fix timing issues on failing scenarios. Fix deprecated jquery functions and update jqueryui

Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
Reinier Balt 2013-02-15 20:51:35 +01:00
parent 98fbbccdcb
commit 1b0d08bbb5
39 changed files with 715 additions and 600 deletions

View file

@ -57,7 +57,7 @@ group :test do
gem "selenium-webdriver" gem "selenium-webdriver"
# uncomment to use the webkit option. This depends on Qt to be installed # uncomment to use the webkit option. This depends on Qt to be installed
#gem "capybara-webkit" # gem "capybara-webkit"
# uncomment to be able to make screenshots from scenarios # uncomment to be able to make screenshots from scenarios
#gem "capybara-screenshot" #gem "capybara-screenshot"

View file

@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
RedCloth (4.2.9) RedCloth (4.2.9)
aasm (3.0.15) aasm (3.0.16)
actionmailer (3.2.12) actionmailer (3.2.12)
actionpack (= 3.2.12) actionpack (= 3.2.12)
mail (~> 2.4.4) mail (~> 2.4.4)
@ -31,7 +31,6 @@ GEM
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
acts_as_list (0.1.9) acts_as_list (0.1.9)
addressable (2.3.2)
arel (3.0.2) arel (3.0.2)
aruba (0.5.1) aruba (0.5.1)
childprocess (~> 0.3.6) childprocess (~> 0.3.6)
@ -51,8 +50,8 @@ GEM
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0) selenium-webdriver (~> 2.0)
xpath (~> 1.0.0) xpath (~> 1.0.0)
childprocess (0.3.6) childprocess (0.3.8)
ffi (~> 1.0, >= 1.0.6) ffi (~> 1.0, >= 1.0.11)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
@ -74,36 +73,33 @@ GEM
erubis (2.7.0) erubis (2.7.0)
execjs (1.4.0) execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
factory_girl (4.1.0) factory_girl (4.2.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.1.0) factory_girl_rails (4.2.1)
factory_girl (~> 4.1.0) factory_girl (~> 4.2.0)
railties (>= 3.0.0) railties (>= 3.0.0)
ffi (1.2.0) ffi (1.3.1)
formatize (1.1.0) formatize (1.1.0)
RedCloth (~> 4.2) RedCloth (~> 4.2)
actionpack (~> 3.0) actionpack (~> 3.0)
bluecloth (~> 2.2) bluecloth (~> 2.2)
gherkin (2.11.5) gherkin (2.11.6)
json (>= 1.4.6) json (>= 1.7.6)
hike (1.2.1) hike (1.2.1)
htmlentities (4.3.1) htmlentities (4.3.1)
i18n (0.6.1) i18n (0.6.1)
journey (1.0.4) journey (1.0.4)
jquery-rails (2.1.4) jquery-rails (2.2.1)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.7.7) json (1.7.7)
libv8 (3.11.8.13) libv8 (3.11.8.13)
libwebsocket (0.1.7.1)
addressable
websocket
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
mime-types (1.21) mime-types (1.21)
multi_json (1.5.1) multi_json (1.6.1)
mysql2 (0.3.11) mysql2 (0.3.11)
nokogiri (1.5.6) nokogiri (1.5.6)
polyglot (0.3.3) polyglot (0.3.3)
@ -140,18 +136,19 @@ GEM
rspec-expectations (2.12.1) rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3) diff-lcs (~> 1.1.3)
rubyzip (0.9.9) rubyzip (0.9.9)
safe_yaml (0.7.1)
sanitize (2.0.3) sanitize (2.0.3)
nokogiri (>= 1.4.4, < 1.6) nokogiri (>= 1.4.4, < 1.6)
sass (3.2.5) sass (3.2.5)
sass-rails (3.2.5) sass-rails (3.2.6)
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
selenium-webdriver (2.27.2) selenium-webdriver (2.29.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip rubyzip
websocket (~> 1.0.4)
simplecov (0.7.1) simplecov (0.7.1)
multi_json (~> 1.0) multi_json (~> 1.0)
simplecov-html (~> 0.7.1) simplecov-html (~> 0.7.1)
@ -161,7 +158,7 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6) sqlite3 (1.3.7)
swf_fu (2.0.3) swf_fu (2.0.3)
coffee-script coffee-script
rails (>= 3.1) rails (>= 3.1)
@ -170,10 +167,10 @@ GEM
ref ref
thor (0.17.0) thor (0.17.0)
tilt (1.3.3) tilt (1.3.3)
timecop (0.5.7) timecop (0.5.9.2)
tolk (1.3.4) tolk (1.3.5)
safe_yaml
will_paginate will_paginate
ya2yaml (~> 0.26)
treetop (1.4.12) treetop (1.4.12)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
@ -182,12 +179,11 @@ GEM
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2) multi_json (~> 1.0, >= 1.0.2)
uniform_notifier (1.1.1) uniform_notifier (1.1.1)
websocket (1.0.6) websocket (1.0.7)
will_paginate (3.0.3) will_paginate (3.0.4)
xpath (1.0.0) xpath (1.0.0)
nokogiri (~> 1.3) nokogiri (~> 1.3)
ya2yaml (0.31) yard (0.8.4.1)
yard (0.8.3)
PLATFORMS PLATFORMS
ruby ruby

View file

@ -17,7 +17,7 @@
//= require tracks.js //= require tracks.js
// Stuff in vendor/assets // Stuff in vendor/assets
//= require jquery-ui-1.9.0.custom.min //= require jquery-ui-1.10.0.custom.min
//= require jquery.ui.touch-punch.min //= require jquery.ui.touch-punch.min
//= require jquery.blockUI //= require jquery.blockUI
//= require jquery.cookie //= require jquery.cookie

View file

