Browse Source

Fixes shape module, finally

Former-commit-id: 2459d781fc9792d2a879aa86e4d8698cfa8122c9
Former-commit-id: 10d4a7b83eb783e6936f72cc6905b71e9e7e867d
beta
Jack Lukic 11 years ago
parent
commit
cd3de8bb2a
  1. 2
      build/minified/collections/message.min.css
  2. 2
      build/minified/elements/button.min.css
  3. 2
      build/minified/elements/icons.min.css
  4. 2
      build/minified/modules/accordion.js
  5. 2
      build/minified/modules/accordion.min.js
  6. 74
      build/minified/modules/shape.js
  7. 2
      build/minified/modules/shape.min.js
  8. 109
      build/minified/modules/tab.js
  9. 2
      build/minified/modules/tab.min.css
  10. 2
      build/minified/modules/tab.min.js
  11. 2
      build/packaged/modules/accordion.js
  12. 74
      build/packaged/modules/shape.js
  13. 109
      build/packaged/modules/tab.js
  14. 2
      build/packaged/semantic.min.css.REMOVED.git-id
  15. 2
      build/packaged/semantic.min.js.REMOVED.git-id
  16. 4
      build/uncompressed/collections/message.css
  17. 264
      build/uncompressed/elements/button.css
  18. 2
      build/uncompressed/elements/icons.css
  19. 2
      build/uncompressed/modules/accordion.js
  20. 32
      build/uncompressed/modules/shape.css
  21. 74
      build/uncompressed/modules/shape.js
  22. 27
      build/uncompressed/modules/tab.css
  23. 109
      build/uncompressed/modules/tab.js
  24. 4
      node/src/files/components/semantic/collections/message.css
  25. 264
      node/src/files/components/semantic/elements/button.css
  26. 2
      node/src/files/components/semantic/elements/icons.css
  27. 2
      node/src/files/components/semantic/modules/accordion.js
  28. 32
      node/src/files/components/semantic/modules/shape.css
  29. 74
      node/src/files/components/semantic/modules/shape.js
  30. 27
      node/src/files/components/semantic/modules/tab.css
  31. 109
      node/src/files/components/semantic/modules/tab.js
  32. 6
      node/src/files/overrides/views/card.css
  33. 4
      node/src/files/stylesheets/semantic.css
  34. 300
      src/elements/button.less
  35. 2
      src/modules/accordion.js
  36. 74
      src/modules/shape.js
  37. 43
      src/modules/shape.less

2
build/minified/collections/message.min.css

