<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  
  

  


  <head>
    <title>
      HTTPSavingPlugin.js.diff on Ticket #11 – Attachment
     – tiddly_on_tahoe
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="search" href="/trac/tiddly_on_tahoe/search" />
        <link rel="help" href="/trac/tiddly_on_tahoe/wiki/TracGuide" />
        <link rel="alternate" href="/trac/tiddly_on_tahoe/raw-attachment/ticket/11/HTTPSavingPlugin.js.diff" type="text/x-diff; charset=utf-8" title="Original Format" />
        <link rel="up" href="/trac/tiddly_on_tahoe/ticket/11" title="Ticket #11" />
        <link rel="start" href="/trac/tiddly_on_tahoe/wiki" />
        <link rel="stylesheet" href="/trac/tiddly_on_tahoe/chrome/common/css/trac.css" type="text/css" /><link rel="stylesheet" href="/trac/tiddly_on_tahoe/chrome/common/css/diff.css" type="text/css" /><link rel="stylesheet" href="/trac/tiddly_on_tahoe/chrome/common/css/code.css" type="text/css" />
      <link type="application/opensearchdescription+xml" rel="search" href="/trac/tiddly_on_tahoe/search/opensearch" title="Search tiddly_on_tahoe" />
    <script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/jquery.js"></script><script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/babel.js"></script><script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/trac.js"></script><script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/search.js"></script><script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/diff.js"></script>
    <!--[if lt IE 7]>
    <script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/ie_pre7_hacks.js"></script>
    <![endif]-->
    <script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/folding.js"></script><script type="text/javascript">
        jQuery(document).ready(function($) {
          $('#preview table.code').enableCollapsibleColumns($('#preview table.code thead th.content'));
        });
      </script>
  </head>
  <body>
    <div id="banner">
      <div id="header">
        <a id="logo" href="http://allmydata.org/"><img src="/trac/tiddly_on_tahoe/chrome/site/Logo-org.png" alt="" /></a>
      </div>
      <form id="search" action="/trac/tiddly_on_tahoe/search" method="get">
        <div>
          <label for="proj-search">Search:</label>
          <input type="text" id="proj-search" name="q" size="18" value="" />
          <input type="submit" value="Search" />
        </div>
      </form>
      <div id="metanav" class="nav">
    <ul>
      <li class="first">logged in as arch_o_median</li><li><a href="/trac/tiddly_on_tahoe/logout">Logout</a></li><li><a href="/trac/tiddly_on_tahoe/wiki/TracGuide">Help/Guide</a></li><li><a href="/trac/tiddly_on_tahoe/about">About Trac</a></li><li class="last"><a href="/trac/tiddly_on_tahoe/prefs">Preferences</a></li>
    </ul>
  </div>
    </div>
    <div id="mainnav" class="nav">
    <ul>
      <li class="first"><a href="/trac/tiddly_on_tahoe/wiki">Wiki</a></li><li><a href="/trac/tiddly_on_tahoe/timeline">Timeline</a></li><li><a href="/trac/tiddly_on_tahoe/roadmap">Roadmap</a></li><li><a href="/trac/tiddly_on_tahoe/browser">Browse Source</a></li><li><a href="/trac/tiddly_on_tahoe/report">View Tickets</a></li><li><a href="/trac/tiddly_on_tahoe/newticket">New Ticket</a></li><li><a href="/trac/tiddly_on_tahoe/search">Search</a></li><li class="last"><a href="">Buildbot</a></li>
    </ul>
  </div>
    <div id="main">
      <div id="ctxtnav" class="nav">
        <h2>Context Navigation</h2>
          <ul>
              <li class="last first"><a href="/trac/tiddly_on_tahoe/ticket/11">Back to Ticket #11</a></li>
          </ul>
        <hr />
      </div>
    <div id="content" class="attachment">
        <h1><a href="/trac/tiddly_on_tahoe/ticket/11">Ticket #11</a>: HTTPSavingPlugin.js.diff</h1>
        <table id="info" summary="Description">
          <tbody>
            <tr>
              <th scope="col">File HTTPSavingPlugin.js.diff,
                <span title="1850 bytes">1.8 KB</span>
                (added by ndurner, <a class="timeline" href="/trac/tiddly_on_tahoe/timeline?from=2010-02-27T21%3A22%3A48Z&amp;precision=second" title="2010-02-27T21:22:48Z in Timeline">11 months</a> ago)</th>
            </tr>
            <tr>
              <td class="message searchable">
                
              </td>
            </tr>
          </tbody>
        </table>
        <div id="preview" class="searchable">
          
  <div class="diff">
  <ul class="entries">
      <li class="entry">
        <h2>
          <a>HTTPSavingPlugin.js</a>
        </h2>
        <table class="trac-diff inline" summary="Differences" cellspacing="0">
              <colgroup><col class="lineno" /><col class="lineno" /><col class="content" /></colgroup>
              <thead>
                <tr>
                  <th title="File orig/HTTPSavingPlugin.js Sat Feb 27 20:35:18 2010">
                      old
                  </th>
                  <th title="File new/HTTPSavingPlugin.js Sat Feb 27 20:36:39 2010">
                      new
                  </th>
                  <td><em></em> </td>
                </tr>
              </thead>
            <tbody class="unmod">
                  <tr>
                          <th>18</th><th>18</th><td class="l"><span>/*global clearMessage, config, getPath, readOnly, saveChanges, saveTest, showBackstage, store, story, version, convertUriToUTF8, convertUnicodeToFileFormat, getLocalPath, loadRemoteFile, locateStoreArea, saveBackup, saveEmpty, saveFile, saveMain, saveRss, unescape, displayMessage, httpReq */</span> </td>
                  </tr><tr>
                          <th>19</th><th>19</th><td class="l"><span>//{{{</span> </td>
                  </tr><tr>
                          <th>20</th><th>20</th><td class="l"><span>if (!version.extensions.HTTPSavingPlugin) { //# ensure that the plugin is only installed once</span> </td>
                  </tr>
            </tbody><tbody class="add">
                  <tr class="first">
                          <th> </th><th>21</th><td class="r"><ins></ins> </td>
                  </tr><tr>
                          <th> </th><th>22</th><td class="r"><ins>// override httpReq to fix 2.5.3 core bug (http://trac.tiddlywiki.org/changeset/9244/Trunk/core/js/Http.js)</ins> </td>
                  </tr><tr>
                          <th> </th><th>23</th><td class="r"><ins>function httpReq(type,url,callback,params,headers,data,contentType,username,password,allowCache)</ins> </td>
                  </tr><tr>
                          <th> </th><th>24</th><td class="r"><ins>{</ins> </td>
                  </tr><tr>
                          <th> </th><th>25</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; var options = {</ins> </td>
                  </tr><tr>
                          <th> </th><th>26</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type:type,</ins> </td>
                  </tr><tr>
                          <th> </th><th>27</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url:url,</ins> </td>
                  </tr><tr>
                          <th> </th><th>28</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processData:false,</ins> </td>
                  </tr><tr>
                          <th> </th><th>29</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data:data,</ins> </td>
                  </tr><tr>
                          <th> </th><th>30</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cache:!!allowCache,</ins> </td>
                  </tr><tr>
                          <th> </th><th>31</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beforeSend: function(xhr) {</ins> </td>
                  </tr><tr>
                          <th> </th><th>32</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(var i in headers)</ins> </td>
                  </tr><tr>
                          <th> </th><th>33</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader(i,headers[i]);</ins> </td>
                  </tr><tr>
                          <th> </th><th>34</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader("X-Requested-With", "TiddlyWiki " + formatVersion());</ins> </td>
                  </tr><tr>
                          <th> </th><th>35</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</ins> </td>
                  </tr><tr>
                          <th> </th><th>36</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; };</ins> </td>
                  </tr><tr>
                          <th> </th><th>37</th><td class="r"><ins></ins> </td>
                  </tr><tr>
                          <th> </th><th>38</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(callback) {</ins> </td>
                  </tr><tr>
                          <th> </th><th>39</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.complete = function(xhr,textStatus) {</ins> </td>
                  </tr><tr>
                          <th> </th><th>40</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(jQuery.httpSuccess(xhr))</ins> </td>
                  </tr><tr>
                          <th> </th><th>41</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback(true,params,xhr.responseText,url,xhr);</ins> </td>
                  </tr><tr>
                          <th> </th><th>42</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</ins> </td>
                  </tr><tr>
                          <th> </th><th>43</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback(false,params,null,url,xhr);</ins> </td>
                  </tr><tr>
                          <th> </th><th>44</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</ins> </td>
                  </tr><tr>
                          <th> </th><th>45</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; }</ins> </td>
                  </tr><tr>
                          <th> </th><th>46</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(contentType)</ins> </td>
                  </tr><tr>
                          <th> </th><th>47</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.contentType = contentType;</ins> </td>
                  </tr><tr>
                          <th> </th><th>48</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(username)</ins> </td>
                  </tr><tr>
                          <th> </th><th>49</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.username = username;</ins> </td>
                  </tr><tr>
                          <th> </th><th>50</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(password)</ins> </td>
                  </tr><tr>
                          <th> </th><th>51</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.password = password;</ins> </td>
                  </tr><tr>
                          <th> </th><th>52</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(window.Components &amp;&amp; window.netscape &amp;&amp; window.netscape.security &amp;&amp; document.location.protocol.indexOf("http") == -1)</ins> </td>
                  </tr><tr>
                          <th> </th><th>53</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");</ins> </td>
                  </tr><tr>
                          <th> </th><th>54</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; return jQuery.ajax(options);</ins> </td>
                  </tr><tr>
                          <th> </th><th>55</th><td class="r"><ins>}</ins> </td>
                  </tr><tr class="last">
                          <th> </th><th>56</th><td class="r"><ins></ins> </td>
                  </tr>
            </tbody><tbody class="unmod">
                  <tr>
                          <th>21</th><th>57</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; version.extensions.HTTPSavingPlugin = { installed: true };</span> </td>
                  </tr><tr>
                          <th>22</th><th>58</th><td class="l"><span></span> </td>
                  </tr><tr>
                          <th>23</th><th>59</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; (function () { //# wrapper</span> </td>
                  </tr>
            </tbody>
              <tbody class="skipped">
                <tr>
                  <th><a href="#L129">…</a></th>
                  <th><a href="#L165">…</a></th>
                  <td><em></em> </td>
                </tr>
              </tbody>
            <tbody class="unmod">
                  <tr>
                          <th>129</th><th>165</th><td class="l"><span></span> </td>
                  </tr><tr>
                          <th>130</th><th>166</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; })(); //# end of wrapper</span> </td>
                  </tr><tr>
                          <th>131</th><th>167</th><td class="l"><span>} //# end of "install only once"</span> </td>
                  </tr>
            </tbody><tbody class="mod">
                      <tr class="first">
                        <th>132</th><th> </th><td class="l"><span>//}}}</span> </td>
                      </tr>
                      <tr>
                        <th> </th><th>168</th><td class="r"><span>//}}}</span> </td>
                      </tr><tr class="last">
                        <th> </th><th>169</th><td class="r"><span><em>&nbsp;No newline at end of file</em></span> </td>
                      </tr>
            </tbody>
        </table>
      </li>
  </ul>
</div>

        </div>
    </div>
    <div id="altlinks">
      <h3>Download in other formats:</h3>
      <ul>
        <li class="last first">
          <a rel="nofollow" href="/trac/tiddly_on_tahoe/raw-attachment/ticket/11/HTTPSavingPlugin.js.diff">Original Format</a>
        </li>
      </ul>
    </div>
    </div>
    <div id="footer" lang="en" xml:lang="en"><hr />
      <a id="tracpowered" href="http://trac.edgewall.org/"><img src="/trac/tiddly_on_tahoe/chrome/common/trac_logo_mini.png" height="30" width="107" alt="Trac Powered" /></a>
      <p class="left">Powered by <a href="/trac/tiddly_on_tahoe/about"><strong>Trac 0.12.1dev-r9947</strong></a><br />
        By <a href="http://www.edgewall.org/">Edgewall Software</a>.</p>
      <p class="right">Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a></p>
    </div>
  </body>
</html>