def resources(self): for r in super(MarkdownEdit, self).resources(): yield r yield ew.JSLink('js/jquery.lightbox_me.js') yield ew.CSSLink('css/simplemde.min.css', compress=False) yield ew.CSSLink('css/markitup_sf.css') yield ew.JSLink('js/simplemde.min.js') yield ew.JSLink('js/sf_markitup.js')
def resources(self): yield ew.JSLink('tracker_js/jquery.multiselect.min.js') yield ew.CSSLink('allura/css/smoothness/jquery-ui-1.8.4.custom.css') yield ew.CSSLink('tracker_css/jquery.multiselect.css') yield ew.JSLink('tracker_js/ticket-list.js') yield ew.CSSLink('tracker_css/ticket-list.css') for r in super(TicketSearchResults, self).resources(): yield r
def resources(self): yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.JSLink('tracker_js/jquery.multiselect.min.js') yield ew.CSSLink('allura/css/smoothness/jquery-ui.min.css') yield ew.CSSLink('tracker_css/jquery.multiselect.css') yield ew.JSLink('tracker_js/ticket-list.js') yield ew.CSSLink('tracker_css/ticket-list.css') for r in super(TicketSearchResults, self).resources(): yield r
def resources(self): for r in super(ProjectUserCombo, self).resources(): yield r yield ew.CSSLink('css/autocomplete.css') yield ew.CSSLink('css/combobox.css') yield ew.JSLink('js/combobox.js') yield onready(''' $('select.project-user-combobox').combobox({ source_url: "%susers" });''' % c.project.url())
def resources(self): for r in super(ProjectUserCombo, self).resources(): yield r yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.CSSLink('css/autocomplete.css') # customized in [6b78ed] so we can't just use jquery-ui.min.css yield ew.CSSLink('css/combobox.css') yield ew.JSLink('js/combobox.js') yield onready(''' $('select.project-user-combobox').combobox({ source_url: "%susers" });''' % c.project.url())
def resources(self): for r in super(MarkdownEdit, self).resources(): yield r yield ew.JSLink('js/jquery.lightbox_me.js') yield ew.CSSLink('css/simplemde.min.css', compress=False) yield ew.CSSLink('css/markitup_sf.css') yield ew.CSSLink('css/show-hint.css') yield ew.JSLink('js/simplemde.min.js') yield ew.JSLink('js/sf_markitup.js') yield ew.JSLink('js/show-hint.js') yield ew.JSLink('js/usermentions-helper.js') yield onready('getProjectUsers(\'%s/users\')' % c.project.url())
def resources(self): yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.JSLink('js/jquery.tagsinput.js') yield ew.CSSLink('css/jquery.tagsinput.css') yield onready(''' $('input.label_edit').tagsInput({ 'height':'100%%', 'width':'100%%', 'autocomplete_url':'%(url)stags' }); $('form').on('blur', '.ui-autocomplete-input', function() { setTimeout(function(){ var clicked = $(document.activeElement); // This is the element that has focus if (clicked.is('#ui-active-menuitem')) { return false; } else { var value = $('div.tagsinput div input').val(); var exists = $('input.label_edit').tagExist(value); var default_value = $('div.tagsinput div input').attr('data-default'); if ((value !== default_value) && (!exists) && value !== '') { $('input.label_edit').addTag(value); } $('input[type=submit]', this).prop('disabled', true); } }, 1); }); ''' % dict(url=c.app.url))
def resources(self): for r in super(MarkdownEdit, self).resources(): yield r yield ew.JSLink('js/jquery.lightbox_me.js') yield ew.JSLink('js/jquery.textarea.js') yield ew.JSLink('js/sf_markitup.js') yield ew.CSSLink('css/markitup_sf.css')
def resources(self): for r in super(DateField, self).resources(): yield r yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.CSSLink( 'allura/css/smoothness/jquery-ui.min.css', compress=False ) # compress will also serve from a different location, breaking image refs
def resources(self): for r in super(NeighborhoodOverviewForm, self).resources(): yield r yield ew.CSSLink('css/colorPicker.css') yield ew.CSSLink('css/jqfontselector.css') yield ew.CSSScript(''' table.table_class, table.input_inner{ margin: 0; padding: 0; width: 99%; } table.table_class .left{ text-align: left; } table.table_class .right{ text-align: right; width: 50%;} table.table_class tbody tr td { border: none; } table.table_class select.add_opt {width: 5em; margin:0; padding: 0;} ''') yield ew.JSLink('js/jquery.colorPicker.js') yield ew.JSLink('js/jqfontselector.js') yield ew.JSScript(''' $(function(){ $('.table_class').find('input[type="checkbox"]').each(function(index, element) { var cb_name = $(this).attr('name'); var inp_name = cb_name.substr(0, cb_name.length-4); var inp_el = $('div[class="'+inp_name+'-inp"]'); if ($(this).prop('checked')) { inp_el.hide(); } $(element).click(function(e) { if ($(this).prop('checked')) { inp_el.hide(); } else { inp_el.show(); } }); }); $('.table_class').find('input.color').each(function(index, element) { $(element).colorPicker(); }); $('.table_class').find('input.font').each(function(index, element) { $(element).fontSelector(); }); }); ''')
def resources(self): yield ew.JSLink('js/jquery.tagsinput.js') yield ew.CSSLink('css/jquery.tagsinput.css') yield onready(''' $('input.label_edit').tagsInput({ 'height':'100%%', 'width':'100%%', 'autocomplete_url':'%(url)stags' }); ''' % dict(url=c.app.url))
def resources(self): for r in super(ProjectUserSelect, self).resources(): yield r yield ew.CSSLink('css/autocomplete.css') yield onready(''' $('input.project_user_select').autocomplete({ source: function (request, response) { $.ajax({ url: "%suser_search", dataType: "json", data: { term: request.term }, success: function (data) { response(data.users); } }); }, minLength: 2 });''' % c.project.url())
def resources(self): for r in super(NeighborhoodProjectSelect, self).resources(): yield r yield ew.CSSLink('css/autocomplete.css') yield onready(''' $('input.neighborhood-project-select').autocomplete({ source: function (request, response) { $.ajax({ url: "%s", dataType: "json", data: { term: request.term }, success: function (data) { response(data.projects); } }); }, minLength: 3 });''' % self.url)
def resources(self): for r in super(NeighborhoodProjectSelect, self).resources(): yield r yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.CSSLink('css/autocomplete.css') # customized in [6b78ed] so we can't just use jquery-ui.min.css yield onready(''' $('input.neighborhood-project-select').autocomplete({ source: function (request, response) { $.ajax({ url: "%s", dataType: "json", data: { term: request.term }, success: function (data) { response(data.projects); } }); }, minLength: 3 });''' % self.url)
def register_css(self, href, **kw): self.resource_manager.register(ew.CSSLink(href, **kw))
def resources(self): for r in super(DateField, self).resources(): yield r yield ew.CSSLink( 'css/jquery.ui.datepicker.css', compress=False ) # compress will also serve from a different location, breaking image refs
def register_theme_css(self, href, **kw): self.resource_manager.register(ew.CSSLink(self.theme_href(href), **kw))
def resources(self): for r in super(NeighborhoodAddProjectForm, self).resources(): yield r yield ew.CSSLink('css/add_project.css') neighborhood = g.antispam.enc('neighborhood') project_name = g.antispam.enc('project_name') project_unixname = g.antispam.enc('project_unixname') yield ew.JSScript(''' $(function(){ var $scms = $('input[type=checkbox].scm'); var $nbhd_input = $('input[name="%(neighborhood)s"]'); var $name_input = $('input[name="%(project_name)s"]'); var $unixname_input = $('input[name="%(project_unixname)s"]'); var $project_url = $('#project_url'); var $url_fragment = $('#url_fragment'); var $form = $name_input.closest('form'); var delay = (function(){ var timers = {}; return function(callback, ms){ clearTimeout (timers[callback]); timers[callback] = setTimeout(callback, ms); }; })(); $name_input.focus(); var update_icon = function($input) { var $success_icon = $input.parent().next().find('.success_icon'); var $error_icon = $input.parent().next().find('.error_icon'); var is_error = $input.nextAll('.error').is(':visible'); $success_icon.toggle(!is_error); $error_icon.toggle(is_error); }; if ($name_input.val() !== '') { update_icon($name_input); } if ($unixname_input.val() !== '') { update_icon($unixname_input); } var handle_error = function($input, message) { var $error_field = $input.nextAll('.error'); if ($error_field.length === 0) { $error_field = $('<div class="error" style="display: none"></div>').insertAfter($input); } $error_field.text(message).toggle(!!message); $project_url.toggle(!message); update_icon($input); }; $form.submit(function(e) { var has_errors = $name_input.add($unixname_input).nextAll('.error').is(':visible'); if (has_errors || $name_input.val() === '' || $unixname_input.val() === '') { e.preventDefault(); alert('You must resolve the issues with the project name.'); return false; } }); $scms.change(function(){ if ( $(this).prop('checked') ) { var on = this; $scms.each(function(){ if ( this !== on ) { $(this).prop('checked', false); } }); } }); var suggest_name = function(project_name) { return project_name.replace(/[^A-Za-z0-9]+/g, '-').toLowerCase(); }; var check_names = function() { var data = { 'neighborhood': $nbhd_input.val(), 'project_name': $name_input.val(), 'project_unixname': $unixname_input.val() }; $.getJSON('check_names', data, function(result){ handle_error($name_input, result.project_name); handle_error($unixname_input, result.project_unixname); }); }; var manual = false; $name_input.on('input', function(){ if (!manual) { var suggested_name = suggest_name($name_input.val()); $unixname_input.val(suggested_name); $url_fragment.text(suggested_name); } delay(check_names, 20); }); $unixname_input.change(function() { manual = true; }); $unixname_input.on('input', function(){ $url_fragment.text($unixname_input.val()); delay(check_names, 20); }); }); ''' % dict(neighborhood=neighborhood, project_name=project_name, project_unixname=project_unixname))
def resources(self): yield ew.CSSLink('tracker_css/ticket-list.css') for r in super(MassEdit, self).resources(): yield r
def resources(self): yield ew.JSLink('tracker_js/ticket-list.js') yield ew.CSSLink('tracker_css/ticket-list.css') for r in super(TicketSearchResults, self).resources(): yield r
def resources(self): for r in super(DateField, self).resources(): yield r yield ew.CSSLink('css/jquery.ui.datepicker.css')
def register_forge_css(self, href, **kw): self.resource_manager.register(ew.CSSLink('allura/' + href, **kw))
def register_app_css(self, href, **kw): app = kw.pop('app', c.app) self.resource_manager.register( ew.CSSLink('tool/%s/%s' % (app.config.tool_name.lower(), href), **kw))
def resources(self): yield ew.JSLink('allura/js/jquery-ui.min.js', location='body_top_js') yield ew.JSLink('js/screenshots.js') yield ew.CSSLink('css/screenshots.css')
def resources(self): yield ew.JSLink('allura/js/hidpi-canvas.min.js') yield ew.JSLink('js/commit_browser.js') yield ew.CSSLink('css/commit_browser.css')
def resources(self): yield ew.CSSLink('css/vote.css') yield ew.JSLink('js/vote.js')
def resources(self): yield ew.CSSLink('css/page_list.css')
def resources(self): yield ew.CSSLink( 'allura/css/smoothness/jquery-ui-1.8.4.custom.css', compress=False ) # compress will also serve from a different location, breaking image refs
def resources(self): yield ew.JSLink('js/screenshots.js') yield ew.CSSLink('css/screenshots.css')
def resources(self): yield ew.JSLink('js/commit_browser.js') yield ew.CSSLink('css/commit_browser.css')