diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
commit | 703aeaef1a43b07dc5497dba72c98151466396cc (patch) | |
tree | 1e18a6b3fc3c28156c2e56f8a3d515b8dd6a9cf9 /lib/scripts/helpers.js | |
parent | 33c3b3817b00aa9384760813643fac0e33daaaff (diff) | |
parent | 14b3007921f7b66fc9e3621b861a3c83e7e9093c (diff) | |
download | rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.gz rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.bz2 |
Merge remote-tracking branch 'origin/master' into diff_navigation
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); + } +} |