Browse Source

Rebuild dist #2165

pull/2169/head
jlukic 9 years ago
parent
commit
b4470ef9d0
13 changed files with 125 additions and 81 deletions
  1. 29
      dist/components/dropdown.js
  2. 2
      dist/components/dropdown.min.js
  3. 2
      dist/components/modal.js
  4. 2
      dist/components/modal.min.js
  5. 4
      dist/components/popup.js
  6. 2
      dist/components/popup.min.js
  7. 3
      dist/components/search.js
  8. 2
      dist/components/search.min.js
  9. 52
      dist/components/tab.js
  10. 2
      dist/components/tab.min.js
  11. 4
      dist/components/transition.js
  12. 94
      dist/semantic.js
  13. 8
      dist/semantic.min.js

29
dist/components/dropdown.js

@ -689,7 +689,6 @@ $.fn.dropdown = function(parameters) {
$range = ($nextActive.length > 0)
? $label.nextUntil($nextActive).add($activeLabels).add($label)
: $label.prevUntil($prevActive).add($activeLabels).add($label)
;
;
if(event.shiftKey) {
$activeLabels.removeClass(className.active);
@ -819,12 +818,12 @@ $.fn.dropdown = function(parameters) {
labelCount = $label.length,
hasActiveLabel = ($activeLabel.length > 0),
hasMultipleActive = ($activeLabel.length > 1),
isFirstLabel = (labelIndex == 0),
isFirstLabel = (labelIndex === 0),
isLastLabel = (labelIndex + 1 == labelCount),
isSearch = module.is.searchSelection(),
isFocusedOnSearch = module.is.focusedOnSearch(),
isFocused = module.is.focused(),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() == 0),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() === 0),
$nextLabel
;
if(settings.allowAdditions && isFocusedOnSearch && (pressedKey == keys.delimiter)) {
@ -840,7 +839,7 @@ $.fn.dropdown = function(parameters) {
else if(hasActiveLabel) {
if(!event.shiftKey) {
module.verbose('Selecting previous label');
$label.removeClass(className.active)
$label.removeClass(className.active);
}
else {
module.verbose('Adding previous label to selection');
@ -866,7 +865,7 @@ $.fn.dropdown = function(parameters) {
if(hasActiveLabel) {
if(!event.shiftKey) {
module.verbose('Selecting next label');
$label.removeClass(className.active)
$label.removeClass(className.active);
}
else {
module.verbose('Adding next label to selection');
@ -1108,7 +1107,7 @@ $.fn.dropdown = function(parameters) {
? callback
: function(){}
;
if($target.closest($menu).length == 0) {
if($target.closest($menu).length === 0) {
module.verbose('Triggering event', callback);
callback();
return true;
@ -1213,7 +1212,7 @@ $.fn.dropdown = function(parameters) {
var
value = module.get.value()
;
if(value == '') {
if(value === '') {
return '';
}
return (!$input.is('select') && module.is.multiple())
@ -1444,10 +1443,10 @@ $.fn.dropdown = function(parameters) {
: '',
hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0),
searchWidth = (searchValue.length * settings.glyphWidth) + 'em',
valueIsSet = $input.val() != ''
valueIsSet = $input.val() !== ''
;
if(isMultiple && hasSearchValue) {
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth)
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
$search.css('width', searchWidth);
}
if(hasSearchValue || (isSearchMultiple && valueIsSet)) {
@ -1649,7 +1648,7 @@ $.fn.dropdown = function(parameters) {
}
else {
module.set.value(selectedValue, selectedText, $selected);
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
$selected.addClass(className.active);
}
}
@ -1685,7 +1684,7 @@ $.fn.dropdown = function(parameters) {
if(settings.label.variation) {
$label.addClass(settings.label.variation);
}
if(shouldAnimate == true) {
if(shouldAnimate === true) {
module.debug('Animating in label', $label);
$label
.addClass(className.hidden)
@ -1792,7 +1791,7 @@ $.fn.dropdown = function(parameters) {
module.remove.label(selectedValue);
}
else {
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
}
}
$selectedItem
@ -1843,7 +1842,7 @@ $.fn.dropdown = function(parameters) {
},
labels: function($activeLabels) {
$activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active);
module.verbose('Removing active labels', $activeLabels);
module.verbose('Removing active label selections', $activeLabels);
$activeLabels
.each(function(){
module.remove.selected($(this).data('value'));
@ -1946,7 +1945,7 @@ $.fn.dropdown = function(parameters) {
return $module.hasClass(className.search);
},
searchSelection: function() {
return ( module.has.search() && $search.closest(selector.menu).length == 0 );
return ( module.has.search() && $search.closest(selector.menu).length === 0 );
},
selection: function() {
return $module.hasClass(className.selection);
@ -2364,7 +2363,7 @@ $.fn.dropdown.settings = {
/* Callbacks */
onLabelSelect : function($selectedLabels){},
onNoResults : function(searchTerm) { return true },
onNoResults : function(searchTerm) { return true; },
onChange : function(value, text, $selected){},
onShow : function(){},
onHide : function(){},

2
dist/components/dropdown.min.js
File diff suppressed because it is too large
View File

2
dist/components/modal.js

@ -108,7 +108,7 @@ $.fn.modal = function(parameters) {
;
if(settings.inverted) {
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
? dimmer.settings.variation + ' inverted'
? dimmerSettings.variation + ' inverted'
: 'inverted'
;
}

2
dist/components/modal.min.js
File diff suppressed because it is too large
View File

4
dist/components/popup.js

@ -600,7 +600,7 @@ $.fn.popup = function(parameters) {
position: function(position, arrowOffset) {
// exit conditions
if($target.length == 0 || $popup.length == 0) {
if($target.length === 0 || $popup.length === 0) {
module.error(error.notFound);
return;
}
@ -641,7 +641,7 @@ $.fn.popup = function(parameters) {
position = position || $module.data(metadata.position) || settings.position;
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset;
if(target.top == 0 && target.left == 0) {
if(target.top === 0 && target.left === 0) {
module.debug('Popup target is hidden, no action taken');
return false;
}

2
dist/components/popup.min.js
File diff suppressed because it is too large
View File

3
dist/components/search.js

@ -550,6 +550,9 @@ $.fn.search = function(parameters) {
clear: {
cache: function(value) {
var
cache = $module.data(metadata.cache)
;
if(!value) {
module.debug('Clearing cache', value);
$module.removeData(metadata.cache);

2
dist/components/search.min.js
File diff suppressed because it is too large
View File

52
dist/components/tab.js

@ -331,7 +331,7 @@ $.fn.tab = function(parameters) {
}
else if(tabPath.search('/') == -1 && tabPath !== '') {
// look for in page anchor
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
currentPath = $anchor.closest('[data-tab]').data('tab');
$tab = module.get.tabElement(currentPath);
// if anchor exists use parent tab
@ -359,9 +359,9 @@ $.fn.tab = function(parameters) {
var
$tab = module.get.tabElement(tabPath),
apiSettings = {
dataType : 'html',
on : 'now',
onSuccess : function(response) {
dataType : 'html',
on : 'now',
onSuccess : function(response) {
module.cache.add(fullTabPath, response);
module.content.update(tabPath, response);
if(tabPath == activeTabPath) {
@ -374,7 +374,9 @@ $.fn.tab = function(parameters) {
settings.onTabInit.call($tab, tabPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
urlData: {
tab: fullTabPath
}
},
request = $tab.api('get request') || false,
existingRequest = ( request && request.state() === 'pending' ),
@ -389,8 +391,13 @@ $.fn.tab = function(parameters) {
module.activate.tab(tabPath);
if(settings.cache && cachedContent) {
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.debug('Adding cached content', fullTabPath);
if(settings.evaluateScripts == 'once') {
module.content.update(tabPath, cachedContent, false);
}
else {
module.content.update(tabPath, cachedContent);
}
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
@ -399,24 +406,35 @@ $.fn.tab = function(parameters) {
}
else if($.api !== undefined) {
requestSettings = $.extend(true, {
headers: { 'X-Remote': true }
headers: {
'X-Remote': true
}
}, settings.apiSettings, apiSettings);
module.debug('Retrieving remote content', fullTabPath, requestSettings);
$tab.api( requestSettings );
$tab.api(requestSettings);
}
else {
module.error(error.api);
}
},
update: function(tabPath, html) {
module.debug('Updating html for', tabPath);
update: function(tabPath, html, evaluateScripts) {
var
$tab = module.get.tabElement(tabPath)
$tab = module.get.tabElement(tabPath),
tab = $tab[0]
;
$tab
.html(html)
evaluateScripts = (evaluateScripts !== undefined)
? evaluateScripts
: settings.evaluateScripts
;
if(evaluateScripts) {
module.debug('Updating HTML and evaluating inline scripts', tabPath, html);
$tab.html(html);
}
else {
module.debug('Updating HTML', tabPath, html);
tab.innerHTML = html;
}
}
},
@ -765,10 +783,12 @@ $.fn.tab.settings = {
alwaysRefresh : false, // load tab content new every tab click
cache : true, // cache the content requests to pull locally
ignoreFirstLoad : false, // don't load remote content on first load
apiSettings : false, // settings for api call
evaluateScripts : 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
templates : {
determineTitle: function(tabArray) {} // returns page title for path

2
dist/components/tab.min.js
File diff suppressed because it is too large
View File

4
dist/components/transition.js

@ -437,7 +437,7 @@ $.fn.transition = function() {
module.remove.completeCallback();
},
queueCallback: function() {
$module.off('.queue' + eventNamespace)
$module.off('.queue' + eventNamespace);
},
completeCallback: function() {
$module.off('.complete' + eventNamespace);
@ -769,7 +769,7 @@ $.fn.transition = function() {
clear: {
queue: function() {
module.debug('Clearing animation queue')
module.debug('Clearing animation queue');
module.remove.queueCallback();
}
},

94
dist/semantic.js

@ -4194,7 +4194,6 @@ $.fn.dropdown = function(parameters) {
$range = ($nextActive.length > 0)
? $label.nextUntil($nextActive).add($activeLabels).add($label)
: $label.prevUntil($prevActive).add($activeLabels).add($label)
;
;
if(event.shiftKey) {
$activeLabels.removeClass(className.active);
@ -4324,12 +4323,12 @@ $.fn.dropdown = function(parameters) {
labelCount = $label.length,
hasActiveLabel = ($activeLabel.length > 0),
hasMultipleActive = ($activeLabel.length > 1),
isFirstLabel = (labelIndex == 0),
isFirstLabel = (labelIndex === 0),
isLastLabel = (labelIndex + 1 == labelCount),
isSearch = module.is.searchSelection(),
isFocusedOnSearch = module.is.focusedOnSearch(),
isFocused = module.is.focused(),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() == 0),
caretAtStart = (isFocusedOnSearch && module.get.caretPosition() === 0),
$nextLabel
;
if(settings.allowAdditions && isFocusedOnSearch && (pressedKey == keys.delimiter)) {
@ -4345,7 +4344,7 @@ $.fn.dropdown = function(parameters) {
else if(hasActiveLabel) {
if(!event.shiftKey) {
module.verbose('Selecting previous label');
$label.removeClass(className.active)
$label.removeClass(className.active);
}
else {
module.verbose('Adding previous label to selection');
@ -4371,7 +4370,7 @@ $.fn.dropdown = function(parameters) {
if(hasActiveLabel) {
if(!event.shiftKey) {
module.verbose('Selecting next label');
$label.removeClass(className.active)
$label.removeClass(className.active);
}
else {
module.verbose('Adding next label to selection');
@ -4613,7 +4612,7 @@ $.fn.dropdown = function(parameters) {
? callback
: function(){}
;
if($target.closest($menu).length == 0) {
if($target.closest($menu).length === 0) {
module.verbose('Triggering event', callback);
callback();
return true;
@ -4718,7 +4717,7 @@ $.fn.dropdown = function(parameters) {
var
value = module.get.value()
;
if(value == '') {
if(value === '') {
return '';
}
return (!$input.is('select') && module.is.multiple())
@ -4949,10 +4948,10 @@ $.fn.dropdown = function(parameters) {
: '',
hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0),
searchWidth = (searchValue.length * settings.glyphWidth) + 'em',
valueIsSet = $input.val() != ''
valueIsSet = $input.val() !== ''
;
if(isMultiple && hasSearchValue) {
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth)
module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);
$search.css('width', searchWidth);
}
if(hasSearchValue || (isSearchMultiple && valueIsSet)) {
@ -5154,7 +5153,7 @@ $.fn.dropdown = function(parameters) {
}
else {
module.set.value(selectedValue, selectedText, $selected);
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
$selected.addClass(className.active);
}
}
@ -5190,7 +5189,7 @@ $.fn.dropdown = function(parameters) {
if(settings.label.variation) {
$label.addClass(settings.label.variation);
}
if(shouldAnimate == true) {
if(shouldAnimate === true) {
module.debug('Animating in label', $label);
$label
.addClass(className.hidden)
@ -5297,7 +5296,7 @@ $.fn.dropdown = function(parameters) {
module.remove.label(selectedValue);
}
else {
module.set.text(module.add.variables(message.count))
module.set.text(module.add.variables(message.count));
}
}
$selectedItem
@ -5348,7 +5347,7 @@ $.fn.dropdown = function(parameters) {
},
labels: function($activeLabels) {
$activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active);
module.verbose('Removing active labels', $activeLabels);
module.verbose('Removing active label selections', $activeLabels);
$activeLabels
.each(function(){
module.remove.selected($(this).data('value'));
@ -5451,7 +5450,7 @@ $.fn.dropdown = function(parameters) {
return $module.hasClass(className.search);
},
searchSelection: function() {
return ( module.has.search() && $search.closest(selector.menu).length == 0 );
return ( module.has.search() && $search.closest(selector.menu).length === 0 );
},
selection: function() {
return $module.hasClass(className.selection);
@ -5869,7 +5868,7 @@ $.fn.dropdown.settings = {
/* Callbacks */
onLabelSelect : function($selectedLabels){},
onNoResults : function(searchTerm) { return true },
onNoResults : function(searchTerm) { return true; },
onChange : function(value, text, $selected){},
onShow : function(){},
onHide : function(){},
@ -6103,7 +6102,7 @@ $.fn.modal = function(parameters) {
;
if(settings.inverted) {
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
? dimmer.settings.variation + ' inverted'
? dimmerSettings.variation + ' inverted'
: 'inverted'
;
}
@ -7972,7 +7971,7 @@ $.fn.popup = function(parameters) {
position: function(position, arrowOffset) {
// exit conditions
if($target.length == 0 || $popup.length == 0) {
if($target.length === 0 || $popup.length === 0) {
module.error(error.notFound);
return;
}
@ -8013,7 +8012,7 @@ $.fn.popup = function(parameters) {
position = position || $module.data(metadata.position) || settings.position;
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset;
if(target.top == 0 && target.left == 0) {
if(target.top === 0 && target.left === 0) {
module.debug('Popup target is hidden, no action taken');
return false;
}
@ -10444,6 +10443,9 @@ $.fn.search = function(parameters) {
clear: {
cache: function(value) {
var
cache = $module.data(metadata.cache)
;
if(!value) {
module.debug('Clearing cache', value);
$module.removeData(metadata.cache);
@ -14140,7 +14142,7 @@ $.fn.tab = function(parameters) {
}
else if(tabPath.search('/') == -1 && tabPath !== '') {
// look for in page anchor
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]');
currentPath = $anchor.closest('[data-tab]').data('tab');
$tab = module.get.tabElement(currentPath);
// if anchor exists use parent tab
@ -14168,9 +14170,9 @@ $.fn.tab = function(parameters) {
var
$tab = module.get.tabElement(tabPath),
apiSettings = {
dataType : 'html',
on : 'now',
onSuccess : function(response) {
dataType : 'html',
on : 'now',
onSuccess : function(response) {
module.cache.add(fullTabPath, response);
module.content.update(tabPath, response);
if(tabPath == activeTabPath) {
@ -14183,7 +14185,9 @@ $.fn.tab = function(parameters) {
settings.onTabInit.call($tab, tabPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
urlData: {
tab: fullTabPath
}
},
request = $tab.api('get request') || false,
existingRequest = ( request && request.state() === 'pending' ),
@ -14198,8 +14202,13 @@ $.fn.tab = function(parameters) {
module.activate.tab(tabPath);
if(settings.cache && cachedContent) {
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.debug('Adding cached content', fullTabPath);
if(settings.evaluateScripts == 'once') {
module.content.update(tabPath, cachedContent, false);
}
else {
module.content.update(tabPath, cachedContent);
}
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
@ -14208,24 +14217,35 @@ $.fn.tab = function(parameters) {
}
else if($.api !== undefined) {
requestSettings = $.extend(true, {
headers: { 'X-Remote': true }
headers: {
'X-Remote': true
}
}, settings.apiSettings, apiSettings);
module.debug('Retrieving remote content', fullTabPath, requestSettings);
$tab.api( requestSettings );
$tab.api(requestSettings);
}
else {
module.error(error.api);
}
},
update: function(tabPath, html) {
module.debug('Updating html for', tabPath);
update: function(tabPath, html, evaluateScripts) {
var
$tab = module.get.tabElement(tabPath)
$tab = module.get.tabElement(tabPath),
tab = $tab[0]
;
$tab
.html(html)
evaluateScripts = (evaluateScripts !== undefined)
? evaluateScripts
: settings.evaluateScripts
;
if(evaluateScripts) {
module.debug('Updating HTML and evaluating inline scripts', tabPath, html);
$tab.html(html);
}
else {
module.debug('Updating HTML', tabPath, html);
tab.innerHTML = html;
}
}
},
@ -14574,10 +14594,12 @@ $.fn.tab.settings = {
alwaysRefresh : false, // load tab content new every tab click
cache : true, // cache the content requests to pull locally
ignoreFirstLoad : false, // don't load remote content on first load
apiSettings : false, // settings for api call
evaluateScripts : 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
templates : {
determineTitle: function(tabArray) {} // returns page title for path
@ -15051,7 +15073,7 @@ $.fn.transition = function() {
module.remove.completeCallback();
},
queueCallback: function() {
$module.off('.queue' + eventNamespace)
$module.off('.queue' + eventNamespace);
},
completeCallback: function() {
$module.off('.complete' + eventNamespace);
@ -15383,7 +15405,7 @@ $.fn.transition = function() {
clear: {
queue: function() {
module.debug('Clearing animation queue')
module.debug('Clearing animation queue');
module.remove.queueCallback();
}
},

8
dist/semantic.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save