dom/tests/mochitest/ajax/scriptaculous/src/scriptaculous.js

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 // script.aculo.us scriptaculous.js v1.7.1_beta2, Tue May 15 15:15:45 EDT 2007
michael@0 2
michael@0 3 // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
michael@0 4 //
michael@0 5 // Permission is hereby granted, free of charge, to any person obtaining
michael@0 6 // a copy of this software and associated documentation files (the
michael@0 7 // "Software"), to deal in the Software without restriction, including
michael@0 8 // without limitation the rights to use, copy, modify, merge, publish,
michael@0 9 // distribute, sublicense, and/or sell copies of the Software, and to
michael@0 10 // permit persons to whom the Software is furnished to do so, subject to
michael@0 11 // the following conditions:
michael@0 12 //
michael@0 13 // The above copyright notice and this permission notice shall be
michael@0 14 // included in all copies or substantial portions of the Software.
michael@0 15 //
michael@0 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
michael@0 17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
michael@0 18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
michael@0 19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
michael@0 20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
michael@0 21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
michael@0 22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
michael@0 23 //
michael@0 24 // For details, see the script.aculo.us web site: http://script.aculo.us/
michael@0 25
michael@0 26 var Scriptaculous = {
michael@0 27 Version: '1.7.1_beta2',
michael@0 28 require: function(libraryName) {
michael@0 29 // inserting via DOM fails in Safari 2.0, so brute force approach
michael@0 30 document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
michael@0 31 },
michael@0 32 REQUIRED_PROTOTYPE: '1.5.1',
michael@0 33 load: function() {
michael@0 34 function convertVersionString(versionString){
michael@0 35 var r = versionString.split('.');
michael@0 36 return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
michael@0 37 }
michael@0 38
michael@0 39 if((typeof Prototype=='undefined') ||
michael@0 40 (typeof Element == 'undefined') ||
michael@0 41 (typeof Element.Methods=='undefined') ||
michael@0 42 (convertVersionString(Prototype.Version) <
michael@0 43 convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
michael@0 44 throw("script.aculo.us requires the Prototype JavaScript framework >= " +
michael@0 45 Scriptaculous.REQUIRED_PROTOTYPE);
michael@0 46
michael@0 47 $A(document.getElementsByTagName("script")).findAll( function(s) {
michael@0 48 return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
michael@0 49 }).each( function(s) {
michael@0 50 var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
michael@0 51 var includes = s.src.match(/\?.*load=([a-z,]*)/);
michael@0 52 (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
michael@0 53 function(include) { Scriptaculous.require(path+include+'.js') });
michael@0 54 });
michael@0 55 }
michael@0 56 }
michael@0 57
michael@0 58 Scriptaculous.load();

mercurial