Opened 4 years ago

Last modified 7 months ago

#2454 new feature-request

Plugin frame work only allows script resources, no CSS or images

Reported by: amain Owned by:
Priority: minor Milestone: 2.0
Component: Web UI Version: 1.3.6
Keywords: Cc:

Description

It is not possible, or unclear how, to register image resources within a plugin. Script resources are added by:

class WebUI(WebPluginBase?):

scripts = [get_resource("<my-js-resource>.js")]

def enable(self):

pass

def disable(self):

pass

It be great if plugins would be allowed to register image sources. Image resources can be used for example in the torrent drop-down menu. At the moment all torrent drop-down menu internal items have an nice icon associated. Items added by plugins don't.

Change History (3)

comment:1 Changed 4 years ago by amain

  • Version changed from other (please specify) to 1.3.6

comment:2 Changed 3 years ago by amain

A response is appreciated.

comment:3 Changed 7 months ago by Cas

  • Milestone changed from Future to 2.0

I've not tested this but it is possible from within a plugin WebUI class to access the existing components the same way that the scripts are added:

from deluge import component
icons = component.get('Icons')
icons.add_directory('relative/path/icondir')
css = component.get('Css')
css.add_directory('relative/path/icondir')

I'll see about getting that code added to pluginmanager

Note: See TracTickets for help on using tickets.