@ -1 +1 @@
.ui.message{position:relative;min-height:18px;margin:1em 0;height:auto;background-color:#EFEFEF;padding:1em;line-height:1.33;color:rgba(0,0,0,.6);-webkit-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-moz-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-o-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-ms-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-webkit-border-radius:.325em;-moz-border-radius:.325em;border-radius:.325em}.ui.message .header{margin:0;font-size:1.33em;font-weight:700}.ui.message .header+p{margin-top:0}.ui.message p{opacity:.85;margin:1em 0}.ui.message>:first-child{margin-top:0}.ui.message>:last-child{margin-bottom:0}.ui.message ul.list{opacity:.85;list-style-position:inside;margin:.2em 0;padding:0}.ui.message ul.list li{position:relative;list-style-type:none;font-style:italic;margin:0 0 0 1em;padding:0}.ui.message ul.list li:before{position:absolute;content:'\2022';top:-.05em;left:-.8em;height:100%;vertical-align:baseline;opacity:.5}.ui.message ul.list li:first-child{margin-top:0}.ui.message>.icon.close{cursor:pointer;position:absolute;top:1em;right:.5em;opacity:.7;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-o-transition:opacity .1s linear;-ms-transition:opacity .1s linear;transition:opacity .1s linear}.ui.message>.icon.close:hover{opacity:1}.ui.message.visible,.ui.header.visible{display:block!important}.ui.message.hidden,.ui.header.hidden{display:none}.ui.compact.message{display:inline-block}.ui.attached.message{margin-left:-1px;margin-right:-1px;margin-bottom:-1px;-webkit-border-radius:.325em .325em 0 0;-moz-border-radius:.325em .325em 0 0;border-radius:.325em .325em 0 0;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;box-shadow:0 0 0 1px rgba(0,0,0,.1) inset}.ui.bottom.attached.message{margin-top:-1px;-webkit-border-radius:0 0 .325em .325em;-moz-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em}.ui.icon.message>.icon{display:table-cell;vertical-align:middle;font-size:3.8em;padding-right:.4em;opacity:.2}.ui.icon.message>.content{display:table-cell;vertical-align:middle}.ui.inverted.message{background-color:rgba(255,255,255,.05);color:rgba(255,255,255,.95)}.ui.black.message{background-color:#333;color:rgba(255,255,255,.95)}.ui.blue.message,.ui.info.message{background-color:#E6F4F9;color:#4D8796}.ui.green.message{background-color:#DEFCD5;color:#52A954}.ui.yellow.message,.ui.warning.message{background-color:#F6F3D5;color:#96904D}.ui.red.message{background-color:#F1D7D7;color:#A95252}.ui.success.message,.ui.positive.message{background-color:#5BBD72;color:#FFF}.ui.error.message,.ui.negative.message{background-color:#D95C5C;color:#FFF}.ui.small.message{font-size:.875em}.ui.message{font-size:1em}.ui.large.message{font-size:1.125em}.ui.huge.message{font-size:1.5em}.ui.massive.message{font-size:2em} .ui.message{position:relative;min-height:18px;margin:1em 0;height:auto;background-color:#EFEFEF;padding:1em;line-height:1.33;color:rgba(0,0,0,.6);-webkit-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-moz-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-o-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-ms-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-webkit-border-radius:.325em;-moz-border-radius:.325em;border-radius:.325em}.ui.message .header{margin:0;font-size:1.33em;font-weight:700}.ui.message .header+p{margin-top:0}.ui.message p{opacity:.85;margin:1em 0}.ui.message>:first-child{margin-top:0}.ui.message>:last-child{margin-bottom:0}.ui.message ul.list{opacity:.85;list-style-position:inside;margin:.2em 0;padding:0}.ui.message ul.list li{position:relative;list-style-type:none;font-style:italic;margin:0 0 0 1em;padding:0}.ui.message ul.list li:before{position:absolute;content:'\2022';top:-.05em;left:-.8em;height:100%;vertical-align:baseline;opacity:.5}.ui.message ul.list li:first-child{margin-top:0}.ui.message>.icon.close{cursor:pointer;position:absolute;top:1em;right:.5em;opacity:.7;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-o-transition:opacity .1s linear;-ms-transition:opacity .1s linear;transition:opacity .1s linear}.ui.message>.icon.close:hover{opacity:1}.ui.message.visible,.ui.header.visible{display:block!important}.ui.message.hidden,.ui.header.hidden{display:none}.ui.compact.message{display:inline-block}.ui.attached.message{margin-left:-1px;margin-right:-1px;margin-bottom:-1px;-webkit-border-radius:.325em .325em 0 0;-moz-border-radius:.325em .325em 0 0;border-radius:.325em .325em 0 0;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;box-shadow:0 0 0 1px rgba(0,0,0,.1) inset}.ui.bottom.attached.message{margin-top:-1px;-webkit-border-radius:0 0 .325em .325em;-moz-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em}.ui.icon.message{display:table;width:100%}.ui.icon.message>.icon{display:table-cell;vertical-align:middle;font-size:3.8em;padding-right:.4em;opacity:.2}.ui.icon.message>.content{display:table-cell;vertical-align:middle}.ui.inverted.message{background-color:rgba(255,255,255,.05);color:rgba(255,255,255,.95)}.ui.black.message{background-color:#333;color:rgba(255,255,255,.95)}.ui.blue.message,.ui.info.message{background-color:#E6F4F9;color:#4D8796}.ui.green.message{background-color:#DEFCD5;color:#52A954}.ui.yellow.message,.ui.warning.message{background-color:#F6F3D5;color:#96904D}.ui.red.message{background-color:#F1D7D7;color:#A95252}.ui.success.message,.ui.positive.message{background-color:#5BBD72;color:#FFF}.ui.error.message,.ui.negative.message{background-color:#D95C5C;color:#FFF}.ui.small.message{font-size:.875em}.ui.message{font-size:1em}.ui.large.message{font-size:1.125em}.ui.huge.message{font-size:1.5em}.ui.massive.message{font-size:2em}

2
build/minified/elements/button.min.css

File diff suppressed because one or more lines are too long

2
build/minified/elements/icons.min.css

File diff suppressed because one or more lines are too long

2
build/minified/modules/accordion.js

@ -329,7 +329,7 @@ $.fn.accordion.settings = {
debug : true, debug : true,
verbose : true, verbose : true,
performance : false, performance : true,
exclusive : true, exclusive : true,
collapsible : true, collapsible : true,

2
build/minified/modules/accordion.min.js

@ -1 +1 @@
!function(a,b,c,d){a.fn.accordion=function(b){var c,e=a(this),f=a.isPlainObject(b)?a.extend(!0,{},a.fn.accordion.settings,b):a.fn.accordion.settings,g=("."+f.namespace,"module-"+f.namespace,e.selector||""),h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return e.each(function(){var b,e=a(this),m=e.find(f.selector.title),n=(e.find(f.selector.icon),e.find(f.selector.content)),o=(e.selector||"",this),p=e.data("module-"+f.namespace),q=f.className,r=(f.metadata,f.namespace),s=(f.animation,f.errors);b={initialize:function(){b.debug("Initializing accordion with bound events",e),m.on("click",b.event.click),e.data("module",b)},destroy:function(){b.debug("Destroying previous accordion for",e),e.off(r)},event:{click:function(){var c=a(this),d=m.index(c),e=c.hasClass(q.active);b.verbose("Accordion title clicked",c),e?f.collapsible?b.close(d):b.debug("Cannot close accordion content collapsing is disabled"):b.open(d)}},open:function(c){var d=m.eq(c),e=d.next(n),g=m.filter("."+q.active),h=g.next(m),i=g.size()>0;e.is(":animated")||(b.debug("Opening accordion content",d),f.exclusive&&i&&(g.removeClass(q.active),h.stop().children().animate({opacity:0},f.speed).end().slideUp(f.speed,f.easing,function(){h.removeClass(q.active).removeAttr("style").children().removeAttr("style")})),d.addClass(q.active),e.stop().children().removeAttr("style").end().slideDown(f.speed,f.easing,function(){e.addClass(q.active).removeAttr("style"),a.proxy(f.onOpen,e)(),a.proxy(f.onChange,e)()}))},close:function(c){var d=m.eq(c),e=d.next(n);b.debug("Closing accordion content",d),d.removeClass(q.active),e.removeClass(q.active).show().stop().children().animate({opacity:0},f.speed).end().slideUp(f.speed,f.easing,function(){e.removeAttr("style"),a.proxy(f.onClose,e)(),a.proxy(f.onChange,e)()})},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?f[c]:(a.isPlainObject(c)?a.extend(!0,f,c):f[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):b.debug=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):b.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},error:function(){b.error=Function.prototype.bind.call(console.log,console,f.moduleName+":")},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:o,Name:a[0],Arguments:a[1]||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var b=f.moduleName+":",c=0;h=!1,a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(c,e,f){var g,h;return e=e||l,f=o||f,"string"==typeof c&&p!==d&&(c=c.split("."),g=c.length-1,a.each(c,function(c,e){return a.isPlainObject(p[e])&&c!=g?(p=p[e],!0):p[e]!==d?(h=p[e],!0):(b.error(s.method),!1)})),a.isFunction(h)?(p.verbose("Executing invoked function",h),h.apply(f,e)):h||!1}},k?(p===d&&b.initialize(),c=b.invoke(j)):(p!==d&&b.destroy(),b.initialize())}),c?c:this},a.fn.accordion.settings={moduleName:"Accordion",debug:!0,verbose:!0,performance:!1,exclusive:!0,collapsible:!0,onOpen:function(){},onClose:function(){},onChange:function(){},errors:{method:"The method you called is not defined"},className:{active:"active",hover:"hover"},selector:{title:".title",icon:".icon",content:".content"},speed:500,easing:"easeInOutQuint"}}(jQuery,window,document); !function(a,b,c,d){a.fn.accordion=function(b){var c,e=a(this),f=a.isPlainObject(b)?a.extend(!0,{},a.fn.accordion.settings,b):a.fn.accordion.settings,g=("."+f.namespace,"module-"+f.namespace,e.selector||""),h=(new Date).getTime(),i=[],j=arguments[0],k="string"==typeof j,l=[].slice.call(arguments,1);return e.each(function(){var b,e=a(this),m=e.find(f.selector.title),n=(e.find(f.selector.icon),e.find(f.selector.content)),o=(e.selector||"",this),p=e.data("module-"+f.namespace),q=f.className,r=(f.metadata,f.namespace),s=(f.animation,f.errors);b={initialize:function(){b.debug("Initializing accordion with bound events",e),m.on("click",b.event.click),e.data("module",b)},destroy:function(){b.debug("Destroying previous accordion for",e),e.off(r)},event:{click:function(){var c=a(this),d=m.index(c),e=c.hasClass(q.active);b.verbose("Accordion title clicked",c),e?f.collapsible?b.close(d):b.debug("Cannot close accordion content collapsing is disabled"):b.open(d)}},open:function(c){var d=m.eq(c),e=d.next(n),g=m.filter("."+q.active),h=g.next(m),i=g.size()>0;e.is(":animated")||(b.debug("Opening accordion content",d),f.exclusive&&i&&(g.removeClass(q.active),h.stop().children().animate({opacity:0},f.speed).end().slideUp(f.speed,f.easing,function(){h.removeClass(q.active).removeAttr("style").children().removeAttr("style")})),d.addClass(q.active),e.stop().children().removeAttr("style").end().slideDown(f.speed,f.easing,function(){e.addClass(q.active).removeAttr("style"),a.proxy(f.onOpen,e)(),a.proxy(f.onChange,e)()}))},close:function(c){var d=m.eq(c),e=d.next(n);b.debug("Closing accordion content",d),d.removeClass(q.active),e.removeClass(q.active).show().stop().children().animate({opacity:0},f.speed).end().slideUp(f.speed,f.easing,function(){e.removeAttr("style"),a.proxy(f.onClose,e)(),a.proxy(f.onChange,e)()})},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?f[c]:(a.isPlainObject(c)?a.extend(!0,f,c):f[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):b.debug=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):b.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},error:function(){b.error=Function.prototype.bind.call(console.log,console,f.moduleName+":")},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=h||c,d=c-e,h=c,i.push({Element:o,Name:a[0],Arguments:a[1]||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var b=f.moduleName+":",c=0;h=!1,a.each(i,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),(console.group!==d||console.table!==d)&&i.length>0&&(console.groupCollapsed(b),console.table?console.table(i):a.each(i,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),i=[]}},invoke:function(c,e,f){var g,h;return e=e||l,f=o||f,"string"==typeof c&&p!==d&&(c=c.split("."),g=c.length-1,a.each(c,function(c,e){return a.isPlainObject(p[e])&&c!=g?(p=p[e],!0):p[e]!==d?(h=p[e],!0):(b.error(s.method),!1)})),a.isFunction(h)?(p.verbose("Executing invoked function",h),h.apply(f,e)):h||!1}},k?(p===d&&b.initialize(),c=b.invoke(j)):(p!==d&&b.destroy(),b.initialize())}),c?c:this},a.fn.accordion.settings={moduleName:"Accordion",debug:!0,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,onOpen:function(){},onClose:function(){},onChange:function(){},errors:{method:"The method you called is not defined"},className:{active:"active",hover:"hover"},selector:{title:".title",icon:".icon",content:".content"},speed:500,easing:"easeInOutQuint"}}(jQuery,window,document);

74
build/minified/modules/shape.js

@ -40,7 +40,6 @@ $.fn.shape = function(parameters) {
// private variables // private variables
$activeSide, $activeSide,
$nextSide, $nextSide,
transitionEnd = 'msTransitionEnd oTransitionEnd webkitTransitionEnd',
// standard module // standard module
element = this, element = this,
@ -112,7 +111,7 @@ $.fn.shape = function(parameters) {
; ;
$sides $sides
.css(propertyObject) .css(propertyObject)
.one(transitionEnd + eventNamespace, callback) .one(module.get.transitionEvent(), callback)
; ;
} }
else { else {
@ -138,9 +137,11 @@ $.fn.shape = function(parameters) {
queue: function(method) { queue: function(method) {
module.debug('Queueing animation of', method); module.debug('Queueing animation of', method);
$sides $sides
.one(transitionEnd, function() { .one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation'); module.debug('Executing queued animation');
$module.shape(method); setTimeout(function(){
$module.shape(method);
}, 0);
}) })
; ;
}, },
@ -175,6 +176,24 @@ $.fn.shape = function(parameters) {
get: { get: {
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() { nextSide: function() {
return ( $activeSide.next(settings.selector.side).size() > 0 ) return ( $activeSide.next(settings.selector.side).size() > 0 )
? $activeSide.next(settings.selector.side) ? $activeSide.next(settings.selector.side)
@ -501,14 +520,25 @@ $.fn.shape = function(parameters) {
return settings[name]; return settings[name];
} }
}, },
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) { internal: function(name, value) {
if(value !== undefined) { if(value !== undefined) {
if( $.isPlainObject(name) ) { if( $.isPlainObject(name) ) {
module.verbose('Modifying internal property', name, value);
$.extend(true, module, name); $.extend(true, module, name);
} }
else { else {
module.verbose('Changing internal method to', value);
module[name] = value; module[name] = value;
} }
} }
@ -537,7 +567,7 @@ $.fn.shape = function(parameters) {
} }
}, },
error: function() { error: function() {
module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':');
}, },
performance: { performance: {
log: function(message) { log: function(message) {
@ -551,44 +581,42 @@ $.fn.shape = function(parameters) {
previousTime = time || currentTime, previousTime = time || currentTime,
executionTime = currentTime - previousTime; executionTime = currentTime - previousTime;
time = currentTime; time = currentTime;
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || 'None', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
} }
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
}, },
display: function() { display: function() {
var var
title = settings.moduleName, title = settings.moduleName + ':',
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', totalTime = 0
totalExecutionTime = 0
; ;
time = false;
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) { if(moduleSelector) {
title += ' Performance (' + moduleSelector + ')'; title += ' \'' + moduleSelector + '\'';
} }
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title); console.groupCollapsed(title);
if(console.table) { if(console.table) {
$.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
});
console.table(performance); console.table(performance);
} }
else { else {
$.each(performance, function(index, data) { $.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
}); });
} }
console.log('Total Execution Time:', totalExecutionTime +'ms');
console.groupEnd(); console.groupEnd();
performance = [];
time = false;
} }
performance = [];
} }
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {

2
build/minified/modules/shape.min.js

File diff suppressed because one or more lines are too long

109
build/minified/modules/tab.js

@ -16,8 +16,8 @@
$module = $(this), $module = $(this),
$tabs = $(settings.context).find(settings.selector.tabs), $tabs = $(settings.context).find(settings.selector.tabs),
firstLoad = true,
cache = {}, cache = {},
firstLoad = true,
recursionDepth = 0, recursionDepth = 0,
activeTabPath, activeTabPath,
@ -62,6 +62,12 @@
return false; return false;
} }
else { else {
if(!settings.apiSettings) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
};
}
module.verbose('Address library found adding state change event'); module.verbose('Address library found adding state change event');
$.address $.address
.state(settings.path) .state(settings.path)
@ -70,7 +76,7 @@
} }
} }
// attach events if navigation wasn't set to window // attach events if navigation wasn't set to window
if( !$.isWindow( $module.get(0) ) ) { if( !$.isWindow( element ) ) {
$module $module
.on('click.' + eventNamespace, module.event.click) .on('click.' + eventNamespace, module.event.click)
; ;
@ -133,21 +139,22 @@
}, },
cache: { cache: {
read: function(tabPath) {
return (tabPath !== undefined) read: function(cacheKey) {
? cache[tabPath] return (cacheKey !== undefined)
: cache ? cache[cacheKey]
: false
; ;
}, },
add: function(tabPath, content) { add: function(cacheKey, content) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Adding cached content for', tabPath); module.debug('Adding cached content for', cacheKey);
cache[tabPath] = content; cache[cacheKey] = content;
}, },
remove: function(tabPath) { remove: function(cacheKey) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Removing cached content for', tabPath); module.debug('Removing cached content for', cacheKey);
delete cache[tabPath]; delete cache[cacheKey];
} }
}, },
@ -160,61 +167,75 @@
var var
currentPathArray = pathArray.slice(0, index + 1), currentPathArray = pathArray.slice(0, index + 1),
currentPath = module.utils.arrayToPath(currentPathArray), currentPath = module.utils.arrayToPath(currentPathArray),
isLastTab = (module.utils.last(pathArray) == currentPath),
isTab = module.is.tab(currentPath), isTab = module.is.tab(currentPath),
isParam = !(isTab), isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState), pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad), shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings), remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath) $tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
isLastTab
; ;
module.verbose('Looking for tab', tab); module.verbose('Looking for tab', tab);
if(isParam) { if(isTab) {
module.verbose('Tab is not found, assuming it is a parameter', tab);
return true;
}
else if(isTab) {
// scope up
module.verbose('Tab was found', tab); module.verbose('Tab was found', tab);
// scope up
activeTabPath = currentPath; activeTabPath = currentPath;
parameterArray = module.utils.filterArray(pathArray, currentPathArray); parameterArray = module.utils.filterArray(pathArray, currentPathArray);
if(isLastIndex) {
isLastTab = true;
}
else {
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
module.verbose('Tab parameters found', nextPathArray);
}
if(isLastTab && remoteContent) { if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) { if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath); module.activate.navigation(currentPath);
module.content.fetch(currentPath, settings.onTabLoad); module.content.fetch(currentPath, tabPath);
} }
else { else {
module.debug('Ignoring remote content on first tab load', currentPath); module.debug('Ignoring remote content on first tab load', currentPath);
firstLoad = false; firstLoad = false;
cache[tabPath] = $tab.html(); module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
} }
} }
else { else {
module.debug('Opened tab', currentPath); module.debug('Opened local tab', currentPath);
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
} }
return false;
}
else {
module.error(errors.missingTab, tab);
return false;
} }
}); });
}, },
content: { content: {
fetch: function(tabPath) { fetch: function(tabPath, fullTabPath) {
var var
$tab = module.get.tabElement(tabPath), $tab = module.get.tabElement(tabPath),
cachedContent = cache[tabPath] || false, fullTabPath = fullTabPath || tabPath,
cachedContent = module.cache.read(fullTabPath),
apiSettings = { apiSettings = {
dataType : 'html', dataType : 'html',
stateContext : $tab, stateContext : $tab,
success : function(response) { success : function(response) {
cache[tabPath] = response; module.cache.add(fullTabPath, response);
module.content.update(tabPath, response); module.content.update(tabPath, response);
if(tabPath == activeTabPath) { if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath); module.debug('Content loaded', tabPath);
@ -225,26 +246,26 @@
} }
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
}, },
urlData: { tab: tabPath } urlData: { tab: fullTabPath }
}, },
request = $tab.data(metadata.promise) || false, request = $tab.data(metadata.promise) || false,
existingRequest = ( request && request.state() === 'pending' ) existingRequest = ( request && request.state() === 'pending' )
; ;
if(settings.cache && cachedContent) { if(settings.cache && cachedContent) {
module.debug('Showing existing content', tabPath); module.debug('Showing existing content', fullTabPath);
// module.content.update(tabPath, cachedContent); module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath); module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
} }
else if(existingRequest) { else if(existingRequest) {
module.debug('Content is already loading', tabPath); module.debug('Content is already loading', fullTabPath);
$tab $tab
.addClass(className.loading) .addClass(className.loading)
; ;
} }
else if($.api !== undefined) { else if($.api !== undefined) {
module.debug('Retrieving content', tabPath); module.debug('Retrieving remote content', fullTabPath);
$.api( $.extend(true, {}, settings.apiSettings, apiSettings) ); $.api( $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings) );
} }
else { else {
module.error(errors.api); module.error(errors.api);
@ -302,7 +323,10 @@
is: { is: {
tab: function(tabName) { tab: function(tabName) {
return ( module.get.tabElement(tabName).size() > 0 ); return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
: false
;
} }
}, },
@ -310,6 +334,9 @@
initialPath: function() { initialPath: function() {
return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab); return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
}, },
path: function() {
return $.address.value();
},
// adds default tabs to tab path // adds default tabs to tab path
defaultPathArray: function(tabPath) { defaultPathArray: function(tabPath) {
return module.utils.pathToArray( module.get.defaultPath(tabPath) ); return module.utils.pathToArray( module.get.defaultPath(tabPath) );
@ -449,7 +476,7 @@
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || '', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
} }
@ -577,7 +604,7 @@
noContent : 'The tab you specified is missing a content url.', noContent : 'The tab you specified is missing a content url.',
method : 'The method you called is not defined', method : 'The method you called is not defined',
state : 'The state library has not been initialized', state : 'The state library has not been initialized',
missingTab : 'Missing tab: ', missingTab : 'Tab cannot be found',
path : 'History enabled, but no path was specified', path : 'History enabled, but no path was specified',
recursion : 'Max recursive depth reached' recursion : 'Max recursive depth reached'
}, },

