本文整理汇总了Python中indico.web.assets.PluginEnvironment.register方法的典型用法代码示例。如果您正苦于以下问题:Python PluginEnvironment.register方法的具体用法?Python PluginEnvironment.register怎么用?Python PluginEnvironment.register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.web.assets.PluginEnvironment
的用法示例。
在下文中一共展示了PluginEnvironment.register方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WPLiveSyncAdmin
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
class WPLiveSyncAdmin(WPAdminPlugins):
def __init__(self, rh, templateClass):
WPAdminPlugins.__init__(self, rh, 'livesync', '')
self._templateClass = templateClass
info = HelperMaKaCInfo.getMaKaCInfoInstance()
self._plugin_asset_env = PluginEnvironment('livesync', os.path.dirname(__file__), '/livesync')
self._plugin_asset_env.debug = info.isDebugActive()
self._plugin_asset_env.register('livesync_js', Bundle('js/livesync.js',
filters='rjsmin',
output="livesync__%(version)s.min.js"))
self._plugin_asset_env.register('livesync_css', Bundle('livesync.css',
filters='cssmin',
output="livesync__%(version)s.min.css"))
def getJSFiles(self):
return WPAdminPlugins.getJSFiles(self) + \
self._plugin_asset_env['livesync_js'].urls()
def getCSSFiles(self):
return WPAdminPlugins.getCSSFiles(self) + \
self._plugin_asset_env['livesync_css'].urls()
def _getPageContent(self, params):
return wcomponents.WTabControl(self._tabCtrl, self._getAW()).getHTML(
self._templateClass.forModule(
indico.ext.livesync).getHTML(params))
示例2: includeTimetableCSSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeTimetableCSSFiles(cls, obj, params={}):
"""
Includes additional Css files.
"""
asset_env = PluginEnvironment('importer', os.path.dirname(__file__), 'importer')
asset_env.register('importer_css', Bundle('css/importer.css',
filters='cssmin',
output="importer__%(version)s.min.css"))
params['paths'].extend(asset_env['importer_css'].urls())
示例3: includeMainJSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeMainJSFiles(self, obj, params={}):
"""
Includes additional javascript file.
"""
asset_env = PluginEnvironment('search', os.path.dirname(__file__), 'search')
asset_env.register('search', Bundle('js/search.js',
filters='rjsmin',
output="search__%(version)s.min.js"))
params['paths'].extend(asset_env['search'].urls())
示例4: __init__
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
class WPCollaborationBase:
def __init__(self):
info = HelperMaKaCInfo.getMaKaCInfoInstance()
self._plugin_asset_env = PluginEnvironment('Collaboration', os.path.dirname(__file__), '/Collaboration')
self._plugin_asset_env.debug = info.isDebugActive()
self._plugin_asset_env.register('collaboration', Bundle('js/Collaboration.js',
'js/bookings.js',
filters='rjsmin',
output="Collaboration_%(version)s.min.js"))
示例5: includeTimetableJSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeTimetableJSFiles(cls, obj, params={}):
"""
Includes additional javascript file.
"""
asset_env = PluginEnvironment('importer', os.path.dirname(__file__), 'importer')
asset_env.register('importer_js', Bundle('js/importer.js',
filters='rjsmin',
output="importer__%(version)s.min.js"))
params['paths'].extend(asset_env['importer_js'].urls())
示例6: WPConfModifChat
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
class WPConfModifChat(WPConferenceModifBase):
def __init__(self, rh, conf):
WPConferenceModifBase.__init__(self, rh, conf)
self._conf = conf
self._tabs = {} # list of Indico's Tab objects
self._tabNames = rh._tabs
self._activeTabName = rh._activeTabName
self._aw = rh.getAW()
self._tabCtrl = wcomponents.TabControl()
info = HelperMaKaCInfo.getMaKaCInfoInstance()
self._plugin_asset_env = PluginEnvironment('InstantMessaging', os.path.dirname(__file__), 'InstantMessaging')
self._plugin_asset_env.debug = info.isDebugActive()
self._plugin_asset_env.register('instant_messaging_js', Bundle('js/InstantMessaging.js',
filters='rjsmin',
output="InstantMessaging_%(version)s.min.js"))
self._plugin_asset_env.register('instant_messaging_css', Bundle('css/im.css',
filters='cssmin',
output="InstantMessaging_%(version)s.min.css"))
def getJSFiles(self):
return WPConferenceModifBase.getJSFiles(self) + \
self._plugin_asset_env['instant_messaging_js'].urls()
def getCSSFiles(self):
return WPConferenceModifBase.getCSSFiles(self) + \
self._plugin_asset_env['instant_messaging_css'].urls()
def _createTabCtrl(self):
for tabName in self._tabNames:
url = urlHandlers.UHConfModifChat.getURL(self._conf, tab=tabName)
self._tabs[tabName] = self._tabCtrl.newTab(tabName, tabName, url)
self._setActiveTab()
def _setActiveSideMenuItem(self):
if self._pluginsDictMenuItem.has_key('InstantMessaging'):
self._pluginsDictMenuItem['Instant Messaging'].setActive(True)
def _setActiveTab(self):
self._tabs[self._activeTabName].setActive()
def _getTitle(self):
return WPConferenceModifBase._getTitle(self) + " - " + _("Chat management")
def _getPageContent(self, params):
if len(self._tabNames) > 0:
self._createTabCtrl()
wc = WConfModifChat.forModule(InstantMessaging, self._conf,
self._activeTabName, self._tabNames, self._aw)
return wcomponents.WTabControl(self._tabCtrl, self._getAW()).getHTML(wc.getHTML({}))
else:
return _("No available plugins, or no active plugins")
示例7: includeTimetableCSSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeTimetableCSSFiles(cls, obj, params={}):
"""
Includes additional Css files.
"""
info = HelperMaKaCInfo.getMaKaCInfoInstance()
asset_env = PluginEnvironment('ictp_xlsimporter', os.path.dirname(__file__), '/ictp_xlsimporter')
asset_env.debug = info.isDebugActive()
asset_env.register('ictp_xlsimporter_css', Bundle('css/ictp_xlsimporter.css',
filters='cssmin',
output="ictp_xlsimporter__%(version)s.min.css"))
params['paths'].extend(asset_env['ictp_xlsimporter_css'].urls())
示例8: includeTimetableJSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeTimetableJSFiles(cls, obj, params={}):
"""
Includes additional javascript file.
"""
info = HelperMaKaCInfo.getMaKaCInfoInstance()
asset_env = PluginEnvironment('ictp_addons', os.path.dirname(__file__), '/ictp_addons')
asset_env.debug = info.isDebugActive()
asset_env.register('ictp_addons_js', Bundle('js/ictp_addons.js',
filters='rjsmin',
output="ictp_addons__%(version)s.min.js"))
params['paths'].extend(asset_env['ictp_addons_js'].urls())
示例9: includeMainJSFiles
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
def includeMainJSFiles(self, obj, params={}):
"""
Includes additional javascript file.
"""
info = HelperMaKaCInfo.getMaKaCInfoInstance()
asset_env = PluginEnvironment('search', os.path.dirname(__file__), '/search')
asset_env.debug = info.isDebugActive()
asset_env.register('search', Bundle('js/search.js',
filters='rjsmin',
output="search__%(version)s.min.js"))
params['paths'].extend(asset_env['search'].urls())
示例10: __init__
# 需要导入模块: from indico.web.assets import PluginEnvironment [as 别名]
# 或者: from indico.web.assets.PluginEnvironment import register [as 别名]
class WPCollaborationBase:
def __init__(self):
self._plugin_asset_env = PluginEnvironment('Collaboration', os.path.dirname(__file__), 'Collaboration')
self._plugin_asset_env.register('collaboration_js', Bundle('js/Collaboration.js', 'js/bookings.js',
filters='rjsmin',
output="Collaboration_%(version)s.min.js"))
self._plugin_asset_env.register('collaboration_css', Bundle('css/Style.css',
filters='cssmin',
output="Collaboration_%(version)s.min.css"))
def getJSFiles(self):
return self._includeJSPackage("Display") + self._plugin_asset_env['collaboration_js'].urls()
def getCSSFiles(self):
return self._plugin_asset_env['collaboration_css'].urls()