From 99804a34b2440589e91d5fe06f8b39b44d6561f2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 4 Jan 2009 19:54:38 +0000 Subject: Rename: gQuickEdit to gQuick quick_edit -> quick --- core/css/quick.css | 45 ++++++++++++++++++++++++++++++++ core/css/quickedit.css | 45 -------------------------------- core/helpers/core_block.php | 6 ++--- core/js/quick.js | 58 ++++++++++++++++++++++++++++++++++++++++++ core/js/quickedit.js | 58 ------------------------------------------ core/views/quick_edit.html.php | 4 +-- 6 files changed, 108 insertions(+), 108 deletions(-) create mode 100644 core/css/quick.css delete mode 100644 core/css/quickedit.css create mode 100644 core/js/quick.js delete mode 100644 core/js/quickedit.js (limited to 'core') diff --git a/core/css/quick.css b/core/css/quick.css new file mode 100644 index 00000000..ab8c5437 --- /dev/null +++ b/core/css/quick.css @@ -0,0 +1,45 @@ +.gQuick { + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +#gQuickPane { + background: #fff; + opacity: 0.8; + border-bottom: 1px dashed #000; +} + +#gQuickPane div { + background-color: red; + float: right; + display: inline; + cursor: pointer; + margin: 8px; +} + +#gQuickPane .rotate-clockwise { + background: url('../images/arrow_rotate_clockwise.png'); + width: 16px; + height: 16px; + position: absolute; + top: 0px; + right: 0px; +} + +#gQuickPane .rotate-clockwise span { + display: none; +} + +#gQuickPane .rotate-counter-clockwise { + background: url('../images/arrow_rotate_anticlockwise.png'); + width: 16px; + height: 16px; + position: absolute; + top: 0px; + left: 0px; +} + +#gQuickPane .rotate-counter-clockwise span { + display: none; +} diff --git a/core/css/quickedit.css b/core/css/quickedit.css deleted file mode 100644 index 62cd0cb6..00000000 --- a/core/css/quickedit.css +++ /dev/null @@ -1,45 +0,0 @@ -.gQuickEdit { - margin: 0 !important; - padding: 0 !important; - border: none !important; -} - -#gQuickEditPane { - background: #fff; - opacity: 0.8; - border-bottom: 1px dashed #000; -} - -#gQuickEditPane div { - background-color: red; - float: right; - display: inline; - cursor: pointer; - margin: 8px; -} - -#gQuickEditPane .rotate-clockwise { - background: url('../images/arrow_rotate_clockwise.png'); - width: 16px; - height: 16px; - position: absolute; - top: 0px; - right: 0px; -} - -#gQuickEditPane .rotate-clockwise span { - display: none; -} - -#gQuickEditPane .rotate-counter-clockwise { - background: url('../images/arrow_rotate_anticlockwise.png'); - width: 16px; - height: 16px; - position: absolute; - top: 0px; - left: 0px; -} - -#gQuickEditPane .rotate-counter-clockwise span { - display: none; -} diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php index 8ce0c8ca..0976c37a 100644 --- a/core/helpers/core_block.php +++ b/core/helpers/core_block.php @@ -27,8 +27,8 @@ class core_block_Core { } if ($theme->page_type == "album" && access::can("edit", $theme->item())) { $buf .= ""; - $buf .= html::script("core/js/quickedit.js"); + url::file("core/css/quick.css") . "\" />"; + $buf .= html::script("core/js/quick.js"); } return $buf; } @@ -36,7 +36,7 @@ class core_block_Core { public static function thumb_top($theme, $child) { if ($child->type == "photo" && access::can("edit", $child)) { $edit_link = url::site("quick/edit/$child->id"); - return "
"; + return "
"; } } 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("
"); + 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("
"); - 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(); -}; diff --git a/core/views/quick_edit.html.php b/core/views/quick_edit.html.php index a7df97f1..940c5c2a 100644 --- a/core/views/quick_edit.html.php +++ b/core/views/quick_edit.html.php @@ -1,13 +1,13 @@ type == "photo"): ?>
id/ccw?csrf=" . access::csrf_token()) ?>"> + quick_link="id/ccw?csrf=" . access::csrf_token()) ?>">
id/cw?csrf=" . access::csrf_token()) ?>"> + quick_link="id/cw?csrf=" . access::csrf_token()) ?>"> -- cgit v1.2.3