|
@ -1466,10 +1466,18 @@ $.fn.form.settings = { |
|
|
return ($(this).filter(':checked').length > 0); |
|
|
return ($(this).filter(':checked').length > 0); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// value contains (text)
|
|
|
|
|
|
|
|
|
// value contains text (insensitive)
|
|
|
contains: function(value, text) { |
|
|
contains: function(value, text) { |
|
|
|
|
|
// escape regex characters
|
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
return (value.search(text) !== -1); |
|
|
|
|
|
|
|
|
return (value.search( new RegExp(text, 'i') ) !== -1); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// value contains text (case sensitive)
|
|
|
|
|
|
containsExactly: function(value, text) { |
|
|
|
|
|
// escape regex characters
|
|
|
|
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
|
|
|
return (value.search( new RegExp(text) ) !== -1); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// is most likely an email
|
|
|
// is most likely an email
|
|
@ -1517,8 +1525,21 @@ $.fn.form.settings = { |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// is exactly value
|
|
|
|
|
|
|
|
|
// is value (case insensitive)
|
|
|
is: function(value, text) { |
|
|
is: function(value, text) { |
|
|
|
|
|
text = (typeof text == 'string') |
|
|
|
|
|
? text.toLowerCase() |
|
|
|
|
|
: text |
|
|
|
|
|
; |
|
|
|
|
|
value = (typeof value == 'string') |
|
|
|
|
|
? value.toLowerCase() |
|
|
|
|
|
: value |
|
|
|
|
|
; |
|
|
|
|
|
return (value == text); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// is value
|
|
|
|
|
|
isExactly: function(value, text) { |
|
|
return (value == text); |
|
|
return (value == text); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -1560,8 +1581,21 @@ $.fn.form.settings = { |
|
|
; |
|
|
; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// value is not exactly notValue
|
|
|
|
|
|
|
|
|
// value is not value (case insensitive)
|
|
|
not: function(value, notValue) { |
|
|
not: function(value, notValue) { |
|
|
|
|
|
value = (typeof value == 'string') |
|
|
|
|
|
? value.toLowerCase() |
|
|
|
|
|
: value |
|
|
|
|
|
; |
|
|
|
|
|
notValue = (typeof notValue == 'string') |
|
|
|
|
|
? notValue.toLowerCase() |
|
|
|
|
|
: notValue |
|
|
|
|
|
; |
|
|
|
|
|
return (value != notValue); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// value is not value (case sensitive)
|
|
|
|
|
|
notExactly: function(value, notValue) { |
|
|
return (value != notValue); |
|
|
return (value != notValue); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -9124,12 +9158,12 @@ $.fn.search = function(parameters) { |
|
|
var |
|
|
var |
|
|
result = false |
|
|
result = false |
|
|
; |
|
|
; |
|
|
value = value || module.get.value(); |
|
|
|
|
|
|
|
|
value = value || module.get.value(); |
|
|
results = results || module.get.results(); |
|
|
results = results || module.get.results(); |
|
|
if(settings.type === 'category') { |
|
|
if(settings.type === 'category') { |
|
|
module.debug('Finding result from category results', value); |
|
|
|
|
|
|
|
|
module.debug('Finding result that matches', value); |
|
|
$.each(results, function(index, category) { |
|
|
$.each(results, function(index, category) { |
|
|
if(category.results !== undefined) { |
|
|
|
|
|
|
|
|
if($.isArray(category.results)) { |
|
|
result = module.search.object(value, category.results)[0]; |
|
|
result = module.search.object(value, category.results)[0]; |
|
|
if(result.length > 0) { |
|
|
if(result.length > 0) { |
|
|
return true; |
|
|
return true; |
|
@ -9155,6 +9189,7 @@ $.fn.search = function(parameters) { |
|
|
value: function(value) { |
|
|
value: function(value) { |
|
|
module.verbose('Setting search input value', value); |
|
|
module.verbose('Setting search input value', value); |
|
|
$prompt.val(value); |
|
|
$prompt.val(value); |
|
|
|
|
|
module.query(); |
|
|
}, |
|
|
}, |
|
|
buttonPressed: function() { |
|
|
buttonPressed: function() { |
|
|
$searchButton.addClass(className.pressed); |
|
|
$searchButton.addClass(className.pressed); |
|
@ -9438,7 +9473,9 @@ $.fn.search = function(parameters) { |
|
|
if(isProperObject || isProperArray ) { |
|
|
if(isProperObject || isProperArray ) { |
|
|
if(settings.maxResults > 0) { |
|
|
if(settings.maxResults > 0) { |
|
|
if(isProperObject) { |
|
|
if(isProperObject) { |
|
|
module.error(error.maxResults); |
|
|
|
|
|
|
|
|
if(settings.type == 'standard') { |
|
|
|
|
|
module.error(error.maxResults); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
response.results = response.results.slice(0, settings.maxResults); |
|
|
response.results = response.results.slice(0, settings.maxResults); |
|
@ -11072,11 +11109,20 @@ $.fn.sidebar = function(parameters) { |
|
|
settings.transition = 'overlay'; |
|
|
settings.transition = 'overlay'; |
|
|
} |
|
|
} |
|
|
module.refresh(); |
|
|
module.refresh(); |
|
|
if(module.othersActive() && module.get.transition() !== 'overlay') { |
|
|
|
|
|
|
|
|
if(module.othersActive()) { |
|
|
module.debug('Other sidebars currently visible'); |
|
|
module.debug('Other sidebars currently visible'); |
|
|
settings.transition = 'overlay'; |
|
|
|
|
|
if(settings.exclusive) { |
|
|
if(settings.exclusive) { |
|
|
module.hideOthers(); |
|
|
|
|
|
|
|
|
// if not overlay queue animation after hide
|
|
|
|
|
|
if(settings.transition != 'overlay') { |
|
|
|
|
|
module.hideOthers(module.show); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.hideOthers(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
settings.transition = 'overlay'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
animateMethod(function() { |
|
|
animateMethod(function() { |
|
@ -11129,8 +11175,7 @@ $.fn.sidebar = function(parameters) { |
|
|
sidebarCount = $otherSidebars.length, |
|
|
sidebarCount = $otherSidebars.length, |
|
|
callbackCount = 0 |
|
|
callbackCount = 0 |
|
|
; |
|
|
; |
|
|
callback = callback || function(){}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callback = callback || function(){}; |
|
|
$otherSidebars |
|
|
$otherSidebars |
|
|
.sidebar('hide', function() { |
|
|
.sidebar('hide', function() { |
|
|
callbackCount++; |
|
|
callbackCount++; |
|
@ -14991,13 +15036,17 @@ $.api = $.fn.api = function(parameters) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// call beforesend and get any settings changes
|
|
|
// call beforesend and get any settings changes
|
|
|
requestSettings = module.get.settings(); |
|
|
|
|
|
|
|
|
requestSettings = module.get.settings(); |
|
|
|
|
|
|
|
|
// check if beforesend cancelled request
|
|
|
|
|
|
|
|
|
// check if before send cancelled request
|
|
|
if(requestSettings === false) { |
|
|
if(requestSettings === false) { |
|
|
|
|
|
module.cancelled = true; |
|
|
module.error(error.beforeSend); |
|
|
module.error(error.beforeSend); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.cancelled = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(settings.url) { |
|
|
if(settings.url) { |
|
|
// override with url if specified
|
|
|
// override with url if specified
|
|
@ -15068,6 +15117,9 @@ $.api = $.fn.api = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
was: { |
|
|
was: { |
|
|
|
|
|
cancelled: function() { |
|
|
|
|
|
return (module.cancelled || false); |
|
|
|
|
|
}, |
|
|
succesful: function() { |
|
|
succesful: function() { |
|
|
return (module.request && module.request.state() == 'resolved'); |
|
|
return (module.request && module.request.state() == 'resolved'); |
|
|
}, |
|
|
}, |
|
@ -16681,10 +16733,18 @@ $.fn.form.settings = { |
|
|
return ($(this).filter(':checked').length > 0); |
|
|
return ($(this).filter(':checked').length > 0); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// value contains (text)
|
|
|
|
|
|
|
|
|
// value contains text (insensitive)
|
|
|
contains: function(value, text) { |
|
|
contains: function(value, text) { |
|
|
|
|
|
// escape regex characters
|
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
return (value.search(text) !== -1); |
|
|
|
|
|
|
|
|
return (value.search( new RegExp(text, 'i') ) !== -1); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// value contains text (case sensitive)
|
|
|
|
|
|
containsExactly: function(value, text) { |
|
|
|
|
|
// escape regex characters
|
|
|
|
|
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
|
|
|
|
return (value.search( new RegExp(text) ) !== -1); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// is most likely an email
|
|
|
// is most likely an email
|
|
@ -16732,8 +16792,21 @@ $.fn.form.settings = { |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// is exactly value
|
|
|
|
|
|
|
|
|
// is value (case insensitive)
|
|
|
is: function(value, text) { |
|
|
is: function(value, text) { |
|
|
|
|
|
text = (typeof text == 'string') |
|
|
|
|
|
? text.toLowerCase() |
|
|
|
|
|
: text |
|
|
|
|
|
; |
|
|
|
|
|
value = (typeof value == 'string') |
|
|
|
|
|
? value.toLowerCase() |
|
|
|
|
|
: value |
|
|
|
|
|
; |
|
|
|
|
|
return (value == text); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// is value
|
|
|
|
|
|
isExactly: function(value, text) { |
|
|
return (value == text); |
|
|
return (value == text); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -16775,8 +16848,21 @@ $.fn.form.settings = { |
|
|
; |
|
|
; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// value is not exactly notValue
|
|
|
|
|
|
|
|
|
// value is not value (case insensitive)
|
|
|
not: function(value, notValue) { |
|
|
not: function(value, notValue) { |
|
|
|
|
|
value = (typeof value == 'string') |
|
|
|
|
|
? value.toLowerCase() |
|
|
|
|
|
: value |
|
|
|
|
|
; |
|
|
|
|
|
notValue = (typeof notValue == 'string') |
|
|
|
|
|
? notValue.toLowerCase() |
|
|
|
|
|
: notValue |
|
|
|
|
|
; |
|
|
|
|
|
return (value != notValue); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// value is not value (case sensitive)
|
|
|
|
|
|
notExactly: function(value, notValue) { |
|
|
return (value != notValue); |
|
|
return (value != notValue); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -16987,13 +17073,20 @@ $.fn.state = function(parameters) { |
|
|
toggle: { |
|
|
toggle: { |
|
|
state: function() { |
|
|
state: function() { |
|
|
var |
|
|
var |
|
|
apiRequest |
|
|
|
|
|
|
|
|
apiRequest, |
|
|
|
|
|
requestCancelled |
|
|
; |
|
|
; |
|
|
if( module.allows('active') && module.is.enabled() ) { |
|
|
if( module.allows('active') && module.is.enabled() ) { |
|
|
module.refresh(); |
|
|
module.refresh(); |
|
|
if($.fn.api !== undefined) { |
|
|
if($.fn.api !== undefined) { |
|
|
apiRequest = $module.api('get request'); |
|
|
|
|
|
if(apiRequest) { |
|
|
|
|
|
|
|
|
apiRequest = $module.api('get request'); |
|
|
|
|
|
requestCancelled = $module.api('was cancelled'); |
|
|
|
|
|
if( requestCancelled ) { |
|
|
|
|
|
module.debug('API Request cancelled by beforesend'); |
|
|
|
|
|
settings.activateTest = function(){ return false; }; |
|
|
|
|
|
settings.deactivateTest = function(){ return false; }; |
|
|
|
|
|
} |
|
|
|
|
|
else if(apiRequest) { |
|
|
module.listenTo(apiRequest); |
|
|
module.listenTo(apiRequest); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -17025,11 +17118,6 @@ $.fn.state = function(parameters) { |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
|
// xhr exists but set to false, beforeSend killed the xhr
|
|
|
|
|
|
else { |
|
|
|
|
|
settings.activateTest = function(){ return false; }; |
|
|
|
|
|
settings.deactivateTest = function(){ return false; }; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// checks whether active/inactive state can be given
|
|
|
// checks whether active/inactive state can be given
|
|
@ -17189,7 +17277,7 @@ $.fn.state = function(parameters) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
module.debug('Text is already sane, ignoring update', text); |
|
|
|
|
|
|
|
|
module.debug('Text is already set, ignoring update', text); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -17374,37 +17462,37 @@ $.fn.state = function(parameters) { |
|
|
$.fn.state.settings = { |
|
|
$.fn.state.settings = { |
|
|
|
|
|
|
|
|
// module info
|
|
|
// module info
|
|
|
name : 'State', |
|
|
|
|
|
|
|
|
name : 'State', |
|
|
|
|
|
|
|
|
// debug output
|
|
|
// debug output
|
|
|
debug : false, |
|
|
|
|
|
|
|
|
debug : false, |
|
|
|
|
|
|
|
|
// verbose debug output
|
|
|
// verbose debug output
|
|
|
verbose : true, |
|
|
|
|
|
|
|
|
verbose : true, |
|
|
|
|
|
|
|
|
// namespace for events
|
|
|
// namespace for events
|
|
|
namespace : 'state', |
|
|
|
|
|
|
|
|
namespace : 'state', |
|
|
|
|
|
|
|
|
// debug data includes performance
|
|
|
// debug data includes performance
|
|
|
performance: true, |
|
|
|
|
|
|
|
|
performance : true, |
|
|
|
|
|
|
|
|
// callback occurs on state change
|
|
|
// callback occurs on state change
|
|
|
onActivate : function() {}, |
|
|
|
|
|
onDeactivate : function() {}, |
|
|
|
|
|
onChange : function() {}, |
|
|
|
|
|
|
|
|
onActivate : function() {}, |
|
|
|
|
|
onDeactivate : function() {}, |
|
|
|
|
|
onChange : function() {}, |
|
|
|
|
|
|
|
|
// state test functions
|
|
|
// state test functions
|
|
|
activateTest : function() { return true; }, |
|
|
activateTest : function() { return true; }, |
|
|
deactivateTest : function() { return true; }, |
|
|
deactivateTest : function() { return true; }, |
|
|
|
|
|
|
|
|
// whether to automatically map default states
|
|
|
// whether to automatically map default states
|
|
|
automatic : true, |
|
|
|
|
|
|
|
|
automatic : true, |
|
|
|
|
|
|
|
|
// activate / deactivate changes all elements instantiated at same time
|
|
|
// activate / deactivate changes all elements instantiated at same time
|
|
|
sync : false, |
|
|
|
|
|
|
|
|
sync : false, |
|
|
|
|
|
|
|
|
// default flash text duration, used for temporarily changing text of an element
|
|
|
// default flash text duration, used for temporarily changing text of an element
|
|
|
flashDuration : 1000, |
|
|
|
|
|
|
|
|
flashDuration : 1000, |
|
|
|
|
|
|
|
|
// selector filter
|
|
|
// selector filter
|
|
|
filter : { |
|
|
filter : { |
|
@ -17416,7 +17504,8 @@ $.fn.state.settings = { |
|
|
|
|
|
|
|
|
// error
|
|
|
// error
|
|
|
error: { |
|
|
error: { |
|
|
method : 'The method you called is not defined.' |
|
|
|
|
|
|
|
|
beforeSend : 'The before send function has cancelled state change', |
|
|
|
|
|
method : 'The method you called is not defined.' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// metadata
|
|
|
// metadata
|
|
|