Ticket #1322: HTTPSavingPlugin2.js.diff

File HTTPSavingPlugin2.js.diff, 15.2 KB (added by arch_o_median, at 2011-01-15T20:27:53Z)

another ndurner patch

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3 
4 
5
6 
7
8
9  <head>
10    <title>
11      HTTPSavingPlugin.js.diff on Ticket #11 – Attachment
12     – tiddly_on_tahoe
13    </title>
14    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15        <link rel="search" href="/trac/tiddly_on_tahoe/search" />
16        <link rel="help" href="/trac/tiddly_on_tahoe/wiki/TracGuide" />
17        <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" />
18        <link rel="up" href="/trac/tiddly_on_tahoe/ticket/11" title="Ticket #11" />
19        <link rel="start" href="/trac/tiddly_on_tahoe/wiki" />
20        <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" />
21      <link type="application/opensearchdescription+xml" rel="search" href="/trac/tiddly_on_tahoe/search/opensearch" title="Search tiddly_on_tahoe" />
22    <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>
23    <!--[if lt IE 7]>
24    <script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/ie_pre7_hacks.js"></script>
25    <![endif]-->
26    <script type="text/javascript" src="/trac/tiddly_on_tahoe/chrome/common/js/folding.js"></script><script type="text/javascript">
27        jQuery(document).ready(function($) {
28          $('#preview table.code').enableCollapsibleColumns($('#preview table.code thead th.content'));
29        });
30      </script>
31  </head>
32  <body>
33    <div id="banner">
34      <div id="header">
35        <a id="logo" href="http://allmydata.org/"><img src="/trac/tiddly_on_tahoe/chrome/site/Logo-org.png" alt="" /></a>
36      </div>
37      <form id="search" action="/trac/tiddly_on_tahoe/search" method="get">
38        <div>
39          <label for="proj-search">Search:</label>
40          <input type="text" id="proj-search" name="q" size="18" value="" />
41          <input type="submit" value="Search" />
42        </div>
43      </form>
44      <div id="metanav" class="nav">
45    <ul>
46      <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>
47    </ul>
48  </div>
49    </div>
50    <div id="mainnav" class="nav">
51    <ul>
52      <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>
53    </ul>
54  </div>
55    <div id="main">
56      <div id="ctxtnav" class="nav">
57        <h2>Context Navigation</h2>
58          <ul>
59              <li class="last first"><a href="/trac/tiddly_on_tahoe/ticket/11">Back to Ticket #11</a></li>
60          </ul>
61        <hr />
62      </div>
63    <div id="content" class="attachment">
64        <h1><a href="/trac/tiddly_on_tahoe/ticket/11">Ticket #11</a>: HTTPSavingPlugin.js.diff</h1>
65        <table id="info" summary="Description">
66          <tbody>
67            <tr>
68              <th scope="col">File HTTPSavingPlugin.js.diff,
69                <span title="1850 bytes">1.8 KB</span>
70                (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>
71            </tr>
72            <tr>
73              <td class="message searchable">
74               
75              </td>
76            </tr>
77          </tbody>
78        </table>
79        <div id="preview" class="searchable">
80         
81  <div class="diff">
82  <ul class="entries">
83      <li class="entry">
84        <h2>
85          <a>HTTPSavingPlugin.js</a>
86        </h2>
87        <table class="trac-diff inline" summary="Differences" cellspacing="0">
88              <colgroup><col class="lineno" /><col class="lineno" /><col class="content" /></colgroup>
89              <thead>
90                <tr>
91                  <th title="File orig/HTTPSavingPlugin.js Sat Feb 27 20:35:18 2010">
92                      old
93                  </th>
94                  <th title="File new/HTTPSavingPlugin.js Sat Feb 27 20:36:39 2010">
95                      new
96                  </th>
97                  <td><em></em> </td>
98                </tr>
99              </thead>
100            <tbody class="unmod">
101                  <tr>
102                          <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>
103                  </tr><tr>
104                          <th>19</th><th>19</th><td class="l"><span>//{{{</span> </td>
105                  </tr><tr>
106                          <th>20</th><th>20</th><td class="l"><span>if (!version.extensions.HTTPSavingPlugin) { //# ensure that the plugin is only installed once</span> </td>
107                  </tr>
108            </tbody><tbody class="add">
109                  <tr class="first">
110                          <th> </th><th>21</th><td class="r"><ins></ins> </td>
111                  </tr><tr>
112                          <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>
113                  </tr><tr>
114                          <th> </th><th>23</th><td class="r"><ins>function httpReq(type,url,callback,params,headers,data,contentType,username,password,allowCache)</ins> </td>
115                  </tr><tr>
116                          <th> </th><th>24</th><td class="r"><ins>{</ins> </td>
117                  </tr><tr>
118                          <th> </th><th>25</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; var options = {</ins> </td>
119                  </tr><tr>
120                          <th> </th><th>26</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type:type,</ins> </td>
121                  </tr><tr>
122                          <th> </th><th>27</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url:url,</ins> </td>
123                  </tr><tr>
124                          <th> </th><th>28</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processData:false,</ins> </td>
125                  </tr><tr>
126                          <th> </th><th>29</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data:data,</ins> </td>
127                  </tr><tr>
128                          <th> </th><th>30</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cache:!!allowCache,</ins> </td>
129                  </tr><tr>
130                          <th> </th><th>31</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beforeSend: function(xhr) {</ins> </td>
131                  </tr><tr>
132                          <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>
133                  </tr><tr>
134                          <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>
135                  </tr><tr>
136                          <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>
137                  </tr><tr>
138                          <th> </th><th>35</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</ins> </td>
139                  </tr><tr>
140                          <th> </th><th>36</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; };</ins> </td>
141                  </tr><tr>
142                          <th> </th><th>37</th><td class="r"><ins></ins> </td>
143                  </tr><tr>
144                          <th> </th><th>38</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(callback) {</ins> </td>
145                  </tr><tr>
146                          <th> </th><th>39</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.complete = function(xhr,textStatus) {</ins> </td>
147                  </tr><tr>
148                          <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>
149                  </tr><tr>
150                          <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>
151                  </tr><tr>
152                          <th> </th><th>42</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</ins> </td>
153                  </tr><tr>
154                          <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>
155                  </tr><tr>
156                          <th> </th><th>44</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</ins> </td>
157                  </tr><tr>
158                          <th> </th><th>45</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; }</ins> </td>
159                  </tr><tr>
160                          <th> </th><th>46</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(contentType)</ins> </td>
161                  </tr><tr>
162                          <th> </th><th>47</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.contentType = contentType;</ins> </td>
163                  </tr><tr>
164                          <th> </th><th>48</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(username)</ins> </td>
165                  </tr><tr>
166                          <th> </th><th>49</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.username = username;</ins> </td>
167                  </tr><tr>
168                          <th> </th><th>50</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; if(password)</ins> </td>
169                  </tr><tr>
170                          <th> </th><th>51</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; options.password = password;</ins> </td>
171                  </tr><tr>
172                          <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>
173                  </tr><tr>
174                          <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>
175                  </tr><tr>
176                          <th> </th><th>54</th><td class="r"><ins>&nbsp; &nbsp; &nbsp; &nbsp; return jQuery.ajax(options);</ins> </td>
177                  </tr><tr>
178                          <th> </th><th>55</th><td class="r"><ins>}</ins> </td>
179                  </tr><tr class="last">
180                          <th> </th><th>56</th><td class="r"><ins></ins> </td>
181                  </tr>
182            </tbody><tbody class="unmod">
183                  <tr>
184                          <th>21</th><th>57</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; version.extensions.HTTPSavingPlugin = { installed: true };</span> </td>
185                  </tr><tr>
186                          <th>22</th><th>58</th><td class="l"><span></span> </td>
187                  </tr><tr>
188                          <th>23</th><th>59</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; (function () { //# wrapper</span> </td>
189                  </tr>
190            </tbody>
191              <tbody class="skipped">
192                <tr>
193                  <th><a href="#L129">…</a></th>
194                  <th><a href="#L165">…</a></th>
195                  <td><em></em> </td>
196                </tr>
197              </tbody>
198            <tbody class="unmod">
199                  <tr>
200                          <th>129</th><th>165</th><td class="l"><span></span> </td>
201                  </tr><tr>
202                          <th>130</th><th>166</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; })(); //# end of wrapper</span> </td>
203                  </tr><tr>
204                          <th>131</th><th>167</th><td class="l"><span>} //# end of "install only once"</span> </td>
205                  </tr>
206            </tbody><tbody class="mod">
207                      <tr class="first">
208                        <th>132</th><th> </th><td class="l"><span>//}}}</span> </td>
209                      </tr>
210                      <tr>
211                        <th> </th><th>168</th><td class="r"><span>//}}}</span> </td>
212                      </tr><tr class="last">
213                        <th> </th><th>169</th><td class="r"><span><em>&nbsp;No newline at end of file</em></span> </td>
214                      </tr>
215            </tbody>
216        </table>
217      </li>
218  </ul>
219</div>
220
221        </div>
222    </div>
223    <div id="altlinks">
224      <h3>Download in other formats:</h3>
225      <ul>
226        <li class="last first">
227          <a rel="nofollow" href="/trac/tiddly_on_tahoe/raw-attachment/ticket/11/HTTPSavingPlugin.js.diff">Original Format</a>
228        </li>
229      </ul>
230    </div>
231    </div>
232    <div id="footer" lang="en" xml:lang="en"><hr />
233      <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>
234      <p class="left">Powered by <a href="/trac/tiddly_on_tahoe/about"><strong>Trac 0.12.1dev-r9947</strong></a><br />
235        By <a href="http://www.edgewall.org/">Edgewall Software</a>.</p>
236      <p class="right">Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a></p>
237    </div>
238  </body>
239</html>