diff --git a/Gemfile b/Gemfile index 77a00659..f32c13f0 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'rails', '3.1.0' gem 'sqlite3' gem 'devise', "1.4.7" gem 'stamp' -gem 'will_paginate', '~> 3.0' +gem 'kaminari' gem 'haml-rails' gem 'jquery-rails' gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' @@ -16,10 +16,12 @@ gem 'faker' gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' gem "inifile" gem "pygments.rb", "0.2.3" -gem "kaminari" gem "thin" gem "git" gem "acts_as_list" +gem 'rdiscount' + +gem 'acts-as-taggable-on', '~>2.1.0' group :assets do gem 'sass-rails', " ~> 3.1.0" @@ -27,14 +29,15 @@ group :assets do gem 'uglifier' end -group :development do +group :development do + gem 'letter_opener' gem 'rails-footnotes', '>= 3.7.5.rc4' gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' end group :development, :test do gem 'rspec-rails' - gem 'shoulda' + gem "shoulda", "~> 3.0.0.beta2" gem 'capybara' gem 'autotest' gem 'autotest-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 5ba34459..e557ee43 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,6 +54,8 @@ GEM activesupport (= 3.1.0) activesupport (3.1.0) multi_json (~> 1.0) + acts-as-taggable-on (2.1.1) + rails acts_as_list (0.1.4) addressable (2.2.6) ansi (1.3.0) @@ -119,6 +121,8 @@ GEM rails (>= 3.0.0) launchy (2.0.5) addressable (~> 2.2.6) + letter_opener (0.0.2) + launchy libv8 (3.3.10.2) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) @@ -161,6 +165,7 @@ GEM rdoc (~> 3.4) thor (~> 0.14.6) rake (0.9.2) + rdiscount (1.6.8) rdoc (3.9.4) rspec (2.6.0) rspec-core (~> 2.6.0) @@ -200,7 +205,11 @@ GEM ffi (>= 1.0.7) json_pure rubyzip - shoulda (2.11.3) + shoulda (3.0.0.beta2) + shoulda-context (~> 1.0.0.beta1) + shoulda-matchers (~> 1.0.0.beta1) + shoulda-context (1.0.0.beta1) + shoulda-matchers (1.0.0.beta3) simplecov (0.5.3) multi_json (~> 1.0.3) simplecov-html (~> 0.5.3) @@ -232,7 +241,6 @@ GEM multi_json (>= 1.0.2) warden (1.0.5) rack (>= 1.0) - will_paginate (3.0.0) xpath (0.1.4) nokogiri (~> 1.3) @@ -240,6 +248,7 @@ PLATFORMS ruby DEPENDENCIES + acts-as-taggable-on (~> 2.1.0) acts_as_list annotate! autotest @@ -258,14 +267,16 @@ DEPENDENCIES jquery-rails kaminari launchy + letter_opener pygments.rb (= 0.2.3) rails (= 3.1.0) rails-footnotes (>= 3.7.5.rc4) + rdiscount rspec-rails ruby-debug19 sass-rails (~> 3.1.0) seed-fu! - shoulda + shoulda (~> 3.0.0.beta2) simplecov six sqlite3 @@ -274,4 +285,3 @@ DEPENDENCIES thin turn uglifier - will_paginate (~> 3.0) diff --git a/app/assets/images/.directory b/app/assets/images/.directory index 93a51f7c..d6f1a908 100644 --- a/app/assets/images/.directory +++ b/app/assets/images/.directory @@ -1,4 +1,4 @@ [Dolphin] ShowPreview=true -Timestamp=2011,9,14,20,34,18 +Timestamp=2011,10,28,13,16,25 Version=2 diff --git a/app/assets/images/bg-header.png b/app/assets/images/bg-header.png new file mode 100644 index 00000000..8759ca58 Binary files /dev/null and b/app/assets/images/bg-header.png differ diff --git a/app/assets/images/chosen-sprite.png b/app/assets/images/chosen-sprite.png new file mode 100644 index 00000000..d08e4b7e Binary files /dev/null and b/app/assets/images/chosen-sprite.png differ diff --git a/app/assets/images/icon-search.png b/app/assets/images/icon-search.png new file mode 100644 index 00000000..7632915c Binary files /dev/null and b/app/assets/images/icon-search.png differ diff --git a/app/assets/images/images.png b/app/assets/images/images.png new file mode 100644 index 00000000..973d3bdd Binary files /dev/null and b/app/assets/images/images.png differ diff --git a/app/assets/images/login-logo.png b/app/assets/images/login-logo.png new file mode 100644 index 00000000..8c064b12 Binary files /dev/null and b/app/assets/images/login-logo.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 024dfe11..31046379 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -5,11 +5,15 @@ // the compiled file. // //= require jquery +//= require jquery-ui //= require jquery_ujs +//= require jquery.ui.selectmenu +//= require jquery.tagify +//= require jquery.cookie //= require_tree . $(function(){ - $(".one_click_select").click(function(){ + $(".one_click_select").live("click", function(){ $(this).select(); }); @@ -17,6 +21,6 @@ $(function(){ $('select#tag').selectmenu({style:'popup', width:200}); }); -function updatePage(){ - $.ajax({type: "GET", url: location.href, dataType: "script"}); +function updatePage(data){ + $.ajax({type: "GET", url: location.href, data: data, dataType: "script"}); } diff --git a/app/assets/javascripts/chosen.jquery.js b/app/assets/javascripts/chosen.jquery.js new file mode 100644 index 00000000..34918fe9 --- /dev/null +++ b/app/assets/javascripts/chosen.jquery.js @@ -0,0 +1,901 @@ +// Chosen, a Select Box Enhancer for jQuery and Protoype +// by Patrick Filler for Harvest, http://getharvest.com +// +// Version 0.9.5 +// Full source at https://github.com/harvesthq/chosen +// Copyright (c) 2011 Harvest http://getharvest.com + +// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +// This file is generated by `cake build`, do not edit it by hand. +(function() { + var SelectParser; + SelectParser = (function() { + function SelectParser() { + this.options_index = 0; + this.parsed = []; + } + SelectParser.prototype.add_node = function(child) { + if (child.nodeName === "OPTGROUP") { + return this.add_group(child); + } else { + return this.add_option(child); + } + }; + SelectParser.prototype.add_group = function(group) { + var group_position, option, _i, _len, _ref, _results; + group_position = this.parsed.length; + this.parsed.push({ + array_index: group_position, + group: true, + label: group.label, + children: 0, + disabled: group.disabled + }); + _ref = group.childNodes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + _results.push(this.add_option(option, group_position, group.disabled)); + } + return _results; + }; + SelectParser.prototype.add_option = function(option, group_position, group_disabled) { + if (option.nodeName === "OPTION") { + if (option.text !== "") { + if (group_position != null) { + this.parsed[group_position].children += 1; + } + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + value: option.value, + text: option.text, + html: option.innerHTML, + selected: option.selected, + disabled: group_disabled === true ? group_disabled : option.disabled, + group_array_index: group_position, + classes: option.className, + style: option.style.cssText + }); + } else { + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + empty: true + }); + } + return this.options_index += 1; + } + }; + return SelectParser; + })(); + SelectParser.select_to_array = function(select) { + var child, parser, _i, _len, _ref; + parser = new SelectParser(); + _ref = select.childNodes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + child = _ref[_i]; + parser.add_node(child); + } + return parser.parsed; + }; + this.SelectParser = SelectParser; +}).call(this); +(function() { + /* + Chosen source: generate output using 'cake build' + Copyright (c) 2011 by Harvest + */ + var AbstractChosen, root; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + root = this; + AbstractChosen = (function() { + function AbstractChosen(form_field, options) { + this.form_field = form_field; + this.options = options != null ? options : {}; + this.set_default_values(); + this.is_multiple = this.form_field.multiple; + this.default_text_default = this.is_multiple ? "Select Some Options" : "Select an Option"; + this.setup(); + this.set_up_html(); + this.register_observers(); + this.finish_setup(); + } + AbstractChosen.prototype.set_default_values = function() { + this.click_test_action = __bind(function(evt) { + return this.test_active_click(evt); + }, this); + this.activate_action = __bind(function(evt) { + return this.activate_field(evt); + }, this); + this.active_field = false; + this.mouse_on_container = false; + this.results_showing = false; + this.result_highlighted = null; + this.result_single_selected = null; + this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; + this.disable_search_threshold = this.options.disable_search_threshold || 0; + this.choices = 0; + return this.results_none_found = this.options.no_results_text || "No results match"; + }; + AbstractChosen.prototype.mouse_enter = function() { + return this.mouse_on_container = true; + }; + AbstractChosen.prototype.mouse_leave = function() { + return this.mouse_on_container = false; + }; + AbstractChosen.prototype.input_focus = function(evt) { + if (!this.active_field) { + return setTimeout((__bind(function() { + return this.container_mousedown(); + }, this)), 50); + } + }; + AbstractChosen.prototype.input_blur = function(evt) { + if (!this.mouse_on_container) { + this.active_field = false; + return setTimeout((__bind(function() { + return this.blur_test(); + }, this)), 100); + } + }; + AbstractChosen.prototype.result_add_option = function(option) { + var classes, style; + if (!option.disabled) { + option.dom_id = this.container_id + "_o_" + option.array_index; + classes = option.selected && this.is_multiple ? [] : ["active-result"]; + if (option.selected) { + classes.push("result-selected"); + } + if (option.group_array_index != null) { + classes.push("group-option"); + } + if (option.classes !== "") { + classes.push(option.classes); + } + style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : ""; + return '
  • ' + option.html + '
  • '; + } else { + return ""; + } + }; + AbstractChosen.prototype.results_update_field = function() { + this.result_clear_highlight(); + this.result_single_selected = null; + return this.results_build(); + }; + AbstractChosen.prototype.results_toggle = function() { + if (this.results_showing) { + return this.results_hide(); + } else { + return this.results_show(); + } + }; + AbstractChosen.prototype.results_search = function(evt) { + if (this.results_showing) { + return this.winnow_results(); + } else { + return this.results_show(); + } + }; + AbstractChosen.prototype.keyup_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + switch (stroke) { + case 8: + if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { + return this.keydown_backstroke(); + } else if (!this.pending_backstroke) { + this.result_clear_highlight(); + return this.results_search(); + } + break; + case 13: + evt.preventDefault(); + if (this.results_showing) { + return this.result_select(evt); + } + break; + case 27: + if (this.results_showing) { + return this.results_hide(); + } + break; + case 9: + case 38: + case 40: + case 16: + case 91: + case 17: + break; + default: + return this.results_search(); + } + }; + AbstractChosen.prototype.generate_field_id = function() { + var new_id; + new_id = this.generate_random_id(); + this.form_field.id = new_id; + return new_id; + }; + AbstractChosen.prototype.generate_random_char = function() { + var chars, newchar, rand; + chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; + rand = Math.floor(Math.random() * chars.length); + return newchar = chars.substring(rand, rand + 1); + }; + return AbstractChosen; + })(); + root.AbstractChosen = AbstractChosen; +}).call(this); +(function() { + /* + Chosen source: generate output using 'cake build' + Copyright (c) 2011 by Harvest + */ + var $, Chosen, get_side_border_padding, root; + var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { + for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor; + child.__super__ = parent.prototype; + return child; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + root = this; + $ = jQuery; + $.fn.extend({ + chosen: function(options) { + if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) { + return this; + } + return $(this).each(function(input_field) { + if (!($(this)).hasClass("chzn-done")) { + return new Chosen(this, options); + } + }); + } + }); + Chosen = (function() { + __extends(Chosen, AbstractChosen); + function Chosen() { + Chosen.__super__.constructor.apply(this, arguments); + } + Chosen.prototype.setup = function() { + this.form_field_jq = $(this.form_field); + return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl"); + }; + Chosen.prototype.finish_setup = function() { + return this.form_field_jq.addClass("chzn-done"); + }; + Chosen.prototype.set_up_html = function() { + var container_div, dd_top, dd_width, sf_width; + this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id(); + this.container_id += "_chzn"; + this.f_width = this.form_field_jq.outerWidth(); + this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default; + container_div = $("
    ", { + id: this.container_id, + "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''), + style: 'width: ' + this.f_width + 'px;' + }); + if (this.is_multiple) { + container_div.html('
    '); + } else { + container_div.html('' + this.default_text + '
    '); + } + this.form_field_jq.hide().after(container_div); + this.container = $('#' + this.container_id); + this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single")); + this.dropdown = this.container.find('div.chzn-drop').first(); + dd_top = this.container.height(); + dd_width = this.f_width - get_side_border_padding(this.dropdown); + this.dropdown.css({ + "width": dd_width + "px", + "top": dd_top + "px" + }); + this.search_field = this.container.find('input').first(); + this.search_results = this.container.find('ul.chzn-results').first(); + this.search_field_scale(); + this.search_no_results = this.container.find('li.no-results').first(); + if (this.is_multiple) { + this.search_choices = this.container.find('ul.chzn-choices').first(); + this.search_container = this.container.find('li.search-field').first(); + } else { + this.search_container = this.container.find('div.chzn-search').first(); + this.selected_item = this.container.find('.chzn-single').first(); + sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field); + this.search_field.css({ + "width": sf_width + "px" + }); + } + this.results_build(); + this.set_tab_index(); + return this.form_field_jq.trigger("liszt:ready", { + chosen: this + }); + }; + Chosen.prototype.register_observers = function() { + this.container.mousedown(__bind(function(evt) { + return this.container_mousedown(evt); + }, this)); + this.container.mouseup(__bind(function(evt) { + return this.container_mouseup(evt); + }, this)); + this.container.mouseenter(__bind(function(evt) { + return this.mouse_enter(evt); + }, this)); + this.container.mouseleave(__bind(function(evt) { + return this.mouse_leave(evt); + }, this)); + this.search_results.mouseup(__bind(function(evt) { + return this.search_results_mouseup(evt); + }, this)); + this.search_results.mouseover(__bind(function(evt) { + return this.search_results_mouseover(evt); + }, this)); + this.search_results.mouseout(__bind(function(evt) { + return this.search_results_mouseout(evt); + }, this)); + this.form_field_jq.bind("liszt:updated", __bind(function(evt) { + return this.results_update_field(evt); + }, this)); + this.search_field.blur(__bind(function(evt) { + return this.input_blur(evt); + }, this)); + this.search_field.keyup(__bind(function(evt) { + return this.keyup_checker(evt); + }, this)); + this.search_field.keydown(__bind(function(evt) { + return this.keydown_checker(evt); + }, this)); + if (this.is_multiple) { + this.search_choices.click(__bind(function(evt) { + return this.choices_click(evt); + }, this)); + return this.search_field.focus(__bind(function(evt) { + return this.input_focus(evt); + }, this)); + } + }; + Chosen.prototype.search_field_disabled = function() { + this.is_disabled = this.form_field_jq[0].disabled; + if (this.is_disabled) { + this.container.addClass('chzn-disabled'); + this.search_field[0].disabled = true; + if (!this.is_multiple) { + this.selected_item.unbind("focus", this.activate_action); + } + return this.close_field(); + } else { + this.container.removeClass('chzn-disabled'); + this.search_field[0].disabled = false; + if (!this.is_multiple) { + return this.selected_item.bind("focus", this.activate_action); + } + } + }; + Chosen.prototype.container_mousedown = function(evt) { + var target_closelink; + if (!this.is_disabled) { + target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false; + if (evt && evt.type === "mousedown") { + evt.stopPropagation(); + } + if (!this.pending_destroy_click && !target_closelink) { + if (!this.active_field) { + if (this.is_multiple) { + this.search_field.val(""); + } + $(document).click(this.click_test_action); + this.results_show(); + } else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) { + evt.preventDefault(); + this.results_toggle(); + } + return this.activate_field(); + } else { + return this.pending_destroy_click = false; + } + } + }; + Chosen.prototype.container_mouseup = function(evt) { + if (evt.target.nodeName === "ABBR") { + return this.results_reset(evt); + } + }; + Chosen.prototype.blur_test = function(evt) { + if (!this.active_field && this.container.hasClass("chzn-container-active")) { + return this.close_field(); + } + }; + Chosen.prototype.close_field = function() { + $(document).unbind("click", this.click_test_action); + if (!this.is_multiple) { + this.selected_item.attr("tabindex", this.search_field.attr("tabindex")); + this.search_field.attr("tabindex", -1); + } + this.active_field = false; + this.results_hide(); + this.container.removeClass("chzn-container-active"); + this.winnow_results_clear(); + this.clear_backstroke(); + this.show_search_field_default(); + return this.search_field_scale(); + }; + Chosen.prototype.activate_field = function() { + if (!this.is_multiple && !this.active_field) { + this.search_field.attr("tabindex", this.selected_item.attr("tabindex")); + this.selected_item.attr("tabindex", -1); + } + this.container.addClass("chzn-container-active"); + this.active_field = true; + this.search_field.val(this.search_field.val()); + return this.search_field.focus(); + }; + Chosen.prototype.test_active_click = function(evt) { + if ($(evt.target).parents('#' + this.container_id).length) { + return this.active_field = true; + } else { + return this.close_field(); + } + }; + Chosen.prototype.results_build = function() { + var content, data, startTime, _i, _len, _ref; + startTime = new Date(); + this.parsing = true; + this.results_data = root.SelectParser.select_to_array(this.form_field); + if (this.is_multiple && this.choices > 0) { + this.search_choices.find("li.search-choice").remove(); + this.choices = 0; + } else if (!this.is_multiple) { + this.selected_item.find("span").text(this.default_text); + if (this.form_field.options.length <= this.disable_search_threshold) { + this.container.addClass("chzn-container-single-nosearch"); + } else { + this.container.removeClass("chzn-container-single-nosearch"); + } + } + content = ''; + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + data = _ref[_i]; + if (data.group) { + content += this.result_add_group(data); + } else if (!data.empty) { + content += this.result_add_option(data); + if (data.selected && this.is_multiple) { + this.choice_build(data); + } else if (data.selected && !this.is_multiple) { + this.selected_item.find("span").text(data.text); + if (this.allow_single_deselect) { + this.single_deselect_control_build(); + } + } + } + } + this.search_field_disabled(); + this.show_search_field_default(); + this.search_field_scale(); + this.search_results.html(content); + return this.parsing = false; + }; + Chosen.prototype.result_add_group = function(group) { + if (!group.disabled) { + group.dom_id = this.container_id + "_g_" + group.array_index; + return '
  • ' + $("
    ").text(group.label).html() + '
  • '; + } else { + return ""; + } + }; + Chosen.prototype.result_do_highlight = function(el) { + var high_bottom, high_top, maxHeight, visible_bottom, visible_top; + if (el.length) { + this.result_clear_highlight(); + this.result_highlight = el; + this.result_highlight.addClass("highlighted"); + maxHeight = parseInt(this.search_results.css("maxHeight"), 10); + visible_top = this.search_results.scrollTop(); + visible_bottom = maxHeight + visible_top; + high_top = this.result_highlight.position().top + this.search_results.scrollTop(); + high_bottom = high_top + this.result_highlight.outerHeight(); + if (high_bottom >= visible_bottom) { + return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0); + } else if (high_top < visible_top) { + return this.search_results.scrollTop(high_top); + } + } + }; + Chosen.prototype.result_clear_highlight = function() { + if (this.result_highlight) { + this.result_highlight.removeClass("highlighted"); + } + return this.result_highlight = null; + }; + Chosen.prototype.results_show = function() { + var dd_top; + if (!this.is_multiple) { + this.selected_item.addClass("chzn-single-with-drop"); + if (this.result_single_selected) { + this.result_do_highlight(this.result_single_selected); + } + } + dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1; + this.dropdown.css({ + "top": dd_top + "px", + "left": 0 + }); + this.results_showing = true; + this.search_field.focus(); + this.search_field.val(this.search_field.val()); + return this.winnow_results(); + }; + Chosen.prototype.results_hide = function() { + if (!this.is_multiple) { + this.selected_item.removeClass("chzn-single-with-drop"); + } + this.result_clear_highlight(); + this.dropdown.css({ + "left": "-9000px" + }); + return this.results_showing = false; + }; + Chosen.prototype.set_tab_index = function(el) { + var ti; + if (this.form_field_jq.attr("tabindex")) { + ti = this.form_field_jq.attr("tabindex"); + this.form_field_jq.attr("tabindex", -1); + if (this.is_multiple) { + return this.search_field.attr("tabindex", ti); + } else { + this.selected_item.attr("tabindex", ti); + return this.search_field.attr("tabindex", -1); + } + } + }; + Chosen.prototype.show_search_field_default = function() { + if (this.is_multiple && this.choices < 1 && !this.active_field) { + this.search_field.val(this.default_text); + return this.search_field.addClass("default"); + } else { + this.search_field.val(""); + return this.search_field.removeClass("default"); + } + }; + Chosen.prototype.search_results_mouseup = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target.length) { + this.result_highlight = target; + return this.result_select(evt); + } + }; + Chosen.prototype.search_results_mouseover = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target) { + return this.result_do_highlight(target); + } + }; + Chosen.prototype.search_results_mouseout = function(evt) { + if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) { + return this.result_clear_highlight(); + } + }; + Chosen.prototype.choices_click = function(evt) { + evt.preventDefault(); + if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) { + return this.results_show(); + } + }; + Chosen.prototype.choice_build = function(item) { + var choice_id, link; + choice_id = this.container_id + "_c_" + item.array_index; + this.choices += 1; + this.search_container.before('
  • ' + item.html + '
  • '); + link = $('#' + choice_id).find("a").first(); + return link.click(__bind(function(evt) { + return this.choice_destroy_link_click(evt); + }, this)); + }; + Chosen.prototype.choice_destroy_link_click = function(evt) { + evt.preventDefault(); + if (!this.is_disabled) { + this.pending_destroy_click = true; + return this.choice_destroy($(evt.target)); + } else { + return evt.stopPropagation; + } + }; + Chosen.prototype.choice_destroy = function(link) { + this.choices -= 1; + this.show_search_field_default(); + if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) { + this.results_hide(); + } + this.result_deselect(link.attr("rel")); + return link.parents('li').first().remove(); + }; + Chosen.prototype.results_reset = function(evt) { + this.form_field.options[0].selected = true; + this.selected_item.find("span").text(this.default_text); + this.show_search_field_default(); + $(evt.target).remove(); + this.form_field_jq.trigger("change"); + if (this.active_field) { + return this.results_hide(); + } + }; + Chosen.prototype.result_select = function(evt) { + var high, high_id, item, position; + if (this.result_highlight) { + high = this.result_highlight; + high_id = high.attr("id"); + this.result_clear_highlight(); + if (this.is_multiple) { + this.result_deactivate(high); + } else { + this.search_results.find(".result-selected").removeClass("result-selected"); + this.result_single_selected = high; + } + high.addClass("result-selected"); + position = high_id.substr(high_id.lastIndexOf("_") + 1); + item = this.results_data[position]; + item.selected = true; + this.form_field.options[item.options_index].selected = true; + if (this.is_multiple) { + this.choice_build(item); + } else { + this.selected_item.find("span").first().text(item.text); + if (this.allow_single_deselect) { + this.single_deselect_control_build(); + } + } + if (!(evt.metaKey && this.is_multiple)) { + this.results_hide(); + } + this.search_field.val(""); + this.form_field_jq.trigger("change"); + return this.search_field_scale(); + } + }; + Chosen.prototype.result_activate = function(el) { + return el.addClass("active-result"); + }; + Chosen.prototype.result_deactivate = function(el) { + return el.removeClass("active-result"); + }; + Chosen.prototype.result_deselect = function(pos) { + var result, result_data; + result_data = this.results_data[pos]; + result_data.selected = false; + this.form_field.options[result_data.options_index].selected = false; + result = $("#" + this.container_id + "_o_" + pos); + result.removeClass("result-selected").addClass("active-result").show(); + this.result_clear_highlight(); + this.winnow_results(); + this.form_field_jq.trigger("change"); + return this.search_field_scale(); + }; + Chosen.prototype.single_deselect_control_build = function() { + if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) { + return this.selected_item.find("span").first().after(""); + } + }; + Chosen.prototype.winnow_results = function() { + var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref; + startTime = new Date(); + this.no_results_clear(); + results = 0; + searchText = this.search_field.val() === this.default_text ? "" : $('
    ').text($.trim(this.search_field.val())).html(); + regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + if (!option.disabled && !option.empty) { + if (option.group) { + $('#' + option.dom_id).hide(); + } else if (!(this.is_multiple && option.selected)) { + found = false; + result_id = option.dom_id; + if (regex.test(option.html)) { + found = true; + results += 1; + } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) { + parts = option.html.replace(/\[|\]/g, "").split(" "); + if (parts.length) { + for (_j = 0, _len2 = parts.length; _j < _len2; _j++) { + part = parts[_j]; + if (regex.test(part)) { + found = true; + results += 1; + } + } + } + } + if (found) { + if (searchText.length) { + startpos = option.html.search(zregex); + text = option.html.substr(0, startpos + searchText.length) + '' + option.html.substr(startpos + searchText.length); + text = text.substr(0, startpos) + '' + text.substr(startpos); + } else { + text = option.html; + } + if ($("#" + result_id).html !== text) { + $("#" + result_id).html(text); + } + this.result_activate($("#" + result_id)); + if (option.group_array_index != null) { + $("#" + this.results_data[option.group_array_index].dom_id).show(); + } + } else { + if (this.result_highlight && result_id === this.result_highlight.attr('id')) { + this.result_clear_highlight(); + } + this.result_deactivate($("#" + result_id)); + } + } + } + } + if (results < 1 && searchText.length) { + return this.no_results(searchText); + } else { + return this.winnow_results_set_highlight(); + } + }; + Chosen.prototype.winnow_results_clear = function() { + var li, lis, _i, _len, _results; + this.search_field.val(""); + lis = this.search_results.find("li"); + _results = []; + for (_i = 0, _len = lis.length; _i < _len; _i++) { + li = lis[_i]; + li = $(li); + _results.push(li.hasClass("group-result") ? li.show() : !this.is_multiple || !li.hasClass("result-selected") ? this.result_activate(li) : void 0); + } + return _results; + }; + Chosen.prototype.winnow_results_set_highlight = function() { + var do_high, selected_results; + if (!this.result_highlight) { + selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; + do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); + if (do_high != null) { + return this.result_do_highlight(do_high); + } + } + }; + Chosen.prototype.no_results = function(terms) { + var no_results_html; + no_results_html = $('
  • ' + this.results_none_found + ' ""
  • '); + no_results_html.find("span").first().html(terms); + return this.search_results.append(no_results_html); + }; + Chosen.prototype.no_results_clear = function() { + return this.search_results.find(".no-results").remove(); + }; + Chosen.prototype.keydown_arrow = function() { + var first_active, next_sib; + if (!this.result_highlight) { + first_active = this.search_results.find("li.active-result").first(); + if (first_active) { + this.result_do_highlight($(first_active)); + } + } else if (this.results_showing) { + next_sib = this.result_highlight.nextAll("li.active-result").first(); + if (next_sib) { + this.result_do_highlight(next_sib); + } + } + if (!this.results_showing) { + return this.results_show(); + } + }; + Chosen.prototype.keyup_arrow = function() { + var prev_sibs; + if (!this.results_showing && !this.is_multiple) { + return this.results_show(); + } else if (this.result_highlight) { + prev_sibs = this.result_highlight.prevAll("li.active-result"); + if (prev_sibs.length) { + return this.result_do_highlight(prev_sibs.first()); + } else { + if (this.choices > 0) { + this.results_hide(); + } + return this.result_clear_highlight(); + } + } + }; + Chosen.prototype.keydown_backstroke = function() { + if (this.pending_backstroke) { + this.choice_destroy(this.pending_backstroke.find("a").first()); + return this.clear_backstroke(); + } else { + this.pending_backstroke = this.search_container.siblings("li.search-choice").last(); + return this.pending_backstroke.addClass("search-choice-focus"); + } + }; + Chosen.prototype.clear_backstroke = function() { + if (this.pending_backstroke) { + this.pending_backstroke.removeClass("search-choice-focus"); + } + return this.pending_backstroke = null; + }; + Chosen.prototype.keydown_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + if (stroke !== 8 && this.pending_backstroke) { + this.clear_backstroke(); + } + switch (stroke) { + case 8: + this.backstroke_length = this.search_field.val().length; + break; + case 9: + if (this.results_showing && !this.is_multiple) { + this.result_select(evt); + } + this.mouse_on_container = false; + break; + case 13: + evt.preventDefault(); + break; + case 38: + evt.preventDefault(); + this.keyup_arrow(); + break; + case 40: + this.keydown_arrow(); + break; + } + }; + Chosen.prototype.search_field_scale = function() { + var dd_top, div, h, style, style_block, styles, w, _i, _len; + if (this.is_multiple) { + h = 0; + w = 0; + style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; + styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; + for (_i = 0, _len = styles.length; _i < _len; _i++) { + style = styles[_i]; + style_block += style + ":" + this.search_field.css(style) + ";"; + } + div = $('
    ', { + 'style': style_block + }); + div.text(this.search_field.val()); + $('body').append(div); + w = div.width() + 25; + div.remove(); + if (w > this.f_width - 10) { + w = this.f_width - 10; + } + this.search_field.css({ + 'width': w + 'px' + }); + dd_top = this.container.height(); + return this.dropdown.css({ + "top": dd_top + "px" + }); + } + }; + Chosen.prototype.generate_random_id = function() { + var string; + string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char(); + while ($("#" + string).length > 0) { + string += this.generate_random_char(); + } + return string; + }; + return Chosen; + })(); + get_side_border_padding = function(elmt) { + var side_border_padding; + return side_border_padding = elmt.outerWidth() - elmt.width(); + }; + root.get_side_border_padding = get_side_border_padding; +}).call(this); diff --git a/app/assets/javascripts/commits.js b/app/assets/javascripts/commits.js index a62e9330..bef7ed74 100644 --- a/app/assets/javascripts/commits.js +++ b/app/assets/javascripts/commits.js @@ -7,3 +7,51 @@ $(document).ready(function(){ } }); }); + + + +var CommitsList = { + +ref:null, +limit:0, +offset:0, + +init: + function(ref, limit) { + this.ref=ref; + this.limit=limit; + this.offset=limit; + this.initLoadMore(); + $('.loading').show(); + }, + +getOld: + function() { + $('.loading').show(); + $.ajax({ + type: "GET", + url: location.href, + data: "limit=" + this.limit + "&offset=" + this.offset + "&ref=" + this.ref, + complete: function(){ $('.loading').hide()}, + dataType: "script"}); + }, + +append: + function(count, html) { + $("#commits_list").append(html); + if(count > 0) { + this.offset += count; + this.initLoadMore(); + } + }, + +initLoadMore: + function() { + $(window).bind('scroll', function(){ + if($(window).scrollTop() == $(document).height() - $(window).height()){ + $(window).unbind('scroll'); + CommitsList.getOld(); + } + }); + } +} diff --git a/app/assets/javascripts/modernizr-2.0.6.min.js b/app/assets/javascripts/modernizr-2.0.6.min.js new file mode 100755 index 00000000..4f00b719 --- /dev/null +++ b/app/assets/javascripts/modernizr-2.0.6.min.js @@ -0,0 +1,4 @@ +/* Modernizr 2.0.6 | MIT & BSD + * Contains: All core tests, html5shiv, yepnope, respond.js. Get your own custom build at www.modernizr.com/download/ + */ +;window.Modernizr=function(a,b,c){function I(){e.input=function(a){for(var b=0,c=a.length;b",a,""].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},w=function(b){if(a.matchMedia)return matchMedia(b).matches;var c;v("@media "+b+" { #"+i+" { position: absolute; } }",function(b){c=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position=="absolute"});return c},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y,z={}.hasOwnProperty,A;!D(z,c)&&!D(z.call,c)?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],c)};var H=function(c,d){var f=c.join(""),g=d.length;v(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9,e.csstransforms3d=j.csstransforms3d.offsetLeft===9,e.generatedcontent=j.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",o.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!D(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){for(var b=-1,c=p.length;++b";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var J in r)A(r,J)&&(y=J.toLowerCase(),e[y]=r[J](),u.push((e[y]?"":"no-")+y));e.input||I(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return;b=typeof b=="boolean"?b:!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},B(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b=u.minw)&&(!u.maxw||u.maxw&&l<=u.maxw))m[u.media]||(m[u.media]=[]),m[u.media].push(f[u.rules])}for(var t in g)g[t]&&g[t].parentNode===j&&j.removeChild(g[t]);for(var t in m){var v=c.createElement("style"),w=m[t].join("\n");v.type="text/css",v.media=t,v.styleSheet?v.styleSheet.cssText=w:v.appendChild(c.createTextNode(w)),n.appendChild(v),g.push(v)}j.insertBefore(n,o.nextSibling)}},s=function(a,b){var c=t();if(!!c){c.open("GET",a,!0),c.onreadystatechange=function(){c.readyState==4&&(c.status==200||c.status==304)&&b(c.responseText)};if(c.readyState==4)return;c.send()}},t=function(){var a=!1,b=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest}],c=b.length;while(c--){try{a=b[c]()}catch(d){continue}break}return function(){return a}}();m(),respond.update=m,a.addEventListener?a.addEventListener("resize",u,!1):a.attachEvent&&a.attachEvent("onresize",u)}}(this,Modernizr.mq("only all")),function(a,b,c){function k(a){return!a||a=="loaded"||a=="complete"}function j(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&g()}function i(a){var c=b.createElement("script"),d;c.src=a.s,c.onreadystatechange=c.onload=function(){!d&&k(c.readyState)&&(d=1,j(),c.onload=c.onreadystatechange=null)},m(function(){d||(d=1,j())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function h(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var e=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,j()):e(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){j()},0)):e(a)}},0)};e(c)}else c.onload=function(){d||(d=1,m(function(){j()},0))},a.e&&c.onload();m(function(){d||(d=1,j())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function g(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?h(a):i(a)},0):(a(),j()):q=0}function f(a,c,d,e,f,h){function i(){!o&&k(l.readyState)&&(r.r=o=1,!q&&j(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:d,s:c,e:h};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=d),l.onload=l.onreadystatechange=i,a=="img"?l.onerror=i:a=="script"&&(l.onerror=function(){r.e=r.r=1,g()}),p.splice(e,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,j())},H.errorTimeout)}function e(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?f(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&g());return this}function d(){var a=H;a.loader={load:e,i:0};return a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function f(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h .account-links, .account-box:hover > .arrow-up{display: block;} +header .account-links{background: white; display: none; border-radius: 5px; width: 100px; margin-top: 0; float: right; box-shadow: 0 1px 1px rgba(0,0,0,.2); } +header .account-links a{color: #666; padding: 6px 10px; display: block; text-shadow: none; border-bottom: 1px solid #eee} +header .account-links a:hover{background-color: #f1f1f1; text-shadow: none; color: #333} + +header .account-links a:first-child{ + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; +} + +header .account-links a:last-child{ + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; + -moz-border-radius-bottomright: 5px; + -moz-border-radius-bottomleft: 5px; + border-bottom-right-radius: 5px; + border-bottom-left-radius: 5px; + border-bottom: 0; +} + +header a.arrow-up{ + display: none; + width: 0; + height: 0; + float: right; + margin-right: 26px; + margin-bottom: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + + border-bottom: 5px solid white; +} +/* eo Account Box */ +input.search-input{float: left; text-shadow: none; width: 116px; background-image: url('icon-search.png') ; background-repeat: no-repeat; background-position: 10px; border-radius: 100px; border: 1px solid rgba(0,0,0,.7); box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 2px rgba(0,0,0,.4) inset ; background-color: #D2D5DA; background-color: rgba(255,255,255,.5); padding: 5px; padding-left: 26px; margin-top: 4px; margin-right: 10px } +input.search-input:focus{ background-color: white; width: 216px;} +input.search-input::-webkit-input-placeholder {color: #666} +/* eo Header */ + + +h2.icon{position: relative; padding-left: 40px; float: left; } +/*h2 a{font-weight: normal;}*/ +h2.icon span{background: #E3E5EA url('images.png'); height: 32px; width: 32px; left: 0; top: -5px; border-radius: 4px; display: inline-block; position: absolute} + + + +/* Dashboard Page */ +html, body { height: 100%; } + +body.dashboard-page h2.icon span{ background-position: 9px -69px; } +body.dashboard-page header{margin-bottom: 0} +body.dashboard-page .news-feed{padding-left: 1em; margin-right: 450px; margin-left: 1%} +body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; } +body.dashboard-page .news-feed h2{float: left;} +body.dashboard-page aside{ width: 420px; float: right; right: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; border-left: 1px solid #ccc } +body.dashboard-page aside h4{margin: 0; border-bottom: 1px solid #ccc; padding: 10px 10px; font-size: 11px; font-weight: bold; text-transform: uppercase;} +body.dashboard-page aside h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 4%; margin-top: -4px; display: block;} +body.dashboard-page aside .project-list {list-style: none; margin: 0; padding: 0;} +body.dashboard-page aside .project-list li a {background: white; color: #{$blue_link}; display: block; border-bottom: 1px solid #eee; padding: 14px 6% 14px 14px;} +body.dashboard-page aside .project-list li a:hover {background: #f1f1f1} +body.dashboard-page aside .project-list li a:hover span.arrow{background-color: #E3E5EA;} +body.dashboard-page aside .project-list li a span.project-name{font-size: 14px; display: block; margin-bottom: 8px} +body.dashboard-page aside .project-list li a span.time{color: #666; font-weight: normal; font-size: 11px} +body.dashboard-page aside .project-list li a span.arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999} +body.dashboard-page .news-feed .project-updates {margin-bottom: 20px; display: block; width: 100%;} +body.dashboard-page .news-feed .project-updates .data{ padding: 0} +body.dashboard-page .news-feed .project-updates a.project-update {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +body.dashboard-page .news-feed .project-updates a.project-update:last-child{border-bottom: 0} +body.dashboard-page .news-feed .project-updates a.project-update img{float: left; margin-right: 10px;} +body.dashboard-page .news-feed .project-updates a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;} +body.dashboard-page .news-feed .project-updates a.project-update span.update-title{margin-bottom: 10px} +body.dashboard-page .news-feed .project-updates a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;} +body.dashboard-page .news-feed .project-updates a.project-update span.update-author strong{font-weight: bold; font-style: normal;} +/* eo Dashboard Page */ + + +.grey-button.right{margin-top: 20px} + +/* Project Page */ + +body.project-page h2.icon .project-name, body.project-page h2.icon d{border: 1px solid #eee; padding: 5px 30px 5px 10px; border-radius: 5px; position: relative;} +body.project-page h2.icon .project-name i.arrow{float: right; + position: absolute; + right: 10px; + top: 13px; + display: block; + background: url('images.png') no-repeat -97px -29px; + width: 4px; + height: 5px; +} + + + +body.project-page h2.icon span{ background-position: -78px -68px; } +body.project-page .project-container{ position: relative; float: left; width: 100%; height: 100%; } +body.project-page .page-title{margin-bottom: 0} +body.project-page .project-sidebar {width: 220px; left: 0; top: 0; height: 100%; bottom: 0; position: absolute; background-color: #f7f7f7; border-left: 1px solid #ccc; float: left; display: inline-block; background: #f7f7f7; padding: 20px 0 20px 2%; margin: 0; } +body.project-page .project-sidebar input.text.git-url{ font-size: 12px; border-radius: 5px; color: #666; box-shadow: 0 1px 2px rgba(0,0,0,.2) inset; padding: 8px 14px 8px 30px; margin-bottom: 20px; background: white url('images.png') no-repeat 8px -40px;} +body.project-page .project-sidebar aside{width: 219px} +body.project-page .project-sidebar aside a{display: block; position: relative; background: white; padding: 15px 10px; border-bottom: 1px solid #eee} +body.project-page .project-sidebar aside a:first-child{ + -webkit-border-top-left-radius: 5px; + -moz-border-radius-topleft: 5px; + border-top-left-radius: 5px; +} +.project-page .project-sidebar aside a:last-child{ + -webkit-border-bottom-left-radius: 5px; + -moz-border-radius-bottomleft: 5px; + border-bottom-left-radius: 5px; +} +body.project-page .project-sidebar aside a:hover{background-color: #eee;} +body.project-page .project-sidebar aside a span.number{float: right; border-radius: 5px; text-shadow: none; background: rgba(0,0,0,.12); text-align: center; padding: 5px 8px; position: absolute; top: 10px; right: 10px} +body.project-page .project-sidebar aside a.current{background-color: #79c3e0; color: white; text-shadow: none; border-color: transparent} +body.project-page .project-content{ padding: 20px; display: block; margin-left: 250px } +body.project-page .project-content h2{ margin-top: 6px} +body.project-page .project-content .button.right{margin-left: 20px} +body.project-page table .commit a{color: #{$blue_link}} +body.project-page table th, body.project-page table td{ border-bottom: 1px solid #DEE2E3;} +body.project-page .fixed{position: fixed; } + +/* Commit Page */ +body.project-page.commits-page .commit-info{float: right;} +body.project-page.commits-page .commit-info data{ + padding: 4px 10px; + font-size: 11px; +} +body.project-page.commits-page .commit-info data.commit-button{ + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4)); + background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4); + background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4); + box-shadow: 0 -1px 0 white inset; + display: block; + border: 1px solid #eee; + border-radius: 5px; + margin-bottom: 2px; + position: relative; + padding-right: 20px; +} + + +body.project-page.commits-page .commit-button i{ + background: url('images.png') no-repeat -138px -27px; + width: 6px; + height: 9px; + float: right; + position: absolute; + top: 6px; + right: 5px; +} +body.project-page.commits-page .commits-date {display: block; width: 100%; margin-bottom: 20px} +body.project-page.commits-page .commits-date .data {padding: 0} +body.project-page.commits-page a.commit{padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +body.project-page.commits-page .commits-date a.commit {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} +body.project-page.commits-page .commits-date a.commit:last-child{border-bottom: 0} +body.project-page.commits-page .commits-date a.commit img{float: left; margin-right: 10px;} +body.project-page.commits-page .commits-date a.commit span.commit-title{display: block;} +body.project-page.commits-page .commits-date a.commit span.commit-title{margin-bottom: 10px} +body.project-page.commits-page .commits-date a.commit span.commit-author{color: #999; font-weight: normal; font-style: italic;} +body.project-page.commits-page .commits-date a.commit span.commit-author strong{font-weight: bold; font-style: normal;} + +/* eo Commit Page */ + +/* eo Project Page */ + + + + +/* Projects Page */ +body.projects-page h2.icon span{background-position: -31px -70px;} +body.projects-page .project-box.ui-box .data .repository {margin-bottom: 20px} +body.projects-page .project-box.ui-box .data .title span{ font-weight: bold;} +body.projects-page .project-box{width: 100%; margin-bottom: 3em} +body.projects-page .browse-code{margin-right: 10px} +/* eo Projects Page */ + + +/* ==|== non-semantic helper classes ======================================== */ +.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; } +.ir br { display: none; } +.hidden { display: none !important; visibility: hidden; } +.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } +.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } +.invisible { visibility: hidden; } +.clearfix:before, .clearfix:after { content: ""; display: table; } +.clearfix:after { clear: both; } +.clearfix { zoom: 1; } + + +/* ==|== media queries ====================================================== */ + +@media only screen and (min-width: 480px) { + + +} + +@media only screen and (min-width: 768px) { + +} + + + +/* ==|== print styles ======================================================= */ + +@media print { + * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } + a, a:visited { text-decoration: underline; } + a[href]:after { content: " (" attr(href) ")"; } + abbr[title]:after { content: " (" attr(title) ")"; } + .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } + pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } + thead { display: table-header-group; } + tr, img { page-break-inside: avoid; } + img { max-width: 100% !important; } + @page { margin: 0.5cm; } + p, h2, h3 { orphans: 3; widows: 3; } + h2, h3 { page-break-after: avoid; } +} diff --git a/app/assets/stylesheets/tags.css.css b/app/assets/stylesheets/tags.css.css new file mode 100644 index 00000000..afd458fd --- /dev/null +++ b/app/assets/stylesheets/tags.css.css @@ -0,0 +1,30 @@ +.tags-list { + padding : 0px 10px 10px 10px; + +} + +.tags-list a { + display: inline-block; + padding: 8px 11px 8px 11px; + margin: 1px 5px 0px 0px; + border-radius: 4px; + border: 1px solid #72bbdf; + background-color: #72bbdf; + color: #0f326d; + font-weight: bold; + font-size: 14px; +} + + +.small-tags a{ + font-size: 9px; + + display: inline-block; + padding: 2px 3px 1px 3px; + margin: 0px 3px 0px 0px; + border-radius: 2px; + background-color: #72bbdf; + color: #FFF; + text-shadow: none; + font-weight: bold; +} \ No newline at end of file diff --git a/app/controllers/admin/mailer_controller.rb b/app/controllers/admin/mailer_controller.rb index 05ad267f..458ad277 100644 --- a/app/controllers/admin/mailer_controller.rb +++ b/app/controllers/admin/mailer_controller.rb @@ -1,4 +1,5 @@ class Admin::MailerController < ApplicationController + layout "admin" before_filter :authenticate_user! before_filter :authenticate_admin! @@ -20,7 +21,7 @@ class Admin::MailerController < ApplicationController else render :file => 'notify/note_wall_email.html.haml', :layout => 'notify' end - rescue + rescue render :text => "Preview not avaialble" end @@ -29,7 +30,7 @@ class Admin::MailerController < ApplicationController @password = "DHasJKDHAS!" render :file => 'notify/new_user_email.html.haml', :layout => 'notify' - rescue + rescue render :text => "Preview not avaialble" end @@ -38,7 +39,7 @@ class Admin::MailerController < ApplicationController @user = @issue.assignee @project = @issue.project render :file => 'notify/new_issue_email.html.haml', :layout => 'notify' - rescue + rescue render :text => "Preview not avaialble" end end diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 55752619..21b25fc0 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -1,32 +1,18 @@ class Admin::ProjectsController < ApplicationController + layout "admin" before_filter :authenticate_user! before_filter :authenticate_admin! def index @admin_projects = Project.page(params[:page]) - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @admin_projects } - end end def show @admin_project = Project.find_by_code(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @admin_project } - end end def new @admin_project = Project.new - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @admin_project } - end end def edit @@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController @admin_project = Project.new(params[:project]) @admin_project.owner = current_user - respond_to do |format| - if @admin_project.save - format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' } - format.json { render json: @admin_project, status: :created, location: @admin_project } - else - format.html { render action: "new" } - format.json { render json: @admin_project.errors, status: :unprocessable_entity } - end + if @admin_project.save + redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' + else + render :action => "new" end end def update @admin_project = Project.find_by_code(params[:id]) - respond_to do |format| - if @admin_project.update_attributes(params[:project]) - format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' } - format.json { head :ok } - else - format.html { render action: "edit" } - format.json { render json: @admin_project.errors, status: :unprocessable_entity } - end + if @admin_project.update_attributes(params[:project]) + redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' + else + render :action => "edit" end end @@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController @admin_project = Project.find_by_code(params[:id]) @admin_project.destroy - respond_to do |format| - format.html { redirect_to admin_projects_url } - format.json { head :ok } - end + redirect_to admin_projects_url end end diff --git a/app/controllers/admin/team_members_controller.rb b/app/controllers/admin/team_members_controller.rb index bca9bfeb..d04d32a6 100644 --- a/app/controllers/admin/team_members_controller.rb +++ b/app/controllers/admin/team_members_controller.rb @@ -1,32 +1,18 @@ class Admin::TeamMembersController < ApplicationController + layout "admin" before_filter :authenticate_user! before_filter :authenticate_admin! def index @admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @admin_team_members } - end end def show @admin_team_member = UsersProject.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @admin_team_member } - end end def new @admin_team_member = UsersProject.new(params[:team_member]) - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @admin_team_member } - end end def edit @@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController @admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member.project_id = params[:team_member][:project_id] - respond_to do |format| - if @admin_team_member.save - format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' } - format.json { render json: @admin_team_member, status: :created, location: @team_member } - else - format.html { render action: "new" } - format.json { render json: @admin_team_member.errors, status: :unprocessable_entity } - end + if @admin_team_member.save + redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' + else + render action: "new" end end @@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController @admin_team_member = UsersProject.find(params[:id]) @admin_team_member.project_id = params[:team_member][:project_id] - respond_to do |format| - if @admin_team_member.update_attributes(params[:team_member]) - format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' } - format.json { head :ok } - else - format.html { render action: "edit" } - format.json { render json: @admin_team_member.errors, status: :unprocessable_entity } - end + if @admin_team_member.update_attributes(params[:team_member]) + redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' + else + render action: "edit" end end @@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController @admin_team_member = UsersProject.find(params[:id]) @admin_team_member.destroy - respond_to do |format| - format.html { redirect_to admin_team_members_url } - format.json { head :ok } - end + redirect_to admin_team_members_url end end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index e9ad1e55..1c008d90 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,32 +1,18 @@ class Admin::UsersController < ApplicationController + layout "admin" before_filter :authenticate_user! before_filter :authenticate_admin! def index @admin_users = User.page(params[:page]) - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @admin_users } - end end def show @admin_user = User.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - format.json { render json: @admin_user } - end end def new @admin_user = User.new(:projects_limit => 10) - - respond_to do |format| - format.html # new.html.erb - format.json { render json: @admin_user } - end end def edit @@ -36,7 +22,7 @@ class Admin::UsersController < ApplicationController def create admin = params[:user].delete("admin") - @admin_user = User.new(params[:user]) + @admin_user = User.new(params[:user]) @admin_user.admin = (admin && admin.to_i > 0) respond_to do |format| @@ -54,8 +40,8 @@ class Admin::UsersController < ApplicationController def update admin = params[:user].delete("admin") if params[:user][:password].empty? - params[:user].delete(:password) - params[:user].delete(:password_confirmation) + params[:user].delete(:password) + params[:user].delete(:password_confirmation) end @admin_user = User.find(params[:id]) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 047c6cb7..782612c0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,7 @@ class ApplicationController < ActionController::Base before_filter :authenticate_user! + before_filter :view_style + protect_from_forgery helper_method :abilities, :can? @@ -8,7 +10,17 @@ class ApplicationController < ActionController::Base render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false end - protected + layout :layout_by_resource + + protected + + def layout_by_resource + if devise_controller? + "devise" + else + "application" + end + end def abilities @abilities ||= Six.new @@ -18,7 +30,7 @@ class ApplicationController < ActionController::Base abilities.allowed?(object, action, subject) end - def project + def project @project ||= Project.find_by_code(params[:project_id]) end @@ -47,19 +59,13 @@ class ApplicationController < ActionController::Base end def load_refs - @branch = unless params[:branch].blank? - params[:branch] - else - nil - end - - @tag = unless params[:tag].blank? - params[:tag] - else - nil - end - - @ref = @branch || @tag || "master" + unless params[:ref].blank? + @ref = params[:ref] + else + @branch = params[:branch].blank? ? nil : params[:branch] + @tag = params[:tag].blank? ? nil : params[:tag] + @ref = @branch || @tag || "master" + end end def render_404 @@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base def require_non_empty_project redirect_to @project unless @project.repo_exists? end + + def view_style + if params[:view_style] == "collapsed" + cookies[:view_style] = "collapsed" + elsif params[:view_style] == "fluid" + cookies[:view_style] = "" + end + + @view_mode = if cookies[:view_style] == "collapsed" + :fixed + else + :fluid + end + end + + def respond_with_notes + if params[:last_id] && params[:first_id] + @notes = @notes.where("id >= ?", params[:first_id]) + elsif params[:last_id] + @notes = @notes.where("id > ?", params[:last_id]) + elsif params[:first_id] + @notes = @notes.where("id < ?", params[:first_id]) + else + nil + end + end end diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 83071891..79703cf1 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -2,6 +2,7 @@ require "base64" class CommitsController < ApplicationController before_filter :project + layout "project" # Authorize before_filter :add_project_abilities @@ -12,11 +13,12 @@ class CommitsController < ApplicationController load_refs # load @branch, @tag & @ref @repo = project.repo + limit, offset = (params[:limit] || 20), (params[:offset] || 0) if params[:path] - @commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0) + @commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset) else - @commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0) + @commits = @repo.commits(@ref, limit, offset) end respond_to do |format| @@ -27,12 +29,12 @@ class CommitsController < ApplicationController def show @commit = project.repo.commits(params[:id]).first - @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit") + @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit").order("created_at DESC").limit(20) @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit") - respond_to do |format| - format.html # show.html.erb - format.js + respond_to do |format| + format.html + format.js { respond_with_notes } end end end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 2476b17e..1c50c66e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,6 @@ class DashboardController < ApplicationController def index @projects = current_user.projects.all + @active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse end end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 757ada94..7ff1ccb3 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -1,12 +1,13 @@ class IssuesController < ApplicationController before_filter :authenticate_user! - before_filter :project + before_filter :project before_filter :issue, :only => [:edit, :update, :destroy, :show] + layout "project" # Authorize before_filter :add_project_abilities before_filter :authorize_read_issue! - before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort] + before_filter :authorize_write_issue!, :only => [:new, :create, :close, :edit, :update, :sort] respond_to :js @@ -34,14 +35,19 @@ class IssuesController < ApplicationController end def show - @notes = @issue.notes + @notes = @issue.notes.order("created_at DESC").limit(20) @note = @project.notes.new(:noteable => @issue) + + respond_to do |format| + format.html + format.js { respond_with_notes } + end end def create @issue = @project.issues.new(params[:issue]) @issue.author = current_user - if @issue.save + if @issue.save && @issue.assignee != current_user Notify.new_issue_email(@issue).deliver end @@ -57,14 +63,13 @@ class IssuesController < ApplicationController end end - def destroy return access_denied! unless can?(current_user, :admin_issue, @issue) @issue.destroy respond_to do |format| - format.js { render :nothing => true } + format.js { render :nothing => true } end end @@ -78,7 +83,23 @@ class IssuesController < ApplicationController render :nothing => true end - protected + def search + terms = params['terms'] + + @project = Project.find(params['project']) + @issues = case params[:status].to_i + when 1 then @project.issues + when 2 then @project.issues.closed + when 3 then @project.issues.opened.assigned(current_user) + else @project.issues.opened + end + + @issues = @issues.where("title LIKE ? OR content LIKE ?", "%#{terms}%", "%#{terms}%") unless terms.blank? + + render :partial => 'issues' + end + + protected def issue @issue ||= @project.issues.find(params[:id]) diff --git a/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb index b0249375..84f47675 100644 --- a/app/controllers/keys_controller.rb +++ b/app/controllers/keys_controller.rb @@ -1,4 +1,5 @@ class KeysController < ApplicationController + layout "profile" respond_to :js def index @@ -24,7 +25,7 @@ class KeysController < ApplicationController respond_to do |format| format.html { redirect_to keys_url } - format.js { render :nothing => true } + format.js { render :nothing => true } end end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 46425664..ad9531e0 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -1,9 +1,9 @@ class NotesController < ApplicationController - before_filter :project + before_filter :project # Authorize before_filter :add_project_abilities - before_filter :authorize_write_note!, :only => [:create] + before_filter :authorize_write_note!, :only => [:create] respond_to :js @@ -15,10 +15,9 @@ class NotesController < ApplicationController notify if params[:notify] == '1' end - respond_to do |format| format.html {redirect_to :back} - format.js + format.js end end @@ -30,11 +29,11 @@ class NotesController < ApplicationController @note.destroy respond_to do |format| - format.js { render :nothing => true } + format.js { render :nothing => true } end end - protected + protected def notify @project.users.reject { |u| u.id == current_user.id } .each do |u| diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb index c8477729..2e58f3e1 100644 --- a/app/controllers/profile_controller.rb +++ b/app/controllers/profile_controller.rb @@ -1,4 +1,5 @@ class ProfileController < ApplicationController + layout "profile" def show @user = current_user end @@ -14,7 +15,7 @@ class ProfileController < ApplicationController end def password_update - params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} + params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} @user = current_user if @user.update_attributes(params[:user]) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 54d19af7..2df5e9cc 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,15 +1,18 @@ class ProjectsController < ApplicationController - before_filter :project, :except => [:index, :new, :create] + before_filter :project, :except => [:index, :new, :create] + layout :determine_layout # Authorize before_filter :add_project_abilities - before_filter :authorize_read_project!, :except => [:index, :new, :create] - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] + before_filter :authorize_read_project!, :except => [:index, :new, :create] + before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy] before_filter :require_non_empty_project, :only => [:blob, :tree] def index - @projects = current_user.projects.all + source = current_user.projects + source = source.tagged_with(params[:tag]) unless params[:tag].blank? + @projects = source.all end def new @@ -23,7 +26,7 @@ class ProjectsController < ApplicationController @project = Project.new(params[:project]) @project.owner = current_user - Project.transaction do + Project.transaction do @project.save! @project.users_projects.create!(:admin => true, :read => true, :write => true, :user => current_user) end @@ -31,7 +34,7 @@ class ProjectsController < ApplicationController respond_to do |format| if @project.valid? format.html { redirect_to @project, notice: 'Project was successfully created.' } - format.js + format.js else format.html { render action: "new" } format.js @@ -51,10 +54,10 @@ class ProjectsController < ApplicationController respond_to do |format| if project.update_attributes(params[:project]) format.html { redirect_to project, :notice => 'Project was successfully updated.' } - format.js + format.js else format.html { render action: "edit" } - format.js + format.js end end end @@ -85,13 +88,12 @@ class ProjectsController < ApplicationController def wall @note = Note.new @notes = @project.common_notes.order("created_at DESC") + @notes = @notes.fresh.limit(20) - @notes = case params[:view] - when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day) - when "all" then @notes.all - when "day" then @notes.since(Date.today.at_beginning_of_day) - else @notes.fresh.limit(10) - end + respond_to do |format| + format.html + format.js { respond_with_notes } + end end # @@ -105,7 +107,7 @@ class ProjectsController < ApplicationController if params[:commit_id] @commit = @repo.commits(params[:commit_id]).first - else + else @commit = @repo.commits(@ref || "master").first end @@ -114,7 +116,7 @@ class ProjectsController < ApplicationController respond_to do |format| format.html # show.html.erb - format.js do + format.js do # diasbale cache to allow back button works response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" response.headers["Pragma"] = "no-cache" @@ -132,7 +134,7 @@ class ProjectsController < ApplicationController if @tree.is_a?(Grit::Blob) send_data(@tree.data, :type => @tree.mime_type, :disposition => 'inline', :filename => @tree.name) - else + else head(404) end rescue @@ -147,9 +149,17 @@ class ProjectsController < ApplicationController end end - protected + protected - def project + def project @project ||= Project.find_by_code(params[:id]) end + + def determine_layout + if @project && !@project.new_record? + "project" + else + "application" + end + end end diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index b31fe683..54ad6019 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -1,11 +1,12 @@ class SnippetsController < ApplicationController before_filter :authenticate_user! - before_filter :project + before_filter :project + layout "project" # Authorize before_filter :add_project_abilities before_filter :authorize_read_snippet! - before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort] + before_filter :authorize_write_snippet!, :only => [:new, :create, :close, :edit, :update, :sort] respond_to :html @@ -13,7 +14,7 @@ class SnippetsController < ApplicationController @snippets = @project.snippets end - def new + def new @snippet = @project.snippets.new end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb new file mode 100644 index 00000000..913bc62b --- /dev/null +++ b/app/controllers/tags_controller.rb @@ -0,0 +1,11 @@ +class TagsController < ApplicationController + def index + @tags = Project.tag_counts.order('count DESC') + @tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank? + + respond_to do |format| + format.html + format.json { render json: @tags.limit(8).map {|t| t.name}} + end + end +end diff --git a/app/controllers/team_members_controller.rb b/app/controllers/team_members_controller.rb index 84addf8d..8a4e32e5 100644 --- a/app/controllers/team_members_controller.rb +++ b/app/controllers/team_members_controller.rb @@ -1,10 +1,11 @@ class TeamMembersController < ApplicationController - before_filter :project + before_filter :project + layout "project" # Authorize before_filter :add_project_abilities before_filter :authorize_read_project! - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update] + before_filter :authorize_admin_project!, :only => [:new, :create, :destroy, :update] def show @team_member = project.users_projects.find(params[:id]) @@ -26,7 +27,7 @@ class TeamMembersController < ApplicationController respond_to do |format| format.js - format.html do + format.html do unless @team_member.valid? flash[:alert] = "User should have at least one role" end @@ -41,7 +42,7 @@ class TeamMembersController < ApplicationController respond_to do |format| format.html { redirect_to root_path } - format.js { render :nothing => true } + format.js { render :nothing => true } end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0895eb0d..70984804 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,6 +4,14 @@ module ApplicationHelper "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" end + def body_class(default_class = nil) + main = content_for(:body_class).blank? ? + default_class : + content_for(:body_class) + + [main, cookies[:view_style]].join(" ") + end + def commit_name(project, commit) if project.commit.id == commit.id "master" @@ -23,18 +31,33 @@ module ApplicationHelper end def last_commit(project) - if project.repo_exists? + if project.repo_exists? time_ago_in_words(project.commit.committed_date) + " ago" - else + else "Never" end + rescue + "Never" + end + + def grouped_options_refs + options = [ + ["Branch", @repo.heads.map(&:name) ], + [ "Tag", @project.tags ] + ] + + grouped_options_for_select(options, @ref) + end + + def markdown(text) + RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe end def search_autocomplete_source projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } default_nav = [ - { :label => "Keys", :url => keys_path }, - { :label => "Projects", :url => projects_path }, + { :label => "Keys", :url => keys_path }, + { :label => "Projects", :url => projects_path }, { :label => "Admin", :url => admin_root_path } ] @@ -42,10 +65,10 @@ module ApplicationHelper if @project && !@project.new_record? project_nav = [ - { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) }, - { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) }, - { :label => "#{@project.code} / Tree", :url => tree_project_path(@project) }, - { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) }, + { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) }, + { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) }, + { :label => "#{@project.code} / Tree", :url => tree_project_path(@project) }, + { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) }, { :label => "#{@project.code} / Team", :url => team_project_path(@project) } ] end diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index f1b54668..bc95f916 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -1,13 +1,13 @@ module CommitsHelper def diff_line(line, line_new = 0, line_old = 0) full_line = html_escape(line.gsub(/\n/, '')) - color = if line[0] == "+" + color = if line[0] == "+" full_line = " #{line_new} " + full_line "#DFD" - elsif line[0] == "-" + elsif line[0] == "-" full_line = "#{line_old}  " + full_line "#FDD" - else + else full_line = "#{line_old}#{line_new} " + full_line "none" end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index a94ddfc2..0560af5d 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -1,2 +1,30 @@ module DashboardHelper + def dashboard_feed_path(project, object) + case object.class.name.to_s + when "Issue" then project_issues_path(project, project.issues.find(object.id)) + when "Grit::Commit" then project_commit_path(project, project.repo.commits(object.id).first) + when "Note" + then + note = object + case note.noteable_type + when "Issue" then project_issue_path(project, note.noteable_id) + when "Snippet" then project_snippet_path(project, note.noteable_id) + when "Commit" then project_commit_path(project, :id => note.noteable_id) + else wall_project_path(project) + end + else "#" + end + rescue + "#" + end + + def dashboard_feed_title(object) + title = case object.class.name.to_s + when "Note" then markdown(object.note) + when "Issue" then object.title + when "Grit::Commit" then object.safe_message + else "" + end + "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " + end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 4a6923af..75ab737c 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -12,7 +12,7 @@ module ProjectsHelper else true end - rescue + rescue nil end end diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb index 236b6c8c..6a91d616 100644 --- a/app/helpers/snippets_helper.rb +++ b/app/helpers/snippets_helper.rb @@ -1,2 +1,11 @@ module SnippetsHelper + def lifetime_select_options + options = [ + ['forever', nil], + ['1 day', "#{Date.current + 1.day}"], + ['1 week', "#{Date.current + 1.week}"], + ['1 month', "#{Date.current + 1.month}"] + ] + options_for_select(options) + end end diff --git a/app/models/ability.rb b/app/models/ability.rb index b822f630..5ab70650 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -17,14 +17,14 @@ class Ability :read_issue, :read_snippet, :read_team_member, - :read_note + :read_note ] if project.readers.include?(user) rules << [ :write_project, :write_issue, :write_snippet, - :write_note + :write_note ] if project.writers.include?(user) rules << [ @@ -32,13 +32,13 @@ class Ability :admin_issue, :admin_snippet, :admin_team_member, - :admin_note + :admin_note ] if project.admins.include?(user) rules.flatten end - class << self + class << self [:issue, :note, :snippet].each do |name| define_method "#{name}_abilities" do |user, subject| if subject.author == user @@ -48,7 +48,7 @@ class Ability :"admin_#{name}" ] else - subject.respond_to?(:project) ? + subject.respond_to?(:project) ? project_abilities(user, subject.project) : [] end end diff --git a/app/models/issue.rb b/app/models/issue.rb index 904965ac..f649cacb 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base validates_presence_of :assignee_id validates_presence_of :author_id + delegate :name, + :email, + :to => :author, + :prefix => true + validates :title, :presence => true, :length => { :within => 0..255 } - - validates :content, - :presence => true, - :length => { :within => 0..2000 } + + #validates :content, + #:presence => true, + #:length => { :within => 0..2000 } scope :critical, where(:critical => true) scope :non_critical, where(:critical => false) @@ -30,7 +35,7 @@ class Issue < ActiveRecord::Base def today? Date.today == created_at.to_date end - + def new? today? && created_at == updated_at end diff --git a/app/models/key.rb b/app/models/key.rb index 29dcbbce..5fe30734 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -8,7 +8,7 @@ class Key < ActiveRecord::Base validates :key, :presence => true, :uniqueness => true, - :length => { :within => 0..1024 } + :length => { :within => 0..1600 } before_save :set_identifier after_save :update_gitosis @@ -17,11 +17,11 @@ class Key < ActiveRecord::Base def set_identifier self.identifier = "#{user.identifier}_#{Time.now.to_i}" end - + def update_gitosis Gitosis.new.configure do |c| c.update_keys(identifier, key) - + projects.each do |project| c.update_project(project.path, project.gitosis_writers) end diff --git a/app/models/note.rb b/app/models/note.rb index e3dabce4..3c59efef 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -7,18 +7,23 @@ class Note < ActiveRecord::Base belongs_to :author, :class_name => "User" - attr_protected :author, :author_id + delegate :name, + :email, + :to => :author, + :prefix => true + + attr_protected :author, :author_id validates_presence_of :project validates :note, :presence => true, - :length => { :within => 0..255 } + :length => { :within => 0..5000 } - validates :attachment, - :file_size => { - :maximum => 10.megabytes.to_i - } + validates :attachment, + :file_size => { + :maximum => 10.megabytes.to_i + } scope :common, where(:noteable_id => nil) diff --git a/app/models/project.rb b/app/models/project.rb index 5262e552..de68f451 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -9,6 +9,8 @@ class Project < ActiveRecord::Base has_many :notes, :dependent => :destroy has_many :snippets, :dependent => :destroy + acts_as_taggable + validates :name, :uniqueness => true, :presence => true, @@ -20,7 +22,7 @@ class Project < ActiveRecord::Base :format => { :with => /^[a-zA-Z0-9_\-]*$/, :message => "only letters, digits & '_' '-' allowed" }, :length => { :within => 0..255 } - + validates :description, :length => { :within => 0..2000 } @@ -57,13 +59,13 @@ class Project < ActiveRecord::Base c.update_project(path, gitosis_writers) end end - + def destroy_gitosis_project Gitosis.new.configure do |c| c.destroy_project(self) end end - + def add_access(user, *access) opts = { :user => user } access.each { |name| opts.merge!(name => true) } @@ -102,12 +104,12 @@ class Project < ActiveRecord::Base def url_to_repo "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" end - + def path_to_repo GITOSIS["base_path"] + path + ".git" end - def repo + def repo @repo ||= Grit::Repo.new(path_to_repo) end @@ -119,32 +121,52 @@ class Project < ActiveRecord::Base repo rescue false end + def last_activity + updates(1).first + rescue + nil + end + + def last_activity_date + last_activity.try(:created_at) + end + + def updates(n = 3) + [ + fresh_commits(n), + issues.last(n), + notes.fresh.limit(n) + ].compact.flatten.sort do |x, y| + y.created_at <=> x.created_at + end[0...n] + end + def commit(commit_id = nil) if commit_id repo.commits(commit_id).first - else + else repo.commits.first end end - def heads + def heads @heads ||= repo.heads end - def fresh_commits - commits = heads.map do |h| - repo.commits(h.name, 10) + def fresh_commits(n = 10) + commits = heads.map do |h| + repo.commits(h.name, n) end.flatten.uniq { |c| c.id } commits.sort! do |x, y| y.committed_date <=> x.committed_date end - commits[0..10] + commits[0...n] end def commits_since(date) - commits = heads.map do |h| + commits = heads.map do |h| repo.log(h.name, nil, :since => date) end.flatten.uniq { |c| c.id } @@ -165,7 +187,7 @@ class Project < ActiveRecord::Base unless owner.can_create_project? errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it") end - rescue + rescue errors[:base] << ("Cant check your ability to create project") end diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 95d6a07d..5c61cf1c 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -13,7 +13,7 @@ class Snippet < ActiveRecord::Base validates :title, :presence => true, :length => { :within => 0..255 } - + validates :file_name, :presence => true, :length => { :within => 0..255 } @@ -22,9 +22,11 @@ class Snippet < ActiveRecord::Base :presence => true, :length => { :within => 0..10000 } + scope :fresh, order("created_at DESC") + scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) def self.content_types - [ + [ ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java", ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb", ".js", ".sh", ".coffee", ".yml", ".md" @@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base def colorize system_colorize(content, file_name) end + + def expired? + expires_at && expires_at < Time.current + end end # == Schema Information # @@ -47,5 +53,6 @@ end # created_at :datetime # updated_at :datetime # file_name :string(255) +# expires_at :datetime # diff --git a/app/models/user.rb b/app/models/user.rb index 7736599e..c90cf49f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,7 +5,7 @@ class User < ActiveRecord::Base :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model - attr_accessible :email, :password, :password_confirmation, :remember_me, + attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :projects_limit, :skype, :linkedin, :twitter has_many :users_projects, :dependent => :destroy diff --git a/app/views/admin/mailer/preview.html.haml b/app/views/admin/mailer/preview.html.haml index 7b723cb8..60e24588 100644 --- a/app/views/admin/mailer/preview.html.haml +++ b/app/views/admin/mailer/preview.html.haml @@ -1,29 +1,28 @@ %p This is page with preview for all system emails that are sent to user -%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system +%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system #accordion %h3 %a New user - %div + %div %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} %h3 %a New issue - %div + %div %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} - %h3 + %h3 %a Commit note %div %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} %h3 %a Issue note - %div + %div %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} %h3 %a Wall note - %div + %div %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} - -:javascript +:javascript $(function() { $( "#accordion" ).accordion(); }); diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 327561de..c529b82e 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,5 +1,5 @@ %table - %tr + %thead %th Name %th Code %th Path diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 68918941..fc2e6324 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -1,7 +1,7 @@ %p#notice= notice .span-8.colborder - %h2= @admin_project.name + %h2= @admin_project.name %p %b Name: @@ -22,16 +22,16 @@ .span-14 - %h2 Team + %h2 Team %table.round-borders %tr %th Name - %th Added + %th Added %th Web %th Git %th Admin - %th + %th - @admin_project.users_projects.each do |tm| %tr diff --git a/app/views/admin/team_members/index.html.haml b/app/views/admin/team_members/index.html.haml index bbd7a6c0..33f58fa5 100644 --- a/app/views/admin/team_members/index.html.haml +++ b/app/views/admin/team_members/index.html.haml @@ -1,14 +1,14 @@ - @admin_team_members.group_by(&:project).sort.each do |project, members| %h3= link_to project.name, [:admin, project] %table - %tr + %thead %th Name %th Email %th Read %th Git %th Manage - %th Added - %th + %th Added + %th %th %th - members.each do |tm| diff --git a/app/views/admin/team_members/show.html.haml b/app/views/admin/team_members/show.html.haml index bd30c7b0..29d1160c 100644 --- a/app/views/admin/team_members/show.html.haml +++ b/app/views/admin/team_members/show.html.haml @@ -11,7 +11,6 @@ %b Since: = @admin_team_member.updated_at - .span-10 .span-6 %b Access: diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index aa9df298..51b5d5c7 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -44,7 +44,7 @@ .field = f.label :twitter %br - = f.text_field :twitter + = f.text_field :twitter .clear %br .actions diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 3b5aa399..cbec1060 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,5 +1,5 @@ %table - %tr + %thead %th Admin %th Name %th Email diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml index cec6e3e1..b188d2ab 100644 --- a/app/views/admin/users/new.html.haml +++ b/app/views/admin/users/new.html.haml @@ -2,5 +2,4 @@ = render 'form' - = link_to 'Back', admin_users_path, :class => "right lbutton" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index aee73c38..5bc5bf9a 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -19,28 +19,27 @@ = @admin_user.skype %p %b LinkedIn: - = @admin_user.linkedin + = @admin_user.linkedin %p %b Twitter: = @admin_user.twitter - .clear = link_to 'Edit', edit_admin_user_path(@admin_user) \| = link_to 'Back', admin_users_path .span-14 - %h2 Projects + %h2 Projects %table.round-borders %tr %th Name - %th Added + %th Added %th Web %th Git %th Admin - %th + %th - @admin_user.users_projects.each do |tm| - project = tm.project diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml index 99823065..2d393993 100644 --- a/app/views/commits/_commits.html.haml +++ b/app/views/commits/_commits.html.haml @@ -1,22 +1,24 @@ - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| - .day-commits-table - .day-header + %div{ :class => "commits-date ui-box ui-box-small ui-box-big" } + .day-commits-table %h3= day.stamp("28 Aug, 2010") - %ul - - commits.each do |commit| - %li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) } - - if commit.author.email - = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" - - else - = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" - %p - %strong - = truncate(commit.safe_message, :length => 60) - = link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right" - = link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right" - %span - %span.author - = commit.author - = time_ago_in_words(commit.committed_date) - ago -= more_commits_link if @commits.size > 99 + .data + - commits.each do |commit| + %a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) } + %span.commit-info + %data.commit-button + = truncate(commit.id.to_s, :length => 16) + %i + %data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"} + Browse Code + - if commit.author_email + = image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" + - else + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" + %span.commit-title + %strong + = truncate(commit.safe_message, :length => 60) + %span.commit-author + %strong= commit.author_name + = time_ago_in_words(commit.committed_date) + ago diff --git a/app/views/commits/_diff.html.haml b/app/views/commits/_diff.html.haml index 2807e090..e385d9dd 100644 --- a/app/views/commits/_diff.html.haml +++ b/app/views/commits/_diff.html.haml @@ -8,7 +8,7 @@ .diff_file_header - if diff.deleted_file %strong{:id => "#{diff.b_path}"}= diff.a_path - - else + - else = link_to tree_file_project_path(@project, @commit.id, diff.b_path) do %strong{:id => "#{diff.b_path}"}= diff.b_path %br/ @@ -19,5 +19,5 @@ .diff_file_content_image %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - else - %p + %p %center No preview for this file type diff --git a/app/views/commits/_index.html.haml b/app/views/commits/_index.html.haml index e4c9cc6e..f1e4c7eb 100644 --- a/app/views/commits/_index.html.haml +++ b/app/views/commits/_index.html.haml @@ -6,4 +6,4 @@ %h1 Listing commits %div{:id => dom_id(@project)} = render "commits" -%br/ \ No newline at end of file +%br/ diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index 67033ade..1ef4a3c8 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -2,6 +2,7 @@ - line_new = 0 - lines_arr = diff.diff.lines.to_a - lines_arr.each do |line| + - next if line.match(/^--- \/dev\/null/) - next if line.match(/^--- a/) - next if line.match(/^\+\+\+ b/) - if line.match(/^@@ -/) @@ -12,10 +13,10 @@ = diff_line(line, line_new, line_old) - if line[0] == "+" - line_new += 1 - - elsif + - elsif - line[0] == "-" - line_old += 1 - - else + - else - line_new += 1 - line_old += 1 diff --git a/app/views/commits/index.html.haml b/app/views/commits/index.html.haml index 452e13f8..0dfb2cff 100644 --- a/app/views/commits/index.html.haml +++ b/app/views/commits/index.html.haml @@ -1,15 +1,28 @@ -%div - %h3 - .left - = form_tag project_commits_path(@project), :method => :get do - = select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" -   - .left.prepend-1 - = form_tag project_commits_path(@project), :method => :get do - = select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" - = text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"] - .clear - - if params[:path] - %h3{:style => "color:#555"} /#{params[:path]} - %div{:id => dom_id(@project)} - = render "commits" +- content_for(:body_class, "project-page commits-page") + +-#%a.right.button{:href => "#"} Download +-#-if can? current_user, :admin_project, @project + %a.right.button.blue{:href => "#"} EDIT +%h2.icon + %span + %d + = link_to project_commits_path(@project) do + = @project.name + - if params[:path] + \/ + %a{:href => "#"}= params[:path].split("/").join(" / ") + +.right= render :partial => "projects/refs", :locals => { :destination => project_commits_path(@project) } + +%div{:id => dom_id(@project)} + #commits_list= render "commits" +.clear +.loading{ :style => "display:none;"} + %center= image_tag "ajax-loader.gif" + + + +:javascript + $(function(){ + CommitsList.init("#{@ref}", 20); + }); diff --git a/app/views/commits/index.js.haml b/app/views/commits/index.js.haml new file mode 100644 index 00000000..39b7108c --- /dev/null +++ b/app/views/commits/index.js.haml @@ -0,0 +1,3 @@ +:plain + CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}"); + diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml index 3beeada8..b42b23de 100644 --- a/app/views/commits/show.html.haml +++ b/app/views/commits/show.html.haml @@ -1,5 +1,5 @@ %h3 - = "[ #{@commit.committer} ] #{truncate(@commit.safe_message)}" + = "[ #{@commit.author_name} ] #{truncate(@commit.safe_message, :length => 70)}" -#= link_to 'Back', project_commits_path(@project), :class => "button" %table.round-borders %tr @@ -7,33 +7,21 @@ %td= @commit.id %tr %td Author - %td= @commit.author - %tr - %td Commiter - %td= @commit.committer + %td= @commit.author_name %tr %td Commited Date - %td= @commit.committed_date + %td= @commit.committed_date.stamp("21 Aug 2011, 11:15pm") %tr %td Message - %td= @commit.safe_message + %td + %pre.commit_message + = preserve @commit.safe_message %tr %td Tree %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) .clear -#tabs - %ul - %li - %a{ :href => "#tabs-1" } Diff - %li - %a{ :href => "#tabs-2" } Comments - %span{ :class => "notes_count" }= @notes.count - %hr - #tabs-1 - = render "commits/diff" - #tabs-2 - = render "notes/notes" +%br -:javascript - $(function() { $( "#tabs" ).tabs(); }); += render "commits/diff" += render "notes/notes" diff --git a/app/views/commits/show.js.haml b/app/views/commits/show.js.haml index cec1fe28..ee31c0b8 100644 --- a/app/views/commits/show.js.haml +++ b/app/views/commits/show.js.haml @@ -1,8 +1 @@ --#:plain - $("#side-commit-preview").remove(); - var side = $("
    "); - side.html("#{escape_javascript(render "commits/show")}"); - $("##{dom_id(@project)}").parent().append(side); - $("##{dom_id(@project)}").addClass("span-14"); -:plain - $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); += render "notes/load" diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index f4ce9a17..eb2122df 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1 +1,40 @@ -timeline +- content_for(:body_class, "dashboard-page") + +#dashboard-content.dashboard-content.content + %aside + %h4 + - if current_user.can_create_project? + %a.button-small.button-green{:href => new_project_path} New Repository + Your Repositories + %ol.project-list + - @projects.each do |project| + %li + %a{:href => project_path(project)} + %span.arrow → + %span.project-name= project.name + %span.time + %strong Last activity: + = project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never" + #news-feed.news-feed + %h2.icon + %span> + Dashboard + - @active_projects.first(3).each do |project| + .project-box.project-updates.ui-box.ui-box-small.ui-box-big + %h3= project.name + .data + - project.updates.each do |update| + %a.project-update{:href => dashboard_feed_path(project, update)} + = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 + %span.update-title + = dashboard_feed_title(update) + %span.update-author + %strong= update.author_name + authored + = time_ago_in_words(update.created_at) + ago + %br + / .project-update + / .project-updates + / #news-feed +/ #dashboard-content diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index b7ae403c..5399a961 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -9,4 +9,4 @@
    <%= f.submit "Resend confirmation instructions" %>
    <% end %> -<%= render :partial => "devise/shared/links" %> \ No newline at end of file +<%= render :partial => "devise/shared/links" %> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index e75c9371..ff76588c 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -13,4 +13,4 @@
    <%= f.submit "Change my password" %>
    <% end %> -<%= render :partial => "devise/shared/links" %> \ No newline at end of file +<%= render :partial => "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index bccf0181..01cb3375 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,15 +1,8 @@ -

    Forgot your password?

    - -
    - <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
    <%= f.label :email %>
    - <%= f.email_field :email %>
    - -
    <%= f.submit "Send me reset password instructions", :class => "lbutton vm" %>
    - <% end %> -
    -
    - <%= render :partial => "devise/shared/links" %> -
    +<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :class => "login-box", :method => :post }) do |f| %> + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + <%= devise_error_messages! %> + <%= f.email_field :email, :placeholder => "Email", :class => "text top" %> +
    + <%= f.submit "Reset password", :class => "grey-button" %> +
    <%= render :partial => "devise/shared/links" %>
    +<% end %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 21de54f0..c17ff3f9 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,20 +1,12 @@ -

    Sign in

    +<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + <%= f.text_field :email, :class => "text top", :placeholder => "Email" %> + <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %> -
    - <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
    <%= f.label :email %>
    - <%= f.text_field :email %>
    - -
    <%= f.label :password %>
    - <%= f.password_field :password %>
    - - <% if devise_mapping.rememberable? -%> -
    <%= f.check_box :remember_me %> <%= f.label :remember_me %>
    - <% end -%> -
    -
    <%= f.submit "Sign in", :class => "lbutton vm" %>
    - <% end %> -
    -
    - <%= render :partial => "devise/shared/links" %> -
    + <% if devise_mapping.rememberable? -%> +
    <%= f.check_box :remember_me %> <%= f.label :remember_me %>
    + <% end -%> +
    + <%= f.submit "Sign in", :class => "grey-button" %> +
    <%= render :partial => "devise/shared/links" %>
    +<% end %> diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb index eab783a4..33b1120f 100644 --- a/app/views/devise/shared/_links.erb +++ b/app/views/devise/shared/_links.erb @@ -22,4 +22,4 @@ <%- resource_class.omniauth_providers.each do |provider| %> <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
    <% end -%> -<% end -%> \ No newline at end of file +<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index c6cdcfe5..b787e648 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -9,4 +9,4 @@
    <%= f.submit "Resend unlock instructions" %>
    <% end %> -<%= render :partial => "devise/shared/links" %> \ No newline at end of file +<%= render :partial => "devise/shared/links" %> diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index eae0ee0f..80f19d62 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -7,10 +7,10 @@ .span-8 = f.label :title - = f.text_field :title, :style => "width:450px" - .span-8 - = f.label :content - = f.text_area :content, :style => "width:450px; height:130px" + = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 + -#.span-8 + -#= f.label :content + -#= f.text_area :content, :style => "width:450px; height:130px" .span-8.append-bottom = f.label :assignee_id = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index 42e8371a..d758fed5 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,12 +1,11 @@ %table.round-borders#issues-table - %tr + %thead - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - %th + %th %th Assignee %th ID %th Title %th Closed? - %th - @issues.critical.each do |issue| = render(:partial => 'show', :locals => {:issue => issue}) diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index fcac006e..72b99b04 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,18 +1,27 @@ %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } - - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" + - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0") %td = image_tag "move.png" , :class => [:handle, :left] %td = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" - = truncate issue.assignee.name, :lenght => 20 + = issue.assignee.name %td ##{issue.id} %td - = html_escape issue.title + = truncate(html_escape(issue.title), :length => 200) + %br %br - if issue.critical %span.tag.high critical - if issue.today? %span.tag.today today + + .right + - if can?(current_user, :admin_issue, @project) || issue.author == current_user + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true + - if can?(current_user, :admin_issue, @project) || issue.author == current_user +   + = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" + -#- if issue.author == current_user -#%span.tag.yours yours -#- if issue.notes.count > 0 @@ -21,13 +30,8 @@ -#notes %td - if can? current_user, :write_issue, @project - = form_for([@project, issue], :remote => true) do |f| + = form_for([@project, issue], :remote => true) do |f| = f.check_box :closed, :onclick => "$(this).parent().submit();" = hidden_field_tag :status_only, true - - else + - else = check_box_tag "closed", 1, issue.closed, :disabled => true - %td - - if can?(current_user, :admin_issue, @project) || issue.author == current_user - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true - - if can?(current_user, :admin_issue, @project) || issue.author == current_user - = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}" diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 6f4548a8..21e455b9 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -1,28 +1,52 @@ %div - - if can? current_user, :write_issue, @project - .left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" - .right - = form_tag project_issues_path(@project), :method => :get do - .span-2 - = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues" - = label_tag "open_issues","Open" - .span-2 - = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues" - = label_tag "closed_issues","Closed" - .span-2 - = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues" - = label_tag "my_issues","To Me" - - .span-2 - = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues" - = label_tag "all_issues","All" + .top_panel_issues + - if can? current_user, :write_issue, @project + %div{:class => "left", :style => "margin-right: 10px;" } + = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" + = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do + = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } + = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } + + .right.issues_filter + = form_tag project_issues_path(@project), :method => :get do + .left + = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status" + = label_tag "open_issues","Open" + .left + = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status" + = label_tag "closed_issues","Closed" + .left + = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status" + = label_tag "my_issues","To Me" + .left + = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" + = label_tag "all_issues","All" #issues-table-holder= render "issues" %br :javascript - $('.delete-issue').live('ajax:success', function() { - $(this).closest('tr').fadeOut(); }); - + var href = $('.issue_search').parent().attr('action'); + var last_terms = ''; + + $('.issue_search').keyup(function() { + var terms = $(this).val(); + var project_id = $('#project_id').val(); + var status = $('.status:checked').val(); + if (terms != last_terms) { + last_terms = terms; + + if (terms.length >= 2 || terms.length == 0) { + $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { + $('#issues-table').html(response); + setSortable(); + }); + } + } + }); + + $('.delete-issue').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); updatePage();}); + function setSortable(){ $('#issues-table>tbody').sortable({ axis: 'y', diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index 199c80c8..dc4ab338 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -1,44 +1,51 @@ %h2 - = "Issue ##{@issue.id} - #{@issue.title}" - -.span-15 - = simple_format html_escape(@issue.content) + %strong + Issue + = "##{@issue.id}" + – + = html_escape(@issue.title) +.left.width-65p .issue_notes= render "notes/notes" -.span-8.right + + .loading{ :style => "display:none;"} + %center= image_tag "ajax-loader.gif" +.right.width-30p .span-8 - - if @issue.closed - %center.success Closed - - else - %center.error Open %table.round-borders %tr - %td Title: - %td - = truncate html_escape(@issue.title) - %tr - %td Project - %td - %strong= @issue.project.name - %tr - %td Author: + %td Author: %td = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" = @issue.author.name %tr - %td Assignee: + %td Assignee: %td = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = @issue.assignee.name + %tr + %td Tags + %td + - if @issue.critical + %span.tag.high critical + - else + %span.tag.normal normal + + - if @issue.today? + %span.tag.today today %tr %td Closed? %td - - if can? current_user, :write_issue, @project - = form_for([@project, @issue]) do |f| + - if can? current_user, :write_issue, @issue + = form_for([@project, @issue]) do |f| = f.check_box :closed, :onclick => "$(this).parent().submit();" = hidden_field_tag :status_only, true - - else + - else = check_box_tag "closed", 1, @issue.closed, :disabled => true + - if can?(current_user, :write_issue, @issue) + .clear + %br + = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true + .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}" .clear - diff --git a/app/views/issues/show.js.haml b/app/views/issues/show.js.haml index 5b9a34c0..ee31c0b8 100644 --- a/app/views/issues/show.js.haml +++ b/app/views/issues/show.js.haml @@ -1,2 +1 @@ -:plain - $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); += render "notes/load" diff --git a/app/views/issues/update.js.haml b/app/views/issues/update.js.haml index c365c3f5..137dba3c 100644 --- a/app/views/issues/update.js.haml +++ b/app/views/issues/update.js.haml @@ -2,11 +2,11 @@ - if @issue.valid? :plain $("##{dom_id(@issue)}").fadeOut(); -- else +- else - if @issue.valid? :plain $("#edit_issue_dialog").dialog("close"); - $.ajax({type: "GET", url: location.href, dataType: "script"}); + updatePage(); - else :plain $("#edit_issue_dialog").empty(); diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml index 416ae8f8..279b125f 100644 --- a/app/views/keys/index.html.haml +++ b/app/views/keys/index.html.haml @@ -10,6 +10,6 @@ = render(:partial => 'show', :locals => {:key => key}) :javascript - $('.delete-key').live('ajax:success', function() { - $(this).closest('tr').fadeOut(); }); + $('.delete-key').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml index 4b6eb2b5..4011485c 100644 --- a/app/views/layouts/_flash.html.haml +++ b/app/views/layouts/_flash.html.haml @@ -6,9 +6,9 @@ %h4= text :javascript $(function(){ - $("#flash_container").slideDown("slow"); - $("#flash_container").click(function(){ - $(this).slideUp("slow"); + $("#flash_container").slideDown("slow"); + $("#flash_container").click(function(){ + $(this).slideUp("slow"); }); setTimeout("hideFlash()",2000); }); diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb index 047f708b..6db1d389 100644 --- a/app/views/layouts/_head_panel.html.erb +++ b/app/views/layouts/_head_panel.html.erb @@ -1,27 +1,44 @@ -
    -
    -
    -
    - <%#= image_tag "git.png", :height => 40, :class => "left" %> - <%#= link_to "gitlab", root_path, :id => "logo" %> - - <%= text_field_tag "search", nil, :placeholder => "Search" %> - -
    -
    - <%= link_to truncate(@project.name, :length => 20), project_path(@project), :class => "current button" if @project && !@project.new_record? %> - <%= link_to 'Projects', projects_path, :class => current_page?(projects_path) ? "current button" : "button" %> - <%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %> - <%= link_to profile_path, :class => ((controller.controller_name == "keys" || controller.controller_name == "profile") ? "current button" : "button") do %> - <%= image_tag gravatar_icon(current_user.email) %> - <%= current_user.name.split(" ").first %> - <% end %> - <%= link_to 'Logout', destroy_user_session_path, :style => "border-left: 1px solid #666;", :class => "button", :method => :delete %> -
    -
    -
    -
    + +
    +

    + GITLAB +

    + + + + + + +
    + <% if current_user %> <%= javascript_tag do %> diff --git a/app/views/layouts/_page_title.html.haml b/app/views/layouts/_page_title.html.haml new file mode 100644 index 00000000..ea72b25a --- /dev/null +++ b/app/views/layouts/_page_title.html.haml @@ -0,0 +1,2 @@ +- if content_for?(:page_title) + = yield :page_title diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml new file mode 100644 index 00000000..e02dbe04 --- /dev/null +++ b/app/views/layouts/admin.html.haml @@ -0,0 +1,26 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} + #container + = render :partial => "layouts/flash" + = render :partial => "layouts/head_panel" + .project-container + .project-sidebar + .fixed + %aside + = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil + = link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil + = link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil + = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil + + .project-content + = yield diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 3eb99da6..9022ecb1 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,28 +2,16 @@ %html %head %title - GitLab #{" - #{@project.name}" if @project && !@project.new_record?} - = stylesheet_link_tag 'blueprint/screen', :media => "screen, projection" - = stylesheet_link_tag 'blueprint/print', :media => "print" - = stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection" - = stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection" - = stylesheet_link_tag 'jquery_ui/jquery-ui-1.8.16.custom', :media => "screen, projection" + GitLab = stylesheet_link_tag "application" = javascript_include_tag "application" = csrf_meta_tags - %link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/ = javascript_tag do REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; - %body#thebody - = render :partial => "layouts/flash" - - if user_signed_in? + %body{ :class => body_class, :id => yield(:boyd_id)} + #container + = render :partial => "layouts/flash" = render :partial => "layouts/head_panel" - .top_bar.container - = render :partial => "projects/top_menu" if @project && !@project.new_record? - = render :partial => "projects/projects_top_menu" if (controller.controller_name == "projects" && ["index", "new", "create"].include?(controller.action_name)) && !admin_namespace? - = render :partial => "profile/top_menu" if ["keys", "profile"].include?(controller.controller_name) - = render :partial => "admin/top_menu" if admin_namespace? - #content-container.container - .span-24 - = yield + = render :partial => "layouts/page_title" + = yield diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml new file mode 100644 index 00000000..32964663 --- /dev/null +++ b/app/views/layouts/devise.html.haml @@ -0,0 +1,14 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body.login-page + = render :partial => "layouts/flash" + = yield diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml new file mode 100644 index 00000000..2fd30dcd --- /dev/null +++ b/app/views/layouts/profile.html.haml @@ -0,0 +1,28 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} + #container + = render :partial => "layouts/flash" + = render :partial => "layouts/head_panel" + .project-container + .project-sidebar + .fixed + %aside + = link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil + = link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil + = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do + Keys + - unless current_user.keys.empty? + %span{ :class => "number" }= current_user.keys.count + + .project-content + = yield diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml new file mode 100644 index 00000000..ee6581ec --- /dev/null +++ b/app/views/layouts/project.html.haml @@ -0,0 +1,44 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body{ :class => body_class('project-page'), :id => yield(:boyd_id)} + #container + = render :partial => "layouts/flash" + = render :partial => "layouts/head_panel" + .project-container + .project-sidebar + .fixed + %input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo} + %aside + = link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil + = link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil + = link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil + = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do + Team + - if @project.users_projects.count > 0 + %span{ :class => "number" }= @project.users_projects.count + = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do + Issues + - if @project.issues.opened.count > 0 + %span{ :class => "number" }= @project.issues.opened.count + = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do + Wall + - if @project.common_notes.count > 0 + %span{ :class => "number" }= @project.common_notes.count + = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do + Snippets + - if @project.snippets.count > 0 + %span{ :class => "number" }= @project.snippets.non_expired.count + - if @commit + = link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil + + .project-content + = yield diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index ca56a245..86f0b779 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -10,7 +10,7 @@ %div = f.label :note - %cite (255 symbols only) + %cite %br = f.text_area :note, :size => 255 @@ -22,7 +22,7 @@ = check_box_tag :notify, 1, true = label_tag :notify, "Notify project team about your note" - + .clear %br = f.submit 'Add note', :class => "lbutton vm", :id => "submit_note" diff --git a/app/views/notes/_load.js.haml b/app/views/notes/_load.js.haml new file mode 100644 index 00000000..c7ec9ed3 --- /dev/null +++ b/app/views/notes/_load.js.haml @@ -0,0 +1,17 @@ +- unless @notes.blank? + + - if params[:last_id] && params[:first_id] + :plain + NoteList.replace(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + + + - elsif params[:last_id] + :plain + NoteList.prepend(#{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + + - elsif params[:first_id] + :plain + NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}"); + + - else + :plain diff --git a/app/views/notes/_notes.html.haml b/app/views/notes/_notes.html.haml index 2d110162..4a5c3aab 100644 --- a/app/views/notes/_notes.html.haml +++ b/app/views/notes/_notes.html.haml @@ -1,28 +1,26 @@ -- if controller.action_name == "wall" - %ul#notes-list= render "notes/notes_list" - -- else - %ul#notes-list= render "notes/notes_list" - %br - %br - - if can? current_user, :write_note, @project - = render "notes/form" +- if can? current_user, :write_note, @project + = render "notes/form" +.clear +%hr +%ul#notes-list= render "notes/notes_list" :javascript - $('.delete-note').live('ajax:success', function() { - $(this).closest('li').fadeOut(); }); + $('.delete-note').live('ajax:success', function() { + $(this).closest('li').fadeOut(); }); $("#new_note").live("ajax:before", function(){ - $("#submit_note").attr("disabled", "disabled"); + $("#submit_note").attr("disabled", "disabled"); }) $("#new_note").live("ajax:complete", function(){ - $("#submit_note").removeAttr("disabled"); + $("#submit_note").removeAttr("disabled"); }) - -- if ["issues", "projects"].include?(controller.controller_name) - :javascript - $(function(){ - var int =self.setInterval("updatePage()", 20000); + $(function(){ + $("#note_note").live("click", function(){ + $(this).css("height", "100px"); + $('.attach_holder').show(); }); + + NoteList.init("wall", #{@notes.last.try(:id) || 0}, #{@notes.first.try(:id) || 0}); + }); diff --git a/app/views/notes/_show.html.haml b/app/views/notes/_show.html.haml index ee9f9ffa..27cb3874 100644 --- a/app/views/notes/_show.html.haml +++ b/app/views/notes/_show.html.haml @@ -1,17 +1,17 @@ -%li{:id => dom_id(note)} - %div.note_author - = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" - %div.note_content.left - = simple_format(html_escape(note.note)) - - if note.attachment.url - Attachment: - = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" - %br - %span.author= note.author.name - %cite.ago +%li{:id => dom_id(note), :class => "note"} + = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" + %div.note-author + %strong= note.author_name + %cite.cgray = time_ago_in_words(note.updated_at) ago - %br - - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - = link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative" + - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) + = link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right" + + %div.note-title + = markdown(note.note) + - if note.attachment.url + .right + %span.file + = link_to note.attachment_identifier, note.attachment.url, :target => "_blank" .clear diff --git a/app/views/notes/create.js.haml b/app/views/notes/create.js.haml index 15371dbc..cf804493 100644 --- a/app/views/notes/create.js.haml +++ b/app/views/notes/create.js.haml @@ -1,11 +1,11 @@ - if @note.valid? :plain $("#new_note .errors").remove(); - updatePage(); $('#note_note').val(""); + NoteList.prepend(#{@note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => @note})}"); - else :plain $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); -:plain +:plain $("#submit_note").removeAttr("disabled"); diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml index 213a7379..1a5a603a 100644 --- a/app/views/notify/new_issue_email.html.haml +++ b/app/views/notify/new_issue_email.html.haml @@ -10,9 +10,9 @@ %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:align => "left", :style => "padding: 20px 0 0;"} %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} - = link_to project_issue_url(@project, @issue) do + = link_to project_issue_url(@project, @issue) do = "Issue ##{@issue.id.to_s}" - = truncate(@issue.title, :length => 45) + = truncate(@issue.title, :length => 45) %br %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} = @issue.content diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index 969ea7e5..2d3abf2e 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -4,7 +4,7 @@ %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:align => "left", :style => "padding: 20px 0 0;"} %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} - Hi #{@user.name}! + Hi #{@user.name}! %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} Administrator created account for you. Now you are a member of company gitlab application. %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} diff --git a/app/views/notify/note_issue_email.html.haml b/app/views/notify/note_issue_email.html.haml index 242c97bf..7d8e2156 100644 --- a/app/views/notify/note_issue_email.html.haml +++ b/app/views/notify/note_issue_email.html.haml @@ -4,10 +4,10 @@ %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:align => "left", :style => "padding: 20px 0 0;"} %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} - New comment - - = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do + New comment - + = link_to project_issue_url(@project, @issue, :anchor => "note_#{@note.id}") do = "Issue ##{@issue.id.to_s}" - = truncate(@issue.title, :length => 35) + = truncate(@issue.title, :length => 35) %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %tr %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} diff --git a/app/views/notify/note_wall_email.html.haml b/app/views/notify/note_wall_email.html.haml index c9fdae12..a2bd5a76 100644 --- a/app/views/notify/note_wall_email.html.haml +++ b/app/views/notify/note_wall_email.html.haml @@ -4,7 +4,7 @@ %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %td{:align => "left", :style => "padding: 20px 0 0;"} %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} - New message on + New message on = link_to "Project Wall", wall_project_url(@project, :anchor => "note_#{@note.id}") %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} %tr diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 00ca98ef..2ddfda48 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -21,10 +21,15 @@ %td = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? %tr - %td + %td .left= f.label :code %cite.right http://yourserver/ %td= f.text_field :code, :placeholder => "example" + + %tr + %td= f.label :tag_list + %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field + .field = f.label :description %br/ @@ -39,10 +44,27 @@ = image_tag "ajax-loader.gif", :class => "append-bottom" - if @project.new_record? %h3.prepend-top Creating project & repository. Please wait for few minutes - - else + - else %h3.prepend-top Updating project & repository. Please wait for few minutes + :javascript - $('.new_project, .edit_project').bind('ajax:before', function() { - $(this).find(".form_content").hide(); + $('.new_project, .edit_project').bind('ajax:before', function() { + $(this).find(".form_content").hide(); $('.ajax_loader').show(); - }); + }); + +:javascript + $(function(){ + var tag_field = $('#tag_field').tagify(); + + tag_field.tagify('inputField').autocomplete({ + source: '/tags.json' + }); + + + $('form').submit( function() { + var tag_field = $('#tag_field') + tag_field.val( tag_field.tagify('serialize') ); + return true; + }); + }) diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml index aec61ffb..7976b11f 100644 --- a/app/views/projects/_list.html.haml +++ b/app/views/projects/_list.html.haml @@ -10,13 +10,18 @@ - @projects.each do |project| %tr{ :class => "project", :url => project_path(project) } - %td= project.name + %td + = project.name + .small-tags + - project.tag_list.each do |tag| + = link_to tag, "/tags/#{tag}" + %td= truncate project.url_to_repo %td= project.code %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled - %td + %td -if can? current_user, :admin_project, project = link_to 'Edit', edit_project_path(project), :class => "lbutton positive" %br diff --git a/app/views/projects/_projects_top_menu.html.haml b/app/views/projects/_projects_top_menu.html.haml index f80f28a8..9e199183 100644 --- a/app/views/projects/_projects_top_menu.html.haml +++ b/app/views/projects/_projects_top_menu.html.haml @@ -11,7 +11,7 @@ $(".list").toggle(); if($(".tile").is(":visible")){ $.cookie('project_view', 'tile', { expires: 14 }); - } else { + } else { $.cookie('project_view', 'list', { expires: 14 }); } } diff --git a/app/views/projects/_recent_commits.html.haml b/app/views/projects/_recent_commits.html.haml index 3157c356..b34470d6 100644 --- a/app/views/projects/_recent_commits.html.haml +++ b/app/views/projects/_recent_commits.html.haml @@ -6,8 +6,8 @@ = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" %p{:style => "margin-bottom: 3px;"} %strong - = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) - + = link_to truncate(commit.safe_message, :length => 60), project_commit_path(@project, :id => commit.id) + %span %span.author = commit.author.name.force_encoding("UTF-8") diff --git a/app/views/projects/_recent_messages.html.haml b/app/views/projects/_recent_messages.html.haml index 67f3449b..e5fb28b9 100644 --- a/app/views/projects/_recent_messages.html.haml +++ b/app/views/projects/_recent_messages.html.haml @@ -40,7 +40,7 @@ %p{:style => "margin-bottom: 3px;"} %span.author = note.author.name - = link_to truncate(note.note, :length => 200), link_to_item + "#note_#{note.id}" + = link_to markdown(truncate(note.note, :length => 200)), link_to_item + "#note_#{note.id}" - if note.attachment.url %br Attachment: diff --git a/app/views/projects/_refs.html.haml b/app/views/projects/_refs.html.haml new file mode 100644 index 00000000..60b17c7f --- /dev/null +++ b/app/views/projects/_refs.html.haml @@ -0,0 +1,8 @@ += form_tag destination, :method => :get, :class => "project-refs-form" do + = select_tag "ref", grouped_options_refs, :onchange => "this.form.submit();", :class => "project-refs-select" + + +:javascript + $(function(){ + $('.project-refs-select').chosen(); + }) diff --git a/app/views/projects/_team.html.haml b/app/views/projects/_team.html.haml index bb906336..d12ccac7 100644 --- a/app/views/projects/_team.html.haml +++ b/app/views/projects/_team.html.haml @@ -2,7 +2,7 @@ %div#new-member-holder = link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "lbutton vm" %table.round-borders#team-table - %tr + %thead %th Name %th Email %th Web @@ -14,5 +14,5 @@ = render(:partial => 'team_members/show', :locals => {:member => up}) :javascript - $('.delete-team-member').live('ajax:success', function() { - $(this).closest('tr').fadeOut(); }); + $('.delete-team-member').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml index b2466d93..cc891f63 100644 --- a/app/views/projects/_tile.html.haml +++ b/app/views/projects/_tile.html.haml @@ -1,16 +1,22 @@ - @projects.in_groups_of(3, false) do |projects| - projects.each_with_index do |project, i| - %div{ :class => "project_thumb round-borders", :style => i == 2 ? "" : "margin-right:30px;" } - %div{ :class => "project", :url => project_path(project) } - %h2 - = image_tag gravatar_icon(project.name), :class => "left", :width => 40, :style => "padding-right:5px;" - = link_to ("/" + project.code), project_path(project), :style => "text-decoration:none" - %p= project.name - %p= project.url_to_repo - -#%p - Commit – - = last_commit(project) - %hr - = link_to "Browse Code", tree_project_path(project), :class => "lbutton" - = link_to "Commits", project_commits_path(project), :class => "lbutton", :style => "float:right;width:80px;" - .clear + %div.grid_1 + %div{ :class => "project-box ui-box ui-box-big" } + = link_to project_path(project) do + %h3= project.name + .data + %p.title.repository + %span Repository: + = project.url_to_repo + %p.title.activity + %span Last Activity: + - last_note = project.notes.last + = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never" + + %p.small-tags + - project.tag_list.each do |tag| + = link_to tag, "/tags/#{tag}" + + .buttons + %a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code + %a.commits.button.green{:href => project_commits_path(project)} Commits diff --git a/app/views/projects/_top_menu.html.haml b/app/views/projects/_top_menu.html.haml index 59f2533e..46586e6c 100644 --- a/app/views/projects/_top_menu.html.haml +++ b/app/views/projects/_top_menu.html.haml @@ -1,5 +1,4 @@ %div.top_project_menu - -#%span= link_to @project.code.capitalize, @project, :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil - if @project.repo_exists? %span= link_to image_tag("home.png", :width => 20), project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil @@ -23,7 +22,7 @@ = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do Snippets - if @project.snippets.count > 0 - %span{ :class => "top_menu_count" }= @project.snippets.count + %span{ :class => "top_menu_count" }= @project.snippets.non_expired.count - if @commit %span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil diff --git a/app/views/projects/_tree.html.haml b/app/views/projects/_tree.html.haml index 11b04a3b..8fdf72f0 100644 --- a/app/views/projects/_tree.html.haml +++ b/app/views/projects/_tree.html.haml @@ -1,31 +1,32 @@ -%h3 - .left - = form_tag tree_project_path(@project), :method => :get do - = select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" -   - .left.prepend-1 - = form_tag tree_project_path(@project), :method => :get do - = select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" - = text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url","one_click_select"] - .clear -%h3#tree-breadcrumbs - = link_to @project.name, tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true - - if params[:path] - - part_path = "" - - params[:path].split("\/").each do |part| - - part_path = File.join(part_path, part) unless part_path.empty? - - if part_path.empty? - - part_path = part - \/ - = link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true +-#%a.right.button{:href => "#"} Download +-#-if can? current_user, :admin_project, @project + %a.right.button.blue{:href => "#"} EDIT +#tree-breadcrumbs + %h2.icon + %span + %d + = link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true do + = @project.name + - if params[:path] + - part_path = "" + - params[:path].split("\/").each do |part| + - part_path = File.join(part_path, part) unless part_path.empty? + - if part_path.empty? + - part_path = part + \/ + = link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true +   + .right= render :partial => "projects/refs", :locals => { :destination => tree_project_path(@project) } +.clear + #tree-content-holder - if tree.is_a?(Grit::Blob) = render :partial => "projects/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } - else - contents = tree.contents %table#tree-slider.round-borders - %tr + %thead %th Name %th Last Update %th diff --git a/app/views/projects/empty.html.erb b/app/views/projects/empty.html.erb index 4c60facd..ffc1ebfa 100644 --- a/app/views/projects/empty.html.erb +++ b/app/views/projects/empty.html.erb @@ -40,7 +40,7 @@ eos

    Be careful!
    Project cant be recovered after destroy.

    - <%= link_to 'Destroy', @project, + <%= link_to 'Destroy', @project, :confirm => 'Are you sure?', :method => :delete, :class => "left button negative span-6", :style => "text-align:center" %>
    diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 888a72b6..ba860571 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -1,9 +1,20 @@ -- unless @projects.empty? - %div{:class => "tile", :style => view_mode_style("tile")} - = render "tile" - %div{:class => "list", :style => view_mode_style("list")} - = render "list" -- else - %center.prepend-top - %h2 - %cite Nothing here +- content_for(:body_class, "projects-page") +- content_for(:page_title) do + .container_4 + .grid_4 + - if current_user.can_create_project? + %a.grey-button.right{:href => new_project_path} Create new project + %h2.icon + %span + Projects + + %div.clear + - unless @projects.empty? + %div{:class => "tile", :style => view_mode_style("tile")} + = render "tile" + %div{:class => "list", :style => view_mode_style("list")} + = render "list" + - else + %center.prepend-top + %h2 + %cite Nothing here diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 85019ecb..ff352437 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -13,11 +13,16 @@ = label_tag "week_view","Week" .clear %hr -.span-11 +.left.width-49p %h3 Commits =render "projects/recent_commits" -.span-11.right +.right.width-49p %h3 Talk =render "projects/recent_messages" +:javascript + function updateDashboard(){ + $('#content-container').load("#{escape_javascript(project_path(@project))} #content-container>*"); + } + setInterval("updateDashboard()", 300000); diff --git a/app/views/projects/tree.js.haml b/app/views/projects/tree.js.haml index 60cbd199..eb08adb1 100644 --- a/app/views/projects/tree.js.haml +++ b/app/views/projects/tree.js.haml @@ -1,5 +1,5 @@ :plain - $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ + $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); $("#tree-holder table").show("slide", { direction: "right" }, 150); }); diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml index ed22478c..4f0ec41e 100644 --- a/app/views/projects/wall.html.haml +++ b/app/views/projects/wall.html.haml @@ -1,29 +1,6 @@ %div.wall_page - - if can? current_user, :write_note, @project - = render "notes/form" - .right - = form_tag wall_project_path(@project), :method => :get do - .span-2 - = radio_button_tag :view, "recent", (params[:view] || "recent") == "recent", :onclick => "this.form.submit()", :id => "recent_view" - = label_tag "recent_view","Recent" - .span-2 - = radio_button_tag :view, "day", params[:view] == "day", :onclick => "this.form.submit()", :id => "day_view" - = label_tag "day_view","Today" - .span-2 - = radio_button_tag :view, "week", params[:view] == "week", :onclick => "this.form.submit()", :id => "week_view" - = label_tag "week_view","Week" - .span-2 - = radio_button_tag :view, "all", params[:view] == "all", :onclick => "this.form.submit()", :id => "all_view" - = label_tag "all_view","All" - .clear - %br - %hr -= render "notes/notes" + = render "notes/notes" + +.loading{ :style => "display:none;"} + %center= image_tag "ajax-loader.gif" -:javascript - $(function(){ - $("#note_note").live("click", function(){ - $(this).css("height", "100px"); - $('.attach_holder').show(); - }); - }); diff --git a/app/views/projects/wall.js.haml b/app/views/projects/wall.js.haml index 5b9a34c0..ee31c0b8 100644 --- a/app/views/projects/wall.js.haml +++ b/app/views/projects/wall.js.haml @@ -1,2 +1 @@ -:plain - $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}"); += render "notes/load" diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index 571e2b06..5cd0f74a 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -12,11 +12,14 @@ %tr %td= f.label :file_name %td= f.text_field :file_name, :placeholder => "example.rb" + %tr + %td= f.label "Lifetime" + %td= f.select :expires_at, lifetime_select_options %tr %td{:colspan => 2} = f.label :content, "Code" %br = f.text_area :content, :style => "height:240px;width:932px;" - + .actions.prepend-top = f.submit 'Save', :class => "lbutton vm" diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml index 483ff42c..ddfba6bf 100644 --- a/app/views/snippets/_snippet.html.haml +++ b/app/views/snippets/_snippet.html.haml @@ -1,11 +1,12 @@ -%tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) } - %td - = image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" - = truncate snippet.author.name, :lenght => 20 - %td= html_escape snippet.title - %td= html_escape snippet.file_name - %td - - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user - = link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive" - - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user - = link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}" +- unless snippet.expired? + %tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) } + %td + = image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" + = truncate snippet.author.name, :lenght => 20 + %td= html_escape snippet.title + %td= html_escape snippet.file_name + %td + - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user + = link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive" + - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user + = link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}" diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 6e5dbde5..3f261000 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -8,7 +8,7 @@ %th Title %th File name %th - = render @snippets + = render @snippets.fresh :javascript - $('.delete-snippet').live('ajax:success', function() { - $(this).closest('tr').fadeOut(); }); + $('.delete-snippet').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 899950b7..757cdb11 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -1,22 +1,26 @@ -%h2 - = "Snippet ##{@snippet.id} - #{@snippet.title}" +- if !@snippet.expired? + %h2 + = "Snippet ##{@snippet.id} - #{@snippet.title}" -.view_file - .view_file_header - %strong - = @snippet.file_name - %br/ - .view_file_content - :erb - <%= raw @snippet.colorize %> + .view_file + .view_file_header + %strong + = @snippet.file_name + %br/ + .view_file_content + :erb + <%= raw @snippet.colorize %> -- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive" -- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - = link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}" -.clear -%br -.snippet_notes= render "notes/notes" + - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user + = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive" + - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user + = link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}" + .clear + %br + .snippet_notes= render "notes/notes" -.clear + .clear +- else + %h2 + Sorry, this snippet is no longer exists diff --git a/app/views/tags/index.html.haml b/app/views/tags/index.html.haml new file mode 100644 index 00000000..c83d62c7 --- /dev/null +++ b/app/views/tags/index.html.haml @@ -0,0 +1,11 @@ +- content_for(:body_class, "projects-page") +- content_for(:page_title) do + .grid_4 + %h2 + Tags + + + .tags-list + - @tags.all.each do |tag| + = link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}" + diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index b9a68e6c..88260cca 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -7,11 +7,11 @@ %td= truncate user.email, :lenght => 16 - if can? current_user, :admin_project, @project - = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| + = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| %td= f.check_box :read, :onclick => "$(this.form).submit();" %td= f.check_box :write, :onclick => "$(this.form).submit();" %td= f.check_box :admin, :onclick => "$(this.form).submit();" - - else + - else %td= check_box_tag "read", 1, member.read, :disabled => :disabled %td= check_box_tag "commit", 1, member.write, :disabled => :disabled %td= check_box_tag "admin", 1, member.admin, :disabled => :disabled diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml index d07c54f8..4a093ee1 100644 --- a/app/views/team_members/show.html.haml +++ b/app/views/team_members/show.html.haml @@ -25,4 +25,3 @@ %b Twitter: = user.twitter - diff --git a/config/application.rb b/config/application.rb index 9a4fd4e4..3481c6d6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -44,5 +44,8 @@ module Gitlab # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + # Extend assets path + config.assets.paths << Rails.root.join('vendor', 'assets', 'images', 'jquery-ui') end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 9e5bf821..173bfc74 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -29,4 +29,5 @@ Gitlab::Application.configure do config.assets.debug = true config.action_mailer.default_url_options = { :host => 'localhost:3000' } + config.action_mailer.delivery_method = :letter_opener end diff --git a/config/environments/production.rb b/config/environments/production.rb index 7ebe4523..d8094817 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -58,7 +58,6 @@ Gitlab::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - config.action_mailer.delivery_method = :sendmail # Defaults to: # # config.action_mailer.sendmail_settings = { diff --git a/config/initializers/grit_ext.rb b/config/initializers/grit_ext.rb index 9231da6f..1a7e6361 100644 --- a/config/initializers/grit_ext.rb +++ b/config/initializers/grit_ext.rb @@ -7,6 +7,6 @@ Grit::Blob.class_eval do include Utils::Colorize end -Grit::Commit.class_eval do +Grit::Commit.class_eval do include CommitExt end diff --git a/config/routes.rb b/config/routes.rb index 8a40a8fe..d4e27965 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,10 @@ Gitlab::Application.routes.draw do - namespace :admin do + + get 'tags'=> 'tags#index' + get 'tags/:tag' => 'projects#index' + + + namespace :admin do resources :users resources :projects resources :team_members @@ -10,19 +15,21 @@ Gitlab::Application.routes.draw do root :to => "users#index" end - get "errors/gitosis" + get "errors/gitosis" get "profile/password", :to => "profile#password" put "profile/password", :to => "profile#password_update" put "profile/edit", :to => "profile#social_update" get "profile", :to => "profile#show" + get "dashboard", :to => "dashboard#index" #get "profile/:id", :to => "profile#show" resources :projects, :only => [:new, :create, :index] resources :keys + devise_for :users - resources :projects, :except => [:new, :create, :index], :path => "/" do - member do + resources :projects, :except => [:new, :create, :index], :path => "/" do + member do get "tree" get "blob" get "team" @@ -32,7 +39,7 @@ Gitlab::Application.routes.draw do get "tree/:commit_id" => "projects#tree" get "tree/:commit_id/:path" => "projects#tree", :as => :tree_file, - :constraints => { + :constraints => { :id => /[a-zA-Z0-9_\-]+/, :commit_id => /[a-zA-Z0-9]+/, :path => /.*/ @@ -47,8 +54,11 @@ Gitlab::Application.routes.draw do collection do post :sort end + collection do + get :search + end end resources :notes, :only => [:create, :destroy] end - root :to => "projects#index" + root :to => "dashboard#index" end diff --git a/db/migrate/20110913200833_devise_create_users.rb b/db/migrate/20110913200833_devise_create_users.rb index 3083e742..01869a9e 100644 --- a/db/migrate/20110913200833_devise_create_users.rb +++ b/db/migrate/20110913200833_devise_create_users.rb @@ -11,7 +11,6 @@ class DeviseCreateUsers < ActiveRecord::Migration # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both # t.token_authenticatable - t.timestamps end diff --git a/db/migrate/20111027051828_add_expires_at_to_snippets.rb b/db/migrate/20111027051828_add_expires_at_to_snippets.rb new file mode 100644 index 00000000..0d94b333 --- /dev/null +++ b/db/migrate/20111027051828_add_expires_at_to_snippets.rb @@ -0,0 +1,5 @@ +class AddExpiresAtToSnippets < ActiveRecord::Migration + def change + add_column :snippets, :expires_at, :datetime + end +end diff --git a/db/migrate/20111027142641_change_note_note_to_text.rb b/db/migrate/20111027142641_change_note_note_to_text.rb new file mode 100644 index 00000000..1bcf4b72 --- /dev/null +++ b/db/migrate/20111027142641_change_note_note_to_text.rb @@ -0,0 +1,8 @@ +class ChangeNoteNoteToText < ActiveRecord::Migration + def up + change_column :notes, :note, :text, :limit => false + end + + def down + end +end diff --git a/db/migrate/20111027152724_issue_conten_to_note.rb b/db/migrate/20111027152724_issue_conten_to_note.rb new file mode 100644 index 00000000..c151a931 --- /dev/null +++ b/db/migrate/20111027152724_issue_conten_to_note.rb @@ -0,0 +1,34 @@ +class IssueContenToNote < ActiveRecord::Migration + def up + puts "Issue content is deprecated -> move to notes" + Issue.find_each(:batch_size => 100) do |issue| + next if issue.content.blank? + note = Note.new( + :note => issue.content, + :project_id => issue.project_id, + :noteable => issue, + :created_at => issue.created_at, + :updated_at => issue.created_at + ) + note.author_id = issue.author_id + + if note.save + issue.update_attributes(:content => nil) + print "." + else + print "F" + end + end + + total = Issue.where("content is not null").count + + if total > 0 + puts "content of #{total} issues were not migrated" + else + puts "Done" + end + end + + def down + end +end diff --git a/db/migrate/20111101222453_acts_as_taggable_on_migration.rb b/db/migrate/20111101222453_acts_as_taggable_on_migration.rb new file mode 100644 index 00000000..16610615 --- /dev/null +++ b/db/migrate/20111101222453_acts_as_taggable_on_migration.rb @@ -0,0 +1,28 @@ +class ActsAsTaggableOnMigration < ActiveRecord::Migration + def self.up + create_table :tags do |t| + t.string :name + end + + create_table :taggings do |t| + t.references :tag + + # You should make sure that the column created is + # long enough to store the required class names. + t.references :taggable, :polymorphic => true + t.references :tagger, :polymorphic => true + + t.string :context + + t.datetime :created_at + end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + drop_table :taggings + drop_table :tags + end +end diff --git a/db/schema.rb b/db/schema.rb index 21c224d4..3d430f4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111025134235) do +ActiveRecord::Schema.define(:version => 20111101222453) do create_table "issues", :force => true do |t| t.string "title" @@ -36,7 +36,7 @@ ActiveRecord::Schema.define(:version => 20111025134235) do end create_table "notes", :force => true do |t| - t.string "note" + t.text "note" t.string "noteable_id" t.string "noteable_type" t.integer "author_id" @@ -65,6 +65,24 @@ ActiveRecord::Schema.define(:version => 20111025134235) do t.datetime "created_at" t.datetime "updated_at" t.string "file_name" + t.datetime "expires_at" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context" + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + + create_table "tags", :force => true do |t| + t.string "name" end create_table "users", :force => true do |t| diff --git a/lib/color.rb b/lib/color.rb index 23feecf4..4eabe249 100644 --- a/lib/color.rb +++ b/lib/color.rb @@ -17,7 +17,7 @@ module Color def command(string) `#{string}` - if $?.to_i > 0 + if $?.to_i > 0 puts red " == #{string} - FAIL" puts red " == Error during configure" exit diff --git a/lib/commit_ext.rb b/lib/commit_ext.rb index e09dbdaf..db650355 100644 --- a/lib/commit_ext.rb +++ b/lib/commit_ext.rb @@ -1,11 +1,23 @@ module CommitExt def safe_message - message.encode("UTF-8", - :invalid => :replace, - :undef => :replace, + message.encode("UTF-8", + :invalid => :replace, + :undef => :replace, :universal_newline => true, :replace => "") - rescue + rescue "-- invalid encoding for commit message" end + + def created_at + committed_date + end + + def author_email + author.email.force_encoding(Encoding::UTF_8) + end + + def author_name + author.name.force_encoding(Encoding::UTF_8) + end end diff --git a/lib/file_size_validator.rb b/lib/file_size_validator.rb index 151e0ce5..611e584f 100644 --- a/lib/file_size_validator.rb +++ b/lib/file_size_validator.rb @@ -33,7 +33,7 @@ class FileSizeValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base - + value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String) CHECKS.each do |key, validity_check| @@ -53,7 +53,7 @@ class FileSizeValidator < ActiveModel::EachValidator record.errors.add(attribute, MESSAGES[key], errors_options) end end - + def help Helper.instance end diff --git a/lib/utils.rb b/lib/utils.rb index e57121a3..f43e2edd 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -1,8 +1,8 @@ module Utils module FileHelper - def binary?(string) + def binary?(string) string.each_byte do |x| - x.nonzero? or return true + x.nonzero? or return true end false end diff --git a/public/apple-touch-icon-114x114-precomposed.png b/public/apple-touch-icon-114x114-precomposed.png new file mode 100755 index 00000000..de2d59f9 Binary files /dev/null and b/public/apple-touch-icon-114x114-precomposed.png differ diff --git a/public/apple-touch-icon-57x57-precomposed.png b/public/apple-touch-icon-57x57-precomposed.png new file mode 100755 index 00000000..6d2fc396 Binary files /dev/null and b/public/apple-touch-icon-57x57-precomposed.png differ diff --git a/public/apple-touch-icon-72x72-precomposed.png b/public/apple-touch-icon-72x72-precomposed.png new file mode 100755 index 00000000..b20e78ef Binary files /dev/null and b/public/apple-touch-icon-72x72-precomposed.png differ diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100755 index 00000000..6d2fc396 Binary files /dev/null and b/public/apple-touch-icon-precomposed.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100755 index 00000000..6d2fc396 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/index.html.example b/public/index.html.example index 9d9811a5..16248eda 100644 --- a/public/index.html.example +++ b/public/index.html.example @@ -25,7 +25,6 @@ text-decoration: none; } - #page { background-color: #f0f0f0; width: 750px; @@ -57,7 +56,6 @@ padding-right: 30px; } - #header { background-image: url("/assets/rails.png"); background-repeat: no-repeat; @@ -71,7 +69,6 @@ font-size: 16px; } - #about h3 { margin: 0; margin-bottom: 10px; @@ -112,7 +109,6 @@ padding: 10px; } - #getting-started { border-top: 1px solid #ccc; margin-top: 25px; @@ -149,7 +145,6 @@ font-size: 13px; } - #sidebar ul { margin-left: 0; padding-left: 0; diff --git a/spec/factories.rb b/spec/factories.rb index cc0cd4e5..36aa4fc9 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -32,7 +32,6 @@ end Factory.add(:issue, Issue) do |obj| obj.title = Faker::Lorem.sentence - obj.content = Faker::Lorem.sentences end Factory.add(:snippet, Snippet) do |obj| diff --git a/spec/factory.rb b/spec/factory.rb index 29e552b1..5edef358 100644 --- a/spec/factory.rb +++ b/spec/factory.rb @@ -1,7 +1,7 @@ class Factory @factories = {} - class << self + class << self def add(name, klass, &block) @factories[name] = [klass, block] end @@ -13,10 +13,10 @@ class Factory def new(name, opts) factory = @factories[name] factory[0].new.tap do |obj| - factory[1].call(obj) + factory[1].call(obj) end.tap do |obj| opts.each do |k, opt| - obj.send("#{k}=", opt) + obj.send("#{k}=", opt) end end end diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index b2d594c9..e0559ab6 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -14,7 +14,7 @@ describe Issue do it { should validate_presence_of(:assignee_id) } end - describe "Scope" do + describe "Scope" do it { Issue.should respond_to :closed } it { Issue.should respond_to :opened } end diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 8515f19b..6522b825 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -10,7 +10,7 @@ describe Key do it { should validate_presence_of(:key) } end - describe "Methods" do + describe "Methods" do it { should respond_to :projects } end diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 20bd41ad..5b16ad36 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -13,8 +13,8 @@ describe Note do it { Factory.create(:note, :project => Factory.create(:project)).should be_valid } - describe :authorization do - before do + describe :authorization do + before do @p1 = Factory :project @p2 = Factory :project, :code => "alien", :path => "legit_1" @u1 = Factory :user @@ -24,10 +24,10 @@ describe Note do @abilities << Ability end - describe :read do - before do - @p1.users_projects.create(:user => @u1, :read => false) - @p1.users_projects.create(:user => @u2, :read => true) + describe :read do + before do + @p1.users_projects.create(:user => @u1, :read => false) + @p1.users_projects.create(:user => @u2, :read => true) @p2.users_projects.create(:user => @u3, :read => true) end @@ -36,11 +36,11 @@ describe Note do it { @abilities.allowed?(@u3, :read_note, @p1).should be_false } end - describe :write do - before do - @p1.users_projects.create(:user => @u1, :write => false) - @p1.users_projects.create(:user => @u2, :write => true) - @p2.users_projects.create(:user => @u3, :write => true) + describe :write do + before do + @p1.users_projects.create(:user => @u1, :write => false) + @p1.users_projects.create(:user => @u2, :write => true) + @p2.users_projects.create(:user => @u3, :write => true) end it { @abilities.allowed?(@u1, :write_note, @p1).should be_false } @@ -48,11 +48,11 @@ describe Note do it { @abilities.allowed?(@u3, :write_note, @p1).should be_false } end - describe :admin do - before do - @p1.users_projects.create(:user => @u1, :admin => false) - @p1.users_projects.create(:user => @u2, :admin => true) - @p2.users_projects.create(:user => @u3, :admin => true) + describe :admin do + before do + @p1.users_projects.create(:user => @u1, :admin => false) + @p1.users_projects.create(:user => @u2, :admin => true) + @p2.users_projects.create(:user => @u3, :admin => true) end it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false } diff --git a/spec/models/project_security_spec.rb b/spec/models/project_security_spec.rb index 8eb8ee80..f8029463 100644 --- a/spec/models/project_security_spec.rb +++ b/spec/models/project_security_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' describe Project do - describe :authorization do - before do + describe :authorization do + before do @p1 = Factory :project @u1 = Factory :user @u2 = Factory :user @@ -10,30 +10,30 @@ describe Project do @abilities << Ability end - describe :read do - before do - @p1.users_projects.create(:project => @p1, :user => @u1, :read => false) - @p1.users_projects.create(:project => @p1, :user => @u2, :read => true) + describe :read do + before do + @p1.users_projects.create(:project => @p1, :user => @u1, :read => false) + @p1.users_projects.create(:project => @p1, :user => @u2, :read => true) end it { @abilities.allowed?(@u1, :read_project, @p1).should be_false } it { @abilities.allowed?(@u2, :read_project, @p1).should be_true } end - describe :write do - before do - @p1.users_projects.create(:project => @p1, :user => @u1, :write => false) - @p1.users_projects.create(:project => @p1, :user => @u2, :write => true) + describe :write do + before do + @p1.users_projects.create(:project => @p1, :user => @u1, :write => false) + @p1.users_projects.create(:project => @p1, :user => @u2, :write => true) end it { @abilities.allowed?(@u1, :write_project, @p1).should be_false } it { @abilities.allowed?(@u2, :write_project, @p1).should be_true } end - describe :admin do - before do - @p1.users_projects.create(:project => @p1, :user => @u1, :admin => false) - @p1.users_projects.create(:project => @p1, :user => @u2, :admin => true) + describe :admin do + before do + @p1.users_projects.create(:project => @p1, :user => @u1, :admin => false) + @p1.users_projects.create(:project => @p1, :user => @u2, :admin => true) end it { @abilities.allowed?(@u1, :admin_project, @p1).should be_false } diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 0c62743d..bd83bc80 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -40,20 +40,20 @@ describe Project do should_not allow_value("gitosis-admin").for(:path) end - it "should return valid url to repo" do + it "should return valid url to repo" do project = Project.new(:path => "somewhere") project.url_to_repo.should == "git@localhost:somewhere.git" end - it "should return path to repo" do + it "should return path to repo" do project = Project.new(:path => "somewhere") project.path_to_repo.should == File.join(Rails.root, "tmp", "tests", "somewhere") end - describe :valid_repo? do - it "should be valid repo" do + describe :valid_repo? do + it "should be valid repo" do project = Factory :project - project.valid_repo?.should be_true + project.valid_repo?.should be_true end it "should be invalid repo" do @@ -62,43 +62,88 @@ describe Project do end end - describe "Git methods" do + describe "updates" do let(:project) { Factory :project } - describe :repo do - it "should return valid repo" do + before do + @issue = Factory :issue, + :project => project, + :author => Factory(:user), + :assignee => Factory(:user) + + @note = Factory :note, + :project => project, + :author => Factory(:user) + + @commit = project.fresh_commits(1).first + end + + describe "return commit, note & issue" do + it { project.updates(3).count.should == 3 } + it { project.updates(3).last.id.should == @commit.id } + it { project.updates(3).include?(@issue).should be_true } + it { project.updates(3).include?(@note).should be_true } + end + end + + describe "last_activity" do + let(:project) { Factory :project } + + before do + @note = Factory :note, + :project => project, + :author => Factory(:user) + end + + it { project.last_activity.should == @note } + it { project.last_activity_date.to_s.should == @note.created_at.to_s } + end + + describe "fresh commits" do + let(:project) { Factory :project } + + it { project.fresh_commits(3).count.should == 3 } + it { project.fresh_commits.first.id.should == "2fb376f61875b58bceee0492e270e9c805294b1a" } + it { project.fresh_commits.last.id.should == "0dac878dbfe0b9c6104a87d65fe999149a8d862c" } + end + + describe "Git methods" do + let(:project) { Factory :project } + + describe :repo do + it "should return valid repo" do project.repo.should be_kind_of(Grit::Repo) end - it "should return nil" do + it "should return nil" do lambda { Project.new(:path => "invalid").repo }.should raise_error(Grit::NoSuchPathError) end - it "should return nil" do + it "should return nil" do lambda { Project.new.repo }.should raise_error(TypeError) end end - describe :commit do - it "should return first head commit if without params" do + describe :commit do + it "should return first head commit if without params" do project.commit.id.should == project.repo.commits.first.id end - it "should return valid commit" do + it "should return valid commit" do project.commit(ValidCommit::ID).should be_valid_commit end - it "should return nil" do + it "should return nil" do project.commit("+123_4532530XYZ").should be_nil end end - describe :tree do - before do + describe :tree do + before do @commit = project.commit(ValidCommit::ID) end - it "should raise error w/o arguments" do + it "should raise error w/o arguments" do lambda { project.tree }.should raise_error end diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 9dab72ca..037287a9 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -26,5 +26,6 @@ end # created_at :datetime # updated_at :datetime # file_name :string(255) +# expires_at :datetime # diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 32fb90a3..d66b1c25 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -14,7 +14,7 @@ describe User do it { should respond_to(:name) } end - it "should return valid identifier" do + it "should return valid identifier" do user = User.new(:email => "test@mail.com") user.identifier.should == "test_mail.com" end diff --git a/spec/models/users_project_spec.rb b/spec/models/users_project_spec.rb index d6a4d02b..c1539161 100644 --- a/spec/models/users_project_spec.rb +++ b/spec/models/users_project_spec.rb @@ -11,7 +11,7 @@ describe UsersProject do it { should validate_presence_of(:project_id) } end - describe "Delegate methods" do + describe "Delegate methods" do it { should respond_to(:user_name) } it { should respond_to(:user_email) } end diff --git a/spec/monkeypatch.rb b/spec/monkeypatch.rb index ea42337f..2e491496 100644 --- a/spec/monkeypatch.rb +++ b/spec/monkeypatch.rb @@ -1,6 +1,6 @@ # Stubbing Project <-> gitosis path # create project using Factory only -class Project +class Project def update_gitosis_project true end @@ -9,12 +9,12 @@ class Project true end - def path_to_repo + def path_to_repo File.join(Rails.root, "tmp", "tests", path) end end -class Key +class Key def update_gitosis true end diff --git a/spec/requests/admin/admin_projects_spec.rb b/spec/requests/admin/admin_projects_spec.rb index e36ee441..fd8703ec 100644 --- a/spec/requests/admin/admin_projects_spec.rb +++ b/spec/requests/admin/admin_projects_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe "Admin::Projects" do - before do + before do @project = Factory :project, :name => "LeGiT", :code => "LGT" @@ -9,7 +9,7 @@ describe "Admin::Projects" do end describe "GET /admin/projects" do - before do + before do visit admin_projects_path end @@ -17,49 +17,49 @@ describe "Admin::Projects" do current_path.should == admin_projects_path end - it "should have projects list" do + it "should have projects list" do page.should have_content(@project.code) page.should have_content(@project.name) end end - describe "GET /admin/projects/:id" do - before do + describe "GET /admin/projects/:id" do + before do visit admin_projects_path click_link "Show" end - it "should have project info" do + it "should have project info" do page.should have_content(@project.code) page.should have_content(@project.name) end end - describe "GET /admin/projects/:id/edit" do - before do + describe "GET /admin/projects/:id/edit" do + before do visit admin_projects_path click_link "edit_project_#{@project.id}" end - it "should have project edit page" do + it "should have project edit page" do page.should have_content("Name") page.should have_content("Code") end describe "Update project" do - before do + before do fill_in "project_name", :with => "Big Bang" fill_in "project_code", :with => "BB1" click_button "Save" @project.reload end - it "should show page with new data" do + it "should show page with new data" do page.should have_content("BB1") page.should have_content("Big Bang") end - it "should change project entry" do + it "should change project entry" do @project.name.should == "Big Bang" @project.code.should == "BB1" end @@ -67,24 +67,24 @@ describe "Admin::Projects" do end describe "GET /admin/projects/new" do - before do + before do visit admin_projects_path click_link "New Project" end it "should be correct path" do - current_path.should == new_admin_project_path + current_path.should == new_admin_project_path end it "should have labels for new project" do - page.should have_content("Name") - page.should have_content("Path") - page.should have_content("Description") + page.should have_content("Name") + page.should have_content("Path") + page.should have_content("Description") end end describe "POST /admin/projects" do - before do + before do visit new_admin_project_path fill_in 'Name', :with => 'NewProject' fill_in 'Code', :with => 'NPR' diff --git a/spec/requests/admin/admin_users_spec.rb b/spec/requests/admin/admin_users_spec.rb index 8d9cbcae..67cfde5f 100644 --- a/spec/requests/admin/admin_users_spec.rb +++ b/spec/requests/admin/admin_users_spec.rb @@ -4,7 +4,7 @@ describe "Admin::Users" do before { login_as :admin } describe "GET /admin/users" do - before do + before do visit admin_users_path end @@ -12,14 +12,14 @@ describe "Admin::Users" do current_path.should == admin_users_path end - it "should have users list" do + it "should have users list" do page.should have_content(@user.email) page.should have_content(@user.name) end end - describe "GET /admin/users/new" do - before do + describe "GET /admin/users/new" do + before do @password = "123ABC" visit new_admin_user_path fill_in "user_name", :with => "Big Bang" @@ -28,23 +28,23 @@ describe "Admin::Users" do fill_in "user_password_confirmation", :with => @password end - it "should create new user" do + it "should create new user" do expect { click_button "Save" }.to change {User.count}.by(1) end - it "should create user with valid data" do + it "should create user with valid data" do click_button "Save" user = User.last user.name.should == "Big Bang" user.email.should == "bigbang@mail.com" end - it "should call send mail" do + it "should call send mail" do Notify.should_receive(:new_user_email).and_return(stub(:deliver => true)) click_button "Save" end - it "should send valid email to user with email & password" do + it "should send valid email to user with email & password" do click_button "Save" user = User.last email = ActionMailer::Base.deliveries.last @@ -54,45 +54,45 @@ describe "Admin::Users" do end end - describe "GET /admin/users/:id" do - before do + describe "GET /admin/users/:id" do + before do visit admin_users_path click_link "Show" end - it "should have user info" do + it "should have user info" do page.should have_content(@user.email) page.should have_content(@user.name) page.should have_content(@user.is_admin?) end end - describe "GET /admin/users/:id/edit" do - before do + describe "GET /admin/users/:id/edit" do + before do @simple_user = Factory :user visit admin_users_path click_link "edit_user_#{@simple_user.id}" end - it "should have user edit page" do + it "should have user edit page" do page.should have_content("Name") page.should have_content("Password") end describe "Update user" do - before do + before do fill_in "user_name", :with => "Big Bang" fill_in "user_email", :with => "bigbang@mail.com" check "user_admin" click_button "Save" end - it "should show page with new data" do + it "should show page with new data" do page.should have_content("bigbang@mail.com") page.should have_content("Big Bang") end - it "should change user entry" do + it "should change user entry" do @simple_user.reload @simple_user.name.should == "Big Bang" @simple_user.is_admin?.should be_true diff --git a/spec/requests/admin/security_spec.rb b/spec/requests/admin/security_spec.rb index 743f9f08..27b60196 100644 --- a/spec/requests/admin/security_spec.rb +++ b/spec/requests/admin/security_spec.rb @@ -1,25 +1,25 @@ require 'spec_helper' describe "Admin::Projects" do - describe "GET /admin/projects" do + describe "GET /admin/projects" do it { admin_projects_path.should be_allowed_for :admin } it { admin_projects_path.should be_denied_for :user } it { admin_projects_path.should be_denied_for :visitor } end - describe "GET /admin/users" do + describe "GET /admin/users" do it { admin_users_path.should be_allowed_for :admin } it { admin_users_path.should be_denied_for :user } it { admin_users_path.should be_denied_for :visitor } end - describe "GET /admin/team_members" do + describe "GET /admin/team_members" do it { admin_team_members_path.should be_allowed_for :admin } it { admin_team_members_path.should be_denied_for :user } it { admin_team_members_path.should be_denied_for :visitor } end - describe "GET /admin/emails" do + describe "GET /admin/emails" do it { admin_emails_path.should be_allowed_for :admin } it { admin_emails_path.should be_denied_for :user } it { admin_emails_path.should be_denied_for :visitor } diff --git a/spec/requests/commits_notes_spec.rb b/spec/requests/commits_notes_spec.rb index 522fe518..69a492e9 100644 --- a/spec/requests/commits_notes_spec.rb +++ b/spec/requests/commits_notes_spec.rb @@ -4,15 +4,14 @@ describe "Issues" do let(:project) { Factory :project } let!(:commit) { project.repo.commits.first } - before do + before do login_as :user project.add_access(@user, :read, :write) end - describe "add new note", :js => true do - before do + describe "add new note", :js => true do + before do visit project_commit_path(project, commit) - click_link "Comments" # notes tab fill_in "note_note", :with => "I commented this commit" click_button "Add note" end diff --git a/spec/requests/commits_spec.rb b/spec/requests/commits_spec.rb index cd7314f9..79bb03f5 100644 --- a/spec/requests/commits_spec.rb +++ b/spec/requests/commits_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' describe "Commits" do let(:project) { Factory :project } let!(:commit) { project.repo.commits.first } - before do + before do login_as :user project.add_access(@user, :read) end describe "GET /commits" do - before do + before do visit project_commits_path(project) end @@ -17,22 +17,22 @@ describe "Commits" do current_path.should == project_commits_path(project) end - it "should have project name" do + it "should have project name" do page.should have_content(project.name) end - it "should list commits" do + it "should list commits" do page.should have_content(commit.author) page.should have_content(commit.message) end end - describe "GET /commits/:id" do - before do + describe "GET /commits/:id" do + before do visit project_commit_path(project, commit) end - it "should have valid path" do + it "should have valid path" do current_path.should == project_commit_path(project, commit) end end diff --git a/spec/requests/dashboard_spec.rb b/spec/requests/dashboard_spec.rb new file mode 100644 index 00000000..6940366a --- /dev/null +++ b/spec/requests/dashboard_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe "Dashboard" do + before { login_as :user } + + describe "GET /dashboard" do + before do + @project = Factory :project + @project.add_access(@user, :read, :write) + visit dashboard_path + end + + it "should be on dashboard page" do + current_path.should == dashboard_path + end + + it "should have projects panel" do + within ".project-list" do + page.should have_content(@project.name) + end + end + + it "should have news feed" do + within "#news-feed" do + page.should have_content(@project.commit.author.name) + page.should have_content(@project.commit.safe_message) + end + end + end +end diff --git a/spec/requests/issues_notes_spec.rb b/spec/requests/issues_notes_spec.rb index 95eb2f35..9ebad394 100644 --- a/spec/requests/issues_notes_spec.rb +++ b/spec/requests/issues_notes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Issues" do let(:project) { Factory :project } - before do + before do login_as :user project.add_access(@user, :read, :write) @@ -13,8 +13,8 @@ describe "Issues" do :project => project end - describe "add new note", :js => true do - before do + describe "add new note", :js => true do + before do visit project_issue_path(project, @issue) fill_in "note_note", :with => "I commented this issue" click_button "Add note" diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb index 79fdf5ef..b5d6f1bc 100644 --- a/spec/requests/issues_spec.rb +++ b/spec/requests/issues_spec.rb @@ -3,13 +3,16 @@ require 'spec_helper' describe "Issues" do let(:project) { Factory :project } - before do + before do login_as :user + @user2 = Factory :user + project.add_access(@user, :read, :write) + project.add_access(@user2, :read, :write) end describe "GET /issues" do - before do + before do @issue = Factory :issue, :author => @user, :assignee => @user, @@ -24,23 +27,23 @@ describe "Issues" do it { should have_content(@issue.project.name) } it { should have_content(@issue.assignee.name) } - describe "Destroy" do - before do + describe "Destroy" do + before do # admin access to remove issue @user.users_projects.destroy_all project.add_access(@user, :read, :write, :admin) visit project_issues_path(project) end - it "should remove entry" do + it "should remove entry" do expect { click_link "destroy_issue_#{@issue.id}" }.to change { Issue.count }.by(-1) end end - describe "statuses", :js => true do - before do + describe "statuses", :js => true do + before do @closed_issue = Factory :issue, :author => @user, :assignee => @user, @@ -48,72 +51,119 @@ describe "Issues" do :closed => true end - it "should show only open" do - should have_content(@issue.title) + it "should show only open" do + should have_content(@issue.title[0..25]) should have_no_content(@closed_issue.title) end - it "should show only closed" do + it "should show only closed" do choose "closed_issues" should have_no_content(@issue.title) - should have_content(@closed_issue.title) + should have_content(@closed_issue.title[0..25]) end - it "should show all" do + it "should show all" do choose "all_issues" - should have_content(@issue.title) - should have_content(@closed_issue.title) + should have_content(@issue.title[0..25]) + should have_content(@closed_issue.title[0..25]) end end end - describe "New issue", :js => true do - before do + describe "New issue", :js => true do + before do visit project_issues_path(project) click_link "New Issue" end - it "should open new issue popup" do + it "should open new issue popup" do page.should have_content("Add new issue") end - describe "fill in" do - before do - fill_in "issue_title", :with => "bug 345" - fill_in "issue_content", :with => "app bug 345" - click_link "Select user" - click_link @user.name + describe "fill in" do + describe 'assign to me' do + before do + fill_in "issue_title", :with => "bug 345" + click_link "Select user" + within "#issue_assignee_id-menu" do + click_link @user.name + end + end + + it { expect { click_button "Save" }.to change {Issue.count}.by(1) } + + it "should add new issue to table" do + click_button "Save" + + page.should_not have_content("Add new issue") + page.should have_content @user.name + page.should have_content "bug 345" + page.should have_content project.name + end + + it "should call send mail" do + Notify.should_not_receive(:new_issue_email) + click_button "Save" + end end - it { expect { click_button "Save" }.to change {Issue.count}.by(1) } + describe 'assign to other' do + before do + fill_in "issue_title", :with => "bug 345" + click_link "Select user" + within "#issue_assignee_id-menu" do + click_link @user2.name + end + end - it "should add new issue to table" do - click_button "Save" + it { expect { click_button "Save" }.to change {Issue.count}.by(1) } - page.should_not have_content("Add new issue") - page.should have_content @user.name - page.should have_content "bug 345" - page.should have_content project.name - end + it "should add new issue to table" do + click_button "Save" - it "should call send mail" do - Notify.should_receive(:new_issue_email).and_return(stub(:deliver => true)) - click_button "Save" - end + page.should_not have_content("Add new issue") + page.should have_content @user2.name + page.should have_content "bug 345" + page.should have_content project.name + end + + it "should call send mail" do + Notify.should_receive(:new_issue_email).and_return(stub(:deliver => true)) + click_button "Save" + end + + it "should send valid email to user with email & password" do + click_button "Save" + issue = Issue.last + email = ActionMailer::Base.deliveries.last + email.subject.should have_content("New Issue was created") + email.body.should have_content(issue.title) + email.body.should have_content(issue.assignee.name) + end - it "should send valid email to user with email & password" do - click_button "Save" - issue = Issue.last - email = ActionMailer::Base.deliveries.last - email.subject.should have_content("New Issue was created") - email.body.should have_content(issue.title) - email.body.should have_content(issue.assignee.name) end end end - describe "Edit issue", :js => true do - before do + describe "Show issue" do + before do + @issue = Factory :issue, + :author => @user, + :assignee => @user, + :project => project + + visit project_issue_path(project, @issue) + end + + it "should have valid show page for issue" do + page.should have_content @issue.title + page.should have_content @user.name + page.should have_content "today" + end + end + + describe "Edit issue", :js => true do + before do @issue = Factory :issue, :author => @user, :assignee => @user, @@ -122,19 +172,18 @@ describe "Issues" do click_link "Edit" end - it "should open new issue popup" do + it "should open new issue popup" do page.should have_content("Issue ##{@issue.id}") end - describe "fill in" do + describe "fill in" do before do fill_in "issue_title", :with => "bug 345" - fill_in "issue_content", :with => "app bug 345" end it { expect { click_button "Save" }.to_not change {Issue.count} } - it "should update issue fields" do + it "should update issue fields" do click_button "Save" page.should_not have_content("Issue ##{@issue.id}") @@ -144,4 +193,51 @@ describe "Issues" do end end end + + describe "Search issue", :js => true do + before do + ['foobar', 'foobar2', 'gitlab'].each do |title| + @issue = Factory :issue, + :author => @user, + :assignee => @user, + :project => project, + :title => title + @issue.save + end + end + + it "should be able to search on different statuses" do + @issue = Issue.first + @issue.closed = true + @issue.save + + visit project_issues_path(project) + choose 'closed_issues' + fill_in 'issue_search', :with => 'foobar' + + page.should have_content 'foobar' + page.should_not have_content 'foobar2' + page.should_not have_content 'gitlab' + end + + it "should search for term and return the correct results" do + visit project_issues_path(project) + fill_in 'issue_search', :with => 'foobar' + + page.should have_content 'foobar' + page.should have_content 'foobar2' + page.should_not have_content 'gitlab' + end + + it "should return all results if term has been cleared" do + visit project_issues_path(project) + fill_in "issue_search", :with => "foobar" + # Because fill_in, :with => "" triggers nothing we need to trigger a keyup event + page.execute_script("$('.issue_search').val('').keyup();"); + + page.should have_content 'foobar' + page.should have_content 'foobar2' + page.should have_content 'gitlab' + end + end end diff --git a/spec/requests/keys_spec.rb b/spec/requests/keys_spec.rb index 316115f9..6ce22b30 100644 --- a/spec/requests/keys_spec.rb +++ b/spec/requests/keys_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' describe "Issues" do - before do + before do login_as :user end describe "GET /keys" do - before do + before do @key = Factory :key, :user => @user visit keys_path end @@ -15,8 +15,8 @@ describe "Issues" do it { should have_content(@key.title) } - describe "Destroy" do - it "should remove entry" do + describe "Destroy" do + it "should remove entry" do expect { click_link "destroy_key_#{@key.id}" }.to change { @user.keys.count }.by(-1) @@ -24,17 +24,17 @@ describe "Issues" do end end - describe "New key", :js => true do - before do + describe "New key", :js => true do + before do visit keys_path click_link "Add new" end - it "should open new key popup" do + it "should open new key popup" do page.should have_content("Add new public key") end - describe "fill in" do + describe "fill in" do before do fill_in "key_title", :with => "laptop" fill_in "key_key", :with => "publickey234=" @@ -42,7 +42,7 @@ describe "Issues" do it { expect { click_button "Save" }.to change {Key.count}.by(1) } - it "should add new key to table" do + it "should add new key to table" do click_button "Save" page.should_not have_content("Add new public key") diff --git a/spec/requests/profile_spec.rb b/spec/requests/profile_spec.rb index 5838f63b..eca1c12e 100644 --- a/spec/requests/profile_spec.rb +++ b/spec/requests/profile_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' describe "Profile" do - before do + before do login_as :user end describe "Show profile" do - before do + before do visit profile_path end @@ -15,13 +15,13 @@ describe "Profile" do end describe "Profile update" do - before do + before do visit profile_path fill_in "user_skype", :with => "testskype" - fill_in "user_linkedin", :with => "testlinkedin" + fill_in "user_linkedin", :with => "testlinkedin" fill_in "user_twitter", :with => "testtwitter" click_button "Save" - @user.reload + @user.reload end it { @user.skype.should == 'testskype' } @@ -29,18 +29,17 @@ describe "Profile" do it { @user.twitter.should == 'testtwitter' } end - describe "Password update" do - before do + before do visit profile_password_path end it { page.should have_content("Password") } it { page.should have_content("Password confirmation") } - describe "change password" do - before do - @old_pwd = @user.encrypted_password + describe "change password" do + before do + @old_pwd = @user.encrypted_password fill_in "user_password", :with => "777777" fill_in "user_password_confirmation", :with => "777777" click_button "Save" @@ -51,18 +50,18 @@ describe "Profile" do current_path.should == new_user_session_path end - it "should change password" do + it "should change password" do @user.encrypted_password.should_not == @old_pwd end - describe "login with new password" do + describe "login with new password" do before do fill_in "user_email", :with => @user.email fill_in "user_password", :with => "777777" click_button "Sign in" end - - it "should login user" do + + it "should login user" do current_path.should == root_path end end diff --git a/spec/requests/projects_security_spec.rb b/spec/requests/projects_security_spec.rb index 90f88d88..1d42c5e7 100644 --- a/spec/requests/projects_security_spec.rb +++ b/spec/requests/projects_security_spec.rb @@ -1,33 +1,33 @@ require 'spec_helper' describe "Projects" do - describe "GET /projects" do + describe "GET /projects" do it { projects_path.should be_allowed_for :admin } it { projects_path.should be_allowed_for :user } it { projects_path.should be_denied_for :visitor } end - describe "GET /projects/new" do + describe "GET /projects/new" do it { projects_path.should be_allowed_for :admin } it { projects_path.should be_allowed_for :user } it { projects_path.should be_denied_for :visitor } end describe "Project" do - before do + before do @project = Factory :project @u1 = Factory :user @u2 = Factory :user @u3 = Factory :user # full access - @project.users_projects.create(:user => @u1, :read => true, :write => true, :admin => true) + @project.users_projects.create(:user => @u1, :read => true, :write => true, :admin => true) # no access - @project.users_projects.create(:user => @u2, :read => false, :write => false, :admin => false) + @project.users_projects.create(:user => @u2, :read => false, :write => false, :admin => false) # readonly - @project.users_projects.create(:user => @u3, :read => true, :write => false, :admin => false) + @project.users_projects.create(:user => @u3, :read => true, :write => false, :admin => false) end - describe "GET /project_code" do + describe "GET /project_code" do it { project_path(@project).should be_allowed_for @u1 } it { project_path(@project).should be_allowed_for @u3 } it { project_path(@project).should be_denied_for :admin } @@ -36,7 +36,7 @@ describe "Projects" do it { project_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/tree" do + describe "GET /project_code/tree" do it { tree_project_path(@project).should be_allowed_for @u1 } it { tree_project_path(@project).should be_allowed_for @u3 } it { tree_project_path(@project).should be_denied_for :admin } @@ -45,7 +45,7 @@ describe "Projects" do it { tree_project_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/commits" do + describe "GET /project_code/commits" do it { project_commits_path(@project).should be_allowed_for @u1 } it { project_commits_path(@project).should be_allowed_for @u3 } it { project_commits_path(@project).should be_denied_for :admin } @@ -54,7 +54,7 @@ describe "Projects" do it { project_commits_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/commit" do + describe "GET /project_code/commit" do it { project_commit_path(@project, @project.commit).should be_allowed_for @u1 } it { project_commit_path(@project, @project.commit).should be_allowed_for @u3 } it { project_commit_path(@project, @project.commit).should be_denied_for :admin } @@ -63,7 +63,7 @@ describe "Projects" do it { project_commit_path(@project, @project.commit).should be_denied_for :visitor } end - describe "GET /project_code/team" do + describe "GET /project_code/team" do it { team_project_path(@project).should be_allowed_for @u1 } it { team_project_path(@project).should be_allowed_for @u3 } it { team_project_path(@project).should be_denied_for :admin } @@ -72,7 +72,7 @@ describe "Projects" do it { team_project_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/wall" do + describe "GET /project_code/wall" do it { wall_project_path(@project).should be_allowed_for @u1 } it { wall_project_path(@project).should be_allowed_for @u3 } it { wall_project_path(@project).should be_denied_for :admin } @@ -81,8 +81,8 @@ describe "Projects" do it { wall_project_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/blob" do - before do + describe "GET /project_code/blob" do + before do @commit = @project.commit @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name @blob_path = blob_project_path(@project, :commit_id => @commit.id, :path => @path) @@ -96,7 +96,7 @@ describe "Projects" do it { @blob_path.should be_denied_for :visitor } end - describe "GET /project_code/edit" do + describe "GET /project_code/edit" do it { edit_project_path(@project).should be_allowed_for @u1 } it { edit_project_path(@project).should be_denied_for @u3 } it { edit_project_path(@project).should be_denied_for :admin } @@ -105,7 +105,7 @@ describe "Projects" do it { edit_project_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/issues" do + describe "GET /project_code/issues" do it { project_issues_path(@project).should be_allowed_for @u1 } it { project_issues_path(@project).should be_allowed_for @u3 } it { project_issues_path(@project).should be_denied_for :admin } @@ -114,7 +114,7 @@ describe "Projects" do it { project_issues_path(@project).should be_denied_for :visitor } end - describe "GET /project_code/snippets" do + describe "GET /project_code/snippets" do it { project_snippets_path(@project).should be_allowed_for @u1 } it { project_snippets_path(@project).should be_allowed_for @u3 } it { project_snippets_path(@project).should be_denied_for :admin } diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index 945c1ea2..3d897157 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -4,38 +4,38 @@ describe "Projects" do before { login_as :user } describe "GET /projects" do - before do + before do visit projects_path end it "should be on projects page" do - current_path.should == projects_path + current_path.should == projects_path end it "should have link to new project" do - page.should have_content("New Project") + page.should have_content("Create new project") end end describe "GET /projects/new" do - before do + before do visit projects_path - click_link "New Project" + click_link "Create new project" end it "should be correct path" do - current_path.should == new_project_path + current_path.should == new_project_path end it "should have labels for new project" do - page.should have_content("Name") - page.should have_content("Path") - page.should have_content("Description") + page.should have_content("Name") + page.should have_content("Path") + page.should have_content("Description") end end describe "POST /projects" do - before do + before do visit new_project_path fill_in 'Name', :with => 'NewProject' fill_in 'Code', :with => 'NPR' @@ -61,7 +61,7 @@ describe "Projects" do end describe "GET /projects/show" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -72,14 +72,14 @@ describe "Projects" do current_path.should == project_path(@project) end - it "should beahave like dashboard" do + it "should beahave like dashboard" do page.should have_content("History") end end describe "GET /projects/team" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -92,13 +92,13 @@ describe "Projects" do current_path.should == team_project_path(@project) end - it "should have as as team member" do + it "should have as as team member" do page.should have_content(@user.name) end end describe "GET /projects/:id/edit" do - before do + before do @project = Factory :project @project.add_access(@user, :admin, :read) @@ -110,14 +110,14 @@ describe "Projects" do end it "should have labels for new project" do - page.should have_content("Name") - page.should have_content("Path") - page.should have_content("Description") + page.should have_content("Name") + page.should have_content("Path") + page.should have_content("Description") end end describe "PUT /projects/:id" do - before do + before do @project = Factory :project @project.add_access(@user, :admin, :read) @@ -140,14 +140,14 @@ describe "Projects" do end #describe "DELETE /projects/:id", :js => true do - #before do + #before do #@project = Factory :project #@project.add_access(@user, :read, :admin) #visit projects_path #end #it "should be correct path" do - #expect { click_link "Destroy" }.to change {Project.count}.by(1) + #expect { click_link "Destroy" }.to change {Project.count}.by(1) #end #end end diff --git a/spec/requests/projects_tree_perfomance_spec.rb b/spec/requests/projects_tree_perfomance_spec.rb index 5b4facb1..bf3ca167 100644 --- a/spec/requests/projects_tree_perfomance_spec.rb +++ b/spec/requests/projects_tree_perfomance_spec.rb @@ -6,13 +6,13 @@ describe "Projects" do describe "GET /projects/tree" do describe "head" do - before do + before do @project = Factory :project @project.add_access(@user, :read) end - it "should be fast" do + it "should be fast" do time = Benchmark.realtime do visit tree_project_path(@project) end @@ -21,12 +21,12 @@ describe "Projects" do end describe ValidCommit::ID do - before do + before do @project = Factory :project @project.add_access(@user, :read) end - it "should be fast" do + it "should be fast" do time = Benchmark.realtime do visit tree_project_path(@project, :commit_id => ValidCommit::ID) end diff --git a/spec/requests/projects_tree_spec.rb b/spec/requests/projects_tree_spec.rb index 4e3176bb..fd49ffaa 100644 --- a/spec/requests/projects_tree_spec.rb +++ b/spec/requests/projects_tree_spec.rb @@ -5,7 +5,7 @@ describe "Projects" do describe "GET /projects/tree" do describe "head" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -20,7 +20,7 @@ describe "Projects" do end describe ValidCommit::ID do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -36,7 +36,7 @@ describe "Projects" do end describe "branch passed" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -53,7 +53,7 @@ describe "Projects" do # TREE FILE PREVIEW describe "file preview" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -70,9 +70,9 @@ describe "Projects" do end end - # RAW FILE + # RAW FILE describe "GET /projects/blob" do - before do + before do @project = Factory :project @project.add_access(@user, :read) @@ -85,7 +85,7 @@ describe "Projects" do current_path.should == blob_project_path(@project) end - it "raw file response" do + it "raw file response" do page.source.should == ValidCommit::BLOB_FILE end end diff --git a/spec/requests/projects_wall_spec.rb b/spec/requests/projects_wall_spec.rb index a7387f93..bb734bda 100644 --- a/spec/requests/projects_wall_spec.rb +++ b/spec/requests/projects_wall_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' describe "Projects", "Wall" do let(:project) { Factory :project } - before do + before do login_as :user project.add_access(@user, :read, :write) end describe "View notes on wall" do - before do + before do Factory :note, :project => project, :note => "Project specs", :author => @user visit wall_project_path(project) end @@ -19,8 +19,8 @@ describe "Projects", "Wall" do it { page.should have_content("less than a minute ago") } end - describe "add new note", :js => true do - before do + describe "add new note", :js => true do + before do visit wall_project_path(project) fill_in "note_note", :with => "my post on wall" click_button "Add note" diff --git a/spec/requests/snippets_spec.rb b/spec/requests/snippets_spec.rb index 00ae58da..ee4f90e6 100644 --- a/spec/requests/snippets_spec.rb +++ b/spec/requests/snippets_spec.rb @@ -3,13 +3,13 @@ require 'spec_helper' describe "Snippets" do let(:project) { Factory :project } - before do + before do login_as :user project.add_access(@user, :read, :write) end describe "GET /snippets" do - before do + before do @snippet = Factory :snippet, :author => @user, :project => project @@ -23,15 +23,23 @@ describe "Snippets" do it { should have_content(@snippet.project.name) } it { should have_content(@snippet.author.name) } - describe "Destroy" do - before do + it "doesn't show expired snippets" do + @snippet.update_attribute(:expires_at, 1.day.ago.to_time) + visit project_snippet_path(project, @snippet) + page.should have_content("Sorry, this snippet is no longer exists") + page.should_not have_content(@snippet.title) + page.should_not have_content(@snippet.content) + end + + describe "Destroy" do + before do # admin access to remove snippet @user.users_projects.destroy_all project.add_access(@user, :read, :write, :admin) visit project_snippets_path(project) end - it "should remove entry" do + it "should remove entry" do expect { click_link "destroy_snippet_#{@snippet.id}" }.to change { Snippet.count }.by(-1) @@ -39,17 +47,17 @@ describe "Snippets" do end end - describe "New snippet" do - before do + describe "New snippet" do + before do visit project_snippets_path(project) click_link "New Snippet" end - it "should open new snippet popup" do + it "should open new snippet popup" do page.current_path.should == new_project_snippet_path(project) end - describe "fill in" do + describe "fill in" do before do fill_in "snippet_title", :with => "login function" fill_in "snippet_file_name", :with => "test.rb" @@ -58,7 +66,7 @@ describe "Snippets" do it { expect { click_button "Save" }.to change {Snippet.count}.by(1) } - it "should add new snippet to table" do + it "should add new snippet to table" do click_button "Save" page.current_path.should == project_snippet_path(project, Snippet.last) page.should have_content "login function" @@ -67,8 +75,8 @@ describe "Snippets" do end end - describe "Edit snippet" do - before do + describe "Edit snippet" do + before do @snippet = Factory :snippet, :author => @user, :project => project @@ -76,11 +84,11 @@ describe "Snippets" do click_link "Edit" end - it "should open edit page" do + it "should open edit page" do page.current_path.should == edit_project_snippet_path(project, @snippet) end - describe "fill in" do + describe "fill in" do before do fill_in "snippet_title", :with => "login function" fill_in "snippet_file_name", :with => "test.rb" @@ -89,7 +97,7 @@ describe "Snippets" do it { expect { click_button "Save" }.to_not change {Snippet.count} } - it "should update snippet fields" do + it "should update snippet fields" do click_button "Save" page.current_path.should == project_snippet_path(project, @snippet) diff --git a/spec/requests/tags_spec.rb b/spec/requests/tags_spec.rb new file mode 100644 index 00000000..94a034da --- /dev/null +++ b/spec/requests/tags_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe "Tags" do + before { login_as :user } + + # describe "GET 'tags/index'" do + # it "should be successful" do + # get 'tags/index' + # response.should be_success + # end + # end + + + describe "GET '/tags.json'" do + before do + @project = Factory :project + @project.add_access(@user, :read) + @project.tag_list = 'demo1' + @project.save + visit '/tags.json' + end + + + it "should contains tags" do + page.should have_content('demo1') + end +end + + + +end diff --git a/spec/requests/team_members_spec.rb b/spec/requests/team_members_spec.rb index 650ed449..d6555518 100644 --- a/spec/requests/team_members_spec.rb +++ b/spec/requests/team_members_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe "TeamMembers" do - before do + before do login_as :user @project = Factory :project @project.add_access(@user, :read, :admin) @@ -10,7 +10,7 @@ describe "TeamMembers" do describe "View profile" do it "should be available" do visit(team_project_path(@project)) - within "#team-table" do + within "#team-table" do click_link(@user.name) end page.should have_content @user.skype @@ -18,23 +18,23 @@ describe "TeamMembers" do end end - describe "New Team member", :js => true do - before do + describe "New Team member", :js => true do + before do @user_1 = Factory :user visit team_project_path(@project) click_link "Add new" end - it "should open new team member popup" do + it "should open new team member popup" do page.should have_content("Add new member to project") end - describe "fill in" do + describe "fill in" do before do click_link "Select user" click_link @user_1.name - within "#team_member_new" do + within "#team_member_new" do check "team_member_read" check "team_member_write" end @@ -42,7 +42,7 @@ describe "TeamMembers" do it { expect { click_button "Save";sleep(1) }.to change {UsersProject.count}.by(1) } - it "should add new member to table" do + it "should add new member to table" do click_button "Save" @member = UsersProject.last @@ -53,8 +53,8 @@ describe "TeamMembers" do @member.admin.should be_false end - it "should not allow creation without access selected" do - within "#team_member_new" do + it "should not allow creation without access selected" do + within "#team_member_new" do uncheck "team_member_read" uncheck "team_member_write" uncheck "team_member_admin" @@ -66,8 +66,8 @@ describe "TeamMembers" do end end - describe "Cancel membership" do - it "should cancel membership" do + describe "Cancel membership" do + it "should cancel membership" do visit team_project_path(@project) expect { click_link "Cancel" }.to change { UsersProject.count }.by(-1) end diff --git a/spec/requests/top_panel_spec.rb b/spec/requests/top_panel_spec.rb index bd4d2047..d1cea6d8 100644 --- a/spec/requests/top_panel_spec.rb +++ b/spec/requests/top_panel_spec.rb @@ -4,7 +4,7 @@ describe "Top Panel", :js => true do before { login_as :user } describe "Search autocomplete" do - before do + before do visit projects_path fill_in "search", :with => "Ke" sleep(2) @@ -12,12 +12,12 @@ describe "Top Panel", :js => true do end it "should be on projects page" do - current_path.should == keys_path + current_path.should == keys_path end end describe "with project" do - before do + before do @project = Factory :project @project.add_access(@user, :read) visit project_path(@project) @@ -28,7 +28,7 @@ describe "Top Panel", :js => true do end it "should be on projects page" do - current_path.should == project_commits_path(@project) + current_path.should == project_commits_path(@project) end end end diff --git a/spec/requests/user_security_spec.rb b/spec/requests/user_security_spec.rb index a27eb1ca..b75a1779 100644 --- a/spec/requests/user_security_spec.rb +++ b/spec/requests/user_security_spec.rb @@ -2,32 +2,32 @@ require 'spec_helper' describe "Users Security" do describe "Project" do - before do + before do @u1 = Factory :user end - describe "GET /login" do + describe "GET /login" do #it { new_user_session_path.should be_denied_for @u1 } #it { new_user_session_path.should be_denied_for :admin } #it { new_user_session_path.should be_denied_for :user } it { new_user_session_path.should_not be_404_for :visitor } end - describe "GET /keys" do + describe "GET /keys" do it { keys_path.should be_allowed_for @u1 } it { keys_path.should be_allowed_for :admin } it { keys_path.should be_allowed_for :user } it { keys_path.should be_denied_for :visitor } end - describe "GET /profile" do + describe "GET /profile" do it { profile_path.should be_allowed_for @u1 } it { profile_path.should be_allowed_for :admin } it { profile_path.should be_allowed_for :user } it { profile_path.should be_denied_for :visitor } end - describe "GET /profile/password" do + describe "GET /profile/password" do it { profile_password_path.should be_allowed_for @u1 } it { profile_password_path.should be_allowed_for :admin } it { profile_password_path.should be_allowed_for :user } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0c2545e3..aa7f23d8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,6 @@ require 'capybara/dsl' require 'factories' require 'monkeypatch' - # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} diff --git a/spec/support/login.rb b/spec/support/login.rb index 462647ab..026e336d 100644 --- a/spec/support/login.rb +++ b/spec/support/login.rb @@ -1,29 +1,29 @@ module LoginMacros def login_as role - @user = User.create(:email => "user#{User.count}@mail.com", + @user = User.create(:email => "user#{User.count}@mail.com", :name => "John Smith", :password => "123456", :password_confirmation => "123456", :skype => 'user_skype') - - if role == :admin + + if role == :admin @user.admin = true @user.save! end visit new_user_session_path - fill_in "Email", :with => @user.email - fill_in "Password", :with => "123456" + fill_in "user_email", :with => @user.email + fill_in "user_password", :with => "123456" click_button "Sign in" end def login_with(user) visit new_user_session_path - fill_in "Email", :with => user.email - fill_in "Password", :with => "123456" + fill_in "user_email", :with => user.email + fill_in "user_password", :with => "123456" click_button "Sign in" end - + def logout click_link "Logout" rescue nil end diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index dcdfa6d5..e0672166 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -18,17 +18,17 @@ RSpec::Matchers.define :be_denied_for do |user| match do |url| include UrlAccess url_denied?(user, url) - end + end end RSpec::Matchers.define :be_404_for do |user| match do |url| include UrlAccess url_404?(user, url) - end + end end -module UrlAccess +module UrlAccess def url_allowed?(user, url) emulate_user(user) visit url diff --git a/spec/support/shared_examples.rb b/spec/support/shared_examples.rb index a2e94ac1..118b9b2a 100644 --- a/spec/support/shared_examples.rb +++ b/spec/support/shared_examples.rb @@ -6,13 +6,12 @@ shared_examples_for :project_side_pane do it { should have_content("Tree") } end - shared_examples_for :tree_view do subject { page } it "should have Tree View of project" do - should have_content("app") - should have_content("history") - should have_content("Gemfile") + should have_content("app") + should have_content("history") + should have_content("Gemfile") end end diff --git a/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png b/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 00000000..5b5dab2a Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png b/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 00000000..ac8b229a Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png b/vendor/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 00000000..ad3d6346 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png b/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 00000000..42ccba26 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png b/vendor/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 00000000..5a46b47c Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png b/vendor/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 00000000..86c2baa6 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png b/vendor/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 00000000..4443fdc1 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png b/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 00000000..7c9fa6c6 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png b/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png new file mode 100644 index 00000000..b273ff11 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png differ diff --git a/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png b/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png new file mode 100644 index 00000000..84defe6e Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png differ diff --git a/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png b/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png new file mode 100644 index 00000000..59bd45b9 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png differ diff --git a/vendor/assets/images/jquery-ui/ui-icons_888888_256x240.png b/vendor/assets/images/jquery-ui/ui-icons_888888_256x240.png new file mode 100644 index 00000000..6d02426c Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-icons_888888_256x240.png differ diff --git a/vendor/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png b/vendor/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png new file mode 100644 index 00000000..2ab019b7 Binary files /dev/null and b/vendor/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png differ diff --git a/vendor/assets/javascripts/jquery-ui.js b/vendor/assets/javascripts/jquery-ui.js new file mode 100644 index 00000000..d92b7a34 --- /dev/null +++ b/vendor/assets/javascripts/jquery-ui.js @@ -0,0 +1,791 @@ +/*! + * jQuery UI 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", +keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= +this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, +"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": +"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, +outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, +"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& +a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= +false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= +m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; +this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, +_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= +false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, +10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| +!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& +a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= +this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), +10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), +10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, +(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= +"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), +10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ +this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& +!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d
    ');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); +var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= +false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); +this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= +{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; +if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, +_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, +{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: +Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= +null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a
    ');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ +a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ +c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); +b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), +10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- +f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? +e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= +e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, +step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= +e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; +var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: +a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- +d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, +f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, +display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= +e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= +d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== +"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& +!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, +left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; +this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= +document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); +return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], +e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); +c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): +this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, +dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, +toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); +if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), +this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= +this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= +d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| +0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", +a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- +f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- +this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, +this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", +a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= +this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), +e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| +e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", +"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", +animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); +f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", +paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g= +false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= +a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; +this.menu=d("
      ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& +a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); +d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& +b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= +this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, +"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); +this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, +this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": +"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== +"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); +b.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, +position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), +h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", +e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== +b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; +d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== +f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
      ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, +function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", +handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, +originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", +f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): +[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); +if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): +e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= +this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- +b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), +create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& +c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j"); +this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", +g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? +(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- +m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); +return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; +this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= +this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= +this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); +c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= +this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- +g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, +b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.bind("mouseout", +function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); +b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, +setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, +"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
      '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", +function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== +"focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): +d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, +b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= +1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ +2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= +d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= +a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, +"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== +a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", +a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= +"";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); +c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= +true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); +a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& +!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), +h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= +this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); +this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? +"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); +this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); +if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? +b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", +COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: +null)||this._defaults.monthNames;var i=function(o){(o=k+1 +12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& +a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? +new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); +n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, +g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& +a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
      '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
      ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
      '+(/all|left/.test(t)&& +x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
      ';var z=j?'":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+ +r.getDate()+"":''+r.getDate()+"")+"
      "+(l?""+(i[0]>0&&G==i[1]-1?'
      ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
      ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, +e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
      ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ +(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? +a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, +e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, +"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; +if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== +"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
      ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); +;/* + * jQuery UI Effects 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; +f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, +[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), +d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; +if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); +return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, +arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ +2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, +d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, +a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, +d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], +10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; diff --git a/vendor/assets/javascripts/jquery.cookie.js b/vendor/assets/javascripts/jquery.cookie.js new file mode 100644 index 00000000..6a3e394b --- /dev/null +++ b/vendor/assets/javascripts/jquery.cookie.js @@ -0,0 +1,41 @@ +/** + * jQuery Cookie plugin + * + * Copyright (c) 2010 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +jQuery.cookie = function (key, value, options) { + + // key and at least value given, set cookie... + if (arguments.length > 1 && String(value) !== "[object Object]") { + options = jQuery.extend({}, options); + + if (value === null || value === undefined) { + options.expires = -1; + } + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setDate(t.getDate() + days); + } + + value = String(value); + + return (document.cookie = [ + encodeURIComponent(key), '=', + options.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // key and possibly options given, get cookie... + options = value || {}; + var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; + return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; +}; diff --git a/vendor/assets/javascripts/jquery.tagify.js b/vendor/assets/javascripts/jquery.tagify.js new file mode 100644 index 00000000..f22d4c71 --- /dev/null +++ b/vendor/assets/javascripts/jquery.tagify.js @@ -0,0 +1,143 @@ +/* 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 new file mode 100644 index 00000000..957fe4d8 --- /dev/null +++ b/vendor/assets/javascripts/jquery.ui.selectmenu.js @@ -0,0 +1,844 @@ + /* + * 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 = $( '
        ', { + 'class': 'ui-widget ui-widget-content', + 'aria-hidden': true, + 'role': 'listbox', + 'aria-labelledby': this.ids[0], + 'id': this.ids[1] + }); + this.listWrap = $( o.wrapperElement ) + .addClass( self.widgetBaseClass + '-menu' ) + .append( this.list ) + .appendTo( 'body' ); + + // transfer menu click to menu button + this.list + .bind("keydown.selectmenu", function(event) { + var ret = false; + switch (event.keyCode) { + case $.ui.keyCode.UP: + if (event.altKey) { + self.close(event, true); + } else { + self._moveFocus(-1); + } + break; + case $.ui.keyCode.DOWN: + if (event.altKey) { + self.close(event, true); + } else { + self._moveFocus(1); + } + break; + case $.ui.keyCode.LEFT: + self._moveFocus(-1); + break; + case $.ui.keyCode.RIGHT: + self._moveFocus(1); + break; + case $.ui.keyCode.HOME: + self._moveFocus(':first'); + break; + case $.ui.keyCode.PAGE_UP: + self._scrollPage('up'); + break; + case $.ui.keyCode.PAGE_DOWN: + self._scrollPage('down'); + break; + case $.ui.keyCode.END: + self._moveFocus(':last'); + break; + case $.ui.keyCode.ENTER: + case $.ui.keyCode.SPACE: + self.close(event, true); + $(event.target).parents('li:eq(0)').trigger('mouseup'); + break; + case $.ui.keyCode.TAB: + ret = true; + self.close(event, true); + $(event.target).parents('li:eq(0)').trigger('mouseup'); + break; + case $.ui.keyCode.ESCAPE: + self.close(event, true); + break; + default: + ret = true; + } + return ret; + }) + .bind('keypress.selectmenu', function(event) { + self._typeAhead(event.which, 'focus'); + return true; + }) + // this allows for using the scrollbar in an overflowed list + .bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; }); + + // needed when window is resized + // TODO seems to be useless, but causes errors (fnagel 01.08.11) + // see: https://github.com/fnagel/jquery-ui/issues/147 + // $(window).bind( "resize.selectmenu", $.proxy( self._refreshPosition, this ) ); + }, + + _init: function() { + var self = this, o = this.options; + + // serialize selectmenu element options + var selectOptionData = []; + this.element + .find('option') + .each(function() { + var opt = $(this); + selectOptionData.push({ + value: opt.attr('value'), + text: self._formatText(opt.text()), + selected: opt.attr('selected'), + disabled: opt.attr('disabled'), + classes: opt.attr('class'), + typeahead: opt.attr('typeahead'), + parentOptGroup: opt.parent('optgroup'), + bgImage: o.bgImage.call(opt) + }); + }); + + // active state class is only used in popup style + var activeClass = (self.options.style == "popup") ? " ui-state-active" : ""; + + // empty list so we can refresh the selectmenu via selectmenu() + this.list.html(""); + + // write li's + if (selectOptionData.length) { + for (var i = 0; i < selectOptionData.length; i++) { + var thisLiAttr = { role : 'presentation' }; + if ( selectOptionData[ i ].disabled ) { + thisLiAttr[ 'class' ] = this.namespace + '-state-disabled'; + } + var thisAAttr = { + html: selectOptionData[i].text, + href : '#nogo', + tabindex : -1, + role : 'option', + 'aria-selected' : false + }; + if ( selectOptionData[ i ].disabled ) { + thisAAttr[ 'aria-disabled' ] = selectOptionData[ i ].disabled; + } + if ( selectOptionData[ i ].typeahead ) { + thisAAttr[ 'typeahead' ] = selectOptionData[ i ].typeahead; + } + var thisA = $('', thisAAttr); + var thisLi = $('
      • ', thisLiAttr) + .append(thisA) + .data('index', i) + .addClass(selectOptionData[i].classes) + .data('optionClasses', selectOptionData[i].classes || '') + .bind("mouseup.selectmenu", function(event) { + if (self._safemouseup && !self._disabled(event.currentTarget) && !self._disabled($( event.currentTarget ).parents( "ul>li." + self.widgetBaseClass + "-group " )) ) { + var changed = $(this).data('index') != self._selectedIndex(); + self.index($(this).data('index')); + self.select(event); + if (changed) { + self.change(event); + } + self.close(event, true); + } + return false; + }) + .bind("click.selectmenu", function() { + return false; + }) + .bind('mouseover.selectmenu focus.selectmenu', function(e) { + // no hover if diabled + if (!$(e.currentTarget).hasClass(self.namespace + '-state-disabled') && !$(e.currentTarget).parent("ul").parent("li").hasClass(self.namespace + '-state-disabled')) { + self._selectedOptionLi().addClass(activeClass); + self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); + $(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover'); + } + }) + .bind('mouseout.selectmenu blur.selectmenu', function() { + if ($(this).is(self._selectedOptionLi().selector)) { + $(this).addClass(activeClass); + } + $(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); + }); + + // optgroup or not... + if ( selectOptionData[i].parentOptGroup.length ) { + var optGroupName = self.widgetBaseClass + '-group-' + this.element.find( 'optgroup' ).index( selectOptionData[i].parentOptGroup ); + if (this.list.find( 'li.' + optGroupName ).length ) { + this.list.find( 'li.' + optGroupName + ':last ul' ).append( thisLi ); + } else { + $('
      • ') + .appendTo( this.list ) + .find( 'ul' ) + .append( thisLi ); + } + } else { + thisLi.appendTo(this.list); + } + + // append icon if option is specified + if (o.icons) { + for (var j in o.icons) { + if (thisLi.is(o.icons[j].find)) { + thisLi + .data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon') + .addClass(self.widgetBaseClass + '-hasIcon'); + var iconClass = o.icons[j].icon || ""; + thisLi + .find('a:eq(0)') + .prepend(''); + if (selectOptionData[i].bgImage) { + thisLi.find('span').css('background-image', selectOptionData[i].bgImage); + } + } + } + } + } + } else { + $('
      • ').appendTo(this.list); + } + // we need to set and unset the CSS classes for dropdown and popup style + var isDropDown = ( o.style == 'dropdown' ); + this.newelement + .toggleClass( self.widgetBaseClass + '-dropdown', isDropDown ) + .toggleClass( self.widgetBaseClass + '-popup', !isDropDown ); + this.list + .toggleClass( self.widgetBaseClass + '-menu-dropdown ui-corner-bottom', isDropDown ) + .toggleClass( self.widgetBaseClass + '-menu-popup ui-corner-all', !isDropDown ) + // add corners to top and bottom menu items + .find( 'li:first' ) + .toggleClass( 'ui-corner-top', !isDropDown ) + .end().find( 'li:last' ) + .addClass( 'ui-corner-bottom' ); + this.selectmenuIcon + .toggleClass( 'ui-icon-triangle-1-s', isDropDown ) + .toggleClass( 'ui-icon-triangle-2-n-s', !isDropDown ); + + // transfer classes to selectmenu and list + if ( o.transferClasses ) { + var transferClasses = this.element.attr( 'class' ) || ''; + this.newelement.add( this.list ).addClass( transferClasses ); + } + + // set menu width to either menuWidth option value, width option value, or select width + if ( o.style == 'dropdown' ) { + this.list.width( o.menuWidth ? o.menuWidth : o.width ); + } else { + this.list.width( o.menuWidth ? o.menuWidth : o.width - o.handleWidth ); + } + + // reset height to auto + this.list.css( 'height', 'auto' ); + var listH = this.listWrap.height(); + // calculate default max height + if ( o.maxHeight && o.maxHeight < listH ) { + this.list.height( o.maxHeight ); + } else { + var winH = $( window ).height() / 3; + if ( winH < listH ) this.list.height( winH ); + } + + // save reference to actionable li's (not group label li's) + this._optionLis = this.list.find( 'li:not(.' + self.widgetBaseClass + '-group)' ); + + // transfer disabled state + if ( this.element.attr( 'disabled' ) ) { + this.disable(); + } else { + this.enable() + } + + // update value + this.index( this._selectedIndex() ); + + // needed when selectmenu is placed at the very bottom / top of the page + window.setTimeout( function() { + self._refreshPosition(); + }, 200 ); + }, + + destroy: function() { + this.element.removeData( this.widgetName ) + .removeClass( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled' ) + .removeAttr( 'aria-disabled' ) + .unbind( ".selectmenu" ); + + // TODO unneded as event binding has been disabled + // $( window ).unbind( ".selectmenu" ); + $( document ).unbind( ".selectmenu" ); + + // unbind click on label, reset its for attr + $( 'label[for=' + this.newelement.attr('id') + ']' ) + .attr( 'for', this.element.attr( 'id' ) ) + .unbind( '.selectmenu' ); + + this.newelementWrap.remove(); + this.listWrap.remove(); + + this.element.show(); + + // call widget destroy function + $.Widget.prototype.destroy.apply(this, arguments); + }, + + _typeAhead: function( code, eventType ){ + var self = this, focusFound = false, C = String.fromCharCode(code).toUpperCase(); + c = C.toLowerCase(); + + if ( self.options.typeAhead == 'sequential' ) { + // clear the timeout so we can use _prevChar + window.clearTimeout('ui.selectmenu-' + self.selectmenuId); + + // define our find var + var find = typeof( self._prevChar ) == 'undefined' ? '' : self._prevChar.join( '' ); + + function focusOptSeq( elem, ind, c ){ + focusFound = true; + $( elem ).trigger( eventType ); + typeof( self._prevChar ) == 'undefined' ? self._prevChar = [ c ] : self._prevChar[ self._prevChar.length ] = c; + } + this.list.find( 'li a' ).each( function( i ) { + if ( !focusFound ) { + // allow the typeahead attribute on the option tag for a more specific lookup + var thisText = $( this ).attr( 'typeahead' ) || $(this).text(); + if ( thisText.indexOf( find + C ) === 0 ) { + focusOptSeq( this, i, C ); + } else if (thisText.indexOf(find+c) === 0 ) { + focusOptSeq( this, i, c ); + } + } + }); + // set a 1 second timeout for sequenctial typeahead + // keep this set even if we have no matches so it doesnt typeahead somewhere else + window.setTimeout( function( el ) { + self._prevChar = undefined; + }, 1000, self ); + + } else { + // define self._prevChar if needed + if ( !self._prevChar ) { self._prevChar = [ '' , 0 ]; } + + focusFound = false; + function focusOpt( elem, ind ){ + focusFound = true; + $( elem ).trigger( eventType ); + self._prevChar[ 1 ] = ind; + } + this.list.find( 'li a' ).each(function( i ){ + if (!focusFound){ + var thisText = $(this).text(); + if ( thisText.indexOf( C ) === 0 || thisText.indexOf( c ) === 0 ) { + if (self._prevChar[0] == C){ + if ( self._prevChar[ 1 ] < i ){ focusOpt( this, i ); } + } else{ + focusOpt( this, i ); + } + } + } + }); + this._prevChar[ 0 ] = C; + } + }, + + // returns some usefull information, called by callbacks only + _uiHash: function() { + var index = this.index(); + return { + index: index, + option: $("option", this.element).get(index), + value: this.element[0].value + }; + }, + + open: function(event) { + var self = this, o = this.options; + if ( self.newelement.attr("aria-disabled") != 'true' ) { + self._closeOthers(event); + self.newelement.addClass('ui-state-active'); + + self.listWrap.appendTo( o.appendTo ); + self.list.attr('aria-hidden', false); + + if ( o.style == "dropdown" ) { + self.newelement.removeClass('ui-corner-all').addClass('ui-corner-top'); + } + + self.listWrap.addClass( self.widgetBaseClass + '-open' ); + // positioning needed for IE7 (tested 01.08.11 on MS VPC Image) + // see https://github.com/fnagel/jquery-ui/issues/147 + if ( $.browser.msie && $.browser.version.substr( 0,1 ) == 7 ) { + self._refreshPosition(); + } + var selected = self.list.attr('aria-hidden', false).find('li:not(.' + self.widgetBaseClass + '-group):eq(' + self._selectedIndex() + '):visible a'); + if (selected.length) selected[0].focus(); + // positioning needed for FF, Chrome, IE8, IE7, IE6 (tested 01.08.11 on MS VPC Image) + self._refreshPosition(); + + self._trigger("open", event, self._uiHash()); + } + }, + + close: function(event, retainFocus) { + if ( this.newelement.is('.ui-state-active') ) { + this.newelement + .removeClass('ui-state-active'); + this.listWrap.removeClass(this.widgetBaseClass + '-open'); + this.list.attr('aria-hidden', true); + if ( this.options.style == "dropdown" ) { + this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); + } + if ( retainFocus ) { + this.newelement.focus(); + } + this._trigger("close", event, this._uiHash()); + } + }, + + change: function(event) { + this.element.trigger("change"); + this._trigger("change", event, this._uiHash()); + }, + + select: function(event) { + if (this._disabled(event.currentTarget)) { return false; } + this._trigger("select", event, this._uiHash()); + }, + + _closeOthers: function(event) { + $('.' + this.widgetBaseClass + '.ui-state-active').not(this.newelement).each(function() { + $(this).data('selectelement').selectmenu('close', event); + }); + $('.' + this.widgetBaseClass + '.ui-state-hover').trigger('mouseout'); + }, + + _toggle: function(event, retainFocus) { + if ( this.list.parent().is('.' + this.widgetBaseClass + '-open') ) { + this.close(event, retainFocus); + } else { + this.open(event); + } + }, + + _formatText: function(text) { + return (this.options.format ? this.options.format(text) : text); + }, + + _selectedIndex: function() { + return this.element[0].selectedIndex; + }, + + _selectedOptionLi: function() { + return this._optionLis.eq(this._selectedIndex()); + }, + + _focusedOptionLi: function() { + return this.list.find('.' + this.widgetBaseClass + '-item-focus'); + }, + + _moveSelection: function(amt, recIndex) { + // do nothing if disabled + if (!this.options.disabled) { + var currIndex = parseInt(this._selectedOptionLi().data('index') || 0, 10); + var newIndex = currIndex + amt; + // do not loop when using up key + + if (newIndex < 0) { + newIndex = 0; + } + if (newIndex > this._optionLis.size() - 1) { + newIndex = this._optionLis.size() - 1; + } + // Occurs when a full loop has been made + if (newIndex === recIndex) { return false; } + + if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) { + // if option at newIndex is disabled, call _moveFocus, incrementing amt by one + (amt > 0) ? ++amt : --amt; + this._moveSelection(amt, newIndex); + } else { + return this._optionLis.eq(newIndex).trigger('mouseup'); + } + } + }, + + _moveFocus: function(amt, recIndex) { + if (!isNaN(amt)) { + var currIndex = parseInt(this._focusedOptionLi().data('index') || 0, 10); + var newIndex = currIndex + amt; + } else { + var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10); + } + + if (newIndex < 0) { + newIndex = 0; + } + if (newIndex > this._optionLis.size() - 1) { + newIndex = this._optionLis.size() - 1; + } + + //Occurs when a full loop has been made + if (newIndex === recIndex) { return false; } + + var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000); + + this._focusedOptionLi().find('a:eq(0)').attr('id', ''); + + if (this._optionLis.eq(newIndex).hasClass( this.namespace + '-state-disabled' )) { + // if option at newIndex is disabled, call _moveFocus, incrementing amt by one + (amt > 0) ? ++amt : --amt; + this._moveFocus(amt, newIndex); + } else { + this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID).focus(); + } + + this.list.attr('aria-activedescendant', activeID); + }, + + _scrollPage: function(direction) { + var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight()); + numPerPage = (direction == 'up' ? -numPerPage : numPerPage); + this._moveFocus(numPerPage); + }, + + _setOption: function(key, value) { + this.options[key] = value; + // set + if (key == 'disabled') { + this.close(); + this.element + .add(this.newelement) + .add(this.list)[value ? 'addClass' : 'removeClass']( + this.widgetBaseClass + '-disabled' + ' ' + + this.namespace + '-state-disabled') + .attr("aria-disabled", value); + } + }, + + disable: function(index, type){ + // if options is not provided, call the parents disable function + if ( typeof( index ) == 'undefined' ) { + this._setOption( 'disabled', true ); + } else { + if ( type == "optgroup" ) { + this._disableOptgroup(index); + } else { + this._disableOption(index); + } + } + }, + + enable: function(index, type) { + // if options is not provided, call the parents enable function + if ( typeof( index ) == 'undefined' ) { + this._setOption('disabled', false); + } else { + if ( type == "optgroup" ) { + this._enableOptgroup(index); + } else { + this._enableOption(index); + } + } + }, + + _disabled: function(elem) { + return $(elem).hasClass( this.namespace + '-state-disabled' ); + }, + + _disableOption: function(index) { + var optionElem = this._optionLis.eq(index); + if (optionElem) { + optionElem.addClass(this.namespace + '-state-disabled') + .find("a").attr("aria-disabled", true); + this.element.find("option").eq(index).attr("disabled", "disabled"); + } + }, + + _enableOption: function(index) { + var optionElem = this._optionLis.eq(index); + if (optionElem) { + optionElem.removeClass( this.namespace + '-state-disabled' ) + .find("a").attr("aria-disabled", false); + this.element.find("option").eq(index).removeAttr("disabled"); + } + }, + + _disableOptgroup: function(index) { + var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index ); + if (optGroupElem) { + optGroupElem.addClass(this.namespace + '-state-disabled') + .attr("aria-disabled", true); + this.element.find("optgroup").eq(index).attr("disabled", "disabled"); + } + }, + + _enableOptgroup: function(index) { + var optGroupElem = this.list.find( 'li.' + this.widgetBaseClass + '-group-' + index ); + if (optGroupElem) { + optGroupElem.removeClass(this.namespace + '-state-disabled') + .attr("aria-disabled", false); + this.element.find("optgroup").eq(index).removeAttr("disabled"); + } + }, + + index: function(newValue) { + if (arguments.length) { + if (!this._disabled($(this._optionLis[newValue]))) { + this.element[0].selectedIndex = newValue; + this._refreshValue(); + } else { + return false; + } + } else { + return this._selectedIndex(); + } + }, + + value: function(newValue) { + if (arguments.length) { + this.element[0].value = newValue; + this._refreshValue(); + } else { + return this.element[0].value; + } + }, + + _refreshValue: function() { + var activeClass = (this.options.style == "popup") ? " ui-state-active" : ""; + var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000); + // deselect previous + this.list + .find('.' + this.widgetBaseClass + '-item-selected') + .removeClass(this.widgetBaseClass + "-item-selected" + activeClass) + .find('a') + .attr('aria-selected', 'false') + .attr('id', ''); + // select new + this._selectedOptionLi() + .addClass(this.widgetBaseClass + "-item-selected" + activeClass) + .find('a') + .attr('aria-selected', 'true') + .attr('id', activeID); + + // toggle any class brought in from option + var currentOptionClasses = (this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : ""); + var newOptionClasses = (this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : ""); + this.newelement + .removeClass(currentOptionClasses) + .data('optionClasses', newOptionClasses) + .addClass( newOptionClasses ) + .find('.' + this.widgetBaseClass + '-status') + .html( + this._selectedOptionLi() + .find('a:eq(0)') + .html() + ); + + this.list.attr('aria-activedescendant', activeID); + }, + + _refreshPosition: function() { + var o = this.options; + + // if its a native pop-up we need to calculate the position of the selected li + if ( o.style == "popup" && !o.positionOptions.offset ) { + var selected = this._selectedOptionLi(); + var _offset = "0 -" + ( selected.outerHeight() + selected.offset().top - this.list.offset().top ); + } + // update zIndex if jQuery UI is able to process + var zIndexElement = this.element.zIndex(); + if ( zIndexElement ) { + this.listWrap.css( 'zIndex', zIndexElement ); + } + this.listWrap.position({ + // set options for position plugin + of: o.positionOptions.of || this.newelement, + my: o.positionOptions.my, + at: o.positionOptions.at, + offset: o.positionOptions.offset || _offset, + collision: o.positionOptions.collision || 'flip' + }); + } +}); + +})(jQuery); diff --git a/vendor/assets/stylesheets/jquery-ui/jquery-ui.css b/vendor/assets/stylesheets/jquery-ui/jquery-ui.css new file mode 100644 index 00000000..a6b4c363 --- /dev/null +++ b/vendor/assets/stylesheets/jquery-ui/jquery-ui.css @@ -0,0 +1,577 @@ +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +/*.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }*/ +/*.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }*/ +/*.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }*/ +/*.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }*/ + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; border:1px solid #ddd} +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.16 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; + background: #fff !important; + background: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#FFF6BF)) !important; + background: -moz-linear-gradient(top,#fff,#FFF6BF) !important; + background: transparent 9 !important; + border-radius:0px; + border-color:white; + border-bottom: 1px solid #E2EAEE; + border-top: 1px solid #E2EAEE; + +} +/* + * jQuery UI Button 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #F7F7F7; color:#555; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0;} +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background:#eaeaea} +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: 0; border:none; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap;} +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; width:200px} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } diff --git a/vendor/assets/stylesheets/jquery-ui/jquery.tagify.css b/vendor/assets/stylesheets/jquery-ui/jquery.tagify.css new file mode 100644 index 00000000..d6c178f7 --- /dev/null +++ b/vendor/assets/stylesheets/jquery-ui/jquery.tagify.css @@ -0,0 +1,34 @@ +/* Tagify styles +Author: Alicia Liu test +*/ + +.tagify-container { +} + +.tagify-container > span { + display: inline-block; + padding: 8px 11px 8px 11px; + margin: 1px 5px 0px 0px; + border-radius: 4px; + border: 1px solid #d0e1ff; + background-color: #d0e1ff; + color: #0f326d; + font-weight: bold; + font-size: 14px; +} + +.tagify-container > span > a { + padding-left: 5px !important; + color: #83a5e1; + text-decoration: none; + font-weight: bold; +} + +.tagify-container > input { + border: 0 none; + width: 100px !important; +} + +.tagify-container > input:focus { + outline: none; +} \ No newline at end of file diff --git a/vendor/assets/stylesheets/jquery-ui/jquery.ui.selectmenu.css b/vendor/assets/stylesheets/jquery-ui/jquery.ui.selectmenu.css new file mode 100644 index 00000000..481adf5a --- /dev/null +++ b/vendor/assets/stylesheets/jquery-ui/jquery.ui.selectmenu.css @@ -0,0 +1,33 @@ +/* Selectmenu +----------------------------------*/ +.ui-selectmenu { background:none; font-size:12px;display: block; display: inline-block; position: relative; height: 2.2em; vertical-align: middle; text-decoration: none; overflow: hidden; zoom: 1; } +.ui-selectmenu-icon { position:absolute; right:6px; margin-top:-8px; top: 50%; } +.ui-selectmenu-menu { padding:0; margin:0; position:absolute; top: 0; display: none; z-index: 1005;} /* z-index: 1005 to make selectmenu work with dialog */ +.ui-selectmenu-menu ul { padding:0; margin:0; list-style:none; position: relative; overflow: auto; overflow-y: auto ; overflow-x: hidden; } +.ui-selectmenu-open { display: block; } +.ui-selectmenu.ui-widget { background:none; } +.ui-selectmenu-menu-popup { margin-top: -1px; } +.ui-selectmenu-menu-dropdown { } +.ui-selectmenu-menu li.ui-state-active { background:#F7FBFC; border:none; padding:1px 0;} +.ui-selectmenu-menu li { padding:0; margin:0; display: block; border-top: 1px dotted transparent; border-bottom: 1px dotted transparent; border-right-width: 0 !important; border-left-width: 0 !important; font-weight: normal !important; } +.ui-selectmenu-menu li a,.ui-selectmenu-status { line-height: 1.4em; display: block; padding: .405em 2.1em .405em 1em; outline:none; text-decoration:none; } +.ui-selectmenu-menu li.ui-state-disabled a, .ui-state-disabled { cursor: default; } +.ui-selectmenu-menu li.ui-selectmenu-hasIcon a, +.ui-selectmenu-hasIcon .ui-selectmenu-status { padding-left: 20px; position: relative; margin-left: 5px; } +.ui-selectmenu-menu li .ui-icon, .ui-selectmenu-status .ui-icon { position: absolute; top: 1em; margin-top: -8px; left: 0; } +.ui-selectmenu-status { line-height: 1.4em; } +.ui-selectmenu-open li.ui-selectmenu-item-focus { background: none repeat scroll 0 0 #FFF6BF; border:1px solid #eaeaea;} +.ui-selectmenu-open li.ui-selectmenu-item-selected { } +.ui-selectmenu-menu li span,.ui-selectmenu-status span { display:block; margin-bottom: .2em; } +.ui-selectmenu-menu li .ui-selectmenu-item-header { font-weight: bold; } +.ui-selectmenu-menu li .ui-selectmenu-item-content { } +.ui-selectmenu-menu li .ui-selectmenu-item-footer { opacity: .8; } +/* for optgroups */ +.ui-selectmenu-menu .ui-selectmenu-group { font-size: 1em; } +.ui-selectmenu-menu .ui-selectmenu-group .ui-selectmenu-group-label { line-height: 1.4em; display:block; padding: .6em .5em 0; font-weight: bold; } +.ui-selectmenu-menu .ui-selectmenu-group ul { margin: 0; padding: 0; } +/* IE6 workaround (dotted transparent borders) */ +* html .ui-selectmenu-menu li { border-color: pink; filter:chroma(color=pink); width:100%; } +* html .ui-selectmenu-menu li a { position: relative } +/* IE7 workaround (opacity disabled) */ +*+html .ui-state-disabled, *+html .ui-state-disabled a { color: silver; }