diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-08-03 10:44:54 +0200 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-08-03 10:44:54 +0200 |
commit | 6acfab8732e1784b953c8cc2ae7408f84fda7ce8 (patch) | |
tree | 01e6ac38df46c9ad18f058c8d597617702eb67f3 /lib/scripts/helpers.js | |
parent | 51bd6f039e782dca456022514893aa80bd7c52b9 (diff) | |
parent | cab505616ec9b8ef3cd671e7337c91d065745932 (diff) | |
download | rpg-6acfab8732e1784b953c8cc2ae7408f84fda7ce8.tar.gz rpg-6acfab8732e1784b953c8cc2ae7408f84fda7ce8.tar.bz2 |
Merge remote-tracking branch 'origin/master' into changelogtestsonly
Diffstat (limited to 'lib/scripts/helpers.js')
-rw-r--r-- | lib/scripts/helpers.js | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/lib/scripts/helpers.js b/lib/scripts/helpers.js index d6f36967d..0b32e8781 100644 --- a/lib/scripts/helpers.js +++ b/lib/scripts/helpers.js @@ -3,25 +3,6 @@ */ /** - * Very simplistic Flash plugin check, probably works for Flash 8 and higher only - * - * @author Andreas Gohr <andi@splitbrain.org> - */ -function hasFlash(version){ - var ver = 0; - try{ - if(navigator.plugins != null && navigator.plugins.length > 0){ - ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0]; - }else{ - ver = (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) - .GetVariable("$version").split(' ')[1].split(',')[0]; - } - }catch(e){ } - - return ver >= version; -} - -/** * A PHP-style substr_replace * * Supports negative start and length and omitting length, but not @@ -68,3 +49,18 @@ function bind(fnc/*, ... */) { static_args.concat(Aps.call(arguments, 0))); }; } + +/** + * Report an error from a JS file to the console + * + * @param e The error object + * @param file The file in which the error occurred + */ +function logError(e, file) { + if (window.console && console.error) { + console.error('The error "%s: %s" occurred in file "%s". ' + + 'If this is in a plugin try updating or disabling the plugin, ' + + 'if this is in a template try updating the template or switching to the "dokuwiki" template.', + e.name, e.message, file); + } +} |