summaryrefslogtreecommitdiff
path: root/core/js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js')
-rw-r--r--core/js/quick.js58
-rw-r--r--core/js/quickedit.js58
2 files changed, 58 insertions, 58 deletions
diff --git a/core/js/quick.js b/core/js/quick.js
new file mode 100644
index 00000000..858ba3f2
--- /dev/null
+++ b/core/js/quick.js
@@ -0,0 +1,58 @@
+$(document).ready(function() {
+ $(".gQuick").hover(show_quick, function() {});
+});
+
+var show_quick = function() {
+ var quick = $(this);
+ $("#gQuickPane").remove();
+ quick.append("<div id=\"gQuickPane\"></div>");
+ var img = quick.find("img");
+ var pos = img.position();
+ $("#gQuickPane").css({
+ "position": "absolute",
+ "top": pos.top,
+ "left": pos.left,
+ "width": img.innerWidth() + 1,
+ "height": 32
+ });
+ quick.hover(function() { }, hide_quick);
+ $.get(
+ quick.attr("quick_link"),
+ {},
+ function(data, textStatus) {
+ $("#gQuickPane").html(data);
+ $("#gQuickPane div").click(function() {
+ quick_do(quick, $(this), img);
+ });
+ }
+ );
+};
+
+var quick_do = function(quick, pane, img) {
+ img.css("opacity", "0.2");
+ quick.addClass("gLoadingLarge");
+ $.ajax({
+ type: "GET",
+ url: pane.attr("quick_link"),
+ dataType: "json",
+ success: function(data) {
+ img.css("opacity", "1");
+ img.attr("width", data.width);
+ img.attr("height", data.height);
+ img.attr("src", data.src);
+ var pos = img.position();
+ quick.removeClass("gLoadingLarge");
+ $("#gQuickPane").css({
+ "position": "absolute",
+ "top": pos.top,
+ "left": pos.left,
+ "width": img.innerWidth() + 1,
+ "height": 32
+ });
+ }
+ });
+};
+
+var hide_quick = function() {
+ $("#gQuickPane").remove();
+};
diff --git a/core/js/quickedit.js b/core/js/quickedit.js
deleted file mode 100644
index 307a5f3a..00000000
--- a/core/js/quickedit.js
+++ /dev/null
@@ -1,58 +0,0 @@
-$(document).ready(function() {
- $(".gQuickEdit").hover(show_quickedit, function() {});
-});
-
-var show_quickedit = function() {
- var quick_edit = $(this);
- $("#gQuickEditPane").remove();
- quick_edit.append("<div id=\"gQuickEditPane\"></div>");
- var img = quick_edit.find("img");
- var pos = img.position();
- $("#gQuickEditPane").css({
- "position": "absolute",
- "top": pos.top,
- "left": pos.left,
- "width": img.innerWidth() + 1,
- "height": 32
- });
- quick_edit.hover(function() { }, hide_quickedit);
- $.get(
- quick_edit.attr("quickedit_link"),
- {},
- function(data, textStatus) {
- $("#gQuickEditPane").html(data);
- $("#gQuickEditPane div").click(function() {
- quickedit(quick_edit, $(this), img);
- });
- }
- );
-};
-
-var quickedit = function(quick_edit, pane, img) {
- img.css("opacity", "0.2");
- quick_edit.addClass("gLoadingLarge");
- $.ajax({
- type: "GET",
- url: pane.attr("quickedit_link"),
- dataType: "json",
- success: function(data) {
- img.css("opacity", "1");
- img.attr("width", data.width);
- img.attr("height", data.height);
- img.attr("src", data.src);
- var pos = img.position();
- quick_edit.removeClass("gLoadingLarge");
- $("#gQuickEditPane").css({
- "position": "absolute",
- "top": pos.top,
- "left": pos.left,
- "width": img.innerWidth() + 1,
- "height": 32
- });
- }
- });
-};
-
-var hide_quickedit = function() {
- $("#gQuickEditPane").remove();
-};