2
build/minified/modules/tab.min.css

@ -1 +1 @@
.ui.tab{display:none}.ui.tab.active,.ui.tab.open{display:block}.ui.tab.simple{background-color:transparent;border:0}.ui.tab.loading{position:relative;overflow:hidden;display:block;min-height:250px;text-indent:-9999px}.ui.tab.loading:after{position:absolute;top:50px;left:50%;content:'Loading...';margin-left:-32px;text-indent:5px;color:rgba(0,0,0,.4);width:100%;height:100%;padding-top:75px;background:url(../images/loader-large.gif) no-repeat 0 0;visibility:visible} .ui.tab{display:none}.ui.tab.active,.ui.tab.open{display:block}.ui.tab.loading{position:relative;overflow:hidden;display:block;min-height:250px;text-indent:-10000px}.ui.tab.loading *{position:relative!important;left:-10000px!important}.ui.tab.loading:after{position:absolute;top:50px;left:50%;content:'Loading...';margin-left:-32px;text-indent:5px;color:rgba(0,0,0,.4);width:100%;height:100%;padding-top:75px;background:url(../images/loader-large.gif) no-repeat 0 0;visibility:visible}

2
build/minified/modules/tab.min.js

File diff suppressed because one or more lines are too long

2
build/packaged/modules/accordion.js

