[Libreoffice-commits] online.git: loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Mar 5 14:16:17 UTC 2019
loleaflet/js/global.js | 82 +++++++++++++++++++++++--------------------------
1 file changed, 40 insertions(+), 42 deletions(-)
New commits:
commit 032703ca164f7e363f153ef82f46e8f697902324
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Jan 26 17:21:48 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Mar 5 10:15:44 2019 -0400
loleaflet: indent global.js
Change-Id: Ib04a18bcedb26ce267a80fd7990454f590de1a3d
diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index 53f58d659..a294ffae8 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -1,54 +1,52 @@
/* -*- js-indent-level: 8 -*- */
-/* global loleafletLogging */
-/*eslint indent: [error, "tab", { "outerIIFEBody": 0 }]*/
(function (global) {
-// If not debug, don't print anything on the console
-// except in tile debug mode (Ctrl-Shift-Alt-d)
-console.log2 = console.log;
-if (loleafletLogging !== 'true') {
- var methods = ['warn', 'info', 'debug', 'trace', 'log', 'assert', 'time', 'timeEnd'];
- for (var i = 0; i < methods.length; i++) {
- console[methods[i]] = function() {};
+ // If not debug, don't print anything on the console
+ // except in tile debug mode (Ctrl-Shift-Alt-d)
+ console.log2 = console.log;
+ if (global.loleafletLogging !== 'true') {
+ var methods = ['warn', 'info', 'debug', 'trace', 'log', 'assert', 'time', 'timeEnd'];
+ for (var i = 0; i < methods.length; i++) {
+ console[methods[i]] = function() {};
+ }
}
-}
-// fix jquery-ui
-// var jQuery = require('jquery');
-global.require = function (path) {
- if (path=='jquery') {
- return global.jQuery;
- }
-};
+ // fix jquery-ui
+ // var jQuery = require('jquery');
+ global.require = function (path) {
+ if (path=='jquery') {
+ return global.jQuery;
+ }
+ };
-global.getParameterByName = function (name) {
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
- var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
- var results = regex.exec(location.search);
- return results === null ? '' : results[1].replace(/\+/g, ' ');
-};
+ global.getParameterByName = function (name) {
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
+ var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
+ var results = regex.exec(location.search);
+ return results === null ? '' : results[1].replace(/\+/g, ' ');
+ };
-global._ = function (string) {
- // In the mobile app case we can't use the stuff from l10n-for-node, as that assumes HTTP.
- if (window.ThisIsTheiOSApp) {
- // We use another approach just for iOS for now.
- if (window.LOCALIZATIONS.hasOwnProperty(string)) {
- // window.postMobileDebug('_(' + string + '): YES: ' + window.LOCALIZATIONS[string]);
- var result = window.LOCALIZATIONS[string];
- if (window.LANG === 'de-CH') {
- result = result.replace(/ß/g, 'ss');
+ global._ = function (string) {
+ // In the mobile app case we can't use the stuff from l10n-for-node, as that assumes HTTP.
+ if (window.ThisIsTheiOSApp) {
+ // We use another approach just for iOS for now.
+ if (window.LOCALIZATIONS.hasOwnProperty(string)) {
+ // window.postMobileDebug('_(' + string + '): YES: ' + window.LOCALIZATIONS[string]);
+ var result = window.LOCALIZATIONS[string];
+ if (window.LANG === 'de-CH') {
+ result = result.replace(/ß/g, 'ss');
+ }
+ return result;
+ } else {
+ // window.postMobileDebug('_(' + string + '): NO');
+ return string;
}
- return result;
- } else {
- // window.postMobileDebug('_(' + string + '): NO');
+ } else if (window.ThisIsAMobileApp) {
+ // And bail out without translations on other mobile platforms.
return string;
+ } else {
+ return string.toLocaleString();
}
- } else if (window.ThisIsAMobileApp) {
- // And bail out without translations on other mobile platforms.
- return string;
- } else {
- return string.toLocaleString();
- }
-};
+ };
}(window));
More information about the Libreoffice-commits
mailing list