Opened 10 years ago

Last modified 22 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.1.1
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 (7)

comment:1 Changed 10 years ago by amain

  • Version changed from other (please specify) to 1.3.6

comment:2 Changed 9 years ago by amain

A response is appreciated.

comment:3 Changed 7 years 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

comment:4 Changed 6 years ago by Cas

  • Milestone changed from 2.0 to 2.0.0

Milestone renamed

comment:5 Changed 5 years ago by Cas

  • Milestone changed from 2.0.0 to 2.1.x

Ticket retargeted after milestone closed

comment:6 Changed 2 years ago by Cas

  • Milestone changed from 2.1.x to 2.1.0

Milestone renamed

comment:7 Changed 22 months ago by Cas

  • Milestone changed from 2.1.0 to 2.1.1

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.