Permalink
Browse files

Merge branch 'master' of git@github.com:gallery/gallery3

  • Loading branch information...
2 parents 4116c7b + 3c3671c commit aa65bb0048411cbc657651899fb63f7afe2aa37a @bharat bharat committed Feb 2, 2010
@@ -10,10 +10,10 @@
},
_show: function(target) {
- if ($(this).data("gallery_in_place_edit") == true) {
+ if ($(target).data("gallery_in_place_edit") == true) {
return;
}
- $(this).data("gallery_in_place_edit", true);
+ $(target).data("gallery_in_place_edit", true);
var self = this;
var tag_width = $(target).width();
$(self).data("tag_width", tag_width);
@@ -27,26 +27,28 @@
var parent = $(target).parent();
parent.children().hide();
parent.append(data);
- parent.find("form :text")
- .width(tag_width)
- .focus();
- $(".g-short-form").gallery_short_form();
- parent.find("form .g-cancel").click(function(event) {
- self._cancel();
- event.preventDefault();
- return false;
- });
- self._ajaxify_edit();
+ self._setup_form(parent.find("form"));
});
+ },
+ _setup_form: function(form) {
+ var self = this;
+ var width = $(self).data("tag_width");
+ form.find(":text").width(width).focus();
+ form.find(".g-cancel").click(function(event) {
+ self._cancel();
+ event.preventDefault();
+ return false;
+ });
+ $(".g-short-form").gallery_short_form();
+ this._ajaxify_edit();
},
_cancel: function() {
var parent = $("#g-in-place-edit-form").parent();
- $(parent).find("form").remove();
+ $("#g-in-place-edit-form").remove();
$(parent).children().show();
- $("#g-in-place-edit-message").remove();
- $(this).data("gallery_in_place_edit", false);
+ $(parent).find(".g-editable").data("gallery_in_place_edit", false);
},
_ajaxify_edit: function() {
@@ -60,17 +62,7 @@
} else {
var parent = $(form).parent();
$(form).replaceWith(data.form);
- var width = $(self).data("tag_width");
- $(parent).find("form :text")
- .width(width)
- .focus();
- $(".g-short-form").gallery_short_form();
- $(parent).find("form .g-cancel").click(function(event) {
- self._cancel();
- event.preventDefault();
- return false;
- });
- self._ajaxify_edit();
+ self._setup_form(parent.find("form"));
}
}
});
@@ -189,7 +189,7 @@ static function import($task) {
}
$task->status = t(
"Album highlights (%count of %total)",
- array("count" => $done["tags"] + 1, "total" => $stats["albums"]));
+ array("count" => $done["highlights"] + 1, "total" => $stats["highlights"]));
break;
@@ -45,7 +45,6 @@
display:block;
position:absolute; right:0em;
height:2em; line-height:2em;
- text-transform:uppercase;
text-align:center; background:#000;
}
#l10n-client-toggler a {
@@ -62,7 +61,7 @@
height:1em; line-height:1em;
padding: .5em; margin:0px;
font-size:1em;
- text-transform:uppercase;}
+}
#l10n-client .strings h2 {
border:0px;}
@@ -25,10 +25,10 @@
<a href="<?= url::site("admin/advanced_settings/edit/$var->module_name/" . html::clean($var->name)) ?>"
class="g-dialog-link"
title="<?= t("Edit %var (%module_name)", array("var" => $var->name, "module_name" => $var->module_name))->for_html_attr() ?>">
- <? if (isset($var->value)): ?>
- <?= html::clean($var->value) ?>
- <? else: ?>
+ <? if (!isset($var->value) || $var->value === ""): ?>
<i> <?= t("empty") ?> </i>
+ <? else: ?>
+ <?= html::clean($var->value) ?>
<? endif ?>
</a>
</td>
@@ -9,7 +9,13 @@
<?= form::submit(array("class" => "submit ui-state-default"), t("Save")) ?>
</li>
<li><a href="#" class="g-cancel"><?= t("Cancel") ?></a></li>
+ <? if (!empty($errors["input"])): ?>
+ <li>
+ <p id="g-in-place-edit-message" class="g-error"><?= $errors["input"] ?></p>
+ </li>
+ <? endif ?>
</ul>
</form>
+

0 comments on commit aa65bb0

Please sign in to comment.