Module: deluge
Branch: 1.3-stable
Commit: 2e62140d2cd7a0c59b6429a71b0be26a135a9e8e

Author: Damien Churchill <dam...@gmail.com>
Date:   Fri May  6 22:08:59 2011 +0100

fix issue #1567, js from plugins not working with different base setting

---

 deluge/ui/web/js/deluge-all/UI.js |   18 +++++++++---------
 deluge/ui/web/pluginmanager.py    |   34 +++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/deluge/ui/web/js/deluge-all/UI.js 
b/deluge/ui/web/js/deluge-all/UI.js
index d0df84e..5c64a26 100644
--- a/deluge/ui/web/js/deluge-all/UI.js
+++ b/deluge/ui/web/js/deluge-all/UI.js
@@ -1,6 +1,6 @@
 /*!
  * Deluge.UI.js
- * 
+ *
  * Copyright (c) Damien Churchill 2009-2010 <dam...@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -74,7 +74,7 @@ deluge.ui = {
                        layout: 'fit',
                        items: [this.MainPanel]
                });
-       
+
                deluge.events.on("connect", this.onConnect, this);
                deluge.events.on("disconnect", this.onDisconnect, this);
                deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, 
this);
@@ -82,7 +82,7 @@ deluge.ui = {
                deluge.client = new Ext.ux.util.RpcClient({
                        url: deluge.config.base + 'json'
                });
-       
+
                // enable all the already active plugins
                for (var plugin in Deluge.pluginStore) {
                        plugin = Deluge.createPlugin(plugin);
@@ -92,11 +92,11 @@ deluge.ui = {
 
                // Initialize quicktips so all the tooltip configs start 
working.
                Ext.QuickTips.init();
-       
+
                deluge.client.on('connected', function(e) {
                        deluge.login.show();
                }, this, {single: true});
-       
+
                this.update = this.update.createDelegate(this);
                this.checkConnection = 
this.checkConnection.createDelegate(this);
 
@@ -125,7 +125,7 @@ deluge.ui = {
        },
 
        onConnectionError: function(error) {
-               
+
        },
 
        onConnectionSuccess: function(result) {
@@ -168,8 +168,8 @@ deluge.ui = {
                }
 
                if (deluge.config.show_session_speed) {
-                       document.title = this.originalTitle + 
-                               ' (Down: ' + 
fspeed(data['stats'].download_rate, true) + 
+                       document.title = this.originalTitle +
+                               ' (Down: ' + 
fspeed(data['stats'].download_rate, true) +
                                ' Up: ' + fspeed(data['stats'].upload_rate, 
true) + ')';
                }
                if (Ext.areObjectsEqual(this.filters, this.oldFilters)) {
@@ -231,7 +231,7 @@ deluge.ui = {
                var scripts = (Deluge.debug) ? resources.debug_scripts : 
resources.scripts;
                Ext.each(scripts, function(script) {
                        Ext.ux.JSLoader({
-                               url: script,
+                               url: deluge.config.base + script,
                                onLoad: this.onPluginLoaded,
                                pluginName: resources.name
                        });
diff --git a/deluge/ui/web/pluginmanager.py b/deluge/ui/web/pluginmanager.py
index d247e07..c2ed75e 100644
--- a/deluge/ui/web/pluginmanager.py
+++ b/deluge/ui/web/pluginmanager.py
@@ -58,26 +58,26 @@ def gather_info(plugin):
         "debug_scripts": debug_scripts,
         "script_directories": directories
     }
-    
+
 class PluginManager(PluginManagerBase, component.Component):
     def __init__(self):
         component.Component.__init__(self, "Web.PluginManager")
         self.config = ConfigManager("web.conf")
         PluginManagerBase.__init__(self, "web.conf", "deluge.plugin.web")
-        
+
         client.register_event_handler("PluginEnabledEvent", 
self._on_plugin_enabled_event)
         client.register_event_handler("PluginDisabledEvent", 
self._on_plugin_disabled_event)
-    
+
     def _on_get_enabled_plugins(self, plugins):
         for plugin in plugins:
             self.enable_plugin(plugin)
-    
+
     def _on_plugin_enabled_event(self, name):
         self.enable_plugin(name)
 
     def _on_plugin_disabled_event(self, name):
         self.disable_plugin(name)
-    
+
     def disable_plugin(self, name):
         # Get the plugin instance
         try:
@@ -85,31 +85,31 @@ class PluginManager(PluginManagerBase, component.Component):
         except KeyError:
             log.info("Plugin has no web ui")
             return
-        
+
         info = gather_info(plugin)
 
         scripts = component.get("Scripts")
         for script in info["scripts"]:
             scripts.remove_script("%s/%s" % (name.lower(), 
os.path.basename(script).lower()))
-        
+
         for script in info["debug_scripts"]:
             scripts.remove_script("%s/%s" % (name.lower(), 
os.path.basename(script).lower()), "debug")
             scripts.remove_script("%s/%s" % (name.lower(), 
os.path.basename(script).lower()), "dev")
-        
+
         super(PluginManager, self).disable_plugin(name)
-    
+
     def enable_plugin(self, name):
         super(PluginManager, self).enable_plugin(name)
-        
+
         # Get the plugin instance
         try:
             plugin = component.get("WebPlugin." + name)
         except KeyError:
             log.info("Plugin has no web ui")
             return
-        
+
         info = gather_info(plugin)
-        
+
         scripts = component.get("Scripts")
         for script in info["scripts"]:
             log.debug("adding script %s for %s", name, 
os.path.basename(script))
@@ -127,16 +127,16 @@ class PluginManager(PluginManagerBase, 
component.Component):
         # Update the enabled plugins from the core
         d = client.core.get_enabled_plugins()
         d.addCallback(self._on_get_enabled_plugins)
-    
+
     def stop(self):
         """
         Stop the plugin manager
         """
         self.disable_plugins()
-    
+
     def update(self):
         pass
-    
+
     def get_plugin_resources(self, name):
         # Get the plugin instance
         try:
@@ -146,7 +146,7 @@ class PluginManager(PluginManagerBase, component.Component):
             return
         info = gather_info(plugin)
         info["name"] = name
-        info["scripts"] = ["/js/%s/%s" % (name.lower(), os.path.basename(s)) 
for s in info["scripts"]]
-        info["debug_scripts"] = ["/js/%s/%s" % (name.lower(), 
os.path.basename(s)) for s in info["debug_scripts"]]
+        info["scripts"] = ["js/%s/%s" % (name.lower(), os.path.basename(s)) 
for s in info["scripts"]]
+        info["debug_scripts"] = ["js/%s/%s" % (name.lower(), 
os.path.basename(s)) for s in info["debug_scripts"]]
         del info["script_directories"]
         return info

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to deluge-commit@googlegroups.com.
To unsubscribe from this group, send email to 
deluge-commit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to