From 30d8c7d1272e0c0cb6c20fddf69af42dd4a706f4 Mon Sep 17 00:00:00 2001
From: prashantsinalkar
Date: Thu, 1 Sep 2016 14:38:29 +0530
Subject: changed css and js
---
js/scilab_fixer.js | 200 -----------------------------------------------------
1 file changed, 200 deletions(-)
delete mode 100755 js/scilab_fixer.js
(limited to 'js')
diff --git a/js/scilab_fixer.js b/js/scilab_fixer.js
deleted file mode 100755
index 657cb61..0000000
--- a/js/scilab_fixer.js
+++ /dev/null
@@ -1,200 +0,0 @@
-$(document).ready(function() {
- var basePath = Drupal.settings.basePath;
- var modPath = basePath + "fix/";
- var modPath1 = basePath + "fix/aicte/book/";
-
-
-
- $category = $("#fix-tbc-form #edit-category");
- $book = $("#fix-tbc-form #edit-book");
- $chapter = $("#fix-tbc-form #edit-chapter");
- $example = $("#fix-tbc-form #edit-example");
- $caption = $("#fix-tbc-form #edit-caption");
- $code = $("#fix-tbc-form #edit-code");
- $caption_form = $("#scilab-fixer-caption-form");
- $code_form = $("#scilab-fixer-code-form");
- $updating = $("#fix-tbc-page #updating");
- $done = $("#fix-tbc-page #done");
- $example.attr("multiple", "enabled");
-
- function reset() {
- for (var i = 0, l = arguments.length; i < l; i ++) {
- switch(arguments[i]) {
- case "book":
- $book.html("");
- break;
-
- case "chapter":
- $chapter.html("");
- break;
-
- case "example":
- $example.html("");
- break;
-
- case "caption":
- $caption.val("");
- break;
-
- }
- }
- }
-
- $category.change(function() {
- reset("book", "chapter", "example", "caption");
- var category_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/category/" + category_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $book.html(data);
- }
- });
- });
-
- $book.change(function() {
- reset("chapter", "example", "caption");
- var book_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/book/" + book_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $chapter.html(data);
- }
- });
- });
-
- $chapter.change(function() {
- reset("example", "caption");
- var chapter_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/chapter/" + chapter_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $example.html(data);
- }
- });
- });
-
- $example.change(function() {
- var example_id = $(this).val();
- reset("caption");
- console.log("########" + example_id);
- $.ajax({
- url: modPath + "ajax/example/" + example_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- var code = $(data).filter("#code").html();
- /* checking whether it is for .well or textarea */
- if($code.hasClass("fix-caption-code")) {
- $code.html(code);
- } else {
- $code.val(code);
- }
- var caption = $(data).filter("#caption").html();
- try {
- $caption.val(caption);
- } catch(e) {
- return;
- }
- }
- });
- });
-
- $caption_form.submit(function(e) {
- var example_id = $example.val();
- if(example_id != "0") {
- var caption = $caption.val();
- $updating.show();
- $.ajax({
- url: modPath + "ajax/update/",
- type: "POST",
- data: {
- example_id: example_id,
- caption: caption
- },
- dataType: "html",
- success: function(data) {
- $chapter.trigger("change");
- $updating.hide();
- $done.show();
- $done.fadeOut("slow");
- }
- });
- } else {
- alert("No example selected.")
- }
- e.preventDefault();
- });
-
- $code_form.submit(function(e) {
- var example_id = $example.val();
- if(example_id != "0") {
- var code = $code.val();
- $.ajax({
- url: modPath + "ajax/code/" + example_id,
- type: "POST",
- data: {
- code: code
- },
- dataType: "html",
- success: function(data) {
- $chapter.trigger("change");
- $updating.hide();
- $done.show();
- $done.fadeOut("slow");
- }
- });
- } else {
- alert("No example selected.")
- }
- e.preventDefault();
- });
-
-$Selected = $(".selected");
- $Selected.click(function (e) {
- $(".sync-msg").remove();
- $(this).after("Saving...");
- $.ajax({
- url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
- success: function() {
- $(".sync-msg").remove();
- console.log ("success");
- }
- });
-
- });
-
- /* toggle in edition */
- $ind_ed = $(".ind-ed");
-
- $ind_ed.click(function(e) {
- var aicte_id = $(this).attr("data-aicte");
- $t = $(this);
- $.ajax({
- url: modPath + "ajax/ind-ed/" + aicte_id,
- type: "GET",
- dataType: "html",
- success: function(data) {
- $tr = $t.parents("tr:first");
- if($tr.hasClass("orange")) {
- $t.parents("tr:first").removeClass("orange");
- $t.html("Mark");
- } else {
- $t.parents("tr:first").addClass("orange");
- $t.html("Unmark");
- }
- console.log(data);
- },
- });
- e.preventDefault();
- });
-
-});
--
cgit
From 090b633219c93987626ad08d37011403b056b8cf Mon Sep 17 00:00:00 2001
From: prashantsinalkar
Date: Thu, 1 Sep 2016 14:39:48 +0530
Subject: added renamed files
---
js/textbook_companion_fixer.js | 202 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 202 insertions(+)
create mode 100755 js/textbook_companion_fixer.js
(limited to 'js')
diff --git a/js/textbook_companion_fixer.js b/js/textbook_companion_fixer.js
new file mode 100755
index 0000000..7a7e3fe
--- /dev/null
+++ b/js/textbook_companion_fixer.js
@@ -0,0 +1,202 @@
+(function ($) {
+$(document).ready(function() {
+ var basePath = Drupal.settings.basePath;
+ var modPath = basePath + "fix/";
+ var modPath1 = basePath + "fix/aicte/book/";
+
+
+
+ $category = $("#fix-tbc-form #edit-category");
+ $book = $("#fix-tbc-form #edit-book");
+ $chapter = $("#fix-tbc-form #edit-chapter");
+ $example = $("#fix-tbc-form #edit-example");
+ $caption = $("#fix-tbc-form #edit-caption");
+ $code = $("#fix-tbc-form #edit-code");
+ $caption_form = $("#scilab-fixer-caption-form");
+ $code_form = $("#scilab-fixer-code-form");
+ $updating = $("#fix-tbc-page #updating");
+ $done = $("#fix-tbc-page #done");
+ $example.attr("multiple", "enabled");
+
+ function reset() {
+ for (var i = 0, l = arguments.length; i < l; i ++) {
+ switch(arguments[i]) {
+ case "book":
+ $book.html("");
+ break;
+
+ case "chapter":
+ $chapter.html("");
+ break;
+
+ case "example":
+ $example.html("");
+ break;
+
+ case "caption":
+ $caption.val("");
+ break;
+
+ }
+ }
+ }
+
+ $category.change(function() {
+ reset("book", "chapter", "example", "caption");
+ var category_id = $(this).val();
+
+ $.ajax({
+ url: modPath + "ajax/category/" + category_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $book.html(data);
+ }
+ });
+ });
+
+ $book.change(function() {
+ reset("chapter", "example", "caption");
+ var book_id = $(this).val();
+
+ $.ajax({
+ url: modPath + "ajax/book/" + book_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $chapter.html(data);
+ }
+ });
+ });
+
+ $chapter.change(function() {
+ reset("example", "caption");
+ var chapter_id = $(this).val();
+
+ $.ajax({
+ url: modPath + "ajax/chapter/" + chapter_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $example.html(data);
+ }
+ });
+ });
+
+ $example.change(function() {
+ var example_id = $(this).val();
+ reset("caption");
+ console.log("########" + example_id);
+ $.ajax({
+ url: modPath + "ajax/example/" + example_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ var code = $(data).filter("#code").html();
+ /* checking whether it is for .well or textarea */
+ if($code.hasClass("fix-caption-code")) {
+ $code.html(code);
+ } else {
+ $code.val(code);
+ }
+ var caption = $(data).filter("#caption").html();
+ try {
+ $caption.val(caption);
+ } catch(e) {
+ return;
+ }
+ }
+ });
+ });
+
+ $caption_form.submit(function(e) {
+ var example_id = $example.val();
+ if(example_id != "0") {
+ var caption = $caption.val();
+ $updating.show();
+ $.ajax({
+ url: modPath + "ajax/update/",
+ type: "POST",
+ data: {
+ example_id: example_id,
+ caption: caption
+ },
+ dataType: "html",
+ success: function(data) {
+ $chapter.trigger("change");
+ $updating.hide();
+ $done.show();
+ $done.fadeOut("slow");
+ }
+ });
+ } else {
+ alert("No example selected.")
+ }
+ e.preventDefault();
+ });
+
+ $code_form.submit(function(e) {
+ var example_id = $example.val();
+ if(example_id != "0") {
+ var code = $code.val();
+ $.ajax({
+ url: modPath + "ajax/code/" + example_id,
+ type: "POST",
+ data: {
+ code: code
+ },
+ dataType: "html",
+ success: function(data) {
+ $chapter.trigger("change");
+ $updating.hide();
+ $done.show();
+ $done.fadeOut("slow");
+ }
+ });
+ } else {
+ alert("No example selected.")
+ }
+ e.preventDefault();
+ });
+
+$Selected = $(".selected");
+ $Selected.click(function (e) {
+ $(".sync-msg").remove();
+ $(this).after("Saving...");
+ $.ajax({
+ url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
+ success: function() {
+ $(".sync-msg").remove();
+ console.log ("success");
+ }
+ });
+
+ });
+
+ /* toggle in edition */
+ $ind_ed = $(".ind-ed");
+
+ $ind_ed.click(function(e) {
+ var aicte_id = $(this).attr("data-aicte");
+ $t = $(this);
+ $.ajax({
+ url: modPath + "ajax/ind-ed/" + aicte_id,
+ type: "GET",
+ dataType: "html",
+ success: function(data) {
+ $tr = $t.parents("tr:first");
+ if($tr.hasClass("orange")) {
+ $t.parents("tr:first").removeClass("orange");
+ $t.html("Mark");
+ } else {
+ $t.parents("tr:first").addClass("orange");
+ $t.html("Unmark");
+ }
+ console.log(data);
+ },
+ });
+ e.preventDefault();
+ });
+
+});
+})(jQuery);
--
cgit
From a510e9c9d287e755a58fc3bd719cc02aa3c62834 Mon Sep 17 00:00:00 2001
From: prashantsinalkar
Date: Tue, 6 Sep 2016 15:54:48 +0530
Subject: fixed dropdown issue and formated the code
---
js/textbook_companion_fixer.js | 453 +++++++++++++++++++++++------------------
1 file changed, 253 insertions(+), 200 deletions(-)
(limited to 'js')
diff --git a/js/textbook_companion_fixer.js b/js/textbook_companion_fixer.js
index 7a7e3fe..0ad82ad 100755
--- a/js/textbook_companion_fixer.js
+++ b/js/textbook_companion_fixer.js
@@ -1,202 +1,255 @@
-(function ($) {
-$(document).ready(function() {
- var basePath = Drupal.settings.basePath;
- var modPath = basePath + "fix/";
- var modPath1 = basePath + "fix/aicte/book/";
+(function($) {
+ $(document).ready(function() {
+ var basePath = Drupal.settings.basePath;
+ var modPath = basePath + "textbook_companion_fixer/";
+ var modPath1 = basePath + "textbook_companion_fixer/aicte/book/";
+ $category = $("#fix-tbc-form #edit-category");
+ $book = $("#fix-tbc-form #edit-book");
+ $chapter = $("#fix-tbc-form #edit-chapter");
+ $example = $("#fix-tbc-form #edit-example");
+ $caption = $("#fix-tbc-form #edit-caption");
+ $code = $("#fix-tbc-form #edit-code");
+ $caption_form = $("#scilab-fixer-caption-form");
+ $code_form = $("#scilab-fixer-code-form");
+ $updating = $("#fix-tbc-page #updating");
+ $done = $("#fix-tbc-page #done");
+ $example.attr("multiple", "enabled");
-
-
- $category = $("#fix-tbc-form #edit-category");
- $book = $("#fix-tbc-form #edit-book");
- $chapter = $("#fix-tbc-form #edit-chapter");
- $example = $("#fix-tbc-form #edit-example");
- $caption = $("#fix-tbc-form #edit-caption");
- $code = $("#fix-tbc-form #edit-code");
- $caption_form = $("#scilab-fixer-caption-form");
- $code_form = $("#scilab-fixer-code-form");
- $updating = $("#fix-tbc-page #updating");
- $done = $("#fix-tbc-page #done");
- $example.attr("multiple", "enabled");
-
- function reset() {
- for (var i = 0, l = arguments.length; i < l; i ++) {
- switch(arguments[i]) {
- case "book":
- $book.html("");
- break;
-
- case "chapter":
- $chapter.html("");
- break;
-
- case "example":
- $example.html("");
- break;
-
- case "caption":
- $caption.val("");
- break;
-
- }
- }
- }
-
- $category.change(function() {
- reset("book", "chapter", "example", "caption");
- var category_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/category/" + category_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $book.html(data);
- }
- });
- });
-
- $book.change(function() {
- reset("chapter", "example", "caption");
- var book_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/book/" + book_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $chapter.html(data);
- }
- });
- });
-
- $chapter.change(function() {
- reset("example", "caption");
- var chapter_id = $(this).val();
-
- $.ajax({
- url: modPath + "ajax/chapter/" + chapter_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- $example.html(data);
- }
- });
- });
-
- $example.change(function() {
- var example_id = $(this).val();
- reset("caption");
- console.log("########" + example_id);
- $.ajax({
- url: modPath + "ajax/example/" + example_id,
- type: "POST",
- dataType: "html",
- success: function(data) {
- var code = $(data).filter("#code").html();
- /* checking whether it is for .well or textarea */
- if($code.hasClass("fix-caption-code")) {
- $code.html(code);
- } else {
- $code.val(code);
- }
- var caption = $(data).filter("#caption").html();
- try {
- $caption.val(caption);
- } catch(e) {
- return;
- }
- }
- });
- });
-
- $caption_form.submit(function(e) {
- var example_id = $example.val();
- if(example_id != "0") {
- var caption = $caption.val();
- $updating.show();
- $.ajax({
- url: modPath + "ajax/update/",
- type: "POST",
- data: {
- example_id: example_id,
- caption: caption
- },
- dataType: "html",
- success: function(data) {
- $chapter.trigger("change");
- $updating.hide();
- $done.show();
- $done.fadeOut("slow");
- }
- });
- } else {
- alert("No example selected.")
- }
- e.preventDefault();
- });
-
- $code_form.submit(function(e) {
- var example_id = $example.val();
- if(example_id != "0") {
- var code = $code.val();
- $.ajax({
- url: modPath + "ajax/code/" + example_id,
- type: "POST",
- data: {
- code: code
- },
- dataType: "html",
- success: function(data) {
- $chapter.trigger("change");
- $updating.hide();
- $done.show();
- $done.fadeOut("slow");
- }
- });
- } else {
- alert("No example selected.")
- }
- e.preventDefault();
- });
-
-$Selected = $(".selected");
- $Selected.click(function (e) {
- $(".sync-msg").remove();
- $(this).after("Saving...");
- $.ajax({
- url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
- success: function() {
- $(".sync-msg").remove();
- console.log ("success");
- }
- });
-
- });
-
- /* toggle in edition */
- $ind_ed = $(".ind-ed");
-
- $ind_ed.click(function(e) {
- var aicte_id = $(this).attr("data-aicte");
- $t = $(this);
- $.ajax({
- url: modPath + "ajax/ind-ed/" + aicte_id,
- type: "GET",
- dataType: "html",
- success: function(data) {
- $tr = $t.parents("tr:first");
- if($tr.hasClass("orange")) {
- $t.parents("tr:first").removeClass("orange");
- $t.html("Mark");
- } else {
- $t.parents("tr:first").addClass("orange");
- $t.html("Unmark");
- }
- console.log(data);
- },
- });
- e.preventDefault();
- });
-
-});
+ function reset() {
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ switch (arguments[i]) {
+ case "book":
+ $book.html("");
+ break;
+ case "chapter":
+ $chapter.html("");
+ break;
+ case "example":
+ $example.html("");
+ break;
+ case "caption":
+ $caption.val("");
+ break;
+ }
+ }
+ }
+ $(".select-book").hide();
+ $(".select-chapter").hide();
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ $category.change(function() {
+ reset("book", "chapter", "example", "caption");
+ var category_id = $(this).val();
+ if (category_id < 1) {
+ $(".select-book").hide();
+ $(".select-chapter").hide();
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ (".well").hide();
+ $(".update-button").hide();
+ } else {
+ $(".select-book").show();
+ $(".select-chapter").hide();
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ }
+ $.ajax({
+ url: modPath + "ajax/category/" + category_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $book.html(data);
+ }
+ });
+ });
+ $book.change(function() {
+ reset("chapter", "example", "caption");
+ var book_id = $(this).val();
+ if (book_id < 1) {
+ $(".select-chapter").hide();
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ } else {
+ $(".select-chapter").show();
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ }
+ $.ajax({
+ url: modPath + "ajax/book/" + book_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $chapter.html(data);
+ }
+ });
+ });
+ $chapter.change(function() {
+ reset("example", "caption");
+ var chapter_id = $(this).val();
+ if (chapter_id < 1) {
+ $(".select-example").hide();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ } else {
+ $(".select-example").show();
+ $(".enter-caption").hide();
+ $(".example-code-edit").hide();
+ $(".update-button").hide();
+ }
+ $.ajax({
+ url: modPath + "ajax/chapter/" + chapter_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ $example.html(data);
+ }
+ });
+ });
+ $example.change(function() {
+ var example_id = $(this).val();
+ var example_caption = $(this).text();
+ reset("caption");
+ if (example_id < 1) {
+ $(".enter-caption").hide();
+ // $("#edit-caption").val("");
+ $(".example-code-edit").hide();
+ $(".well").hide();
+ $(".update-button").hide();
+ } else {
+ $(".enter-caption").show();
+ // $("#edit-caption").val(example_caption);
+ $(".example-code-edit").show();
+ $(".well").show();
+ $(".update-button").show();
+ }
+ $.ajax({
+ url: modPath + "ajax/example/" + example_id,
+ type: "POST",
+ dataType: "html",
+ success: function(data) {
+ var code = $(data).filter("#code").html();
+ /* checking whether it is for .well or textarea */
+ if ($code.hasClass("fix-caption-code")) {
+ $code.html(code);
+ } else {
+ $code.val(code);
+ }
+ var caption = $(data).filter("#caption").html();
+ try {
+ $caption.val(caption);
+ } catch (e) {
+ return;
+ }
+ }
+ });
+ });
+ $caption_form.submit(function(e) {
+ var example_id = $example.val();
+ if (example_id != "0") {
+ var caption = $caption.val();
+ caption = caption.trim();
+ if (caption == '') {
+ alert('Please enter new caption ');
+ return false;
+ }
+ $updating.show();
+ $.ajax({
+ url: modPath + "ajax/update/",
+ type: "POST",
+ data: {
+ example_id: example_id,
+ caption: caption
+ },
+ dataType: "html",
+ success: function(data) {
+ $chapter.trigger("change");
+ $updating.hide();
+ $done.show();
+ $done.fadeOut("slow");
+ }
+ });
+ } else {
+ alert("No example selected.")
+ }
+ e.preventDefault();
+ });
+ $code_form.submit(function(e) {
+ var example_id = $example.val();
+ if (example_id != "0") {
+ var code = $code.val();
+ code = code.trim();
+ if (code == '') {
+ alert('Please enter new code');
+ return false;
+ }
+ $.ajax({
+ url: modPath + "ajax/code/" + example_id,
+ type: "POST",
+ data: {
+ code: code
+ },
+ dataType: "html",
+ success: function(data) {
+ $chapter.trigger("change");
+ $updating.hide();
+ $done.show();
+ $done.fadeOut("slow");
+ $(".example-code-edit").show();
+ }
+ });
+ } else {
+ alert("No example selected.")
+ }
+ e.preventDefault();
+ });
+ $Selected = $(".selected");
+ $Selected.click(function(e) {
+ $(".sync-msg").remove();
+ $(this).after("Saving...");
+ $.ajax({
+ url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
+ success: function() {
+ $(".sync-msg").remove();
+ console.log("success");
+ }
+ });
+ });
+ /* toggle in edition */
+ $ind_ed = $(".ind-ed");
+ $ind_ed.click(function(e) {
+ var aicte_id = $(this).attr("data-aicte");
+ $t = $(this);
+ $.ajax({
+ url: modPath + "ajax/ind-ed/" + aicte_id,
+ type: "GET",
+ dataType: "html",
+ success: function(data) {
+ $tr = $t.parents("tr:first");
+ if ($tr.hasClass("orange")) {
+ $t.parents("tr:first").removeClass("orange");
+ $t.html("Mark");
+ } else {
+ $t.parents("tr:first").addClass("orange");
+ $t.html("Unmark");
+ }
+ },
+ });
+ e.preventDefault();
+ });
+ });
})(jQuery);
--
cgit
From 99b0fe340368e306679060c44979aca5154b52be Mon Sep 17 00:00:00 2001
From: prashantsinalkar
Date: Tue, 6 Sep 2016 15:56:53 +0530
Subject: formated the code
---
js/selection.js | 49 +++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 24 deletions(-)
(limited to 'js')
diff --git a/js/selection.js b/js/selection.js
index 6834aca..639afe5 100755
--- a/js/selection.js
+++ b/js/selection.js
@@ -1,26 +1,27 @@
function getSelectionText(divID) {
- var selectedText = "";
- if (window.getSelection) {
- var sel = window.getSelection();
- var div = document.getElementById(divID);
-
- if (sel.rangeCount) {
- // Get the selected range
- var range = sel.getRangeAt(0);
- // Check that the selection is wholly contained within the div text
- // if (range.commonAncestorContainer == div.firstChild) {
- var selectedText = range.toString();
- // }
- }
- }
- return selectedText;
+ var selectedText = "";
+ if (window.getSelection) {
+ var sel = window.getSelection();
+ var div = document.getElementById(divID);
+ if (sel.rangeCount) {
+ // Get the selected range
+ var range = sel.getRangeAt(0);
+ // Check that the selection is wholly contained within the div text
+ // if (range.commonAncestorContainer == div.firstChild) {
+ var selectedText = range.toString();
+ // }
+ }
+ }
+ return selectedText;
}
-$(document).ready(function() {
- $(".fix-caption-code").mousedown(function() {
- $("#edit-caption").val("");
- });
- $(".fix-caption-code").mouseup(function() {
- quotedText = getSelectionText("#fix-caption-code");
- $("#edit-caption").val(quotedText);
- });
-});
+(function($) {
+ $(document).ready(function() {
+ $(".fix-caption-code").mousedown(function() {
+ $("#edit-caption").val("");
+ });
+ $(".fix-caption-code").mouseup(function() {
+ quotedText = getSelectionText("#fix-caption-code");
+ $("#edit-caption").val(quotedText);
+ });
+ });
+})(jQuery);
--
cgit