@ -70,7 +70,7 @@ var TracksForm = {
}); });
/* add behavior to clear the date both buttons for show_from and due */ /* add behavior to clear the date both buttons for show_from and due */
$(".date_clear").live('click', function() { $(document).on("click", ".date_clear", function() {
$(this).prev().val(''); $(this).prev().val('');
}); });
@ -79,7 +79,7 @@ var TracksForm = {
}); });
/* submit todo form after entering new todo */ /* submit todo form after entering new todo */
$("button#todo_new_action_submit").live('click', function (ev) { $(document).on("click", "button#todo_new_action_submit", function (ev) {
if ($('input#predecessor_input').val() != "") if ($('input#predecessor_input').val() != "")
if (!confirm(i18n['todos.unresolved_dependency'])) if (!confirm(i18n['todos.unresolved_dependency']))
return false; return false;
@ -89,14 +89,14 @@ var TracksForm = {
}); });
/* submit multi-todo form after entering multiple new todos */ /* submit multi-todo form after entering multiple new todos */
$("button#todo_multi_new_action_submit").live('click', function (ev) { $(document).on("click", "button#todo_multi_new_action_submit", function (ev) {
if (TodoItems.askIfNewContextProvided('multi_', this)) if (TodoItems.askIfNewContextProvided('multi_', this))
submit_with_ajax_and_block_element('form#todo-form-multi-new-action', $(this)); submit_with_ajax_and_block_element('form#todo-form-multi-new-action', $(this));
return false; return false;
}); });
}, },
enable_dependency_delete: function() { enable_dependency_delete: function() {
$('a[class=icon_delete_dep]').live('click', function() { $(document).on("click", 'a[class=icon_delete_dep]', function() {
var form = $(this).parents('form').get(0); var form = $(this).parents('form').get(0);
var predecessor_list = $(form).find('input[name=predecessor_list]'); var predecessor_list = $(form).find('input[name=predecessor_list]');
var id_list = split( predecessor_list.val() ); var id_list = split( predecessor_list.val() );
@ -506,30 +506,30 @@ var TodoItems = {
}, },
setup_behavior: function() { setup_behavior: function() {
/* show the notes of a todo */ /* show the notes of a todo */
$(".show_notes").live('click', function () { $(document).on("click",".show_notes", function () {
$(this).next().toggle("fast"); $(this).next().toggle("fast");
return false; return false;
}); });
$(".show_successors").live('click', function () { $(document).on("click",".show_successors", function () {
$(this).next().toggle("fast"); $(this).next().toggle("fast");
return false; return false;
}); });
/* set behavior for star icon */ /* set behavior for star icon */
$(".item-container a.star_item").live('click', function (ev){ $(document).on("click", ".item-container a.star_item", function (ev){
put_with_ajax_and_block_element(this.href, $(this)); put_with_ajax_and_block_element(this.href, $(this));
return false; return false;
}); });
/* set behavior for toggle checkboxes for Recurring Todos */ /* set behavior for toggle checkboxes for Recurring Todos */
$(".item-container input.item-checkbox").live('click', function(ev){ $(document).on("click", ".item-container input.item-checkbox", function(ev){
put_with_ajax_and_block_element(this.value, $(this).parents(".item-container")); put_with_ajax_and_block_element(this.value, $(this).parents(".item-container"));
return false; return false;
}); });
/* set behavior for edit icon */ /* set behavior for edit icon */
$(".item-container a.edit_item").live('click', function (ev){ $(document).on("click", ".item-container a.edit_item", function (ev){
var ajax_options = default_ajax_options_for_scripts('GET', this.href, $(this).parents('.item-container')); var ajax_options = default_ajax_options_for_scripts('GET', this.href, $(this).parents('.item-container'));
var id = this.id.substr(15); var id = this.id.substr(15);
ajax_options.complete.push( function(){ ajax_options.complete.push( function(){
@ -540,7 +540,7 @@ var TodoItems = {
}); });
/* delete button to delete a todo from the list */ /* delete button to delete a todo from the list */
$('.item-container a.icon_delete_item').live('click', function(evt){ $(document).on("click",".item-container a.icon_delete_item", function(evt){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.item-container')); delete_with_ajax_and_block_element(this.href, $(this).parents('.item-container'));
@ -549,13 +549,13 @@ var TodoItems = {
}); });
/* submit todo form after edit */ /* submit todo form after edit */
$("form.edit_todo_form button.positive").live('click', function (ev) { $(document).on("click","form.edit_todo_form button.positive", function(evt) {
submit_with_ajax_and_block_element('form.edit_todo_form', $(this)); submit_with_ajax_and_block_element('form.edit_todo_form', $(this));
return false; return false;
}); });
// for cancelling edit todo form // for cancelling edit todo form
$('form.edit_todo_form a.negative').live('click', function(){ $(document).on("click",'form.edit_todo_form a.negative', function(){
$(this).parents('.edit-form').fadeOut(200, function () { $(this).parents('.edit-form').fadeOut(200, function () {
$(this).parents('.list').find('.project').fadeIn(500); $(this).parents('.list').find('.project').fadeIn(500);
$(this).parents('.container').find('.item-show').fadeIn(500); $(this).parents('.container').find('.item-show').fadeIn(500);
@ -563,7 +563,7 @@ var TodoItems = {
}); });
// defer a todo // defer a todo
$(".item-container a.icon_defer_item").live('click', function(ev){ $(document).on("click",".item-container a.icon_defer_item", function(ev){
if ($(this).attr("x_defer_alert") == "true") if ($(this).attr("x_defer_alert") == "true")
alert ($(this).attr("x_defer_date_after_due_date")); alert ($(this).attr("x_defer_date_after_due_date"));
else else
@ -572,7 +572,7 @@ var TodoItems = {
}); });
/* delete button to delete a dependency from the list */ /* delete button to delete a dependency from the list */
$('.item-container a.delete_dependency_button').live('click', function(evt){ $(document).on("click",'.item-container a.delete_dependency_button', function(evt){
var predecessor_id=$(this).attr("x_predecessors_id"); var predecessor_id=$(this).attr("x_predecessors_id");
var ajax_options = default_ajax_options_for_scripts('DELETE', this.href, $(this).parents('.item-container')); var ajax_options = default_ajax_options_for_scripts('DELETE', this.href, $(this).parents('.item-container'));
ajax_options.data += "&predecessor="+predecessor_id ajax_options.data += "&predecessor="+predecessor_id
@ -609,7 +609,7 @@ var ProjectItems = {
var UsersPage = { var UsersPage = {
setup_behavior: function() { setup_behavior: function() {
/* delete button to delete a user from the list */ /* delete button to delete a user from the list */
$('a.delete_user_button').live('click', function(evt){ $(document).on("click",'a.delete_user_button', function(evt){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.project')); delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
@ -704,7 +704,7 @@ var ProjectListPage = {
}); });
/* alphabetize project list */ /* alphabetize project list */
$('.alphabetize_link').live('click', function(evt){ $(document).on("click",'.alphabetize_link', function(evt) {
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
post_with_ajax_and_block_element(this.href, $(this).parents('.alpha_sort')); post_with_ajax_and_block_element(this.href, $(this).parents('.alpha_sort'));
@ -722,7 +722,7 @@ var ProjectListPage = {
}); });
/* delete button to delete a project from the list */ /* delete button to delete a project from the list */
$('a.delete_project_button').live('click', function(evt){ $(document).on("click",'a.delete_project_button', function(evt){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.project')); delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
@ -731,21 +731,21 @@ var ProjectListPage = {
}); });
/* set behavior for edit project settings link in both projects list page and project page */ /* set behavior for edit project settings link in both projects list page and project page */
$("a.project_edit_settings").live('click', function (evt) { $(document).on("click","a.project_edit_settings", function (evt) {
$(this).parent().parent().addClass('project-edit-current'); /* mark project in list */ $(this).parent().parent().addClass('project-edit-current'); /* mark project in list */
get_with_ajax_and_block_element(this.href, $(this).parent().parent()); get_with_ajax_and_block_element(this.href, $(this).parent().parent());
return false; return false;
}); });
/* submit project form after edit */ /* submit project form after edit */
$("form.edit-project-form button.positive").live('click', function (ev) { $(document).on("click", "form.edit-project-form button.positive", function (ev) {
$('div#project_name').editable('enable'); $('div#project_name').editable('enable');
submit_with_ajax_and_block_element('form.edit-project-form', $(this)); submit_with_ajax_and_block_element('form.edit-project-form', $(this));
return false; return false;
}); });
/* cancel edit project form */ /* cancel edit project form */
$('form.edit-project-form a.negative').live('click', function(){ $(document).on("click",'form.edit-project-form a.negative', function(){
$('div#project_name').editable('enable'); $('div#project_name').editable('enable');
$(this).parents('.edit-form').fadeOut(200, function () { $(this).parents('.edit-form').fadeOut(200, function () {
$(this).parents('.project-edit-current').removeClass('project-edit-current'); $(this).parents('.project-edit-current').removeClass('project-edit-current');
@ -755,7 +755,7 @@ var ProjectListPage = {
}); });
/* submit project form after entering new project */ /* submit project form after entering new project */
$("form#project_form button.positive").live('click', function (ev) { $(document).on("click","form#project_form button.positive", function(evt) {
submit_with_ajax_and_block_element('form#project_form', $(this)); submit_with_ajax_and_block_element('form#project_form', $(this));
return false; return false;
}); });
@ -820,7 +820,7 @@ var ContextListPage = {
}); });
/* delete a context using the x button */ /* delete a context using the x button */
$('a.delete_context_button').live('click', function(evt){ $(document).on("click",'a.delete_context_button', function(evt){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.context')); delete_with_ajax_and_block_element(this.href, $(this).parents('.context'));
@ -829,19 +829,19 @@ var ContextListPage = {
}); });
/* set behavior for edit context settings link in projects list page and project page */ /* set behavior for edit context settings link in projects list page and project page */
$("a.context_edit_settings").live('click', function (ev) { $(document).on("click","a.context_edit_settings", function(evt) {
get_with_ajax_and_block_element(this.href, $(this).parent().parent()); get_with_ajax_and_block_element(this.href, $(this).parent().parent());
return false; return false;
}); });
/* submit form when editing a context */ /* submit form when editing a context */
$("form.edit-context-form button.positive").live('click', function (ev) { $(document).on("click","form.edit-context-form button.positive", function(evt) {
submit_with_ajax_and_block_element('form.edit-context-form', $(this)); submit_with_ajax_and_block_element('form.edit-context-form', $(this));
return false; return false;
}); });
/* submit form for new context in sidebar */ /* submit form for new context in sidebar */
$("form#context-form button.positive").live('click', function (ev) { $(document).on("click","form#context-form button.positive", function(evt) {
submit_with_ajax_and_block_element('form#context-form', $(this)); submit_with_ajax_and_block_element('form#context-form', $(this));
return false; return false;
}); });
@ -867,13 +867,13 @@ var ContextListPage = {
var IntegrationsPage = { var IntegrationsPage = {
setup_behavior: function() { setup_behavior: function() {
$('#applescript1-contexts').live('change', function(){ $(document).on("change",'#applescript1-contexts', function(){
IntegrationsPage.get_script_for_context("#applescript1", "get_applescript1", this.value); IntegrationsPage.get_script_for_context("#applescript1", "get_applescript1", this.value);
}); });
$('#applescript2-contexts').live('change', function(){ $(document).on("change",'#applescript2-contexts', function(){
IntegrationsPage.get_script_for_context("#applescript2", "get_applescript2", this.value); IntegrationsPage.get_script_for_context("#applescript2", "get_applescript2", this.value);
}); });
$('#quicksilver-contexts').live('change', function(){ $(document).on("change",'#quicksilver-contexts', function(){
IntegrationsPage.get_script_for_context("#quicksilver", "get_quicksilver_applescript", this.value) IntegrationsPage.get_script_for_context("#quicksilver", "get_quicksilver_applescript", this.value)
}); });
}, },
@ -903,14 +903,14 @@ var FeedsPage = {
var NotesPage = { var NotesPage = {
setup_behavior: function() { setup_behavior: function() {
/* Add note */ /* Add note */
$(".add_note_link a").live('click', function(){ $(document).on("click",".add_note_link a", function(){
$('#new-note').show(); $('#new-note').show();
$('textarea#note_body').val(''); $('textarea#note_body').val('');
$('textarea#note_body').focus(); $('textarea#note_body').focus();
}); });
/* delete button for note */ /* delete button for note */
$('a.delete_note_button').live('click', function(){ $(document).on("click",'a.delete_note_button', function(){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.project_notes')); delete_with_ajax_and_block_element(this.href, $(this).parents('.project_notes'));
@ -919,7 +919,7 @@ var NotesPage = {
}); });
/* edit button for note */ /* edit button for note */
$('a.note_edit_settings').live('click', function(){ $(document).on("click",'a.note_edit_settings', function(){
var dom_id = this.id.substr(10); var dom_id = this.id.substr(10);
$('#'+dom_id).toggle(); $('#'+dom_id).toggle();
$('#edit_'+dom_id).show(); $('#edit_'+dom_id).show();
@ -928,7 +928,7 @@ var NotesPage = {
}); });
/* cancel button when editing a note */ /* cancel button when editing a note */
$('.edit-note-form a.negative').live('click', function(){ $(document).on("click",'.edit-note-form a.negative', function(){
var dom_id = this.id.substr(14); var dom_id = this.id.substr(14);
/* dom_id == 'note_XX' on notes page and just 'note' on project page */ /* dom_id == 'note_XX' on notes page and just 'note' on project page */
if (dom_id == 'note') { if (dom_id == 'note') {
@ -941,7 +941,7 @@ var NotesPage = {
}); });
/* update button when editing a note */ /* update button when editing a note */
$("form.edit-note-form button.positive").live('click', function (ev) { $(document).on("click","form.edit-note-form button.positive", function(evt) {
submit_with_ajax_and_block_element($(this).parents('form.edit-note-form'), $(this)); submit_with_ajax_and_block_element($(this).parents('form.edit-note-form'), $(this));
return false; return false;
}); });
@ -968,7 +968,7 @@ var RecurringTodosPage = {
}, },
setup_behavior: function() { setup_behavior: function() {
/* add new recurring todo plus-button in sidebar */ /* add new recurring todo plus-button in sidebar */
$("#add-new-recurring-todo").live('click', function(){ $(document).on("click","#add-new-recurring-todo", function(){
$( "#new-recurring-todo" ).dialog( "open" ); $( "#new-recurring-todo" ).dialog( "open" );
}); });
@ -999,7 +999,7 @@ var RecurringTodosPage = {
}); });
/* change recurring period radio input on new form */ /* change recurring period radio input on new form */
$("#recurring_period input").live('click', function(){ $(document).on("click","#recurring_period input", function(){
RecurringTodosPage.hide_all_recurring(); RecurringTodosPage.hide_all_recurring();
$('#recurring_'+this.id.split('_')[4]).show(); $('#recurring_'+this.id.split('_')[4]).show();
}); });
@ -1032,19 +1032,19 @@ var RecurringTodosPage = {
}); });
/* change recurring period radio input on edit form */ /* change recurring period radio input on edit form */
$("#recurring_edit_period input").live('click', function(){ $(document).on("click","#recurring_edit_period input", function(){
RecurringTodosPage.hide_all_edit_recurring(); RecurringTodosPage.hide_all_edit_recurring();
$('#recurring_edit_'+this.id.split('_')[5]).show(); $('#recurring_edit_'+this.id.split('_')[5]).show();
}); });
/* set behavior for edit recurring todo */ /* set behavior for edit recurring todo */
$(".item-container a.edit_icon").live('click', function (ev){ $(document).on("click",".item-container a.edit_icon", function(evt){
get_with_ajax_and_block_element(this.href, $(this).parents(".item-container")); get_with_ajax_and_block_element(this.href, $(this).parents(".item-container"));
return false; return false;
}); });
/* delete button to delete a todo from the list */ /* delete button to delete a todo from the list */
$('.item-container a.delete_icon').live('click', function(evt){ $(document).on("click",'.item-container a.delete_icon', function(evt){
var confirm_message = $(this).attr("x_confirm_message") var confirm_message = $(this).attr("x_confirm_message")
if(confirm(confirm_message)){ if(confirm(confirm_message)){
delete_with_ajax_and_block_element(this.href, $(this).parents('.project')); delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
@ -1082,7 +1082,7 @@ function setup_auto_refresh(interval){
} }
setTimeout(refresh_page, interval); setTimeout(refresh_page, interval);
$(function(){ $(function(){
$("input").live('keydown', function(){ $(document).on("keydown","input", function(){
field_touched = true; field_touched = true;
}); });
}); });
@ -1267,13 +1267,13 @@ function enable_rich_interaction(){
TodoItems.setup_drag_and_drop(); TodoItems.setup_drag_and_drop();
/* have to bind on keypress because of limitations of live() */ /* have to bind on keypress because of limitations of live() */
$('input[name=project_name]').live('keypress', function(){ $(document).on("keypress",'input[name=project_name]', function(){
$(this).bind('blur', project_defaults); $(this).bind('blur', project_defaults);
}); });
$('input[name=context_name]').live('keypress', function(){ $(document).on("keypress",'input[name=context_name]', function(){
$(this).attr('edited', 'true'); $(this).attr('edited', 'true');
}); });
$('input[name=tag_list]').live('keypress', function(){ $(document).on("keypress",'input[name=tag_list]', function(){
$(this).attr('edited', 'true'); $(this).attr('edited', 'true');
}); });
@ -1291,8 +1291,10 @@ function enable_rich_interaction(){
$(document).ready(function() { $(document).ready(function() {
// fix for IE8. Without this checkboxes don't work AJAXy. See #1152 // fix for IE7/8. Without this checkboxes don't work AJAXy. See #1152
if($.browser.msie && ( ($.browser.version.substring(0, 2) == "8.") || ($.browser.version.substring(0, 2) == "7.") ) ) { var msie8 = /MSIE 8.0/.test(navigator.userAgent);
var msie7 = /MSIE 7.0/.test(navigator.userAgent);
if(msie8 || msie7) {
$('body').bind('change', function() { $('body').bind('change', function() {
return true; return true;
}); });

View file

@ -34,7 +34,7 @@ class ApplicationController < ActionController::Base
locale = locale || prefs.locale unless current_user.nil? # otherwise, the locale of the currently logged in user takes over locale = locale || prefs.locale unless current_user.nil? # otherwise, the locale of the currently logged in user takes over
locale = locale || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE'] locale = locale || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']
I18n.locale = locale.nil? ? I18n.default_locale : (I18n::available_locales.include?(locale.to_sym) ? locale : I18n.default_locale) I18n.locale = locale.nil? ? I18n.default_locale : (I18n::available_locales.include?(locale.to_sym) ? locale : I18n.default_locale)
logger.debug("Selected '#{I18n.locale}' as locale") # logger.debug("Selected '#{I18n.locale}' as locale")
end end
def set_session_expiration def set_session_expiration

View file

@ -0,0 +1,4 @@
<% if @saved -%>
TracksPages.page_notify('notice', '<%=t('projects.status_project_name_changed')%>', 5);
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
<% end %>

View file

@ -1,8 +0,0 @@
#TODO: is this dead code?
page['default_project_name_id'].value = @project.name
page['todo_project_name'].value = @project.name
page << "enable_rich_interaction();"
status_message = t('projects.status_project_name_changed')
page.notify :notice, status_message, 5.0

View file

@ -13,6 +13,8 @@ end
When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name| When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
find("a#link_edit_context_#{@context.id}").click find("a#link_edit_context_#{@context.id}").click
# wait for the form to appear (which included a submit button)
page.should have_css("button#submit_context_#{@context.id}", :visible=>true) page.should have_css("button#submit_context_#{@context.id}", :visible=>true)
within "div.edit-form" do within "div.edit-form" do
@ -21,6 +23,8 @@ When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
end end
# wait for the form to go away # wait for the form to go away
page.should_not have_css("button#submit_context_#{@context.id}", :visible => true)
# wait for the changed context to appear
page.should have_css("a#link_edit_context_#{@context.id}", :visible=> true) page.should have_css("a#link_edit_context_#{@context.id}", :visible=> true)
end end

View file

@ -133,7 +133,9 @@ end
When /^I try to edit the project name to "([^\"]*)"$/ do |new_title| When /^I try to edit the project name to "([^\"]*)"$/ do |new_title|
edit_project_no_wait(@project) do edit_project_no_wait(@project) do
fill_in "project[name]", :with => new_title within "form.edit-project-form" do
fill_in "project[name]", :with => new_title
end
end end
end end
@ -202,15 +204,20 @@ When /^I edit project settings and mark the project as reviewed$/ do
end end
When /^I add a note "([^"]*)" to the project$/ do |note_body| When /^I add a note "([^"]*)" to the project$/ do |note_body|
click_link "Add a note"
page.should have_css "div.widgets button#submit_note"
fill_in "note[body]", :with => note_body
click_button "Add note"
submit_button = "div.widgets button#submit_note" submit_button = "div.widgets button#submit_note"
click_link "Add a note"
page.should have_css submit_button
fill_in "note[body]", :with => note_body
elem = find(submit_button) elem = find(submit_button)
elem.should_not be_nil # form is hidden elem.should_not be_nil
elem.should_not be_visible elem.click
wait_until do
!elem.visible?
end
end end
When /^I click on the first note icon$/ do When /^I click on the first note icon$/ do
@ -245,9 +252,10 @@ Then /^I edit the default tags to "([^"]*)"$/ do |default_tags|
end end
Then /^I should be able to change the project name in place$/ do Then /^I should be able to change the project name in place$/ do
#Note that this is not changing the project name # Note that this is not changing the project name
page.should have_css("div#project_name>form>input") page.should have_css("div#project_name>form>input")
page.find("div#project_name > form > button[type=cancel]").click page.find("div#project_name > form > button[type=cancel]").click
page.should_not have_css("div#project_name>form>input")
end end
Then /^I should not be able to change the project name in place$/ do Then /^I should not be able to change the project name in place$/ do

View file

@ -7,6 +7,7 @@ When /^I mark "([^"]*)" as complete$/ do |action_description|
check "mark_complete_#{todo.id}" check "mark_complete_#{todo.id}"
wait_for_ajax wait_for_ajax
wait_for_animations_to_end
end end
When /^I mark "([^"]*)" as uncompleted$/ do |action_description| When /^I mark "([^"]*)" as uncompleted$/ do |action_description|
@ -16,6 +17,7 @@ When /^I mark "([^"]*)" as uncompleted$/ do |action_description|
uncheck "mark_complete_#{todo.id}" uncheck "mark_complete_#{todo.id}"
wait_for_ajax wait_for_ajax
wait_for_animations_to_end
end end
When /^I mark the completed todo "([^"]*)" active$/ do |action_description| When /^I mark the completed todo "([^"]*)" active$/ do |action_description|
@ -68,6 +70,8 @@ When /I change the (.*) field of "([^\"]*)" to "([^\"]*)"$/ do |field_name, todo
open_edit_form_for(todo) open_edit_form_for(todo)
within "form.edit_todo_form" do within "form.edit_todo_form" do
fill_in "#{field_name}", :with => new_value fill_in "#{field_name}", :with => new_value
# force blur event
page.execute_script("$('form.edit_todo_form input.#{field_name}_todo_#{todo.id}').blur();")
end end
submit_edit_todo_form(todo) submit_edit_todo_form(todo)
wait_for_ajax wait_for_ajax

View file

@ -3,6 +3,8 @@
# newer version of cucumber-rails. Consider adding your own code to a new file # newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb # instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files. # files.
require 'simplecov'
SimpleCov.start 'rails'
require 'cucumber/rails' require 'cucumber/rails'
@ -56,4 +58,3 @@ end
# The :transaction strategy is faster, but might give you threading problems. # The :transaction strategy is faster, but might give you threading problems.
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
Cucumber::Rails::Database.javascript_strategy = :truncation Cucumber::Rails::Database.javascript_strategy = :truncation

View file

@ -9,7 +9,7 @@ Capybara.default_wait_time = 5
Capybara.javascript_driver = ENV["JS_DRIVER"] ? ENV["JS_DRIVER"].to_sym : :selenium Capybara.javascript_driver = ENV["JS_DRIVER"] ? ENV["JS_DRIVER"].to_sym : :selenium
if Capybara.javascript_driver == :webkit if Capybara.javascript_driver == :webkit
require 'capybara/webkit' # require 'capybara/webkit'
end end
if Capybara.javascript_driver == :selenium if Capybara.javascript_driver == :selenium

View file

@ -22,8 +22,13 @@ module TracksStepHelper
end end
def open_edit_form_for(todo) def open_edit_form_for(todo)
edit_link = "div#line_todo_#{todo.id} a#icon_edit_todo_#{todo.id}"
# make sure we can open the edit form
page.should have_css(edit_link)
# on calendar page there can be more than 1 occurance of a todo, so we select the first here # on calendar page there can be more than 1 occurance of a todo, so we select the first here
all(:css, "div#line_todo_#{todo.id} a#icon_edit_todo_#{todo.id}")[0].click all(:css, edit_link)[0].click
wait_for_ajax wait_for_ajax
wait_for_animations_to_end wait_for_animations_to_end
end end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,10 @@
/*! /*!
* jQuery blockUI plugin * jQuery blockUI plugin
* Version 2.38 (29-MAR-2011) * Version 2.56.0-2013.01.31
* @requires jQuery v1.2.3 or later * @requires jQuery v1.7 or later
* *
* Examples at: http://malsup.com/jquery/block/ * Examples at: http://malsup.com/jquery/block/
* Copyright (c) 2007-2010 M. Alsup * Copyright (c) 2007-2013 M. Alsup
* Dual licensed under the MIT and GPL licenses: * Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
@ -12,482 +12,564 @@
* Thanks to Amir-Hossein Sobhi for some excellent contributions! * Thanks to Amir-Hossein Sobhi for some excellent contributions!
*/ */
;(function($) { ;(function() {
"use strict";
if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { function setup($) {
alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); $.fn._fadeIn = $.fn.fadeIn;
return;
}
$.fn._fadeIn = $.fn.fadeIn; var noOp = $.noop || function() {};
var noOp = function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
// retarded userAgent strings on Vista)
var msie = /MSIE/.test(navigator.userAgent);
var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
var mode = document.documentMode || 0;
// var setExpr = msie && (($.browser.version < 8 && !mode) || mode < 8);
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // global $ methods for blocking/unblocking the entire page
// retarded userAgent strings on Vista) $.blockUI = function(opts) { install(window, opts); };
var mode = document.documentMode || 0; $.unblockUI = function(opts) { remove(window, opts); };
var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);
var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;
// global $ methods for blocking/unblocking the entire page // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
$.blockUI = function(opts) { install(window, opts); }; $.growlUI = function(title, message, timeout, onClose) {
$.unblockUI = function(opts) { remove(window, opts); }; var $m = $('<div class="growlUI"></div>');
if (title) $m.append('<h1>'+title+'</h1>');
if (message) $m.append('<h2>'+message+'</h2>');
if (timeout === undefined) timeout = 3000;
$.blockUI({
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
timeout: timeout, showOverlay: false,
onUnblock: onClose,
css: $.blockUI.defaults.growlCSS
});
};
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) // plugin method for blocking element content
$.growlUI = function(title, message, timeout, onClose) { $.fn.block = function(opts) {
var $m = $('<div class="growlUI"></div>'); var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
if (title) $m.append('<h1>'+title+'</h1>'); this.each(function() {
if (message) $m.append('<h2>'+message+'</h2>'); var $el = $(this);
if (timeout == undefined) timeout = 3000; if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
$.blockUI({ return;
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, $el.unblock({ fadeOut: 0 });
timeout: timeout, showOverlay: false, });
onUnblock: onClose,
css: $.blockUI.defaults.growlCSS
});
};
// plugin method for blocking element content return this.each(function() {
$.fn.block = function(opts) { if ($.css(this,'position') == 'static') {
return this.unblock({ fadeOut: 0 }).each(function() { this.style.position = 'relative';
if ($.css(this,'position') == 'static') $(this).data('blockUI.static', true);
this.style.position = 'relative'; }
if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in ie
this.style.zoom = 1; // force 'hasLayout' install(this, opts);
install(this, opts); });
}); };
};
// plugin method for unblocking element content // plugin method for unblocking element content
$.fn.unblock = function(opts) { $.fn.unblock = function(opts) {
return this.each(function() { return this.each(function() {
remove(this, opts); remove(this, opts);
}); });
}; };
$.blockUI.version = 2.38; // 2nd generation blocking at no extra cost! $.blockUI.version = 2.56; // 2nd generation blocking at no extra cost!
// override these in your code to change the default behavior and style // override these in your code to change the default behavior and style
$.blockUI.defaults = { $.blockUI.defaults = {
// message displayed when blocking (use null for no message) // message displayed when blocking (use null for no message)
message: '<h1>Please wait...</h1>', message: '<h1>Please wait...</h1>',
title: null, // title string; only used when theme == true title: null, // title string; only used when theme == true
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
theme: false, // set to true to use with jQuery UI themes theme: false, // set to true to use with jQuery UI themes
// styles for the message when blocking; if you wish to disable // styles for the message when blocking; if you wish to disable
// these and use an external stylesheet then do this in your code: // these and use an external stylesheet then do this in your code:
// $.blockUI.defaults.css = {}; // $.blockUI.defaults.css = {};
css: { css: {
padding: 0, padding: 0,
margin: 0, margin: 0,
width: '30%', width: '30%',
top: '40%', top: '40%',
left: '35%', left: '35%',
textAlign: 'center', textAlign: 'center',
color: '#000', color: '#000',
border: '3px solid #aaa', border: '3px solid #aaa',
backgroundColor:'#fff', backgroundColor:'#fff',
cursor: 'wait' cursor: 'wait'
}, },
// minimal style set used when themes are used // minimal style set used when themes are used
themedCSS: { themedCSS: {
width: '30%', width: '30%',
top: '40%', top: '40%',
left: '35%' left: '35%'
}, },
// styles for the overlay // styles for the overlay
overlayCSS: { overlayCSS: {
backgroundColor: '#000', backgroundColor: '#000',
opacity: 0.6, opacity: 0.6,
cursor: 'wait' cursor: 'wait'
}, },
// styles applied when using $.growlUI // style to replace wait cursor before unblocking to correct issue
growlCSS: { // of lingering wait cursor
width: '350px', cursorReset: 'default',
top: '10px',
left: '',
right: '10px',
border: 'none',
padding: '5px',
opacity: 0.6,
cursor: 'default',
color: '#fff',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
'border-radius': '10px'
},
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w // styles applied when using $.growlUI
// (hat tip to Jorge H. N. de Vasconcelos) growlCSS: {
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', width: '350px',
top: '10px',
left: '',
right: '10px',
border: 'none',
padding: '5px',
opacity: 0.6,
cursor: 'default',
color: '#fff',
backgroundColor: '#000',
'-webkit-border-radius':'10px',
'-moz-border-radius': '10px',
'border-radius': '10px'
},
// force usage of iframe in non-IE browsers (handy for blocking applets) // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
forceIframe: false, // (hat tip to Jorge H. N. de Vasconcelos)
/*jshint scripturl:true */
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
// z-index for the blocking overlay // force usage of iframe in non-IE browsers (handy for blocking applets)
baseZ: 1000, forceIframe: false,
// set these to true to have the message automatically centered // z-index for the blocking overlay
centerX: true, // <-- only effects element blocking (page block controlled via css above) baseZ: 1000,
centerY: true,
// allow body element to be stetched in ie6; this makes blocking look better // set these to true to have the message automatically centered
// on "short" pages. disable if you wish to prevent changes to the body height centerX: true, // <-- only effects element blocking (page block controlled via css above)
allowBodyStretch: true, centerY: true,
// enable if you want key and mouse events to be disabled for content that is blocked // allow body element to be stetched in ie6; this makes blocking look better
bindEvents: true, // on "short" pages. disable if you wish to prevent changes to the body height
allowBodyStretch: true,
// be default blockUI will supress tab navigation from leaving blocking content // enable if you want key and mouse events to be disabled for content that is blocked
// (if bindEvents is true) bindEvents: true,
constrainTabKey: true,
// fadeIn time in millis; set to 0 to disable fadeIn on block // be default blockUI will supress tab navigation from leaving blocking content
fadeIn: 200, // (if bindEvents is true)
constrainTabKey: true,
// fadeOut time in millis; set to 0 to disable fadeOut on unblock // fadeIn time in millis; set to 0 to disable fadeIn on block
fadeOut: 400, fadeIn: 200,
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock // fadeOut time in millis; set to 0 to disable fadeOut on unblock
timeout: 0, fadeOut: 400,
// disable if you don't want to show the overlay // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
showOverlay: true, timeout: 0,
// if true, focus will be placed in the first available input field when // disable if you don't want to show the overlay
// page blocking showOverlay: true,
focusInput: true,
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) // if true, focus will be placed in the first available input field when
applyPlatformOpacityRules: true, // page blocking
focusInput: true,
// callback method invoked when fadeIn has completed and blocking message is visible // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
onBlock: null, // no longer needed in 2012
// applyPlatformOpacityRules: true,
// callback method invoked when unblocking has completed; the callback is // callback method invoked when fadeIn has completed and blocking message is visible
// passed the element that has been unblocked (which is the window object for page onBlock: null,
// blocks) and the options that were passed to the unblock call:
// onUnblock(element, options)
onUnblock: null,
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 // callback method invoked when unblocking has completed; the callback is
quirksmodeOffsetHack: 4, // passed the element that has been unblocked (which is the window object for page
// blocks) and the options that were passed to the unblock call:
// onUnblock(element, options)
onUnblock: null,
// class name of the message block // callback method invoked when the overlay area is clicked.
blockMsgClass: 'blockMsg' // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
}; onOverlayClick: null,
// private data and functions follow... // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
quirksmodeOffsetHack: 4,
var pageBlock = null; // class name of the message block
var pageBlockEls = []; blockMsgClass: 'blockMsg',
function install(el, opts) { // if it is already blocked, then ignore it (don't unblock and reblock)
var full = (el == window); ignoreIfBlocked: false
var msg = opts && opts.message !== undefined ? opts.message : undefined; };
opts = $.extend({}, $.blockUI.defaults, opts || {});
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
msg = msg === undefined ? opts.message : msg;
// remove the current block (if there is one) // private data and functions follow...
if (full && pageBlock)
remove(window, {fadeOut:0});
// if an existing element is being used as the blocking content then we capture var pageBlock = null;
// its current place in the DOM (and current display style) so we can restore var pageBlockEls = [];
// it when we unblock
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
var node = msg.jquery ? msg[0] : msg;
var data = {};
$(el).data('blockUI.history', data);
data.el = node;
data.parent = node.parentNode;
data.display = node.style.display;
data.position = node.style.position;
if (data.parent)
data.parent.removeChild(node);
}
var z = opts.baseZ; function install(el, opts) {
var css, themedCSS;
var full = (el == window);
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
opts = $.extend({}, $.blockUI.defaults, opts || {});
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
// layer1 is the iframe layer which is used to supress bleed through of underlying content return;
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
// layer3 is the message content that is displayed while blocking
var lyr1 = ($.browser.msie || opts.forceIframe) opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>') css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
: $('<div class="blockUI" style="display:none"></div>'); if (opts.onOverlayClick)
opts.overlayCSS.cursor = 'pointer';
var lyr2 = opts.theme themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>') msg = msg === undefined ? opts.message : msg;
: $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
var lyr3, s; // remove the current block (if there is one)
if (opts.theme && full) { if (full && pageBlock)
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed">' + remove(window, {fadeOut:0});
'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
'<div class="ui-widget-content ui-dialog-content"></div>' +
'</div>';
}
else if (opts.theme) {
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:absolute">' +
'<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
'<div class="ui-widget-content ui-dialog-content"></div>' +
'</div>';
}
else if (full) {
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+z+';display:none;position:fixed"></div>';
}
else {
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+z+';display:none;position:absolute"></div>';
}
lyr3 = $(s);
// if we have a message, style it // if an existing element is being used as the blocking content then we capture
if (msg) { // its current place in the DOM (and current display style) so we can restore
if (opts.theme) { // it when we unblock
lyr3.css(themedCSS); if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
lyr3.addClass('ui-widget-content'); var node = msg.jquery ? msg[0] : msg;
} var data = {};
else $(el).data('blockUI.history', data);
lyr3.css(css); data.el = node;
} data.parent = node.parentNode;
data.display = node.style.display;
// style the overlay data.position = node.style.position;
if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))) if (data.parent)
lyr2.css(opts.overlayCSS); data.parent.removeChild(node);
lyr2.css('position', full ? 'fixed' : 'absolute');
// make iframe layer transparent in IE
if ($.browser.msie || opts.forceIframe)
lyr1.css('opacity',0.0);
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
$.each(layers, function() {
this.appendTo($par);
});
if (opts.theme && opts.draggable && $.fn.draggable) {
lyr3.draggable({
handle: '.ui-dialog-titlebar',
cancel: 'li'
});
}
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
if (ie6 || expr) {
// give body 100% height
if (full && opts.allowBodyStretch && $.boxModel)
$('html,body').css('height','100%');
// fix ie6 issue when blocked element has a border width
if ((ie6 || !$.boxModel) && !full) {
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
var fixT = t ? '(0 - '+t+')' : 0;
var fixL = l ? '(0 - '+l+')' : 0;
}
// simulate fixed position
$.each([lyr1,lyr2,lyr3], function(i,o) {
var s = o[0].style;
s.position = 'absolute';
if (i < 2) {
full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
: s.setExpression('height','this.parentNode.offsetHeight + "px"');
full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
: s.setExpression('width','this.parentNode.offsetWidth + "px"');
if (fixL) s.setExpression('left', fixL);
if (fixT) s.setExpression('top', fixT);
} }
else if (opts.centerY) {
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); $(el).data('blockUI.onUnblock', opts.onUnblock);
s.marginTop = 0; var z = opts.baseZ;
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
// layer1 is the iframe layer which is used to supress bleed through of underlying content
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
// layer3 is the message content that is displayed while blocking
var lyr1, lyr2, lyr3, s;
if (msie || opts.forceIframe)
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
else
lyr1 = $('<div class="blockUI" style="display:none"></div>');
if (opts.theme)
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
else
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
if (opts.theme && full) {
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
if ( opts.title ) {
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
}
s += '<div class="ui-widget-content ui-dialog-content"></div>';
s += '</div>';
} }
else if (!opts.centerY && full) { else if (opts.theme) {
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; if ( opts.title ) {
s.setExpression('top',expression); s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
}
s += '<div class="ui-widget-content ui-dialog-content"></div>';
s += '</div>';
} }
}); else if (full) {
} s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
}
else {
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
}
lyr3 = $(s);
// show the message // if we have a message, style it
if (msg) { if (msg) {
if (opts.theme) if (opts.theme) {
lyr3.find('.ui-widget-content').append(msg); lyr3.css(themedCSS);
else lyr3.addClass('ui-widget-content');
lyr3.append(msg); }
if (msg.jquery || msg.nodeType) else
$(msg).show(); lyr3.css(css);
} }
if (($.browser.msie || opts.forceIframe) && opts.showOverlay) // style the overlay
lyr1.show(); // opacity is zero if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
if (opts.fadeIn) { lyr2.css(opts.overlayCSS);
var cb = opts.onBlock ? opts.onBlock : noOp; lyr2.css('position', full ? 'fixed' : 'absolute');
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
var cb2 = msg ? cb : noOp;
if (opts.showOverlay)
lyr2._fadeIn(opts.fadeIn, cb1);
if (msg)
lyr3._fadeIn(opts.fadeIn, cb2);
}
else {
if (opts.showOverlay)
lyr2.show();
if (msg)
lyr3.show();
if (opts.onBlock)
opts.onBlock();
}
// bind key and mouse events // make iframe layer transparent in IE
bind(1, el, opts); if (msie || opts.forceIframe)
lyr1.css('opacity',0.0);
if (full) { //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
pageBlock = lyr3[0]; var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
pageBlockEls = $(':input:enabled:visible',pageBlock); $.each(layers, function() {
if (opts.focusInput) this.appendTo($par);
setTimeout(focus, 20); });
}
else
center(lyr3[0], opts.centerX, opts.centerY);
if (opts.timeout) { if (opts.theme && opts.draggable && $.fn.draggable) {
// auto-unblock lyr3.draggable({
var to = setTimeout(function() { handle: '.ui-dialog-titlebar',
full ? $.unblockUI(opts) : $(el).unblock(opts); cancel: 'li'
}, opts.timeout); });
$(el).data('blockUI.timeout', to); }
}
};
// remove the block // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
function remove(el, opts) { var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
var full = (el == window); if (ie6 || expr) {
var $el = $(el); // give body 100% height
var data = $el.data('blockUI.history'); if (full && opts.allowBodyStretch && $.support.boxModel)
var to = $el.data('blockUI.timeout'); $('html,body').css('height','100%');
if (to) {
clearTimeout(to);
$el.removeData('blockUI.timeout');
}
opts = $.extend({}, $.blockUI.defaults, opts || {});
bind(0, el, opts); // unbind events
var els; // fix ie6 issue when blocked element has a border width
if (full) // crazy selector to handle odd field errors in ie6/7 if ((ie6 || !$.support.boxModel) && !full) {
els = $('body').children().filter('.blockUI').add('body > .blockUI'); var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
else var fixT = t ? '(0 - '+t+')' : 0;
els = $('.blockUI', el); var fixL = l ? '(0 - '+l+')' : 0;
}
if (full) // simulate fixed position
pageBlock = pageBlockEls = null; $.each(layers, function(i,o) {
var s = o[0].style;
s.position = 'absolute';
if (i < 2) {
if (full)
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
else
s.setExpression('height','this.parentNode.offsetHeight + "px"');
if (full)
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
else
s.setExpression('width','this.parentNode.offsetWidth + "px"');
if (fixL) s.setExpression('left', fixL);
if (fixT) s.setExpression('top', fixT);
}
else if (opts.centerY) {
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
s.marginTop = 0;
}
else if (!opts.centerY && full) {
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
s.setExpression('top',expression);
}
});
}
if (opts.fadeOut) { // show the message
els.fadeOut(opts.fadeOut); if (msg) {
setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); if (opts.theme)
} lyr3.find('.ui-widget-content').append(msg);
else else
reset(els, data, opts, el); lyr3.append(msg);
}; if (msg.jquery || msg.nodeType)
$(msg).show();
}
// move blocking element back into the DOM where it started if ((msie || opts.forceIframe) && opts.showOverlay)
function reset(els,data,opts,el) { lyr1.show(); // opacity is zero
els.each(function(i,o) { if (opts.fadeIn) {
// remove via DOM calls so we don't lose event handlers var cb = opts.onBlock ? opts.onBlock : noOp;
if (this.parentNode) var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
this.parentNode.removeChild(this); var cb2 = msg ? cb : noOp;
}); if (opts.showOverlay)
lyr2._fadeIn(opts.fadeIn, cb1);
if (msg)
lyr3._fadeIn(opts.fadeIn, cb2);
}
else {
if (opts.showOverlay)
lyr2.show();
if (msg)
lyr3.show();
if (opts.onBlock)
opts.onBlock();
}
if (data && data.el) { // bind key and mouse events
data.el.style.display = data.display; bind(1, el, opts);
data.el.style.position = data.position;
if (data.parent)
data.parent.appendChild(data.el);
$(el).removeData('blockUI.history');
}
if (typeof opts.onUnblock == 'function') if (full) {
opts.onUnblock(el,opts); pageBlock = lyr3[0];
}; pageBlockEls = $(':input:enabled:visible',pageBlock);
if (opts.focusInput)
setTimeout(focus, 20);
}
else
center(lyr3[0], opts.centerX, opts.centerY);
// bind/unbind the handler if (opts.timeout) {
function bind(b, el, opts) { // auto-unblock
var full = el == window, $el = $(el); var to = setTimeout(function() {
if (full)
// don't bother unbinding if there is nothing to unbind $.unblockUI(opts);
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) else
return; $(el).unblock(opts);
if (!full) }, opts.timeout);
$el.data('blockUI.isBlocked', b); $(el).data('blockUI.timeout', to);
// don't bind events when overlay is not in use or if bindEvents is false
if (!opts.bindEvents || (b && !opts.showOverlay))
return;
// bind anchors and inputs for mouse and key events
var events = 'mousedown mouseup keydown keypress';
b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
// former impl...
// var $e = $('a,:input');
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
};
// event handler to suppress keyboard/mouse events when blocking
function handler(e) {
// allow tab navigation (conditionally)
if (e.keyCode && e.keyCode == 9) {
if (pageBlock && e.data.constrainTabKey) {
var els = pageBlockEls;
var fwd = !e.shiftKey && e.target === els[els.length-1];
var back = e.shiftKey && e.target === els[0];
if (fwd || back) {
setTimeout(function(){focus(back)},10);
return false;
} }
} }
// remove the block
function remove(el, opts) {
var full = (el == window);
var $el = $(el);
var data = $el.data('blockUI.history');
var to = $el.data('blockUI.timeout');
if (to) {
clearTimeout(to);
$el.removeData('blockUI.timeout');
}
opts = $.extend({}, $.blockUI.defaults, opts || {});
bind(0, el, opts); // unbind events
if (opts.onUnblock === null) {
opts.onUnblock = $el.data('blockUI.onUnblock');
$el.removeData('blockUI.onUnblock');
}
var els;
if (full) // crazy selector to handle odd field errors in ie6/7
els = $('body').children().filter('.blockUI').add('body > .blockUI');
else
els = $el.find('>.blockUI');
// fix cursor issue
if ( opts.cursorReset ) {
if ( els.length > 1 )
els[1].style.cursor = opts.cursorReset;
if ( els.length > 2 )
els[2].style.cursor = opts.cursorReset;
}
if (full)
pageBlock = pageBlockEls = null;
if (opts.fadeOut) {
els.fadeOut(opts.fadeOut);
setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
}
else
reset(els, data, opts, el);
}
// move blocking element back into the DOM where it started
function reset(els,data,opts,el) {
var $el = $(el);
els.each(function(i,o) {
// remove via DOM calls so we don't lose event handlers
if (this.parentNode)
this.parentNode.removeChild(this);
});
if (data && data.el) {
data.el.style.display = data.display;
data.el.style.position = data.position;
if (data.parent)
data.parent.appendChild(data.el);
$el.removeData('blockUI.history');
}
if ($el.data('blockUI.static')) {
$el.css('position', 'static'); // #22
}
if (typeof opts.onUnblock == 'function')
opts.onUnblock(el,opts);
// fix issue in Safari 6 where block artifacts remain until reflow
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
body.width(w-1).width(w);
body[0].style.width = cssW;
}
// bind/unbind the handler
function bind(b, el, opts) {
var full = el == window, $el = $(el);
// don't bother unbinding if there is nothing to unbind
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
return;
$el.data('blockUI.isBlocked', b);
// don't bind events when overlay is not in use or if bindEvents is false
if (!opts.bindEvents || (b && !opts.showOverlay))
return;
// bind anchors and inputs for mouse and key events
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
if (b)
$(document).bind(events, opts, handler);
else
$(document).unbind(events, handler);
// former impl...
// var $e = $('a,:input');
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
}
// event handler to suppress keyboard/mouse events when blocking
function handler(e) {
// allow tab navigation (conditionally)
if (e.keyCode && e.keyCode == 9) {
if (pageBlock && e.data.constrainTabKey) {
var els = pageBlockEls;
var fwd = !e.shiftKey && e.target === els[els.length-1];
var back = e.shiftKey && e.target === els[0];
if (fwd || back) {
setTimeout(function(){focus(back);},10);
return false;
}
}
}
var opts = e.data;
var target = $(e.target);
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
opts.onOverlayClick();
// allow events within the message content
if (target.parents('div.' + opts.blockMsgClass).length > 0)
return true;
// allow events for content that is not being blocked
return target.parents().children().filter('div.blockUI').length === 0;
}
function focus(back) {
if (!pageBlockEls)
return;
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
if (e)
e.focus();
}
function center(el, x, y) {
var p = el.parentNode, s = el.style;
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
if (x) s.left = l > 0 ? (l+'px') : '0';
if (y) s.top = t > 0 ? (t+'px') : '0';
}
function sz(el, p) {
return parseInt($.css(el,p),10)||0;
}
} }
var opts = e.data;
// allow events within the message content
if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0)
return true;
// allow events for content that is not being blocked
return $(e.target).parents().children().filter('div.blockUI').length == 0;
};
function focus(back) { /*global define:true */
if (!pageBlockEls) if (typeof define === 'function' && define.amd && define.amd.jQuery) {
return; define(['jquery'], setup);
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; } else {
if (e) setup(jQuery);
e.focus(); }
};
function center(el, x, y) { })();
var p = el.parentNode, s = el.style;
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
if (x) s.left = l > 0 ? (l+'px') : '0';
if (y) s.top = t > 0 ? (t+'px') : '0';
};
function sz(el, p) {
return parseInt($.css(el,p))||0;
};
})(jQuery);

View file

@ -1,13 +1,12 @@
/* /*
* Superfish v1.4.8 - jQuery menu widget * Superfish v1.5.3 - jQuery menu widget
* Copyright (c) 2008 Joel Birch * Copyright (c) 2013 Joel Birch
* *
* Dual licensed under the MIT and GPL licenses: * Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/ */
;(function($){ ;(function($){
@ -15,71 +14,110 @@
var sf = $.fn.superfish, var sf = $.fn.superfish,
c = sf.c, c = sf.c,
$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')), $arrow = $('<span class="'+c.arrowClass+'"> &#187;</span>'),
over = function(){ over = function(e){
var $$ = $(this), menu = getMenu($$); var $$ = $(this), menu = getMenu($$);
if (e.type === 'mouseenter' || e.type==='focusin'){
$$.children('a').data('follow',true);
}
clearTimeout(menu.sfTimer); clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl(); $$.showSuperfishUl().siblings().hideSuperfishUl();
}, },
out = function(){ out = function(e){
var $$ = $(this), menu = getMenu($$), o = sf.op; var $$ = $(this), menu = getMenu($$), o = sf.op;
clearTimeout(menu.sfTimer); var close = function(){
menu.sfTimer=setTimeout(function(){
o.retainPath=($.inArray($$[0],o.$path)>-1); o.retainPath=($.inArray($$[0],o.$path)>-1);
$$.hideSuperfishUl(); $$.hideSuperfishUl();
if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} if (o.$path.length && $$.parents('li.'+o.hoverClass).length<1){
},o.delay); o.onIdle.call();
$.proxy(over,o.$path,e)();
}
};
if (e.type !== 'mouseleave' && e.type !== 'focusout'){
close();
} else {
clearTimeout(menu.sfTimer);
menu.sfTimer=setTimeout(close,o.delay);
}
if (e.type === 'mouseleave' || e.type === 'focusout'){
$$.children('a').data('follow',false);
}
}, },
getMenu = function($menu){ getMenu = function($child){
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; if ($child.hasClass(c.menuClass)){
$.error('Superfish requires you to update to a version of hoverIntent that supports event-delegation, such as this one: https://github.com/joeldbirch/onHoverIntent');
}
var menu = $child.closest('.'+c.menuClass)[0];
sf.op = sf.o[menu.serial]; sf.op = sf.o[menu.serial];
return menu; return menu;
}, },
applyHandlers = function($menu){
var targets = 'li:has(ul)';
if (!sf.op.useClick){
if ($.fn.hoverIntent && !sf.op.disableHI){
$menu.hoverIntent(over, out, targets);
} else {
$menu.on('mouseenter', targets, over);
$menu.on('mouseleave', targets, out);
}
}
$menu.on('focusin', targets, over);
$menu.on('focusout', targets, out);
$menu.on('click', 'a', clickHandler);
},
clickHandler = function(e){
var $a = $(this);
var $submenu = $a.next('ul');
var follow = $a.data('follow');
if ( $submenu.length && (sf.op.useClick || !follow) ){
e.preventDefault();
if ($submenu.is(':visible')){
$.proxy(out,$(this).parent(),e)();
} else {
$.proxy(over,$(this).parent(),e)();
}
}
},
addArrows = function($li,o){
if (o.autoArrows) {
$li.children('a').each(function() {
addArrow( $(this) );
});
}
},
addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
return this.each(function() { return this.addClass(c.menuClass).each(function() {
var s = this.serial = sf.o.length; var s = this.serial = sf.o.length;
var o = $.extend({},sf.defaults,op); var o = $.extend({},sf.defaults,op);
o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ var $$ = $(this);
$(this).addClass([o.hoverClass,c.bcClass].join(' ')) var $liHasUl = $$.find('li:has(ul)');
o.$path = $$.find('li.'+o.pathClass).slice(0,o.pathLevels).each(function(){
$(this).addClass(o.hoverClass+' '+c.bcClass)
.filter('li:has(ul)').removeClass(o.pathClass); .filter('li:has(ul)').removeClass(o.pathClass);
}); });
sf.o[s] = sf.op = o; sf.o[s] = sf.op = o;
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { addArrows($liHasUl,o);
if (o.autoArrows) addArrow( $('>a:first-child',this) ); applyHandlers($$);
})
.not('.'+c.bcClass) $liHasUl.not('.'+c.bcClass).hideSuperfishUl();
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
});
o.onInit.call(this); o.onInit.call(this);
}).each(function() {
var menuClasses = [c.menuClass];
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
$(this).addClass(menuClasses.join(' '));
}); });
}; };
var sf = $.fn.superfish; var sf = $.fn.superfish;
sf.o = []; sf.o = [];
sf.op = {}; sf.op = {};
sf.IE7fix = function(){
var o = sf.op;
if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');
};
sf.c = { sf.c = {
bcClass : 'sf-breadcrumb', bcClass : 'sf-breadcrumb',
menuClass : 'sf-js-enabled', menuClass : 'sf-js-enabled',
anchorClass : 'sf-with-ul', anchorClass : 'sf-with-ul',
arrowClass : 'sf-sub-indicator', arrowClass : 'sf-sub-indicator'
shadowClass : 'sf-shadow'
}; };
sf.defaults = { sf.defaults = {
hoverClass : 'sfHover', hoverClass : 'sfHover',
@ -87,33 +125,39 @@
pathLevels : 1, pathLevels : 1,
delay : 800, delay : 800,
animation : {opacity:'show'}, animation : {opacity:'show'},
animationOut: {opacity:'hide'},
speed : 'normal', speed : 'normal',
speedOut : 'fast',
autoArrows : true, autoArrows : true,
dropShadows : true,
disableHI : false, // true disables hoverIntent detection disableHI : false, // true disables hoverIntent detection
useClick : false,
onInit : function(){}, // callback functions onInit : function(){}, // callback functions
onBeforeShow: function(){}, onBeforeShow: function(){},
onShow : function(){}, onShow : function(){},
onHide : function(){} onHide : function(){},
onIdle : function(){}
}; };
$.fn.extend({ $.fn.extend({
hideSuperfishUl : function(){ hideSuperfishUl : function(){
var o = sf.op, var o = sf.op,
not = (o.retainPath===true) ? o.$path : ''; not = (o.retainPath===true) ? o.$path : '';
o.retainPath = false; o.retainPath = false;
var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) var $ul = $('li.'+o.hoverClass,this).add(this).not(not)
.find('>ul').hide().css('visibility','hidden'); .find('>ul').stop().animate(o.animationOut,o.speedOut,function(){
o.onHide.call($ul); $ul = $(this);
$ul.css('visibility','hidden').parent().removeClass(o.hoverClass);
o.onHide.call($ul);
});
return this; return this;
}, },
showSuperfishUl : function(){ showSuperfishUl : function(){
var o = sf.op, var o = sf.op,
sh = sf.c.shadowClass+'-off',
$ul = this.addClass(o.hoverClass) $ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible'); .find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul); o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); $ul.stop().animate(o.animation,o.speed,function(){
o.onShow.call($ul);
});
return this; return this;
} }
}); });

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 434 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 274 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 274 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 395 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 268 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -6,6 +6,9 @@
padding-bottom: 2.5em; padding-bottom: 2.5em;
position: relative; position: relative;
} }
.sf-navbar ul {
box-shadow: none;
}
.sf-navbar li { .sf-navbar li {
background: #AABDE6; background: #AABDE6;
position: static; position: static;
@ -81,13 +84,3 @@ ul.sf-navbar .current ul ul {
.sf-navbar ul li.sfHover > a > .sf-sub-indicator { .sf-navbar ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px -100px; /* arrow hovers for modern browsers*/ background-position: -10px -100px; /* arrow hovers for modern browsers*/
} }
/*** remove shadow on first submenu ***/
.sf-navbar > li > ul {
background: transparent;
padding: 0;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-topright: 0;
-webkit-border-top-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
}

View file

@ -11,26 +11,18 @@
.sf-menu ul { .sf-menu ul {
position: absolute; position: absolute;
top: -999em; top: -999em;
width: 12em; /* left offset of submenus need to match (see below) */ width: 10em; /* left offset of submenus need to match (see below) */
} }
.sf-item-menu ul {
width: 9.5em;
z-index: 99;
}
.sf-menu ul li { .sf-menu ul li {
width: 100%; width: 100%;
} }
.sf-menu li:hover { .sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */ visibility: inherit; /* fixes IE7 'sticky bug' */
} }
.sf-menu li { .sf-menu li {
float: left; float: left;
position: relative; position: relative;
} }
.sf-menu a { .sf-menu a {
display: block; display: block;
position: relative; position: relative;
@ -147,6 +139,7 @@ ul.sf-menu li li li.sfHover ul {
border-bottom: none; border-bottom: none;
} }
/*** arrows **/ /*** arrows **/
.sf-menu a.sf-with-ul { .sf-menu a.sf-with-ul {
padding-right: 2.25em; padding-right: 2.25em;
@ -161,7 +154,7 @@ ul.sf-menu li li li.sfHover ul {
height: 10px; height: 10px;
text-indent: -999em; text-indent: -999em;
overflow: hidden; overflow: hidden;
background: url('/assets/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
} }
a > .sf-sub-indicator { /* give all except IE6 the correct values */ a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: .8em; top: .8em;
@ -187,16 +180,3 @@ li.sfHover > a > .sf-sub-indicator {
.sf-menu ul li.sfHover > a > .sf-sub-indicator { .sf-menu ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px 0; /* arrow hovers for modern browsers*/ background-position: -10px 0; /* arrow hovers for modern browsers*/
} }
/*** shadows for all but IE6 ***/
.sf-shadow ul {
background: url('/assets/shadow.png') no-repeat bottom right;
padding: 0 8px 9px 0;
-moz-border-radius-bottomleft: 17px;
-moz-border-radius-topright: 17px;
-webkit-border-top-right-radius: 17px;
-webkit-border-bottom-left-radius: 17px;
}
.sf-shadow ul.sf-shadow-off {
background: transparent;
}