@ -329,7 +329,7 @@ $.fn.accordion.settings = {
debug : true, debug : true,
verbose : true, verbose : true,
performance : false, performance : true,
exclusive : true, exclusive : true,
collapsible : true, collapsible : true,

74
build/packaged/modules/shape.js

@ -40,7 +40,6 @@ $.fn.shape = function(parameters) {
// private variables // private variables
$activeSide, $activeSide,
$nextSide, $nextSide,
transitionEnd = 'msTransitionEnd oTransitionEnd webkitTransitionEnd',
// standard module // standard module
element = this, element = this,
@ -112,7 +111,7 @@ $.fn.shape = function(parameters) {
; ;
$sides $sides
.css(propertyObject) .css(propertyObject)
.one(transitionEnd + eventNamespace, callback) .one(module.get.transitionEvent(), callback)
; ;
} }
else { else {
@ -138,9 +137,11 @@ $.fn.shape = function(parameters) {
queue: function(method) { queue: function(method) {
module.debug('Queueing animation of', method); module.debug('Queueing animation of', method);
$sides $sides
.one(transitionEnd, function() { .one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation'); module.debug('Executing queued animation');
$module.shape(method); setTimeout(function(){
$module.shape(method);
}, 0);
}) })
; ;
}, },
@ -175,6 +176,24 @@ $.fn.shape = function(parameters) {
get: { get: {
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() { nextSide: function() {
return ( $activeSide.next(settings.selector.side).size() > 0 ) return ( $activeSide.next(settings.selector.side).size() > 0 )
? $activeSide.next(settings.selector.side) ? $activeSide.next(settings.selector.side)
@ -501,14 +520,25 @@ $.fn.shape = function(parameters) {
return settings[name]; return settings[name];
} }
}, },
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) { internal: function(name, value) {
if(value !== undefined) { if(value !== undefined) {
if( $.isPlainObject(name) ) { if( $.isPlainObject(name) ) {
module.verbose('Modifying internal property', name, value);
$.extend(true, module, name); $.extend(true, module, name);
} }
else { else {
module.verbose('Changing internal method to', value);
module[name] = value; module[name] = value;
} }
} }
@ -537,7 +567,7 @@ $.fn.shape = function(parameters) {
} }
}, },
error: function() { error: function() {
module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':');
}, },
performance: { performance: {
log: function(message) { log: function(message) {
@ -551,44 +581,42 @@ $.fn.shape = function(parameters) {
previousTime = time || currentTime, previousTime = time || currentTime,
executionTime = currentTime - previousTime; executionTime = currentTime - previousTime;
time = currentTime; time = currentTime;
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || 'None', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
} }
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
}, },
display: function() { display: function() {
var var
title = settings.moduleName, title = settings.moduleName + ':',
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', totalTime = 0
totalExecutionTime = 0
; ;
time = false;
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) { if(moduleSelector) {
title += ' Performance (' + moduleSelector + ')'; title += ' \'' + moduleSelector + '\'';
} }
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title); console.groupCollapsed(title);
if(console.table) { if(console.table) {
$.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
});
console.table(performance); console.table(performance);
} }
else { else {
$.each(performance, function(index, data) { $.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
}); });
} }
console.log('Total Execution Time:', totalExecutionTime +'ms');
console.groupEnd(); console.groupEnd();
performance = [];
time = false;
} }
performance = [];
} }
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {

109
build/packaged/modules/tab.js

@ -16,8 +16,8 @@
$module = $(this), $module = $(this),
$tabs = $(settings.context).find(settings.selector.tabs), $tabs = $(settings.context).find(settings.selector.tabs),
firstLoad = true,
cache = {}, cache = {},
firstLoad = true,
recursionDepth = 0, recursionDepth = 0,
activeTabPath, activeTabPath,
@ -62,6 +62,12 @@
return false; return false;
} }
else { else {
if(!settings.apiSettings) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
};
}
module.verbose('Address library found adding state change event'); module.verbose('Address library found adding state change event');
$.address $.address
.state(settings.path) .state(settings.path)
@ -70,7 +76,7 @@
} }
} }
// attach events if navigation wasn't set to window // attach events if navigation wasn't set to window
if( !$.isWindow( $module.get(0) ) ) { if( !$.isWindow( element ) ) {
$module $module
.on('click.' + eventNamespace, module.event.click) .on('click.' + eventNamespace, module.event.click)
; ;
@ -133,21 +139,22 @@
}, },
cache: { cache: {
read: function(tabPath) {
return (tabPath !== undefined) read: function(cacheKey) {
? cache[tabPath] return (cacheKey !== undefined)
: cache ? cache[cacheKey]
: false
; ;
}, },
add: function(tabPath, content) { add: function(cacheKey, content) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Adding cached content for', tabPath); module.debug('Adding cached content for', cacheKey);
cache[tabPath] = content; cache[cacheKey] = content;
}, },
remove: function(tabPath) { remove: function(cacheKey) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Removing cached content for', tabPath); module.debug('Removing cached content for', cacheKey);
delete cache[tabPath]; delete cache[cacheKey];
} }
}, },
@ -160,61 +167,75 @@
var var
currentPathArray = pathArray.slice(0, index + 1), currentPathArray = pathArray.slice(0, index + 1),
currentPath = module.utils.arrayToPath(currentPathArray), currentPath = module.utils.arrayToPath(currentPathArray),
isLastTab = (module.utils.last(pathArray) == currentPath),
isTab = module.is.tab(currentPath), isTab = module.is.tab(currentPath),
isParam = !(isTab), isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState), pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad), shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings), remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath) $tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
isLastTab
; ;
module.verbose('Looking for tab', tab); module.verbose('Looking for tab', tab);
if(isParam) { if(isTab) {
module.verbose('Tab is not found, assuming it is a parameter', tab);
return true;
}
else if(isTab) {
// scope up
module.verbose('Tab was found', tab); module.verbose('Tab was found', tab);
// scope up
activeTabPath = currentPath; activeTabPath = currentPath;
parameterArray = module.utils.filterArray(pathArray, currentPathArray); parameterArray = module.utils.filterArray(pathArray, currentPathArray);
if(isLastIndex) {
isLastTab = true;
}
else {
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
module.verbose('Tab parameters found', nextPathArray);
}
if(isLastTab && remoteContent) { if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) { if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath); module.activate.navigation(currentPath);
module.content.fetch(currentPath, settings.onTabLoad); module.content.fetch(currentPath, tabPath);
} }
else { else {
module.debug('Ignoring remote content on first tab load', currentPath); module.debug('Ignoring remote content on first tab load', currentPath);
firstLoad = false; firstLoad = false;
cache[tabPath] = $tab.html(); module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
} }
} }
else { else {
module.debug('Opened tab', currentPath); module.debug('Opened local tab', currentPath);
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
} }
return false;
}
else {
module.error(errors.missingTab, tab);
return false;
} }
}); });
}, },
content: { content: {
fetch: function(tabPath) { fetch: function(tabPath, fullTabPath) {
var var
$tab = module.get.tabElement(tabPath), $tab = module.get.tabElement(tabPath),
cachedContent = cache[tabPath] || false, fullTabPath = fullTabPath || tabPath,
cachedContent = module.cache.read(fullTabPath),
apiSettings = { apiSettings = {
dataType : 'html', dataType : 'html',
stateContext : $tab, stateContext : $tab,
success : function(response) { success : function(response) {
cache[tabPath] = response; module.cache.add(fullTabPath, response);
module.content.update(tabPath, response); module.content.update(tabPath, response);
if(tabPath == activeTabPath) { if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath); module.debug('Content loaded', tabPath);
@ -225,26 +246,26 @@
} }
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
}, },
urlData: { tab: tabPath } urlData: { tab: fullTabPath }
}, },
request = $tab.data(metadata.promise) || false, request = $tab.data(metadata.promise) || false,
existingRequest = ( request && request.state() === 'pending' ) existingRequest = ( request && request.state() === 'pending' )
; ;
if(settings.cache && cachedContent) { if(settings.cache && cachedContent) {
module.debug('Showing existing content', tabPath); module.debug('Showing existing content', fullTabPath);
// module.content.update(tabPath, cachedContent); module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath); module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
} }
else if(existingRequest) { else if(existingRequest) {
module.debug('Content is already loading', tabPath); module.debug('Content is already loading', fullTabPath);
$tab $tab
.addClass(className.loading) .addClass(className.loading)
; ;
} }
else if($.api !== undefined) { else if($.api !== undefined) {
module.debug('Retrieving content', tabPath); module.debug('Retrieving remote content', fullTabPath);
$.api( $.extend(true, {}, settings.apiSettings, apiSettings) ); $.api( $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings) );
} }
else { else {
module.error(errors.api); module.error(errors.api);
@ -302,7 +323,10 @@
is: { is: {
tab: function(tabName) { tab: function(tabName) {
return ( module.get.tabElement(tabName).size() > 0 ); return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
: false
;
} }
}, },
@ -310,6 +334,9 @@
initialPath: function() { initialPath: function() {
return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab); return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
}, },
path: function() {
return $.address.value();
},
// adds default tabs to tab path // adds default tabs to tab path
defaultPathArray: function(tabPath) { defaultPathArray: function(tabPath) {
return module.utils.pathToArray( module.get.defaultPath(tabPath) ); return module.utils.pathToArray( module.get.defaultPath(tabPath) );
@ -449,7 +476,7 @@
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || '', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
} }
@ -577,7 +604,7 @@
noContent : 'The tab you specified is missing a content url.', noContent : 'The tab you specified is missing a content url.',
method : 'The method you called is not defined', method : 'The method you called is not defined',
state : 'The state library has not been initialized', state : 'The state library has not been initialized',
missingTab : 'Missing tab: ', missingTab : 'Tab cannot be found',
path : 'History enabled, but no path was specified', path : 'History enabled, but no path was specified',
recursion : 'Max recursive depth reached' recursion : 'Max recursive depth reached'
}, },

2
build/packaged/semantic.min.css.REMOVED.git-id

@ -1 +1 @@
0e7e71cc0f359032a27e430bc6b2528f60297a3a 359f25c642789e5c6cb0787aa48fbe7faf94687c

2
build/packaged/semantic.min.js.REMOVED.git-id

@ -1 +1 @@
90bbc11aa0dcba1f4d6d3ed26f2c5abd44e0d938 c61968fec0531359a6ac8e706842ef6817cbeba9

