fix IDE warnings / documentation and move "use strict" from global scope to object itself

This commit is contained in:
Ralf Becker 2014-10-09 09:34:24 +00:00
parent 659ca5eb4f
commit 29cae75178
2 changed files with 52 additions and 54 deletions

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
*/ */
@ -19,7 +17,9 @@
/** /**
* @augments Class * @augments Class
*/ */
egw.extend('links', egw.MODULE_GLOBAL, function() { egw.extend('links', egw.MODULE_GLOBAL, function()
{
"use strict";
/** /**
* Link registry * Link registry
@ -54,9 +54,9 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Check if $app is in the registry and has an entry for $name * Check if $app is in the registry and has an entry for $name
* *
* @param string $app app-name * @param {string} _app app-name
* @param string $name name / key in the registry, eg. 'view' * @param {string} _name name / key in the registry, eg. 'view'
* @return boolean|string false if $app is not registered, otherwise string with the value for $name * @return {boolean|string} false if $app is not registered, otherwise string with the value for $name
* @memberOf egw * @memberOf egw
*/ */
link_get_registry: function(_app, _name) link_get_registry: function(_app, _name)
@ -105,8 +105,8 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Get mime-type information from app-registry * Get mime-type information from app-registry
* *
* @param string _type * @param {string} _type
* @return array with values for keys 'menuaction', 'mime_id' (path) or 'mime_url' and options 'mime_popup' and other values to pass one * @return {object} with values for keys 'menuaction', 'mime_id' (path) or 'mime_url' and options 'mime_popup' and other values to pass one
*/ */
get_mime_info: function(_type) get_mime_info: function(_type)
{ {
@ -127,9 +127,9 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Get handler (link-data) for given path and mime-type * Get handler (link-data) for given path and mime-type
* *
* @param string|object _path vfs path or object with attr path or id, app2 and id2 (path=/apps/app2/id2/id) * @param {string|object} _path vfs path or object with attr path or id, app2 and id2 (path=/apps/app2/id2/id)
* @param string _type mime-type, if not given in _path object * @param {string} _type mime-type, if not given in _path object
* @return string|object string with EGw relative link, array with get-parameters for '/index.php' or null (directory and not filemanager access) * @return {string|object} string with EGw relative link, array with get-parameters for '/index.php' or null (directory and not filemanager access)
*/ */
mime_open: function(_path, _type) mime_open: function(_path, _type)
{ {
@ -182,8 +182,8 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Get list of link-aware apps the user has rights to use * Get list of link-aware apps the user has rights to use
* *
* @param string $must_support capability the apps need to support, eg. 'add', default ''=list all apps * @param {string} _must_support capability the apps need to support, eg. 'add', default ''=list all apps
* @return array with app => title pairs * @return {object} with app => title pairs
*/ */
link_app_list: function(_must_support) link_app_list: function(_must_support)
{ {
@ -218,8 +218,8 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Set link registry * Set link registry
* *
* @param object _registry whole registry or entries for just one app * @param {object} _registry whole registry or entries for just one app
* @param string _app * @param {string} _app
*/ */
set_link_registry: function (_registry, _app) set_link_registry: function (_registry, _app)
{ {
@ -238,10 +238,10 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
* *
* Please note, the values of the query get url encoded! * Please note, the values of the query get url encoded!
* *
* @param string _url a url relative to the egroupware install root, it can contain a query too * @param {string} _url a url relative to the egroupware install root, it can contain a query too
* @param array|string _extravars query string arguements as string or array (prefered) * @param {object|string} _extravars query string arguements as string or array (prefered)
* if string is used ambersands in vars have to be already urlencoded as '%26', function ensures they get NOT double encoded * if string is used ambersands in vars have to be already urlencoded as '%26', function ensures they get NOT double encoded
* @return string generated url * @return {string} generated url
*/ */
link: function(_url, _extravars) link: function(_url, _extravars)
{ {
@ -332,11 +332,11 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
* Query a title of _app/_id * Query a title of _app/_id
* *
* @param {string} _app * @param {string} _app
* @param {(string|int)} _id * @param {string|number} _id
* @param {function} _callback optinal callback, required if for responses from the server * @param {function} _callback optinal callback, required if for responses from the server
* @param {object} _context context for the callback * @param {object} _context context for the callback
* @param {boolean} _force_reload true load again from server, even if already cached * @param {boolean} _force_reload true load again from server, even if already cached
* @return string|boolean|null string with title if it exist in local cache or null if not * @return {string|boolean|null} string with title if it exist in local cache or null if not
*/ */
link_title: function(_app, _id, _callback, _context, _force_reload) link_title: function(_app, _id, _callback, _context, _force_reload)
{ {
@ -374,7 +374,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Callback to add all current title requests * Callback to add all current title requests
* *
* @param array of parameters, only first parameter is used * @param {object} _params of parameters, only first parameter is used
*/ */
link_title_before_send: function(_params) link_title_before_send: function(_params)
{ {
@ -396,7 +396,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Callback for server response * Callback for server response
* *
* @param object _response _app => _id => title * @param {object} _response _app => _id => title
*/ */
link_title_callback: function(_response) link_title_callback: function(_response)
{ {
@ -432,8 +432,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
/** /**
* Create quick add selectbox * Create quick add selectbox
* *
* @param _parent parent to create selectbox in * @param {DOMnode} _parent parent to create selectbox in
* @returns
*/ */
link_quick_add: function(_parent) link_quick_add: function(_parent)
{ {
@ -461,6 +460,4 @@ egw.extend('links', egw.MODULE_GLOBAL, function() {
}); });
} }
}; };
}); });

View File

@ -10,8 +10,6 @@
* @version $Id$ * @version $Id$
*/ */
"use strict";
/*egw:uses /*egw:uses
egw_core; egw_core;
egw_links; egw_links;
@ -19,9 +17,12 @@
/** /**
* @augments Class * @augments Class
* @param {object} _egw
* @param {DOMwindow} _wnd
*/ */
egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) { egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
{
"use strict";
/** /**
* Magic handling for mailto: uris using mail application. * Magic handling for mailto: uris using mail application.
@ -52,8 +53,8 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
var content = { var content = {
to: mailto[1] || [], to: mailto[1] || [],
cc: match['cc'] || [], cc: match['cc'] || [],
bcc: match['bcc'] || [], bcc: match['bcc'] || []
} };
// Get open compose windows // Get open compose windows
var compose = egw.getOpenWindows("mail", /^compose_/); var compose = egw.getOpenWindows("mail", /^compose_/);
@ -61,7 +62,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
{ {
// No compose windows, might be no mail app.js // No compose windows, might be no mail app.js
// We really want to use mail_compose() here // We really want to use mail_compose() here
egw.open('','mail','add',{'preset[mailto]': uri},'compose__','mail') egw.open('','mail','add',{'preset[mailto]': uri},'compose__','mail');
} }
if(compose.length == 1) if(compose.length == 1)
{ {
@ -120,13 +121,13 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
* - egw.open(123,'addressbook','view') opens addressbook view for entry 123 (showing linked infologs) * - egw.open(123,'addressbook','view') opens addressbook view for entry 123 (showing linked infologs)
* - egw.open('','addressbook','view_list',{ search: 'Becker' }) opens list of addresses containing 'Becker' * - egw.open('','addressbook','view_list',{ search: 'Becker' }) opens list of addresses containing 'Becker'
* *
* @param string|int|object id_data either just the id or if app=="" "app:id" or object with all data * @param {string}|int|object id_data either just the id or if app=="" "app:id" or object with all data
* to be able to open files you need to give: (mine-)type, path or id, app2 and id2 (path=/apps/app2/id2/id" * to be able to open files you need to give: (mine-)type, path or id, app2 and id2 (path=/apps/app2/id2/id"
* @param string app app-name or empty (app is part of id) * @param {string} app app-name or empty (app is part of id)
* @param string type default "edit", possible "view", "view_list", "edit" (falls back to "view") and "add" * @param {string} type default "edit", possible "view", "view_list", "edit" (falls back to "view") and "add"
* @param object|string extra extra url parameters to append as object or string * @param {object|string} extra extra url parameters to append as object or string
* @param string target target of window to open * @param {string} target target of window to open
* @param string target_app target application to open in that tab * @param {string} target_app target application to open in that tab
* @memberOf egw * @memberOf egw
*/ */
open: function(id_data, app, type, extra, target, target_app) open: function(id_data, app, type, extra, target, target_app)
@ -234,11 +235,11 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
/** /**
* Open a link, which can be either a menuaction, a EGroupware relative url or a full url * Open a link, which can be either a menuaction, a EGroupware relative url or a full url
* *
* @param string _link menuaction, EGroupware relative url or a full url (incl. "mailto:" or "javascript:") * @param {string} _link menuaction, EGroupware relative url or a full url (incl. "mailto:" or "javascript:")
* @param string _target optional target / window name * @param {string} _target optional target / window name
* @param string _popup widthxheight, if a popup should be used * @param {string} _popup widthxheight, if a popup should be used
* @param string _target_app app-name for opener * @param {string} _target_app app-name for opener
* @param boolean _check_popup_blocker TRUE check if browser pop-up blocker is on/off, FALSE no check * @param {boolean} _check_popup_blocker TRUE check if browser pop-up blocker is on/off, FALSE no check
* - This option only makes sense to be enabled when the open_link requested without user interaction * - This option only makes sense to be enabled when the open_link requested without user interaction
*/ */
open_link: function(_link, _target, _popup, _target_app, _check_popup_blocker) open_link: function(_link, _target, _popup, _target_app, _check_popup_blocker)
@ -323,10 +324,10 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) {
/** /**
* Check if browser pop-up blocker is on/off * Check if browser pop-up blocker is on/off
* *
* @param string _link menuaction, EGroupware relative url or a full url (incl. "mailto:" or "javascript:") * @param {string} _link menuaction, EGroupware relative url or a full url (incl. "mailto:" or "javascript:")
* @param string _target optional target / window name * @param {string} _target optional target / window name
* @param string _popup widthxheight, if a popup should be used * @param {string} _popup widthxheight, if a popup should be used
* @param string _target_app app-name for opener * @param {string} _target_app app-name for opener
* *
* @return boolean returns false if pop-up blocker is off * @return boolean returns false if pop-up blocker is off
* - returns true if pop-up blocker is on, * - returns true if pop-up blocker is on,