From 813814f02ed7bf226782861820570117fa196026 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 17 Aug 2012 09:09:11 +0300 Subject: Application cleanup --- Gemfile | 6 +- Gemfile.lock | 8 +- app/assets/javascripts/application.js | 2 - app/assets/stylesheets/application.css | 3 +- app/assets/stylesheets/jquery_ui.scss | 33 - app/assets/stylesheets/main.scss | 30 +- app/models/issue.rb | 2 - lib/tasks/dev/tests.rake | 2 +- vendor/assets/images/bg_fallback.png | Bin 0 -> 3721 bytes vendor/assets/images/icon_sprite.png | Bin 0 -> 3217 bytes vendor/assets/images/progress_bar.gif | Bin 0 -> 502 bytes vendor/assets/images/slider_handles.png | Bin 0 -> 4453 bytes vendor/assets/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes vendor/assets/images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes vendor/assets/javascripts/jquery.tagify.js | 143 ---- vendor/assets/javascripts/jquery.ui.selectmenu.js | 844 --------------------- .../assets/stylesheets/jquery-ui/jquery.tagify.css | 34 - .../stylesheets/jquery-ui/jquery.ui.selectmenu.css | 33 - vendor/assets/stylesheets/jquery.ui.aristo.css | 738 ++++++++++++++++++ 19 files changed, 755 insertions(+), 1123 deletions(-) delete mode 100644 app/assets/stylesheets/jquery_ui.scss create mode 100644 vendor/assets/images/bg_fallback.png create mode 100644 vendor/assets/images/icon_sprite.png create mode 100644 vendor/assets/images/progress_bar.gif create mode 100644 vendor/assets/images/slider_handles.png create mode 100644 vendor/assets/images/ui-icons_222222_256x240.png create mode 100644 vendor/assets/images/ui-icons_454545_256x240.png delete mode 100644 vendor/assets/javascripts/jquery.tagify.js delete mode 100644 vendor/assets/javascripts/jquery.ui.selectmenu.js delete mode 100644 vendor/assets/stylesheets/jquery-ui/jquery.tagify.css delete mode 100644 vendor/assets/stylesheets/jquery-ui/jquery.ui.selectmenu.css create mode 100644 vendor/assets/stylesheets/jquery.ui.aristo.css diff --git a/Gemfile b/Gemfile index d2a5728f97c..26e4e195def 100644 --- a/Gemfile +++ b/Gemfile @@ -76,10 +76,6 @@ gem 'settingslogic' gem "foreman" gem "git" -# Unused -gem 'tabs_on_rails' -gem "acts_as_list" - group :assets do gem "sass-rails", "3.2.5" gem "coffee-rails", "3.2.2" @@ -91,7 +87,7 @@ group :assets do gem "jquery-ui-rails", "0.5.0" gem "modernizr", "2.5.3" gem "raphael-rails", "1.5.2" - gem 'bootstrap-sass', "2.0.3.1" + gem 'bootstrap-sass', "2.0.4" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 7356c35ede0..57ad193512e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,7 +98,6 @@ GEM multi_json (~> 1.0) acts-as-taggable-on (2.3.1) rails (~> 3.0) - acts_as_list (0.1.6) addressable (2.2.8) ansi (1.4.2) arel (3.0.2) @@ -109,7 +108,7 @@ GEM awesome_print (1.0.2) bcrypt-ruby (3.0.1) blankslate (2.1.2.4) - bootstrap-sass (2.0.3.1) + bootstrap-sass (2.0.4.0) builder (3.0.0) capybara (1.1.2) mime-types (>= 1.16) @@ -338,7 +337,6 @@ GEM tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.6) stamp (0.1.6) - tabs_on_rails (2.1.1) therubyracer (0.10.1) libv8 (~> 3.3.10) thin (1.3.1) @@ -375,12 +373,11 @@ PLATFORMS DEPENDENCIES acts-as-taggable-on (= 2.3.1) - acts_as_list annotate! autotest autotest-rails awesome_print - bootstrap-sass (= 2.0.3.1) + bootstrap-sass (= 2.0.4) capybara capybara-webkit carrierwave @@ -431,7 +428,6 @@ DEPENDENCIES six sqlite3 stamp - tabs_on_rails therubyracer thin turn diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 25732ae5289..d9cbd5d65b3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -7,8 +7,6 @@ //= require jquery //= require jquery.ui.all //= require jquery_ujs -//= require jquery.ui.selectmenu -//= require jquery.tagify //= require jquery.cookie //= require jquery.endless-scroll //= require jquery.highlight diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 6ce23320984..92d542a9866 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -3,8 +3,7 @@ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * the top of the compiled file, but it's generally better to create a new file per style scope. *= require jquery.ui.all - *= require jquery-ui/jquery.ui.selectmenu - *= require jquery-ui/jquery.tagify + *= require jquery.ui.aristo *= require chosen *= require_self *= require main diff --git a/app/assets/stylesheets/jquery_ui.scss b/app/assets/stylesheets/jquery_ui.scss deleted file mode 100644 index 1063f1d080e..00000000000 --- a/app/assets/stylesheets/jquery_ui.scss +++ /dev/null @@ -1,33 +0,0 @@ -/** - * JQUERY UI datepicker - * - */ -.ui-datepicker { - border-color:#eee; - padding:20px; - - .ui-state-default { - background:#f1f1f1; - padding:5px; - } - .ui-state-active { - background:#fff; - } -} - -/** - * JQUERY UI progressbar - * - */ -.ui-progressbar { - border:1px solid #ddd; - height:6px; - margin:0; - padding:0; - - .ui-progressbar-value { - background-color: #62C462;//$blue_link; - margin:0; - } -} - diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 5613f1e82d8..71d09883006 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -3,8 +3,8 @@ /** GITLAB colors **/ $text_color:#222; -$lite_text_color: #666; -$link_color:#2A79A3; +$lite_text_color: #666; +$link_color:#2A79A3; $active_link_color:#2FA0BB; $active_bg_color:#79C3E0; $active_bd_color: #2FA0BB; @@ -31,7 +31,7 @@ $hover: #FDF5D9; box-shadow: 0 0 3px #ddd; } -@mixin solid_shade { +@mixin solid_shade { -moz-box-shadow: 0 0 0 3px #eee; -webkit-box-shadow: 0 0 0 3px #eee; box-shadow: 0 0 0 3px #eee; @@ -73,21 +73,21 @@ $hover: #FDF5D9; /** - * Header of application. + * Header of application. * Contain application logo, search panel, profile icon */ @import "sections/header.scss"; /** - * Navigation menu of application. + * Navigation menu of application. * Panel with links to pages depends on project, profile or admin area */ @import "sections/nav.scss"; /** - * This file represent some UI that can be changed - * during web app restyle or theme select. - * + * This file represent some UI that can be changed + * during web app restyle or theme select. + * * Next items should be placed there * - link, button colors * - header restyles @@ -118,7 +118,7 @@ $hover: #FDF5D9; * Most of application styles placed here. * This file represent common UI that should not be changed between themes * or project restyling like form width or user avatar class or commit title - * + * * TODO: clean it */ @import "common.scss"; @@ -140,17 +140,17 @@ $hover: #FDF5D9; @import "ref_select.scss"; /** - * Code (files list) styles. Browsing project files there + * Code (files list) styles. Browsing project files there */ @import "sections/tree.scss"; /** - * This file represent notes(comments) styles + * This file represent notes(comments) styles */ @import "sections/notes.scss"; /** - * Devise styles + * Devise styles */ @import "sections/login.scss"; @@ -165,9 +165,3 @@ $hover: #FDF5D9; * */ @import "highlight/dark.scss"; - -/** - * JQUERY UI ext - * - */ -@import "jquery_ui.scss"; diff --git a/app/models/issue.rb b/app/models/issue.rb index 454b13586ac..6409eebac63 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -9,8 +9,6 @@ class Issue < ActiveRecord::Base validates :description, length: { within: 0..2000 } - acts_as_list - def self.open_for(user) opened.assigned(user) end diff --git a/lib/tasks/dev/tests.rake b/lib/tasks/dev/tests.rake index f91320ebdd2..d5c0e75e457 100644 --- a/lib/tasks/dev/tests.rake +++ b/lib/tasks/dev/tests.rake @@ -3,7 +3,7 @@ namespace :dev do task :tests do ["cucumber", "rspec spec"].each do |cmd| puts "Starting to run #{cmd}..." - system("bundle exec #{cmd}") + system("export DISPLAY=:99.0 && bundle exec #{cmd}") raise "#{cmd} failed!" unless $?.exitstatus == 0 end end diff --git a/vendor/assets/images/bg_fallback.png b/vendor/assets/images/bg_fallback.png new file mode 100644 index 00000000000..4b2754b8040 Binary files /dev/null and b/vendor/assets/images/bg_fallback.png differ diff --git a/vendor/assets/images/icon_sprite.png b/vendor/assets/images/icon_sprite.png new file mode 100644 index 00000000000..636c80f2216 Binary files /dev/null and b/vendor/assets/images/icon_sprite.png differ diff --git a/vendor/assets/images/progress_bar.gif b/vendor/assets/images/progress_bar.gif new file mode 100644 index 00000000000..156fbb53137 Binary files /dev/null and b/vendor/assets/images/progress_bar.gif differ diff --git a/vendor/assets/images/slider_handles.png b/vendor/assets/images/slider_handles.png new file mode 100644 index 00000000000..b95a46eca97 Binary files /dev/null and b/vendor/assets/images/slider_handles.png differ diff --git a/vendor/assets/images/ui-icons_222222_256x240.png b/vendor/assets/images/ui-icons_222222_256x240.png new file mode 100644 index 00000000000..b273ff111d2 Binary files /dev/null and b/vendor/assets/images/ui-icons_222222_256x240.png differ diff --git a/vendor/assets/images/ui-icons_454545_256x240.png b/vendor/assets/images/ui-icons_454545_256x240.png new file mode 100644 index 00000000000..59bd45b907c Binary files /dev/null and b/vendor/assets/images/ui-icons_454545_256x240.png differ diff --git a/vendor/assets/javascripts/jquery.tagify.js b/vendor/assets/javascripts/jquery.tagify.js deleted file mode 100644 index f22d4c71191..00000000000 --- a/vendor/assets/javascripts/jquery.tagify.js +++ /dev/null @@ -1,143 +0,0 @@ -/* Author: Alicia Liu */ - -(function ($) { - - $.widget("ui.tagify", { - options: { - delimiters: [13, 188], // what user can type to complete a tag in char codes: [enter], [comma] - outputDelimiter: ',', // delimiter for tags in original input field - cssClass: 'tagify-container', // CSS class to style the tagify div and tags, see stylesheet - addTagPrompt: 'add tags' // placeholder text - }, - - _create: function() { - var self = this, - el = self.element, - opts = self.options; - - this.tags = []; - - // hide text field and replace with a div that contains it's own input field for entering tags - this.tagInput = $("") - .attr( 'placeholder', opts.addTagPrompt ) - .keypress( function(e) { - var $this = $(this), - pressed = e.which; - - for ( i in opts.delimiters ) { - - if (pressed == opts.delimiters[i]) { - self.add( $this.val() ); - e.preventDefault(); - return false; - } - } - }) - // for some reason, in Safari, backspace is only recognized on keyup - .keyup( function(e) { - var $this = $(this), - pressed = e.which; - - // if backspace is hit with no input, remove the last tag - if (pressed == 8) { // backspace - if ( $this.val() == "" ) { - self.remove(); - return false; - } - return; - } - }); - - this.tagDiv = $("
") - .addClass( opts.cssClass ) - .click( function() { - $(this).children('input').focus(); - }) - .append( this.tagInput ) - .insertAfter( el.hide() ); - - // if the field isn't empty, parse the field for tags, and prepopulate existing tags - var initVal = $.trim( el.val() ); - - if ( initVal ) { - var initTags = initVal.split( opts.outputDelimiter ); - $.each( initTags, function(i, tag) { - self.add( tag ); - }); - } - }, - - _setOption: function( key, value ) { - options.key = value; - }, - - // add a tag, public function - add: function(text) { - var self = this; - text = text || self.tagInput.val(); - if (text) { - var tagIndex = self.tags.length; - - var removeButton = $("x") - .click( function() { - self.remove( tagIndex ); - return false; - }); - var newTag = $("") - .text( text ) - .append( removeButton ); - - self.tagInput.before( newTag ); - self.tags.push( text ); - self.tagInput.val(''); - } - }, - - // remove a tag by index, public function - // if index is blank, remove the last tag - remove: function( tagIndex ) { - var self = this; - if ( tagIndex == null || tagIndex === (self.tags.length - 1) ) { - this.tagDiv.children("span").last().remove(); - self.tags.pop(); - } - if ( typeof(tagIndex) == 'number' ) { - // otherwise just hide this tag, and we don't mess up the index - this.tagDiv.children( "span:eq(" + tagIndex + ")" ).hide(); - // we rely on the serialize function to remove null values - delete( self.tags[tagIndex] ); - } - }, - - // serialize the tags with the given delimiter, and write it back into the tagified field - serialize: function() { - var self = this; - var delim = self.options.outputDelimiter; - var tagsStr = self.tags.join( delim ); - - // our tags might have deleted entries, remove them here - var dupes = new RegExp(delim + delim + '+', 'g'); // regex: /,,+/g - var ends = new RegExp('^' + delim + '|' + delim + '$', 'g'); // regex: /^,|,$/g - var outputStr = tagsStr.replace( dupes, delim ).replace(ends, ''); - - self.element.val(outputStr); - return outputStr; - }, - - inputField: function() { - return this.tagInput; - }, - - containerDiv: function() { - return this.tagDiv; - }, - - // remove the div, and show original input - destroy: function() { - $.Widget.prototype.destroy.apply(this); - this.tagDiv.remove(); - this.element.show(); - } - }); - -})(jQuery); \ No newline at end of file diff --git a/vendor/assets/javascripts/jquery.ui.selectmenu.js b/vendor/assets/javascripts/jquery.ui.selectmenu.js deleted file mode 100644 index 957fe4d8887..00000000000 --- a/vendor/assets/javascripts/jquery.ui.selectmenu.js +++ /dev/null @@ -1,844 +0,0 @@ - /* - * jQuery UI selectmenu dev version - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - * https://github.com/fnagel/jquery-ui/wiki/Selectmenu - */ - -(function($) { - -$.widget("ui.selectmenu", { - getter: "value", - version: "1.8", - eventPrefix: "selectmenu", - options: { - transferClasses: true, - typeAhead: "sequential", - style: 'dropdown', - positionOptions: { - my: "left top", - at: "left bottom", - offset: null - }, - width: null, - menuWidth: null, - handleWidth: 26, - maxHeight: null, - icons: null, - format: null, - bgImage: function() {}, - wrapperElement: "
" - }, - - _create: function() { - var self = this, o = this.options; - - // set a default id value, generate a new random one if not set by developer - var selectmenuId = this.element.attr( 'id' ) || 'ui-selectmenu-' + Math.random().toString( 16 ).slice( 2, 10 ); - - // quick array of button and menu id's - this.ids = [ selectmenuId + '-button', selectmenuId + '-menu' ]; - - // define safe mouseup for future toggling - this._safemouseup = true; - - // create menu button wrapper - this.newelement = $( '', { - 'class': this.widgetBaseClass + ' ui-widget ui-state-default ui-corner-all', - 'id' : this.ids[ 0 ], - 'role': 'button', - 'href': '#nogo', - 'tabindex': this.element.attr( 'disabled' ) ? 1 : 0, - 'aria-haspopup': true, - 'aria-owns': this.ids[ 1 ] - }); - this.newelementWrap = $( o.wrapperElement ) - .append( this.newelement ) - .insertAfter( this.element ); - - // transfer tabindex - var tabindex = this.element.attr( 'tabindex' ); - if ( tabindex ) { - this.newelement.attr( 'tabindex', tabindex ); - } - - // save reference to select in data for ease in calling methods - this.newelement.data( 'selectelement', this.element ); - - // menu icon - this.selectmenuIcon = $( '' ) - .prependTo( this.newelement ); - - // append status span to button - this.newelement.prepend( '' ); - - // make associated form label trigger focus - $( 'label[for="' + selectmenuId + '"]' ) - .attr( 'for', this.ids[0] ) - .bind( 'click.selectmenu', function() { - self.newelement[0].focus(); - return false; - }); - - // click toggle for menu visibility - this.newelement - .bind('mousedown.selectmenu', function(event) { - self._toggle(event, true); - // make sure a click won't open/close instantly - if (o.style == "popup") { - self._safemouseup = false; - setTimeout(function() { self._safemouseup = true; }, 300); - } - return false; - }) - .bind('click.selectmenu', function() { - return false; - }) - .bind("keydown.selectmenu", function(event) { - var ret = false; - switch (event.keyCode) { - case $.ui.keyCode.ENTER: - ret = true; - break; - case $.ui.keyCode.SPACE: - self._toggle(event); - break; - case $.ui.keyCode.UP: - if (event.altKey) { - self.open(event); - } else { - self._moveSelection(-1); - } - break; - case $.ui.keyCode.DOWN: - if (event.altKey) { - self.open(event); - } else { - self._moveSelection(1); - } - break; - case $.ui.keyCode.LEFT: - self._moveSelection(-1); - break; - case $.ui.keyCode.RIGHT: - self._moveSelection(1); - break; - case $.ui.keyCode.TAB: - ret = true; - break; - default: - ret = true; - } - return ret; - }) - .bind('keypress.selectmenu', function(event) { - self._typeAhead(event.which, 'mouseup'); - return true; - }) - .bind('mouseover.selectmenu focus.selectmenu', function() { - if (!o.disabled) { - $(this).addClass(self.widgetBaseClass + '-focus ui-state-hover'); - } - }) - .bind('mouseout.selectmenu blur.selectmenu', function() { - if (!o.disabled) { - $(this).removeClass(self.widgetBaseClass + '-focus ui-state-hover'); - } - }); - - // document click closes menu - $(document).bind("mousedown.selectmenu", function(event) { - self.close(event); - }); - - // change event on original selectmenu - this.element - .bind("click.selectmenu", function() { - self._refreshValue(); - }) - // FIXME: newelement can be null under unclear circumstances in IE8 - // TODO not sure if this is still a problem (fnagel 20.03.11) - .bind("focus.selectmenu", function() { - if (self.newelement) { - self.newelement[0].focus(); - } - }); - - // set width when not set via options - if (!o.width) { - o.width = this.element.outerWidth(); - } - // set menu button width - this.newelement.width(o.width); - - // hide original selectmenu element - this.element.hide(); - - // create menu portion, append to body - this.list = $( '