4
build/uncompressed/collections/message.css

@ -143,6 +143,10 @@
/*-------------- /*--------------
Icon Icon
---------------*/ ---------------*/
.ui.icon.message {
display: table;
width: 100%;
}
.ui.icon.message > .icon { .ui.icon.message > .icon {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;

264
build/uncompressed/elements/button.css

@ -119,138 +119,6 @@
-moz-box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset; box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset;
} }
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*------------------- /*-------------------
Disabled Disabled
--------------------*/ --------------------*/
@ -959,3 +827,135 @@
-webkit-border-radius: 0px 0px 0.3125em 0.3125em; -webkit-border-radius: 0px 0px 0.3125em 0.3125em;
border-radius: 0px 0px 0.3125em 0.3125em; border-radius: 0px 0px 0.3125em 0.3125em;
} }
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
}

2
build/uncompressed/elements/icons.css

@ -647,7 +647,7 @@ i.link.icon {
transition: opacity 0.3s ease-out; transition: opacity 0.3s ease-out;
} }
.link.icon:hover { .link.icon:hover {
opacity: 1; opacity: 1 !important;
} }
/*------------------- /*-------------------
Circular Circular

2
build/uncompressed/modules/accordion.js

@ -329,7 +329,7 @@ $.fn.accordion.settings = {
debug : true, debug : true,
verbose : true, verbose : true,
performance : false, performance : true,
exclusive : true, exclusive : true,
collapsible : true, collapsible : true,

32
build/uncompressed/modules/shape.css

@ -1,5 +1,16 @@
/*
* # Semantic Button
* http://github.com/quirkyinc/semantic
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: April 17 2013
*/
/******************************* /*******************************
Shape Shape
*******************************/ *******************************/
.ui.shape { .ui.shape {
position: relative; position: relative;
@ -22,14 +33,15 @@
-ms-backface-visibility: hidden; -ms-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
} }
/*---------------
States
----------------*/
/* Standard */
.ui.shape .side { .ui.shape .side {
display: none; display: none;
} }
/* Animating */ /*******************************
States
*******************************/
/*--------------
Animating
---------------*/
.ui.shape.animating .sides { .ui.shape.animating .sides {
position: absolute; position: absolute;
} }
@ -43,7 +55,9 @@
.ui.shape .hidden.side { .ui.shape .hidden.side {
opacity: 0.7; opacity: 0.7;
} }
/* css animation */ /*--------------
CSS
---------------*/
.ui.shape.css { .ui.shape.css {
-webkit-transition: all 0.6s ease-in-out; -webkit-transition: all 0.6s ease-in-out;
-moz-transition: all 0.6s ease-in-out; -moz-transition: all 0.6s ease-in-out;
@ -65,7 +79,9 @@
-ms-transition: opacity 0.6s ease-in-out; -ms-transition: opacity 0.6s ease-in-out;
transition: opacity 0.6s ease-in-out; transition: opacity 0.6s ease-in-out;
} }
/* Active */ /*--------------
Active
---------------*/
.ui.shape .active.side { .ui.shape .active.side {
display: block; display: block;
} }

74
build/uncompressed/modules/shape.js

@ -40,7 +40,6 @@ $.fn.shape = function(parameters) {
// private variables // private variables
$activeSide, $activeSide,
$nextSide, $nextSide,
transitionEnd = 'msTransitionEnd oTransitionEnd webkitTransitionEnd',
// standard module // standard module
element = this, element = this,
@ -112,7 +111,7 @@ $.fn.shape = function(parameters) {
; ;
$sides $sides
.css(propertyObject) .css(propertyObject)
.one(transitionEnd + eventNamespace, callback) .one(module.get.transitionEvent(), callback)
; ;
} }
else { else {
@ -138,9 +137,11 @@ $.fn.shape = function(parameters) {
queue: function(method) { queue: function(method) {
module.debug('Queueing animation of', method); module.debug('Queueing animation of', method);
$sides $sides
.one(transitionEnd, function() { .one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation'); module.debug('Executing queued animation');
$module.shape(method); setTimeout(function(){
$module.shape(method);
}, 0);
}) })
; ;
}, },
@ -175,6 +176,24 @@ $.fn.shape = function(parameters) {
get: { get: {
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() { nextSide: function() {
return ( $activeSide.next(settings.selector.side).size() > 0 ) return ( $activeSide.next(settings.selector.side).size() > 0 )
? $activeSide.next(settings.selector.side) ? $activeSide.next(settings.selector.side)
@ -501,14 +520,25 @@ $.fn.shape = function(parameters) {
return settings[name]; return settings[name];
} }
}, },
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) { internal: function(name, value) {
if(value !== undefined) { if(value !== undefined) {
if( $.isPlainObject(name) ) { if( $.isPlainObject(name) ) {
module.verbose('Modifying internal property', name, value);
$.extend(true, module, name); $.extend(true, module, name);
} }
else { else {
module.verbose('Changing internal method to', value);
module[name] = value; module[name] = value;
} }
} }
@ -537,7 +567,7 @@ $.fn.shape = function(parameters) {
} }
}, },
error: function() { error: function() {
module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':');
}, },
performance: { performance: {
log: function(message) { log: function(message) {
@ -551,44 +581,42 @@ $.fn.shape = function(parameters) {
previousTime = time || currentTime, previousTime = time || currentTime,
executionTime = currentTime - previousTime; executionTime = currentTime - previousTime;
time = currentTime; time = currentTime;
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || 'None', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
} }
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
}, },
display: function() { display: function() {
var var
title = settings.moduleName, title = settings.moduleName + ':',
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', totalTime = 0
totalExecutionTime = 0
; ;
time = false;
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) { if(moduleSelector) {
title += ' Performance (' + moduleSelector + ')'; title += ' \'' + moduleSelector + '\'';
} }
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title); console.groupCollapsed(title);
if(console.table) { if(console.table) {
$.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
});
console.table(performance); console.table(performance);
} }
else { else {
$.each(performance, function(index, data) { $.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
}); });
} }
console.log('Total Execution Time:', totalExecutionTime +'ms');
console.groupEnd(); console.groupEnd();
performance = [];
time = false;
} }
performance = [];
} }
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {

27
build/uncompressed/modules/tab.css

@ -1,3 +1,14 @@
/*
* # Semantic Button
* http://github.com/quirkyinc/semantic
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: April 17 2013
*/
/******************************* /*******************************
UI Tabs UI Tabs
*******************************/ *******************************/
@ -8,20 +19,22 @@
.ui.tab.open { .ui.tab.open {
display: block; display: block;
} }
.ui.tab.simple { /*******************************
background-color: transparent; States
border: none; *******************************/
}
/*-------------------- /*--------------------
Loading State Loading
---------------------*/ ---------------------*/
/* On Form */
.ui.tab.loading { .ui.tab.loading {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
display: block; display: block;
min-height: 250px; min-height: 250px;
text-indent: -9999px; text-indent: -10000px;
}
.ui.tab.loading * {
position: relative !important;
left: -10000px !important;
} }
.ui.tab.loading:after { .ui.tab.loading:after {
position: absolute; position: absolute;

109
build/uncompressed/modules/tab.js

@ -16,8 +16,8 @@
$module = $(this), $module = $(this),
$tabs = $(settings.context).find(settings.selector.tabs), $tabs = $(settings.context).find(settings.selector.tabs),
firstLoad = true,
cache = {}, cache = {},
firstLoad = true,
recursionDepth = 0, recursionDepth = 0,
activeTabPath, activeTabPath,
@ -62,6 +62,12 @@
return false; return false;
} }
else { else {
if(!settings.apiSettings) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
};
}
module.verbose('Address library found adding state change event'); module.verbose('Address library found adding state change event');
$.address $.address
.state(settings.path) .state(settings.path)
@ -70,7 +76,7 @@
} }
} }
// attach events if navigation wasn't set to window // attach events if navigation wasn't set to window
if( !$.isWindow( $module.get(0) ) ) { if( !$.isWindow( element ) ) {
$module $module
.on('click.' + eventNamespace, module.event.click) .on('click.' + eventNamespace, module.event.click)
; ;
@ -133,21 +139,22 @@
}, },
cache: { cache: {
read: function(tabPath) {
return (tabPath !== undefined) read: function(cacheKey) {
? cache[tabPath] return (cacheKey !== undefined)
: cache ? cache[cacheKey]
: false
; ;
}, },
add: function(tabPath, content) { add: function(cacheKey, content) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Adding cached content for', tabPath); module.debug('Adding cached content for', cacheKey);
cache[tabPath] = content; cache[cacheKey] = content;
}, },
remove: function(tabPath) { remove: function(cacheKey) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Removing cached content for', tabPath); module.debug('Removing cached content for', cacheKey);
delete cache[tabPath]; delete cache[cacheKey];
} }
}, },
@ -160,61 +167,75 @@
var var
currentPathArray = pathArray.slice(0, index + 1), currentPathArray = pathArray.slice(0, index + 1),
currentPath = module.utils.arrayToPath(currentPathArray), currentPath = module.utils.arrayToPath(currentPathArray),
isLastTab = (module.utils.last(pathArray) == currentPath),
isTab = module.is.tab(currentPath), isTab = module.is.tab(currentPath),
isParam = !(isTab), isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState), pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad), shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings), remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath) $tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
isLastTab
; ;
module.verbose('Looking for tab', tab); module.verbose('Looking for tab', tab);
if(isParam) { if(isTab) {
module.verbose('Tab is not found, assuming it is a parameter', tab);
return true;
}
else if(isTab) {
// scope up
module.verbose('Tab was found', tab); module.verbose('Tab was found', tab);
// scope up
activeTabPath = currentPath; activeTabPath = currentPath;
parameterArray = module.utils.filterArray(pathArray, currentPathArray); parameterArray = module.utils.filterArray(pathArray, currentPathArray);
if(isLastIndex) {
isLastTab = true;
}
else {
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
module.verbose('Tab parameters found', nextPathArray);
}
if(isLastTab && remoteContent) { if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) { if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath); module.activate.navigation(currentPath);
module.content.fetch(currentPath, settings.onTabLoad); module.content.fetch(currentPath, tabPath);
} }
else { else {
module.debug('Ignoring remote content on first tab load', currentPath); module.debug('Ignoring remote content on first tab load', currentPath);
firstLoad = false; firstLoad = false;
cache[tabPath] = $tab.html(); module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
} }
} }
else { else {
module.debug('Opened tab', currentPath); module.debug('Opened local tab', currentPath);
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
} }
return false;
}
else {
module.error(errors.missingTab, tab);
return false;
} }
}); });
}, },
content: { content: {
fetch: function(tabPath) { fetch: function(tabPath, fullTabPath) {
var var
$tab = module.get.tabElement(tabPath), $tab = module.get.tabElement(tabPath),
cachedContent = cache[tabPath] || false, fullTabPath = fullTabPath || tabPath,
cachedContent = module.cache.read(fullTabPath),
apiSettings = { apiSettings = {
dataType : 'html', dataType : 'html',
stateContext : $tab, stateContext : $tab,
success : function(response) { success : function(response) {
cache[tabPath] = response; module.cache.add(fullTabPath, response);
module.content.update(tabPath, response); module.content.update(tabPath, response);
if(tabPath == activeTabPath) { if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath); module.debug('Content loaded', tabPath);
@ -225,26 +246,26 @@
} }
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
}, },
urlData: { tab: tabPath } urlData: { tab: fullTabPath }
}, },
request = $tab.data(metadata.promise) || false, request = $tab.data(metadata.promise) || false,
existingRequest = ( request && request.state() === 'pending' ) existingRequest = ( request && request.state() === 'pending' )
; ;
if(settings.cache && cachedContent) { if(settings.cache && cachedContent) {
module.debug('Showing existing content', tabPath); module.debug('Showing existing content', fullTabPath);
// module.content.update(tabPath, cachedContent); module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath); module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
} }
else if(existingRequest) { else if(existingRequest) {
module.debug('Content is already loading', tabPath); module.debug('Content is already loading', fullTabPath);
$tab $tab
.addClass(className.loading) .addClass(className.loading)
; ;
} }
else if($.api !== undefined) { else if($.api !== undefined) {
module.debug('Retrieving content', tabPath); module.debug('Retrieving remote content', fullTabPath);
$.api( $.extend(true, {}, settings.apiSettings, apiSettings) ); $.api( $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings) );
} }
else { else {
module.error(errors.api); module.error(errors.api);
@ -302,7 +323,10 @@
is: { is: {
tab: function(tabName) { tab: function(tabName) {
return ( module.get.tabElement(tabName).size() > 0 ); return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
: false
;
} }
}, },
@ -310,6 +334,9 @@
initialPath: function() { initialPath: function() {
return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab); return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
}, },
path: function() {
return $.address.value();
},
// adds default tabs to tab path // adds default tabs to tab path
defaultPathArray: function(tabPath) { defaultPathArray: function(tabPath) {
return module.utils.pathToArray( module.get.defaultPath(tabPath) ); return module.utils.pathToArray( module.get.defaultPath(tabPath) );
@ -449,7 +476,7 @@
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || '', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
} }
@ -577,7 +604,7 @@
noContent : 'The tab you specified is missing a content url.', noContent : 'The tab you specified is missing a content url.',
method : 'The method you called is not defined', method : 'The method you called is not defined',
state : 'The state library has not been initialized', state : 'The state library has not been initialized',
missingTab : 'Missing tab: ', missingTab : 'Tab cannot be found',
path : 'History enabled, but no path was specified', path : 'History enabled, but no path was specified',
recursion : 'Max recursive depth reached' recursion : 'Max recursive depth reached'
}, },

