|
|
|
@ -27,132 +27,144 @@
|
|
|
|
|
<span class='line'> 20</span> The Free Software Foundation, Inc.,
|
|
|
|
|
<span class='line'> 21</span> 51 Franklin Street, Fifth Floor
|
|
|
|
|
<span class='line'> 22</span> Boston, MA 02110-1301, USA.
|
|
|
|
|
<span class='line'> 23</span> #
|
|
|
|
|
<span class='line'> 24</span> # In addition, as a special exception, the copyright holders give
|
|
|
|
|
<span class='line'> 25</span> # permission to link the code of portions of this program with the OpenSSL
|
|
|
|
|
<span class='line'> 26</span> # library.
|
|
|
|
|
<span class='line'> 27</span> # You must obey the GNU General Public License in all respects for all of
|
|
|
|
|
<span class='line'> 28</span> # the code used other than OpenSSL. If you modify file(s) with this
|
|
|
|
|
<span class='line'> 29</span> # exception, you may extend this exception to your version of the file(s),
|
|
|
|
|
<span class='line'> 30</span> # but you are not obligated to do so. If you do not wish to do so, delete
|
|
|
|
|
<span class='line'> 31</span> # this exception statement from your version. If you delete this exception
|
|
|
|
|
<span class='line'> 32</span> # statement from all source files in the program, then also delete it here.
|
|
|
|
|
<span class='line'> 33</span> #
|
|
|
|
|
<span class='line'> 34</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 35</span>
|
|
|
|
|
<span class='line'> 36</span> </span><span class="NAME">Deluge.UI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 37</span>
|
|
|
|
|
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">cookies</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.state.CookieProvider</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 39</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 40</span> </span><span class="NAME">errorCount</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 41</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 42</span> </span><span class="NAME">initialize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">Ext.state.Manager.setProvider</span><span class="PUNC">(</span><span class="NAME">this.cookies</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 44</span> </span><span class="NAME">this.MainPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Panel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'mainPanel'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-main-panel'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Deluge'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'border'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">tbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Deluge.Toolbar</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Details</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Deluge.Statusbar</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 57</span>
|
|
|
|
|
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">this.Viewport</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Viewport</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.MainPanel</span><span class="PUNC">]</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 62</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 63</span> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">"connect"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onConnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">"disconnect"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onDisconnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.ux.util.RpcClient</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/json'</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.on</span><span class="PUNC">(</span><span class="STRN">'connected'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Login.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.update.bind</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 73</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 74</span> </span><span class="NAME">update</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">filters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar.getFilters</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.update_ui</span><span class="PUNC">(</span><span class="NAME">Deluge.Keys.Grid</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filters</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUpdate</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">failure</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUpdateError</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 23</span>
|
|
|
|
|
<span class='line'> 24</span> In addition, as a special exception, the copyright holders give
|
|
|
|
|
<span class='line'> 25</span> permission to link the code of portions of this program with the OpenSSL
|
|
|
|
|
<span class='line'> 26</span> library.
|
|
|
|
|
<span class='line'> 27</span> You must obey the GNU General Public License in all respects for all of
|
|
|
|
|
<span class='line'> 28</span> the code used other than OpenSSL. If you modify file(s) with this
|
|
|
|
|
<span class='line'> 29</span> exception, you may extend this exception to your version of the file(s),
|
|
|
|
|
<span class='line'> 30</span> but you are not obligated to do so. If you do not wish to do so, delete
|
|
|
|
|
<span class='line'> 31</span> this exception statement from your version. If you delete this exception
|
|
|
|
|
<span class='line'> 32</span> statement from all source files in the program, then also delete it here.
|
|
|
|
|
<span class='line'> 33</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 34</span>
|
|
|
|
|
<span class='line'> 35</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'> 36</span> * @namespace Deluge
|
|
|
|
|
<span class='line'> 37</span> * @static
|
|
|
|
|
<span class='line'> 38</span> * @class Deluge.UI
|
|
|
|
|
<span class='line'> 39</span> * The controller for the whole interface, that ties all the components
|
|
|
|
|
<span class='line'> 40</span> * together and handles the 2 second poll.
|
|
|
|
|
<span class='line'> 41</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 42</span> </span><span class="NAME">Deluge.UI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 43</span>
|
|
|
|
|
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">cookies</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.state.CookieProvider</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 45</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 46</span> </span><span class="NAME">errorCount</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 47</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 48</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'> 49</span> * @description Create all the interface components, the json-rpc client
|
|
|
|
|
<span class='line'> 50</span> * and set up various events that the UI will utilise.
|
|
|
|
|
<span class='line'> 51</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">initialize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">Ext.state.Manager.setProvider</span><span class="PUNC">(</span><span class="NAME">this.cookies</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 54</span> </span><span class="NAME">this.MainPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Panel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'mainPanel'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-main-panel'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Deluge'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'border'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">tbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Deluge.Toolbar</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Details</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Deluge.Statusbar</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 67</span>
|
|
|
|
|
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">this.Viewport</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Viewport</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.MainPanel</span><span class="PUNC">]</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 72</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 73</span> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">"connect"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onConnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">"disconnect"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onDisconnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.ux.util.RpcClient</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/json'</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.on</span><span class="PUNC">(</span><span class="STRN">'connected'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Login.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Details.update</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connected</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onConnectedCheck</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 87</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 88</span> </span><span class="NAME">onConnectedCheck</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 93</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 94</span> </span><span class="NAME">onUpdateError</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.errorCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Lost Connection'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'The connection to the webserver has been lost!'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="WHIT">
|
|
|
|
|
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">this.errorCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>105</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>106</span> </span><span class="NAME">onUpdate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'torrents'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Statusbar.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'stats'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'filters'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">this.errorCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>112</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>113</span> </span><span class="COMM">/*
|
|
|
|
|
<span class='line'>114</span> Property: run
|
|
|
|
|
<span class='line'>115</span> Start the Deluge UI polling the server to get the updated torrent
|
|
|
|
|
<span class='line'>116</span> information.
|
|
|
|
|
<span class='line'>117</span>
|
|
|
|
|
<span class='line'>118</span> Example:
|
|
|
|
|
<span class='line'>119</span> Deluge.UI.onConnect();
|
|
|
|
|
<span class='line'>120</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">onConnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">setInterval</span><span class="PUNC">(</span><span class="NAME">this.update</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2000</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.update.bind</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 83</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 84</span> </span><span class="NAME">update</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">filters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar.getFilters</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.update_ui</span><span class="PUNC">(</span><span class="NAME">Deluge.Keys.Grid</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">filters</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUpdate</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">failure</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUpdateError</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Details.update</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connected</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onConnectedCheck</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 97</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'> 98</span> </span><span class="NAME">onConnectedCheck</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>103</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>104</span> </span><span class="NAME">onUpdateError</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.errorCount</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Lost Connection'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'The connection to the webserver has been lost!'</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="WHIT">
|
|
|
|
|
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">this.errorCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>115</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>116</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'>117</span> * @static
|
|
|
|
|
<span class='line'>118</span> * @private
|
|
|
|
|
<span class='line'>119</span> * Updates the various components in the interface.
|
|
|
|
|
<span class='line'>120</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">onUpdate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'torrents'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Statusbar.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'stats'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Sidebar.update</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="STRN">'filters'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">this.errorCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>127</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>128</span> </span><span class="NAME">onDisconnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">this.stop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>131</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>132</span> </span><span class="COMM">/*
|
|
|
|
|
<span class='line'>133</span> Property: stop
|
|
|
|
|
<span class='line'>134</span> Stop the Deluge UI polling the server to get the updated torrent
|
|
|
|
|
<span class='line'>135</span> information.
|
|
|
|
|
<span class='line'>136</span>
|
|
|
|
|
<span class='line'>137</span> Example:
|
|
|
|
|
<span class='line'>138</span> Deluge.UI.stop();
|
|
|
|
|
<span class='line'>139</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">stop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">loadData</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>147</span> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>148</span>
|
|
|
|
|
<span class='line'>149</span> </span><span class="NAME">Ext.onReady</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.UI.initialize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>151</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
|
|
|
|
<span class='line'>128</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'>129</span> * @static
|
|
|
|
|
<span class='line'>130</span> * @private
|
|
|
|
|
<span class='line'>131</span> * Start the Deluge UI polling the server and update the interface.
|
|
|
|
|
<span class='line'>132</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">onConnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">setInterval</span><span class="PUNC">(</span><span class="NAME">this.update</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2000</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>139</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>140</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'>141</span> * @static
|
|
|
|
|
<span class='line'>142</span> * @private
|
|
|
|
|
<span class='line'>143</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">onDisconnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">this.stop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
|
|
|
|
<span class='line'>147</span> </span><span class="WHIT">
|
|
|
|
|
<span class='line'>148</span> </span><span class="COMM">/**
|
|
|
|
|
<span class='line'>149</span> * @static
|
|
|
|
|
<span class='line'>150</span> * Stop the Deluge UI polling the server and clear the interface.
|
|
|
|
|
<span class='line'>151</span> */</span><span class="WHIT">
|
|
|
|
|
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="NAME">stop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Torrents.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">loadData</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>159</span> </span><span class="PUNC">}</span><span class="WHIT">
|
|
|
|
|
<span class='line'>160</span>
|
|
|
|
|
<span class='line'>161</span> </span><span class="NAME">Ext.onReady</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
|
|
|
|
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.UI.initialize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
|
|
|
|
<span class='line'>163</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|