## sites/index.html <%! import os.path%> <%! from vispa import url %> <%inherit file="${os.path.join('..','base.html')}" /> <%namespace name="base" file="${os.path.join('..','base.html')}"/> <%block name="title">Vispa <%block name="favicon">"${url.static('img/ico/favicon.png')}" <%block name="meta"> <%block name="js_imports_pre"> <% jquery_scripts = ["jquery.min.js", "jquery.migrate.min.js", "mobile/jquery.mobile.min.js", "ui/jquery.ui.min.js", "ui/jquery.ui.touch-punch.min.js", "jgestures/jquery.jgestures.min.js", "hotkeys/jquery.hotkeys.min.js", "qtip/jquery.qtip.min.js", "topics/jquery.topics.min.js", "polling/jquery.polling.min.js", "shortcuts/jquery.shortcuts.min.js", "history/jquery.history.min.js", "slimscroll/jquery.slimscroll-horizontal.min.js", "slimscroll/jquery.slimscroll.min.js", "jqbrowser/jquery.jqbrowser.min.js", "logger/jquery.logger.min.js", "ludo-jquery-treetable/jquery.treeTable.js", "persist/persist-min.js", "tablesorter/jquery.tablesorter.min.js", "tablesorter/jquery.tablesorter.pager.min.js", "tablesorter/jquery.tablesorter.widgets.min.js", "tablesorter/jquery.tablesorter.jui.js", "selectBoxIt/jquery.selectBoxIt.min.js", "resizablesnap/jquery.ui.resizable.snap.ext.min.js", "isotope/jquery.isotope.min.js", "transparency/jquery.transparency.min.js"] framework_scripts = ["class/class.min.js", "json/json2.js", #"bootstrap/js/bootstrap.min.js" "three/three.min.js", "three/TinyTrackballControls.js", "ace/ace.js"] base_scripts = ["jquerymods.js", "socket.js", "bus.js", "messenger.js", "url.js", "menu.js", "helpers.js"] site_scripts = ["index.js", "view.js", "extensionview.js", "commandpalette.js", "pathbar.js", "extensionmanager.js", "workspacemanager.js", "preferencehandler.js", "preferenceview.js"] for script in jquery_scripts: base.import_js(url.static(url.join("frameworks/jquery", script))) for script in framework_scripts: base.import_js(url.static(url.join("frameworks", script))) for script in base_scripts: base.import_js(url.static(url.join("js/base", script))) for script in site_scripts: base.import_js(url.static(url.join("js/sites/index", script))) %> <%block name="js_imports_post"> <% for script in common_js: base.import_js(script) %> <%block name="css_imports"> <% base.import_css(url.static("css/base/resets.css")) jquery_scripts = ["ui/css/overcast/jquery-ui-1.10.2.custom.min.css", "ludo-jquery-treetable/css/jquery.treeTable.css", # "tablesorter/css/jquery.tablesorter.min.css", # "tablesorter/css/theme.blue.css", "tablesorter/css/theme.jui.css", "tablesorter/css/jquery.tablesorter.pager.css", "selectBoxIt/css/jquery.selectBoxIt.min.css"] framework_scripts = []#["bootstrap/css/bootstrap.min.css"] base_scripts = ["menu.css", "overlay.css", "messenger.css"] site_scripts = ["view.css", "extensionview.css", "preferenceview.css", "pathbar.css"] for script in jquery_scripts: base.import_css(url.static(url.join("frameworks/jquery", script))) for script in framework_scripts: base.import_css(url.static(url.join("frameworks", script))) for script in base_scripts: base.import_css(url.static(url.join("css/base", script))) for script in site_scripts: base.import_css(url.static(url.join("css/sites/index", script))) for script in common_css: base.import_css(script) %> <%block name="js_inline_post"> $(function() { % if logging_enabled: $.Logger().enable().level('${logging_level}'); % for elem in logging_ignore: $.Logger('${elem}').disable(); % endfor % endif // show the inner startup overlay (css transition) $('#startup-overlay-inner').toggleClass('visible'); $.ajaxSetup({ // Disable caching of AJAX responses cache: ${'false' if devmode else 'true'} }); // store template data var wsPath = $.Helpers.joinPath(location.host, '${base_dynamic}', 'bus/'); var templateData = { devMode: ${'true' if devmode else 'false'}, userName: '${username}', addWorkspaces: ${'true' if add_workspaces else 'false'}, profileId: ${profile_id}, urlHandler: { dynamicBase: '${base_dynamic}', staticBase: '${base_static}' }, bus: { address: $.Helpers.strFormat('ws{0}://{1}', '${'s' if secure_websockets else ''}', wsPath), forceFallback: ${'false' if use_websockets else 'true'}, fallbackPollUrl: $.Helpers.strFormat('{0}//{1}poll', location.protocol, wsPath), fallbackSendUrl: $.Helpers.strFormat('{0}//{1}receive', location.protocol, wsPath) } }; // store the preferences var preferences = { vispa_preference: $.parseJSON('${vispa_preference}'), extension_preference: $.parseJSON('${extension_preference}') }; // merge the templateData and preferences var config = $.extend(true, {}, templateData, preferences.vispa_preference); // prepare the workspace data var workspaceData = { connected: ${workspace_ids}, all: $.parseJSON("${workspace_data}".replace(/\'/g, '"')) }; // startup vispa with template data and preferences window.Vispa = new Vispa(config, preferences.extension_preference, workspaceData); window.Vispa.startup(); }); ## Main GUI Markup