4
node/src/files/components/semantic/collections/message.css

@ -143,6 +143,10 @@
/*-------------- /*--------------
Icon Icon
---------------*/ ---------------*/
.ui.icon.message {
display: table;
width: 100%;
}
.ui.icon.message > .icon { .ui.icon.message > .icon {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;

264
node/src/files/components/semantic/elements/button.css

@ -119,138 +119,6 @@
-moz-box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset; box-shadow: 0em 0em 0.125em 1px rgba(0, 0, 0, 0.1) inset;
} }
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*------------------- /*-------------------
Disabled Disabled
--------------------*/ --------------------*/
@ -959,3 +827,135 @@
-webkit-border-radius: 0px 0px 0.3125em 0.3125em; -webkit-border-radius: 0px 0px 0.3125em 0.3125em;
border-radius: 0px 0px 0.3125em 0.3125em; border-radius: 0px 0px 0.3125em 0.3125em;
} }
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
}

2
node/src/files/components/semantic/elements/icons.css

@ -647,7 +647,7 @@ i.link.icon {
transition: opacity 0.3s ease-out; transition: opacity 0.3s ease-out;
} }
.link.icon:hover { .link.icon:hover {
opacity: 1; opacity: 1 !important;
} }
/*------------------- /*-------------------
Circular Circular

2
node/src/files/components/semantic/modules/accordion.js

@ -329,7 +329,7 @@ $.fn.accordion.settings = {
debug : true, debug : true,
verbose : true, verbose : true,
performance : false, performance : true,
exclusive : true, exclusive : true,
collapsible : true, collapsible : true,

32
node/src/files/components/semantic/modules/shape.css

@ -1,5 +1,16 @@
/*
* # Semantic Button
* http://github.com/quirkyinc/semantic
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: April 17 2013
*/
/******************************* /*******************************
Shape Shape
*******************************/ *******************************/
.ui.shape { .ui.shape {
position: relative; position: relative;
@ -22,14 +33,15 @@
-ms-backface-visibility: hidden; -ms-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
} }
/*---------------
States
----------------*/
/* Standard */
.ui.shape .side { .ui.shape .side {
display: none; display: none;
} }
/* Animating */ /*******************************
States
*******************************/
/*--------------
Animating
---------------*/
.ui.shape.animating .sides { .ui.shape.animating .sides {
position: absolute; position: absolute;
} }
@ -43,7 +55,9 @@
.ui.shape .hidden.side { .ui.shape .hidden.side {
opacity: 0.7; opacity: 0.7;
} }
/* css animation */ /*--------------
CSS
---------------*/
.ui.shape.css { .ui.shape.css {
-webkit-transition: all 0.6s ease-in-out; -webkit-transition: all 0.6s ease-in-out;
-moz-transition: all 0.6s ease-in-out; -moz-transition: all 0.6s ease-in-out;
@ -65,7 +79,9 @@
-ms-transition: opacity 0.6s ease-in-out; -ms-transition: opacity 0.6s ease-in-out;
transition: opacity 0.6s ease-in-out; transition: opacity 0.6s ease-in-out;
} }
/* Active */ /*--------------
Active
---------------*/
.ui.shape .active.side { .ui.shape .active.side {
display: block; display: block;
} }

74
node/src/files/components/semantic/modules/shape.js

