Changeset 4054

Show
Ignore:
Timestamp:
03/19/08 04:38:16 (7 months ago)
Author:
JeremyRuston
Message:

Minor improvements required to allow saving from templates (ticket #528)

Location:
Trunk/core
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Trunk/core/html/tiddlywiki.template.html

    r4017 r4054  
    22<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    33<head> 
    4 <script type="text/javascript"> 
     4<script id="versionArea" type="text/javascript"> 
    55//<![CDATA[ 
    66<!--@@version@@--> 
     
    8989<!--@@postbody@@--> 
    9090<!--POST-BODY-END--> 
    91 <script type="text/javascript"> 
     91<script id="jsArea" type="text/javascript"> 
    9292//<![CDATA[ 
    9393<!--@@prejs@@--> 
    9494<!--@@js@@--> 
    9595<!--@@postjs@@--> 
    96 //-- 
    97 //-- End of scripts 
    98 //-- 
    9996//]]> 
    10097</script> 
  • Trunk/core/js/Config.js

    r3558 r4054  
    1111        cascadeDepth: 5 // Depth of cascade animation 
    1212}; 
     13 
     14// Hashmap of alternative parsers for the wikifier 
     15config.parsers = {}; 
    1316 
    1417// Adaptors 
     
    4851        chkInsertTabs: false, 
    4952        chkUsePreForStorage: true, // Whether to use <pre> format for storage 
    50         chkDisplayStartupTime: false, 
     53        chkDisplayInstrumentation: false, 
    5154        txtBackupFolder: "", 
    5255        txtMainTab: "tabTimeline", 
  • Trunk/core/js/Saving.js

    r4043 r4054  
    9595                return; 
    9696        clearMessage(); 
    97         // Get the URL of the document 
     97        var t0 = new Date(); 
     98        //# Get the URL of the document 
    9899        var originalPath = document.location.toString(); 
    99         // Check we were loaded from a file URL 
     100        //# Check we were loaded from a file URL 
    100101        if(originalPath.substr(0,5) != "file:") { 
    101102                alert(config.messages.notFileUrlError); 
     
    105106        } 
    106107        var localPath = getLocalPath(originalPath); 
    107         // Load the original file 
     108        //# Load the original file 
    108109        var original = loadFile(localPath); 
    109110        if(original == null) { 
     
    113114                return; 
    114115        } 
    115         // Locate the storeArea div's 
     116        //# Locate the storeArea div's 
    116117        var posDiv = locateStoreArea(original); 
    117118        if(!posDiv) { 
     
    123124        saveEmpty(localPath,original,posDiv); 
    124125        saveMain(localPath,original,posDiv); 
     126        if(config.options.chkDisplayInstrumentation) 
     127                displayMessage("saveChanges " + (new Date()-t0) + " ms"); 
    125128} 
    126129 
     
    135138                else 
    136139                        alert(config.messages.backupFailed); 
    137         } 
    138 } 
    139  
    140 function saveRss(localPath) 
    141 { 
    142         //# Save Rss 
    143         if(config.options.chkGenerateAnRssFeed) { 
    144                 var rssPath = localPath.substr(0,localPath.lastIndexOf(".")) + ".xml"; 
    145                 var rssSave = saveFile(rssPath,convertUnicodeToUTF8(generateRss())); 
    146                 if(rssSave) 
    147                         displayMessage(config.messages.rssSaved,"file://" + rssPath); 
    148                 else 
    149                         alert(config.messages.rssFailed); 
    150140        } 
    151141} 
     
    186176        } else { 
    187177                alert(config.messages.mainFailed); 
     178        } 
     179} 
     180 
     181function saveRss(localPath) 
     182{ 
     183        //# Save Rss 
     184        if(config.options.chkGenerateAnRssFeed) { 
     185                var rssPath = localPath.substr(0,localPath.lastIndexOf(".")) + ".xml"; 
     186                if(saveFile(rssPath,convertUnicodeToUTF8(generateRss()))) 
     187                        displayMessage(config.messages.rssSaved,"file://" + rssPath); 
     188                else 
     189                        alert(config.messages.rssFailed); 
    188190        } 
    189191} 
  • Trunk/core/js/Wikifier.js

    r3449 r4054  
    3535function wikifyStatic(source,highlightRegExp,tiddler,format) 
    3636{ 
    37         var e = createTiddlyElement(document.body,"div"); 
     37        var e = createTiddlyElement(document.body,"pre"); 
    3838        e.style.display = "none"; 
    3939        var html = ""; 
  • Trunk/core/js/main.js

    r3540 r4054  
    77var story = null; // Main story 
    88var formatter = null; // Default formatters for the wikifier 
    9 config.parsers = {}; // Hashmap of alternative parsers for the wikifier 
    109var anim = typeof Animator == "function" ? new Animator() : null; // Animation engine 
    1110var readOnly = false; // Whether we're in readonly mode 
     
    6968                backstage.init(); 
    7069        t10 = new Date(); 
    71         if(config.options.chkDisplayStartupTime) { 
     70        if(config.options.chkDisplayInstrumentation) { 
    7271                displayMessage("LoadShadows " + (t2-t1) + " ms"); 
    7372                displayMessage("LoadFromDiv " + (t3-t2) + " ms");