| 4 | | if (!window._editor_url) { |
| 5 | | // Because of the way the DOM is loaded, this is guaranteed to always pull our script tag. |
| 6 | | var scripts = document.getElementsByTagName('script'); |
| 7 | | var this_script = scripts[scripts.length-1]; |
| 8 | | |
| 9 | | // We'll allow two ways to specify arguments. We'll accept them in the |
| 10 | | // argument of the script, or we'll accept them embedded into our script tag. |
| 11 | | var args = this_script.src.split('?'); |
| 12 | | args = args.length == 2 ? args[1].split('&') : ''; |
| 13 | | for (var index=0; index<args.length; ++index) { |
| 14 | | var arg = args[index].split('='); |
| 15 | | if (arg.length == 2) { |
| 16 | | switch (arg[0]) { |
| 17 | | case 'lang': |
| 18 | | case 'icons': |
| 19 | | case 'skin': |
| 20 | | case 'url': |
| 21 | | window['_editor_'+arg[0]] = arg[1]; |
| 22 | | break; |
| | 4 | if (!window._editor_url) |
| | 5 | { |
| | 6 | (function() // wrap this in an ad-hoc function to avoid unecessary pollution of global namespace |
| | 7 | { |
| | 8 | // Because of the way the DOM is loaded, this is guaranteed to always pull our script tag. |
| | 9 | var scripts = document.getElementsByTagName('script'); |
| | 10 | var this_script = scripts[scripts.length - 1]; |
| | 11 | |
| | 12 | // We'll allow two ways to specify arguments. We'll accept them in the |
| | 13 | // argument of the script, or we'll accept them embedded into our script tag. |
| | 14 | var args = this_script.src.split('?'); |
| | 15 | args = args.length == 2 ? args[1].split('&') : ''; |
| | 16 | for (var index = 0; index < args.length; ++index) |
| | 17 | { |
| | 18 | var arg = args[index].split('='); |
| | 19 | if (arg.length == 2) |
| | 20 | { |
| | 21 | switch (arg[0]) |
| | 22 | { |
| | 23 | case 'lang': |
| | 24 | case 'icons': |
| | 25 | case 'skin': |
| | 26 | case 'url': |
| | 27 | window['_editor_' + arg[0]] = arg[1]; |
| | 28 | break; |
| 24 | | } |
| 25 | | } |
| 26 | | |
| 27 | | // We can grab the script innerHTML and execute that to cut down on script |
| 28 | | // tags. Thanks John Resig! |
| 29 | | // http://ejohn.org/blog/degrading-script-tags/ |
| 30 | | if (this_script.innerHTML.replace(/\s+/,'')) { |
| | 30 | } |
| | 31 | } |
| | 32 | |
| | 33 | // We can grab the script innerHTML and execute that to cut down on script |
| | 34 | // tags. Thanks John Resig! |
| | 35 | // http://ejohn.org/blog/degrading-script-tags/ |
| | 36 | if (this_script.innerHTML.replace(/\s+/, '')) |
| | 37 | { |