Changeset f8c266 in indico
- Timestamp:
- 04/26/12 18:01:11 (13 months ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- ec666e
- Parents:
- 2d1b8e
- git-author:
- Pedro Ferreira <jose.pedro.ferreira@…> (04/24/12 17:49:54)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (04/26/12 18:01:11)
- Files:
-
- 1 added
- 6 deleted
- 10 edited
-
etc/js/indico.cfg (deleted)
-
etc/js/instantmessaging.cfg (deleted)
-
etc/js/jquery.cfg (deleted)
-
etc/js/jsbuild.sh (deleted)
-
etc/js/livesync.cfg (deleted)
-
etc/js/presentation.cfg (deleted)
-
indico/MaKaC/consoleScripts/installBase.py (modified) (1 diff)
-
indico/MaKaC/plugins/InstantMessaging/pages.py (modified) (2 diffs)
-
indico/MaKaC/plugins/InstantMessaging/rh.py (modified) (1 diff)
-
indico/MaKaC/webinterface/pages/base.py (modified) (3 diffs)
-
indico/MaKaC/webinterface/tpls/HTMLHeader.tpl (modified) (2 diffs)
-
indico/MaKaC/webinterface/wcomponents.py (modified) (4 diffs)
-
indico/ext/livesync/chrome.py (modified) (2 diffs)
-
indico/ext/statistics/chrome.py (modified) (1 diff)
-
indico/web/assets.py (added)
-
requirements.txt (modified) (2 diffs)
-
setup.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/consoleScripts/installBase.py
r05686c rf8c266 203 203 204 204 205 def jsCompress():206 '''Packs and minifies javascript files'''207 208 try:209 pkg_resources.require('JSTools')210 except pkg_resources.DistributionNotFound:211 print """212 JSTools not found! JSTools is needed for JavaScript compression, if you're building Indico from source. Please install it.213 i.e. try 'easy_install jstools'"""214 sys.exit(-1)215 216 jsbuildPath = 'jsbuild'217 os.chdir('./etc/js')218 os.system('%s -o ../../indico/htdocs/js/jquery/pack jquery.cfg' % jsbuildPath)219 os.system('%s -o ../../indico/htdocs/js/indico/pack indico.cfg' % jsbuildPath)220 os.system('%s -o ../../indico/htdocs/js/presentation/pack presentation.cfg' % jsbuildPath )221 os.system('%s -o ../../indico/MaKaC/plugins/InstantMessaging/htdocs/js instantmessaging.cfg ' % jsbuildPath )222 os.system('%s -o ../../indico/ext/livesync/htdocs/js livesync.cfg' % jsbuildPath )223 os.chdir('../..')224 225 226 205 def _checkModPythonIsInstalled(): 227 206 pass -
indico/MaKaC/plugins/InstantMessaging/pages.py
re10646 rf8c266 20 20 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 21 21 22 import os 23 from webassets import Bundle, Environment 22 24 from MaKaC.webinterface.pages.conferences import WPConferenceModifBase, WPConferenceDefaultDisplayBase 23 25 from MaKaC.webinterface import wcomponents … … 50 52 self._tabCtrl = wcomponents.TabControl() 51 53 52 #TODO: with wsgi we want to specify another path instead of the usual one for .js files, so we'll have to make some modifications 53 #to make possible specifying absoulte paths 54 def getJSFiles(self): 55 return WPConferenceModifBase.getJSFiles(self) + self._includeJSPackage('Plugins') 54 plugin_htdocs = os.path.join(os.path.dirname(__file__), 'htdocs') 55 56 self._plugin_asset_env = Environment(plugin_htdocs, '/InstantMessaging') 57 self._plugin_asset_env.register('instant_messaging', Bundle('js/InstantMessaging.js', 58 filters='jsmin', 59 output="InstantMessaging_%(version)s.min.js")) 56 60 57 61 def getJSFiles(self): 58 62 return WPConferenceModifBase.getJSFiles(self) + \ 59 self._ includeJSFile('InstantMessaging/js', 'InstantMessaging')63 self._plugin_asset_env['instant_messaging'].urls() 60 64 61 65 def getCSSFiles(self): -
indico/MaKaC/plugins/InstantMessaging/rh.py
re10646 rf8c266 35 35 from indico.web.legacy import wrapUH 36 36 from indico.web.rh import RHHtdocs 37 37 38 38 39 class RHInstantMessagingHtdocs(RHHtdocs): -
indico/MaKaC/webinterface/pages/base.py
r880ea8 rf8c266 18 18 ## along with CDS Indico; if not, write to the Free Software Foundation, Inc., 19 19 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 20 21 from webassets import Environment 22 from indico.web import assets 20 23 21 24 import MaKaC.webinterface.wcomponents as wcomponents … … 40 43 41 44 def __init__( self, rh ): 45 config = Config.getInstance() 42 46 self._rh = rh 43 47 self._locTZ = "" 48 info = HelperMaKaCInfo.getMaKaCInfoInstance() 49 50 self._asset_env = Environment(config.getHtdocsDir(), '/') 51 self._asset_env.debug = info.isDebugActive() 52 53 # register existing assets 54 assets.register_all_js(self._asset_env) 44 55 45 56 #store page specific CSS and JS 46 57 self._extraCSS = [] 47 58 self._extraJS = [] 48 49 def _includeJSPackage(self, packageName, module = 'indico', path=None):50 info = HelperMaKaCInfo().getMaKaCInfoInstance()51 52 timestamp = os.stat(__file__).st_mtime53 54 if info.isDebugActive():55 return ['js/%s/%s/Loader.js?%d' % (module, packageName, timestamp)]56 else:57 return ['js/%s/pack/%s.js.pack?%d' % (module, packageName, timestamp)]58 59 def _includeJQuery(self):60 # TODO: rename this to _includeJSLibs or something similar61 info = HelperMaKaCInfo().getMaKaCInfoInstance()62 63 timestamp = os.stat(__file__).st_mtime64 65 files = ['underscore', 'jquery', 'jquery-ui', 'jquery.form', 'jquery.custom',66 'jquery.daterange', 'jquery.qtip', 'jquery.dttbutton', 'jquery.colorbox',67 'jquery.menu', 'date', 'jquery.multiselect']68 if info.isDebugActive():69 # We can't use Loader.js as jQuery is included before any indico js70 return ['js/jquery/%s.js?%d' % (f, timestamp) for f in files]71 else:72 return ['js/jquery/pack/jquery.js.pack?%d' % timestamp]73 74 def _includeJSFile(self, path, filename):75 info = HelperMaKaCInfo().getMaKaCInfoInstance()76 77 timestamp = os.stat(__file__).st_mtime78 79 if info.isDebugActive():80 return ['%s/%s.js?%d' % (path, filename, timestamp)]81 else:82 return ['%s/%s.js.pack?%d' % (path, filename, timestamp)]83 84 def _includePresentationFiles(self):85 info = HelperMaKaCInfo().getMaKaCInfoInstance()86 87 timestamp = os.stat(__file__).st_mtime88 89 if info.isDebugActive():90 return ['%s?%d' % (f, timestamp) for f in ['js/presentation/Loader.js', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']]91 else:92 return ['%s?%d' % (f, timestamp) for f in ['js/presentation/pack/Presentation.js.pack', 'js/indico/jquery/defaults.js', 'js/indico/jquery/global.js']]93 59 94 60 def _getBaseURL( self ): … … 108 74 return [] 109 75 110 def getJSFiles(self):111 return self._includeJQuery() + \112 self._includePresentationFiles() + \113 self._includeJSPackage('Core') + \114 self._includeJSPackage('Legacy') + \115 self._includeJSPackage('Common')116 117 76 def _getJavaScriptInclude(self, scriptPath): 118 77 return '<script src="'+ scriptPath +'" type="text/javascript"></script>\n' 78 79 def getJSFiles(self): 80 return self._asset_env['base_js'].urls() 81 82 def _includeJSPackage(self, pkg_name): 83 return self._asset_env['indico_' + pkg_name.lower()].urls() 119 84 120 85 def _getJavaScriptUserData(self): -
indico/MaKaC/webinterface/tpls/HTMLHeader.tpl
rf56594 rf8c266 7 7 8 8 <link rel="shortcut icon" type="image/x-icon" href="${ systemIcon('addressBarIcon') }"> 9 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/calendar-blue.css?${ timestamp }" >10 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/jquery-ui.css?${ timestamp }">11 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/jquery.qtip.css?${ timestamp }">12 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/jquery.colorbox.css?${ timestamp }">13 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/jquery-ui-custom.css?${ timestamp }">14 9 15 <link rel="stylesheet" type="text/css" href="${ baseurl }/css/${ stylesheet }?${ timestamp }"> 10 % for stylesheet in stylesheets: 11 <link rel="stylesheet" type="text/css" href="${ baseurl + '/' + stylesheet }"> 12 % endfor 16 13 17 14 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> … … 35 32 <!-- Page Specific JS files--> 36 33 % for JSFile in extraJSFiles: 37 ${ page._getJavaScriptInclude(baseurl + '/' +JSFile) }34 ${ page._getJavaScriptInclude(baseurl + JSFile) } 38 35 % endfor 39 36 -
indico/MaKaC/webinterface/wcomponents.py
raf8270 rf8c266 19 19 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 20 20 21 from webassets import Environment 22 from indico.web import assets 23 21 24 from MaKaC.plugins import PluginsHolder, OldObservable 22 25 … … 60 63 from MaKaC.common.ContextHelp import ContextHelp 61 64 from MaKaC.rb_tools import FormMode, overlap 65 from MaKaC.common.info import HelperMaKaCInfo 62 66 63 67 from lxml import etree … … 110 114 111 115 cfg = Configuration.Config.getInstance() 116 info = HelperMaKaCInfo.getMaKaCInfoInstance() 117 112 118 self._dir = cfg.getTPLDir() 119 self._asset_env = Environment(os.path.join(cfg.getHtdocsDir(), 'css'), 'css/') 120 self._asset_env.debug = info.isDebugActive() 121 122 if DBMgr.getInstance().isConnected(): 123 css_file = cfg.getCssStylesheetName() 124 else: 125 css_file = 'Default.css' 126 127 assets.register_all_css(self._asset_env, css_file) 113 128 114 129 def _getSpecificTPL(self, dir, tplId, extension="tpl"): … … 256 271 return text 257 272 273 258 274 class WHTMLHeader(WTemplated): 259 275 260 261 262 def __init__(self, tpl_name = None): 276 def __init__(self, tpl_name=None): 263 277 WTemplated.__init__(self) 264 278 265 def getVars( self):266 vars = WTemplated.getVars( self)279 def getVars(self): 280 tvars = WTemplated.getVars(self) 267 281 minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 268 vars["analyticsActive"] = minfo.isAnalyticsActive() 269 vars["analyticsCode"] = minfo.getAnalyticsCode() 270 vars["analyticsCodeLocation"] = minfo.getAnalyticsCodeLocation() 271 272 273 if DBMgr.getInstance().isConnected(): 274 vars['stylesheet'] = Config.getInstance().getCssStylesheetName() 275 else: 276 vars['stylesheet'] = 'Default.css' 277 vars['timestamp'] = "%d"%os.stat(__file__).st_mtime 278 return vars 282 tvars["analyticsActive"] = minfo.isAnalyticsActive() 283 tvars["analyticsCode"] = minfo.getAnalyticsCode() 284 tvars["analyticsCodeLocation"] = minfo.getAnalyticsCodeLocation() 285 tvars['timestamp'] = "%d" % os.stat(__file__).st_mtime 286 tvars['stylesheets'] = self._asset_env['base_css'].urls() 287 return tvars 279 288 280 289 -
indico/ext/livesync/chrome.py
r9264b3 rf8c266 28 28 # 3rd party lib imports 29 29 import zope.interface 30 from webassets import Bundle, Environment 30 31 31 32 # plugin imports … … 134 135 self._templateClass = templateClass 135 136 137 self._plugin_asset_env = Environment(RHLiveSyncHtdocs._local_path, '/livesync') 138 self._plugin_asset_env.register('livesync', Bundle('js/livesync.js', 139 filters='jsmin', 140 output="InstantMessaging__%(version)s.min.js")) 141 136 142 def getJSFiles(self): 137 143 return WPAdminPlugins.getJSFiles(self) + \ 138 self._ includeJSFile('livesync/js', 'livesync')144 self._plugin_asset_env['livesync'].urls() 139 145 140 146 def getCSSFiles(self): -
indico/ext/statistics/chrome.py
rbe54ff6 rf8c266 171 171 172 172 def __init__(self, rh, templateClass, activeTab, params): 173 WPConferenceModifBase.__init__(self, rh, rh._conf) 173 174 self._rh = rh 174 175 self._conf = self._rh._conf -
requirements.txt
rae7546 rf8c266 3 3 wsgiref 4 4 Babel 5 JSTools6 5 Mako 7 6 MarkupSafe … … 29 28 py 30 29 pytest 30 jsmin 31 cssmin 32 webassets 33 python-cjson -
setup.py
re3e124 rf8c266 125 125 'lxml', 'cds-indico-extras', 'zc.queue', 'python-dateutil<2.0', 126 126 'pypdf', 'mako>=0.4.1', 'babel', 'icalendar>=3.0', 'pyatom', 127 'simplejson', 'python-cjson' ]127 'simplejson', 'python-cjson', 'webassets', 'jsmin', 'cssmin'] 128 128 129 129 #for Python older than 2.7 … … 143 143 144 144 return v 145 145 146 146 147 ### Commands ########################################################### … … 151 152 152 153 def run(self): 153 global x154 154 sdist.sdist.run(self) 155 156 157 class jsdist_indico:158 def jsCompress(self):159 from MaKaC.consoleScripts.installBase import jsCompress160 jsCompress()161 155 162 156 … … 164 158 class bdist_indico(bdist.bdist, jsdist_indico): 165 159 def run(self): 166 self.jsCompress()167 160 compileAllLanguages(self) 168 161 bdist.bdist.run(self) … … 175 168 class bdist_egg_indico(bdist_egg.bdist_egg, jsdist_indico): 176 169 def run(self): 177 self.jsCompress()178 170 compileAllLanguages(self) 179 171 bdist_egg.bdist_egg.run(self) … … 181 173 bdist_egg_indico.dataFiles = dataFiles 182 174 return bdist_egg_indico 183 184 185 class jsbuild(Command):186 description = "minifies and packs javascript files"187 user_options = []188 boolean_options = []189 190 def initialize_options(self):191 pass192 193 def finalize_options(self):194 pass195 196 def run(self):197 from MaKaC.consoleScripts.installBase import jsCompress198 jsCompress()199 175 200 176 … … 486 462 'bdist': _bdist_indico(dataFiles), 487 463 'bdist_egg': _bdist_egg_indico(dataFiles), 488 'jsbuild': jsbuild,489 464 'develop_config': develop_config, 490 465 'develop': develop_indico,
Note: See TracChangeset
for help on using the changeset viewer.