@ -40,7 +40,6 @@ $.fn.shape = function(parameters) {
// private variables // private variables
$activeSide, $activeSide,
$nextSide, $nextSide,
transitionEnd = 'msTransitionEnd oTransitionEnd webkitTransitionEnd',
// standard module // standard module
element = this, element = this,
@ -112,7 +111,7 @@ $.fn.shape = function(parameters) {
; ;
$sides $sides
.css(propertyObject) .css(propertyObject)
.one(transitionEnd + eventNamespace, callback) .one(module.get.transitionEvent(), callback)
; ;
} }
else { else {
@ -138,9 +137,11 @@ $.fn.shape = function(parameters) {
queue: function(method) { queue: function(method) {
module.debug('Queueing animation of', method); module.debug('Queueing animation of', method);
$sides $sides
.one(transitionEnd, function() { .one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation'); module.debug('Executing queued animation');
$module.shape(method); setTimeout(function(){
$module.shape(method);
}, 0);
}) })
; ;
}, },
@ -175,6 +176,24 @@ $.fn.shape = function(parameters) {
get: { get: {
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() { nextSide: function() {
return ( $activeSide.next(settings.selector.side).size() > 0 ) return ( $activeSide.next(settings.selector.side).size() > 0 )
? $activeSide.next(settings.selector.side) ? $activeSide.next(settings.selector.side)
@ -501,14 +520,25 @@ $.fn.shape = function(parameters) {
return settings[name]; return settings[name];
} }
}, },
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) { internal: function(name, value) {
if(value !== undefined) { if(value !== undefined) {
if( $.isPlainObject(name) ) { if( $.isPlainObject(name) ) {
module.verbose('Modifying internal property', name, value);
$.extend(true, module, name); $.extend(true, module, name);
} }
else { else {
module.verbose('Changing internal method to', value);
module[name] = value; module[name] = value;
} }
} }
@ -537,7 +567,7 @@ $.fn.shape = function(parameters) {
} }
}, },
error: function() { error: function() {
module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':');
}, },
performance: { performance: {
log: function(message) { log: function(message) {
@ -551,44 +581,42 @@ $.fn.shape = function(parameters) {
previousTime = time || currentTime, previousTime = time || currentTime,
executionTime = currentTime - previousTime; executionTime = currentTime - previousTime;
time = currentTime; time = currentTime;
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || 'None', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
} }
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
}, },
display: function() { display: function() {
var var
title = settings.moduleName, title = settings.moduleName + ':',
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', totalTime = 0
totalExecutionTime = 0
; ;
time = false;
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) { if(moduleSelector) {
title += ' Performance (' + moduleSelector + ')'; title += ' \'' + moduleSelector + '\'';
} }
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title); console.groupCollapsed(title);
if(console.table) { if(console.table) {
$.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
});
console.table(performance); console.table(performance);
} }
else { else {
$.each(performance, function(index, data) { $.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
}); });
} }
console.log('Total Execution Time:', totalExecutionTime +'ms');
console.groupEnd(); console.groupEnd();
performance = [];
time = false;
} }
performance = [];
} }
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {

27
node/src/files/components/semantic/modules/tab.css

@ -1,3 +1,14 @@
/*
* # Semantic Button
* http://github.com/quirkyinc/semantic
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: April 17 2013
*/
/******************************* /*******************************
UI Tabs UI Tabs
*******************************/ *******************************/
@ -8,20 +19,22 @@
.ui.tab.open { .ui.tab.open {
display: block; display: block;
} }
.ui.tab.simple { /*******************************
background-color: transparent; States
border: none; *******************************/
}
/*-------------------- /*--------------------
Loading State Loading
---------------------*/ ---------------------*/
/* On Form */
.ui.tab.loading { .ui.tab.loading {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
display: block; display: block;
min-height: 250px; min-height: 250px;
text-indent: -9999px; text-indent: -10000px;
}
.ui.tab.loading * {
position: relative !important;
left: -10000px !important;
} }
.ui.tab.loading:after { .ui.tab.loading:after {
position: absolute; position: absolute;

109
node/src/files/components/semantic/modules/tab.js

@ -16,8 +16,8 @@
$module = $(this), $module = $(this),
$tabs = $(settings.context).find(settings.selector.tabs), $tabs = $(settings.context).find(settings.selector.tabs),
firstLoad = true,
cache = {}, cache = {},
firstLoad = true,
recursionDepth = 0, recursionDepth = 0,
activeTabPath, activeTabPath,
@ -62,6 +62,12 @@
return false; return false;
} }
else { else {
if(!settings.apiSettings) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
};
}
module.verbose('Address library found adding state change event'); module.verbose('Address library found adding state change event');
$.address $.address
.state(settings.path) .state(settings.path)
@ -70,7 +76,7 @@
} }
} }
// attach events if navigation wasn't set to window // attach events if navigation wasn't set to window
if( !$.isWindow( $module.get(0) ) ) { if( !$.isWindow( element ) ) {
$module $module
.on('click.' + eventNamespace, module.event.click) .on('click.' + eventNamespace, module.event.click)
; ;
@ -133,21 +139,22 @@
}, },
cache: { cache: {
read: function(tabPath) {
return (tabPath !== undefined) read: function(cacheKey) {
? cache[tabPath] return (cacheKey !== undefined)
: cache ? cache[cacheKey]
: false
; ;
}, },
add: function(tabPath, content) { add: function(cacheKey, content) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Adding cached content for', tabPath); module.debug('Adding cached content for', cacheKey);
cache[tabPath] = content; cache[cacheKey] = content;
}, },
remove: function(tabPath) { remove: function(cacheKey) {
tabPath = tabPath || activeTabPath; cacheKey = cacheKey || activeTabPath;
module.debug('Removing cached content for', tabPath); module.debug('Removing cached content for', cacheKey);
delete cache[tabPath]; delete cache[cacheKey];
} }
}, },
@ -160,61 +167,75 @@
var var
currentPathArray = pathArray.slice(0, index + 1), currentPathArray = pathArray.slice(0, index + 1),
currentPath = module.utils.arrayToPath(currentPathArray), currentPath = module.utils.arrayToPath(currentPathArray),
isLastTab = (module.utils.last(pathArray) == currentPath),
isTab = module.is.tab(currentPath), isTab = module.is.tab(currentPath),
isParam = !(isTab), isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState), pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad), shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings), remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath) $tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
isLastTab
; ;
module.verbose('Looking for tab', tab); module.verbose('Looking for tab', tab);
if(isParam) { if(isTab) {
module.verbose('Tab is not found, assuming it is a parameter', tab);
return true;
}
else if(isTab) {
// scope up
module.verbose('Tab was found', tab); module.verbose('Tab was found', tab);
// scope up
activeTabPath = currentPath; activeTabPath = currentPath;
parameterArray = module.utils.filterArray(pathArray, currentPathArray); parameterArray = module.utils.filterArray(pathArray, currentPathArray);
if(isLastIndex) {
isLastTab = true;
}
else {
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
module.verbose('Tab parameters found', nextPathArray);
}
if(isLastTab && remoteContent) { if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) { if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath); module.activate.navigation(currentPath);
module.content.fetch(currentPath, settings.onTabLoad); module.content.fetch(currentPath, tabPath);
} }
else { else {
module.debug('Ignoring remote content on first tab load', currentPath); module.debug('Ignoring remote content on first tab load', currentPath);
firstLoad = false; firstLoad = false;
cache[tabPath] = $tab.html(); module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
} }
} }
else { else {
module.debug('Opened tab', currentPath); module.debug('Opened local tab', currentPath);
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent); $.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
} }
return false;
}
else {
module.error(errors.missingTab, tab);
return false;
} }
}); });
}, },
content: { content: {
fetch: function(tabPath) { fetch: function(tabPath, fullTabPath) {
var var
$tab = module.get.tabElement(tabPath), $tab = module.get.tabElement(tabPath),
cachedContent = cache[tabPath] || false, fullTabPath = fullTabPath || tabPath,
cachedContent = module.cache.read(fullTabPath),
apiSettings = { apiSettings = {
dataType : 'html', dataType : 'html',
stateContext : $tab, stateContext : $tab,
success : function(response) { success : function(response) {
cache[tabPath] = response; module.cache.add(fullTabPath, response);
module.content.update(tabPath, response); module.content.update(tabPath, response);
if(tabPath == activeTabPath) { if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath); module.debug('Content loaded', tabPath);
@ -225,26 +246,26 @@
} }
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
}, },
urlData: { tab: tabPath } urlData: { tab: fullTabPath }
}, },
request = $tab.data(metadata.promise) || false, request = $tab.data(metadata.promise) || false,
existingRequest = ( request && request.state() === 'pending' ) existingRequest = ( request && request.state() === 'pending' )
; ;
if(settings.cache && cachedContent) { if(settings.cache && cachedContent) {
module.debug('Showing existing content', tabPath); module.debug('Showing existing content', fullTabPath);
// module.content.update(tabPath, cachedContent); module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath); module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent); $.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
} }
else if(existingRequest) { else if(existingRequest) {
module.debug('Content is already loading', tabPath); module.debug('Content is already loading', fullTabPath);
$tab $tab
.addClass(className.loading) .addClass(className.loading)
; ;
} }
else if($.api !== undefined) { else if($.api !== undefined) {
module.debug('Retrieving content', tabPath); module.debug('Retrieving remote content', fullTabPath);
$.api( $.extend(true, {}, settings.apiSettings, apiSettings) ); $.api( $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings) );
} }
else { else {
module.error(errors.api); module.error(errors.api);
@ -302,7 +323,10 @@
is: { is: {
tab: function(tabName) { tab: function(tabName) {
return ( module.get.tabElement(tabName).size() > 0 ); return (tabName !== undefined)
? ( module.get.tabElement(tabName).size() > 0 )
: false
;
} }
}, },
@ -310,6 +334,9 @@
initialPath: function() { initialPath: function() {
return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab); return $module.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
}, },
path: function() {
return $.address.value();
},
// adds default tabs to tab path // adds default tabs to tab path
defaultPathArray: function(tabPath) { defaultPathArray: function(tabPath) {
return module.utils.pathToArray( module.get.defaultPath(tabPath) ); return module.utils.pathToArray( module.get.defaultPath(tabPath) );
@ -449,7 +476,7 @@
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || '', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
} }
@ -577,7 +604,7 @@
noContent : 'The tab you specified is missing a content url.', noContent : 'The tab you specified is missing a content url.',
method : 'The method you called is not defined', method : 'The method you called is not defined',
state : 'The state library has not been initialized', state : 'The state library has not been initialized',
missingTab : 'Missing tab: ', missingTab : 'Tab cannot be found',
path : 'History enabled, but no path was specified', path : 'History enabled, but no path was specified',
recursion : 'Max recursive depth reached' recursion : 'Max recursive depth reached'
}, },

6
node/src/files/overrides/views/card.css

