http://trac.tiddlywiki.org/changeset/9741
JeremyRuston 2009-05-19 09:55:53 +0000 (Tue, 19 May 2009) 46 [fileplugin] Minor refactorings and commenting --------------- U Trunk/core/jquery/plugins/jquery.file.js --------------- Modified: Trunk/core/jquery/plugins/jquery.file.js =================================================================== --- Trunk/core/jquery/plugins/jquery.file.js 2009-05-19 09:13:22 UTC (rev 9740) +++ Trunk/core/jquery/plugins/jquery.file.js 2009-05-19 09:55:53 UTC (rev 9741) @@ -5,7 +5,8 @@ Copyright (c) UnaMesa Association 2009 -Dual licensed under the MIT and GPL licenses: +Triple licensed under the BSD, MIT and GPL licenses: + http://www.opensource.org/licenses/bsd-license.php http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl.html */ @@ -28,6 +29,9 @@ } return this.currentDriver; }, + init: function() { + this.getDriver(); + }, load: function(filePath) { return this.getDriver().loadFile(filePath); }, @@ -41,11 +45,21 @@ return false; } }); + + // Deferred initialisation for any drivers that need it + $(function() { + for(var t in drivers) { + if(drivers[t].deferredInit) + drivers[t].deferredInit(); + } + }); - // Private implementations for each browser + // Private driver implementations for each browser var drivers = {}; + // Internet Explorer driver + drivers.activeX = { name: "activeX", isAvailable: function() { @@ -118,7 +132,9 @@ return true; } }; - + + // Mozilla driver + drivers.mozilla = { name: "mozilla", isAvailable: function() { @@ -178,13 +194,11 @@ } }; - $(function() { - drivers.tiddlySaver.loadApplet(); - }); + // TiddlySaver driver drivers.tiddlySaver = { name: "tiddlySaver", - loadApplet: function() { + deferredInit: function() { if(!document.applets["TiddlySaver"] && !$.browser.mozilla && !$.browser.msie) { $(document.body).append("<applet style='position:absolute;left:-1px' name='TiddlySaver' code='TiddlySaver.class' archive='TiddlySaver.jar' width='1'height='1'></applet>"); } @@ -213,6 +227,8 @@ } } + // Java LiveConnect driver + drivers.javaLiveConnect = { name: "javaLiveConnect", isAvailable: function() { @@ -243,6 +259,8 @@ return true; } } + + // Private utilities function javaUrlToFilename(url) { var f = "//localhost"; --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/TiddlyWikiDev?hl=en -~----------~----~----~----~------~----~------~--~---
