fixing scope of "use strict", so we do not need to remove it when concatinating our scripts like we do now with minjs

This commit is contained in:
Ralf Becker 2016-02-29 15:50:24 +00:00
parent bbf6ca54ac
commit 033c1f4a9f
27 changed files with 219 additions and 199 deletions

View File

@ -7,14 +7,13 @@
* @description Framework base module which creates fw_base object and includes basic framework functionallity * @description Framework base module which creates fw_base object and includes basic framework functionallity
*/ */
"use strict";
/*egw:uses /*egw:uses
jquery.jquery; jquery.jquery;
egw_inheritance.js; egw_inheritance.js;
*/ */
var fw_base = Class.extend({ var fw_base = (function(){ "use strict"; return Class.extend(
{
/** /**
* Framework base class constructor sets up basic initialization * Framework base class constructor sets up basic initialization
* @param {type} _sidemenuId * @param {type} _sidemenuId
@ -1043,4 +1042,4 @@ var fw_base = Class.extend({
} }
} }
} }
}); });}).call(this);

View File

@ -17,11 +17,9 @@
EGW_BROWSER_TYPE_NONE = 0; EGW_BROWSER_TYPE_NONE = 0;
EGW_BROWSER_TYPE_IFRAME = 1; EGW_BROWSER_TYPE_IFRAME = 1;
EGW_BROWSER_TYPE_DIV = 2; EGW_BROWSER_TYPE_DIV = 2;
"use strict";
var fw_browser = Class.extend({
var fw_browser = (function(){ "use strict"; return Class.extend(
{
/** /**
* @param {string} _app * @param {string} _app
* @param {function} _heightCallback * @param {function} _heightCallback
@ -323,7 +321,7 @@ var fw_browser = Class.extend({
if (this.app.sidemenuEntry) if (this.app.sidemenuEntry)
this.app.sidemenuEntry.hideAjaxLoader(); this.app.sidemenuEntry.hideAjaxLoader();
// egw_widgetReplace(this.app.appName, this.contentDiv, this.data); // egw_widgetReplace(this.app.appName, this.contentDiv, this.data);
content = { var content = {
html: this.data, html: this.data,
js: '' js: ''
}; };
@ -373,7 +371,4 @@ var fw_browser = Class.extend({
{ {
this.browse('about:blank', this.type == EGW_BROWSER_TYPE_IFRAME); this.browse('about:blank', this.type == EGW_BROWSER_TYPE_IFRAME);
} }
});}).call(this);
});

View File

@ -8,7 +8,6 @@
* @description Create jdots framework * @description Create jdots framework
*/ */
"use strict";
/*egw:uses /*egw:uses
jquery.jquery; jquery.jquery;
framework.fw_base; framework.fw_base;
@ -17,7 +16,15 @@
egw_fw_classes; egw_fw_classes;
egw_inheritance.js; egw_inheritance.js;
*/ */
(function(window){
/**
*
* @param {DOMWindow} window
*/
(function(window)
{
"use strict";
/** /**
* *
* @type @exp;fw_ui_sidemenu_entry@call;extend * @type @exp;fw_ui_sidemenu_entry@call;extend
@ -84,12 +91,8 @@
* *
* @type @exp;fw_ui_sidemenu@call;extend * @type @exp;fw_ui_sidemenu@call;extend
*/ */
var desktop_ui_sidemenu = fw_ui_sidemenu.extend({ var desktop_ui_sidemenu = fw_ui_sidemenu.extend(
{
/**
*
* @returns {undefined}
*/
init: function(_baseDiv, _sortCallback) init: function(_baseDiv, _sortCallback)
{ {
this._super.apply(this,arguments); this._super.apply(this,arguments);
@ -211,7 +214,7 @@
/** /**
* *
* @returns {undefined} * @param {array} apps
*/ */
loadApplications: function (apps) loadApplications: function (apps)
{ {

View File

@ -13,21 +13,14 @@
egw_inheritance.js; egw_inheritance.js;
*/ */
/**
* Constants definition
*/
"use strict";
/** /**
* ui siemenu entry class * ui siemenu entry class
* Basic sidebar menu implementation * Basic sidebar menu implementation
* *
* @type @exp;Class@call;extend * @type @exp;Class@call;extend
*/ */
var fw_ui_sidemenu_entry = Class.extend({ var fw_ui_sidemenu_entry = (function(){ "use strict"; return Class.extend(
{
/** /**
* Framework ui sidemenu entry class constructor * Framework ui sidemenu entry class constructor
* *
@ -179,13 +172,14 @@ var fw_ui_sidemenu_entry = Class.extend({
$j(this.headerDiv).remove(); $j(this.headerDiv).remove();
$j(this.contentDiv).remove(); $j(this.contentDiv).remove();
} }
}); });}).call(this);
/** /**
* *
* @type @exp;Class@call;extend * @type @exp;Class@call;extend
*/ */
var fw_ui_sidemenu = Class.extend({ var fw_ui_sidemenu = (function(){ "use strict"; return Class.extend(
{
/** /**
* The constructor of the egw_fw_ui_sidemenu. * The constructor of the egw_fw_ui_sidemenu.
* *
@ -279,7 +273,7 @@ var fw_ui_sidemenu = Class.extend({
this.entries = new Array(); this.entries = new Array();
} }
}); });}).call(this);
/** /**
* Class: egw_fw_ui_tab * Class: egw_fw_ui_tab

View File

@ -11,8 +11,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_inheritance; egw_inheritance;
/phpgwapi/js/es6-promise.min.js; /phpgwapi/js/es6-promise.min.js;
@ -65,7 +63,7 @@ window.app = {classes: {}};
* @class AppJS * @class AppJS
* @augments Class * @augments Class
*/ */
var AppJS = Class.extend( var AppJS = (function(){ "use strict"; return Class.extend(
{ {
/** /**
* Internal application name - override this * Internal application name - override this
@ -1783,4 +1781,4 @@ var AppJS = Class.extend(
}); });
}); });
} }
}); });}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_debug; egw_debug;
@ -37,7 +35,10 @@
app_base; app_base;
*/ */
(function(){ (function()
{
"use strict";
var debug = false; var debug = false;
var egw_script = document.getElementById('egw_script_id'); var egw_script = document.getElementById('egw_script_id');
var start_time = (new Date).getTime(); var start_time = (new Date).getTime();

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
jquery.jquery-ui; jquery.jquery-ui;
jquery.jquery-ui-timepicker-addon; jquery.jquery-ui-timepicker-addon;
@ -31,6 +29,8 @@
*/ */
egw.extend('calendar', egw.MODULE_WND_LOCAL, function(_app, _wnd) egw.extend('calendar', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{ {
"use strict";
// translate only once // translate only once
var calendar_translated = false,timepicker_translated = false; var calendar_translated = false,timepicker_translated = false;
@ -275,6 +275,8 @@ egw.extend('calendar', egw.MODULE_WND_LOCAL, function(_app, _wnd)
/** /**
* Calculate the start of the week, according to user's preference * Calculate the start of the week, according to user's preference
*
* @param {string} date
*/ */
week_start: function(date) { week_start: function(date) {
var d = new Date(date); var d = new Date(date);

View File

@ -10,13 +10,13 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
egw.extend('config', egw.MODULE_GLOBAL, function() { egw.extend('config', egw.MODULE_GLOBAL, function()
{
"use strict";
/** /**
* Clientside config * Clientside config

View File

@ -10,13 +10,13 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/** /**
* This code setups the egw namespace and adds the "extend" function, which is * This code setups the egw namespace and adds the "extend" function, which is
* used by extension modules to inject their content into the egw object. * used by extension modules to inject their content into the egw object.
*/ */
(function() { (function()
{
"use strict";
var instanceUid = 0; var instanceUid = 0;

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
@ -23,7 +21,9 @@
* @param {string} _app application name object is instanciated for * @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for * @param {object} _wnd window object is instanciated for
*/ */
egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd) { egw.extend('css', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
"use strict";
/** /**
* Assoziative array which stores the current css rule for a given selector. * Assoziative array which stores the current css rule for a given selector.

View File

@ -15,9 +15,15 @@
egw_debug; egw_debug;
*/ */
"use strict"; /**
* Module storing and updating row data
egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { *
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/
egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd)
{
"use strict";
/** /**
* How many UIDs we'll tell the server we know about. No need to pass the whole list around. * How many UIDs we'll tell the server we know about. No need to pass the whole list around.
@ -527,6 +533,11 @@ egw.extend("data_storage", egw.MODULE_GLOBAL, function (_app, _wnd) {
* using dataFetch() && parseServerResponse(), above. Both update the * using dataFetch() && parseServerResponse(), above. Both update the
* GLOBAL data cache though this one is registered globally, and the above * GLOBAL data cache though this one is registered globally, and the above
* is registered app local. * is registered app local.
*
* @param {string} type
* @param {object} res
* @param {object} req
* @returns {Boolean}
*/ */
egw.registerJSONPlugin(function(type, res, req) { egw.registerJSONPlugin(function(type, res, req) {
if ((typeof res.data.uid != 'undefined') && if ((typeof res.data.uid != 'undefined') &&

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
@ -25,7 +23,9 @@
* @param {string} _app * @param {string} _app
* @param {object} _wnd * @param {object} _wnd
*/ */
egw.extend('debug', egw.MODULE_GLOBAL, function(_app, _wnd) { egw.extend('debug', egw.MODULE_GLOBAL, function(_app, _wnd)
{
"use strict";
/** /**
* DEBUGLEVEL specifies which messages are printed to the console. * DEBUGLEVEL specifies which messages are printed to the console.

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_ready; egw_ready;
@ -20,9 +18,13 @@
/** /**
* @augments Class * @augments Class
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/ */
egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd) egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{ {
"use strict";
var egw = this; var egw = this;
/** /**
@ -128,10 +130,10 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
* Load and execute javascript file(s) in order * Load and execute javascript file(s) in order
* *
* @memberOf egw * @memberOf egw
* @param string|array _jsFiles (array of) urls to include * @param {string|array} _jsFiles (array of) urls to include
* @param function _callback called after JS files are loaded and executed * @param {function} _callback called after JS files are loaded and executed
* @param object _context * @param {object} _context
* @param string _prefix prefix for _jsFiles * @param {string} _prefix prefix for _jsFiles
*/ */
includeJS: function(_jsFiles, _callback, _context, _prefix) includeJS: function(_jsFiles, _callback, _context, _prefix)
{ {

View File

@ -10,13 +10,13 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
egw.extend('images', egw.MODULE_GLOBAL, function() { egw.extend('images', egw.MODULE_GLOBAL, function()
{
"use strict";
/** /**
* Map to serverside available images for users template-set * Map to serverside available images for users template-set

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/** /**
* Usage of the JS inheritance system * Usage of the JS inheritance system
* ---------------------------------- * ----------------------------------
@ -71,6 +69,8 @@
*/ */
(function() (function()
{ {
"use strict";
var initializing = false; var initializing = false;
/** /**

View File

@ -9,15 +9,20 @@
* @version $Id$ * @version $Id$
*/ */
"use strict"
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_files; egw_files;
egw_ready; egw_ready;
*/ */
egw.extend('jquery', egw.MODULE_WND_LOCAL, function(_app, _wnd) { /**
* NOT USED
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/
egw.extend('jquery', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
"use strict";
// Get the reference to the "files" and the "ready" module for the current // Get the reference to the "files" and the "ready" module for the current
// window // window
@ -37,9 +42,5 @@ egw.extend('jquery', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
return { return {
'$j': null '$j': null
} };
}); });

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
jquery.jquery; jquery.jquery;
@ -21,7 +19,15 @@
egw_debug; egw_debug;
*/ */
egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) { /**
* Module sending json requests
*
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/
egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
"use strict";
/** /**
* Object which contains all registered handlers for JS responses. * Object which contains all registered handlers for JS responses.
@ -36,7 +42,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
*/ */
if(typeof egw._global_json_handlers == 'undefined') if(typeof egw._global_json_handlers == 'undefined')
{ {
egw._global_json_handlers = {} egw._global_json_handlers = {};
} }
var global_plugins = egw._global_json_handlers; var global_plugins = egw._global_json_handlers;

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_debug; egw_debug;
@ -19,6 +17,8 @@
egw.extend('jsonq', egw.MODULE_GLOBAL, function() egw.extend('jsonq', egw.MODULE_GLOBAL, function()
{ {
"use strict";
/** /**
* Queued json requests (objects with attributes menuaction, parameters, context, callback, sender and callbeforesend) * Queued json requests (objects with attributes menuaction, parameters, context, callback, sender and callbeforesend)
* *

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_files; egw_files;
@ -21,7 +19,9 @@
/** /**
* @augments Class * @augments Class
*/ */
egw.extend('lang', egw.MODULE_GLOBAL, function() { egw.extend('lang', egw.MODULE_GLOBAL, function()
{
"use strict";
/** /**
* Translations * Translations

View File

@ -9,8 +9,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
@ -24,6 +22,8 @@
*/ */
egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{ {
"use strict";
_app; // not used, but required by function signature _app; // not used, but required by function signature
var message_timer; var message_timer;
var error_reg_exp; var error_reg_exp;
@ -247,8 +247,8 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
* @param {string} _id a unique id to be able to distinguish loading-prompts * @param {string} _id a unique id to be able to distinguish loading-prompts
* @param {boolean} _stat true to show the loading and false to remove it * @param {boolean} _stat true to show the loading and false to remove it
* @param {string} _msg a message to show while loading * @param {string} _msg a message to show while loading
* @param {string|jQuery node} _node DOM selector id or jquery DOM object, default is body * @param {string|jQuery _node} _node DOM selector id or jquery DOM object, default is body
* @param {string} mode defines the animation mode, default mode is spinner * @param {string} _mode defines the animation mode, default mode is spinner
* animation modes: * animation modes:
* - spinner: a sphere with a spinning bar inside * - spinner: a sphere with a spinning bar inside
* - horizental: a horizental bar * - horizental: a horizental bar

View File

@ -10,13 +10,13 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
egw.extend('preferences', egw.MODULE_GLOBAL, function() { egw.extend('preferences', egw.MODULE_GLOBAL, function()
{
"use strict";
/** /**
* Object holding the prefences as 2-dim. associative array, use * Object holding the prefences as 2-dim. associative array, use

View File

@ -9,8 +9,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict"
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_utils; egw_utils;
@ -19,8 +17,12 @@
/** /**
* @augments Class * @augments Class
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/ */
egw.extend('ready', egw.MODULE_WND_LOCAL, function(_app, _wnd) { egw.extend('ready', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
"use strict";
var egw = this; var egw = this;
@ -181,7 +183,7 @@ egw.extend('ready', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
else else
{ {
setTimeout(function() { setTimeout(function() {
_callback.call(_context) _callback.call(_context);
}, 1); }, 1);
} }
}, },

View File

@ -9,16 +9,12 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_ready; egw_ready;
egw_debug; egw_debug;
*/ */
/** /**
* Store is a wrapper around browser based, persistant storage. * Store is a wrapper around browser based, persistant storage.
* *
@ -28,7 +24,9 @@
* @param {string} _app * @param {string} _app
* @param {DOMWindow} _wnd * @param {DOMWindow} _wnd
*/ */
egw.extend('store', egw.MODULE_GLOBAL, function(_app, _wnd) { egw.extend('store', egw.MODULE_GLOBAL, function(_app, _wnd)
{
"use strict";
var egw = this; var egw = this;

View File

@ -7,11 +7,14 @@
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Hadi Nategh (as AT stylite.de) * @author Hadi Nategh (as AT stylite.de)
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @version $Id: * @version $Id$
*/ */
$j(function(){ jQuery(function()
{
"use strict";
var that = this; var that = this;
var log_tail_start=0; var log_tail_start=0;

View File

@ -10,14 +10,19 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
jquery.jquery; jquery.jquery;
egw_core; egw_core;
*/ */
egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) { /**
*
* @param {string} _app application name object is instanciated for
* @param {object} _wnd window object is instanciated for
*/
egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
"use strict";
var tooltip_div = null; var tooltip_div = null;
var current_elem = null; var current_elem = null;
@ -96,6 +101,8 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
/** /**
* Creates the tooltip_div with the given text. * Creates the tooltip_div with the given text.
*
* @param {string} _html
*/ */
function prepare(_html) function prepare(_html)
{ {
@ -212,7 +219,7 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
// Unbind all "tooltip" events from the given element // Unbind all "tooltip" events from the given element
_elem.unbind('.tooltip'); _elem.unbind('.tooltip');
} }
} };
}); });

View File

@ -10,14 +10,14 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
egw.extend('user', egw.MODULE_GLOBAL, function() egw.extend('user', egw.MODULE_GLOBAL, function()
{ {
"use strict";
/** /**
* Data about current user * Data about current user
* *

View File

@ -10,13 +10,13 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
egw.extend('utils', egw.MODULE_GLOBAL, function() { egw.extend('utils', egw.MODULE_GLOBAL, function()
{
"use strict";
function json_escape_string(input) function json_escape_string(input)
{ {
@ -167,8 +167,8 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() {
/** /**
* Decode encoded vfs special chars * Decode encoded vfs special chars
* *
* @param string _path path to decode * @param {string} _path path to decode
* @return string * @return {string}
*/ */
decodePath: function(_path) { decodePath: function(_path) {
return decodeURIComponent(_path); return decodeURIComponent(_path);
@ -177,8 +177,8 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() {
/** /**
* Encode vfs special chars excluding / * Encode vfs special chars excluding /
* *
* @param string _path path to decode * @param {string} _path path to decode
* @return string * @return {string}
*/ */
encodePath: function(_path) { encodePath: function(_path) {
var components = _path.split('/'); var components = _path.split('/');
@ -197,10 +197,8 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() {
* '?' => '%3F', * '?' => '%3F',
* '/' => '', // better remove it completly * '/' => '', // better remove it completly
* *
* @param string _path path to decode * @param {string} _comp path to decode
* @return string * @return {string}
*/
/*
*/ */
encodePathComponent: function(_comp) { encodePathComponent: function(_comp) {
return _comp.replace(/#/g,'%23').replace(/\?/g,'%3F').replace(/\//g,''); return _comp.replace(/#/g,'%23').replace(/\?/g,'%3F').replace(/\//g,'');
@ -290,7 +288,7 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() {
{ {
return open_windows; return open_windows;
} }
var list = [] var list = [];
var now = Date.now(); var now = Date.now();
for(var i in open_windows) for(var i in open_windows)
{ {