summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-17 20:59:24 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-17 20:59:24 +0000
commit7cf0313e7b8672d9757f565fd72c8e7dcf1a8904 (patch)
tree617bc7d0556dc6f6d2e4b5b192211f7bb66fa6e3
parentc81ee12411af5d26bbe4fe413ea7f6728d047ace (diff)
Remove the in-place tag editing code from the default theme. It
should be implemented in the tags module for now, and then possibly generalized out to lib later on.
-rw-r--r--modules/tag/views/admin_tags.html.php5
-rw-r--r--themes/admin_default/js/ui.init.js50
2 files changed, 9 insertions, 46 deletions
diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php
index d6472706..484cb759 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<script>
$("document").ready(function() {
- $("#gTagAdmin .tag-name").attr("title", "<?= t("Click to edit this tag") ?>");
+ // $("#gTagAdmin .tag-name").attr("title", "<?= t("Click to edit this tag") ?>");
$("#gTagAdmin .delete-link").attr("title", $(".delete-link:first span").html());
});
</script>
@@ -40,7 +40,8 @@
<li>
<span id="gTag-<?= $tag->id ?>" class="gEditable tag-name"><?= $tag->name ?></span>
<span class="understate">(<?= $tag->count ?>)</span>
- <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>" class="gDialogLink delete-link gButtonLink">
+ <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>"
+ class="gDialogLink delete-link gButtonLink">
<span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
</li>
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js
index d0406b39..fe8a76ac 100644
--- a/themes/admin_default/js/ui.init.js
+++ b/themes/admin_default/js/ui.init.js
@@ -52,55 +52,17 @@ $(document).ready(function(){
// Add drop shadows
$(".gSelected").dropShadow();
- // In-place editing for tag admin
- $(".gEditable").bind("click", editInplace);
-
// Add hover state for buttons
$(".ui-state-default").hover(
- function(){
- $(this).addClass("ui-state-hover");
- },
- function(){
- $(this).removeClass("ui-state-hover");
- }
+ function() {
+ $(this).addClass("ui-state-hover");
+ },
+ function() {
+ $(this).removeClass("ui-state-hover");
+ }
);
-
});
-function closeEditInPlaceForms() {
- // closes currently open inplace edit forms
- if ($("#gRenameTagForm").length) {
- var li = $("#gRenameTagForm").parent();
- $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert"));
- li.height("");
- $(".gEditable", li).bind("click", editInplace);
- $(".gDialogLink", li).bind("click", handleDialogEvent);
- }
-}
-
-function editInplace(element){
- closeEditInPlaceForms();
-
- // creat edit form
- var tag_id = $(this).attr('id').substr(5);
- var tag_name = $(this).text();
- var tag_width = $(this).width();
- $(this).parent().data("revert", $(this).parent().html());
- var form = '<form id="gRenameTagForm" method="post" action="/gallery3/index.php/admin/tags/rename/' + tag_id + '">';
- form += '<input id="name" name="name" type="text" class="textbox" value="' + tag_name + '" />';
- form += '<input type="submit" class="submit" value="Save" />';
- form += '<span>or</span> <a href="#">cancel</a>';
- form += '</form>';
-
- // add edit form
- $(this).parent().html(form);
- $("#gRenameTagForm #name")
- .width(tag_width+30)
- .focus();
- $("#gRenameTagForm").parent().height('1.6em');
- $("#gRenameTagForm a").bind("click", closeEditInPlaceForms);
-}
-
function handlePanelEvent(event) {
togglePanel(event.currentTarget);
event.preventDefault();