summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tag/helpers/tag.php2
-rw-r--r--modules/tag/helpers/tag_theme.php1
-rw-r--r--modules/tag/js/tag.js22
-rw-r--r--modules/tag/views/admin_tags.html.php8
4 files changed, 17 insertions, 16 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index a2104e9d..b1d79458 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -111,7 +111,7 @@ class tag_Core {
}
static function get_rename_form($tag) {
- $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "g-rename-tag-form"));
+ $form = new Forge("admin/tags/rename/$tag->id", "", "post", array("id" => "g-edit-tag-form", "class" => "g-short-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"));
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index 4f22d2ac..e3743824 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -21,6 +21,7 @@ class tag_theme_Core {
static function head($theme) {
$theme->css("jquery.autocomplete.css");
$theme->script("jquery.autocomplete.js");
+ $theme->css("tag.css");
$theme->script("tag.js");
}
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
index e2e6b782..17845272 100644
--- a/modules/tag/js/tag.js
+++ b/modules/tag/js/tag.js
@@ -8,8 +8,8 @@ function ajaxify_tag_form() {
success: function(data) {
if (data.result == "success") {
$.get($("#g-tag-cloud").attr("title"), function(data, textStatus) {
- $("#g-tag-cloud").html(data);
- });
+ $("#g-tag-cloud").html(data);
+ });
}
$("#g-tag form").resetForm();
}
@@ -18,10 +18,10 @@ function ajaxify_tag_form() {
function closeEditInPlaceForms() {
// closes currently open inplace edit forms
- if ($("#g-rename-tag-form").length) {
+ if ($("#g-edit-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"));
+ var li = $("#g-edit-tag-form").parent();
+ $("#g-edit-tag-form").parent().html($("#g-edit-tag-form").parent().data("revert"));
li.height("");
$(".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="g-rename-tag-form" method="post" class="ui-helper-clearfix" ';
+ var form = '<form id="g-edit-tag-form" method="post" class="g-inline 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,14 +52,14 @@ function editInPlace(element) {
// add edit form
$(this).parent().html(form);
- $("#g-rename-tag-form #name")
+ $("#g-edit-tag-form #name")
.width(tag_width+30)
.focus();
- //$("#g-rename-tag-form").parent().height( $("#g-rename-tag-form").height() );
- $("#g-rename-tag-form a").bind("click", closeEditInPlaceForms);
+ //$("#g-edit-tag-form").parent().height( $("#g-edit-tag-form").height() );
+ $("#g-edit-tag-form a").bind("click", closeEditInPlaceForms);
ajaxify_editInPlaceForm = function() {
- $("#g-rename-tag-form").ajaxForm({
+ $("#g-edit-tag-form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.result == "success") {
@@ -68,7 +68,7 @@ function editInPlace(element) {
console.log(data);
window.location.reload();
} else if (data.result == "error") {
- $("#g-rename-tag-form #name")
+ $("#g-edit-tag-form #name")
.addClass("g-error")
.focus();
$("#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 27813a91..edc466bb 100644
--- a/modules/tag/views/admin_tags.html.php
+++ b/modules/tag/views/admin_tags.html.php
@@ -3,8 +3,8 @@
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
- $("#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());
+ $("#g-tag-admin .g-tag-name").attr("title", <?= t("Click to edit this tag")->for_js() ?>);
+ $("#g-tag-admin .g-delete-link").attr("title", $(".g-delete-link:first span").html());
// In-place editing for tag admin
$(".g-editable").bind("click", editInPlace);
@@ -47,10 +47,10 @@
<? endif ?>
<li>
- <span id="g-tag-<?= $tag->id ?>" class="g-editable tag-name"><?= html::clean($tag->name) ?></span>
+ <span id="g-tag-<?= $tag->id ?>" class="g-editable g-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-dialog-link delete-link g-button">
+ class="g-dialog-link g-delete-link g-button">
<span class="ui-icon ui-icon-trash"><?= t("Delete this tag") ?></span></a>
</li>