Browse Source
removes undocumented error state for buttons, adds in draft components
removes undocumented error state for buttons, adds in draft components
Former-commit-id:pull/258/head5f864996a5
Former-commit-id:db2e81f95f
11 changed files with 1726 additions and 553 deletions
Split View
Diff Options
-
104build/less/elements/button.less
-
93build/uncompressed/elements/button.css
-
45node/src/documents/elements/button.html
-
327node/src/draft/less/carousel.js
-
71node/src/draft/less/carousel.less
-
1197node/src/draft/less/extra.transitions.less
-
46node/src/draft/less/sitemap.less
-
104node/src/files/release/less/elements/button.less
-
93node/src/files/release/uncompressed/elements/button.css
-
95spec/button.json
-
104src/elements/button.less
@ -0,0 +1,327 @@ |
|||
/* ****************************** |
|||
Semantic Module: Carousel |
|||
Author: Jack Lukic |
|||
Notes: First Commit May 28, 2013 |
|||
|
|||
A carousel alternates between |
|||
several pieces of content in sequence. |
|||
|
|||
****************************** */ |
|||
|
|||
;(function ( $, window, document, undefined ) { |
|||
|
|||
$.fn.carousel = function(parameters) { |
|||
var |
|||
$allModules = $(this), |
|||
|
|||
settings = $.extend(true, {}, $.fn.carousel.settings, parameters), |
|||
|
|||
eventNamespace = '.' + settings.namespace, |
|||
moduleNamespace = 'module-' + settings.namespace, |
|||
moduleSelector = $allModules.selector || '', |
|||
|
|||
time = new Date().getTime(), |
|||
performance = [], |
|||
|
|||
query = arguments[0], |
|||
methodInvoked = (typeof query == 'string'), |
|||
queryArguments = [].slice.call(arguments, 1), |
|||
invokedResponse |
|||
; |
|||
|
|||
$allModules |
|||
.each(function() { |
|||
var |
|||
$module = $(this), |
|||
$arrows = $(settings.selector.arrows), |
|||
$leftArrow = $(settings.selector.leftArrow), |
|||
$rightArrow = $(settings.selector.rightArrow), |
|||
$content = $(settings.selector.content), |
|||
$navigation = $(settings.selector.navigation), |
|||
$navItem = $(settings.selector.navItem), |
|||
|
|||
selector = $module.selector || '', |
|||
element = this, |
|||
instance = $module.data('module-' + settings.namespace), |
|||
|
|||
className = settings.className, |
|||
namespace = settings.namespace, |
|||
errors = settings.errors, |
|||
module |
|||
; |
|||
|
|||
module = { |
|||
|
|||
initialize: function() { |
|||
module.openingAnimation(); |
|||
module.marquee.autoAdvance(); |
|||
$leftArrow |
|||
.on('click', module.marquee.left) |
|||
; |
|||
$rightArrow |
|||
.on('click', module.marquee.right) |
|||
; |
|||
$navItem |
|||
.on('click', module.marquee.change) |
|||
; |
|||
}, |
|||
|
|||
destroy: function() { |
|||
module.verbose('Destroying previous module for', $module); |
|||
$module |
|||
.off(eventNamespace) |
|||
; |
|||
}, |
|||
|
|||
left: function() { |
|||
var |
|||
$activeContent = $content.filter('.' + className.active), |
|||
currentIndex = $content.index($activeContent), |
|||
imageCount = $content.size(), |
|||
newIndex = (currentIndex - 1 != -1) |
|||
? (currentIndex - 1) |
|||
: (imageCount - 1) |
|||
; |
|||
$navItem |
|||
.eq(newIndex) |
|||
.trigger('click') |
|||
; |
|||
}, |
|||
|
|||
right: function() { |
|||
var |
|||
$activeContent = $content.filter('.' + className.active), |
|||
currentIndex = $content.index($activeContent), |
|||
imageCount = $content.size(), |
|||
newIndex = (currentIndex + 1 != imageCount) |
|||
? (currentIndex + 1) |
|||
: 0 |
|||
; |
|||
$navItem |
|||
.eq(newIndex) |
|||
.trigger('click') |
|||
; |
|||
}, |
|||
|
|||
change: function() { |
|||
var |
|||
$selected = $(this), |
|||
selectedIndex = $navItem.index($selected), |
|||
$selectedImage = $content.eq(selectedIndex) |
|||
; |
|||
module.marquee.autoAdvance(); |
|||
$selected |
|||
.addClass('active') |
|||
.siblings() |
|||
.removeClass('active') |
|||
; |
|||
$selectedImage |
|||
.addClass('active animated fadeIn') |
|||
.siblings('.' + className.active) |
|||
.removeClass('animated fadeIn scaleIn') |
|||
.animate({ |
|||
opacity: 0 |
|||
}, 500, function(){ |
|||
$(this) |
|||
.removeClass('active') |
|||
.removeAttr('style') |
|||
; |
|||
}) |
|||
; |
|||
}, |
|||
|
|||
autoAdvance: function() { |
|||
clearInterval(module.timer); |
|||
module.timer = setInterval(module.marquee.right, settings.duration); |
|||
}, |
|||
|
|||
setting: function(name, value) { |
|||
if(value !== undefined) { |
|||
if( $.isPlainObject(name) ) { |
|||
module.verbose('Modifying settings object', name, value); |
|||
$.extend(true, settings, name); |
|||
} |
|||
else { |
|||
module.verbose('Modifying setting', name, value); |
|||
settings[name] = value; |
|||
} |
|||
} |
|||
else { |
|||
return settings[name]; |
|||
} |
|||
}, |
|||
internal: function(name, value) { |
|||
if(value !== undefined) { |
|||
if( $.isPlainObject(name) ) { |
|||
module.verbose('Modifying internal property', name, value); |
|||
$.extend(true, module, name); |
|||
} |
|||
else { |
|||
module.verbose('Changing internal method to', value); |
|||
module[name] = value; |
|||
} |
|||
} |
|||
else { |
|||
return module[name]; |
|||
} |
|||
}, |
|||
debug: function() { |
|||
if(settings.debug) { |
|||
if(settings.performance) { |
|||
module.performance.log(arguments); |
|||
} |
|||
else { |
|||
module.debug = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); |
|||
module.debug.apply(console, arguments); |
|||
} |
|||
} |
|||
}, |
|||
verbose: function() { |
|||
if(settings.verbose && settings.debug) { |
|||
if(settings.performance) { |
|||
module.performance.log(arguments); |
|||
} |
|||
else { |
|||
module.verbose = Function.prototype.bind.call(console.info, console, settings.moduleName + ':'); |
|||
module.verbose.apply(console, arguments); |
|||
} |
|||
} |
|||
}, |
|||
error: function() { |
|||
module.error = Function.prototype.bind.call(console.error, console, settings.moduleName + ':'); |
|||
module.error.apply(console, arguments); |
|||
}, |
|||
performance: { |
|||
log: function(message) { |
|||
var |
|||
currentTime, |
|||
executionTime, |
|||
previousTime |
|||
; |
|||
if(settings.performance) { |
|||
currentTime = new Date().getTime(); |
|||
previousTime = time || currentTime; |
|||
executionTime = currentTime - previousTime; |
|||
time = currentTime; |
|||
performance.push({ |
|||
'Element' : element, |
|||
'Name' : message[0], |
|||
'Arguments' : message[1] || 'None', |
|||
'Execution Time' : executionTime |
|||
}); |
|||
clearTimeout(module.performance.timer); |
|||
module.performance.timer = setTimeout(module.performance.display, 100); |
|||
} |
|||
}, |
|||
display: function() { |
|||
var |
|||
title = settings.moduleName, |
|||
caption = settings.moduleName + ': ' + moduleSelector + '(' + $allModules.size() + ' elements)', |
|||
totalExecutionTime = 0 |
|||
; |
|||
if(moduleSelector) { |
|||
title += ' Performance (' + moduleSelector + ')'; |
|||
} |
|||
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) { |
|||
console.groupCollapsed(title); |
|||
if(console.table) { |
|||
$.each(performance, function(index, data) { |
|||
totalExecutionTime += data['Execution Time']; |
|||
}); |
|||
console.table(performance); |
|||
} |
|||
else { |
|||
$.each(performance, function(index, data) { |
|||
totalExecutionTime += data['Execution Time']; |
|||
console.log(data['Name'] + ': ' + data['Execution Time']+'ms'); |
|||
}); |
|||
} |
|||
console.log('Total Execution Time:', totalExecutionTime +'ms'); |
|||
console.groupEnd(); |
|||
performance = []; |
|||
time = false; |
|||
} |
|||
} |
|||
}, |
|||
invoke: function(query, passedArguments, context) { |
|||
var |
|||
maxDepth, |
|||
found |
|||
; |
|||
passedArguments = passedArguments || queryArguments; |
|||
context = element || context; |
|||
if(typeof query == 'string' && instance !== undefined) { |
|||
query = query.split(/[\. ]/); |
|||
maxDepth = query.length - 1; |
|||
$.each(query, function(depth, value) { |
|||
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) { |
|||
instance = instance[value]; |
|||
return true; |
|||
} |
|||
else if( instance[value] !== undefined ) { |
|||
found = instance[value]; |
|||
return true; |
|||
} |
|||
module.error(errors.method); |
|||
return false; |
|||
}); |
|||
} |
|||
if ( $.isFunction( found ) ) { |
|||
return found.apply(context, passedArguments); |
|||
} |
|||
return found || false; |
|||
} |
|||
}; |
|||
|
|||
if(methodInvoked) { |
|||
if(instance === undefined) { |
|||
module.initialize(); |
|||
} |
|||
module.invoke(query); |
|||
} |
|||
else { |
|||
if(instance !== undefined) { |
|||
module.destroy(); |
|||
} |
|||
module.initialize(); |
|||
} |
|||
}) |
|||
; |
|||
return (invokedResponse !== undefined) |
|||
? invokedResponse |
|||
: this |
|||
; |
|||
}; |
|||
|
|||
$.fn.carousel.settings = { |
|||
|
|||
name : 'Carousel', |
|||
namespace : 'carousel', |
|||
|
|||
verbose : true, |
|||
debug : true, |
|||
performance : true, |
|||
|
|||
// delegated event context
|
|||
duration: 5000, |
|||
|
|||
errors : { |
|||
method : 'The method you called is not defined.' |
|||
}, |
|||
|
|||
selector : { |
|||
arrows : '.arrow', |
|||
leftArrow : '.left.arrow', |
|||
rightArrow : '.right.arrow', |
|||
content : '.content', |
|||
navigation : '.navigation', |
|||
navItem : '.navigation .icon' |
|||
}, |
|||
|
|||
className : { |
|||
active : 'active' |
|||
} |
|||
|
|||
}; |
|||
|
|||
})( jQuery, window , document ); |
@ -0,0 +1,71 @@ |
|||
/* |
|||
* # Semantic Carousel |
|||
* http://github.com/quirkyinc/semantic |
|||
* |
|||
* |
|||
* Copyright 2013 Contributors |
|||
* Released under the MIT license |
|||
* http://opensource.org/licenses/MIT |
|||
* |
|||
* Released: June 03, 2013 |
|||
*/ |
|||
|
|||
|
|||
/******************************* |
|||
Carousel |
|||
*******************************/ |
|||
|
|||
.ui.carousel { |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.ui.carousel .arrow { |
|||
position: absolute; |
|||
font-size: 1.5em; |
|||
top: 50%; |
|||
left: 0%; |
|||
margin-top: -0.5em; |
|||
z-index: 10; |
|||
} |
|||
.ui.carousel .right.arrow { |
|||
left: auto; |
|||
right: 0%; |
|||
} |
|||
|
|||
.ui.carousel .slides { |
|||
position: relative; |
|||
width: 200%; |
|||
width: 9999px; |
|||
overflow: hidden; |
|||
font-size: 0em; |
|||
} |
|||
.ui.carousel .slides .slide { |
|||
display: inline-block; |
|||
height: 100%; |
|||
font-size: 1rem; |
|||
} |
|||
.ui.carousel .slides .slide > img { |
|||
display: block; |
|||
width: 100%; |
|||
} |
|||
|
|||
|
|||
/*-------------------- |
|||
Loading State |
|||
---------------------*/ |
|||
|
|||
/* On Form */ |
|||
.ui.carousel.loading { |
|||
position: relative; |
|||
} |
|||
.ui.carousel.loading:after { |
|||
position: absolute; |
|||
top: 0%; |
|||
left: 0%; |
|||
content: ''; |
|||
|
|||
width: 100%; |
|||
height: 100%; |
|||
background: rgba(255, 255, 255, 0.8) url(../images/loader-large.gif) no-repeat 50% 50%; |
|||
visibility: visible; |
|||
} |
1197
node/src/draft/less/extra.transitions.less
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,46 @@ |
|||
/* |
|||
* # Sitemap |
|||
* |
|||
* |
|||
* Copyright 2013 Contributors |
|||
* Released under the MIT license |
|||
* http://opensource.org/licenses/MIT |
|||
* |
|||
* Released: April 17 2013 |
|||
*/ |
|||
|
|||
/******************************* |
|||
Sitemap |
|||
*******************************/ |
|||
|
|||
.ui.sitemap { |
|||
margin: 0 -3rem; |
|||
font-size: 0rem; |
|||
text-align: left; |
|||
} |
|||
|
|||
|
|||
/*-------------- |
|||
Elements |
|||
---------------*/ |
|||
|
|||
.ui.sitemap > .section { |
|||
display: inline-block; |
|||
vertical-align: top; |
|||
|
|||
margin: 0em 3rem; |
|||
|
|||
font-size: 1rem; |
|||
} |
|||
|
|||
.ui.sitemap > .section > .header { |
|||
font-size: 1.125em; |
|||
color: rgba(0, 0, 0, 0.8); |
|||
padding-bottom: 0.5em; |
|||
} |
|||
|
|||
.ui.sitemap > .section > a { |
|||
display: block; |
|||
padding: 0.25em 0em; |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save