diff options
Diffstat (limited to 'modules/tag')
| -rw-r--r-- | modules/tag/helpers/tag.php | 6 | ||||
| -rw-r--r-- | modules/tag/helpers/tag_block.php | 2 | ||||
| -rw-r--r-- | modules/tag/js/tag.js | 38 | ||||
| -rw-r--r-- | modules/tag/views/admin_tags.html.php | 14 | ||||
| -rw-r--r-- | modules/tag/views/tag_block.html.php | 10 |
5 files changed, 35 insertions, 35 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index be5461a4..d4278802 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -98,7 +98,7 @@ class tag_Core { } static function get_add_form($item) { - $form = new Forge("tags", "", "post", array("id" => "gAddTagForm")); + $form = new Forge("tags", "", "post", array("id" => "g-add-tag-form")); $label = $item->is_album() ? t("Add tag to album") : ($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie")); @@ -111,7 +111,7 @@ class tag_Core { } static function get_rename_form($tag) { - $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "gRenameTagForm")); + $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "g-rename-tag-form")); $group = $form->group("rename_tag")->label(t("Rename Tag")); $group->input("name")->label(t("Tag name"))->value($tag->name)->rules("required|length[1,64]"); $group->inputs["name"]->error_messages("in_use", t("There is already a tag with that name")); @@ -120,7 +120,7 @@ class tag_Core { } static function get_delete_form($tag) { - $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "gDeleteTagForm")); + $form = new Forge("admin/tags/delete/$tag->id", "", "post", array("id" => "g-delete-tag-form")); $group = $form->group("delete_tag") ->label(t("Really delete tag %tag_name?", array("tag_name" => $tag->name))); $group->submit("")->value(t("Delete Tag")); diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php index bbcc5fd1..37da0b16 100644 --- a/modules/tag/helpers/tag_block.php +++ b/modules/tag/helpers/tag_block.php @@ -27,7 +27,7 @@ class tag_block_Core { switch ($block_id) { case "tag": $block = new Block(); - $block->css_id = "gTag"; + $block->css_id = "g-tag"; $block->title = t("Popular Tags"); $block->content = new View("tag_block.html"); $block->content->cloud = tag::cloud(30); diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index bc2331c9..e2e6b782 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -3,28 +3,28 @@ $("document").ready(function() { }); function ajaxify_tag_form() { - $("#gTag form").ajaxForm({ + $("#g-tag form").ajaxForm({ dataType: "json", success: function(data) { if (data.result == "success") { - $.get($("#gTagCloud").attr("title"), function(data, textStatus) { - $("#gTagCloud").html(data); + $.get($("#g-tag-cloud").attr("title"), function(data, textStatus) { + $("#g-tag-cloud").html(data); }); } - $("#gTag form").resetForm(); + $("#g-tag form").resetForm(); } }); } function closeEditInPlaceForms() { // closes currently open inplace edit forms - if ($("#gRenameTagForm").length) { - $("#gEditErrorMessage").remove(); - var li = $("#gRenameTagForm").parent(); - $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); + if ($("#g-rename-tag-form").length) { + $("#g-edit-error-message").remove(); + var li = $("#g-rename-tag-form").parent(); + $("#g-rename-tag-form").parent().html($("#g-rename-tag-form").parent().data("revert")); li.height(""); - $(".gEditable", li).bind("click", editInPlace); - $(".g-dialogLink", li).gallery_dialog(); + $(".g-editable", li).bind("click", editInPlace); + $(".g-dialog-link", li).gallery_dialog(); } } @@ -41,7 +41,7 @@ function editInPlace(element) { var tag_name = $(this).html(); var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); - var form = '<form id="gRenameTagForm" method="post" class="ui-helper-clearfix" '; + var form = '<form id="g-rename-tag-form" method="post" class="ui-helper-clearfix" '; form += 'action="' + TAG_RENAME_URL.replace('__ID__', tag_id) + '">'; form += '<input name="csrf" type="hidden" value="' + csrf_token + '" />'; form += '<input id="name" name="name" type="text" class="textbox" value="' + @@ -52,26 +52,26 @@ function editInPlace(element) { // add edit form $(this).parent().html(form); - $("#gRenameTagForm #name") + $("#g-rename-tag-form #name") .width(tag_width+30) .focus(); - //$("#gRenameTagForm").parent().height( $("#gRenameTagForm").height() ); - $("#gRenameTagForm a").bind("click", closeEditInPlaceForms); + //$("#g-rename-tag-form").parent().height( $("#g-rename-tag-form").height() ); + $("#g-rename-tag-form a").bind("click", closeEditInPlaceForms); ajaxify_editInPlaceForm = function() { - $("#gRenameTagForm").ajaxForm({ + $("#g-rename-tag-form").ajaxForm({ dataType: "json", success: function(data) { if (data.result == "success") { closeEditInPlaceForms(); // close form - $("#gTag-" + data.tag_id).text(data.new_tagname); // update tagname + $("#g-tag-" + data.tag_id).text(data.new_tagname); // update tagname console.log(data); window.location.reload(); } else if (data.result == "error") { - $("#gRenameTagForm #name") - .addClass("gError") + $("#g-rename-tag-form #name") + .addClass("g-error") .focus(); - $("#gTagAdmin").before("<p id=\"gEditErrorMessage\" class=\"gError\">" + data.message + "</p>"); + $("#g-tag-admin").before("<p id=\"g-edit-error-message\" class=\"g-error\">" + data.message + "</p>"); } } }); diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index a4bd5d8f..27813a91 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -3,18 +3,18 @@ var TAG_RENAME_URL = <?= html::js_string(url::site("admin/tags/rename/__ID__")) ?>; $("document").ready(function() { // using JS for adding link titles to avoid running t() for each tag - $("#gTagAdmin .tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>); - $("#gTagAdmin .delete-link").attr("title", $(".delete-link:first span").html()); + $("#g-tag-admin .tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>); + $("#g-tag-admin .delete-link").attr("title", $(".delete-link:first span").html()); // In-place editing for tag admin - $(".gEditable").bind("click", editInPlace); + $(".g-editable").bind("click", editInPlace); }); // make some values available within tag.js var csrf_token = "<?= $csrf ?>"; var save_i18n = <?= html::js_string(t("save")->for_html_attr()) ?>; var cancel_i18n = <?= html::js_string(t("cancel")->for_html_attr()) ?>; </script> -<div class="gBlock"> +<div class="g-block"> <h2> <?= t("Tag Admin") ?> </h2> @@ -22,7 +22,7 @@ <? $tags_per_column = $tags->count()/5 ?> <? $column_tag_count = 0 ?> - <table id="gTagAdmin" class="gBlockContent"> + <table id="g-tag-admin" class="g-block-content"> <caption class="g-understate"> <?= t2("There is one tag", "There are %count tags", $tags->count()) ?> </caption> @@ -47,10 +47,10 @@ <? endif ?> <li> - <span id="gTag-<?= $tag->id ?>" class="gEditable tag-name"><?= html::clean($tag->name) ?></span> + <span id="g-tag-<?= $tag->id ?>" class="g-editable tag-name"><?= html::clean($tag->name) ?></span> <span class="g-understate">(<?= $tag->count ?>)</span> <a href="<?= url::site("admin/tags/form_delete/$tag->id") ?>" - class="g-dialogLink delete-link g-button"> + class="g-dialog-link delete-link g-button"> <span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a> </li> diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index 59a4ef88..8c79b74a 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -1,8 +1,8 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<script> - $("#gAddTagForm").ready(function() { - var url = $("#gTagCloud").attr("title") + "/autocomplete"; - $("#gAddTagForm input:text").autocomplete( +<script language="text/javascript"> + $("#g-add-tag-form").ready(function() { + var url = $("#g-tag-cloud").attr("title") + "/autocomplete"; + $("#g-add-tag-form input:text").autocomplete( url, { max: 30, multiple: true, @@ -11,7 +11,7 @@ ); }); </script> -<div id="gTagCloud" title="<?= url::site("tags") ?>"> +<div id="g-tag-cloud" title="<?= url::site("tags") ?>"> <?= $cloud ?> </div> <?= $form ?>
\ No newline at end of file |
