diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-08-03 00:40:34 +0200 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-08-03 00:40:34 +0200 |
commit | b8b64ed77285e4d753d35d4ceab0516be597a2f1 (patch) | |
tree | 7cc1a82a5887a9efeb3f9160f98613e65e404ba0 /lib/scripts/helpers.js | |
parent | af07997c5ff7cc096965159d90158e3710d2d019 (diff) | |
parent | 586da9c1028b1013e8dc47911ba430671a389b5b (diff) | |
download | rpg-b8b64ed77285e4d753d35d4ceab0516be597a2f1.tar.gz rpg-b8b64ed77285e4d753d35d4ceab0516be597a2f1.tar.bz2 |
Merge branch 'master' into configmgr_improvements
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); + } +} |