From fa25f2a477ca6820ddba93493b806e9cfdd4775d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Sat, 5 Jul 2014 23:30:07 +0200 Subject: [PATCH] Remove examples/loader.js That script was used when Plovr was used for running the examples. --- build.py | 1 - examples/loader.js | 64 ---------------------------------------------- 2 files changed, 65 deletions(-) delete mode 100644 examples/loader.js diff --git a/build.py b/build.py index 58a259e17a..93e13d57bf 100755 --- a/build.py +++ b/build.py @@ -100,7 +100,6 @@ EXAMPLES_SRC = [path if not path.startswith('examples/bootstrap') if path != 'examples/Jugl.js' if path != 'examples/jquery.min.js' - if path != 'examples/loader.js' if path != 'examples/example-list.js'] EXAMPLES_JSON = ['build/' + example.replace('.html', '.json') diff --git a/examples/loader.js b/examples/loader.js deleted file mode 100644 index 603b500d29..0000000000 --- a/examples/loader.js +++ /dev/null @@ -1,64 +0,0 @@ - - -/** - * Loader to add the plovr generated script to the document. - * - * The following default values may be overridden with query string - * parameters: - * - * * hostname - the current hostname (window.location.hostname) - * * port - 9810 - * * mode - RAW - * * id - id param in loader.js query string; defaults to 'ol' if not set - * - * Usage: - * - * - */ -(function() { - var scripts = document.getElementsByTagName('script'); - var params = { - hostname: window.location.hostname, - port: '9810', - mode: 'RAW', - id: 'ol' - }; - if (window.location.protocol === 'file:' && !params.hostname) { - params.hostname = 'localhost'; - } - var chunks, search, pair; - - var src, index, id, i; - for (i = scripts.length - 1; i >= 0; --i) { - src = scripts[i].getAttribute('src'); - if (~(index = src.indexOf('loader.js?'))) { - // script params - search = src.substr(index + 10); - chunks = search ? search.split('&') : []; - for (i = chunks.length - 1; i >= 0; --i) { - pair = chunks[i].split('='); - params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); - } - break; - } - } - // url params - search = window.location.search.substring(1); - chunks = search ? search.split('&') : []; - for (i = chunks.length - 1; i >= 0; --i) { - pair = chunks[i].split('='); - params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); - } - - var host = params.hostname + ':' + params.port; - delete params.hostname; - delete params.port; - - var pairs = []; - for (var key in params) { - pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key])); - } - - var url = 'http://' + host + '/compile?' + pairs.join('&'); - document.write(''); -}());