Opened 8 years ago

Closed 8 years ago

#1300 closed enhancement (fixed)

create namespace for plugins within Xinha namespace

Reported by: ray Owned by: gogo
Priority: normal Milestone: 0.96
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

currently all plugins are simple functions, i.e. they are in the global (window) scope. This bad style as it requires deployers to take care not to have functions by the same name.

I propose creating a dedicated namespace Xinha.plugins. Plugins should then be written using this pattern

//wrap in a function that is executed immediately to encapsulate variables
(function(){
  Xinha.plugins.PluginName = PluginName; //connect to the plugins namespace
  function PluginName(editor)
  {
    //proceed normally
  }
})()

Change History (1)

comment:1 Changed 8 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed

rev [1079]

Note: See TracTickets for help on using tickets.