From 247a8c5e8704b1bf7452c2996d1597400a724d78 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 24 Oct 2014 12:19:16 +0000 Subject: [PATCH] text and German translations for drag-n-drop modifier hints --- phpgwapi/js/egw_action/egw_action_dragdrop.js | 30 ++++++++++--------- phpgwapi/lang/egw_de.lang | 5 +++- phpgwapi/lang/egw_en.lang | 5 +++- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/phpgwapi/js/egw_action/egw_action_dragdrop.js b/phpgwapi/js/egw_action/egw_action_dragdrop.js index d4e87b6ef4..ea9797a56c 100644 --- a/phpgwapi/js/egw_action/egw_action_dragdrop.js +++ b/phpgwapi/js/egw_action/egw_action_dragdrop.js @@ -83,7 +83,7 @@ function egwDragActionImplementation() ai.helper = null; ai.ddTypes = []; ai.selected = []; - + // Define default helper DOM // default helper also can be called later in application code in order to customization ai.defaultDDHelper = function (_selected) @@ -94,13 +94,13 @@ function egwDragActionImplementation() var moreRow = $j(document.createElement('tr')).addClass('et2_egw_action_ddHelper_moreRow'); // Main div helper container var div = $j(document.createElement("div")).append(table); - + var rows = []; // Maximum number of rows to show var maxRows = 3; // item label var itemLabel = egw.lang(egw.link_get_registry(egw.app_name(),_selected.length > 1?'entries':'entry')||egw.app_name()); - + var index = 0; for (var i = 0; i < _selected.length;i++) { @@ -117,7 +117,7 @@ function egwDragActionImplementation() var spanCnt = $j(document.createElement('span')) .addClass('et2_egw_action_ddHelper_itemsCnt') .appendTo(div); - + spanCnt.text(_selected.length +' '+ itemLabel); // Number of not shown rows var restRows = _selected.length - maxRows; @@ -129,7 +129,7 @@ function egwDragActionImplementation() break; } } - + var text = $j(document.createElement('div')).addClass('et2_egw_action_ddHelper_tip'); div.append(text); @@ -137,13 +137,14 @@ function egwDragActionImplementation() if('draggable' in document.createElement('span') && navigator && navigator.userAgent.indexOf('Chrome') >= 0 && egw.app_name() == 'filemanager') // currently only filemanager supports drag out { - var key = ["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0 ? 'Ctrl' : 'Command'; - text.text(egw.lang('Hold Alt + Shift key to drag %2 to your computer',key, itemLabel)); + var key = ["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0 ? + egw.lang('Alt') : egw.lang('Command ⌘'); + text.text(egw.lang('Hold [%1] and [%2] key to drag %3 to your desktop', key, egw.lang('Shift ⇧'), itemLabel)); } // Final html DOM return as helper structor return div; }; - + ai.doRegisterAction = function(_aoi, _callback, _context) { var node = _aoi.getDOMNode(); @@ -201,7 +202,7 @@ function egwDragActionImplementation() { // Disabling draggable adds some UI classes, but we don't care so remove them $j(node).removeClass("ui-draggable-disabled ui-state-disabled"); - + } else { @@ -327,7 +328,7 @@ function egwDragActionImplementation() { // Add a basic class to the helper in order to standardize the background layout ai.helper.addClass('et2_egw_action_ddHelper'); - + // Append the helper object to the body element - this // fixes a bug in IE: If the element isn't inserted into // the DOM-tree jquery appends it to the parent node. @@ -351,12 +352,13 @@ function egwDragActionImplementation() // to distinguish whether the action was intended for dragging or selecting content. var tipTelorance = 10; var helperTop = ai.helper.position().top; - - if (helperTop >= dTarget.offset().top + + if (helperTop >= dTarget.offset().top && helperTop <= (dTarget.height() + dTarget.offset().top) + tipTelorance) { - var key = (["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0)?"Ctrl": "Command"; - egw.message(egw.lang('Hold %1 key to select content.',key),'info'); + var key = ["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0 ? + egw.lang("Ctrl") : egw.lang("Command ⌘"); + egw.message(egw.lang('Hold [%1] key to select text eg. to copy it', key), 'info'); } // Invalid target return true; diff --git a/phpgwapi/lang/egw_de.lang b/phpgwapi/lang/egw_de.lang index 025a42a363..519debe08a 100644 --- a/phpgwapi/lang/egw_de.lang +++ b/phpgwapi/lang/egw_de.lang @@ -185,6 +185,7 @@ cocos (keeling) islands common de COCOS INSELN collection empty. common de Collection ist leer collection listing common de Auflistung der Collection colombia common de KOLUMBIEN +command ⌘ common de Cmd ⌘ common preferences common de Allgemeine Einstellungen comoros common de KOMOREN company common de Unternehmen @@ -373,7 +374,8 @@ height common de Höhe help common de Hilfe high common de Hoch highest common de Höchste -hold %1 to drag %2 to your computer common de %1 Taste halten um %2 auf Ihren Computer zu ziehen +hold [%1] and [%2] key to drag %3 to your desktop common de [%1] und [%2] Tasten halten um %3 auf Ihren Schreibtisch (Desktop) zu ziehen +hold [%1] key to select text eg. to copy it common de [%1] Taste halten um Text zu markieren um ihn z.B. zu kopieren holy see (vatican city state) common de VATICAN home common de Home home email common de private E-Mail @@ -731,6 +733,7 @@ setup common de Setup setup main menu common de Setup Hauptmenü seychelles common de SEYCHELLEN shift common de Shift +shift ⇧ common de Umschalten ⇧ show all common de alle anzeigen show all categorys common de Alle Kategorien anzeigen show as topmenu common de Menü oben anzeigen diff --git a/phpgwapi/lang/egw_en.lang b/phpgwapi/lang/egw_en.lang index 3171771508..e4577f03a0 100644 --- a/phpgwapi/lang/egw_en.lang +++ b/phpgwapi/lang/egw_en.lang @@ -185,6 +185,7 @@ cocos (keeling) islands common en COCOS (KEELING) ISLANDS collection empty. common en Collection empty. collection listing common en Collection listing colombia common en COLOMBIA +command ⌘ common en Command ⌘ common preferences common en Common preferences comoros common en COMOROS company common en Company @@ -373,7 +374,8 @@ height common en Height help common en Help high common en High highest common en Highest -hold %1 to drag %2 to your computer common en Hold %1 to drag %2 to your computer +hold [%1] and [%2] key to drag %3 to your desktop common en Hold [%1] and [%2] key to drag %3 to your desktop +hold [%1] key to select text eg. to copy it common en Hold [%1] key to select text eg. to copy it holy see (vatican city state) common en HOLY SEE (VATICAN CITY STATE) home common en Home home email common en Home email @@ -731,6 +733,7 @@ setup common en Setup setup main menu common en Setup main menu seychelles common en SEYCHELLES shift common en Shift +shift ⇧ common en Shift ⇧ show all common en Show all show all categorys common en Show all categories show as topmenu common en Show as top menu