From d4738ce4844d39d55fec7f149c6aff5c061c0a38 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 29 Jun 2009 22:05:55 -0700 Subject: Partial fix for ticket 471 - i18n of "Translate Text" button in l10n client --- modules/gallery/js/l10n_client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/gallery/js') diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js index 4936d1cc..7e29849d 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'); @@ -171,7 +171,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 { -- cgit v1.2.3 From a633c134b754305eaa611c5d67af4ca7c79beafe Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Fri, 3 Jul 2009 16:14:05 -0700 Subject: Ticket 104: Adding "Copy sourc text" button to l10n UI (usability / productivity improvement) --- modules/gallery/js/l10n_client.js | 26 ++++++++++++++++++++++++++ modules/gallery/views/l10n_client.html.php | 2 ++ 2 files changed, 28 insertions(+) (limited to 'modules/gallery/js') diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js index 7e29849d..f5be5058 100644 --- a/modules/gallery/js/l10n_client.js +++ b/modules/gallery/js/l10n_client.js @@ -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); + } + + } + } }) }); diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index 38e92e3e..c0cbbfa2 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -63,6 +63,8 @@ "/> + -- cgit v1.2.3 From e0e450d90fe67ac199d82d2b8e902cff5c8b6c7d Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sat, 11 Jul 2009 00:40:57 -0600 Subject: Position gItem and gPhoto relative, then position quick and thumb menus as absolute within them. Moved css from quick.js to quick.css. --- modules/gallery/css/quick.css | 12 ++++++++++++ modules/gallery/helpers/gallery_menu.php | 3 ++- modules/gallery/js/quick.js | 11 +---------- themes/default/css/screen.css | 18 +++++++++++++++++- themes/default/js/ui.init.js | 8 ++++++++ 5 files changed, 40 insertions(+), 12 deletions(-) (limited to 'modules/gallery/js') diff --git a/modules/gallery/css/quick.css b/modules/gallery/css/quick.css index 02f9953e..0e45eac2 100644 --- a/modules/gallery/css/quick.css +++ b/modules/gallery/css/quick.css @@ -1,3 +1,12 @@ +#gQuickPane { + position: absolute; + top: 0; + left: 0; + text-align: center; + width: 100%; + height: auto; +} + .gItem:hover { background-color: #cfdeff; } @@ -12,6 +21,9 @@ background: #000; border-bottom: 1px solid #ccc; opacity: 0.9; + position: absolute; + top: 0; + left: 0; } #gQuickPane a { diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index bffb7696..b6f763b8 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -97,7 +97,8 @@ class gallery_menu_Core { static function thumb($menu, $theme, $item) { $menu->append(Menu::factory("submenu") ->id("options_menu") - ->label(t("Options"))); + ->label(t("Options")) + ->css_class("gThumbMenu")); } static function photo($menu, $theme) { diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 4ebdac47..32e34ef3 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -13,16 +13,7 @@ var show_quick = function() { var quick = $(this).find(".gQuick"); $("#gQuickPane").remove(); cont.append("
"); - 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"), diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 41e51623..d08ada17 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -460,6 +460,7 @@ form .gError, height: 240px; overflow: hidden; padding: 14px 8px; + position: relative; text-align: center; width: 213px; } @@ -487,7 +488,7 @@ form .gError, } #gContent #gPhoto { - + position: relative; } #gContent #gItem .gFullSizeLink img { @@ -581,6 +582,21 @@ form .gError, margin-bottom: 0; } +/* Thumb Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gItem .gMenu { + bottom: 0; + margin-bottom: -2px; + position: absolute; + right: 0; +} + +.gItem .gMenu li { + font-weight: normal !important; +} + +/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + #gViewMenu { margin-bottom: 1em; } diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js index 9d9d3079..29e04d5e 100644 --- a/themes/default/js/ui.init.js +++ b/themes/default/js/ui.init.js @@ -36,6 +36,14 @@ $(document).ready(function() { $(dialogLinks[i]).bind("click", handleDialogEvent); } + // gThumbMenu + if ($(".gItem .gMenu").length) { + $(".gItem .gMenu").removeClass("sf-menu"); + $(".gItem .gMenu span").removeClass("sf-sub-indicator"); + $(".gItem .gMenu span").addClass("ui-icon ui-icon-triangle-1-n"); + $(".gItem .gMenu li:first-child").addClass("ui-icon-right ui-corner-top ui-state-default"); + } + // Initialize view menu if ($("#gViewMenu").length) { $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); -- cgit v1.2.3 From ecc7d881e3bad1dd8edf5cbd4382bda9a668fcb8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 05:52:50 -0700 Subject: Fix bug introduced in e0e450d90fe67ac199d82d2b8e902cff5c8b6c7d where it got rid of the 'img' var which is used when we set the click action on buttons. Partial fix for #528. --- modules/gallery/js/quick.js | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/js') diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 32e34ef3..28ced3f6 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -11,6 +11,7 @@ $(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("
"); $("#gQuickPane").hide(); -- cgit v1.2.3 From 6b013060aabc1d13545958fdb3c096faac2ba5a7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 06:15:44 -0700 Subject: Fix style: space after ) before {. --- modules/gallery/js/quick.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/js') diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 28ced3f6..2dcb1c36 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -22,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"); } ); -- cgit v1.2.3 From 214d977f4dc9ac78f4571a7cc89109fd95f5a2eb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 06:51:21 -0700 Subject: Don't close the dialog window after we successfully complete an action. The expectation is that we're going to reload the page (or redirect to a new url). If we close the dialog, then we can trigger the onhover for items we've just deleted causing errors. Simplify the API while we're at it by getting rid of the no-longer-used on_success argument to openDialog() This fixes #528. --- lib/gallery.dialog.js | 13 +++++-------- modules/gallery/js/quick.js | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'modules/gallery/js') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index fc66323e..74c2f20e 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -11,23 +11,20 @@ function handleDialogEvent(event) { event.preventDefault(); } -function ajaxify_dialog(on_success) { +function ajaxify_dialog() { $("#gDialog form").ajaxForm({ dataType: "json", success: function(data) { if (data.form) { $("#gDialog form").replaceWith(data.form); - ajaxify_dialog(on_success); + ajaxify_dialog(); on_form_loaded(); if (typeof data.reset == 'function') { eval(data.reset + '()'); } } if (data.result == "success") { - $("#gDialog").dialog("close"); - if (on_success) { - on_success(); - } else if (data.location) { + if (data.location) { window.location = data.location; } else { window.location.reload(); @@ -46,7 +43,7 @@ function ajaxify_dialog(on_success) { * @see handleDialogEvent() * @see showLoading() */ -function openDialog(element, on_success) { +function openDialog(element) { var sHref = $(element).attr("href"); var sTitle = $(element).attr("title"); var eDialog = '
'; @@ -92,7 +89,7 @@ function openDialog(element, on_success) { $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html()); } - ajaxify_dialog(on_success); + ajaxify_dialog(); }); return false; } diff --git a/modules/gallery/js/quick.js b/modules/gallery/js/quick.js index 2dcb1c36..3ac97f8e 100644 --- a/modules/gallery/js/quick.js +++ b/modules/gallery/js/quick.js @@ -46,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"); -- cgit v1.2.3