Ticket #1195 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

Allow to specify an external url to load a plugin from

Reported by: guest Owned by:
Priority: normal Milestone: 0.95
Component: Plugins Version: trunk
Severity: normal Keywords:
Cc: xinha.trac@…

Description

I want to include a plugin that is not in the editor url, but elsewhere on the server. Is it possible to specify the URL for certain plugins?

Change History

Changed 5 years ago by guest

plugin:// would need to be updated to handle this.

Changed 5 years ago by ray

  • summary changed from External plugins are difficult to include to Allow to specify an external url to load a plugin from
  • milestone changed from 0.96 to 0.95

Changed 5 years ago by ray

  • status changed from new to closed
  • resolution set to fixed

rev [999]: if you are using Xinha.loadPlugins() and the xinha_plugins array (NewbieGuide style) you can now instead of just the plugin name an object containing the name and a url for the plugin, like:

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
   'CharacterMap', //loads from _edito_url/plugins/CharacterMap/character-map.js
   {plugin:'AnotherPlugin',url:'/XinhaExternalPlugins/AnotherPlugin/AnotherPlugin.js'} // loads from the given path
  ]

Inside the plugin you can refer to the given path for loading additional assets using Xinha.getPluginDir(pluginName)

Xinha.getPluginDir('AnotherPlugin') + '/img/icon.gif'; // would resolve to /XinhaExternalPlugins/AnotherPlugin/img/icon.gif
Note: See TracTickets for help on using tickets.