From 3ed5c92361ff4f6685acdfd46b5a47426ae6ce58 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 16 Jun 2015 19:13:10 +0100 Subject: [PATCH] Remove the tw2 edition It was used for testing the TW2 build process, but now we can use https://github.com/tiddlywiki/tiddlywiki.com for that --- editions/tw2/source/tiddlywiki.com/README.md | 63 - editions/tw2/source/tiddlywiki.com/bld | 17 - .../source/tiddlywiki.com/empty.html.recipe | 1 - editions/tw2/source/tiddlywiki.com/ginsu | 14 - .../source/tiddlywiki.com/index.html.recipe | 3 - editions/tw2/source/tiddlywiki.com/pull.sh | 58 - .../tw2/source/tiddlywiki.com/tiddler2tid | 53 - .../tiddlywiki-com-ref/Basic_Formatting.tid | 18 - .../tiddlywiki-com-ref/CSS_Formatting.tid | 31 - .../tiddlywiki-com-ref/CamelCase.tid | 6 - .../tiddlywiki-com-ref/Code_Formatting.tid | 17 - .../ColorPalette_shadows.tid | 27 - .../tiddlywiki-com-ref/Date_Formats.tid | 36 - .../tiddlywiki-com-ref/DefaultTiddlers.tid | 7 - .../DefaultTiddlers_shadows.tid | 19 - .../EditTemplate_shadows.tid | 34 - .../GettingStarted_shadows.tid | 13 - .../HTML_Entities_Formatting.tid | 18 - .../tiddlywiki-com-ref/HTML_Formatting.tid | 20 - .../Headings_Formatting.tid | 22 - .../Horizontal_Rule_Formatting.tid | 27 - .../tiddlywiki-com-ref/Image_Formatting.tid | 41 - .../Line_Break_Formatting.tid | 13 - .../tiddlywiki-com-ref/Link_Formatting.tid | 71 - .../tiddlywiki-com-ref/List_Formatting.tid | 44 - .../tiddlywiki-com-ref/MacrosContent.tid | 23 - .../tiddlywiki-com-ref/MainMenu_shadows.tid | 8 - .../tiddlywiki-com-ref/MarkupPreHead.tid | 11 - .../PageTemplate_shadows.tid | 35 - .../PluginManager_shadows.tid | 11 - .../Quotations_Formatting.tid | 29 - .../tiddlywiki-com-ref/Reference.tid | 8 - .../tiddlywiki-com-ref/ReferenceContent.tid | 26 - .../ShadowTiddlersContent.tid | 24 - .../SideBarOptions_shadows.tid | 15 - .../tiddlywiki-com-ref/SiteSubtitle.tid | 7 - .../SiteSubtitle_shadows.tid | 17 - .../tiddlywiki-com-ref/SiteTitle.tid | 7 - .../tiddlywiki-com-ref/SiteTitle_shadows.tid | 12 - .../tiddlywiki-com-ref/StyleSheet_shadows.tid | 19 - .../Suppressing_Formatting.tid | 22 - .../tiddlywiki-com-ref/TabAll_shadows.tid | 12 - .../TabMoreMissing_shadows.tid | 12 - .../TabMoreOrphans_shadows.tid | 12 - .../TabMoreShadowed_shadows.tid | 12 - .../TabTimeline_shadows.tid | 12 - .../tiddlywiki-com-ref/Tables_Formatting.tid | 112 - .../ViewTemplate_shadows.tid | 40 - .../tiddlywiki-com-ref/WikiTextContent.tid | 20 - .../tiddlywiki-com-ref/WikiWord.tid | 6 - .../WindowTitle_shadows.tid | 21 - .../tiddlywiki-com-ref/allTags_macro.tid | 15 - .../anotherTiddlerToTransclude.tid | 6 - .../tiddlywiki-com-ref/closeAll_macro.tid | 14 - .../tiddlywiki-com-ref/list_macro.tid | 37 - .../tiddlywiki-com-ref/newJournal_macro.tid | 14 - .../tiddlywiki-com-ref/newTiddler_macro.tid | 22 - .../tiddlywiki-com-ref/options_macro.tid | 17 - .../tiddlywiki-com-ref/permaview_macro.tid | 14 - .../tiddlywiki-com-ref/saveChanges_macro.tid | 23 - .../tiddlywiki-com-ref/search_macro.tid | 22 - .../tiddlywiki-com-ref/slider_macro.tid | 20 - .../tiddlywiki-com-ref/split.recipe | 64 - .../tiddlywiki-com-ref/tabs_macro.tid | 25 - .../tiddlywiki-com-ref/tag_macro.tid | 17 - .../tiddlywiki-com-ref/tagging_macro.tid | 19 - .../tiddlywiki-com-ref/tags_macro.tid | 14 - .../tiddlerToTransclude.tid | 6 - .../tiddlywiki-com-ref/tiddler_macro.tid | 35 - .../tiddlywiki-com-refSetupFlag.tid | 8 - .../tiddlywiki-com-ref/timeline_macro.tid | 24 - .../tiddlywiki-com-ref/today_macro.tid | 21 - .../tiddlywiki-com-ref/version_macro.tid | 13 - .../tiddlywiki-com-ref/view_macro.tid | 16 - .../tiddlywiki-com-ref/view_macro_types.tid | 45 - .../tiddlywiki-com/AbegoSoftwareServer.tid | 10 - .../Advanced_download_options.tid | 17 - .../AnotherExampleStyleSheet.tid | 49 - .../tiddlywiki-com/AutoSave.tid | 10 - .../tiddlywiki-com/BackstageArea.tid | 12 - .../tiddlywiki-com/BidiXTWServer.tid | 10 - .../tiddlywiki-com/BobsPluginsServer.tid | 10 - .../tiddlywiki-com/Browsers.tid | 23 - .../tiddlywiki.com/tiddlywiki-com/Camino.tid | 8 - .../tiddlywiki-com/CancelTiddlerCommand.tid | 11 - .../tiddlywiki-com/CharacterEncoding.tid | 12 - .../tiddlywiki.com/tiddlywiki-com/Chrome.tid | 9 - .../tiddlywiki-com/CloseOthersCommand.tid | 11 - .../tiddlywiki-com/CloseTiddlerCommand.tid | 11 - .../tiddlywiki-com/ColorPalette.tid | 24 - .../tiddlywiki-com/Community.tid | 17 - .../Configuration.SideBarTabs.tid | 9 - .../tiddlywiki-com/Configuration.tid | 21 - .../tiddlywiki-com/ContentsSlider.tid | 8 - .../tiddlywiki-com/Contribute.tid | 12 - .../tiddlywiki-com/CustomMarkup.tid | 14 - .../tiddlywiki-com/CustomStyleSheet.tid | 10 - .../tiddlywiki-com/Customisation.tid | 16 - .../tiddlywiki-com/DefaultTiddlers.tid | 7 - .../tiddlywiki-com/DeleteTiddlerCommand.tid | 11 - .../tiddlywiki-com/DeveloperDocumentation.tid | 10 - .../tiddlywiki-com/DiscussionForums.tid | 15 - .../tiddlywiki-com/Download.tid | 8 - .../DownloadTiddlyWikiPlugin.js | 52 - .../DownloadTiddlyWikiPlugin.js.meta | 6 - .../tiddlywiki-com/Downloading.tid | 21 - ...oading_guidelines__Firefox_on_Mac_OS_X.tid | 25 - ...nloading_guidelines__Firefox_on_Ubuntu.tid | 25 - ...loading_guidelines__Firefox_on_Windows.tid | 7 - ...g_guidelines__Firefox_on_Windows_Vista.tid | 23 - ...ding_guidelines__Firefox_on_Windows_XP.tid | 22 - ...idelines__Internet_Explorer_on_Windows.tid | 7 - ...es__Internet_Explorer_on_Windows_Vista.tid | 39 - ...lines__Internet_Explorer_on_Windows_XP.tid | 38 - ...nloading_guidelines__Opera_on_Mac_OS_X.tid | 27 - ...loading_guidelines__Safari_on_Mac_OS_X.tid | 27 - .../tiddlywiki-com/EditTiddlerCommand.tid | 11 - .../tiddlywiki.com/tiddlywiki-com/Editing.tid | 16 - .../tiddlywiki-com/ExamplePlugin.js | 21 - .../tiddlywiki-com/ExamplePlugin.js.meta | 6 - .../tiddlywiki-com/ExampleStyleSheet.tid | 10 - .../tiddlywiki-com/ExampleSystemConfig.tid | 10 - .../tiddlywiki-com/Examples.tid | 31 - .../tiddlywiki-com/Feedback.tid | 7 - .../tiddlywiki.com/tiddlywiki-com/FireFox.tid | 20 - .../tiddlywiki-com/FireFoxKeyboardIssue.tid | 8 - .../tiddlywiki-com/FlickrBadge.tid | 23 - .../tiddlywiki-com/GenerateAnRssFeed.tid | 10 - .../tiddlywiki-com/GettingStarted.tid | 15 - .../tiddlywiki-com/GettingStarted_shadows.tid | 12 - .../tiddlywiki-com/GreaseMonkey.tid | 8 - .../tiddlywiki-com/GuerillaWiki.tid | 12 - .../tiddlywiki-com/HelloThere.tid | 12 - .../tiddlywiki-com/Help_and_Support.tid | 15 - .../tiddlywiki-com/HideEditingFeatures.tid | 16 - .../tiddlywiki.com/tiddlywiki-com/History.tid | 11 - .../tiddlywiki-com/HostedOptions.tid | 27 - .../tiddlywiki-com/HowToUpgrade.tid | 15 - .../HowToUpgradeOlderTiddlyWikis.tid | 18 - .../tiddlywiki-com/HtmlEntities.tid | 37 - .../tiddlywiki-com/Importing_Tiddlers.tid | 18 - .../tiddlywiki-com/IncrementalSearch.tid | 8 - .../tiddlywiki-com/InstallingPlugins.tid | 10 - .../tiddlywiki-com/InterfaceOptions.tid | 16 - .../tiddlywiki-com/InternetExplorer.tid | 14 - .../tiddlywiki-com/JavaScript.tid | 8 - .../tiddlywiki-com/JeremyRuston.tid | 10 - .../tiddlywiki-com/JumpCommand.tid | 11 - .../tiddlywiki-com/KeyboardShortcuts.tid | 21 - .../tiddlywiki.com/tiddlywiki-com/Licence.tid | 7 - .../tiddlywiki-com/LikeThis.tid | 7 - .../tiddlywiki-com/LinkToFolders.tid | 10 - .../tiddlywiki-com/Link_Formatting.tid | 70 - .../tiddlywiki-com/MainMenu.tid | 21 - .../ManuallyInstallIngPlugins.tid | 21 - .../tiddlywiki-com/MarkupPreHead.tid | 12 - .../tiddlywiki-com/MartinsPluginsServer.tid | 10 - .../tiddlywiki-com/Mathematics.tid | 12 - .../tiddlywiki-com/MicroContent.tid | 10 - .../tiddlywiki-com/MinorChanges.tid | 7 - .../tiddlywiki-com/MissingTiddlers.tid | 8 - .../tiddlywiki-com/MobileDevices.tid | 16 - .../tiddlywiki-com/MonkeyPirateTWServer.tid | 10 - .../tiddlywiki.com/tiddlywiki-com/MoreTab.tid | 8 - .../tiddlywiki-com/NestedStyleSheets.tid | 18 - .../tiddlywiki-com/NestedTemplates.tid | 16 - .../tiddlywiki-com/OpenSourceLicense.tid | 8 - .../tiddlywiki.com/tiddlywiki-com/Opera.tid | 8 - .../tiddlywiki-com/OrphanTiddlers.tid | 8 - .../tiddlywiki-com/Osmosoft.tid | 11 - .../tiddlywiki-com/PageTemplate.tid | 26 - .../tiddlywiki-com/ParameterParser.tid | 24 - .../tiddlywiki-com/PeachTWServer.tid | 10 - .../tiddlywiki-com/PeriodicTable.tid | 36 - .../tiddlywiki-com/PermaView.tid | 10 - .../tiddlywiki-com/PermalinkCommand.tid | 13 - .../tiddlywiki-com/PersistentOptions.tid | 21 - .../tiddlywiki-com/PlainText.tid | 17 - .../tiddlywiki-com/PluginFormat.tid | 21 - .../tiddlywiki-com/PluginFormatting.tid | 41 - .../tiddlywiki.com/tiddlywiki-com/Plugins.tid | 14 - .../PrinceTiddlyWikiExtensionsServer.tid | 10 - .../PublicationsAndArticles.tid | 19 - .../tiddlywiki.com/tiddlywiki-com/Raves.tid | 15 - .../tiddlywiki-com/RedMountainVistaServer.tid | 10 - .../tiddlywiki-com/ReferencesButton.tid | 10 - .../tiddlywiki-com/ReferencesCommand.tid | 11 - .../tiddlywiki-com/RegExpSearch.tid | 8 - .../tiddlywiki.com/tiddlywiki-com/RssFeed.tid | 8 - .../tiddlywiki.com/tiddlywiki-com/Safari.tid | 11 - .../tiddlywiki-com/SafeMode.tid | 8 - .../tiddlywiki-com/SaveBackups.tid | 8 - .../tiddlywiki-com/SaveChanges.tid | 16 - .../tiddlywiki-com/SaveEmptyTemplate.tid | 10 - .../tiddlywiki-com/SaveTiddlerCommand.tid | 11 - .../tiddlywiki-com/SaveUnpredictabilities.tid | 10 - .../tiddlywiki.com/tiddlywiki-com/Search.tid | 13 - .../tiddlywiki-com/SelfContained.tid | 8 - .../tiddlywiki-com/ServerSide.tid | 10 - .../tiddlywiki-com/ServicePack2Problems.tid | 16 - .../tiddlywiki-com/ShadowTiddlers.tid | 12 - .../tiddlywiki-com/SideBarOptions.tid | 8 - .../tiddlywiki-com/SimpleSearchPlugin.js | 153 - .../tiddlywiki-com/SimpleSearchPlugin.js.meta | 6 - .../tiddlywiki-com/SiteSubtitle.tid | 7 - .../SiteSubtitle_shadow_tiddlers.tid | 16 - .../tiddlywiki-com/SiteTitle.tid | 8 - .../tiddlywiki.com/tiddlywiki-com/SiteUrl.tid | 7 - .../tiddlywiki-com/SpecialTags.tid | 12 - .../tiddlywiki-com/SpecialTiddlers.tid | 12 - .../tiddlywiki-com/StartupParameters.tid | 25 - .../tiddlywiki-com/StyleSheet.tid | 62 - .../tiddlywiki-com/Suppressing_Formatting.tid | 21 - .../tiddlywiki.com/tiddlywiki-com/Tags.tid | 16 - .../tiddlywiki.com/tiddlywiki-com/Tiddler.tid | 12 - .../tiddlywiki-com/TiddlerComments.tid | 10 - .../tiddlywiki-com/TiddlerSlicing.tid | 43 - .../tiddlywiki-com/TiddlyBookmarklets.tid | 15 - .../tiddlywiki-com/TiddlySaver.tid | 14 - .../tiddlywiki-com/TiddlyStylesServer.tid | 8 - .../tiddlywiki-com/TiddlyToolsServer.tid | 10 - .../tiddlywiki-com/TiddlyWiki.tid | 10 - .../tiddlywiki-com/TiddlyWikiAdaptations.tid | 25 - .../tiddlywiki-com/TiddlyWikiFiction.tid | 11 - .../TiddlyWiki_Browser_Compatibility.tid | 21 - .../tiddlywiki-com/ToggleLinks.tid | 10 - .../tiddlywiki-com/ToolbarButtons.tid | 21 - .../tiddlywiki-com/TutorialsAndGuides.tid | 12 - .../tiddlywiki.com/tiddlywiki-com/UnaMesa.tid | 7 - .../tiddlywiki-com/VistaIssues.tid | 10 - .../tiddlywiki-com/VisualTWServer.tid | 9 - .../tiddlywiki.com/tiddlywiki-com/Wii.tid | 7 - .../tiddlywiki-com/WikiOnAStick.tid | 10 - .../tiddlywiki-com/WikiWikiWeb.tid | 12 - .../tiddlywiki-com/WritingStyle.tid | 8 - .../tiddlywiki-com/brixhamharbour.jpg.tid | 6 - .../tiddlywiki.com/tiddlywiki-com/example.tid | 7 - .../tiddlywiki-com/favicon.ico.tid | 6 - .../tiddlywiki-com/field.jpg.tid | 6 - .../tiddlywiki-com/forest.jpg.tid | 6 - .../tiddlywiki-com/fractalveg.jpg.tid | 6 - .../tiddlywiki.com/tiddlywiki-com/iPhone.tid | 7 - .../tiddlywiki-com/split.recipe | 160 - .../tiddlywiki-com/systemServer.tid | 28 - .../tiddlywiki-comSetupFlag.tid | 8 - .../tiddlywiki-com/translations.tid | 10 - editions/tw2/source/tiddlywiki.com/upload | 70 - editions/tw2/source/tiddlywiki/ALPHA | 1 - editions/tw2/source/tiddlywiki/Makefile | 22 - editions/tw2/source/tiddlywiki/README | 12 - editions/tw2/source/tiddlywiki/bldalpha | 18 - editions/tw2/source/tiddlywiki/bldxjs | 18 - editions/tw2/source/tiddlywiki/cook | 24 - .../source/tiddlywiki/deprecated/Crypto.js | 44 - .../tiddlywiki/deprecated/Deprecated.js | 90 - .../tiddlywiki/deprecated/FileAdaptor.js | 20 - .../tw2/source/tiddlywiki/deprecated/Http.js | 26 - .../source/tiddlywiki/deprecated/Numbers.js | 16 - .../source/tiddlywiki/deprecated/Strings.js | 29 - .../source/tiddlywiki/deprecated/Tiddler.js | 22 - .../source/tiddlywiki/deprecated/Utilities.js | 38 - .../source/tiddlywiki/deprecated/Wikifier.js | 16 - .../source/tiddlywiki/deprecated/split.recipe | 10 - .../tw2/source/tiddlywiki/html/copyright.txt | 29 - .../tw2/source/tiddlywiki/html/externaljs.txt | 3 - .../html/externaljs_tiddlyspace.txt | 3 - .../html/externaljs_tiddlyspace_alpha.txt | 3 - .../html/externaljs_tiddlyspace_beta.txt | 3 - .../tw2/source/tiddlywiki/html/noscript.txt | 3 - .../tw2/source/tiddlywiki/html/rss.link.html | 1 - .../tw2/source/tiddlywiki/html/split.recipe | 4 - .../tiddlywiki/html/splitnonoscript.recipe | 3 - editions/tw2/source/tiddlywiki/html/style.txt | 7 - .../tiddlywiki/html/tiddlywiki.template.html | 92 - .../tw2/source/tiddlywiki/jquery/jquery.js | 4 - .../plugins/doc/encoding.digests.sha1.html | 43 - .../tiddlywiki/jquery/plugins/doc/index.html | 31 - .../jquery/plugins/doc/styles/main.css | 78 - .../tiddlywiki/jquery/plugins/doc/twFile.html | 124 - .../jquery/plugins/doc/twFileDemo.html | 435 - .../jquery/plugins/doc/twStylesheet.html | 94 - .../tiddlywiki/jquery/plugins/doc/update | 13 - .../plugins/jQuery.encoding.digests.sha1.js | 155 - .../jquery/plugins/jQuery.twFile.js | 333 - .../jquery/plugins/jQuery.twStylesheet.js | 64 - .../jquery/plugins/jquery.gettext-1.0.4.js | 139 - .../jquery/plugins/obsolete/jquery.tw.js | 10 - .../plugins/obsolete/jquery.tw.macro.js | 58 - .../plugins/obsolete/jquery.tw.macro.today.js | 15 - .../tiddlywiki/jquery/plugins/split.recipe | 2 - .../jquery/plugins/test/TiddlySaver.jar | Bin 5012 -> 0 bytes .../jquery/plugins/test/jQuery.twFile.html | 25 - .../plugins/test/jQuery.twStylesheet.html | 25 - .../jquery/plugins/test/js/jQuery.twFile.js | 86 - .../plugins/test/js/jQuery.twStylesheet.js | 69 - .../tiddlywiki/jquery/plugins/test/sample.txt | 5 - .../tw2/source/tiddlywiki/jquery/split.recipe | 2 - .../tw2/source/tiddlywiki/js/AdaptorBase.js | 90 - editions/tw2/source/tiddlywiki/js/Animator.js | 46 - .../tw2/source/tiddlywiki/js/Backstage.js | 187 - .../tw2/source/tiddlywiki/js/BasicTypes.js | 103 - editions/tw2/source/tiddlywiki/js/Commands.js | 178 - editions/tw2/source/tiddlywiki/js/Config.js | 227 - .../tw2/source/tiddlywiki/js/ConfigBrowser.js | 30 - editions/tw2/source/tiddlywiki/js/Crypto.js | 143 - editions/tw2/source/tiddlywiki/js/Dates.js | 119 - editions/tw2/source/tiddlywiki/js/Dom.js | 264 - .../tw2/source/tiddlywiki/js/FileAdaptor.js | 185 - .../tw2/source/tiddlywiki/js/FileSystem.js | 311 - editions/tw2/source/tiddlywiki/js/Filters.js | 61 - .../tw2/source/tiddlywiki/js/Formatter.js | 529 - .../source/tiddlywiki/js/FormatterHelpers.js | 94 - editions/tw2/source/tiddlywiki/js/Guide.js | 12 - editions/tw2/source/tiddlywiki/js/Http.js | 75 - editions/tw2/source/tiddlywiki/js/Import.js | 390 - editions/tw2/source/tiddlywiki/js/Lingo.js | 500 - editions/tw2/source/tiddlywiki/js/ListView.js | 275 - .../tw2/source/tiddlywiki/js/LoaderSaver.js | 59 - editions/tw2/source/tiddlywiki/js/Macros.js | 567 - editions/tw2/source/tiddlywiki/js/Manager.js | 99 - editions/tw2/source/tiddlywiki/js/Messages.js | 44 - editions/tw2/source/tiddlywiki/js/Morpher.js | 85 - .../tw2/source/tiddlywiki/js/NewTiddler.js | 81 - editions/tw2/source/tiddlywiki/js/Numbers.js | 15 - editions/tw2/source/tiddlywiki/js/Options.js | 312 - .../tw2/source/tiddlywiki/js/Paramifiers.js | 135 - editions/tw2/source/tiddlywiki/js/Popup.js | 104 - editions/tw2/source/tiddlywiki/js/RGB.js | 59 - editions/tw2/source/tiddlywiki/js/Refresh.js | 192 - editions/tw2/source/tiddlywiki/js/Saving.js | 248 - .../tw2/source/tiddlywiki/js/SavingRSS.js | 57 - editions/tw2/source/tiddlywiki/js/Scroller.js | 10 - editions/tw2/source/tiddlywiki/js/Search.js | 81 - editions/tw2/source/tiddlywiki/js/Slider.js | 35 - .../tw2/source/tiddlywiki/js/Sparkline.js | 56 - editions/tw2/source/tiddlywiki/js/Story.js | 712 - editions/tw2/source/tiddlywiki/js/Strings.js | 298 - editions/tw2/source/tiddlywiki/js/Sync.js | 222 - .../tw2/source/tiddlywiki/js/TW21Loader.js | 55 - .../tw2/source/tiddlywiki/js/TW21Saver.js | 42 - editions/tw2/source/tiddlywiki/js/Tabs.js | 65 - editions/tw2/source/tiddlywiki/js/Tiddler.js | 207 - .../tw2/source/tiddlywiki/js/TiddlerFields.js | 173 - .../tw2/source/tiddlywiki/js/TiddlyWiki.js | 645 - editions/tw2/source/tiddlywiki/js/Toolbar.js | 161 - editions/tw2/source/tiddlywiki/js/Upgrade.js | 117 - .../tw2/source/tiddlywiki/js/Utilities.js | 285 - .../source/tiddlywiki/js/UtilitiesPopup.js | 113 - editions/tw2/source/tiddlywiki/js/Version.js | 1 - editions/tw2/source/tiddlywiki/js/Wikifier.js | 237 - editions/tw2/source/tiddlywiki/js/Wizard.js | 69 - editions/tw2/source/tiddlywiki/js/Zoomer.js | 21 - editions/tw2/source/tiddlywiki/js/main.js | 236 - .../tw2/source/tiddlywiki/js/split.recipe | 54 - .../recipes/empty.2.0.11.html.recipe | 2 - .../recipes/empty.2.1.0.html.recipe | 3 - .../recipes/empty.2.1.3.html.recipe | 3 - .../recipes/empty.2.2.0.html.recipe | 3 - .../recipes/empty.2.2.5.html.recipe | 3 - .../recipes/empty.2.2.6.html.recipe | 3 - .../recipes/empty.2.3.0.html.recipe | 3 - .../recipes/empty.2.4.0.html.recipe | 1 - .../recipes/empty.2.4.1.html.recipe | 1 - .../recipes/empty.2.4.2.html.recipe | 1 - .../recipes/empty.2.4.3.html.recipe | 1 - .../recipes/empty.2.5.0.html.recipe | 1 - .../recipes/empty.2.5.1.html.recipe | 1 - .../recipes/empty.2.5.2.html.recipe | 1 - .../recipes/empty.2.5.3.html.recipe | 1 - .../recipes/empty.2.6.0.html.recipe | 1 - .../tiddlywiki/shadows/ColorPalette.tiddler | 18 - .../tiddlywiki/shadows/EditTemplate.tiddler | 10 - .../tiddlywiki/shadows/GettingStarted.tiddler | 7 - .../tiddlywiki/shadows/ImportTiddlers.tiddler | 3 - .../tiddlywiki/shadows/MarkupPreHead.tiddler | 6 - .../tiddlywiki/shadows/OptionsPanel.tiddler | 15 - .../tiddlywiki/shadows/PageTemplate.tiddler | 23 - .../shadows/StyleSheetColors.tiddler | 136 - .../shadows/StyleSheetLayout.tiddler | 172 - .../shadows/StyleSheetLocale.tiddler | 14 - .../shadows/StyleSheetPrint.tiddler | 9 - .../tiddlywiki/shadows/ViewTemplate.tiddler | 11 - .../source/tiddlywiki/shadows/split.recipe | 13 - editions/tw2/source/tiddlywiki/test/README | 12 - .../tiddlywiki/test/html/qunitpostscript.txt | 4 - .../source/tiddlywiki/test/html/split.recipe | 1 - .../tiddlywiki/test/html/testpostscript.txt | 4 - .../source/tiddlywiki/test/jqMock/jqMock.html | 25 - .../source/tiddlywiki/test/jqMock/jqMock.js | 590 - .../tiddlywiki/test/jqMock/jqMockTest.js | 927 -- .../tiddlywiki/test/jqMock/split.recipe | 1 - .../tw2/source/tiddlywiki/test/js/Animator.js | 32 - .../tw2/source/tiddlywiki/test/js/Arrays.js | 220 - .../source/tiddlywiki/test/js/BasicTypes.js | 244 - .../tw2/source/tiddlywiki/test/js/Crypto.js | 27 - editions/tw2/source/tiddlywiki/test/js/DOM.js | 81 - .../tw2/source/tiddlywiki/test/js/Dates.js | 477 - .../tw2/source/tiddlywiki/test/js/Encoding.js | 29 - .../source/tiddlywiki/test/js/FileSystem.js | 55 - .../tw2/source/tiddlywiki/test/js/Filters.js | 158 - .../tiddlywiki/test/js/LoadingSaving.js | 99 - .../tw2/source/tiddlywiki/test/js/Macros.js | 359 - .../tw2/source/tiddlywiki/test/js/Numbers.js | 28 - .../tw2/source/tiddlywiki/test/js/Options.js | 29 - editions/tw2/source/tiddlywiki/test/js/RGB.js | 43 - .../source/tiddlywiki/test/js/SavingRSS.js | 117 - .../tw2/source/tiddlywiki/test/js/Shadows.js | 21 - .../tw2/source/tiddlywiki/test/js/Strings.js | 70 - .../source/tiddlywiki/test/js/TW21Saver.js | 51 - .../tw2/source/tiddlywiki/test/js/Tiddler.js | 90 - .../tiddlywiki/test/js/TiddlerFields.js | 23 - .../source/tiddlywiki/test/js/TiddlyWiki.js | 470 - .../source/tiddlywiki/test/js/Utilities.js | 572 - .../tw2/source/tiddlywiki/test/js/Version.js | 58 - .../tw2/source/tiddlywiki/test/js/Wikifier.js | 193 - .../tw2/source/tiddlywiki/test/js/Wizard.js | 59 - .../tw2/source/tiddlywiki/test/js/Zoomer.js | 32 - .../source/tiddlywiki/test/js/split.recipe | 26 - .../tw2/source/tiddlywiki/test/js/template.js | 11 - .../test/qunit/delayTestExecution.js | 9 - .../source/tiddlywiki/test/qunit/qunit.css | 163 - .../tw2/source/tiddlywiki/test/qunit/qunit.js | 1297 -- .../tiddlywiki/test/qunit/raiseAssertion.js | 35 - .../source/tiddlywiki/test/qunit/split.recipe | 4 - .../source/tiddlywiki/test/recipes/sample.txt | 7 - .../recipes/shadows/DefaultTiddlers.tiddler | 3 - .../test/recipes/shadows/MainMenu.tiddler | 3 - .../recipes/shadows/SideBarOptions.tiddler | 3 - .../test/recipes/shadows/SideBarTabs.tiddler | 3 - .../test/recipes/shadows/split.recipe | 4 - .../tiddlywiki/test/recipes/tests.html.recipe | 18 - .../tw2/source/tiddlywiki/test/reporter.html | 55 - .../tw2/source/tiddlywiki/test/reporter.php | 16 - .../tiddlywiki/test/testdata/split.recipe | 3 - .../tiddlywiki/test/testdata/testTiddler1.tid | 6 - .../tiddlywiki/test/testdata/testTiddler2.tid | 17 - .../tiddlywiki/test/testdata/testTiddler3.tid | 10 - editions/tw2/source/tiddlywiki/tests/README | 11 - .../source/tiddlywiki/tests/html/test.recipe | 4 - .../tiddlywiki/tests/html/test.template.html | 64 - .../tiddlywiki/tests/html/testAll.html.recipe | 23 - .../tests/html/testAll.template.html | 20 - .../tests/html/testAnimator.html.recipe | 4 - .../tests/html/testBasicTypes.html.recipe | 4 - .../tests/html/testContributors.recipe | 4 - .../tests/html/testContributors.template.html | 63 - .../tests/html/testContributors2.recipe | 4 - .../html/testContributors2.template.html | 63 - .../tests/html/testContributorsMin.recipe | 1 - .../html/testContributorsMin.template.html | 19 - .../tests/html/testCrypto.html.recipe | 4 - .../tests/html/testDates.html.recipe | 4 - .../tiddlywiki/tests/html/testDom.html.recipe | 4 - .../tests/html/testFileSystem.html.recipe | 5 - .../tests/html/testGenerateRss.html.recipe | 6 - .../tests/html/testMacros.html.recipe | 5 - .../tests/html/testMessages.html.recipe | 5 - .../tests/html/testMocks.html.recipe | 5 - .../tiddlywiki/tests/html/testRGB.html.recipe | 6 - .../tests/html/testShadows.html.recipe | 3 - .../tests/html/testStrings.html.recipe | 4 - .../tests/html/testTW21Saver.html.recipe | 3 - .../tests/html/testTeamTasksPlugins.recipe | 4 - .../html/testTeamTasksPlugins.template.html | 64 - .../tests/html/testTiddler.html.recipe | 3 - .../tests/html/testTiddlyWiki.html.recipe | 5 - .../tests/html/testUtilities.html.recipe | 5 - .../tests/html/testVersion.html.recipe | 5 - .../tests/html/testWikifier.html.recipe | 5 - .../tests/html/testWizard.html.recipe | 4 - .../tiddlywiki/tests/html/testXML.html.recipe | 6 - .../tests/html/testZoomer.html.recipe | 4 - .../tiddlywiki/tests/html/testmin.recipe | 1 - .../tests/html/testmin.template.html | 21 - editions/tw2/source/tiddlywiki/tests/js/ckx | 7 - .../tw2/source/tiddlywiki/tests/js/mock.js | 65 - .../source/tiddlywiki/tests/js/tiddlywiki.js | 8358 ---------- .../tiddlywiki/tests/js/tiddlywiki.js.recipe | 2 - .../tests/js/tiddlywiki.template.js | 5 - .../tw2/source/tiddlywiki/tests/js/xml.js | 36 - .../tw2/source/tiddlywiki/tests/js/xpath.js | 626 - .../tests/jsspec/BasicTypes.jsspec.js | 287 - .../tiddlywiki/tests/jsspec/Macros.jsspec.js | 221 - .../tests/jsspec/Messages.jsspec.js | 39 - .../tiddlywiki/tests/jsspec/Mocks.jsspec.js | 82 - .../tiddlywiki/tests/jsspec/Strings.jsspec.js | 113 - .../tests/jsspec/Wikifier.jsspec.js | 519 - .../tiddlywiki/tests/jsspec/XML.jsspec.js | 38 - .../tiddlywiki/tests/jsspec/split.recipe | 8 - .../source/tiddlywiki/tiddlywiki.html.recipe | 6 - .../tiddlywiki_externaljs.html.recipe | 4 - ...dlywiki_externaljs_tiddlyspace.html.recipe | 4 - ...i_externaljs_tiddlyspace_alpha.html.recipe | 4 - .../tiddlywikinonoscript.html.recipe | 6 - editions/tw2/source/tiddlywiki/uploadalpha | 54 - editions/tw2/source/translations/README.md | 33 - .../locales/core/ca/empty.ca.html.recipe | 2 - .../locales/core/ca/locale.ca.2.5.2.js | 499 - .../locales/core/cs/empty.cs.html.recipe | 2 - .../translations/locales/core/cs/locale.cs.js | 488 - .../locales/core/cs/locale.cs.js.meta | 5 - .../translations/locales/core/de/locale.de.js | 530 - .../locales/core/el/empty.el.html.recipe | 2 - .../translations/locales/core/el/locale.el.js | 430 - .../locales/core/el/locale.el.js.meta | 5 - .../locales/core/en/Credits.tiddler | 6 - .../locales/core/en/DefaultTiddlers.tiddler | 5 - .../core/en/DownloadedSoftware.tiddler | 8 - .../locales/core/en/GettingStarted.tiddler | 7 - .../locales/core/en/OptionsPanel.tiddler | 15 - .../locales/core/en/TiddlyWiki.en.html.recipe | 7 - .../locales/core/en/empty.en.html.recipe | 2 - .../translations/locales/core/en/locale.en.js | 512 - .../locales/core/en/locale.en.js.meta | 5 - .../translations/locales/core/en/readme.txt | 20 - .../locales/core/es/TW243emptyES.html | 9901 ------------ .../locales/core/es/TW253emptyES.html | 9989 ------------ .../locales/core/es/TW260emptyES.html | 10176 ------------ .../locales/core/es/TW261emptyES.html | 10232 ------------ .../translations/locales/core/es/locale.es.js | 498 - .../locales/core/es/locale037.es.js | 492 - .../locales/core/es/locale040.es.js | 498 - .../translations/locales/core/es/readme.txt | 36 - .../locales/core/fr/empty.fr.html.recipe | 2 - .../translations/locales/core/fr/locale.fr.js | 518 - .../locales/core/fr/locale.fr.js.meta | 5 - .../locales/core/id/empty.id.html.recipe | 2 - .../translations/locales/core/id/locale.id.js | 457 - .../locales/core/id/locale.id.js.meta | 4 - .../translations/locales/core/ko/empty.html | 10246 ------------ .../translations/locales/core/ko/locale.ko.js | 514 - .../translations/locales/core/ko/readme.txt | 9 - .../locales/core/lv/empty.lv.html.recipe | 2 - .../translations/locales/core/lv/locale.lv.js | 457 - .../locales/core/lv/locale.lv.js.meta | 5 - .../locales/core/nl/TW224emptyNL.html | 9291 ----------- .../locales/core/nl/TW243emptyNL.html | 9908 ------------ .../locales/core/nl/TW253emptyNL.html | 9997 ------------ .../locales/core/nl/TW260emptyNL.html | 10185 ------------ .../locales/core/nl/TW261emptyNL.html | 10242 ------------ .../translations/locales/core/nl/locale.nl.js | 508 - .../locales/core/nl/locale025.nl.js | 465 - .../locales/core/nl/locale026.nl.js | 499 - .../locales/core/nl/locale030.nl.js | 506 - .../translations/locales/core/nl/readme.txt | 29 - .../locales/core/pl/AdvancedOptions.tiddler | 14 - .../locales/core/pl/GettingStarted.tiddler | 7 - .../locales/core/pl/OptionsPanel.tiddler | 16 - .../locales/core/pl/SzybkiStart.tiddler | 3 - .../locales/core/pl/TiddlyWiki.pl.html.recipe | 6 - .../translations/locales/core/pl/locale.pl.js | 314 - .../locales/core/pl/locale.pl.js.meta | 5 - .../locales/core/ru/empty.ru.html.recipe | 2 - .../translations/locales/core/ru/locale.ru.js | 497 - .../locales/core/ru/locale.ru.js.meta | 5 - .../locales/core/sv/Credits.tiddler | 6 - .../locales/core/sv/DefaultTiddlers.tiddler | 5 - .../core/sv/DownloadedSoftware.tiddler | 8 - .../locales/core/sv/GettingStarted.tiddler | 8 - .../locales/core/sv/OptionsPanel.tiddler | 15 - .../locales/core/sv/TiddlySaver.jar | Bin 5012 -> 0 bytes .../locales/core/sv/TiddlyWiki.en.html.recipe | 7 - .../locales/core/sv/empty.sv.html.recipe | 2 - .../translations/locales/core/sv/locale.sv.js | 491 - .../locales/core/sv/locale.sv.js.meta | 5 - .../translations/locales/core/sv/readme.txt | 10 - .../locales/core/tr/AdvancedOptions.tiddler | 15 - .../locales/core/tr/GettingStarted.tiddler | 7 - .../locales/core/tr/OptionsPanel.tiddler | 17 - .../locales/core/tr/TiddlyWiki.tr.html.recipe | 5 - .../translations/locales/core/tr/locale.tr.js | 309 - .../locales/core/tr/locale.tr.js.meta | 5 - .../locales/core/tr/notyetsupported.txt | 6 - .../locales/core/zh-Hans/Credits.tiddler | 6 - .../core/zh-Hans/DefaultTiddlers.tiddler | 5 - .../core/zh-Hans/DownloadedSoftware.tiddler | 7 - .../core/zh-Hans/GettingStarted.tiddler | 7 - .../locales/core/zh-Hans/OptionsPanel.tiddler | 13 - .../locales/core/zh-Hans/StyleSheet.tiddler | 3 - .../zh-Hans/TiddlyWiki.zh-Hans.html.recipe | 6 - .../core/zh-Hans/empty.zh-Hans.html.recipe | 3 - .../locales/core/zh-Hans/locale.zh-Hans.js | 500 - .../core/zh-Hans/locale.zh-Hans.js.meta | 5 - .../locales/core/zh-Hans/noscript.zh-Hans.txt | 3 - .../locales/core/zh-Hant/Credits.tiddler | 6 - .../core/zh-Hant/DefaultTiddlers.tiddler | 5 - .../core/zh-Hant/DownloadedSoftware.tiddler | 7 - .../core/zh-Hant/GettingStarted.tiddler | 7 - .../locales/core/zh-Hant/OptionsPanel.tiddler | 13 - .../locales/core/zh-Hant/StyleSheet.tiddler | 3 - .../zh-Hant/TiddlyWiki.zh-Hant.html.recipe | 6 - .../core/zh-Hant/empty.zh-Hant.html.recipe | 3 - .../locales/core/zh-Hant/locale.zh-Hant.js | 504 - .../core/zh-Hant/locale.zh-Hant.js.meta | 5 - .../locales/core/zh-Hant/noscript.zh-Hant.txt | 3 - editions/tw2/target/empty.2.6.5.html | 10147 ------------ editions/tw2/target/index.2.6.5.html | 13196 --------------- editions/tw2/target/index.2.6.5.xml | 387 - editions/tw2/target/prebuilt.html | 13211 ---------------- editions/tw2/tiddlywiki.info | 6 - 600 files changed, 183181 deletions(-) delete mode 100755 editions/tw2/source/tiddlywiki.com/README.md delete mode 100755 editions/tw2/source/tiddlywiki.com/bld delete mode 100755 editions/tw2/source/tiddlywiki.com/empty.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki.com/ginsu delete mode 100755 editions/tw2/source/tiddlywiki.com/index.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki.com/pull.sh delete mode 100755 editions/tw2/source/tiddlywiki.com/tiddler2tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Basic_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CSS_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CamelCase.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Code_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ColorPalette_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Date_Formats.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/EditTemplate_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/GettingStarted_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Entities_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Headings_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Horizontal_Rule_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Image_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Line_Break_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Link_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/List_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/MacrosContent.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/MainMenu_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/MarkupPreHead.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/PageTemplate_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/PluginManager_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Quotations_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Reference.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ReferenceContent.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ShadowTiddlersContent.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/SideBarOptions_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/SiteSubtitle.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/SiteSubtitle_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/SiteTitle.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/SiteTitle_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/StyleSheet_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Suppressing_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/TabAll_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/TabMoreMissing_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/TabMoreOrphans_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/TabMoreShadowed_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/TabTimeline_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Tables_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ViewTemplate_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/WikiTextContent.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/WikiWord.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/WindowTitle_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/allTags_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/anotherTiddlerToTransclude.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/closeAll_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/list_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/newJournal_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/newTiddler_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/options_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/permaview_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/saveChanges_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/search_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/slider_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/split.recipe delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tabs_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tag_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tagging_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tags_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tiddlerToTransclude.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tiddler_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/tiddlywiki-com-refSetupFlag.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/timeline_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/today_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/version_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/view_macro.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/view_macro_types.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/AbegoSoftwareServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Advanced_download_options.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/AnotherExampleStyleSheet.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/AutoSave.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/BackstageArea.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/BidiXTWServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/BobsPluginsServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Browsers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Camino.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CancelTiddlerCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CharacterEncoding.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Chrome.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CloseOthersCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CloseTiddlerCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ColorPalette.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Community.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Configuration.SideBarTabs.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Configuration.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ContentsSlider.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Contribute.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CustomMarkup.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/CustomStyleSheet.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Customisation.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DefaultTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DeleteTiddlerCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DeveloperDocumentation.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DiscussionForums.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Download.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DownloadTiddlyWikiPlugin.js delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/DownloadTiddlyWikiPlugin.js.meta delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Firefox_on_Mac_OS_X.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Firefox_on_Ubuntu.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Firefox_on_Windows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Firefox_on_Windows_Vista.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Firefox_on_Windows_XP.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Internet_Explorer_on_Windows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Internet_Explorer_on_Windows_Vista.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Internet_Explorer_on_Windows_XP.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Opera_on_Mac_OS_X.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Downloading_guidelines__Safari_on_Mac_OS_X.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/EditTiddlerCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Editing.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ExamplePlugin.js delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ExamplePlugin.js.meta delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ExampleStyleSheet.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ExampleSystemConfig.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Examples.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Feedback.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/FireFox.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/FireFoxKeyboardIssue.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/FlickrBadge.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/GenerateAnRssFeed.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/GettingStarted.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/GettingStarted_shadows.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/GreaseMonkey.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/GuerillaWiki.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HelloThere.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Help_and_Support.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HideEditingFeatures.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/History.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HostedOptions.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HowToUpgrade.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HowToUpgradeOlderTiddlyWikis.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/HtmlEntities.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Importing_Tiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/IncrementalSearch.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/InstallingPlugins.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/InterfaceOptions.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/InternetExplorer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/JavaScript.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/JeremyRuston.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/JumpCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/KeyboardShortcuts.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Licence.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/LikeThis.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/LinkToFolders.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Link_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MainMenu.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ManuallyInstallIngPlugins.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MarkupPreHead.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MartinsPluginsServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Mathematics.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MicroContent.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MinorChanges.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MissingTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MobileDevices.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MonkeyPirateTWServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/MoreTab.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/NestedStyleSheets.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/NestedTemplates.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/OpenSourceLicense.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Opera.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/OrphanTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Osmosoft.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PageTemplate.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ParameterParser.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PeachTWServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PeriodicTable.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PermaView.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PermalinkCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PersistentOptions.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PlainText.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PluginFormat.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PluginFormatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Plugins.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PrinceTiddlyWikiExtensionsServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/PublicationsAndArticles.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Raves.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/RedMountainVistaServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ReferencesButton.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ReferencesCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/RegExpSearch.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/RssFeed.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Safari.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SafeMode.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SaveBackups.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SaveChanges.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SaveEmptyTemplate.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SaveTiddlerCommand.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SaveUnpredictabilities.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Search.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SelfContained.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ServerSide.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ServicePack2Problems.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ShadowTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SideBarOptions.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SimpleSearchPlugin.js delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SimpleSearchPlugin.js.meta delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SiteSubtitle.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SiteSubtitle_shadow_tiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SiteTitle.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SiteUrl.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SpecialTags.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/SpecialTiddlers.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/StartupParameters.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/StyleSheet.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Suppressing_Formatting.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Tags.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Tiddler.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlerComments.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlerSlicing.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyBookmarklets.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlySaver.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyStylesServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyToolsServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyWiki.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyWikiAdaptations.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyWikiFiction.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TiddlyWiki_Browser_Compatibility.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ToggleLinks.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/ToolbarButtons.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/TutorialsAndGuides.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/UnaMesa.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/VistaIssues.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/VisualTWServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/Wii.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/WikiOnAStick.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/WikiWikiWeb.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/WritingStyle.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/brixhamharbour.jpg.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/example.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/favicon.ico.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/field.jpg.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/forest.jpg.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/fractalveg.jpg.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/iPhone.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/split.recipe delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/systemServer.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/tiddlywiki-comSetupFlag.tid delete mode 100644 editions/tw2/source/tiddlywiki.com/tiddlywiki-com/translations.tid delete mode 100755 editions/tw2/source/tiddlywiki.com/upload delete mode 100755 editions/tw2/source/tiddlywiki/ALPHA delete mode 100755 editions/tw2/source/tiddlywiki/Makefile delete mode 100755 editions/tw2/source/tiddlywiki/README delete mode 100755 editions/tw2/source/tiddlywiki/bldalpha delete mode 100755 editions/tw2/source/tiddlywiki/bldxjs delete mode 100755 editions/tw2/source/tiddlywiki/cook delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Crypto.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Deprecated.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/FileAdaptor.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Http.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Numbers.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Strings.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Tiddler.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Utilities.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/Wikifier.js delete mode 100755 editions/tw2/source/tiddlywiki/deprecated/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/html/copyright.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/externaljs.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_alpha.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_beta.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/noscript.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/rss.link.html delete mode 100755 editions/tw2/source/tiddlywiki/html/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/html/splitnonoscript.recipe delete mode 100755 editions/tw2/source/tiddlywiki/html/style.txt delete mode 100755 editions/tw2/source/tiddlywiki/html/tiddlywiki.template.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/jquery.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/encoding.digests.sha1.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/index.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/styles/main.css delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFile.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFileDemo.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/twStylesheet.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/doc/update delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.encoding.digests.sha1.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twFile.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twStylesheet.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/jquery.gettext-1.0.4.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.today.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/TiddlySaver.jar delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/jQuery.twFile.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/jQuery.twStylesheet.html delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twFile.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twStylesheet.js delete mode 100755 editions/tw2/source/tiddlywiki/jquery/plugins/test/sample.txt delete mode 100755 editions/tw2/source/tiddlywiki/jquery/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/js/AdaptorBase.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Animator.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Backstage.js delete mode 100755 editions/tw2/source/tiddlywiki/js/BasicTypes.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Commands.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Config.js delete mode 100755 editions/tw2/source/tiddlywiki/js/ConfigBrowser.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Crypto.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Dates.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Dom.js delete mode 100755 editions/tw2/source/tiddlywiki/js/FileAdaptor.js delete mode 100755 editions/tw2/source/tiddlywiki/js/FileSystem.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Filters.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Formatter.js delete mode 100755 editions/tw2/source/tiddlywiki/js/FormatterHelpers.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Guide.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Http.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Import.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Lingo.js delete mode 100755 editions/tw2/source/tiddlywiki/js/ListView.js delete mode 100755 editions/tw2/source/tiddlywiki/js/LoaderSaver.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Macros.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Manager.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Messages.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Morpher.js delete mode 100755 editions/tw2/source/tiddlywiki/js/NewTiddler.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Numbers.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Options.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Paramifiers.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Popup.js delete mode 100755 editions/tw2/source/tiddlywiki/js/RGB.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Refresh.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Saving.js delete mode 100755 editions/tw2/source/tiddlywiki/js/SavingRSS.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Scroller.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Search.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Slider.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Sparkline.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Story.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Strings.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Sync.js delete mode 100755 editions/tw2/source/tiddlywiki/js/TW21Loader.js delete mode 100755 editions/tw2/source/tiddlywiki/js/TW21Saver.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Tabs.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Tiddler.js delete mode 100755 editions/tw2/source/tiddlywiki/js/TiddlerFields.js delete mode 100755 editions/tw2/source/tiddlywiki/js/TiddlyWiki.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Toolbar.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Upgrade.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Utilities.js delete mode 100755 editions/tw2/source/tiddlywiki/js/UtilitiesPopup.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Version.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Wikifier.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Wizard.js delete mode 100755 editions/tw2/source/tiddlywiki/js/Zoomer.js delete mode 100755 editions/tw2/source/tiddlywiki/js/main.js delete mode 100755 editions/tw2/source/tiddlywiki/js/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.0.11.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.1.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.1.3.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.2.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.2.5.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.2.6.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.3.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.4.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.4.1.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.4.2.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.4.3.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.5.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.5.1.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.5.2.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.5.3.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/recipes/empty.2.6.0.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/shadows/ColorPalette.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/EditTemplate.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/GettingStarted.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/ImportTiddlers.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/MarkupPreHead.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/PageTemplate.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/StyleSheetColors.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/StyleSheetLayout.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/StyleSheetLocale.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/StyleSheetPrint.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/ViewTemplate.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/shadows/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/README delete mode 100755 editions/tw2/source/tiddlywiki/test/html/qunitpostscript.txt delete mode 100755 editions/tw2/source/tiddlywiki/test/html/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/html/testpostscript.txt delete mode 100755 editions/tw2/source/tiddlywiki/test/jqMock/jqMock.html delete mode 100755 editions/tw2/source/tiddlywiki/test/jqMock/jqMock.js delete mode 100755 editions/tw2/source/tiddlywiki/test/jqMock/jqMockTest.js delete mode 100755 editions/tw2/source/tiddlywiki/test/jqMock/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Animator.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Arrays.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/BasicTypes.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Crypto.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/DOM.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Dates.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Encoding.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/FileSystem.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Filters.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/LoadingSaving.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Macros.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Numbers.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Options.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/RGB.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/SavingRSS.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Shadows.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Strings.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/TW21Saver.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Tiddler.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/TiddlerFields.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/TiddlyWiki.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Utilities.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Version.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Wikifier.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Wizard.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/Zoomer.js delete mode 100755 editions/tw2/source/tiddlywiki/test/js/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/js/template.js delete mode 100755 editions/tw2/source/tiddlywiki/test/qunit/delayTestExecution.js delete mode 100755 editions/tw2/source/tiddlywiki/test/qunit/qunit.css delete mode 100755 editions/tw2/source/tiddlywiki/test/qunit/qunit.js delete mode 100755 editions/tw2/source/tiddlywiki/test/qunit/raiseAssertion.js delete mode 100755 editions/tw2/source/tiddlywiki/test/qunit/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/sample.txt delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/shadows/DefaultTiddlers.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/shadows/MainMenu.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarOptions.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarTabs.tiddler delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/shadows/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/recipes/tests.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/reporter.html delete mode 100755 editions/tw2/source/tiddlywiki/test/reporter.php delete mode 100755 editions/tw2/source/tiddlywiki/test/testdata/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/test/testdata/testTiddler1.tid delete mode 100755 editions/tw2/source/tiddlywiki/test/testdata/testTiddler2.tid delete mode 100755 editions/tw2/source/tiddlywiki/test/testdata/testTiddler3.tid delete mode 100755 editions/tw2/source/tiddlywiki/tests/README delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/test.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/test.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testAll.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testAll.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testAnimator.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testBasicTypes.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributors.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributors.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributors2.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributors2.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testCrypto.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testDates.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testDom.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testFileSystem.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testGenerateRss.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testMacros.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testMessages.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testMocks.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testRGB.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testShadows.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testStrings.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testTW21Saver.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testTiddler.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testTiddlyWiki.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testUtilities.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testVersion.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testWikifier.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testWizard.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testXML.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testZoomer.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testmin.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/html/testmin.template.html delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/ckx delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/mock.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.template.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/xml.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/js/xpath.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/BasicTypes.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/Macros.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/Messages.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/Mocks.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/Strings.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/Wikifier.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/XML.jsspec.js delete mode 100755 editions/tw2/source/tiddlywiki/tests/jsspec/split.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tiddlywiki.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tiddlywiki_externaljs.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace_alpha.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/tiddlywikinonoscript.html.recipe delete mode 100755 editions/tw2/source/tiddlywiki/uploadalpha delete mode 100755 editions/tw2/source/translations/README.md delete mode 100755 editions/tw2/source/translations/locales/core/ca/empty.ca.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/ca/locale.ca.2.5.2.js delete mode 100755 editions/tw2/source/translations/locales/core/cs/empty.cs.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/cs/locale.cs.js delete mode 100755 editions/tw2/source/translations/locales/core/cs/locale.cs.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/de/locale.de.js delete mode 100755 editions/tw2/source/translations/locales/core/el/empty.el.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/el/locale.el.js delete mode 100755 editions/tw2/source/translations/locales/core/el/locale.el.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/en/Credits.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/en/DefaultTiddlers.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/en/DownloadedSoftware.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/en/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/en/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/en/TiddlyWiki.en.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/en/empty.en.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/en/locale.en.js delete mode 100755 editions/tw2/source/translations/locales/core/en/locale.en.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/en/readme.txt delete mode 100755 editions/tw2/source/translations/locales/core/es/TW243emptyES.html delete mode 100755 editions/tw2/source/translations/locales/core/es/TW253emptyES.html delete mode 100755 editions/tw2/source/translations/locales/core/es/TW260emptyES.html delete mode 100755 editions/tw2/source/translations/locales/core/es/TW261emptyES.html delete mode 100755 editions/tw2/source/translations/locales/core/es/locale.es.js delete mode 100755 editions/tw2/source/translations/locales/core/es/locale037.es.js delete mode 100755 editions/tw2/source/translations/locales/core/es/locale040.es.js delete mode 100755 editions/tw2/source/translations/locales/core/es/readme.txt delete mode 100755 editions/tw2/source/translations/locales/core/fr/empty.fr.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/fr/locale.fr.js delete mode 100755 editions/tw2/source/translations/locales/core/fr/locale.fr.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/id/empty.id.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/id/locale.id.js delete mode 100755 editions/tw2/source/translations/locales/core/id/locale.id.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/ko/empty.html delete mode 100755 editions/tw2/source/translations/locales/core/ko/locale.ko.js delete mode 100755 editions/tw2/source/translations/locales/core/ko/readme.txt delete mode 100755 editions/tw2/source/translations/locales/core/lv/empty.lv.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/lv/locale.lv.js delete mode 100755 editions/tw2/source/translations/locales/core/lv/locale.lv.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/nl/TW224emptyNL.html delete mode 100755 editions/tw2/source/translations/locales/core/nl/TW243emptyNL.html delete mode 100755 editions/tw2/source/translations/locales/core/nl/TW253emptyNL.html delete mode 100755 editions/tw2/source/translations/locales/core/nl/TW260emptyNL.html delete mode 100755 editions/tw2/source/translations/locales/core/nl/TW261emptyNL.html delete mode 100755 editions/tw2/source/translations/locales/core/nl/locale.nl.js delete mode 100755 editions/tw2/source/translations/locales/core/nl/locale025.nl.js delete mode 100755 editions/tw2/source/translations/locales/core/nl/locale026.nl.js delete mode 100755 editions/tw2/source/translations/locales/core/nl/locale030.nl.js delete mode 100755 editions/tw2/source/translations/locales/core/nl/readme.txt delete mode 100755 editions/tw2/source/translations/locales/core/pl/AdvancedOptions.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/pl/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/pl/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/pl/SzybkiStart.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/pl/TiddlyWiki.pl.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/pl/locale.pl.js delete mode 100755 editions/tw2/source/translations/locales/core/pl/locale.pl.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/ru/empty.ru.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/ru/locale.ru.js delete mode 100755 editions/tw2/source/translations/locales/core/ru/locale.ru.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/sv/Credits.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/sv/DefaultTiddlers.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/sv/DownloadedSoftware.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/sv/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/sv/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/sv/TiddlySaver.jar delete mode 100755 editions/tw2/source/translations/locales/core/sv/TiddlyWiki.en.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/sv/empty.sv.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/sv/locale.sv.js delete mode 100755 editions/tw2/source/translations/locales/core/sv/locale.sv.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/sv/readme.txt delete mode 100755 editions/tw2/source/translations/locales/core/tr/AdvancedOptions.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/tr/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/tr/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/tr/TiddlyWiki.tr.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/tr/locale.tr.js delete mode 100755 editions/tw2/source/translations/locales/core/tr/locale.tr.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/tr/notyetsupported.txt delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/Credits.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/DefaultTiddlers.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/DownloadedSoftware.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/StyleSheet.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/TiddlyWiki.zh-Hans.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/empty.zh-Hans.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/locale.zh-Hans.js delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/locale.zh-Hans.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hans/noscript.zh-Hans.txt delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/Credits.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/DefaultTiddlers.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/DownloadedSoftware.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/GettingStarted.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/OptionsPanel.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/StyleSheet.tiddler delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/TiddlyWiki.zh-Hant.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/empty.zh-Hant.html.recipe delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/locale.zh-Hant.js delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/locale.zh-Hant.js.meta delete mode 100755 editions/tw2/source/translations/locales/core/zh-Hant/noscript.zh-Hant.txt delete mode 100644 editions/tw2/target/empty.2.6.5.html delete mode 100644 editions/tw2/target/index.2.6.5.html delete mode 100644 editions/tw2/target/index.2.6.5.xml delete mode 100644 editions/tw2/target/prebuilt.html delete mode 100644 editions/tw2/tiddlywiki.info diff --git a/editions/tw2/source/tiddlywiki.com/README.md b/editions/tw2/source/tiddlywiki.com/README.md deleted file mode 100755 index 06cd6af15..000000000 --- a/editions/tw2/source/tiddlywiki.com/README.md +++ /dev/null @@ -1,63 +0,0 @@ -TiddlyWiki -========== - -https://github.com/TiddlyWiki/tiddlywiki.com - - -Description ------------ - -This repository contains the tools required to create the site http://tiddlywiki.com/ - -The content for tiddlywiki.com is obtained from a [TiddlySpace](http://tiddlyspace.com/). - - -Prerequisites -------------- - -Ensure that you have downloaded and installed TiddlyWiki as described at https://github.com/TiddlyWiki/tiddlywiki - -You need perl to build tiddlywiki.com. If you do not have it installed, it can be downloaded [here](http://www.perl.org/get.html). - -You need to set up `ginsu`. Copy the `ginsu` script file to somewhere that is on your path. Edit this file according to the instructions in the file. - -You need to set up the `tiddler2tid`. Copy the `tiddler2tid` script file to somewhere that is on your path. - - -Building tiddlywiki.com ------------------------ - -After downloading and installing TiddlyWiki checkout the version of TiddlyWiki that you wish to use for tiddlywiki.com. Ongoing development occurs in the tiddlywiki repository, so you need to checkout a tagged release version of TiddlyWiki. Change to the tiddlywiki directory and checkout the required version, eg: - - git checkout tags/v2.6.5 - -Change back to the tiddlywiki.com directory. - -Pull down the tiddlywiki.com content form TiddlySpace by invoking the `pull.sh` script: - - ./pull.sh - -Edit the build script `bld` setting the correct version number for TiddlyWiki. - -Invoke the build script: - - ./bld - -You now need to generate the TiddlyWiki RSS file. To do this open the TiddlyWiki file index.html in Firefox, ensure the AdvancedOption "Generate an RSS feed when saving changes" is set, and then save the TiddlyWiki. Doing this also causes TiddlyWiki to generate some static HTML for display when Javascript is not enabled. - -Edit the upload script `upload` setting the correct version number for TiddlyWiki. - -Finally you need to upload the TiddlyWiki files to tiddlywiki.com. If this is the first time you are uploading, then you will need to create a `tmp` directory on tiddlywiki.com: - - ssh user@tiddlywiki.com - [enter your password when prompted] - mkdir tmp - exit - -You can now upload the TiddlyWiki files, run the upload script: - - ./upload - -You will be prompted for your password on several occasions during the upload process. To do this you will of course need an account on tiddlywiki.com. The upload script assumes your remote user name is the same as your local user name, if it is not then you may specify your remote user name as the first parameter to the upload script. - -Migrated from http://svn.tiddlywiki.org on 20110719. diff --git a/editions/tw2/source/tiddlywiki.com/bld b/editions/tw2/source/tiddlywiki.com/bld deleted file mode 100755 index cd8c49fc4..000000000 --- a/editions/tw2/source/tiddlywiki.com/bld +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# bld [release] - -DEFAULT_RELEASE="2.6.5" -RELEASE=${1:-$DEFAULT_RELEASE} -DEST=$PWD/cooked/tiddlywiki.com -mkdir -p cooked -mkdir -p cooked/tiddlywiki.com -cook $PWD/index.html.recipe -d $DEST -o index.$RELEASE.html -cook $PWD/empty.html.recipe -d $DEST -o empty.$RELEASE.html -cp ../tiddlywiki/java/TiddlySaver.jar $DEST/TiddlySaver.jar -rm $DEST/empty.$RELEASE.zip -cp $DEST/empty.$RELEASE.html tmp/empty.html -zip -j $DEST/empty.$RELEASE.zip tmp/empty.html $DEST/TiddlySaver.jar -rm tmp/empty.html diff --git a/editions/tw2/source/tiddlywiki.com/empty.html.recipe b/editions/tw2/source/tiddlywiki.com/empty.html.recipe deleted file mode 100755 index c25233e11..000000000 --- a/editions/tw2/source/tiddlywiki.com/empty.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../tiddlywiki/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki.com/ginsu b/editions/tw2/source/tiddlywiki.com/ginsu deleted file mode 100755 index 2cb334d8a..000000000 --- a/editions/tw2/source/tiddlywiki.com/ginsu +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# This is a sample ginsu script to be used with the tiddlywiki.com scripts -# Adjust this script and then install it somewhere on your $PATH, such as ~/bin. -# -# You will need to adjust COOKER_TRUNK below. -# -# Change this to where you have the cooker code installed -COOKER_TRUNK=$HOME/Documents/Code/GitHub/tiddlywiki/cooker -DEFAULT_FILENAME=index -FILENAME=${1:-$DEFAULT_FILENAME} -DEST=$PWD -RECIPE=$PWD/$FILENAME.html -ruby -C $COOKER_TRUNK ginsu.rb $RECIPE -d$DEST $2 $3 $4 $5 diff --git a/editions/tw2/source/tiddlywiki.com/index.html.recipe b/editions/tw2/source/tiddlywiki.com/index.html.recipe deleted file mode 100755 index a493049eb..000000000 --- a/editions/tw2/source/tiddlywiki.com/index.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../tiddlywiki/tiddlywikinonoscript.html.recipe -recipe: tiddlywiki-com-ref/split.recipe -recipe: tiddlywiki-com/split.recipe diff --git a/editions/tw2/source/tiddlywiki.com/pull.sh b/editions/tw2/source/tiddlywiki.com/pull.sh deleted file mode 100755 index 469b990ba..000000000 --- a/editions/tw2/source/tiddlywiki.com/pull.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# -# this hack pulls down the wikis for each bag, splitting the wiki into tiddlers using ginsu -# long term plan is to use the "fat" JSON for a bag -# - -set -e -export space -export dir - -mkdir -p tmp - -for space in tiddlywiki-com-ref tiddlywiki-com -do - mkdir -p $space - - dir=tmp/${space}.html.0 - curl -s http://${space}.tiddlyspace.com/bags/${space}_public/tiddlers.wiki > tmp/$space.html - - # clear out the space directory so we can see deleted files when we commit - rm -f $space/* - - # backup any existing exploded content - mkdir -p backups - [ -d $dir ] && mv $dir backups/$$ - - # split into tiddlers - ( - cd tmp - ginsu $space > /dev/null - ) - - # convert .tiddler files into .tid files - ( - cd "$dir" - - tiddler2tid *.tiddler - find . -name \*.tid -o -name \*.js -o -name \*.meta | - while read file - do - sed -e '/^server.*: /d' -e '/^_hash:/d' < "$file" > "../../$space/$file" - done - ) - - # make recipe based on files in the space directory - ( - cd $space - - find . -name \*.tid -o -name \*.js | - grep -v '\.jpg\.' | - grep -v 'PageTemplate' | - grep -v 'SplashScreen' | - grep -v 'SiteSubtitle' | - sed 's/^/tiddler: /' > split.recipe - ) -done - -cook $PWD/index.html.recipe diff --git a/editions/tw2/source/tiddlywiki.com/tiddler2tid b/editions/tw2/source/tiddlywiki.com/tiddler2tid deleted file mode 100755 index 7e45ceb8b..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddler2tid +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr//bin/env perl - -# -# convert .tiddler into .tid files -# useful for ginsu a TiddlyWiki, then HTTP PUT them to TiddlyWeb/TiddlySpaces -# - -use strict; - -sub read_file { - my ($filename) = @_; - undef $/; - local *FILE; - open FILE, "< $filename"; - binmode(FILE, ":utf8"); - my $c = ; - close FILE; - return $c; -} - -foreach my $file (@ARGV) { - - my $tid = $file; - my $text = ""; - - if ($file =~ /.tiddler$/) { - - $tid =~ s/dler$//; - $text = read_file($file, encoding => 'utf8'); - - my $attrs = $text; - $attrs =~ s/\s*]*)>.*$/$1/s; - $attrs =~ s/\s*(\w+)\s*=\s*["']([^"']*)["']\s*/$1: $2\n/gs; - - $text =~ s/^\s*]*>\s*<\s*pre>\s*(.*)\s*<\/pre\s*>\s*<\/div\s*>\s*$/$1/s; - - $text = $attrs . "\n" . $text; - - } elsif ($file =~ /.js$/) { - - $tid =~ s/.js$/.tid/; - $text = read_file($file . ".meta") . "\n" . read_file($file); - - } - - if ($text) { - print "$tid\n"; - open(FILE, "> $tid"); - binmode(FILE, ":utf8"); - print FILE $text; - close(FILE); - } -} diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Basic_Formatting.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Basic_Formatting.tid deleted file mode 100644 index abe9e76fd..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Basic_Formatting.tid +++ /dev/null @@ -1,18 +0,0 @@ -title: Basic Formatting -modifier: psd -created: 20110211142531 -modified: 201102151515 -tags: formatting -creator: matt - -|Style|Formatting|h -|''bold''|{{{''bold''}}} - two single-quotes, not a double-quote| -|//italics//|{{{//italics//}}}| -|''//bold italics//''|{{{''//bold italics//''}}}| -|__underline__|{{{__underline__}}}| -|--strikethrough--|{{{--Strikethrough--}}}| -|super^^script^^|{{{super^^script^^}}}| -|sub~~script~~|{{{sub~~script~~}}}| -|@@Highlight@@|{{{@@Highlight@@}}}| -|{{{plain text}}}|{{{ {{{PlainText No ''Formatting''}}} }}}| -|/%this text will be invisible%/hidden text|{{{/%this text will be invisible%/}}}| diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CSS_Formatting.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CSS_Formatting.tid deleted file mode 100644 index 26731b8c1..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CSS_Formatting.tid +++ /dev/null @@ -1,31 +0,0 @@ -title: CSS Formatting -modifier: jermolene -created: 20110211142635 -modified: 20111103182214 -tags: formatting -creator: matt - -!!Inline Styles -Apply CSS properties inline: -{{{ -@@color:#4bbbbb;Some random text@@ -}}} -Displays as: -@@color:#4bbbbb;Some random text@@ -!!CSS classes -CSS classes can be applied to text blocks or runs. This form creates an HTML {{{}}}: -{{{ -{{customClassName{Some random text}}} -}}} -Displays as: -{{customClassName{Some random text}}} -This form generates an HTML {{{
}}}: -{{{ - {{customClassName{ - Some random text - }}} -}}} -Displays as: -{{customClassName{ -Some random text -}}} diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CamelCase.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CamelCase.tid deleted file mode 100644 index c2c6d12b2..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/CamelCase.tid +++ /dev/null @@ -1,6 +0,0 @@ -title: CamelCase -modifier: matt -created: 20110221141430 -creator: matt - -CamelCase (camel case or camel-case)—also known as medial capitals—is the practice of writing compound words or phrases in which the elements are joined without spaces. diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Code_Formatting.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Code_Formatting.tid deleted file mode 100644 index 97c4d076e..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Code_Formatting.tid +++ /dev/null @@ -1,17 +0,0 @@ -title: Code Formatting -modifier: colmbritton -created: 20110211142613 -modified: 20110216114812 -tags: formatting -creator: matt - -Text such as computer code that should be displayed without wiki processing and preserving line breaks: -{{{ -Some plain text including WikiLinks -}}} -Displays as: -{{{ -Some plain text including WikiLinks -}}} -!See Also -[[Suppressing Formatting]] diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ColorPalette_shadows.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ColorPalette_shadows.tid deleted file mode 100644 index 61609e30e..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/ColorPalette_shadows.tid +++ /dev/null @@ -1,27 +0,0 @@ -title: ColorPalette shadows -modifier: matt -created: 20110211143633 -modified: 201102151510 -tags: shadow -creator: matt - -This tiddler determines the colour scheme used within the TiddlyWiki. When a new space is created the random color palette macro determines the default, however these can be overwritten directly in the ColorPalette tiddler. - -{{{ -Background: #e0e3f5 -Foreground: #090d1e -PrimaryPale: #b9c2e8 -PrimaryLight: #7485d2 -PrimaryMid: #384fb1 -PrimaryDark: #0c1126 -SecondaryPale: #cbe8b9 -SecondaryLight: #98d274 -SecondaryMid: #67b138 -SecondaryDark: #16260c -TertiaryPale: #e8bab9 -TertiaryLight: #d27574 -TertiaryMid: #b13a38 -TertiaryDark: #260c0c -Error: #f88 -ColorPaletteParameters: HSL([229|48], [0.5146822107288709],[0.1|0.8208696653333263]) -}}} diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Date_Formats.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Date_Formats.tid deleted file mode 100644 index ab1143d9b..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/Date_Formats.tid +++ /dev/null @@ -1,36 +0,0 @@ -title: Date Formats -modifier: matt -created: 20110216113958 -modified: 20110221141513 -creator: colmbritton - -Several [[Macros|MacrosContent]] including the [[Today Macro|today macro]] take a [[Date Format String|Date Formats]] as an optional argument. This string can be a combination of ordinary text, with some special characters that get substituted by parts of the date: -* {{{DDD}}} - day of week in full (eg, "Monday") -* {{{ddd}}} - short day of week (eg, "Mon") -* {{{DD}}} - day of month -* {{{0DD}}} - adds a leading zero -* {{{DDth}}} - adds a suffix -* {{{WW}}} - ~ISO-8601 week number of year -* {{{0WW}}} - adds a leading zero -* {{{MMM}}} - month in full (eg, "July") -* {{{mmm}}} - short month (eg, "Jul") -* {{{MM}}} - month number -* {{{0MM}}} - adds leading zero -* {{{YYYY}}} - full year -* {{{YY}}} - two digit year -* {{{wYYYY}}} - full year with respect to week number -* {{{wYY}}} two digit year with respect to week number -* {{{hh}}} - hours -* {{{0hh}}} - adds a leading zero -* {{{hh12}}} - hours in 12 hour clock -* {{{0hh12}}} - hours in 12 hour clock with leading zero -* {{{mm}}} - minutes -* {{{0mm}}} - minutes with leading zero -* {{{ss}}} - seconds -* {{{0ss}}} - seconds with leading zero -* {{{am}}} or {{{pm}}} - lower case AM/PM indicator -* {{{AM}}} or {{{PM}}} - upper case AM/PM indicator - -!!!!Examples -{{{DDth MMM YYYY}}} - 16th February 2011 -{{{DDth mmm hh:mm:ss}}} - 16th Feb 2011 11:38:42 diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers.tid deleted file mode 100644 index 445bc11df..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers.tid +++ /dev/null @@ -1,7 +0,0 @@ -title: DefaultTiddlers -modifier: colmbritton -created: 20110211154017 -modified: 20110211163338 -creator: colmbritton - -[[Reference]] diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers_shadows.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers_shadows.tid deleted file mode 100644 index d2350bb92..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/DefaultTiddlers_shadows.tid +++ /dev/null @@ -1,19 +0,0 @@ -title: DefaultTiddlers shadows -modifier: matt -created: 20110211143659 -modified: 201102151510 -tags: shadow -creator: matt - -This tiddler contains a list of tiddlers that are opened automatically when you load the tiddlywiki. -The default is: -{{{ -[[GettingStarted]] -}}} - -An example could be: -{{{ -[[HelloThere]] -[[Reference]] -[[Features]] -}}} diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/EditTemplate_shadows.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/EditTemplate_shadows.tid deleted file mode 100644 index 7cce5e6ce..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/EditTemplate_shadows.tid +++ /dev/null @@ -1,34 +0,0 @@ -title: EditTemplate shadows -modifier: matt -created: 20110211143734 -modified: 201102151511 -tags: shadow -creator: matt - -This tiddler contains the markup used to display tiddlers in edit mode. It is designed to make it easy to change the layout/structure of the tiddler in edit mode. -By default it contains the following markup: -{{{ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
tags
-
-
- - -
-
-}}} diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/GettingStarted_shadows.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/GettingStarted_shadows.tid deleted file mode 100644 index 03043d464..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/GettingStarted_shadows.tid +++ /dev/null @@ -1,13 +0,0 @@ -title: GettingStarted shadows -modifier: matt -created: 20110211143758 -modified: 201102151537 -tags: shadow -creator: matt - -The GettingStarted shadow tiddler contains information about how to start using your TiddlyWiki. -You can change it to include anything you desire. - -For example a lot of tiddlywiki authors use it to explain what their wiki is about. This is a particularly useful approach because by default the GettingStarted tiddler is in the [[DefaultTiddlers|Shadow - DefaultTiddlers]] tiddler, thus opens automatically upon loading of the page. - -By default it is also part of the [[MainMenu|Shadow - MainMenu]] tiddler so is included on the left side of the menu bar above. diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Entities_Formatting.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Entities_Formatting.tid deleted file mode 100644 index 020e0f0f3..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Entities_Formatting.tid +++ /dev/null @@ -1,18 +0,0 @@ -title: HTML Entities Formatting -modifier: psd -created: 20110211142850 -modified: 201102151515 -tags: formatting -creator: matt - -HTML entities can be used to easily type special characters: -{{{ -Here is a quote symbol: " -And a pound sign: £ -}}} -Displays as: -Here is a quote symbol: " -And a pound sign: £ -!Notes -For a full list of available HTML references see: -http://www.w3schools.com/tags/ref_entities.asp diff --git a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Formatting.tid b/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Formatting.tid deleted file mode 100644 index e067eb13b..000000000 --- a/editions/tw2/source/tiddlywiki.com/tiddlywiki-com-ref/HTML_Formatting.tid +++ /dev/null @@ -1,20 +0,0 @@ -title: HTML Formatting -modifier: psd -created: 20110211142909 -modified: 20110215151851 -tags: formatting -creator: matt - -Raw HTML text can be included in a tiddler: -{{{ - -This is some HTML formatting - -}}} - -This is some HTML formatting - -!Notes -* only static HTML elements that are valid within a {{{
}}} work correctly -* {{{document.write}}} cannot be used to generate dynamic content -* External {{{ - - diff --git a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace.txt b/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace.txt deleted file mode 100755 index 9873ba982..000000000 --- a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace.txt +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_alpha.txt b/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_alpha.txt deleted file mode 100755 index bde0205e9..000000000 --- a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_alpha.txt +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_beta.txt b/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_beta.txt deleted file mode 100755 index 44ab9c0da..000000000 --- a/editions/tw2/source/tiddlywiki/html/externaljs_tiddlyspace_beta.txt +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/editions/tw2/source/tiddlywiki/html/noscript.txt b/editions/tw2/source/tiddlywiki/html/noscript.txt deleted file mode 100755 index a9dad34aa..000000000 --- a/editions/tw2/source/tiddlywiki/html/noscript.txt +++ /dev/null @@ -1,3 +0,0 @@ -
-This page requires JavaScript to function properly.

If you are using Microsoft Internet Explorer you may need to click on the yellow bar above and select 'Allow Blocked Content'. You must then click 'Yes' on the following security warning. -
diff --git a/editions/tw2/source/tiddlywiki/html/rss.link.html b/editions/tw2/source/tiddlywiki/html/rss.link.html deleted file mode 100755 index 4da2bc3dd..000000000 --- a/editions/tw2/source/tiddlywiki/html/rss.link.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/editions/tw2/source/tiddlywiki/html/split.recipe b/editions/tw2/source/tiddlywiki/html/split.recipe deleted file mode 100755 index 01d4cb6ad..000000000 --- a/editions/tw2/source/tiddlywiki/html/split.recipe +++ /dev/null @@ -1,4 +0,0 @@ -template: tiddlywiki.template.html -copyright: copyright.txt -style: style.txt -noscript: noscript.txt diff --git a/editions/tw2/source/tiddlywiki/html/splitnonoscript.recipe b/editions/tw2/source/tiddlywiki/html/splitnonoscript.recipe deleted file mode 100755 index e1dee93d9..000000000 --- a/editions/tw2/source/tiddlywiki/html/splitnonoscript.recipe +++ /dev/null @@ -1,3 +0,0 @@ -template: tiddlywiki.template.html -copyright: copyright.txt -style: style.txt diff --git a/editions/tw2/source/tiddlywiki/html/style.txt b/editions/tw2/source/tiddlywiki/html/style.txt deleted file mode 100755 index a70bd458c..000000000 --- a/editions/tw2/source/tiddlywiki/html/style.txt +++ /dev/null @@ -1,7 +0,0 @@ -#saveTest {display:none;} -#messageArea {display:none;} -#copyright {display:none;} -#storeArea {display:none;} -#storeArea div {padding:0.5em; margin:1em 0em 0em 0em; border-color:#fff #666 #444 #ddd; border-style:solid; border-width:2px; overflow:auto;} -#shadowArea {display:none;} -#javascriptWarning {width:100%; text-align:center; font-weight:bold; background-color:#dd1100; color:#fff; padding:1em 0em;} diff --git a/editions/tw2/source/tiddlywiki/html/tiddlywiki.template.html b/editions/tw2/source/tiddlywiki/html/tiddlywiki.template.html deleted file mode 100755 index 918f9ccd5..000000000 --- a/editions/tw2/source/tiddlywiki/html/tiddlywiki.template.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - -<!--@@title@@--> - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
- -
- -
- - - -
- - - - - - - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/jquery.js b/editions/tw2/source/tiddlywiki/jquery/jquery.js deleted file mode 100755 index 628ed9b31..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/encoding.digests.sha1.html b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/encoding.digests.sha1.html deleted file mode 100755 index 8a5cb7879..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/encoding.digests.sha1.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - jQuery.encoding.digests.sha1 - - - - -

jQuery.encoding.digests.sha1

-

- This jQuery plugin implements the SHA-1 cryptographic hash function. -

- -

Source

-

- The source code is currently hosted in TiddlyWiki's - Subversion repository. -

-

- Feedback is welcome. -

- -

API

-
    -
  • -

    $.encoding.digests.hexSha1Str(str): Return, in hex, the SHA-1 hash of a string

    -
  • -
  • -

    $.encoding.digests.sha1Str(str): Return the SHA-1 hash of a string

    -
  • -
  • -

    $.encoding.digests.sha1(x,blen): Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words

    -
  • -
-

(full documentation in the code comments)

- -

Demo

- [TBD] - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/index.html b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/index.html deleted file mode 100755 index 8c11a8e45..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - TiddlyWiki jQuery plugins - - - - -

TiddlyWiki jQuery plugins

-

- With jQuery being integrated into the - TiddlyWiki core, the community has - begun extracting TiddlyWiki functionality into generic components in - the form of jQuery plugins: -

- - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/styles/main.css b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/styles/main.css deleted file mode 100755 index d0969d959..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/styles/main.css +++ /dev/null @@ -1,78 +0,0 @@ -* { - margin: 0; - padding: 0; -} - -html { - background-color: #000; -} - -body { - width: 50%; - margin: 0 auto; - padding: 10px; - background-color: #FFF; -} - -h1, -h2 { - margin-bottom: 10px; -} - -h2 { - margin-top: 20px; -} - -p, -ul { - margin-bottom: 0.5em; -} - -ul { - margin-left: 1em; -} - -ul ul { - margin-bottom: 0; -} - -li p { - margin-bottom: 0.2em; -} - -code { - color: #0A0; -} - -fieldset, -legend { - border: 1px solid #AAA; -} - -fieldset { - margin: 30px 10px 10px; - padding: 10px 5px 5px 10px; -} - -legend, -.editor { - background-color: #EEE; -} - -legend { - margin-top: -1em; - border-bottom: none; - padding: 1px 3px 0; - line-height: 1em; -} - -fieldset textarea { - display: block; - width: 98%; -} - -fieldset input { - width: 5em; - margin: 10px 10px 5px 0; - font-size: 1.1em; -} diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFile.html b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFile.html deleted file mode 100755 index b4378580c..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFile.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - jQuery.twFile - - - - -

jQuery.twFile

-

- This jQuery plugin provides access to - the local file system (for documents loaded from a file:// - URI) to load and save file contents from the browser. -

- -

- The code is based on TiddlyWiki's - self-saving capabilities. -

- -

- Note that the TiddlySaver - applet is required on Opera and WebKit-based browsers (Safari, Chrome). - The applet has to be present in the same folder as the respective HTML document. -

- -

Source

-

- The source code is currently hosted in TiddlyWiki's - Subversion repository. -

-

- Feedback is welcome. -

- -

API Summary

-
    -
  • -

    $.twFile.load(filePath): load contents from file

    -
  • -
  • -

    $.twFile.save(filePath, content): save contents to file

    -
  • -
  • -

    $.twFile.copy(dest, source): duplicate existing file

    -

    N.B.: This is not supported on all browsers.

    -
  • -
  • -

    - $.twFile.convertUriToLocalPath(filePath): - normalizes specified absolute file path -

    -
  • -
-

- N.B.: All file paths must be absolute (e.g. - /tmp/foo.txt or C:\temp\foo.txt). -

-

(full documentation in the code comments)

- -

Limitations

-
    -
  • - plugin unavailable until - document.ready - handlers have completed -

    - Since the TiddlySaver applet cannot be injected synchronously - into the document, this is done asynchronously during - document.ready processing. -

    -

    - This means that the plugin is not guaranteed to work properly - until after all these handlers have completed. -

    -
  • -
  • - currently unreliable UTF-8 support on Internet Explorer -

    - The plugin is designed to work with UTF-8 encoded text files. - However, support in Internet Explorer is broken, and can only - reliably save files that are encoded with the ANSI subset of - UTF-8. In the case of HTML files, this problem can often be - avoided by using HTML entity encodings. -

    -
  • -
- -

Internals

-

- Internally, the plugin uses four separate drivers to implement the functionality on different browsers: -

    -
  • - activeX: uses the FileSystemObject built into Internet Explorer 5 and above -
  • -
  • - mozilla: uses the XUL libraries built into Firefox -
  • -
  • - tiddlySaver: uses a custom Java applet that works on Safari, Chrome and Opera -
  • -
  • - javaLiveConnect: uses an ancient (and slow) binding technology to call Java runtime library routines directly - only works on Opera -
  • -
-

- -

Demo

-

- Download this document (and - TiddlySaver if necessary) and open it from - the local disk. -

-

- This demo illustrates self-saving capabilities by passing - document.location.href to $.twFile.convertUriToLocalPath, - using the return value in load and save functions. -

- - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFileDemo.html b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFileDemo.html deleted file mode 100755 index 24545b721..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twFileDemo.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - jQuery.twFileDemo - - - -

jQuery.twFileDemo

-

- This is an example file that can be used to test out the saving and loading system. - Press the edit button to view the page HTML and you can then make changes. Press save - to update the page. -

-

Dummy Text

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris viverra nisl sagittis lorem - rutrum eu lacinia elit ultrices. In laoreet tortor in dolor dignissim vitae lacinia massa dignissim. - Sed luctus, tortor a aliquam vulputate, orci tellus vulasdasdputate risus, sed vehicula quam massa ac orci. - Cras in nibh purus, ac tempor est. In tincidunt nulla et velit accumsan non tempor massa vulputate. - Nunc condimentum aliquam ligulasdasda, vel tincidunt nunc fringilla eget. Ut arcu nisl, auctor viverra tempor ut, - dapibus et mi. Etiam porttitor, quam venenatis luctus porta, risus sapien rutrum ipsum, quis luctus sem mi - posuere urna. Duis interdum, justo quis sodales vulputate, mauris nisi hendrerit lacus, - porttitor consequat diam tortor ut lorem. Nullam in justo sit amet orci ornare porta quis nec nulla. - Vestibulum eu mattis arcu. In nulla purus, vestibulum id ornare placerat, sagittis quis lacus. - Aenean a eros eu sem pulvinar iaculis. Quisque molestie, sapien ac luctus tempus, eros dui posuere nulla, - quis euismod dolor nisl nec dolor. Duis laoreet varius fermentum. Pellentesque habitant morbi tristique - senectus et netus et malesuada fames ac turpis egestas. Mauris at nulla quam, et eleifend mi. - Maecenas magna arcu, posuere sit amet ullamcorper vehicula, ornare nec lectus. Curabitur nec interdum nisi. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. -

-

Tools

- -
Cannot load file
- - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twStylesheet.html b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twStylesheet.html deleted file mode 100755 index 3b8b6a7d6..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/twStylesheet.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - jQuery.twStylesheet - - - - - - - -

jQuery.twStylesheet

-

- This jQuery plugin allows the application - of CSS rule sets to the document. -

-

- In contrast to jQuery's CSS methods, - it applies styles to the document rather than to individual elements (just - like defining a static style sheet in the document head). -

-

- The code is based on TiddlyWiki's dynamic - style-sheet capabilities, where it is used to allow users to customize their - documents on the fly. -

- -

Source

-

- The source code is currently hosted in TiddlyWiki's - Subversion repository. -

-

- Feedback is welcome. -

- -

API Summary

-
    -
  • -

    $.twStylesheet(css[, options]): adds or replaces a style sheet

    -

    - css is a string containing the CSS rule sets, while - options.id is an optional name identifying the style sheet, allowing - co-existence of multiple style sheets -

    -
  • -
  • -

    - $.twStylesheet.remove([options]): delete an existing style sheet -

    -

    - The options argument is identical to $.twStylesheet's. -

    -
  • -
-

(full documentation in the code comments)

- -

Demo

- This will apply the CSS rule sets below to the entire document. -
- CSS - - - -
- - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/update b/editions/tw2/source/tiddlywiki/jquery/plugins/doc/update deleted file mode 100755 index 1be8cde57..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/doc/update +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# upload [user] - -REMOTE_USER=${1:-$USER} -HOST="jquery.tiddlywiki.org" -DIR="/var/www/www.jquery.tiddlywiki.org/htdocs/" - -COMMANDS="ssh $REMOTE_USER@$HOST" -COMMANDS="$COMMANDS cd $DIR;" -COMMANDS="$COMMANDS sudo svn update;" -$COMMANDS diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.encoding.digests.sha1.js b/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.encoding.digests.sha1.js deleted file mode 100755 index db026415c..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.encoding.digests.sha1.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -jQuery.encoding.digests.sha1.js - -SHA-1 digest and associated utility functions - -Copyright (c) UnaMesa Association 2009 - -Dual licensed under the MIT and GPL licenses: - http://www.opensource.org/licenses/mit-license.php - http://www.gnu.org/licenses/gpl.html -*/ - -(function($) { - -if(!$.encoding) - $.encoding = {}; - $.extend($.encoding,{ - strToBe32s: function(str) { - // Convert a string to an array of big-endian 32-bit words - var be=[]; - var len=Math.floor(str.length/4); - var i, j; - for(i=0, j=0; i>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32); - j++; - } - return be; - }, - be32sToStr: function(be) { - // Convert an array of big-endian 32-bit words to a string - var str=''; - for(var i=0;i>5]>>>(24-i%32)) & 0xff); - } - return str; - }, - be32sToHex: function(be) { - // Convert an array of big-endian 32-bit words to a hex string - var hex='0123456789ABCDEF'; - var str=''; - for(var i=0;i>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF); - } - return str; - } - }); -})(jQuery); - - -(function($) { - -if(!$.encoding.digests) - $.encoding.digests = {}; - $.extend($.encoding.digests,{ - hexSha1Str: function(str) { - // Return, in hex, the SHA-1 hash of a string - return $.encoding.be32sToHex($.encoding.digests.sha1Str(str)); - }, - sha1Str: function(str) { - // Return the SHA-1 hash of a string - return sha1($.encoding.strToBe32s(str),str.length); - }, - sha1: function(x,blen) { - // Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words - return sha1($.encoding.strToBe32s(str),str.length); - } - }); - - // Private functions. - function sha1(x,blen) { - // Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words - function add32(a,b) { - // Add 32-bit integers, wrapping at 32 bits - // Uses 16-bit operations internally to work around bugs in some JavaScript interpreters. - var lsw=(a&0xFFFF)+(b&0xFFFF); - var msw=(a>>16)+(b>>16)+(lsw>>16); - return (msw<<16)|(lsw&0xFFFF); - } - function AA(a,b,c,d,e) { - // Cryptographic round helper function. Add five 32-bit integers, wrapping at 32 bits, second parameter is rotated left 5 bits before the addition - // Uses 16-bit operations internally to work around bugs in some JavaScript interpreters. - b=(b>>>27)|(b<<5); - var lsw=(a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF); - var msw=(a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16); - return (msw<<16)|(lsw&0xFFFF); - } - function RR(w,j) { - // Cryptographic round helper function. - var n=w[j-3]^w[j-8]^w[j-14]^w[j-16]; - return (n>>>31)|(n<<1); - } - - var len=blen*8; - //# Append padding so length in bits is 448 mod 512 - x[len>>5] |= 0x80 << (24-len%32); - //# Append length - x[((len+64>>9)<<4)+15]=len; - var w=new Array(80); - - var k1=0x5A827999; - var k2=0x6ED9EBA1; - var k3=0x8F1BBCDC; - var k4=0xCA62C1D6; - - var h0=0x67452301; - var h1=0xEFCDAB89; - var h2=0x98BADCFE; - var h3=0x10325476; - var h4=0xC3D2E1F0; - - for(var i=0;i>>2)|(b<<30); b=a; a=t; j++; - } - while(j<20) { - w[j]=RR(w,j); - t=AA(e,a,d^(b&(c^d)),w[j],k1); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<40) { - w[j]=RR(w,j); - t=AA(e,a,b^c^d,w[j],k2); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<60) { - w[j]=RR(w,j); - t=AA(e,a,(b&c)|(d&(b|c)),w[j],k3); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<80) { - w[j]=RR(w,j); - t=AA(e,a,b^c^d,w[j],k4); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - h0=add32(h0,a); - h1=add32(h1,b); - h2=add32(h2,c); - h3=add32(h3,d); - h4=add32(h4,e); - } - return [h0,h1,h2,h3,h4]; - } -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twFile.js b/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twFile.js deleted file mode 100755 index 1967e30c4..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twFile.js +++ /dev/null @@ -1,333 +0,0 @@ -/* -jQuery.twFile.js - -jQuery plugin for loading a file and saving data to a file - -Copyright (c) UnaMesa Association 2009 - -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 -*/ - - -(function($) { - if(!$.twFile) { - $.twFile = {}; - } - - $.extend($.twFile,{ - currentDriver: null, - driverList: ["tiddlySaver", "activeX","javaLiveConnect", "mozilla"], - - // Loads the contents of a text file from the local file system - // filePath is the path to the file in these formats: - // x:\path\path\path\filename - PC local file - // \\server\share\path\path\path\filename - PC network file - // /path/path/path/filename - Mac/Unix local file - // returns the text of the file, or null if the operation cannot be performed or false if there was an error - load: function(filePath) { - var d = this.getDriver(); - return d ? d.loadFile(filePath) : null; - }, - // Saves a string to a text file on the local file system - // filePath is the path to the file in the format described above - // content is the string to save - // returns true if the file was saved successfully, or null if the operation cannot be performed or false if there was an error - save: function(filePath,content) { - var d = this.getDriver(); - return d ? d.saveFile(filePath,content) : null; - }, - // Copies a file on the local file system - // dest is the path to the destination file in the format described above - // source is the path to the source file in the format described above - // returns true if the file was copied successfully, or null if the operation cannot be performed or false if there was an error - copy: function(dest,source) { - var d = this.getDriver(); - if(d && d.copyFile) - return d.copyFile(dest,source); - else - return null; - }, - // Converts a local file path from the format returned by document.location into the format expected by this plugin - // url is the original URL of the file - // returns the equivalent local file path - convertUriToLocalPath: function (url) { - // Remove any location or query part of the URL - var originalPath = url.split("#")[0].split("?")[0]; - // Convert file://localhost/ to file:/// - if(originalPath.indexOf("file://localhost/") == 0) - originalPath = "file://" + originalPath.substr(16); - // Convert to a native file format - //# "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..." - //# "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..." - //# "file:///path/path/path..." - mac/unix local file --> "/path/path/path..." - //# "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..." - var localPath; - if(originalPath.charAt(9) == ":") // PC local file - localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file://///") == 0) // Firefox PC network file - localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file:///") == 0) // Mac/UNIX local file - localPath = unescape(originalPath.substr(7)); - else if(originalPath.indexOf("file:/") == 0) // Mac/UNIX local file - localPath = unescape(originalPath.substr(5)); - else if(originalPath.indexOf("//") == 0) // PC network file - localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\"); - return localPath || originalPath; - }, - - // Deferred initialization for any drivers that need it - // returns a Deferred object so callback that executes as soon - // as twFile is ready can be attached - initialize: function() { - return $.Deferred(function(dfd) { - for(var t in drivers) { - if(drivers[t].deferredInit) - drivers[t].deferredInit(); - } - // Kludge: give the some time to load - setTimeout(dfd.resolve, 0); - }); - }, - - // Private functions - - // Returns a reference to the current driver - getDriver: function() { - if(this.currentDriver === null) { - for(var t=0; t=0;i--) { - if(!fso.FolderExists(scan[i])) { - fso.CreateFolder(scan[i]); - } - } - return true; - } catch(ex) { - } - return false; - }, - copyFile: function(dest,source) { - drivers.activeX.createPath(dest); - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - fso.GetFile(source).Copy(dest); - } catch(ex) { - return false; - } - return true; - }, - saveFile: function(filePath,content) { - // Returns null if it can't do it, false if there's an error, true if it saved OK - drivers.activeX.createPath(filePath); - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var file = fso.OpenTextFile(filePath,2,-1,0); - file.Write(content); - file.Close(); - } catch (ex) { - return null; - } - return true; - } - }; - - // Mozilla driver - - drivers.mozilla = { - name: "mozilla", - isAvailable: function() { - return !!window.Components; - }, - loadFile: function(filePath) { - // Returns null if it can't do it, false if there's an error, or a string of the content if successful - if(window.Components) { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - file.initWithPath(filePath); - if(!file.exists()) - return null; - var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); - inputStream.init(file,0x01,00004,null); - var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); - sInputStream.init(inputStream); - var contents = sInputStream.read(sInputStream.available()); - sInputStream.close(); - inputStream.close(); - return contents; - } catch(ex) { - //# alert("Exception while attempting to load\n\n" + ex); - return false; - } - } - return null; - }, - saveFile: function(filePath,content) { - // Returns null if it can't do it, false if there's an error, true if it saved OK - if(window.Components) { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - file.initWithPath(filePath); - if(!file.exists()) - file.create(0,0664); - var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream); - out.init(file,0x20|0x02,00004,null); - out.write(content,content.length); - out.flush(); - out.close(); - return true; - } catch(ex) { - alert("Exception while attempting to save\n\n" + ex); - return false; - } - } - return null; - } - }; - - // TiddlySaver driver - - drivers.tiddlySaver = { - name: "tiddlySaver", - deferredInit: function() { - if(!document.applets["TiddlySaver"] && /* !$.browser.mozilla && !$.browser.msie && */ document.location.toString().substr(0,5) == "file:") { - $(document.body).append(""); - } - }, - isAvailable: function() { - var isReady = false; - try { - isReady = !!document.applets["TiddlySaver"] && - ($.browser.msie || document.applets["TiddlySaver"].isActive) && - ( document.applets["TiddlySaver"].isActive() ); - } catch (ex) { - isReady = false; - } - return isReady; - }, - loadFile: function(filePath) { - var r; - try { - if(document.applets["TiddlySaver"]) { - r = document.applets["TiddlySaver"].loadFile(javaUrlToFilename(filePath),"UTF-8"); - return (r === undefined || r === null) ? null : String(r); - } - } catch(ex) { - } - return null; - }, - saveFile: function(filePath,content) { - try { - if(document.applets["TiddlySaver"]) - return document.applets["TiddlySaver"].saveFile(javaUrlToFilename(filePath),"UTF-8",content); - } catch(ex) { - } - return null; - } - }; - - // Java LiveConnect driver - - drivers.javaLiveConnect = { - name: "javaLiveConnect", - isAvailable: function() { - return !!window.java && !!window.java.io && !!window.java.io.FileReader; - }, - loadFile: function(filePath) { - var r; - var content = []; - try { - r = new java.io.BufferedReader(new java.io.FileReader(javaUrlToFilename(filePath))); - var line; - while((line = r.readLine()) != null) - content.push(new String(line)); - r.close(); - } catch(ex) { - return null; - } - return content.join("\n") + "\n"; - }, - saveFile: function(filePath,content) { - try { - var s = new java.io.PrintStream(new java.io.FileOutputStream(javaUrlToFilename(filePath))); - s.print(content); - s.close(); - } catch(ex) { - return null; - } - return true; - } - }; - - // Private utilities - - function javaUrlToFilename(url) { - var f = "//localhost"; - if(url.indexOf(f) == 0) - return url.substring(f.length); - var i = url.indexOf(":"); - return i > 0 ? url.substring(i-1) : url; - } - -})(jQuery); - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twStylesheet.js b/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twStylesheet.js deleted file mode 100755 index 7ef4da4b9..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/jQuery.twStylesheet.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -jQuery.twStylesheet.js - -jQuery plugin to dynamically insert CSS rules into a document - -Usage: - jQuery.twStylesheet applies style definitions - jQuery.twStylesheet.remove neutralizes style definitions - -Copyright (c) UnaMesa Association 2009 - -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 -*/ - -(function($) { - -var defaultId = "customStyleSheet"; // XXX: rename to dynamicStyleSheet? - -// Add or replace a style sheet -// css argument is a string of CSS rule sets -// options.id is an optional name identifying the style sheet -// options.doc is an optional document reference -// N.B.: Uses DOM methods instead of jQuery to ensure cross-browser comaptibility. -$.twStylesheet = function(css, options) { - options = options || {}; - var id = options.id || defaultId; - var doc = options.doc || document; - var el = doc.getElementById(id); - if(doc.createStyleSheet) { // IE-specific handling - if(el) { - el.parentNode.removeChild(el); - } - doc.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd", - ' '); // fails without   - } else { // modern browsers - if(el) { - el.replaceChild(doc.createTextNode(css), el.firstChild); - } else { - el = doc.createElement("style"); - el.type = "text/css"; - el.id = id; - el.appendChild(doc.createTextNode(css)); - doc.getElementsByTagName("head")[0].appendChild(el); - } - } -}; - -// Remove existing style sheet -// options.id is an optional name identifying the style sheet -// options.doc is an optional document reference -$.twStylesheet.remove = function(options) { - options = options || {}; - var id = options.id || defaultId; - var doc = options.doc || document; - var el = doc.getElementById(id); - if(el) { - el.parentNode.removeChild(el); - } -}; - -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/jquery.gettext-1.0.4.js b/editions/tw2/source/tiddlywiki/jquery/plugins/jquery.gettext-1.0.4.js deleted file mode 100755 index a0d661182..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/jquery.gettext-1.0.4.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * gettext for jQuery - * - * Copyright (c) 2008 Sabin Iacob (m0n5t3r) - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * @license http://www.gnu.org/licenses/gpl.html - * @project jquery.gettext - * - * Usage: - * - * This plugin expects its input data to be a JSON object like - * {"": header, "string": "translation", ...} - * - * After getting the server side set up (either as a static file - my choice - or - * as a web service), the client side is simple: - * * add to the head section of the page something like - * - * * in your script, use $.gt.gettext(string) or _(string); for plural forms, use - * $.gt.ngettext(sg, pl1[, pl2, ...], count) or n_(sg, pl1[, pl2, ...], count) - * * to extract strings to a .po file, you can use standard gettext utilities like - * xgettext and msgfmt; to generate the JSON, one could use the following Python - * snippet, assuming a domain.mo file exists under path/lang/LC_MESSAGES: - * - * import simplejson as enc - * - * def gettext_json(domain, path, lang = [], indent = False): - * try: - * tr = gettext.translation(domain, path, lang) - * return enc.dumps(tr._catalog, ensure_ascii = False, indent = indent) - * except IOError: - * return None - * - * why go through the additional hassle of gettext? well, it's a matter of - * preference, the main advantags I see are: - * * well known editing tools like KBabel, poEdit, gtranslator, Emacs PO mode, - * etc. - * * translation memory, fuzzy matches and other features that get really - * helpful when your application is big and you have hundreds of strings - */ -(function($) { - $.gt = $.gt || {}; - - $.extend($.gt, { - messages: {}, - lang: 'C', - setLang: function(code) { $.gt.lang = typeof code == 'string' && code != ' ' ? code : 'C'; }, - pl_re: /^Plural-Forms:\s*nplurals\s*=\s*(\d+);\s*plural\s*=\s*([^a-zA-Z0-9\$]*([a-zA-Z0-9\$]+).+)$/m, - plural: function(n) {return n != 1;}, - load: function() { - $('link[rel=gettext]').each(function(){ - var lang = this.lang; - $.get(this.href, function(data){ - $.gt.messages[lang] = $.gt.messages[lang] || {}; - try { - var messages = eval('(' + data + ')'); - } catch(e) { - return; - } - - $.extend($.gt.messages[lang], messages); - - var pl = $.gt.pl_re.exec($.gt.messages[lang]['']); - if(pl){ - var expr = pl[2]; - var np = pl[1]; - var v = pl[3]; - try { - var fn = eval('(function(' + v + ') {return ' + expr + ';})'); - } catch(e) { - return; - } - $.gt.plural = fn; - } - }); - }); - $.gt.setLang($('html').attr('lang')); - }, - gettext: function(msgstr) { - var lang = $.gt.lang; - - if(lang == 'C' || typeof $.gt.messages[lang] == 'undefined') { - return msgstr; - } - - var trans = $.gt.messages[lang][msgstr]; - - if(typeof trans == 'string') { // regular action - return trans; - } else if(typeof trans == 'object' && trans.constructor == Array) { // the translation contains plural(s), yet gettext was called - return trans[0]; - } - return msgstr; - }, - ngettext: function() { - var lang = $.gt.lang; - var argv = Array.apply(null, arguments); - var cnt = argv[argv.length - 1]; - var sg = argv[0]; - var pls = argv.slice(0, -1); - - var trans = pls; - - if(lang != 'C' && typeof $.gt.messages[lang] != 'undefined') { - trans = $.gt.messages[lang][sg]; - } - - if(typeof trans == 'string') { // called ngettext, but no plural forms available :-? - return trans; - } else if(typeof trans == 'object' && trans.constructor == Array) { - var pl = $.gt.plural(cnt); - if(typeof pl == 'boolean' && pls.length == 2) { - pl = pl ? 1 : 0; - } - if(typeof pl == 'number' && pl < trans.length) { - return trans[pl]; - } - } - return sg; - } - }); - - $('document').ready($.gt.load); -})(jQuery); - -if(typeof _ == 'undefined') { - var _ = jQuery.gt.gettext; -} -if(typeof n_ == 'undefined') { - var n_ = jQuery.gt.ngettext; -} diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.js b/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.js deleted file mode 100755 index e15bc079d..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -jquery.tw.js -addition of tw 'namespace' -*/ -(function($) { - if(!$.tw) { - $.tw = {}; - $.tw.extend = $.extend; - } -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.js b/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.js deleted file mode 100755 index 35dc62d7a..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -jquery.tw.macro.js -macro parameter expansion -*/ -(function($) { - $.tw.extend({ - expandMacroParams: function(params) { - // expand the macro parameters into a name:value hash - // all parameters are also given a numeric name, starting at 1 - var opts = {}; - var unnamed = 1; - var name,val; - var t = $.trim(params); - var s = 0; - var i = findNakedSpace(t,s); - var param = i==-1 ? t.substr(s) : t.substring(s,i); - while(true) { - var ci = param.indexOf(':'); - if(ci==-1) { - // parameter is unnamed - name = param ? unnamed++ : null; - val = param; - } else { - name = param.substr(0,ci); - val = param.substr(ci+1); - } - val = $.trim(val); - if(val.charAt(0)=='"' && val.charAt(val.length-1)=='"') { - val = val.substr(1,val.length-2); - } - if(name) - opts[name] = val; - if(i==-1) - break; - s = i+1; - i = findNakedSpace(t,s); - param = i==-1 ? t.substr(s) : t.substring(s,i); - } - return opts; - } - }); - - // Private functions. - function findNakedSpace(text,start) { - // find the next space not surrounded by quotes - var d = text.indexOf(' ',start); - if(d==-1) - return -1; - var qs = text.indexOf('"',start); - if(qs==-1 || qs > d) - return d; - var qe = text.indexOf('"',qs+1); - if(qe==-1) - return d; - return findNakedSpace(text,qe+1); - } - -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.today.js b/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.today.js deleted file mode 100755 index 33b187437..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/obsolete/jquery.tw.macro.today.js +++ /dev/null @@ -1,15 +0,0 @@ -/* -jquery.tw.macro.today.js -jQuery TiddlyWiki <> macro -*/ -(function($) { - $.fn.tw_today = function(args) { - args.format = args.format || args[1]; - var opts = $.extend({},$.fn.tw_today.defaults,args); - var now = new Date(); - var text = now.formatString(opts.format.trim()); - this.append(""+text+""); - return this; - }; - $.fn.tw_today.defaults = {format:"ddd mmm 0DD 0hh:0mm:0ss YYYY"}; -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/split.recipe b/editions/tw2/source/tiddlywiki/jquery/plugins/split.recipe deleted file mode 100755 index 363112e06..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/split.recipe +++ /dev/null @@ -1,2 +0,0 @@ -jquery: jQuery.encoding.digests.sha1.js -jquery: jQuery.twStylesheet.js diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/test/TiddlySaver.jar b/editions/tw2/source/tiddlywiki/jquery/plugins/test/TiddlySaver.jar deleted file mode 100755 index 7ff2c9da39948c5e36b02bdc117082f2328a33ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5012 zcmaJ_by!r}yM|$gjzL1CQ$iX9X-VmB>E_Vg-8~|Ml!$-`(kb07Gc=MC(w%|`!^Lxc z=O@Q|@A=k0`+4?yzy0iYt#^Iz`cxHAfP_fsx5G-z?+MbKAiRB6lGYSwlT()AP!d;` zlabcYWLJ`LfHmQUaw0t)eH|XOxs;;@i6W6)K@z2@RHI>eX`AyDhj5ITsP#+VkZ+V5 zUUV{{+gk(9ulc!rBU(zS+Sqg<1U(Kx9qP4Bd}xyI%doJuwe2*xFay}k;E~~75uZ?<+ z@1ur8&qtCHoQ7PJGuO#lc}AtL2irG2^sT!tc8N2bKUi^3E{#_O%;#Ku#*%$RZYv#24LuBAcyP zeVoQ@WCoq%MeWpP=`QbB*7nOAbr8_Vh> zh+pUzVn&~Z+B9s2SSo~oY+vX@r;H40Rhu-|`r+WG?jnIZui)u!R@vv*Vm!k`CpRrT zPn|k)dG3>$;SgwpQTVp?RD!b~BTItKa9Fq23m!}l#RFKgx2W^7X8@;~DmhUK37RCK zF+h{YjKMbHMxVoUksiLzkjisgvfw%Wi6F9Iyb|aZf?yux;rdpuCSj^L|A6q#HG|Ea2jj`0|To?whHEZ0;1zX%$W0w++sn zVUAW%XV@#M(}FXj3YI*#qmbkMusCKaM|}sMqa!;z#=b>W-0H6>>rmP^qt9yJqF#-Y zY(>Hit=NQSHVzNt^z*Wq{pgOSAKxi;=~|Ic$JS zMZdhtuy>FUqz^m5zxLfi3{|m8WKwOp6yD95ymi`- znd_*GPgh^8uI#7%RaW%OwZ2{!HZ(P;_1jWFZ#GjqaUkJBc?7_S|)?;ynN+c-ex?K z6@b_7utXSHcU}ef*_L9Qm zZ}BT1;|n_Ac(}3E3TzZNi^w{o#Ac$7k2kRCpax%%;pg=)y)4t-2#=M*)G9dODU&Kd zK=#tNlvAc(K@{^odA%1vqFlK05Htm$LglUTt$AgsuqB(fP)}@mDVG4Q9@+fT5f6ld z7wt(+{qdGiiDA7++=o{31KLXhCx6iBccnZqqv>*bA$2bSbKKt8nQlM@y2{V#nrEP< zKTW4cti!(R_(EG?UTF#()=qstoH^Cm1A1p|o#BCqcNHk+M z6>q@(29@>V_q#@R<`nk#nlywwZ4bYUmxM5Y0t99mDWj(N11NCe3Ftxc9HUUB%d*+~ zx=bWgiA^KCKGyX%2F}vDy#_Ar{q7%Te2ZwZ#RRlV6nFa&T*StdEP)wfkmUE#*^q$? z^tQ{spt;?^+*4Hdarvq?g*J$B!p=M>8q4|{y#Tw9bJViu&O{Jc!~*RU^7#8= zgore(Prk!kGiWxp?$&y7v!8CQtkmDiAPgYvUNc5EqK zt)LEK`p@@(|4jO2QGN##+|JOnwXm@F z(J=M2bfxEFH@7!+b92yysS}8U5s~&)rh47LP+H8wLK-n3Q7#}ixUeIb30;Q0tO=zg zQt6LsRoCNf6z?$>JfnJMZ8>#I)zr!0liZvbM+5(fC$#eoI{ImW@r55h13n=f4q z#pxn}^~>+by|s!og(c8`DA8P6V#krwamx^8b+SD$=iVQb<(eq{V@5eZt{Q9J6usb$ zU9moGv0hw^Z69B04|3$}*5gllD~Uxsg|z-1L#_(X*Re&d2Uy*|aZbFqR_y98Q?e_b zFA!-JALo8e6Zz$ka#$P@mRhEVYRhX4ZtF9uB+2MBY|7mi^MiX>Kb0o=$^!oy8q4#f zcqI#b4zaTNq9RaLRnfi|gv;})khJ~?Vi)NQyb*BJu+z$0dIL67?+H*W@(zx|R#f9+ zJBFLY7F7C?byY5KTCVAk%MaIDb{xx2@D-ckCOt^p=TMchAR)b(>oeLGK1dT#=pl$7 z5B5^3JfTHl@*AwG7s;5!1Q|_B>QmrLX4Tgkkz3j6unX;{kS(_;vrQwsX{?&JHGN`*meVPQRAQe9943ca|NYfduBwmJR3$7 zJ$119fiklF=3aOF0-(?)BZ+>{1k!avSCq1u+cSxKkWZt+LXlX|mR9-r^?0WJ`=n)F zVf5G?Dc|?risA4*arZ?}Rh$4*cl<=il(=qgEwefxPKsZRAjYASAjV1Ja<`X93V$vU zA(u4$%#Q0Alug_0#HAU@p%I$J-t~q#k57`a2>33%F-8~v536G#z^FI=SqB~c`qZPg zfq5|7%BIYNkiA1{2d5z^1)B_Nl|l@d)0ZwP;a1$X_VTvxj3ROaFHa-$FQ(9H`c@<` zIC9n$8hWOxTwh9vrKh%rBh;cud)1g^tO6|4F_h=nOPHC4U4 zi4aO_Q>#vxOLNg>={L)s$~NQJ&>Sinf*9i;k&>s4!87rH=wTJ73ZZhWaMTIVpg2+|5c&|FV(rusVH`!Z2r)Ic;s(B_#DUIUPpqMSP}YtKn_lS);g7 z)^2c-wy~&w6BgeLK7^-KY0jJLu!g`7Whow2H$KF%R__8QlfsvqBLl;Eu`5WVWIN&` z(b9-EJ;R37h4lv3^4Y369L8Vp!IsL+6K6|8vK$k8Byo};V}~Rvy!j2?8uXyqM0Q9O zd3w3@5EgL9&5{K!)ALp|zqO1e3%=yaX>p2G@OVq3472fD(^FSfX1|vC8Tk4Hv zGjFd|v0?$0zp-;JNm$xyZXOFAf#&A(w|&xI^F4Wt!#<>eot4E_8v8B73zMCWVT4FD z06~HFsG&D)rJ*-n%NN6o)_OI-{g~%*G>~nS13Kg7 zqTC}CBcFnAZ&?qz+7#2g@Ra;iH{{Mh6RJe87(`@}jaBAm49TOn2-P}FHf?Ezw(~R1 z&GzqG=PIG_-8_%!;&{yBtYXddlY=YK!6rvX`}6Zv z;{6wzTiA_k%XmL)iAs+IN$of$FL%p_a zypgacEEoM9H8vq33n=NUBGU`Vi*(&XA)k>rBCM4eJO-!Ct$Nutr7C*8W=pED-+exP|P{l@p4d~V7 z)FD^OWHiod) zic``Cn~>18>aB_&qj;U9L25%;K67=OJaRcBN$Bbf?$r8^3_BuiJ2{x zMX4}lYEV#0dgV9n|7j`+pV@~b++MlSZcjB;1!Mpr(ytcI-L}Th7S2E8|7z&`p5gAL z{^x%96{xr0{BMT8n<2l$?>e5JH~(KDf4lvDgWvW6?&ANpHh-I*pT6i<*kjzm|8z;e zL+_sSKhN`DQFIHvv# - - - - - Tests - - - - - - - - - - - - - -

-
    -
    - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/test/jQuery.twStylesheet.html b/editions/tw2/source/tiddlywiki/jquery/plugins/test/jQuery.twStylesheet.html deleted file mode 100755 index 1eeb2098d..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/test/jQuery.twStylesheet.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Tests - - - - - - - - - - - - - -

    -
      -
      - - - diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twFile.js b/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twFile.js deleted file mode 100755 index f478f887e..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twFile.js +++ /dev/null @@ -1,86 +0,0 @@ -jQuery(document).ready(function() { - module("jQuery.twFile"); - - test("load", function() { - var actual, expected, filepath; - - actual = jQuery.twFile.load(); - expected = null; - same(actual, expected, "returns null if no argument is specified"); - - filepath = getDocumentPath() + "/sample.txt"; - actual = jQuery.twFile.load(filepath); - expected = "lorem ipsum\n" + - "dolor sit amet\n" + - "\n" + - " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n" + - "foo bar baz\n"; - same(actual, expected, "returns contents of specified file"); - - filepath = "/null"; - actual = jQuery.twFile.load(filepath); - expected = null; - same(actual, expected, "returns null if the specified file does not exist"); - - filepath = "sample.txt"; - actual = jQuery.twFile.load(filepath); - expected = null; - same(actual, expected, "returns null if specified file path is not absolute"); - }); - - test("save", function() { - var actual, expression, expected, str; - var filepath = getDocumentPath() + "/savetest.txt"; - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { jQuery.twFile.save(); }; - expected = "ReferenceError"; - raises(expression, expected, "raises exception if no argument is specified"); - */ - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { jQuery.twFile.save(filepath); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no content argument is specified"); - */ - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { jQuery.twFile.save("foo.txt", "sample content"); }; - expected = "ReferenceError"; - raises(expression, expected, "raises exception if specified file path is not absolute"); - */ - - str = "lorem ipsum\n" + - "dolor sit amet\n" + - "\n" + - " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n" + - //"\xa9\u010d\u010c\n" + - "foo bar baz\n" + - (new Date).toString(); - saveAndLoadString(filepath, str, "writes given ANSI text content to specified file"); - - //str = "\xa9\u010d\u010c"; - //saveAndLoadString(filepath, str, "writes given UTF-8 text content to specified file"); - - //jQuery.twFile.save(filepath, ""); // teardown: blank file contents (deletion impossible) - }); - - // helper function to save and load back a string to a file - var saveAndLoadString = function(filepath,str,desc) { - jQuery.twFile.save(filepath, str); - var actual = jQuery.twFile.load(filepath); - same(actual, str, desc); - } - - // helper function to retrieve current document's file path - var getDocumentPath = function() { - var path = document.location.pathname; - var startpos = 0; - var endpos = path.lastIndexOf("/"); - if(path.charAt(2) == ":") { - startpos = 1; - path = path.replace(new RegExp("/","g"),"\\") - } - return unescape(path.substring(startpos, endpos)); - }; -}); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twStylesheet.js b/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twStylesheet.js deleted file mode 100755 index 56a00cbae..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/test/js/jQuery.twStylesheet.js +++ /dev/null @@ -1,69 +0,0 @@ -jQuery(document).ready(function() { - module("jQuery.twStylesheet"); - - test("apply", function() { - var actual, expected, el; - - el = jQuery('
      ').appendTo(document.body); - jQuery.twStylesheet("div { overflow: hidden; }"); - actual = jQuery(el).css("overflow"); - expected = "hidden"; - same(actual, expected, "applies style definitions to document"); - // teardown - jQuery(el).remove(); - jQuery.twStylesheet.remove(); - - el = jQuery('
      ').appendTo(document.body); - jQuery.twStylesheet("div { font-style: italic; }"); - actual = jQuery(el).css("font-style"); - expected = "italic"; - same(actual, expected, "applies style definitions to newly-created elements"); - // teardown - jQuery(el).remove(); - jQuery.twStylesheet.remove(); - - jQuery.twStylesheet("", { id: "dummyStyleSheet" }); - actual = jQuery("#dummyStyleSheet").length; - expected = 1; - same(actual, expected, "generates style element using given ID"); - // teardown - jQuery.twStylesheet.remove({ id: "dummyStyleSheet" }); - - // TODO: test for options.doc argument - - }); - - test("remove", function() { - var actual, expected; - - // setup - el = jQuery('
      ').appendTo(document.body); - jQuery.twStylesheet("div { overflow: hidden; }"); - // test - jQuery.twStylesheet.remove(); - actual = jQuery(el).css("overflow"); - expected = "visible"; - same(actual, expected, "neutralizes style definitions"); - // teardown - jQuery(el).remove(); - - // setup - jQuery.twStylesheet(""); - // test - jQuery.twStylesheet.remove(); - actual = jQuery("#customStyleSheet").length; - expected = 0; - same(actual, expected, "removes default style sheet if no ID is given"); - - // setup - jQuery.twStylesheet("", { id: "dummyStyleSheet" }); - // test - jQuery.twStylesheet.remove({ id: "dummyStyleSheet" }); - actual = jQuery("#dummyStyleSheet").length; - expected = 0; - same(actual, expected, "removes style element using given ID"); - - // TODO: test for options.doc argument - - }); -}); diff --git a/editions/tw2/source/tiddlywiki/jquery/plugins/test/sample.txt b/editions/tw2/source/tiddlywiki/jquery/plugins/test/sample.txt deleted file mode 100755 index 9036986bd..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/plugins/test/sample.txt +++ /dev/null @@ -1,5 +0,0 @@ -lorem ipsum -dolor sit amet - - !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ -foo bar baz diff --git a/editions/tw2/source/tiddlywiki/jquery/split.recipe b/editions/tw2/source/tiddlywiki/jquery/split.recipe deleted file mode 100755 index 269987a30..000000000 --- a/editions/tw2/source/tiddlywiki/jquery/split.recipe +++ /dev/null @@ -1,2 +0,0 @@ -jslib: jquery.js -recipe: plugins/split.recipe diff --git a/editions/tw2/source/tiddlywiki/js/AdaptorBase.js b/editions/tw2/source/tiddlywiki/js/AdaptorBase.js deleted file mode 100755 index d63c76b4c..000000000 --- a/editions/tw2/source/tiddlywiki/js/AdaptorBase.js +++ /dev/null @@ -1,90 +0,0 @@ -//-- -//-- Server adaptor base class -//-- - -function AdaptorBase() -{ - this.host = null; - this.store = null; - return this; -} - -AdaptorBase.prototype.close = function() -{ - return true; -}; - -AdaptorBase.prototype.fullHostName = function(host) -{ - if(!host) - return ''; - host = host.trim(); - if(!host.match(/:\/\//)) - host = 'http://' + host; - if(host.substr(host.length-1) == '/') - host = host.substr(0,host.length-1); - return host; -}; - -AdaptorBase.minHostName = function(host) -{ - return host; -}; - -AdaptorBase.prototype.setContext = function(context,userParams,callback) -{ - if(!context) context = {}; - context.userParams = userParams; - if(callback) context.callback = callback; - context.adaptor = this; - if(!context.host) - context.host = this.host; - context.host = this.fullHostName(context.host); - if(!context.workspace) - context.workspace = this.workspace; - return context; -}; - -// Open the specified host -//# host - uri of host (eg, "http://www.tiddlywiki.com/" or "www.tiddlywiki.com") -//# context is itself passed on as a parameter to the callback function -//# userParams - user settable object object that is passed on unchanged to the callback function -//# callback - optional function to be called on completion -//# Return value is true if the request was successfully issued, false if this connector doesn't support openHost(), -//# or an error description string if there was a problem -//# The callback parameters are callback(context) -//# context.status - true if OK, string if error -//# context.adaptor - reference to this adaptor object -//# userParams - parameters as originally passed into the openHost function -AdaptorBase.prototype.openHost = function(host,context,userParams,callback) -{ - this.host = host; - context = this.setContext(context,userParams,callback); - context.status = true; - if(callback) - window.setTimeout(function() {context.callback(context,userParams);},10); - return true; -}; - -// Open the specified workspace -//# workspace - name of workspace to open -//# context - passed on as a parameter to the callback function -//# userParams - user settable object object that is passed on unchanged to the callback function -//# callback - function to be called on completion -//# Return value is true if the request was successfully issued -//# or an error description string if there was a problem -//# The callback parameters are callback(context,userParams) -//# context.status - true if OK, false if error -//# context.statusText - error message if there was an error -//# context.adaptor - reference to this adaptor object -//# userParams - parameters as originally passed into the openWorkspace function -AdaptorBase.prototype.openWorkspace = function(workspace,context,userParams,callback) -{ - this.workspace = workspace; - context = this.setContext(context,userParams,callback); - context.status = true; - if(callback) - window.setTimeout(function() {callback(context,userParams);},10); - return true; -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Animator.js b/editions/tw2/source/tiddlywiki/js/Animator.js deleted file mode 100755 index f6263a88c..000000000 --- a/editions/tw2/source/tiddlywiki/js/Animator.js +++ /dev/null @@ -1,46 +0,0 @@ -//- -//- Animation engine -//- - -function Animator() -{ - this.running = 0; // Incremented at start of each animation, decremented afterwards. If zero, the interval timer is disabled - this.timerID = 0; // ID of the timer used for animating - this.animations = []; // List of animations in progress - return this; -} - -// Start animation engine -Animator.prototype.startAnimating = function() //# Variable number of arguments -{ - var t; - for(t=0; t 0) - ListView.create(popup,items,this.listViewTemplate); - else - createTiddlyElement(popup,"div",null,null,this.emptyText); -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Config.js b/editions/tw2/source/tiddlywiki/js/Config.js deleted file mode 100755 index 23aad000e..000000000 --- a/editions/tw2/source/tiddlywiki/js/Config.js +++ /dev/null @@ -1,227 +0,0 @@ -//-- -//-- Configuration repository -//-- - -// Miscellaneous options -var config = { - numRssItems: 20, // Number of items in the RSS feed - animDuration: 400, // Duration of UI animations in milliseconds - cascadeFast: 20, // Speed for cascade animations (higher == slower) - cascadeSlow: 60, // Speed for EasterEgg cascade animations - cascadeDepth: 5, // Depth of cascade animation - locale: "en" // W3C language tag -}; - -// Hashmap of alternative parsers for the wikifier -config.parsers = {}; - -// Adaptors -config.adaptors = {}; -config.defaultAdaptor = null; - -// Backstage tasks -config.tasks = {}; - -// Annotations -config.annotations = {}; - -// Custom fields to be automatically added to new tiddlers -config.defaultCustomFields = {}; - -// Messages -config.messages = { - messageClose: {}, - dates: {}, - tiddlerPopup: {} -}; - -// Options that can be set in the options panel and/or cookies -config.options = { - chkRegExpSearch: false, - chkCaseSensitiveSearch: false, - chkIncrementalSearch: true, - chkAnimate: true, - chkSaveBackups: true, - chkAutoSave: false, - chkGenerateAnRssFeed: false, - chkSaveEmptyTemplate: false, - chkOpenInNewWindow: true, - chkToggleLinks: false, - chkHttpReadOnly: true, - chkForceMinorUpdate: false, - chkConfirmDelete: true, - chkInsertTabs: false, - chkUsePreForStorage: true, // Whether to use
       format for storage
      -	chkDisplayInstrumentation: false,
      -	txtBackupFolder: "",
      -	txtEditorFocus: "text",
      -	txtMainTab: "tabTimeline",
      -	txtMoreTab: "moreTabAll",
      -	txtMaxEditRows: "30",
      -	txtFileSystemCharSet: "UTF-8",
      -	txtTheme: ""
      -	};
      -config.optionsDesc = {};
      -
      -//# config.optionSource["chkAnimate"] can be:
      -//# 	cookie: the option gets stored in a cookie, with the default value coming from SystemSettings
      -//#		volatile: the option isn't persisted at all, and reverts to the default specified in SystemSettings when the document is reloaded
      -//#		setting: the option is stored in the SystemSettings tiddler
      -//#	The default is "setting"
      -config.optionsSource = {};
      -
      -// Default tiddler templates
      -var DEFAULT_VIEW_TEMPLATE = 1;
      -var DEFAULT_EDIT_TEMPLATE = 2;
      -config.tiddlerTemplates = {
      -	1: "ViewTemplate",
      -	2: "EditTemplate"
      -};
      -
      -// More messages (rather a legacy layout that should not really be like this)
      -config.views = {
      -	wikified: {
      -		tag: {}
      -	},
      -	editor: {
      -		tagChooser: {}
      -	}
      -};
      -
      -// Backstage tasks
      -config.backstageTasks = ["save","sync","importTask","tweak","upgrade","plugins"];
      -
      -// Extensions
      -config.extensions = {};
      -
      -// Macros; each has a 'handler' member that is inserted later
      -config.macros = {
      -	today: {},
      -	version: {},
      -	search: {sizeTextbox: 15},
      -	tiddler: {},
      -	tag: {},
      -	tags: {},
      -	tagging: {},
      -	timeline: {},
      -	allTags: {},
      -	list: {
      -		all: {},
      -		missing: {},
      -		orphans: {},
      -		shadowed: {},
      -		touched: {},
      -		filter: {}
      -	},
      -	closeAll: {},
      -	permaview: {},
      -	saveChanges: {},
      -	slider: {},
      -	option: {},
      -	options: {},
      -	newTiddler: {},
      -	newJournal: {},
      -	tabs: {},
      -	gradient: {},
      -	message: {},
      -	view: {defaultView: "text"},
      -	edit: {},
      -	tagChooser: {},
      -	toolbar: {},
      -	plugins: {},
      -	refreshDisplay: {},
      -	importTiddlers: {},
      -	upgrade: {
      -		source: "http://tiddlywiki-releases.tiddlyspace.com/upgrade",
      -		backupExtension: "pre.core.upgrade"
      -	},
      -	sync: {},
      -	annotations: {}
      -};
      -
      -// Commands supported by the toolbar macro
      -config.commands = {
      -	closeTiddler: {},
      -	closeOthers: {},
      -	editTiddler: {},
      -	saveTiddler: {hideReadOnly: true},
      -	cancelTiddler: {},
      -	deleteTiddler: {hideReadOnly: true},
      -	permalink: {},
      -	references: {type: "popup"},
      -	jump: {type: "popup"},
      -	syncing: {type: "popup"},
      -	fields: {type: "popup"}
      -};
      -
      -// Control of macro parameter evaluation
      -config.evaluateMacroParameters = "all";
      -
      -// Basic regular expressions
      -config.textPrimitives = {
      -	upperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]",
      -	lowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]",
      -	anyLetter:   "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]",
      -	anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]"
      -};
      -if(!((new RegExp("[\u0150\u0170]","g")).test("\u0150"))) {
      -	config.textPrimitives = {
      -		upperLetter: "[A-Z\u00c0-\u00de]",
      -		lowerLetter: "[a-z0-9_\\-\u00df-\u00ff]",
      -		anyLetter:   "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff]",
      -		anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff]"
      -	};
      -}
      -config.textPrimitives.sliceSeparator = "::";
      -config.textPrimitives.sectionSeparator = "##";
      -config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b)";
      -config.textPrimitives.unWikiLink = "~";
      -config.textPrimitives.wikiLink = "(?:(?:" + config.textPrimitives.upperLetter + "+" +
      -	config.textPrimitives.lowerLetter + "+" +
      -	config.textPrimitives.upperLetter +
      -	config.textPrimitives.anyLetter + "*)|(?:" +
      -	config.textPrimitives.upperLetter + "{2,}" +
      -	config.textPrimitives.lowerLetter + "+))";
      -
      -config.textPrimitives.cssLookahead = "(?:(" + config.textPrimitives.anyLetter + "+)\\(([^\\)\\|\\n]+)(?:\\):))|(?:(" + config.textPrimitives.anyLetter + "+):([^;\\|\\n]+);)";
      -config.textPrimitives.cssLookaheadRegExp = new RegExp(config.textPrimitives.cssLookahead,"mg");
      -
      -config.textPrimitives.brackettedLink = "\\[\\[([^\\]]+)\\]\\]";
      -config.textPrimitives.titledBrackettedLink = "\\[\\[([^\\[\\]\\|]+)\\|([^\\[\\]\\|]+)\\]\\]";
      -config.textPrimitives.tiddlerForcedLinkRegExp = new RegExp("(?:" + config.textPrimitives.titledBrackettedLink + ")|(?:" +
      -	config.textPrimitives.brackettedLink + ")|(?:" +
      -	config.textPrimitives.urlPattern + ")","mg");
      -config.textPrimitives.tiddlerAnyLinkRegExp = new RegExp("("+ config.textPrimitives.wikiLink + ")|(?:" +
      -	config.textPrimitives.titledBrackettedLink + ")|(?:" +
      -	config.textPrimitives.brackettedLink + ")|(?:" +
      -	config.textPrimitives.urlPattern + ")","mg");
      -
      -config.glyphs = {
      -	currBrowser: null,
      -	browsers: [],
      -	codes: {}
      -};
      -
      -//--
      -//-- Shadow tiddlers
      -//--
      -
      -config.shadowTiddlers = {
      -	StyleSheet: "",
      -	MarkupPreHead: "",
      -	MarkupPostHead: "",
      -	MarkupPreBody: "",
      -	MarkupPostBody: "",
      -	TabTimeline: '<>',
      -	TabAll: '<>',
      -	TabTags: '<>',
      -	TabMoreMissing: '<>',
      -	TabMoreOrphans: '<>',
      -	TabMoreShadowed: '<>',
      -	AdvancedOptions: '<>',
      -	PluginManager: '<>',
      -	SystemSettings: '',
      -	ToolbarCommands: '|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|',
      -	WindowTitle: '<> - <>'
      -};
      -
      diff --git a/editions/tw2/source/tiddlywiki/js/ConfigBrowser.js b/editions/tw2/source/tiddlywiki/js/ConfigBrowser.js
      deleted file mode 100755
      index f995b8da3..000000000
      --- a/editions/tw2/source/tiddlywiki/js/ConfigBrowser.js
      +++ /dev/null
      @@ -1,30 +0,0 @@
      -// Browser detection... In a very few places, there's nothing else for it but to know what browser we're using.
      -config.userAgent = navigator.userAgent.toLowerCase();
      -config.browser = {
      -	isIE: config.userAgent.indexOf("msie") != -1 && config.userAgent.indexOf("opera") == -1,
      -	isGecko: navigator.product == "Gecko" && config.userAgent.indexOf("WebKit") == -1,
      -	ieVersion: /MSIE (\d.\d)/i.exec(config.userAgent), // config.browser.ieVersion[1], if it exists, will be the IE version string, eg "6.0"
      -	isSafari: config.userAgent.indexOf("applewebkit") != -1,
      -	isBadSafari: !((new RegExp("[\u0150\u0170]","g")).test("\u0150")),
      -	firefoxDate: /gecko\/(\d{8})/i.exec(config.userAgent), // config.browser.firefoxDate[1], if it exists, will be Firefox release date as "YYYYMMDD"
      -	isOpera: config.userAgent.indexOf("opera") != -1,
      -	isChrome: config.userAgent.indexOf('chrome') > -1,
      -	isLinux: config.userAgent.indexOf("linux") != -1,
      -	isUnix: config.userAgent.indexOf("x11") != -1,
      -	isMac: config.userAgent.indexOf("mac") != -1,
      -	isWindows: config.userAgent.indexOf("win") != -1
      -};
      -
      -merge(config.glyphs,{
      -	browsers: [
      -		function() {return config.browser.isIE;},
      -		function() {return true;}
      -		],
      -	codes: {
      -		downTriangle: ["\u25BC","\u25BE"],
      -		downArrow: ["\u2193","\u2193"],
      -		bentArrowLeft: ["\u2190","\u21A9"],
      -		bentArrowRight: ["\u2192","\u21AA"]
      -	}
      -});
      -
      diff --git a/editions/tw2/source/tiddlywiki/js/Crypto.js b/editions/tw2/source/tiddlywiki/js/Crypto.js
      deleted file mode 100755
      index fed672330..000000000
      --- a/editions/tw2/source/tiddlywiki/js/Crypto.js
      +++ /dev/null
      @@ -1,143 +0,0 @@
      -//--
      -//-- Crypto functions and associated conversion routines
      -//--
      -
      -// Crypto 'namespace'
      -function Crypto() {}
      -
      -// Convert a string to an array of big-endian 32-bit words
      -Crypto.strToBe32s = function(str)
      -{
      -	var be=[];
      -	var len=Math.floor(str.length/4);
      -	var i, j;
      -	for(i=0, j=0; i>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
      -		j++;
      -	}
      -	return be;
      -};
      -
      -// Convert an array of big-endian 32-bit words to a string
      -Crypto.be32sToStr = function(be)
      -{
      -	var str='';
      -	for(var i=0;i>5]>>>(24-i%32)) & 0xff);
      -	}
      -	return str;
      -};
      -
      -// Convert an array of big-endian 32-bit words to a hex string
      -Crypto.be32sToHex = function(be)
      -{
      -	var hex='0123456789ABCDEF';
      -	var str='';
      -	for(var i=0;i>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
      -	}
      -	return str;
      -};
      -
      -// Return, in hex, the SHA-1 hash of a string
      -Crypto.hexSha1Str = function(str)
      -{
      -	return Crypto.be32sToHex(Crypto.sha1Str(str));
      -};
      -
      -// Return the SHA-1 hash of a string
      -Crypto.sha1Str = function(str)
      -{
      -	return Crypto.sha1(Crypto.strToBe32s(str),str.length);
      -};
      -
      -// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
      -Crypto.sha1 = function(x,blen)
      -{
      -	// Add 32-bit integers, wrapping at 32 bits
      -	//# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
      -	function add32(a,b)
      -	{
      -		var lsw=(a&0xFFFF)+(b&0xFFFF);
      -		var msw=(a>>16)+(b>>16)+(lsw>>16);
      -		return (msw<<16)|(lsw&0xFFFF);
      -	}
      -	//# Cryptographic round helper function. Add five 32-bit integers, wrapping at 32 bits, second parameter is rotated left 5 bits before the addition
      -	//# Uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
      -	function AA(a,b,c,d,e)
      -	{
      -		b=(b>>>27)|(b<<5);
      -		var lsw=(a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
      -		var msw=(a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
      -		return (msw<<16)|(lsw&0xFFFF);
      -	}
      -	//# Cryptographic round helper function.
      -	function RR(w,j)
      -	{
      -		var n=w[j-3]^w[j-8]^w[j-14]^w[j-16];
      -		return (n>>>31)|(n<<1);
      -	}
      -
      -	var len=blen*8;
      -	//# Append padding so length in bits is 448 mod 512
      -	x[len>>5] |= 0x80 << (24-len%32);
      -	//# Append length
      -	x[((len+64>>9)<<4)+15]=len;
      -	var w=new Array(80);
      -
      -	var k1=0x5A827999;
      -	var k2=0x6ED9EBA1;
      -	var k3=0x8F1BBCDC;
      -	var k4=0xCA62C1D6;
      -
      -	var h0=0x67452301;
      -	var h1=0xEFCDAB89;
      -	var h2=0x98BADCFE;
      -	var h3=0x10325476;
      -	var h4=0xC3D2E1F0;
      -
      -	for(var i=0;i>>2)|(b<<30); b=a; a=t; j++;
      -		}
      -		while(j<20) {
      -			w[j]=RR(w,j);
      -			t=AA(e,a,d^(b&(c^d)),w[j],k1);
      -			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++;
      -		}
      -		while(j<40) {
      -			w[j]=RR(w,j);
      -			t=AA(e,a,b^c^d,w[j],k2);
      -			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++;
      -		}
      -		while(j<60) {
      -			w[j]=RR(w,j);
      -			t=AA(e,a,(b&c)|(d&(b|c)),w[j],k3);
      -			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++;
      -		}
      -		while(j<80) {
      -			w[j]=RR(w,j);
      -			t=AA(e,a,b^c^d,w[j],k4);
      -			e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++;
      -		}
      -		h0=add32(h0,a);
      -		h1=add32(h1,b);
      -		h2=add32(h2,c);
      -		h3=add32(h3,d);
      -		h4=add32(h4,e);
      -	}
      -	return [h0,h1,h2,h3,h4];
      -};
      -
      diff --git a/editions/tw2/source/tiddlywiki/js/Dates.js b/editions/tw2/source/tiddlywiki/js/Dates.js
      deleted file mode 100755
      index 8cb2179e4..000000000
      --- a/editions/tw2/source/tiddlywiki/js/Dates.js
      +++ /dev/null
      @@ -1,119 +0,0 @@
      -//--
      -//-- Augmented methods for the JavaScript Date() object
      -//--
      -
      -// Substitute date components into a string
      -Date.prototype.formatString = function(template)
      -{
      -	var t = template.replace(/0hh12/g,String.zeroPad(this.getHours12(),2));
      -	t = t.replace(/hh12/g,this.getHours12());
      -	t = t.replace(/0hh/g,String.zeroPad(this.getHours(),2));
      -	t = t.replace(/hh/g,this.getHours());
      -	t = t.replace(/mmm/g,config.messages.dates.shortMonths[this.getMonth()]);
      -	t = t.replace(/0mm/g,String.zeroPad(this.getMinutes(),2));
      -	t = t.replace(/mm/g,this.getMinutes());
      -	t = t.replace(/0ss/g,String.zeroPad(this.getSeconds(),2));
      -	t = t.replace(/ss/g,this.getSeconds());
      -	t = t.replace(/[ap]m/g,this.getAmPm().toLowerCase());
      -	t = t.replace(/[AP]M/g,this.getAmPm().toUpperCase());
      -	t = t.replace(/wYYYY/g,this.getYearForWeekNo());
      -	t = t.replace(/wYY/g,String.zeroPad(this.getYearForWeekNo()-2000,2));
      -	t = t.replace(/YYYY/g,this.getFullYear());
      -	t = t.replace(/YY/g,String.zeroPad(this.getFullYear()-2000,2));
      -	t = t.replace(/MMM/g,config.messages.dates.months[this.getMonth()]);
      -	t = t.replace(/0MM/g,String.zeroPad(this.getMonth()+1,2));
      -	t = t.replace(/MM/g,this.getMonth()+1);
      -	t = t.replace(/0WW/g,String.zeroPad(this.getWeek(),2));
      -	t = t.replace(/WW/g,this.getWeek());
      -	t = t.replace(/DDD/g,config.messages.dates.days[this.getDay()]);
      -	t = t.replace(/ddd/g,config.messages.dates.shortDays[this.getDay()]);
      -	t = t.replace(/0DD/g,String.zeroPad(this.getDate(),2));
      -	t = t.replace(/DDth/g,this.getDate()+this.daySuffix());
      -	t = t.replace(/DD/g,this.getDate());
      -	var tz = this.getTimezoneOffset();
      -	var atz = Math.abs(tz);
      -	t = t.replace(/TZD/g,(tz < 0 ? '+' : '-') + String.zeroPad(Math.floor(atz / 60),2) + ':' + String.zeroPad(atz % 60,2));
      -	t = t.replace(/\\/g,"");
      -	return t;
      -};
      -
      -Date.prototype.getWeek = function()
      -{
      -	var dt = new Date(this.getTime());
      -	var d = dt.getDay();
      -	if(d==0) d=7;// JavaScript Sun=0, ISO Sun=7
      -	dt.setTime(dt.getTime()+(4-d)*86400000);// shift day to Thurs of same week to calculate weekNo
      -	var n = Math.floor((dt.getTime()-new Date(dt.getFullYear(),0,1)+3600000)/86400000);
      -	return Math.floor(n/7)+1;
      -};
      -
      -Date.prototype.getYearForWeekNo = function()
      -{
      -	var dt = new Date(this.getTime());
      -	var d = dt.getDay();
      -	if(d==0) d=7;// JavaScript Sun=0, ISO Sun=7
      -	dt.setTime(dt.getTime()+(4-d)*86400000);// shift day to Thurs of same week
      -	return dt.getFullYear();
      -};
      -
      -Date.prototype.getHours12 = function()
      -{
      -	var h = this.getHours();
      -	return h > 12 ? h-12 : ( h > 0 ? h : 12 );
      -};
      -
      -Date.prototype.getAmPm = function()
      -{
      -	return this.getHours() >= 12 ? config.messages.dates.pm : config.messages.dates.am;
      -};
      -
      -Date.prototype.daySuffix = function()
      -{
      -	return config.messages.dates.daySuffixes[this.getDate()-1];
      -};
      -
      -// Convert a date to local YYYYMMDDHHMM string format
      -Date.prototype.convertToLocalYYYYMMDDHHMM = function()
      -{
      -	return this.getFullYear() + String.zeroPad(this.getMonth()+1,2) + String.zeroPad(this.getDate(),2) + String.zeroPad(this.getHours(),2) + String.zeroPad(this.getMinutes(),2);
      -};
      -
      -// Convert a date to UTC YYYYMMDDHHMM string format
      -Date.prototype.convertToYYYYMMDDHHMM = function()
      -{
      -	return this.getUTCFullYear() + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2);
      -};
      -
      -// Convert a date to UTC YYYYMMDD.HHMMSSMMM string format
      -Date.prototype.convertToYYYYMMDDHHMMSSMMM = function()
      -{
      -	return this.getUTCFullYear() + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + "." + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2) + String.zeroPad(this.getUTCSeconds(),2) + String.zeroPad(this.getUTCMilliseconds(),3) +"0";
      -};
      -
      -// Static method to create a date from a UTC YYYYMMDDHHMM format string
      -Date.convertFromYYYYMMDDHHMM = function(d)
      -{
      -	d = d?d.replace(/[^0-9]/g, ""):"";
      -	return Date.convertFromYYYYMMDDHHMMSSMMM(d.substr(0,12));
      -};
      -
      -// Static method to create a date from a UTC YYYYMMDDHHMMSS format string
      -Date.convertFromYYYYMMDDHHMMSS = function(d)
      -{
      -	d = d?d.replace(/[^0-9]/g, ""):"";
      -	return Date.convertFromYYYYMMDDHHMMSSMMM(d.substr(0,14));
      -};
      -
      -// Static method to create a date from a UTC YYYYMMDDHHMMSSMMM format string
      -Date.convertFromYYYYMMDDHHMMSSMMM = function(d)
      -{
      -	d = d ? d.replace(/[^0-9]/g, "") : "";
      -	return new Date(Date.UTC(parseInt(d.substr(0,4),10),
      -			parseInt(d.substr(4,2),10)-1,
      -			parseInt(d.substr(6,2),10),
      -			parseInt(d.substr(8,2)||"00",10),
      -			parseInt(d.substr(10,2)||"00",10),
      -			parseInt(d.substr(12,2)||"00",10),
      -			parseInt(d.substr(14,3)||"000",10)));
      -};
      -
      diff --git a/editions/tw2/source/tiddlywiki/js/Dom.js b/editions/tw2/source/tiddlywiki/js/Dom.js
      deleted file mode 100755
      index d288d34de..000000000
      --- a/editions/tw2/source/tiddlywiki/js/Dom.js
      +++ /dev/null
      @@ -1,264 +0,0 @@
      -//--
      -//-- DOM utilities - many derived from www.quirksmode.org
      -//--
      -
      -function drawGradient(place,horiz,locolors,hicolors)
      -{
      -	if(!hicolors)
      -		hicolors = locolors;
      -	var t;
      -	for(t=0; t<= 100; t+=2) {
      -		var bar = document.createElement("div");
      -		place.appendChild(bar);
      -		bar.style.position = "absolute";
      -		bar.style.left = horiz ? t + "%" : 0;
      -		bar.style.top = horiz ? 0 : t + "%";
      -		bar.style.width = horiz ? (101-t) + "%" : "100%";
      -		bar.style.height = horiz ? "100%" : (101-t) + "%";
      -		bar.style.zIndex = -1;
      -		var p = t/100*(locolors.length-1);
      -		var hc = hicolors[Math.floor(p)];
      -		if(typeof hc == "string")
      -			hc = new RGB(hc);
      -		var lc = locolors[Math.ceil(p)];
      -		if(typeof lc == "string")
      -			lc = new RGB(lc);
      -		bar.style.backgroundColor = hc.mix(lc,p-Math.floor(p)).toString();
      -	}
      -}
      -
      -//# Add an event handler
      -//# Thanks to John Resig, via QuirksMode
      -function addEvent(obj,type,fn)
      -{
      -	if(obj.attachEvent) {
      -		obj["e"+type+fn] = fn;
      -		obj[type+fn] = function(){obj["e"+type+fn](window.event);};
      -		obj.attachEvent("on"+type,obj[type+fn]);
      -	} else {
      -		obj.addEventListener(type,fn,false);
      -	}
      -}
      -
      -//# Remove an event handler
      -//# Thanks to John Resig, via QuirksMode
      -function removeEvent(obj,type,fn)
      -{
      -	if(obj.detachEvent) {
      -		obj.detachEvent("on"+type,obj[type+fn]);
      -		obj[type+fn] = null;
      -	} else {
      -		obj.removeEventListener(type,fn,false);
      -	}
      -}
      -
      -// Find the closest relative with a given property value (property defaults to tagName, relative defaults to parentNode)
      -function findRelated(e,value,name,relative)
      -{
      -	name = name || "tagName";
      -	relative = relative || "parentNode";
      -	if(name == "className") {
      -		while(e && !jQuery(e).hasClass(value)) {
      -			e = e[relative];
      -		}
      -	} else {
      -		while(e && e[name] != value) {
      -			e = e[relative];
      -		}
      -	}
      -	return e;
      -}
      -
      -// Get the scroll position for window.scrollTo necessary to scroll a given element into view
      -function ensureVisible(e)
      -{
      -	var posTop = findPosY(e);
      -	var posBot = posTop + e.offsetHeight;
      -	var winTop = findScrollY();
      -	var winHeight = findWindowHeight();
      -	var winBot = winTop + winHeight;
      -	if(posTop < winTop) {
      -		return posTop;
      -	} else if(posBot > winBot) {
      -		if(e.offsetHeight < winHeight)
      -			return posTop - (winHeight - e.offsetHeight);
      -		else
      -			return posTop;
      -	} else {
      -		return winTop;
      -	}
      -}
      -
      -// Get the current width of the display window
      -function findWindowWidth()
      -{
      -	return window.innerWidth || document.documentElement.clientWidth;
      -}
      -
      -// Get the current height of the display window
      -function findWindowHeight()
      -{
      -	return window.innerHeight || document.documentElement.clientHeight;
      -}
      -
      -// Get the current horizontal page scroll position
      -function findScrollX()
      -{
      -	return window.scrollX || document.documentElement.scrollLeft;
      -}
      -
      -// Get the current vertical page scroll position
      -function findScrollY()
      -{
      -	return window.scrollY || document.documentElement.scrollTop;
      -}
      -
      -function findPosX(obj)
      -{
      -	var curleft = 0;
      -	while(obj.offsetParent) {
      -		curleft += obj.offsetLeft;
      -		obj = obj.offsetParent;
      -	}
      -	return curleft;
      -}
      -
      -function findPosY(obj)
      -{
      -	var curtop = 0;
      -	while(obj.offsetParent) {
      -		curtop += obj.offsetTop;
      -		obj = obj.offsetParent;
      -	}
      -	return curtop;
      -}
      -
      -// Blur a particular element
      -function blurElement(e)
      -{
      -	if(e && e.focus && e.blur) {
      -		e.focus();
      -		e.blur();
      -	}
      -}
      -
      -// Create a non-breaking space
      -function insertSpacer(place)
      -{
      -	var e = document.createTextNode(String.fromCharCode(160));
      -	if(place)
      -		place.appendChild(e);
      -	return e;
      -}
      -
      -// Replace the current selection of a textarea or text input and scroll it into view
      -function replaceSelection(e,text)
      -{
      -	if(e.setSelectionRange) {
      -		var oldpos = e.selectionStart;
      -		var isRange = e.selectionEnd > e.selectionStart;
      -		e.value = e.value.substr(0,e.selectionStart) + text + e.value.substr(e.selectionEnd);
      -		e.setSelectionRange(isRange ? oldpos : oldpos + text.length,oldpos + text.length);
      -		var linecount = e.value.split("\n").length;
      -		var thisline = e.value.substr(0,e.selectionStart).split("\n").length-1;
      -		e.scrollTop = Math.floor((thisline - e.rows / 2) * e.scrollHeight / linecount);
      -	} else if(document.selection) {
      -		var range = document.selection.createRange();
      -		if(range.parentElement() == e) {
      -			var isCollapsed = range.text == "";
      -			range.text = text;
      -			if(!isCollapsed) {
      -				range.moveStart("character", -text.length);
      -				range.select();
      -			}
      -		}
      -	}
      -}
      -
      -// Set the caret position in a text area
      -function setCaretPosition(e,pos)
      -{
      -	if(e.selectionStart || e.selectionStart == '0') {
      -		e.selectionStart = pos;
      -		e.selectionEnd = pos;
      -		e.focus();
      -	} else if(document.selection) {
      -		// IE support
      -		e.focus ();
      -		var sel = document.selection.createRange();
      -		sel.moveStart('character', -e.value.length);
      -		sel.moveStart('character',pos);
      -		sel.moveEnd('character',0);
      -		sel.select();
      -	}
      -}
      -
      -// Returns the text of the given (text) node, possibly merging subsequent text nodes
      -function getNodeText(e)
      -{
      -	var t = "";
      -	while(e && e.nodeName == "#text") {
      -		t += e.nodeValue;
      -		e = e.nextSibling;
      -	}
      -	return t;
      -}
      -
      -// Returns true if the element e has a given ancestor element
      -function isDescendant(e,ancestor)
      -{
      -	while(e) {
      -		if(e === ancestor)
      -			return true;
      -		e = e.parentNode;
      -	}
      -	return false;
      -}
      -
      -
      -// deprecate the following...
      -
      -// Prevent an event from bubbling
      -function stopEvent(e)
      -{
      -	var ev = e || window.event;
      -	ev.cancelBubble = true;
      -	if(ev.stopPropagation) ev.stopPropagation();
      -	return false;
      -}
      -
      -// Remove any event handlers or non-primitve custom attributes
      -function scrubNode(e)
      -{
      -	if(!config.browser.isIE)
      -		return;
      -	var att = e.attributes;
      -	if(att) {
      -		var t;
      -		for(t=0; t 0 ? s+fin : s;
      -}
      -
      -//# convert unicode string to a format suitable for saving to file
      -//# this should be UTF8, unless the browser does not support saving non-ASCII characters
      -function convertUnicodeToFileFormat(s)
      -{
      -	return config.browser.isOpera || !window.netscape ? (config.browser.isIE ? convertUnicodeToHtmlEntities(s) : s) : mozConvertUnicodeToUTF8(s);
      -}
      -
      -function convertUnicodeToHtmlEntities(s)
      -{
      -	var re = /[^\u0000-\u007F]/g;
      -	return s.replace(re,function($0) {return "&#" + $0.charCodeAt(0).toString() + ";";});
      -}
      -
      -function convertUnicodeToUTF8(s)
      -{
      -// return convertUnicodeToFileFormat to allow plugin migration
      -	return convertUnicodeToFileFormat(s);
      -}
      -
      -function manualConvertUnicodeToUTF8(s)
      -{
      -	return unescape(encodeURIComponent(s));
      -}
      -
      -function mozConvertUnicodeToUTF8(s)
      -{
      -	try {
      -		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      -		var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
      -		converter.charset = "UTF-8";
      -	} catch(ex) {
      -		return manualConvertUnicodeToUTF8(s);
      -	} // fallback
      -	var u = converter.ConvertFromUnicode(s);
      -	var fin = converter.Finish();
      -	return fin.length > 0 ? u + fin : u;
      -}
      -
      -function convertUriToUTF8(uri,charSet)
      -{
      -	if(window.netscape == undefined || charSet == undefined || charSet == "")
      -		return uri;
      -	try {
      -		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      -		var converter = Components.classes["@mozilla.org/intl/utf8converterservice;1"].getService(Components.interfaces.nsIUTF8ConverterService);
      -	} catch(ex) {
      -		return uri;
      -	}
      -	return converter.convertURISpecToUTF8(uri,charSet);
      -}
      -
      -function copyFile(dest,source)
      -{
      -	return config.browser.isIE ? ieCopyFile(dest,source) : false;
      -}
      -
      -function saveFile(fileUrl,content)
      -{
      -	var r = mozillaSaveFile(fileUrl,content);
      -	if(!r)
      -		r = ieSaveFile(fileUrl,content);
      -	if(!r)
      -		r = javaSaveFile(fileUrl,content);
      -	return r;
      -}
      -
      -function loadFile(fileUrl)
      -{
      -	var r = mozillaLoadFile(fileUrl);
      -	if((r == null) || (r == false))
      -		r = ieLoadFile(fileUrl);
      -	if((r == null) || (r == false))
      -		r = javaLoadFile(fileUrl);
      -	return r;
      -}
      -
      -function ieCreatePath(path)
      -{
      -	try {
      -		var fso = new ActiveXObject("Scripting.FileSystemObject");
      -	} catch(ex) {
      -		return null;
      -	}
      -
      -	//# Remove the filename, if present. Use trailing slash (i.e. "foo\bar\") if no filename.
      -	var pos = path.lastIndexOf("\\");
      -	if(pos==-1)
      -		pos = path.lastIndexOf("/");
      -	if(pos!=-1)
      -		path = path.substring(0,pos+1);
      -
      -	//# Walk up the path until we find a folder that exists
      -	var scan = [path];
      -	var parent = fso.GetParentFolderName(path);
      -	while(parent && !fso.FolderExists(parent)) {
      -		scan.push(parent);
      -		parent = fso.GetParentFolderName(parent);
      -	}
      -
      -	//# Walk back down the path, creating folders
      -	for(i=scan.length-1;i>=0;i--) {
      -		if(!fso.FolderExists(scan[i])) {
      -			fso.CreateFolder(scan[i]);
      -		}
      -	}
      -	return true;
      -}
      -
      -// Returns null if it can't do it, false if there's an error, true if it saved OK
      -function ieSaveFile(filePath,content)
      -{
      -	ieCreatePath(filePath);
      -	try {
      -		var fso = new ActiveXObject("Scripting.FileSystemObject");
      -	} catch(ex) {
      -		//# alert("Exception while attempting to save\n\n" + ex.toString());
      -		return null;
      -	}
      -	var file = fso.OpenTextFile(filePath,2,-1,0);
      -	file.Write(content);
      -	file.Close();
      -	return true;
      -}
      -
      -// Returns null if it can't do it, false if there's an error, or a string of the content if successful
      -function ieLoadFile(filePath)
      -{
      -	try {
      -		var fso = new ActiveXObject("Scripting.FileSystemObject");
      -		var file = fso.OpenTextFile(filePath,1);
      -		var content = file.ReadAll();
      -		file.Close();
      -	} catch(ex) {
      -		//# alert("Exception while attempting to load\n\n" + ex.toString());
      -		return null;
      -	}
      -	return content;
      -}
      -
      -function ieCopyFile(dest,source)
      -{
      -	ieCreatePath(dest);
      -	try {
      -		var fso = new ActiveXObject("Scripting.FileSystemObject");
      -		fso.GetFile(source).Copy(dest);
      -	} catch(ex) {
      -		return false;
      -	}
      -	return true;
      -}
      -
      -// Returns null if it can't do it, false if there's an error, true if it saved OK
      -function mozillaSaveFile(filePath,content)
      -{
      -	if(window.Components) {
      -		try {
      -			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      -			var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
      -			file.initWithPath(filePath);
      -			if(!file.exists())
      -				file.create(0,0x01B4);// 0x01B4 = 0664
      -			var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
      -			out.init(file,0x22,0x04,null);
      -			out.write(content,content.length);
      -			out.flush();
      -			out.close();
      -			return true;
      -		} catch(ex) {
      -			//# alert("Exception while attempting to save\n\n" + ex);
      -			return false;
      -		}
      -	}
      -	return null;
      -}
      -
      -// Returns null if it can't do it, false if there's an error, or a string of the content if successful
      -function mozillaLoadFile(filePath)
      -{
      -	if(window.Components) {
      -		try {
      -			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      -			var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
      -			file.initWithPath(filePath);
      -			if(!file.exists())
      -				return null;
      -			var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
      -			inputStream.init(file,0x01,0x04,null);
      -			var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
      -			sInputStream.init(inputStream);
      -			var contents = sInputStream.read(sInputStream.available());
      -			sInputStream.close();
      -			inputStream.close();
      -			return contents;
      -		} catch(ex) {
      -			//# alert("Exception while attempting to load\n\n" + ex);
      -			return false;
      -		}
      -	}
      -	return null;
      -}
      -
      -function javaUrlToFilename(url)
      -{
      -	var f = "//localhost";
      -	if(url.indexOf(f) == 0)
      -		return url.substring(f.length);
      -	var i = url.indexOf(":");
      -	return i > 0 ? url.substring(i-1) : url;
      -}
      -
      -function javaSaveFile(filePath,content)
      -{
      -	try {
      -		if(document.applets["TiddlySaver"])
      -			return document.applets["TiddlySaver"].saveFile(javaUrlToFilename(filePath),"UTF-8",content);
      -	} catch(ex) {
      -	}
      -	try {
      -		var s = new java.io.PrintStream(new java.io.FileOutputStream(javaUrlToFilename(filePath)));
      -		s.print(content);
      -		s.close();
      -	} catch(ex2) {
      -		return null;
      -	}
      -	return true;
      -}
      -
      -function javaLoadFile(filePath)
      -{
      -	try {
      -		if(document.applets["TiddlySaver"]) {
      -			var ret = document.applets["TiddlySaver"].loadFile(javaUrlToFilename(filePath),"UTF-8");
      -			if(!ret)
      -				return null;
      -			return String(ret);
      -		}
      -	} catch(ex) {
      -	}
      -	var content = [];
      -	try {
      -		var r = new java.io.BufferedReader(new java.io.FileReader(javaUrlToFilename(filePath)));
      -		var line;
      -		while((line = r.readLine()) != null)
      -			content.push(String(line));
      -		r.close();
      -	} catch(ex2) {
      -		return null;
      -	}
      -	return content.join("\n");
      -}
      -
      diff --git a/editions/tw2/source/tiddlywiki/js/Filters.js b/editions/tw2/source/tiddlywiki/js/Filters.js
      deleted file mode 100755
      index ad285d363..000000000
      --- a/editions/tw2/source/tiddlywiki/js/Filters.js
      +++ /dev/null
      @@ -1,61 +0,0 @@
      -//--
      -//-- Filter a list of tiddlers
      -//--
      -
      -//# Extensible filter functions
      -config.filters = {
      -	tiddler: function(results,match) {
      -		var title = match[1]||match[4];
      -		var tiddler = this.fetchTiddler(title);
      -		if(tiddler) {
      -			results.pushUnique(tiddler);
      -		} else if(this.isShadowTiddler(title)) {
      -			tiddler = new Tiddler();
      -			tiddler.set(title,this.getTiddlerText(title));
      -			results.pushUnique(tiddler);
      -		} else {
      -			results.pushUnique(new Tiddler(title));
      -		}
      -		return results;
      -	},
      -	tag: function(results,match) {
      -		var m,matched = this.getTaggedTiddlers(match[3]);
      -		for(m=0; m 1) {
      -						last.element.setAttribute("colspan",colSpanCount);
      -						last.element.setAttribute("colSpan",colSpanCount); // Needed for IE
      -						colSpanCount = 1;
      -					}
      -				}
      -				w.nextMatch = this.cellRegExp.lastIndex-1;
      -			} else if(cellMatch[1] == ">") {
      -				// Colspan
      -				colSpanCount++;
      -				w.nextMatch = this.cellRegExp.lastIndex-1;
      -			} else if(cellMatch[2]) {
      -				// End of row
      -				if(prevCell && colSpanCount > 1) {
      -					prevCell.setAttribute("colspan",colSpanCount);
      -					prevCell.setAttribute("colSpan",colSpanCount); // Needed for IE
      -				}
      -				w.nextMatch = this.cellRegExp.lastIndex;
      -				break;
      -			} else {
      -				// Cell
      -				w.nextMatch++;
      -				var styles = config.formatterHelpers.inlineCssHelper(w);
      -				var spaceLeft = false;
      -				var chr = w.source.substr(w.nextMatch,1);
      -				while(chr == " ") {
      -					spaceLeft = true;
      -					w.nextMatch++;
      -					chr = w.source.substr(w.nextMatch,1);
      -				}
      -				var cell;
      -				if(chr == "!") {
      -					cell = createTiddlyElement(e,"th");
      -					w.nextMatch++;
      -				} else {
      -					cell = createTiddlyElement(e,"td");
      -				}
      -				prevCell = cell;
      -				prevColumns[col] = {rowSpanCount:1,element:cell};
      -				if(colSpanCount > 1) {
      -					cell.setAttribute("colspan",colSpanCount);
      -					cell.setAttribute("colSpan",colSpanCount); // Needed for IE
      -					colSpanCount = 1;
      -				}
      -				config.formatterHelpers.applyCssHelper(cell,styles);
      -				w.subWikifyTerm(cell,this.cellTermRegExp);
      -				if(w.matchText.substr(w.matchText.length-2,1) == " ") // spaceRight
      -					cell.align = spaceLeft ? "center" : "left";
      -				else if(spaceLeft)
      -					cell.align = "right";
      -				w.nextMatch--;
      -			}
      -			col++;
      -			this.cellRegExp.lastIndex = w.nextMatch;
      -			cellMatch = this.cellRegExp.exec(w.source);
      -		}
      -	}
      -},
      -
      -{
      -	name: "heading",
      -	match: "^!{1,6}",
      -	termRegExp: /(\n)/mg,
      -	handler: function(w)
      -	{
      -		w.subWikifyTerm(createTiddlyElement(w.output,"h" + w.matchLength),this.termRegExp);
      -	}
      -},
      -
      -{
      -	name: "list",
      -	match: "^(?:[\\*#;:]+)",
      -	lookaheadRegExp: /^(?:(?:(\*)|(#)|(;)|(:))+)/mg,
      -	termRegExp: /(\n)/mg,
      -	handler: function(w)
      -	{
      -		var stack = [w.output];
      -		var currLevel = 0, currType = null;
      -		var listLevel, listType, itemType, baseType;
      -		w.nextMatch = w.matchStart;
      -		this.lookaheadRegExp.lastIndex = w.nextMatch;
      -		var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
      -		while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) {
      -			if(lookaheadMatch[1]) {
      -				listType = "ul";
      -				itemType = "li";
      -			} else if(lookaheadMatch[2]) {
      -				listType = "ol";
      -				itemType = "li";
      -			} else if(lookaheadMatch[3]) {
      -				listType = "dl";
      -				itemType = "dt";
      -			} else if(lookaheadMatch[4]) {
      -				listType = "dl";
      -				itemType = "dd";
      -			}
      -			if(!baseType)
      -				baseType = listType;
      -			listLevel = lookaheadMatch[0].length;
      -			w.nextMatch += lookaheadMatch[0].length;
      -			var t;
      -			if(listLevel > currLevel) {
      -				for(t=currLevel; tlistLevel; t--)
      -					stack.pop();
      -			} else if(listLevel == currLevel && listType != currType) {
      -				stack.pop();
      -				stack.push(createTiddlyElement(stack[stack.length-1].lastChild,listType));
      -			}
      -			currLevel = listLevel;
      -			currType = listType;
      -			var e = createTiddlyElement(stack[stack.length-1],itemType);
      -			w.subWikifyTerm(e,this.termRegExp);
      -			this.lookaheadRegExp.lastIndex = w.nextMatch;
      -			lookaheadMatch = this.lookaheadRegExp.exec(w.source);
      -		}
      -	}
      -},
      -
      -{
      -	name: "quoteByBlock",
      -	match: "^<<<\\n",
      -	termRegExp: /(^<<<(\n|$))/mg,
      -	element: "blockquote",
      -	handler: config.formatterHelpers.createElementAndWikify
      -},
      -
      -{
      -	name: "quoteByLine",
      -	match: "^>+",
      -	lookaheadRegExp: /^>+/mg,
      -	termRegExp: /(\n)/mg,
      -	element: "blockquote",
      -	handler: function(w)
      -	{
      -		var stack = [w.output];
      -		var currLevel = 0;
      -		var newLevel = w.matchLength;
      -		var t,matched;
      -		do {
      -			if(newLevel > currLevel) {
      -				for(t=currLevel; tnewLevel; t--)
      -					stack.pop();
      -			}
      -			currLevel = newLevel;
      -			w.subWikifyTerm(stack[stack.length-1],this.termRegExp);
      -			createTiddlyElement(stack[stack.length-1],"br");
      -			this.lookaheadRegExp.lastIndex = w.nextMatch;
      -			var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
      -			matched = lookaheadMatch && lookaheadMatch.index == w.nextMatch;
      -			if(matched) {
      -				newLevel = lookaheadMatch[0].length;
      -				w.nextMatch += lookaheadMatch[0].length;
      -			}
      -		} while(matched);
      -	}
      -},
      -
      -{
      -	name: "rule",
      -	match: "^----+$\\n?|
      \\n?", - handler: function(w) - { - createTiddlyElement(w.output,"hr"); - } -}, - -{ - name: "monospacedByLine", - match: "^(?:/\\*\\{\\{\\{\\*/|\\{\\{\\{|//\\{\\{\\{|)\\n", - element: "pre", - handler: function(w) - { - switch(w.matchText) { - case "/*{{{*/\n": // CSS - this.lookaheadRegExp = /\/\*\{\{\{\*\/\n*((?:^[^\n]*\n)+?)(\n*^\f*\/\*\}\}\}\*\/$\n?)/mg; - break; - case "{{{\n": // monospaced block - this.lookaheadRegExp = /^\{\{\{\n((?:^[^\n]*\n)+?)(^\f*\}\}\}$\n?)/mg; - break; - case "//{{{\n": // plugin - this.lookaheadRegExp = /^\/\/\{\{\{\n\n*((?:^[^\n]*\n)+?)(\n*^\f*\/\/\}\}\}$\n?)/mg; - break; - case "\n": //template - this.lookaheadRegExp = /\n*((?:^[^\n]*\n)+?)(\n*^\f*$\n?)/mg; - break; - default: - break; - } - config.formatterHelpers.enclosedTextHelper.call(this,w); - } -}, - -{ - name: "wikifyComment", - match: "^(?:/\\*\\*\\*|\n)/mg); - w.subWikifyTerm(w.output,termRegExp); - } -}, - -{ - name: "macro", - match: "<<", - lookaheadRegExp: /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[1]) { - w.nextMatch = this.lookaheadRegExp.lastIndex; - invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler); - } - } -}, - -{ - name: "prettyLink", - match: "\\[\\[", - lookaheadRegExp: /\[\[(.*?)(?:\|(~)?(.*?))?\]\]/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - var e; - var text = lookaheadMatch[1]; - if(lookaheadMatch[3]) { - // Pretty bracketted link - var link = lookaheadMatch[3]; - e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link)) ? - createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler); - } else { - // Simple bracketted link - e = createTiddlyLink(w.output,text,false,null,w.isStatic,w.tiddler); - } - createTiddlyText(e,text); - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "wikiLink", - match: config.textPrimitives.unWikiLink+"?"+config.textPrimitives.wikiLink, - handler: function(w) - { - if(w.matchText.substr(0,1) == config.textPrimitives.unWikiLink) { - w.outputText(w.output,w.matchStart+1,w.nextMatch); - return; - } - if(w.matchStart > 0) { - var preRegExp = new RegExp(config.textPrimitives.anyLetterStrict,"mg"); - preRegExp.lastIndex = w.matchStart-1; - var preMatch = preRegExp.exec(w.source); - if(preMatch.index == w.matchStart-1) { - w.outputText(w.output,w.matchStart,w.nextMatch); - return; - } - } - if(w.autoLinkWikiWords || store.isShadowTiddler(w.matchText)) { - var link = createTiddlyLink(w.output,w.matchText,false,null,w.isStatic,w.tiddler); - w.outputText(link,w.matchStart,w.nextMatch); - } else { - w.outputText(w.output,w.matchStart,w.nextMatch); - } - } -}, - -{ - name: "urlLink", - match: config.textPrimitives.urlPattern, - handler: function(w) - { - w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch); - } -}, - -{ - name: "image", - match: "\\[[<>]?[Ii][Mm][Gg]\\[", - //# [<] sequence below is to avoid lessThan-questionMark sequence so TiddlyWikis can be included in PHP files - lookaheadRegExp: /\[([<]?)(>?)[Ii][Mm][Gg]\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - var e = w.output; - if(lookaheadMatch[5]) { - var link = lookaheadMatch[5]; - e = config.formatterHelpers.isExternalLink(link) ? createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler); - jQuery(e).addClass("imageLink"); - } - var img = createTiddlyElement(e,"img"); - if(lookaheadMatch[1]) - img.align = "left"; - else if(lookaheadMatch[2]) - img.align = "right"; - if(lookaheadMatch[3]) { - img.title = lookaheadMatch[3]; - img.setAttribute("alt",lookaheadMatch[3]); - } - img.src = lookaheadMatch[4]; - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "html", - match: "<[Hh][Tt][Mm][Ll]>", - lookaheadRegExp: /<[Hh][Tt][Mm][Ll]>((?:.|\n)*?)<\/[Hh][Tt][Mm][Ll]>/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"span").innerHTML = lookaheadMatch[1]; - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "commentByBlock", - match: "/%", - lookaheadRegExp: /\/%((?:.|\n)*?)%\//mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) - w.nextMatch = this.lookaheadRegExp.lastIndex; - } -}, - -{ - name: "characterFormat", - match: "''|//|__|\\^\\^|~~|--(?!\\s|$)|\\{\\{\\{", - handler: function(w) - { - switch(w.matchText) { - case "''": - w.subWikifyTerm(w.output.appendChild(document.createElement("strong")),/('')/mg); - break; - case "//": - w.subWikifyTerm(createTiddlyElement(w.output,"em"),/(\/\/)/mg); - break; - case "__": - w.subWikifyTerm(createTiddlyElement(w.output,"u"),/(__)/mg); - break; - case "^^": - w.subWikifyTerm(createTiddlyElement(w.output,"sup"),/(\^\^)/mg); - break; - case "~~": - w.subWikifyTerm(createTiddlyElement(w.output,"sub"),/(~~)/mg); - break; - case "--": - w.subWikifyTerm(createTiddlyElement(w.output,"strike"),/(--)/mg); - break; - case "{{{": - var lookaheadRegExp = /\{\{\{((?:.|\n)*?)\}\}\}/mg; - lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"code",null,null,lookaheadMatch[1]); - w.nextMatch = lookaheadRegExp.lastIndex; - } - break; - } - } -}, - -{ - name: "customFormat", - match: "@@|\\{\\{", - handler: function(w) - { - switch(w.matchText) { - case "@@": - var e = createTiddlyElement(w.output,"span"); - var styles = config.formatterHelpers.inlineCssHelper(w); - if(styles.length == 0) - e.className = "marked"; - else - config.formatterHelpers.applyCssHelper(e,styles); - w.subWikifyTerm(e,/(@@)/mg); - break; - case "{{": - var lookaheadRegExp = /\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg; - lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = lookaheadRegExp.exec(w.source); - if(lookaheadMatch) { - w.nextMatch = lookaheadRegExp.lastIndex; - e = createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" : "span",null,lookaheadMatch[1]); - w.subWikifyTerm(e,/(\}\}\})/mg); - } - break; - } - } -}, - -{ - name: "mdash", - match: "--", - handler: function(w) - { - createTiddlyElement(w.output,"span").innerHTML = "—"; - } -}, - -{ - name: "lineBreak", - match: "\\n|
      ", - handler: function(w) - { - createTiddlyElement(w.output,"br"); - } -}, - -{ - name: "rawText", - match: "\"{3}|", - lookaheadRegExp: /(?:\"{3}|)((?:.|\n)*?)(?:\"{3}|<\/nowiki>)/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"span",null,null,lookaheadMatch[1]); - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "htmlEntitiesEncoding", - match: "(?:(?:&#?[a-zA-Z0-9]{2,8};|.)(?:&#?(?:x0*(?:3[0-6][0-9a-fA-F]|1D[c-fC-F][0-9a-fA-F]|20[d-fD-F][0-9a-fA-F]|FE2[0-9a-fA-F])|0*(?:76[89]|7[7-9][0-9]|8[0-7][0-9]|761[6-9]|76[2-7][0-9]|84[0-3][0-9]|844[0-7]|6505[6-9]|6506[0-9]|6507[0-1]));)+|&#?[a-zA-Z0-9]{2,8};)", - handler: function(w) - { - createTiddlyElement(w.output,"span").innerHTML = w.matchText; - } -} - -]; - diff --git a/editions/tw2/source/tiddlywiki/js/FormatterHelpers.js b/editions/tw2/source/tiddlywiki/js/FormatterHelpers.js deleted file mode 100755 index b48b96429..000000000 --- a/editions/tw2/source/tiddlywiki/js/FormatterHelpers.js +++ /dev/null @@ -1,94 +0,0 @@ -//-- -//-- Formatter helpers -//-- - -function Formatter(formatters) -{ - var n; - this.formatters = []; - var pattern = []; - for(n=0; n= 200 && xhr.status < 300) || - xhr.status === 304 || xhr.status === 1223; - } catch(e) {} - return false; - }; - - var options = { - type:type, - url:url, - processData:false, - data:data, - cache:!!allowCache, - beforeSend: function(xhr) { - var i; - for(i in headers) - xhr.setRequestHeader(i,headers[i]); - xhr.setRequestHeader("X-Requested-With", "TiddlyWiki " + formatVersion()); - } - }; - - if(callback) { - options.complete = function(xhr,textStatus) { - if(httpSuccess(xhr)) - callback(true,params,xhr.responseText,url,xhr); - else - callback(false,params,null,url,xhr); - }; - } - if(contentType) - options.contentType = contentType; - if(username) - options.username = username; - if(password) - options.password = password; - if(window.Components && window.netscape && window.netscape.security && document.location.protocol.indexOf("http") == -1) - window.netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); - return jQuery.ajax(options); -} diff --git a/editions/tw2/source/tiddlywiki/js/Import.js b/editions/tw2/source/tiddlywiki/js/Import.js deleted file mode 100755 index 005a57642..000000000 --- a/editions/tw2/source/tiddlywiki/js/Import.js +++ /dev/null @@ -1,390 +0,0 @@ -//-- -//-- ImportTiddlers macro -//-- - -config.macros.importTiddlers.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - if(readOnly) { - createTiddlyElement(place,"div",null,"marked",this.readOnlyWarning); - return; - } - var w = new Wizard(); - w.createWizard(place,this.wizardTitle); - this.restart(w); -}; - -config.macros.importTiddlers.onCancel = function(e) -{ - var wizard = new Wizard(this); - wizard.clear(); - config.macros.importTiddlers.restart(wizard); - return false; -}; - -config.macros.importTiddlers.onClose = function(e) -{ - backstage.hidePanel(); - return false; -}; - -config.macros.importTiddlers.restart = function(wizard) -{ - var me = config.macros.importTiddlers; - wizard.addStep(this.step1Title,this.step1Html); - var t,s = wizard.getElement("selTypes"); - for(t in config.adaptors) { - var e = createTiddlyElement(s,"option",null,null,config.adaptors[t].serverLabel || t); - e.value = t; - } - if(config.defaultAdaptor) - s.value = config.defaultAdaptor; - s = wizard.getElement("selFeeds"); - var feeds = this.getFeeds(); - for(t in feeds) { - e = createTiddlyElement(s,"option",null,null,t); - e.value = t; - } - wizard.setValue("feeds",feeds); - s.onchange = me.onFeedChange; - var fileInput = wizard.getElement("txtBrowse"); - fileInput.onchange = me.onBrowseChange; - fileInput.onkeyup = me.onBrowseChange; - wizard.setButtons([{caption: this.openLabel, tooltip: this.openPrompt, onClick: me.onOpen}]); - wizard.formElem.action = "javascript:;"; - wizard.formElem.onsubmit = function() { - if(!this.txtPath || this.txtPath.value.length) //# check for manually entered path in first step - this.lastChild.firstChild.onclick(); - }; -}; - -config.macros.importTiddlers.getFeeds = function() -{ - var feeds = {}; - var t,tagged = store.getTaggedTiddlers("systemServer","title"); - for(t=0; t 0) { - if(!confirm(me.confirmOverwriteText.format([overwrite.join(", ")]))) - return false; - } - wizard.addStep(me.step4Title.format([rowNames.length]),me.step4Html); - for(t=0; t>'}, - importTask: {text: "import", tooltip: "Import tiddlers and plugins from other TiddlyWiki files and servers", content: '<>'}, - tweak: {text: "tweak", tooltip: "Tweak the appearance and behaviour of TiddlyWiki", content: '<>'}, - upgrade: {text: "upgrade", tooltip: "Upgrade TiddlyWiki core code", content: '<>'}, - plugins: {text: "plugins", tooltip: "Manage installed plugins", content: '<>'} -}); - -// Options that can be set in the options panel and/or cookies -merge(config.optionsDesc,{ - txtUserName: "Username for signing your edits", - chkRegExpSearch: "Enable regular expressions for searches", - chkCaseSensitiveSearch: "Case-sensitive searching", - chkIncrementalSearch: "Incremental key-by-key searching", - chkAnimate: "Enable animations", - chkSaveBackups: "Keep backup file when saving changes", - chkAutoSave: "Automatically save changes", - chkGenerateAnRssFeed: "Generate an RSS feed when saving changes", - chkSaveEmptyTemplate: "Generate an empty template when saving changes", - chkOpenInNewWindow: "Open external links in a new window", - chkToggleLinks: "Clicking on links to open tiddlers causes them to close", - chkHttpReadOnly: "Hide editing features when viewed over HTTP", - chkForceMinorUpdate: "Don't update modifier username and date when editing tiddlers", - chkConfirmDelete: "Require confirmation before deleting tiddlers", - chkInsertTabs: "Use the tab key to insert tab characters instead of moving between fields", - txtBackupFolder: "Name of folder to use for backups", - txtMaxEditRows: "Maximum number of rows in edit boxes", - txtTheme: "Name of the theme to use", - txtFileSystemCharSet: "Default character set for saving changes (Firefox/Mozilla only)"}); - -merge(config.messages,{ - customConfigError: "Problems were encountered loading plugins. See PluginManager for details", - pluginError: "Error: %0", - pluginDisabled: "Not executed because disabled via 'systemConfigDisable' tag", - pluginForced: "Executed because forced via 'systemConfigForce' tag", - pluginVersionError: "Not executed because this plugin needs a newer version of TiddlyWiki", - nothingSelected: "Nothing is selected. You must select one or more items first", - savedSnapshotError: "It appears that this TiddlyWiki has been incorrectly saved. Please see http://www.tiddlywiki.com/#Download for details", - subtitleUnknown: "(unknown)", - undefinedTiddlerToolTip: "The tiddler '%0' doesn't yet exist", - shadowedTiddlerToolTip: "The tiddler '%0' doesn't yet exist, but has a pre-defined shadow value", - tiddlerLinkTooltip: "%0 - %1, %2", - externalLinkTooltip: "External link to %0", - noTags: "There are no tagged tiddlers", - notFileUrlError: "You need to save this TiddlyWiki to a file before you can save changes", - cantSaveError: "It's not possible to save changes. Possible reasons include:\n- your browser doesn't support saving (Firefox, Internet Explorer, Safari and Opera all work if properly configured)\n- the pathname to your TiddlyWiki file contains illegal characters\n- the TiddlyWiki HTML file has been moved or renamed", - invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki", - backupSaved: "Backup saved", - backupFailed: "Failed to save backup file", - rssSaved: "RSS feed saved", - rssFailed: "Failed to save RSS feed file", - emptySaved: "Empty template saved", - emptyFailed: "Failed to save empty template file", - mainSaved: "Main TiddlyWiki file saved", - mainFailed: "Failed to save main TiddlyWiki file. Your changes have not been saved", - macroError: "Error in macro <<%0>>", - macroErrorDetails: "Error while executing macro <<%0>>:\n%1", - missingMacro: "No such macro", - overwriteWarning: "A tiddler named '%0' already exists. Choose OK to overwrite it", - unsavedChangesWarning: "WARNING! There are unsaved changes in TiddlyWiki\n\nChoose OK to save\nChoose CANCEL to discard", - confirmExit: "--------------------------------\n\nThere are unsaved changes in TiddlyWiki. If you continue you will lose those changes\n\n--------------------------------", - saveInstructions: "SaveChanges", - unsupportedTWFormat: "Unsupported TiddlyWiki format '%0'", - tiddlerSaveError: "Error when saving tiddler '%0'", - tiddlerLoadError: "Error when loading tiddler '%0'", - wrongSaveFormat: "Cannot save with storage format '%0'. Using standard format for save.", - invalidFieldName: "Invalid field name %0", - fieldCannotBeChanged: "Field '%0' cannot be changed", - loadingMissingTiddler: "Attempting to retrieve the tiddler '%0' from the '%1' server at:\n\n'%2' in the workspace '%3'", - upgradeDone: "The upgrade to version %0 is now complete\n\nClick 'OK' to reload the newly upgraded TiddlyWiki", - invalidCookie: "Invalid cookie '%0'"}); - -merge(config.messages.messageClose,{ - text: "close", - tooltip: "close this message area"}); - -config.messages.backstage = { - open: {text: "backstage", tooltip: "Open the backstage area to perform authoring and editing tasks"}, - close: {text: "close", tooltip: "Close the backstage area"}, - prompt: "backstage: ", - decal: { - edit: {text: "edit", tooltip: "Edit the tiddler '%0'"} - } -}; - -config.messages.listView = { - tiddlerTooltip: "Click for the full text of this tiddler", - previewUnavailable: "(preview not available)" -}; - -config.messages.dates.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November","December"]; -config.messages.dates.days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; -config.messages.dates.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -config.messages.dates.shortDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -// suffixes for dates, eg "1st","2nd","3rd"..."30th","31st" -config.messages.dates.daySuffixes = ["st","nd","rd","th","th","th","th","th","th","th", - "th","th","th","th","th","th","th","th","th","th", - "st","nd","rd","th","th","th","th","th","th","th", - "st"]; -config.messages.dates.am = "am"; -config.messages.dates.pm = "pm"; - -merge(config.messages.tiddlerPopup,{ - }); - -merge(config.views.wikified.tag,{ - labelNoTags: "no tags", - labelTags: "tags: ", - openTag: "Open tag '%0'", - tooltip: "Show tiddlers tagged with '%0'", - openAllText: "Open all", - openAllTooltip: "Open all of these tiddlers", - popupNone: "No other tiddlers tagged with '%0'"}); - -merge(config.views.wikified,{ - defaultText: "The tiddler '%0' doesn't yet exist. Double-click to create it", - defaultModifier: "(missing)", - shadowModifier: "(built-in shadow tiddler)", - dateFormat: "DD MMM YYYY", - createdPrompt: "created"}); - -merge(config.views.editor,{ - tagPrompt: "Type tags separated with spaces, [[use double square brackets]] if necessary, or add existing", - defaultText: "Type the text for '%0'"}); - -merge(config.views.editor.tagChooser,{ - text: "tags", - tooltip: "Choose existing tags to add to this tiddler", - popupNone: "There are no tags defined", - tagTooltip: "Add the tag '%0'"}); - -merge(config.messages,{ - sizeTemplates: - [ - {unit: 1024*1024*1024, template: "%0\u00a0GB"}, - {unit: 1024*1024, template: "%0\u00a0MB"}, - {unit: 1024, template: "%0\u00a0KB"}, - {unit: 1, template: "%0\u00a0B"} - ]}); - -merge(config.macros.search,{ - label: "search", - prompt: "Search this TiddlyWiki", - placeholder: "", - accessKey: "F", - successMsg: "%0 tiddlers found matching %1", - failureMsg: "No tiddlers found matching %0"}); - -merge(config.macros.tagging,{ - label: "tagging: ", - labelNotTag: "not tagging", - tooltip: "List of tiddlers tagged with '%0'"}); - -merge(config.macros.timeline,{ - dateFormat: "DD MMM YYYY"}); - -merge(config.macros.allTags,{ - tooltip: "Show tiddlers tagged with '%0'", - noTags: "There are no tagged tiddlers"}); - -config.macros.list.all.prompt = "All tiddlers in alphabetical order"; -config.macros.list.missing.prompt = "Tiddlers that have links to them but are not defined"; -config.macros.list.orphans.prompt = "Tiddlers that are not linked to from any other tiddlers"; -config.macros.list.shadowed.prompt = "Tiddlers shadowed with default contents"; -config.macros.list.touched.prompt = "Tiddlers that have been modified locally"; - -merge(config.macros.closeAll,{ - label: "close all", - prompt: "Close all displayed tiddlers (except any that are being edited)"}); - -merge(config.macros.permaview,{ - label: "permaview", - prompt: "Link to an URL that retrieves all the currently displayed tiddlers"}); - -merge(config.macros.saveChanges,{ - label: "save changes", - prompt: "Save all tiddlers to create a new TiddlyWiki", - accessKey: "S"}); - -merge(config.macros.newTiddler,{ - label: "new tiddler", - prompt: "Create a new tiddler", - title: "New Tiddler", - accessKey: "N"}); - -merge(config.macros.newJournal,{ - label: "new journal", - prompt: "Create a new tiddler from the current date and time", - accessKey: "J"}); - -merge(config.macros.options,{ - wizardTitle: "Tweak advanced options", - step1Title: "These options are saved in cookies in your browser", - step1Html: "
      Show unknown options", - unknownDescription: "//(unknown)//", - listViewTemplate: { - columns: [ - {name: 'Option', field: 'option', title: "Option", type: 'String'}, - {name: 'Description', field: 'description', title: "Description", type: 'WikiText'}, - {name: 'Name', field: 'name', title: "Name", type: 'String'} - ], - rowClasses: [ - {className: 'lowlight', field: 'lowlight'} - ]} - }); - -merge(config.macros.plugins,{ - wizardTitle: "Manage plugins", - step1Title: "Currently loaded plugins", - step1Html: "", // DO NOT TRANSLATE - skippedText: "(This plugin has not been executed because it was added since startup)", - noPluginText: "There are no plugins installed", - confirmDeleteText: "Are you sure you want to delete these plugins:\n\n%0", - removeLabel: "remove systemConfig tag", - removePrompt: "Remove systemConfig tag", - deleteLabel: "delete", - deletePrompt: "Delete these tiddlers forever", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Description', field: 'Description', title: "Description", type: 'String'}, - {name: 'Version', field: 'Version', title: "Version", type: 'String'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'}, - {name: 'Forced', field: 'forced', title: "Forced", tag: 'systemConfigForce', type: 'TagCheckbox'}, - {name: 'Disabled', field: 'disabled', title: "Disabled", tag: 'systemConfigDisable', type: 'TagCheckbox'}, - {name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"}, - {name: 'Startup Time', field: 'startupTime', title: "Startup Time", type: 'String'}, - {name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"}, - {name: 'Log', field: 'log', title: "Log", type: 'StringList'} - ], - rowClasses: [ - {className: 'error', field: 'error'}, - {className: 'warning', field: 'warning'} - ]}, - listViewTemplateReadOnly: { - columns: [ - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Description', field: 'Description', title: "Description", type: 'String'}, - {name: 'Version', field: 'Version', title: "Version", type: 'String'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'}, - {name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"}, - {name: 'Startup Time', field: 'startupTime', title: "Startup Time", type: 'String'}, - {name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"}, - {name: 'Log', field: 'log', title: "Log", type: 'StringList'} - ], - rowClasses: [ - {className: 'error', field: 'error'}, - {className: 'warning', field: 'warning'} - ]} - }); - -merge(config.macros.toolbar,{ - moreLabel: "more", - morePrompt: "Show additional commands", - lessLabel: "less", - lessPrompt: "Hide additional commands", - separator: "|" - }); - -merge(config.macros.refreshDisplay,{ - label: "refresh", - prompt: "Redraw the entire TiddlyWiki display" - }); - -merge(config.macros.importTiddlers,{ - readOnlyWarning: "You cannot import into a read-only TiddlyWiki file. Try opening it from a file:// URL", - wizardTitle: "Import tiddlers from another file or server", - step1Title: "Step 1: Locate the server or TiddlyWiki file", - step1Html: "Specify the type of the server:
      Enter the URL or pathname here:
      ...or browse for a file:

      ...or select a pre-defined feed: ", - openLabel: "open", - openPrompt: "Open the connection to this file or server", - statusOpenHost: "Opening the host", - statusGetWorkspaceList: "Getting the list of available workspaces", - step2Title: "Step 2: Choose the workspace", - step2Html: "Enter a workspace name:
      ...or select a workspace: ", - cancelLabel: "cancel", - cancelPrompt: "Cancel this import", - statusOpenWorkspace: "Opening the workspace", - statusGetTiddlerList: "Getting the list of available tiddlers", - errorGettingTiddlerList: "Error getting list of tiddlers, click Cancel to try again", - errorGettingTiddlerListHttp404: "Error retrieving tiddlers from url, please ensure the url exists. Click Cancel to try again.", - errorGettingTiddlerListHttp: "Error retrieving tiddlers from url, please ensure this url exists and is CORS enabled", - errorGettingTiddlerListFile: "Error retrieving tiddlers from local file, please make sure the file is in the same directory as your TiddlyWiki. Click Cancel to try again.", - step3Title: "Step 3: Choose the tiddlers to import", - step3Html: "
      Keep these tiddlers linked to this server so that you can synchronise subsequent changes
      Save the details of this server in a 'systemServer' tiddler called: ", - importLabel: "import", - importPrompt: "Import these tiddlers", - confirmOverwriteText: "Are you sure you want to overwrite these tiddlers:\n\n%0", - step4Title: "Step 4: Importing %0 tiddler(s)", - step4Html: "", // DO NOT TRANSLATE - doneLabel: "done", - donePrompt: "Close this wizard", - statusDoingImport: "Importing tiddlers", - statusDoneImport: "All tiddlers imported", - systemServerNamePattern: "%2 on %1", - systemServerNamePatternNoWorkspace: "%1", - confirmOverwriteSaveTiddler: "The tiddler '%0' already exists. Click 'OK' to overwrite it with the details of this server, or 'Cancel' to leave it unchanged", - serverSaveTemplate: "|''Type:''|%0|\n|''URL:''|%1|\n|''Workspace:''|%2|\n\nThis tiddler was automatically created to record the details of this server", - serverSaveModifier: "(System)", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'}, - {name: 'Tags', field: 'tags', title: "Tags", type: 'Tags'} - ], - rowClasses: [ - ]} - }); - -merge(config.macros.upgrade,{ - wizardTitle: "Upgrade TiddlyWiki core code", - step1Title: "Update or repair this TiddlyWiki to the latest release", - step1Html: "You are about to upgrade to the latest release of the TiddlyWiki core code (from %1). Your content will be preserved across the upgrade.

      Note that core upgrades have been known to interfere with older plugins. If you run into problems with the upgraded file, see http://www.tiddlywiki.org/wiki/CoreUpgrades", - errorCantUpgrade: "Unable to upgrade this TiddlyWiki. You can only perform upgrades on TiddlyWiki files stored locally", - errorNotSaved: "You must save changes before you can perform an upgrade", - step2Title: "Confirm the upgrade details", - step2Html_downgrade: "You are about to downgrade to TiddlyWiki version %0 from %1.

      Downgrading to an earlier version of the core code is not recommended", - step2Html_restore: "This TiddlyWiki appears to be already using the latest version of the core code (%0).

      You can continue to upgrade anyway to ensure that the core code hasn't been corrupted or damaged", - step2Html_upgrade: "You are about to upgrade to TiddlyWiki version %0 from %1", - upgradeLabel: "upgrade", - upgradePrompt: "Prepare for the upgrade process", - statusPreparingBackup: "Preparing backup", - statusSavingBackup: "Saving backup file", - errorSavingBackup: "There was a problem saving the backup file", - statusLoadingCore: "Loading core code", - errorLoadingCore: "Error loading the core code", - errorCoreFormat: "Error with the new core code", - statusSavingCore: "Saving the new core code", - statusReloadingCore: "Reloading the new core code", - startLabel: "start", - startPrompt: "Start the upgrade process", - cancelLabel: "cancel", - cancelPrompt: "Cancel the upgrade process", - step3Title: "Upgrade cancelled", - step3Html: "You have cancelled the upgrade process" - }); - -merge(config.macros.sync,{ - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Server Type', field: 'serverType', title: "Server type", type: 'String'}, - {name: 'Server Host', field: 'serverHost', title: "Server host", type: 'String'}, - {name: 'Server Workspace', field: 'serverWorkspace', title: "Server workspace", type: 'String'}, - {name: 'Status', field: 'status', title: "Synchronisation status", type: 'String'}, - {name: 'Server URL', field: 'serverUrl', title: "Server URL", text: "View", type: 'Link'} - ], - rowClasses: [ - ], - buttons: [ - {caption: "Sync these tiddlers", name: 'sync'} - ]}, - wizardTitle: "Synchronize with external servers and files", - step1Title: "Choose the tiddlers you want to synchronize", - step1Html: "", // DO NOT TRANSLATE - syncLabel: "sync", - syncPrompt: "Sync these tiddlers", - hasChanged: "Changed while unplugged", - hasNotChanged: "Unchanged while unplugged", - syncStatusList: { - none: {text: "...", display:'none', className:'notChanged'}, - changedServer: {text: "Changed on server", display:null, className:'changedServer'}, - changedLocally: {text: "Changed while unplugged", display:null, className:'changedLocally'}, - changedBoth: {text: "Changed while unplugged and on server", display:null, className:'changedBoth'}, - notFound: {text: "Not found on server", display:null, className:'notFound'}, - putToServer: {text: "Saved update on server", display:null, className:'putToServer'}, - gotFromServer: {text: "Retrieved update from server", display:null, className:'gotFromServer'} - } - }); - -merge(config.macros.annotations,{ - }); - -merge(config.commands.closeTiddler,{ - text: "close", - tooltip: "Close this tiddler"}); - -merge(config.commands.closeOthers,{ - text: "close others", - tooltip: "Close all other tiddlers"}); - -merge(config.commands.editTiddler,{ - text: "edit", - tooltip: "Edit this tiddler", - readOnlyText: "view", - readOnlyTooltip: "View the source of this tiddler"}); - -merge(config.commands.saveTiddler,{ - text: "done", - tooltip: "Save changes to this tiddler"}); - -merge(config.commands.cancelTiddler,{ - text: "cancel", - tooltip: "Undo changes to this tiddler", - warning: "Are you sure you want to abandon your changes to '%0'?", - readOnlyText: "done", - readOnlyTooltip: "View this tiddler normally"}); - -merge(config.commands.deleteTiddler,{ - text: "delete", - tooltip: "Delete this tiddler", - warning: "Are you sure you want to delete '%0'?"}); - -merge(config.commands.permalink,{ - text: "permalink", - tooltip: "Permalink for this tiddler"}); - -merge(config.commands.references,{ - text: "references", - tooltip: "Show tiddlers that link to this one", - popupNone: "No references"}); - -merge(config.commands.jump,{ - text: "jump", - tooltip: "Jump to another open tiddler"}); - -merge(config.commands.syncing,{ - text: "syncing", - tooltip: "Control synchronisation of this tiddler with a server or external file", - currentlySyncing: "
      Currently syncing via '%0' to:
      host: %1
      workspace: %2", // Note escaping of closing
      tag - notCurrentlySyncing: "Not currently syncing", - captionUnSync: "Stop synchronising this tiddler", - chooseServer: "Synchronise this tiddler with another server:", - currServerMarker: "\u25cf ", - notCurrServerMarker: " "}); - -merge(config.commands.fields,{ - text: "fields", - tooltip: "Show the extended fields of this tiddler", - emptyText: "There are no extended fields for this tiddler", - listViewTemplate: { - columns: [ - {name: 'Field', field: 'field', title: "Field", type: 'String'}, - {name: 'Value', field: 'value', title: "Value", type: 'String'} - ], - rowClasses: [ - ], - buttons: [ - ]}}); - -merge(config.shadowTiddlers,{ - DefaultTiddlers: "[[GettingStarted]]", - MainMenu: "[[GettingStarted]]", - SiteTitle: "My TiddlyWiki", - SiteSubtitle: "a reusable non-linear personal web notebook", - SiteUrl: "", - SideBarOptions: '<><><><><><><>', - SideBarTabs: '<>', - TabMore: '<>' - }); - -merge(config.annotations,{ - AdvancedOptions: "This shadow tiddler provides access to several advanced options", - ColorPalette: "These values in this shadow tiddler determine the colour scheme of the ~TiddlyWiki user interface", - DefaultTiddlers: "The tiddlers listed in this shadow tiddler will be automatically displayed when ~TiddlyWiki starts up", - EditTemplate: "The HTML template in this shadow tiddler determines how tiddlers look while they are being edited", - GettingStarted: "This shadow tiddler provides basic usage instructions", - ImportTiddlers: "This shadow tiddler provides access to importing tiddlers", - MainMenu: "This shadow tiddler is used as the contents of the main menu in the left-hand column of the screen", - MarkupPreHead: "This tiddler is inserted at the top of the section of the TiddlyWiki HTML file", - MarkupPostHead: "This tiddler is inserted at the bottom of the section of the TiddlyWiki HTML file", - MarkupPreBody: "This tiddler is inserted at the top of the section of the TiddlyWiki HTML file", - MarkupPostBody: "This tiddler is inserted at the end of the section of the TiddlyWiki HTML file immediately after the script block", - OptionsPanel: "This shadow tiddler is used as the contents of the options panel slider in the right-hand sidebar", - PageTemplate: "The HTML template in this shadow tiddler determines the overall ~TiddlyWiki layout", - PluginManager: "This shadow tiddler provides access to the plugin manager", - SideBarOptions: "This shadow tiddler is used as the contents of the option panel in the right-hand sidebar", - SideBarTabs: "This shadow tiddler is used as the contents of the tabs panel in the right-hand sidebar", - SiteSubtitle: "This shadow tiddler is used as the second part of the page title", - SiteTitle: "This shadow tiddler is used as the first part of the page title", - SiteUrl: "This shadow tiddler should be set to the full target URL for publication", - StyleSheetColors: "This shadow tiddler contains CSS definitions related to the color of page elements. ''DO NOT EDIT THIS TIDDLER'', instead make your changes in the StyleSheet shadow tiddler", - StyleSheet: "This tiddler can contain custom CSS definitions", - StyleSheetLayout: "This shadow tiddler contains CSS definitions related to the layout of page elements. ''DO NOT EDIT THIS TIDDLER'', instead make your changes in the StyleSheet shadow tiddler", - StyleSheetLocale: "This shadow tiddler contains CSS definitions related to the translation locale", - StyleSheetPrint: "This shadow tiddler contains CSS definitions for printing", - SystemSettings: "This tiddler is used to store configuration options for this TiddlyWiki document", - TabAll: "This shadow tiddler contains the contents of the 'All' tab in the right-hand sidebar", - TabMore: "This shadow tiddler contains the contents of the 'More' tab in the right-hand sidebar", - TabMoreMissing: "This shadow tiddler contains the contents of the 'Missing' tab in the right-hand sidebar", - TabMoreOrphans: "This shadow tiddler contains the contents of the 'Orphans' tab in the right-hand sidebar", - TabMoreShadowed: "This shadow tiddler contains the contents of the 'Shadowed' tab in the right-hand sidebar", - TabTags: "This shadow tiddler contains the contents of the 'Tags' tab in the right-hand sidebar", - TabTimeline: "This shadow tiddler contains the contents of the 'Timeline' tab in the right-hand sidebar", - ToolbarCommands: "This shadow tiddler determines which commands are shown in tiddler toolbars", - ViewTemplate: "The HTML template in this shadow tiddler determines how tiddlers look" - }); diff --git a/editions/tw2/source/tiddlywiki/js/ListView.js b/editions/tw2/source/tiddlywiki/js/ListView.js deleted file mode 100755 index f48950543..000000000 --- a/editions/tw2/source/tiddlywiki/js/ListView.js +++ /dev/null @@ -1,275 +0,0 @@ -//-- -//-- ListView gadget -//-- - -var ListView = {}; - -// Create a listview -//# place - where in the DOM tree to insert the listview -//# listObject - array of objects to be included in the listview -//# listTemplate - template for the listview -//# callback - callback for a command being selected -//# className - optional classname for the element -ListView.create = function(place,listObject,listTemplate,callback,className) -{ - var table = createTiddlyElement(place,"table",null,className || "listView twtable"); - var thead = createTiddlyElement(table,"thead"); - var t,r = createTiddlyElement(thead,"tr"); - for(t=0; t element of listView -//# callback(checkboxElement,rowName) -//# where -//# checkboxElement - DOM element of checkbox -//# rowName - name of this row as assigned by the column template -//# result: true if at least one selector was checked -ListView.forEachSelector = function(view,callback) -{ - var checkboxes = view.getElementsByTagName("input"); - var t,hadOne = false; - for(t=0; t>) - window.tiddler = tiddlerElem ? store.getTiddler(tiddlerElem.getAttribute("tiddler")) : null; - window.place = place; - var allowEval = true; - if(config.evaluateMacroParameters=="system") { - if(!tiddler || tiddler.tags.indexOf("systemAllowEval") == -1) { - allowEval = false; - } - } - m.handler(place,macro,m.noPreParse?null:params.readMacroParams(!allowEval),wikifier,params,tiddler); - } else { - createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,config.messages.missingMacro])); - } - } catch(ex) { - createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,ex.toString()])); - } -} - -config.macros.version.handler = function(place) -{ - jQuery("").text(formatVersion()).appendTo(place); -}; - -config.macros.today.handler = function(place,macroName,params) -{ - var now = new Date(); - var text = params[0] ? now.formatString(params[0].trim()) : now.toLocaleString(); - jQuery("").text(text).appendTo(place); -}; - -config.macros.list.template = "<>"; -config.macros.list.handler = function(place,macroName,params,wikifier,paramString) -{ - var list = document.createElement("ul"); - jQuery(list).attr({ refresh: "macro", macroName: macroName }).data("params", paramString); - place.appendChild(list); - this.refresh(list); -}; - -config.macros.list.refresh = function(list) { - var paramString = jQuery(list).data("params"); - var params = paramString.readMacroParams(); - var args = paramString.parseParams("anon", null, null)[0]; - var type = args.anon ? args.anon[0] : "all"; - jQuery(list).empty().addClass("list list-" + type); - var template = args.template ? store.getTiddlerText(args.template[0]) : false; - if(!template) { - template = config.macros.list.template; - } - if(this[type].prompt) - createTiddlyElement(list,"li",null,"listTitle",this[type].prompt); - var results; - if(this[type].handler) - results = this[type].handler(params); - var t; - for(t = 0; t < results.length; t++) { - var li = document.createElement("li"); - list.appendChild(li); - var tiddler = results[t]; - if(typeof(tiddler) == 'string') { // deal with missing etc.. - tiddler = store.getTiddler(tiddler) || new Tiddler(tiddler); - } - wikify(template, li, null, tiddler); - } - if(results.length === 0 && args.emptyMessage) { - jQuery(list).addClass("emptyList"); - jQuery("
    1. ").text(args.emptyMessage[0]).appendTo(list); - } -}; - -config.macros.list.all.handler = function(params) -{ - return store.reverseLookup("tags","excludeLists",false,"title"); -}; - -config.macros.list.missing.handler = function(params) -{ - return store.getMissingLinks(); -}; - -config.macros.list.orphans.handler = function(params) -{ - return store.getOrphans(); -}; - -config.macros.list.shadowed.handler = function(params) -{ - return store.getShadowed(); -}; - -config.macros.list.touched.handler = function(params) -{ - return store.getTouched(); -}; - -config.macros.list.filter.handler = function(params) -{ - var filter = params[1]; - var results = []; - if(filter) { - var tiddlers = store.filterTiddlers(filter); - var t; - for(t=0; t").attr("params", paramString). - attr("macroName", macroName).appendTo(place)[0]; - macro.refresh(container); - }, - refresh: function(container) { - jQuery(container).attr("refresh", "macro").empty(); - var paramString = jQuery(container).attr("params"); - var args = paramString.parseParams("anon", null, null)[0]; - var params = args.anon || []; - - var field = params[0] || "modified"; - var dateFormat = params[2] || this.dateFormat; - var groupTemplate = macro.groupTemplate.format(field, dateFormat); - groupTemplate = args.groupTemplate ? store.getTiddlerText(args.groupTemplate[0]) || groupTemplate : - groupTemplate; - - var itemTemplate = macro.itemTemplate; - itemTemplate = args.template ? store.getTiddlerText(args.template[0]) || itemTemplate : - itemTemplate; - - var tiddlers = args.filter ? store.sortTiddlers(store.filterTiddlers(args.filter[0]), field) : - store.reverseLookup("tags", "excludeLists", false, field); - var lastGroup = "", ul; - var last = params[1] ? tiddlers.length-Math.min(tiddlers.length,parseInt(params[1],10)) : 0; - var t; - for(t=tiddlers.length-1; t>=last; t--) { - var tiddler = tiddlers[t]; - var theGroup = wikifyPlainText(groupTemplate,0,tiddler); - if(typeof(ul) == "undefined" || theGroup != lastGroup) { - ul = document.createElement("ul"); - jQuery(ul).addClass("timeline"); - container.appendChild(ul); - createTiddlyElement(ul,"li",null,"listTitle",theGroup); - lastGroup = theGroup; - } - var item = createTiddlyElement(ul,"li",null,"listLink"); - wikify(itemTemplate,item,null,tiddler); - } - }, - groupTemplate: "<>", - itemTemplate: "<>" -}); - -config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - var allowEval = true; - var stack = config.macros.tiddler.tiddlerStack; - if(stack.length > 0 && config.evaluateMacroParameters == "system") { - // included tiddler and "system" evaluation required, so check tiddler tagged appropriately - var title = stack[stack.length-1]; - var pos = title.indexOf(config.textPrimitives.sectionSeparator); - if(pos != -1) { - title = title.substr(0,pos); // get the base tiddler title - } - var t = store.getTiddler(title); - if(!t || t.tags.indexOf("systemAllowEval") == -1) { - allowEval = false; - } - } - params = paramString.parseParams("name",null,allowEval,false,true); - var names = params[0]["name"]; - var tiddlerName = names[0]; - var className = names[1] || null; - var args = params[0]["with"]; - var wrapper = createTiddlyElement(place,"span",null,className,null,{ - refresh: "content", tiddler: tiddlerName - }); - if(args!==undefined) - wrapper.setAttribute("args","[["+args.join("]] [[")+"]]"); - this.transclude(wrapper,tiddlerName,args); -}; - -config.macros.tiddler.transclude = function(wrapper,tiddlerName,args) -{ - var text = store.getTiddlerText(tiddlerName); - if(!text) - return; - var stack = config.macros.tiddler.tiddlerStack; - if(stack.indexOf(tiddlerName) !== -1) - return; - stack.push(tiddlerName); - try { - if(typeof args == "string") - args = args.readBracketedList(); - var n = args ? Math.min(args.length,9) : 0; - var i; - for(i=0; i> -config.macros.gradient.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - var panel = wikifier ? createTiddlyElement(place,"div",null,"gradient") : place; - panel.style.position = "relative"; - panel.style.overflow = "hidden"; - panel.style.zIndex = "0"; - if(wikifier) { - var styles = config.formatterHelpers.inlineCssHelper(wikifier); - config.formatterHelpers.applyCssHelper(panel,styles); - } - params = paramString.parseParams("color"); - var locolors = [], hicolors = []; - var t; - for(t=2; t>"); - if(document.all) { - panel.style.height = "100%"; - panel.style.width = "100%"; - } -}; - -config.macros.message.handler = function(place,macroName,params) -{ - if(params[0]) { - var names = params[0].split("."); - var lookupMessage = function(root,nameIndex) { - if(root[names[nameIndex]]) { - if(nameIndex < names.length-1) - return (lookupMessage(root[names[nameIndex]],nameIndex+1)); - else - return root[names[nameIndex]]; - } else - return null; - }; - var m = lookupMessage(config,0); - if(m == null) - m = lookupMessage(window,0); - createTiddlyText(place,m.toString().format(params.splice(1))); - } -}; - - -config.macros.view.depth = 0; -config.macros.view.values = []; -config.macros.view.views = { - text: function(value,place,params,wikifier,paramString,tiddler) { - highlightify(value,place,highlightHack,tiddler); - }, - link: function(value,place,params,wikifier,paramString,tiddler) { - createTiddlyLink(place,value,true); - }, - wikified: function(value,place,params,wikifier,paramString,tiddler) { - if(config.macros.view.depth>50) - return; - if(config.macros.view.depth>0) { - if (value==config.macros.view.values[config.macros.view.depth-1]) { - return; - } - } - config.macros.view.values[config.macros.view.depth] = value; - config.macros.view.depth++; - if(params[2]) - value=params[2].unescapeLineBreaks().format([value]); - wikify(value,place,highlightHack,tiddler); - config.macros.view.depth--; - config.macros.view.values[config.macros.view.depth] = null; - }, - date: function(value,place,params,wikifier,paramString,tiddler) { - value = Date.convertFromYYYYMMDDHHMM(value); - createTiddlyText(place,value.formatString(params[2] || config.views.wikified.dateFormat)); - } -}; - -config.macros.view.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - if((tiddler instanceof Tiddler) && params[0]) { - var value = store.getValue(tiddler,params[0]); - if(value) { - var type = params[1] || config.macros.view.defaultView; - var handler = config.macros.view.views[type]; - if(handler) - handler(value,place,params,wikifier,paramString,tiddler); - } - } -}; - -config.macros.edit.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - var field = params[0]; - var rows = params[1] || 0; - var defVal = params[2] || ''; - if((tiddler instanceof Tiddler) && field) { - story.setDirty(tiddler.title,true); - var e,v; - if(field != "text" && !rows) { - e = createTiddlyElement(null,"input",null,null,null,{ - type: "text", edit: field, size: "40", autocomplete: "off" - }); - e.value = store.getValue(tiddler,field) || defVal; - place.appendChild(e); - } else { - var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix"); - var wrapper2 = createTiddlyElement(wrapper1,"div"); - e = createTiddlyElement(wrapper2,"textarea"); - e.value = v = store.getValue(tiddler,field) || defVal; - rows = rows || 10; - var lines = v.match(/\n/mg); - var maxLines = Math.max(parseInt(config.options.txtMaxEditRows,10),5); - if(lines != null && lines.length > rows) - rows = lines.length + 5; - rows = Math.min(rows,maxLines); - e.setAttribute("rows",rows); - e.setAttribute("edit",field); - place.appendChild(wrapper1); - } - if(tiddler.isReadOnly()) { - e.setAttribute("readOnly","readOnly"); - jQuery(e).addClass("readOnly"); - } - return e; - } -}; - -config.macros.tagChooser.onClick = function(ev) -{ - var e = ev || window.event; - var lingo = config.views.editor.tagChooser; - var popup = Popup.create(this); - var tags = store.getTags(this.getAttribute("tags")); - if(tags.length == 0) - jQuery("
    2. ").text(lingo.popupNone).appendTo(popup); - var t; - for(t=0; t= this.endTime) { - this.stop(); - return false; - } - return true; -}; - diff --git a/editions/tw2/source/tiddlywiki/js/NewTiddler.js b/editions/tw2/source/tiddlywiki/js/NewTiddler.js deleted file mode 100755 index 0fe8584e2..000000000 --- a/editions/tw2/source/tiddlywiki/js/NewTiddler.js +++ /dev/null @@ -1,81 +0,0 @@ -//-- -//-- NewTiddler and NewJournal macros -//-- - -config.macros.newTiddler.createNewTiddlerButton = function(place,title,params,label,prompt,accessKey,newFocus,isJournal) -{ - var tags = []; - var t; - for(t=1; t 0) - btn.setAttribute("params",tags.join("|")); - btn.setAttribute("newFocus",newFocus); - btn.setAttribute("newTemplate",getParam(params,"template",DEFAULT_EDIT_TEMPLATE)); - if(customFields !== "") - btn.setAttribute("customFields",customFields); - var text = getParam(params,"text"); - if(text !== undefined) - btn.setAttribute("newText",text); - return btn; -}; - -config.macros.newTiddler.onClickNewTiddler = function() -{ - var title = this.getAttribute("newTitle"); - if(this.getAttribute("isJournal") == "true") { - title = new Date().formatString(title.trim()); - } - var params = this.getAttribute("params"); - var tags = params ? params.split("|") : []; - var focus = this.getAttribute("newFocus"); - var template = this.getAttribute("newTemplate"); - var customFields = this.getAttribute("customFields"); - if(!customFields && !store.isShadowTiddler(title)) - customFields = String.encodeHashMap(config.defaultCustomFields); - story.displayTiddler(null,title,template,false,null,null); - var tiddlerElem = story.getTiddler(title); - if(customFields) - story.addCustomFields(tiddlerElem,customFields); - var text = this.getAttribute("newText"); - if(typeof text == "string" && story.getTiddlerField(title,"text")) - story.getTiddlerField(title,"text").value = text.format([title]); - var t; - for(t=0;t max) - c = max; - return Number(c); -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Options.js b/editions/tw2/source/tiddlywiki/js/Options.js deleted file mode 100755 index f2903a520..000000000 --- a/editions/tw2/source/tiddlywiki/js/Options.js +++ /dev/null @@ -1,312 +0,0 @@ -//-- -//-- Option handling -//-- - -config.optionHandlers = { - 'txt': { - get: function(name) {return encodeCookie(config.options[name].toString());}, - set: function(name,value) {config.options[name] = decodeCookie(value);} - }, - 'chk': { - get: function(name) {return config.options[name] ? 'true' : 'false';}, - set: function(name,value) {config.options[name] = value == 'true';} - } -}; - -function setOption(name,value) -{ - var optType = name.substr(0,3); - if(config.optionHandlers[optType] && config.optionHandlers[optType].set) - config.optionHandlers[optType].set(name,value); -} - -// Gets the value of an option as a string. Most code should just read from config.options.* directly -function getOption(name) -{ - var optType = name.substr(0,3); - return config.optionHandlers[optType] && config.optionHandlers[optType].get ? config.optionHandlers[optType].get(name) : null; -} - -//# Loads config.options from cookies and SystemSettings -function loadOptions() -{ - if(safeMode) - return; - loadCookies(); - loadSystemSettings(); -} -// @Deprecated; retained for backwards compatibility -var loadOptionsCookie = loadOptions; - -function getCookies() -{ - var cookieList = document.cookie.split(';'); - var i,cookies = {}; - for(i=0; i= 0 && !valign && !halign) { - offset.x = offset.x + root.offsetWidth; - } else { - offset.x = (halign == "right") ? offset.x + root.offsetWidth : offset.x; - offset.y = (valign == "top") ? offset.y : offset.y + root.offsetHeight; - } - var rootLeft = findPosX(root); - var rootTop = findPosY(root); - var popupLeft = rootLeft + offset.x; - var popupTop = rootTop + offset.y; - var winWidth = findWindowWidth(); - if(popup.offsetWidth > winWidth*0.75) - popup.style.width = winWidth*0.75 + "px"; - var popupWidth = popup.offsetWidth; - var scrollWidth = winWidth - document.body.offsetWidth; - if(popupLeft + popupWidth > winWidth - scrollWidth - 1) { - if(halign == "right") - popupLeft = popupLeft - root.offsetWidth - popupWidth; - else - popupLeft = winWidth - popupWidth - scrollWidth - 1; - } - popup.style.left = popupLeft + "px"; - popup.style.top = popupTop + "px"; - popup.style.display = "block"; -}; - -Popup.find = function(e) -{ - var t,pos = -1; - for(t=this.stack.length-1; t>=0; t--) { - if(isDescendant(e,this.stack[t].popup)) - pos = t; - } - return pos; -}; - -Popup.remove = function(pos) -{ - if(!pos) pos = 0; - if(Popup.stack.length > pos) { - Popup.removeFrom(pos); - } -}; - -Popup.removeFrom = function(from) -{ - var t; - for(t=Popup.stack.length-1; t>=from; t--) { - var p = Popup.stack[t]; - jQuery(p.root).removeClass("highlight"); - jQuery(p.popup).remove(); - } - Popup.stack = Popup.stack.slice(0,from); -}; - diff --git a/editions/tw2/source/tiddlywiki/js/RGB.js b/editions/tw2/source/tiddlywiki/js/RGB.js deleted file mode 100755 index 672b84d20..000000000 --- a/editions/tw2/source/tiddlywiki/js/RGB.js +++ /dev/null @@ -1,59 +0,0 @@ -//-- -//-- RGB colour object -//-- - -// Construct an RGB colour object from a '#rrggbb', '#rgb' or 'rgb(n,n,n)' string or from separate r,g,b values -function RGB(r,g,b) -{ - this.r = 0; - this.g = 0; - this.b = 0; - if(typeof r == "string") { - if(r.substr(0,1) == "#") { - if(r.length == 7) { - this.r = parseInt(r.substr(1,2),16)/255; - this.g = parseInt(r.substr(3,2),16)/255; - this.b = parseInt(r.substr(5,2),16)/255; - } else { - this.r = parseInt(r.substr(1,1),16)/15; - this.g = parseInt(r.substr(2,1),16)/15; - this.b = parseInt(r.substr(3,1),16)/15; - } - } else { - var rgbPattern = /rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/; - var c = r.match(rgbPattern); - if(c) { - this.r = parseInt(c[1],10)/255; - this.g = parseInt(c[2],10)/255; - this.b = parseInt(c[3],10)/255; - } - } - } else { - this.r = r; - this.g = g; - this.b = b; - } - return this; -} - -// Mixes this colour with another in a specified proportion -// c = other colour to mix -// f = 0..1 where 0 is this colour and 1 is the new colour -// Returns an RGB object -RGB.prototype.mix = function(c,f) -{ - return new RGB(this.r + (c.r-this.r) * f,this.g + (c.g-this.g) * f,this.b + (c.b-this.b) * f); -}; - -// Return an rgb colour as a #rrggbb format hex string -RGB.prototype.toString = function() -{ - var clamp = function(x,min,max) { - return x < min ? min : (x > max ? max : x); - }; - return "#" + - ("0" + Math.floor(clamp(this.r,0,1) * 255).toString(16)).right(2) + - ("0" + Math.floor(clamp(this.g,0,1) * 255).toString(16)).right(2) + - ("0" + Math.floor(clamp(this.b,0,1) * 255).toString(16)).right(2); -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Refresh.js b/editions/tw2/source/tiddlywiki/js/Refresh.js deleted file mode 100755 index 5857aa16f..000000000 --- a/editions/tw2/source/tiddlywiki/js/Refresh.js +++ /dev/null @@ -1,192 +0,0 @@ -//-- -//-- Refresh mechanism -//-- - -//# List of notification functions to be called when certain tiddlers are changed or deleted -config.notifyTiddlers = [ - {name: "SystemSettings", notify: onSystemSettingsChange}, - {name: "StyleSheetLayout", notify: refreshStyles}, - {name: "StyleSheetColors", notify: refreshStyles}, - {name: "StyleSheet", notify: refreshStyles}, - {name: "StyleSheetPrint", notify: refreshStyles}, - {name: "PageTemplate", notify: refreshPageTemplate}, - {name: "SiteTitle", notify: refreshPageTitle}, - {name: "SiteSubtitle", notify: refreshPageTitle}, - {name: "WindowTitle", notify: refreshPageTitle}, - {name: "ColorPalette", notify: refreshColorPalette}, - {name: null, notify: refreshDisplay} -]; - -//# refresher functions -config.refreshers = { - link: function(e,changeList) - { - var title = e.getAttribute("tiddlyLink"); - refreshTiddlyLink(e,title); - return true; - }, - - tiddler: function(e,changeList) - { - var title = e.getAttribute("tiddler"); - var template = e.getAttribute("template"); - if(changeList && (changeList.indexOf && changeList.indexOf(title) != -1) && !story.isDirty(title)) - story.refreshTiddler(title,template,true); - else - refreshElements(e,changeList); - return true; - }, - - content: function(e,changeList) - { - var title = e.getAttribute("tiddler"); - var force = e.getAttribute("force"); - var args = e.getAttribute("args"); - if(force != null || changeList == null || (changeList.indexOf && changeList.indexOf(title) != -1)) { - jQuery(e).empty(); - config.macros.tiddler.transclude(e,title,args); - return true; - } else - return false; - }, - - macro: function(e,changeList) - { - var macro = e.getAttribute("macroName"); - var params = e.getAttribute("params"); - if(macro) - macro = config.macros[macro]; - if(macro && macro.refresh) - macro.refresh(e,params); - return true; - } -}; - -config.refresherData = { - styleSheet: "StyleSheet", - defaultStyleSheet: "StyleSheet", - pageTemplate: "PageTemplate", - defaultPageTemplate: "PageTemplate", - colorPalette: "ColorPalette", - defaultColorPalette: "ColorPalette" -}; - -function refreshElements(root,changeList) -{ - var c,nodes = root.childNodes; - for(c=0; c").appendTo("body").hide()[0]; - var display = story.getContainer(); - var nodes,t; - if(display) { - nodes = display.childNodes; - for(t=nodes.length-1; t>=0; t--) - stash.appendChild(nodes[t]); - } - var wrapper = document.getElementById("contentWrapper"); - - var isAvailable = function(title) { - var s = title ? title.indexOf(config.textPrimitives.sectionSeparator) : -1; - if(s!=-1) - title = title.substr(0,s); - return store.tiddlerExists(title) || store.isShadowTiddler(title); - }; - //# protect against non-existent pageTemplate - if(!title || !isAvailable(title)) - title = config.refresherData.pageTemplate; - if(!isAvailable(title)) - title = config.refresherData.defaultPageTemplate; //# this one is always avaialable - wrapper.innerHTML = store.getRecursiveTiddlerText(title,null,10); - applyHtmlMacros(wrapper); - refreshElements(wrapper); - display = story.getContainer(); - jQuery(display).empty(); - if(!display) - display = createTiddlyElement(wrapper,"div",story.containerId()); - nodes = stash.childNodes; - for(t=nodes.length-1; t>=0; t--) - display.appendChild(nodes[t]); - jQuery(stash).remove(); -} - -function refreshDisplay(hint) -{ - if(typeof hint == "string") - hint = [hint]; - var e = document.getElementById("contentWrapper"); - refreshElements(e,hint); - if(backstage.isPanelVisible()) { - e = document.getElementById("backstage"); - refreshElements(e,hint); - } -} - -function refreshPageTitle() -{ - document.title = getPageTitle(); -} - -function getPageTitle() -{ - return wikifyPlainText(store.getTiddlerText("WindowTitle",""),null,tiddler); -} - -function refreshStyles(title,doc) -{ - setStylesheet(title == null ? "" : store.getRecursiveTiddlerText(title,"",10),title,doc || document); -} - -function refreshColorPalette(title) -{ - if(!startingUp) - refreshAll(); -} - -function refreshAll() -{ - refreshPageTemplate(); - refreshDisplay(); - refreshStyles("StyleSheetLayout"); - refreshStyles("StyleSheetColors"); - refreshStyles(config.refresherData.styleSheet); - refreshStyles("StyleSheetPrint"); -} - diff --git a/editions/tw2/source/tiddlywiki/js/Saving.js b/editions/tw2/source/tiddlywiki/js/Saving.js deleted file mode 100755 index 1051c99ef..000000000 --- a/editions/tw2/source/tiddlywiki/js/Saving.js +++ /dev/null @@ -1,248 +0,0 @@ -//-- -//-- Saving -//-- - -var saveUsingSafari = false; - -var startSaveArea = '
      '; // Split up into two so that indexOf() of this source doesn't find it -var startSaveAreaRE = /<((div)|(DIV)) ((id)|(ID))=["']?storeArea['"]?>/; // Used for IE6 -var endSaveArea = ''; -var endSaveAreaCaps = ''; - -// If there are unsaved changes, force the user to confirm before exitting -function confirmExit() -{ - hadConfirmExit = true; - if((store && store.isDirty && store.isDirty()) || (story && story.areAnyDirty && story.areAnyDirty())) - return config.messages.confirmExit; -} - -// Give the user a chance to save changes before exitting -function checkUnsavedChanges() -{ - if(store && store.isDirty && store.isDirty() && window.hadConfirmExit === false) { - if(confirm(config.messages.unsavedChangesWarning)) - saveChanges(); - } -} - -function updateLanguageAttribute(s) -{ - if(config.locale) { - var mRE = /(/; - var m = mRE.exec(s); - if(m) { - var t = m[1]; - if(m[2]) - t += ' xml:lang="' + config.locale + '"'; - if(m[3]) - t += ' lang="' + config.locale + '"'; - t += ">"; - s = s.substr(0,m.index) + t + s.substr(m.index+m[0].length); - } - } - return s; -} - -function updateMarkupBlock(s,blockName,tiddlerName) -{ - return s.replaceChunk( - "".format([blockName]), - "".format([blockName]), - "\n" + convertUnicodeToFileFormat(store.getRecursiveTiddlerText(tiddlerName,"")) + "\n"); -} - -function updateOriginal(original,posDiv,localPath) -{ - if(!posDiv) - posDiv = locateStoreArea(original); - if(!posDiv) { - alert(config.messages.invalidFileError.format([localPath])); - return null; - } - var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" + - convertUnicodeToFileFormat(store.allTiddlersAsHtml()) + "\n" + - original.substr(posDiv[1]); - var newSiteTitle = convertUnicodeToFileFormat(getPageTitle()).htmlEncode(); - revised = revised.replaceChunk("",""," " + newSiteTitle + " "); - revised = updateLanguageAttribute(revised); - revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead"); - revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead"); - revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody"); - revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody"); - return revised; -} - -function locateStoreArea(original) -{ - // Locate the storeArea divs - if(!original) - return null; - var posOpeningDiv = original.search(startSaveAreaRE); - var limitClosingDiv = original.indexOf("<"+"!--POST-STOREAREA--"+">"); - if(limitClosingDiv == -1) - limitClosingDiv = original.indexOf("<"+"!--POST-BODY-START--"+">"); - var start = limitClosingDiv == -1 ? original.length : limitClosingDiv; - var posClosingDiv = original.lastIndexOf(endSaveArea,start); - if(posClosingDiv == -1) - posClosingDiv = original.lastIndexOf(endSaveAreaCaps,start); - return (posOpeningDiv != -1 && posClosingDiv != -1) ? [posOpeningDiv,posClosingDiv] : null; -} - -function autoSaveChanges(onlyIfDirty,tiddlers) -{ - if(config.options.chkAutoSave) - saveChanges(onlyIfDirty,tiddlers); -} - -function loadOriginal(localPath) -{ - return loadFile(localPath); -} - -// Save this tiddlywiki with the pending changes -function saveChanges(onlyIfDirty,tiddlers) -{ - if(onlyIfDirty && !store.isDirty()) - return; - clearMessage(); - var t0 = new Date(); - var msg = config.messages; - //# Get the URL of the document - var originalPath = document.location.toString(); - //# Check we were loaded from a file URL - if(originalPath.substr(0,5) != "file:") { - alert(msg.notFileUrlError); - if(store.tiddlerExists(msg.saveInstructions)) - story.displayTiddler(null,msg.saveInstructions); - return; - } - var localPath = getLocalPath(originalPath); - //# Load the original file - var original = loadOriginal(localPath); - if(original == null) { - alert(msg.cantSaveError); - if(store.tiddlerExists(msg.saveInstructions)) - story.displayTiddler(null,msg.saveInstructions); - return; - } - //# Locate the storeArea div's - var posDiv = locateStoreArea(original); - if(!posDiv) { - alert(msg.invalidFileError.format([localPath])); - return; - } - saveMain(localPath,original,posDiv); - if(config.options.chkSaveBackups) - saveBackup(localPath,original); - if(config.options.chkSaveEmptyTemplate) - saveEmpty(localPath,original,posDiv); - if(config.options.chkGenerateAnRssFeed && saveRss instanceof Function) - saveRss(localPath); - if(config.options.chkDisplayInstrumentation) - displayMessage("saveChanges " + (new Date()-t0) + " ms"); -} - -function saveMain(localPath,original,posDiv) -{ - var save; - try { - //# Save new file - var revised = updateOriginal(original,posDiv,localPath); - save = saveFile(localPath,revised); - } catch (ex) { - showException(ex); - } - if(save) { - displayMessage(config.messages.mainSaved,"file://" + localPath); - store.setDirty(false); - } else { - alert(config.messages.mainFailed); - } -} - -function saveBackup(localPath,original) -{ - //# Save the backup - var backupPath = getBackupPath(localPath); - var backup = copyFile(backupPath,localPath); - //# Browser does not support copy, so use save instead - if(!backup) - backup = saveFile(backupPath,original); - if(backup) - displayMessage(config.messages.backupSaved,"file://" + backupPath); - else - alert(config.messages.backupFailed); -} - -function saveEmpty(localPath,original,posDiv) -{ - //# Save empty template - var emptyPath,p; - if((p = localPath.lastIndexOf("/")) != -1) - emptyPath = localPath.substr(0,p) + "/"; - else if((p = localPath.lastIndexOf("\\")) != -1) - emptyPath = localPath.substr(0,p) + "\\"; - else - emptyPath = localPath + "."; - emptyPath += "empty.html"; - var empty = original.substr(0,posDiv[0] + startSaveArea.length) + original.substr(posDiv[1]); - var emptySave = saveFile(emptyPath,empty); - if(emptySave) - displayMessage(config.messages.emptySaved,"file://" + emptyPath); - else - alert(config.messages.emptyFailed); -} - -function getLocalPath(origPath) -{ - var originalPath = convertUriToUTF8(origPath,config.options.txtFileSystemCharSet); - // Remove any location or query part of the URL - var argPos = originalPath.indexOf("?"); - if(argPos != -1) - originalPath = originalPath.substr(0,argPos); - var hashPos = originalPath.indexOf("#"); - if(hashPos != -1) - originalPath = originalPath.substr(0,hashPos); - // Convert file://localhost/ to file:/// - if(originalPath.indexOf("file://localhost/") == 0) - originalPath = "file://" + originalPath.substr(16); - // Convert to a native file format - //# "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..." - //# "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..." - //# "file:///path/path/path..." - mac/unix local file --> "/path/path/path..." - //# "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..." - var localPath; - if(originalPath.charAt(9) == ":") // pc local file - localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file - localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file:///") == 0) // mac/unix local file - localPath = unescape(originalPath.substr(7)); - else if(originalPath.indexOf("file:/") == 0) // mac/unix local file - localPath = unescape(originalPath.substr(5)); - else // pc network file - localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\"); - return localPath; -} - -function getBackupPath(localPath,title,extension) -{ - var slash = "\\"; - var dirPathPos = localPath.lastIndexOf("\\"); - if(dirPathPos == -1) { - dirPathPos = localPath.lastIndexOf("/"); - slash = "/"; - } - var backupFolder = config.options.txtBackupFolder; - if(!backupFolder || backupFolder == "") - backupFolder = "."; - var backupPath = localPath.substr(0,dirPathPos) + slash + backupFolder + localPath.substr(dirPathPos); - backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "."; - //# replace illegal filename characters(// \/:*?"<>|) and space with underscore - if(title) - backupPath += title.replace(/[\\\/\*\?\":<> ]/g,"_") + "."; - backupPath += (new Date()).convertToYYYYMMDDHHMMSSMMM() + "." + (extension || "html"); - return backupPath; -} - diff --git a/editions/tw2/source/tiddlywiki/js/SavingRSS.js b/editions/tw2/source/tiddlywiki/js/SavingRSS.js deleted file mode 100755 index 9f144d3c8..000000000 --- a/editions/tw2/source/tiddlywiki/js/SavingRSS.js +++ /dev/null @@ -1,57 +0,0 @@ -//-- -//-- RSS Saving -//-- - -function saveRss(localPath) -{ - var rssPath = localPath.substr(0,localPath.lastIndexOf(".")) + ".xml"; - if(saveFile(rssPath,convertUnicodeToFileFormat(generateRss()))) - displayMessage(config.messages.rssSaved,"file://" + rssPath); - else - alert(config.messages.rssFailed); -} - -tiddlerToRssItem = function(tiddler,uri) -{ - var s = "" + tiddler.title.htmlEncode() + "\n"; - s += "" + wikifyStatic(tiddler.text,null,tiddler).htmlEncode() + "\n"; - var i; - for(i=0; i\n"; - s += "" + uri + "#" + encodeURIComponent(String.encodeTiddlyLink(tiddler.title)) + "\n"; - s +="" + tiddler.modified.toGMTString() + "\n"; - return s; -}; - -function generateRss() -{ - var s = []; - var d = new Date(); - var u = store.getTiddlerText("SiteUrl"); - // Assemble the header - s.push("<" + "?xml version=\"1.0\"?" + ">"); - s.push(""); - s.push(""); - s.push("" + wikifyPlainText(store.getTiddlerText("SiteTitle",""),null,tiddler).htmlEncode() + ""); - if(u) - s.push("" + u.htmlEncode() + ""); - s.push("" + wikifyPlainText(store.getTiddlerText("SiteSubtitle",""),null,tiddler).htmlEncode() + ""); - s.push("" + config.locale + ""); - s.push("Copyright " + d.getFullYear() + " " + config.options.txtUserName.htmlEncode() + ""); - s.push("" + d.toGMTString() + ""); - s.push("" + d.toGMTString() + ""); - s.push("http://blogs.law.harvard.edu/tech/rss"); - s.push("TiddlyWiki " + formatVersion() + ""); - // The body - var tiddlers = store.getTiddlers("modified","excludeLists"); - var i,n = config.numRssItems > tiddlers.length ? 0 : tiddlers.length-config.numRssItems; - for(i=tiddlers.length-1; i>=n; i--) { - s.push("\n" + tiddlerToRssItem(tiddlers[i],u) + "\n"); - } - // And footer - s.push(""); - s.push(""); - // Save it all - return s.join("\n"); -} - diff --git a/editions/tw2/source/tiddlywiki/js/Scroller.js b/editions/tw2/source/tiddlywiki/js/Scroller.js deleted file mode 100755 index ef7c004e9..000000000 --- a/editions/tw2/source/tiddlywiki/js/Scroller.js +++ /dev/null @@ -1,10 +0,0 @@ -//-- -//-- Scroller animation -//-- - -function Scroller(targetElement) -{ - var p = [{style: '-tw-vertScroll', start: findScrollY(), end: ensureVisible(targetElement)}]; - return new Morpher(targetElement,config.animDuration,p); -} - diff --git a/editions/tw2/source/tiddlywiki/js/Search.js b/editions/tw2/source/tiddlywiki/js/Search.js deleted file mode 100755 index 55fbd8e5c..000000000 --- a/editions/tw2/source/tiddlywiki/js/Search.js +++ /dev/null @@ -1,81 +0,0 @@ -//-- -//-- Search macro -//-- - -config.macros.search.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - params = paramString.parseParams("anon",null,false,false,false); - createTiddlyButton(place,this.label,this.prompt,this.onClick,"searchButton"); - var txt = createTiddlyElement(null,"input",null,"txtOptionInput searchField"); - txt.value = getParam(params,"anon",""); - if(config.browser.isSafari) { - txt.setAttribute("type","search"); - txt.setAttribute("results","5"); - } else { - txt.setAttribute("type","text"); - } - place.appendChild(txt); - txt.onkeyup = this.onKeyPress; - txt.onfocus = this.onFocus; - txt.setAttribute("size",this.sizeTextbox); - txt.setAttribute("accessKey",getParam(params,"accesskey",this.accessKey)); - txt.setAttribute("autocomplete","off"); - txt.setAttribute("lastSearchText",""); - txt.setAttribute("placeholder",getParam(params,"placeholder",this.placeholder)); -}; - -// Global because there's only ever one outstanding incremental search timer -config.macros.search.timeout = null; - -config.macros.search.doSearch = function(txt) -{ - if(txt.value.length > 0) { - story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch); - txt.setAttribute("lastSearchText",txt.value); - } -}; - -config.macros.search.onClick = function(e) -{ - config.macros.search.doSearch(this.nextSibling); - return false; -}; - -config.macros.search.onKeyPress = function(ev) -{ - var me = config.macros.search; - var e = ev || window.event; - switch(e.keyCode) { - case 9: // Tab - return; - case 13: // Ctrl-Enter - case 10: // Ctrl-Enter on IE PC - me.doSearch(this); - break; - case 27: // Escape - this.value = ""; - clearMessage(); - break; - } - if(config.options.chkIncrementalSearch) { - if(this.value.length > 2) { - if(this.value != this.getAttribute("lastSearchText")) { - if(me.timeout) { - clearTimeout(me.timeout); - } - var txt = this; - me.timeout = setTimeout(function() {me.doSearch(txt);},500); - } - } else { - if(me.timeout) { - clearTimeout(me.timeout); - } - } - } -}; - -config.macros.search.onFocus = function(e) -{ - this.select(); -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Slider.js b/editions/tw2/source/tiddlywiki/js/Slider.js deleted file mode 100755 index 9871dbbb3..000000000 --- a/editions/tw2/source/tiddlywiki/js/Slider.js +++ /dev/null @@ -1,35 +0,0 @@ -//-- -//-- Slider animation -//-- - -// deleteMode - "none", "all" [delete target element and it's children], [only] "children" [but not the target element] -function Slider(element,opening,unused,deleteMode) -{ - element.style.overflow = 'hidden'; - if(opening) - element.style.height = '0px'; // Resolves a Firefox flashing bug - element.style.display = 'block'; - var height = element.scrollHeight; - var p = []; - var c = null; - if(opening) { - p.push({style: 'height', start: 0, end: height, template: '%0px', atEnd: 'auto'}); - p.push({style: 'opacity', start: 0, end: 1, template: '%0'}); - p.push({style: 'filter', start: 0, end: 100, template: 'alpha(opacity:%0)'}); - } else { - p.push({style: 'height', start: height, end: 0, template: '%0px'}); - p.push({style: 'display', atEnd: 'none'}); - p.push({style: 'opacity', start: 1, end: 0, template: '%0'}); - p.push({style: 'filter', start: 100, end: 0, template: 'alpha(opacity:%0)'}); - switch(deleteMode) { - case "all": - c = function(element,properties) {jQuery(element).remove();}; - break; - case "children": - c = function(element,properties) {jQuery(element).empty();}; - break; - } - } - return new Morpher(element,config.animDuration,p,c); -} - diff --git a/editions/tw2/source/tiddlywiki/js/Sparkline.js b/editions/tw2/source/tiddlywiki/js/Sparkline.js deleted file mode 100755 index 3bb5235fe..000000000 --- a/editions/tw2/source/tiddlywiki/js/Sparkline.js +++ /dev/null @@ -1,56 +0,0 @@ -//-- -//-- Sparklines -//-- - -config.macros.sparkline = {}; - -config.shadowTiddlers.StyleSheetSparklines = "/*{{{*/\n" + - ".sparkline {\n" + - "\tline-height: 1em;\n" + - "\tborder: 0;\n" + - "\tbackground: [[ColorPalette::PrimaryPale]];\n" + - "}\n\n" + - ".sparktick {\n" + - "\toutline: 0;\n" + - "\tbackground: [[ColorPalette::PrimaryDark]];\n" + - "}\n" + - "/*}}}*/"; -store.addNotification("StyleSheetSparklines", refreshStyles); - -config.macros.sparkline.handler = function(place,macroName,params) -{ - var data = []; - var min = 0; - var max = 0; - var v; - for(var t=0; t max) - max = v; - data.push(v); - } - if(data.length < 1) - return; - var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160)); - box.title = data.join(","); - var w = box.offsetWidth; - var h = box.offsetHeight; - box.style.paddingRight = (data.length * 2 - w) + "px"; - box.style.position = "relative"; - for(var d=0; d=0;t--) - this.displayTiddler(srcElement,titles[t],template,animate,unused,customFields); -}; - -//# Display a given tiddler with a given template. If the tiddler is already displayed but with a different -//# template, it is switched to the specified template. If the tiddler does not exist, and if server hosting -//# custom fields were provided, then an attempt is made to retrieve the tiddler from the server -//# srcElement - reference to element from which this one is being opened -or- -//# special positions "top", "bottom" -//# tiddler - tiddler or title of tiddler to display -//# template - the name of the tiddler containing the template -or- -//# one of the constants DEFAULT_VIEW_TEMPLATE and DEFAULT_EDIT_TEMPLATE -or- -//# null or undefined to indicate the current template if there is one, DEFAULT_VIEW_TEMPLATE if not -//# animate - whether to perform animations -//# customFields - an optional list of name:"value" pairs to be assigned as tiddler fields (for edit templates) -//# toggle - if true, causes the tiddler to be closed if it is already opened -//# animationSrc - optional. If provided, this will specify the element which is to act as the start of the animation -or- -//# the source of the animation will be the srcElement. -Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle,animationSrc) -{ - var title = (tiddler instanceof Tiddler) ? tiddler.title : tiddler; - var tiddlerElem = this.getTiddler(title); - if(tiddlerElem) { - if(toggle) { - if(tiddlerElem.getAttribute("dirty") != "true") - this.closeTiddler(title,true); - } else { - this.refreshTiddler(title,template,false,customFields); - } - } else { - var place = this.getContainer(); - var before = this.positionTiddler(srcElement); - tiddlerElem = this.createTiddler(place,before,title,template,customFields); - } - if(animationSrc && typeof animationSrc !== "string") { - srcElement = animationSrc; - } - if(srcElement && typeof srcElement !== "string") { - if(config.options.chkAnimate && (animate == undefined || animate == true) && anim && typeof Zoomer == "function" && typeof Scroller == "function") - anim.startAnimating(new Zoomer(title,srcElement,tiddlerElem),new Scroller(tiddlerElem)); - else - window.scrollTo(0,ensureVisible(tiddlerElem)); - } - return tiddlerElem; -}; - -//# Figure out the appropriate position for a newly opened tiddler -//# srcElement - reference to the element containing the link to the tiddler -or- -//# special positions "top", "bottom" -//# returns - reference to the tiddler that the new one should appear before (null for the bottom of the story) -Story.prototype.positionTiddler = function(srcElement) -{ - var place = this.getContainer(); - var before = null; - if(typeof srcElement == "string") { - switch(srcElement) { - case "top": - before = place.firstChild; - break; - case "bottom": - before = null; - break; - } - } else { - var after = this.findContainingTiddler(srcElement); - if(after == null) { - before = place.firstChild; - } else if(after.nextSibling) { - before = after.nextSibling; - if(before.nodeType != 1) - before = null; - } - } - return before; -}; - -//# Create a tiddler frame at the appropriate place in a story column. If the tiddler doesn't exist, -//# triggers an attempt to load it as a missing tiddler -//# place - reference to parent element -//# before - null, or reference to element before which to insert new tiddler -//# title - title of new tiddler -//# template - the name of the tiddler containing the template or one of the constants DEFAULT_VIEW_TEMPLATE and DEFAULT_EDIT_TEMPLATE -//# customFields - an optional list of name:"value" pairs to be assigned as tiddler fields -Story.prototype.createTiddler = function(place,before,title,template,customFields) -{ - var tiddlerElem = createTiddlyElement(null,"div",this.tiddlerId(title),"tiddler"); - tiddlerElem.setAttribute("refresh","tiddler"); - if(customFields) - tiddlerElem.setAttribute("tiddlyFields",customFields); - place.insertBefore(tiddlerElem,before); - var defaultText = null; - if(!store.tiddlerExists(title) && !store.isShadowTiddler(title)) - defaultText = this.loadMissingTiddler(title,customFields); - this.refreshTiddler(title,template,false,customFields,defaultText); - return tiddlerElem; -}; - -//# Attempts to load a missing tiddler from the server specified in the custom fields -//# title - title of the missing tiddler -//# fields - string of name:"value" pairs or hashmap -//# callback - optional function invoked with context argument upon completion; context provides context.tiddler if successful -Story.prototype.loadMissingTiddler = function(title,fields,callback) -{ - var getTiddlerCallback = function(context) - { - if(context.status) { - var t = context.tiddler; - if(!t.created) - t.created = new Date(); - if(!t.modified) - t.modified = t.created; - context.tiddler = store.saveTiddler(t.title,t.title,t.text,t.modifier,t.modified,t.tags,t.fields,true,t.created,t.creator); - autoSaveChanges(); - } else { - story.refreshTiddler(context.title,null,true); - } - context.adaptor.close(); - if(callback) { - callback(context); - } - }; - var tiddler = new Tiddler(title); - tiddler.fields = typeof fields == "string" ? fields.decodeHashMap() : fields||{}; - var context = {serverType:tiddler.getServerType()}; - if(!context.serverType) - return ""; - context.host = tiddler.fields['server.host']; - context.workspace = tiddler.fields['server.workspace']; - var adaptor = new config.adaptors[context.serverType](); - adaptor.getTiddler(title,context,null,getTiddlerCallback); - return config.messages.loadingMissingTiddler.format([title,context.serverType,context.host,context.workspace]); -}; - -//# Overridable for choosing the name of the template to apply for a tiddler -Story.prototype.chooseTemplateForTiddler = function(title,template) -{ - if(!template) - template = DEFAULT_VIEW_TEMPLATE; - if(template == DEFAULT_VIEW_TEMPLATE || template == DEFAULT_EDIT_TEMPLATE) - template = config.tiddlerTemplates[template]; - return template; -}; - -//# Overridable for extracting the text of a template from a tiddler -Story.prototype.getTemplateForTiddler = function(title,template,tiddler) -{ - return store.getRecursiveTiddlerText(template,null,10); -}; - -//# Apply a template to an existing tiddler if it is not already displayed using that template -//# title - title of tiddler to update -//# template - the name of the tiddler containing the template or one of the constants DEFAULT_VIEW_TEMPLATE and DEFAULT_EDIT_TEMPLATE -//# force - if true, forces the refresh even if the template hasn't changed -//# customFields - an optional list of name/value pairs to be assigned as tiddler fields (for edit templates) -//# defaultText - an optional string to replace the default text for non-existent tiddlers -Story.prototype.refreshTiddler = function(title,template,force,customFields,defaultText) -{ - var tiddlerElem = this.getTiddler(title); - if(tiddlerElem) { - if(tiddlerElem.getAttribute("dirty") == "true" && !force) - return tiddlerElem; - template = this.chooseTemplateForTiddler(title,template); - var currTemplate = tiddlerElem.getAttribute("template"); - if((template != currTemplate) || force) { - var tiddler = store.getTiddler(title); - if(!tiddler) { - tiddler = new Tiddler(); - if(store.isShadowTiddler(title)) { - var tags = []; - tiddler.set(title,store.getTiddlerText(title),config.views.wikified.shadowModifier,version.date,tags,version.date); - } else { - var text = template=="EditTemplate" ? - config.views.editor.defaultText.format([title]) : - config.views.wikified.defaultText.format([title]); - text = defaultText || text; - var fields = customFields ? customFields.decodeHashMap() : null; - tiddler.set(title,text,config.views.wikified.defaultModifier,version.date,[],version.date,fields); - } - } - tiddlerElem.setAttribute("tags",tiddler.tags.join(" ")); - tiddlerElem.setAttribute("tiddler",title); - tiddlerElem.setAttribute("template",template); - tiddlerElem.onmouseover = this.onTiddlerMouseOver; - tiddlerElem.onmouseout = this.onTiddlerMouseOut; - tiddlerElem.ondblclick = this.onTiddlerDblClick; - tiddlerElem[window.event?"onkeydown":"onkeypress"] = this.onTiddlerKeyPress; - tiddlerElem.innerHTML = this.getTemplateForTiddler(title,template,tiddler); - applyHtmlMacros(tiddlerElem,tiddler); - if(store.getTaggedTiddlers(title).length > 0) - jQuery(tiddlerElem).addClass("isTag"); - else - jQuery(tiddlerElem).removeClass("isTag"); - if(store.tiddlerExists(title)) { - jQuery(tiddlerElem).removeClass("shadow"); - jQuery(tiddlerElem).removeClass("missing"); - } else { - jQuery(tiddlerElem).addClass(store.isShadowTiddler(title) ? "shadow" : "missing"); - } - if(customFields) - this.addCustomFields(tiddlerElem,customFields); - } - } - return tiddlerElem; -}; - -//# Add hidden input elements for the custom fields of a tiddler -Story.prototype.addCustomFields = function(place,customFields) -{ - var fields = customFields.decodeHashMap(); - var w = createTiddlyElement(place,"div",null,"customFields"); - w.style.display = "none"; - var t; - for(t in fields) { - var e = document.createElement("input"); - e.setAttribute("type","text"); - e.setAttribute("value",fields[t]); - w.appendChild(e); - e.setAttribute("edit",t); - } -}; - -//# Refresh all tiddlers in the Story -Story.prototype.refreshAllTiddlers = function(force) -{ - var e = this.getContainer().firstChild; - while(e) { - var template = e.getAttribute("template"); - if(template && e.getAttribute("dirty") != "true") { - this.refreshTiddler(e.getAttribute("tiddler"),force ? null : template,true); - } - e = e.nextSibling; - } -}; - -//# Default tiddler onmouseover/out event handlers -Story.prototype.onTiddlerMouseOver = function(e) -{ - jQuery(this).addClass("selected"); -}; - -Story.prototype.onTiddlerMouseOut = function(e) -{ - jQuery(this).removeClass("selected"); -}; - -//# Default tiddler ondblclick event handler -Story.prototype.onTiddlerDblClick = function(ev) -{ - var e = ev || window.event; - var target = resolveTarget(e); - if(target && target.nodeName.toLowerCase() != "input" && target.nodeName.toLowerCase() != "textarea") { - if(document.selection && document.selection.empty) - document.selection.empty(); - config.macros.toolbar.invokeCommand(this,"defaultCommand",e); - e.cancelBubble = true; - if(e.stopPropagation) e.stopPropagation(); - return true; - } - return false; -}; - -Story.prototype.onTiddlerKeyPress = function(ev) -{ - var e = ev || window.event; - clearMessage(); - var consume = false; - var title = this.getAttribute("tiddler"); - var target = resolveTarget(e); - switch(e.keyCode) { - case 9: // Tab - var ed = story.getTiddlerField(title,"text"); - if(target.tagName.toLowerCase() == "input" && ed.value==config.views.editor.defaultText.format([title])) { - // moving from input field and editor still contains default text, so select it - ed.focus(); - ed.select(); - consume = true; - } - if(config.options.chkInsertTabs && target.tagName.toLowerCase() == "textarea") { - replaceSelection(target,String.fromCharCode(9)); - consume = true; - } - if(config.isOpera) { - target.onblur = function() { - this.focus(); - this.onblur = null; - }; - } - break; - case 13: // Ctrl-Enter - case 10: // Ctrl-Enter on IE PC - case 77: // Ctrl-Enter is "M" on some platforms - if(e.ctrlKey) { - blurElement(this); - config.macros.toolbar.invokeCommand(this,"defaultCommand",e); - consume = true; - } - break; - case 27: // Escape - blurElement(this); - config.macros.toolbar.invokeCommand(this,"cancelCommand",e); - consume = true; - break; - } - e.cancelBubble = consume; - if(consume) { - if(e.stopPropagation) e.stopPropagation(); // Stop Propagation - e.returnValue = true; // Cancel The Event in IE - if(e.preventDefault ) e.preventDefault(); // Cancel The Event in Moz - } - return !consume; -}; - -//# Returns the specified field (input or textarea element) in a tiddler, otherwise the first edit field it finds -//# or null if it found no edit field at all -Story.prototype.getTiddlerField = function(title,field) -{ - var tiddlerElem = this.getTiddler(title); - var e = null; - if(tiddlerElem) { - var t,children = tiddlerElem.getElementsByTagName("*"); - for(t=0; t 0) - displayMessage(config.macros.search.successMsg.format([matches.length.toString(),q + text + q])); - else - displayMessage(config.macros.search.failureMsg.format([q + text + q])); -}; - -//# Determine if the specified element is within a tiddler in this story -//# e - reference to an element -//# returns: reference to a tiddler element or null if none -Story.prototype.findContainingTiddler = function(e) -{ - while(e && !jQuery(e).hasClass("tiddler")) { - e = jQuery(e).hasClass("popup") && Popup.stack[0] ? Popup.stack[0].root : e.parentNode; - } - return e; -}; - -//# Gather any saveable fields from a tiddler element -//# e - reference to an element to scan recursively -//# fields - object to contain gathered field values -Story.prototype.gatherSaveFields = function(e,fields) -{ - if(e && e.getAttribute) { - var f = e.getAttribute("edit"); - if(f) - fields[f] = e.value.replace(/\r/mg,""); - if(e.hasChildNodes()) { - var t,c = e.childNodes; - for(t=0; t "backgroundColor") -String.prototype.unDash = function() -{ - var t,s = this.split("-"); - if(s.length > 1) { - for(t=1; t currPos) - r.push(this.substring(currPos,match.index)); - r.push(substrings[parseInt(match[1],10)]); - currPos = subRegExp.lastIndex; - } - } while(match); - if(currPos < this.length) - r.push(this.substring(currPos,this.length)); - return r.join(""); -}; - -// Escape any special RegExp characters with that character preceded by a backslash -String.prototype.escapeRegExp = function() -{ - var s = "\\^$*+?()=!|,{}[]."; - var t,c = this; - for(t=0; t to ">" and " to """ -String.prototype.htmlEncode = function() -{ - return this.replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,"""); -}; - -// Convert "&" to &, "<" to <, ">" to > and """ to " -String.prototype.htmlDecode = function() -{ - return this.replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\"").replace(/&/mg,"&"); -}; - -// Parse a space-separated string of name:value parameters -//# where: -//# - the name or the value can be optional (in which case separate defaults are used instead) -//# - in case of ambiguity, a lone word is taken to be a value -//# - if 'cascadeDefaults' is set to true, then the defaults are modified by updated by each specified name or value -//# - name prefixes are not allowed if the 'noNames' parameter is true -//# - if both the name and value are present they must be separated by a colon -//# - the name and the value may both be quoted with single- or double-quotes, double-square brackets -//# - names or values quoted with {{double-curly braces}} are evaluated as a JavaScript expression -//# - as long as the 'allowEval' parameter is true -// The result is an array of objects: -// result[0] = object with a member for each parameter name, value of that member being an array of values -// result[1..n] = one object for each parameter, with 'name' and 'value' members -String.prototype.parseParams = function(defaultName,defaultValue,allowEval,noNames,cascadeDefaults) -{ - var parseToken = function(match,p) { - var n; - if(match[p]) // Double quoted - n = match[p]; - else if(match[p+1]) // Single quoted - n = match[p+1]; - else if(match[p+2]) // Double-square-bracket quoted - n = match[p+2]; - else if(match[p+3]) // Double-brace quoted - try { - n = match[p+3]; - if(allowEval && config.evaluateMacroParameters != "none") { - if(config.evaluateMacroParameters == "restricted") { - if(window.restrictedEval) { - n = window.restrictedEval(n); - } - } else { - n = window.eval(n); - } - } - } catch(ex) { - throw "Unable to evaluate {{" + match[p+3] + "}}: " + exceptionText(ex); - } - else if(match[p+4]) // Unquoted - n = match[p+4]; - else if(match[p+5]) // empty quote - n = ""; - return n; - }; - var r = [{}]; - var dblQuote = "(?:\"((?:(?:\\\\\")|[^\"])+)\")"; - var sngQuote = "(?:'((?:(?:\\\\\')|[^'])+)')"; - var dblSquare = "(?:\\[\\[((?:\\s|\\S)*?)\\]\\])"; - var dblBrace = "(?:\\{\\{((?:\\s|\\S)*?)\\}\\})"; - var unQuoted = noNames ? "([^\"'\\s]\\S*)" : "([^\"':\\s][^\\s:]*)"; - var emptyQuote = "((?:\"\")|(?:''))"; - var skipSpace = "(?:\\s*)"; - var token = "(?:" + dblQuote + "|" + sngQuote + "|" + dblSquare + "|" + dblBrace + "|" + unQuoted + "|" + emptyQuote + ")"; - var re = noNames ? new RegExp(token,"mg") : new RegExp(skipSpace + token + skipSpace + "(?:(\\:)" + skipSpace + token + ")?","mg"); - var match; - do { - match = re.exec(this); - if(match) { - var n = parseToken(match,1); - if(noNames) { - r.push({name:"",value:n}); - } else { - var v = parseToken(match,8); - if(v == null && defaultName) { - v = n; - n = defaultName; - } else if(v == null && defaultValue) { - v = defaultValue; - } - r.push({name:n,value:v}); - if(cascadeDefaults) { - defaultName = n; - defaultValue = v; - } - } - } - } while(match); - // Summarise parameters into first element - var t; - for(t=1; t si.tiddler.fields['server.page.revision']) { - si.syncStatus = me.syncStatusList[si.isTouched ? 'changedBoth' : 'changedServer']; - } - } else { - si.syncStatus = me.syncStatusList.notFound; - } - me.updateSyncStatus(si); - } - return true; - }; - - var openWorkspaceCallback = function(context,syncItems) { - if(context.status) { - context.adaptor.getTiddlerList(context,syncItems,getTiddlerListCallback); - return true; - } - displayMessage(context.statusText); - return false; - }; - - var context = {host:st.serverHost,workspace:st.serverWorkspace}; - syncItem.adaptor.openHost(st.serverHost); - syncItem.adaptor.openWorkspace(st.serverWorkspace,context,st.syncItems,openWorkspaceCallback); - return st; -}; - -config.macros.sync.updateSyncStatus = function(syncItem) -{ - var e = syncItem.colElements["status"]; - jQuery(e).empty(); - createTiddlyText(e,syncItem.syncStatus.text); - syncItem.rowElement.style.display = syncItem.syncStatus.display; - if(syncItem.syncStatus.className) - syncItem.rowElement.className = syncItem.syncStatus.className; -}; - -config.macros.sync.doSync = function(e) -{ - var me = config.macros.sync; - var getTiddlerCallback = function(context,syncItem) { - if(syncItem) { - var tiddler = context.tiddler; - store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields,true,tiddler.created); - syncItem.syncStatus = me.syncStatusList.gotFromServer; - me.updateSyncStatus(syncItem); - } - }; - var putTiddlerCallback = function(context,syncItem) { - if(syncItem) { - store.resetTiddler(context.title); - syncItem.syncStatus = me.syncStatusList.putToServer; - me.updateSyncStatus(syncItem); - } - }; - - var rowNames = ListView.getSelectedRows(currSync.listView); - var i,sl = me.syncStatusList; - for(i=0; i= 0; i--) { - var name = attrs[i].name; - if(attrs[i].specified && !TiddlyWiki.isStandardField(name)) { - fields[name] = attrs[i].value.unescapeLineBreaks(); - } - } - tiddler.assign(title,text,modifier,modified,tags,created,fields,creator); - return tiddler; -}; - diff --git a/editions/tw2/source/tiddlywiki/js/TW21Saver.js b/editions/tw2/source/tiddlywiki/js/TW21Saver.js deleted file mode 100755 index 294a82e75..000000000 --- a/editions/tw2/source/tiddlywiki/js/TW21Saver.js +++ /dev/null @@ -1,42 +0,0 @@ -//-- -//-- TW21Saver (inherits from SaverBase) -//-- - -function TW21Saver() {} - -TW21Saver.prototype = new SaverBase(); - -TW21Saver.prototype.externalizeTiddler = function(store,tiddler) -{ - try { - var extendedAttributes = ""; - var usePre = config.options.chkUsePreForStorage; - store.forEachField(tiddler, - function(tiddler,fieldName,value) { - // don't store stuff from the temp namespace - if(typeof value != "string") - value = ""; - if(!fieldName.match(/^temp\./)) - extendedAttributes += ' %0="%1"'.format([fieldName,value.escapeLineBreaks().htmlEncode()]); - },true); - var created = tiddler.created; - var modified = tiddler.modified; - var attributes = tiddler.creator ? ' creator="' + tiddler.creator.htmlEncode() + '"' : ""; - attributes += tiddler.modifier ? ' modifier="' + tiddler.modifier.htmlEncode() + '"' : ""; - attributes += (usePre && created == version.date) ? "" :' created="' + created.convertToYYYYMMDDHHMM() + '"'; - attributes += (usePre && modified == created) ? "" : ' modified="' + modified.convertToYYYYMMDDHHMM() +'"'; - var tags = tiddler.getTags(); - if(!usePre || tags) - attributes += ' tags="' + tags.htmlEncode() + '"'; - return ('
      %4').format([ - usePre ? "title" : "tiddler", - tiddler.title.htmlEncode(), - attributes, - extendedAttributes, - usePre ? "\n
      " + tiddler.text.htmlEncode() + "
      \n" : tiddler.text.escapeLineBreaks().htmlEncode() - ]); - } catch (ex) { - throw exceptionText(ex,config.messages.tiddlerSaveError.format([tiddler.title])); - } -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Tabs.js b/editions/tw2/source/tiddlywiki/js/Tabs.js deleted file mode 100755 index cc9aebc03..000000000 --- a/editions/tw2/source/tiddlywiki/js/Tabs.js +++ /dev/null @@ -1,65 +0,0 @@ -//-- -//-- Tabs macro -//-- - -config.macros.tabs.handler = function(place,macroName,params) -{ - var cookie = params[0]; - var numTabs = (params.length-1)/3; - var wrapper = createTiddlyElement(null,"div",null,"tabsetWrapper " + cookie); - var tabset = createTiddlyElement(wrapper,"div",null,"tabset"); - tabset.setAttribute("cookie",cookie); - var validTab = false; - var t; - for(t=0; t 0; -}; - -// Change the text and other attributes of a tiddler -Tiddler.prototype.set = function(title,text,modifier,modified,tags,created,fields,creator) -{ - this.assign(title,text,modifier,modified,tags,created,fields,creator); - this.changed(); - return this; -}; - -// Change the text and other attributes of a tiddler without triggered a tiddler.changed() call -Tiddler.prototype.assign = function(title,text,modifier,modified,tags,created,fields,creator) -{ - if(title != undefined) - this.title = title; - if(text != undefined) - this.text = text; - if(modifier != undefined) - this.modifier = modifier; - if(modified != undefined) - this.modified = modified; - if(creator != undefined) - this.creator = creator; - if(created != undefined) - this.created = created; - if(fields != undefined) - this.fields = fields; - if(tags != undefined) - this.tags = (typeof tags == "string") ? tags.readBracketedList() : tags; - else if(this.tags == undefined) - this.tags = []; - return this; -}; - -// Get the tags for a tiddler as a string (space delimited, using [[brackets]] for tags containing spaces) -Tiddler.prototype.getTags = function() -{ - return String.encodeTiddlyLinkList(this.tags); -}; - -// Test if a tiddler carries a tag -Tiddler.prototype.isTagged = function(tag) -{ - return this.tags.indexOf(tag) != -1; -}; - -// Static method to convert "\n" to newlines, "\s" to "\" -Tiddler.unescapeLineBreaks = function(text) -{ - return text ? text.unescapeLineBreaks() : ""; -}; - -// Convert newlines to "\n", "\" to "\s" -Tiddler.prototype.escapeLineBreaks = function() -{ - return this.text.escapeLineBreaks(); -}; - -// Updates the secondary information (like links[] array) after a change to a tiddler -Tiddler.prototype.changed = function() -{ - this.links = []; - var text = this.text; - // remove 'quoted' text before scanning tiddler source - text = text.replace(/\/%((?:.|\n)*?)%\//g,""). - replace(/\{{3}((?:.|\n)*?)\}{3}/g,""). - replace(/"""((?:.|\n)*?)"""/g,""). - replace(/((?:.|\n)*?)<\/nowiki\>/g,""). - replace(/((?:.|\n)*?)<\/html\>/g,""). - replace(//g,""); - var t = this.autoLinkWikiWords() ? 0 : 1; - var tiddlerLinkRegExp = t==0 ? config.textPrimitives.tiddlerAnyLinkRegExp : config.textPrimitives.tiddlerForcedLinkRegExp; - tiddlerLinkRegExp.lastIndex = 0; - var formatMatch = tiddlerLinkRegExp.exec(text); - while(formatMatch) { - var lastIndex = tiddlerLinkRegExp.lastIndex; - if(t==0 && formatMatch[1] && formatMatch[1] != this.title) { - // wikiWordLink - if(formatMatch.index > 0) { - var preRegExp = new RegExp(config.textPrimitives.unWikiLink+"|"+config.textPrimitives.anyLetter,"mg"); - preRegExp.lastIndex = formatMatch.index-1; - var preMatch = preRegExp.exec(text); - if(preMatch.index != formatMatch.index-1) - this.links.pushUnique(formatMatch[1]); - } else { - this.links.pushUnique(formatMatch[1]); - } - } - else if(formatMatch[2-t] && !config.formatterHelpers.isExternalLink(formatMatch[3-t])) // titledBrackettedLink - this.links.pushUnique(formatMatch[3-t]); - else if(formatMatch[4-t] && formatMatch[4-t] != this.title) // brackettedLink - this.links.pushUnique(formatMatch[4-t]); - //# Do not add link if match urlPattern (formatMatch[5-t]) - tiddlerLinkRegExp.lastIndex = lastIndex; - formatMatch = tiddlerLinkRegExp.exec(text); - } - this.linksUpdated = true; -}; - -Tiddler.prototype.getSubtitle = function() -{ - var modifier = this.modifier; - if(!modifier) - modifier = config.messages.subtitleUnknown || ""; - var modified = this.modified; - if(modified) - modified = modified.toLocaleString(); - else - modified = config.messages.subtitleUnknown || ""; - var f = config.messages.tiddlerLinkTooltip || "%0 - %1, %2"; - return f.format([this.title,modifier,modified]); -}; - -Tiddler.prototype.isReadOnly = function() -{ - return readOnly; -}; - -Tiddler.prototype.autoLinkWikiWords = function() -{ - return !(this.isTagged("systemConfig") || this.isTagged("excludeMissing")); -}; - -Tiddler.prototype.getServerType = function() -{ - var serverType = null; - if(this.fields['server.type']) - serverType = this.fields['server.type']; - if(!serverType) - serverType = this.fields['wikiformat']; - if(serverType && !config.adaptors[serverType]) - serverType = null; - return serverType; -}; - -Tiddler.prototype.getAdaptor = function() -{ - var serverType = this.getServerType(); - return serverType ? new config.adaptors[serverType]() : null; -}; - diff --git a/editions/tw2/source/tiddlywiki/js/TiddlerFields.js b/editions/tw2/source/tiddlywiki/js/TiddlerFields.js deleted file mode 100755 index 338475459..000000000 --- a/editions/tw2/source/tiddlywiki/js/TiddlerFields.js +++ /dev/null @@ -1,173 +0,0 @@ -// Returns true if path is a valid field name (path), -// i.e. a sequence of identifiers, separated by "." -TiddlyWiki.isValidFieldName = function(name) -{ - var match = /[a-zA-Z_]\w*(\.[a-zA-Z_]\w*)*/.exec(name); - return match && (match[0] == name); -}; - -// Throws an exception when name is not a valid field name. -TiddlyWiki.checkFieldName = function(name) -{ - if(!TiddlyWiki.isValidFieldName(name)) - throw config.messages.invalidFieldName.format([name]); -}; - -function StringFieldAccess(n,readOnly) -{ - this.set = readOnly ? - function(t,v) {if(v != t[n]) throw config.messages.fieldCannotBeChanged.format([n]);} : - function(t,v) {if(v != t[n]) {t[n] = v; return true;}}; - this.get = function(t) {return t[n];}; -} - -function DateFieldAccess(n) -{ - this.set = function(t,v) { - var d = v instanceof Date ? v : Date.convertFromYYYYMMDDHHMM(v); - if(d != t[n]) { - t[n] = d; return true; - } - }; - this.get = function(t) {return t[n].convertToYYYYMMDDHHMM();}; -} - -function LinksFieldAccess(n) -{ - this.set = function(t,v) { - var s = (typeof v == "string") ? v.readBracketedList() : v; - if(s.toString() != t[n].toString()) { - t[n] = s; return true; - } - }; - this.get = function(t) {return String.encodeTiddlyLinkList(t[n]);}; -} - -TiddlyWiki.standardFieldAccess = { - // The set functions return true when setting the data has changed the value. - "title": new StringFieldAccess("title",true), - // Handle the "tiddler" field name as the title - "tiddler": new StringFieldAccess("title",true), - "text": new StringFieldAccess("text"), - "modifier": new StringFieldAccess("modifier"), - "modified": new DateFieldAccess("modified"), - "creator": new StringFieldAccess("creator"), - "created": new DateFieldAccess("created"), - "tags": new LinksFieldAccess("tags") -}; - -TiddlyWiki.isStandardField = function(name) -{ - return TiddlyWiki.standardFieldAccess[name] != undefined; -}; - -// Sets the value of the given field of the tiddler to the value. -// Setting an ExtendedField's value to null or undefined removes the field. -// Setting a namespace to undefined removes all fields of that namespace. -// The fieldName is case-insensitive. -// All values will be converted to a string value. -TiddlyWiki.prototype.setValue = function(tiddler,fieldName,value) -{ - TiddlyWiki.checkFieldName(fieldName); - var t = this.resolveTiddler(tiddler); - if(!t) - return; - fieldName = fieldName.toLowerCase(); - var isRemove = (value === undefined) || (value === null); - var accessor = TiddlyWiki.standardFieldAccess[fieldName]; - if(accessor) { - if(isRemove) - // don't remove StandardFields - return; - var h = TiddlyWiki.standardFieldAccess[fieldName]; - if(!h.set(t,value)) - return; - } else { - var oldValue = t.fields[fieldName]; - if(isRemove) { - if(oldValue !== undefined) { - // deletes a single field - delete t.fields[fieldName]; - } else { - // no concrete value is defined for the fieldName - // so we guess this is a namespace path. - // delete all fields in a namespace - var re = new RegExp("^"+fieldName+"\\."); - var dirty = false; - var n; - for(n in t.fields) { - if(n.match(re)) { - delete t.fields[n]; - dirty = true; - } - } - if(!dirty) - return; - } - } else { - // the "normal" set case. value is defined (not null/undefined) - // For convenience provide a nicer conversion Date->String - value = value instanceof Date ? value.convertToYYYYMMDDHHMMSSMMM() : String(value); - if(oldValue == value) - return; - t.fields[fieldName] = value; - } - } - // When we are here the tiddler/store really was changed. - this.notify(t.title,true); - if(!fieldName.match(/^temp\./)) - this.setDirty(true); -}; - -// Returns the value of the given field of the tiddler. -// The fieldName is case-insensitive. -// Will only return String values (or undefined). -TiddlyWiki.prototype.getValue = function(tiddler,fieldName) -{ - var t = this.resolveTiddler(tiddler); - if(!t) - return undefined; - if(fieldName.indexOf(config.textPrimitives.sectionSeparator) === 0 || fieldName.indexOf(config.textPrimitives.sliceSeparator) === 0) { - var sliceType = fieldName.substr(0, 2); - var sliceName = fieldName.substring(2); - return store.getTiddlerText("%0%1%2".format(t.title,sliceType,sliceName)); - } else { - fieldName = fieldName.toLowerCase(); - var accessor = TiddlyWiki.standardFieldAccess[fieldName]; - if(accessor) { - return accessor.get(t); - } - } - return t.fields[fieldName]; -}; - -// Calls the callback function for every field in the tiddler. -// When callback function returns a non-false value the iteration stops -// and that value is returned. -// The order of the fields is not defined. -// @param callback a function(tiddler,fieldName,value). -TiddlyWiki.prototype.forEachField = function(tiddler,callback,onlyExtendedFields) -{ - var t = this.resolveTiddler(tiddler); - if(!t) - return undefined; - var n,result; - for(n in t.fields) { - result = callback(t,n,t.fields[n]); - if(result) - return result; - } - if(onlyExtendedFields) - return undefined; - for(n in TiddlyWiki.standardFieldAccess) { - if(n != "tiddler") { - // even though the "title" field can also be referenced through the name "tiddler" - // we only visit this field once. - result = callback(t,n,TiddlyWiki.standardFieldAccess[n].get(t)); - if(result) - return result; - } - } - return undefined; -}; - diff --git a/editions/tw2/source/tiddlywiki/js/TiddlyWiki.js b/editions/tw2/source/tiddlywiki/js/TiddlyWiki.js deleted file mode 100755 index 0249ef395..000000000 --- a/editions/tw2/source/tiddlywiki/js/TiddlyWiki.js +++ /dev/null @@ -1,645 +0,0 @@ -//-- -//-- TiddlyWiki instance contains TiddlerS -//-- - -function TiddlyWiki(params) -{ - var tiddlers = {}; // Hashmap by name of tiddlers - if(params && params.config) { - this.config = config; - } - this.tiddlersUpdated = false; - this.namedNotifications = []; // Array of {name:,notify:} of notification functions - this.notificationLevel = 0; - this.slices = {}; // map tiddlerName->(map sliceName->sliceValue). Lazy. - this.clear = function() { - tiddlers = {}; - this.setDirty(false); - }; - this.fetchTiddler = function(title) { - var t = tiddlers[title]; - return t instanceof Tiddler ? t : null; - }; - this.deleteTiddler = function(title) { - delete this.slices[title]; - delete tiddlers[title]; - }; - this.addTiddler = function(tiddler) { - delete this.slices[tiddler.title]; - tiddlers[tiddler.title] = tiddler; - }; - this.forEachTiddler = function(callback) { - var t; - for(t in tiddlers) { - var tiddler = tiddlers[t]; - if(tiddler instanceof Tiddler) - callback.call(this,t,tiddler); - } - }; -} - -//# Set the dirty flag -TiddlyWiki.prototype.setDirty = function(dirty) -{ - this.dirty = dirty; -}; - -TiddlyWiki.prototype.isDirty = function() -{ - return this.dirty; -}; - -TiddlyWiki.prototype.tiddlerExists = function(title) -{ - var t = this.fetchTiddler(title); - return t != undefined; -}; - -TiddlyWiki.prototype.isShadowTiddler = function(title) -{ - return config.shadowTiddlers[title] === undefined ? false : true; -}; - -TiddlyWiki.prototype.createTiddler = function(title) -{ - var tiddler = this.fetchTiddler(title); - if(!tiddler) { - tiddler = new Tiddler(title); - this.addTiddler(tiddler); - this.setDirty(true); - } - return tiddler; -}; - -TiddlyWiki.prototype.getTiddler = function(title) -{ - var t = this.fetchTiddler(title); - if(t != undefined) - return t; - else - return null; -}; - -TiddlyWiki.prototype.getShadowTiddlerText = function(title) -{ - if(typeof config.shadowTiddlers[title] == "string") - return config.shadowTiddlers[title]; - else - return ""; -}; - -// Retrieve tiddler contents -//# Supports tiddler slices or sections, encoded in {{{title}}} argument using -//# the respective separator characters ({{{::}}} or {{{##}}}). -TiddlyWiki.prototype.getTiddlerText = function(title,defaultText) -{ - if(!title) - return defaultText; - var pos = title.indexOf(config.textPrimitives.sectionSeparator); - var section = null; - if(pos != -1) { - section = title.substr(pos + config.textPrimitives.sectionSeparator.length); - title = title.substr(0,pos); - } - pos = title.indexOf(config.textPrimitives.sliceSeparator); - if(pos != -1) { - var slice = this.getTiddlerSlice(title.substr(0,pos),title.substr(pos + config.textPrimitives.sliceSeparator.length)); - if(slice) - return slice; - } - var tiddler = this.fetchTiddler(title); - var text = tiddler ? tiddler.text : null; - if(!tiddler && this.isShadowTiddler(title)) { - text = this.getShadowTiddlerText(title); - } - if(text) { - if(!section) - return text; - var re = new RegExp("(^!{1,6}[ \t]*" + section.escapeRegExp() + "[ \t]*\n)","mg"); - re.lastIndex = 0; - var match = re.exec(text); - if(match) { - var t = text.substr(match.index+match[1].length); - var re2 = /^!/mg; - re2.lastIndex = 0; - match = re2.exec(t); //# search for the next heading - if(match) - t = t.substr(0,match.index-1);//# don't include final \n - return t; - } - return defaultText; - } - if(defaultText != undefined) - return defaultText; - return null; -}; - -TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) -{ - var bracketRegExp = new RegExp("(?:\\[\\[([^\\]]+)\\]\\])","mg"); - var text = this.getTiddlerText(title,null); - if(text == null) - return defaultText; - var textOut = []; - var match,lastPos = 0; - do { - match = bracketRegExp.exec(text); - if(match) { - textOut.push(text.substr(lastPos,match.index-lastPos)); - if(match[1]) { - if(depth <= 0) - textOut.push(match[1]); - else - textOut.push(this.getRecursiveTiddlerText(match[1],"",depth-1)); - } - lastPos = match.index + match[0].length; - } else { - textOut.push(text.substr(lastPos)); - } - } while(match); - return textOut.join(""); -}; - -//TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]+)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\n]+)[\t\x20]*\|$)/gm; -TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]*)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\|\n]*)[\t\x20]*\|$)/gm; -// @internal -TiddlyWiki.prototype.calcAllSlices = function(title) -{ - var slices = {}; - var text = this.getTiddlerText(title,""); - this.slicesRE.lastIndex = 0; - var m = this.slicesRE.exec(text); - while(m) { - if(m[2]) - slices[m[2]] = m[3]; - else - slices[m[5]] = m[6]; - m = this.slicesRE.exec(text); - } - return slices; -}; - -// Returns the slice of text of the given name -//# -//# A text slice is a substring in the tiddler's text that is defined -//# either like this -//# aName: textSlice -//# or -//# |aName:| textSlice | -//# or -//# |aName| textSlice | -//# -//# In the text the name (or name:) may be decorated with '' or // -//# ie this would also a valid text slice: -//# -//# |''aName:''| textSlice | -//# -//# @param name should only contain "word characters" (i.e. "a-ZA-Z_0-9") -//# @return [may be undefined] the (trimmed) text of the specified slice. -TiddlyWiki.prototype.getTiddlerSlice = function(title,sliceName) -{ - var slices = this.slices[title]; - if(!slices) { - slices = this.calcAllSlices(title); - this.slices[title] = slices; - } - return slices[sliceName]; -}; - -// Build an hashmap of the specified named slices of a tiddler -TiddlyWiki.prototype.getTiddlerSlices = function(title,sliceNames) -{ - var t,r = {}; - for(t=0; t<" + "body>" + text.substring(posDiv[0],posDiv[1] + endSaveArea.length) + "<" + "/body><" + "/html>"; - // Create the iframe - var iframe = document.createElement("iframe"); - iframe.style.display = "none"; - document.body.appendChild(iframe); - var doc = iframe.document; - if(iframe.contentDocument) - doc = iframe.contentDocument; // For NS6 - else if(iframe.contentWindow) - doc = iframe.contentWindow.document; // For IE5.5 and IE6 - // Put the content in the iframe - doc.open(); - doc.writeln(content); - doc.close(); - // Load the content into a TiddlyWiki() object - var storeArea = doc.getElementById("storeArea"); - this.loadFromDiv(storeArea,"store"); - // Get rid of the iframe - iframe.parentNode.removeChild(iframe); - return this; -}; - -TiddlyWiki.prototype.updateTiddlers = function() -{ - this.tiddlersUpdated = true; - this.forEachTiddler(function(title,tiddler) { - tiddler.changed(); - }); -}; - -// Return an array of tiddlers matching a search regular expression -TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag,match) -{ - var candidates = this.reverseLookup("tags",excludeTag,!!match); - var t,results = []; - for(t=0; t": - btn = createTiddlyButton(place,this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore); - jQuery(btn).addClass("moreCommand"); - var e = createTiddlyElement(place,"span",null,"moreCommand"); - e.style.display = "none"; - place = e; - break; - default: - var className = ""; - switch(c.substr(0,1)) { - case "+": - className = "defaultCommand"; - c = c.substr(1); - break; - case "-": - className = "cancelCommand"; - c = c.substr(1); - break; - } - if(config.commands[c]) { - this.createCommand(place,c,tiddler,className); - } else { - this.customCommand(place,c,wikifier,tiddler); - } - break; - } - } -}; - -// Overrideable function to extend toolbar handler -config.macros.toolbar.customCommand = function(place,command,wikifier,tiddler) -{ -}; - diff --git a/editions/tw2/source/tiddlywiki/js/Upgrade.js b/editions/tw2/source/tiddlywiki/js/Upgrade.js deleted file mode 100755 index 7399d5b30..000000000 --- a/editions/tw2/source/tiddlywiki/js/Upgrade.js +++ /dev/null @@ -1,117 +0,0 @@ -//-- -//-- Upgrade macro -//-- - -config.macros.upgrade.handler = function(place) -{ - var w = new Wizard(); - w.createWizard(place,this.wizardTitle); - w.addStep(this.step1Title,this.step1Html.format([this.source,this.source])); - w.setButtons([{caption: this.upgradeLabel, tooltip: this.upgradePrompt, onClick: this.onClickUpgrade}]); -}; - -config.macros.upgrade.onClickUpgrade = function(e) -{ - var me = config.macros.upgrade; - var w = new Wizard(this); - if(window.location.protocol != "file:") { - alert(me.errorCantUpgrade); - return false; - } - if(story.areAnyDirty() || store.isDirty()) { - alert(me.errorNotSaved); - return false; - } - var localPath = getLocalPath(document.location.toString()); - var backupPath = getBackupPath(localPath,me.backupExtension); - w.setValue("backupPath",backupPath); - w.setButtons([],me.statusPreparingBackup); - var original = loadOriginal(localPath); - w.setButtons([],me.statusSavingBackup); - var backup = copyFile(backupPath,localPath); - if(!backup) - backup = saveFile(backupPath,original); - if(!backup) { - w.setButtons([],me.errorSavingBackup); - alert(me.errorSavingBackup); - return false; - } - w.setButtons([],me.statusLoadingCore); - var options = { - type:"GET", - url:me.source, - processData:false, - success:function(data,textStatus,jqXHR) { - me.onLoadCore(true,w,jqXHR.responseText,me.source,jqXHR); - }, - error:function(jqXHR,textStatus,errorThrown) { - me.onLoadCore(false,w,null,me.source,jqXHR); - } - }; - ajaxReq(options); - return false; -}; - -config.macros.upgrade.onLoadCore = function(status,params,responseText,url,xhr) -{ - var me = config.macros.upgrade; - var w = params; - var errMsg; - if(!status) - errMsg = me.errorLoadingCore; - var newVer = me.extractVersion(responseText); - if(!newVer) - errMsg = me.errorCoreFormat; - if(errMsg) { - w.setButtons([],errMsg); - alert(errMsg); - return; - } - var onStartUpgrade = function(e) { - w.setButtons([],me.statusSavingCore); - var localPath = getLocalPath(document.location.toString()); - saveFile(localPath,responseText); - w.setButtons([],me.statusReloadingCore); - var backupPath = w.getValue("backupPath"); - var newLoc = document.location.toString() + "?time=" + new Date().convertToYYYYMMDDHHMM() + "#upgrade:[[" + encodeURI(backupPath) + "]]"; - window.setTimeout(function () {window.location = newLoc;},10); - }; - var step2 = [me.step2Html_downgrade,me.step2Html_restore,me.step2Html_upgrade][compareVersions(version,newVer) + 1]; - w.addStep(me.step2Title,step2.format([formatVersion(newVer),formatVersion(version)])); - w.setButtons([{caption: me.startLabel, tooltip: me.startPrompt, onClick: onStartUpgrade},{caption: me.cancelLabel, tooltip: me.cancelPrompt, onClick: me.onCancel}]); -}; - -config.macros.upgrade.onCancel = function(e) -{ - var me = config.macros.upgrade; - var w = new Wizard(this); - w.addStep(me.step3Title,me.step3Html); - w.setButtons([]); - return false; -}; - -config.macros.upgrade.extractVersion = function(upgradeFile) -{ - var re = /^var version = \{title: "([^"]+)", major: (\d+), minor: (\d+), revision: (\d+)(, beta: (\d+)){0,1}, date: new Date\("([^"]+)"\)/mg; - var m = re.exec(upgradeFile); - return m ? {title: m[1], major: m[2], minor: m[3], revision: m[4], beta: m[6], date: new Date(m[7])} : null; -}; - -function upgradeFrom(path) -{ - var importStore = new TiddlyWiki(); - var tw = loadFile(path); - if(window.netscape !== undefined) - tw = convertUTF8ToUnicode(tw); - importStore.importTiddlyWiki(tw); - importStore.forEachTiddler(function(title,tiddler) { - if(!store.getTiddler(title)) { - store.addTiddler(tiddler); - } - }); - refreshDisplay(); - saveChanges(); //# To create appropriate Markup* sections - alert(config.messages.upgradeDone.format([formatVersion()])); - window.location = window.location.toString().substr(0,window.location.toString().lastIndexOf("?")); -} - diff --git a/editions/tw2/source/tiddlywiki/js/Utilities.js b/editions/tw2/source/tiddlywiki/js/Utilities.js deleted file mode 100755 index f97569d1f..000000000 --- a/editions/tw2/source/tiddlywiki/js/Utilities.js +++ /dev/null @@ -1,285 +0,0 @@ -//-- -//-- TiddlyWiki-specific utility functions -//-- - -// Returns TiddlyWiki version string -function formatVersion(v) -{ - v = v || version; - return v.major + "." + v.minor + "." + v.revision + - (v.alpha ? " (alpha " + v.alpha + ")" : "") + - (v.beta ? " (beta " + v.beta + ")" : ""); -} - -//# Compares two TiddlyWiki version objects -//# Returns +1 if v2 is later than v1 -//# 0 if v2 is the same as v1 -//# -1 if v2 is earlier than v1 -//# version without a beta number is later than a version with a beta number -function compareVersions(v1,v2) -{ - var x1,x2,i,a = ["major","minor","revision"]; - for(i = 0; ix2) - return -1; - } - x1 = v1.beta || 9999; - x2 = v2.beta || 9999; - if(x1 x2 ? -1 : 0; -} - -function merge(dst,src,preserveExisting) -{ - var i; - for(i in src) { - if(!preserveExisting || dst[i] === undefined) - dst[i] = src[i]; - } - return dst; -} - -// Resolve the target object of an event -function resolveTarget(e) -{ - var obj; - if(e.target) - obj = e.target; - else if(e.srcElement) - obj = e.srcElement; - if(obj.nodeType == 3) // defeat Safari bug - obj = obj.parentNode; - return obj; -} - -// Returns a string containing the description of an exception, optionally prepended by a message -function exceptionText(e,message) -{ - var s = e.description || e.toString(); - return message ? "%0:\n%1".format([message,s]) : s; -} - -// Displays an alert of an exception description with optional message -function showException(e,message) -{ - alert(exceptionText(e,message)); -} - -function alertAndThrow(m) -{ - alert(m); - throw(m); -} - -function glyph(name) -{ - var g = config.glyphs; - var b = g.currBrowser; - if(b == null) { - b = 0; - while(b < g.browsers.length-1 && !g.browsers[b]()) - b++; - g.currBrowser = b; - } - if(!g.codes[name]) - return ""; - return g.codes[name][b]; -} - -function createTiddlyText(parent,text) -{ - return parent.appendChild(document.createTextNode(text)); -} - -function createTiddlyCheckbox(parent,caption,checked,onChange) -{ - var cb = document.createElement("input"); - cb.setAttribute("type","checkbox"); - cb.onclick = onChange; - parent.appendChild(cb); - cb.checked = checked; - cb.className = "chkOptionInput"; - if(caption) - wikify(caption,parent); - return cb; -} - -function createTiddlyElement(parent,element,id,className,text,attribs) -{ - var n,e = document.createElement(element); - if(className != null) - e.className = className; - if(id != null) - e.setAttribute("id",id); - if(text != null) - e.appendChild(document.createTextNode(text)); - if(attribs) { - for(n in attribs) { - e.setAttribute(n,attribs[n]); - } - } - if(parent != null) - parent.appendChild(e); - return e; -} - -function createTiddlyButton(parent,text,tooltip,action,className,id,accessKey,attribs) -{ - var i,btn = document.createElement("a"); - btn.setAttribute("href","javascript:;"); - if(action) { - btn.onclick = action; - } - if(tooltip) - btn.setAttribute("title",tooltip); - if(text) - btn.appendChild(document.createTextNode(text)); - btn.className = className || "button"; - if(id) - btn.id = id; - if(attribs) { - for(i in attribs) { - btn.setAttribute(i,attribs[i]); - } - } - if(parent) - parent.appendChild(btn); - if(accessKey) - btn.setAttribute("accessKey",accessKey); - return btn; -} - -//# Create a link to an external resource -//# place - element where the link should be created -//# url - link target -//# label - link text (optional) -function createExternalLink(place,url,label) -{ - var link = document.createElement("a"); - link.className = "externalLink"; - link.href = url; - var f = config.messages.externalLinkTooltip; - link.title = f ? f.format([url]) : url; - if(config.options.chkOpenInNewWindow) - link.target = "_blank"; - place.appendChild(link); - if(label) - createTiddlyText(link, label); - return link; -} - -function getTiddlyLinkInfo(title,currClasses) -{ - var classes = currClasses ? currClasses.split(" ") : []; - classes.pushUnique("tiddlyLink"); - var tiddler = store.fetchTiddler(title); - var subTitle; - if(tiddler) { - subTitle = tiddler.getSubtitle(); - classes.pushUnique("tiddlyLinkExisting"); - classes.remove("tiddlyLinkNonExisting"); - classes.remove("shadow"); - } else { - var f; - classes.remove("tiddlyLinkExisting"); - classes.pushUnique("tiddlyLinkNonExisting"); - if(store.isShadowTiddler(title)) { - f = config.messages.shadowedTiddlerToolTip; - classes.pushUnique("shadow"); - } else { - f = config.messages.undefinedTiddlerToolTip; - classes.remove("shadow"); - } - subTitle = f ? f.format([title]) : ""; - } - if(typeof config.annotations[title]=="string") - subTitle = config.annotations[title]; - return {classes: classes.join(" "),subTitle: subTitle}; -} - -// Event handler for clicking on a tiddly link -function onClickTiddlerLink(ev) -{ - var e = ev || window.event; - var target = resolveTarget(e); - var link = target; - var title = null; - var fields = null; - var noToggle = null; - do { - title = link.getAttribute("tiddlyLink"); - fields = link.getAttribute("tiddlyFields"); - noToggle = link.getAttribute("noToggle"); - link = link.parentNode; - } while(title == null && link != null); - if(!store.isShadowTiddler(title)) { - var f = fields ? fields.decodeHashMap() : {}; - fields = String.encodeHashMap(merge(f,config.defaultCustomFields,true)); - } - if(title) { - var toggling = e.metaKey || e.ctrlKey; - if(config.options.chkToggleLinks) - toggling = !toggling; - if(noToggle) - toggling = false; - if(store.getTiddler(title)) - fields = null; - story.displayTiddler(target,title,null,true,null,fields,toggling); - } - clearMessage(); - return false; -} - -//# Create a link to a particular tiddler -//# place - element where the link should be created -//# title - title of target tiddler -//# includeText - flag for whether to include the title as the text of the link -//# className - custom CSS class for the link -//# linkedFromTiddler - tiddler from which to inherit extended fields -//# noToggle - flag to force the link to open the target, even if chkToggleLinks is on -function createTiddlyLink(place,title,includeText,className,isStatic,linkedFromTiddler,noToggle) -{ - var title = jQuery.trim(title); - var text = includeText ? title : null; - var i = getTiddlyLinkInfo(title,className); - var btn = isStatic ? createExternalLink(place,store.getTiddlerText("SiteUrl",null) + "#" + title) : createTiddlyButton(place,text,i.subTitle,onClickTiddlerLink,i.classes); - if(isStatic) - btn.className += ' ' + className; - btn.setAttribute("refresh","link"); - btn.setAttribute("tiddlyLink",title); - if(noToggle) - btn.setAttribute("noToggle","true"); - if(linkedFromTiddler) { - var fields = linkedFromTiddler.getInheritedFields(); - if(fields) - btn.setAttribute("tiddlyFields",fields); - } - return btn; -} - -function refreshTiddlyLink(e,title) -{ - var i = getTiddlyLinkInfo(title,e.className); - e.className = i.classes; - e.title = i.subTitle; -} - -function createTiddlyDropDown(place,onchange,options,defaultValue) -{ - var sel = createTiddlyElement(place,"select"); - sel.onchange = onchange; - var t; - for(t=0; t 0) { - var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll); - openAll.setAttribute("tag",tag); - openAll.setAttribute("sortby",sortby); - createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div"); - for(r=0; r this.nextMatch) - this.outputText(this.output,this.nextMatch,formatterMatch.index); - // Set the match parameters for the handler - this.matchStart = formatterMatch.index; - this.matchLength = formatterMatch[0].length; - this.matchText = formatterMatch[0]; - this.nextMatch = this.formatter.formatterRegExp.lastIndex; - //# Figure out which formatter matched and call its handler - var t; - for(t=1; t this.nextMatch) - this.outputText(this.output,this.nextMatch,terminatorMatch.index); - //# Set the match parameters - this.matchText = terminatorMatch[1]; - this.matchLength = terminatorMatch[1].length; - this.matchStart = terminatorMatch.index; - this.nextMatch = this.matchStart + this.matchLength; - //# Restore the output pointer - this.output = oldOutput; - return; - } - //# It must be a formatter match; output any text before the match - if(formatterMatch.index > this.nextMatch) - this.outputText(this.output,this.nextMatch,formatterMatch.index); - //# Set the match parameters - this.matchStart = formatterMatch.index; - this.matchLength = formatterMatch[0].length; - this.matchText = formatterMatch[0]; - this.nextMatch = this.formatter.formatterRegExp.lastIndex; - //# Figure out which formatter matched and call its handler - var t; - for(t=1; t startPos) && (this.highlightMatch.index < endPos) && (startPos < endPos)) { - //# Deal with any plain text before the highlight - if(this.highlightMatch.index > startPos) { - createTiddlyText(place,this.source.substring(startPos,this.highlightMatch.index)); - startPos = this.highlightMatch.index; - } - //# Deal with the highlight - var highlightEnd = Math.min(this.highlightRegExp.lastIndex,endPos); - createTiddlyElement(place,"span",null,"highlight",this.source.substring(startPos,highlightEnd)); - startPos = highlightEnd; - //# Nudge along to the next highlight if we're done with this one - if(startPos >= this.highlightRegExp.lastIndex) - this.highlightMatch = this.highlightRegExp.exec(this.source); - } - //# Do the unhighlighted text left over - if(startPos < endPos) { - createTiddlyText(place,this.source.substring(startPos,endPos)); - } -}; - -function wikify(source,output,highlightRegExp,tiddler) -{ - if(source) { - var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler); - var t0 = new Date(); - wikifier.subWikify(output); - if(tiddler && config.options.chkDisplayInstrumentation) - displayMessage("wikify:" +tiddler.title+ " in " + (new Date()-t0) + " ms"); - } -} - -function wikifyStatic(source,highlightRegExp,tiddler,format) -{ - var e = createTiddlyElement(document.body,"pre"); - e.style.display = "none"; - var html = ""; - if(source && source != "") { - if(!tiddler) - tiddler = new Tiddler("temp"); - var wikifier = new Wikifier(source,getParser(tiddler,format),highlightRegExp,tiddler); - wikifier.isStatic = true; - wikifier.subWikify(e); - html = e.innerHTML; - jQuery(e).remove(); - } - return html; -} - -//# Wikify a string to plain text -//# text - text to wikify -//# limit - maximum number of characters to generate -//# tiddler - optional reference to the tiddler containing this text -function wikifyPlainText(text,limit,tiddler) -{ - if(limit > 0) - text = text.substr(0,limit); - var wikifier = new Wikifier(text,formatter,null,tiddler); - return wikifier.wikifyPlain(); -} - -//# Highlight plain text into an element -function highlightify(source,output,highlightRegExp,tiddler) -{ - if(source) { - var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler); - wikifier.outputText(output,0,source.length); - } -} - diff --git a/editions/tw2/source/tiddlywiki/js/Wizard.js b/editions/tw2/source/tiddlywiki/js/Wizard.js deleted file mode 100755 index db2243056..000000000 --- a/editions/tw2/source/tiddlywiki/js/Wizard.js +++ /dev/null @@ -1,69 +0,0 @@ -//-- -//-- Wizard support -//-- - -function Wizard(elem) -{ - if(elem) { - this.formElem = findRelated(elem,"wizard","className"); - this.bodyElem = findRelated(this.formElem.firstChild,"wizardBody","className","nextSibling"); - this.footElem = findRelated(this.formElem.firstChild,"wizardFooter","className","nextSibling"); - } else { - this.formElem = null; - this.bodyElem = null; - this.footElem = null; - } -} - -Wizard.prototype.setValue = function(name,value) -{ - jQuery(this.formElem).data(name, value); -}; - -Wizard.prototype.getValue = function(name) -{ - return this.formElem ? jQuery(this.formElem).data(name) : null; -}; - -Wizard.prototype.createWizard = function(place,title) -{ - this.formElem = createTiddlyElement(place,"form",null,"wizard"); - createTiddlyElement(this.formElem,"h1",null,null,title); - this.bodyElem = createTiddlyElement(this.formElem,"div",null,"wizardBody"); - this.footElem = createTiddlyElement(this.formElem,"div",null,"wizardFooter"); - return this.formElem; -}; - -Wizard.prototype.clear = function() -{ - jQuery(this.bodyElem).empty(); -}; - -Wizard.prototype.setButtons = function(buttonInfo,status) -{ - jQuery(this.footElem).empty(); - var t; - for(t=0; t 0) { - plugin.log.push(config.messages.pluginVersionError); - return false; - } - } - return true; -} - -function isPluginEnabled(plugin) -{ - if(plugin.tiddler.isTagged("systemConfigDisable")) { - plugin.log.push(config.messages.pluginDisabled); - return false; - } - return true; -} - diff --git a/editions/tw2/source/tiddlywiki/js/split.recipe b/editions/tw2/source/tiddlywiki/js/split.recipe deleted file mode 100755 index 42c321911..000000000 --- a/editions/tw2/source/tiddlywiki/js/split.recipe +++ /dev/null @@ -1,54 +0,0 @@ -version: Version.js -js: Guide.js -js: Config.js -js: ConfigBrowser.js -js: Lingo.js -js: main.js -js: Paramifiers.js -js: FormatterHelpers.js -js: Formatter.js -js: Wikifier.js -js: Macros.js -js: NewTiddler.js -js: Search.js -js: Tabs.js -js: Toolbar.js -js: Commands.js -js: Tiddler.js -js: TiddlyWiki.js -js: Filters.js -js: TiddlerFields.js -js: Story.js -js: Backstage.js -js: Import.js -js: Upgrade.js -js: Sync.js -js: Manager.js -js: Messages.js -js: Refresh.js -js: Options.js -js: Saving.js -js: SavingRSS.js -js: FileSystem.js -js: AdaptorBase.js -js: FileAdaptor.js -js: Http.js -js: Utilities.js -js: UtilitiesPopup.js -js: Animator.js -js: Morpher.js -js: Zoomer.js -js: Scroller.js -js: Slider.js -js: Popup.js -js: Wizard.js -js: ListView.js -js: BasicTypes.js -js: Strings.js -js: Dates.js -js: RGB.js -js: Dom.js -js: LoaderSaver.js -js: TW21Loader.js -js: TW21Saver.js - diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.0.11.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.0.11.html.recipe deleted file mode 100755 index 1f569b101..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.0.11.html.recipe +++ /dev/null @@ -1,2 +0,0 @@ -recipe: ../../../Tags/2.0.11/core/tiddlywiki.html.recipe -title: ../../../Tags/2.0.11/core/html/title.html diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.1.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.1.0.html.recipe deleted file mode 100755 index 22cfaa37c..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.1.0.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/REL-2.1.0_Final/core/tiddlywiki.html.recipe -title: ../../../Tags/REL-2.1.0_Final/core/html/title.html -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.1.3.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.1.3.html.recipe deleted file mode 100755 index e583b92f5..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.1.3.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/REL-2.1.3_Final/core/tiddlywiki.html.recipe -title: ../../../Tags/REL-2.1.3_Final/core/html/title.html -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.2.0.html.recipe deleted file mode 100755 index e8343f8f4..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.0.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/REL-2.2.0_Final/core/tiddlywiki.html.recipe -title: ../../../Tags/REL-2.2.0_Final/core/html/title.html -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.5.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.2.5.html.recipe deleted file mode 100755 index dba25b175..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.5.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/REL-2.2.5_Final/core/tiddlywiki.html.recipe -title: ../../../Tags/REL-2.2.5_Final/core/html/title.txt -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.6.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.2.6.html.recipe deleted file mode 100755 index 5743657a6..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.2.6.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/core/REL-2.2.6_Final/tiddlywiki.html.recipe -title: ../../../Tags/core/REL-2.2.6_Final/html/title.txt -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.3.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.3.0.html.recipe deleted file mode 100755 index db123623c..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.3.0.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: ../../../Tags/core/REL-2.3.0_Final/tiddlywiki.html.recipe -title: ../../../Tags/core/REL-2.3.0_Final/html/title.txt -tiddler: ../../association/plugins/LegacyStrikeThroughPlugin/LegacyStrikeThroughPlugin.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.4.0.html.recipe deleted file mode 100755 index 422d0f505..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.0.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.4.0_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.1.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.4.1.html.recipe deleted file mode 100755 index 54def12d0..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.1.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.4.1_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.2.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.4.2.html.recipe deleted file mode 100755 index 468a5fe71..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.2.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.4.2_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.3.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.4.3.html.recipe deleted file mode 100755 index 7ded46a4f..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.4.3.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.4.3_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.5.0.html.recipe deleted file mode 100755 index af37f99ae..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.0.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.5.0_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.1.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.5.1.html.recipe deleted file mode 100755 index 6ed11d004..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.1.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.5.1_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.2.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.5.2.html.recipe deleted file mode 100755 index e0e9f2a94..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.2.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.5.2_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.3.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.5.3.html.recipe deleted file mode 100755 index a2c4d43a5..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.5.3.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.5.3_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/recipes/empty.2.6.0.html.recipe b/editions/tw2/source/tiddlywiki/recipes/empty.2.6.0.html.recipe deleted file mode 100755 index 9493a5f37..000000000 --- a/editions/tw2/source/tiddlywiki/recipes/empty.2.6.0.html.recipe +++ /dev/null @@ -1 +0,0 @@ -recipe: ../../../Tags/core/REL-2.6.0_Final/tiddlywiki.html.recipe diff --git a/editions/tw2/source/tiddlywiki/shadows/ColorPalette.tiddler b/editions/tw2/source/tiddlywiki/shadows/ColorPalette.tiddler deleted file mode 100755 index 724775a0e..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/ColorPalette.tiddler +++ /dev/null @@ -1,18 +0,0 @@ -
      -
      Background: #fff
      -Foreground: #000
      -PrimaryPale: #8cf
      -PrimaryLight: #18f
      -PrimaryMid: #04b
      -PrimaryDark: #014
      -SecondaryPale: #ffc
      -SecondaryLight: #fe8
      -SecondaryMid: #db4
      -SecondaryDark: #841
      -TertiaryPale: #eee
      -TertiaryLight: #ccc
      -TertiaryMid: #999
      -TertiaryDark: #666
      -Error: #f88
      -
      -
      \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/shadows/EditTemplate.tiddler b/editions/tw2/source/tiddlywiki/shadows/EditTemplate.tiddler deleted file mode 100755 index ae8f24421..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/EditTemplate.tiddler +++ /dev/null @@ -1,10 +0,0 @@ -
      -
      
      -
      -
      -
      -
      -
      -
      -
      -
      \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/shadows/GettingStarted.tiddler b/editions/tw2/source/tiddlywiki/shadows/GettingStarted.tiddler deleted file mode 100755 index 0a8230cc2..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/GettingStarted.tiddler +++ /dev/null @@ -1,7 +0,0 @@ -
      -
      To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
      -* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
      -* [[MainMenu]]: The menu (usually on the left)
      -* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
      -You'll also need to enter your username for signing your edits: <
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/ImportTiddlers.tiddler b/editions/tw2/source/tiddlywiki/shadows/ImportTiddlers.tiddler deleted file mode 100755 index 83adacbe6..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/ImportTiddlers.tiddler +++ /dev/null @@ -1,3 +0,0 @@ -
      -
      <>
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/MarkupPreHead.tiddler b/editions/tw2/source/tiddlywiki/shadows/MarkupPreHead.tiddler deleted file mode 100755 index 7f4ebe7cb..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/MarkupPreHead.tiddler +++ /dev/null @@ -1,6 +0,0 @@ -
      -
      
      -
      -
      -
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/OptionsPanel.tiddler b/editions/tw2/source/tiddlywiki/shadows/OptionsPanel.tiddler deleted file mode 100755 index a89fc386c..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/OptionsPanel.tiddler +++ /dev/null @@ -1,15 +0,0 @@ -
      -
      These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser
      -
      -Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])
      -
      -<
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/PageTemplate.tiddler b/editions/tw2/source/tiddlywiki/shadows/PageTemplate.tiddler deleted file mode 100755 index d55f2c60b..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/PageTemplate.tiddler +++ /dev/null @@ -1,23 +0,0 @@ -
      -
      
      -
      -
      -  - -
      -
      -  - -
      -
      - - -
      -
      -
      -
      -
      -
      \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/shadows/StyleSheetColors.tiddler b/editions/tw2/source/tiddlywiki/shadows/StyleSheetColors.tiddler deleted file mode 100755 index 275d81f46..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/StyleSheetColors.tiddler +++ /dev/null @@ -1,136 +0,0 @@ -
      -
      /*{{{*/
      -body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
      -
      -a {color:[[ColorPalette::PrimaryMid]];}
      -a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
      -a img {border:0;}
      -
      -h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
      -h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
      -h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
      -
      -.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
      -.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
      -.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
      -
      -.header {background:[[ColorPalette::PrimaryMid]];}
      -.headerShadow {color:[[ColorPalette::Foreground]];}
      -.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
      -.headerForeground {color:[[ColorPalette::Background]];}
      -.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
      -
      -.tabSelected {color:[[ColorPalette::PrimaryDark]];
      -	background:[[ColorPalette::TertiaryPale]];
      -	border-left:1px solid [[ColorPalette::TertiaryLight]];
      -	border-top:1px solid [[ColorPalette::TertiaryLight]];
      -	border-right:1px solid [[ColorPalette::TertiaryLight]];
      -}
      -.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
      -.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
      -.tabContents .button {border:0;}
      -
      -#sidebar {}
      -#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
      -#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
      -#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
      -#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
      -#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
      -
      -.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
      -.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
      -.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
      -.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
      -	border:1px solid [[ColorPalette::PrimaryMid]];}
      -.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
      -.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
      -.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
      -.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
      -	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
      -.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
      -.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
      -	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
      -
      -.wizard .notChanged {background:transparent;}
      -.wizard .changedLocally {background:#80ff80;}
      -.wizard .changedServer {background:#8080ff;}
      -.wizard .changedBoth {background:#ff8080;}
      -.wizard .notFound {background:#ffff80;}
      -.wizard .putToServer {background:#ff80ff;}
      -.wizard .gotFromServer {background:#80ffff;}
      -
      -#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
      -#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
      -
      -.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
      -
      -.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
      -.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
      -.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
      -.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
      -.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
      -.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
      -.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
      -.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
      -
      -.tiddler .defaultCommand {font-weight:bold;}
      -
      -.shadow .title {color:[[ColorPalette::TertiaryDark]];}
      -
      -.title {color:[[ColorPalette::SecondaryDark]];}
      -.subtitle {color:[[ColorPalette::TertiaryDark]];}
      -
      -.toolbar {color:[[ColorPalette::PrimaryMid]];}
      -.toolbar a {color:[[ColorPalette::TertiaryLight]];}
      -.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
      -.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
      -
      -.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
      -.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
      -.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
      -.tagging .button, .tagged .button {border:none;}
      -
      -.footer {color:[[ColorPalette::TertiaryLight]];}
      -.selected .footer {color:[[ColorPalette::TertiaryMid]];}
      -
      -.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
      -.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
      -.lowlight {background:[[ColorPalette::TertiaryLight]];}
      -
      -.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
      -
      -.imageLink, #displayArea .imageLink {background:transparent;}
      -
      -.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
      -
      -.viewer .listTitle {list-style-type:none; margin-left:-2em;}
      -.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
      -.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
      -
      -.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
      -.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
      -.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
      -
      -.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
      -.viewer code {color:[[ColorPalette::SecondaryDark]];}
      -.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
      -
      -.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
      -
      -.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
      -.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
      -.editorFooter {color:[[ColorPalette::TertiaryMid]];}
      -.readOnly {background:[[ColorPalette::TertiaryPale]];}
      -
      -#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
      -#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
      -#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
      -#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
      -#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
      -#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
      -#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
      -.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
      -.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
      -#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:alpha(opacity=60);}
      -/*}}}*/
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/StyleSheetLayout.tiddler b/editions/tw2/source/tiddlywiki/shadows/StyleSheetLayout.tiddler deleted file mode 100755 index a2d796c32..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/StyleSheetLayout.tiddler +++ /dev/null @@ -1,172 +0,0 @@ -
      -
      /*{{{*/
      -* html .tiddler {height:1%;}
      -
      -body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}
      -
      -h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
      -h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
      -h4,h5,h6 {margin-top:1em;}
      -h1 {font-size:1.35em;}
      -h2 {font-size:1.25em;}
      -h3 {font-size:1.1em;}
      -h4 {font-size:1em;}
      -h5 {font-size:.9em;}
      -
      -hr {height:1px;}
      -
      -a {text-decoration:none;}
      -
      -dt {font-weight:bold;}
      -
      -ol {list-style-type:decimal;}
      -ol ol {list-style-type:lower-alpha;}
      -ol ol ol {list-style-type:lower-roman;}
      -ol ol ol ol {list-style-type:decimal;}
      -ol ol ol ol ol {list-style-type:lower-alpha;}
      -ol ol ol ol ol ol {list-style-type:lower-roman;}
      -ol ol ol ol ol ol ol {list-style-type:decimal;}
      -
      -.txtOptionInput {width:11em;}
      -
      -#contentWrapper .chkOptionInput {border:0;}
      -
      -.externalLink {text-decoration:underline;}
      -
      -.indent {margin-left:3em;}
      -.outdent {margin-left:3em; text-indent:-3em;}
      -code.escaped {white-space:nowrap;}
      -
      -.tiddlyLinkExisting {font-weight:bold;}
      -.tiddlyLinkNonExisting {font-style:italic;}
      -
      -/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
      -a.tiddlyLinkNonExisting.shadow {font-weight:bold;}
      -
      -#mainMenu .tiddlyLinkExisting,
      -	#mainMenu .tiddlyLinkNonExisting,
      -	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
      -#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}
      -
      -.header {position:relative;}
      -.header a:hover {background:transparent;}
      -.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
      -.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0; top:0;}
      -
      -.siteTitle {font-size:3em;}
      -.siteSubtitle {font-size:1.2em;}
      -
      -#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}
      -
      -#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
      -#sidebarOptions {padding-top:0.3em;}
      -#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
      -#sidebarOptions input {margin:0.4em 0.5em;}
      -#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
      -#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
      -#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
      -#sidebarTabs .tabContents {width:15em; overflow:hidden;}
      -
      -.wizard {padding:0.1em 1em 0 2em;}
      -.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
      -.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
      -.wizardStep {padding:1em 1em 1em 1em;}
      -.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
      -.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
      -.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
      -.wizard .button {padding:0.1em 0.2em;}
      -
      -#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
      -.messageToolbar {display:block; text-align:right; padding:0.2em;}
      -#messageArea a {text-decoration:underline;}
      -
      -.tiddlerPopupButton {padding:0.2em;}
      -.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}
      -
      -.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
      -.popup .popupMessage {padding:0.4em;}
      -.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
      -.popup li.disabled {padding:0.4em;}
      -.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
      -.listBreak {font-size:1px; line-height:1px;}
      -.listBreak div {margin:2px 0;}
      -
      -.tabset {padding:1em 0 0 0.5em;}
      -.tab {margin:0 0 0 0.25em; padding:2px;}
      -.tabContents {padding:0.5em;}
      -.tabContents ul, .tabContents ol {margin:0; padding:0;}
      -.txtMainTab .tabContents li {list-style:none;}
      -.tabContents li.listLink { margin-left:.75em;}
      -
      -#contentWrapper {display:block;}
      -#splashScreen {display:none;}
      -
      -#displayArea {margin:1em 17em 0 14em;}
      -
      -.toolbar {text-align:right; font-size:.9em;}
      -
      -.tiddler {padding:1em 1em 0;}
      -
      -.missing .viewer,.missing .title {font-style:italic;}
      -
      -.title {font-size:1.6em; font-weight:bold;}
      -
      -.missing .subtitle {display:none;}
      -.subtitle {font-size:1.1em;}
      -
      -.tiddler .button {padding:0.2em 0.4em;}
      -
      -.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
      -.isTag .tagging {display:block;}
      -.tagged {margin:0.5em; float:right;}
      -.tagging, .tagged {font-size:0.9em; padding:0.25em;}
      -.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
      -.tagClear {clear:both;}
      -
      -.footer {font-size:.9em;}
      -.footer li {display:inline;}
      -
      -.annotation {padding:0.5em; margin:0.5em;}
      -
      -* html .viewer pre {width:99%; padding:0 0 1em 0;}
      -.viewer {line-height:1.4em; padding-top:0.5em;}
      -.viewer .button {margin:0 0.25em; padding:0 0.25em;}
      -.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
      -.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
      -
      -.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
      -.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
      -table.listView {font-size:0.85em; margin:0.8em 1.0em;}
      -table.listView th, table.listView td, table.listView tr {padding:0 3px 0 3px;}
      -
      -.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
      -.viewer code {font-size:1.2em; line-height:1.4em;}
      -
      -.editor {font-size:1.1em;}
      -.editor input, .editor textarea {display:block; width:100%; font:inherit;}
      -.editorFooter {padding:0.25em 0; font-size:.9em;}
      -.editorFooter .button {padding-top:0; padding-bottom:0;}
      -
      -.fieldsetFix {border:0; padding:0; margin:1px 0px;}
      -
      -.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
      -.zoomer div {padding:1em;}
      -
      -* html #backstage {width:99%;}
      -* html #backstageArea {width:99%;}
      -#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
      -#backstageToolbar {position:relative;}
      -#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
      -#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
      -#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
      -#backstage {position:relative; width:100%; z-index:50;}
      -#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
      -.backstagePanelFooter {padding-top:0.2em; float:right;}
      -.backstagePanelFooter a {padding:0.2em 0.4em;}
      -#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}
      -
      -.whenBackstage {display:none;}
      -.backstageVisible .whenBackstage {display:block;}
      -/*}}}*/
      -
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/StyleSheetLocale.tiddler b/editions/tw2/source/tiddlywiki/shadows/StyleSheetLocale.tiddler deleted file mode 100755 index fea759f29..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/StyleSheetLocale.tiddler +++ /dev/null @@ -1,14 +0,0 @@ -
      -
      /***
      -StyleSheet for use when a translation requires any css style changes.
      -This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
      -***/
      -/*{{{*/
      -body {font-size:0.8em;}
      -#sidebarOptions {font-size:1.05em;}
      -#sidebarOptions a {font-style:normal;}
      -#sidebarOptions .sliderPanel {font-size:0.95em;}
      -.subtitle {font-size:0.8em;}
      -.viewer table.listView {font-size:0.95em;}
      -/*}}}*/
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/StyleSheetPrint.tiddler b/editions/tw2/source/tiddlywiki/shadows/StyleSheetPrint.tiddler deleted file mode 100755 index dd60ebd8c..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/StyleSheetPrint.tiddler +++ /dev/null @@ -1,9 +0,0 @@ -
      -
      /*{{{*/
      -@media print {
      -#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
      -#displayArea {margin: 1em 1em 0em;}
      -noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
      -}
      -/*}}}*/
      -
      diff --git a/editions/tw2/source/tiddlywiki/shadows/ViewTemplate.tiddler b/editions/tw2/source/tiddlywiki/shadows/ViewTemplate.tiddler deleted file mode 100755 index 5b4529504..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/ViewTemplate.tiddler +++ /dev/null @@ -1,11 +0,0 @@ -
      -
      
      -
      -
      -
      , ( )
      -
      -
      -
      -
      -
      -
      \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/shadows/split.recipe b/editions/tw2/source/tiddlywiki/shadows/split.recipe deleted file mode 100755 index 1f2f3ac0f..000000000 --- a/editions/tw2/source/tiddlywiki/shadows/split.recipe +++ /dev/null @@ -1,13 +0,0 @@ -prehead: MarkupPreHead.tiddler -shadow: MarkupPreHead.tiddler -shadow: ColorPalette.tiddler -shadow: StyleSheetColors.tiddler -shadow: StyleSheetLayout.tiddler -shadow: StyleSheetLocale.tiddler -shadow: StyleSheetPrint.tiddler -shadow: PageTemplate.tiddler -shadow: ViewTemplate.tiddler -shadow: EditTemplate.tiddler -shadow: GettingStarted.tiddler -shadow: OptionsPanel.tiddler -shadow: ImportTiddlers.tiddler diff --git a/editions/tw2/source/tiddlywiki/test/README b/editions/tw2/source/tiddlywiki/test/README deleted file mode 100755 index 2feb764f5..000000000 --- a/editions/tw2/source/tiddlywiki/test/README +++ /dev/null @@ -1,12 +0,0 @@ -This directory contains the test suite for the TiddlyWiki core. -The framework being used is QUnit (http://docs.jquery.com/QUnit). - -N.B.: -The use of JSSpec is gradually being phased out in favor of QUnit. -Existing JSSpec-based tests are contained in the core/tests directory. -cf. http://trac.tiddlywiki.org/ticket/963 - -/html required HTML components -/js actual test code for core modules -/qunit testing framework -/recipes recipes to build test suite diff --git a/editions/tw2/source/tiddlywiki/test/html/qunitpostscript.txt b/editions/tw2/source/tiddlywiki/test/html/qunitpostscript.txt deleted file mode 100755 index 59a36a872..000000000 --- a/editions/tw2/source/tiddlywiki/test/html/qunitpostscript.txt +++ /dev/null @@ -1,4 +0,0 @@ -

      QUnit tests

      -

      -

      -
        diff --git a/editions/tw2/source/tiddlywiki/test/html/split.recipe b/editions/tw2/source/tiddlywiki/test/html/split.recipe deleted file mode 100755 index 8294cf806..000000000 --- a/editions/tw2/source/tiddlywiki/test/html/split.recipe +++ /dev/null @@ -1 +0,0 @@ -postscript: qunitpostscript.txt diff --git a/editions/tw2/source/tiddlywiki/test/html/testpostscript.txt b/editions/tw2/source/tiddlywiki/test/html/testpostscript.txt deleted file mode 100755 index 41c5c928f..000000000 --- a/editions/tw2/source/tiddlywiki/test/html/testpostscript.txt +++ /dev/null @@ -1,4 +0,0 @@ - -

        -
          -
          diff --git a/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.html b/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.html deleted file mode 100755 index 2c6cfee06..000000000 --- a/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.html +++ /dev/null @@ -1,25 +0,0 @@ - - - -jqMock Test Suite - - - - - - - - -

          jqMock Test Suite

          - -

          - - - - -
            - - - - diff --git a/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.js b/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.js deleted file mode 100755 index 97f96a2c8..000000000 --- a/editions/tw2/source/tiddlywiki/test/jqMock/jqMock.js +++ /dev/null @@ -1,590 +0,0 @@ -/* - * jqMock - The JavaScript Mock framework for jQuery / jqUnit - * http://code.google.com/p/jqmock/ - * version 1.1 - * - * Copyright 2008 Kenneth Ko, under the GNU Lesser General Public License - * - * By Kenneth Ko - * http://longgoldenears.blogspot.com/ - * - * ================================================================== - * Release Notes: - * -------------- - * version 1.1 - * - [3] change behaviour of verify() to NOT check unexpected invocations - * (note: it does check unexpected invocations of calls which were setup as expectations) - * - [3] added verifyAll() method which will check unexpected invocations - * - [4] added new assertion method to check for exceptions being thrown, expectThatExceptionThrown() - * - [4] added new expression to help assert the exception, is.exception({name: ... , message: ..., type: ...}) - * - refactoring, ArgExpectation has been internally renamed to Expression - * - * version 1.01 - * - [1] [2] bug fixes: circular references - * - * version 1.0 - * - initial release -* - */ - -var jqMock = jqMock || {}; - -(function ($) { - //======== Utils ============= - function _isObjExpected(actual, expected, oneway, rchain) { - oneway = oneway || false; - rchain = rchain || [] ; // holds elements already compared in the recursion, to prevent circular references - if (actual === expected) { - return true; - } else if (expected instanceof Expression) { - return expected.assert(actual); - } else if (actual===null || expected===null) { - return false; - } else if (actual instanceof Array && expected instanceof Array) { - // array compare - if (actual.length != expected.length) - return false; - for(var i=0; i MAX_DEPTH) - return "....."; - if (typeof obj=="object") { - for(var a=0; a0) - result[result.length-1] = "]"; - else - result.push("]"); - } else if (obj instanceof Expression) { - return obj.tostring(); - } else if (obj instanceof Error) { - // for errors, only print name and message (don't want stack) - var err = {}; - if ("name" in obj) err.name = obj.name; - if ("message" in obj) err.message = obj.message; - return tostring(err, rchain); - } else if ($.isFunction(obj)) { - //} else if (typeof obj == "function") { - return "function()"; - } else if (typeof obj == "object") { - result.push("{"); - for(var i in obj) { - if (/^__/.test(i)) continue; - result.push(i); - result.push(":"); - result.push(tostring(obj[i], rchain)); - result.push(","); - } - result[result.length==1 ? result.length : result.length-1] = "}"; - } else { - result.push(typeof obj == "string" ? "'" : ""); - result.push(obj); - result.push(typeof obj == "string" ? "'" : ""); - } - rchain.splice(rchainCount); - return result.join(""); - }; - function _getClassName(clz) { - return $.trim(clz.toString()).match(/^function\s(.*)\(/)[1]; - } - function expectThatExceptionThrown(fn, expression) { - try { - fn(); - ok(false, "The expected exception was never thrown. Expression was: " + tostring(expression)); - } catch(ex) { - assertThat(ex, expression, "expected exception matching " + tostring(expression) + " to be thrown"); - } - }; - //======== Modifier ============= - function Modifier(fnName, _origFn) { - this._fnName = fnName; - this._origFn = _origFn; - this._args = []; // default no arg - this._multiplicity = MultiplicityFactory.exactly(1); // default of 1 - this._returnValue = undefined; - this._returnValueSpecified = false; - this._exception = null; - this._matchCount = 0; - } - Modifier.prototype.args = function() { - var expectedArgs = Array.prototype.slice.call(arguments); - this._args = expectedArgs; - return this; - }; - Modifier.prototype.multiplicity = function(m) { - if (m instanceof Multiplicity) - this._multiplicity = m; - else if (typeof m == "number") - this._multiplicity = MultiplicityFactory.exactly(m); - else - throw new Error("Invalid argument for multiplicity()"); - return this; - }; - Modifier.prototype.returnValue = function(rv) { - this._returnValueSpecified = true; - if (typeof rv != "undefined") - this._returnValue = rv; - }; - Modifier.prototype.throwException = function(ex) { - this._exception = ex; - }; - var MATCHRESULT_does_not_match = -1; - var MATCHRESULT_matched_but_disabled = 0; - var MATCHRESULT_matched = 1; - Modifier.prototype.matches = function(actualArgs) { - var b = true; - var expectedArgs = this._args; - if (expectedArgs.length==0) { - // handle no argument - b = (actualArgs.length==0); - } else if (expectedArgs.length == actualArgs.length) { - for(var i=0; i= this.lower & count <= this.upper); - this.isDisabled = (count >= this.upper); - }; - Multiplicity.prototype.tostring = function() { - if (this.type==MultiplicityType.EXACTLY) { - return "(" + this.lower + ")"; - } else { - return [ - "(", this.lower, "..", - (this.upper==Infinity ? "*" : this.upper),")" - ].join(""); - } - }; - var MultiplicityFactory = { - exactly : function(n) { - if (n==0) { - // zero is actually atMost(0) - return new Multiplicity(MultiplicityType.ATMOST, 0, 0, true); - } else { - return new Multiplicity(MultiplicityType.EXACTLY, n, n, false); - } - }, - times : function(n,m) { - if (arguments.length == 1) { - return new Multiplicity(MultiplicityType.EXACTLY, n, n, false); - } else { - if (n==0) - // (0..m) is actually atMost(m) - return new Multiplicity(MultiplicityType.ATMOST, 0, m, true); - else - return new Multiplicity(MultiplicityType.RANGE, n, m, false); - } - }, - atLeast : function(n) { - return new Multiplicity(MultiplicityType.ATLEAST, n, Infinity, false); - }, - atMost : function(n) { - return new Multiplicity(MultiplicityType.ATMOST, 0, n, true); - } - }; - // ======= Expression =============== - var ExpressionType = { - ANYTHING:0, - NOT:1, - INSTANCEOF:2, - SUPERSET:3, - REGEX:4, - ANYOF:5, - ALLOF:6, - CUSTOM: 7, - ERROR:8 - }; - function Expression(type, param) { - this.type = type; - this.param = param; - }; - Expression.prototype.assert = function(actual) { - switch(this.type) { - case ExpressionType.ANYTHING: - return true; - case ExpressionType.NOT: - return !_isObjExpected(actual, this.param); - case ExpressionType.INSTANCEOF: - return actual instanceof this.param; - case ExpressionType.SUPERSET: - return _isObjExpected(actual, this.param, true); - case ExpressionType.REGEX: - return this.param.test(actual); - case ExpressionType.ANYOF: - for(var i=0; i _oep) { - matchResult = _modifiers[_oep].matches(arguments); - if (matchResult == MATCHRESULT_matched) { - matchedModifier = _modifiers[_oep]; - } - } - } - } - if (matchedModifier === undefined) - _oef = true; - } else { - // unordered expectations, matches first one - for(var i=0; i<_modifiers.length; i++) { - matchResult = _modifiers[i].matches(arguments); - if (matchResult == MATCHRESULT_matched) { - matchedModifier = _modifiers[i]; - break; - } - } - } - - if (matchedModifier) - return matchedModifier.doAction(this, arguments); - - // store the unmatched expectation as an error string - var actualArgs = Array.prototype.slice.call(arguments); - var unmatchedMsg = fnName + "(" + tostring(actualArgs).replace(/^\[(.*)\]$/, "$1") + ")"; - _unmatched.push( {'matchResult': matchResult, 'msg': unmatchedMsg} ); - }; - if (!obj[fnName].isMock) { - var _origFn = obj[fnName]; - obj[fnName] = intercept; - obj[fnName].isMock = true; - } else { - throw new Error("Could not create Mock: you tried to overwrite a function which is already a mock!"); - } - this.reset = function() { - _oep = 0; - _oef = false; - for(var i=0; i<_modifiers.length; i++) - delete _modifiers[i]; - _modifiers = []; - for(var i=0; i<_unmatched.length; i++) - delete _unmatched[i]; - _unmatched = []; - }; - this.restore = function() { - this.reset(); - _obj[_fnName] = _origFn; - }; - this.modify = function() { - _modifiers.push(new Modifier(_fnName, _origFn)); - return _modifiers[_modifiers.length-1]; - }; - this.setOrdered = function(b) { - _isOrdered = b; - }; - // check that all expectations satisfied - var _verify = function(verifyUnmatched) { - if (_modifiers.length > 0) { - var b = true; - for(var i=0; i<_modifiers.length; i++) { - if (!_modifiers[i].satisfied()){ - b = false; - break; - } - } - // unsatisfied expectations - var msg = ""; - if (!b) { - msg += (_isOrdered ? "Ordered" : "Unordered") + " expectations have not yet been satisfied:
            "; - for(var i=0; i<_modifiers.length; i++) { - msg += _modifiers[i].tostring() + "
            "; - } - } - - if (_unmatched.length>0) { - // unmatched expectations, when using verifyAll() - if (verifyUnmatched) { - b = false; - msg += "No expectation matched for the following calls:
            " - for(var i=0; i<_unmatched.length; i++) { - msg += _unmatched[i].msg + "
            "; - } - // unmatched expectations, when using verify() - } else { - var msg1 = ""; - for(var i=0; i<_unmatched.length; i++) { - if (_unmatched[i].matchResult == MATCHRESULT_matched_but_disabled) - msg1 += _unmatched[i].msg + "
            "; - } - if (msg1.length>0) { - msg += "No expectation matched for the following calls which were setup as expectations:
            " + msg1; - b = false; - } - } - } - - if (msg=="") - msg = _modifiers.length + " expectations were satisfied"; - - ok(b, msg); - } else { - throw new Error("Expectation setup error. You must set up some expectations"); - } - }; - this.verify = function() { - _verify(false); - }; - this.verifyAll = function() { - _verify(true); - }; - }; - //=====changed expect to expects as window.expect exists in qunit============== - function addShortcut() { - if (window.expects || window.is) - throw new Error("Cannot add shortcuts, expect() or is() already exists in global scope!"); - expects = jqMock.expects; - is = jqMock.is; - }; - //=================== - $.extend(jqMock, { - assertThat: assertThat, - tostring: tostring, - expectThatExceptionThrown: expectThatExceptionThrown, - Mock: Mock, - // changed expect to expects - expects: MultiplicityFactory, - is: ExpressionFactory, - addShortcut: addShortcut - }); -}) (jQuery); diff --git a/editions/tw2/source/tiddlywiki/test/jqMock/jqMockTest.js b/editions/tw2/source/tiddlywiki/test/jqMock/jqMockTest.js deleted file mode 100755 index b0fd1148e..000000000 --- a/editions/tw2/source/tiddlywiki/test/jqMock/jqMockTest.js +++ /dev/null @@ -1,927 +0,0 @@ -jQuery(document).ready(function(){ - - module("PASS"); - - test("without shortcut", function() { - var myObj = {sayHello:function(){}}; - var mock = new jqMock.Mock(myObj, "sayHello"); - mock.modify().args(jqMock.is.anyOf(["Lisa","Bart","Maggie"])); - mock.modify().args("Homer").multiplicity(jqMock.expects.atLeast(1)); - myObj.sayHello("Lisa"); - myObj.sayHello("Homer"); - mock.verifyAll(); - }); - - jqMock.addShortcut(); - - test("mocking native dialog", function() { - var confirmMock = new jqMock.Mock(window, "confirm"); - confirmMock.modify().args("are you sure?").returnValue(true); - confirmMock.modify().args("are you sure 2?").returnValue(false); - var b1 = confirm("are you sure?"); - ok(b1, "should be true"); - var b2 = confirm("are you sure 2?"); - ok(!b2, "should be true (2)"); - confirmMock.verifyAll(); - confirmMock.restore(); - - var alertMock = new jqMock.Mock(window, "alert"); - alertMock.modify().args("are you sure?").returnValue(); - alert("are you sure?"); - alertMock.verifyAll(); - alertMock.restore(); - }); - - test("args() expectation", function() { - - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args(16); - mock.modify().args([4,5,6]); - var obj = {a:'a', b: ['x', 'y'], func : function() {}}; - mock.modify().args(obj); - mock.modify().args(null); - mock.modify().args(undefined); - mock.modify().args(16,[4,5,6], obj); - mock.modify(); // default no arg, multiplicity 1 - - var objActual = {a:3, fn:function(){}, b:{x:'x',y:'y'}}; - var objExpect = {b:{x:'x',y:'y'}, a:3, fn:is.anything}; - mock.modify().args(objExpect); - myobj.fn(objActual); - - myobj.fn(16); - myobj.fn([4,5,6]); - myobj.fn(obj); - myobj.fn(null); - myobj.fn(); - var b; - myobj.fn(b); - myobj.fn(16,[4,5,6], obj); - - mock.verifyAll(); - }); - - test("Expression is()", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args(is.anything).multiplicity(4); - myobj.fn("a"); - myobj.fn(3); - myobj.fn([1,2,3]); - myobj.fn({a:[1,2,3],b:{c:'c'}}); - mock.verifyAll(); - mock.reset(); - - mock.modify().args({a:'apple', x: is.anything, b:'banana'}).multiplicity(2); - myobj.fn({a:'apple', x: 'xxx', b:'banana'}); - myobj.fn({a:'apple', b:'banana'}); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.not('x')).multiplicity(4); - myobj.fn("y"); - myobj.fn(1); - myobj.fn(['x','y']); - myobj.fn({x:'x', y:'y'}); - mock.verifyAll(); - mock.reset(); - - var MyObject = function MyObject(){}; - mock.modify().args(is.instanceOf(MyObject)); - mock.modify().args(is.instanceOf(Array)); - myobj.fn(new MyObject()); - myobj.fn([1,2,3]); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.not(null)); - mock.modify().args(is.not(undefined)); - myobj.fn("something"); - myobj.fn(null); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.objectThatIncludes({a:'apple', b:'banana'})); - myobj.fn({a:'apple', fn:function(){}, b:'banana'}); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.regex(/^abc[0-9]*xyz$/)); - mock.modify().args(is.not(is.regex(/[0-9]/))); - myobj.fn("abc12345xyz"); - myobj.fn("abc"); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.anyOf(["a", "b", "c",null, undefined])).multiplicity(5); - myobj.fn("a"); - myobj.fn(null); - myobj.fn("c"); - myobj.fn(undefined); - myobj.fn("b"); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.allOf([is.not("a"), is.not("b")])).multiplicity(2); - mock.modify().args(is.allOf([is.not(null), is.not(undefined)])); - myobj.fn("x"); - myobj.fn("y"); - myobj.fn("z"); - mock.verifyAll(); - mock.reset(); - - var isEven = function(arg) { - return arg % 2 == 0 ; - }; - mock.modify().args(is.custom(isEven)).multiplicity(3); - myobj.fn(2); - myobj.fn(4); - myobj.fn(6); - mock.verifyAll(); - mock.reset(); - }); - - test("expectation resolution", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args(is.not('x')); - mock.modify().args(is.not('y')); - mock.modify().args(is.anything); - myobj.fn(1); - myobj.fn(2); - myobj.fn(3); - mock.verifyAll(); - mock.reset(); - - // this is an RMock behaviour. - mock.modify().multiplicity(2).args(is.not("y")); - mock.modify().multiplicity(expects.atLeast(2)).args("x"); - for(var i=0; i<4; i++) myobj.fn("x"); - mock.verifyAll(); - mock.reset(); - - mock.modify().multiplicity(expects.times(2,3)).args("x"); - mock.modify().multiplicity(expects.exactly(1)).args(is.not("y")); - mock.modify().multiplicity(expects.atMost(1)).args("x"); - for(var i=0; i<5; i++) myobj.fn("x"); - mock.verifyAll(); - mock.reset(); - }); - - test("ordered expectations", function() { - - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.setOrdered(true); - - mock.modify().args(1); - mock.modify().args(2); - mock.modify().args(3); - myobj.fn(1); - myobj.fn(2); - myobj.fn(3); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(4); - myobj.fn(4); - mock.verifyAll(); - mock.reset(); - - mock.modify().args('x'); - mock.modify().args('y'); - mock.modify().args('x'); - myobj.fn('x'); - myobj.fn('y'); - myobj.fn('x'); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.anything); - mock.modify().args(is.not('y')); - mock.modify().args(is.instanceOf(Array)); - myobj.fn({}); - myobj.fn('x'); - myobj.fn([1,2,3]); - mock.verifyAll(); - mock.reset(); - }); - - test("unexpected invocation, but using verify() only", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.modify().args(1); - mock.modify().args(2); - mock.modify().args(3); - myobj.fn(3); - myobj.fn(2); - myobj.fn(5); // unexpected, but we dont check - myobj.fn(4); // unexpected, but we dont check - myobj.fn(1); - mock.verify(); - }); - - test("returnValue and intercepting", function() { - var myobj = {sum:function(a,b){return a+b;}}; - var mock = new jqMock.Mock(myobj, "sum"); - mock.modify().args(5,6).returnValue(100); // change the returnValue - mock.modify().args(5,6); // don't intercept - equals(myobj.sum(5,6) , 100); - equals(myobj.sum(5,6) , 11); - mock.restore(); - equals(myobj.sum(11,12) , 23); - }); - - test("throwException", function() { - expect(2); - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.modify().args().throwException("my exception"); - var myError = new Error("some error"); - mock.modify().args(1).throwException(myError); - try { - myobj.fn(); - } catch (ex) { - equals(ex, "my exception"); - } - try { - myobj.fn(1); - } catch (ex) { - equals(ex.message, "some error"); - } - }); - - test("multiplicity", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args().multiplicity(expects.exactly(1)); - mock.modify().args('a').multiplicity(expects.times(3)); - mock.modify().args('c').multiplicity(2); - mock.modify().args('b','bbb').multiplicity(expects.times(2,3)); - mock.modify().args({p:'p'},[7,8]); - mock.modify().args('y').multiplicity(expects.atLeast(1)); - mock.modify().args('z').multiplicity(expects.atMost(4)); - mock.modify().args('foo').multiplicity(expects.atMost(0)); - mock.modify().args('zero1').multiplicity(0); - mock.modify().args('zero2').multiplicity(expects.exactly(0)); - mock.modify().args('zero3').multiplicity(expects.times(0,2)); - - myobj.fn({p:'p'},[7,8]); - myobj.fn('a'); - myobj.fn(); - myobj.fn('a'); - myobj.fn('a'); - myobj.fn('c'); - myobj.fn('c'); - myobj.fn('b','bbb'); - myobj.fn('z'); - myobj.fn('y'); - myobj.fn('y'); - myobj.fn('b','bbb'); - myobj.fn('z'); - myobj.fn('z'); - myobj.fn('z'); - mock.verifyAll(); - mock.reset(); - }); - - test("tostring", function() { - equals(jqMock.tostring(3), "3"); - equals(jqMock.tostring("a"), "'a'"); - equals(jqMock.tostring([]), "[]"); - equals(jqMock.tostring([1,2,3]), "[1,2,3]"); - equals(jqMock.tostring([1,2,"x"]), "[1,2,'x']"); - equals(jqMock.tostring(function(){}), "function()"); - equals(jqMock.tostring({}), "{}"); - equals(jqMock.tostring({a:1,b:2,c:'cc'}), "{a:1,b:2,c:'cc'}"); - var x; - equals(jqMock.tostring(x), "undefined"); - equals(jqMock.tostring(null), "null"); - - equals(jqMock.tostring(is.anything), "is.anything"); - equals(jqMock.tostring(is.not('x')), "is.not('x')"); - equals(jqMock.tostring(is.instanceOf(Array)), "is.instanceOf(Array)"); - equals(jqMock.tostring(is.objectThatIncludes({a:'a'})), "is.objectThatIncludes({a:'a'})"); - equals(jqMock.tostring(is.regex(/^[0-9]*/)), "is.regex(/^[0-9]*/)"); - equals(jqMock.tostring(is.anyOf([is.not('a'), is.not('b')])), "is.anyOf([is.not('a'),is.not('b')])"); - equals(jqMock.tostring(is.allOf([is.not(null), is.not(undefined)])), "is.allOf([is.not(null),is.not(undefined)])"); - equals(jqMock.tostring(is.exception({name: "ReferenceError", message: "blah is not defined", type: ReferenceError})), "is.exception({name:'ReferenceError',message:'blah is not defined',type:is.instanceOf(ReferenceError)})"); - equals(jqMock.tostring(is.exception("foo")), "is.exception({message:'foo'})"); - - // NOTE: rhino has error during for(var i : obj) which returns the wrong ordering due to HashMap implementation - var obj = {c:{x:'x',y:['xx',99]}, d:[1,2,{p:'p',q:5}], fn:function(){}, a:3, b:'bob'}; - var objStr = "{c:{x:'x',y:['xx',99]},d:[1,2,{p:'p',q:5}],fn:function(),a:3,b:'bob'}" - equals(jqMock.tostring(obj), objStr); - }); - - test("circular reference", function() { - var a={}; - var b={}; - var x1={'x':a}; - var x2={'x':b}; - a['x'] = x1; - b['x'] = x2; - - var aa=[]; - var bb=[]; - var xx1=[aa]; - var xx2=[bb]; - aa[0] = xx1; - bb[0] = xx2; - - expect(6); - - equals(jqMock.tostring(a), "{x:{x:...}}"); - equals(jqMock.tostring(aa), "[[...]]"); - - try { - jqMock.assertThat(a,b); - } catch (ex) { - equals(ex.message, "Circular Reference detected in the object!", "ciruclar ref in object"); - } - try { - jqMock.assertThat(a,b); - } catch (ex) { - equals(ex.message, "Circular Reference detected in the object!", "ciruclar ref in object"); - } - try { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.modify().args(a).multiplicity(1); - myobj.fn(b); - } catch (ex) { - equals(ex.message, "Circular Reference detected in the object!", "ciruclar ref in object"); - } - try { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.modify().args(aa).multiplicity(1); - myobj.fn(bb); - } catch (ex) { - equals(ex.message, "Circular Reference detected in the object!", "ciruclar ref in object"); - } - }); - - test("object assertion", function() { - jqMock.assertThat(window, window, "assertThat(window), reference equality"); - jqMock.assertThat(3,3); - jqMock.assertThat("a","a"); - jqMock.assertThat([1,2,3],[1,2,3]); - jqMock.assertThat({},{}, "{}"); - jqMock.assertThat([{a:'a'},{b:'b',d:'d'}],[{a:'a'},{d:'d', b:'b'}]); - jqMock.assertThat({b:'b',x:[1,2,3],d:'d'},{d:'d',x:[1,2,3],b:'b'}); - var fn = function(n) {return n+1;}; - jqMock.assertThat(fn, fn); - - var objActual = {a:3, b:{x:'x',y:'y'}, c:[7,8,9]}; - var objExpect = {b:{x:'x',y:'y'}, c:[7,8,9], a:3}; - jqMock.assertThat(objActual,objExpect); - - jqMock.assertThat([1,2,3], is.instanceOf(Array)); - jqMock.assertThat("foo", is.anyOf(['foo','bar'])); - jqMock.assertThat({x:'x', a:'a', y:'y'}, is.objectThatIncludes({a:'a'})); - - jqMock.assertThat(new Error("booya"), is.exception("booya"), "is.exception"); - }); - - test("expectThatExceptionThrown", function() { - // simple compare - jqMock.expectThatExceptionThrown(function() { - throw "blah"; - }, "blah"); - // using expression - jqMock.expectThatExceptionThrown(function() { - throw new Error("booya"); - }, is.allOf([is.instanceOf(Error), is.objectThatIncludes({'message':'booya'})])); - // using is.exception expression - jqMock.expectThatExceptionThrown(function() { - throw {"message":"bad exception"}; - }, is.exception({message: "bad exception"})); - jqMock.expectThatExceptionThrown(function() { - throw new Error("bad exception 2"); - }, is.exception("bad exception 2")); - jqMock.expectThatExceptionThrown(function() { - eval("blah"); - }, is.exception({name: "ReferenceError", message: "blah is not defined", type: ReferenceError})); - function MyUserException (message) { - this.message=message; - this.name="UserException"; - } - jqMock.expectThatExceptionThrown(function() { - throw new MyUserException("booya"); - }, is.exception({name: "UserException", message: "booya", type: MyUserException})); - // just that some expression is thrown - jqMock.expectThatExceptionThrown(function() { - throw new Error("anything"); - }, is.exception()); - }); - - test("error handling", function() { - expect(15); - var obj = {x:'x'}; - try { - new jqMock.Mock(obj, "x"); - } catch(ex) { - equals(ex.message, "Could not create Mock: x is not a function", "exception should be thrown"); - } - var obj2; - try { - new jqMock.Mock(obj2, "x"); - } catch(ex) { - equals( ex.message, "Could not create Mock: the object or function you specified is not defined, obj.x", "exception should be thrown"); - } - var obj3 = {}; - try { - new jqMock.Mock(obj3, "x"); - } catch(ex) { - equals(ex.message, "Could not create Mock: the object or function you specified is not defined, obj.x", "exception should be thrown"); - } - var obj4 = {fn:function(){}}; - try { - var mock = new jqMock.Mock(obj4, "fn"); - mock.verify(); - } catch(ex) { - equals(ex.message, "Expectation setup error. You must set up some expectations", "exception should be thrown"); - } - var alertMock = new jqMock.Mock(window, "alert"); - try { - ok(window.alert.isMock, "flag should be set"); - new jqMock.Mock(window, "alert"); - } catch(ex) { - equals(ex.message, "Could not create Mock: you tried to overwrite a function which is already a mock!", "exception should be thrown"); - } - alertMock.restore(); - - var obj5 = {fn:function(){}}; - var mock5 = new jqMock.Mock(obj5, "fn"); - try { - mock5.modify().args(is.instanceOf('x')); - } catch(ex) { - equals(ex.message, "Invalid argument to is.instanceOf() , argument must be a Class", "exception should be thrown"); - } - try { - mock5.modify().args(is.regex('x')); - } catch(ex) { - equals(ex.message, "Invalid argument to is.regex() , argument must be regex", "exception should be thrown"); - } - try { - mock5.modify().args(is.anyOf('x')); - } catch(ex) { - equals(ex.message, "Invalid argument to is.anyOf() , argument must be an Array", "exception should be thrown"); - } - try { - mock5.modify().args(is.allOf('x')); - } catch(ex) { - equals(ex.message, "Invalid argument to is.allOf() , argument must be an Array", "exception should be thrown"); - } - try { - mock5.modify().args(is.custom('x')); - } catch(ex) { - equals(ex.message, "Invalid argument to is.custom() , argument must be a Function that returns a boolean value", "exception should be thrown"); - } - try { - mock5.modify().multiplicity("x"); - } catch(ex) { - equals(ex.message, "Invalid argument for multiplicity()", "exception should be thrown"); - } - - try { - jqMock.addShortcut(); - } catch(ex) { - equals(ex.message, "Cannot add shortcuts, expect() or is() already exists in global scope!", "exception should be thrown"); - } - - try { - is.exception(0); - } catch(ex) { - equals(ex.message, "Invalid argument to is.exception() , argument must be an object or string"); - } - - try { - is.exception({type:'foo'}); - } catch(ex) { - equals(ex.message, "Invalid argument to is.exception() , the type attribute of the parameter must be a Class"); - } - }); - - //==================================================================== - // The following tests check the failure behaviour of jqMock. - // After running tests that record failures through the framework, - // this code will scrape the resulting HTML to check the failures. - // Note: does not support the drilldown doubleclick view - //==================================================================== - - var counter = 15; // number of tests in PASS module above - - var assertFailureCallbacks = [] - function assertFailure(callback) { - assertFailureCallbacks.push(callback); - } - function assertFailMessages(expectedMessages) { - var allAssertionsPassed = true; - var createSpan = function(passes) { - return $("") - .css("color", passes ? "green" : "#FF6E1F") - .text(passes? " [PASS]" : " [FAIL]"); - }; - var testResult = $('ol#tests>li').eq(counter++); - var assertionResults = testResult.find("ol>li"); - assertionResults.each(function(i,x) { - var tmp = document.createElement("div"); - tmp.innerHTML = expectedMessages[i]; // because of HTML entities - var ok = (x.innerHTML==tmp.innerHTML); - if (!ok) { - allAssertionsPassed = false; - if (console && console.error) { - console.error("[" + counter + "] Actual:\n" + x.innerHTML); - console.error("[" + counter + "] Expected:\n" + tmp.innerHTML); - } - } - $(x).append(createSpan(ok)); - tmp = null; - }); - createSpan(allAssertionsPassed).appendTo(testResult.find("strong")); - } - $(function() { - for(var i=0; ili.fail').filter(function(){ - return $(this).find('strong').text().indexOf(") [PASS]")<0; - }); - $('h2#banner')[0].className = (failed.length>0 ? "fail" : "pass"); - }); - - - var unos = "Unordered expectations have not yet been satisfied:
            "; - var onos = "Ordered expectations have not yet been satisfied:
            "; - var noex = "No expectation matched for the following calls:
            "; - var noex2 = "No expectation matched for the following calls which were setup as expectations:
            " - var br = "
            "; - var s3 = "   "; - - - // ---------------------- run the tests ---------------------- - module("FAIL"); - - test("mocking native dialog", function() { - var alertMock = new jqMock.Mock(window, "alert"); - alertMock.modify().args("some alert"); - window.alert("some other value"); - alertMock.verifyAll(); - alertMock.restore(); - }); - assertFailure(function() { - var expected = []; - expected[0] = unos + - "→0 (1) alert('some alert')" + br + - noex + - "alert('some other value')" + br; - assertFailMessages(expected); - }); - - - test("args() expectation", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - var objActual = {a:3, fn:function(){}, b:{x:'x',y:'y'}}; - var objExpect = {b:{x:'x',y:'zzzzz'}, a:3}; - mock.modify().args(objExpect); - mock.modify().args(1,2,3); - mock.modify().args(); - - myobj.fn(objActual); - myobj.fn(1,2); - myobj.fn('foo'); - - mock.verifyAll(); - }); - assertFailure(function() { - var expected = []; - expected[0] = unos + - "→0 (1) fn({b:{x:'x',y:'zzzzz'},a:3})" +br+ - "→0 (1) fn(1,2,3)"+br+ - "→0 (1) fn()"+br+ - noex+ - "fn({a:3,fn:function(),b:{x:'x',y:'y'}})"+br+ - "fn(1,2)"+br+ - "fn('foo')"+br; - assertFailMessages(expected); - }); - - - test("Expression is()", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args(is.not('x')); - mock.verifyAll(); - mock.reset(); - - var MyObject = function MyObject(){}; - mock.modify().args(is.instanceOf(MyObject)); - mock.modify().args(is.instanceOf(Array)); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.objectThatIncludes({a:'apple', b:'banana'})); - myobj.fn({a:'apple'}); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.regex(/^[0-9]+/)); - myobj.fn("abc"); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.anyOf(["a", "b", "c"])); - myobj.fn("d"); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(is.allOf([is.not(null), is.not(undefined)])); - myobj.fn(null); - myobj.fn(undefined); - mock.verifyAll(); - mock.reset(); - - var isEven = function(arg) { - return arg % 2 == 0 ; - }; - mock.modify().args(is.custom(isEven)).multiplicity(2); - myobj.fn(3); - myobj.fn(2); - mock.verifyAll(); - mock.reset(); - - }); - assertFailure(function() { - var expected = []; - expected[0] = unos + - "→0 (1) fn(is.not('x'))" +br; - expected[1] = unos + - "→0 (1) fn(is.instanceOf(MyObject))" +br+ - "→0 (1) fn(is.instanceOf(Array))" +br; - expected[2] = unos + - "→0 (1) fn(is.objectThatIncludes({a:'apple',b:'banana'}))" + br+ - noex+ - "fn({a:'apple'})"+ br; - expected[3] = unos + - "→0 (1) fn(is.regex(/^[0-9]+/))" + br + - noex+ - "fn('abc')" + br; - expected[4] = unos + - "→0 (1) fn(is.anyOf(['a','b','c']))" + br + - noex+ - "fn('d')" + br; - expected[5] = unos + - "→0 (1) fn(is.allOf([is.not(null),is.not(undefined)]))" + br + - noex+ - "fn(null)" + br + - "fn(undefined)" + br; - expected[6] = unos + - "→1 (2) fn(is.custom(function))" + br + - noex+ - "fn(3)" + br; - assertFailMessages(expected); - }); - - test("expectation resolution", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - // this is RMock behaviour - mock.modify().multiplicity(expects.atLeast(2)).args("x"); // atLeast will always match... - mock.modify().multiplicity(2).args(is.not("y")); // meaning this will never get matched - myobj.fn("x"); - myobj.fn("x"); - myobj.fn("x"); - myobj.fn("x"); - mock.verifyAll(); - mock.reset(); - - // even without verifying unexpected invocations, should fail - mock.modify().args("x").multiplicity(2); - myobj.fn("x"); - myobj.fn("x"); - myobj.fn("x"); // 3rd invoc, should fail - myobj.fn("y"); // since using verify(), should ignore this one - mock.verify(); - }); - assertFailure(function() { - var expected = []; - expected[0] = unos + - s3 + "4 (2..*) fn('x')" + br + - "→0 (2) fn(is.not('y'))" + br; - expected[1] = noex2 + "fn('x')" + br; - assertFailMessages(expected); - }); - - - - - test("ordered expectations", function() { - - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - mock.setOrdered(true); - - mock.modify().args(1); - mock.modify().args(2); - mock.modify().args(3); - myobj.fn(1); - myobj.fn(3); - myobj.fn(2); - mock.verifyAll(); - mock.reset(); - - mock.modify().args('x'); - mock.modify().args('y'); - mock.modify().args('x'); - myobj.fn('x'); - myobj.fn('x'); - myobj.fn('y'); - mock.verifyAll(); - mock.reset(); - - mock.modify().args(1); - mock.modify().args(2); - mock.modify().args(3); - myobj.fn(1); - myobj.fn(3); - myobj.fn(2); - mock.verify(); // verify() only - mock.reset(); - }); - assertFailure(function() { - var expected = []; - expected[0] = onos + - s3 + "1 (1) fn(1)" + br + - "→0 (1) fn(2)" + br+ - "→0 (1) fn(3)" + br+ - noex+ - "fn(3)" + br+ - "fn(2)" + br; - expected[1] = onos + - s3 + "1 (1) fn('x')" + br + - "→0 (1) fn('y')" + br+ - "→0 (1) fn('x')" + br+ - noex+ - "fn('x')" + br+ - "fn('y')" + br; - expected[2] = onos + - s3 + "1 (1) fn(1)" + br + - "→0 (1) fn(2)" + br+ - "→0 (1) fn(3)" + br; - assertFailMessages(expected); - }); - - - test("using verify() does not print out unexpected section", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - var objActual = {a:3, fn:function(){}, b:{x:'x',y:'y'}}; - var objExpect = {b:{x:'x',y:'zzzzz'}, a:3}; - mock.modify().args(objExpect); - mock.modify().args(1,2,3); - mock.modify().args(); - - myobj.fn(objActual); - myobj.fn(1,2); - myobj.fn('foo'); - - mock.verify(); - }); - assertFailure(function() { - var expected = []; - expected[0] = unos + - "→0 (1) fn({b:{x:'x',y:'zzzzz'},a:3})" +br+ - "→0 (1) fn(1,2,3)"+br+ - "→0 (1) fn()"+br; - assertFailMessages(expected); - }); - - - test("object assertion", function() { - jqMock.assertThat(1,3); - jqMock.assertThat(3,"3"); - jqMock.assertThat("b","a"); - jqMock.assertThat([1,2,3],[1,2]); - jqMock.assertThat([1,2,3],[3,2,1]); - jqMock.assertThat([1,2,3],[1,2,"x"]); - jqMock.assertThat([1,2,3,4,5,6,7],[1,2,"x",4,5,6,7]); - jqMock.assertThat([1,2,3,4,5,6,7],[1,2,"3",4,5,6,7]); - jqMock.assertThat({a:'a',b:'b',c:'c'},{a:'a',b:'b'}); - var objActual = {a:3, fn:function(){}, b:{x:'x',y:'y'}}; - var objExpect = {b:{x:'x',y:'zzzzz'}, a:3}; - jqMock.assertThat(objActual,objExpect); - jqMock.assertThat(3, is.instanceOf(Array)); - }); - assertFailure(function() { - var expected = [ - "object did not match expectation, actual: 1, expected: 3", - "object did not match expectation, actual: 3, expected: '3'", - "object did not match expectation, actual: 'b', expected: 'a'", - "object did not match expectation, actual: [1,2,3], expected: [1,2]", - "object did not match expectation, actual: [1,2,3], expected: [3,2,1]", - "object did not match expectation, actual: [1,2,3], expected: [1,2,'x']", - "object did not match expectation, actual: [1,2,3,4,5,6,7], expected: [1,2,'x',4,5,6,7]", - "object did not match expectation, actual: [1,2,3,4,5,6,7], expected: [1,2,'3',4,5,6,7]", - "object did not match expectation, actual: {a:'a',b:'b',c:'c'}, expected: {a:'a',b:'b'}", - "object did not match expectation, actual: {a:3,fn:function(),b:{x:'x',y:'y'}}, expected: {b:{x:'x',y:'zzzzz'},a:3}", - "object did not match expectation, actual: 3, expected: is.instanceOf(Array)" - ]; - assertFailMessages(expected); - }); - - - - - test("multiplicity", function() { - var myobj = {fn:function(){}}; - var mock = new jqMock.Mock(myobj, "fn"); - - mock.modify().args('x'); - mock.modify().args('y'); - myobj.fn('x'); - myobj.fn('x'); - myobj.fn('y'); - mock.verifyAll(); - mock.reset(); - - mock.modify().args({a:'alice',b:'bob'}); - mock.modify().args("foobar").multiplicity(expects.atLeast(3)); - mock.modify().args("foo").multiplicity(expects.atMost(1)); - mock.modify().args('a','b', 'c').multiplicity(expects.times(2,3)); - mock.modify().args(123).multiplicity(0); - - for (var i=0; i<2; i++) myobj.fn({a:'alice',b:'bob'}); - for (var i=0; i<2; i++) myobj.fn('foobar'); - for (var i=0; i<2; i++) myobj.fn('foo'); - for (var i=0; i<4; i++) myobj.fn('a','b', 'c'); - myobj.fn(123); - mock.verifyAll(); - mock.reset(); - - }); - assertFailure(function() { - var expected = []; - expected[0] = noex+ - "fn('x')" + br; - expected[1] = unos + - s3 + "1 (1) fn({a:'alice',b:'bob'})" + br + - "→2 (3..*) fn('foobar')" + br+ - s3 + "1 (0..1) fn('foo')" + br + - s3 + "3 (2..3) fn('a','b','c')" + br + - "→1 (0..0) fn(123)" + br + - noex+ - "fn({a:'alice',b:'bob'})" + br+ - "fn('foo')" + br + - "fn('a','b','c')" + br; - assertFailMessages(expected); - }); - - - test("expectThatExceptionThrown", function() { - jqMock.expectThatExceptionThrown(function() { - //noop - }, "something"); - - jqMock.expectThatExceptionThrown(function() { - throw "foo"; - }, "bar"); - - jqMock.expectThatExceptionThrown(function() { - throw new Error("bad exception 2"); - }, is.exception("bad exception 3")); - - jqMock.expectThatExceptionThrown(function() { - eval("blah"); - }, is.exception({type: RangeError})); - - // just that some expression is thrown - jqMock.expectThatExceptionThrown(function() { - //noop - }, is.exception()); - }); - assertFailure(function() { - var expected = [ - "The expected exception was never thrown. Expression was: 'something'", - "expected exception matching 'bar' to be thrown: object did not match expectation, actual: 'foo', expected: 'bar'", - "expected exception matching is.exception({message:'bad exception 3'}) to be thrown: object did not match expectation, actual: {name:'Error',message:'bad exception 2'}, expected: is.exception({message:'bad exception 3'})", - "expected exception matching is.exception({type:is.instanceOf(RangeError)}) to be thrown: object did not match expectation, actual: {name:'ReferenceError',message:'blah is not defined'}, expected: is.exception({type:is.instanceOf(RangeError)})", - "The expected exception was never thrown. Expression was: is.exception()" - ]; - assertFailMessages(expected); - }); - - -}); diff --git a/editions/tw2/source/tiddlywiki/test/jqMock/split.recipe b/editions/tw2/source/tiddlywiki/test/jqMock/split.recipe deleted file mode 100755 index 32c603fc7..000000000 --- a/editions/tw2/source/tiddlywiki/test/jqMock/split.recipe +++ /dev/null @@ -1 +0,0 @@ -jslib: jqMock.js \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/test/js/Animator.js b/editions/tw2/source/tiddlywiki/test/js/Animator.js deleted file mode 100755 index 8cc383435..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Animator.js +++ /dev/null @@ -1,32 +0,0 @@ -jQuery(document).ready(function(){ - - module("Animator"); - - test("Animator : constructor", function() { - - var a = new Animator(); - - same(typeof a,'object','the Animator() constructor should return an object'); - - same(a.running,0,'the object returned by the Animator() constructor should contain a \'running\' integer with a value of 0 '); - - same(a.timerID,0,'the object returned by the Animator() constructor should contain a \'timerID\' integer with a value of 0 '); - - same(a.animations.length,0,'the object returned by the Animator() constructor should contain an empty \'animations\' array'); - - }); - - test("Animator : functions", function() { - - var expected = ".2061"; - var actual = Animator.slowInSlowOut(0.3); - actual = actual.toString().substr(1,5); - same(actual,expected,'given a float value, Animator.slowInSlowOut() returns the result of the correct mathematical transformation.'); - - expected = 0; - actual = Animator.slowInSlowOut(2); - same(actual,expected,'given a value above the max of valid input, Animator.slowInSlowOut() clamps its output appropriately.'); - - }); -}); - diff --git a/editions/tw2/source/tiddlywiki/test/js/Arrays.js b/editions/tw2/source/tiddlywiki/test/js/Arrays.js deleted file mode 100755 index df6b5f4ae..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Arrays.js +++ /dev/null @@ -1,220 +0,0 @@ -jQuery(document).ready(function() { - module("Arrays"); - - test("Array indexOf", function() { - var actual, expected; - - actual = typeof [].indexOf; - expected = "function"; - same(actual, expected, "method exists"); - - actual = ["foo", "bar", "baz"].indexOf("bar"); - expected = 1; - same(actual, expected, "returns element postion"); - - actual = ["foo", "bar"].indexOf("baz"); - expected = -1; - same(actual, expected, "returns -1 if element not present"); - - actual = ["foo", "bar", "baz"].indexOf("baz", 1); - expected = 2; - same(actual, expected, "returns element position if element is present within given range"); - - actual = ["foo", "bar", "baz"].indexOf("foo", 1); - expected = -1; - same(actual, expected, "returns -1 if element is not present within given range"); - }); - - test("Array findByField", function() { - var actual, expected; - - var L = [{ foo: "lorem", bar: "ipsum" }, { bar: "dolor", baz: "sit" }, { bar: "dolor" }]; - - actual = L.findByField(); - expected = 0; - same(actual, expected, "returns 0 if no arguments are specified"); // XXX: not actually desired; cf. ticket #964 - - actual = L.findByField("bar", "dolor"); - expected = 1; - same(actual, expected, "returns position of first matching element"); - - actual = L.findByField("bar", "xxx"); - expected = null; - same(actual, expected, "returns null if no match was found"); // XXX: not actually desired; cf. ticket #966 - - }); - - test("Array contains", function() { - var actual, expected; - - var L = ["foo", "bar", "baz", "bar"]; - - actual = L.contains(); - expected = false; - same(actual, expected, "returns false if no arguments are specified"); - - actual = L.contains("bar"); - expected = true; - same(actual, expected, "returns true if a matching element was found"); - - actual = L.contains("xxx"); - expected = false; - same(actual, expected, "returns false if no matching element was found"); - }); - - test("Array containsAny", function() { - var actual, expression, expected; - - var L = ["foo", "bar", "baz"]; - - expression = function() { L.containsAny(); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no arguments are specified"); - - actual = L.containsAny("foo"); - expected = false; - same(actual, expected, "returns false if argument is not an array"); // XXX: not actually desired!? - - actual = L.containsAny(["lorem", "bar"]); - expected = true; - same(actual, expected, "returns true if a matching item has been found"); - - actual = L.containsAny(["lorem", "ipsum"]); - expected = false; - same(actual, expected, "returns false if no matching item has been found"); - }); - - test("Array containsAll", function() { - var actual, expression, expected; - - var L = ["foo", "bar", "baz"]; - - expression = function() { L.containsAll(); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no arguments are specified"); - - actual = L.containsAll("foo"); - expected = false; - same(actual, expected, "returns false if argument is not an array"); // XXX: not actually desired!? - - actual = L.containsAll(["foo", "bar"]); - expected = true; - same(actual, expected, "returns true if all given items have been found"); - - actual = L.containsAll(["lorem", "bar"]); - expected = false; - same(actual, expected, "returns false if not all given items have been found"); - }); - - test("Array pushUnique", function() { - var actual, expected; - - /* XXX: behavior currently undefined - actual = ["foo", "bar"]; - actual.pushUnique(); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify array if no arguments are specified"); - */ - - actual = ["foo", "bar"]; - actual.pushUnique("baz"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array, provided an identical element is not present yet"); - - actual = ["foo", "bar", "baz"]; - actual.pushUnique("baz"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if given item is already present"); - - actual = [{ foo: "lorem" }, { bar: "ipsum" }]; - actual.pushUnique({ bar: "ipsum" }); - expected = [{ foo: "lorem" }, { bar: "ipsum" }, { bar: "ipsum" }]; - same(actual, expected, "appends given item to original array if it is an object (deep comparison is not supported)"); // XXX: not actually desired!? -- cf. #606 - }); - - test("Array remove", function() { - var actual, expected, L; - - actual = ["foo", "bar", "baz"]; - actual.remove(); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if no arguments are specified"); - - actual = ["foo", "bar", "baz"]; - actual.remove("bar"); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array, provided such an element is present"); - - actual = ["foo", "bar", "baz"]; - actual.remove("lorem"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if given item is not present"); - - actual = [{ foo: "lorem" }, { bar: "ipsum" }]; - actual.remove({ bar: "ipsum" }); - expected = [{ foo: "lorem" }, { bar: "ipsum" }]; - same(actual, expected, "does not modify original array if given item is an object (deep comparison is not supported)"); // XXX: not actually desired!? -- cf. #606 - }); - - test("Array setItem", function() { - var actual, expected; - - actual = ["foo", "bar", "baz"]; - actual.setItem(); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify array if no arguments are specified"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("foo"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if mode is not specified"); - - actual = ["foo", "bar"]; - actual.setItem("baz", 0); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array if mode is 0 and element is not present"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("bar", 0); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array if mode 0 and element is present"); - - actual = ["foo", "bar"]; - actual.setItem("baz", +1); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array if mode is +1 and element is not present"); - - actual = ["foo", "bar"]; - actual.setItem("bar", +1); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify original array if mode is +1 and element is present"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("bar", -1); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array if mode is -1 and element is present"); - - actual = ["foo", "bar"]; - actual.setItem("baz", -1); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify original array if mode is -1 and element is not present"); - }); - - test("Array map", function() { - var actual, expected, L; - - L = ["foo", "lorem", "amet"]; - - actual = L.map(function(item, i) { - return item.substr(2, 1); - }); - expected = ["o", "r", "e"]; - same(actual, expected, "returns an array of elements defined by the specified callback"); - - actual = L.map(function(item, i) { - return item.length + i; - }); - expected = [3, 6, 6]; - same(actual, expected, "passes element value and index to the callback"); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/BasicTypes.js b/editions/tw2/source/tiddlywiki/test/js/BasicTypes.js deleted file mode 100755 index 60276947a..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/BasicTypes.js +++ /dev/null @@ -1,244 +0,0 @@ -jQuery(document).ready(function() { - module("Basic Types"); - - test("Number clamp", function() { - var actual, expected; - - actual = (99).clamp(); - expected = 99; - same(actual, expected, "returns original number if no arguments are specified"); - - actual = (11).clamp(20); - expected = 20; - same(actual, expected, "if only one argument is specified, uses it as minimum"); - - actual = (55).clamp(20, 80); - expected = 55; - same(actual, expected, "returns original number if it is between minimum and maximum"); - - actual = (11).clamp(20, 80); - expected = 20; - same(actual, expected, "returns minimum if number is smaller than minimum"); - - actual = (99).clamp(20, 80); - expected = 80; - same(actual, expected, "returns maximum if number is greater than maximum"); - }); - - test("Array indexOf", function() { - var actual, expected; - - actual = typeof [].indexOf; - expected = "function"; - same(actual, expected, "method exists"); - - actual = ["foo", "bar", "baz"].indexOf("bar"); - expected = 1; - same(actual, expected, "returns element postion"); - - actual = ["foo", "bar"].indexOf("baz"); - expected = -1; - same(actual, expected, "returns -1 if element not present"); - - actual = ["foo", "bar", "baz"].indexOf("baz", 1); - expected = 2; - same(actual, expected, "returns element position if element is present within given range"); - - actual = ["foo", "bar", "baz"].indexOf("foo", 1); - expected = -1; - same(actual, expected, "returns -1 if element is not present within given range"); - }); - - test("Array findByField", function() { - var actual, expected; - - var L = [{ foo: "lorem", bar: "ipsum" }, { bar: "dolor", baz: "sit" }, { bar: "dolor" }]; - - actual = L.findByField(); - expected = 0; - same(actual, expected, "returns 0 if no arguments are specified"); // XXX: not actually desired; cf. ticket #964 - - actual = L.findByField("bar", "dolor"); - expected = 1; - same(actual, expected, "returns position of first matching element"); - - actual = L.findByField("bar", "xxx"); - expected = null; - same(actual, expected, "returns null if no match was found"); // XXX: not actually desired; cf. ticket #966 - - }); - - test("Array contains", function() { - var actual, expected; - - var L = ["foo", "bar", "baz", "bar"]; - - actual = L.contains(); - expected = false; - same(actual, expected, "returns false if no arguments are specified"); - - actual = L.contains("bar"); - expected = true; - same(actual, expected, "returns true if a matching element was found"); - - actual = L.contains("xxx"); - expected = false; - same(actual, expected, "returns false if no matching element was found"); - }); - - test("Array containsAny", function() { - var actual, expression, expected; - - var L = ["foo", "bar", "baz"]; - - expression = function() { L.containsAny(); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no arguments are specified"); - - actual = L.containsAny("foo"); - expected = false; - same(actual, expected, "returns false if argument is not an array"); // XXX: not actually desired!? - - actual = L.containsAny(["lorem", "bar"]); - expected = true; - same(actual, expected, "returns true if a matching item has been found"); - - actual = L.containsAny(["lorem", "ipsum"]); - expected = false; - same(actual, expected, "returns false if no matching item has been found"); - }); - - test("Array containsAll", function() { - var actual, expression, expected; - - var L = ["foo", "bar", "baz"]; - - expression = function() { L.containsAll(); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no arguments are specified"); - - actual = L.containsAll("foo"); - expected = false; - same(actual, expected, "returns false if argument is not an array"); // XXX: not actually desired!? - - actual = L.containsAll(["foo", "bar"]); - expected = true; - same(actual, expected, "returns true if all given items have been found"); - - actual = L.containsAll(["lorem", "bar"]); - expected = false; - same(actual, expected, "returns false if not all given items have been found"); - }); - - test("Array pushUnique", function() { - var actual, expected; - - /* XXX: behavior currently undefined - actual = ["foo", "bar"]; - actual.pushUnique(); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify array if no arguments are specified"); - */ - - actual = ["foo", "bar"]; - actual.pushUnique("baz"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array, provided an identical element is not present yet"); - - actual = ["foo", "bar", "baz"]; - actual.pushUnique("baz"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if given item is already present"); - - actual = [{ foo: "lorem" }, { bar: "ipsum" }]; - actual.pushUnique({ bar: "ipsum" }); - expected = [{ foo: "lorem" }, { bar: "ipsum" }, { bar: "ipsum" }]; - same(actual, expected, "appends given item to original array if it is an object (deep comparison is not supported)"); // XXX: not actually desired!? -- cf. #606 - }); - - test("Array remove", function() { - var actual, expected, L; - - actual = ["foo", "bar", "baz"]; - actual.remove(); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if no arguments are specified"); - - actual = ["foo", "bar", "baz"]; - actual.remove("bar"); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array, provided such an element is present"); - - actual = ["foo", "bar", "baz"]; - actual.remove("lorem"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if given item is not present"); - - actual = [{ foo: "lorem" }, { bar: "ipsum" }]; - actual.remove({ bar: "ipsum" }); - expected = [{ foo: "lorem" }, { bar: "ipsum" }]; - same(actual, expected, "does not modify original array if given item is an object (deep comparison is not supported)"); // XXX: not actually desired!? -- cf. #606 - }); - - test("Array setItem", function() { - var actual, expected; - - actual = ["foo", "bar", "baz"]; - actual.setItem(); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify array if no arguments are specified"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("foo"); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "does not modify original array if mode is not specified"); - - actual = ["foo", "bar"]; - actual.setItem("baz", 0); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array if mode is 0 and element is not present"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("bar", 0); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array if mode 0 and element is present"); - - actual = ["foo", "bar"]; - actual.setItem("baz", +1); - expected = ["foo", "bar", "baz"]; - same(actual, expected, "appends given item to original array if mode is +1 and element is not present"); - - actual = ["foo", "bar"]; - actual.setItem("bar", +1); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify original array if mode is +1 and element is present"); - - actual = ["foo", "bar", "baz"]; - actual.setItem("bar", -1); - expected = ["foo", "baz"]; - same(actual, expected, "removes given item from original array if mode is -1 and element is present"); - - actual = ["foo", "bar"]; - actual.setItem("baz", -1); - expected = ["foo", "bar"]; - same(actual, expected, "does not modify original array if mode is -1 and element is not present"); - }); - - test("Array map", function() { - var actual, expected, L; - - L = ["foo", "lorem", "amet"]; - - actual = L.map(function(item, i) { - return item.substr(2, 1); - }); - expected = ["o", "r", "e"]; - same(actual, expected, "returns an array of elements defined by the specified callback"); - - actual = L.map(function(item, i) { - return item.length + i; - }); - expected = [3, 6, 6]; - same(actual, expected, "passes element value and index to the callback"); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Crypto.js b/editions/tw2/source/tiddlywiki/test/js/Crypto.js deleted file mode 100755 index a3f7d8f64..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Crypto.js +++ /dev/null @@ -1,27 +0,0 @@ -jQuery(document).ready(function(){ - - module("Crypto"); - - test("SHA-1 functions", function() { - var actual = jQuery.encoding.digests.hexSha1Str("").toLowerCase(); - var expected = "da39a3ee5e6b4b0d3255bfef95601890afd80709"; - same(actual,expected,'SHA-1 hash of empty string should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("The quick brown fox jumps over the lazy dog").toLowerCase(); - expected = "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"; - same(actual,expected,'SHA-1 hash of test vector 1 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("abc").toLowerCase(); - expected = "a9993e364706816aba3e25717850c26c9cd0d89d"; - same(actual,expected,'SHA-1 hash of test vector 2 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"); - expected = "84983E441C3BD26EBAAE4AA1F95129E5E54670F1"; - same(actual,expected,'SHA-1 hash of test vector 3 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("12345678901234567890123456789012345678901234567890123456789012345678901234567890"); - expected = "50ABF5706A150990A08B2C5EA40FA0E585554732"; - same(actual,expected,'SHA-1 hash of test vector 4 should be correct'); - }); - -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/DOM.js b/editions/tw2/source/tiddlywiki/test/js/DOM.js deleted file mode 100755 index 91e0241e5..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/DOM.js +++ /dev/null @@ -1,81 +0,0 @@ -(function($) { - -var makeTestNode = function() { - var ele = $('
            '); - ele.appendTo('body'); - return ele.get(0); -}; - -var removeTestNode = function() { - $('#testElement').remove(); -}; - -$(document).ready(function(){ - - module("DOM.js"); - - test("resolveTarget", function() { - expect(1); - var ele = makeTestNode(); - - var target; - $(ele).click(function(ev){ - target = $(ev.target)[0]; - }); - $(ele).click(); - equals(target, ele, "resolveTarget correctly identifies the target of a click event"); - - removeTestNode(); - }); - - - test('getPlainText', function(){ - expect(1); - - $('body').append("
            foo bar baz
            "); - var d = $('#text_test').get(0); - equals(getPlainText(d), "foo bar baz", "getPlainText() returns the plain text of an element."); - $("#text_test").remove(); - }); - - - test("findWindowHeight", function() { - expect(2); - equals(typeof findWindowHeight(), "number", "returns a number value"); - equals($(window).height(), findWindowHeight(), "return the current height of the display window"); - }); - - test("findWindowWidth", function() { - expect(1); - equals(typeof findWindowWidth(), "number", "returns a number value"); - // XXX: following test does not work - // equals($(window).width(), findWindowWidth(), "return the current width of the display window"); - }); - - - test("findScrollX", function() { - - var scroll = 10; - - $('
            wide
            ').css({width: '9999px'}).appendTo('body'); - $().scrollLeft(scroll); - - equals(typeof findScrollX(), "number", "returns a number value"); - //equals(findScrollX(), scroll, "returns the correct horizontal scroll position of the window"); - - $('#wiiide').remove(); - }); - - test("findScrollY", function() { - expect(1); - var scroll = 200; - $().scrollTop(scroll); - - equals(typeof findScrollY(), "number", "returns a number value"); - // XXX: following test does not work - // equals(findScrollY(), scroll, "returns the correct vertical scroll position of the window"); - - }); -}); // document ready. - -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/test/js/Dates.js b/editions/tw2/source/tiddlywiki/test/js/Dates.js deleted file mode 100755 index 5a44cd804..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Dates.js +++ /dev/null @@ -1,477 +0,0 @@ -jQuery(document).ready(function(){ - - module("Dates"); - - test("Date functions", function() { - - var actual = new Date(2008,11,31,9,48).formatString("0hh12"); - var expected = "09"; - same(actual,expected,'12-hour format (with zero-padding) should return correct result for AM times'); - actual = new Date(2008,11,31,21,48).formatString("0hh12"); - expected = "09"; - same(actual,expected,'12-hour format (with zero-padding) should return correct result for PM times'); - actual = new Date(2008,11,31,9,48).formatString("hh12"); - expected = "9"; - same(actual,expected,'12-hour format (without zero-padding) should return correct result for AM times'); - actual = new Date(2008,11,31,21,48).formatString("hh12"); - expected = "9"; - same(actual,expected,'12-hour format (without zero-padding) should return correct result for PM times'); - - actual = new Date(2008,11,31,9,48).formatString("0hh"); - expected = "09"; - same(actual,expected,'24-hour format (with zero-padding) should return correct result for AM times'); - actual = new Date(2008,11,31,21,48).formatString("0hh"); - expected = "21"; - same(actual,expected,'24-hour format (with zero-padding) should return correct result for PM times'); - actual = new Date(2008,11,31,9,48).formatString("hh"); - expected = "9"; - same(actual,expected,'24-hour format (without zero-padding) should return correct result for AM times'); - actual = new Date(2008,11,31,21,48).formatString("hh"); - expected = "21"; - same(actual,expected,'24-hour format (without zero-padding) should return correct result for PM times'); - - actual = new Date(2008,0).formatString("mmm"); - expected = "Jan"; - same(actual,expected,'short-month format should return "Jan" for month 0'); - actual = new Date(2008,1).formatString("mmm"); - expected = "Feb"; - same(actual,expected,'short-month format should return "Feb" for month 1'); - actual = new Date(2008,2).formatString("mmm"); - expected = "Mar"; - same(actual,expected,'short-month format should return "Mar" for month 2'); - actual = new Date(2008,3).formatString("mmm"); - expected = "Apr"; - same(actual,expected,'short-month format should return "Apr" for month 3'); - actual = new Date(2008,4).formatString("mmm"); - expected = "May"; - same(actual,expected,'short-month format should return "May" for month 4'); - actual = new Date(2008,5).formatString("mmm"); - expected = "Jun"; - same(actual,expected,'short-month format should return "Jun" for month 5'); - actual = new Date(2008,6).formatString("mmm"); - expected = "Jul"; - same(actual,expected,'short-month format should return "Jul" for month 6'); - actual = new Date(2008,7).formatString("mmm"); - expected = "Aug"; - same(actual,expected,'short-month format should return "Aug" for month 7'); - actual = new Date(2008,8).formatString("mmm"); - expected = "Sep"; - same(actual,expected,'short-month format should return "Sep" for month 8'); - actual = new Date(2008,9).formatString("mmm"); - expected = "Oct"; - same(actual,expected,'short-month format should return "Oct" for month 9'); - actual = new Date(2008,10).formatString("mmm"); - expected = "Nov"; - same(actual,expected,'short-month format should return "Nov" for month 10'); - actual = new Date(2008,11).formatString("mmm"); - expected = "Dec"; - same(actual,expected,'short-month format should return "Dec" for month 12'); - - actual = new Date(2008,11,15,11,0).formatString("0mm"); - expected = "00"; - same(actual,expected,'minutes format (with zero-padding) should return "00" for minute 0'); - actual = new Date(2008,11,15,11,5).formatString("0mm"); - expected = "05"; - same(actual,expected,'minutes format (with zero-padding) should return "05" for minute 5'); - actual = new Date(2008,11,15,11,30).formatString("0mm"); - expected = "30"; - same(actual,expected,'minutes format (with zero-padding) should return "30" for minute 30'); - actual = new Date(2008,11,15,11,60).formatString("0mm"); - expected = "00"; - same(actual,expected,'minutes format (with zero-padding) should return "00" for minute 60'); - actual = new Date(2008,11,15,11,0).formatString("mm"); - expected = "0"; - same(actual,expected,'minutes format (without zero-padding) should return "0" for minute 0'); - actual = new Date(2008,11,15,11,5).formatString("mm"); - expected = "5"; - same(actual,expected,'minutes format (without zero-padding) should return "5" for minute 5'); - actual = new Date(2008,11,15,11,30).formatString("mm"); - expected = "30"; - same(actual,expected,'minutes format (without zero-padding) should return "30" for minute 30'); - actual = new Date(2008,11,15,11,60).formatString("mm"); - expected = "0"; - same(actual,expected,'minutes format (without zero-padding) should return "0" for minute 60'); - - actual = new Date(2008,11,15,11,1,0).formatString("0ss"); - expected = "00"; - same(actual,expected,'seconds format (with zero-padding) should return "00" for second 0'); - actual = new Date(2008,11,15,11,1,5).formatString("0ss"); - expected = "05"; - same(actual,expected,'seconds format (with zero-padding) should return "05" for second 5'); - actual = new Date(2008,11,15,11,1,30).formatString("0ss"); - expected = "30"; - same(actual,expected,'seconds format (with zero-padding) should return "30" for second 30'); - actual = new Date(2008,11,15,11,1,60).formatString("0ss"); - expected = "00"; - same(actual,expected,'seconds format (with zero-padding) should return "00" for second 60'); - actual = new Date(2008,11,15,11,1,0).formatString("ss"); - expected = "0"; - same(actual,expected,'seconds format (without zero-padding) should return "0" for second 0'); - actual = new Date(2008,11,15,11,1,5).formatString("ss"); - expected = "5"; - same(actual,expected,'seconds format (without zero-padding) should return "5" for second 5'); - actual = new Date(2008,11,15,11,1,30).formatString("ss"); - expected = "30"; - same(actual,expected,'seconds format (without zero-padding) should return "30" for second 30'); - actual = new Date(2008,11,15,11,1,60).formatString("ss"); - expected = "0"; - same(actual,expected,'seconds format (without zero-padding) should return "0" for second 60'); - - actual = new Date(2008,11,15,0).formatString("am"); - expected = "am"; - same(actual,expected,'am format should return "am" for pre-noon times (00:00:00)'); - actual = new Date(2008,11,15,8).formatString("am"); - expected = "am"; - same(actual,expected,'am format should return "am" for pre-noon times (08:00:00)'); - actual = new Date(2008,11,15,11,59,59).formatString("am"); - expected = "am"; - same(actual,expected,'am format should return "am" for pre-noon times (11:59:59)'); - actual = new Date(2008,11,15,0).formatString("pm"); - expected = "am"; - same(actual,expected,'pm format should return "am" for pre-noon times (00:00:00)'); - actual = new Date(2008,11,15,8).formatString("pm"); - expected = "am"; - same(actual,expected,'pm format should return "am" for pre-noon times (08:00:00)'); - actual = new Date(2008,11,15,11,59,59).formatString("pm"); - expected = "am"; - same(actual,expected,'pm format should return "am" for pre-noon times (11:59:59)'); - actual = new Date(2008,11,15,12).formatString("am"); - expected = "pm"; - same(actual,expected,'am format should return "pm" for pre-midnight times (12:00:00)'); - actual = new Date(2008,11,15,20).formatString("am"); - expected = "pm"; - same(actual,expected,'am format should return "pm" for pre-midnight times (20:00:00)'); - actual = new Date(2008,11,15,23,59,59).formatString("am"); - expected = "pm"; - same(actual,expected,'am format should return "pm" for pre-midnight times (23:59:59)'); - actual = new Date(2008,11,15,12).formatString("pm"); - expected = "pm"; - same(actual,expected,'pm format should return "pm" for pre-midnight times (12:00:00)'); - actual = new Date(2008,11,15,20).formatString("pm"); - expected = "pm"; - same(actual,expected,'pm format should return "pm" for pre-midnight times (20:00:00)'); - actual = new Date(2008,11,15,23,59,59).formatString("pm"); - expected = "pm"; - same(actual,expected,'pm format should return "pm" for pre-midnight times (23:59:59)'); - - actual = new Date(2008,11,15,0).formatString("AM"); - expected = "AM"; - same(actual,expected,'AM format should return "AM" for pre-noon times (00:00:00)'); - actual = new Date(2008,11,15,8).formatString("AM"); - expected = "AM"; - same(actual,expected,'AM format should return "AM" for pre-noon times (08:00:00)'); - actual = new Date(2008,11,15,11,59,59).formatString("AM"); - expected = "AM"; - same(actual,expected,'AM format should return "AM" for pre-noon times (11:59:59)'); - actual = new Date(2008,11,15,0).formatString("PM"); - expected = "AM"; - same(actual,expected,'PM format should return "AM" for pre-noon times (00:00:00)'); - actual = new Date(2008,11,15,8).formatString("PM"); - expected = "AM"; - same(actual,expected,'PM format should return "AM" for pre-noon times (08:00:00)'); - actual = new Date(2008,11,15,11,59,59).formatString("PM"); - expected = "AM"; - same(actual,expected,'PM format should return "AM" for pre-noon times (11:59:59)'); - actual = new Date(2008,11,15,12).formatString("AM"); - expected = "PM"; - same(actual,expected,'AM format should return "PM" for pre-midnight times (12:00:00)'); - actual = new Date(2008,11,15,20).formatString("AM"); - expected = "PM"; - same(actual,expected,'AM format should return "PM" for pre-midnight times (20:00:00)'); - actual = new Date(2008,11,15,23,59,59).formatString("AM"); - expected = "PM"; - same(actual,expected,'AM format should return "PM" for pre-midnight times (23:59:59)'); - actual = new Date(2008,11,15,12).formatString("PM"); - expected = "PM"; - same(actual,expected,'PM format should return "PM" for pre-midnight times (12:00:00)'); - actual = new Date(2008,11,15,20).formatString("PM"); - expected = "PM"; - same(actual,expected,'PM format should return "PM" for pre-midnight times (20:00:00)'); - actual = new Date(2008,11,15,23,59,59).formatString("PM"); - expected = "PM"; - same(actual,expected,'PM format should return "PM" for pre-midnight times (23:59:59)'); - - actual = new Date(2007,11,31).formatString("wYYYY"); - expected = "2008"; - same(actual,expected,'week-based four-digit year format should return the year based on the week number'); - actual = new Date(2007,11,31).formatString("wYY"); - expected = "08"; - same(actual,expected,'week-based two-digit year format should return the year based on the week number'); - actual = new Date(2007,11,31).formatString("YYYY"); - expected = "2007"; - same(actual,expected,'four-digit year format should return the correct year'); - actual = new Date(7,11,31).formatString("YYYY"); - expected = "1907"; - same(actual,expected,'four-digit year format should return the correct year based on 20th century'); - actual = new Date(2007,11,31).formatString("YY"); - expected = "07"; - same(actual,expected,'two-digit year format should return the correct year'); - - actual = new Date(2008,0).formatString("MMM"); - expected = "January"; - same(actual,expected,'full-month format should return "January" for month 0'); - actual = new Date(2008,1).formatString("MMM"); - expected = "February"; - same(actual,expected,'full-month format should return "February" for month 1'); - actual = new Date(2008,2).formatString("MMM"); - expected = "March"; - same(actual,expected,'full-month format should return "March" for month 2'); - actual = new Date(2008,3).formatString("MMM"); - expected = "April"; - same(actual,expected,'full-month format should return "April" for month 3'); - actual = new Date(2008,4).formatString("MMM"); - expected = "May"; - same(actual,expected,'full-month format should return "May" for month 4'); - actual = new Date(2008,5).formatString("MMM"); - expected = "June"; - same(actual,expected,'full-month format should return "June" for month 5'); - actual = new Date(2008,6).formatString("MMM"); - expected = "July"; - same(actual,expected,'full-month format should return "July" for month 6'); - actual = new Date(2008,7).formatString("MMM"); - expected = "August"; - same(actual,expected,'full-month format should return "August" for month 7'); - actual = new Date(2008,8).formatString("MMM"); - expected = "September"; - same(actual,expected,'full-month format should return "September" for month 8'); - actual = new Date(2008,9).formatString("MMM"); - expected = "October"; - same(actual,expected,'full-month format should return "October" for month 9'); - actual = new Date(2008,10).formatString("MMM"); - expected = "November"; - same(actual,expected,'full-month format should return "November" for month 10'); - actual = new Date(2008,11).formatString("MMM"); - expected = "December"; - same(actual,expected,'full-month format should return "December" for month 12'); - - actual = new Date(2008,0).formatString("0MM"); - expected = "01"; - same(actual,expected,'months format (with zero-padding) should return "01" for January'); - actual = new Date(2008,11).formatString("0MM"); - expected = "12"; - same(actual,expected,'months format (with zero-padding) should return "12" for December'); - actual = new Date(2008,12).formatString("0MM"); - expected = "01"; - same(actual,expected,'months format (with zero-padding) should return "01" for month 13'); - actual = new Date(2008,0).formatString("MM"); - expected = "1"; - same(actual,expected,'months format (without zero-padding) should return "1" for January'); - actual = new Date(2008,11).formatString("MM"); - expected = "12"; - same(actual,expected,'months format (without zero-padding) should return "12" for December'); - actual = new Date(2008,12).formatString("MM"); - expected = "1"; - same(actual,expected,'months format (without zero-padding) should return "1" for month 13'); - - actual = new Date(2008,0,3).formatString("0WW"); - expected = "01"; - same(actual,expected,'weeks format (with zero-padding) should return "01" for the first Thursday of the year'); - actual = new Date(2008,11,28).formatString("0WW"); - expected = "52"; - same(actual,expected,'weeks format (with zero-padding) should return "52" for the last Sunday of the year'); - actual = new Date(2008,0,1).formatString("WW"); - expected = "1"; - same(actual,expected,'weeks format (without zero-padding) should return "1" for the first day of the year'); - actual = new Date(2008,11,28).formatString("WW"); - expected = "52"; - same(actual,expected,'weeks format (without zero-padding) should return "52" for the last Sunday of the year'); - - actual = new Date(2008,0,7).formatString("DDD"); - expected = "Monday"; - same(actual,expected,'full-day format should return "Monday" for the first day of the week'); - actual = new Date(2008,0,8).formatString("DDD"); - expected = "Tuesday"; - same(actual,expected,'full-day format should return "Tuesday" for the second day of the week'); - actual = new Date(2008,0,9).formatString("DDD"); - expected = "Wednesday"; - same(actual,expected,'full-day format should return "Wednesday" for the third day of the week'); - actual = new Date(2008,0,10).formatString("DDD"); - expected = "Thursday"; - same(actual,expected,'full-day format should return "Thursday" for the fourth day of the week'); - actual = new Date(2008,0,11).formatString("DDD"); - expected = "Friday"; - same(actual,expected,'full-day format should return "Friday" for the fifth day of the week'); - actual = new Date(2008,0,12).formatString("DDD"); - expected = "Saturday"; - same(actual,expected,'full-day format should return "Saturday" for the sixth day of the week'); - actual = new Date(2008,0,13).formatString("DDD"); - expected = "Sunday"; - same(actual,expected,'full-day format should return "Sunday" for the seventh day of the week'); - - actual = new Date(2008,0,7).formatString("ddd"); - expected = "Mon"; - same(actual,expected,'short-day format should return "Mon" for the first day of the week'); - actual = new Date(2008,0,8).formatString("ddd"); - expected = "Tue"; - same(actual,expected,'short-day format should return "Tue" for the second day of the week'); - actual = new Date(2008,0,9).formatString("ddd"); - expected = "Wed"; - same(actual,expected,'short-day format should return "Wed" for the third day of the week'); - actual = new Date(2008,0,10).formatString("ddd"); - expected = "Thu"; - same(actual,expected,'short-day format should return "Thu" for the fourth day of the week'); - actual = new Date(2008,0,11).formatString("ddd"); - expected = "Fri"; - same(actual,expected,'short-day format should return "Fri" for the fifth day of the week'); - actual = new Date(2008,0,12).formatString("ddd"); - expected = "Sat"; - same(actual,expected,'short-day format should return "Sat" for the sixth day of the week'); - actual = new Date(2008,0,13).formatString("ddd"); - expected = "Sun"; - same(actual,expected,'short-day format should return "Sun" for the seventh day of the week'); - - actual = new Date(2008,5,1).formatString("0DD"); - expected = "01"; - same(actual,expected,'days format (with zero-padding) should return "01" for the first day of the month'); - actual = new Date(2008,0,31).formatString("0DD"); - expected = "31"; - same(actual,expected,'days format (with zero-padding) should return "31" for January 31'); - actual = new Date(2008,0,32).formatString("0DD"); - expected = "01"; - same(actual,expected,'days format (with zero-padding) should return "01" for January 32 [sic]'); - actual = new Date(2008,1,29).formatString("0DD"); - expected = "29"; - same(actual,expected,'days format (with zero-padding) should return "29" for February 29, 2008'); - actual = new Date(2009,1,29).formatString("0DD"); - expected = "01"; - same(actual,expected,'days format (with zero-padding) should return "01" for February 29 [sic], 2009'); - - actual = new Date(2008,5,1).formatString("DD"); - expected = "1"; - same(actual,expected,'days format (without zero-padding) should return "1" for the first day of the month'); - actual = new Date(2008,0,31).formatString("DD"); - expected = "31"; - same(actual,expected,'days format (without zero-padding) should return "31" for January 31'); - actual = new Date(2008,0,32).formatString("DD"); - expected = "1"; - same(actual,expected,'days format (without zero-padding) should return "1" for January 32 [sic]'); - actual = new Date(2008,1,29).formatString("DD"); - expected = "29"; - same(actual,expected,'days format (without zero-padding) should return "29" for February 29, 2008'); - actual = new Date(2009,1,29).formatString("DD"); - expected = "1"; - same(actual,expected,'days format (without zero-padding) should return "1" for February 29 [sic], 2009'); - - actual = new Date(2008,5,1).formatString("DDth"); - expected = "1st"; - same(actual,expected,'day-with-suffix format should return "1st" for the first day of the month'); - actual = new Date(2008,5,2).formatString("DDth"); - expected = "2nd"; - same(actual,expected,'day-with-suffix format should return "2nd" for the second day of the month'); - actual = new Date(2008,5,3).formatString("DDth"); - expected = "3rd"; - same(actual,expected,'day-with-suffix format should return "3rd" for the third day of the month'); - actual = new Date(2008,5,4).formatString("DDth"); - expected = "4th"; - same(actual,expected,'day-with-suffix format should return "4th" for the fourth day of the month'); - actual = new Date(2008,5,11).formatString("DDth"); - expected = "11th"; - same(actual,expected,'day-with-suffix format should return "11th" for the eleventh day of the month'); - actual = new Date(2008,5,21).formatString("DDth"); - expected = "21st"; - same(actual,expected,'day-with-suffix format should return "21st" for the twenty-first day of the month'); - actual = new Date(2008,5,22).formatString("DDth"); - expected = "22nd"; - same(actual,expected,'day-with-suffix format should return "22nd" for the twenty-second day of the month'); - actual = new Date(2008,5,23).formatString("DDth"); - expected = "23rd"; - same(actual,expected,'day-with-suffix format should return "23rd" for the twenty-third day of the month'); - actual = new Date(2008,5,24).formatString("DDth"); - expected = "24th"; - same(actual,expected,'day-with-suffix format should return "24th" for the twenty-fourth day of the month'); - actual = new Date(2008,0,32).formatString("DDth"); - expected = "1st"; - same(actual,expected,'day-with-suffix format should return "1st" for the January 32 [sic]'); - }); - - - test("Date: formatting", function() { - var actual = new Date(2007,2,1).formatString("YYYY MMM DD"); - var expected = "2007 March 1"; - same(actual,expected,'Date formatting YYYY MMM DD'); - actual = new Date(2007,2,1).formatString("DD of MMM, YYYY"); - expected = "1 of March, 2007"; - same(actual,expected,'Given a format string including text (such as DD of MMM, YYYY) the date format outputs accordingly.'); - actual = new Date(2008,11,31,23,48,59).formatString("YYYY MMM DD hh:mm ss"); - expected = "2008 December 31 23:48 59"; - same(actual,expected,'Date formatting YYYY MMM DD hh:mm ss'); - actual = new Date(2008,11,31,3,8,9).formatString("0hh hh 0mm mm 0ss ss"); - expected = "03 3 08 8 09 9"; - same(actual,expected,'Date formatting hours, minutes & seconds'); - actual = new Date(2008,11,31,3,8,9).formatString("hh12 0hh12 AM am PM pm"); - expected = "3 03 AM am AM am"; - same(actual,expected,'Date formatting 12-hour (AM)'); - actual = new Date(2008,11,31,15,8,9).formatString("hh12 0hh12 AM am PM pm"); - expected = "3 03 PM pm PM pm"; - same(actual,expected,'Date formatting 12-hour (PM)'); - actual = Date.convertFromYYYYMMDDHHMM("200812312348").toString(); - expected = new Date(2008,11,31,23,48,0,0).toString(); - same(actual,expected,'Date convertFromYYYYMMDDHHMM'); - }); - - - test("Date: information", function() { - var actual = new Date(2007,2,1,10,0).getAmPm(); - var expected = "am"; - same(actual,expected,'Given an AM time, getAmPm returns am'); - actual = new Date(2007,2,1,13,0).getAmPm(); - expected = "pm"; - same(actual,expected,'Given an PM time, getAmPm returns pm'); - actual = new Date(2007,2,1).daySuffix(); - expected = "st"; - same(actual,expected,'Give a valid date (1st), daySuffix returns the correct day Suffix '); - }); - - - test("Date: escaping", function() { - var actual = new Date(2008,0,31,1,2,3).formatString("Y\\Y\\Y\\Y"); - var expected = "YYYY"; - same(actual,expected,'should not convert escaped four-digit year format'); - actual = new Date(2008,0,31,1,2,3).formatString("Y\\Y"); - expected = "YY"; - same(actual,expected,'should not convert escaped two-digit year format'); - }); - - test("Date: conversions", function() { - same(typeof Date.convertFromYYYYMMDDHHMMSSMMM,"function",'should parse define a function'); - same(typeof Date.convertFromYYYYMMDDHHMMSSMMM("20070228"),"object",'should return an object'); - - var actual = Date.convertFromYYYYMMDDHHMMSSMMM(); - ok(actual=="Invalid Date"||isNaN(actual),'should parse null value should be invalid'); - actual = Date.convertFromYYYYMMDDHHMMSSMMM("2006"), - ok(actual=="Invalid Date"||isNaN(actual),'should parse year only should be invalid'); - actual = Date.convertFromYYYYMMDDHHMMSSMMM("20061"), - ok(actual=="Invalid Date"||isNaN(actual),'should parse year, short month only should be invalid'); - actual = Date.convertFromYYYYMMDDHHMMSSMMM("200601") - ok(actual=="Invalid Date"||isNaN(actual),'should parse year,month only should be invalid'); - - same(Date.convertFromYYYYMMDDHHMMSSMMM("20070228"),new Date(Date.UTC(2007,1,28)),'should parse date only'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("19691103"),new Date(Date.UTC(1969,10,3)),'should parse 1969 date only'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("2006011"),new Date(Date.UTC(2006,0,1)),'should parse year,month, short day'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("199912079"),new Date(Date.UTC(1999,11,7,9)),'should parse year,month,day short hour'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("1999121712"),new Date(Date.UTC(1999,11,17,12)),'should parse year,month,day,hour'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("199912598"),new Date(Date.UTC(1999,11,59,8)),'should parse year,month,day,hour short mins'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("199912150257"),new Date(Date.UTC(1999,11,15,2,57)),'should parse year,month,day,hour,mins'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("1999121512579"),new Date(Date.UTC(1999,11,15,12,57,9)),'should parse year,month,day,hour,mins,short secs'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("19991215125719"),new Date(Date.UTC(1999,11,15,12,57,19)),'should parse year,month,day,hour,mins,secs'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("199912151257198"),new Date(Date.UTC(1999,11,15,12,57,19,8)),'should parse year,month,day,hour,mins,secs,short milliseconds'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("1999121512571978"),new Date(Date.UTC(1999,11,15,12,57,19,78)),'should parse year,month,day,hour,mins,secs,medium milliseconds'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("19991215125719678"),new Date(Date.UTC(1999,11,15,12,57,19,678)),'should parse year,month,day,hour,mins,secs,long milliseconds'); - same(Date.convertFromYYYYMMDDHHMMSSMMM("1999-12-15.12:57:19.678"),new Date(Date.UTC(1999,11,15,12,57,19,678)),'should parse ignoring punctuation'); - same(Date.convertFromYYYYMMDDHHMMSSMMM(" 1999/12/15 12:57:19 678 "),new Date(Date.UTC(1999,11,15,12,57,19,678)),'should parse ignoring whitespace'); - same(Date.convertFromYYYYMMDDHHMMSSMMM(" 1999/12/15 12:57:19 678 GMT (BST) "),new Date(Date.UTC(1999,11,15,12,57,19,678)),'should parse ignoring trailing text'); - same(Date.convertFromYYYYMMDDHHMM(" 1999/12/15 12:57:19 678 GMT (BST) "),new Date(Date.UTC(1999,11,15,12,57,0,0)),'should parse ignoring whitespace, punctuation and trailing text'); - same(Date.convertFromYYYYMMDDHHMM(" 1999/12/15 12:57:xx "),new Date(Date.UTC(1999,11,15,12,57,0,0)),'should parse ignoring whitespace, punctuation and trailing text'); - same(Date.convertFromYYYYMMDDHHMMSS("199912151257xx"),new Date(Date.UTC(1999,11,15,12,57,0,0)),'should parse ignoring trailing text'); - same(Date.convertFromYYYYMMDDHHMMSS("19991215125719"),new Date(Date.UTC(1999,11,15,12,57,19,0)),'should parse including seconds'); - same(Date.convertFromYYYYMMDDHHMMSS("19991215125709"),new Date(Date.UTC(1999,11,15,12,57,9,0)),'should parse including seconds'); - same(Date.convertFromYYYYMMDDHHMMSS("1999121512571"),new Date(Date.UTC(1999,11,15,12,57,1,0)),'should parse including partial seconds'); - var d1 = new Date(Date.UTC(1987,9,29,21,43,57,678)); - var s1 = d1.convertToYYYYMMDDHHMMSSMMM(); - var d2 = Date.convertFromYYYYMMDDHHMMSSMMM(s1); - var s2 = d2.convertToYYYYMMDDHHMMSSMMM(); - same(s2,s1,'should roundtrip current date from Date.convertToYYYYMMDDHHMMSSMMM'); - same(d1,d2,'should roundtrip current date from Date.convertToYYYYMMDDHHMMSSMMM'); - }); -}); - diff --git a/editions/tw2/source/tiddlywiki/test/js/Encoding.js b/editions/tw2/source/tiddlywiki/test/js/Encoding.js deleted file mode 100755 index 91f03de7b..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Encoding.js +++ /dev/null @@ -1,29 +0,0 @@ -jQuery(document).ready(function(){ - - module("jQuery.encoding.digests.sha1.js"); - - test("SHA-1 digest", function() { - expect(5); - - var actual = jQuery.encoding.digests.hexSha1Str("").toLowerCase(); - var expected = "da39a3ee5e6b4b0d3255bfef95601890afd80709"; - ok(actual==expected,'SHA-1 hash of empty string should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("The quick brown fox jumps over the lazy dog").toLowerCase(); - expected = "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"; - ok(actual==expected,'SHA-1 hash of test vector 1 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("abc").toLowerCase(); - expected = "a9993e364706816aba3e25717850c26c9cd0d89d"; - ok(actual==expected,'SHA-1 hash of test vector 2 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"); - expected = "84983E441C3BD26EBAAE4AA1F95129E5E54670F1"; - ok(actual==expected,'SHA-1 hash of test vector 3 should be correct'); - - actual = jQuery.encoding.digests.hexSha1Str("12345678901234567890123456789012345678901234567890123456789012345678901234567890"); - expected = "50ABF5706A150990A08B2C5EA40FA0E585554732"; - ok(actual==expected,'SHA-1 hash of test vector 4 should be correct'); - - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/FileSystem.js b/editions/tw2/source/tiddlywiki/test/js/FileSystem.js deleted file mode 100755 index c96761f52..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/FileSystem.js +++ /dev/null @@ -1,55 +0,0 @@ -jQuery(document).ready(function() { - module("File System"); - - test("convertUTF8ToUnicode", function() { - var actual, expected, str; - - str = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - - actual = convertUTF8ToUnicode(str); - expected = str; - same(actual, expected, "ASCII characters should remain unchanged when converted from UTF8 to Unicode using convert"); - }); - - test("manualConvertUTF8ToUnicode", function() { - var actual, expected, str; - - str = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - - actual = manualConvertUTF8ToUnicode(str); - expected = str; - same(actual, expected, "ASCII characters should remain unchanged when converted from UTF8 to Unicode manually"); - }); - - test("convertUnicodeToUTF8", function() { - var actual, expected, str; - - str = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - - actual = convertUnicodeToUTF8(str); - expected = str; - same(actual, expected, "ASCII characters should remain unchanged when converted from Unicode to UTF8 using convert"); - }); - - test("manualConvertUnicodeToUTF8", function() { - var actual, expected, str; - - str = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - - actual = manualConvertUnicodeToUTF8(str); - expected = str; - same(actual, expected, "ASCII characters should remain unchanged when converted from Unicode to UTF8 manually"); - }); - - /* XXX: this test does not work - test("round trip conversion from UTF8 to Unicode and back", function() { - var actual, expected, str; - - str = "\u007f\u0080"; - - actual = convertUTF8ToUnicode(convertUnicodeToUTF8(str)); - expected = str; - same(actual, expected, "characters should remain unchanged when converted from Unicode to UTF8 and back to Unicode"); - }); - */ -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Filters.js b/editions/tw2/source/tiddlywiki/test/js/Filters.js deleted file mode 100755 index 77a0c0a5d..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Filters.js +++ /dev/null @@ -1,158 +0,0 @@ -/*global story, jQuery, document, module, test, same strictEqual store */ -(function ($) { - jQuery(document).ready(function () { - module("Filters.js"); - - /* - * tiddler - */ - test("filterTiddlers: 'tiddler' should be one tiddlers named foo", function () { - var tiddlers = store.filterTiddlers("foo"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "foo"); - }); - - /* - * [[tiddler]] - */ - test("filterTiddlers: '[[foo]]' should be one tiddlers named foo", function () { - var tiddlers = store.filterTiddlers("[[foo]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "foo"); - }); - - /* - * [[tiddler]][[tiddler]] - */ - test("filterTiddlers: '[[foo]][[foo]]' should be two tiddlers named foo", function () { - var tiddlers = store.filterTiddlers("[[foo]][[foo]]"); - strictEqual(tiddlers.length, 2, 'two tiddlers'); - strictEqual(tiddlers[0].title, "foo"); - strictEqual(tiddlers[1].title, "foo"); - }); - - /* - * [tag[value]] - */ - test("filterTiddlers: '[tag[testTag]]' should be three tiddlers tagged testTag", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - }); - - test("filterTiddlers: '[tag[oneTag]]' should be one tiddlers tagged oneTag", function () { - var tiddlers = store.filterTiddlers("[tag[oneTag]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - }); - - /* - * combined tags - */ - test("filterTiddlers: '[tag[testTag]][tag[twoTag]]' should be three tiddlers tagged testTag and twoTag", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][tag[twoTag]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - }); - - /* - * [limit[n]] - */ - test("filterTiddlers: '[tag[testTag]][limit[1]]' should be one tiddlers tagged testTag limited with 1", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][limit[1]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - }); - - test("filterTiddlers: '[tag[testTag]][limit[2]]' should be two tiddlers tagged testTag limited with 2", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][limit[2]]"); - strictEqual(tiddlers.length, 2, 'two tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - }); - - test("filterTiddlers: '[tag[testTag]][limit[3]]' should be three tiddlers tagged testTag limited with 3", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][limit[3]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - }); - - test("filterTiddlers: '[tag[testTag]][limit[50]]' should be three tiddlers tagged testTag limited with 50", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][limit[50]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - }); - - /* - * [field[value]] - */ - test("filterTiddlers: '[fieldvalue[two]]' should return the tiddler with a fieldvalue 'two'", function () { - var tiddlers = store.filterTiddlers("[fieldvalue[two]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler2"); - }); - - test("filterTiddlers: '[fieldvalue[three]]' should return the tiddler with a fieldvalue 'three'", function () { - var tiddlers = store.filterTiddlers("[fieldvalue[three]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler3"); - }); - - test("filterTiddlers: '[server.bag[foo]]' should return the tiddler with a fieldvalue 'three'", function () { - var tiddlers = store.filterTiddlers("[server.bag[foo]]"); - strictEqual(tiddlers.length, 1, 'one tiddler'); - strictEqual(tiddlers[0].title, "testTiddler3"); - }); - - test("filterTiddlers: '[field-thing[bar]]' should return the tiddler with a fieldvalue 'three'", function () { - var tiddlers = store.filterTiddlers("[field-thing[bar]]"); - strictEqual(tiddlers.length, 1, 'one tiddler'); - strictEqual(tiddlers[0].title, "testTiddler3"); - }); - - /* - * [tag[value]][sort[+title]] - */ - test("filterTiddlers: '[tag[testTag]][sort[+title]]' should return three tiddlers tagged testTag, sorted", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][sort[+title]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - }); - - /* - * [tag[value]][sort[-title]] - */ - test("filterTiddlers: '[tag[testTag]][sort[-title]]' should return three tiddlers tagged testTag, reverse sorted", function () { - var tiddlers = store.filterTiddlers("[tag[testTag]][sort[-title]]"); - strictEqual(tiddlers.length, 3, 'three tiddlers'); - strictEqual(tiddlers[2].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[0].title, "testTiddler3"); - }); - - /* - * errors .. - */ - test("filterTiddlers: '[[]]' should return no tiddlers", function () { - var tiddlers = store.filterTiddlers("[[]]"); - strictEqual(tiddlers.length, 0, 'no tiddlers'); - }); - - test("filterTiddlers: '[tag[]]' seems to return a tiddler called tag", function () { - var tiddlers = store.filterTiddlers("[tag[]]"); - strictEqual(tiddlers.length, 1, 'one tiddlers'); - strictEqual(tiddlers[0].title, "tag"); - }); - - }); -}(jQuery)); diff --git a/editions/tw2/source/tiddlywiki/test/js/LoadingSaving.js b/editions/tw2/source/tiddlywiki/test/js/LoadingSaving.js deleted file mode 100755 index e91551a48..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/LoadingSaving.js +++ /dev/null @@ -1,99 +0,0 @@ -jQuery(document).ready(function() { - module("LoadingSaving"); - - - test("load", function() { - var actual, expected, filepath; - - actual = loadFile(); - expected = null; - same(actual, expected, "returns null if no argument is specified"); - - filepath = getDocumentPath() + "/sample.txt"; - var s = loadFile(filepath); - // if the java saver was used then it will have done the unicode conversion. - actual = window.netscape ? convertUTF8ToUnicode(s) : s; - expected = "lorem ipsum\n" + - "dolor sit amet\n" + - "\n" + - ' !"#$%&' + "'()*+,-./0123456789:;<=>?\n" + - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n" + - "\xa9\u010d\u010c\n" + - "foo bar baz\n"; - //if(!config.browser.isOpera && window.netscape) - if(!(config.browser.isChrome && config.browser.isMac)) - same(actual, expected, "returns contents of specified file"); - - filepath = "/null"; - actual = loadFile(filepath); - ok(actual==null || actual=="undefined", "returns null if the specified file does not exist"); - - filepath = "sample.txt"; - actual = loadFile(filepath); - ok(actual==null || actual=="undefined", "returns null if specified file path is not absolute"); - }); - - test("save", function() { - var actual, expression, expected, str; - var filepath = getDocumentPath() + "/savetest.txt"; - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { saveFile(); }; - expected = "ReferenceError"; - raises(expression, expected, "raises exception if no argument is specified"); - */ - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { saveFile(filepath); }; - expected = "TypeError"; - raises(expression, expected, "raises exception if no content argument is specified"); - */ - - /* disabled as browser-level exceptions cannot be trapped - expression = function() { saveFile("foo.txt", "sample content"); }; - expected = "ReferenceError"; - raises(expression, expected, "raises exception if specified file path is not absolute"); - */ - - str = "lorem ipsum\n" + - "dolor sit amet\n" + - "\n" + - " !#$%&'\"()*+,-./0123456789:;<=>?\n" + - "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n" + - "\xa9\u010d\u010c\n" + - "foo bar baz\n" + - (new Date).toString(); - saveAndLoadString(filepath, str, "X writes given ANSI text content to specified file"); - - var str2 = "\xa9\u010d\u010c"; - saveAndLoadString(filepath, str2, "Y writes given UTF-8 text content to specified file"); - - //saveFile(filepath, ""); // teardown: blank file contents (deletion impossible) - }); - - // helper function to save and load back a string to a file - var saveAndLoadString = function(filepath,str,desc) { - if(config.browser.isChrome && config.browser.isMac) { - return true; - } - saveFile(filepath, convertUnicodeToUTF8(str)); // => entities if IE - var s = loadFile(filepath); - // if the java saver was used then it will have done the unicode conversion. - var actual = window.netscape ? convertUTF8ToUnicode(s) : s; - //var expected = config.browser.isOpera || !window.netscape ? convertUnicodeToHtmlEntities(str) : str; - var expected = config.browser.isIE ? convertUnicodeToHtmlEntities(str) : str; - same(actual, expected, desc); - } - - // helper function to retrieve current document's file path - var getDocumentPath = function() { - var path = document.location.pathname; - var startpos = 0; - var endpos = path.lastIndexOf("/"); - if(path.charAt(2) == ":") { - startpos = 1; - path = path.replace(new RegExp("/","g"),"\\") - } - return unescape(path.substring(startpos, endpos)); - }; -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Macros.js b/editions/tw2/source/tiddlywiki/test/js/Macros.js deleted file mode 100755 index 7a52f9748..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Macros.js +++ /dev/null @@ -1,359 +0,0 @@ -/*global story, jQuery, document, module, test, same strictEqual store */ -(function ($) { - $(document).ready(function () { - module("Macros.js", {}); - /* - * list - */ - test("list all", function () { - var place = $("
            ")[0]; - var params = ["all"]; - var paramString = "all"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 4, - "there are 3 tiddlers defined in testdata at time of writing these should all be listed. also a prompt"); - strictEqual($($("li", place)[0]).text(), config.macros.list.all.prompt, "make sure prompt in place.") - strictEqual($("li .tiddlyLink", place).length, 3, "3 tiddly links should have been created"); - }); - - test("list missing - nothing missing", function () { - var place = $("
            ")[0]; - var params = ["missing"]; - var paramString = "missing"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 1,"no missing tiddlers only header"); - strictEqual($($("li", place)[0]).text(), config.macros.list.missing.prompt, "make sure prompt in place.") - strictEqual($("li .tiddlyLink", place).length, 0, "no tiddly links should have been created"); - }); - - test("NEW: list missing - test emptyMessage", function () { - var place = $("
            ")[0]; - var params = ["missing"]; - var paramString = "missing emptyMessage:nothing"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 2,"no missing tiddlers only header and empty message"); - strictEqual($($("li", place)[1]).text(), "nothing", "check the empty message was printed"); - }); - - test("list shadows", function () { - var place = $("
            ")[0]; - var params = ["shadowed"]; - var paramString = "shadowed"; - var numShadows = 0; - for(var i in config.shadowTiddlers) { - numShadows += 1; - } - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, numShadows + 1,"all shadows and the header"); - var items = $("li", place); - strictEqual($("li .tiddlyLink", place).length, items.length - 1, - "everything but header should be tiddlylink") - strictEqual($(items[1]).text(), "AdvancedOptions", - "the first in the list should be the shadow AdvancedOptions"); - strictEqual($(items[items.length - 1]).text(), "WindowTitle", - "the first in the list should be the shadow WindowTitle"); - }); - - test("list orphans", function () { - var place = $("
            ")[0]; - var params = ["orphans"]; - var paramString = "orphans"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 3,"header plus 2 dummy tiddlers"); - var items = $("li", place); - strictEqual($(items[1]).text(), "testTiddler1", - "check alphabetical order"); - strictEqual($(items[2]).text(), "testTiddler3", - "check alphabetical order"); - }); - - test("list touched", function () { - var place = $("
            ")[0]; - var params = ["touched"]; - var paramString = "touched"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 1,"just header"); - }); - - test("list filter", function () { - var place = $("
            ")[0]; - var params = ["filter", "[tag[twoTag]]"]; - var paramString = "filter [tag[twoTag]]"; - config.macros.list.handler(place,"list",params,null,paramString); - var item = $("li .tiddlyLink", place); - strictEqual(item.length, 1,"just the tiddler matched"); - strictEqual(item.text(), "testTiddler2") - }); - - test("NEW: list filter emptyMessage", function () { - var place = $("
            ")[0]; - var params = ["filter", "[tag[badtag]]"]; - var paramString = "filter [tag[badtag]] emptyMessage:what"; - config.macros.list.handler(place,"list",params,null,paramString); - var item = $("li", place); - strictEqual(item.length, 1,"just the empty message"); - strictEqual(item.text(), "what") - }); - - test("dateFormat default", function() { - strictEqual(config.macros.timeline.dateFormat, "DD MMM YYYY"); - }); - - test("<<timeline>>", function () { - var place = $("
            ")[0]; - var params = []; - var paramString = ""; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - var lists = $("ul", place); - var items = $("li", place); - strictEqual($(lists[0]).hasClass("timeline"), true, "timeline class set"); - strictEqual(lists.length, 2, "01/12/2010 (1&3), 01/12/1995 (2)"); - strictEqual(items.length, 5, "headings plus three tiddlers"); - var list1 = $("li", lists[0]); - var heading1 = $(list1[0]); - strictEqual(heading1.text(), "1 December 2010", "the most recent"); - strictEqual(heading1.hasClass("listTitle"), true, "has listTitle class set"); - var item1 = $("a", list1[1]); - strictEqual(item1.hasClass("tiddlyLink tiddlyLinkExisting"), true, "a tiddly link created"); - strictEqual(item1.text(), "testTiddler3", "the timestamp is more recent so this appears at the top"); - strictEqual($("a", list1[2]).text(), "testTiddler1"); - - strictEqual($("li:first", lists[1]).text(), "1 December 1995", "2nd heading"); - }); - - test("<<timeline created>>", function () { - var place = $("
            ")[0]; - var params = ["created"]; - var paramString = "created"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - var lists = $("ul", place); - var items = $("li", place); - strictEqual($(lists[0]).hasClass("timeline"), true, "timeline class set"); - strictEqual(lists.length, 3, "21/10/2009, 22/07/1994 and 19/10/2009"); - strictEqual(items.length, 6, "headings plus three tiddlers"); - var list1 = $("li", lists[0]); - var heading1 = $(list1[0]); - strictEqual(heading1.text(), "21 October 2009", "the most recent"); - strictEqual(heading1.hasClass("listTitle"), true, "has listTitle class set"); - var item1 = $("a", list1[1]); - strictEqual(item1.hasClass("tiddlyLink tiddlyLinkExisting"), true, "a tiddly link created"); - strictEqual(item1.text(), "testTiddler1"); - strictEqual($("li:first", lists[1]).text(), "19 October 2009", "2nd heading"); - strictEqual($("li:first", lists[2]).text(), "22 July 1994", "3rd heading"); - }); - - test("<<timeline '' 1>>", function () { - var place = $("
            ")[0]; - var params = ["", "1"]; - var paramString = "'' 1"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - var lists = $("ul", place); - var items = $("li", place); - strictEqual($(lists[0]).hasClass("timeline"), true, "timeline class set"); - strictEqual(lists.length, 1, "the 2nd parameter defines a cutoff limitting the results to 1"); - strictEqual(items.length, 2, "heading plus the latest tiddler"); - var list1 = $("li", lists[0]); - var heading1 = $(list1[0]); - strictEqual(heading1.text(), "1 December 2010", "the most recent"); - strictEqual($("a", list1[1]).text(), "testTiddler3", "the timestamp is more recent so this appears at the top"); - }); - - test("test date format <<timeline '' 1 '0hh:0mm' >>", function () { - var place = $("
            ")[0]; - var params = [null, "1", "0hh:0mm"]; - var paramString = "'' 1 '0hh:0mm'"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - strictEqual($("ul .listTitle", place).text(), "09:40", "check dateFormat parameter has propagated"); - strictEqual($("ul .listLink", place).text(), "testTiddler3", "the timestamp is more recent so this appears at the top"); - }); - - test("tagging macro (tagging nothing)", function() { - var place = $("
            ")[0]; - var paramString = ""; - var tiddler = store.getTiddler("I tag nothing"); - config.macros.tagging.handler(place, null, [], null, paramString, tiddler); - - strictEqual($("ul", place).length, 1, "a list was created in the container"); - strictEqual($("ul li.listTitle", place).length, 1, "a list title was created"); - strictEqual($("ul li.listTitle", place).text(), config.macros.tagging.labelNotTag, - "the text says this tiddler is tagging nothing"); - }); - - test("tagging macro (tagging something)", function() { - var place = $("
            ")[0]; - var paramString = ""; - var tiddler = new Tiddler("testTag"); - config.macros.tagging.handler(place, null, [], null, paramString, tiddler); - - strictEqual($("ul", place).length, 1, "a list was created in the container"); - strictEqual($("ul li.listTitle", place).length, 1, "a list title was created"); - strictEqual($("ul li.listTitle", place).text(), config.macros.tagging.label, - "the text says this tiddler is tagging things"); - strictEqual($("ul li", place).length, 4, - "3 tiddlers are tagged with testTag and the list title makes 4 items"); - strictEqual($("ul li a.tiddlyLink", place).length, 3, - "3 tiddlers link to testTag"); - }); - - //<>; - test("tagging macro (sortby parameter)", function() { - var place = $("
            ")[0]; - var paramString = "sortBy:-title" - var tiddler = new Tiddler("testTag"); - config.macros.tagging.handler(place, null, [], null, paramString, tiddler); - - strictEqual($("ul", place).length, 1, "a list was created in the container"); - strictEqual($("ul li a.tiddlyLink", place).length, 3, - "3 tiddlers link to testTag"); - strictEqual($($("li a", place)[0]).attr("tiddlyLink"), "testTiddler3", - "testing testTiddler3 is at the top of the list"); - strictEqual($($("li a", place)[2]).attr("tiddlyLink"), "testTiddler1", - "testing testTiddler1 is at the bottom of the list"); - }); - - test("tagging macro (tagging something title parameter passed)", function() { - // note this test is identical to above but uses a parameter rather than the current tiddler. - var place = $("
            ")[0]; - var paramString = "testTag"; - config.macros.tagging.handler(place, null, [], null, paramString, null); - - strictEqual($("ul", place).length, 1, "a list was created in the container"); - strictEqual($("ul li.listTitle", place).length, 1, "a list title was created"); - strictEqual($("ul li.listTitle", place).text(), config.macros.tagging.label, - "the text says this tiddler is tagging things"); - strictEqual($("ul li", place).length, 4, - "3 tiddlers are tagged with testTag and the list title makes 4 items"); - strictEqual($("ul li a.tiddlyLink", place).length, 3, - "3 tiddlers link to testTag"); - }); - - test("tagging macro (sep parameter)", function() { - // note this test is identical to above but uses a parameter rather than the current tiddler. - var place = $("
            ")[0]; - var paramString = "testTag sep:','"; - config.macros.tagging.handler(place, null, [], null, paramString, null); - - var text = $("ul", place).text(); - strictEqual(text, config.macros.tagging.label + "testTiddler1,testTiddler2,testTiddler3", - "The sep parameter adds separators between each item"); - }); - - module("Macros.js - additional scenarios", { - setup: function() { - var text = "[[Foo is a missing tiddler]] test"; - store.saveTiddler("MissingExample", "MissingExample", text); - var templateText = "<> hello world"; - store.saveTiddler("MyTemplate", "MyTemplate", templateText); - }, - teardown: function() { - store.removeTiddler("MissingExample"); - store.removeTiddler("MyTemplate"); - } - }); - - test("list missing - where something missing", function () { - var place = $("
            ")[0]; - var params = ["missing"]; - var paramString = "missing"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 2, "prompt and one match"); - strictEqual($("li .tiddlyLink", place).text(), "Foo is a missing tiddler","check missing tiddler link created."); - }); - - test("NEW: missing with template parameter", function () { - var place = $("
            ")[0]; - var params = ["missing"]; - var paramString = "missing template:MyTemplate"; - config.macros.list.handler(place,"list",params,null,paramString); - var items = $("li", place); - strictEqual(items.length, 2, "prompt and one match"); - strictEqual($(items[0]).text(), config.macros.list.missing.prompt, "prompt in place and immune from templating"); - strictEqual($(items[1]).text(), - "Foo is a missing tiddler hello world","check missing tiddler link created."); - }); - - test("list touched", function () { - var place = $("
            ")[0]; - var params = ["touched"]; - var paramString = "touched"; - config.macros.list.handler(place,"list",params,null,paramString); - strictEqual($("li", place).length, 3, "just header and MissingExample and MyTemplate"); - var links = $("li .tiddlyLink", place); - strictEqual($(links[0]).text(), "MissingExample", "should have noticed it was touched"); - }); - - test("NEW: list filter with new template", function () { - var place = $("
            ")[0]; - var params = ["filter", "[tag[testTag]][sort[-title]]"]; - var paramString = "filter [tag[testTag]][sort[-title]] template:MyTemplate"; - config.macros.list.handler(place,"list",params,null,paramString); - var items = $("li", place); - strictEqual(items.length, 3, "should match 3 tiddlers"); - strictEqual($(items[0]).text(), "testTiddler3 hello world", "the template has hello world in it."); - strictEqual($(".tiddlyLink", items[0]).text(), "testTiddler3", "filter sorts by descending title"); - }); - - module("Macros.js - timeline templating", { - setup: function() { - config.shadowTiddlers["TestTemplates"] = ["!Group", - "Modified at <>hrs on <>", - "!Item", "hello world <>!"].join("\n"); - }, - teardown: function() { - delete config.shadowTiddlers["TestTemplates"]; - } - }); - - test("<<timeline created groupTemplate:TestTemplates##Group template:TestTemplates##Item>>", function () { - var place = $("
            ")[0]; - var params = ["created", "groupTemplate:TestTemplates##Group", "template:TestTemplates##Item"]; - var paramString = "created groupTemplate:TestTemplates##Group template:TestTemplates##Item"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - var lists = $("ul", place); - var items = $("li", place); - strictEqual($(lists[0]).hasClass("timeline"), true, "timeline class set"); - strictEqual(lists.length, 3, "21/10/2009, 22/07/1994 and 19/10/2009"); - strictEqual(items.length, 6, "headings plus three tiddlers"); - }); - - test("NEW: test templating <<timeline '' 1 groupTemplate:TestTemplates##Group template:TestTemplates##Item>> ", - function () { - var place = $("
            ")[0]; - var params = ["", "1", "groupTemplate:TestTemplates##Group", "template:TestTemplates##Item"]; - var paramString = "'' 1 groupTemplate:TestTemplates##Group template:TestTemplates##Item"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place, "timeline", params, null, paramString, tiddler); - strictEqual($("ul .listTitle", place).text(), "Modified at 09hrs on 01/12/2010", - "check group template was applied"); - strictEqual($("ul .listLink", place).text(), "hello world testTiddler3!", "the item template was applied"); - strictEqual($("ul .listLink a", place).length, 0, "no link created"); - }); - - test("NEW: test group templating vs timestamp <<timeline '' 1 0hh:0mm groupTemplate:TestTemplates##Group>> ", - function () { - var place = $("
            ")[0]; - var params = ["", "1", "0hh:0mm", "groupTemplate:TestTemplates##Group"]; - var paramString = "'' 1 0hh:0mm groupTemplate:TestTemplates##Group template:TestTemplates##Item"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place, "timeline", params, null, paramString, tiddler); - strictEqual($("ul .listTitle", place).text(), "Modified at 09hrs on 01/12/2010", "check group template was applied and timestamp ignored"); - }); - - test("NEW: test filtering <<timeline filter:[tag[twoTag]]>> ", - function () { - var place = $("
            ")[0]; - var params = ["filter:[tag[twoTag]]"]; - var paramString = "filter:[tag[twoTag]]"; - var tiddler = store.getTiddler("testTiddler1"); - config.macros.timeline.handler(place,"timeline",params, null, paramString, tiddler); - strictEqual($("ul", place).length, 1, "1 timeline created"); - strictEqual($("ul li", place).length, 2, "heading and tiddler"); - strictEqual($("ul .listLink a", place).text(), "testTiddler2", "only testTiddler2 has the tag twoTag"); - }); -}); -}(jQuery)); diff --git a/editions/tw2/source/tiddlywiki/test/js/Numbers.js b/editions/tw2/source/tiddlywiki/test/js/Numbers.js deleted file mode 100755 index 4ab77e726..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Numbers.js +++ /dev/null @@ -1,28 +0,0 @@ -jQuery(document).ready(function() { - module("Numbers"); - - test("Number clamp", function() { - var actual, expected; - - actual = (99).clamp(); - expected = 99; - same(actual, expected, "returns original number if no arguments are specified"); - - actual = (11).clamp(20); - expected = 20; - same(actual, expected, "if only one argument is specified, uses it as minimum"); - - actual = (55).clamp(20, 80); - expected = 55; - same(actual, expected, "returns original number if it is between minimum and maximum"); - - actual = (11).clamp(20, 80); - expected = 20; - same(actual, expected, "returns minimum if number is smaller than minimum"); - - actual = (99).clamp(20, 80); - expected = 80; - same(actual, expected, "returns maximum if number is greater than maximum"); - }); - -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Options.js b/editions/tw2/source/tiddlywiki/test/js/Options.js deleted file mode 100755 index 0eef9136a..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Options.js +++ /dev/null @@ -1,29 +0,0 @@ -jQuery(document).ready(function(){ - var numSaves, _autoSaveChanges; - module("TiddlyWiki options", { - setup: function() { - config.options.chkAutoSave = true; - systemSettingSave = 0; - _autoSaveChanges = autoSaveChanges; - numSaves = 0; - autoSaveChanges = function() { - numSaves += 1; - return _autoSaveChanges.apply(this, arguments); - } - }, - teardown: function() { - numSaves = null; - config.options.chkAutoSave = false; - autoSaveChanges = _autoSaveChanges; - } - }); - - test("save multiple system settings", function() { - saveSystemSetting("foo", true); - saveSystemSetting("foo", false); - saveSystemSetting("foo", true); - strictEqual(numSaves, 0, "The save is asynchronous so no saves have yet been made"); - strictEqual(systemSettingSave > 0, true, "However there should be a timeout in progress"); - }); - -}); \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/test/js/RGB.js b/editions/tw2/source/tiddlywiki/test/js/RGB.js deleted file mode 100755 index ab11b1d44..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/RGB.js +++ /dev/null @@ -1,43 +0,0 @@ -jQuery(document).ready(function(){ - - module("TiddlyWiki core"); - - test("RGB tests", function() { - expect(4); - - var actual = new RGB(1,0,1).toString(); - var expected = "#ff00ff"; - ok(actual==expected,'RGB(1,0,1) is the same as #ff00ff'); - - actual = new RGB("#f00").toString(); - expected = "#ff0000"; - ok(actual==expected,'#ff0000 is the same as #f00'); - - actual = new RGB("#123").toString(); - console.log("actual",actual); - expected = "#112233"; - ok(actual==expected,'#112233 is the same as #123'); - - actual = new RGB("#abc").toString(); - console.log("actual",actual); - expected = "#aabbcc"; - ok(actual==expected,'#aabbcc is the same as #abc'); - - actual = new RGB("#123456").toString(); - expected = "#123456"; - ok(actual==expected,'#123456 is the same as #123456'); - - actual = new RGB("rgb(0,255,0)").toString(); - expected = "#00ff00"; - ok(actual==expected,'RGB object created from rgb value > toString method gives hex'); - - actual = new RGB("rgb(120,0,0)").mix(new RGB("#00ff00"),0.5).toString(); - - //120 + (0 - 120) *0.5 and 0 + (255-0) * 0.5 - expected = new RGB("rgb(60,127,0)").toString(); - ok(actual==expected,'RGB mix function proportion 0.5'); - - }); - - -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/SavingRSS.js b/editions/tw2/source/tiddlywiki/test/js/SavingRSS.js deleted file mode 100755 index 6144dc6b2..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/SavingRSS.js +++ /dev/null @@ -1,117 +0,0 @@ -// carried over from jsspec testing -// TBD: refactor out -tests_xml = { - - parse: function(text) { - var doc; - if(window.ActiveXObject) { - doc = new ActiveXObject("Microsoft.XMLDOM"); - doc.async = "false"; - doc.loadXML(text); - } else { - var parser = new DOMParser(); - doc = parser.parseFromString(text,"text/xml"); - } - if(!doc) { - return null; - } - - doc.xpath = function(expression, type) { - var t; - - if(type == "string") { t = XPathResult.STRING_TYPE; } - if(type == "number") { t = XPathResult.NUMBER_TYPE; } - if(type == "boolean") { t = XPathResult.BOOLEAN_TYPE; } - if(type == "singlenode") { t = XPathResult.SINGLENODE_TYPE; } - - var res = this.evaluate(expression, this, null, t, null); - - if(type == "string") { return res.stringValue; } - if(type == "number") { return res.numberValue; } - if(type == "boolean") { return res.booleanValue; } - if(type == "singleNode") { return this.singleNodeValue; } - return null; - }; - - return doc; - } -}; - -jQuery(document).ready(function(){ - - var _username; - module("GenerateRss", { - setup: function() { - _username = config.options.txtUserName; - config.options.txtUserName = "YourName"; - }, - teardown: function() { - config.options.txtUserName = _username; - } - }); - - /* - - - My TiddlyWiki - http://www.tiddlywiki.com/ - a reusable non-linear personal web notebook - en-us - Copyright 2008 YourName - Tue, 15 Apr 2008 11:11:50 GMT - Tue, 15 Apr 2008 11:11:50 GMT - http://blogs.law.harvard.edu/tech/rss - TiddlyWiki 2.4.0 - - - */ - test("generateRss: feed for an empty store", function() { - - var actual, expected; - var rss = generateRss(); - - actual = (typeof rss); - expected = 'string'; - same(actual, expected, 'produces a string value'); - - // - // - // - actual = rss.match(new RegExp(/^<\?xml\s+version=(["'])1.0\1\s*(encoding=(["'])utf-8\2)?\s*\?>/)); - ok(actual, 'should start with an XML 1.0 declaration'); - - xml = tests_xml.parse(rss); - actual = typeof xml; - expected = 'object'; - same(actual, expected, 'should be well-formed XML'); - - actual = xml.documentElement.nodeName; - expected = "rss"; - same(actual, expected, 'document node should be "rss"'); - - actual = xml.documentElement.getAttribute("version"); - expected = "2.0"; - same(actual, expected, 'rss version should be "2.0"'); - - actual = xml.xpath("count(/rss/channel)", "number"); - expected = 1; - same(actual, expected, 'document should have a single channel element'); - - actual = xml.xpath("/rss/channel/title", "string"); - expected = 'My TiddlyWiki'; - same(actual, expected, 'channel title should be the default TiddlyWiki title'); - - actual = xml.xpath("/rss/channel/description", "string"); - expected = 'a reusable non-linear personal web notebook'; - same(actual, expected, 'channel description should be the default TiddlyWiki subtitle'); - - actual = xml.xpath("/rss/channel/language", "string"); - expected = 'en'; - same(actual, expected, 'channel language should be "en"'); - - // Y2K+99 issue - var message = xml.xpath("/rss/channel/copyright", "string"); - actual = message.match(new RegExp(/Copyright 20[0-9]{2,2} YourName/)); - ok(actual, 'channel copyright should be "TiddlyWiki YYYY YourName"'); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Shadows.js b/editions/tw2/source/tiddlywiki/test/js/Shadows.js deleted file mode 100755 index 32688358a..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Shadows.js +++ /dev/null @@ -1,21 +0,0 @@ -jQuery(document).ready(function(){ - - module("TiddlyWiki core"); - - test("Shadow tiddler existence", function() { - expect(2); - - var actual = config.shadowTiddlers["EditTemplate"]; - ok(actual,'EditTemplate shadow tiddler should exist'); - - loadShadowTiddlers(); - actual = config.shadowTiddlers["StyleSheetColors"]; - ok(actual,'StyleSheetColors shadow tiddler should exist'); - - actual = config.shadowTiddlers["SystemSettings"]; - strictEqual(typeof(actual) !== 'undefined',true,'SystemSettings shadow tiddler should exist'); - - }); - - -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Strings.js b/editions/tw2/source/tiddlywiki/test/js/Strings.js deleted file mode 100755 index e40183817..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Strings.js +++ /dev/null @@ -1,70 +0,0 @@ -jQuery(document).ready(function(){ - - module("TiddlyWiki core"); - - test("String functions", function() { - expect(4); - - var actual = "abcdef".right(3); - var expected = "def"; - ok(actual==expected,'String right'); - - actual = " abcdef ".trim(); - expected = "abcdef"; - ok(actual==expected,'String trim'); - - actual = " abc def ".trim(); - expected = "abc def"; - ok(actual==expected,'String trim'); - - actual = "background-color".unDash(); - expected = "backgroundColor"; - ok(actual==expected,'String undash'); - - }); - - test("readMacroParams", function() { - var params = "foo bar dum".readMacroParams(false); - var params2 = "foo bar 'tweedle de' dum".readMacroParams(false); - var params3 = "foo bar 'tweedle dum' dum test:foo test: 'bar' [[check brackets]]".readMacroParams(false); - - strictEqual(params.length, 3, "There are 3 parameters"); - strictEqual(params2.length, 4, "There are 4 parameters"); - strictEqual(params2[2], "tweedle de", "Check parameter in brackets"); - strictEqual(params3[4], "test:foo"); - strictEqual(params3[5], "test:"); - strictEqual(params3[6], "bar"); - strictEqual(params3[7], "check brackets"); - }); - - test("parseParams", function() { - var args = "foo [[bar dum]] test:foo test: bar hello:[[goodbye]] x: [[bar dum]] what:[['fun']] why:'[[test]]'". - parseParams(); - var args2 = "foo [[bar dum]] test:foo test: bar hello:[[goodbye]] x: [[bar dum]] what:[['fun']] why:'[[test]]'". - parseParams("anon"); - var map = args[0]; - var map2 = args2[0]; - - strictEqual(map.anon, undefined, "no unnamed parameters matched"); - strictEqual(map.what.length, 1, "what only matched once"); - strictEqual(map.test.length, 2, "test is a named parameter twice"); - strictEqual(args[2].name, "bar dum", "unnamed parameters are collected in resulting array"); - strictEqual(args[2].value, undefined, "no value for unnamed parameters"); - strictEqual(args[3].value, "foo", "test matches foo"); - strictEqual(args[4].value, "bar", "test matches bar the leading whitespace ignored"); - strictEqual(args[5].value, "goodbye", "checking [[ ]]"); - strictEqual(args[6].value, "bar dum", "checking [[ ]] and ignored leading space"); - strictEqual(args[7].value, "'fun'", "checking the quotes are kept"); - strictEqual(args[8].value, "[[test]]", "checking the brackets are kept in this special case"); - - strictEqual(map2.anon.length, 2, "foo and bar dum matched"); - strictEqual(args2[1].name, "anon", - "unnamed parameters collect as anonymous"); - strictEqual(args2[1].value, "foo", - "unnamed parameters collect as anonymous"); - strictEqual(args2[2].name, "anon", - "unnamed parameters collect as anonymous"); - strictEqual(args2[2].value, "bar dum", "unnamed parameters collect as anonymous"); - strictEqual(args2[3].name, "test", "named parameters collected as normal"); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/TW21Saver.js b/editions/tw2/source/tiddlywiki/test/js/TW21Saver.js deleted file mode 100755 index 389b9b5bd..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/TW21Saver.js +++ /dev/null @@ -1,51 +0,0 @@ -jQuery(document).ready(function(){ - - module("TW21Saver"); - - test("Saving tests", function() { - var store = new TiddlyWiki(); - var saver = store.getSaver(); - - var tiddler = new Tiddler("test"); - tiddler.text = ""; - tiddler.created = version.date; - tiddler.modified = tiddler.created; - - var actual = saver.externalizeTiddler(store,tiddler); - var expected = "
            \n
            \n
            "; - ok(actual==expected,'Saving empty tiddler with no dates'); - - delete tiddler; - tiddler = new Tiddler("test"); - tiddler.text = ""; - tiddler.created = new Date(Date.UTC(2008,3,16,12,34)); - tiddler.modified = tiddler.created; - - actual = saver.externalizeTiddler(store,tiddler); - expected = "
            \n
            \n
            "; - ok(actual==expected,'Saving empty tiddler with created date'); - - delete tiddler; - tiddler = new Tiddler("test"); - tiddler.text = ""; - tiddler.created = new Date(Date.UTC(2008,3,16,12,34)); - tiddler.modified = new Date(Date.UTC(2008,3,17,12,34)); - - actual = saver.externalizeTiddler(store,tiddler); - expected = "
            \n
            \n
            "; - ok(actual==expected,'Saving empty tiddler with created and modified dates'); - - delete tiddler; - tiddler = new Tiddler("test"); - tiddler.text = "text"; - tiddler.created = version.date; - tiddler.modified = tiddler.created; - - actual = saver.externalizeTiddler(store,tiddler); - expected = "
            \n
            text
            \n
            "; - ok(actual==expected,'Saving tiddler with text'); - - }); - - -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Tiddler.js b/editions/tw2/source/tiddlywiki/test/js/Tiddler.js deleted file mode 100755 index 6a98a4e63..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Tiddler.js +++ /dev/null @@ -1,90 +0,0 @@ -jQuery(document).ready(function(){ - - module("Tiddler"); - - test('constructor', function() { - var tiddler = new Tiddler("temp"); - var empty = ""; - same(tiddler.text,"",'Newly created tiddler should have empty string as content'); - tiddler = new Tiddler("temp"); - same(tiddler.created,tiddler.modified,'Created and modified dates should be equal for newly created tiddler'); - tiddler = new Tiddler("temp"); - same(tiddler.getTags(),"",'Newly created tiddler should not have any tags'); - }); - - test('tiddler.isTouched()', function() { - var tiddler = new Tiddler("temp"); - same(tiddler.isTouched(),false,'it should return true if the tiddler has been updated since the tiddler was created or downloaded'); - if(!tiddler.fields['changecount']) - tiddler.fields['changecount'] = 0; - tiddler.fields['changecount']++; - same(tiddler.isTouched(),true,'it should return true if the tiddler has been updated since the tiddler was created or downloaded'); - }); - - test('tiddler.incChangeCount()', function() { - var tiddler = new Tiddler("temp"); - same(tiddler.isTouched(),false,'Tiddler changecount should increment by 1 when incChangeCount is called 1'); - tiddler.incChangeCount(); - same(tiddler.isTouched(),true,'Tiddler changecount should increment by 1 when incChangeCount is called 2'); - }); - - test('tiddler.clearChangeCount()', function() { - var tiddler = new Tiddler("temp"); - same(tiddler.isTouched(),false,'Tiddler changecount should be set to 0 when clearChangeCount is called 1'); - tiddler.incChangeCount(); - same(tiddler.isTouched(),true,'Tiddler changecount should be set to 0 when clearChangeCount is called 2'); - tiddler.clearChangeCount(); - same(tiddler.isTouched(),false,'Tiddler changecount should be set to 0 when clearChangeCount is called 3'); - }); - - test('tiddler.assign()', function() { - function newTiddler() { - var tiddler = new Tiddler("temp"); - tiddler.text = "some text"; - tiddler.modifier = "a modifier"; - tiddler.created = new Date(2008,04,21,01,02,03); - tiddler.modified = new Date(2009,05,22,12,13,14); - return tiddler; - } - - var tiddler = newTiddler(); - tiddler.assign("NewTitle"); - same(tiddler.title,"NewTitle",'Assigning value to tiddler title should override old title 1'); - same(tiddler.text,"some text",'Assigning value to tiddler title should override old title 2'); - same(tiddler.modifier,"a modifier",'Assigning value to tiddler title should override old title 3'); - same(tiddler.created,new Date(2008,04,21,01,02,03),'Assigning value to tiddler title should override old title 4'); - same(tiddler.modified,new Date(2009,05,22,12,13,14),'Assigning value to tiddler title should override old title 5'); - - tiddler = newTiddler(); - tiddler.assign(null,"new text"); - same(tiddler.title,"temp",'Assigning value to tiddler text should override old text 1'); - same(tiddler.text,"new text",'Assigning value to tiddler text should override old text 2'); - same(tiddler.modifier,"a modifier",'Assigning value to tiddler text should override old text 3'); - same(tiddler.created,new Date(2008,04,21,01,02,03),'Assigning value to tiddler text should override old text 4'); - same(tiddler.modified,new Date(2009,05,22,12,13,14),'Assigning value to tiddler text should override old text 5'); - - tiddler = newTiddler(); - tiddler.assign(null,null,"new modifier"); - same(tiddler.title,"temp",'Assigning value to tiddler modifier should override old modifier 1'); - same(tiddler.text,"some text",'Assigning value to tiddler modifier should override old modifier 2'); - same(tiddler.modifier,"new modifier",'Assigning value to tiddler modifier should override old modifier 3'); - same(tiddler.created,new Date(2008,04,21,01,02,03),'Assigning value to tiddler modifier should override old modifier 4'); - same(tiddler.modified,new Date(2009,05,22,12,13,14),'Assigning value to tiddler modifier should override old modifier 5'); - - tiddler = newTiddler(); - tiddler.assign(null,null,null,null,null,new Date(2007,03,20,00,01,02)); - same(tiddler.title,"temp",'Assigning value to tiddler created date should override old created date 1'); - same(tiddler.text,"some text",'Assigning value to tiddler created date should override old created date 2'); - same(tiddler.modifier,"a modifier",'Assigning value to tiddler created date should override old created date 3'); - same(tiddler.created,new Date(2007,03,20,00,01,02),'Assigning value to tiddler created date should override old created date 4'); - same(tiddler.modified,new Date(2009,05,22,12,13,14),'Assigning value to tiddler created date should override old created date 5'); - - tiddler = newTiddler(); - tiddler.assign(null,null,null,new Date(2010,06,23,13,14,15)); - same(tiddler.title,"temp",'Assigning value to tiddler modified date should override old modified date 1'); - same(tiddler.text,"some text",'Assigning value to tiddler modified date should override old modified date 2'); - same(tiddler.modifier,"a modifier",'Assigning value to tiddler modified date should override old modified date 3'); - same(tiddler.created,new Date(2008,04,21,01,02,03),'Assigning value to tiddler modified date should override old modified date 4'); - same(tiddler.modified,new Date(2010,06,23,13,14,15),'Assigning value to tiddler modified date should override old modified date 5'); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/TiddlerFields.js b/editions/tw2/source/tiddlywiki/test/js/TiddlerFields.js deleted file mode 100755 index 5094fbf07..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/TiddlerFields.js +++ /dev/null @@ -1,23 +0,0 @@ -jQuery(document).ready(function(){ - - module("TiddlerFields"); - - test("getValue", function() { - var val = store.getValue("testTiddler2","fieldvalue"); - var val2 = store.getValue("testTiddler2","modified"); - var val3 = store.getValue("testTiddler2","tags"); - var val4 = store.getValue("testTiddler2","::slice"); - var val5 = store.getValue("testTiddler2","##section"); - var val6 = store.getValue("testTiddler2","##section2"); - var val7 = store.getValue("testTiddler2","##Section3"); - var val8 = store.getValue("testTiddler2","FieldValue"); - strictEqual(val, "two"); - strictEqual(val2, "199512010340"); - strictEqual(val3, "testTag twoTag"); - strictEqual(val4, "4t"); - strictEqual(val5, "bar\n"); - strictEqual(val6, "test\n"); - strictEqual(val7, "welcome\n"); - strictEqual(val8, "two"); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/TiddlyWiki.js b/editions/tw2/source/tiddlywiki/test/js/TiddlyWiki.js deleted file mode 100755 index e6c71c109..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/TiddlyWiki.js +++ /dev/null @@ -1,470 +0,0 @@ -jQuery(document).ready(function(){ - var _numTiddlers; - var module_tiddlers = [{title: "tvalue1", tags: ["twtesthello"], fields: {xyz:"bar"}}, - {title: "tvalue2", tags: []}, - {title: "tvalue3", tags: ["twtesthello", "goodbye"], fields: {xyz: "bar"}}, - {title: "tvalue4", tags: ["what"], fields:{xyz:"bar"}}, - {title: "tvalue5", tags: [], fields:{xyz:"barz"}} - ]; - module("TiddlyWiki.js", { - setup: function() { - for(var i = 0; i < module_tiddlers.length; i++) { - var tid = module_tiddlers[i]; - store.saveTiddler(tid.title, tid.title, tid.text, null, null, tid.tags, tid.fields); - } - _numTiddlers = store.getTiddlers().length; - }, - teardown: function() { - _numTiddlers = false; - for(var i = 0; i < module_tiddlers.length; i++) { - var tid = module_tiddlers[i]; - store.removeTiddler(tid.title); - } - } - }); - - test("saveTiddler() fields", function() { - - var store = new TiddlyWiki(); - - var title = "tiddler"; - var text = "text"; - var fields = {a:"aa", b:"bb"}; - config.defaultCustomFields = {}; - var tiddler = store.saveTiddler(title, title, text, null, null, null, fields); - tiddler.clearChangeCount(); - actual = tiddler.fields; - expected = {a:"aa", b:"bb"}; - same(actual,expected,'fields should be unchanged when defaultCustomFields empty'); - - config.defaultCustomFields = {dcf1:"d1", dcf2:"d2"}; - tiddler = store.saveTiddler(title, title, text, null, null, null, fields); - tiddler.clearChangeCount(); - actual = tiddler.fields; - expected = {a:"aa", b:"bb", dcf1:"d1", dcf2:"d2"}; - same(actual,expected,'fields should be merged with defaultCustomFields'); - - config.defaultCustomFields = {a:"xx", b:"yy", dcf1:"d1", dcf2:"d2"}; - tiddler = store.saveTiddler(title, title, text, null, null, null, fields); - tiddler.clearChangeCount(); - actual = tiddler.fields; - expected = {a:"aa", b:"bb", dcf1:"d1", dcf2:"d2"}; - same(actual,expected,'defaultCustomFields should not overwrite fields'); - }); - - test("Slices: calcAllSlices()", function() { - - var store = new TiddlyWiki(); - - var actual = typeof store.calcAllSlices(); - var expected = "object"; - same(actual,expected,'should return an object when not passed any arguments'); - - actual = typeof store.calcAllSlices(""); - expected = "object"; - same(actual,expected,'should return an object when passed an empty string'); - - actual = typeof store.calcAllSlices("MissingTiddler"); - expected = "object"; - same(actual,expected,'should return an object when pointed to a non-existing tiddler'); - - var title = "tiddler"; - var text = "foo: bar"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "foo": "bar" }; - same(actual,expected,'should return an existing slice (colon notation) as a label/value pair'); - - title = "tiddler"; - text = "foo: bar\nlorem: ipsum"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar", lorem: "ipsum" }; - same(actual,expected,'should return existing slices (colon notation) as label/value pairs'); - - title = "tiddler"; - text = "|foo|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should return an existing slice (table notation) as a label/value pair'); - - title = "tiddler"; - text = "|foo|bar|\n|lorem|ipsum|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar", lorem: "ipsum" }; - same(actual,expected,'should return existing slices (table notation) as label/value pairs'); - - title = "tiddler"; - text = "|''foo''|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should strip bold markup from slice labels'); - - title = "tiddler"; - text = "|//foo//|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should strip italic markup from slice labels'); - - title = "tiddler"; - text = "|foo|''bar''|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "''bar''" }; - same(actual,expected,'should not strip markup from slice values'); - - title = "tiddler"; - text = "|~FooBar|baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { FooBar: "baz" }; - same(actual,expected,'should ignore the escaping character for WikiWords in slice labels'); - - title = "tiddler"; - text = "|~foo|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should ignore the escaping character for non-WikiWords in slice labels'); - - title = "tiddler"; - text = "|foo|~BarBaz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "~BarBaz" }; - same(actual,expected,'should not ignore the escaping character for WikiWords in slice values'); - - title = "tiddler"; - text = "|foo|~bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "~bar" }; - same(actual,expected,'should not ignore the escaping character for non-WikiWords in slice values'); - - title = "tiddler"; - text = "|foo bar|baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = {}; - same(actual,expected,'should ignore slices whose label contains spaces'); - - title = "tiddler"; - text = "|foo|bar baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar baz" }; - same(actual,expected,'should not ignore slices whose value contains spaces'); - - title = "tiddler"; - text = "|foo:|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should strip trailing colons from slice labels (table notation)'); - - title = "tiddler"; - text = "''~FooBar:'' baz"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { FooBar: "baz" }; - same(actual,expected,'should strip bold markup from slice labels (colon notation)'); - - title = "tiddler"; - text = "//~FooBar:// baz"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { FooBar: "baz" }; - same(actual,expected,'should strip italic markup from slice labels (colon notation)'); - - title = "tiddler"; - text = "|''~FooBar:''|baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { FooBar: "baz" }; - same(actual,expected,'should strip bold markup from slice labels (table notation)'); - - title = "tiddler"; - text = "|//~FooBar://|baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { FooBar: "baz" }; - same(actual,expected,'should strip italic markup from slice labels (table notation)'); - - title = "tiddler"; - text = "foo: bar: baz"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar: baz" }; - same(actual,expected,'should ignore colons in slice values (colon notation)'); - - title = "tiddler"; - text = "foo.bar: baz"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "foo.bar": "baz" }; - same(actual,expected,'should allow dots in slice labels'); - - title = "tiddler"; - text = "foo: bar|baz"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "foo": "bar|baz" }; - same(actual,expected,'should allow pipes in slice values (colon notation)'); - - title = "tiddler"; - text = "|foo|bar|baz|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "foo": "bar|baz" }; -// same(actual,expected,'should allow pipes in slice values (table notation)'); - - title = "tiddler"; - text = "foo: lorem [[bar|baz]] ipsum"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "lorem [[bar|baz]] ipsum" }; - same(actual,expected,'should retrieve slices containing PrettyLinks (colon notation)'); - - title = "tiddler"; - text = "foo: lorem [img[qux|bar.baz]] ipsum"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "lorem [img[qux|bar.baz]] ipsum" }; - same(actual,expected,'should retrieve slices containing image markup (colon notation)'); - - /* - // FAILURE - // ticket #522 (http://trac.tiddlywiki.org/ticket/522) - title = "tiddler"; - text = "//{{{\nfoo: bar;\n//}}}"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = {}; - same(actual,expected,'should disregard apparent slices within code sections'); - */ - title = "tiddler"; - text = "{\n\tfoo: 'bar'\n}\n"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = {}; - same(actual,expected,'should disregard slices within JSON structures'); - }); - - test("Slices: getTiddlerSlice()", function() { - var store = new TiddlyWiki(); - - var actual = store.getTiddlerSlice(); - var expected = undefined; - same(actual,expected,'should return undefined when not passed any arguments'); - - actual = store.getTiddlerSlice("tiddler", "foo"); - expected = undefined; - same(actual,expected,'should return undefined when pointed to non-existing tiddler'); - - title = "tiddler"; - text = "foo bar\nbaz"; - store.saveTiddler(title, title, text); - actual = store.getTiddlerSlice(title, "foo"); - expected = undefined; - same(actual,expected,'should return undefined when pointed to non-existing slice'); - - title = "tiddler"; - text = "foo: bar"; - store.saveTiddler(title, title, text); - actual = store.getTiddlerSlice(title, "foo"); - expected = "bar"; - same(actual,expected,'should return slice value when given slice label (colon notation)'); - - title = "tiddler"; - text = "|foo|bar|"; - store.saveTiddler(title, title, text); - actual = store.getTiddlerSlice(title, "foo"); - expected = "bar"; - same(actual,expected,'should return slice value when given slice label (table notation)'); - - /* - // FAILURE - // ticket #370 (http://trac.tiddlywiki.org/ticket/370) - title = "tiddler"; - text = "|!foo|bar|"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { foo: "bar" }; - same(actual,expected,'should strip heading markup from slice labels (table notation)'); - - // FAILURE - // ticket #370 (http://trac.tiddlywiki.org/ticket/370) - title = "tiddler"; - text = "[[foo]]: bar"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "foo": "bar" }; - same(actual,expected,'should strip double brackets (PrettyLinks) from slice labels'); - - // FAILURE - // ticket #370 (http://trac.tiddlywiki.org/ticket/370) - title = "tiddler"; - text = "[foo]: bar"; - store.saveTiddler(title, title, text); - actual = store.calcAllSlices(title); - expected = { "[foo]": "bar" }; - same(actual,expected,'should allow brackets in slice labels'); - */ - - }); - - - test("getTaggedTiddlers", function() { - var tiddlers = store.getTaggedTiddlers("twtesthello"); - strictEqual(tiddlers.length, 2, 'No message'); - }); - - test("getValueTiddlers", function() { - var tiddlers = store.getValueTiddlers("xyz", "bar"); - var tiddlers2 = store.getValueTiddlers("tags", "twtesthello"); - strictEqual(tiddlers.length, 3, 'No message'); - }); - - test("filterTiddlers", function() { - var tiddlers = store.filterTiddlers("[tag[twtesthello]]"); - var tiddlers2 = store.filterTiddlers("[xyz[bar]]"); - var tiddlers3 = store.filterTiddlers("[tag[twtesthello]][limit[1]]"); - var tiddlers4 = store.filterTiddlers("[xyz[bar]][limit[2]]"); - strictEqual(tiddlers.length, 2, 'No message'); - strictEqual(tiddlers2.length, 3, 'No message'); - strictEqual(tiddlers3.length, 1, 'No message'); - strictEqual(tiddlers4.length, 2, 'No message'); - }); - - test("reverseLookup (custom fields)", function() { - var lookupField = "server.bag"; - var lookupValue = "foo"; - var sortField = "modified"; - var tiddlers = store.reverseLookup(lookupField,lookupValue,true,sortField); - var tiddlers2 = store.reverseLookup(lookupField,lookupValue,false,sortField); - strictEqual(tiddlers.length, 1); - strictEqual(tiddlers[0].title, "testTiddler3"); - strictEqual(tiddlers2.length, _numTiddlers - 1, "returns all the tiddlers minus the one with this field match"); - }); - - test("reverseLookup (tags)", function() { - var lookupField = "tags"; - var lookupValue = "testTag"; - var sortField = "title"; - var tiddlers = store.reverseLookup(lookupField,lookupValue,true,sortField); - var tiddlers2 = store.reverseLookup(lookupField,lookupValue,false,sortField); - strictEqual(tiddlers.length, 3); - strictEqual(tiddlers[0].title, "testTiddler1"); - strictEqual(tiddlers[1].title, "testTiddler2"); - strictEqual(tiddlers[2].title, "testTiddler3"); - strictEqual(tiddlers2.length, _numTiddlers - 3, "returns all the tiddlers minus the three tiddler with this tag"); - }); - - test("reverseLookup (links)", function() { - var lookupField = "links"; - var lookupValue = "testTiddler2"; - var sortField = "title"; - var tiddlers = store.reverseLookup(lookupField,lookupValue,true,sortField); - var tiddlers2 = store.reverseLookup(lookupField,lookupValue,false,sortField); - strictEqual(tiddlers.length, 1); - strictEqual(tiddlers[0].title, "testTiddler3"); - strictEqual(tiddlers2.length, _numTiddlers - 1, "returns all the tiddlers minus the one tiddler with this link"); - }); - - test("reverseLookup (attribute)", function() { - var lookupField = "creator"; - var lookupValue = "martin"; - var sortField = "title"; - var tiddlers = store.reverseLookup(lookupField,lookupValue,true,sortField); - var tiddlers2 = store.reverseLookup(lookupField,lookupValue,false,sortField); - strictEqual(tiddlers.length, 1); - strictEqual(tiddlers[0].title, "testTiddler3"); - strictEqual(tiddlers2.length, _numTiddlers - 1, "returns all the tiddlers minus the one tiddler created by martin"); - }); - - var _loadFromDiv, storeArea; - module("TiddlyWiki.js - importTiddlyWiki", { - setup: function() { - _loadFromDiv = TiddlyWiki.prototype.loadFromDiv; - TiddlyWiki.prototype.loadFromDiv = function(area) { - storeArea = area; - }; - }, - teardown: function() { - TiddlyWiki.prototype.loadFromDiv = _loadFromDiv; - storeArea = null; - } - }); - - test("importTiddlyWiki empty store", function() { - var html = ['', '', - '
            ', '
            ', - '', ''].join("\n"); - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - }); - - test("importTiddlyWiki empty store (post body start)", function() { - var html = ['', - '', - '
            ', '
            ', - ,'',''].join("\n"); - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - }); - - test("importTiddlyWiki empty store (minified test)", function() { - var html = ['', - '', - '
            ', '
            ', - ,'',''].join(""); // join without newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - }); - - test("importTiddlyWiki empty store (minified test)", function() { - var html = ['', - '', - '
            hello
            ', '
            ', - ,'',''].join(""); // join without newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - strictEqual($(".tiddler", storeArea).length, 1, "there is one element with class tiddler within the element"); - }); - - test("importTiddlyWiki empty store (no comments)", function() { - var html = ['','
            hello
            ', - ''].join(""); // join without newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - strictEqual($(".tiddler", storeArea).length, 1, "there is one element with class tiddler within the element"); - }); - - test("importTiddlyWiki empty store (upper case tags)", function() { - var html = ['','
            hello
            ', - ''].join("\n"); // join with newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - strictEqual($(".tiddler", storeArea).length, 1, "there is one element with class tiddler within the element"); - }); - - test("importTiddlyWiki empty store (storeArea in single quotes)", function() { - var html = ["","
            ",'
            hello
            ', - ''].join("\n"); // join with newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - strictEqual($(".tiddler", storeArea).length, 1, "there is one element with class tiddler within the element"); - }); - - test("importTiddlyWiki empty store (storeArea with no quotes)", function() { - var html = ["","
            ",'
            hello
            ', - ''].join("\n"); // join with newlines - store.importTiddlyWiki(html); - strictEqual($(storeArea).attr("id"), "storeArea", "make sure a storeArea was found"); - strictEqual($(".tiddler", storeArea).length, 1, "there is one element with class tiddler within the element"); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Utilities.js b/editions/tw2/source/tiddlywiki/test/js/Utilities.js deleted file mode 100755 index c4f7be08c..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Utilities.js +++ /dev/null @@ -1,572 +0,0 @@ -jQuery(document).ready(function() { - - function makeTestNode() { - return $("
            ")[0]; - } - - function removeTestNode() {} - - module("Utilities"); - - test("Utilities: formatVersion", function() { - - var actual, expected; - - v = { - major:1, - minor:2, - revision:3 - }; - v_beta = { - major:1, - minor:2, - revision:3, - beta:true - }; - v_alpha = { - major:1, - minor:2, - revision:3, - alpha:true - }; - - actual = formatVersion(v); - expected = v.major+"."+v.minor+"."+v.revision; - same(actual, expected, "it should use a version object if one is passed as a parameter, which has properties: major, minor, revision, beta (optional) and format the output as 'major.minor.revision'"); - - actual = formatVersion(); - expected = version.major+"."+version.minor+"."+version.revision+(version.beta?" (beta "+version.beta+")" : "")+(version.alpha?" (alpha "+version.alpha+")" : ""); - same(actual, expected, 'it doesn\'t need to take an argument, in which case it will use the global "version" variable'); - - actual = typeof formatVersion(); - expected = "string"; - same(actual, expected, 'it should return a string'); - - actual = formatVersion(v_beta).indexOf("beta "+v_beta.beta) != -1; - same(actual, true, 'it should append the string " (beta #)", where # is the beta number if the beta number is set'); - - actual = formatVersion(v_alpha).indexOf("alpha "+v_alpha.alpha) != -1; - same(actual, true, 'it should append the string " (alpha #)", where # is the alpha number if the alpha number is set'); - - }); - - - test("Utilities functions: compareVersions", function() { - - var v1, v1_beta, v2, message; - function setUp(_message) { - message = _message; - v1 = { - major:1, - minor:2, - revision:3 - }; - v1_beta = { - major:1, - minor:2, - revision:3, - beta:true - }; - v2 = { - major:v1.major, - minor:v1.minor, - revision:v1.revision - }; - } - - setUp('it should return +1 if the second version is later than the first'); - v2.major = v1.major+1; - var actual = compareVersions(v1,v2); - var expected = 1; - same(actual,expected,message); - v2.major--; - v2.minor = v1.minor+1; - actual = compareVersions(v1,v2); - expected = 1; - same(actual,expected,message); - v2.minor--; - v2.revision = v1.revision+1; - actual = compareVersions(v1,v2); - expected = 1; - same(actual,expected,message); - - setUp('it should return 0 if the second version is the same as the first'); - actual = compareVersions(v1,v2); - expected = 0; - same(actual,expected,message); - - setUp('it should return -1 if the second version is earlier than the first'); - v2.major = v1.major-1; - actual = compareVersions(v1,v2); - expected = -1; - same(actual,expected,message); - v2.major++; - v2.minor = v1.minor-1; - actual = compareVersions(v1,v2); - expected = -1; - same(actual,expected,message); - v2.minor++; - v2.revision = v1.revision-1; - actual = compareVersions(v1,v2); - expected = -1; - same(actual,expected,message); - - setUp('it should treat versions without a beta number as later than a version without a beta number'); - actual = compareVersions(v1,v1_beta); - expected = -1; - same(actual,expected,message); - - }); - - - test("createTiddlyText", function() { - expect(1); - - var parent = makeTestNode(); - createTiddlyText(parent, "
            "); - createTiddlyText(parent, "a"); - createTiddlyText(parent, "
            "); - equals(parent.innerHTML, "<div>a</div>", "createTiddlyText should append text node, not html element"); - - removeTestNode(); - }); - - - test("createTiddlyElement", function() { - expect(4); - - ok(createTiddlyElement(null,"div"), "Element creation should create the DOM element"); - - createTiddlyElement( makeTestNode(),"div"); - ok($('#testElement div'), 'Setting the parent parameter should append the new DOM element to the parent'); - removeTestNode(); - - createTiddlyElement(null,"div",'testID'); - ok($('#testID'), 'Setting the element id parameter should set the id on the DOM element'); - - createTiddlyElement(null,"div", null, 'testClass'); - ok($('div.testClass'), 'Setting the element class parameter should set the class on the DOM element'); - - }); - - - test("Utilities: createTiddlyButton(parent,text,tooltip,action,className,id,accessKey,attribs)", function() { - - function setUp(_message) { - message = _message; - parent = document.body; - text = "hi!"; - tooltip = "a tooltip"; - action = function() { alert('clicked!'); }; - className = "testButton"; - id = "testButtonId"; - accessKey = "b"; - attribs = { - style:"display:none;" - }; - btn = createTiddlyButton(parent,text,tooltip,action,className,id,accessKey,attribs); - } - - setUp('it should create an anchor element as a child of the parent element provided'); - var before = document.body.childNodes.length; - btn = createTiddlyButton(parent,text,tooltip,action,className,id,accessKey,attribs); - var after = document.body.childNodes.length; - var actual = after-before; - var expected = 1; - same(actual,expected,message); - actual = document.body.childNodes[after-1].nodeName; - expected = "A"; - same(actual,expected,message); - - setUp('it should set the onclick function to the provided action parameter'); - actual = btn.onclick; - expected = action; - same(actual,expected,message); - - setUp('it should set the anchor href to null if no action parameter is provided'); - actual = btn.href; - expected = "javascript:;"; - same(actual,expected,message); - - setUp('it should set the anchor title to the provided tooltip paramater'); - actual = btn.title; - expected = tooltip; - same(actual,expected,message); - - setUp('it should set the contained text to the provided text parameter'); - actual = btn.innerText || btn.textContent; - expected = text; - same(actual,expected,message); - - setUp('it should set the anchor class to the provdided className parameter'); - actual = btn.className; - expected = className; - - setUp('it should set the anchor class to "button" if no className parameter is provided'); - var btn2 = createTiddlyButton(parent,text,tooltip,action,null,id,accessKey,attribs); - actual = btn2.className; - expected = "button"; - same(actual,expected,message); - - setUp('it should set the anchor id to the provided id parameter'); - actual = btn.id; - expected = id; - same(actual,expected,message); - - setUp('it should set any attributes on the anchor that are provided in the attribs object'); - for(i in attribs) { - same(btn.i, attribs.i, message); - } - - // No tests in jsspec - // 'it should set the anchor accessKey attribute to the provided accessKey parameter': function() {} - - setUp('it should return the anchor element'); - actual = btn.nodeName; - expected = "A"; - same(actual,expected,message); - - setUp('it should not require any parameters and still return an anchor element'); - actual = createTiddlyButton().nodeName; - expected = "A"; - same(actual,expected,message); - }); - - test("Utilities: createTiddlyLink trailing whitespace", function() { - var place = $("
            ")[0] - var link = createTiddlyLink(place," testTiddler1 "); - strictEqual($(link).attr("tiddlylink"), "testTiddler1", "attribute has been set without leading or trailing whitespace"); - strictEqual($(link).hasClass("tiddlyLinkExisting"), true, - "has matched testTiddler1 not a tiddler with leading and trailing whitespace") - }); - - test("Utilities: createTiddlyLink(place,title,includeText,className,isStatic,linkedFromTiddler,noToggle)", function() { - - function setUp(_message) { - message = _message; - store = new TiddlyWiki(); - title = "test"; - t = new Tiddler(title); - t_linked_from = new Tiddler("linkedFrom"); - t_linked_from.fields = { - "server.host":"host", - "server.workspace":"workspace", - "wikiformat":"wikiformat", - "server.type":"type" - }; - place = document.body; - includeText = true; - className = "testLink"; - isStatic = "true"; - linkedFromTiddler = t_linked_from; - noToggle = "true"; - btn = createTiddlyLink(place,title,includeText,className,false,linkedFromTiddler,noToggle); - btn_external = createTiddlyLink(place,title,includeText,className,isStatic,linkedFromTiddler,noToggle); - } - - setUp('it should add a link as child of the "place" DOM element (internal)'); - var before = place.childNodes; - var expected = before.length+1; - createTiddlyLink(place,title); - var actual = place.childNodes.length; - same(actual,expected,message); - actual = place.childNodes[place.childNodes.length-1].nodeName; - expected = "A"; - same(actual,expected,message); - - setUp('it should set the "tiddlyLink" attribute on the link to the provided "title" parameter (internal)'); - actual = btn.getAttribute("tiddlyLink"); - expected = title; - same(actual,expected,message); - - setUp('it should set the "tiddlyLink" attribute on the link to the provided "title" parameter (external)'); - actual = btn_external.getAttribute("tiddlyLink"); - expected = title; - same(actual,expected,message); - - setUp('it should include the title as the text of this link if the "includeText" parameter is set to true (internal)'); - actual = btn.innerText || btn.textContent; - expected = title; - same(actual,expected,message); - - setUp('it should include the title as the text of this link if the "includeText" parameter is set to true (external)'); - actual = btn_external.innerText || btn.textContent; - expected = title; - same(actual,expected,message); - - setUp('it should not include any text in the link if the "includeText" parameter is not set or false'); - btn = createTiddlyLink(place,title); - actual = btn.innerText || btn.textContent; - expected = ""; - same(actual,expected,message); - - setUp('it should add the provided "className" parameter to the class of the link (internal)'); - actual = btn.className.indexOf(className) != -1; - same(actual,true,message); - - /* BUG IN DOCS: THIS IS ONLY TRUE IF THE LINK IS INTERNAL */ - /* see http://groups.google.com/group/TiddlyWikiDev/browse_thread/thread/3e8c2de8d7b0fbfa */ - setUp('it should add the provided "className" parameter to the class of the link (external)'); - actual = btn_external.className.indexOf(className) != -1; - same(actual,true,message); - - setUp('it should set the "tiddlyFields" attribute on the link to be the fields from any tiddler referred to in the provided "linkedFromTiddler" parameter (internal)'); - actual = btn.getAttribute("tiddlyFields"); - expected = linkedFromTiddler.getInheritedFields(); - same(actual,expected,message); - - setUp('it should set the "tiddlyFields" attribute on the link to be the fields from any tiddler referred to in the provided "linkedFromTiddler" parameter (external)'); - actual = btn_external.getAttribute("tiddlyFields"); - expected = linkedFromTiddler.getInheritedFields(); - same(actual,expected,message); - - setUp('it should set the "noToggle" attribute on the link to "true" if the provided "noToggle" parameter is set (internal)'); - actual = btn.getAttribute("noToggle"); - expected = "true"; - same(actual,expected,message); - - setUp('it should set the "noToggle" attribute on the link to "true" if the provided "noToggle" parameter is set (external)'); - actual = btn_external.getAttribute("noToggle"); - expected = "true"; - same(actual,expected,message); - - setUp('it should set the "refresh" attribute on the link to "link" (internal)'); - actual = btn.getAttribute("refresh"); - expected = "link"; - same(actual,expected,message); - - setUp('it should set the "refresh" attribute on the link to "link" (external)'); - actual = btn_external.getAttribute("refresh"); - expected = "link"; - same(actual,expected,message); - - // BROKEN - // setUp('it should create a permalink if the "isStatic" parameter is set (internal)'); - // actual = btn.href.indexOf("#") != -1; - // same(actual,true,message); - - setUp('it should create a permalink if the "isStatic" parameter is set (external)'); - actual = btn_external.href.indexOf("#") != -1; - same(actual,true,message); - - setUp('it should return a reference to the link (internal)'); - actual = btn.nodeName; - expected = "A"; - same(actual,expected,message); - - setUp('it should return a reference to the link (external)'); - actual = btn_external.nodeName; - expected = "A"; - same(actual,expected,message); - - }); - - - test('Utilities: refreshTiddlyLink(e,title)', function() { - - function setUp(_message) { - message = _message; - store = new TiddlyWiki(); - loadShadowTiddlers(); - not_a_tiddler = null; - store.saveTiddler("a_tiddler","a_tiddler"); - store.saveTiddler("another_tiddler","another_tiddler"); - place = document.body; - btn = createTiddlyLink(place,"a_tiddler"); - } - - setUp('it should update the className attribute of the "e" element if "title" is the name of a non-existant tiddler'); - refreshTiddlyLink(btn,not_a_tiddler); - expected = ["tiddlyLink","tiddlyLinkNonExisting"]; - actual = btn.className.readBracketedList(); - for(var i=0;ibold", - italic:"italic", - underline:"underline", - superscript:"superscript", - subscript:"subscript", - strikeout:"strikeout", - code:"code" - }; - - formatter = new Formatter(config.formatters); - var actual = ""; - var expected = ""; - for (var i in wikifier_input_strings) { - actual = wikifyStatic(wikifier_input_strings[i]).toLowerCase(); - expected = wikifier_output_strings[i]; - equals(actual,expected,'testing input strings for Formatter.characterFormat'+wikifier_input_strings[i]); - } - - formatter = new Formatter(config.formatters); - expected = '
          1. ab
            cd
            '; - actual = wikifyStatic("|a|b|\n|c|d|").toLowerCase(); - equals(actual,expected,'testing table formatting'); - }); - - test('Wikifier: wikifyStatic() 2', function() { - var expected = ""; - var actual = wikifyStatic(null); - equals(actual,expected,'it should return an empty string if source does not exist'); - actual = wikifyStatic(""); - equals(actual,expected,'it should return an empty string if source is an empty string'); - - source = "some text"; - actual = wikifyStatic(source); - ok(actual,'it should not require a tiddler to work'); - - /*'it should call subWikify() with the pre block as the only parameter': function() { - var funcToMock = 'Wikifier.prototype.subWikify'; - tests_mock.before(funcToMock,function() { - tests_mock.frame[funcToMock].funcArgs = arguments; - }); - wikifyStatic(source); - var tests_mock_return = tests_mock.after(funcToMock); - var expected = "PRE"; - equals(tests_mock_return.called,true); - equals(tests_mock_return.funcArgs.length,1); - equals(tests_mock_return.funcArgs[0].nodeName,expected); - },*/ - - expected = "string"; - actual = typeof wikifyStatic(source); - equals(actual,expected,'it should return a text string'); - - place = document.createElement("div"); - d = document.body.appendChild(place); - d.style.display = "none"; - expected = document.body.childNodes.length; - var html = wikifyStatic(source); - actual = document.body.childNodes.length; - equals(actual,expected,'it should not leave any elements attached to the document body after returning'); - removeNode(d); - }); - - test('Wikifier: wikifyStatic() 3 htmlEntitiesEncoding', function() { - wikifier_input_strings = { - illegal01:"&a#x0301;", - e160:" ", - e161:"¡", - e162:"¢", - e163:"£", - e255:"ÿ", - e8800:"≠", - e0x300:"̀", - e0x0300:"̀" - }; - - wikifier_output_strings = { - illegal01:"&a#x0301;", - e160:" ", - e161:"¡", - e162:"¢", - e163:"£", - e255:"ÿ", - e8800:"≠", - e0x300:"Ì€", - e0x0300:"Ì€" - }; - - formatter = new Formatter(config.formatters); - var actual = ""; - var expected = ""; - for (var i in wikifier_input_strings) { - actual = wikifyStatic(wikifier_input_strings[i]).toLowerCase(); - expected = wikifier_output_strings[i]; - equals(actual,expected,'testing input strings for Formatter.htmlEntitiesEncoding'+wikifier_input_strings[i]); - } - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Wizard.js b/editions/tw2/source/tiddlywiki/test/js/Wizard.js deleted file mode 100755 index de0517ff7..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Wizard.js +++ /dev/null @@ -1,59 +0,0 @@ -jQuery(document).ready(function(){ - - module("Wizard.js"); - - test("Wizard: construction", function() { - expect(1); - - var w = new Wizard(); - var actual = w.formElem===null && w.bodyElem===null && w.footElem===null; - ok(actual==true,'properties should be null when constructed with no parameters'); - - }); - - test("Wizard: setValue / getValue (no formEl)", function() { - var w = new Wizard(); - var val1 = w.getValue("test"); - w.setValue("test", "foo"); - var val2 = w.getValue("test"); - strictEqual(val1, null, "no value set"); - strictEqual(val2, null, "value could not be set as no formEl"); - }); - - test("Wizard: setValue / getValue (formEl)", function() { - var w = new Wizard(); - w.createWizard($("
            ")[0], "My Title"); - var val1 = w.getValue("test1"); - var elem = $("
            ").addClass("foo")[0]; - w.setValue("test1", "foo"); - w.setValue("test2", ["a list", "of items"]); - w.setValue("test3", { name: "data", val: "foo" }); - w.setValue("test4", elem); - var val2 = w.getValue("test1"); - var val3 = w.getValue("test2"); - var val4 = w.getValue("test3"); - var val5 = w.getValue("test4"); - - strictEqual(val1, undefined, "no value set but returns undefined if formEl exists"); - strictEqual(val2, "foo", "value should be set in this situation"); - strictEqual(val3.length, 2, "array set successfully (1/2)"); - strictEqual(val3[0], "a list", "array set successfully (2/2)"); - strictEqual(val4.name, "data", "object set successfully"); - strictEqual($(val5).hasClass("foo"), true, "element set successfully"); - }); - - test("Wizard: createWizard", function() { - var elem = $(place)[0]; - var wizard = new Wizard(); - wizard.createWizard(place, 'Import a TiddlyWiki'); - strictEqual(wizard.formElem.nodeName, "FORM", "a form element set."); - }); - - test("Wizard: setValue of existing property name on node", function() { - var w = new Wizard(); - w.createWizard($("
            ")[0], "My Title"); - w.setValue("nodeName", "foo"); - var mode = w.getValue("nodeName"); - strictEqual(mode, "foo", "reserved names should be possible to set.") - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/Zoomer.js b/editions/tw2/source/tiddlywiki/test/js/Zoomer.js deleted file mode 100755 index 3260ea900..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/Zoomer.js +++ /dev/null @@ -1,32 +0,0 @@ -jQuery(document).ready(function(){ - - module("Zoomer"); - - test("Zoomer functions", function() { - - var zoomer_elem = document.body.appendChild(document.createElement("div")); - var zoomer_text = "hi!"; - var actual = new Zoomer(zoomer_text,zoomer_elem,zoomer_elem); - - ok(actual,'it should return a Morpher object'); - - delete zoomer_elem; - delete zoomer_text; - - zoomer_elem = document.body.appendChild(document.createElement("div")); - zoomer_text = "hi!"; - - var before = document.body.childNodes.length; - var z = new Zoomer(zoomer_text,zoomer_elem,zoomer_elem); - var after = document.body.childNodes.length; - actual = after - before; - var expected = 1; - same(actual,expected,'it should create a div as child of the body'); - actual = document.body.childNodes[document.body.childNodes.length-1].nodeName; - expected = "DIV"; - same(actual,expected,'it should create a div with the class of "zoomer"'); - - delete zoomer_elem; - delete zoomer_text; - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/js/split.recipe b/editions/tw2/source/tiddlywiki/test/js/split.recipe deleted file mode 100755 index a444c4ada..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/split.recipe +++ /dev/null @@ -1,26 +0,0 @@ -jquery: Animator.js -jquery: SavingRSS.js -jquery: Numbers.js -jquery: Arrays.js -jquery: Crypto.js -jquery: DOM.js -jquery: Dates.js -jquery: Encoding.js -jquery: FileSystem.js -jquery: LoadingSaving.js -jquery: Macros.js -#jquery: main.js -jquery: Options.js -jquery: RGB.js -jquery: Shadows.js -jquery: Strings.js -jquery: Tiddler.js -jquery: TiddlerFields.js -jquery: TiddlyWiki.js -jquery: Filters.js -jquery: TW21Saver.js -jquery: Utilities.js -jquery: Version.js -jquery: Wikifier.js -jquery: Wizard.js -#jquery: Zoomer.js diff --git a/editions/tw2/source/tiddlywiki/test/js/template.js b/editions/tw2/source/tiddlywiki/test/js/template.js deleted file mode 100755 index 2285a824c..000000000 --- a/editions/tw2/source/tiddlywiki/test/js/template.js +++ /dev/null @@ -1,11 +0,0 @@ -jQuery(document).ready(function() { - module(""); - - test("
            ", function() { - var actual, expected; - - actual = <...>; - expected = <...>; - same(actual, expected, ""); - }); -}); diff --git a/editions/tw2/source/tiddlywiki/test/qunit/delayTestExecution.js b/editions/tw2/source/tiddlywiki/test/qunit/delayTestExecution.js deleted file mode 100755 index 2f3817b7e..000000000 --- a/editions/tw2/source/tiddlywiki/test/qunit/delayTestExecution.js +++ /dev/null @@ -1,9 +0,0 @@ -jQuery(document).ready(function() { - test("Wait until TiddlyWiki starts", function() { - stop(); - }); -}); - -jQuery().bind("startup", function() { - start(); -}); diff --git a/editions/tw2/source/tiddlywiki/test/qunit/qunit.css b/editions/tw2/source/tiddlywiki/test/qunit/qunit.css deleted file mode 100755 index 10e765761..000000000 --- a/editions/tw2/source/tiddlywiki/test/qunit/qunit.css +++ /dev/null @@ -1,163 +0,0 @@ -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 15px 15px 0 0; - -moz-border-radius: 15px 15px 0 0; - -webkit-border-top-right-radius: 15px; - -webkit-border-top-left-radius: 15px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0em 0 0.5em 2em; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests ol { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 15px; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - - box-shadow: inset 0px 2px 13px #999; - -moz-box-shadow: inset 0px 2px 13px #999; - -webkit-box-shadow: inset 0px 2px 13px #999; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - margin: 0.5em; - padding: 0.4em 0.5em 0.4em 0.5em; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #5E740B; - background-color: #fff; - border-left: 26px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 26px solid #EE5757; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail, -#qunit-testrunner-toolbar { background-color: #EE5757; } - - -/** Footer */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-radius: 0 0 15px 15px; - -moz-border-radius: 0 0 15px 15px; - -webkit-border-bottom-right-radius: 15px; - -webkit-border-bottom-left-radius: 15px; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; -} diff --git a/editions/tw2/source/tiddlywiki/test/qunit/qunit.js b/editions/tw2/source/tiddlywiki/test/qunit/qunit.js deleted file mode 100755 index d54b72ae6..000000000 --- a/editions/tw2/source/tiddlywiki/test/qunit/qunit.js +++ /dev/null @@ -1,1297 +0,0 @@ -/* - * QUnit - A JavaScript Unit Testing Framework - * - * http://docs.jquery.com/QUnit - * - * Copyright (c) 2009 John Resig, Jörn Zaefferer - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - */ - -(function(window) { - -var QUnit = { - - // call on start of module test to prepend name to all tests - module: function(name, testEnvironment) { - config.currentModule = name; - - synchronize(function() { - if ( config.previousModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - config.previousModule = config.currentModule; - config.currentModule = name; - config.moduleTestEnvironment = testEnvironment; - config.moduleStats = { all: 0, bad: 0 }; - - QUnit.moduleStart( name, testEnvironment ); - }); - }, - - asyncTest: function(testName, expected, callback) { - if ( arguments.length === 2 ) { - callback = expected; - expected = 0; - } - - QUnit.test(testName, expected, callback, true); - }, - - test: function(testName, expected, callback, async) { - var name = '' + testName + '', testEnvironment, testEnvironmentArg; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - // is 2nd argument a testEnvironment? - if ( expected && typeof expected === 'object') { - testEnvironmentArg = expected; - expected = null; - } - - if ( config.currentModule ) { - name = '' + config.currentModule + ": " + name; - } - - if ( !validTest(config.currentModule + ": " + testName) ) { - return; - } - - synchronize(function() { - - testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, config.moduleTestEnvironment); - if (testEnvironmentArg) { - extend(testEnvironment,testEnvironmentArg); - } - - QUnit.testStart( testName, testEnvironment ); - - // allow utility functions to access the current test environment - QUnit.current_testEnvironment = testEnvironment; - - config.assertions = []; - config.expected = expected; - - var tests = id("qunit-tests"); - if (tests) { - var b = document.createElement("strong"); - b.innerHTML = "Running " + name; - var li = document.createElement("li"); - li.appendChild( b ); - li.id = "current-test-output"; - tests.appendChild( li ); - } - - try { - if ( !config.pollution ) { - saveGlobal(); - } - - testEnvironment.setup.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Setup failed on " + name + ": " + e.message ); - } - }); - - synchronize(function() { - if ( async ) { - QUnit.stop(); - } - - try { - callback.call(testEnvironment); - } catch(e) { - fail("Test " + name + " died, exception and test follows", e, callback); - QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - start(); - } - } - }); - - synchronize(function() { - try { - checkPollution(); - testEnvironment.teardown.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Teardown failed on " + name + ": " + e.message ); - } - }); - - synchronize(function() { - var good = 0, bad = 0, - tests = id("qunit-tests"); - - config.stats.all += config.assertions.length; - config.moduleStats.all += config.assertions.length; - - if ( tests ) { - var ol = document.createElement("ol"); - - for ( var i = 0; i < config.assertions.length; i++ ) { - var assertion = config.assertions[i]; - - var li = document.createElement("li"); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed"); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - if (bad == 0) { - ol.style.display = "none"; - } - - var b = document.createElement("strong"); - b.innerHTML = name + " (" + bad + ", " + good + ", " + config.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling, display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function(e) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location.search = "?" + encodeURIComponent(getText([target]).replace(/\(.+\)$/, "").replace(/(^\s*|\s*$)/g, "")); - } - }); - - var li = id("current-test-output"); - li.id = ""; - li.className = bad ? "fail" : "pass"; - li.style.display = resultDisplayStyle(!bad); - li.removeChild( li.firstChild ); - li.appendChild( b ); - li.appendChild( ol ); - - if ( bad ) { - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "block"; - id("qunit-filter-pass").disabled = null; - id("qunit-filter-missing").disabled = null; - } - } - - } else { - for ( var i = 0; i < config.assertions.length; i++ ) { - if ( !config.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - try { - QUnit.reset(); - } catch(e) { - fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, QUnit.reset); - } - - if ( config.expected && config.expected != config.assertions.length ) { - QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" ); - } - - QUnit.testDone( testName, bad, config.assertions.length ); - - if ( !window.setTimeout && !config.queue.length ) { - done(); - } - }); - - synchronize( done ); - }, - - /** - * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - */ - expect: function(asserts) { - config.expected = asserts; - }, - - /** - * Asserts true. - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function(a, msg) { - a = !!a; - var details = { - result: a, - message: msg - }; - msg = escapeHtml(msg); - QUnit.log(a, msg, details); - config.assertions.push({ - result: a, - message: msg - }); - }, - - /** - * Checks that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * - * Prefered to ok( actual == expected, message ) - * - * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." ); - * - * @param Object actual - * @param Object expected - * @param String message (optional) - */ - equal: function(actual, expected, message) { - QUnit.push(expected == actual, actual, expected, message); - }, - - notEqual: function(actual, expected, message) { - QUnit.push(expected != actual, actual, expected, message); - }, - - deepEqual: function(actual, expected, message) { - QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); - }, - - notDeepEqual: function(actual, expected, message) { - QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message); - }, - - strictEqual: function(actual, expected, message) { - QUnit.push(expected === actual, actual, expected, message); - }, - - notStrictEqual: function(actual, expected, message) { - QUnit.push(expected !== actual, actual, expected, message); - }, - - raises: function(fn, message) { - try { - fn(); - ok( false, message ); - } - catch (e) { - ok( true, message ); - } - }, - - start: function() { - // A slight delay, to avoid any current callbacks - if ( window.setTimeout ) { - window.setTimeout(function() { - if ( config.timeout ) { - clearTimeout(config.timeout); - } - - config.blocking = false; - process(); - }, 13); - } else { - config.blocking = false; - process(); - } - }, - - stop: function(timeout) { - config.blocking = true; - - if ( timeout && window.setTimeout ) { - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - QUnit.start(); - }, timeout); - } - } - -}; - -// Backwards compatibility, deprecated -QUnit.equals = QUnit.equal; -QUnit.same = QUnit.deepEqual; - -// Maintain internal state -var config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true -}; - -// Load paramaters -(function() { - var location = window.location || { search: "", protocol: "file:" }, - GETParams = location.search.slice(1).split('&'); - - for ( var i = 0; i < GETParams.length; i++ ) { - GETParams[i] = decodeURIComponent( GETParams[i] ); - if ( GETParams[i] === "noglobals" ) { - GETParams.splice( i, 1 ); - i--; - config.noglobals = true; - } else if ( GETParams[i].search('=') > -1 ) { - GETParams.splice( i, 1 ); - i--; - } - } - - // restrict modules/tests by get parameters - config.filters = GETParams; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = !!(location.protocol === 'file:'); -})(); - -// Expose the API as global variables, unless an 'exports' -// object exists, in that case we assume we're in CommonJS -if ( typeof exports === "undefined" || typeof require === "undefined" ) { - extend(window, QUnit); - window.QUnit = QUnit; -} else { - extend(exports, QUnit); - exports.QUnit = QUnit; -} - -// define these after exposing globals to keep them in these QUnit namespace only -extend(QUnit, { - config: config, - - // Initialize the configuration options - init: function() { - extend(config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date, - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - assertions: [], - filters: [], - queue: [] - }); - - var tests = id("qunit-tests"), - banner = id("qunit-banner"), - result = id("qunit-testresult"); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - }, - - /** - * Resets the test setup. Useful for tests that modify the DOM. - * - * If jQuery is available, uses jQuery's html(), otherwise just innerHTML. - */ - reset: function() { - if ( window.jQuery ) { - jQuery( "#main, #qunit-fixture" ).html( config.fixture ); - } else { - var main = id( 'main' ) || id( 'qunit-fixture' ); - if ( main ) { - main.innerHTML = config.fixture; - } - } - }, - - /** - * Trigger an event on an element. - * - * @example triggerEvent( document.body, "click" ); - * - * @param DOMElement elem - * @param String type - */ - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent("MouseEvents"); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - elem.dispatchEvent( event ); - - } else if ( elem.fireEvent ) { - elem.fireEvent("on"+type); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) == type; - }, - - objectType: function( obj ) { - if (typeof obj === "undefined") { - return "undefined"; - - // consider: typeof null === object - } - if (obj === null) { - return "null"; - } - - var type = Object.prototype.toString.call( obj ) - .match(/^\[object\s(.*)\]$/)[1] || ''; - - switch (type) { - case 'Number': - if (isNaN(obj)) { - return "nan"; - } else { - return "number"; - } - case 'String': - case 'Boolean': - case 'Array': - case 'Date': - case 'RegExp': - case 'Function': - return type.toLowerCase(); - } - if (typeof obj === "object") { - return "object"; - } - return undefined; - }, - - push: function(result, actual, expected, message) { - var details = { - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeHtml(message) || (result ? "okay" : "failed"); - message = '' + message + ""; - expected = escapeHtml(QUnit.jsDump.parse(expected)); - actual = escapeHtml(QUnit.jsDump.parse(actual)); - var output = message + ', expected: ' + expected + ''; - if (actual != expected) { - output += ' result: ' + actual + ', diff: ' + QUnit.diff(expected, actual); - } - - QUnit.log(result, message, details); - - config.assertions.push({ - result: !!result, - message: output - }); - }, - - // Logging callbacks - begin: function() {}, - done: function(failures, total) {}, - log: function(result, message) {}, - testStart: function(name, testEnvironment) {}, - testDone: function(name, failures, total) {}, - moduleStart: function(name, testEnvironment) {}, - moduleDone: function(name, failures, total) {} -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -addEvent(window, "load", function() { - QUnit.begin(); - - // Initialize the config, saving the execution queue - var oldconfig = extend({}, config); - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - var userAgent = id("qunit-userAgent"); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - var banner = id("qunit-header"); - if ( banner ) { - var paramsIndex = location.href.lastIndexOf(location.search); - if ( paramsIndex > -1 ) { - var mainPageLocation = location.href.slice(0, paramsIndex); - if ( mainPageLocation == location.href ) { - banner.innerHTML = ' ' + banner.innerHTML + ' '; - } else { - var testName = decodeURIComponent(location.search.slice(1)); - banner.innerHTML = '' + banner.innerHTML + '' + testName + ''; - } - } - } - - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "none"; - - var filter = document.createElement("input"); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - filter.disabled = true; - addEvent( filter, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("pass") > -1 ) { - li[i].style.display = filter.checked ? "none" : ""; - } - } - }); - toolbar.appendChild( filter ); - - var label = document.createElement("label"); - label.setAttribute("for", "qunit-filter-pass"); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - var missing = document.createElement("input"); - missing.type = "checkbox"; - missing.id = "qunit-filter-missing"; - missing.disabled = true; - addEvent( missing, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) { - li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block"; - } - } - }); - toolbar.appendChild( missing ); - - label = document.createElement("label"); - label.setAttribute("for", "qunit-filter-missing"); - label.innerHTML = "Hide missing tests (untested code is broken code)"; - toolbar.appendChild( label ); - } - - var main = id('main') || id('qunit-fixture'); - if ( main ) { - config.fixture = main.innerHTML; - } - - if (config.autostart) { - QUnit.start(); - } -}); - -function done() { - if ( config.doneTimer && window.clearTimeout ) { - window.clearTimeout( config.doneTimer ); - config.doneTimer = null; - } - - if ( config.queue.length ) { - config.doneTimer = window.setTimeout(function(){ - if ( !config.queue.length ) { - done(); - } else { - synchronize( done ); - } - }, 13); - - return; - } - - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - var banner = id("qunit-banner"), - tests = id("qunit-tests"), - html = ['Tests completed in ', - +new Date - config.started, ' milliseconds.
            ', - '', config.stats.all - config.stats.bad, ' tests of ', config.stats.all, ' passed, ', config.stats.bad,' failed.'].join(''); - - if ( banner ) { - banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass"); - } - - if ( tests ) { - var result = id("qunit-testresult"); - - if ( !result ) { - result = document.createElement("p"); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests.nextSibling ); - } - - result.innerHTML = html; - } - - QUnit.done( config.stats.bad, config.stats.all ); -} - -function validTest( name ) { - var i = config.filters.length, - run = false; - - if ( !i ) { - return true; - } - - while ( i-- ) { - var filter = config.filters[i], - not = filter.charAt(0) == '!'; - - if ( not ) { - filter = filter.slice(1); - } - - if ( name.indexOf(filter) !== -1 ) { - return !not; - } - - if ( not ) { - run = true; - } - } - - return run; -} - -function resultDisplayStyle(passed) { - return passed && id("qunit-filter-pass") && id("qunit-filter-pass").checked ? 'none' : ''; -} - -function escapeHtml(s) { - if (!s) { - return ""; - } - s = s + ""; - return s.replace(/[\&"<>\\]/g, function(s) { - switch(s) { - case "&": return "&"; - case "\\": return "\\\\"; - case '"': return '\"'; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); -} - -function synchronize( callback ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process(); - } -} - -function process() { - var start = (new Date()).getTime(); - - while ( config.queue.length && !config.blocking ) { - if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) { - config.queue.shift()(); - - } else { - setTimeout( process, 13 ); - break; - } - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var old = config.pollution; - saveGlobal(); - - var newGlobals = diff( old, config.pollution ); - if ( newGlobals.length > 0 ) { - ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); - config.expected++; - } - - var deletedGlobals = diff( config.pollution, old ); - if ( deletedGlobals.length > 0 ) { - ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") ); - config.expected++; - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var result = a.slice(); - for ( var i = 0; i < result.length; i++ ) { - for ( var j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice(i, 1); - i--; - break; - } - } - } - return result; -} - -function fail(message, exception, callback) { - if ( typeof console !== "undefined" && console.error && console.warn ) { - console.error(message); - console.error(exception); - console.warn(callback.toString()); - - } else if ( window.opera && opera.postError ) { - opera.postError(message, exception, callback.toString); - } -} - -function extend(a, b) { - for ( var prop in b ) { - a[prop] = b[prop]; - } - - return a; -} - -function addEvent(elem, type, fn) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id(name) { - return !!(typeof document !== "undefined" && document && document.getElementById) && - document.getElementById( name ); -} - -// Test for equality any JavaScript type. -// Discussions and reference: http://philrathe.com/articles/equiv -// Test suites: http://philrathe.com/tests/equiv -// Author: Philippe Rathé -QUnit.equiv = function () { - - var innerEquiv; // the real equiv function - var callers = []; // stack to decide between skip/abort functions - var parents = []; // stack to avoiding loops from circular referencing - - // Call the o related callback with the given arguments. - function bindCallbacks(o, callbacks, args) { - var prop = QUnit.objectType(o); - if (prop) { - if (QUnit.objectType(callbacks[prop]) === "function") { - return callbacks[prop].apply(callbacks, args); - } else { - return callbacks[prop]; // or undefined - } - } - } - - var callbacks = function () { - - // for string, boolean, number and null - function useStrictEquality(b, a) { - if (b instanceof a.constructor || a instanceof b.constructor) { - // to catch short annotaion VS 'new' annotation of a declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function (b) { - return isNaN(b); - }, - - "date": function (b, a) { - return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function (b, a) { - return QUnit.objectType(b) === "regexp" && - a.source === b.source && // the regex itself - a.global === b.global && // and its modifers (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function () { - var caller = callers[callers.length - 1]; - return caller !== Object && - typeof caller !== "undefined"; - }, - - "array": function (b, a) { - var i, j, loop; - var len; - - // b could be an object literal here - if ( ! (QUnit.objectType(b) === "array")) { - return false; - } - - len = a.length; - if (len !== b.length) { // safe and faster - return false; - } - - //track reference to avoid circular references - parents.push(a); - for (i = 0; i < len; i++) { - loop = false; - for(j=0;j= 0) { - type = "array"; - } else { - type = typeof obj; - } - return type; - }, - separator:function() { - return this.multiline ? this.HTML ? '
            ' : '\n' : this.HTML ? ' ' : ' '; - }, - indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) - return ''; - var chr = this.indentChar; - if ( this.HTML ) - chr = chr.replace(/\t/g,' ').replace(/ /g,' '); - return Array( this._depth_ + (extra||0) ).join(chr); - }, - up:function( a ) { - this._depth_ += a || 1; - }, - down:function( a ) { - this._depth_ -= a || 1; - }, - setParser:function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote:quote, - literal:literal, - join:join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers:{ - window: '[Window]', - document: '[Document]', - error:'[ERROR]', //when no parser is found, shouldn't happen - unknown: '[Unknown]', - 'null':'null', - undefined:'undefined', - 'function':function( fn ) { - var ret = 'function', - name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE - if ( name ) - ret += ' ' + name; - ret += '('; - - ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join(''); - return join( ret, this.parse(fn,'functionCode'), '}' ); - }, - array: array, - nodelist: array, - arguments: array, - object:function( map ) { - var ret = [ ]; - this.up(); - for ( var key in map ) - ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) ); - this.down(); - return join( '{', ret, '}' ); - }, - node:function( node ) { - var open = this.HTML ? '<' : '<', - close = this.HTML ? '>' : '>'; - - var tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( var a in this.DOMAttrs ) { - var val = node[this.DOMAttrs[a]]; - if ( val ) - ret += ' ' + a + '=' + this.parse( val, 'attribute' ); - } - return ret + close + open + '/' + tag + close; - }, - functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function - var l = fn.length; - if ( !l ) return ''; - - var args = Array(l); - while ( l-- ) - args[l] = String.fromCharCode(97+l);//97 is 'a' - return ' ' + args.join(', ') + ' '; - }, - key:quote, //object calls it internally, the key part of an item in a map - functionCode:'[code]', //function calls it internally, it's the content of the function - attribute:quote, //node calls it internally, it's an html attribute value - string:quote, - date:quote, - regexp:literal, //regex - number:literal, - 'boolean':literal - }, - DOMAttrs:{//attributes to dump from nodes, name=>realName - id:'id', - name:'name', - 'class':'className' - }, - HTML:false,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar:' ',//indentation unit - multiline:false //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -})(); - -// from Sizzle.js -function getText( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -}; - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - function diff(o, n){ - var ns = new Object(); - var os = new Object(); - - for (var i = 0; i < n.length; i++) { - if (ns[n[i]] == null) - ns[n[i]] = { - rows: new Array(), - o: null - }; - ns[n[i]].rows.push(i); - } - - for (var i = 0; i < o.length; i++) { - if (os[o[i]] == null) - os[o[i]] = { - rows: new Array(), - n: null - }; - os[o[i]].rows.push(i); - } - - for (var i in ns) { - if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) { - n[ns[i].rows[0]] = { - text: n[ns[i].rows[0]], - row: os[i].rows[0] - }; - o[os[i].rows[0]] = { - text: o[os[i].rows[0]], - row: ns[i].rows[0] - }; - } - } - - for (var i = 0; i < n.length - 1; i++) { - if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null && - n[i + 1] == o[n[i].row + 1]) { - n[i + 1] = { - text: n[i + 1], - row: n[i].row + 1 - }; - o[n[i].row + 1] = { - text: o[n[i].row + 1], - row: i + 1 - }; - } - } - - for (var i = n.length - 1; i > 0; i--) { - if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null && - n[i - 1] == o[n[i].row - 1]) { - n[i - 1] = { - text: n[i - 1], - row: n[i].row - 1 - }; - o[n[i].row - 1] = { - text: o[n[i].row - 1], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function(o, n){ - o = o.replace(/\s+$/, ''); - n = n.replace(/\s+$/, ''); - var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/)); - - var str = ""; - - var oSpace = o.match(/\s+/g); - if (oSpace == null) { - oSpace = [" "]; - } - else { - oSpace.push(" "); - } - var nSpace = n.match(/\s+/g); - if (nSpace == null) { - nSpace = [" "]; - } - else { - nSpace.push(" "); - } - - if (out.n.length == 0) { - for (var i = 0; i < out.o.length; i++) { - str += '' + out.o[i] + oSpace[i] + ""; - } - } - else { - if (out.n[0].text == null) { - for (n = 0; n < out.o.length && out.o[n].text == null; n++) { - str += '' + out.o[n] + oSpace[n] + ""; - } - } - - for (var i = 0; i < out.n.length; i++) { - if (out.n[i].text == null) { - str += '' + out.n[i] + nSpace[i] + ""; - } - else { - var pre = ""; - - for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) { - pre += '' + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -})(); - -})(this); diff --git a/editions/tw2/source/tiddlywiki/test/qunit/raiseAssertion.js b/editions/tw2/source/tiddlywiki/test/qunit/raiseAssertion.js deleted file mode 100755 index 1ceaafb9f..000000000 --- a/editions/tw2/source/tiddlywiki/test/qunit/raiseAssertion.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * extension of the QUnit framework to support exception handling - * cf. http://dev.jquery.com/ticket/4318 - */ - -(function($) { - -$.extend(window, { - raises: raises -}); - -/** - * Checks that the given expression throws an exception of the expected type, with an optional message. - * - * @example raises( function() { return foo.bar; }, "TypeError", "invalid property access raises TypeError exception" ); - * - * @param Function expression - * @param String expected exception type - * @param String message (optional) - */ -function raises(expression, expected, message) { - try { - push(false, expression(), expected, message); - } catch(ex) { - push(ex.name == expected, ex.name, expected, message); - } -} - -// duplicated private function from testrunner.js -function push(result, actual, expected, message) { - message = message || (result ? "okay" : "failed"); - QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + jsDump.parse(expected) + " result: " + jsDump.parse(actual) ); -} - -})(jQuery); diff --git a/editions/tw2/source/tiddlywiki/test/qunit/split.recipe b/editions/tw2/source/tiddlywiki/test/qunit/split.recipe deleted file mode 100755 index bfd2f60aa..000000000 --- a/editions/tw2/source/tiddlywiki/test/qunit/split.recipe +++ /dev/null @@ -1,4 +0,0 @@ -#jslib: delayTestExecution.js -jslib: raiseAssertion.js -jslib: qunit.js -style: qunit.css diff --git a/editions/tw2/source/tiddlywiki/test/recipes/sample.txt b/editions/tw2/source/tiddlywiki/test/recipes/sample.txt deleted file mode 100755 index 0cd850f13..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/sample.txt +++ /dev/null @@ -1,7 +0,0 @@ -lorem ipsum -dolor sit amet - - !"#$%&'()*+,-./0123456789:;<=>? -@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -©ÄÄŒ -foo bar baz diff --git a/editions/tw2/source/tiddlywiki/test/recipes/shadows/DefaultTiddlers.tiddler b/editions/tw2/source/tiddlywiki/test/recipes/shadows/DefaultTiddlers.tiddler deleted file mode 100755 index 3cfea3077..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/shadows/DefaultTiddlers.tiddler +++ /dev/null @@ -1,3 +0,0 @@ -
            -
            
            -
            diff --git a/editions/tw2/source/tiddlywiki/test/recipes/shadows/MainMenu.tiddler b/editions/tw2/source/tiddlywiki/test/recipes/shadows/MainMenu.tiddler deleted file mode 100755 index f6600dc71..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/shadows/MainMenu.tiddler +++ /dev/null @@ -1,3 +0,0 @@ -
            -
            
            -
            diff --git a/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarOptions.tiddler b/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarOptions.tiddler deleted file mode 100755 index 7ac832697..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarOptions.tiddler +++ /dev/null @@ -1,3 +0,0 @@ -
            -
            
            -
            diff --git a/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarTabs.tiddler b/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarTabs.tiddler deleted file mode 100755 index 64a502456..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/shadows/SideBarTabs.tiddler +++ /dev/null @@ -1,3 +0,0 @@ -
            -
            
            -
            diff --git a/editions/tw2/source/tiddlywiki/test/recipes/shadows/split.recipe b/editions/tw2/source/tiddlywiki/test/recipes/shadows/split.recipe deleted file mode 100755 index 4cb9beb8e..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/shadows/split.recipe +++ /dev/null @@ -1,4 +0,0 @@ -shadow: DefaultTiddlers.tiddler -shadow: MainMenu.tiddler -shadow: SideBarOptions.tiddler -shadow: SideBarTabs.tiddler diff --git a/editions/tw2/source/tiddlywiki/test/recipes/tests.html.recipe b/editions/tw2/source/tiddlywiki/test/recipes/tests.html.recipe deleted file mode 100755 index d7bdb9b92..000000000 --- a/editions/tw2/source/tiddlywiki/test/recipes/tests.html.recipe +++ /dev/null @@ -1,18 +0,0 @@ -# TiddlyWiki components -recipe: ../../tiddlywiki.html.recipe -recipe: ../../deprecated/split.recipe -recipe: shadows/split.recipe - -# jQuery -recipe: ../../jquery/split.recipe - -# test framework -recipe: ../qunit/split.recipe -recipe: ../jqMock/split.recipe -recipe: ../html/split.recipe - -# tests -recipe: ../js/split.recipe - -# testdata -recipe: ../testdata/split.recipe diff --git a/editions/tw2/source/tiddlywiki/test/reporter.html b/editions/tw2/source/tiddlywiki/test/reporter.html deleted file mode 100755 index 8306ff9c4..000000000 --- a/editions/tw2/source/tiddlywiki/test/reporter.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Test Suite - - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/test/reporter.php b/editions/tw2/source/tiddlywiki/test/reporter.php deleted file mode 100755 index 1ea86d537..000000000 --- a/editions/tw2/source/tiddlywiki/test/reporter.php +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/editions/tw2/source/tiddlywiki/test/testdata/split.recipe b/editions/tw2/source/tiddlywiki/test/testdata/split.recipe deleted file mode 100755 index 05ac3143b..000000000 --- a/editions/tw2/source/tiddlywiki/test/testdata/split.recipe +++ /dev/null @@ -1,3 +0,0 @@ -tiddler: testTiddler1.tid -tiddler: testTiddler2.tid -tiddler: testTiddler3.tid diff --git a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler1.tid b/editions/tw2/source/tiddlywiki/test/testdata/testTiddler1.tid deleted file mode 100755 index 6b8b65ad2..000000000 --- a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler1.tid +++ /dev/null @@ -1,6 +0,0 @@ -tags: testTag oneTag -fieldvalue: one -modified: 201012010340 -created: 200910211355 - -hello diff --git a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler2.tid b/editions/tw2/source/tiddlywiki/test/testdata/testTiddler2.tid deleted file mode 100755 index cb9160679..000000000 --- a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler2.tid +++ /dev/null @@ -1,17 +0,0 @@ -tags: testTag twoTag -fieldvalue: two -modified: 19951201034020 -created: 19940722031200 - -hello - -slice:4t - -!section -bar - -!section2 -test - -!Section3 -welcome diff --git a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler3.tid b/editions/tw2/source/tiddlywiki/test/testdata/testTiddler3.tid deleted file mode 100755 index f8a5d4820..000000000 --- a/editions/tw2/source/tiddlywiki/test/testdata/testTiddler3.tid +++ /dev/null @@ -1,10 +0,0 @@ -tags: testTag threeTag -fieldvalue: three -server.bag: foo -field-thing: bar -creator: martin -modified: 20101201094020 -created: 200910191255 - -hello -[[testTiddler2]] diff --git a/editions/tw2/source/tiddlywiki/tests/README b/editions/tw2/source/tiddlywiki/tests/README deleted file mode 100755 index dc1d510aa..000000000 --- a/editions/tw2/source/tiddlywiki/tests/README +++ /dev/null @@ -1,11 +0,0 @@ -This directory contains the test suite for the TiddlyWiki core. -The framework being used is JSSpec (http://jania.pe.kr/aw/moin.cgi/JSSpec). - -N.B.: -The use of JSSpec is gradually being phased out in favor of QUnit. -QUnit-based tests are contained in the core/test directory. -cf. http://trac.tiddlywiki.org/ticket/963 - -/html recipes for building the test suite -/js testing framework -/jsspec actual test code for core modules diff --git a/editions/tw2/source/tiddlywiki/tests/html/test.recipe b/editions/tw2/source/tiddlywiki/tests/html/test.recipe deleted file mode 100755 index eb2bd2981..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/test.recipe +++ /dev/null @@ -1,4 +0,0 @@ -template: test.template.html -style: ../../html/style.txt -recipe: ../../shadows/split.recipe -recipe: ../../js/split.recipe diff --git a/editions/tw2/source/tiddlywiki/tests/html/test.template.html b/editions/tw2/source/tiddlywiki/tests/html/test.template.html deleted file mode 100755 index 8bf0f0f27..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/test.template.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -<!--@@title@@--> - - - - - - - - - - - - - - -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            - -
            - - - -
            - - - - - - - - - - - - \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testAll.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testAll.html.recipe deleted file mode 100755 index 7d7e8b98f..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testAll.html.recipe +++ /dev/null @@ -1,23 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki All tests -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testAll.template.html b/editions/tw2/source/tiddlywiki/tests/html/testAll.template.html deleted file mode 100755 index 056501a68..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testAll.template.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -TiddlyWiki tests - - - - - - - - - - - - - \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testAnimator.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testAnimator.html.recipe deleted file mode 100755 index a0babf886..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testAnimator.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Animator tests -jsspecsrc= -jsspecsrc= \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testBasicTypes.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testBasicTypes.html.recipe deleted file mode 100755 index 6fd161f91..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testBasicTypes.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki BasicTypes tests -jsspecsrc= -jsspecsrc= \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributors.recipe b/editions/tw2/source/tiddlywiki/tests/html/testContributors.recipe deleted file mode 100755 index 1b12fac57..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributors.recipe +++ /dev/null @@ -1,4 +0,0 @@ -template: testContributors.template.html -style: ../../html/style.txt -recipe: ../../shadows/split.recipe -recipe: ../../js/split.recipe \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributors.template.html b/editions/tw2/source/tiddlywiki/tests/html/testContributors.template.html deleted file mode 100755 index 18f5c5803..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributors.template.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - -TiddlyWiki tests - - - - - - - - - - - - - - - - -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            - -
            - - - -
            - - - - - - - - - - \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributors2.recipe b/editions/tw2/source/tiddlywiki/tests/html/testContributors2.recipe deleted file mode 100755 index 49e928651..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributors2.recipe +++ /dev/null @@ -1,4 +0,0 @@ -template: testContributors2.template.html -style: ../../html/style.txt -recipe: ../../shadows/split.recipe -recipe: ../../js/split.recipe diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributors2.template.html b/editions/tw2/source/tiddlywiki/tests/html/testContributors2.template.html deleted file mode 100755 index 152621e48..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributors2.template.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - -TiddlyWiki tests - - - - - - - - - - - - - - - - -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            - -
            - - - -
            - - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.recipe b/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.recipe deleted file mode 100755 index 14235a57e..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.recipe +++ /dev/null @@ -1 +0,0 @@ -template: testContributorsMin.template.html diff --git a/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.template.html b/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.template.html deleted file mode 100755 index 53f600d9c..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testContributorsMin.template.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -<!--@@title@@--> - - - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/tests/html/testCrypto.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testCrypto.html.recipe deleted file mode 100755 index 61b03e54d..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testCrypto.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki Crypto tests -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testDates.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testDates.html.recipe deleted file mode 100755 index 5b15ff660..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testDates.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki date tests -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testDom.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testDom.html.recipe deleted file mode 100755 index 20641c099..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testDom.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki Dom tests -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testFileSystem.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testFileSystem.html.recipe deleted file mode 100755 index 40bfcacc5..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testFileSystem.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki FileSystem tests -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testGenerateRss.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testGenerateRss.html.recipe deleted file mode 100755 index f449af12c..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testGenerateRss.html.recipe +++ /dev/null @@ -1,6 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki GenerateRss tests - -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testMacros.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testMacros.html.recipe deleted file mode 100755 index 26363d746..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testMacros.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Macros tests -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testMessages.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testMessages.html.recipe deleted file mode 100755 index 5371379c0..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testMessages.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki messages tests -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testMocks.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testMocks.html.recipe deleted file mode 100755 index 576686151..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testMocks.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Mock tests -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testRGB.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testRGB.html.recipe deleted file mode 100755 index 21626a094..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testRGB.html.recipe +++ /dev/null @@ -1,6 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki RGB tests -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testShadows.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testShadows.html.recipe deleted file mode 100755 index 0f9799f73..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testShadows.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Shadow tests -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testStrings.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testStrings.html.recipe deleted file mode 100755 index 1cc3fc02f..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testStrings.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: testmin.recipe -title=TiddlyWiki strings tests -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testTW21Saver.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testTW21Saver.html.recipe deleted file mode 100755 index 42c4648f2..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testTW21Saver.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki TWSaver tests -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.recipe b/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.recipe deleted file mode 100755 index 6c57c7aaa..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.recipe +++ /dev/null @@ -1,4 +0,0 @@ -template: testTeamTasksPlugins.template.html -style: ../../html/style.txt -recipe: ../../shadows/split.recipe -recipe: ../../js/split.recipe \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.template.html b/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.template.html deleted file mode 100755 index 10afd1411..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testTeamTasksPlugins.template.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - -TiddlyWiki tests - - - - - - - - - - - - - - - - - -
            -
            -
            -
            -
            -
            -
            -
            -
            -
            - -
            - -
            - - - -
            - - - - - - - - - - \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testTiddler.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testTiddler.html.recipe deleted file mode 100755 index d940a58e5..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testTiddler.html.recipe +++ /dev/null @@ -1,3 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Tiddler tests -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testTiddlyWiki.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testTiddlyWiki.html.recipe deleted file mode 100755 index dc740b351..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testTiddlyWiki.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki store tests - -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testUtilities.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testUtilities.html.recipe deleted file mode 100755 index 7aa57cbf7..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testUtilities.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Utilities tests - -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testVersion.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testVersion.html.recipe deleted file mode 100755 index ead0ca619..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testVersion.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Version tests - -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testWikifier.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testWikifier.html.recipe deleted file mode 100755 index b308302ff..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testWikifier.html.recipe +++ /dev/null @@ -1,5 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Wikifier tests -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testWizard.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testWizard.html.recipe deleted file mode 100755 index 8a8b4e18f..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testWizard.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Wizard tests -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testXML.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testXML.html.recipe deleted file mode 100755 index eaae7f227..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testXML.html.recipe +++ /dev/null @@ -1,6 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki XML tests -jsspecsrc= -jsspecsrc= -jsspecsrc= -jsspecsrc= diff --git a/editions/tw2/source/tiddlywiki/tests/html/testZoomer.html.recipe b/editions/tw2/source/tiddlywiki/tests/html/testZoomer.html.recipe deleted file mode 100755 index d9bf9a144..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testZoomer.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: test.recipe -title=TiddlyWiki Zoomer tests -jsspecsrc= -jsspecsrc= \ No newline at end of file diff --git a/editions/tw2/source/tiddlywiki/tests/html/testmin.recipe b/editions/tw2/source/tiddlywiki/tests/html/testmin.recipe deleted file mode 100755 index 1e326b2bd..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testmin.recipe +++ /dev/null @@ -1 +0,0 @@ -template: testmin.template.html diff --git a/editions/tw2/source/tiddlywiki/tests/html/testmin.template.html b/editions/tw2/source/tiddlywiki/tests/html/testmin.template.html deleted file mode 100755 index 8a296d577..000000000 --- a/editions/tw2/source/tiddlywiki/tests/html/testmin.template.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - -<!--@@title@@--> - - - - - - - - - - - - - diff --git a/editions/tw2/source/tiddlywiki/tests/js/ckx b/editions/tw2/source/tiddlywiki/tests/js/ckx deleted file mode 100755 index eeda0a879..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/ckx +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -TWDIR=$HOME/Documents/TiddlyWiki -DEFAULT_FILENAME=tiddlywiki -FILENAME=${1:-$DEFAULT_FILENAME} -DEST=$PWD -RECIPE=$PWD/$FILENAME.js.recipe -ruby -C ../../../tools/cooker cook.rb $RECIPE -d$DEST -s $2 $3 $4 $5 diff --git a/editions/tw2/source/tiddlywiki/tests/js/mock.js b/editions/tw2/source/tiddlywiki/tests/js/mock.js deleted file mode 100755 index 9a0b78fbc..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/mock.js +++ /dev/null @@ -1,65 +0,0 @@ -tests_mock = { - frame: {}, - - /* - * replace named global functions with a mock version - * - mock can access original function, and store context in tests_mock.frame[funcName] - */ - before: function(funcName,mocker) - { - var frame = {}; - frame.called = 0; - frame.savedFunc = eval(funcName); - if (typeof frame.savedFunc != "function") - throw(funcName +" is not a function: " + (typeof frame.savedFunc)); - - var mockFunction = function() { - tests_mock.frame[funcName].called++; - if (mocker) - return mocker.apply(this, arguments); - }; - eval(funcName + "=mockFunction"); - - this.frame[funcName] = frame; - }, - - /* - * restore named global function - * - return frame object, which includes a count of calls - */ - after: function(funcName) - { - frame = this.frame[funcName]; - eval(funcName + '=frame.savedFunc'); - return frame; - }, - - /* - * save values of named global variables - */ - save: function(varName) - { - var frame = {}; - frame.restore = true; - frame.savedValue = eval(varName); - if (typeof frame.savedValue == "function") - throw(varName +" is a function: " + (typeof frame.savedValue)); - - this.frame[varName] = frame; - }, - - /* - * restore any named global variables - */ - restore: function() - { - var varName; - for(varName in this.frame) { - frame = this.frame[varName]; - if (frame.restore){ - eval(varName+'=frame.savedValue'); - frame.restore = false; - } - } - } -}; diff --git a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js b/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js deleted file mode 100755 index fc903c659..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js +++ /dev/null @@ -1,8358 +0,0 @@ -// format for storage - chkDisplayInstrumentation: false, - txtBackupFolder: "", - txtEditorFocus: "text", - txtMainTab: "tabTimeline", - txtMoreTab: "moreTabAll", - txtMaxEditRows: "30", - txtFileSystemCharSet: "UTF-8", - txtTheme: "" - }; -config.optionsDesc = {}; - -var DEFAULT_VIEW_TEMPLATE = 1; -var DEFAULT_EDIT_TEMPLATE = 2; -config.tiddlerTemplates = { - 1: "ViewTemplate", - 2: "EditTemplate" -}; - -config.views = { - wikified: { - tag: {} - }, - editor: { - tagChooser: {} - } -}; - -config.backstageTasks = ["save","sync","importTask","tweak","upgrade","plugins"]; - -config.macros = { - today: {}, - version: {}, - search: {sizeTextbox: 15}, - tiddler: {}, - tag: {}, - tags: {}, - tagging: {}, - timeline: {}, - allTags: {}, - list: { - all: {}, - missing: {}, - orphans: {}, - shadowed: {}, - touched: {}, - filter: {} - }, - closeAll: {}, - permaview: {}, - saveChanges: {}, - slider: {}, - option: {}, - options: {}, - newTiddler: {}, - newJournal: {}, - tabs: {}, - gradient: {}, - message: {}, - view: {defaultView: "text"}, - edit: {}, - tagChooser: {}, - toolbar: {}, - plugins: {}, - refreshDisplay: {}, - importTiddlers: {}, - upgrade: { - source: "http://www.tiddlywiki.com/upgrade/", - backupExtension: "pre.core.upgrade" - }, - sync: {}, - annotations: {} -}; - -config.commands = { - closeTiddler: {}, - closeOthers: {}, - editTiddler: {}, - saveTiddler: {hideReadOnly: true}, - cancelTiddler: {}, - deleteTiddler: {hideReadOnly: true}, - permalink: {}, - references: {type: "popup"}, - jump: {type: "popup"}, - syncing: {type: "popup"}, - fields: {type: "popup"} -}; - -config.userAgent = navigator.userAgent.toLowerCase(); -config.browser = { - isIE: config.userAgent.indexOf("msie") != -1 && config.userAgent.indexOf("opera") == -1, - isGecko: config.userAgent.indexOf("gecko") != -1, - ieVersion: /MSIE (\d.\d)/i.exec(config.userAgent), // config.browser.ieVersion[1], if it exists, will be the IE version string, eg "6.0" - isSafari: config.userAgent.indexOf("applewebkit") != -1, - isBadSafari: !((new RegExp("[\u0150\u0170]","g")).test("\u0150")), - firefoxDate: /gecko\/(\d{8})/i.exec(config.userAgent), // config.browser.firefoxDate[1], if it exists, will be Firefox release date as "YYYYMMDD" - isOpera: config.userAgent.indexOf("opera") != -1, - isLinux: config.userAgent.indexOf("linux") != -1, - isUnix: config.userAgent.indexOf("x11") != -1, - isMac: config.userAgent.indexOf("mac") != -1, - isWindows: config.userAgent.indexOf("win") != -1 -}; - -config.textPrimitives = { - upperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]", - lowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]", - anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]", - anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]" -}; -if(config.browser.isBadSafari) { - config.textPrimitives = { - upperLetter: "[A-Z\u00c0-\u00de]", - lowerLetter: "[a-z0-9_\\-\u00df-\u00ff]", - anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff]", - anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff]" - }; -} -config.textPrimitives.sliceSeparator = "::"; -config.textPrimitives.sectionSeparator = "##"; -config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b)"; -config.textPrimitives.unWikiLink = "~"; -config.textPrimitives.wikiLink = "(?:(?:" + config.textPrimitives.upperLetter + "+" + - config.textPrimitives.lowerLetter + "+" + - config.textPrimitives.upperLetter + - config.textPrimitives.anyLetter + "*)|(?:" + - config.textPrimitives.upperLetter + "{2,}" + - config.textPrimitives.lowerLetter + "+))"; - -config.textPrimitives.cssLookahead = "(?:(" + config.textPrimitives.anyLetter + "+)\\(([^\\)\\|\\n]+)(?:\\):))|(?:(" + config.textPrimitives.anyLetter + "+):([^;\\|\\n]+);)"; -config.textPrimitives.cssLookaheadRegExp = new RegExp(config.textPrimitives.cssLookahead,"mg"); - -config.textPrimitives.brackettedLink = "\\[\\[([^\\]]+)\\]\\]"; -config.textPrimitives.titledBrackettedLink = "\\[\\[([^\\[\\]\\|]+)\\|([^\\[\\]\\|]+)\\]\\]"; -config.textPrimitives.tiddlerForcedLinkRegExp = new RegExp("(?:" + config.textPrimitives.titledBrackettedLink + ")|(?:" + - config.textPrimitives.brackettedLink + ")|(?:" + - config.textPrimitives.urlPattern + ")","mg"); -config.textPrimitives.tiddlerAnyLinkRegExp = new RegExp("("+ config.textPrimitives.wikiLink + ")|(?:" + - config.textPrimitives.titledBrackettedLink + ")|(?:" + - config.textPrimitives.brackettedLink + ")|(?:" + - config.textPrimitives.urlPattern + ")","mg"); - -config.glyphs = { - browsers: [ - function() {return config.browser.isIE;}, - function() {return true;} - ], - currBrowser: null, - codes: { - downTriangle: ["\u25BC","\u25BE"], - downArrow: ["\u2193","\u2193"], - bentArrowLeft: ["\u2190","\u21A9"], - bentArrowRight: ["\u2192","\u21AA"] - } -}; - - -config.shadowTiddlers = { - StyleSheet: "", - MarkupPreHead: "", - MarkupPostHead: "", - MarkupPreBody: "", - MarkupPostBody: "", - TabTimeline: '<>', - TabAll: '<>', - TabTags: '<>', - TabMoreMissing: '<>', - TabMoreOrphans: '<>', - TabMoreShadowed: '<>', - AdvancedOptions: '<>', - PluginManager: '<>' -}; - - - -merge(config.options,{ - txtUserName: "YourName"}); - -merge(config.tasks,{ - save: {text: "save", tooltip: "Save your changes to this TiddlyWiki", action: saveChanges}, - sync: {text: "sync", tooltip: "Synchronise changes with other TiddlyWiki files and servers", content: '<>'}, - importTask: {text: "import", tooltip: "Import tiddlers and plugins from other TiddlyWiki files and servers", content: '<>'}, - tweak: {text: "tweak", tooltip: "Tweak the appearance and behaviour of TiddlyWiki", content: '<>'}, - upgrade: {text: "upgrade", tooltip: "Upgrade TiddlyWiki core code", content: '<>'}, - plugins: {text: "plugins", tooltip: "Manage installed plugins", content: '<>'} -}); - -merge(config.optionsDesc,{ - txtUserName: "Username for signing your edits", - chkRegExpSearch: "Enable regular expressions for searches", - chkCaseSensitiveSearch: "Case-sensitive searching", - chkIncrementalSearch: "Incremental key-by-key searching", - chkAnimate: "Enable animations", - chkSaveBackups: "Keep backup file when saving changes", - chkAutoSave: "Automatically save changes", - chkGenerateAnRssFeed: "Generate an RSS feed when saving changes", - chkSaveEmptyTemplate: "Generate an empty template when saving changes", - chkOpenInNewWindow: "Open external links in a new window", - chkToggleLinks: "Clicking on links to open tiddlers causes them to close", - chkHttpReadOnly: "Hide editing features when viewed over HTTP", - chkForceMinorUpdate: "Don't update modifier username and date when editing tiddlers", - chkConfirmDelete: "Require confirmation before deleting tiddlers", - chkInsertTabs: "Use the tab key to insert tab characters instead of moving between fields", - txtBackupFolder: "Name of folder to use for backups", - txtMaxEditRows: "Maximum number of rows in edit boxes", - txtFileSystemCharSet: "Default character set for saving changes (Firefox/Mozilla only)"}); - -merge(config.messages,{ - customConfigError: "Problems were encountered loading plugins. See PluginManager for details", - pluginError: "Error: %0", - pluginDisabled: "Not executed because disabled via 'systemConfigDisable' tag", - pluginForced: "Executed because forced via 'systemConfigForce' tag", - pluginVersionError: "Not executed because this plugin needs a newer version of TiddlyWiki", - nothingSelected: "Nothing is selected. You must select one or more items first", - savedSnapshotError: "It appears that this TiddlyWiki has been incorrectly saved. Please see http://www.tiddlywiki.com/#DownloadSoftware for details", - subtitleUnknown: "(unknown)", - undefinedTiddlerToolTip: "The tiddler '%0' doesn't yet exist", - shadowedTiddlerToolTip: "The tiddler '%0' doesn't yet exist, but has a pre-defined shadow value", - tiddlerLinkTooltip: "%0 - %1, %2", - externalLinkTooltip: "External link to %0", - noTags: "There are no tagged tiddlers", - notFileUrlError: "You need to save this TiddlyWiki to a file before you can save changes", - cantSaveError: "It's not possible to save changes. Possible reasons include:\n- your browser doesn't support saving (Firefox, Internet Explorer, Safari and Opera all work if properly configured)\n- the pathname to your TiddlyWiki file contains illegal characters\n- the TiddlyWiki HTML file has been moved or renamed", - invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki", - backupSaved: "Backup saved", - backupFailed: "Failed to save backup file", - rssSaved: "RSS feed saved", - rssFailed: "Failed to save RSS feed file", - emptySaved: "Empty template saved", - emptyFailed: "Failed to save empty template file", - mainSaved: "Main TiddlyWiki file saved", - mainFailed: "Failed to save main TiddlyWiki file. Your changes have not been saved", - macroError: "Error in macro <<\%0>>", - macroErrorDetails: "Error while executing macro <<\%0>>:\n%1", - missingMacro: "No such macro", - overwriteWarning: "A tiddler named '%0' already exists. Choose OK to overwrite it", - unsavedChangesWarning: "WARNING! There are unsaved changes in TiddlyWiki\n\nChoose OK to save\nChoose CANCEL to discard", - confirmExit: "--------------------------------\n\nThere are unsaved changes in TiddlyWiki. If you continue you will lose those changes\n\n--------------------------------", - saveInstructions: "SaveChanges", - unsupportedTWFormat: "Unsupported TiddlyWiki format '%0'", - tiddlerSaveError: "Error when saving tiddler '%0'", - tiddlerLoadError: "Error when loading tiddler '%0'", - wrongSaveFormat: "Cannot save with storage format '%0'. Using standard format for save.", - invalidFieldName: "Invalid field name %0", - fieldCannotBeChanged: "Field '%0' cannot be changed", - loadingMissingTiddler: "Attempting to retrieve the tiddler '%0' from the '%1' server at:\n\n'%2' in the workspace '%3'", - upgradeDone: "The upgrade to version %0 is now complete\n\nClick 'OK' to reload the newly upgraded TiddlyWiki"}); - -merge(config.messages.messageClose,{ - text: "close", - tooltip: "close this message area"}); - -config.messages.backstage = { - open: {text: "backstage", tooltip: "Open the backstage area to perform authoring and editing tasks"}, - close: {text: "close", tooltip: "Close the backstage area"}, - prompt: "backstage: ", - decal: { - edit: {text: "edit", tooltip: "Edit the tiddler '%0'"} - } -}; - -config.messages.listView = { - tiddlerTooltip: "Click for the full text of this tiddler", - previewUnavailable: "(preview not available)" -}; - -config.messages.dates.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November","December"]; -config.messages.dates.days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; -config.messages.dates.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -config.messages.dates.shortDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; -config.messages.dates.daySuffixes = ["st","nd","rd","th","th","th","th","th","th","th", - "th","th","th","th","th","th","th","th","th","th", - "st","nd","rd","th","th","th","th","th","th","th", - "st"]; -config.messages.dates.am = "am"; -config.messages.dates.pm = "pm"; - -merge(config.messages.tiddlerPopup,{ - }); - -merge(config.views.wikified.tag,{ - labelNoTags: "no tags", - labelTags: "tags: ", - openTag: "Open tag '%0'", - tooltip: "Show tiddlers tagged with '%0'", - openAllText: "Open all", - openAllTooltip: "Open all of these tiddlers", - popupNone: "No other tiddlers tagged with '%0'"}); - -merge(config.views.wikified,{ - defaultText: "The tiddler '%0' doesn't yet exist. Double-click to create it", - defaultModifier: "(missing)", - shadowModifier: "(built-in shadow tiddler)", - dateFormat: "DD MMM YYYY", - createdPrompt: "created"}); - -merge(config.views.editor,{ - tagPrompt: "Type tags separated with spaces, [[use double square brackets]] if necessary, or add existing", - defaultText: "Type the text for '%0'"}); - -merge(config.views.editor.tagChooser,{ - text: "tags", - tooltip: "Choose existing tags to add to this tiddler", - popupNone: "There are no tags defined", - tagTooltip: "Add the tag '%0'"}); - -merge(config.messages,{ - sizeTemplates: - [ - {unit: 1024*1024*1024, template: "%0\u00a0GB"}, - {unit: 1024*1024, template: "%0\u00a0MB"}, - {unit: 1024, template: "%0\u00a0KB"}, - {unit: 1, template: "%0\u00a0B"} - ]}); - -merge(config.macros.search,{ - label: "search", - prompt: "Search this TiddlyWiki", - accessKey: "F", - successMsg: "%0 tiddlers found matching %1", - failureMsg: "No tiddlers found matching %0"}); - -merge(config.macros.tagging,{ - label: "tagging: ", - labelNotTag: "not tagging", - tooltip: "List of tiddlers tagged with '%0'"}); - -merge(config.macros.timeline,{ - dateFormat: "DD MMM YYYY"}); - -merge(config.macros.allTags,{ - tooltip: "Show tiddlers tagged with '%0'", - noTags: "There are no tagged tiddlers"}); - -config.macros.list.all.prompt = "All tiddlers in alphabetical order"; -config.macros.list.missing.prompt = "Tiddlers that have links to them but are not defined"; -config.macros.list.orphans.prompt = "Tiddlers that are not linked to from any other tiddlers"; -config.macros.list.shadowed.prompt = "Tiddlers shadowed with default contents"; -config.macros.list.touched.prompt = "Tiddlers that have been modified locally"; - -merge(config.macros.closeAll,{ - label: "close all", - prompt: "Close all displayed tiddlers (except any that are being edited)"}); - -merge(config.macros.permaview,{ - label: "permaview", - prompt: "Link to an URL that retrieves all the currently displayed tiddlers"}); - -merge(config.macros.saveChanges,{ - label: "save changes", - prompt: "Save all tiddlers to create a new TiddlyWiki", - accessKey: "S"}); - -merge(config.macros.newTiddler,{ - label: "new tiddler", - prompt: "Create a new tiddler", - title: "New Tiddler", - accessKey: "N"}); - -merge(config.macros.newJournal,{ - label: "new journal", - prompt: "Create a new tiddler from the current date and time", - accessKey: "J"}); - -merge(config.macros.options,{ - wizardTitle: "Tweak advanced options", - step1Title: "These options are saved in cookies in your browser", - step1Html: "
            Show unknown options", - unknownDescription: "//(unknown)//", - listViewTemplate: { - columns: [ - {name: 'Option', field: 'option', title: "Option", type: 'String'}, - {name: 'Description', field: 'description', title: "Description", type: 'WikiText'}, - {name: 'Name', field: 'name', title: "Name", type: 'String'} - ], - rowClasses: [ - {className: 'lowlight', field: 'lowlight'} - ]} - }); - -merge(config.macros.plugins,{ - wizardTitle: "Manage plugins", - step1Title: "Currently loaded plugins", - step1Html: "", // DO NOT TRANSLATE - skippedText: "(This plugin has not been executed because it was added since startup)", - noPluginText: "There are no plugins installed", - confirmDeleteText: "Are you sure you want to delete these plugins:\n\n%0", - removeLabel: "remove systemConfig tag", - removePrompt: "Remove systemConfig tag", - deleteLabel: "delete", - deletePrompt: "Delete these tiddlers forever", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'}, - {name: 'Forced', field: 'forced', title: "Forced", tag: 'systemConfigForce', type: 'TagCheckbox'}, - {name: 'Disabled', field: 'disabled', title: "Disabled", tag: 'systemConfigDisable', type: 'TagCheckbox'}, - {name: 'Executed', field: 'executed', title: "Loaded", type: 'Boolean', trueText: "Yes", falseText: "No"}, - {name: 'Startup Time', field: 'startupTime', title: "Startup Time", type: 'String'}, - {name: 'Error', field: 'error', title: "Status", type: 'Boolean', trueText: "Error", falseText: "OK"}, - {name: 'Log', field: 'log', title: "Log", type: 'StringList'} - ], - rowClasses: [ - {className: 'error', field: 'error'}, - {className: 'warning', field: 'warning'} - ]} - }); - -merge(config.macros.toolbar,{ - moreLabel: "more", - morePrompt: "Reveal further commands" - }); - -merge(config.macros.refreshDisplay,{ - label: "refresh", - prompt: "Redraw the entire TiddlyWiki display" - }); - -merge(config.macros.importTiddlers,{ - readOnlyWarning: "You cannot import into a read-only TiddlyWiki file. Try opening it from a file:// URL", - wizardTitle: "Import tiddlers from another file or server", - step1Title: "Step 1: Locate the server or TiddlyWiki file", - step1Html: "Specify the type of the server:
            Enter the URL or pathname here:
            ...or browse for a file:

            ...or select a pre-defined feed: ", - openLabel: "open", - openPrompt: "Open the connection to this file or server", - openError: "There were problems fetching the tiddlywiki file", - statusOpenHost: "Opening the host", - statusGetWorkspaceList: "Getting the list of available workspaces", - step2Title: "Step 2: Choose the workspace", - step2Html: "Enter a workspace name:
            ...or select a workspace: ", - cancelLabel: "cancel", - cancelPrompt: "Cancel this import", - statusOpenWorkspace: "Opening the workspace", - statusGetTiddlerList: "Getting the list of available tiddlers", - errorGettingTiddlerList: "Error getting list of tiddlers, click Cancel to try again", - step3Title: "Step 3: Choose the tiddlers to import", - step3Html: "
            Keep these tiddlers linked to this server so that you can synchronise subsequent changes
            Save the details of this server in a 'systemServer' tiddler called: ", - importLabel: "import", - importPrompt: "Import these tiddlers", - confirmOverwriteText: "Are you sure you want to overwrite these tiddlers:\n\n%0", - step4Title: "Step 4: Importing %0 tiddler(s)", - step4Html: "", // DO NOT TRANSLATE - doneLabel: "done", - donePrompt: "Close this wizard", - statusDoingImport: "Importing tiddlers", - statusDoneImport: "All tiddlers imported", - systemServerNamePattern: "%2 on %1", - systemServerNamePatternNoWorkspace: "%1", - confirmOverwriteSaveTiddler: "The tiddler '%0' already exists. Click 'OK' to overwrite it with the details of this server, or 'Cancel' to leave it unchanged", - serverSaveTemplate: "|''Type:''|%0|\n|''URL:''|%1|\n|''Workspace:''|%2|\n\nThis tiddler was automatically created to record the details of this server", - serverSaveModifier: "(System)", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Size", type: 'Size'}, - {name: 'Tags', field: 'tags', title: "Tags", type: 'Tags'} - ], - rowClasses: [ - ]} - }); - -merge(config.macros.upgrade,{ - wizardTitle: "Upgrade TiddlyWiki core code", - step1Title: "Update or repair this TiddlyWiki to the latest release", - step1Html: "You are about to upgrade to the latest release of the TiddlyWiki core code (from %1). Your content will be preserved across the upgrade.

            Note that core upgrades have been known to interfere with older plugins. If you run into problems with the upgraded file, see http://www.tiddlywiki.org/wiki/CoreUpgrades", - errorCantUpgrade: "Unable to upgrade this TiddlyWiki. You can only perform upgrades on TiddlyWiki files stored locally", - errorNotSaved: "You must save changes before you can perform an upgrade", - step2Title: "Confirm the upgrade details", - step2Html_downgrade: "You are about to downgrade to TiddlyWiki version %0 from %1.

            Downgrading to an earlier version of the core code is not recommended", - step2Html_restore: "This TiddlyWiki appears to be already using the latest version of the core code (%0).

            You can continue to upgrade anyway to ensure that the core code hasn't been corrupted or damaged", - step2Html_upgrade: "You are about to upgrade to TiddlyWiki version %0 from %1", - upgradeLabel: "upgrade", - upgradePrompt: "Prepare for the upgrade process", - statusPreparingBackup: "Preparing backup", - statusSavingBackup: "Saving backup file", - errorSavingBackup: "There was a problem saving the backup file", - statusLoadingCore: "Loading core code", - errorLoadingCore: "Error loading the core code", - errorCoreFormat: "Error with the new core code", - statusSavingCore: "Saving the new core code", - statusReloadingCore: "Reloading the new core code", - startLabel: "start", - startPrompt: "Start the upgrade process", - cancelLabel: "cancel", - cancelPrompt: "Cancel the upgrade process", - step3Title: "Upgrade cancelled", - step3Html: "You have cancelled the upgrade process" - }); - -merge(config.macros.sync,{ - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Server Type', field: 'serverType', title: "Server type", type: 'String'}, - {name: 'Server Host', field: 'serverHost', title: "Server host", type: 'String'}, - {name: 'Server Workspace', field: 'serverWorkspace', title: "Server workspace", type: 'String'}, - {name: 'Status', field: 'status', title: "Synchronisation status", type: 'String'}, - {name: 'Server URL', field: 'serverUrl', title: "Server URL", text: "View", type: 'Link'} - ], - rowClasses: [ - ], - buttons: [ - {caption: "Sync these tiddlers", name: 'sync'} - ]}, - wizardTitle: "Synchronize with external servers and files", - step1Title: "Choose the tiddlers you want to synchronize", - step1Html: "", // DO NOT TRANSLATE - syncLabel: "sync", - syncPrompt: "Sync these tiddlers", - hasChanged: "Changed while unplugged", - hasNotChanged: "Unchanged while unplugged", - syncStatusList: { - none: {text: "...", color: "transparent", display:null}, - changedServer: {text: "Changed on server", color: '#8080ff', display:null}, - changedLocally: {text: "Changed while unplugged", color: '#80ff80', display:null}, - changedBoth: {text: "Changed while unplugged and on server", color: '#ff8080', display:null}, - notFound: {text: "Not found on server", color: '#ffff80', display:null}, - putToServer: {text: "Saved update on server", color: '#ff80ff', display:null}, - gotFromServer: {text: "Retrieved update from server", color: '#80ffff', display:null} - } - }); - -merge(config.macros.annotations,{ - }); - -merge(config.commands.closeTiddler,{ - text: "close", - tooltip: "Close this tiddler"}); - -merge(config.commands.closeOthers,{ - text: "close others", - tooltip: "Close all other tiddlers"}); - -merge(config.commands.editTiddler,{ - text: "edit", - tooltip: "Edit this tiddler", - readOnlyText: "view", - readOnlyTooltip: "View the source of this tiddler"}); - -merge(config.commands.saveTiddler,{ - text: "done", - tooltip: "Save changes to this tiddler"}); - -merge(config.commands.cancelTiddler,{ - text: "cancel", - tooltip: "Undo changes to this tiddler", - warning: "Are you sure you want to abandon your changes to '%0'?", - readOnlyText: "done", - readOnlyTooltip: "View this tiddler normally"}); - -merge(config.commands.deleteTiddler,{ - text: "delete", - tooltip: "Delete this tiddler", - warning: "Are you sure you want to delete '%0'?"}); - -merge(config.commands.permalink,{ - text: "permalink", - tooltip: "Permalink for this tiddler"}); - -merge(config.commands.references,{ - text: "references", - tooltip: "Show tiddlers that link to this one", - popupNone: "No references"}); - -merge(config.commands.jump,{ - text: "jump", - tooltip: "Jump to another open tiddler"}); - -merge(config.commands.syncing,{ - text: "syncing", - tooltip: "Control synchronisation of this tiddler with a server or external file", - currentlySyncing: "
            Currently syncing via '%0' to:
            host: %1
            workspace: %2", // Note escaping of closing
            tag - notCurrentlySyncing: "Not currently syncing", - captionUnSync: "Stop synchronising this tiddler", - chooseServer: "Synchronise this tiddler with another server:", - currServerMarker: "\u25cf ", - notCurrServerMarker: " "}); - -merge(config.commands.fields,{ - text: "fields", - tooltip: "Show the extended fields of this tiddler", - emptyText: "There are no extended fields for this tiddler", - listViewTemplate: { - columns: [ - {name: 'Field', field: 'field', title: "Field", type: 'String'}, - {name: 'Value', field: 'value', title: "Value", type: 'String'} - ], - rowClasses: [ - ], - buttons: [ - ]}}); - -merge(config.shadowTiddlers,{ - DefaultTiddlers: "GettingStarted", - MainMenu: "GettingStarted", - SiteTitle: "My TiddlyWiki", - SiteSubtitle: "a reusable non-linear personal web notebook", - SiteUrl: "http://www.tiddlywiki.com/", - SideBarOptions: '<><><><><><><>', - SideBarTabs: '<>', - TabMore: '<>', - ToolbarCommands: "|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|"}); - -merge(config.annotations,{ - AdvancedOptions: "This shadow tiddler provides access to several advanced options", - ColorPalette: "These values in this shadow tiddler determine the colour scheme of the ~TiddlyWiki user interface", - DefaultTiddlers: "The tiddlers listed in this shadow tiddler will be automatically displayed when ~TiddlyWiki starts up", - EditTemplate: "The HTML template in this shadow tiddler determines how tiddlers look while they are being edited", - GettingStarted: "This shadow tiddler provides basic usage instructions", - ImportTiddlers: "This shadow tiddler provides access to importing tiddlers", - MainMenu: "This shadow tiddler is used as the contents of the main menu in the left-hand column of the screen", - MarkupPreHead: "This tiddler is inserted at the top of the section of the TiddlyWiki HTML file", - MarkupPostHead: "This tiddler is inserted at the bottom of the section of the TiddlyWiki HTML file", - MarkupPreBody: "This tiddler is inserted at the top of the section of the TiddlyWiki HTML file", - MarkupPostBody: "This tiddler is inserted at the end of the section of the TiddlyWiki HTML file immediately after the script block", - OptionsPanel: "This shadow tiddler is used as the contents of the options panel slider in the right-hand sidebar", - PageTemplate: "The HTML template in this shadow tiddler determines the overall ~TiddlyWiki layout", - PluginManager: "This shadow tiddler provides access to the plugin manager", - SideBarOptions: "This shadow tiddler is used as the contents of the option panel in the right-hand sidebar", - SideBarTabs: "This shadow tiddler is used as the contents of the tabs panel in the right-hand sidebar", - SiteSubtitle: "This shadow tiddler is used as the second part of the page title", - SiteTitle: "This shadow tiddler is used as the first part of the page title", - SiteUrl: "This shadow tiddler should be set to the full target URL for publication", - StyleSheetColors: "This shadow tiddler contains CSS definitions related to the color of page elements. ''DO NOT EDIT THIS TIDDLER'', instead make your changes in the StyleSheet shadow tiddler", - StyleSheet: "This tiddler can contain custom CSS definitions", - StyleSheetLayout: "This shadow tiddler contains CSS definitions related to the layout of page elements. ''DO NOT EDIT THIS TIDDLER'', instead make your changes in the StyleSheet shadow tiddler", - StyleSheetLocale: "This shadow tiddler contains CSS definitions related to the translation locale", - StyleSheetPrint: "This shadow tiddler contains CSS definitions for printing", - TabAll: "This shadow tiddler contains the contents of the 'All' tab in the right-hand sidebar", - TabMore: "This shadow tiddler contains the contents of the 'More' tab in the right-hand sidebar", - TabMoreMissing: "This shadow tiddler contains the contents of the 'Missing' tab in the right-hand sidebar", - TabMoreOrphans: "This shadow tiddler contains the contents of the 'Orphans' tab in the right-hand sidebar", - TabMoreShadowed: "This shadow tiddler contains the contents of the 'Shadowed' tab in the right-hand sidebar", - TabTags: "This shadow tiddler contains the contents of the 'Tags' tab in the right-hand sidebar", - TabTimeline: "This shadow tiddler contains the contents of the 'Timeline' tab in the right-hand sidebar", - ToolbarCommands: "This shadow tiddler determines which commands are shown in tiddler toolbars", - ViewTemplate: "The HTML template in this shadow tiddler determines how tiddlers look" - }); - - -var params = null; // Command line parameters -var store = null; // TiddlyWiki storage -var story = null; // Main story -var formatter = null; // Default formatters for the wikifier -var anim = typeof Animator == "function" ? new Animator() : null; // Animation engine -var readOnly = false; // Whether we're in readonly mode -var highlightHack = null; // Embarrassing hack department... -var hadConfirmExit = false; // Don't warn more than once -var safeMode = false; // Disable all plugins and cookies -var showBackstage; // Whether to include the backstage area -var installedPlugins = []; // Information filled in when plugins are executed -var startingUp = false; // Whether we're in the process of starting up -var pluginInfo,tiddler; // Used to pass information to plugins in loadPlugins() - -var useJavaSaver = (config.browser.isSafari || config.browser.isOpera) && (document.location.toString().substr(0,4) != "http"); - -function main() -{ - var t10,t9,t8,t7,t6,t5,t4,t3,t2,t1,t0 = new Date(); - startingUp = true; - window.onbeforeunload = function(e) {if(window.confirmExit) return confirmExit();}; - params = getParameters(); - if(params) - params = params.parseParams("open",null,false); - store = new TiddlyWiki(); - invokeParamifier(params,"oninit"); - story = new Story("tiddlerDisplay","tiddler"); - addEvent(document,"click",Popup.onDocumentClick); - saveTest(); - loadOptionsCookie(); - for(var s=0; s 0) { - plugin.log.push(config.messages.pluginVersionError); - return false; - } - } - return true; -} - -function isPluginEnabled(plugin) -{ - if(plugin.tiddler.isTagged("systemConfigDisable")) { - plugin.log.push(config.messages.pluginDisabled); - return false; - } - return true; -} - -function invokeMacro(place,macro,params,wikifier,tiddler) -{ - try { - var m = config.macros[macro]; - if(m && m.handler) - m.handler(place,macro,params.readMacroParams(),wikifier,params,tiddler); - else - createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,config.messages.missingMacro])); - } catch(ex) { - createTiddlyError(place,config.messages.macroError.format([macro]),config.messages.macroErrorDetails.format([macro,ex.toString()])); - } -} - - -function getParameters() -{ - var p = null; - if(window.location.hash) { - p = decodeURIComponent(window.location.hash.substr(1)); - if(config.browser.firefoxDate != null && config.browser.firefoxDate[1] < "20051111") - p = convertUTF8ToUnicode(p); - } - return p; -} - -function invokeParamifier(params,handler) -{ - if(!params || params.length == undefined || params.length <= 1) - return; - for(var t=1; t") { - colSpanCount++; - w.nextMatch = this.cellRegExp.lastIndex-1; - } else if(cellMatch[2]) { - if(prevCell && colSpanCount > 1) { - prevCell.setAttribute("colspan",colSpanCount); - prevCell.setAttribute("colSpan",colSpanCount); // Needed for IE - } - w.nextMatch = this.cellRegExp.lastIndex; - break; - } else { - w.nextMatch++; - var styles = config.formatterHelpers.inlineCssHelper(w); - var spaceLeft = false; - var chr = w.source.substr(w.nextMatch,1); - while(chr == " ") { - spaceLeft = true; - w.nextMatch++; - chr = w.source.substr(w.nextMatch,1); - } - var cell; - if(chr == "!") { - cell = createTiddlyElement(e,"th"); - w.nextMatch++; - } else { - cell = createTiddlyElement(e,"td"); - } - prevCell = cell; - prevColumns[col] = {rowSpanCount:1,element:cell}; - if(colSpanCount > 1) { - cell.setAttribute("colspan",colSpanCount); - cell.setAttribute("colSpan",colSpanCount); // Needed for IE - colSpanCount = 1; - } - config.formatterHelpers.applyCssHelper(cell,styles); - w.subWikifyTerm(cell,this.cellTermRegExp); - if(w.matchText.substr(w.matchText.length-2,1) == " ") // spaceRight - cell.align = spaceLeft ? "center" : "left"; - else if(spaceLeft) - cell.align = "right"; - w.nextMatch--; - } - col++; - this.cellRegExp.lastIndex = w.nextMatch; - cellMatch = this.cellRegExp.exec(w.source); - } - } -}, - -{ - name: "heading", - match: "^!{1,6}", - termRegExp: /(\n)/mg, - handler: function(w) - { - w.subWikifyTerm(createTiddlyElement(w.output,"h" + w.matchLength),this.termRegExp); - } -}, - -{ - name: "list", - match: "^(?:[\\*#;:]+)", - lookaheadRegExp: /^(?:(?:(\*)|(#)|(;)|(:))+)/mg, - termRegExp: /(\n)/mg, - handler: function(w) - { - var stack = [w.output]; - var currLevel = 0, currType = null; - var listLevel, listType, itemType, baseType; - w.nextMatch = w.matchStart; - this.lookaheadRegExp.lastIndex = w.nextMatch; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - while(lookaheadMatch && lookaheadMatch.index == w.nextMatch) { - if(lookaheadMatch[1]) { - listType = "ul"; - itemType = "li"; - } else if(lookaheadMatch[2]) { - listType = "ol"; - itemType = "li"; - } else if(lookaheadMatch[3]) { - listType = "dl"; - itemType = "dt"; - } else if(lookaheadMatch[4]) { - listType = "dl"; - itemType = "dd"; - } - if(!baseType) - baseType = listType; - listLevel = lookaheadMatch[0].length; - w.nextMatch += lookaheadMatch[0].length; - var t; - if(listLevel > currLevel) { - for(t=currLevel; tlistLevel; t--) - stack.pop(); - } else if(listLevel == currLevel && listType != currType) { - stack.pop(); - stack.push(createTiddlyElement(stack[stack.length-1].lastChild,listType)); - } - currLevel = listLevel; - currType = listType; - var e = createTiddlyElement(stack[stack.length-1],itemType); - w.subWikifyTerm(e,this.termRegExp); - this.lookaheadRegExp.lastIndex = w.nextMatch; - lookaheadMatch = this.lookaheadRegExp.exec(w.source); - } - } -}, - -{ - name: "quoteByBlock", - match: "^<<<\\n", - termRegExp: /(^<<<(\n|$))/mg, - element: "blockquote", - handler: config.formatterHelpers.createElementAndWikify -}, - -{ - name: "quoteByLine", - match: "^>+", - lookaheadRegExp: /^>+/mg, - termRegExp: /(\n)/mg, - element: "blockquote", - handler: function(w) - { - var stack = [w.output]; - var currLevel = 0; - var newLevel = w.matchLength; - var t; - do { - if(newLevel > currLevel) { - for(t=currLevel; tnewLevel; t--) - stack.pop(); - } - currLevel = newLevel; - w.subWikifyTerm(stack[stack.length-1],this.termRegExp); - createTiddlyElement(stack[stack.length-1],"br"); - this.lookaheadRegExp.lastIndex = w.nextMatch; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - var matched = lookaheadMatch && lookaheadMatch.index == w.nextMatch; - if(matched) { - newLevel = lookaheadMatch[0].length; - w.nextMatch += lookaheadMatch[0].length; - } - } while(matched); - } -}, - -{ - name: "rule", - match: "^----+$\\n?", - handler: function(w) - { - createTiddlyElement(w.output,"hr"); - } -}, - -{ - name: "monospacedByLine", - match: "^(?:/\\*\\{\\{\\{\\*/|\\{\\{\\{|//\\{\\{\\{|)\\n", - element: "pre", - handler: function(w) - { - switch(w.matchText) { - case "/*{{{*/\n": // CSS - this.lookaheadRegExp = /\/\*\{\{\{\*\/\n*((?:^[^\n]*\n)+?)(\n*^\/\*\}\}\}\*\/$\n?)/mg; - break; - case "{{{\n": // monospaced block - this.lookaheadRegExp = /^\{\{\{\n((?:^[^\n]*\n)+?)(^\}\}\}$\n?)/mg; - break; - case "//{{{\n": // plugin - this.lookaheadRegExp = /^\/\/\{\{\{\n\n*((?:^[^\n]*\n)+?)(\n*^\/\/\}\}\}$\n?)/mg; - break; - case "\n": //template - this.lookaheadRegExp = /\n*((?:^[^\n]*\n)+?)(\n*^$\n?)/mg; - break; - default: - break; - } - config.formatterHelpers.enclosedTextHelper.call(this,w); - } -}, - -{ - name: "wikifyComment", - match: "^(?:/\\*\\*\\*|\n)/mg); - w.subWikifyTerm(w.output,termRegExp); - } -}, - -{ - name: "macro", - match: "<<", - lookaheadRegExp: /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*)>>/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart && lookaheadMatch[1]) { - w.nextMatch = this.lookaheadRegExp.lastIndex; - invokeMacro(w.output,lookaheadMatch[1],lookaheadMatch[2],w,w.tiddler); - } - } -}, - -{ - name: "prettyLink", - match: "\\[\\[", - lookaheadRegExp: /\[\[(.*?)(?:\|(~)?(.*?))?\]\]/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - var e; - var text = lookaheadMatch[1]; - if(lookaheadMatch[3]) { - var link = lookaheadMatch[3]; - e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link)) ? - createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler); - } else { - e = createTiddlyLink(w.output,text,false,null,w.isStatic,w.tiddler); - } - createTiddlyText(e,text); - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "wikiLink", - match: config.textPrimitives.unWikiLink+"?"+config.textPrimitives.wikiLink, - handler: function(w) - { - if(w.matchText.substr(0,1) == config.textPrimitives.unWikiLink) { - w.outputText(w.output,w.matchStart+1,w.nextMatch); - return; - } - if(w.matchStart > 0) { - var preRegExp = new RegExp(config.textPrimitives.anyLetterStrict,"mg"); - preRegExp.lastIndex = w.matchStart-1; - var preMatch = preRegExp.exec(w.source); - if(preMatch.index == w.matchStart-1) { - w.outputText(w.output,w.matchStart,w.nextMatch); - return; - } - } - if(w.autoLinkWikiWords || store.isShadowTiddler(w.matchText)) { - var link = createTiddlyLink(w.output,w.matchText,false,null,w.isStatic,w.tiddler); - w.outputText(link,w.matchStart,w.nextMatch); - } else { - w.outputText(w.output,w.matchStart,w.nextMatch); - } - } -}, - -{ - name: "urlLink", - match: config.textPrimitives.urlPattern, - handler: function(w) - { - w.outputText(createExternalLink(w.output,w.matchText),w.matchStart,w.nextMatch); - } -}, - -{ - name: "image", - match: "\\[[<>]?[Ii][Mm][Gg]\\[", - lookaheadRegExp: /\[([<]?)(>?)[Ii][Mm][Gg]\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - var e = w.output; - if(lookaheadMatch[5]) { - var link = lookaheadMatch[5]; - e = config.formatterHelpers.isExternalLink(link) ? createExternalLink(w.output,link) : createTiddlyLink(w.output,link,false,null,w.isStatic,w.tiddler); - addClass(e,"imageLink"); - } - var img = createTiddlyElement(e,"img"); - if(lookaheadMatch[1]) - img.align = "left"; - else if(lookaheadMatch[2]) - img.align = "right"; - if(lookaheadMatch[3]) { - img.title = lookaheadMatch[3]; - img.setAttribute("alt",lookaheadMatch[3]); - } - img.src = lookaheadMatch[4]; - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "html", - match: "<[Hh][Tt][Mm][Ll]>", - lookaheadRegExp: /<[Hh][Tt][Mm][Ll]>((?:.|\n)*?)<\/[Hh][Tt][Mm][Ll]>/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"span").innerHTML = lookaheadMatch[1]; - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "commentByBlock", - match: "/%", - lookaheadRegExp: /\/%((?:.|\n)*?)%\//mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) - w.nextMatch = this.lookaheadRegExp.lastIndex; - } -}, - -{ - name: "characterFormat", - match: "''|//|__|\\^\\^|~~|--(?!\\s|$)|\\{\\{\\{", - handler: function(w) - { - switch(w.matchText) { - case "''": - w.subWikifyTerm(w.output.appendChild(document.createElement("strong")),/('')/mg); - break; - case "//": - w.subWikifyTerm(createTiddlyElement(w.output,"em"),/(\/\/)/mg); - break; - case "__": - w.subWikifyTerm(createTiddlyElement(w.output,"u"),/(__)/mg); - break; - case "^^": - w.subWikifyTerm(createTiddlyElement(w.output,"sup"),/(\^\^)/mg); - break; - case "~~": - w.subWikifyTerm(createTiddlyElement(w.output,"sub"),/(~~)/mg); - break; - case "--": - w.subWikifyTerm(createTiddlyElement(w.output,"strike"),/(--)/mg); - break; - case "{{{": - var lookaheadRegExp = /\{\{\{((?:.|\n)*?)\}\}\}/mg; - lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"code",null,null,lookaheadMatch[1]); - w.nextMatch = lookaheadRegExp.lastIndex; - } - break; - } - } -}, - -{ - name: "customFormat", - match: "@@|\\{\\{", - handler: function(w) - { - switch(w.matchText) { - case "@@": - var e = createTiddlyElement(w.output,"span"); - var styles = config.formatterHelpers.inlineCssHelper(w); - if(styles.length == 0) - e.className = "marked"; - else - config.formatterHelpers.applyCssHelper(e,styles); - w.subWikifyTerm(e,/(@@)/mg); - break; - case "{{": - lookaheadRegExp = /\{\{[\s]*([\w]+[\s\w]*)[\s]*\{(\n?)/mg; - lookaheadRegExp.lastIndex = w.matchStart; - lookaheadMatch = lookaheadRegExp.exec(w.source); - if(lookaheadMatch) { - w.nextMatch = lookaheadRegExp.lastIndex; - e = createTiddlyElement(w.output,lookaheadMatch[2] == "\n" ? "div" : "span",null,lookaheadMatch[1]); - w.subWikifyTerm(e,/(\}\}\})/mg); - } - break; - } - } -}, - -{ - name: "mdash", - match: "--", - handler: function(w) - { - createTiddlyElement(w.output,"span").innerHTML = "—"; - } -}, - -{ - name: "lineBreak", - match: "\\n|
            ", - handler: function(w) - { - createTiddlyElement(w.output,"br"); - } -}, - -{ - name: "rawText", - match: "\\\"{3}|", - lookaheadRegExp: /(?:\"{3}|)((?:.|\n)*?)(?:\"{3}|<\/nowiki>)/mg, - handler: function(w) - { - this.lookaheadRegExp.lastIndex = w.matchStart; - var lookaheadMatch = this.lookaheadRegExp.exec(w.source); - if(lookaheadMatch && lookaheadMatch.index == w.matchStart) { - createTiddlyElement(w.output,"span",null,null,lookaheadMatch[1]); - w.nextMatch = this.lookaheadRegExp.lastIndex; - } - } -}, - -{ - name: "htmlEntitiesEncoding", - match: "(?:(?:&#?[a-zA-Z0-9]{2,8};|.)(?:&#?(?:x0*(?:3[0-6][0-9a-fA-F]|1D[c-fC-F][0-9a-fA-F]|20[d-fD-F][0-9a-fA-F]|FE2[0-9a-fA-F])|0*(?:76[89]|7[7-9][0-9]|8[0-7][0-9]|761[6-9]|76[2-7][0-9]|84[0-3][0-9]|844[0-7]|6505[6-9]|6506[0-9]|6507[0-1]));)+|&#?[a-zA-Z0-9]{2,8};)", - handler: function(w) - { - createTiddlyElement(w.output,"span").innerHTML = w.matchText; - } -} - -]; - - -function getParser(tiddler,format) -{ - if(tiddler) { - if(!format) - format = tiddler.fields["wikiformat"]; - var i; - if(format) { - for(i in config.parsers) { - if(format == config.parsers[i].format) - return config.parsers[i]; - } - } else { - for(i in config.parsers) { - if(tiddler.isTagged(config.parsers[i].formatTag)) - return config.parsers[i]; - } - } - } - return formatter; -} - -function wikify(source,output,highlightRegExp,tiddler) -{ - if(source) { - var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler); - var t0 = new Date(); - wikifier.subWikify(output); - if(tiddler && config.options.chkDisplayInstrumentation) - displayMessage("wikify:" +tiddler.title+ " in " + (new Date()-t0) + " ms"); - } -} - -function wikifyStatic(source,highlightRegExp,tiddler,format) -{ - var e = createTiddlyElement(document.body,"pre"); - e.style.display = "none"; - var html = ""; - if(source && source != "") { - if(!tiddler) - tiddler = new Tiddler("temp"); - var wikifier = new Wikifier(source,getParser(tiddler,format),highlightRegExp,tiddler); - wikifier.isStatic = true; - wikifier.subWikify(e); - html = e.innerHTML; - removeNode(e); - } - return html; -} - -function wikifyPlain(title,theStore,limit) -{ - if(!theStore) - theStore = store; - if(theStore.tiddlerExists(title) || theStore.isShadowTiddler(title)) { - return wikifyPlainText(theStore.getTiddlerText(title),limit,tiddler); - } else { - return ""; - } -} - -function wikifyPlainText(text,limit,tiddler) -{ - if(limit > 0) - text = text.substr(0,limit); - var wikifier = new Wikifier(text,formatter,null,tiddler); - return wikifier.wikifyPlain(); -} - -function highlightify(source,output,highlightRegExp,tiddler) -{ - if(source) { - var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler); - wikifier.outputText(output,0,source.length); - } -} - -function Wikifier(source,formatter,highlightRegExp,tiddler) -{ - this.source = source; - this.output = null; - this.formatter = formatter; - this.nextMatch = 0; - this.autoLinkWikiWords = tiddler && tiddler.autoLinkWikiWords() == false ? false : true; - this.highlightRegExp = highlightRegExp; - this.highlightMatch = null; - this.isStatic = false; - if(highlightRegExp) { - highlightRegExp.lastIndex = 0; - this.highlightMatch = highlightRegExp.exec(source); - } - this.tiddler = tiddler; -} - -Wikifier.prototype.wikifyPlain = function() -{ - var e = createTiddlyElement(document.body,"div"); - e.style.display = "none"; - this.subWikify(e); - var text = getPlainText(e); - removeNode(e); - return text; -}; - -Wikifier.prototype.subWikify = function(output,terminator) -{ - try { - if(terminator) - this.subWikifyTerm(output,new RegExp("(" + terminator + ")","mg")); - else - this.subWikifyUnterm(output); - } catch(ex) { - showException(ex); - } -}; - -Wikifier.prototype.subWikifyUnterm = function(output) -{ - var oldOutput = this.output; - this.output = output; - this.formatter.formatterRegExp.lastIndex = this.nextMatch; - var formatterMatch = this.formatter.formatterRegExp.exec(this.source); - while(formatterMatch) { - if(formatterMatch.index > this.nextMatch) - this.outputText(this.output,this.nextMatch,formatterMatch.index); - this.matchStart = formatterMatch.index; - this.matchLength = formatterMatch[0].length; - this.matchText = formatterMatch[0]; - this.nextMatch = this.formatter.formatterRegExp.lastIndex; - for(var t=1; t this.nextMatch) - this.outputText(this.output,this.nextMatch,terminatorMatch.index); - this.matchText = terminatorMatch[1]; - this.matchLength = terminatorMatch[1].length; - this.matchStart = terminatorMatch.index; - this.nextMatch = this.matchStart + this.matchLength; - this.output = oldOutput; - return; - } - if(formatterMatch.index > this.nextMatch) - this.outputText(this.output,this.nextMatch,formatterMatch.index); - this.matchStart = formatterMatch.index; - this.matchLength = formatterMatch[0].length; - this.matchText = formatterMatch[0]; - this.nextMatch = this.formatter.formatterRegExp.lastIndex; - for(var t=1; t startPos) && (this.highlightMatch.index < endPos) && (startPos < endPos)) { - if(this.highlightMatch.index > startPos) { - createTiddlyText(place,this.source.substring(startPos,this.highlightMatch.index)); - startPos = this.highlightMatch.index; - } - var highlightEnd = Math.min(this.highlightRegExp.lastIndex,endPos); - var theHighlight = createTiddlyElement(place,"span",null,"highlight",this.source.substring(startPos,highlightEnd)); - startPos = highlightEnd; - if(startPos >= this.highlightRegExp.lastIndex) - this.highlightMatch = this.highlightRegExp.exec(this.source); - } - if(startPos < endPos) { - createTiddlyText(place,this.source.substring(startPos,endPos)); - } -}; - - -config.macros.today.handler = function(place,macroName,params) -{ - var now = new Date(); - var text = params[0] ? now.formatString(params[0].trim()) : now.toLocaleString(); - createTiddlyElement(place,"span",null,null,text); -}; - -config.macros.version.handler = function(place) -{ - createTiddlyElement(place,"span",null,null,formatVersion()); -}; - -config.macros.list.handler = function(place,macroName,params) -{ - var type = params[0] ? params[0] : "all"; - var list = document.createElement("ul"); - place.appendChild(list); - if(this[type].prompt) - createTiddlyElement(list,"li",null,"listTitle",this[type].prompt); - var results; - if(this[type].handler) - results = this[type].handler(params); - for(var t = 0; t < results.length; t++) { - var li = document.createElement("li"); - list.appendChild(li); - createTiddlyLink(li,typeof results[t] == "string" ? results[t] : results[t].title,true); - } -}; - -config.macros.list.all.handler = function(params) -{ - return store.reverseLookup("tags","excludeLists",false,"title"); -}; - -config.macros.list.missing.handler = function(params) -{ - return store.getMissingLinks(); -}; - -config.macros.list.orphans.handler = function(params) -{ - return store.getOrphans(); -}; - -config.macros.list.shadowed.handler = function(params) -{ - return store.getShadowed(); -}; - -config.macros.list.touched.handler = function(params) -{ - return store.getTouched(); -}; - -config.macros.list.filter.handler = function(params) -{ - var filter = params[1]; - var results = []; - if(filter) { - var tiddlers = store.filterTiddlers(filter); - for(var t=0; t=last; t--) { - var tiddler = tiddlers[t]; - var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8); - if(theDay != lastDay) { - var ul = document.createElement("ul"); - place.appendChild(ul); - createTiddlyElement(ul,"li",null,"listTitle",tiddler[field].formatString(dateFormat)); - lastDay = theDay; - } - createTiddlyElement(ul,"li",null,"listLink").appendChild(createTiddlyLink(place,tiddler.title,true)); - } -}; - -config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - params = paramString.parseParams("name",null,true,false,true); - var names = params[0]["name"]; - var tiddlerName = names[0]; - var className = names[1] ? names[1] : null; - var args = params[0]["with"]; - var wrapper = createTiddlyElement(place,"span",null,className); - if(!args) { - wrapper.setAttribute("refresh","content"); - wrapper.setAttribute("tiddler",tiddlerName); - } - var text = store.getTiddlerText(tiddlerName); - if(text) { - var stack = config.macros.tiddler.tiddlerStack; - if(stack.indexOf(tiddlerName) !== -1) - return; - stack.push(tiddlerName); - try { - var n = args ? Math.min(args.length,9) : 0; - for(var i=0; i>"); - if(document.all) { - panel.style.height = "100%"; - panel.style.width = "100%"; - } -}; - -config.macros.message.handler = function(place,macroName,params) -{ - if(params[0]) { - var names = params[0].split("."); - var lookupMessage = function(root,nameIndex) { - if(names[nameIndex] in root) { - if(nameIndex < names.length-1) - return (lookupMessage(root[names[nameIndex]],nameIndex+1)); - else - return root[names[nameIndex]]; - } else - return null; - }; - var m = lookupMessage(config,0); - if(m == null) - m = lookupMessage(window,0); - createTiddlyText(place,m.toString().format(params.splice(1))); - } -}; - - -config.macros.view.views = { - text: function(value,place,params,wikifier,paramString,tiddler) { - highlightify(value,place,highlightHack,tiddler); - }, - link: function(value,place,params,wikifier,paramString,tiddler) { - createTiddlyLink(place,value,true); - }, - wikified: function(value,place,params,wikifier,paramString,tiddler) { - if(params[2]) - value=params[2].unescapeLineBreaks().format([value]); - wikify(value,place,highlightHack,tiddler); - }, - date: function(value,place,params,wikifier,paramString,tiddler) { - value = Date.convertFromYYYYMMDDHHMM(value); - createTiddlyText(place,value.formatString(params[2] ? params[2] : config.views.wikified.dateFormat)); - } -}; - -config.macros.view.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - if((tiddler instanceof Tiddler) && params[0]) { - var value = store.getValue(tiddler,params[0]); - if(value) { - var type = params[1] ? params[1] : config.macros.view.defaultView; - var handler = config.macros.view.views[type]; - if(handler) - handler(value,place,params,wikifier,paramString,tiddler); - } - } -}; - -config.macros.edit.handler = function(place,macroName,params,wikifier,paramString,tiddler) -{ - var field = params[0]; - var rows = params[1] || 0; - var defVal = params[2] || ''; - if((tiddler instanceof Tiddler) && field) { - story.setDirty(tiddler.title,true); - var e,v; - if(field != "text" && !rows) { - e = createTiddlyElement(null,"input"); - if(tiddler.isReadOnly()) - e.setAttribute("readOnly","readOnly"); - e.setAttribute("edit",field); - e.setAttribute("type","text"); - e.value = store.getValue(tiddler,field) || defVal; - e.setAttribute("size","40"); - e.setAttribute("autocomplete","off"); - place.appendChild(e); - } else { - var wrapper1 = createTiddlyElement(null,"fieldset",null,"fieldsetFix"); - var wrapper2 = createTiddlyElement(wrapper1,"div"); - e = createTiddlyElement(wrapper2,"textarea"); - if(tiddler.isReadOnly()) - e.setAttribute("readOnly","readOnly"); - e.value = v = store.getValue(tiddler,field) || defVal; - rows = rows ? rows : 10; - var lines = v.match(/\n/mg); - var maxLines = Math.max(parseInt(config.options.txtMaxEditRows),5); - if(lines != null && lines.length > rows) - rows = lines.length + 5; - rows = Math.min(rows,maxLines); - e.setAttribute("rows",rows); - e.setAttribute("edit",field); - place.appendChild(wrapper1); - } - return e; - } -}; - -config.macros.tagChooser.onClick = function(ev) -{ - var e = ev ? ev : window.event; - var lingo = config.views.editor.tagChooser; - var popup = Popup.create(this); - var tags = store.getTags("excludeLists"); - if(tags.length == 0) - createTiddlyText(createTiddlyElement(popup,"li"),lingo.popupNone); - for(var t=0; t 0) - btn.setAttribute("params",tags.join("|")); - btn.setAttribute("newFocus",newFocus); - btn.setAttribute("newTemplate",getParam(params,"template",DEFAULT_EDIT_TEMPLATE)); - if(customFields !== "") - btn.setAttribute("customFields",customFields); - var text = getParam(params,"text"); - if(text !== undefined) - btn.setAttribute("newText",text); - return btn; -}; - -config.macros.newTiddler.onClickNewTiddler = function() -{ - var title = this.getAttribute("newTitle"); - if(this.getAttribute("isJournal") == "true") { - var now = new Date(); - title = now.formatString(title.trim()); - } - var params = this.getAttribute("params"); - var tags = params ? params.split("|") : []; - var focus = this.getAttribute("newFocus"); - var template = this.getAttribute("newTemplate"); - var customFields = this.getAttribute("customFields"); - story.displayTiddler(null,title,template,false,null,null); - var tiddlerElem = story.getTiddler(title); - if(customFields) - story.addCustomFields(tiddlerElem,customFields); - var text = this.getAttribute("newText"); - if(typeof text == "string") - story.getTiddlerField(title,"text").value = text.format([title]); - for(var t=0;t 0) { - story.search(txt.value,config.options.chkCaseSensitiveSearch,config.options.chkRegExpSearch); - txt.setAttribute("lastSearchText",txt.value); - } -}; - -config.macros.search.onClick = function(e) -{ - config.macros.search.doSearch(this.nextSibling); - return false; -}; - -config.macros.search.onKeyPress = function(ev) -{ - var e = ev ? ev : window.event; - switch(e.keyCode) { - case 13: // Ctrl-Enter - case 10: // Ctrl-Enter on IE PC - config.macros.search.doSearch(this); - break; - case 27: // Escape - this.value = ""; - clearMessage(); - break; - } - if(config.options.chkIncrementalSearch) { - if(this.value.length > 2) { - if(this.value != this.getAttribute("lastSearchText")) { - if(config.macros.search.timeout) - clearTimeout(config.macros.search.timeout); - var txt = this; - config.macros.search.timeout = setTimeout(function() {config.macros.search.doSearch(txt);},500); - } - } else { - if(config.macros.search.timeout) - clearTimeout(config.macros.search.timeout); - } - } -}; - -config.macros.search.onFocus = function(e) -{ - this.select(); -}; - - -config.macros.tabs.handler = function(place,macroName,params) -{ - var cookie = params[0]; - var numTabs = (params.length-1)/3; - var wrapper = createTiddlyElement(null,"div",null,"tabsetWrapper " + cookie); - var tabset = createTiddlyElement(wrapper,"div",null,"tabset"); - tabset.setAttribute("cookie",cookie); - var validTab = false; - for(var t=0; t': - var btn = createTiddlyButton(place,this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore); - addClass(btn,"moreCommand"); - var e = createTiddlyElement(place,"span",null,"moreCommand"); - e.style.display = "none"; - place = e; - break; - default: - var className = ""; - switch(c.substr(0,1)) { - case "+": - className = "defaultCommand"; - c = c.substr(1); - break; - case "-": - className = "cancelCommand"; - c = c.substr(1); - break; - } - if(c in config.commands) - this.createCommand(place,c,tiddler,className); - break; - } - } -}; - - -config.commands.closeTiddler.handler = function(event,src,title) -{ - if(story.isDirty(title) && !readOnly) { - if(!confirm(config.commands.cancelTiddler.warning.format([title]))) - return false; - } - story.setDirty(title,false); - story.closeTiddler(title,true); - return false; -}; - -config.commands.closeOthers.handler = function(event,src,title) -{ - story.closeAllTiddlers(title); - return false; -}; - -config.commands.editTiddler.handler = function(event,src,title) -{ - clearMessage(); - var tiddlerElem = story.getTiddler(title); - var fields = tiddlerElem.getAttribute("tiddlyFields"); - story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE,false,null,fields); - story.focusTiddler(title,config.options.txtEditorFocus||"text"); - return false; -}; - -config.commands.saveTiddler.handler = function(event,src,title) -{ - var newTitle = story.saveTiddler(title,event.shiftKey); - if(newTitle) - story.displayTiddler(null,newTitle); - return false; -}; - -config.commands.cancelTiddler.handler = function(event,src,title) -{ - if(story.hasChanges(title) && !readOnly) { - if(!confirm(this.warning.format([title]))) - return false; - } - story.setDirty(title,false); - story.displayTiddler(null,title); - return false; -}; - -config.commands.deleteTiddler.handler = function(event,src,title) -{ - var deleteIt = true; - if(config.options.chkConfirmDelete) - deleteIt = confirm(this.warning.format([title])); - if(deleteIt) { - store.removeTiddler(title); - story.closeTiddler(title,true); - autoSaveChanges(); - } - return false; -}; - -config.commands.permalink.handler = function(event,src,title) -{ - var t = encodeURIComponent(String.encodeTiddlyLink(title)); - if(window.location.hash != t) - window.location.hash = t; - return false; -}; - -config.commands.references.handlePopup = function(popup,title) -{ - var references = store.getReferringTiddlers(title); - var c = false; - for(var r=0; r 0) - ListView.create(popup,items,this.listViewTemplate); - else - createTiddlyElement(popup,"div",null,null,this.emptyText); -}; - - -function Tiddler(title) -{ - this.title = title; - this.text = ""; - this.modifier = null; - this.created = new Date(); - this.modified = this.created; - this.links = []; - this.linksUpdated = false; - this.tags = []; - this.fields = {}; - return this; -} - -Tiddler.prototype.getLinks = function() -{ - if(this.linksUpdated==false) - this.changed(); - return this.links; -}; - -Tiddler.prototype.getInheritedFields = function() -{ - var f = {}; - for(i in this.fields) { - if(i=="server.host" || i=="server.workspace" || i=="wikiformat"|| i=="server.type") { - f[i] = this.fields[i]; - } - } - return String.encodeHashMap(f); -}; - -Tiddler.prototype.incChangeCount = function() -{ - var c = this.fields['changecount']; - c = c ? parseInt(c) : 0; - this.fields['changecount'] = String(c+1); -}; - -Tiddler.prototype.clearChangeCount = function() -{ - if(this.fields['changecount']) { - delete this.fields['changecount']; - } -}; - -Tiddler.prototype.doNotSave = function() -{ - return this.fields['doNotSave']; -}; - -Tiddler.prototype.isTouched = function() -{ - var changeCount = this.fields['changecount']; - if(changeCount === undefined) - changeCount = 0; - return changeCount > 0; -}; - -Tiddler.prototype.toRssItem = function(uri) -{ - var s = []; - s.push("" + this.title.htmlEncode() + ""); - s.push("" + wikifyStatic(this.text,null,this).htmlEncode() + ""); - for(var t=0; t" + this.tags[t] + ""); - s.push("" + uri + "#" + encodeURIComponent(String.encodeTiddlyLink(this.title)) + ""); - s.push("" + this.modified.toGMTString() + ""); - return s.join("\n"); -}; - -Tiddler.prototype.saveToRss = function(uri) -{ - return "\n" + this.toRssItem(uri) + "\n"; -}; - -Tiddler.prototype.set = function(title,text,modifier,modified,tags,created,fields) -{ - this.assign(title,text,modifier,modified,tags,created,fields); - this.changed(); - return this; -}; - -Tiddler.prototype.assign = function(title,text,modifier,modified,tags,created,fields) -{ - if(title) - this.title = title; - if(text) - this.text = text; - if(modifier) - this.modifier = modifier; - if(modified) - this.modified = modified; - if(created) - this.created = created; - if(fields) - this.fields = fields; - if(tags) - this.tags = (typeof tags == "string") ? tags.readBracketedList() : tags; - else if(this.tags == undefined) - this.tags = []; - return this; -}; - -Tiddler.prototype.getTags = function() -{ - return String.encodeTiddlyLinkList(this.tags); -}; - -Tiddler.prototype.isTagged = function(tag) -{ - return this.tags.indexOf(tag) != -1; -}; - -Tiddler.unescapeLineBreaks = function(text) -{ - return text ? text.unescapeLineBreaks() : ""; -}; - -Tiddler.prototype.escapeLineBreaks = function() -{ - return this.text.escapeLineBreaks(); -}; - -Tiddler.prototype.changed = function() -{ - this.links = []; - var t = this.autoLinkWikiWords() ? 0 : 1; - var tiddlerLinkRegExp = t==0 ? config.textPrimitives.tiddlerAnyLinkRegExp : config.textPrimitives.tiddlerForcedLinkRegExp; - tiddlerLinkRegExp.lastIndex = 0; - var formatMatch = tiddlerLinkRegExp.exec(this.text); - while(formatMatch) { - var lastIndex = tiddlerLinkRegExp.lastIndex; - if(t==0 && formatMatch[1] && formatMatch[1] != this.title) { - if(formatMatch.index > 0) { - var preRegExp = new RegExp(config.textPrimitives.unWikiLink+"|"+config.textPrimitives.anyLetter,"mg"); - preRegExp.lastIndex = formatMatch.index-1; - var preMatch = preRegExp.exec(this.text); - if(preMatch.index != formatMatch.index-1) - this.links.pushUnique(formatMatch[1]); - } else { - this.links.pushUnique(formatMatch[1]); - } - } - else if(formatMatch[2-t] && !config.formatterHelpers.isExternalLink(formatMatch[3-t])) // titledBrackettedLink - this.links.pushUnique(formatMatch[3-t]); - else if(formatMatch[4-t] && formatMatch[4-t] != this.title) // brackettedLink - this.links.pushUnique(formatMatch[4-t]); - tiddlerLinkRegExp.lastIndex = lastIndex; - formatMatch = tiddlerLinkRegExp.exec(this.text); - } - this.linksUpdated = true; -}; - -Tiddler.prototype.getSubtitle = function() -{ - var modifier = this.modifier; - if(!modifier) - modifier = config.messages.subtitleUnknown; - var modified = this.modified; - if(modified) - modified = modified.toLocaleString(); - else - modified = config.messages.subtitleUnknown; - return config.messages.tiddlerLinkTooltip.format([this.title,modifier,modified]); -}; - -Tiddler.prototype.isReadOnly = function() -{ - return readOnly; -}; - -Tiddler.prototype.autoLinkWikiWords = function() -{ - return !(this.isTagged("systemConfig") || this.isTagged("excludeMissing")); -}; - -Tiddler.prototype.generateFingerprint = function() -{ - return "0x" + Crypto.hexSha1Str(this.text); -}; - -Tiddler.prototype.getServerType = function() -{ - var serverType = null; - if(this.fields['server.type']) - serverType = this.fields['server.type']; - if(!serverType) - serverType = this.fields['wikiformat']; - if(serverType && !config.adaptors[serverType]) - serverType = null; - return serverType; -}; - -Tiddler.prototype.getAdaptor = function() -{ - var serverType = this.getServerType(); - return serverType ? new config.adaptors[serverType] : null; -}; - - -function TiddlyWiki() -{ - var tiddlers = {}; // Hashmap by name of tiddlers - this.tiddlersUpdated = false; - this.namedNotifications = []; // Array of {name:,notify:} of notification functions - this.notificationLevel = 0; - this.slices = {}; // map tiddlerName->(map sliceName->sliceValue). Lazy. - this.clear = function() { - tiddlers = {}; - this.setDirty(false); - }; - this.fetchTiddler = function(title) { - var t = tiddlers[title]; - return t instanceof Tiddler ? t : null; - }; - this.deleteTiddler = function(title) { - delete this.slices[title]; - delete tiddlers[title]; - }; - this.addTiddler = function(tiddler) { - delete this.slices[tiddler.title]; - tiddlers[tiddler.title] = tiddler; - }; - this.forEachTiddler = function(callback) { - for(var t in tiddlers) { - var tiddler = tiddlers[t]; - if(tiddler instanceof Tiddler) - callback.call(this,t,tiddler); - } - }; -} - -TiddlyWiki.prototype.setDirty = function(dirty) -{ - this.dirty = dirty; -}; - -TiddlyWiki.prototype.isDirty = function() -{ - return this.dirty; -}; - -TiddlyWiki.prototype.suspendNotifications = function() -{ - this.notificationLevel--; -}; - -TiddlyWiki.prototype.resumeNotifications = function() -{ - this.notificationLevel++; -}; - -TiddlyWiki.prototype.notify = function(title,doBlanket) -{ - if(!this.notificationLevel) { - for(var t=0; t<" + "body>" + text.substring(posDiv[0],posDiv[1] + endSaveArea.length) + "<" + "/body><" + "/html>"; - var iframe = document.createElement("iframe"); - iframe.style.display = "none"; - document.body.appendChild(iframe); - var doc = iframe.document; - if(iframe.contentDocument) - doc = iframe.contentDocument; // For NS6 - else if(iframe.contentWindow) - doc = iframe.contentWindow.document; // For IE5.5 and IE6 - doc.open(); - doc.writeln(content); - doc.close(); - var storeArea = doc.getElementById("storeArea"); - this.loadFromDiv(storeArea,"store"); - iframe.parentNode.removeChild(iframe); - return this; -}; - -TiddlyWiki.prototype.updateTiddlers = function() -{ - this.tiddlersUpdated = true; - this.forEachTiddler(function(title,tiddler) { - tiddler.changed(); - }); -}; - -TiddlyWiki.prototype.allTiddlersAsHtml = function() -{ - return store.getSaver().externalize(store); -}; - -TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag,match) -{ - var candidates = this.reverseLookup("tags",excludeTag,!!match); - var results = []; - for(var t=0; t=0;t--) - this.displayTiddler(srcElement,titles[t],template,animate,unused,customFields); -}; - -Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle) -{ - var title = (tiddler instanceof Tiddler) ? tiddler.title : tiddler; - var tiddlerElem = this.getTiddler(title); - if(tiddlerElem) { - if(toggle) - this.closeTiddler(title,true); - else - this.refreshTiddler(title,template,false,customFields); - } else { - var place = this.getContainer(); - var before = this.positionTiddler(srcElement); - tiddlerElem = this.createTiddler(place,before,title,template,customFields); - } - if(srcElement && typeof srcElement !== "string") { - if(config.options.chkAnimate && (animate == undefined || animate == true) && anim && typeof Zoomer == "function" && typeof Scroller == "function") - anim.startAnimating(new Zoomer(title,srcElement,tiddlerElem),new Scroller(tiddlerElem)); - else - window.scrollTo(0,ensureVisible(tiddlerElem)); - } -}; - -Story.prototype.positionTiddler = function(srcElement) -{ - var place = this.getContainer(); - var before = null; - if(typeof srcElement == "string") { - switch(srcElement) { - case "top": - before = place.firstChild; - break; - case "bottom": - before = null; - break; - } - } else { - var after = this.findContainingTiddler(srcElement); - if(after == null) { - before = place.firstChild; - } else if(after.nextSibling) { - before = after.nextSibling; - if(before.nodeType != 1) - before = null; - } - } - return before; -}; - -Story.prototype.createTiddler = function(place,before,title,template,customFields) -{ - var tiddlerElem = createTiddlyElement(null,"div",this.tiddlerId(title),"tiddler"); - tiddlerElem.setAttribute("refresh","tiddler"); - if(customFields) - tiddlerElem.setAttribute("tiddlyFields",customFields); - place.insertBefore(tiddlerElem,before); - var defaultText = null; - if(!store.tiddlerExists(title) && !store.isShadowTiddler(title)) - defaultText = this.loadMissingTiddler(title,customFields,tiddlerElem); - this.refreshTiddler(title,template,false,customFields,defaultText); - return tiddlerElem; -}; - -Story.prototype.loadMissingTiddler = function(title,fields,tiddlerElem) -{ - var tiddler = new Tiddler(title); - tiddler.fields = typeof fields == "string" ? fields.decodeHashMap() : (fields || {}); - var serverType = tiddler.getServerType(); - var host = tiddler.fields['server.host']; - var workspace = tiddler.fields['server.workspace']; - if(!serverType || !host) - return null; - var sm = new SyncMachine(serverType,{ - start: function() { - return this.openHost(host,"openWorkspace"); - }, - openWorkspace: function() { - return this.openWorkspace(workspace,"getTiddler"); - }, - getTiddler: function() { - return this.getTiddler(title,"onGetTiddler"); - }, - onGetTiddler: function(context) { - var tiddler = context.tiddler; - if(tiddler && tiddler.text) { - var downloaded = new Date(); - if(!tiddler.created) - tiddler.created = downloaded; - if(!tiddler.modified) - tiddler.modified = tiddler.created; - store.saveTiddler(tiddler.title,tiddler.title,tiddler.text,tiddler.modifier,tiddler.modified,tiddler.tags,tiddler.fields,true,tiddler.created); - autoSaveChanges(); - } - delete this; - return true; - }, - error: function(message) { - displayMessage("Error loading missing tiddler from %0: %1".format([host,message])); - } - }); - sm.go(); - return config.messages.loadingMissingTiddler.format([title,serverType,host,workspace]); -}; - -Story.prototype.chooseTemplateForTiddler = function(title,template) -{ - if(!template) - template = DEFAULT_VIEW_TEMPLATE; - if(template == DEFAULT_VIEW_TEMPLATE || template == DEFAULT_EDIT_TEMPLATE) - template = config.tiddlerTemplates[template]; - return template; -}; - -Story.prototype.getTemplateForTiddler = function(title,template,tiddler) -{ - return store.getRecursiveTiddlerText(template,null,10); -}; - -Story.prototype.refreshTiddler = function(title,template,force,customFields,defaultText) -{ - var tiddlerElem = this.getTiddler(title); - if(tiddlerElem) { - if(tiddlerElem.getAttribute("dirty") == "true" && !force) - return tiddlerElem; - template = this.chooseTemplateForTiddler(title,template); - var currTemplate = tiddlerElem.getAttribute("template"); - if((template != currTemplate) || force) { - var tiddler = store.getTiddler(title); - if(!tiddler) { - tiddler = new Tiddler(); - if(store.isShadowTiddler(title)) { - tiddler.set(title,store.getTiddlerText(title),config.views.wikified.shadowModifier,version.date,[],version.date); - } else { - var text = template=="EditTemplate" ? - config.views.editor.defaultText.format([title]) : - config.views.wikified.defaultText.format([title]); - text = defaultText || text; - var fields = customFields ? customFields.decodeHashMap() : null; - tiddler.set(title,text,config.views.wikified.defaultModifier,version.date,[],version.date,fields); - } - } - tiddlerElem.setAttribute("tags",tiddler.tags.join(" ")); - tiddlerElem.setAttribute("tiddler",title); - tiddlerElem.setAttribute("template",template); - tiddlerElem.onmouseover = this.onTiddlerMouseOver; - tiddlerElem.onmouseout = this.onTiddlerMouseOut; - tiddlerElem.ondblclick = this.onTiddlerDblClick; - tiddlerElem[window.event?"onkeydown":"onkeypress"] = this.onTiddlerKeyPress; - tiddlerElem.innerHTML = this.getTemplateForTiddler(title,template,tiddler); - applyHtmlMacros(tiddlerElem,tiddler); - if(store.getTaggedTiddlers(title).length > 0) - addClass(tiddlerElem,"isTag"); - else - removeClass(tiddlerElem,"isTag"); - if(store.tiddlerExists(title)) { - removeClass(tiddlerElem,"shadow"); - removeClass(tiddlerElem,"missing"); - } else { - addClass(tiddlerElem,store.isShadowTiddler(title) ? "shadow" : "missing"); - } - if(customFields) - this.addCustomFields(tiddlerElem,customFields); - forceReflow(); - } - } - return tiddlerElem; -}; - -Story.prototype.addCustomFields = function(place,customFields) -{ - var fields = customFields.decodeHashMap(); - var w = document.createElement("div"); - w.style.display = "none"; - place.appendChild(w); - for(var t in fields) { - var e = document.createElement("input"); - e.setAttribute("type","text"); - e.setAttribute("value",fields[t]); - w.appendChild(e); - e.setAttribute("edit",t); - } -}; - -Story.prototype.refreshAllTiddlers = function(force) -{ - var place = this.getContainer(); - var e = place.firstChild; - if(!e) - return; - this.refreshTiddler(e.getAttribute("tiddler"),force ? null : e.getAttribute("template"),true); - while((e = e.nextSibling) != null) - this.refreshTiddler(e.getAttribute("tiddler"),force ? null : e.getAttribute("template"),true); -}; - -Story.prototype.onTiddlerMouseOver = function(e) -{ - if(window.addClass instanceof Function) - addClass(this,"selected"); -}; - -Story.prototype.onTiddlerMouseOut = function(e) -{ - if(window.removeClass instanceof Function) - removeClass(this,"selected"); -}; - -Story.prototype.onTiddlerDblClick = function(ev) -{ - var e = ev ? ev : window.event; - var target = resolveTarget(e); - if(target && target.nodeName.toLowerCase() != "input" && target.nodeName.toLowerCase() != "textarea") { - if(document.selection && document.selection.empty) - document.selection.empty(); - config.macros.toolbar.invokeCommand(this,"defaultCommand",e); - e.cancelBubble = true; - if(e.stopPropagation) e.stopPropagation(); - return true; - } - return false; -}; - -Story.prototype.onTiddlerKeyPress = function(ev) -{ - var e = ev ? ev : window.event; - clearMessage(); - var consume = false; - var title = this.getAttribute("tiddler"); - var target = resolveTarget(e); - switch(e.keyCode) { - case 9: // Tab - if(config.options.chkInsertTabs && target.tagName.toLowerCase() == "textarea") { - replaceSelection(target,String.fromCharCode(9)); - consume = true; - } - if(config.isOpera) { - target.onblur = function() { - this.focus(); - this.onblur = null; - }; - } - break; - case 13: // Ctrl-Enter - case 10: // Ctrl-Enter on IE PC - case 77: // Ctrl-Enter is "M" on some platforms - if(e.ctrlKey) { - blurElement(this); - config.macros.toolbar.invokeCommand(this,"defaultCommand",e); - consume = true; - } - break; - case 27: // Escape - blurElement(this); - config.macros.toolbar.invokeCommand(this,"cancelCommand",e); - consume = true; - break; - } - e.cancelBubble = consume; - if(consume) { - if(e.stopPropagation) e.stopPropagation(); // Stop Propagation - e.returnValue = true; // Cancel The Event in IE - if(e.preventDefault ) e.preventDefault(); // Cancel The Event in Moz - } - return !consume; -}; - -Story.prototype.getTiddlerField = function(title,field) -{ - var tiddlerElem = this.getTiddler(title); - var e = null; - if(tiddlerElem ) { - var children = tiddlerElem.getElementsByTagName("*"); - for(var t=0; t 0) - displayMessage(config.macros.search.successMsg.format([matches.length.toString(),q + text + q])); - else - displayMessage(config.macros.search.failureMsg.format([q + text + q])); -}; - -Story.prototype.findContainingTiddler = function(e) -{ - while(e && !hasClass(e,"tiddler")) - e = e.parentNode; - return e; -}; - -Story.prototype.gatherSaveFields = function(e,fields) -{ - if(e && e.getAttribute) { - var f = e.getAttribute("edit"); - if(f) - fields[f] = e.value.replace(/\r/mg,""); - if(e.hasChildNodes()) { - var c = e.childNodes; - for(var t=0; t 0) { - if(!confirm(config.macros.importTiddlers.confirmOverwriteText.format([overwrite.join(", ")]))) - return false; - } - wizard.addStep(config.macros.importTiddlers.step4Title.format([rowNames.length]),config.macros.importTiddlers.step4Html); - for(t=0; t si.tiddler.fields['server.page.revision']) { - si.syncStatus = config.macros.sync.syncStatusList[si.isTouched ? 'changedBoth' : 'changedServer']; - } - } else { - si.syncStatus = config.macros.sync.syncStatusList.notFound; - } - config.macros.sync.updateSyncStatus(si); - } - }, - getTiddler: function(title) { - return this.getTiddler(title,"onGetTiddler"); - }, - onGetTiddler: function(context) { - var tiddler = context.tiddler; - var syncItem = st.syncItems.findByField("title",tiddler.title); - if(syncItem !== null) { - syncItem = st.syncItems[syncItem]; - store.saveTiddler(tiddler.title, tiddler.title, tiddler.text, tiddler.modifier, tiddler.modified, tiddler.tags, tiddler.fields, true, tiddler.created); - syncItem.syncStatus = config.macros.sync.syncStatusList.gotFromServer; - config.macros.sync.updateSyncStatus(syncItem); - } - }, - putTiddler: function(tiddler) { - return this.putTiddler(tiddler,"onPutTiddler"); - }, - onPutTiddler: function(context) { - var title = context.title; - var syncItem = st.syncItems.findByField("title",title); - if(syncItem !== null) { - syncItem = st.syncItems[syncItem]; - store.resetTiddler(title); - if(context.status) { - syncItem.syncStatus = config.macros.sync.syncStatusList.putToServer; - config.macros.sync.updateSyncStatus(syncItem); - } - } - } - }); - st.syncMachine.go(); - return st; -}; - -config.macros.sync.updateSyncStatus = function(syncItem) -{ - var e = syncItem.colElements["status"]; - jQuery(e).empty(); - createTiddlyText(e,syncItem.syncStatus.text); - syncItem.rowElement.style.backgroundColor = syncItem.syncStatus.color; - syncItem.rowElement.style.display = syncItem.syncStatus.display; -}; - -config.macros.sync.doSync = function(e) -{ - var rowNames = ListView.getSelectedRows(currSync.listView); - var sl = config.macros.sync.syncStatusList; - for(var i=0; i=0; t--) - stash.appendChild(nodes[t]); - } - var wrapper = document.getElementById("contentWrapper"); - - isAvailable = function(title) { - var s = title ? title.indexOf(config.textPrimitives.sectionSeparator) : -1; - if(s!=-1) - title = title.substr(0,s); - return store.tiddlerExists(title) || store.isShadowTiddler(title); - }; - if(!title || !isAvailable(title)) - title = config.refresherData.pageTemplate; - if(!isAvailable(title)) - title = config.refresherData.defaultPageTemplate; //# this one is always avaialable - html = store.getRecursiveTiddlerText(title,null,10); - wrapper.innerHTML = html; - applyHtmlMacros(wrapper); - refreshElements(wrapper); - display = story.getContainer(); - removeChildren(display); - if(!display) - display = createTiddlyElement(wrapper,"div",story.containerId()); - nodes = stash.childNodes; - for(t=nodes.length-1; t>=0; t--) - display.appendChild(nodes[t]); - removeNode(stash); -} - -function refreshDisplay(hint) -{ - if(typeof hint == "string") - hint = [hint]; - var e = document.getElementById("contentWrapper"); - refreshElements(e,hint); - if(backstage.isPanelVisible()) { - e = document.getElementById("backstage"); - refreshElements(e,hint); - } -} - -function refreshPageTitle() -{ - document.title = getPageTitle(); -} - -function getPageTitle() -{ - var st = wikifyPlain("SiteTitle"); - var ss = wikifyPlain("SiteSubtitle"); - return st + ((st == "" || ss == "") ? "" : " - ") + ss; -} - -function refreshStyles(title,doc) -{ - setStylesheet(title == null ? "" : store.getRecursiveTiddlerText(title,"",10),title,doc || document); -} - -function refreshColorPalette(title) -{ - if(!startingUp) - refreshAll(); -} - -function refreshAll() -{ - refreshPageTemplate(); - refreshDisplay(); - refreshStyles("StyleSheetLayout"); - refreshStyles("StyleSheetColors"); - refreshStyles(config.refresherData.styleSheet); - refreshStyles("StyleSheetPrint"); -} - - -config.optionHandlers = { - 'txt': { - get: function(name) {return encodeCookie(config.options[name].toString());}, - set: function(name,value) {config.options[name] = decodeCookie(value);} - }, - 'chk': { - get: function(name) {return config.options[name] ? "true" : "false";}, - set: function(name,value) {config.options[name] = value == "true";} - } -}; - -function loadOptionsCookie() -{ - if(safeMode) - return; - var cookies = document.cookie.split(";"); - for(var c=0; c'; // Split up into two so that indexOf() of this source doesn't find it -var endSaveArea = ''; - -function confirmExit() -{ - hadConfirmExit = true; - if((store && store.isDirty && store.isDirty()) || (story && story.areAnyDirty && story.areAnyDirty())) - return config.messages.confirmExit; -} - -function checkUnsavedChanges() -{ - if(store && store.isDirty && store.isDirty() && window.hadConfirmExit === false) { - if(confirm(config.messages.unsavedChangesWarning)) - saveChanges(); - } -} - -function updateLanguageAttribute(s) -{ - if(config.locale) { - var mRE = /(/; - var m = mRE.exec(s); - if(m) { - var t = m[1]; - if(m[2]) - t += ' xml:lang="' + config.locale + '"'; - if(m[3]) - t += ' lang="' + config.locale + '"'; - t += ">"; - s = s.substr(0,m.index) + t + s.substr(m.index+m[0].length); - } - } - return s; -} - -function updateMarkupBlock(s,blockName,tiddlerName) -{ - return s.replaceChunk( - "".format([blockName]), - "".format([blockName]), - "\n" + convertUnicodeToFileFormat(store.getRecursiveTiddlerText(tiddlerName,"")) + "\n"); -} - -function updateOriginal(original,posDiv) -{ - if(!posDiv) - posDiv = locateStoreArea(original); - if(!posDiv) { - alert(config.messages.invalidFileError.format([localPath])); - return null; - } - var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" + - convertUnicodeToFileFormat(store.allTiddlersAsHtml()) + "\n" + - original.substr(posDiv[1]); - var newSiteTitle = convertUnicodeToFileFormat(getPageTitle()).htmlEncode(); - revised = revised.replaceChunk("",""," " + newSiteTitle + " "); - revised = updateLanguageAttribute(revised); - revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead"); - revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead"); - revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody"); - revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody"); - return revised; -} - -function locateStoreArea(original) -{ - var posOpeningDiv = original.indexOf(startSaveArea); - var limitClosingDiv = original.indexOf("<"+"!--POST-STOREAREA--"+">"); - if(limitClosingDiv == -1) - limitClosingDiv = original.indexOf("<"+"!--POST-BODY-START--"+">"); - var posClosingDiv = original.lastIndexOf(endSaveArea,limitClosingDiv == -1 ? original.length : limitClosingDiv); - return (posOpeningDiv != -1 && posClosingDiv != -1) ? [posOpeningDiv,posClosingDiv] : null; -} - -function autoSaveChanges(onlyIfDirty,tiddlers) -{ - if(config.options.chkAutoSave) - saveChanges(onlyIfDirty,tiddlers); -} - -function loadOriginal(localPath) -{ - return loadFile(localPath); -} - -function saveChanges(onlyIfDirty,tiddlers) -{ - if(onlyIfDirty && !store.isDirty()) - return; - clearMessage(); - var t0 = new Date(); - var originalPath = document.location.toString(); - if(originalPath.substr(0,5) != "file:") { - alert(config.messages.notFileUrlError); - if(store.tiddlerExists(config.messages.saveInstructions)) - story.displayTiddler(null,config.messages.saveInstructions); - return; - } - var localPath = getLocalPath(originalPath); - var original = loadOriginal(localPath); - if(original == null) { - alert(config.messages.cantSaveError); - if(store.tiddlerExists(config.messages.saveInstructions)) - story.displayTiddler(null,config.messages.saveInstructions); - return; - } - var posDiv = locateStoreArea(original); - if(!posDiv) { - alert(config.messages.invalidFileError.format([localPath])); - return; - } - saveMain(localPath,original,posDiv); - if(config.options.chkSaveBackups) - saveBackup(localPath,original); - if(config.options.chkSaveEmptyTemplate) - saveEmpty(localPath,original,posDiv); - if(config.options.chkGenerateAnRssFeed && saveRss instanceof Function) - saveRss(localPath); - if(config.options.chkDisplayInstrumentation) - displayMessage("saveChanges " + (new Date()-t0) + " ms"); -} - -function saveMain(localPath,original,posDiv) -{ - var save; - try { - var revised = updateOriginal(original,posDiv); - save = saveFile(localPath,revised); - } catch (ex) { - showException(ex); - } - if(save) { - displayMessage(config.messages.mainSaved,"file://" + localPath); - store.setDirty(false); - } else { - alert(config.messages.mainFailed); - } -} - -function saveBackup(localPath,original) -{ - var backupPath = getBackupPath(localPath); - var backup = copyFile(backupPath,localPath); - if(!backup) - backup = saveFile(backupPath,original); - if(backup) - displayMessage(config.messages.backupSaved,"file://" + backupPath); - else - alert(config.messages.backupFailed); -} - -function saveEmpty(localPath,original,posDiv) -{ - var emptyPath,p; - if((p = localPath.lastIndexOf("/")) != -1) - emptyPath = localPath.substr(0,p) + "/"; - else if((p = localPath.lastIndexOf("\\")) != -1) - emptyPath = localPath.substr(0,p) + "\\"; - else - emptyPath = localPath + "."; - emptyPath += "empty.html"; - var empty = original.substr(0,posDiv[0] + startSaveArea.length) + original.substr(posDiv[1]); - var emptySave = saveFile(emptyPath,empty); - if(emptySave) - displayMessage(config.messages.emptySaved,"file://" + emptyPath); - else - alert(config.messages.emptyFailed); -} - -function getLocalPath(origPath) -{ - var originalPath = convertUriToUTF8(origPath,config.options.txtFileSystemCharSet); - var argPos = originalPath.indexOf("?"); - if(argPos != -1) - originalPath = originalPath.substr(0,argPos); - var hashPos = originalPath.indexOf("#"); - if(hashPos != -1) - originalPath = originalPath.substr(0,hashPos); - if(originalPath.indexOf("file://localhost/") == 0) - originalPath = "file://" + originalPath.substr(16); - var localPath; - if(originalPath.charAt(9) == ":") // pc local file - localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file://///") == 0) // FireFox pc network file - localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\"); - else if(originalPath.indexOf("file:///") == 0) // mac/unix local file - localPath = unescape(originalPath.substr(7)); - else if(originalPath.indexOf("file:/") == 0) // mac/unix local file - localPath = unescape(originalPath.substr(5)); - else // pc network file - localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\"); - return localPath; -} - -function getBackupPath(localPath,title,extension) -{ - var slash = "\\"; - var dirPathPos = localPath.lastIndexOf("\\"); - if(dirPathPos == -1) { - dirPathPos = localPath.lastIndexOf("/"); - slash = "/"; - } - var backupFolder = config.options.txtBackupFolder; - if(!backupFolder || backupFolder == "") - backupFolder = "."; - var backupPath = localPath.substr(0,dirPathPos) + slash + backupFolder + localPath.substr(dirPathPos); - backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "."; - if(title) - backupPath += title.replace(/[\\\/\*\?\":<> ]/g,"_") + "."; - backupPath += (new Date()).convertToYYYYMMDDHHMMSSMMM() + "." + (extension || "html"); - return backupPath; -} - - -function saveRss(localPath) -{ - var rssPath = localPath.substr(0,localPath.lastIndexOf(".")) + ".xml"; - if(saveFile(rssPath,convertUnicodeToFileFormat(generateRss()))) - displayMessage(config.messages.rssSaved,"file://" + rssPath); - else - alert(config.messages.rssFailed); -} - -function generateRss() -{ - var s = []; - var d = new Date(); - var u = store.getTiddlerText("SiteUrl"); - s.push("<" + "?xml version=\"1.0\"?" + ">"); - s.push(""); - s.push(""); - s.push("" + wikifyPlain("SiteTitle").htmlEncode() + ""); - if(u) - s.push("" + u.htmlEncode() + ""); - s.push("" + wikifyPlain("SiteSubtitle").htmlEncode() + ""); - s.push("en-us"); - s.push("Copyright " + d.getFullYear() + " " + config.options.txtUserName.htmlEncode() + ""); - s.push("" + d.toGMTString() + ""); - s.push("" + d.toGMTString() + ""); - s.push("http://blogs.law.harvard.edu/tech/rss"); - s.push("TiddlyWiki " + formatVersion() + ""); - var tiddlers = store.getTiddlers("modified","excludeLists"); - var n = config.numRssItems > tiddlers.length ? 0 : tiddlers.length-config.numRssItems; - for(var t=tiddlers.length-1; t>=n; t--) { - s.push("\n" + tiddlers[t].toRssItem(u) + "\n"); - } - s.push(""); - s.push(""); - return s.join("\n"); -} - - -function convertUTF8ToUnicode(u) -{ - return config.browser.isOpera || !window.netscape ? manualConvertUTF8ToUnicode(u) : mozConvertUTF8ToUnicode(u); -} - -function manualConvertUTF8ToUnicode(utf) -{ - var uni = utf; - var src = 0; - var dst = 0; - var b1, b2, b3; - var c; - while(src < utf.length) { - b1 = utf.charCodeAt(src++); - if(b1 < 0x80) { - dst++; - } else if(b1 < 0xE0) { - b2 = utf.charCodeAt(src++); - c = String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F)); - uni = uni.substring(0,dst++).concat(c,utf.substr(src)); - } else { - b2 = utf.charCodeAt(src++); - b3 = utf.charCodeAt(src++); - c = String.fromCharCode(((b1 & 0xF) << 12) | ((b2 & 0x3F) << 6) | (b3 & 0x3F)); - uni = uni.substring(0,dst++).concat(c,utf.substr(src)); - } - } - return uni; -} - -function mozConvertUTF8ToUnicode(u) -{ - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); - converter.charset = "UTF-8"; - } catch(ex) { - return manualConvertUTF8ToUnicode(u); - } // fallback - var s = converter.ConvertToUnicode(u); - var fin = converter.Finish(); - return fin.length > 0 ? s+fin : s; -} - -function convertUnicodeToFileFormat(u) -{ - return config.browser.isOpera || !window.netscape ? convertUnicodeToHtmlEntities(u) : mozConvertUnicodeToUTF8(u); -} - -function convertUnicodeToHtmlEntities(s) -{ - var re = /[^\u0000-\u007F]/g; - return s.replace(re,function($0) {return "&#" + $0.charCodeAt(0).toString() + ";";}); - -} - -function convertUnicodeToUTF8(s) -{ - return config.browser.isOpera || !window.netscape ? manualConvertUnicodeToUTF8(s) : mozConvertUTF8ToUnicode(s); -} - -function manualConvertUnicodeToUTF8(s) -{ - return unescape(encodeURIComponent(s)); -} - -function mozConvertUnicodeToUTF8(s) -{ - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter); - converter.charset = "UTF-8"; - } catch(ex) { - return manualConvertUnicodeToUTF8(s); - } // fallback - var u = converter.ConvertFromUnicode(s); - var fin = converter.Finish(); - return fin.length > 0 ? u + fin : u; -} - -function convertUriToUTF8(uri,charSet) -{ - if(window.netscape == undefined || charSet == undefined || charSet == "") - return uri; - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var converter = Components.classes["@mozilla.org/intl/utf8converterservice;1"].getService(Components.interfaces.nsIUTF8ConverterService); - } catch(ex) { - return uri; - } - return converter.convertURISpecToUTF8(uri,charSet); -} - -function copyFile(dest,source) -{ - return config.browser.isIE ? ieCopyFile(dest,source) : false; -} - -function saveFile(fileUrl,content) -{ - var r = mozillaSaveFile(fileUrl,content); - if(!r) - r = ieSaveFile(fileUrl,content); - if(!r) - r = javaSaveFile(fileUrl,content); - return r; -} - -function loadFile(fileUrl) -{ - var r = mozillaLoadFile(fileUrl); - if((r == null) || (r == false)) - r = ieLoadFile(fileUrl); - if((r == null) || (r == false)) - r = javaLoadFile(fileUrl); - return r; -} - -function ieCreatePath(path) -{ - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - } catch(ex) { - return null; - } - - var pos = path.lastIndexOf("\\"); - if(pos!=-1) - path = path.substring(0, pos+1); - - var scan = []; - scan.push(path); - var i = 0; - do { - var parent = fso.GetParentFolderName(scan[i++]); - if(fso.FolderExists(parent)) - break; - scan.push(parent); - } while(true); - - for(i=scan.length-1;i>=0;i--) { - if(!fso.FolderExists(scan[i])) - fso.CreateFolder(scan[i]); - } - return true; -} - -function ieSaveFile(filePath,content) -{ - ieCreatePath(filePath); - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - } catch(ex) { - return null; - } - var file = fso.OpenTextFile(filePath,2,-1,0); - file.Write(content); - file.Close(); - return true; -} - -function ieLoadFile(filePath) -{ - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var file = fso.OpenTextFile(filePath,1); - var content = file.ReadAll(); - file.Close(); - } catch(ex) { - return null; - } - return content; -} - -function ieCopyFile(dest,source) -{ - ieCreatePath(dest); - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - fso.GetFile(source).Copy(dest); - } catch(ex) { - return false; - } - return true; -} - -function mozillaSaveFile(filePath,content) -{ - if(window.Components) { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - file.initWithPath(filePath); - if(!file.exists()) - file.create(0,0664); - var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream); - out.init(file,0x20|0x02,00004,null); - out.write(content,content.length); - out.flush(); - out.close(); - return true; - } catch(ex) { - return false; - } - } - return null; -} - -function mozillaLoadFile(filePath) -{ - if(window.Components) { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - file.initWithPath(filePath); - if(!file.exists()) - return null; - var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); - inputStream.init(file,0x01,00004,null); - var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); - sInputStream.init(inputStream); - var contents = sInputStream.read(sInputStream.available()); - sInputStream.close(); - inputStream.close(); - return contents; - } catch(ex) { - return false; - } - } - return null; -} - -function javaUrlToFilename(url) -{ - var f = "//localhost"; - if(url.indexOf(f) == 0) - return url.substring(f.length); - var i = url.indexOf(":"); - return i > 0 ? url.substring(i-1) : url; -} - -function javaSaveFile(filePath,content) -{ - try { - if(document.applets["TiddlySaver"]) - return document.applets["TiddlySaver"].saveFile(javaUrlToFilename(filePath),"UTF-8",content); - } catch(ex) { - } - try { - var s = new java.io.PrintStream(new java.io.FileOutputStream(javaUrlToFilename(filePath))); - s.print(content); - s.close(); - } catch(ex) { - return null; - } - return true; -} - -function javaLoadFile(filePath) -{ - try { - if(document.applets["TiddlySaver"]) - return String(document.applets["TiddlySaver"].loadFile(javaUrlToFilename(filePath),"UTF-8")); - } catch(ex) { - } - var content = []; - try { - var r = new java.io.BufferedReader(new java.io.FileReader(javaUrlToFilename(filePath))); - var line; - while((line = r.readLine()) != null) - content.push(new String(line)); - r.close(); - } catch(ex) { - return null; - } - return content.join("\n"); -} - - -function FileAdaptor() -{ - this.host = null; - this.store = null; - return this; -} - -FileAdaptor.serverType = 'file'; -FileAdaptor.serverLabel = 'TiddlyWiki'; - -FileAdaptor.prototype.setContext = function(context,userParams,callback) -{ - if(!context) context = {}; - context.userParams = userParams; - if(callback) context.callback = callback; - context.adaptor = this; - if(!context.host) - context.host = this.host; - context.host = FileAdaptor.fullHostName(context.host); - if(!context.workspace) - context.workspace = this.workspace; - return context; -}; - -FileAdaptor.fullHostName = function(host) -{ - if(!host) - return ''; - if(!host.match(/:\/\//)) - host = 'http://' + host; - return host; -}; - -FileAdaptor.minHostName = function(host) -{ - return host ? host.replace(/^http:\/\//,'').replace(/\/$/,'') : ''; -}; - -FileAdaptor.prototype.openHost = function(host,context,userParams,callback) -{ - this.host = host; - context = this.setContext(context,userParams,callback); - context.status = true; - if(callback) - window.setTimeout(function() {context.callback(context,userParams);},10); - return true; -}; - -FileAdaptor.loadTiddlyWikiCallback = function(status,context,responseText,url,xhr) -{ - context.status = status; - if(!status) { - context.statusText = "Error reading file"; - } else { - context.adaptor.store = new TiddlyWiki(); - if(!context.adaptor.store.importTiddlyWiki(responseText)) - context.statusText = config.messages.invalidFileError.format([url]); - } - context.complete(context,context.userParams); -}; - -FileAdaptor.prototype.getWorkspaceList = function(context,userParams,callback) -{ - context = this.setContext(context,userParams,callback); - context.workspaces = [{title:"(default)"}]; - context.status = true; - if(callback) - window.setTimeout(function() {callback(context,userParams);},10); - return true; -}; - -FileAdaptor.prototype.openWorkspace = function(workspace,context,userParams,callback) -{ - this.workspace = workspace; - context = this.setContext(context,userParams,callback); - context.status = true; - if(callback) - window.setTimeout(function() {callback(context,userParams);},10); - return true; -}; - -FileAdaptor.prototype.getTiddlerList = function(context,userParams,callback,filter) -{ - context = this.setContext(context,userParams,callback); - if(!context.filter) - context.filter = filter; - context.complete = FileAdaptor.getTiddlerListComplete; - if(this.store) { - var ret = context.complete(context,context.userParams); - } else { - ret = loadRemoteFile(context.host,FileAdaptor.loadTiddlyWikiCallback,context); - if(typeof ret != "string") - ret = true; - } - return ret; -}; - -FileAdaptor.getTiddlerListComplete = function(context,userParams) -{ - if(context.status) { - if(context.filter) { - context.tiddlers = context.adaptor.store.filterTiddlers(context.filter); - } else { - context.tiddlers = []; - context.adaptor.store.forEachTiddler(function(title,tiddler) {context.tiddlers.push(tiddler);}); - } - for(var i=0; ix2) - return -1; - } - x1 = v1.beta || 9999; - x2 = v2.beta || 9999; - if(x1 x2 ? -1 : 0; -}; - -function createTiddlyButton(parent,text,tooltip,action,className,id,accessKey,attribs) -{ - var btn = document.createElement("a"); - if(action) { - btn.onclick = action; - btn.setAttribute("href","javascript:;"); - } - if(tooltip) - btn.setAttribute("title",tooltip); - if(text) - btn.appendChild(document.createTextNode(text)); - btn.className = className || "button"; - if(id) - btn.id = id; - if(attribs) { - for(var i in attribs) { - btn.setAttribute(i,attribs[i]); - } - } - if(parent) - parent.appendChild(btn); - if(accessKey) - btn.setAttribute("accessKey",accessKey); - return btn; -} - -function createTiddlyLink(place,title,includeText,className,isStatic,linkedFromTiddler,noToggle) -{ - var text = includeText ? title : null; - var i = getTiddlyLinkInfo(title,className); - var btn = isStatic ? createExternalLink(place,store.getTiddlerText("SiteUrl",null) + "#" + title) : createTiddlyButton(place,text,i.subTitle,onClickTiddlerLink,i.classes); - btn.setAttribute("refresh","link"); - btn.setAttribute("tiddlyLink",title); - if(noToggle) - btn.setAttribute("noToggle","true"); - if(linkedFromTiddler) { - var fields = linkedFromTiddler.getInheritedFields(); - if(fields) - btn.setAttribute("tiddlyFields",fields); - } - return btn; -} - -function refreshTiddlyLink(e,title) -{ - var i = getTiddlyLinkInfo(title,e.className); - e.className = i.classes; - e.title = i.subTitle; -} - -function getTiddlyLinkInfo(title,currClasses) -{ - var classes = currClasses ? currClasses.split(" ") : []; - classes.pushUnique("tiddlyLink"); - var tiddler = store.fetchTiddler(title); - var subTitle; - if(tiddler) { - subTitle = tiddler.getSubtitle(); - classes.pushUnique("tiddlyLinkExisting"); - classes.remove("tiddlyLinkNonExisting"); - classes.remove("shadow"); - } else { - classes.remove("tiddlyLinkExisting"); - classes.pushUnique("tiddlyLinkNonExisting"); - if(store.isShadowTiddler(title)) { - subTitle = config.messages.shadowedTiddlerToolTip.format([title]); - classes.pushUnique("shadow"); - } else { - subTitle = config.messages.undefinedTiddlerToolTip.format([title]); - classes.remove("shadow"); - } - } - if(typeof config.annotations[title]=="string") - subTitle = config.annotations[title]; - return {classes: classes.join(" "),subTitle: subTitle}; -} - -function createExternalLink(place,url) -{ - var link = document.createElement("a"); - link.className = "externalLink"; - link.href = url; - link.title = config.messages.externalLinkTooltip.format([url]); - if(config.options.chkOpenInNewWindow) - link.target = "_blank"; - place.appendChild(link); - return link; -} - -function onClickTiddlerLink(ev) -{ - var e = ev ? ev : window.event; - var target = resolveTarget(e); - var link = target; - var title = null; - var fields = null; - var noToggle = null; - do { - title = link.getAttribute("tiddlyLink"); - fields = link.getAttribute("tiddlyFields"); - noToggle = link.getAttribute("noToggle"); - link = link.parentNode; - } while(title == null && link != null); - if(!store.isShadowTiddler(title)) { - var f = fields ? fields.decodeHashMap() : {}; - fields = String.encodeHashMap(merge(f,config.defaultCustomFields,true)); - } - if(title) { - var toggling = e.metaKey || e.ctrlKey; - if(config.options.chkToggleLinks) - toggling = !toggling; - if(noToggle) - toggling = false; - if(store.getTiddler(title)) - fields = null; - story.displayTiddler(target,title,null,true,null,fields,toggling); - } - clearMessage(); - return false; -} - -function createTagButton(place,tag,excludeTiddler,title,tooltip) -{ - var btn = createTiddlyButton(place,title||tag,(tooltip||config.views.wikified.tag.tooltip).format([tag]),onClickTag); - btn.setAttribute("tag",tag); - if(excludeTiddler) - btn.setAttribute("tiddler",excludeTiddler); - return btn; -} - -function onClickTag(ev) -{ - var e = ev ? ev : window.event; - var popup = Popup.create(this); - var tag = this.getAttribute("tag"); - var title = this.getAttribute("tiddler"); - if(popup && tag) { - var tagged = store.getTaggedTiddlers(tag); - var titles = []; - var li,r; - for(r=0;r 0) { - var openAll = createTiddlyButton(createTiddlyElement(popup,"li"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll); - openAll.setAttribute("tag",tag); - createTiddlyElement(createTiddlyElement(popup,"li",null,"listBreak"),"div"); - for(r=0; r= this.endTime) { - this.stop(); - return false; - } - return true; -}; - - -function Zoomer(text,startElement,targetElement,unused) -{ - var e = createTiddlyElement(document.body,"div",null,"zoomer"); - createTiddlyElement(e,"div",null,null,text); - var winWidth = findWindowWidth(); - var winHeight = findWindowHeight(); - var p = [ - {style: 'left', start: findPosX(startElement), end: findPosX(targetElement), template: '%0px'}, - {style: 'top', start: findPosY(startElement), end: findPosY(targetElement), template: '%0px'}, - {style: 'width', start: Math.min(startElement.scrollWidth,winWidth), end: Math.min(targetElement.scrollWidth,winWidth), template: '%0px', atEnd: 'auto'}, - {style: 'height', start: Math.min(startElement.scrollHeight,winHeight), end: Math.min(targetElement.scrollHeight,winHeight), template: '%0px', atEnd: 'auto'}, - {style: 'fontSize', start: 8, end: 24, template: '%0pt'} - ]; - var c = function(element,properties) {removeNode(element);}; - return new Morpher(e,config.animDuration,p,c); -} - - -function Scroller(targetElement) -{ - var p = [{style: '-tw-vertScroll', start: findScrollY(), end: ensureVisible(targetElement)}]; - return new Morpher(targetElement,config.animDuration,p); -} - - -function Slider(element,opening,unused,deleteMode) -{ - element.style.overflow = 'hidden'; - if(opening) - element.style.height = '0px'; // Resolves a Firefox flashing bug - element.style.display = 'block'; - var left = findPosX(element); - var width = element.scrollWidth; - var height = element.scrollHeight; - var winWidth = findWindowWidth(); - var p = []; - var c = null; - if(opening) { - p.push({style: 'height', start: 0, end: height, template: '%0px', atEnd: 'auto'}); - p.push({style: 'opacity', start: 0, end: 1, template: '%0'}); - p.push({style: 'filter', start: 0, end: 100, template: 'alpha(opacity:%0)'}); - } else { - p.push({style: 'height', start: height, end: 0, template: '%0px'}); - p.push({style: 'display', atEnd: 'none'}); - p.push({style: 'opacity', start: 1, end: 0, template: '%0'}); - p.push({style: 'filter', start: 100, end: 0, template: 'alpha(opacity:%0)'}); - switch(deleteMode) { - case "all": - c = function(element,properties) {removeNode(element);}; - break; - case "children": - c = function(element,properties) {removeChildren(element);}; - break; - } - } - return new Morpher(element,config.animDuration,p,c); -} - - -var Popup = { - stack: [] // Array of objects with members root: and popup: - }; - -Popup.create = function(root,elem,className) -{ - var stackPosition = this.find(root,"popup"); - Popup.remove(stackPosition+1); - var popup = createTiddlyElement(document.body,elem || "ol","popup",className || "popup"); - popup.stackPosition = stackPosition; - Popup.stack.push({root: root, popup: popup}); - return popup; -}; - -Popup.onDocumentClick = function(ev) -{ - var e = ev ? ev : window.event; - if(e.eventPhase == undefined) - Popup.remove(); - else if(e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET) - Popup.remove(); - return true; -}; - -Popup.show = function(valign,halign,offset) -{ - var curr = Popup.stack[Popup.stack.length-1]; - this.place(curr.root,curr.popup,valign,halign,offset); - addClass(curr.root,"highlight"); - if(config.options.chkAnimate && anim && typeof Scroller == "function") - anim.startAnimating(new Scroller(curr.popup)); - else - window.scrollTo(0,ensureVisible(curr.popup)); -}; - -Popup.place = function(root,popup,valign,halign,offset) -{ - if(!offset) - var offset = {x:0,y:0}; - if(popup.stackPosition >= 0 && !valign && !halign) { - offset.x = offset.x + root.offsetWidth; - } else { - offset.x = (halign == 'right') ? offset.x + root.offsetWidth : offset.x; - offset.y = (valign == 'top') ? offset.y : offset.y + root.offsetHeight; - } - var rootLeft = findPosX(root); - var rootTop = findPosY(root); - var popupLeft = rootLeft + offset.x; - var popupTop = rootTop + offset.y; - var winWidth = findWindowWidth(); - if(popup.offsetWidth > winWidth*0.75) - popup.style.width = winWidth*0.75 + "px"; - var popupWidth = popup.offsetWidth; - var scrollWidth = winWidth - document.body.offsetWidth; - if(popupLeft + popupWidth > winWidth - scrollWidth - 1) { - if(halign == 'right') - popupLeft = popupLeft - root.offsetWidth - popupWidth; - else - popupLeft = winWidth - popupWidth - scrollWidth - 1; - } - popup.style.left = popupLeft + "px"; - popup.style.top = popupTop + "px"; - popup.style.display = "block"; -}; - -Popup.find = function(e) -{ - var pos = -1; - for (var t=this.stack.length-1; t>=0; t--) { - if(isDescendant(e,this.stack[t].popup)) - pos = i; - } - return pos; -}; - -Popup.remove = function(pos) -{ - if(!pos) var pos = 0; - if(Popup.stack.length > pos) { - Popup.removeFrom(pos); - } -}; - -Popup.removeFrom = function(from) -{ - for(var t=Popup.stack.length-1; t>=from; t--) { - var p = Popup.stack[t]; - removeClass(p.root,"highlight"); - removeNode(p.popup); - } - Popup.stack = Popup.stack.slice(0,from); -}; - - -function Wizard(elem) -{ - if(elem) { - this.formElem = findRelated(elem,"wizard","className"); - this.bodyElem = findRelated(this.formElem.firstChild,"wizardBody","className","nextSibling"); - this.footElem = findRelated(this.formElem.firstChild,"wizardFooter","className","nextSibling"); - } else { - this.formElem = null; - this.bodyElem = null; - this.footElem = null; - } -} - -Wizard.prototype.setValue = function(name,value) -{ - if(this.formElem) - this.formElem[name] = value; -}; - -Wizard.prototype.getValue = function(name) -{ - return this.formElem ? this.formElem[name] : null; -}; - -Wizard.prototype.createWizard = function(place,title) -{ - this.formElem = createTiddlyElement(place,"form",null,"wizard"); - createTiddlyElement(this.formElem,"h1",null,null,title); - this.bodyElem = createTiddlyElement(this.formElem,"div",null,"wizardBody"); - this.footElem = createTiddlyElement(this.formElem,"div",null,"wizardFooter"); -}; - -Wizard.prototype.clear = function() -{ - removeChildren(this.bodyElem); -}; - -Wizard.prototype.setButtons = function(buttonInfo,status) -{ - removeChildren(this.footElem); - for(var t=0; t max) - c = max; - return c; -}; - -if(!Array.indexOf) { -Array.prototype.indexOf = function(item,from) -{ - if(!from) - from = 0; - for(var i=from; i 1) { - for(var t=1; t currPos) - r.push(this.substring(currPos,match.index)); - r.push(substrings[parseInt(match[1])]); - currPos = subRegExp.lastIndex; - } - } while(match); - if(currPos < this.length) - r.push(this.substring(currPos,this.length)); - return r.join(""); -}; - -String.prototype.escapeRegExp = function() -{ - var s = "\\^$*+?()=!|,{}[]."; - var c = this; - for(var t=0; t/mg,">").replace(/\"/mg,"""); -}; - -String.prototype.htmlDecode = function() -{ - return this.replace(/</mg,"<").replace(/>/mg,">").replace(/"/mg,"\"").replace(/&/mg,"&"); -}; - -String.prototype.toJSONString = function() -{ - var m = { - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '"' : '\\"', - '\\': '\\\\' - }; - var replaceFn = function(a,b) { - var c = m[b]; - if(c) - return c; - c = b.charCodeAt(); - return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); - }; - if(/["\\\x00-\x1f]/.test(this)) - return '"' + this.replace(/([\x00-\x1f\\"])/g,replaceFn) + '"'; - return '"' + this + '"'; -}; - -String.prototype.parseParams = function(defaultName,defaultValue,allowEval,noNames,cascadeDefaults) -{ - var parseToken = function(match,p) { - var n; - if(match[p]) // Double quoted - n = match[p]; - else if(match[p+1]) // Single quoted - n = match[p+1]; - else if(match[p+2]) // Double-square-bracket quoted - n = match[p+2]; - else if(match[p+3]) // Double-brace quoted - try { - n = match[p+3]; - if(allowEval) - n = window.eval(n); - } catch(ex) { - throw "Unable to evaluate {{" + match[p+3] + "}}: " + exceptionText(ex); - } - else if(match[p+4]) // Unquoted - n = match[p+4]; - else if(match[p+5]) // empty quote - n = ""; - return n; - }; - var r = [{}]; - var dblQuote = "(?:\"((?:(?:\\\\\")|[^\"])+)\")"; - var sngQuote = "(?:'((?:(?:\\\\\')|[^'])+)')"; - var dblSquare = "(?:\\[\\[((?:\\s|\\S)*?)\\]\\])"; - var dblBrace = "(?:\\{\\{((?:\\s|\\S)*?)\\}\\})"; - var unQuoted = noNames ? "([^\"'\\s]\\S*)" : "([^\"':\\s][^\\s:]*)"; - var emptyQuote = "((?:\"\")|(?:''))"; - var skipSpace = "(?:\\s*)"; - var token = "(?:" + dblQuote + "|" + sngQuote + "|" + dblSquare + "|" + dblBrace + "|" + unQuoted + "|" + emptyQuote + ")"; - var re = noNames ? new RegExp(token,"mg") : new RegExp(skipSpace + token + skipSpace + "(?:(\\:)" + skipSpace + token + ")?","mg"); - var params = []; - do { - var match = re.exec(this); - if(match) { - var n = parseToken(match,1); - if(noNames) { - r.push({name:"",value:n}); - } else { - var v = parseToken(match,8); - if(v == null && defaultName) { - v = n; - n = defaultName; - } else if(v == null && defaultValue) { - v = defaultValue; - } - r.push({name:n,value:v}); - if(cascadeDefaults) { - defaultName = n; - defaultValue = v; - } - } - } - } while(match); - for(var t=1; t 12 ? h-12 : ( h > 0 ? h : 12 ); -}; - -Date.prototype.getAmPm = function() -{ - return this.getHours() >= 12 ? config.messages.dates.pm : config.messages.dates.am; -}; - -Date.prototype.daySuffix = function() -{ - return config.messages.dates.daySuffixes[this.getDate()-1]; -}; - -Date.prototype.convertToLocalYYYYMMDDHHMM = function() -{ - return this.getFullYear() + String.zeroPad(this.getMonth()+1,2) + String.zeroPad(this.getDate(),2) + String.zeroPad(this.getHours(),2) + String.zeroPad(this.getMinutes(),2); -}; - -Date.prototype.convertToYYYYMMDDHHMM = function() -{ - return this.getUTCFullYear() + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2); -}; - -Date.prototype.convertToYYYYMMDDHHMMSSMMM = function() -{ - return this.getUTCFullYear() + String.zeroPad(this.getUTCMonth()+1,2) + String.zeroPad(this.getUTCDate(),2) + "." + String.zeroPad(this.getUTCHours(),2) + String.zeroPad(this.getUTCMinutes(),2) + String.zeroPad(this.getUTCSeconds(),2) + String.zeroPad(this.getUTCMilliseconds(),4); -}; - -Date.convertFromYYYYMMDDHHMM = function(d) -{ - var hh = d.substr(8,2) || "00"; - var mm = d.substr(10,2) || "00"; - return new Date(Date.UTC(parseInt(d.substr(0,4),10), - parseInt(d.substr(4,2),10)-1, - parseInt(d.substr(6,2),10), - parseInt(hh,10), - parseInt(mm,10),0,0)); -}; - - -function Crypto() {} - -Crypto.strToBe32s = function(str) -{ - var be=Array(); - var len=Math.floor(str.length/4); - var i, j; - for(i=0, j=0; i>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32); - j++; - } - return be; -}; - -Crypto.be32sToStr = function(be) -{ - var str=''; - for(var i=0;i>5]>>>(24-i%32)) & 0xff); - return str; -}; - -Crypto.be32sToHex = function(be) -{ - var hex='0123456789ABCDEF'; - var str=''; - for(var i=0;i>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF); - return str; -}; - -Crypto.hexSha1Str = function(str) -{ - return Crypto.be32sToHex(Crypto.sha1Str(str)); -}; - -Crypto.sha1Str = function(str) -{ - return Crypto.sha1(Crypto.strToBe32s(str),str.length); -}; - -Crypto.sha1 = function(x,blen) -{ - function add32(a,b) - { - var lsw=(a&0xFFFF)+(b&0xFFFF); - var msw=(a>>16)+(b>>16)+(lsw>>16); - return (msw<<16)|(lsw&0xFFFF); - } - function AA(a,b,c,d,e) - { - b=(b>>>27)|(b<<5); - var lsw=(a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF); - var msw=(a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16); - return (msw<<16)|(lsw&0xFFFF); - } - function RR(w,j) - { - var n=w[j-3]^w[j-8]^w[j-14]^w[j-16]; - return (n>>>31)|(n<<1); - } - - var len=blen*8; - x[len>>5] |= 0x80 << (24-len%32); - x[((len+64>>9)<<4)+15]=len; - var w=Array(80); - - var k1=0x5A827999; - var k2=0x6ED9EBA1; - var k3=0x8F1BBCDC; - var k4=0xCA62C1D6; - - var h0=0x67452301; - var h1=0xEFCDAB89; - var h2=0x98BADCFE; - var h3=0x10325476; - var h4=0xC3D2E1F0; - - for(var i=0;i>>2)|(b<<30); b=a; a=t; j++; - } - while(j<20) { - w[j]=RR(w,j); - t=AA(e,a,d^(b&(c^d)),w[j],k1); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<40) { - w[j]=RR(w,j); - t=AA(e,a,b^c^d,w[j],k2); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<60) { - w[j]=RR(w,j); - t=AA(e,a,(b&c)|(d&(b|c)),w[j],k3); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - while(j<80) { - w[j]=RR(w,j); - t=AA(e,a,b^c^d,w[j],k4); - e=d; d=c; c=(b>>>2)|(b<<30); b=a; a=t; j++; - } - h0=add32(h0,a); - h1=add32(h1,b); - h2=add32(h2,c); - h3=add32(h3,d); - h4=add32(h4,e); - } - return [h0,h1,h2,h3,h4]; -}; - - -function RGB(r,g,b) -{ - this.r = 0; - this.g = 0; - this.b = 0; - if(typeof r == "string") { - if(r.substr(0,1) == "#") { - if(r.length == 7) { - this.r = parseInt(r.substr(1,2),16)/255; - this.g = parseInt(r.substr(3,2),16)/255; - this.b = parseInt(r.substr(5,2),16)/255; - } else { - this.r = parseInt(r.substr(1,1),16)/15; - this.g = parseInt(r.substr(2,1),16)/15; - this.b = parseInt(r.substr(3,1),16)/15; - } - } else { - var rgbPattern = /rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/; - var c = r.match(rgbPattern); - if(c) { - this.r = parseInt(c[1],10)/255; - this.g = parseInt(c[2],10)/255; - this.b = parseInt(c[3],10)/255; - } - } - } else { - this.r = r; - this.g = g; - this.b = b; - } - return this; -} - -RGB.prototype.mix = function(c,f) -{ - return new RGB(this.r + (c.r-this.r) * f,this.g + (c.g-this.g) * f,this.b + (c.b-this.b) * f); -}; - -RGB.prototype.toString = function() -{ - return "#" + ("0" + Math.floor(this.r.clamp(0,1) * 255).toString(16)).right(2) + - ("0" + Math.floor(this.g.clamp(0,1) * 255).toString(16)).right(2) + - ("0" + Math.floor(this.b.clamp(0,1) * 255).toString(16)).right(2); -}; - - -function drawGradient(place,horiz,locolors,hicolors) -{ - if(!hicolors) - hicolors = locolors; - for(var t=0; t<= 100; t+=2) { - var bar = document.createElement("div"); - place.appendChild(bar); - bar.style.position = "absolute"; - bar.style.left = horiz ? t + "%" : 0; - bar.style.top = horiz ? 0 : t + "%"; - bar.style.width = horiz ? (101-t) + "%" : "100%"; - bar.style.height = horiz ? "100%" : (101-t) + "%"; - bar.style.zIndex = -1; - var p = t/100*(locolors.length-1); - bar.style.backgroundColor = hicolors[Math.floor(p)].mix(locolors[Math.ceil(p)],p-Math.floor(p)).toString(); - } -} - -function createTiddlyText(parent,text) -{ - return parent.appendChild(document.createTextNode(text)); -} - -function createTiddlyCheckbox(parent,caption,checked,onChange) -{ - var cb = document.createElement("input"); - cb.setAttribute("type","checkbox"); - cb.onclick = onChange; - parent.appendChild(cb); - cb.checked = checked; - cb.className = "chkOptionInput"; - if(caption) - wikify(caption,parent); - return cb; -} - -function createTiddlyElement(parent,element,id,className,text,attribs) -{ - var e = document.createElement(element); - if(className != null) - e.className = className; - if(id != null) - e.setAttribute("id",id); - if(text != null) - e.appendChild(document.createTextNode(text)); - if(attribs) { - for(var n in attribs) { - e.setAttribute(n,attribs[n]); - } - } - if(parent != null) - parent.appendChild(e); - return e; -} - -function addEvent(obj,type,fn) -{ - if(obj.attachEvent) { - obj['e'+type+fn] = fn; - obj[type+fn] = function(){obj['e'+type+fn](window.event);}; - obj.attachEvent('on'+type,obj[type+fn]); - } else { - obj.addEventListener(type,fn,false); - } -} - -function removeEvent(obj,type,fn) -{ - if(obj.detachEvent) { - obj.detachEvent('on'+type,obj[type+fn]); - obj[type+fn] = null; - } else { - obj.removeEventListener(type,fn,false); - } -} - -function addClass(e,className) -{ - var currClass = e.className.split(" "); - if(currClass.indexOf(className) == -1) - e.className += " " + className; -} - -function removeClass(e,className) -{ - var currClass = e.className.split(" "); - var i = currClass.indexOf(className); - while(i != -1) { - currClass.splice(i,1); - i = currClass.indexOf(className); - } - e.className = currClass.join(" "); -} - -function hasClass(e,className) -{ - if(e.className && e.className.split(" ").indexOf(className) != -1) { - return true; - } - return false; -} - -function findRelated(e,value,name,relative) -{ - name = name || "tagName"; - relative = relative || "parentNode"; - if(name == "className") { - while(e && !hasClass(e,value)) { - e = e[relative]; - } - } else { - while(e && e[name] != value) { - e = e[relative]; - } - } - return e; -} - -function resolveTarget(e) -{ - var obj; - if(e.target) - obj = e.target; - else if(e.srcElement) - obj = e.srcElement; - if(obj.nodeType == 3) // defeat Safari bug - obj = obj.parentNode; - return obj; -} - -function stopEvent(e) -{ - var ev = e ? e : window.event; - ev.cancelBubble = true; - if(ev.stopPropagation) ev.stopPropagation(); - return false; -} - -function getPlainText(e) -{ - var text = ""; - if(e.innerText) - text = e.innerText; - else if(e.textContent) - text = e.textContent; - return text; -} - -function ensureVisible(e) -{ - var posTop = findPosY(e); - var posBot = posTop + e.offsetHeight; - var winTop = findScrollY(); - var winHeight = findWindowHeight(); - var winBot = winTop + winHeight; - if(posTop < winTop) { - return posTop; - } else if(posBot > winBot) { - if(e.offsetHeight < winHeight) - return posTop - (winHeight - e.offsetHeight); - else - return posTop; - } else { - return winTop; - } -} - -function findWindowWidth() -{ - return window.innerWidth || document.documentElement.clientWidth; -} - -function findWindowHeight() -{ - return window.innerHeight || document.documentElement.clientHeight; -} - -function findScrollX() -{ - return window.scrollX || document.documentElement.scrollLeft; -} - -function findScrollY() -{ - return window.scrollY || document.documentElement.scrollTop; -} - -function findPosX(obj) -{ - var curleft = 0; - while(obj.offsetParent) { - curleft += obj.offsetLeft; - obj = obj.offsetParent; - } - return curleft; -} - -function findPosY(obj) -{ - var curtop = 0; - while(obj.offsetParent) { - curtop += obj.offsetTop; - obj = obj.offsetParent; - } - return curtop; -} - -function blurElement(e) -{ - if(e && e.focus && e.blur) { - e.focus(); - e.blur(); - } -} - -function insertSpacer(place) -{ - var e = document.createTextNode(String.fromCharCode(160)); - if(place) - place.appendChild(e); - return e; -} - -function removeChildren(e) -{ - while(e && e.hasChildNodes()) - removeNode(e.firstChild); -} - -function removeNode(e) -{ - scrubNode(e); - e.parentNode.removeChild(e); -} - -function scrubNode(e) -{ - if(!config.browser.isIE) - return; - var att = e.attributes; - if(att) { - for(var t=0; t" + s + ""); - } else { - if(n) { - n.replaceChild(doc.createTextNode(s),n.firstChild); - } else { - n = doc.createElement("style"); - n.type = "text/css"; - n.id = id; - n.appendChild(doc.createTextNode(s)); - doc.getElementsByTagName("head")[0].appendChild(n); - } - } -} - -function removeStyleSheet(id) -{ - var e = document.getElementById(id); - if(e) - e.parentNode.removeChild(e); -} - -function forceReflow() -{ - if(config.browser.isGecko) { - setStylesheet("body {top:0px;margin-top:0px;}","forceReflow"); - setTimeout(function() {setStylesheet("","forceReflow");},1); - } -} - -function replaceSelection(e,text) -{ - if(e.setSelectionRange) { - var oldpos = e.selectionStart; - var isRange = e.selectionEnd > e.selectionStart; - e.value = e.value.substr(0,e.selectionStart) + text + e.value.substr(e.selectionEnd); - e.setSelectionRange(isRange ? oldpos : oldpos + text.length,oldpos + text.length); - var linecount = e.value.split('\n').length; - var thisline = e.value.substr(0,e.selectionStart).split('\n').length-1; - e.scrollTop = Math.floor((thisline - e.rows / 2) * e.scrollHeight / linecount); - } else if(document.selection) { - var range = document.selection.createRange(); - if(range.parentElement() == e) { - var isCollapsed = range.text == ""; - range.text = text; - if(!isCollapsed) { - range.moveStart('character', -text.length); - range.select(); - } - } - } -} - -function getNodeText(e) -{ - var t = ""; - while(e && e.nodeName == "#text") { - t += e.nodeValue; - e = e.nextSibling; - } - return t; -} - -function isDescendant(e,ancestor) -{ - while(e) { - if(e === ancestor) - return true; - e = e.parentNode; - } - return false; -} - - -function LoaderBase() {} - -LoaderBase.prototype.loadTiddler = function(store,node,tiddlers) -{ - var title = this.getTitle(store,node); - if(safeMode && store.isShadowTiddler(title)) - return; - if(title) { - var tiddler = store.createTiddler(title); - this.internalizeTiddler(store,tiddler,title,node); - tiddlers.push(tiddler); - } -}; - -LoaderBase.prototype.loadTiddlers = function(store,nodes) -{ - var tiddlers = []; - for(var t = 0; t < nodes.length; t++) { - try { - this.loadTiddler(store,nodes[t],tiddlers); - } catch(ex) { - showException(ex,config.messages.tiddlerLoadError.format([this.getTitle(store,nodes[t])])); - } - } - return tiddlers; -}; - -function SaverBase() {} - -SaverBase.prototype.externalize = function(store) -{ - var results = []; - var tiddlers = store.getTiddlers("title"); - for(var t = 0; t < tiddlers.length; t++) { - if(!tiddlers[t].doNotSave()) - results.push(this.externalizeTiddler(store, tiddlers[t])); - } - return results.join("\n"); -}; - - -function TW21Loader() {} - -TW21Loader.prototype = new LoaderBase(); - -TW21Loader.prototype.getTitle = function(store,node) -{ - var title = null; - if(node.getAttribute) { - title = node.getAttribute("title"); - if(!title) - title = node.getAttribute("tiddler"); - } - if(!title && node.id) { - var lenPrefix = store.idPrefix.length; - if(node.id.substr(0,lenPrefix) == store.idPrefix) - title = node.id.substr(lenPrefix); - } - return title; -}; - -TW21Loader.prototype.internalizeTiddler = function(store,tiddler,title,node) -{ - var e = node.firstChild; - var text = null; - if(node.getAttribute("tiddler")) { - text = getNodeText(e).unescapeLineBreaks(); - } else { - while(e.nodeName!="PRE" && e.nodeName!="pre") { - e = e.nextSibling; - } - text = e.innerHTML.replace(/\r/mg,"").htmlDecode(); - } - var modifier = node.getAttribute("modifier"); - var c = node.getAttribute("created"); - var m = node.getAttribute("modified"); - var created = c ? Date.convertFromYYYYMMDDHHMM(c) : version.date; - var modified = m ? Date.convertFromYYYYMMDDHHMM(m) : created; - var tags = node.getAttribute("tags"); - var fields = {}; - var attrs = node.attributes; - for(var i = attrs.length-1; i >= 0; i--) { - var name = attrs[i].name; - if(attrs[i].specified && !TiddlyWiki.isStandardField(name)) { - fields[name] = attrs[i].value.unescapeLineBreaks(); - } - } - tiddler.assign(title,text,modifier,modified,tags,created,fields); - return tiddler; -}; - - -function TW21Saver() {} - -TW21Saver.prototype = new SaverBase(); - -TW21Saver.prototype.externalizeTiddler = function(store,tiddler) -{ - try { - var extendedAttributes = ""; - var usePre = config.options.chkUsePreForStorage; - store.forEachField(tiddler, - function(tiddler,fieldName,value) { - if(typeof value != "string") - value = ""; - if(!fieldName.match(/^temp\./)) - extendedAttributes += ' %0="%1"'.format([fieldName,value.escapeLineBreaks().htmlEncode()]); - },true); - var created = tiddler.created; - var modified = tiddler.modified; - var attributes = tiddler.modifier ? ' modifier="' + tiddler.modifier.htmlEncode() + '"' : ""; - attributes += (usePre && created == version.date) ? "" :' created="' + created.convertToYYYYMMDDHHMM() + '"'; - attributes += (usePre && modified == created) ? "" : ' modified="' + modified.convertToYYYYMMDDHHMM() +'"'; - var tags = tiddler.getTags(); - if(!usePre || tags) - attributes += ' tags="' + tags.htmlEncode() + '"'; - return ('
            %4').format([ - usePre ? "title" : "tiddler", - tiddler.title.htmlEncode(), - attributes, - extendedAttributes, - usePre ? "\n
            " + tiddler.text.htmlEncode() + "
            \n" : tiddler.text.escapeLineBreaks().htmlEncode() - ]); - } catch (ex) { - throw exceptionText(ex,config.messages.tiddlerSaveError.format([tiddler.title])); - } -}; - -//]]> diff --git a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js.recipe b/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js.recipe deleted file mode 100755 index 411ab82cb..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.js.recipe +++ /dev/null @@ -1,2 +0,0 @@ -template: tiddlywiki.template.js -recipe: ../../js/split.recipe diff --git a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.template.js b/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.template.js deleted file mode 100755 index c843e922a..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/tiddlywiki.template.js +++ /dev/null @@ -1,5 +0,0 @@ -// - - -//]]> diff --git a/editions/tw2/source/tiddlywiki/tests/js/xml.js b/editions/tw2/source/tiddlywiki/tests/js/xml.js deleted file mode 100755 index 73fbd4999..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/xml.js +++ /dev/null @@ -1,36 +0,0 @@ -tests_xml = { - - parse: function(text) { - var doc; - if(window.ActiveXObject) { - doc = new ActiveXObject("Microsoft.XMLDOM"); - doc.async = "false"; - doc.loadXML(text); - } else { - var parser = new DOMParser(); - doc = parser.parseFromString(text,"text/xml"); - } - if(!doc) { - return null; - } - - doc.xpath = function(expression, type) { - var t; - - if(type == "string") { t = XPathResult.STRING_TYPE; } - if(type == "number") { t = XPathResult.NUMBER_TYPE; } - if(type == "boolean") { t = XPathResult.BOOLEAN_TYPE; } - if(type == "singlenode") { t = XPathResult.SINGLENODE_TYPE; } - - var res = this.evaluate(expression, this, null, t, null); - - if(type == "string") { return res.stringValue; } - if(type == "number") { return res.numberValue; } - if(type == "boolean") { return res.booleanValue; } - if(type == "singleNode") { return this.singleNodeValue; } - return null; - }; - - return doc; - } -}; diff --git a/editions/tw2/source/tiddlywiki/tests/js/xpath.js b/editions/tw2/source/tiddlywiki/tests/js/xpath.js deleted file mode 100755 index 772fd39dd..000000000 --- a/editions/tw2/source/tiddlywiki/tests/js/xpath.js +++ /dev/null @@ -1,626 +0,0 @@ -/* - javascript-xpath, an implementation of DOM Level 3 XPath for Internet Explorer 5+ - Copyright (C) 2004 Dimitri Glazkov Modified 2006 Mehdi Hassan - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - -*/ - -// Mozilla, Firefox, Safari etc have support by default, we don't have an implementation for the rest -if (!(XPathResult.NUMBER_TYPE + XPathResult.NUMBER_TYPE)) -{ - window._content = window; - - var _tb_windowEvents = new Array(); - - window.addEventListener = function(event, handler, flag) { - _tb_windowEvents[event] = handler; - }; - - function _tb_postProcess() { - if (_tb_windowEvents["load"]) { - _tb_windowEvents["load"](); - } - } - - var extern; - if (window.dialogArguments && window.dialogArguments.external) { - extern = window.dialogArguments.external; - } else if (window.external) { - extern = window.external; - } - - // XPathException - // An Error object will be thrown, this is just a handler to instantiate that object - var XPathException = new _XPathExceptionHandler(); - function _XPathExceptionHandler() - { - this.INVALID_EXPRESSION_ERR = 51; - this.TYPE_ERR = 52; - this.NOT_IMPLEMENTED_ERR = -1; - this.RUNTIME_ERR = -2; - - this.ThrowNotImplemented = function(message) - { - ThrowError(this.NOT_IMPLEMENTED_ERR, "This functionality is not implemented.", message); - }; - - this.ThrowInvalidExpression = function(message) - { - ThrowError(this.INVALID_EXPRESSION_ERR, "Invalid expression", message); - }; - - this.ThrowType = function(message) - { - ThrowError(this.TYPE_ERR, "Type error", message); - }; - - this.Throw = function(message) - { - ThrowError(this.RUNTIME_ERR, "Run-time error", message); - }; - - function ThrowError(code, description, message) - { - var error = new Error(code, "DOM-L3-XPath : " + description + (message ? ", \"" + message + "\"": "")); - error.code = code; - error.name = "XPathException"; - throw error; - } - } - - // DOMException - // An Error object will be thrown, this is just a handler to instantiate that object - var DOMException = new _DOMExceptionHandler(); - function _DOMExceptionHandler() - { - this.ThrowInvalidState = function(message) - { - ThrowError(13, "The state of the object is no longer valid", message); - }; - - function ThrowError(code, description, message) - { - var error = new Error(code, "DOM : " + description + (message ? ", \"" + message + "\"": "")); - error.code = code; - error.name = "DOMException"; - throw error; - } - } - - // XPathEvaluator - // implemented as document object methods - - // XPathExpression createExpression(String expression, XPathNSResolver resolver) - document.createExpression = function - ( - expression, // String - resolver // XPathNSResolver - ) - { - // returns XPathExpression object - return new XPathExpression(expression, resolver); - }; - - // XPathNSResolver createNSResolver(nodeResolver) - document.createNSResolver = function - ( - nodeResolver // Node - ) - { - // returns XPathNSResolver - return new XPathNSResolver(nodeResolver); - }; - - // XPathResult evaluate(String expresison, Node contextNode, XPathNSResolver resolver, Number type, XPathResult result) - document.evaluate = function - ( - expression, // String - contextNode, // Node - resolver, // XPathNSResolver - type, // Number - result // XPathResult - ) - // can raise XPathException, DOMException - { - // return XPathResult - return document.createExpression(expression, resolver).evaluate(contextNode, type, result); - }; - - // XPathExpression - function XPathExpression - ( - expression, // String - resolver // XPathNSResolver - ) - { - this.expressionString = expression; - this.resolver = resolver; - - // XPathResult evaluate(Node contextNode, Number type, XPathResult result) - this.evaluate = function - ( - contextNode, // Node - type, // Number - result // XPathResult - ) - // raises XPathException, DOMException - { - // return XPathResult - return (result && result.constructor == XPathResult ? result.initialize(this, contextNode, resolver, type) : new XPathResult(this, contextNode, resolver, type)); - }; - - this.toString = function() - { - return "[XPathExpression]"; - }; - } - - // XPathNSResolver - function XPathNSResolver(node) - { - this.node = node; - - // String lookupNamespaceURI(String prefix) - this.lookupNamespaceURI = function - ( - prefix // String - ) - { - XPathException.ThrowNotImplemented(); - // return String - return null; - }; - - this.toString = function() - { - return "[XPathNSResolver]"; - }; - } - - // XPathResult - XPathResult.ANY_TYPE = 0; - XPathResult.NUMBER_TYPE = 1; - XPathResult.STRING_TYPE = 2; - XPathResult.BOOLEAN_TYPE = 3; - XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; - XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; - XPathResult.UNORDERED_SNAPSHOT_TYPE = 6; - XPathResult.ORDERED_SNAPSHOT_TYPE = 7; - XPathResult.ANY_UNORDERED_NODE_TYPE = 8; - XPathResult.FIRST_ORDERED_NODE_TYPE = 9; - - function XPathResult - ( - expression, // XPathExpression - contextNode, // Node - resolver, // XPathNSResolver - type // Number - ) - { - this.initialize = function(expression, contextNode, resolver, type) - { - this._domResult = null; - this._expression = expression; - this._contextNode = contextNode; - this._resolver = resolver; - if (type) - { - this.resultType = type; - this._isIterator = (type == XPathResult.UNORDERED_NODE_ITERATOR_TYPE || - type == XPathResult.ORDERED_NODE_ITERATOR_TYPE || - type == XPathResult.ANY_TYPE); - this._isSnapshot = (type == XPathResult.UNORDERED_SNAPSHOT_TYPE || type == XPathResult.ORDERED_SNAPSHOT_TYPE); - this._isNodeSet = type > XPathResult.BOOLEAN_TYPE; - } - else - { - this.resultType = XPathResult.ANY_TYPE; - this._isIterator = true; - this._isSnapshot = false; - this._isNodeSet = true; - } - return this; - }; - - this.initialize(expression, contextNode, resolver, type); - - this.getInvalidIteratorState = function() - { - return documentChangeDetected() || !this._isIterator; - }; - - this.getSnapshotLength = function() - // raises XPathException - { - if (!this._isSnapshot) - { - XPathException.ThrowType("Snapshot is not an expected result type"); - } - activateResult(this); - // return Number - return this._domResult.length; - }; - - // Node iterateNext() - this.iterateNext = function() - // raises XPathException, DOMException - { - if (!this._isIterator) - { - XPathException.ThrowType("Iterator is not an expected result type"); - } - activateResult(this); - if (documentChangeDetected()) - { - DOMException.ThrowInvalidState("iterateNext"); - } - // return Node - return getNextNode(this); - }; - - // Node snapshotItem(Number index) - this.snapshotItem = function(index) - // raises XPathException - { - if (!this._isSnapshot) - { - XPathException.ThrowType("Snapshot is not an expected result type"); - } - // return Node - return getItemNode(this, index); - }; - - this.toString = function() - { - return "[XPathResult]"; - }; - - // returns string value of the result, if result type is STRING_TYPE - // otherwise throws an XPathException - this.getStringValue = function() - { - if (this.resultType != XPathResult.STRING_TYPE) - { - XPathException.ThrowType("The expression can not be converted to return String"); - } - return getNodeText(this); - }; - - // returns number value of the result, if the result is NUMBER_TYPE - // otherwise throws an XPathException - this.getNumberValue = function() - { - if (this.resultType != XPathResult.NUMBER_TYPE) - { - XPathException.ThrowType("The expression can not be converted to return Number"); - } - var number = parseInt(getNodeText(this)); - if (isNaN(number)) - { - XPathException.ThrowType("The result can not be converted to Number"); - } - return number; - }; - - // returns boolean value of the result, if the result is BOOLEAN_TYPE - // otherwise throws an XPathException - this.getBooleanValue = function() - { - if (this.resultType != XPathResult.BOOLEAN_TYPE) - { - XPathException.ThrowType("The expression can not be converted to return Boolean"); - } - - var - text = getNodeText(this); - bool = (text ? text.toLowerCase() : null); - if (bool == "false" || bool == "true") - { - return bool; - } - XPathException.ThrowType("The result can not be converted to Boolean"); - }; - - // returns single node, if the result is ANY_UNORDERED_NODE_TYPE or FIRST_ORDERED_NODE_TYPE - // otherwise throws an XPathException - this.getSingleNodeValue = function() - { - if (this.resultType != XPathResult.ANY_UNORDERED_NODE_TYPE && - this.resultType != XPathResult.FIRST_ORDERED_NODE_TYPE) - { - XPathException.ThrowType("The expression can not be converted to return single Node value"); - } - return getSingleNode(this); - }; - - function documentChangeDetected() - { - return document._XPathMsxmlDocumentHelper.documentChangeDetected(); - } - - function getNodeText(result) - { - activateResult(result); - return result._textResult; -// return ((node = getSingleNode(result)) ? (node.nodeType == 1 ? node.innerText : node.nodeValue) : null); - } - - function findNode(result, current) - { - switch(current.nodeType) - { - case 1: // NODE_ELEMENT - var id = current.attributes.getNamedItem("id"); - if (id) - { - return document.getElementById(id.value); - } - XPathException.Throw("unable to locate element in XML tree"); - case 2: // NODE_ATTRIBUTE - var id = current.selectSingleNode("..").attributes.getNamedItem("id"); - if (id) - { - var node = document.getElementById(id.text); - if (node) - { - return node.attributes.getNamedItem(current.nodeName); - } - } - XPathException.Throw("unable to locate attribute in XML tree"); - case 3: // NODE_TEXT - var id = current.selectSingleNode("..").attributes.getNamedItem("id"); - if (id) - { - var node = document.getElementById(id.value); - if (node) - { - for(child in node.childNodes) - { - if (child.nodeType == 3 && child.nodeValue == current.nodeValue) - { - return child; - } - } - } - } - XPathException.Throw("unable to locate text in XML tree"); - } - XPathException.Throw("unknown node type"); - } - - function activateResult(result) - { - if (!result._domResult) - { - try - { - var expression = result._expression.expressionString; - - // adjust expression if contextNode is not a document - if (result._contextNode != document && expression.indexOf("//") != 0) - { - - expression = "//*[@id = '" + result._contextNode.id + "']" + - (expression.indexOf("/") == 0 ? "" : "/") + expression; - } - - if (result._isNodeSet) - { - result._domResult = document._XPathMsxmlDocumentHelper.getDom().selectNodes(expression); - } - else - { - result._domResult = true; - result._textResult = document._XPathMsxmlDocumentHelper.getTextResult(expression); - } - - } - catch(error) - { - alert(error.description); - XPathException.ThrowInvalidExpression(error.description); - } - } - } - - function getSingleNode(result) - { - var node = getItemNode(result, 0); - result._domResult = null; - return node; - } - - function getItemNode(result, index) - { - activateResult(result); - var current = result._domResult.item(index); - return (current ? findNode(result, current) : null); - } - - function getNextNode(result) - { - var current = result._domResult.nextNode; - if (current) - { - return findNode(result, current); - } - result._domResult = null; - return null; - } - } - - document.reloadDom = function() - { - document._XPathMsxmlDocumentHelper.reset(); - }; - - document._XPathMsxmlDocumentHelper = new _XPathMsxmlDocumentHelper(); - function _XPathMsxmlDocumentHelper() - { - this.getDom = function() - { - activateDom(this); - return this.dom; - }; - - this.getXml = function() - { - activateDom(this); - return this.dom.xml; - }; - - this.getTextResult = function(expression) - { - expression = expression.replace(//g, ">").replace(/"/g, "\""); - var xslText = "" + - "" + - ""; - var xsl = new ActiveXObject("Msxml2.DOMDocument"); - xsl.loadXML(xslText); - try - { - var result = this.getDom().transformNode(xsl); - } - catch(error) - { - alert("Error: " + error.description); - } - return result; - }; - - this.reset = function() - { - this.dom = null; - }; - - function onPropertyChangeEventHandler() - { - document._propertyChangeDetected = true; - }; - - this.documentChangeDetected = function() - { - return (document.ignoreDocumentChanges ? false : this._currentElementCount != document.all.length || document._propertyChangeDetected); - }; - - function activateDom(helper) - { - if (!helper.dom) - { - var dom = new ActiveXObject("Msxml2.DOMDocument"); - dom.async = false; - dom.resolveExternals = false; - loadDocument(dom, helper); - helper.dom = dom; - helper._currentElementCount = document.all.length; - document._propertyChangeDetected = false; - } - else - { - if (helper.documentChangeDetected()) - { - var dom = helper.dom; - dom.load(""); - loadDocument(dom, helper); - helper._currentElementCount = document.all.length; - document._propertyChangeDetected = false; - } - } - } - - function loadDocument(dom, helper) - { - return loadNode(dom, dom, document.body, helper); - } - - function loadNode(dom, domParentNode, node, helper) - { - if (node.nodeType == 3) - { - domParentNode.appendChild(dom.createTextNode(node.nodeValue)); - } - else - { - var domNode = dom.createElement(node.nodeName.toLowerCase()); - if (!node.id) - { - node.id = node.uniqueID; - } - domParentNode.appendChild(domNode); - loadAttributes(dom, domNode, node); - var length = node.childNodes.length; - for(var i = 0; i < length; i ++ ) - { - loadNode(dom, domNode, node.childNodes[i], helper); - } - node.attachEvent("onpropertychange", onPropertyChangeEventHandler); - } - } - - function loadAttributes(dom, domParentNode, node) - { - for (var i = 0; i < node.attributes.length; i ++ ) - { - var attribute = node.attributes[i]; - var attributeValue = attribute.nodeValue; - if (attributeValue && attribute.specified) - { - var domAttribute = dom.createAttribute(attribute.nodeName); - domAttribute.value = attributeValue; - domParentNode.setAttributeNode(domAttribute); - } - } - } - - } -} -else -{ - document.reloadDom = function() {}; - XPathResult.prototype.getStringValue = function() - { - return this.stringValue; - }; - - XPathResult.prototype.getNumberValue = function() - { - return this.numberValue; - }; - - XPathResult.prototype.getBooleanValue = function() - { - return this.booleanValue; - }; - - XPathResult.prototype.getSingleNodeValue = function() - { - return this.singleNodeValue; - }; - - XPathResult.prototype.getInvalidIteratorState = function() - { - return this.invalidIteratorState; - }; - - XPathResult.prototype.getSnapshotLength = function() - { - return this.snapshotLength; - }; - - XPathResult.prototype.getResultType = function() - { - return this.resultType; - }; -} diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/BasicTypes.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/BasicTypes.jsspec.js deleted file mode 100755 index dcbf2a7cf..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/BasicTypes.jsspec.js +++ /dev/null @@ -1,287 +0,0 @@ -// - diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/Macros.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/Macros.jsspec.js deleted file mode 100755 index 08d9494e5..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/Macros.jsspec.js +++ /dev/null @@ -1,221 +0,0 @@ -// >"); - var title = __re_escape(__title.en[name]); - var r = new RegExp(''+text+'<\/a>$'); - value_of(t).should_match(r); - value_of(t).should_match(/class="/); - value_of(t).should_match(/title="/); - value_of(t).should_match(/href="/); - if (accesskey) - value_of(t).should_match(/accesskey="/); -} - -function testing_check_button_onclick(name,func) -{ - tests_mock.before(func); - config.macros[name].onClick(); - value_of(tests_mock.after(func).called).should_be(1); -} - -describe('Macros: macro errors', { - before_each : function() { - __main(); - }, - 'missing macro should produce errortext' : function() { - value_of(wikifyStatic('<>')).should_match(/errortext/); - } -}); - -describe('Macros: version macro', { - before_each : function() { - __main(); - }, - 'version macro should expand to the version string' : function() { - version.major = "123"; - version.minor = "456"; - version.revision = "789"; - version.beta = "123456789"; - value_of(wikifyStatic("<>")).should_match(/^<(span|SPAN)>123.456.789 \(beta 123456789\)<\/(span|SPAN)>$/); - } -}); - -describe('Macros: today macro', { - before_each : function() { - __main(); - }, - 'today macro should return a date-shaped string [known to fail]' : function() { - value_of(wikifyStatic("<>")).should_match(/^<(span|SPAN)>[A-Z][a-z]+\s[A-Z][a-z]+\s+[0-9]{1,2}\s[0-9]{2}:[0-9]{2}:[0-9]{2} 2[0-9]{3}<\/(span|SPAN)>$/); - } -}); - -describe('Macros: list macro', { - before_each : function() { - __main(); - }, - 'list all by default expands to the listTitle and an empty list' : function() { - value_of(wikifyStatic("<>")).should_be('
            • ' + __title.en.all + '
            '); - }, - 'list missing by default expands to the listTitle and an empty list' : function() { - value_of(wikifyStatic("<>")).should_be('
            • ' + __title.en.missing + '
            '); - }, - 'list orphans by default expands to the listTitle and an empty list' : function() { - value_of(wikifyStatic("<>")).should_be('
            • ' + __title.en.orphans + '
            '); - }, - 'list shadowed by default expands to the listTitle and a list of tiddlers' : function() { - var pattern = new RegExp('^
            • ' + __title.en.shadowed + '
            • .*<\/li><\/ul>'); - value_of(wikifyStatic("<>")).should_match(pattern); - }, - 'list touched by default expands to the listTitle and empty list' : function() { - value_of(wikifyStatic("<>")).should_be('
              • ' + __title.en.touched + '
              '); - }, - 'list filter by default expands to an empty list' : function() { - value_of(wikifyStatic("<>")).should_be('
                '); - } -}); - -describe('Macros: closeAll macro', { - before_each : function() { - __main(); - }, - 'closeAll macro expands to button' : function() { - testing_check_button("closeAll","close all"); - }, - 'closeAll.onClick calls the story.closeAllTiddlers function' : function() { - testing_check_button_onclick("closeAll","story.closeAllTiddlers"); - } - -}); - -describe('Macros: permaview macro', { - before_each : function() { - __main(); - }, - 'permaview macro expands to button' : function() { - testing_check_button("permaview","permaview"); - }, - 'permaview.onClick calls the story.permaView function' : function() { - testing_check_button_onclick("permaview","story.permaView"); - } -}); - -describe('Macros: saveChanges macro', { - before_each : function() { - __main(); - }, - 'saveChanges macro doesn\'t expand to button when readOnly' : function() { - readOnly = true; - value_of(wikifyStatic("<>")).should_be(""); - }, - 'saveChanges macro expands to button when not readOnly' : function() { - readOnly = false; - testing_check_button("saveChanges","save changes","S"); - }, - 'saveChanges.onClick calls the saveChanges function' : function() { - testing_check_button_onclick("saveChanges","saveChanges"); - } -}); - -describe('Macros: message macro', { - before_each : function() { - __main(); - tests_mock.save('config.options.txtUserName'); - }, - after_each : function() { - tests_mock.restore(); - }, - 'message with no parameters returns an empty string' : function() { - value_of(wikifyStatic("<>")).should_be(''); - }, - 'message with returns an empty string' : function() { - var username = "MyAssertedUserName"; - config.options.txtUserName = username; - value_of(wikifyStatic("<>")).should_be(username); - }, -}); - -describe('Macros: tagChooser macro', { - before_each : function() { - __main(); - tests_mock.save('config.options.txtUserName'); - }, - after_each : function() { - tests_mock.restore(); - }, - 'tagChooser with no parameters returns an empty string' : function() { - var t = wikifyStatic("<>"); - var title = __title.en.tagChooser; - var text = "tags"; - var r = new RegExp(''+text+'<\/a>$'); - value_of(t).should_match(r); - value_of(t).should_match(/tiddler="/); - value_of(t).should_match(/class="/); - value_of(t).should_match(/title="/); - value_of(t).should_match(/href="/); - } -}); - -describe('Macros: refreshDisplay macro', { - before_each : function() { - __main(); - }, - 'refreshDisplay macro expands to button' : function() { - testing_check_button("refreshDisplay","refresh"); - }, - 'refreshDisplay.onClick calls the refreshAll function' : function() { - testing_check_button_onclick("refreshDisplay","refreshAll"); - } -}); - -describe('Macros: annotations macro', { - before_each : function() { - store = new TiddlyWiki(); - loadShadowTiddlers(); - store.saveTiddler("t","t","text"); - formatter = new Formatter(config.formatters); - }, - 'annotations macro for a non-tiddler expands the empty string' : function() { - value_of(wikifyStatic("<>")).should_be(''); - }, - 'annotations macro expands to empty string for tiddler not in config.annotations' : function() { - value_of(wikifyStatic("<>",null,new Tiddler("temp"))).should_be(''); - }, - 'annotations macro expands to config.annotations defined text' : function() { - var title = "This is the title text"; - config.annotations.temp = title; - value_of(wikifyStatic("<>",null,new Tiddler("temp"))).should_be('
                '+title+'
                '); - } -}); - -// ]]> diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/Messages.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/Messages.jsspec.js deleted file mode 100755 index c4e5a2886..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/Messages.jsspec.js +++ /dev/null @@ -1,39 +0,0 @@ -// diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/Mocks.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/Mocks.jsspec.js deleted file mode 100755 index e8dd19e08..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/Mocks.jsspec.js +++ /dev/null @@ -1,82 +0,0 @@ -// diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/Strings.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/Strings.jsspec.js deleted file mode 100755 index f648b8075..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/Strings.jsspec.js +++ /dev/null @@ -1,113 +0,0 @@ -// "': function() { - var actual = '&<>"'.htmlEncode(); - var expected = '&<>"'; - value_of(actual).should_be(expected); - }, - 'String should correctly htmlDecode &<>"': function() { - var actual = '&<>"'.htmlDecode(); - var expected = '&<>"'; - value_of(actual).should_be(expected); - }, - 'htmlEncode followed by htmlDecode of complex string should leave string unchanged': function() { - var s = '&&&""<">>&>&"'; - var actual = s.htmlEncode().htmlDecode(); - value_of(actual).should_be(s); - } - // NO IT SHOULDN'T! YOU CAN'T DECODE SOMETHING THAT IS NOT ENCODED - //'htmlDecode followed by htmlEncode of complex string should leave string unchanged': function() { - // var s = '&&&""<">>&>&"'; - // var actual = s.htmlDecode().htmlEncode(); - // value_of(actual).should_be(s); - //} -}); - -describe('Strings: parseParams', { - 'String should correctly parseParams for single name value pair': function() { - var actual = "aName:aValue".parseParams(); - var expected = [{"aName":["aValue"]},{name:"aName",value:"aValue"}]; - value_of(actual).should_be(expected); - }, - 'String should correctly parseParams for two name value pairs': function() { - var actual = "aName:'aValue' aName2:'aValue2'".parseParams(); - var expected = [{"aName":["aValue"], "aName2":["aValue2"]},{name:"aName",value:"aValue"},{name:"aName2",value:"aValue2"}]; - value_of(actual).should_be(expected); - } -}); - -describe('Strings: encodeTiddlyLink', { - 'String should correctly encodeTiddlyLink with no spaces': function() { - var actual = String.encodeTiddlyLink("title"); - var expected = "title"; - value_of(actual).should_be(expected); - }, - 'String should correctly encodeTiddlyLink with spaces': function() { - var actual = String.encodeTiddlyLink("the title"); - var expected = "[[the title]]"; - value_of(actual).should_be(expected); - } -}); -// ]]> diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/Wikifier.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/Wikifier.jsspec.js deleted file mode 100755 index cd3148309..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/Wikifier.jsspec.js +++ /dev/null @@ -1,519 +0,0 @@ -// bold", - italic:"italic", - underline:"underline", - superscript:"superscript", - subscript:"subscript", - strikeout:"strikeout", - code:"code" - }; - - formatter = new Formatter(config.formatters); - var actual = ""; - var expected = ""; - for (var i in wikifier_input_strings) { - actual = wikifyStatic(wikifier_input_strings[i]).toLowerCase(); - expected = wikifier_output_strings[i]; - value_of(actual).should_be(expected); - } - }, - 'testing table formatting': function() { - formatter = new Formatter(config.formatters); - var expected = '
                ab
                cd
                '; - var actual = wikifyStatic("|a|b|\n|c|d|").toLowerCase(); - value_of(actual).should_be(expected); - } - /*'table surrounded by character formatting should not cause infinite loop': function() { - formatter = new Formatter(config.formatters); - var actual = wikifyStatic("''|a|b|\n|c|d|''").toLowerCase(); - value_of(true).should_be_true(); // just check that above line did not cause infinite loop - }*/ -}); - -describe('Wikifier: wikifyStatic()', { - before_each: function() { - place = document.createElement("div"); - d = document.body.appendChild(place); - d.style.display = "none"; - source = "some text"; - }, - - after_each: function() { - removeNode(d); - }, - - 'it should return an empty string if source does not exist or is an empty string': function() { - var expected = ""; - var actual = wikifyStatic(null); - value_of(actual).should_be(expected); - actual = wikifyStatic(""); - value_of(actual).should_be(expected); - }, - - 'it should not require a tiddler to work': function() { - var actual = wikifyStatic(source); - value_of(actual).should_not_be_null(); - }, - - 'it should call subWikify() with the pre block as the only parameter': function() { - var funcToMock = 'Wikifier.prototype.subWikify'; - tests_mock.before(funcToMock,function() { - tests_mock.frame[funcToMock].funcArgs = arguments; - }); - wikifyStatic(source); - var tests_mock_return = tests_mock.after(funcToMock); - var expected = "PRE"; - value_of(tests_mock_return.called).should_be(true); - value_of(tests_mock_return.funcArgs.length).should_be(1); - value_of(tests_mock_return.funcArgs[0].nodeName).should_be(expected); - }, - - 'it should return a text string': function() { - var expected = "string"; - var actual = typeof wikifyStatic(source); - }, - - 'it should not leave any elements attached to the document body after returning': function() { - var expected = document.body.childNodes.length; - var html = wikifyStatic(source); - var actual = document.body.childNodes.length; - value_of(actual).should_be(expected); - } -}); - -describe('Wikifier: wikifyPlain', { - - before_each: function() { - store = new TiddlyWiki(); - loadShadowTiddlers(); - store.saveTiddler("t","t","text"); - formatter = new Formatter(config.formatters); - }, - - 'it should use the store if only a title parameter is provided': function() { - var actual = wikifyPlain("t"); - value_of(actual).should_not_be_null(); - }, - - 'it should call wikifyPlainText() if the tiddler exists in the store or is a shadow tiddler': function() { - tests_mock.before('wikifyPlainText'); - wikifyPlain("t"); - var actual = tests_mock.after('wikifyPlainText').called; - value_of(actual).should_be_true(); - }, - - 'it should call wikifyPlainText() if the tiddler is a shadow tiddler': function() { - - var t = store.isShadowTiddler("SiteTitle"); - value_of(t).should_be_true(); - mockVars = tests_mock.before('wikifyPlainText'); - wikifyPlain("SiteTitle"); - var actual = tests_mock.after('wikifyPlainText').called; - value_of(actual).should_be_true(); - }, - - 'it should return an empty string if the tiddler is not in the store or a shadow tiddler': function() { - var tiddler = store.getTiddler("foo"); - value_of(tiddler).should_be(null); - var actual = wikifyPlain("foo"); - var expected = ""; - value_of(actual).should_be(expected); - } -}); - -describe('Wikifier: wikifyPlainText', { - - before_each: function() { - store = new TiddlyWiki(); - loadShadowTiddlers(); - formatter = new Formatter(config.formatters); - }, - - 'if a limit parameter is provided and the input text is greater in length than the limit, the number of characters generated should equal the limit': function() { - var limit = 5; - var source = "aphraseof21characters"; - var actual = wikifyPlainText(source,limit).length; - var expected = limit; - value_of(actual).should_be(expected); - }, - - 'it should call Wikifier.prototype.wikifyPlain()': function() { - tests_mock.before('Wikifier.prototype.wikifyPlain'); - wikifyPlainText("hello",1,new Tiddler("temp")); - var actual = tests_mock.after('Wikifier.prototype.wikifyPlain').called; - value_of(actual).should_be_true(); - }, - - 'it should take an optional tiddler parameter that sets the context for the wikification': function() { - var tiddler = new Tiddler("temp"); - var source = "<>"; - tiddler.text = "the text of a tiddler"; - var expected = tiddler.text; - store.saveTiddler("temp","temp",tiddler.text); - var actual = wikifyPlainText(source,null,tiddler); - value_of(actual).should_be(expected); - } -}); - -describe('Wikifier: highlightify', { - - before_each: function() { - output = document.body.appendChild(document.createElement("div")); - source = "test text"; - highlightregexp = new RegExp("text","img"); - tiddler = new Tiddler("temp"); - }, - - 'it should not add anything to the "output" element if the source parameter is empty': function() { - var actual = highlightify(null,output); - value_of(actual).shoufld_be_null; - }, - - 'it should highlight output text by wrapping with a span of class "highlight"': function() { - var expected = 'test text'; - highlightify(source,output,highlightregexp,tiddler); - // value in IE is: test text - // note SPAN is capitals and no quotes - actual = output.innerHTML; - value_of(actual).should_be(expected); - }, - - after_each: function() { - removeNode(output); - } - -}); - -describe('Wikifier: Wikifier()', { - - 'it should return a Wikifier object': function() { - var actual = new Wikifier(); - value_of(actual instanceof Wikifier).should_be_true(); - }, - - 'it should return an object with properties source, output, formatter, nextMatch, autoLinkWikiWords, highlightRegExp, highlightMatch, isStatic, tiddler': function() { - var actual = new Wikifier(); - value_of(actual.hasOwnProperty("source")).should_be_true(); - value_of(actual.hasOwnProperty("output")).should_be_true(); - value_of(actual.hasOwnProperty("formatter")).should_be_true(); - value_of(actual.hasOwnProperty("nextMatch")).should_be_true(); - value_of(actual.hasOwnProperty("autoLinkWikiWords")).should_be_true(); - value_of(actual.hasOwnProperty("highlightRegExp")).should_be_true(); - value_of(actual.hasOwnProperty("highlightMatch")).should_be_true(); - value_of(actual.hasOwnProperty("isStatic")).should_be_true(); - value_of(actual.hasOwnProperty("tiddler")).should_be_true(); - - } - -}); - -describe('Wikifier: wikifyPlain', { - - 'it should return the plain text value of the return value of this.subWikify()': function() { - store = new TiddlyWiki(); - formatter = new Formatter(config.formatters); - var source = "a StringWith some [[wikitext]] ''inside''"; - var w = new Wikifier(source,formatter); - var actual = w.wikifyPlain(); - var expected = "a StringWith some wikitext inside"; - value_of(actual).should_be(expected); - } -}); - -describe('Wikifier: subWikify', { - - before_each: function() { - formatter = new Formatter(config.formatters); - output = document.body.appendChild(document.createElement("div")); - terminator = ""; - w = new Wikifier("test",formatter); - }, - - 'it should call this.subWikifyUnterm if second parameter is not provided': function() { - tests_mock.before('Wikifier.prototype.subWikifyUnterm'); - w.subWikify(output); - var actual = tests_mock.after('Wikifier.prototype.subWikifyUnterm').called; - value_of(actual).should_be_true; - }, - - 'it should call this.subWikifyTerm if a second parameter is provided': function() { - tests_mock.before('Wikifier.prototype.subWikifyTerm'); - w.subWikify(output,terminator); - var actual = tests_mock.after('Wikifier.prototype.subWikifyTerm').called; - value_of(actual).should_be_true; - }, - - after_each: function() { - removeNode(output); - delete formatter; - delete terminator; - delete w; - } -}); - -describe('Wikifier: subWikifyUnterm', { - - before_each: function() { - formatter = new Formatter([{ - name: "test", - match: "test", - handler: function(w) - { - createTiddlyText(w.output,w.matchText); - } - }]); - - output = document.body.appendChild(document.createElement("div")); - source = "some test input for a test of a function"; - w = new Wikifier(source,formatter); - }, - - 'it should pass any text that matches the formatter\'s regexp to the correct handler in the formatter': function() { - w.subWikifyUnterm(output); - var actual = output.innerHTML; - var expected = source; - value_of(actual).should_be(expected); - }, - - 'it should output any text before, between or after a match': function() { - tests_mock.before('Wikifier.prototype.outputText'); - w.subWikifyUnterm(output); - var actual = tests_mock.after('Wikifier.prototype.outputText').called; - value_of(actual).should_be(3); - actual = output.innerHTML; - var expected = "testtest"; - value_of(actual).should_be(expected); - }, - - after_each: function() { - removeNode(output); - delete formatter; - delete source; - delete w; - } -}); - -describe('Wikifier: subWikifyTerm', { - - before_each: function() { - formatter = new Formatter([{ - name: "test", - match: "test", - handler: function(w) - { - createTiddlyText(w.output,w.matchText); - } - }]); - - termRegExp = /(\n)/mg; - output = document.body.appendChild(document.createElement("div")); - source = "some test multi-line test input \n for a test of a function"; - w = new Wikifier(source,formatter); - }, - - 'it should ignore all input after a match with termRegExp': function() { - w.subWikifyTerm(output,termRegExp); - var actual = output.innerHTML; - var expected = source.substring(0,source.indexOf("\n")); - value_of(actual).should_be(expected); - }, - - 'it should pass any text that matches the formatter\'s regexp to the correct handler in the formatter': function() { - tests_mock.before('formatter.formatters[0].handler'); - w.subWikifyTerm(output,termRegExp); - var actual = tests_mock.after('formatter.formatters[0].handler').called; - value_of(actual).should_be(2); - }, - - 'it should output any text before, between or after a formatter match': function() { - tests_mock.before('Wikifier.prototype.outputText'); - w.subWikifyTerm(output,termRegExp); - var actual = tests_mock.after('Wikifier.prototype.outputText').called; - value_of(actual).should_be(3); - actual = output.innerHTML; - var expected = "testtest"; - value_of(actual).should_be(expected); - }, - - after_each: function() { - removeNode(output); - delete formatter; - delete termRegExp; - delete source; - delete w; - } -}); - -describe('Wikifier: outputText', { - - before_each: function() { - formatter = new Formatter(config.formatters); - source = "some test input"; - highlightRegExp = /test/g; - output = document.body.appendChild(document.createElement("div")); - }, - - 'it should output all the input text if the Wikifier object\'s highlightRegExp property is null': function() { - w = new Wikifier(source,formatter); - w.outputText(output,0,source.length); - var actual = output.innerHTML; - value_of(actual).should_be(source); - }, - - 'it should wrap any text that matched by the Wikifier object\'s highlightRegExp in tags with a class of "highlight"': function() { - w = new Wikifier(source,formatter,highlightRegExp); - w.outputText(output,0,source.length); - var actual = output.innerHTML; - var match = actual.match(" - diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/XML.jsspec.js b/editions/tw2/source/tiddlywiki/tests/jsspec/XML.jsspec.js deleted file mode 100755 index 038d1ecee..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/XML.jsspec.js +++ /dev/null @@ -1,38 +0,0 @@ -// '); - value_of(typeof xml).should_match('object'); - }, - 'documentElement should be an object' : function() { - xml = tests_xml.parse(''); - value_of(typeof xml.documentElement).should_be("object"); - }, - 'DOM should be able to access documentElement nodeName' : function() { - xml = tests_xml.parse(''); - value_of(xml.documentElement.nodeName).should_be("foo"); - }, - 'DOM should be able to access documentElement nodeName from empty document' : function() { - xml = tests_xml.parse(''); - value_of(xml.documentElement.nodeName).should_be("foo"); - }, - 'DOM should be able to access attribute on document node' : function() { - xml = tests_xml.parse(''); - value_of(xml.documentElement.getAttribute("version")).should_be("2.0"); - }, - 'XPath should be able to access the documentElement' : function() { - xml = tests_xml.parse('hello'); - value_of(xml.xpath("/foo", "string")).should_be("hello"); - }, - 'XPath should be able to access the documentElement' : function() { - xml = tests_xml.parse('helloworld'); - value_of(xml.xpath("/foo/bar", "string")).should_be("world"); - }, - 'XPath count of nodeset containing elements' : function() { - xml = tests_xml.parse(''); - value_of(xml.xpath("count(/foo/bar)", "number")).should_be(3); - } -}); - -// ]]> diff --git a/editions/tw2/source/tiddlywiki/tests/jsspec/split.recipe b/editions/tw2/source/tiddlywiki/tests/jsspec/split.recipe deleted file mode 100755 index 1db6a0cb7..000000000 --- a/editions/tw2/source/tiddlywiki/tests/jsspec/split.recipe +++ /dev/null @@ -1,8 +0,0 @@ -jsspec: BasicTypes.jsspec.js -jsspec: Dom.jsspec.js -jsspec: Macros.jsspec.js -jsspec: Messages.jsspec.js -jsspec: Mocks.jsspec.js -jsspec: Strings.jsspec.js -jsspec: Wikifier.jsspec.js -jsspec: XML.jsspec.js diff --git a/editions/tw2/source/tiddlywiki/tiddlywiki.html.recipe b/editions/tw2/source/tiddlywiki/tiddlywiki.html.recipe deleted file mode 100755 index 422989061..000000000 --- a/editions/tw2/source/tiddlywiki/tiddlywiki.html.recipe +++ /dev/null @@ -1,6 +0,0 @@ -recipe: html/split.recipe -recipe: shadows/split.recipe -recipe: js/split.recipe -recipe: deprecated/split.recipe -recipe: jquery/split.recipe -copy: java/TiddlySaver.jar diff --git a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs.html.recipe b/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs.html.recipe deleted file mode 100755 index d5d4e8a0b..000000000 --- a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: html/split.recipe -recipe: shadows/split.recipe -version: js/Version.js -jsext: html/externaljs.txt diff --git a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace.html.recipe b/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace.html.recipe deleted file mode 100755 index 0d46385c6..000000000 --- a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: html/split.recipe -recipe: shadows/split.recipe -version: js/Version.js -jsext: html/externaljs_tiddlyspace.txt diff --git a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace_alpha.html.recipe b/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace_alpha.html.recipe deleted file mode 100755 index e6d40bc78..000000000 --- a/editions/tw2/source/tiddlywiki/tiddlywiki_externaljs_tiddlyspace_alpha.html.recipe +++ /dev/null @@ -1,4 +0,0 @@ -recipe: html/split.recipe -recipe: shadows/split.recipe -version: js/Version.js -jsext: html/externaljs_tiddlyspace_alpha.txt diff --git a/editions/tw2/source/tiddlywiki/tiddlywikinonoscript.html.recipe b/editions/tw2/source/tiddlywiki/tiddlywikinonoscript.html.recipe deleted file mode 100755 index fa7d7107e..000000000 --- a/editions/tw2/source/tiddlywiki/tiddlywikinonoscript.html.recipe +++ /dev/null @@ -1,6 +0,0 @@ -recipe: html/splitnonoscript.recipe -recipe: shadows/split.recipe -recipe: js/split.recipe -recipe: deprecated/split.recipe -recipe: jquery/split.recipe -copy: java/TiddlySaver.jar diff --git a/editions/tw2/source/tiddlywiki/uploadalpha b/editions/tw2/source/tiddlywiki/uploadalpha deleted file mode 100755 index 56b1120bd..000000000 --- a/editions/tw2/source/tiddlywiki/uploadalpha +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# uploadalpha [release] [username] - -# default values -USERNAME=${2:-$LOGNAME} -DEFAULT_RELEASE=`cat ALPHA` -RELEASE=${1:-$DEFAULT_RELEASE} -HOST="$USERNAME@tiddlywiki.com" -DIR="/var/www/www.tiddlywiki.com/htdocs" -OWNER="www-data:www-data" -PERM="664" - -# setPermissions() -# Usage: -# setPermissions file -function setPermissions() { - COMMANDS="$COMMANDS sudo chown $OWNER $1;" - COMMANDS="$COMMANDS sudo chmod $PERM $1;" -} - -# upload files to temporary folder -echo -echo "uploading files" -echo -FILES="tiddlywiki.$RELEASE.html tiddlywiki_compressed.$RELEASE.html tiddlywiki_externaljs.$RELEASE.html tiddlywiki_externaljs_tiddlyspace.$RELEASE.html twcore.$RELEASE.js jquery/jquery.js jquery/plugins/jQuery.twStylesheet.js" -scp $FILES "$HOST:./tmp/" - -# transfer files to their respective folders -echo -echo "transferring files" -echo -stty -echo -COMMANDS="ssh $HOST" -# Empty -COMMANDS="$COMMANDS sudo cp ./tmp/tiddlywiki.$RELEASE.html $DIR/alpha/empty.html;" -setPermissions "$DIR/alpha/empty.html" -# Compressed -COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_compressed.$RELEASE.html $DIR/alpha/tiddlywiki_compressed.html;" -setPermissions "$DIR/alpha/tiddlywiki_compressed.html" -COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_externaljs.$RELEASE.html $DIR/alpha/tiddlywiki_externaljs.html;" -setPermissions "$DIR/alpha/tiddlywiki_externaljs.html" -COMMANDS="$COMMANDS sudo mv ./tmp/tiddlywiki_externaljs_tiddlyspace.$RELEASE.html $DIR/alpha/tiddlywiki_externaljs_tiddlyspace.html;" -setPermissions "$DIR/alpha/tiddlywiki_externaljs_tiddlyspace.html" -COMMANDS="$COMMANDS sudo mv ./tmp/twcore.$RELEASE.js $DIR/alpha/twcore.js;" -setPermissions "$DIR/alpha/twcore.js" -COMMANDS="$COMMANDS sudo mv ./tmp/jquery.js $DIR/alpha/jquery.js;" -setPermissions "$DIR/alpha/jquery.js" -COMMANDS="$COMMANDS sudo mv ./tmp/jQuery.twStylesheet.js $DIR/alpha/jQuery.twStylesheet.js;" -setPermissions "$DIR/alpha/jQuery.twStylesheet.js" -# execute -$COMMANDS -stty echo diff --git a/editions/tw2/source/translations/README.md b/editions/tw2/source/translations/README.md deleted file mode 100755 index 8391d96d6..000000000 --- a/editions/tw2/source/translations/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Translating TiddlyWiki -====================== - -Are you you thinking of writing a translation for TiddlyWiki? That is fantastic: it will make a real difference to the community. This page is here to get you going. - -If you have any questions you would like addressed, please contact translations@tiddlywiki.org. - - -How to create or update a translation of TiddlyWiki ---------------------------------------------------- - -1. First, check below to see if the translation you need already exists. -2. Download a fresh copy of TiddlyWiki from http://www.tiddlywiki.com/ -3. In another window, visit https://github.com/TiddlyWiki/tiddlywiki/blob/master/locales/core/en/locale.en.js and copy all the text to the clipboard -4. Go back to the TiddlyWiki file and create a tiddler named after the language you are translating -5. Paste the clipboard into the body of the new tiddler -6. Add the tag "systemConfig" to the tiddler -7. Click 'done' and save your changes -8. Study the entries you've pasted and replace the various quoted English strings (only the ones in double-quotes!) with their translations -9. Save and reload to test -10. The "config.locale" in your translation-tiddler is used to set the W3C language tags in your HTML automatically, but since this reload is the first time your translation is executed, only now these tags are actually updated. Therefore you have to save your TW once again. - - -Useful links ------------- - -[W3C Internationalization Best Practices](http://www.w3.org/TR/i18n-html-tech-lang/) - -http://www.w3.org/International/articles/language-tags/Overview.en.php - -http://www.loc.gov/standards/iso639-2/php/code_list.php - -http://www.iana.org/assignments/language-subtag-registry diff --git a/editions/tw2/source/translations/locales/core/ca/empty.ca.html.recipe b/editions/tw2/source/translations/locales/core/ca/empty.ca.html.recipe deleted file mode 100755 index eb76a6feb..000000000 --- a/editions/tw2/source/translations/locales/core/ca/empty.ca.html.recipe +++ /dev/null @@ -1,2 +0,0 @@ -recipe: ../../../../core/tiddlywiki.html.recipe -tiddler: locale.ca.js diff --git a/editions/tw2/source/translations/locales/core/ca/locale.ca.2.5.2.js b/editions/tw2/source/translations/locales/core/ca/locale.ca.2.5.2.js deleted file mode 100755 index 905c09da0..000000000 --- a/editions/tw2/source/translations/locales/core/ca/locale.ca.2.5.2.js +++ /dev/null @@ -1,499 +0,0 @@ -/*** -|''Name:''|CatalanLingo| -|''Description:''|Central Catalan translation for T| -|''Author:''|Paco Rivière (http://pacoriviere.cat)| -|''Source:''|https://projectes.lafarga.cat/projects/tiddlywiki/downloads| -|''CodeRepository:''|http://svn.tiddlywiki.org/Trunk/association/locales/core/en/locale.en.js | -|''Version:''|0.4.0| -|''Date:''|Apr 11, 2010| -|''Comments:''|Agrairem els vostres comentaris a https://projectes.lafarga.cat/forum/?group_id=38| -|''License:''|[[BSD open source license]]| -|''~CoreVersion:''|2.5.2| -***/ - -//{{{ -//-- -//-- Translateable strings -//-- - -// Strings in "double quotes" should be translated; strings in 'single quotes' should be left alone - -config.locale = "ca"; // W3C language tag - -if (config.options.txtUserName == 'YourName') // do not translate this line, but do translate the next line - merge(config.options,{txtUserName: "ElVostreNom"}); - -merge(config.tasks,{ - save: {text: "desa", tooltip: "Desa tots els canvis en aquest arxiu", action: saveChanges}, - sync: {text: "sincronitza", tooltip: "Sincronitza els canvis amb d'altres fitxers i servidors TiddlyWiki", content: '<>'}, - importTask: {text: "importa", tooltip: "Importa tiddlers i connector d'altres fitxers TiddlyWiki i servidors", content: '<>'}, - tweak: {text: "opcions", tooltip: "Tria el comportament de TiddlyWiki", content: '<>'}, - upgrade: {text: "actualitza", tooltip: "Actualitza el codi del nucli de TiddlyWiki", content: '<>'}, - plugins: {text: "connectors", tooltip: "Gestiona els connectors", content: '<>'} -}); - -// Options that can be set in the options panel and/or cookies -merge(config.optionsDesc,{ - txtUserName: "Nom utilitzat per signar els canvis", - chkRegExpSearch: "Cerca expressions regulars", - chkCaseSensitiveSearch: "Distingeix les majúscules en cercar", - chkIncrementalSearch: "Cerca incremental tecla a tecla", - chkAnimate: "Fes servir animacions", - chkSaveBackups: "Desa una còpia de seguretat abans de desar els canvis", - chkAutoSave: "Registra els canvis de forma automàtica", - chkGenerateAnRssFeed: "Genera un fil RSS en desar els canvis", - chkSaveEmptyTemplate: "Genera un fitxer 'empty.html'en desar els canvis", - chkOpenInNewWindow: "Obre els vincles externs en un altre finestra", - chkToggleLinks: "Tanca els elements oberts en clicar sobre els seus vincles", - chkHttpReadOnly: "Amaga els botons d'edició quan s'accedeix com per HTTP", - chkForceMinorUpdate: "Tracta les edicions com a Canvis Menors conservant data i hora", - chkConfirmDelete: "Demana confirmació abans de superimir un element", - chkInsertTabs: "Inserta un tabulador amb la tecla 3tab en lloc de slatar el camp", - txtBackupFolder: "Nom de la carpeta per als arxius de còpia", - txtMaxEditRows: "Màxim nombre de línies d'una capsa d'edició tiddler", - txtTheme: "Nom del tema", - txtFileSystemCharSet: "Codificació de caractèrs per desar els (només per Firefox/Mozilla)"}); - -merge(config.messages,{ - customConfigError: "S'han trobat problemes en carregar els connectors. Veieu el PluginManager per a més detalls", - pluginError: "Error: %0", - pluginDisabled: "Not executed because disabled via 'systemConfigDisable' tag", - pluginForced: "Executed because forced via 'systemConfigForce' tag", - pluginVersionError: "Not executed because this plugin needs a newer version of TiddlyWiki", - nothingSelected: "Nothing is selected. You must select one or more items first", - savedSnapshotError: "It appears that this TiddlyWiki has been incorrectly saved. Please see http://www.tiddlywiki.com/#Download for details", - subtitleUnknown: "(unknown)", - undefinedTiddlerToolTip: "The tiddler '%0' doesn't yet exist", - shadowedTiddlerToolTip: "The tiddler '%0' doesn't yet exist, but has a pre-defined shadow value", - tiddlerLinkTooltip: "%0 - %1, %2", - externalLinkTooltip: "Enllaç extern cap a %0", - noTags: "No hi ha tiddlers amb etiquetes", - notFileUrlError: "Cal desar aquest TiddlyWiki a un arxiu abans de poder desar els canvis", - cantSaveError: "No es poden desar els canvis. Pot ser que el vostre navegador no permeti desar (Proveu de fer servir Firefox, en lloc), o degut a que el nom de la ruta de l'arxiu TiddlyWiki té algun caràcter incorrecte", - invalidFileError: "Sembla que l'arxiu original '%0' no és un TiddlyWiki vàlid", - backupSaved: "S'ha desat la còpia", - backupFailed: "No ha estat possible desar la còpia de l'arxiu", - rssSaved: "S'ha desat el fil RSS", - rssFailed: "No ha estat possible desar el fil RSS", - emptySaved: "S'ha desat la plantilla buida", - emptyFailed: "No ha estat possible desar la plantilla buida", - mainSaved: "S'ha desat l'arxiu principal de TiddlyWiki", - mainFailed: "No ha estat possible desar l'arxiu principal de TiddlyWiki. Els vostres canvis no s'han desat", - macroError: "Hi ha un error a la macro <<%0>>", - macroErrorDetails: "Hi ha hagut un error a l'executar la macro <<%0>>:\n%1", - missingMacro: "No es troba la macro", - overwriteWarning: "Ja hi ha un tiddler amb el nom '%0'. Trieu DAcord si el voleu sobreescriure", - unsavedChangesWarning: "ATENCIÓ! Hi ha canvis que no s'han desat al TiddlyWiki\n\nTrieu DAcord per desar\nTrieu ANUL·LA per descartar-los", - confirmExit: "--------------------------------\n\nHi ha canvis que no s'han desat al TiddlyWiki. Si continueu perdreu aquests canvis\n\n--------------------------------", - saveInstructions: "DesaElsCanvis", - unsupportedTWFormat: "El format del TiddlyWiki no es permés '%0'", - tiddlerSaveError: "Hi ha hagut un error en desar el tiddler '%0'", - tiddlerLoadError: "Hi ha hagut un error en desar el tiddler '%0'", - wrongSaveFormat: "No es pot desar en el format de magatzament '%0'. Feu servir el format standard per a desar.", - invalidFieldName: "El nom del camp no és vàlid vàlid %0", - fieldCannotBeChanged: "No es pot modificar el camp '%0'", - loadingMissingTiddler: "Intentant recuperar el '%0' del servidor '%1' a:\n\n'%2' a l'espai de treball '%3'", - upgradeDone: "S'ha completat l'actualització a la versió %0\n\nCliqueu 'D'acord' per tornar a carregar el nou TiddlyWiki actualitzat"}); - -merge(config.messages.messageClose,{ - text: "tanca", - tooltip: "tanca aquest tiddler"}); - -config.messages.backstage = { - open: {text: "bastidors", tooltip: "Obre els bastidors per les tasques d'autor i editor"}, - close: {text: "tanca", tooltip: "Tanca els bastidors"}, - prompt: "bastidors : ", - decal: { - edit: {text: "edita", tooltip: "Edita el tiddler '%0'"} - } -}; - -config.messages.listView = { - tiddlerTooltip: "Cliqueu per preveure el tiddler", - previewUnavailable: "(no es pot preveure)" -}; - -config.messages.dates.months = ["de gener de", "de febrer de", "de març de", "d'abril de", "de maig de", "de juny de", "de juliol de", "d'agost de", "de setembre de", "d'octubre de", "de novembre de","de desembre de"]; -config.messages.dates.days = ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]; -config.messages.dates.shortMonths = ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"]; -config.messages.dates.shortDays = ["Diu", "Dil", "Dma", "Dcr", "Dij", "Div", "Dis"]; -// suffixes for dates, eg "1st","2nd","3rd"..."30th","31st" -config.messages.dates.daySuffixes = ["r","n","r","t","é","é","é","é","é","é", - "é","é","é","é","é","é","é","é","é","é", - "é","","é","é","é","é","é","é","é","é", - "é"]; -config.messages.dates.am = "m."; -config.messages.dates.pm = "t."; - -merge(config.messages.tiddlerPopup,{ - }); - -merge(config.views.wikified.tag,{ - labelNoTags: "sense etiquetes", - labelTags: "etiquetes: ", - openTag: "Obre l'etiqueta '%0'", - tooltip: "Obre els tiddlers etiquetats amb '%0'", - openAllText: "obre tots", - openAllTooltip: "Obre tots aquests tiddlers", - popupNone: "No hi ha altres tiddlers etiquetats amb '%0'"}); - -merge(config.views.wikified,{ - defaultText: "El tiddler '%0' no existeix. Cliqueu dos cops per començar-lo", - defaultModifier: "(falta)", - shadowModifier: "(tiddler ombra pre-definit)", - dateFormat: "DD MMM YYYY", - createdPrompt: "creat el"}); - -merge(config.views.editor,{ - tagPrompt: "Afegiu les etiquetes separades per espais, [[feu servir corxets]] si cal, o afegiu-ne", - defaultText: "Entreu el text per a '%0'.'"}); - -merge(config.views.editor.tagChooser,{ - text: "etiquetes", - tooltip: "Tria entre les etiquetes actuals per afegir a aquest tiddler", - popupNone: "No hi ha etiquetes definides", - tagTooltip: "Afegeix l'etiqueta '%0'"}); - -merge(config.messages,{ - sizeTemplates: - [ - {unit: 1024*1024*1024, template: "%0\u00a0GB"}, - {unit: 1024*1024, template: "%0\u00a0MB"}, - {unit: 1024, template: "%0\u00a0KB"}, - {unit: 1, template: "%0\u00a0B"} - ]}); - -merge(config.macros.search,{ - label: "cerca", - prompt: "Cerca en aquest TiddlyWiki", - accessKey: "F", - successMsg: "S'han trobat %0 tiddlers que contenen: '%1'", - failureMsg: "No s'ha trobat cap tiddler amb: '%0'"}); - -merge(config.macros.tagging,{ - label: "etiquetes:", - labelNotTag: "cap etiqueta", - tooltip: "Llista de tiddlers etiquetats amb '%0'"}); - -merge(config.macros.timeline,{ - dateFormat: "DD MMM YYYY"});// use this to change the date format for your locale, eg "YYYY MMM DD", do not translate the Y, M or D - -merge(config.macros.allTags,{ - tooltip: "Mostra tiddlers com a etiqueta '%0'", - noTags: "No hi ha tiddlers amb etiquetes"}); - -config.macros.list.all.prompt = "Tots els tiddlers per ordre alfabètic"; -config.macros.list.missing.prompt = "Tiddlers que tenen enllaços cap a ells, però no estàn definits"; -config.macros.list.orphans.prompt = "Tiddlers sense enllaços des de cap altre"; -config.macros.list.shadowed.prompt = "Tiddlers amb ombres amb contingut per omisió"; -config.macros.list.touched.prompt = "Tiddlers que heu modificat localment"; - -merge(config.macros.closeAll,{ - label: "tanca tots", - prompt: "Tanca tots els tiddlers oberts (excepte els que s'estàn editant)"}); - -merge(config.macros.permaview,{ - label: "torna vista", - prompt: "Enllaça a una URL que torni tots els tiddlers que es mostren ara"}); - -merge(config.macros.saveChanges,{ - label: "desa els canvis", - prompt: "Desa tots els canvis a un arxiu", - accessKey: "S"}); - -merge(config.macros.newTiddler,{ - label: "nou tiddler", - prompt: "Obre un nou tiddler", - title: "Nou tiddler", - accessKey: "N"}); - -merge(config.macros.newJournal,{ - label: "nou diari", - prompt: "Obre un nou tiddler amb la data i hora actuals", - accessKey: "J"}); - -merge(config.macros.options,{ - wizardTitle: "Opcions avançades", - step1Title: "Aquestes opcions es desen a les galetes del vostre navegador", - step1Html: "
                Mostre les opcions desconegudes", - unknownDescription: "//(desconegut)//", - listViewTemplate: { - columns: [ - {name: 'Option', field: 'option', title: "Opció", type: 'String'}, - {name: 'Description', field: 'description', title: "Descripció", type: 'WikiText'}, - {name: 'Name', field: 'name', title: "Nom", type: 'String'} - ], - rowClasses: [ - {className: 'lowlight', field: 'lowlight'} - ]} - }); - -merge(config.macros.plugins,{ - wizardTitle: "Gestor de connectors", - step1Title: "Connectors carregats", - step1Html: "", // DO NOT TRANSLATE - skippedText: "(Aquest connector encara no s'ha carregat)", - noPluginText: "No hi ha cap connector instal·lat", - confirmDeleteText: "Segur que voleu que suprimir els connectors:\n\n%0", - removeLabel: "suprimeix l'etiqueta systemConfig", - removePrompt: "Suprimeix l'etiqueta systemConfig", - deleteLabel: "suprimeix", - deletePrompt: "Suprimeix definitivament aquests tiddlers", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Description', field: 'Description', title: "Descripció", type: 'String'}, - {name: 'Version', field: 'Version', title: "Versió", type: 'String'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Mida", type: 'Size'}, - {name: 'Forced', field: 'forced', title: "Forçat", tag: 'systemConfigForce', type: 'TagCheckbox'}, - {name: 'Disabled', field: 'disabled', title: "Desactivat", tag: 'systemConfigDisable', type: 'TagCheckbox'}, - {name: 'Executed', field: 'executed', title: "Carregat", type: 'Boolean', trueText: "Sí", falseText: "No"}, - {name: 'Startup Time', field: 'startupTime', title: "Temps de càrrega", type: 'String'}, - {name: 'Error', field: 'error', title: "Resultat", type: 'Boolean', trueText: "Error", falseText: "DAcord"}, - {name: 'Log', field: 'log', title: "Registre", type: 'StringList'} - ], - rowClasses: [ - {className: 'error', field: 'error'}, - {className: 'warning', field: 'avís'} - ]} - }); - -merge(config.macros.toolbar,{ - moreLabel: "més", - morePrompt: "Mostra més ordres", - lessLabel: "menys", - lessPrompt: "Mostra menys ordres", - separator: "|" - }); - -merge(config.macros.refreshDisplay,{ - label: "actualitza", - prompt: "Torna a carregar tot el TiddlyWiki" - }); - -merge(config.macros.importTiddlers,{ - readOnlyWarning: "No podeu importar a un fitxer TiddlyWiki només de lectura. Mireu d'obrir-lo des d'un fitxer, file:// URL", - wizardTitle: "Importa tiddlers d'un altre fitxer o servidor", - step1Title: "Pas 1: Indiqueu el fitxer TiddlyWiki o servidor", - step1Html: "Indiqueu el tipus de servidor:
                Entreu la URL o la ruta aquí:
                ...o navega:

                ...o trieu un canal predefinit: ", - openLabel: "obre", - openPrompt: "Obre la connexió amb aquest fitxer o servidor", - openError: "Hi ha hagut un problema en importar el fitxer Tiddlywiki", - statusOpenHost: "Obrint el servidor", - statusGetWorkspaceList: "Obtenint la llista d'espais de treball disponibles", - step2Title: "Pas 2: Trieu un espai de treball", - step2Html: "Entreu el nom de l'espai de treball:
                ...o trieu un espai de treball: ", - cancelLabel: "anul·la", - cancelPrompt: "Anul·la la importació", - statusOpenWorkspace: "Obrint l'espai de treball", - statusGetTiddlerList: "Obtenint la llista de tiddlers", - errorGettingTiddlerList: "Hi ha hagut un problema en obtenir la llist de tiddlers, cliqueu Anul·la o torneu a provar", - step3Title: "Pas 3: Trieu els tiddlers que voleu importar", - step3Html: "
                Manté aquests tiddlers enllaçats a aquest servidor per doder sincronitzar el canvis
                Deseu els detalls del servidor en un tiddler 'systemServer' anomenat: ", - importLabel: "importa", - importPrompt: "Importa aquests tiddlers", - confirmOverwriteText: "Segur que voleu substituir aquests tiddlers:\n\n%0", - step4Title: "Pas 4: Important %0 tiddler(s)", - step4Html: "", // DO NOT TRANSLATE - doneLabel: "fet", - donePrompt: "Tanca l'assistent", - statusDoingImport: "Important els tiddlers", - statusDoneImport: "S'han importat tots els tiddlers", - systemServerNamePattern: "%2 de %1", - systemServerNamePatternNoWorkspace: "%1", - confirmOverwriteSaveTiddler: "El tiddler '%0' ja existeix. Cliqueu 'DAcord' per sobreescriure'l amb els detalls d'aquest servidor, o 'Anul·la' per deixar-ho tal com és", - serverSaveTemplate: "|''Tipus:''|%0|\n|''URL:''|%1|\n|''Espai:''|%2|\n\nAquest tiddler es va crear automàticament per registrar els detalls d'aquest servidor", - serverSaveModifier: "(System)", - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'Selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Size', field: 'size', tiddlerLink: 'size', title: "Mida", type: 'Size'}, - {name: 'Tags', field: 'tags', title: "Etiquetes", type: 'Tags'} - ], - rowClasses: [ - ]} - }); - -merge(config.macros.upgrade,{ - wizardTitle: "Actualitza el codi del nucli de TiddlyWiki", - step1Title: "Posa al dia o repara aquest this TiddlyWiki a la darrera versió", - step1Html: "Aneu a actualitzar a la darrera versió el nucli de TiddlyWiki (de %1). El vostre contingut es conservarà al actualitzar.

                Les actualitzacions del nucli poden fer que els connectors més antics deixin de funcionar correctament. Si trobeu problemes amb l'arxiu actualitzat, veieu http://www.tiddlywiki.org/wiki/CoreUpgrades", - errorCantUpgrade: "No es pot actualitzar aquest TiddlyWiki. Només podeu actualitzar fitxers TiddlyWiki desats localment", - errorNotSaved: "Heu de desar els canvis abans d'actualitzar", - step2Title: "Confirmeu els detalls de l'actualització", - step2Html_downgrade: "Aneu a retrocedir a TiddlyWiki versió %0 des de la %1.

                Downgrading to an earlier version of the core code is not recommended", - step2Html_restore: "Sembla que aquest TiddlyWiki ja fa servir la darrera versió del codi del nucli (%0).

                Podeu continuar igualment l'actualització per assegurar que el codi del nucli no està danyat", - step2Html_upgrade: "Aneu a actualitzar aquest TiddlyWiki a la versió %0 des de la %1", - upgradeLabel: "actualitza", - upgradePrompt: "Inicia el procés d'actualització", - statusPreparingBackup: "Preparant la còpia de seguretat", - statusSavingBackup: "Desant la còpia de seguretat", - errorSavingBackup: "S'han trobat un problema en desar la còpia de seguretat", - statusLoadingCore: "Carregant el codi del nucli", - errorLoadingCore: "Hi ha hagut un error carregant el codi del nucli", - errorCoreFormat: "Hi ha hagut un error amb el nou codi del nucli", - statusSavingCore: "Desant el nou codi del nucli", - statusReloadingCore: "Tornant a carregar el nou codi del nucli", - startLabel: "inicia", - startPrompt: "Inicia l'actualització", - cancelLabel: "cancel·la", - cancelPrompt: "Cancel·la l'actualització", - step3Title: "procés cancel·lat", - step3Html: "Heu cancel·lat l'actualització" - }); - -merge(config.macros.sync,{ - listViewTemplate: { - columns: [ - {name: 'Selected', field: 'selected', rowName: 'title', type: 'Selector'}, - {name: 'Tiddler', field: 'tiddler', title: "Tiddler", type: 'Tiddler'}, - {name: 'Server Type', field: 'serverType', title: "Tipus de servidor", type: 'String'}, - {name: 'Server Host', field: 'serverHost', title: "Servidor", type: 'String'}, - {name: 'Server Workspace', field: 'serverWorkspace', title: "Espai de treball", type: 'String'}, - {name: 'Status', field: 'status', title: "Estat de Sicronització", type: 'String'}, - {name: 'Server URL', field: 'serverUrl', title: "URL del servidor", text: "Mostra", type: 'Link'} - ], - rowClasses: [ - ], - buttons: [ - {caption: "Sync these tiddlers", name: 'sync'} - ]}, - wizardTitle: "Sincronitza amb servidors i fitxers externs", - step1Title: "Trieu els tiddlers que voleu sincronitzar", - step1Html: "", // DO NOT TRANSLATE - syncLabel: "sinc", - syncPrompt: "Sincronitza aquests tiddlers", - hasChanged: "Ha canviat mentre no era connectat", - hasNotChanged: "Sense canvis mentre no era connectat", - syncStatusList: { - none: {text: "...", display:null, className:'notChanged'}, - changedServer: {text: "Canviat al servidor", display:null, className:'changedServer'}, - changedLocally: {text: "Canviat mentre era desconnectat", display:null, className:'changedLocally'}, - changedBoth: {text: "Canviat mentre desconnectat i al servidor", display:null, className:'changedBoth'}, - notFound: {text: "No s'ha trobat al servidor", display:null, className:'notFound'}, - putToServer: {text: "S'han desat els canvis al servidor", display:null, className:'putToServer'}, - gotFromServer: {text: "S'han recuperat els canvis des del servidor", display:null, className:'gotFromServer'} - } - }); - -merge(config.commands.closeTiddler,{ - text: "tanca", - tooltip: "Tanca aquest tiddler"}); - -merge(config.commands.closeOthers,{ - text: "tanca altres", - tooltip: "Tanca tots els altres tiddlers"}); - -merge(config.commands.editTiddler,{ - text: "edita", - tooltip: "Edita aquest tiddler", - readOnlyText: "mostra", - readOnlyTooltip: "Mostra el codi d'aquest tiddler"}); - -merge(config.commands.saveTiddler,{ - text: "desa", - tooltip: "Desa els canvis d'aquest tiddler"}); - -merge(config.commands.cancelTiddler,{ - text: "anul·la", - tooltip: "Anul·la els canvis a aquest tiddler", - warning: "Segur que voleu anul·lar els canvis a '%0'?", - readOnlyText: "fet", - readOnlyTooltip: "Torna a l'aspecte normal"}); - -merge(config.commands.deleteTiddler,{ - text: "suprimeix", - tooltip: "Suprimeix aquest tiddler", - warning: "Segur que voleu suprimir '%0'?"}); - -merge(config.commands.permalink,{ - text: "enllaç permanent", - tooltip: "Enllaç permanent d'aquest tiddler"}); - -merge(config.commands.references,{ - text: "referències", - tooltip: "Obre els tiddlers que enllacen a aquest", - popupNone: "sense referències"}); - -merge(config.commands.jump,{ - text: "salta", - tooltip: "Salta a un altre tiddler obert"}); - -merge(config.commands.syncing,{ - text: "sincronitzant", - tooltip: "Control de la sincronització d'aquest tiddler amb un servidor o fitxer extern", - currentlySyncing: "
                Es sincromitza '%0' amb:
                servidor: %1
                workspace: %2", // Note escaping of closing
                tag - notCurrentlySyncing: "No s'està sincronitzant", - captionUnSync: "Atura la sincronització d'aquest tiddler", - chooseServer: "Sincronitza aquest tiddler amb un altre servidor:", - currServerMarker: "\u25cf ", - notCurrServerMarker: " "}); - -merge(config.commands.fields,{ - text: "camps", - tooltip: "Mostra els camps ampliats d'aquest tiddler", - emptyText: "Aquest tiddler no té camps ampliats", - listViewTemplate: { - columns: [ - {name: 'Field', field: 'field', title: "Camp", type: 'String'}, - {name: 'Value', field: 'value', title: "Valor", type: 'String'} - ], - rowClasses: [ - ], - buttons: [ - ]}}); - -merge(config.shadowTiddlers,{ - DefaultTiddlers: "[[ComComençar]]", - MainMenu: "ComComençar\n\n[[Donacions]]\n© 2009 [[UnaMesa|http://www.unamesa.org/]]\n© 2009 [[frivière|http://pacoriviere.cat/]]\n\n\n^^TiddlyWiki versió <>^^", - SiteTitle: "El meu TiddlyWiki", - SiteSubtitle: "bloc web personal no lineal, reutilitzable", - SiteUrl: "http://www.tiddlywiki.com/", - ComComençar: "Per començar amb aquest TiddlyWiki en blanc, heu de modificar els següents tiddlers:\n* [[TitolDelLloc|SiteTitle]] & [[SubtitolDelLloc|SiteSubtitle]]: El títol i el subtítol del lloc, com es mostra a sobre (un cop desats, també apareixeran a la barra de títols del navegador)\n* [[MenuPrincipal|MainMenu]]: El menú (normalment a l'esquerra)\n* [[TiddlersPerOmisio|DefaultTiddlers]]: Conté els noms dels tiddlers que voleu que apareguin quan s'obre el TiddlyWiki\nTambé heu d'entrar el vostre nom d'usuari per signar les vostres edicions: <