This commit is contained in:
oitsjustjose 2017-02-25 03:50:31 -05:00
commit 4e066bffc9
10017 changed files with 1322084 additions and 0 deletions

127
node_modules/semantic-ui/src/README.md generated vendored Normal file
View file

@ -0,0 +1,127 @@
## Setup
### Built-In Tools
From the Semantic directory you can setup gulp to build Semantic by running.
```bash
npm install
```
Semantic will automatically configure itself using a `post-install` script built into the package.
After set-up can use gulp to build your project's css:
```bash
/* Watch files */
gulp watch
/* Build all files */
gulp build
```
Visit the [Getting Started Guide](http://learnsemantic.com/guide/expert.html) for more details on set-up
### Custom Pipelines
#### Importing Gulp Tasks
Each gulp task can be imported into your own Gulpfile using `require`
```javascript
var
watch = require('path/to/semantic/tasks/watch')
;
gulp.task('watch ui', 'Watch Semantic UI', watch));
```
#### Importing LESS
> LESS files do not contain vendor prefixes. If you are to use these files directly you must add them during your build step.
Before using source files you will need to create a `theme.config` by renaming `theme.config.example`, and a site folder by renaming `_site/` to `site/`
You can then import Semantic from your own LESS files:
```less
/* Import all components */
@import 'src/semantic';
```
To import individual components you will have to create a scope for each import using `& {}`
```less
/* Import a specific component */
& { @import 'src/definitions/elements/button'; }
```
### Config Files
These files are generated automatically using install scripts, but must be manually renamed if you are using installing manually.
filename | usage | Initial Name
--- | --- | ---
**theme.config** | config file that stores each element's current theme for LESS | theme.config.example
**site/** | folder storing all your site's variables and css overrides for each UI component | _site/
**semantic.json** | stores folder paths for build tools and current installed version for updates. Only necessary when using build tools | semantic.json.example
### Workflow
You will only need to use Semantic's build tools while refining your UI. When designing pages, you can rely on the compiled css packages in `dist/`.
When creating your UI you can try <a href="http://www.learnsemantic.com/themes/creating.html">downloading different themes</a>, adjusting your <a href="http://www.learnsemantic.com/developing/customizing.html#setting-global-variables">site-wide settings</a> (font-family, colors, etc) and tweaking components in your site's <a href="http://www.learnsemantic.com/developing/customizing.html#designing-for-the-long-now">component overrides</a>.
Files in the `examples/` folder of your project can be useful for testing out changes in your UI. For example, you might run `gulp watch` download a new theme to `src/site/themes/` then adjust your `theme.config` file with the name of the new theme and refresh `examples/kitchensink.html` to inspect changes in the theme.
## Theming
### Concepts
#### Inheritance
There are three levels of inheritance in Semantic
* Default theme - Semantic UI's neutral default theme
* Packaged theme - A specified packaged theme, like "amazon", or "material"
* Site theme - A theme specific to your site
#### Folder Structure
* `definitions/` contains the `css` and `javascript` definitions for each component
* `themes/` contains *pre-packaged themes* including Semantic's default theme
* `site/` contains your current site's theme
View the [Theming Guide](http://learnsemantic.com/themes/overview.html) for a more in-depth look
## Customizing
#### Basic Customization
The best way to start customizing is to specify overriding variables in your site's `site.variables` file.
This is a blank stub file that lets you specify variables that overriding variables.
Some important values to customize:
* Base font size
* Named color hex codes
* Header/Page Font-families
* Primary and secondary colors
* Grid column count
To find out what variables are available to modify, you can inspect the variables in the default theme in `themes/default/`
#### Advanced Configuration
Each component has its own variable file, which can be used to modify any of the underlying variables for that component.
For example `/site/elements/button.variables`.
You may also specify your own custom LESS in `site/elements/button.overrides`. This file will have access to all underlying variables available for that component.
#### Using Pre-Packaged Themes
You can modify `theme.config` to use any prepackaged theme available in `src/themes/`.
For example you can modify `theme.config` to use a `github` button theme by changing
```less
@button: 'github';
```
View the [Customization Guide](http://learnsemantic.com/developing/customizing.html) to learn more

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*-------------------
Flag Variables
--------------------*/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Global Variables
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Global Variables
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
Site Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

View file

@ -0,0 +1,3 @@
/*******************************
User Variable Overrides
*******************************/

1167
node_modules/semantic-ui/src/definitions/behaviors/api.js generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,280 @@
/*!
* # Semantic UI - Colorize
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.fn.colorize = function(parameters) {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.colorize.settings, parameters)
: $.extend({}, $.fn.colorize.settings),
// hoist arguments
moduleArguments = arguments || false
;
$(this)
.each(function(instanceIndex) {
var
$module = $(this),
mainCanvas = $('<canvas />')[0],
imageCanvas = $('<canvas />')[0],
overlayCanvas = $('<canvas />')[0],
backgroundImage = new Image(),
// defs
mainContext,
imageContext,
overlayContext,
image,
imageName,
width,
height,
// shortcuts
colors = settings.colors,
paths = settings.paths,
namespace = settings.namespace,
error = settings.error,
// boilerplate
instance = $module.data('module-' + namespace),
module
;
module = {
checkPreconditions: function() {
module.debug('Checking pre-conditions');
if( !$.isPlainObject(colors) || $.isEmptyObject(colors) ) {
module.error(error.undefinedColors);
return false;
}
return true;
},
async: function(callback) {
if(settings.async) {
setTimeout(callback, 0);
}
else {
callback();
}
},
getMetadata: function() {
module.debug('Grabbing metadata');
image = $module.data('image') || settings.image || undefined;
imageName = $module.data('name') || settings.name || instanceIndex;
width = settings.width || $module.width();
height = settings.height || $module.height();
if(width === 0 || height === 0) {
module.error(error.undefinedSize);
}
},
initialize: function() {
module.debug('Initializing with colors', colors);
if( module.checkPreconditions() ) {
module.async(function() {
module.getMetadata();
module.canvas.create();
module.draw.image(function() {
module.draw.colors();
module.canvas.merge();
});
$module
.data('module-' + namespace, module)
;
});
}
},
redraw: function() {
module.debug('Redrawing image');
module.async(function() {
module.canvas.clear();
module.draw.colors();
module.canvas.merge();
});
},
change: {
color: function(colorName, color) {
module.debug('Changing color', colorName);
if(colors[colorName] === undefined) {
module.error(error.missingColor);
return false;
}
colors[colorName] = color;
module.redraw();
}
},
canvas: {
create: function() {
module.debug('Creating canvases');
mainCanvas.width = width;
mainCanvas.height = height;
imageCanvas.width = width;
imageCanvas.height = height;
overlayCanvas.width = width;
overlayCanvas.height = height;
mainContext = mainCanvas.getContext('2d');
imageContext = imageCanvas.getContext('2d');
overlayContext = overlayCanvas.getContext('2d');
$module
.append( mainCanvas )
;
mainContext = $module.children('canvas')[0].getContext('2d');
},
clear: function(context) {
module.debug('Clearing canvas');
overlayContext.fillStyle = '#FFFFFF';
overlayContext.fillRect(0, 0, width, height);
},
merge: function() {
if( !$.isFunction(mainContext.blendOnto) ) {
module.error(error.missingPlugin);
return;
}
mainContext.putImageData( imageContext.getImageData(0, 0, width, height), 0, 0);
overlayContext.blendOnto(mainContext, 'multiply');
}
},
draw: {
image: function(callback) {
module.debug('Drawing image');
callback = callback || function(){};
if(image) {
backgroundImage.src = image;
backgroundImage.onload = function() {
imageContext.drawImage(backgroundImage, 0, 0);
callback();
};
}
else {
module.error(error.noImage);
callback();
}
},
colors: function() {
module.debug('Drawing color overlays', colors);
$.each(colors, function(colorName, color) {
settings.onDraw(overlayContext, imageName, colorName, color);
});
}
},
debug: function(message, variableName) {
if(settings.debug) {
if(variableName !== undefined) {
console.info(settings.name + ': ' + message, variableName);
}
else {
console.info(settings.name + ': ' + message);
}
}
},
error: function(errorMessage) {
console.warn(settings.name + ': ' + errorMessage);
},
invoke: function(methodName, context, methodArguments) {
var
method
;
methodArguments = methodArguments || Array.prototype.slice.call( arguments, 2 );
if(typeof methodName == 'string' && instance !== undefined) {
methodName = methodName.split('.');
$.each(methodName, function(index, name) {
if( $.isPlainObject( instance[name] ) ) {
instance = instance[name];
return true;
}
else if( $.isFunction( instance[name] ) ) {
method = instance[name];
return true;
}
module.error(settings.error.method);
return false;
});
}
return ( $.isFunction( method ) )
? method.apply(context, methodArguments)
: false
;
}
};
if(instance !== undefined && moduleArguments) {
// simpler than invoke realizing to invoke itself (and losing scope due prototype.call()
if(moduleArguments[0] == 'invoke') {
moduleArguments = Array.prototype.slice.call( moduleArguments, 1 );
}
return module.invoke(moduleArguments[0], this, Array.prototype.slice.call( moduleArguments, 1 ) );
}
// initializing
module.initialize();
})
;
return this;
};
$.fn.colorize.settings = {
name : 'Image Colorizer',
debug : true,
namespace : 'colorize',
onDraw : function(overlayContext, imageName, colorName, color) {},
// whether to block execution while updating canvas
async : true,
// object containing names and default values of color regions
colors : {},
metadata: {
image : 'image',
name : 'name'
},
error: {
noImage : 'No tracing image specified',
undefinedColors : 'No default colors specified.',
missingColor : 'Attempted to change color that does not exist',
missingPlugin : 'Blend onto plug-in must be included',
undefinedHeight : 'The width or height of image canvas could not be automatically determined. Please specify a height.'
}
};
})( jQuery, window, document );

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,708 @@
/*!
* # Semantic UI - State
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.fn.state = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
hasTouch = ('ontouchstart' in document.documentElement),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.state.settings, parameters)
: $.extend({}, $.fn.state.settings),
error = settings.error,
metadata = settings.metadata,
className = settings.className,
namespace = settings.namespace,
states = settings.states,
text = settings.text,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
$module = $(this),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
module.verbose('Initializing module');
// allow module to guess desired state based on element
if(settings.automatic) {
module.add.defaults();
}
// bind events with delegated events
if(settings.context && moduleSelector !== '') {
$(settings.context)
.on(moduleSelector, 'mouseenter' + eventNamespace, module.change.text)
.on(moduleSelector, 'mouseleave' + eventNamespace, module.reset.text)
.on(moduleSelector, 'click' + eventNamespace, module.toggle.state)
;
}
else {
$module
.on('mouseenter' + eventNamespace, module.change.text)
.on('mouseleave' + eventNamespace, module.reset.text)
.on('click' + eventNamespace, module.toggle.state)
;
}
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying previous module', instance);
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
refresh: function() {
module.verbose('Refreshing selector cache');
$module = $(element);
},
add: {
defaults: function() {
var
userStates = parameters && $.isPlainObject(parameters.states)
? parameters.states
: {}
;
$.each(settings.defaults, function(type, typeStates) {
if( module.is[type] !== undefined && module.is[type]() ) {
module.verbose('Adding default states', type, element);
$.extend(settings.states, typeStates, userStates);
}
});
}
},
is: {
active: function() {
return $module.hasClass(className.active);
},
loading: function() {
return $module.hasClass(className.loading);
},
inactive: function() {
return !( $module.hasClass(className.active) );
},
state: function(state) {
if(className[state] === undefined) {
return false;
}
return $module.hasClass( className[state] );
},
enabled: function() {
return !( $module.is(settings.filter.active) );
},
disabled: function() {
return ( $module.is(settings.filter.active) );
},
textEnabled: function() {
return !( $module.is(settings.filter.text) );
},
// definitions for automatic type detection
button: function() {
return $module.is('.button:not(a, .submit)');
},
input: function() {
return $module.is('input');
},
progress: function() {
return $module.is('.ui.progress');
}
},
allow: function(state) {
module.debug('Now allowing state', state);
states[state] = true;
},
disallow: function(state) {
module.debug('No longer allowing', state);
states[state] = false;
},
allows: function(state) {
return states[state] || false;
},
enable: function() {
$module.removeClass(className.disabled);
},
disable: function() {
$module.addClass(className.disabled);
},
setState: function(state) {
if(module.allows(state)) {
$module.addClass( className[state] );
}
},
removeState: function(state) {
if(module.allows(state)) {
$module.removeClass( className[state] );
}
},
toggle: {
state: function() {
var
apiRequest,
requestCancelled
;
if( module.allows('active') && module.is.enabled() ) {
module.refresh();
if($.fn.api !== undefined) {
apiRequest = $module.api('get request');
requestCancelled = $module.api('was cancelled');
if( requestCancelled ) {
module.debug('API Request cancelled by beforesend');
settings.activateTest = function(){ return false; };
settings.deactivateTest = function(){ return false; };
}
else if(apiRequest) {
module.listenTo(apiRequest);
return;
}
}
module.change.state();
}
}
},
listenTo: function(apiRequest) {
module.debug('API request detected, waiting for state signal', apiRequest);
if(apiRequest) {
if(text.loading) {
module.update.text(text.loading);
}
$.when(apiRequest)
.then(function() {
if(apiRequest.state() == 'resolved') {
module.debug('API request succeeded');
settings.activateTest = function(){ return true; };
settings.deactivateTest = function(){ return true; };
}
else {
module.debug('API request failed');
settings.activateTest = function(){ return false; };
settings.deactivateTest = function(){ return false; };
}
module.change.state();
})
;
}
},
// checks whether active/inactive state can be given
change: {
state: function() {
module.debug('Determining state change direction');
// inactive to active change
if( module.is.inactive() ) {
module.activate();
}
else {
module.deactivate();
}
if(settings.sync) {
module.sync();
}
settings.onChange.call(element);
},
text: function() {
if( module.is.textEnabled() ) {
if(module.is.disabled() ) {
module.verbose('Changing text to disabled text', text.hover);
module.update.text(text.disabled);
}
else if( module.is.active() ) {
if(text.hover) {
module.verbose('Changing text to hover text', text.hover);
module.update.text(text.hover);
}
else if(text.deactivate) {
module.verbose('Changing text to deactivating text', text.deactivate);
module.update.text(text.deactivate);
}
}
else {
if(text.hover) {
module.verbose('Changing text to hover text', text.hover);
module.update.text(text.hover);
}
else if(text.activate){
module.verbose('Changing text to activating text', text.activate);
module.update.text(text.activate);
}
}
}
}
},
activate: function() {
if( settings.activateTest.call(element) ) {
module.debug('Setting state to active');
$module
.addClass(className.active)
;
module.update.text(text.active);
settings.onActivate.call(element);
}
},
deactivate: function() {
if( settings.deactivateTest.call(element) ) {
module.debug('Setting state to inactive');
$module
.removeClass(className.active)
;
module.update.text(text.inactive);
settings.onDeactivate.call(element);
}
},
sync: function() {
module.verbose('Syncing other buttons to current state');
if( module.is.active() ) {
$allModules
.not($module)
.state('activate');
}
else {
$allModules
.not($module)
.state('deactivate')
;
}
},
get: {
text: function() {
return (settings.selector.text)
? $module.find(settings.selector.text).text()
: $module.html()
;
},
textFor: function(state) {
return text[state] || false;
}
},
flash: {
text: function(text, duration, callback) {
var
previousText = module.get.text()
;
module.debug('Flashing text message', text, duration);
text = text || settings.text.flash;
duration = duration || settings.flashDuration;
callback = callback || function() {};
module.update.text(text);
setTimeout(function(){
module.update.text(previousText);
callback.call(element);
}, duration);
}
},
reset: {
// on mouseout sets text to previous value
text: function() {
var
activeText = text.active || $module.data(metadata.storedText),
inactiveText = text.inactive || $module.data(metadata.storedText)
;
if( module.is.textEnabled() ) {
if( module.is.active() && activeText) {
module.verbose('Resetting active text', activeText);
module.update.text(activeText);
}
else if(inactiveText) {
module.verbose('Resetting inactive text', activeText);
module.update.text(inactiveText);
}
}
}
},
update: {
text: function(text) {
var
currentText = module.get.text()
;
if(text && text !== currentText) {
module.debug('Updating text', text);
if(settings.selector.text) {
$module
.data(metadata.storedText, text)
.find(settings.selector.text)
.text(text)
;
}
else {
$module
.data(metadata.storedText, text)
.html(text)
;
}
}
else {
module.debug('Text is already set, ignoring update', text);
}
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
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({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.state.settings = {
// module info
name : 'State',
// debug output
debug : false,
// verbose debug output
verbose : false,
// namespace for events
namespace : 'state',
// debug data includes performance
performance : true,
// callback occurs on state change
onActivate : function() {},
onDeactivate : function() {},
onChange : function() {},
// state test functions
activateTest : function() { return true; },
deactivateTest : function() { return true; },
// whether to automatically map default states
automatic : true,
// activate / deactivate changes all elements instantiated at same time
sync : false,
// default flash text duration, used for temporarily changing text of an element
flashDuration : 1000,
// selector filter
filter : {
text : '.loading, .disabled',
active : '.disabled'
},
context : false,
// error
error: {
beforeSend : 'The before send function has cancelled state change',
method : 'The method you called is not defined.'
},
// metadata
metadata: {
promise : 'promise',
storedText : 'stored-text'
},
// change class on state
className: {
active : 'active',
disabled : 'disabled',
error : 'error',
loading : 'loading',
success : 'success',
warning : 'warning'
},
selector: {
// selector for text node
text: false
},
defaults : {
input: {
disabled : true,
loading : true,
active : true
},
button: {
disabled : true,
loading : true,
active : true,
},
progress: {
active : true,
success : true,
warning : true,
error : true
}
},
states : {
active : true,
disabled : true,
error : true,
loading : true,
success : true,
warning : true
},
text : {
disabled : false,
flash : false,
hover : false,
active : false,
inactive : false,
activate : false,
deactivate : false
}
};
})( jQuery, window, document );

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,525 @@
/*!
* # Semantic UI - Visit
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.visit = $.fn.visit = function(parameters) {
var
$allModules = $.isFunction(this)
? $(window)
: $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.visit.settings, parameters)
: $.extend({}, $.fn.visit.settings),
error = settings.error,
namespace = settings.namespace,
eventNamespace = '.' + namespace,
moduleNamespace = namespace + '-module',
$module = $(this),
$displays = $(),
element = this,
instance = $module.data(moduleNamespace),
module
;
module = {
initialize: function() {
if(settings.count) {
module.store(settings.key.count, settings.count);
}
else if(settings.id) {
module.add.id(settings.id);
}
else if(settings.increment && methodInvoked !== 'increment') {
module.increment();
}
module.add.display($module);
module.instantiate();
},
instantiate: function() {
module.verbose('Storing instance of visit module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying instance');
$module
.removeData(moduleNamespace)
;
},
increment: function(id) {
var
currentValue = module.get.count(),
newValue = +(currentValue) + 1
;
if(id) {
module.add.id(id);
}
else {
if(newValue > settings.limit && !settings.surpass) {
newValue = settings.limit;
}
module.debug('Incrementing visits', newValue);
module.store(settings.key.count, newValue);
}
},
decrement: function(id) {
var
currentValue = module.get.count(),
newValue = +(currentValue) - 1
;
if(id) {
module.remove.id(id);
}
else {
module.debug('Removing visit');
module.store(settings.key.count, newValue);
}
},
get: {
count: function() {
return +(module.retrieve(settings.key.count)) || 0;
},
idCount: function(ids) {
ids = ids || module.get.ids();
return ids.length;
},
ids: function(delimitedIDs) {
var
idArray = []
;
delimitedIDs = delimitedIDs || module.retrieve(settings.key.ids);
if(typeof delimitedIDs === 'string') {
idArray = delimitedIDs.split(settings.delimiter);
}
module.verbose('Found visited ID list', idArray);
return idArray;
},
storageOptions: function(data) {
var
options = {}
;
if(settings.expires) {
options.expires = settings.expires;
}
if(settings.domain) {
options.domain = settings.domain;
}
if(settings.path) {
options.path = settings.path;
}
return options;
}
},
has: {
visited: function(id, ids) {
var
visited = false
;
ids = ids || module.get.ids();
if(id !== undefined && ids) {
$.each(ids, function(index, value){
if(value == id) {
visited = true;
}
});
}
return visited;
}
},
set: {
count: function(value) {
module.store(settings.key.count, value);
},
ids: function(value) {
module.store(settings.key.ids, value);
}
},
reset: function() {
module.store(settings.key.count, 0);
module.store(settings.key.ids, null);
},
add: {
id: function(id) {
var
currentIDs = module.retrieve(settings.key.ids),
newIDs = (currentIDs === undefined || currentIDs === '')
? id
: currentIDs + settings.delimiter + id
;
if( module.has.visited(id) ) {
module.debug('Unique content already visited, not adding visit', id, currentIDs);
}
else if(id === undefined) {
module.debug('ID is not defined');
}
else {
module.debug('Adding visit to unique content', id);
module.store(settings.key.ids, newIDs);
}
module.set.count( module.get.idCount() );
},
display: function(selector) {
var
$element = $(selector)
;
if($element.length > 0 && !$.isWindow($element[0])) {
module.debug('Updating visit count for element', $element);
$displays = ($displays.length > 0)
? $displays.add($element)
: $element
;
}
}
},
remove: {
id: function(id) {
var
currentIDs = module.get.ids(),
newIDs = []
;
if(id !== undefined && currentIDs !== undefined) {
module.debug('Removing visit to unique content', id, currentIDs);
$.each(currentIDs, function(index, value){
if(value !== id) {
newIDs.push(value);
}
});
newIDs = newIDs.join(settings.delimiter);
module.store(settings.key.ids, newIDs );
}
module.set.count( module.get.idCount() );
}
},
check: {
limit: function(value) {
value = value || module.get.count();
if(settings.limit) {
if(value >= settings.limit) {
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
settings.onLimit.call(element, value);
}
module.debug('Limit not reached', value, settings.limit);
settings.onChange.call(element, value);
}
module.update.display(value);
}
},
update: {
display: function(value) {
value = value || module.get.count();
if($displays.length > 0) {
module.debug('Updating displayed view count', $displays);
$displays.html(value);
}
}
},
store: function(key, value) {
var
options = module.get.storageOptions(value)
;
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
window.localStorage.setItem(key, value);
module.debug('Value stored using local storage', key, value);
}
else if($.cookie !== undefined) {
$.cookie(key, value, options);
module.debug('Value stored using cookie', key, value, options);
}
else {
module.error(error.noCookieStorage);
return;
}
if(key == settings.key.count) {
module.check.limit(value);
}
},
retrieve: function(key, value) {
var
storedValue
;
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
storedValue = window.localStorage.getItem(key);
}
// get by cookie
else if($.cookie !== undefined) {
storedValue = $.cookie(key);
}
else {
module.error(error.noCookieStorage);
}
if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
storedValue = undefined;
}
return storedValue;
},
setting: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
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({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if($allModules.length > 1) {
title += ' ' + '(' + $allModules.length + ')';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.visit.settings = {
name : 'Visit',
debug : false,
verbose : false,
performance : true,
namespace : 'visit',
increment : false,
surpass : false,
count : false,
limit : false,
delimiter : '&',
storageMethod : 'localstorage',
key : {
count : 'visit-count',
ids : 'visit-ids'
},
expires : 30,
domain : false,
path : '/',
onLimit : function() {},
onChange : function() {},
error : {
method : 'The method you called is not defined',
missingPersist : 'Using the persist setting requires the inclusion of PersistJS',
noCookieStorage : 'The default storage cookie requires $.cookie to be included.'
}
};
})( jQuery, window, document );

View file

@ -0,0 +1,122 @@
/*!
* # Semantic UI - Breadcrumb
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Theme
*******************************/
@type : 'collection';
@element : 'breadcrumb';
@import (multiple) '../../theme.config';
/*******************************
Breadcrumb
*******************************/
.ui.breadcrumb {
line-height: 1;
display: @display;
margin: @verticalMargin 0em;
vertical-align: @verticalAlign;
}
.ui.breadcrumb:first-child {
margin-top: 0em;
}
.ui.breadcrumb:last-child {
margin-bottom: 0em;
}
/*******************************
Content
*******************************/
/* Divider */
.ui.breadcrumb .divider {
display: inline-block;
opacity: @dividerOpacity;
margin: 0em @dividerSpacing 0em;
font-size: @dividerSize;
color: @dividerColor;
vertical-align: @dividerVerticalAlign;
}
/* Link */
.ui.breadcrumb a {
color: @linkColor;
}
.ui.breadcrumb a:hover {
color: @linkHoverColor;
}
/* Icon Divider */
.ui.breadcrumb .icon.divider {
font-size: @iconDividerSize;
vertical-align: @iconDividerVerticalAlign;
}
/* Section */
.ui.breadcrumb a.section {
cursor: pointer;
}
.ui.breadcrumb .section {
display: inline-block;
margin: @sectionMargin;
padding: @sectionPadding;
}
/* Loose Coupling */
.ui.breadcrumb.segment {
display: inline-block;
padding: @segmentPadding;
}
/*******************************
States
*******************************/
.ui.breadcrumb .active.section {
font-weight: @activeFontWeight;
}
/*******************************
Variations
*******************************/
.ui.mini.breadcrumb {
font-size: @mini;
}
.ui.tiny.breadcrumb {
font-size: @tiny;
}
.ui.small.breadcrumb {
font-size: @small;
}
.ui.breadcrumb {
font-size: @medium;
}
.ui.large.breadcrumb {
font-size: @large;
}
.ui.big.breadcrumb {
font-size: @big;
}
.ui.huge.breadcrumb {
font-size: @huge;
}
.ui.massive.breadcrumb {
font-size: @massive;
}
.loadUIOverrides();

Some files were not shown because too many files have changed in this diff Show more