@ -43,6 +43,7 @@
.ui.cards .card .dimmer, .ui.cards .card .dimmer,
.ui.card .dimmer { .ui.card .dimmer {
background-color: rgba(80, 80, 80, 0.6); background-color: rgba(80, 80, 80, 0.6);
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
-moz-border-radius: 4px; -moz-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
@ -60,11 +61,6 @@
font-size: 2em; font-size: 2em;
color: #FFFFFF; color: #FFFFFF;
} }
.ui.cards .card .dimmer .content,
.ui.card .dimmer .content {
}
.ui.cards .card .dimmer .buttons, .ui.cards .card .dimmer .buttons,
.ui.card .dimmer .buttons { .ui.card .dimmer .buttons {
display: inline-block; display: inline-block;

4
node/src/files/stylesheets/semantic.css

@ -331,11 +331,11 @@ a:hover {
width: auto !important; width: auto !important;
margin-right: 1em; margin-right: 1em;
} }
#example .masthead h1 { #example .masthead.segment h1 {
font-size: 5em; font-size: 5em;
color: #FFFFFF; color: #FFFFFF;
line-height: 1.2; line-height: 1.2;
margin-bottom: 0px; margin: 0em;
padding-bottom: 0px; padding-bottom: 0px;
} }
#example .masthead strike { #example .masthead strike {

300
src/elements/button.less

@ -193,155 +193,6 @@
} }
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*------------------- /*-------------------
Disabled Disabled
--------------------*/ --------------------*/
@ -1130,4 +981,155 @@
-moz-border-radius: 0px 0px 0.3125em 0.3125em; -moz-border-radius: 0px 0px 0.3125em 0.3125em;
-webkit-border-radius: 0px 0px 0.3125em 0.3125em; -webkit-border-radius: 0px 0px 0.3125em 0.3125em;
border-radius: 0px 0px 0.3125em 0.3125em; border-radius: 0px 0px 0.3125em 0.3125em;
}
/*--------------
Loading
---------------*/
.ui.button.loading,
.ui.button.loading.hover {
position: relative;
cursor: default;
background-color: #F3F3F3 !important;
color: transparent !important;
text-shadow: none !important;
background-image: none !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.loading:after {
position: absolute;
top: 0em;
left: 0em;
width: 100%;
height: 100%;
content: '';
background: transparent url(../images/loader-mini.gif) no-repeat 50% 50%;
}
.ui.labeled.icon.button.loading .icon {
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/*--------------
Error
---------------*/
.ui.button.error,
.ui.button.error.hover,
.ui.button.error.down {
cursor: default;
position: relative !important;
background-color: #D95C5C !important;
color: transparent !important;
text-shadow: none;
-webkit-transition: all 0s linear;
-moz-transition: all 0s linear;
-o-transition: all 0s linear;
-ms-transition: all 0s linear;
transition: all 0s linear;
}
.ui.button.error .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.error:after {
position: absolute;
left: 50%;
content: "Error";
margin-left: -1.8em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
.ui.button.error .icon:before {
font-family: 'Icons';
content: '\26a0';
}
/*--------------
Success
---------------*/
.ui.button.success,
.ui.button.success.hover,
.ui.button.success.down {
position: relative !important;
background-color: #5BBD72 !important;
color: transparent !important;
}
.ui.button.success .icon {
opacity: 1;
color: #FFFFFF;
}
.ui.button.success .icon:before {
font-family: 'Icons';
content: '\2611';
}
.ui.button.success:after {
position: absolute;
left: 50%;
content: "Success";
margin-left: -2em;
color: #FFFFFF;
-webkit-animation: button-text 0.5s;
-moz-animation: button-text 0.5s;
-ms-animation: button-text 0.5s;
-o-animation: button-text 0.5s;
animation: button-text 0.5s;
}
@-webkit-keyframes button-text {
0% {
-webkit-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-webkit-transform: translateY(0);
}
}
@-moz-keyframes button-text {
0% {
-moz-transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
-moz-transform: translateY(0);
}
}
@keyframes button-text {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
opacity: 1;
transform: translateY(0);
}
} }

2
src/modules/accordion.js

@ -329,7 +329,7 @@ $.fn.accordion.settings = {
debug : true, debug : true,
verbose : true, verbose : true,
performance : false, performance : true,
exclusive : true, exclusive : true,
collapsible : true, collapsible : true,

74
src/modules/shape.js

@ -40,7 +40,6 @@ $.fn.shape = function(parameters) {
// private variables // private variables
$activeSide, $activeSide,
$nextSide, $nextSide,
transitionEnd = 'msTransitionEnd oTransitionEnd webkitTransitionEnd',
// standard module // standard module
element = this, element = this,
@ -112,7 +111,7 @@ $.fn.shape = function(parameters) {
; ;
$sides $sides
.css(propertyObject) .css(propertyObject)
.one(transitionEnd + eventNamespace, callback) .one(module.get.transitionEvent(), callback)
; ;
} }
else { else {
@ -138,9 +137,11 @@ $.fn.shape = function(parameters) {
queue: function(method) { queue: function(method) {
module.debug('Queueing animation of', method); module.debug('Queueing animation of', method);
$sides $sides
.one(transitionEnd, function() { .one(module.get.transitionEvent(), function() {
module.debug('Executing queued animation'); module.debug('Executing queued animation');
$module.shape(method); setTimeout(function(){
$module.shape(method);
}, 0);
}) })
; ;
}, },
@ -175,6 +176,24 @@ $.fn.shape = function(parameters) {
get: { get: {
transitionEvent: function() {
var
element = document.createElement('element'),
transitions = {
'transition' :'transitionend',
'OTransition' :'oTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
},
transition
;
for(transition in transitions){
if( element.style[transition] !== undefined ){
return transitions[transition];
}
}
},
nextSide: function() { nextSide: function() {
return ( $activeSide.next(settings.selector.side).size() > 0 ) return ( $activeSide.next(settings.selector.side).size() > 0 )
? $activeSide.next(settings.selector.side) ? $activeSide.next(settings.selector.side)
@ -501,14 +520,25 @@ $.fn.shape = function(parameters) {
return settings[name]; return settings[name];
} }
}, },
setting: function(name, value) {
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) { internal: function(name, value) {
if(value !== undefined) { if(value !== undefined) {
if( $.isPlainObject(name) ) { if( $.isPlainObject(name) ) {
module.verbose('Modifying internal property', name, value);
$.extend(true, module, name); $.extend(true, module, name);
} }
else { else {
module.verbose('Changing internal method to', value);
module[name] = value; module[name] = value;
} }
} }
@ -537,7 +567,7 @@ $.fn.shape = function(parameters) {
} }
}, },
error: function() { error: function() {
module.error = Function.prototype.bind.call(console.log, console, settings.moduleName + ':'); module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':');
}, },
performance: { performance: {
log: function(message) { log: function(message) {
@ -551,44 +581,42 @@ $.fn.shape = function(parameters) {
previousTime = time || currentTime, previousTime = time || currentTime,
executionTime = currentTime - previousTime; executionTime = currentTime - previousTime;
time = currentTime; time = currentTime;
performance.push({ performance.push({
'Element' : element, 'Element' : element,
'Name' : message[0], 'Name' : message[0],
'Arguments' : message[1] || 'None', 'Arguments' : [].slice.call(message, 1) || '',
'Execution Time' : executionTime 'Execution Time' : executionTime
}); });
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
} }
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 100);
}, },
display: function() { display: function() {
var var
title = settings.moduleName, title = settings.moduleName + ':',
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', totalTime = 0
totalExecutionTime = 0
; ;
time = false;
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) { if(moduleSelector) {
title += ' Performance (' + moduleSelector + ')'; title += ' \'' + moduleSelector + '\'';
} }
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title); console.groupCollapsed(title);
if(console.table) { if(console.table) {
$.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
});
console.table(performance); console.table(performance);
} }
else { else {
$.each(performance, function(index, data) { $.each(performance, function(index, data) {
totalExecutionTime += data['Execution Time'];
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
}); });
} }
console.log('Total Execution Time:', totalExecutionTime +'ms');
console.groupEnd(); console.groupEnd();
performance = [];
time = false;
} }
performance = [];
} }
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {

43
src/modules/shape.less

@ -1,5 +1,18 @@
/*
* # Semantic Button
* http://github.com/quirkyinc/semantic
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Released: April 17 2013
*/
/******************************* /*******************************
Shape Shape
*******************************/ *******************************/
.ui.shape { .ui.shape {
@ -27,16 +40,21 @@
backface-visibility: hidden; backface-visibility: hidden;
} }
/*---------------
States
----------------*/
/* Standard */
.ui.shape .side { .ui.shape .side {
display: none; display: none;
} }
/* Animating */
/*******************************
States
*******************************/
/*--------------
Animating
---------------*/
.ui.shape.animating .sides { .ui.shape.animating .sides {
position: absolute; position: absolute;
} }
@ -51,7 +69,11 @@
opacity: 0.7; opacity: 0.7;
} }
/* css animation */
/*--------------
CSS
---------------*/
.ui.shape.css { .ui.shape.css {
-webkit-transition: -webkit-transition:
all 0.6s ease-in-out; all 0.6s ease-in-out;
@ -84,7 +106,10 @@
transition: opacity 0.6s ease-in-out; transition: opacity 0.6s ease-in-out;
} }
/* Active */ /*--------------
Active
---------------*/
.ui.shape .active.side { .ui.shape .active.side {
display: block; display: block;
} }
Loading…
Cancel
Save