summaryrefslogtreecommitdiff
path: root/modules/gallery/js
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-07-16 17:31:20 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-07-16 17:31:20 +0200
commit7f5030ac208c30a7dc576a57cd9e665022ccbde5 (patch)
tree6b23e78aa8cc2dd363def46e083217e3c9b52f1b /modules/gallery/js
parent923732ca4dca6db218f6252a7133cd72f98fa086 (diff)
parent85b0f580291e375a2c5ec21b8210e59023ee24c2 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/js')
-rw-r--r--modules/gallery/js/l10n_client.js32
-rw-r--r--modules/gallery/js/quick.js18
2 files changed, 34 insertions, 16 deletions
diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js
index 4936d1cc..f5be5058 100644
--- a/modules/gallery/js/l10n_client.js
+++ b/modules/gallery/js/l10n_client.js
@@ -58,7 +58,7 @@ jQuery.extend(Gallery, {
case 1:
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').show();
$('#l10n-client').height('22em').removeClass('hidden');
- $('#l10n-client .labels .toggle').text('X');
+ $('#l10n-client-toggler').text(MSG_CLOSE_X);
/*
* This CSS clashes with Gallery's CSS, probably due to
* YUI's grid / floats.
@@ -72,7 +72,7 @@ jQuery.extend(Gallery, {
$('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').hide();
$('#l10n-client').height('2em').addClass('hidden');
// TODO: Localize this message
- $('#l10n-client .labels .toggle').text('Translate Text');
+ $('#l10n-client-toggler').text(MSG_TRANSLATE_TEXT);
/*
if(!$.browser.msie) {
$('body').css('border-bottom', '0px');
@@ -140,6 +140,32 @@ jQuery.extend(Gallery, {
}
}
}
+
+ this.copySourceText = function() {
+ var index = Gallery.l10nClient.selected;
+ if (index >= 0) {
+ var source = Gallery.l10nClient.getString(index, 'source');
+ var is_plural = Gallery.l10nClient.isPluralMessage(source);
+ if (is_plural) {
+ if (typeof(translation) != 'object') {
+ translation = {};
+ }
+ var num_plural_forms = plural_forms.length;
+ for (var i = 0; i < num_plural_forms; i++) {
+ var form = plural_forms[i];
+ var text = source['other'];
+ if (form == 'one') {
+ text = source['one'];
+ }
+ $('#l10n-edit-plural-translation-' + form)
+ .attr('value', text);
+ }
+ } else {
+ $('#l10n-edit-translation').attr('value', source);
+ }
+
+ }
+ }
})
});
@@ -171,7 +197,7 @@ Gallery.behaviors.l10nClient = function(context) {
});
// When l10n_client window is clicked, toggle based on current state.
- $('#l10n-client .labels .toggle').click(function() {
+ $('#l10n-client-toggler').click(function() {
if($('#l10n-client').is('.hidden')) {
Gallery.l10nClient.toggle(1);
} else {
diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js
index 4ebdac47..3ac97f8e 100644
--- a/modules/gallery/js/quick.js
+++ b/modules/gallery/js/quick.js
@@ -11,18 +11,10 @@ $(document).ready(function() {
var show_quick = function() {
var cont = $(this);
var quick = $(this).find(".gQuick");
+ var img = cont.find(".gThumbnail,.gResize");
$("#gQuickPane").remove();
cont.append("<div id=\"gQuickPane\"></div>");
- var img = cont.find(".gThumbnail,.gResize");
- var pos = cont.position();
- $("#gQuickPane").css({
- "position": "absolute",
- "top": pos.top,
- "left": pos.left,
- "text-align": "center",
- "width": cont.innerWidth() + 1,
- "height": "auto"
- }).hide();
+ $("#gQuickPane").hide();
cont.hover(function() {}, hide_quick);
$.get(
quick.attr("href"),
@@ -30,10 +22,10 @@ var show_quick = function() {
function(data, textStatus) {
$("#gQuickPane").html(data).slideDown("fast");
$(".ui-state-default").hover(
- function(){
+ function() {
$(this).addClass("ui-state-hover");
},
- function(){
+ function() {
$(this).removeClass("ui-state-hover");
}
);
@@ -54,7 +46,7 @@ var quick_do = function(cont, pane, img) {
return false;
}
if (pane.hasClass("gDialogLink")) {
- openDialog(pane, function() { window.location.reload(); });
+ openDialog(pane);
} else {
img.css("opacity", "0.1");
cont.addClass("gLoadingLarge");