├── example ├── assets │ ├── sass │ │ ├── functions │ │ │ └── _import.scss │ │ ├── modules │ │ │ ├── _import.scss │ │ │ └── _base.scss │ │ ├── mixins │ │ │ ├── _import.scss │ │ │ ├── _text.scss │ │ │ ├── _animate.scss │ │ │ ├── _design.scss │ │ │ └── _prefix.scss │ │ ├── _global.scss │ │ ├── main.scss │ │ ├── normalize │ │ │ └── _normalize.scss │ │ └── _fontAwesome.scss │ ├── img │ │ ├── banner.jpg │ │ ├── webdev.png │ │ ├── dialogs.png │ │ └── treehouse.png │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── js │ │ └── lib │ │ │ ├── sh │ │ │ ├── shBrushJScript.js │ │ │ ├── shCore.css │ │ │ ├── shCoreDefault.css │ │ │ └── shCore.js │ │ │ └── alertify │ │ │ ├── alertify.default.css │ │ │ ├── alertify.core.css │ │ │ ├── alertify.bootstrap.css │ │ │ └── alertify.min.js │ └── css │ │ └── main.css └── index.html ├── .gitignore ├── .travis.yml ├── sass ├── alertify.scss ├── alertify.default.scss ├── alertify.bootstrap.scss ├── _log.scss ├── mixins │ ├── _animate.scss │ ├── _design.scss │ └── _prefix.scss ├── _log.default.scss ├── _log.bootstrap.scss ├── _dialog.scss ├── _dialog.default.scss └── _dialog.bootstrap.scss ├── src ├── keys.js ├── alertify.js ├── generate.js ├── transition.js ├── validate.js ├── element.js ├── proto.js ├── logs.js ├── log.js └── dialog.js ├── test ├── specs │ ├── keys.test.js │ ├── transition.test.js │ ├── alertify.test.js │ ├── proto.test.js │ ├── log.test.js │ ├── validate.test.js │ ├── element.test.js │ ├── logs.test.js │ └── dialog.test.js ├── runner.js ├── index.html ├── qunit │ └── qunit.css └── vendor │ └── require.js ├── package.json ├── README.md └── Gruntfile.js /example/assets/sass/functions/_import.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .sass-cache 3 | dist 4 | -------------------------------------------------------------------------------- /example/assets/sass/modules/_import.scss: -------------------------------------------------------------------------------- 1 | @import "_base.scss"; -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.9 -------------------------------------------------------------------------------- /sass/alertify.scss: -------------------------------------------------------------------------------- 1 | @import "_dialog.scss"; 2 | @import "_log.scss"; -------------------------------------------------------------------------------- /sass/alertify.default.scss: -------------------------------------------------------------------------------- 1 | @import "_dialog.default.scss"; 2 | @import "_log.default.scss"; -------------------------------------------------------------------------------- /sass/alertify.bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "_dialog.bootstrap.scss"; 2 | @import "_log.bootstrap.scss"; -------------------------------------------------------------------------------- /example/assets/img/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/img/banner.jpg -------------------------------------------------------------------------------- /example/assets/img/webdev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/img/webdev.png -------------------------------------------------------------------------------- /example/assets/img/dialogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/img/dialogs.png -------------------------------------------------------------------------------- /example/assets/img/treehouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/img/treehouse.png -------------------------------------------------------------------------------- /example/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /example/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /example/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /example/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dyorg/alertify.js/master/example/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /example/assets/sass/mixins/_import.scss: -------------------------------------------------------------------------------- 1 | @import "_animate.scss"; 2 | @import "_design.scss"; 3 | @import "_prefix.scss"; 4 | @import "_text.scss"; -------------------------------------------------------------------------------- /src/keys.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | "use strict"; 3 | 4 | var keys = { 5 | ENTER : 13, 6 | ESC : 27, 7 | SPACE : 32 8 | }; 9 | 10 | return keys; 11 | }); 12 | -------------------------------------------------------------------------------- /src/alertify.js: -------------------------------------------------------------------------------- 1 | define(["proto"], function (AlertifyProto) { 2 | "use strict"; 3 | 4 | var Alertify = function () {}; 5 | Alertify.prototype = AlertifyProto; 6 | Alertify = new Alertify(); 7 | 8 | return Alertify; 9 | }); 10 | -------------------------------------------------------------------------------- /src/generate.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | "use strict"; 3 | 4 | return function () { 5 | var output = "require([\"alertify\", \"dialog\", \"logs\"], function (Alertify, Dialog, logs) {\n" + 6 | " window.Alertify = Alertify;\n" + 7 | "});"; 8 | return output; 9 | }; 10 | }); -------------------------------------------------------------------------------- /test/specs/keys.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/keys"], function (keys) { 2 | module("Keys"); 3 | 4 | test("keys API", function () { 5 | expect(3); 6 | deepEqual(keys.ENTER, 13, "Enter code is 13"); 7 | deepEqual(keys.ESC, 27, "Escape code is 27"); 8 | deepEqual(keys.SPACE, 32, "Space code is 32"); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/specs/transition.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/transition"], function (transition) { 2 | module("Transition"); 3 | 4 | test("transition API", function () { 5 | expect(2); 6 | deepEqual(typeof transition.type, "string", "transition.type is a string"); 7 | deepEqual(typeof transition.supported, "boolean", "transition.supported is a boolean"); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /sass/_log.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_animate"; 2 | 3 | .alertify-logs { 4 | position: fixed; 5 | z-index: 9999; 6 | } 7 | .alertify-log { 8 | position: relative; 9 | display: block; 10 | opacity: 0; 11 | @include transition( all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275) ); 12 | } 13 | 14 | // States 15 | .is-alertify-log-showing { 16 | opacity: 1; 17 | } 18 | .is-alertify-log-hidden { 19 | opacity: 0; 20 | } 21 | -------------------------------------------------------------------------------- /example/assets/sass/_global.scss: -------------------------------------------------------------------------------- 1 | // Reset/Normalize 2 | @import "normalize/_normalize.scss"; 3 | // Import all functions 4 | @import "functions/_import.scss"; 5 | // Import all mixins 6 | @import "mixins/_import.scss"; 7 | 8 | // Set global variables 9 | $sansSerif : Arial, Helvetica, sans-serif; 10 | $serif : Georgia, Times, serif; 11 | $fontSize : 16px; 12 | $lineHeight : 1.5; 13 | 14 | // alignment 15 | $spacing : 20px; 16 | // color scheme 17 | $light : #F5F5F5; -------------------------------------------------------------------------------- /test/runner.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | QUnit.config.autostart = false; 3 | 4 | require.config({ 5 | baseUrl: "../src", 6 | }); 7 | 8 | var testModules = [ 9 | "specs/alertify.test.js", 10 | "specs/dialog.test.js", 11 | "specs/element.test.js", 12 | "specs/keys.test.js", 13 | "specs/logs.test.js", 14 | "specs/log.test.js", 15 | "specs/proto.test.js", 16 | "specs/transition.test.js", 17 | "specs/validate.test.js" 18 | ]; 19 | 20 | require(testModules, QUnit.start); 21 | }()); -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | alertify.js Test Suite 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
test markup
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /example/assets/sass/mixins/_text.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Font Face 3 | * 4 | * @param $family Font name to be used in stylesheet 5 | * @param $path Path to font file 6 | */ 7 | @mixin fontface ($family, $path) { 8 | @font-face { 9 | font-family: $family; 10 | src: url('#{$path}.eot'); 11 | src: url('#{$path}.eot?#iefix') format('embedded-opentype'), 12 | url('#{$path}.woff') format('woff'), 13 | url('#{$path}.ttf') format('truetype'), 14 | url('#{$path}.svg##{$family}') format('svg'); 15 | font-weight: normal; 16 | font-style: normal; 17 | } 18 | } -------------------------------------------------------------------------------- /test/specs/alertify.test.js: -------------------------------------------------------------------------------- 1 | define(["alertify"], function (Alertify) { 2 | module("Alertify"); 3 | 4 | test("Alertify prototype object API", function () { 5 | expect(5); 6 | deepEqual(typeof Alertify._version, "string", "Alertify _version is a string"); 7 | deepEqual(typeof Alertify._prefix, "string", "Alertify _prefix is a string"); 8 | deepEqual(typeof Alertify.get, "function", "Alertify.get is a function"); 9 | deepEqual(typeof Alertify.on, "function", "Alertify.on is a function"); 10 | deepEqual(typeof Alertify.off, "function", "Alertify.off is a function"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /sass/mixins/_animate.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_prefix"; 2 | 3 | // 4 | // Transition 5 | // Multiple transition must be wrapped in braces 6 | // 7 | // 8 | // @include transition(all 1s linear); 9 | // @include transition((color 1s linear, opacity 1s linear)); 10 | // 11 | // 12 | // @param $list [default: all 1s linear] List of transitions 13 | // 14 | @mixin transition ($list: all 1s linear) { 15 | // which prefix to append to the property 16 | $webkit : true; 17 | $moz : true; 18 | $ms : true; 19 | $o : true; 20 | $spec : true; 21 | 22 | // set prefix 23 | @include prefix(transition, $list, $webkit, $moz, $ms, $o, $spec); 24 | } -------------------------------------------------------------------------------- /example/assets/sass/mixins/_animate.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition 3 | * Multiple transition must be wrapped in braces 4 | * 5 | * 6 | * @include transition(all 1s linear); 7 | * @include transition((color 1s linear, opacity 1s linear)); 8 | * 9 | * 10 | * @param $list [default: all 1s linear] List of transitions 11 | */ 12 | @mixin transition ($list: all 1s linear) { 13 | // which prefix to append to the property 14 | $webkit : true; 15 | $moz : true; 16 | $ms : true; 17 | $o : true; 18 | $spec : true; 19 | 20 | // set prefix 21 | @include prefix(transition, $list, $webkit, $moz, $ms, $o, $spec); 22 | } -------------------------------------------------------------------------------- /example/assets/sass/modules/_base.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Contents: 3 | * 4 | * 1. Media Object 5 | * 2. Clearfix 6 | */ 7 | 8 | /** 9 | * 1. Media Object 10 | * 11 | * Extremely flexible media object. Can reduce countless lines of code. 12 | * 13 | * HTML :: 14 | * 15 | *
16 | * 17 | *
18 | *

Body Text

19 | *
20 | *
21 | */ 22 | .media, 23 | .mediaBody { 24 | overflow: hidden; zoom: 1; 25 | } 26 | .mediaAside { 27 | float: left; display: inline; 28 | margin-right: 1em; 29 | } 30 | 31 | /** 32 | * 2. Clearfix 33 | */ 34 | .clearfix { 35 | zoom: 1; 36 | 37 | &:before, 38 | &:after { 39 | content: ""; 40 | display: table; 41 | } 42 | 43 | &:after { 44 | clear: both; 45 | } 46 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alertify", 3 | "description": "browser dialogs never looked so good", 4 | "version": "0.4.0rc1", 5 | "homepage": "http://fabien-d.github.com/alertify.js/", 6 | "author": { 7 | "name": "Fabien Doiron", 8 | "email": "fabien.doiron@gmail.com" 9 | }, 10 | "scripts": { 11 | "test": "grunt test" 12 | }, 13 | "devDependencies": { 14 | "grunt": "0.4.0rc7", 15 | "grunt-cli": "~0.1", 16 | "grunt-lib-phantomjs": "~0.1", 17 | "grunt-contrib-jshint": "~0.1.0", 18 | "grunt-contrib-qunit": "~0.1.1", 19 | "grunt-contrib-requirejs": "~0.3", 20 | "grunt-contrib-clean": "~0.4.0", 21 | "grunt-contrib-copy": "~0.4.0", 22 | "grunt-contrib-uglify": "~0.1.1", 23 | "requirejs": "~2.1.4", 24 | "grunt-contrib-compass": "~0.1.1", 25 | "grunt-contrib-connect": "~0.3.0" 26 | }, 27 | "licenses": [ 28 | { 29 | "type": "MIT", 30 | "url": "http://opensource.org/licenses/mit-license.php" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /sass/_log.default.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_design.scss"; 2 | @import "mixins/_prefix.scss"; 3 | 4 | $logWidth : 300px; 5 | $spacing : 8px; 6 | 7 | .alertify-logs { 8 | position: fixed; 9 | z-index: 9999; 10 | bottom: $spacing; right: $spacing; 11 | width: $logWidth; 12 | } 13 | .alertify-log { 14 | margin-top: $spacing; 15 | right: -$logWidth; 16 | padding: $spacing * 2 $spacing * 2; 17 | border-radius: 4px; 18 | } 19 | .alertify-log-info { 20 | background: #1F1F1F; 21 | background: rgba(0,0,0,.9); 22 | color: #FFF; 23 | text-shadow: -1px -1px 0 rgba(0,0,0,.5); 24 | } 25 | .alertify-log-error { 26 | color: #FFF; 27 | background: #FE1A00; 28 | background: rgba(254,26,0,.9); 29 | } 30 | .alertify-log-success { 31 | color: #FFF; 32 | background: #5CB811; 33 | background: rgba(92,184,17,.9); 34 | } 35 | 36 | // States 37 | .is-alertify-log-showing { 38 | right: 0; 39 | } 40 | .is-alertify-log-hidden { 41 | right: -$logWidth; 42 | } -------------------------------------------------------------------------------- /sass/_log.bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_design.scss"; 2 | @import "mixins/_prefix.scss"; 3 | 4 | $logWidth : 300px; 5 | $spacing : 8px; 6 | 7 | .alertify-logs { 8 | position: fixed; 9 | z-index: 9999; 10 | bottom: $spacing; right: $spacing; 11 | width: $logWidth; 12 | } 13 | .alertify-log { 14 | margin-top: $spacing; 15 | right: -$logWidth; 16 | padding: $spacing $spacing * 2; 17 | border-radius: 4px; 18 | } 19 | 20 | .alertify-log-info { 21 | color: #3A8ABF; 22 | text-shadow: 0 1px 0 rgba(255,255,255,.5); 23 | border: 1px solid #BCE8F1; 24 | background: #D9EDF7; 25 | padding: 8px 14px; 26 | border-radius: 4px; 27 | } 28 | .alertify-log-error { 29 | color: #B94A48; 30 | background: #F2DEDE; 31 | border: 1px solid #EED3D7; 32 | } 33 | .alertify-log-success { 34 | color: #468847; 35 | background: #DFF0D8; 36 | border: 1px solid #D6E9C6; 37 | } 38 | 39 | // States 40 | .is-alertify-log-showing { 41 | right: 0; 42 | } 43 | .is-alertify-log-hidden { 44 | right: -$logWidth; 45 | } -------------------------------------------------------------------------------- /src/transition.js: -------------------------------------------------------------------------------- 1 | define(["element"], function (element) { 2 | "use strict"; 3 | 4 | var transition; 5 | 6 | /** 7 | * Transition 8 | * Determines if current browser supports CSS transitions 9 | * And if so, assigns the proper transition event 10 | * 11 | * @return {Object} 12 | */ 13 | transition = function () { 14 | var t, 15 | type, 16 | supported = false, 17 | el = element.create("fakeelement"), 18 | transitions = { 19 | "WebkitTransition" : "webkitTransitionEnd", 20 | "MozTransition" : "transitionend", 21 | "OTransition" : "otransitionend", 22 | "transition" : "transitionend" 23 | }; 24 | 25 | for (t in transitions) { 26 | if (el.style[t] !== undefined) { 27 | type = transitions[t]; 28 | supported = true; 29 | break; 30 | } 31 | } 32 | 33 | return { 34 | type : type, 35 | supported : supported 36 | }; 37 | }; 38 | 39 | return transition(); 40 | }); 41 | -------------------------------------------------------------------------------- /sass/mixins/_design.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Linear Gradient 3 | // 4 | // @param $list [default: (top, #F5F5F5, #FFF)] 5 | // 6 | @mixin linear-gradient ($list: (top, #F5F5F5, #FFF)) { 7 | // which prefix to append to the property 8 | $webkit : true; 9 | $moz : true; 10 | $ms : true; 11 | $o : true; 12 | $spec : true; 13 | 14 | // set property prefix 15 | @include prop-prefix(background-image, linear-gradient, $list, $webkit, $moz, $ms, $o, $spec); 16 | } 17 | 18 | // 19 | // Radial Gradient 20 | // 21 | // @param $type [default: ellipse] Type of radial gradient 22 | // @param $position [default: center] Gradient position 23 | // @param $list [default: (#FFF, #F5F5F5)] 24 | // 25 | @mixin radial-gradient ($list: (#FFF, #F5F5F5), $type: ellipse, $position: center) { 26 | // which prefix to append to the property 27 | $webkit : true; 28 | $moz : true; 29 | $ms : true; 30 | $o : true; 31 | $spec : false; 32 | 33 | // set property prefix 34 | @include prop-prefix(background-image, radial-gradient, ($position, $type, $list), $webkit, $moz, $ms, $o, $spec); 35 | // specs have a different implementation 36 | background-image: radial-gradient($type at $position, $list); 37 | } -------------------------------------------------------------------------------- /example/assets/sass/mixins/_design.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Linear Gradient 3 | * 4 | * @param $list [default: (top, #F5F5F5, #FFF)] 5 | */ 6 | @mixin linear-gradient ($list: (top, #F5F5F5, #FFF)) { 7 | // which prefix to append to the property 8 | $webkit : true; 9 | $moz : true; 10 | $ms : true; 11 | $o : true; 12 | $spec : true; 13 | 14 | // set property prefix 15 | @include prop-prefix(background-image, linear-gradient, $list, $webkit, $moz, $ms, $o, $spec); 16 | } 17 | 18 | /** 19 | * Radial Gradient 20 | * 21 | * @param $type [default: ellipse] Type of radial gradient 22 | * @param $position [default: center] Gradient position 23 | * @param $list [default: (#FFF, #F5F5F5)] 24 | */ 25 | @mixin radial-gradient ($list: (#FFF, #F5F5F5), $type: ellipse, $position: center) { 26 | // which prefix to append to the property 27 | $webkit : true; 28 | $moz : true; 29 | $ms : true; 30 | $o : true; 31 | $spec : false; 32 | 33 | // set property prefix 34 | @include prop-prefix(background-image, radial-gradient, ($position, $type, $list), $webkit, $moz, $ms, $o, $spec); 35 | // specs have a different implementation 36 | background-image: radial-gradient($type at $position, $list); 37 | } -------------------------------------------------------------------------------- /test/specs/proto.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/proto"], function (Proto) { 2 | module("Alertify Prototype"); 3 | 4 | test("prototype object API", function () { 5 | expect(5); 6 | deepEqual(typeof Proto._version, "string", "Prototype _version is a string"); 7 | deepEqual(typeof Proto._prefix, "string", "Prototype _prefix is a string"); 8 | deepEqual(typeof Proto.get, "function", "Prototype.get is a function"); 9 | deepEqual(typeof Proto.on, "function", "Prototype.on is a function"); 10 | deepEqual(typeof Proto.off, "function", "Prototype.off is a function"); 11 | }); 12 | 13 | test("self optimizing function", function () { 14 | expect(2); 15 | var originalON = Proto.on; 16 | var originalOFF = Proto.off; 17 | Proto.on(document.createElement("fake"), "click", function () {}); 18 | 19 | notDeepEqual(originalON, Proto.on, "on method self optimized itself"); 20 | notDeepEqual(originalOFF, Proto.off, "off method self optimized itself"); 21 | }); 22 | 23 | test("get method", function () { 24 | expect(1); 25 | var el = document.createElement("fake"); 26 | el.setAttribute("id", "test"); 27 | document.body.appendChild(el); 28 | deepEqual(el, Proto.get("test"), "elements selector is working"); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /example/assets/js/lib/sh/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | ;(function() 2 | { 3 | // CommonJS 4 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 5 | 6 | function Brush() 7 | { 8 | var keywords = 'break case catch class continue ' + 9 | 'default delete do else enum export extends false ' + 10 | 'for function if implements import in instanceof ' + 11 | 'interface let new null package private protected ' + 12 | 'static return super switch ' + 13 | 'this throw true try typeof var while with yield'; 14 | 15 | var r = SyntaxHighlighter.regexLib; 16 | 17 | this.regexList = [ 18 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 19 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 20 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 21 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 22 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 23 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 24 | ]; 25 | 26 | this.forHtmlScript(r.scriptScriptTags); 27 | }; 28 | 29 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 30 | Brush.aliases = ['js', 'jscript', 'javascript']; 31 | 32 | SyntaxHighlighter.brushes.JScript = Brush; 33 | 34 | // CommonJS 35 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 36 | })(); 37 | -------------------------------------------------------------------------------- /sass/_dialog.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_animate"; 2 | @import "mixins/_prefix"; 3 | 4 | .alertify-cover { 5 | position: fixed; z-index: 9999; 6 | top: 0; bottom: 0; left: 0; right: 0; 7 | } 8 | 9 | .alertify-dialog { 10 | position: fixed; z-index: 99999; 11 | top: 50px; left: 50%; 12 | opacity: 1; 13 | @include transition( all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275) ); 14 | } 15 | .alertify-resetFocus { 16 | border: 0; 17 | clip: rect(0 0 0 0); 18 | height: 1px; width: 1px; 19 | margin: -1px; padding: 0; 20 | overflow: hidden; 21 | position: absolute; 22 | } 23 | .alertify-text { 24 | margin-bottom: 15px; 25 | width: 100%; 26 | font-size: 100%; 27 | @include prefix(box-sizing, border-box); 28 | } 29 | .alertify-button, 30 | .alertify-button:hover, 31 | .alertify-button:active, 32 | .alertify-button:visited { 33 | background: none; 34 | text-decoration: none; 35 | border: none; 36 | line-height: 1.5; 37 | font-size: 100%; 38 | display: inline-block; 39 | cursor: pointer; 40 | margin-left: 5px; 41 | } 42 | 43 | // States 44 | .is-alertify-cover-hidden { 45 | display: none; 46 | } 47 | 48 | .is-alertify-dialog-hidden { 49 | opacity: 0; 50 | display: none; 51 | @include prefix(transform, translate(0,-150px), true, true, true, true, true); 52 | } 53 | // overwrite display: none; for everything except IE6-8 54 | :root *> .is-alertify-dialog-hidden { display: block; } 55 | -------------------------------------------------------------------------------- /src/validate.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | "use strict"; 3 | 4 | var _checkValidation, 5 | validate; 6 | 7 | /** 8 | * Validate Parameters 9 | * The validation checks parameter against specified type. 10 | * If the parameter is set to optional, is will be valid unless 11 | * a parameter is specified and does not pass the test 12 | * 13 | * @param {String} type Type to check parameter against 14 | * @param {Mixed} param Parameter to check 15 | * @param {Boolean} optional [Optional] Whether the parameter is optional 16 | * @return {Boolean} 17 | */ 18 | _checkValidation = function (type, param, optional) { 19 | var valid = false; 20 | if (optional && typeof param === "undefined") { 21 | valid = true; 22 | } else { 23 | if (type === "object") { 24 | valid = (typeof param === "object" && !(param instanceof Array)); 25 | } else { 26 | valid = (typeof param === type); 27 | } 28 | } 29 | return valid; 30 | }; 31 | 32 | /** 33 | * Validate API 34 | * 35 | * @type {Object} 36 | */ 37 | validate = { 38 | messages: { 39 | invalidArguments: "Invalid arguments" 40 | }, 41 | isFunction: function (param, optional) { 42 | return _checkValidation("function", param, optional); 43 | }, 44 | isNumber: function (param, optional) { 45 | return _checkValidation("number", param, optional); 46 | }, 47 | isObject: function (param, optional) { 48 | return _checkValidation("object", param, optional); 49 | }, 50 | isString: function (param, optional) { 51 | return _checkValidation("string", param, optional); 52 | }, 53 | }; 54 | 55 | return validate; 56 | }); 57 | -------------------------------------------------------------------------------- /test/specs/log.test.js: -------------------------------------------------------------------------------- 1 | var x; 2 | define(["../../src/log"], function (Log) { 3 | module("Alertify Log"); 4 | 5 | test("log object API", function () { 6 | expect(3); 7 | var el = document.createElement("fake"); 8 | var log = new Log(el, "info", "message"); 9 | deepEqual(typeof log.close, "function", "Log.close is a function"); 10 | deepEqual(typeof log.create, "function", "Log.create is function"); 11 | deepEqual(typeof log.show, "function", "Log.show is function"); 12 | }); 13 | 14 | test("log object", function () { 15 | expect(7); 16 | var el = document.createElement("fake"); 17 | try { 18 | new Log("custom"); 19 | } catch (error) { 20 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 21 | } 22 | try { 23 | new Log(el, {}); 24 | } catch (error) { 25 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 26 | } 27 | try { 28 | new Log(el, "custom", function () {}); 29 | } catch (error) { 30 | deepEqual(error.message, "Invalid arguments", "Third argument error caught"); 31 | } 32 | try { 33 | new Log(el, "custom", "message", "!Number"); 34 | } catch (error) { 35 | deepEqual(error.message, "Invalid arguments", "Fourth argument error caught"); 36 | } 37 | try { 38 | new Log(el, "custom", "Custom Message"); 39 | deepEqual(1, 1, "Optional parameter validated"); 40 | } catch (error) { 41 | } 42 | try { 43 | new Log(el, "custom", "Custom Message", 5000); 44 | deepEqual(1, 1, "Optional parameter provided and valid"); 45 | } catch (error) { 46 | } 47 | 48 | var log = new Log(el, "success", "This is my message", 8000); 49 | deepEqual(log.delay, 8000, "Set proper delay"); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /src/element.js: -------------------------------------------------------------------------------- 1 | define(["validate"], function (validate) { 2 | "use strict"; 3 | 4 | var element = {}, 5 | setAttributes; 6 | 7 | /** 8 | * Set Attributes 9 | * Add attributes to a created element 10 | * 11 | * @param {Object} el Created DOM element 12 | * @param {Object} params [Optional] Attributes object 13 | * @return {Object} 14 | */ 15 | setAttributes = function (el, params) { 16 | var k; 17 | if (!validate.isObject(el) || 18 | !validate.isObject(params, true)) { 19 | throw new Error(validate.messages.invalidArguments); 20 | } 21 | if (typeof params !== "undefined") { 22 | if (params.attributes) { 23 | for (k in params.attributes) { 24 | if (params.attributes.hasOwnProperty(k)) { 25 | el.setAttribute(k, params.attributes[k]); 26 | } 27 | } 28 | } 29 | if (params.classes) { 30 | el.className = params.classes; 31 | } 32 | } 33 | return el; 34 | }; 35 | 36 | /** 37 | * element API 38 | * 39 | * @type {Object} 40 | */ 41 | element = { 42 | create: function (type, params) { 43 | var el; 44 | if (!validate.isString(type) || 45 | !validate.isObject(params, true)) { 46 | throw new Error(validate.messages.invalidArguments); 47 | } 48 | 49 | el = document.createElement(type); 50 | el = setAttributes(el, params); 51 | return el; 52 | }, 53 | ready: function (el) { 54 | if (!validate.isObject(el)) { 55 | throw new Error(validate.messages.invalidArguments); 56 | } 57 | if (el && el.scrollTop !== null) { 58 | return; 59 | } else { 60 | this.ready(); 61 | } 62 | } 63 | }; 64 | 65 | return element; 66 | }); 67 | -------------------------------------------------------------------------------- /src/proto.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | "use strict"; 3 | 4 | var AlertifyProto, 5 | add, 6 | attach; 7 | 8 | /** 9 | * Add 10 | * Update bind and unbind method for browser 11 | * that support add/removeEventListener 12 | * 13 | * @return {undefined} 14 | */ 15 | add = function () { 16 | this.on = function (el, event, fn) { 17 | el.addEventListener(event, fn, false); 18 | }; 19 | this.off = function (el, event, fn) { 20 | el.removeEventListener(event, fn, false); 21 | }; 22 | }; 23 | 24 | /** 25 | * Attach 26 | * Update bind and unbind method for browser 27 | * that support attach/detachEvent 28 | * 29 | * @return {undefined} 30 | */ 31 | attach = function () { 32 | this.on = function (el, event, fn) { 33 | el.attachEvent("on" + event, fn); 34 | }; 35 | this.off = function (el, event, fn) { 36 | el.detachEvent("on" + event, fn); 37 | }; 38 | }; 39 | 40 | /** 41 | * Alertify Prototype API 42 | * 43 | * @type {Object} 44 | */ 45 | AlertifyProto = { 46 | _version : "0.4.0", 47 | _prefix : "alertify", 48 | get: function (id) { 49 | return document.getElementById(id); 50 | }, 51 | on: function (el, event, fn) { 52 | if (typeof el.addEventListener === "function") { 53 | el.addEventListener(event, fn, false); 54 | add.call(this); 55 | } else if (el.attachEvent) { 56 | el.attachEvent("on" + event, fn); 57 | attach.call(this); 58 | } 59 | }, 60 | off: function (el, event, fn) { 61 | if (typeof el.removeEventListener === "function") { 62 | el.removeEventListener(event, fn, false); 63 | add.call(this); 64 | } else if (el.detachEvent) { 65 | el.detachEvent("on" + event, fn); 66 | attach.call(this); 67 | } 68 | } 69 | }; 70 | 71 | return AlertifyProto; 72 | }); 73 | -------------------------------------------------------------------------------- /test/specs/validate.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/validate"], function (validate) { 2 | module("Validate"); 3 | 4 | test("validate object API", function () { 5 | expect(2); 6 | deepEqual(typeof validate.isFunction, "function", "validate.isFunction is a function"); 7 | deepEqual(typeof validate.isString, "function", "validate.isString is a function"); 8 | }); 9 | 10 | test("isFunction Method", function () { 11 | expect(5); 12 | deepEqual(validate.isFunction({}), false, "Object is not a function"); 13 | deepEqual(validate.isFunction("!Function"), false, "String is not a function"); 14 | deepEqual(validate.isFunction(function () {}), true, "Function is a function"); 15 | deepEqual(validate.isFunction(undefined, true), true, "Optional and undefined returns true"); 16 | deepEqual(validate.isFunction("!Function", true), false, "Optional and string returns false"); 17 | }); 18 | 19 | test("isString Method", function () { 20 | expect(3); 21 | deepEqual(validate.isString({}), false, "Object is not a string"); 22 | deepEqual(validate.isString(200), false, "Number is not a string"); 23 | deepEqual(validate.isString("200"), true, "String is a string"); 24 | }); 25 | 26 | test("isNumber Method", function () { 27 | expect(3); 28 | deepEqual(validate.isNumber({}), false, "Object is not a number"); 29 | deepEqual(validate.isNumber("200"), false, "String is not a number"); 30 | deepEqual(validate.isNumber(200), true, "Number is a number"); 31 | }); 32 | 33 | test("isObject Method", function () { 34 | expect(4); 35 | deepEqual(validate.isObject("!Object"), false, "String is not an object"); 36 | deepEqual(validate.isObject([]), false, "Array is not an object"); 37 | deepEqual(validate.isObject(function() {}), false, "Function is not an object"); 38 | deepEqual(validate.isObject({}), true, "Object is an object"); 39 | }); 40 | 41 | module("Validate Labels"); 42 | 43 | test("validate Labels String", function () { 44 | expect(1); 45 | deepEqual(validate.messages.invalidArguments, "Invalid arguments"); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /sass/mixins/_prefix.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Add browser prefix to selector 3 | // 4 | // Single property 5 | // 6 | // @include prefix(transition, all 1s linear, $webkit, $moz, $ms, $o, $spec); 7 | // 8 | // 9 | // Multiple properties 10 | // 11 | // @include prefix(transition, (color 1s linear, opacity 1s linear), $webkit, $moz, $ms, $o, $spec); 12 | // 13 | // 14 | // @param $property Property to prepend prefix 15 | // @param $value value of the property 16 | // @param $webkit Whether to add -wekbit prefix 17 | // @param $moz Whether to add -moz prefix 18 | // @param $ms Whether to add -ms prefix 19 | // @param $o Whether to add -o prefix 20 | // @param $spec Whether to add spec property 21 | // 22 | @mixin prefix ($property, $value, $webkit: true, $moz: true, $ms: false, $o: false, $spec: true) { 23 | @if $webkit { -webkit-#{$property}: $value; } 24 | @if $moz { -moz-#{$property}: $value; } 25 | @if $ms { -ms-#{$property}: $value; } 26 | @if $o { -o-#{$property}: $value; } 27 | @if $spec { #{$property}: $value; } 28 | } 29 | 30 | // 31 | // Add browser prefix to property 32 | // 33 | // Single property 34 | // 35 | // @include prop-prefix(background-image, linear-gradient, (top, #FFF, #CCC), $webkit, $moz, $ms, $o, $spec); 36 | // 37 | // 38 | // @param $selector Selector 39 | // @param $property Property to prepend prefix 40 | // @param $value value of the property 41 | // @param $webkit Whether to add -wekbit prefix 42 | // @param $moz Whether to add -moz prefix 43 | // @param $ms Whether to add -ms prefix 44 | // @param $o Whether to add -o prefix 45 | // @param $spec Whether to add spec property 46 | // 47 | @mixin prop-prefix ($selector, $property, $value, $webkit: true, $moz: true, $ms: false, $o: false, $spec: true) { 48 | @if $webkit { #{$selector}: unquote("-webkit-#{$property}(#{$value})"); } 49 | @if $moz { #{$selector}: unquote(" -moz-#{$property}(#{$value})"); } 50 | @if $ms { #{$selector}: unquote(" -ms-#{$property}(#{$value})"); } 51 | @if $o { #{$selector}: unquote(" -o-#{$property}(#{$value})"); } 52 | @if $spec { #{$selector}: unquote(" #{$property}(#{$value})"); } 53 | } -------------------------------------------------------------------------------- /example/assets/sass/mixins/_prefix.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Add browser prefix to selector 3 | * 4 | * Single property 5 | * 6 | * @include prefix(transition, all 1s linear, $webkit, $moz, $ms, $o, $spec); 7 | * 8 | * 9 | * Multiple properties 10 | * 11 | * @include prefix(transition, (color 1s linear, opacity 1s linear), $webkit, $moz, $ms, $o, $spec); 12 | * 13 | * 14 | * @param $property Property to prepend prefix 15 | * @param $value value of the property 16 | * @param $webkit Whether to add -wekbit prefix 17 | * @param $moz Whether to add -moz prefix 18 | * @param $ms Whether to add -ms prefix 19 | * @param $o Whether to add -o prefix 20 | * @param $spec Whether to add spec property 21 | */ 22 | @mixin prefix ($property, $value, $webkit: true, $moz: true, $ms: false, $o: false, $spec: true) { 23 | @if $webkit { -webkit-#{$property}: $value; } 24 | @if $moz { -moz-#{$property}: $value; } 25 | @if $ms { -ms-#{$property}: $value; } 26 | @if $o { -o-#{$property}: $value; } 27 | @if $spec { #{$property}: $value; } 28 | } 29 | 30 | /** 31 | * Add browser prefix to property 32 | * 33 | * Single property 34 | * 35 | * @include prop-prefix(background-image, linear-gradient, (top, #FFF, #CCC), $webkit, $moz, $ms, $o, $spec); 36 | * 37 | * 38 | * @param $selector Selector 39 | * @param $property Property to prepend prefix 40 | * @param $value value of the property 41 | * @param $webkit Whether to add -wekbit prefix 42 | * @param $moz Whether to add -moz prefix 43 | * @param $ms Whether to add -ms prefix 44 | * @param $o Whether to add -o prefix 45 | * @param $spec Whether to add spec property 46 | */ 47 | @mixin prop-prefix ($selector, $property, $value, $webkit: true, $moz: true, $ms: false, $o: false, $spec: true) { 48 | @if $webkit { #{$selector}: unquote("-webkit-#{$property}(#{$value})"); } 49 | @if $moz { #{$selector}: unquote(" -moz-#{$property}(#{$value})"); } 50 | @if $ms { #{$selector}: unquote(" -ms-#{$property}(#{$value})"); } 51 | @if $o { #{$selector}: unquote(" -o-#{$property}(#{$value})"); } 52 | @if $spec { #{$selector}: unquote(" #{$property}(#{$value})"); } 53 | } -------------------------------------------------------------------------------- /src/logs.js: -------------------------------------------------------------------------------- 1 | define(["alertify", "proto", "element", "validate", "log"], function (Alertify, AlertifyProto, element, validate, Log) { 2 | "use strict"; 3 | 4 | var init, 5 | createLog, 6 | validateParams, 7 | logs; 8 | 9 | /** 10 | * Init Method 11 | * Create the log holder element 12 | * 13 | * @return {Object} Log holder element 14 | */ 15 | init = function () { 16 | var el = element.create("section", { classes: Alertify._prefix + "-logs" }); 17 | document.body.appendChild(el); 18 | element.ready(el); 19 | return el; 20 | }; 21 | 22 | /** 23 | * Create Log 24 | * 25 | * @param {String} type Log type 26 | * @param {String} msg Log message 27 | * @param {Number} delay [Optional] Delay in ms 28 | * @return {Object} 29 | */ 30 | createLog = function (type, msg, delay) { 31 | validateParams(type, msg, delay); 32 | this.el = document.body.contains(this.el) ? this.el : init(); 33 | return new Log(this.el, type, msg, delay); 34 | }; 35 | 36 | /** 37 | * Validate Parameters 38 | * 39 | * @param {String} type Log type 40 | * @param {String} msg Log message 41 | * @param {Number} delay [Optional] Delay in ms 42 | * @return {undefined} 43 | */ 44 | validateParams = function (type, msg, delay) { 45 | if (!validate.isString(type) || 46 | !validate.isString(msg) || 47 | !validate.isNumber(delay, true)) { 48 | throw new Error(validate.messages.invalidArguments); 49 | } 50 | }; 51 | 52 | /** 53 | * Logs API 54 | * 55 | * @type {Object} 56 | */ 57 | logs = { 58 | delay : 5000, 59 | el : undefined, 60 | create: function (type, msg, delay) { 61 | return createLog.call(this, type, msg, delay); 62 | }, 63 | error: function (msg, delay) { 64 | return createLog.call(this, "error", msg, delay); 65 | }, 66 | info: function (msg, delay) { 67 | return createLog.call(this, "info", msg, delay); 68 | }, 69 | success: function (msg, delay) { 70 | return createLog.call(this, "success", msg, delay); 71 | } 72 | }; 73 | 74 | AlertifyProto.log = logs; 75 | 76 | return logs; 77 | }); 78 | -------------------------------------------------------------------------------- /test/specs/element.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/element"], function (element) { 2 | module("Element"); 3 | 4 | test("Element object API", function () { 5 | expect(2); 6 | deepEqual(typeof element.create, "function", "element.create is a function"); 7 | deepEqual(typeof element.ready, "function", "element.ready is a function"); 8 | }); 9 | 10 | test("Create element parameters", function () { 11 | expect(4); 12 | try { 13 | element.create({}); 14 | } catch (error) { 15 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 16 | } 17 | try { 18 | element.create("article"); 19 | deepEqual(1, 1, "Optional argument not provided"); 20 | } catch (error) { 21 | } 22 | try { 23 | element.create("article", []); 24 | } catch (error) { 25 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 26 | } 27 | try { 28 | element.create("article", {}); 29 | deepEqual(1, 1, "Optional argument provided and valid"); 30 | } catch (error) { 31 | } 32 | }); 33 | 34 | test("Creating the element", function () { 35 | expect(4); 36 | var el = element.create("article", { 37 | classes: "alertify-log", 38 | attributes: { 39 | id: "id-test", 40 | "data-prop": "data-test" 41 | } 42 | }); 43 | deepEqual(typeof el, "object", "element.create returns an object"); 44 | deepEqual(el.className, "alertify-log", "class names appended properly"); 45 | deepEqual(el.id, "id-test", "id appended properly"); 46 | deepEqual(el.getAttribute("data-prop"), "data-test", "data attribute appended properly"); 47 | }); 48 | 49 | test("Ready method parameter", function () { 50 | expect(1); 51 | try { 52 | element.ready(); 53 | } catch (error) { 54 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 55 | } 56 | }); 57 | 58 | test("Element ready method", function () { 59 | expect(1); 60 | var el = element.create("fake"); 61 | element.ready(el); 62 | deepEqual(true, true, "element is ready and execution continued"); 63 | }); 64 | }); 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![build status](https://secure.travis-ci.org/fabien-d/alertify.js.png)](http://travis-ci.org/fabien-d/alertify.js) 2 | 3 | # alertify.js - browser dialogs never looked so good 4 | 5 | Checkout the [getting started guide](https://github.com/fabien-d/alertify.js/wiki/Getting-Started) to get up and running with alertify.js. If you're a developer looking to contribute or hack on the source, see [installing alertify.js](https://github.com/fabien-d/alertify.js/wiki/Installing-alertify.js). 6 | 7 | ## Note 8 | **The `master` branch is always the latest development point and will not reflect the latest stable version.** The latest stable version is currently on branch `0.3` and can also be downloaded from the example site below. 9 | 10 | ## Examples 11 | 12 | Deprecated: ~~[alertify.js 0.4.0rc1](http://fabien-d.github.com/alertify.js/0.4.0rc1/) - Release candidate~~ 13 | * [alertify.js 0.3.9](http://fabien-d.github.com/alertify.js/) - Latest stable version 14 | 15 | ## Documentation 16 | 17 | Head on over to the [alertify.js wiki](https://github.com/fabien-d/alertify.js/wiki). 18 | 19 | ## Contributing 20 | 21 | Read information on how to [properly log issues](https://github.com/fabien-d/alertify.js/wiki/Opening-Issues) and guidelines to [contribute to alertify.js](https://github.com/fabien-d/alertify.js/wiki/Contributing). 22 | 23 | ## Where is it being tested? 24 | 25 | * Microsoft Internet Explorer 8+ (Standards Mode) 26 | * Google Chrome 27 | * Mozilla FireFox 28 | * Apple Safari 29 | * Opera 30 | * iOS 31 | * Android 32 | 33 | ## Credit where credit is due 34 | 35 | See all list of [contributors](https://github.com/fabien-d/alertify.js/contributors) 36 | 37 | ## Release History 38 | 39 | For full details, see the [alertify.js changesets](https://github.com/fabien-d/alertify.js/wiki/Changeset) 40 | 41 | * 2013/07/06 - 0.3.10 42 | * 2013/04/20 - 0.3.9 43 | * 2013/02/17 - 0.4.0 Release Candidate 1 44 | * 2013/02/04 - 0.3.8 45 | * 2013/01/20 - 0.3.7 46 | * 2013/01/15 - 0.3.6 47 | * 2013/01/12 - 0.3.5 48 | * 2013/01/12 - 0.3.4 49 | * 2013/01/12 - 0.3.3 50 | * 2012/12/24 - 0.3.2 51 | * 2012/12/21 - 0.3.1 52 | * 2012/12/16 - 0.3.0 53 | * 2012/12/09 - 0.2.12 54 | 55 | *wasn't keeping track of changeset before... my bad 56 | 57 | ## License 58 | 59 | Alertify is licensed under MIT http://www.opensource.org/licenses/MIT 60 | 61 | ### Copyright 62 | 63 | Copyright (c) 2012, Fabien Doiron 64 | , [@fabien_doiron](http://twitter.com/fabien_doiron) 65 | -------------------------------------------------------------------------------- /sass/_dialog.default.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_design.scss"; 2 | @import "mixins/_prefix.scss"; 3 | 4 | // dialog default configs 5 | $dialogWidth : 550px; 6 | $btnOK : #FE1A00; 7 | $btnCancel : #5CB811; 8 | 9 | .alertify-dialog { 10 | width: $dialogWidth; 11 | margin-left: -$dialogWidth * .5; 12 | background: #FFF; 13 | border: 10px solid #333; 14 | border: 10px solid rgba(0,0,0,.7); 15 | border-radius: 8px; 16 | box-shadow: 0 3px 3px rgba(0,0,0,.3); 17 | @include prefix(background-clip, padding, true, true, false, false, false); 18 | background-clip: padding-box; 19 | } 20 | .alertify-dialog-inner { 21 | padding: 25px; 22 | } 23 | .alertify-inner { 24 | text-align: center; 25 | } 26 | .alertify-text { 27 | border: 1px solid #CCC; 28 | padding: 10px; 29 | border-radius: 4px; 30 | } 31 | .alertify-button { 32 | border-radius: 4px; 33 | color: #FFF; 34 | font-weight: bold; 35 | padding: 6px 15px; 36 | text-decoration: none; 37 | text-shadow: 1px 1px 0 rgba(0,0,0,.5); 38 | box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5); 39 | @include linear-gradient( (top, rgba(255,255,255,.3), rgba(255,255,255,0)) ); 40 | } 41 | .alertify-button:hover, 42 | .alertify-button:focus { 43 | outline: none; 44 | @include linear-gradient( (top, rgba(0,0,0,.1), rgba(0,0,0,0)) ); 45 | } 46 | .alertify-button:focus { 47 | box-shadow: 0 0 10px #2B72D5; 48 | } 49 | .alertify-button:active { 50 | position: relative; 51 | box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); 52 | } 53 | .alertify-button-cancel, 54 | .alertify-button-cancel:hover, 55 | .alertify-button-cancel:focus { 56 | background-color: $btnOK; 57 | border: 1px solid darken($btnOK, 10%); 58 | } 59 | .alertify-button-ok, 60 | .alertify-button-ok:hover, 61 | .alertify-button-ok:focus { 62 | background-color: $btnCancel; 63 | border: 1px solid darken($btnCancel, 10%); 64 | } 65 | 66 | @media only screen and (max-width: 680px) { 67 | .alertify-dialog { 68 | width: 90%; 69 | left: 5%; 70 | margin: 0; 71 | @include prefix(box-sizing, border-box); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /example/assets/js/lib/alertify/alertify.default.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Default Look and Feel 3 | */ 4 | .alertify, 5 | .alertify-log { 6 | font-family: sans-serif; 7 | } 8 | .alertify { 9 | background: #FFF; 10 | border: 10px solid #333; /* browsers that don't support rgba */ 11 | border: 10px solid rgba(0,0,0,.7); 12 | border-radius: 8px; 13 | box-shadow: 0 3px 3px rgba(0,0,0,.3); 14 | -webkit-background-clip: padding; /* Safari 4? Chrome 6? */ 15 | -moz-background-clip: padding; /* Firefox 3.6 */ 16 | background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */ 17 | } 18 | .alertify-text { 19 | border: 1px solid #CCC; 20 | padding: 10px; 21 | border-radius: 4px; 22 | } 23 | .alertify-button { 24 | border-radius: 4px; 25 | color: #FFF; 26 | font-weight: bold; 27 | padding: 6px 15px; 28 | text-decoration: none; 29 | text-shadow: 1px 1px 0 rgba(0,0,0,.5); 30 | box-shadow: inset 0 1px 0 0 rgba(255,255,255,.5); 31 | background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 32 | background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 33 | background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 34 | background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 35 | background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 36 | } 37 | .alertify-button:hover, 38 | .alertify-button:focus { 39 | outline: none; 40 | background-image: -webkit-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); 41 | background-image: -moz-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); 42 | background-image: -ms-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); 43 | background-image: -o-linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); 44 | background-image: linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,0)); 45 | } 46 | .alertify-button:focus { 47 | box-shadow: 0 0 15px #2B72D5; 48 | } 49 | .alertify-button:active { 50 | position: relative; 51 | box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); 52 | } 53 | .alertify-button-cancel, 54 | .alertify-button-cancel:hover, 55 | .alertify-button-cancel:focus { 56 | background-color: #FE1A00; 57 | border: 1px solid #D83526; 58 | } 59 | .alertify-button-ok, 60 | .alertify-button-ok:hover, 61 | .alertify-button-ok:focus { 62 | background-color: #5CB811; 63 | border: 1px solid #3B7808; 64 | } 65 | 66 | .alertify-log { 67 | background: #1F1F1F; 68 | background: rgba(0,0,0,.9); 69 | padding: 15px; 70 | border-radius: 4px; 71 | color: #FFF; 72 | text-shadow: -1px -1px 0 rgba(0,0,0,.5); 73 | } 74 | .alertify-log-error { 75 | background: #FE1A00; 76 | background: rgba(254,26,0,.9); 77 | } 78 | .alertify-log-success { 79 | background: #5CB811; 80 | background: rgba(92,184,17,.9); 81 | } -------------------------------------------------------------------------------- /src/log.js: -------------------------------------------------------------------------------- 1 | define(["alertify", "validate", "element", "transition"], function (Alertify, validate, element, transition) { 2 | "use strict"; 3 | 4 | var Log, 5 | onTransitionEnd, 6 | remove, 7 | startTimer, 8 | prefix = Alertify._prefix + "-log", 9 | clsShow = prefix + " is-" + prefix + "-showing", 10 | clsHide = prefix + " is-" + prefix + "-hidden"; 11 | 12 | /** 13 | * Log Method 14 | * 15 | * @param {Object} parent HTML DOM to insert log message into 16 | * @param {String} type Log type 17 | * @param {String} msg Log message 18 | * @param {Number} delay [Optional] Delay in ms 19 | */ 20 | Log = function (parent, type, msg, delay) { 21 | if (!validate.isObject(parent) || 22 | !validate.isString(type) || 23 | !validate.isString(msg) || 24 | !validate.isNumber(delay, true)) { 25 | throw new Error(validate.messages.invalidArguments); 26 | } 27 | 28 | this.delay = (typeof delay !== "undefined") ? delay : 5000; 29 | this.msg = msg; 30 | this.parent = parent; 31 | this.type = type; 32 | this.create(); 33 | this.show(); 34 | }; 35 | 36 | /** 37 | * Transition End 38 | * Handle CSS transition end 39 | * 40 | * @param {Event} event Event 41 | * @return {undefined} 42 | */ 43 | onTransitionEnd = function (event) { 44 | event.stopPropagation(); 45 | if (typeof this.el !== "undefined") { 46 | Alertify.off(this.el, transition.type, this.fn); 47 | remove.call(this); 48 | } 49 | }; 50 | 51 | /** 52 | * Remove 53 | * Remove the element from the DOM 54 | * 55 | * @return {undefined} 56 | */ 57 | remove = function () { 58 | this.parent.removeChild(this.el); 59 | delete this.el; 60 | }; 61 | 62 | /** 63 | * StartTimer 64 | * 65 | * @return {undefined} 66 | */ 67 | startTimer = function () { 68 | var that = this; 69 | if (this.delay !== 0) { 70 | setTimeout(function () { 71 | that.close(); 72 | }, this.delay); 73 | } 74 | }; 75 | 76 | /** 77 | * Close 78 | * Prepare the log element to be removed. 79 | * Set an event listener for transition complete 80 | * or call the remove directly 81 | * 82 | * @return {undefined} 83 | */ 84 | Log.prototype.close = function () { 85 | var that = this; 86 | if (typeof this.el !== "undefined" && this.el.parentNode === this.parent) { 87 | if (transition.supported) { 88 | this.fn = function (event) { 89 | onTransitionEnd.call(that, event); 90 | }; 91 | Alertify.on(this.el, transition.type, this.fn); 92 | this.el.className = clsHide + " " + prefix + "-" + this.type; 93 | } else { 94 | remove.call(this); 95 | } 96 | } 97 | }; 98 | 99 | /** 100 | * Create 101 | * Create a new log element and 102 | * append it to the parent 103 | * 104 | * @return {undefined} 105 | */ 106 | Log.prototype.create = function () { 107 | if (typeof this.el === "undefined") { 108 | var el = element.create("article", { 109 | classes: clsHide + " " + prefix + "-" + this.type 110 | }); 111 | el.innerHTML = this.msg; 112 | this.parent.appendChild(el); 113 | element.ready(el); 114 | this.el = el; 115 | } 116 | }; 117 | 118 | /** 119 | * Show 120 | * Show new log element and bind click listener 121 | * 122 | * @return {undefined} 123 | */ 124 | Log.prototype.show = function () { 125 | var that = this; 126 | if (typeof this.el === "undefined") { 127 | return; 128 | } 129 | Alertify.on(this.el, "click", function () { 130 | that.close(); 131 | }); 132 | this.el.className = clsShow + " " + prefix + "-" + this.type; 133 | startTimer.call(this); 134 | }; 135 | 136 | return Log; 137 | }); -------------------------------------------------------------------------------- /example/assets/js/lib/alertify/alertify.core.css: -------------------------------------------------------------------------------- 1 | .alertify-show, 2 | .alertify-log { 3 | -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1); /* older webkit */ 4 | -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); 5 | -moz-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); 6 | -ms-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); 7 | -o-transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); 8 | transition: all 500ms cubic-bezier(0.175, 0.885, 0.320, 1.275); /* easeOutBack */ 9 | } 10 | .alertify-hide { 11 | -webkit-transition: all 250ms cubic-bezier(0.600, 0, 0.735, 0.045); /* older webkit */ 12 | -webkit-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 13 | -moz-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 14 | -ms-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 15 | -o-transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 16 | transition: all 250ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */ 17 | } 18 | .alertify-log-hide { 19 | -webkit-transition: all 500ms cubic-bezier(0.600, 0, 0.735, 0.045); /* older webkit */ 20 | -webkit-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 21 | -moz-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 22 | -ms-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 23 | -o-transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); 24 | transition: all 500ms cubic-bezier(0.600, -0.280, 0.735, 0.045); /* easeInBack */ 25 | } 26 | .alertify-cover { 27 | position: fixed; z-index: 99999; 28 | top: 0; right: 0; bottom: 0; left: 0; 29 | } 30 | .alertify-cover-hidden { 31 | display: none; 32 | } 33 | .alertify { 34 | position: fixed; z-index: 99999; 35 | top: 50px; left: 50%; 36 | width: 550px; 37 | margin-left: -275px; 38 | opacity: 1; 39 | } 40 | .alertify-hidden { 41 | -webkit-transform: translate(0,-150px); 42 | -moz-transform: translate(0,-150px); 43 | -ms-transform: translate(0,-150px); 44 | -o-transform: translate(0,-150px); 45 | transform: translate(0,-150px); 46 | opacity: 0; 47 | display: none; 48 | } 49 | /* overwrite display: none; for everything except IE6-8 */ 50 | :root *> .alertify-hidden { display: block; } 51 | .alertify-logs { 52 | position: fixed; 53 | z-index: 5000; 54 | bottom: 10px; 55 | right: 10px; 56 | width: 300px; 57 | } 58 | .alertify-logs-hidden { 59 | display: none; 60 | } 61 | .alertify-log { 62 | display: block; 63 | margin-top: 10px; 64 | position: relative; 65 | right: -300px; 66 | opacity: 0; 67 | } 68 | .alertify-log-show { 69 | right: 0; 70 | opacity: 1; 71 | } 72 | .alertify-log-hide { 73 | -webkit-transform: translate(300px, 0); 74 | -moz-transform: translate(300px, 0); 75 | -ms-transform: translate(300px, 0); 76 | -o-transform: translate(300px, 0); 77 | transform: translate(300px, 0); 78 | opacity: 0; 79 | } 80 | .alertify-dialog { 81 | padding: 25px; 82 | } 83 | .alertify-resetFocus { 84 | border: 0; 85 | clip: rect(0 0 0 0); 86 | height: 1px; 87 | margin: -1px; 88 | overflow: hidden; 89 | padding: 0; 90 | position: absolute; 91 | width: 1px; 92 | } 93 | .alertify-inner { 94 | text-align: center; 95 | } 96 | .alertify-text { 97 | margin-bottom: 15px; 98 | width: 100%; 99 | -webkit-box-sizing: border-box; 100 | -moz-box-sizing: border-box; 101 | box-sizing: border-box; 102 | font-size: 100%; 103 | } 104 | .alertify-buttons { 105 | } 106 | .alertify-button, 107 | .alertify-button:hover, 108 | .alertify-button:active, 109 | .alertify-button:visited { 110 | background: none; 111 | text-decoration: none; 112 | border: none; 113 | /* line-height and font-size for input button */ 114 | line-height: 1.5; 115 | font-size: 100%; 116 | display: inline-block; 117 | cursor: pointer; 118 | margin-left: 5px; 119 | } 120 | 121 | .alertify-isHidden { 122 | visibility: hidden; 123 | } 124 | 125 | @media only screen and (max-width: 680px) { 126 | .alertify, 127 | .alertify-logs { 128 | width: 90%; 129 | -webkit-box-sizing: border-box; 130 | -moz-box-sizing: border-box; 131 | box-sizing: border-box; 132 | } 133 | .alertify { 134 | left: 5%; 135 | margin: 0; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /test/specs/logs.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/logs"], function (Log) { 2 | module("Alertify Logs"); 3 | 4 | test("logs object API", function () { 5 | expect(5); 6 | deepEqual(typeof Log.delay, "number", "Log.delay is a number"); 7 | deepEqual(typeof Log.create, "function", "Log.create is a function"); 8 | deepEqual(typeof Log.error, "function", "Log.error is a function"); 9 | deepEqual(typeof Log.info, "function", "Log.info is a function"); 10 | deepEqual(typeof Log.success, "function", "Log.success is a function"); 11 | }); 12 | 13 | test("logs create method", function () { 14 | expect(8); 15 | try { 16 | Log.create({}); 17 | } catch (error) { 18 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 19 | } 20 | try { 21 | Log.create("custom", {}); 22 | } catch (error) { 23 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 24 | } 25 | try { 26 | Log.create("custom", "Message", "!Number"); 27 | } catch (error) { 28 | deepEqual(error.message, "Invalid arguments", "Third argument error caught"); 29 | } 30 | try { 31 | Log.create("custom", "Logs Custom Message 1"); 32 | deepEqual(1, 1, "Optional parameter validated"); 33 | } catch (error) { 34 | } 35 | try { 36 | log = Log.create("custom", "Logs Custom Message 2", 5000); 37 | deepEqual(1, 1, "Optional parameter provided and valid"); 38 | } catch (error) { 39 | } 40 | deepEqual(log.delay, 5000, "log element delay properly set"); 41 | deepEqual(log.msg, "Logs Custom Message 2", "log element msg properly set"); 42 | deepEqual(log.type, "custom", "log element type properly set"); 43 | }); 44 | 45 | test("logs error method", function () { 46 | expect(4); 47 | try { 48 | Log.error({}); 49 | } catch (error) { 50 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 51 | } 52 | try { 53 | Log.error("Message", "!Number"); 54 | } catch (error) { 55 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 56 | } 57 | try { 58 | Log.error("Error Message 1"); 59 | deepEqual(1, 1, "Optional parameter validated"); 60 | } catch (error) { 61 | } 62 | try { 63 | Log.error("Error Message 2", 5000); 64 | deepEqual(1, 1, "Optional parameter provided and valid"); 65 | } catch (error) {} 66 | }); 67 | 68 | test("logs info method", function () { 69 | expect(4); 70 | try { 71 | Log.info({}); 72 | } catch (error) { 73 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 74 | } 75 | try { 76 | Log.info("Message", "!Number"); 77 | } catch (error) { 78 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 79 | } 80 | try { 81 | Log.info("Info Message 1"); 82 | deepEqual(1, 1, "Optional parameter validated"); 83 | } catch (error) { 84 | } 85 | try { 86 | Log.info("Info Message 2", 5000); 87 | deepEqual(1, 1, "Optional parameter provided and valid"); 88 | } catch (error) {} 89 | }); 90 | 91 | test("logs success method", function () { 92 | expect(4); 93 | try { 94 | Log.success({}); 95 | } catch (error) { 96 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 97 | } 98 | try { 99 | Log.success("Message", "!Number"); 100 | } catch (error) { 101 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 102 | } 103 | try { 104 | Log.success("Success Message 1"); 105 | deepEqual(1, 1, "Optional parameter validated"); 106 | } catch (error) { 107 | } 108 | try { 109 | Log.success("Success Message 2", 5000); 110 | deepEqual(1, 1, "Optional parameter provided and valid"); 111 | } catch (error) {} 112 | }); 113 | }); 114 | -------------------------------------------------------------------------------- /example/assets/js/lib/alertify/alertify.bootstrap.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Twitter Bootstrap Look and Feel 3 | * Based on http://twitter.github.com/bootstrap/ 4 | */ 5 | .alertify, 6 | .alertify-log { 7 | font-family: sans-serif; 8 | } 9 | .alertify { 10 | background: #FFF; 11 | border: 1px solid #8E8E8E; /* browsers that don't support rgba */ 12 | border: 1px solid rgba(0,0,0,.3); 13 | border-radius: 6px; 14 | box-shadow: 0 3px 7px rgba(0,0,0,.3); 15 | -webkit-background-clip: padding; /* Safari 4? Chrome 6? */ 16 | -moz-background-clip: padding; /* Firefox 3.6 */ 17 | background-clip: padding-box; /* Firefox 4, Safari 5, Opera 10, IE 9 */ 18 | } 19 | .alertify-dialog { 20 | padding: 0; 21 | } 22 | .alertify-inner { 23 | text-align: left; 24 | } 25 | .alertify-message { 26 | padding: 15px; 27 | margin: 0; 28 | } 29 | .alertify-text-wrapper { 30 | padding: 0 15px; 31 | } 32 | .alertify-text { 33 | color: #555; 34 | border-radius: 4px; 35 | padding: 8px; 36 | background-color: #FFF; 37 | border: 1px solid #CCC; 38 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 39 | } 40 | .alertify-text:focus { 41 | border-color: rgba(82,168,236,.8); 42 | outline: 0; 43 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); 44 | } 45 | 46 | .alertify-buttons { 47 | padding: 14px 15px 15px; 48 | background: #F5F5F5; 49 | border-top: 1px solid #DDD; 50 | border-radius: 0 0 6px 6px; 51 | box-shadow: inset 0 1px 0 #FFF; 52 | text-align: right; 53 | } 54 | .alertify-button, 55 | .alertify-button:hover, 56 | .alertify-button:focus, 57 | .alertify-button:active { 58 | margin-left: 10px; 59 | border-radius: 4px; 60 | font-weight: normal; 61 | padding: 4px 12px; 62 | text-decoration: none; 63 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05); 64 | background-image: -webkit-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 65 | background-image: -moz-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 66 | background-image: -ms-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 67 | background-image: -o-linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 68 | background-image: linear-gradient(top, rgba(255,255,255,.3), rgba(255,255,255,0)); 69 | } 70 | .alertify-button:focus { 71 | outline: none; 72 | box-shadow: 0 0 5px #2B72D5; 73 | } 74 | .alertify-button:active { 75 | position: relative; 76 | box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); 77 | } 78 | .alertify-button-cancel, 79 | .alertify-button-cancel:hover, 80 | .alertify-button-cancel:focus, 81 | .alertify-button-cancel:active { 82 | text-shadow: 0 -1px 0 rgba(255,255,255,.75); 83 | background-color: #E6E6E6; 84 | border: 1px solid #BBB; 85 | color: #333; 86 | background-image: -webkit-linear-gradient(top, #FFF, #E6E6E6); 87 | background-image: -moz-linear-gradient(top, #FFF, #E6E6E6); 88 | background-image: -ms-linear-gradient(top, #FFF, #E6E6E6); 89 | background-image: -o-linear-gradient(top, #FFF, #E6E6E6); 90 | background-image: linear-gradient(top, #FFF, #E6E6E6); 91 | } 92 | .alertify-button-cancel:hover, 93 | .alertify-button-cancel:focus, 94 | .alertify-button-cancel:active { 95 | background: #E6E6E6; 96 | } 97 | .alertify-button-ok, 98 | .alertify-button-ok:hover, 99 | .alertify-button-ok:focus, 100 | .alertify-button-ok:active { 101 | text-shadow: 0 -1px 0 rgba(0,0,0,.25); 102 | background-color: #04C; 103 | border: 1px solid #04C; 104 | border-color: #04C #04C #002A80; 105 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 106 | color: #FFF; 107 | } 108 | .alertify-button-ok:hover, 109 | .alertify-button-ok:focus, 110 | .alertify-button-ok:active { 111 | background: #04C; 112 | } 113 | 114 | .alertify-log { 115 | background: #D9EDF7; 116 | padding: 8px 14px; 117 | border-radius: 4px; 118 | color: #3A8ABF; 119 | text-shadow: 0 1px 0 rgba(255,255,255,.5); 120 | border: 1px solid #BCE8F1; 121 | } 122 | .alertify-log-error { 123 | color: #B94A48; 124 | background: #F2DEDE; 125 | border: 1px solid #EED3D7; 126 | } 127 | .alertify-log-success { 128 | color: #468847; 129 | background: #DFF0D8; 130 | border: 1px solid #D6E9C6; 131 | } -------------------------------------------------------------------------------- /sass/_dialog.bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/_design.scss"; 2 | @import "mixins/_prefix.scss"; 3 | 4 | // dialog default configs 5 | $dialogWidth : 550px; 6 | 7 | .alertify-dialog { 8 | width: $dialogWidth; 9 | margin-left: -$dialogWidth * .5; 10 | background: #FFF; 11 | border: 1px solid #8E8E8E; /* browsers that don't support rgba */ 12 | border: 1px solid rgba(0,0,0,.3); 13 | border-radius: 6px; 14 | box-shadow: 0 3px 7px rgba(0,0,0,.3); 15 | @include prefix(background-clip, padding, true, true, false, false, false); 16 | background-clip: padding-box; 17 | } 18 | .alertify-message { 19 | padding: 15px; 20 | margin: 0; 21 | } 22 | .alertify-text-wrapper { 23 | padding: 0 15px; 24 | } 25 | .alertify-text { 26 | color: #555; 27 | border-radius: 4px; 28 | padding: 8px; 29 | background-color: #FFF; 30 | border: 1px solid #CCC; 31 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075); 32 | 33 | &:focus { 34 | border-color: rgba(82,168,236,.8); 35 | outline: 0; 36 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); 37 | } 38 | } 39 | .alertify-buttons { 40 | padding: 14px 15px 15px; 41 | background: #F5F5F5; 42 | border-top: 1px solid #DDD; 43 | border-radius: 0 0 6px 6px; 44 | box-shadow: inset 0 1px 0 #FFF; 45 | text-align: right; 46 | } 47 | .alertify-button, 48 | .alertify-button:hover, 49 | .alertify-button:focus, 50 | .alertify-button:active { 51 | margin-left: 10px; 52 | border-radius: 4px; 53 | font-weight: normal; 54 | padding: 4px 12px; 55 | text-decoration: none; 56 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 57 | 0 1px 2px rgba(0, 0, 0, .05); 58 | @include linear-gradient( (top, rgba(255,255,255,.3), rgba(255,255,255,0)) ); 59 | } 60 | .alertify-button:focus { 61 | outline: none; 62 | box-shadow: 0 0 5px #2B72D5; 63 | } 64 | .alertify-button:active { 65 | position: relative; 66 | box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 67 | 0 1px 2px rgba(0,0,0,.05); 68 | } 69 | .alertify-button-cancel, 70 | .alertify-button-cancel:hover, 71 | .alertify-button-cancel:focus, 72 | .alertify-button-cancel:active { 73 | text-shadow: 0 -1px 0 rgba(255,255,255,.75); 74 | background-color: #E6E6E6; 75 | border: 1px solid #BBB; 76 | color: #333; 77 | @include linear-gradient( (top, #FFF, #E6E6E6) ); 78 | } 79 | .alertify-button-cancel:hover, 80 | .alertify-button-cancel:focus, 81 | .alertify-button-cancel:active { 82 | background: #E6E6E6; 83 | } 84 | .alertify-button-ok, 85 | .alertify-button-ok:hover, 86 | .alertify-button-ok:focus, 87 | .alertify-button-ok:active { 88 | text-shadow: 0 -1px 0 rgba(0,0,0,.25); 89 | background-color: #04C; 90 | border: 1px solid #04C; 91 | border-color: #04C #04C #002A80; 92 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 93 | color: #FFF; 94 | } 95 | .alertify-button-ok:hover, 96 | .alertify-button-ok:focus, 97 | .alertify-button-ok:active { 98 | background: #04C; 99 | } 100 | 101 | @media only screen and (max-width: 680px) { 102 | .alertify-dialog { 103 | width: 90%; 104 | left: 5%; 105 | margin: 0; 106 | @include prefix(box-sizing, border-box); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /test/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** 2 | * QUnit v1.9.0 - A JavaScript Unit Testing Framework 3 | * 4 | * http://docs.jquery.com/QUnit 5 | * 6 | * Copyright (c) 2012 John Resig, Jörn Zaefferer 7 | * Dual licensed under the MIT (MIT-LICENSE.txt) 8 | * or GPL (GPL-LICENSE.txt) licenses. 9 | */ 10 | 11 | /** Font Family and Sizes */ 12 | 13 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 14 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; 15 | } 16 | 17 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 18 | #qunit-tests { font-size: smaller; } 19 | 20 | 21 | /** Resets */ 22 | 23 | #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { 24 | margin: 0; 25 | padding: 0; 26 | } 27 | 28 | 29 | /** Header */ 30 | 31 | #qunit-header { 32 | padding: 0.5em 0 0.5em 1em; 33 | 34 | color: #8699a4; 35 | background-color: #0d3349; 36 | 37 | font-size: 1.5em; 38 | line-height: 1em; 39 | font-weight: normal; 40 | 41 | border-radius: 5px 5px 0 0; 42 | -moz-border-radius: 5px 5px 0 0; 43 | -webkit-border-top-right-radius: 5px; 44 | -webkit-border-top-left-radius: 5px; 45 | } 46 | 47 | #qunit-header a { 48 | text-decoration: none; 49 | color: #c2ccd1; 50 | } 51 | 52 | #qunit-header a:hover, 53 | #qunit-header a:focus { 54 | color: #fff; 55 | } 56 | 57 | #qunit-testrunner-toolbar label { 58 | display: inline-block; 59 | padding: 0 .5em 0 .1em; 60 | } 61 | 62 | #qunit-banner { 63 | height: 5px; 64 | } 65 | 66 | #qunit-testrunner-toolbar { 67 | padding: 0.5em 0 0.5em 2em; 68 | color: #5E740B; 69 | background-color: #eee; 70 | } 71 | 72 | #qunit-userAgent { 73 | padding: 0.5em 0 0.5em 2.5em; 74 | background-color: #2b81af; 75 | color: #fff; 76 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 77 | } 78 | 79 | 80 | /** Tests: Pass/Fail */ 81 | 82 | #qunit-tests { 83 | list-style-position: inside; 84 | } 85 | 86 | #qunit-tests li { 87 | padding: 0.4em 0.5em 0.4em 2.5em; 88 | border-bottom: 1px solid #fff; 89 | list-style-position: inside; 90 | } 91 | 92 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 93 | display: none; 94 | } 95 | 96 | #qunit-tests li strong { 97 | cursor: pointer; 98 | } 99 | 100 | #qunit-tests li a { 101 | padding: 0.5em; 102 | color: #c2ccd1; 103 | text-decoration: none; 104 | } 105 | #qunit-tests li a:hover, 106 | #qunit-tests li a:focus { 107 | color: #000; 108 | } 109 | 110 | #qunit-tests ol { 111 | margin-top: 0.5em; 112 | padding: 0.5em; 113 | 114 | background-color: #fff; 115 | 116 | border-radius: 5px; 117 | -moz-border-radius: 5px; 118 | -webkit-border-radius: 5px; 119 | } 120 | 121 | #qunit-tests table { 122 | border-collapse: collapse; 123 | margin-top: .2em; 124 | } 125 | 126 | #qunit-tests th { 127 | text-align: right; 128 | vertical-align: top; 129 | padding: 0 .5em 0 0; 130 | } 131 | 132 | #qunit-tests td { 133 | vertical-align: top; 134 | } 135 | 136 | #qunit-tests pre { 137 | margin: 0; 138 | white-space: pre-wrap; 139 | word-wrap: break-word; 140 | } 141 | 142 | #qunit-tests del { 143 | background-color: #e0f2be; 144 | color: #374e0c; 145 | text-decoration: none; 146 | } 147 | 148 | #qunit-tests ins { 149 | background-color: #ffcaca; 150 | color: #500; 151 | text-decoration: none; 152 | } 153 | 154 | /*** Test Counts */ 155 | 156 | #qunit-tests b.counts { color: black; } 157 | #qunit-tests b.passed { color: #5E740B; } 158 | #qunit-tests b.failed { color: #710909; } 159 | 160 | #qunit-tests li li { 161 | padding: 5px; 162 | background-color: #fff; 163 | border-bottom: none; 164 | list-style-position: inside; 165 | } 166 | 167 | /*** Passing Styles */ 168 | 169 | #qunit-tests li li.pass { 170 | color: #3c510c; 171 | background-color: #fff; 172 | border-left: 10px solid #C6E746; 173 | } 174 | 175 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 176 | #qunit-tests .pass .test-name { color: #366097; } 177 | 178 | #qunit-tests .pass .test-actual, 179 | #qunit-tests .pass .test-expected { color: #999999; } 180 | 181 | #qunit-banner.qunit-pass { background-color: #C6E746; } 182 | 183 | /*** Failing Styles */ 184 | 185 | #qunit-tests li li.fail { 186 | color: #710909; 187 | background-color: #fff; 188 | border-left: 10px solid #EE5757; 189 | white-space: pre; 190 | } 191 | 192 | #qunit-tests > li:last-child { 193 | border-radius: 0 0 5px 5px; 194 | -moz-border-radius: 0 0 5px 5px; 195 | -webkit-border-bottom-right-radius: 5px; 196 | -webkit-border-bottom-left-radius: 5px; 197 | } 198 | 199 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 200 | #qunit-tests .fail .test-name, 201 | #qunit-tests .fail .module-name { color: #000000; } 202 | 203 | #qunit-tests .fail .test-actual { color: #EE5757; } 204 | #qunit-tests .fail .test-expected { color: green; } 205 | 206 | #qunit-banner.qunit-fail { background-color: #EE5757; } 207 | 208 | 209 | /** Result */ 210 | 211 | #qunit-testresult { 212 | padding: 0.5em 0.5em 0.5em 2.5em; 213 | 214 | color: #2b81af; 215 | background-color: #D2E0E6; 216 | 217 | border-bottom: 1px solid white; 218 | } 219 | #qunit-testresult .module-name { 220 | font-weight: bold; 221 | } 222 | 223 | /** Fixture */ 224 | 225 | #qunit-fixture { 226 | position: absolute; 227 | top: -10000px; 228 | left: -10000px; 229 | width: 1000px; 230 | height: 1000px; 231 | } -------------------------------------------------------------------------------- /example/assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | @import "_global.scss"; 2 | 3 | body { 4 | font: normal #{$fontSize}/#{$lineHeight} $sansSerif; 5 | color: #333; 6 | background: #FFF; 7 | } 8 | 9 | @import "modules/_import.scss"; 10 | @import "_fontAwesome.scss"; 11 | 12 | h1, h2, h3, h4, h5, h6 { 13 | line-height: 1.2; 14 | font-weight: normal; 15 | } 16 | h1 { 17 | font-size: $fontSize * 4; 18 | text-align: center; 19 | font-family: "lato", $sansSerif; 20 | color: #FFF; 21 | margin: 0 0 $spacing * 2; 22 | } 23 | h2 { 24 | font-size: $fontSize * 2.5; 25 | font-family: "lato", $sansSerif; 26 | font-weight: 900; 27 | text-align: center; 28 | position: relative; 29 | z-index: 1; 30 | 31 | span { 32 | display: inline-block; 33 | padding: $spacing; 34 | background: #FFF; 35 | } 36 | 37 | &:before { 38 | position: absolute; 39 | z-index: -1; 40 | top: 55%; left: 0; right: 0; 41 | border-top: 1px dashed #AAA; 42 | border-bottom: 1px dashed #F5F5F5; 43 | content: ""; 44 | } 45 | } 46 | h3 { 47 | font: bold #{$fontSize * 1.25}/1.2 $sansSerif; 48 | margin: 0 0 $spacing; 49 | } 50 | 51 | h4 { 52 | font: bold #{$fontSize}/1.2 $sansSerif; 53 | } 54 | 55 | p { 56 | margin: 0 0 $spacing; 57 | } 58 | 59 | a { 60 | color: #0C7AB9; 61 | 62 | &:hover { 63 | color: #FFF; 64 | background: #0C7AB9; 65 | text-decoration: none; 66 | } 67 | } 68 | 69 | .container { 70 | width: 900px; 71 | margin: 0 auto; 72 | } 73 | 74 | .masthead { 75 | padding: $spacing 0; 76 | background: url(../img/banner.jpg) no-repeat center 0; 77 | margin-bottom: $spacing * 3; 78 | 79 | img { 80 | display: block; 81 | margin: 0 auto; 82 | } 83 | } 84 | 85 | .cta { 86 | text-align: center; 87 | 88 | .button-primary { 89 | padding: $spacing $spacing * 2; 90 | @include prefix(box-sizing, border-bottom); 91 | } 92 | } 93 | 94 | .small { 95 | font-size: $fontSize * .75; 96 | font-weight: normal; 97 | } 98 | 99 | .footer { 100 | background: #13181F; 101 | color: #666; 102 | text-align: center; 103 | padding: $spacing * 2 0; 104 | 105 | a { 106 | color: #FFF; 107 | text-decoration: none; 108 | } 109 | 110 | i { margin-right: 4px; } 111 | } 112 | 113 | .featured-list { 114 | list-style: none; 115 | text-align: center; 116 | margin: $spacing * 4 0 0; 117 | padding: 0; 118 | 119 | li { 120 | display: inline-block; 121 | margin: 0 $spacing $spacing; 122 | 123 | a { 124 | position: relative; 125 | display: block; 126 | color: #666; 127 | 128 | &:before { 129 | content: ""; 130 | display: block; 131 | margin: 0 auto 5px; 132 | } 133 | 134 | &:hover { 135 | background: none; 136 | color: #FFF; 137 | } 138 | } 139 | } 140 | 141 | .treehouse:before { 142 | background: url(../img/treehouse.png) no-repeat center bottom; 143 | width: 58px; height: 42px; 144 | } 145 | .webdev:before { 146 | background: url(../img/webdev.png) no-repeat center bottom; 147 | width: 103px; height: 42px; 148 | } 149 | } 150 | 151 | .block { 152 | margin-bottom: $spacing * 3; 153 | } 154 | 155 | .mh-logo { 156 | font-family: "lato", $sansSerif; 157 | font-weight: 900; 158 | text-transform: uppercase; 159 | font-size: $fontSize * 1.5; 160 | text-align: center; 161 | color: #7A7C7C; 162 | 163 | .extension { 164 | text-transform: none; 165 | } 166 | } 167 | 168 | .feature { 169 | float: left; 170 | width: 47%; 171 | margin-bottom: $spacing; 172 | 173 | &.alt { 174 | float: right; 175 | } 176 | 177 | .mediaAside { 178 | font-size: $fontSize * 2; 179 | line-height: 1; 180 | margin: 0; 181 | width: 60px; 182 | } 183 | } 184 | 185 | .row { 186 | @extend .clearfix; 187 | } 188 | 189 | .syntaxhighlighter .toolbar { 190 | display: none; 191 | } 192 | 193 | .button-group { 194 | margin: 0; 195 | font-size: 0; 196 | } 197 | 198 | .button-primary { 199 | font-size: $fontSize; 200 | background: #0C7AB9; 201 | color: #FFF; 202 | display: inline-block; 203 | padding: $spacing * .25 $spacing; 204 | text-decoration: none; 205 | font-weight: bold; 206 | border-radius: 2px; 207 | margin: 0 5px 5px 0; 208 | 209 | &:hover, 210 | &:focus { 211 | background: darken(#0C7AB9, 7%); 212 | outline: none; 213 | } 214 | &:focus { 215 | box-shadow: 0 0 10px lighten(#0C7AB9, 10%); 216 | } 217 | &:active { 218 | box-shadow: inset 0 3px 3px rgba(0,0,0,.25); 219 | } 220 | 221 | &.is-disabled { 222 | opacity: .5; 223 | } 224 | } 225 | 226 | @media only screen and (max-width: 980px) { 227 | .container { width: 95%; } 228 | .button { margin-bottom: $spacing; } 229 | } 230 | 231 | @media only screen and (max-width: 830px) { 232 | img { 233 | max-width: 100%; 234 | height: auto; 235 | } 236 | 237 | .feature, 238 | .alt { 239 | float: none; 240 | width: 100%; 241 | } 242 | } 243 | 244 | @media only screen and (max-width: 640px) { 245 | .mh-logo { 246 | font-size: $fontSize * .8; 247 | } 248 | 249 | h1 { 250 | font-size: $fontSize * 1.5; 251 | } 252 | 253 | h2 { 254 | font-size: $fontSize * 1.5; 255 | } 256 | } -------------------------------------------------------------------------------- /test/specs/dialog.test.js: -------------------------------------------------------------------------------- 1 | define(["../../src/dialog"], function (Dialog) { 2 | module("Alertify Dialog Properties"); 3 | 4 | test("dialog properties", function () { 5 | expect(12); 6 | var d = Dialog; 7 | deepEqual(d.buttonFocus, "ok", "Initial button focus is OK"); 8 | deepEqual(d.buttonReverse, false, "Initial button order is default"); 9 | deepEqual(typeof d.cover, "undefined", "Initial cover element is undefined"); 10 | deepEqual(typeof d.el, "undefined", "Initial dialog element is undefined"); 11 | deepEqual(d.labels.ok, "OK", "Initial ok button label is OK"); 12 | deepEqual(d.labels.cancel, "Cancel", "Initial cancel button label is Cancel"); 13 | 14 | d.alert("test"); 15 | deepEqual(typeof d.cover, "object", "Cover element gets created"); 16 | deepEqual(typeof d.el, "object", "Dialog element gets created"); 17 | 18 | d.buttonFocus = "cancel"; 19 | deepEqual(d.buttonFocus, "cancel", "Initial button focus can be changed"); 20 | 21 | d.buttonReverse = true; 22 | deepEqual(d.buttonReverse, true, "Initial button order can be changed"); 23 | 24 | d.labels.ok = "Yes"; 25 | d.labels.cancel = "No"; 26 | deepEqual(d.labels.ok, "Yes", "Initial ok label can be changed"); 27 | deepEqual(d.labels.cancel, "No", "Initial cancel label can be changed"); 28 | }); 29 | 30 | module("Alertify Dialog"); 31 | 32 | test("dialog object API", function () { 33 | expect(6); 34 | deepEqual(typeof Dialog.labels, "object", "Dialog.labels is an object"); 35 | deepEqual(typeof Dialog.labels.ok, "string", "Dialog.labels.ok is a string"); 36 | deepEqual(typeof Dialog.labels.cancel, "string", "Dialog.labels.cancel is a string"); 37 | deepEqual(typeof Dialog.alert, "function", "Dialog.alert is a function"); 38 | deepEqual(typeof Dialog.confirm, "function", "Dialog.confirm is a function"); 39 | deepEqual(typeof Dialog.prompt, "function", "Dialog.prompt is a function"); 40 | }); 41 | 42 | test("dialog chaining", function () { 43 | expect(3); 44 | try { 45 | Dialog.confirm("Alert chaining").alert("Alert chaining 2"); 46 | deepEqual(1, 1, "Alert chaining works"); 47 | } catch (error) {} 48 | try { 49 | Dialog.confirm("Confirm chaining").alert("Confirm chaining 2"); 50 | deepEqual(1, 1, "Confirm chaining works"); 51 | } catch (error) {} 52 | try { 53 | Dialog.prompt("Prompt chaining").alert("Prompt chaining 2"); 54 | deepEqual(1, 1, "Prompt chaining works"); 55 | } catch (error) {} 56 | }); 57 | 58 | test("dialog alert method", function () { 59 | expect(4); 60 | try { 61 | Dialog.alert({}); 62 | } catch (error) { 63 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 64 | } 65 | try { 66 | Dialog.alert("Message", "!Function"); 67 | } catch (error) { 68 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 69 | } 70 | try { 71 | Dialog.alert("Message"); 72 | deepEqual(1, 1, "Optional parameter validated"); 73 | } catch (error) { 74 | } 75 | try { 76 | Dialog.alert("Message", function () {}); 77 | deepEqual(1, 1, "Optional parameter provided and valid"); 78 | } catch (error) { 79 | } 80 | }); 81 | 82 | test("dialog confirm method", function () { 83 | expect(6); 84 | try { 85 | Dialog.confirm({}); 86 | } catch (error) { 87 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 88 | } 89 | try { 90 | Dialog.confirm("Message", "!Function"); 91 | } catch (error) { 92 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 93 | } 94 | try { 95 | Dialog.confirm("Message", function () {}, "!Function"); 96 | } catch (error) { 97 | deepEqual(error.message, "Invalid arguments", "Third argument error caught"); 98 | } 99 | try { 100 | Dialog.confirm("Message"); 101 | deepEqual(1, 1, "Optional parameter validated"); 102 | } catch (error) { 103 | } 104 | try { 105 | Dialog.confirm("Message", function () {}); 106 | deepEqual(1, 1, "Optional parameter provided and valid"); 107 | } catch (error) { 108 | } 109 | try { 110 | Dialog.confirm("Message", function () {}, function () {}); 111 | deepEqual(1, 1, "Optional parameters provided and valid"); 112 | } catch (error) { 113 | } 114 | }); 115 | 116 | test("dialog prompt method", function () { 117 | expect(8); 118 | try { 119 | Dialog.prompt({}); 120 | } catch (error) { 121 | deepEqual(error.message, "Invalid arguments", "First argument error caught"); 122 | } 123 | try { 124 | Dialog.prompt("Message", "!Function"); 125 | } catch (error) { 126 | deepEqual(error.message, "Invalid arguments", "Second argument error caught"); 127 | } 128 | try { 129 | Dialog.prompt("Message", function () {}, "!Function"); 130 | } catch (error) { 131 | deepEqual(error.message, "Invalid arguments", "Third argument error caught"); 132 | } 133 | try { 134 | Dialog.prompt("Message", function () {}, function () {}, {}); 135 | } catch (error) { 136 | deepEqual(error.message, "Invalid arguments", "Fourth argument error caught"); 137 | } 138 | try { 139 | Dialog.prompt("Message"); 140 | deepEqual(1, 1, "Optional parameter validated"); 141 | } catch (error) { 142 | } 143 | try { 144 | Dialog.prompt("Message", function () {}); 145 | deepEqual(1, 1, "Optional parameter provided and valid"); 146 | } catch (error) { 147 | } 148 | try { 149 | Dialog.prompt("Message", function () {}, function () {}); 150 | deepEqual(1, 1, "Optional parameters provided and valid"); 151 | } catch (error) { 152 | } 153 | try { 154 | Dialog.prompt("Message", function () {}, function () {}, "Placeholder"); 155 | deepEqual(1, 1, "Optional parameters provided and valid"); 156 | } catch (error) { 157 | } 158 | }); 159 | }); 160 | -------------------------------------------------------------------------------- /example/assets/js/lib/sh/shCore.css: -------------------------------------------------------------------------------- 1 | .syntaxhighlighter a, 2 | .syntaxhighlighter div, 3 | .syntaxhighlighter code, 4 | .syntaxhighlighter table, 5 | .syntaxhighlighter table td, 6 | .syntaxhighlighter table tr, 7 | .syntaxhighlighter table tbody, 8 | .syntaxhighlighter table thead, 9 | .syntaxhighlighter table caption, 10 | .syntaxhighlighter textarea { 11 | -moz-border-radius: 0 0 0 0 !important; 12 | -webkit-border-radius: 0 0 0 0 !important; 13 | background: none !important; 14 | border: 0 !important; 15 | bottom: auto !important; 16 | float: none !important; 17 | height: auto !important; 18 | left: auto !important; 19 | line-height: 1.1em !important; 20 | margin: 0 !important; 21 | outline: 0 !important; 22 | overflow: visible !important; 23 | padding: 0 !important; 24 | position: static !important; 25 | right: auto !important; 26 | text-align: left !important; 27 | top: auto !important; 28 | vertical-align: baseline !important; 29 | width: auto !important; 30 | box-sizing: content-box !important; 31 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 32 | font-weight: normal !important; 33 | font-style: normal !important; 34 | font-size: 1em !important; 35 | min-height: inherit !important; 36 | min-height: auto !important; 37 | } 38 | 39 | .syntaxhighlighter { 40 | width: 100% !important; 41 | margin: 1em 0 1em 0 !important; 42 | position: relative !important; 43 | overflow: auto !important; 44 | font-size: 1em !important; 45 | } 46 | .syntaxhighlighter.source { 47 | overflow: hidden !important; 48 | } 49 | .syntaxhighlighter .bold { 50 | font-weight: bold !important; 51 | } 52 | .syntaxhighlighter .italic { 53 | font-style: italic !important; 54 | } 55 | .syntaxhighlighter .line { 56 | white-space: pre !important; 57 | } 58 | .syntaxhighlighter table { 59 | width: 100% !important; 60 | } 61 | .syntaxhighlighter table caption { 62 | text-align: left !important; 63 | padding: .5em 0 0.5em 1em !important; 64 | } 65 | .syntaxhighlighter table td.code { 66 | width: 100% !important; 67 | } 68 | .syntaxhighlighter table td.code .container { 69 | position: relative !important; 70 | } 71 | .syntaxhighlighter table td.code .container textarea { 72 | box-sizing: border-box !important; 73 | position: absolute !important; 74 | left: 0 !important; 75 | top: 0 !important; 76 | width: 100% !important; 77 | height: 100% !important; 78 | border: none !important; 79 | background: white !important; 80 | padding-left: 1em !important; 81 | overflow: hidden !important; 82 | white-space: pre !important; 83 | } 84 | .syntaxhighlighter table td.gutter .line { 85 | text-align: right !important; 86 | padding: 0 0.5em 0 1em !important; 87 | } 88 | .syntaxhighlighter table td.code .line { 89 | padding: 0 1em !important; 90 | } 91 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 92 | padding-left: 0em !important; 93 | } 94 | .syntaxhighlighter.show { 95 | display: block !important; 96 | } 97 | .syntaxhighlighter.collapsed table { 98 | display: none !important; 99 | } 100 | .syntaxhighlighter.collapsed .toolbar { 101 | padding: 0.1em 0.8em 0em 0.8em !important; 102 | font-size: 1em !important; 103 | position: static !important; 104 | width: auto !important; 105 | height: auto !important; 106 | } 107 | .syntaxhighlighter.collapsed .toolbar span { 108 | display: inline !important; 109 | margin-right: 1em !important; 110 | } 111 | .syntaxhighlighter.collapsed .toolbar span a { 112 | padding: 0 !important; 113 | display: none !important; 114 | } 115 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 116 | display: inline !important; 117 | } 118 | .syntaxhighlighter .toolbar { 119 | position: absolute !important; 120 | right: 1px !important; 121 | top: 1px !important; 122 | width: 11px !important; 123 | height: 11px !important; 124 | font-size: 10px !important; 125 | z-index: 10 !important; 126 | } 127 | .syntaxhighlighter .toolbar span.title { 128 | display: inline !important; 129 | } 130 | .syntaxhighlighter .toolbar a { 131 | display: block !important; 132 | text-align: center !important; 133 | text-decoration: none !important; 134 | padding-top: 1px !important; 135 | } 136 | .syntaxhighlighter .toolbar a.expandSource { 137 | display: none !important; 138 | } 139 | .syntaxhighlighter.ie { 140 | font-size: .9em !important; 141 | padding: 1px 0 1px 0 !important; 142 | } 143 | .syntaxhighlighter.ie .toolbar { 144 | line-height: 8px !important; 145 | } 146 | .syntaxhighlighter.ie .toolbar a { 147 | padding-top: 0px !important; 148 | } 149 | .syntaxhighlighter.printing .line.alt1 .content, 150 | .syntaxhighlighter.printing .line.alt2 .content, 151 | .syntaxhighlighter.printing .line.highlighted .number, 152 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 153 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 154 | background: none !important; 155 | } 156 | .syntaxhighlighter.printing .line .number { 157 | color: #bbbbbb !important; 158 | } 159 | .syntaxhighlighter.printing .line .content { 160 | color: black !important; 161 | } 162 | .syntaxhighlighter.printing .toolbar { 163 | display: none !important; 164 | } 165 | .syntaxhighlighter.printing a { 166 | text-decoration: none !important; 167 | } 168 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 169 | color: black !important; 170 | } 171 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 172 | color: #008200 !important; 173 | } 174 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 175 | color: blue !important; 176 | } 177 | .syntaxhighlighter.printing .keyword { 178 | color: #006699 !important; 179 | font-weight: bold !important; 180 | } 181 | .syntaxhighlighter.printing .preprocessor { 182 | color: gray !important; 183 | } 184 | .syntaxhighlighter.printing .variable { 185 | color: #aa7700 !important; 186 | } 187 | .syntaxhighlighter.printing .value { 188 | color: #009900 !important; 189 | } 190 | .syntaxhighlighter.printing .functions { 191 | color: #ff1493 !important; 192 | } 193 | .syntaxhighlighter.printing .constants { 194 | color: #0066cc !important; 195 | } 196 | .syntaxhighlighter.printing .script { 197 | font-weight: bold !important; 198 | } 199 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 200 | color: gray !important; 201 | } 202 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 203 | color: #ff1493 !important; 204 | } 205 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 206 | color: red !important; 207 | } 208 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 209 | color: black !important; 210 | } 211 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | var requirejs = require("requirejs"); 2 | requirejs.config({ 3 | appDir : __dirname + "/src/", 4 | baseUrl : __dirname + "/src/" 5 | }); 6 | 7 | var generateInit = requirejs("generate"); 8 | 9 | module.exports = function (grunt) { 10 | "use strict"; 11 | 12 | grunt.loadNpmTasks("grunt-contrib-jshint"); 13 | grunt.loadNpmTasks("grunt-contrib-qunit"); 14 | grunt.loadNpmTasks("grunt-contrib-clean"); 15 | grunt.loadNpmTasks("grunt-contrib-connect"); 16 | grunt.loadNpmTasks("grunt-contrib-requirejs"); 17 | grunt.loadNpmTasks("grunt-contrib-copy"); 18 | grunt.loadNpmTasks("grunt-contrib-uglify"); 19 | grunt.loadNpmTasks('grunt-contrib-compass'); 20 | 21 | var license = "/*!\n" + 22 | " * <%= pkg.name %>.js\n" + 23 | " * <%= pkg.description %>\n" + 24 | " *\n" + 25 | " * @author <%= pkg.author.name %> <<%= pkg.author.email %>>\n" + 26 | " * @copyright <%= pkg.author.name %> <%= grunt.template.today('yyyy') %>\n" + 27 | " * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>\n" + 28 | " * @link <%= pkg.homepage %>\n" + 29 | " * @module <%= pkg.name %>\n" + 30 | " * @version <%= pkg.version %>\n" + 31 | " */"; 32 | 33 | grunt.initConfig({ 34 | pkg: grunt.file.readJSON("package.json"), 35 | clean: { 36 | build: ["build", "dist", "tmp"], 37 | postbuild: ["build", "tmp"] 38 | }, 39 | compass: { 40 | dist: { 41 | options: { 42 | sassDir: "sass", 43 | cssDir: "dist/themes", 44 | environment: "production", 45 | outputStyle: "nested" 46 | } 47 | } 48 | }, 49 | connect: { 50 | server: { 51 | options: { 52 | port: 9001, 53 | keepalive: true, 54 | base: '' 55 | } 56 | } 57 | }, 58 | copy: { 59 | build: { 60 | files: { 61 | "dist/alertify.js": "build/src/alertify.js" 62 | } 63 | } 64 | }, 65 | generateinit : { 66 | build: { 67 | src: ["tmp/alertify.init.js"] 68 | } 69 | }, 70 | jshint: { 71 | files: { 72 | src: ["src/**/*.js"] 73 | }, 74 | options: { 75 | curly : true, 76 | eqeqeq : true, 77 | immed : true, 78 | latedef : true, 79 | noempty : true, 80 | newcap : true, 81 | noarg : true, 82 | sub : true, 83 | undef : true, 84 | boss : true, 85 | eqnull : true, 86 | node : true, 87 | smarttabs : true, 88 | es5 : true, 89 | globals: { 90 | Alertify : true, 91 | document : true, 92 | require : true, 93 | define : true 94 | } 95 | } 96 | }, 97 | qunit: { 98 | all: ["test/**/*.html"] 99 | }, 100 | requirejs: { 101 | compile: { 102 | options: { 103 | dir: "build", 104 | appDir: ".", 105 | baseUrl: "src", 106 | optimize: "none", 107 | paths: { 108 | "alertify.init": "../tmp/alertify.init" 109 | }, 110 | modules: [{ 111 | "name": "alertify", 112 | "include": ["alertify.init"], 113 | "create": true 114 | }], 115 | wrap: { 116 | start: license + "\n(function (global, document, undefined) {", 117 | end: "})(this, document);" 118 | }, 119 | fileExclusionRegExp: /^(.git|node_modules|example|test)$/, 120 | onBuildWrite: function (id, path, contents) { 121 | if ((/^define\([\s\S]+?\{/).test(contents)) { 122 | //Remove AMD ceremony for use without require.js or 123 | //almond.js 124 | contents = contents.replace(/^define\([\s\S]+?\{/, ''); 125 | contents = contents.replace(/\}\s*?\);\s*?$/, ''); 126 | //remove last return statement and trailing }) 127 | contents = contents.replace(/return.*[^return]*$/, ''); 128 | } else if ((/^require\([\s\S]+?\{/).test(contents)) { 129 | contents = contents.replace(/require\([\s\S]+?\{/, ''); 130 | contents = contents.replace(/\}\)\;/, ''); 131 | } 132 | 133 | return contents; 134 | } 135 | } 136 | } 137 | }, 138 | stripdefine: { 139 | build: { 140 | src: ["dist/alertify.js"] 141 | } 142 | }, 143 | uglify: { 144 | options: { 145 | banner: "/*! <%= pkg.name %> <%= pkg.version %> (<%= pkg.author.name %>) | <%= pkg.licenses[0].type %> */\n" 146 | }, 147 | dist: { 148 | files: { 149 | "dist/alertify.min.js": ["dist/alertify.js"] 150 | } 151 | } 152 | }, 153 | watch: { 154 | files: "", 155 | tasks: "lint" 156 | } 157 | }); 158 | 159 | grunt.registerMultiTask("stripdefine", "Strip define call from dist file", function () { 160 | this.filesSrc.forEach( function ( filepath ) { 161 | var mod = grunt.file.read( filepath ) 162 | .replace( /define\("alertify", function\(\)\{\}\);/g, "" ) 163 | .replace( /define\("alertify.init", function\(\)\{\}\);/g, "" ) 164 | .replace( /\/\/;/g, "" ); 165 | 166 | grunt.file.write( "dist/alertify.js", mod ); 167 | }); 168 | }); 169 | 170 | grunt.registerMultiTask("generateinit", "Generate Init file", function () { 171 | grunt.file.write("tmp/alertify.init.js", generateInit()); 172 | }); 173 | 174 | grunt.registerTask("build", ["jshint", "qunit", "clean:build", "generateinit", "requirejs", "copy", "clean:postbuild", "stripdefine", "compass", "uglify"]); 175 | grunt.registerTask("test", ["jshint", "qunit"]); 176 | grunt.registerTask("default", ["build"]); 177 | }; -------------------------------------------------------------------------------- /example/assets/js/lib/alertify/alertify.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * alertify 3 | * An unobtrusive customizable JavaScript notification system 4 | * 5 | * @author Fabien Doiron 6 | * @copyright Fabien Doiron 2013 7 | * @license MIT 8 | * @link http://fabien-d.github.com/alertify.js/ 9 | * @module alertify 10 | * @version 0.3.7 11 | */ 12 | (function(e,t){"use strict";var n=e.document,r;r=function(){var r={},i={},s=!1,o={ENTER:13,ESC:27,SPACE:32},u=[],a,f,l,c,h,p,d,v,m,g,y,b;return i={buttons:{holder:'',submit:'',ok:'{{ok}}',cancel:'{{cancel}}'},input:'
',message:'

{{message}}

',log:'
{{message}}
'},b=function(){var e,r=n.createElement("fakeelement"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"};for(e in i)if(r.style[e]!==t)return i[e]},a=function(e){return n.getElementById(e)},r={labels:{ok:"OK",cancel:"Cancel"},delay:5e3,buttonReverse:!1,buttonFocus:"ok",transition:t,addListeners:function(e){var t=typeof l!="undefined",r=typeof f!="undefined",i=typeof y!="undefined",s="",u=this,a,h,p,d,v;a=function(t){return typeof t.preventDefault!="undefined"&&t.preventDefault(),p(t),typeof y!="undefined"&&(s=y.value),typeof e=="function"&&(typeof y!="undefined"?e(!0,s):e(!0)),!1},h=function(t){return typeof t.preventDefault!="undefined"&&t.preventDefault(),p(t),typeof e=="function"&&e(!1),!1},p=function(e){u.hide(),u.unbind(n.body,"keyup",d),u.unbind(c,"focus",v),i&&u.unbind(g,"submit",a),t&&u.unbind(l,"click",a),r&&u.unbind(f,"click",h)},d=function(e){var t=e.keyCode;t===o.SPACE&&!i&&a(e),t===o.ESC&&r&&h(e)},v=function(e){i?y.focus():r?f.focus():l.focus()},this.bind(c,"focus",v),t&&this.bind(l,"click",a),r&&this.bind(f,"click",h),this.bind(n.body,"keyup",d),i&&this.bind(g,"submit",a),typeof this.transition=="undefined"&&this.setFocus()},bind:function(e,t,n){typeof e.addEventListener=="function"?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},handleErrors:function(){if(typeof e.onerror!="undefined"){var t=this;return e.onerror=function(e,n,r){t.error("["+e+" on line "+r+" of "+n+"]",0)},!0}return!1},appendButtons:function(e,t){return this.buttonReverse?t+e:e+t},build:function(e){var t="",n=e.type,s=e.message,o=e.cssClass||"";t+='
',r.buttonFocus==="none"&&(t+=''),n==="prompt"&&(t+='
'),t+='
',t+=i.message.replace("{{message}}",s),n==="prompt"&&(t+=i.input),t+=i.buttons.holder,t+="
",n==="prompt"&&(t+="
"),t+='Reset Focus',t+="
";switch(n){case"confirm":t=t.replace("{{buttons}}",this.appendButtons(i.buttons.cancel,i.buttons.ok)),t=t.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"prompt":t=t.replace("{{buttons}}",this.appendButtons(i.buttons.cancel,i.buttons.submit)),t=t.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"alert":t=t.replace("{{buttons}}",i.buttons.ok),t=t.replace("{{ok}}",this.labels.ok);break;default:}return v.className="alertify alertify-show alertify-"+n+" "+o,d.className="alertify-cover",t},close:function(e,t){var n=t&&!isNaN(t)?+t:this.delay,r=this,i,s;this.bind(e,"click",function(){i(e)}),s=function(e){e.stopPropagation(),r.unbind(this,r.transition,s),m.removeChild(this),m.hasChildNodes()||(m.className+=" alertify-logs-hidden")},i=function(e){typeof e!="undefined"&&e.parentNode===m&&(typeof r.transition!="undefined"?(r.bind(e,r.transition,s),e.className+=" alertify-log-hide"):(m.removeChild(e),m.hasChildNodes()||(m.className+=" alertify-logs-hidden")))};if(t===0)return;setTimeout(function(){i(e)},n)},dialog:function(e,t,r,i,o){p=n.activeElement;var a=function(){if(v&&v.scrollTop!==null)return;a()};if(typeof e!="string")throw new Error("message must be a string");if(typeof t!="string")throw new Error("type must be a string");if(typeof r!="undefined"&&typeof r!="function")throw new Error("fn must be a function");return typeof this.init=="function"&&(this.init(),a()),u.push({type:t,message:e,callback:r,placeholder:i,cssClass:o}),s||this.setup(),this},extend:function(e){if(typeof e!="string")throw new Error("extend method must have exactly one paramter");return function(t,n){return this.log(t,e,n),this}},hide:function(){var e,t=this;u.splice(0,1),u.length>0?this.setup():(s=!1,e=function(n){n.stopPropagation(),v.className+=" alertify-isHidden",t.unbind(v,t.transition,e)},typeof this.transition!="undefined"?(this.bind(v,this.transition,e),v.className="alertify alertify-hide alertify-hidden"):v.className="alertify alertify-hide alertify-hidden alertify-isHidden",d.className="alertify-cover alertify-cover-hidden",p.focus())},init:function(){n.createElement("nav"),n.createElement("article"),n.createElement("section"),d=n.createElement("div"),d.setAttribute("id","alertify-cover"),d.className="alertify-cover alertify-cover-hidden",n.body.appendChild(d),v=n.createElement("section"),v.setAttribute("id","alertify"),v.className="alertify alertify-hidden",n.body.appendChild(v),m=n.createElement("section"),m.setAttribute("id","alertify-logs"),m.className="alertify-logs alertify-logs-hidden",n.body.appendChild(m),n.body.setAttribute("tabindex","0"),this.transition=b(),delete this.init},log:function(e,t,n){var r=function(){if(m&&m.scrollTop!==null)return;r()};return typeof this.init=="function"&&(this.init(),r()),m.className="alertify-logs",this.notify(e,t,n),this},notify:function(e,t,r){var i=n.createElement("article");i.className="alertify-log"+(typeof t=="string"&&t!==""?" alertify-log-"+t:""),i.innerHTML=e,m.insertBefore(i,m.firstChild),setTimeout(function(){i.className=i.className+" alertify-log-show"},50),this.close(i,r)},set:function(e){var t;if(typeof e!="object"&&e instanceof Array)throw new Error("args must be an object");for(t in e)e.hasOwnProperty(t)&&(this[t]=e[t])},setFocus:function(){y?(y.focus(),y.select()):h.focus()},setup:function(){var e=u[0],n=this,i;s=!0,i=function(e){e.stopPropagation(),n.setFocus(),n.unbind(v,n.transition,i)},typeof this.transition!="undefined"&&this.bind(v,this.transition,i),v.innerHTML=this.build(e),c=a("alertify-resetFocus"),l=a("alertify-ok")||t,f=a("alertify-cancel")||t,h=r.buttonFocus==="cancel"?f:r.buttonFocus==="none"?a("alertify-noneFocus"):l,y=a("alertify-text")||t,g=a("alertify-form")||t,typeof e.placeholder=="string"&&e.placeholder!==""&&(y.value=e.placeholder),this.addListeners(e.callback)},unbind:function(e,t,n){typeof e.removeEventListener=="function"?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)}},{alert:function(e,t,n){return r.dialog(e,"alert",t,"",n),this},confirm:function(e,t,n){return r.dialog(e,"confirm",t,"",n),this},extend:r.extend,init:r.init,log:function(e,t,n){return r.log(e,t,n),this},prompt:function(e,t,n,i){return r.dialog(e,"prompt",t,n,i),this},success:function(e,t){return r.log(e,"success",t),this},error:function(e,t){return r.log(e,"error",t),this},set:function(e){r.set(e)},labels:r.labels,debug:r.handleErrors}},typeof define=="function"?define([],function(){return new r}):typeof e.alertify=="undefined"&&(e.alertify=new r)})(this); -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | alertify.js - example page 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 |

Dialogs

18 | Alert Dialog
19 | Confirm Dialog
20 | Prompt Dialog
21 | Custom Labels
22 | Button Focus
23 | Button Order 24 | 25 |

Logs

26 | Standard Log
27 | Success Log
28 | Error Log
29 | Hide in 10 seconds
30 | Persistent Log 31 | 32 |

API Driven Log

33 | Create Log
34 | Close Log
35 | Recreate Log
36 | Reshow Log 37 | 38 |

Themes

39 | Bootstrap Theme 40 | 41 | 42 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /example/assets/js/lib/sh/shCoreDefault.css: -------------------------------------------------------------------------------- 1 | .syntaxhighlighter a, 2 | .syntaxhighlighter div, 3 | .syntaxhighlighter code, 4 | .syntaxhighlighter table, 5 | .syntaxhighlighter table td, 6 | .syntaxhighlighter table tr, 7 | .syntaxhighlighter table tbody, 8 | .syntaxhighlighter table thead, 9 | .syntaxhighlighter table caption, 10 | .syntaxhighlighter textarea { 11 | -moz-border-radius: 0 0 0 0 !important; 12 | -webkit-border-radius: 0 0 0 0 !important; 13 | background: none !important; 14 | border: 0 !important; 15 | bottom: auto !important; 16 | float: none !important; 17 | height: auto !important; 18 | left: auto !important; 19 | line-height: 1.1em !important; 20 | margin: 0 !important; 21 | outline: 0 !important; 22 | overflow: visible !important; 23 | padding: 0 !important; 24 | position: static !important; 25 | right: auto !important; 26 | text-align: left !important; 27 | top: auto !important; 28 | vertical-align: baseline !important; 29 | width: auto !important; 30 | box-sizing: content-box !important; 31 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 32 | font-weight: normal !important; 33 | font-style: normal !important; 34 | font-size: 1em !important; 35 | min-height: inherit !important; 36 | min-height: auto !important; 37 | } 38 | 39 | .syntaxhighlighter { 40 | width: 100% !important; 41 | margin: 1em 0 1em 0 !important; 42 | position: relative !important; 43 | overflow: auto !important; 44 | font-size: 1em !important; 45 | } 46 | .syntaxhighlighter.source { 47 | overflow: hidden !important; 48 | } 49 | .syntaxhighlighter .bold { 50 | font-weight: bold !important; 51 | } 52 | .syntaxhighlighter .italic { 53 | font-style: italic !important; 54 | } 55 | .syntaxhighlighter .line { 56 | white-space: pre !important; 57 | } 58 | .syntaxhighlighter table { 59 | width: 100% !important; 60 | } 61 | .syntaxhighlighter table caption { 62 | text-align: left !important; 63 | padding: .5em 0 0.5em 1em !important; 64 | } 65 | .syntaxhighlighter table td.code { 66 | width: 100% !important; 67 | } 68 | .syntaxhighlighter table td.code .container { 69 | position: relative !important; 70 | } 71 | .syntaxhighlighter table td.code .container textarea { 72 | box-sizing: border-box !important; 73 | position: absolute !important; 74 | left: 0 !important; 75 | top: 0 !important; 76 | width: 100% !important; 77 | height: 100% !important; 78 | border: none !important; 79 | background: white !important; 80 | padding-left: 1em !important; 81 | overflow: hidden !important; 82 | white-space: pre !important; 83 | } 84 | .syntaxhighlighter table td.gutter .line { 85 | text-align: right !important; 86 | padding: 0 0.5em 0 1em !important; 87 | } 88 | .syntaxhighlighter table td.code .line { 89 | padding: 0 1em !important; 90 | } 91 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 92 | padding-left: 0em !important; 93 | } 94 | .syntaxhighlighter.show { 95 | display: block !important; 96 | } 97 | .syntaxhighlighter.collapsed table { 98 | display: none !important; 99 | } 100 | .syntaxhighlighter.collapsed .toolbar { 101 | padding: 0.1em 0.8em 0em 0.8em !important; 102 | font-size: 1em !important; 103 | position: static !important; 104 | width: auto !important; 105 | height: auto !important; 106 | } 107 | .syntaxhighlighter.collapsed .toolbar span { 108 | display: inline !important; 109 | margin-right: 1em !important; 110 | } 111 | .syntaxhighlighter.collapsed .toolbar span a { 112 | padding: 0 !important; 113 | display: none !important; 114 | } 115 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 116 | display: inline !important; 117 | } 118 | .syntaxhighlighter .toolbar { 119 | position: absolute !important; 120 | right: 1px !important; 121 | top: 1px !important; 122 | width: 11px !important; 123 | height: 11px !important; 124 | font-size: 10px !important; 125 | z-index: 10 !important; 126 | } 127 | .syntaxhighlighter .toolbar span.title { 128 | display: inline !important; 129 | } 130 | .syntaxhighlighter .toolbar a { 131 | display: block !important; 132 | text-align: center !important; 133 | text-decoration: none !important; 134 | padding-top: 1px !important; 135 | } 136 | .syntaxhighlighter .toolbar a.expandSource { 137 | display: none !important; 138 | } 139 | .syntaxhighlighter.ie { 140 | font-size: .9em !important; 141 | padding: 1px 0 1px 0 !important; 142 | } 143 | .syntaxhighlighter.ie .toolbar { 144 | line-height: 8px !important; 145 | } 146 | .syntaxhighlighter.ie .toolbar a { 147 | padding-top: 0px !important; 148 | } 149 | .syntaxhighlighter.printing .line.alt1 .content, 150 | .syntaxhighlighter.printing .line.alt2 .content, 151 | .syntaxhighlighter.printing .line.highlighted .number, 152 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 153 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 154 | background: none !important; 155 | } 156 | .syntaxhighlighter.printing .line .number { 157 | color: #bbbbbb !important; 158 | } 159 | .syntaxhighlighter.printing .line .content { 160 | color: black !important; 161 | } 162 | .syntaxhighlighter.printing .toolbar { 163 | display: none !important; 164 | } 165 | .syntaxhighlighter.printing a { 166 | text-decoration: none !important; 167 | } 168 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 169 | color: black !important; 170 | } 171 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 172 | color: #008200 !important; 173 | } 174 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 175 | color: blue !important; 176 | } 177 | .syntaxhighlighter.printing .keyword { 178 | color: #006699 !important; 179 | font-weight: bold !important; 180 | } 181 | .syntaxhighlighter.printing .preprocessor { 182 | color: gray !important; 183 | } 184 | .syntaxhighlighter.printing .variable { 185 | color: #aa7700 !important; 186 | } 187 | .syntaxhighlighter.printing .value { 188 | color: #009900 !important; 189 | } 190 | .syntaxhighlighter.printing .functions { 191 | color: #ff1493 !important; 192 | } 193 | .syntaxhighlighter.printing .constants { 194 | color: #0066cc !important; 195 | } 196 | .syntaxhighlighter.printing .script { 197 | font-weight: bold !important; 198 | } 199 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 200 | color: gray !important; 201 | } 202 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 203 | color: #ff1493 !important; 204 | } 205 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 206 | color: red !important; 207 | } 208 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 209 | color: black !important; 210 | } 211 | 212 | .syntaxhighlighter { 213 | background-color: white !important; 214 | } 215 | .syntaxhighlighter .line.alt1 { 216 | background-color: white !important; 217 | } 218 | .syntaxhighlighter .line.alt2 { 219 | background-color: white !important; 220 | } 221 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 222 | background-color: #e0e0e0 !important; 223 | } 224 | .syntaxhighlighter .line.highlighted.number { 225 | color: black !important; 226 | } 227 | .syntaxhighlighter table caption { 228 | color: black !important; 229 | } 230 | .syntaxhighlighter .gutter { 231 | color: #afafaf !important; 232 | } 233 | .syntaxhighlighter .gutter .line { 234 | border-right: 3px solid #6ce26c !important; 235 | } 236 | .syntaxhighlighter .gutter .line.highlighted { 237 | background-color: #6ce26c !important; 238 | color: white !important; 239 | } 240 | .syntaxhighlighter.printing .line .content { 241 | border: none !important; 242 | } 243 | .syntaxhighlighter.collapsed { 244 | overflow: visible !important; 245 | } 246 | .syntaxhighlighter.collapsed .toolbar { 247 | color: blue !important; 248 | background: white !important; 249 | border: 1px solid #6ce26c !important; 250 | } 251 | .syntaxhighlighter.collapsed .toolbar a { 252 | color: blue !important; 253 | } 254 | .syntaxhighlighter.collapsed .toolbar a:hover { 255 | color: red !important; 256 | } 257 | .syntaxhighlighter .toolbar { 258 | color: white !important; 259 | background: #6ce26c !important; 260 | border: none !important; 261 | } 262 | .syntaxhighlighter .toolbar a { 263 | color: white !important; 264 | } 265 | .syntaxhighlighter .toolbar a:hover { 266 | color: black !important; 267 | } 268 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 269 | color: black !important; 270 | } 271 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 272 | color: #008200 !important; 273 | } 274 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 275 | color: blue !important; 276 | } 277 | .syntaxhighlighter .keyword { 278 | color: #006699 !important; 279 | } 280 | .syntaxhighlighter .preprocessor { 281 | color: gray !important; 282 | } 283 | .syntaxhighlighter .variable { 284 | color: #aa7700 !important; 285 | } 286 | .syntaxhighlighter .value { 287 | color: #009900 !important; 288 | } 289 | .syntaxhighlighter .functions { 290 | color: #ff1493 !important; 291 | } 292 | .syntaxhighlighter .constants { 293 | color: #0066cc !important; 294 | } 295 | .syntaxhighlighter .script { 296 | font-weight: bold !important; 297 | color: #006699 !important; 298 | background-color: none !important; 299 | } 300 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 301 | color: gray !important; 302 | } 303 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 304 | color: #ff1493 !important; 305 | } 306 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 307 | color: red !important; 308 | } 309 | 310 | .syntaxhighlighter .keyword { 311 | font-weight: bold !important; 312 | } 313 | -------------------------------------------------------------------------------- /example/assets/sass/normalize/_normalize.scss: -------------------------------------------------------------------------------- 1 | /* normalize.css 2012-08-07T21:27 UTC | MIT License | git.io/normalize */ 2 | /** 3 | * edited: Fabien Doiron 4 | * 5 | * 1. Removed top margins - keep everything using bottom margins 6 | */ 7 | 8 | /* ========================================================================== 9 | HTML5 display definitions 10 | ========================================================================== */ 11 | 12 | /* 13 | * Corrects `block` display not defined in IE6/7/8/9 & FF3. 14 | */ 15 | 16 | article, 17 | aside, 18 | details, 19 | figcaption, 20 | figure, 21 | footer, 22 | header, 23 | hgroup, 24 | nav, 25 | section, 26 | summary { 27 | display: block; 28 | } 29 | 30 | /* 31 | * Corrects `inline-block` display not defined in IE6/7/8/9 & FF3. 32 | */ 33 | 34 | audio, 35 | canvas, 36 | video { 37 | display: inline-block; 38 | *display: inline; 39 | *zoom: 1; 40 | } 41 | 42 | /* 43 | * Prevents modern browsers from displaying `audio` without controls. 44 | * Remove excess height in iOS5 devices. 45 | */ 46 | 47 | audio:not([controls]) { 48 | display: none; 49 | height: 0; 50 | } 51 | 52 | /* 53 | * Addresses styling for `hidden` attribute not present in IE7/8/9, FF3, S4. 54 | * Known issue: no IE6 support. 55 | */ 56 | 57 | [hidden] { 58 | display: none; 59 | } 60 | 61 | /* ========================================================================== 62 | Base 63 | ========================================================================== */ 64 | 65 | /* 66 | * 1. Corrects text resizing oddly in IE6/7 when body `font-size` is set using 67 | * `em` units. 68 | * 2. Prevents iOS text size adjust after orientation change, without disabling 69 | * user zoom. 70 | */ 71 | 72 | html { 73 | font-size: 100%; /* 1 */ 74 | -webkit-text-size-adjust: 100%; /* 2 */ 75 | -ms-text-size-adjust: 100%; /* 2 */ 76 | } 77 | 78 | /* 79 | * Addresses `font-family` inconsistency between `textarea` and other form 80 | * elements. 81 | */ 82 | 83 | html, 84 | button, 85 | input, 86 | select, 87 | textarea { 88 | font-family: sans-serif; 89 | } 90 | 91 | /* 92 | * Addresses margins handled incorrectly in IE6/7. 93 | */ 94 | 95 | body { 96 | margin: 0; 97 | } 98 | 99 | /* ========================================================================== 100 | Links 101 | ========================================================================== */ 102 | 103 | /* 104 | * Addresses `outline` inconsistency between Chrome and other browsers. 105 | */ 106 | 107 | a:focus { 108 | outline: thin dotted; 109 | } 110 | 111 | /* 112 | * Improves readability when focused and also mouse hovered in all browsers. 113 | * people.opera.com/patrickl/experiments/keyboard/test 114 | */ 115 | 116 | a:active, 117 | a:hover { 118 | outline: 0; 119 | } 120 | 121 | /* ========================================================================== 122 | Typography 123 | ========================================================================== */ 124 | 125 | /* 126 | * Addresses font sizes and margins set differently in IE6/7. 127 | * Addresses font sizes within `section` and `article` in FF4+, Chrome, S5. 128 | */ 129 | 130 | h1 { 131 | font-size: 2em; 132 | margin: 0 0 0.67em; 133 | } 134 | 135 | h2 { 136 | font-size: 1.5em; 137 | margin: 0 0 0.83em; 138 | } 139 | 140 | h3 { 141 | font-size: 1.17em; 142 | margin: 0 0 1em; 143 | } 144 | 145 | h4 { 146 | font-size: 1em; 147 | margin: 0 0 1.33em; 148 | } 149 | 150 | h5 { 151 | font-size: 0.83em; 152 | margin: 0 0 1.67em; 153 | } 154 | 155 | h6 { 156 | font-size: 0.75em; 157 | margin: 0 0 2.33em; 158 | } 159 | 160 | /* 161 | * Addresses styling not present in IE7/8/9, S5, Chrome. 162 | */ 163 | 164 | abbr[title] { 165 | border-bottom: 1px dotted; 166 | } 167 | 168 | /* 169 | * Addresses style set to `bolder` in FF3+, S4/5, Chrome. 170 | */ 171 | 172 | b, 173 | strong { 174 | font-weight: bold; 175 | } 176 | 177 | blockquote { 178 | margin: 0 40px 1em; 179 | } 180 | 181 | /* 182 | * Addresses styling not present in S5, Chrome. 183 | */ 184 | 185 | dfn { 186 | font-style: italic; 187 | } 188 | 189 | /* 190 | * Addresses styling not present in IE6/7/8/9. 191 | */ 192 | 193 | mark { 194 | background: #ff0; 195 | color: #000; 196 | } 197 | 198 | /* 199 | * Addresses margins set differently in IE6/7. 200 | */ 201 | 202 | p, 203 | pre { 204 | margin: 0 0 1em; 205 | } 206 | 207 | /* 208 | * Corrects font family set oddly in IE6, S4/5, Chrome. 209 | * en.wikipedia.org/wiki/User:Davidgothberg/Test59 210 | */ 211 | 212 | code, 213 | kbd, 214 | pre, 215 | samp { 216 | font-family: monospace, serif; 217 | _font-family: 'courier new', monospace; 218 | font-size: 1em; 219 | } 220 | 221 | /* 222 | * Improves readability of pre-formatted text in all browsers. 223 | */ 224 | 225 | pre { 226 | white-space: pre; 227 | white-space: pre-wrap; 228 | word-wrap: break-word; 229 | } 230 | 231 | /* 232 | * Addresses CSS quotes not supported in IE6/7. 233 | */ 234 | 235 | q { 236 | quotes: none; 237 | } 238 | 239 | /* 240 | * Addresses `quotes` property not supported in S4. 241 | */ 242 | 243 | q:before, 244 | q:after { 245 | content: ''; 246 | content: none; 247 | } 248 | 249 | small { 250 | font-size: 75%; 251 | } 252 | 253 | /* 254 | * Prevents `sub` and `sup` affecting `line-height` in all browsers. 255 | * gist.github.com/413930 256 | */ 257 | 258 | sub, 259 | sup { 260 | font-size: 75%; 261 | line-height: 0; 262 | position: relative; 263 | vertical-align: baseline; 264 | } 265 | 266 | sup { 267 | top: -0.5em; 268 | } 269 | 270 | sub { 271 | bottom: -0.25em; 272 | } 273 | 274 | /* ========================================================================== 275 | Lists 276 | ========================================================================== */ 277 | 278 | /* 279 | * Addresses margins set differently in IE6/7. 280 | */ 281 | 282 | dl, 283 | menu, 284 | ol, 285 | ul { 286 | margin: 0 0 1em; 287 | } 288 | 289 | dd { 290 | margin: 0 0 0 40px; 291 | } 292 | 293 | /* 294 | * Addresses paddings set differently in IE6/7. 295 | */ 296 | 297 | menu, 298 | ol, 299 | ul { 300 | padding: 0 0 0 40px; 301 | } 302 | 303 | /* 304 | * Corrects list images handled incorrectly in IE7. 305 | */ 306 | 307 | nav ul, 308 | nav ol { 309 | list-style: none; 310 | list-style-image: none; 311 | } 312 | 313 | /* ========================================================================== 314 | Embedded content 315 | ========================================================================== */ 316 | 317 | /* 318 | * 1. Removes border when inside `a` element in IE6/7/8/9, FF3. 319 | * 2. Improves image quality when scaled in IE7. 320 | * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ 321 | */ 322 | 323 | img { 324 | border: 0; /* 1 */ 325 | -ms-interpolation-mode: bicubic; /* 2 */ 326 | } 327 | 328 | /* 329 | * Corrects overflow displayed oddly in IE9. 330 | */ 331 | 332 | svg:not(:root) { 333 | overflow: hidden; 334 | } 335 | 336 | /* ========================================================================== 337 | Figures 338 | ========================================================================== */ 339 | 340 | /* 341 | * Addresses margin not present in IE6/7/8/9, S5, O11. 342 | */ 343 | 344 | figure { 345 | margin: 0; 346 | } 347 | 348 | /* ========================================================================== 349 | Forms 350 | ========================================================================== */ 351 | 352 | /* 353 | * Corrects margin displayed oddly in IE6/7. 354 | */ 355 | 356 | form { 357 | margin: 0; 358 | } 359 | 360 | /* 361 | * Define consistent border, margin, and padding. 362 | */ 363 | 364 | fieldset { 365 | border: 1px solid #c0c0c0; 366 | margin: 0 2px; 367 | padding: 0.35em 0.625em 0.75em; 368 | } 369 | 370 | /* 371 | * 1. Corrects color not being inherited in IE6/7/8/9. 372 | * 2. Corrects text not wrapping in FF3. 373 | * 3. Corrects alignment displayed oddly in IE6/7. 374 | */ 375 | 376 | legend { 377 | border: 0; /* 1 */ 378 | padding: 0; 379 | white-space: normal; /* 2 */ 380 | *margin-left: -7px; /* 3 */ 381 | } 382 | 383 | /* 384 | * 1. Corrects font size not being inherited in all browsers. 385 | * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome. 386 | * 3. Improves appearance and consistency in all browsers. 387 | */ 388 | 389 | button, 390 | input, 391 | select, 392 | textarea { 393 | font-size: 100%; /* 1 */ 394 | margin: 0; /* 2 */ 395 | vertical-align: baseline; /* 3 */ 396 | *vertical-align: middle; /* 3 */ 397 | } 398 | 399 | /* 400 | * Addresses FF3/4 setting `line-height` on `input` using `!important` in the 401 | * UA stylesheet. 402 | */ 403 | 404 | button, 405 | input { 406 | line-height: normal; 407 | } 408 | 409 | /* 410 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 411 | * and `video` controls. 412 | * 2. Corrects inability to style clickable `input` types in iOS. 413 | * 3. Improves usability and consistency of cursor style between image-type 414 | * `input` and others. 415 | * 4. Removes inner spacing in IE7 without affecting normal text inputs. 416 | * Known issue: inner spacing remains in IE6. 417 | */ 418 | 419 | button, 420 | html input[type="button"], /* 1 */ 421 | input[type="reset"], 422 | input[type="submit"] { 423 | -webkit-appearance: button; /* 2 */ 424 | cursor: pointer; /* 3 */ 425 | *overflow: visible; /* 4 */ 426 | } 427 | 428 | /* 429 | * Re-set default cursor for disabled elements. 430 | */ 431 | 432 | button[disabled], 433 | input[disabled] { 434 | cursor: default; 435 | } 436 | 437 | /* 438 | * 1. Addresses box sizing set to content-box in IE8/9. 439 | * 2. Removes excess padding in IE8/9. 440 | * 3. Removes excess padding in IE7. 441 | * Known issue: excess padding remains in IE6. 442 | */ 443 | 444 | input[type="checkbox"], 445 | input[type="radio"] { 446 | box-sizing: border-box; /* 1 */ 447 | padding: 0; /* 2 */ 448 | *height: 13px; /* 3 */ 449 | *width: 13px; /* 3 */ 450 | } 451 | 452 | /* 453 | * 1. Addresses `appearance` set to `searchfield` in S5, Chrome. 454 | * 2. Addresses `box-sizing` set to `border-box` in S5, Chrome (include `-moz` 455 | * to future-proof). 456 | */ 457 | 458 | input[type="search"] { 459 | -webkit-appearance: textfield; /* 1 */ 460 | -moz-box-sizing: content-box; 461 | -webkit-box-sizing: content-box; /* 2 */ 462 | box-sizing: content-box; 463 | } 464 | 465 | /* 466 | * Removes inner padding and search cancel button in S5, Chrome on OS X. 467 | */ 468 | 469 | input[type="search"]::-webkit-search-cancel-button, 470 | input[type="search"]::-webkit-search-decoration { 471 | -webkit-appearance: none; 472 | } 473 | 474 | /* 475 | * Removes inner padding and border in FF3+. 476 | */ 477 | 478 | button::-moz-focus-inner, 479 | input::-moz-focus-inner { 480 | border: 0; 481 | padding: 0; 482 | } 483 | 484 | /* 485 | * 1. Removes default vertical scrollbar in IE6/7/8/9. 486 | * 2. Improves readability and alignment in all browsers. 487 | */ 488 | 489 | textarea { 490 | overflow: auto; /* 1 */ 491 | vertical-align: top; /* 2 */ 492 | } 493 | 494 | /* ========================================================================== 495 | Tables 496 | ========================================================================== */ 497 | 498 | /* 499 | * Remove most spacing between table cells. 500 | */ 501 | 502 | table { 503 | border-collapse: collapse; 504 | border-spacing: 0; 505 | } -------------------------------------------------------------------------------- /test/vendor/require.js: -------------------------------------------------------------------------------- 1 | /* 2 | RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 3 | Available via the MIT or new BSD license. 4 | see: http://github.com/jrburke/requirejs for details 5 | */ 6 | var requirejs,require,define; 7 | (function(Z){function x(b){return J.call(b)==="[object Function]"}function E(b){return J.call(b)==="[object Array]"}function o(b,e){if(b){var f;for(f=0;f-1;f-=1)if(b[f]&&e(b[f],f,b))break}}function y(b,e){for(var f in b)if(b.hasOwnProperty(f)&&e(b[f],f))break}function N(b,e,f,h){e&&y(e,function(e,j){if(f||!F.call(b,j))h&&typeof e!=="string"?(b[j]||(b[j]={}),N(b[j],e,f,h)):b[j]=e});return b}function t(b,e){return function(){return e.apply(b, 8 | arguments)}}function $(b){if(!b)return b;var e=Z;o(b.split("."),function(b){e=e[b]});return e}function aa(b,e,f){return function(){var h=ga.call(arguments,0),c;if(f&&x(c=h[h.length-1]))c.__requireJsBuild=!0;h.push(e);return b.apply(null,h)}}function ba(b,e,f){o([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(h){var c=h[1]||h[0];b[h[0]]=e?aa(e[c],f):function(){var b=z[O];return b[c].apply(b,arguments)}})}function G(b,e,f,h){e=Error(e+"\nhttp://requirejs.org/docs/errors.html#"+ 9 | b);e.requireType=b;e.requireModules=h;if(f)e.originalError=f;return e}function ha(){if(H&&H.readyState==="interactive")return H;M(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return H=b});return H}var j,p,u,B,s,C,H,I,ca,da,ia=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ja=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ea=/\.js$/,ka=/^\.\//;p=Object.prototype;var J=p.toString,F=p.hasOwnProperty;p=Array.prototype;var ga=p.slice,la=p.splice,w=!!(typeof window!== 10 | "undefined"&&navigator&&document),fa=!w&&typeof importScripts!=="undefined",ma=w&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,O="_",S=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",z={},r={},P=[],K=!1;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(x(requirejs))return;r=requirejs;requirejs=void 0}typeof require!=="undefined"&&!x(require)&&(r=require,require=void 0);j=requirejs=function(b,e,f,h){var c,o=O;!E(b)&&typeof b!=="string"&& 11 | (c=b,E(e)?(b=e,e=f,f=h):b=[]);if(c&&c.context)o=c.context;(h=z[o])||(h=z[o]=j.s.newContext(o));c&&h.configure(c);return h.require(b,e,f)};j.config=function(b){return j(b)};require||(require=j);j.version="2.0.6";j.jsExtRegExp=/^\/|:|\?|\.js$/;j.isBrowser=w;p=j.s={contexts:z,newContext:function(b){function e(a,d,k){var l,b,i,v,e,c,f,g=d&&d.split("/");l=g;var h=m.map,j=h&&h["*"];if(a&&a.charAt(0)===".")if(d){l=m.pkgs[d]?g=[d]:g.slice(0,g.length-1);d=a=l.concat(a.split("/"));for(l=0;d[l];l+=1)if(b=d[l], 12 | b===".")d.splice(l,1),l-=1;else if(b==="..")if(l===1&&(d[2]===".."||d[0]===".."))break;else l>0&&(d.splice(l-1,2),l-=2);l=m.pkgs[d=a[0]];a=a.join("/");l&&a===d+"/"+l.main&&(a=d)}else a.indexOf("./")===0&&(a=a.substring(2));if(k&&(g||j)&&h){d=a.split("/");for(l=d.length;l>0;l-=1){i=d.slice(0,l).join("/");if(g)for(b=g.length;b>0;b-=1)if(k=h[g.slice(0,b).join("/")])if(k=k[i]){v=k;e=l;break}if(v)break;!c&&j&&j[i]&&(c=j[i],f=l)}!v&&c&&(v=c,e=f);v&&(d.splice(0,e,v),a=d.join("/"))}return a}function f(a){w&& 13 | o(document.getElementsByTagName("script"),function(d){if(d.getAttribute("data-requiremodule")===a&&d.getAttribute("data-requirecontext")===g.contextName)return d.parentNode.removeChild(d),!0})}function h(a){var d=m.paths[a];if(d&&E(d)&&d.length>1)return f(a),d.shift(),g.undef(a),g.require([a]),!0}function c(a,d,k,l){var b,i,v=a?a.indexOf("!"):-1,c=null,f=d?d.name:null,h=a,j=!0,m="";a||(j=!1,a="_@r"+(M+=1));v!==-1&&(c=a.substring(0,v),a=a.substring(v+1,a.length));c&&(c=e(c,f,l),i=q[c]);a&&(c?m=i&& 14 | i.normalize?i.normalize(a,function(a){return e(a,f,l)}):e(a,f,l):(m=e(a,f,l),b=g.nameToUrl(m)));a=c&&!i&&!k?"_unnormalized"+(O+=1):"";return{prefix:c,name:m,parentMap:d,unnormalized:!!a,url:b,originalName:h,isDefine:j,id:(c?c+"!"+m:m)+a}}function p(a){var d=a.id,k=n[d];k||(k=n[d]=new g.Module(a));return k}function r(a,d,k){var b=a.id,c=n[b];if(F.call(q,b)&&(!c||c.defineEmitComplete))d==="defined"&&k(q[b]);else p(a).on(d,k)}function A(a,d){var k=a.requireModules,b=!1;if(d)d(a);else if(o(k,function(d){if(d= 15 | n[d])d.error=a,d.events.error&&(b=!0,d.emit("error",a))}),!b)j.onError(a)}function s(){P.length&&(la.apply(D,[D.length-1,0].concat(P)),P=[])}function u(a,d,k){a=a&&a.map;d=aa(k||g.require,a,d);ba(d,g,a);d.isBrowser=w;return d}function z(a){delete n[a];o(L,function(d,k){if(d.map.id===a)return L.splice(k,1),d.defined||(g.waitCount-=1),!0})}function B(a,d,k){var b=a.map.id,c=a.depMaps,i;if(a.inited){if(d[b])return a;d[b]=!0;o(c,function(a){var a=a.id,b=n[a];return!b||k[a]||!b.inited||!b.enabled?void 0: 16 | i=B(b,d,k)});k[b]=!0;return i}}function C(a,d,b){var l=a.map.id,c=a.depMaps;if(a.inited&&a.map.isDefine){if(d[l])return q[l];d[l]=a;o(c,function(i){var i=i.id,c=n[i];!Q[i]&&c&&(!c.inited||!c.enabled?b[l]=!0:(c=C(c,d,b),b[i]||a.defineDepById(i,c)))});a.check(!0);return q[l]}}function I(a){a.check()}function T(){var a,d,b,l,c=(b=m.waitSeconds*1E3)&&g.startTime+b<(new Date).getTime(),i=[],e=!1,j=!0;if(!U){U=!0;y(n,function(b){a=b.map;d=a.id;if(b.enabled&&!b.error)if(!b.inited&&c)h(d)?e=l=!0:(i.push(d), 17 | f(d));else if(!b.inited&&b.fetched&&a.isDefine&&(e=!0,!a.prefix))return j=!1});if(c&&i.length)return b=G("timeout","Load timeout for modules: "+i,null,i),b.contextName=g.contextName,A(b);j&&(o(L,function(a){if(!a.defined){var a=B(a,{},{}),d={};a&&(C(a,d,{}),y(d,I))}}),y(n,I));if((!c||l)&&e)if((w||fa)&&!V)V=setTimeout(function(){V=0;T()},50);U=!1}}function W(a){p(c(a[0],null,!0)).init(a[1],a[2])}function J(a){var a=a.currentTarget||a.srcElement,d=g.onScriptLoad;a.detachEvent&&!S?a.detachEvent("onreadystatechange", 18 | d):a.removeEventListener("load",d,!1);d=g.onScriptError;a.detachEvent&&!S||a.removeEventListener("error",d,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}var U,X,g,Q,V,m={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},n={},Y={},D=[],q={},R={},M=1,O=1,L=[];Q={require:function(a){return u(a)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports=q[a.map.id]={}},module:function(a){return a.module={id:a.map.id,uri:a.map.url,config:function(){return m.config&&m.config[a.map.id]|| 19 | {}},exports:q[a.map.id]}}};X=function(a){this.events=Y[a.id]||{};this.map=a;this.shim=m.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};X.prototype={init:function(a,d,b,c){c=c||{};if(!this.inited){this.factory=d;if(b)this.on("error",b);else this.events.error&&(b=t(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.depMaps.rjsSkipMap=a.rjsSkipMap;this.errback=b;this.inited=!0;this.ignore=c.ignore;c.enabled||this.enabled?this.enable(): 20 | this.check()}},defineDepById:function(a,d){var b;o(this.depMaps,function(d,c){if(d.id===a)return b=c,!0});return this.defineDep(b,d)},defineDep:function(a,d){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=d)},fetch:function(){if(!this.fetched){this.fetched=!0;g.startTime=(new Date).getTime();var a=this.map;if(this.shim)u(this,!0)(this.shim.deps||[],t(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}}, 21 | load:function(){var a=this.map.url;R[a]||(R[a]=!0,g.load(this.map.id,a))},check:function(a){if(this.enabled&&!this.enabling){var d,b,c=this.map.id;b=this.depExports;var e=this.exports,i=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(x(i)){if(this.events.error)try{e=g.execCb(c,i,b,e)}catch(f){d=f}else e=g.execCb(c,i,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e= 22 | b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(d)return d.requireMap=this.map,d.requireModules=[this.map.id],d.requireType="define",A(this.error=d)}else e=i;this.exports=e;if(this.map.isDefine&&!this.ignore&&(q[c]=e,j.onResourceLoad))j.onResourceLoad(g,this.map,this.depMaps);delete n[c];this.defined=!0;g.waitCount-=1;g.waitCount===0&&(L=[])}this.defining=!1;if(!a&&this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}}, 23 | callPlugin:function(){var a=this.map,d=a.id,b=c(a.prefix,null,!1,!0);r(b,"defined",t(this,function(b){var k;k=this.map.name;var i=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){if(b.normalize&&(k=b.normalize(k,function(a){return e(a,i,!0)})||""),b=c(a.prefix+"!"+k,this.map.parentMap,!1,!0),r(b,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),b=n[b.id]){if(this.events.error)b.on("error",t(this,function(a){this.emit("error",a)})); 24 | b.enable()}}else k=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[d];y(n,function(a){a.map.id.indexOf(d+"_unnormalized")===0&&z(a.map.id)});A(a)}),k.fromText=function(a,b){var d=K;d&&(K=!1);p(c(a));j.exec(b);d&&(K=!0);g.completeLoad(a)},b.load(a.name,u(a.parentMap,!0,function(a,b,d){a.rjsSkipMap=!0;return g.require(a,b,d)}),k,m)}));g.enable(b,this);this.pluginMaps[b.id]=b},enable:function(){this.enabled= 25 | !0;if(!this.waitPushed)L.push(this),g.waitCount+=1,this.waitPushed=!0;this.enabling=!0;o(this.depMaps,t(this,function(a,b){var k,e;if(typeof a==="string"){a=c(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.depMaps.rjsSkipMap);this.depMaps[b]=a;if(k=Q[a.id]){this.depExports[b]=k(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&r(a,"error",this.errback)}k=a.id;e=n[k];!Q[k]&&e&&!e.enabled&&g.enable(a,this)}));y(this.pluginMaps, 26 | t(this,function(a){var b=n[a.id];b&&!b.enabled&&g.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){o(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};return g={config:m,contextName:b,registry:n,defined:q,urlFetched:R,waitCount:0,defQueue:D,Module:X,makeModuleMap:c,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=m.pkgs,e=m.shim,f=m.paths, 27 | j=m.map;N(m,a,!0);m.paths=N(f,a.paths,!0);if(a.map)m.map=N(j||{},a.map,!0,!0);if(a.shim)y(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exports.__buildReady)a.exports=g.makeShimExports(a.exports);e[b]=a}),m.shim=e;if(a.packages)o(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ka,"").replace(ea,"")}}),m.pkgs=b;y(n,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=c(b)});if(a.deps||a.callback)g.require(a.deps|| 28 | [],a.callback)},makeShimExports:function(a){var b;return typeof a==="string"?(b=function(){return $(a)},b.exports=a,b):function(){return a.apply(Z,arguments)}},requireDefined:function(a,b){var e=c(a,b,!1,!0).id;return F.call(q,e)},requireSpecified:function(a,b){a=c(a,b,!1,!0).id;return F.call(q,a)||F.call(n,a)},require:function(a,d,e,f){var h;if(typeof a==="string"){if(x(d))return A(G("requireargs","Invalid require call"),e);if(j.get)return j.get(g,a,d);a=c(a,d,!1,!0);a=a.id;return!F.call(q,a)?A(G("notloaded", 29 | 'Module name "'+a+'" has not been loaded yet for context: '+b)):q[a]}e&&!x(e)&&(f=e,e=void 0);d&&!x(d)&&(f=d,d=void 0);for(s();D.length;)if(h=D.shift(),h[0]===null)return A(G("mismatch","Mismatched anonymous define() module: "+h[h.length-1]));else W(h);p(c(null,f)).init(a,d,e,{enabled:!0});T();return g.require},undef:function(a){s();var b=c(a,null,!0),e=n[a];delete q[a];delete R[b.url];delete Y[a];if(e){if(e.events.defined)Y[a]=e.events;z(a)}},enable:function(a){n[a.id]&&p(a).enable()},completeLoad:function(a){var b, 30 | c,e=m.shim[a]||{},f=e.exports&&e.exports.exports;for(s();D.length;){c=D.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);W(c)}c=n[a];if(!b&&!q[a]&&c&&!c.inited)if(m.enforceDefine&&(!f||!$(f)))if(h(a))return;else return A(G("nodefine","No define call for "+a,null,[a]));else W([a,e.deps||[],e.exports]);T()},toUrl:function(a,b){var c=a.lastIndexOf("."),f=null;c!==-1&&(f=a.substring(c,a.length),a=a.substring(0,c));return g.nameToUrl(e(a,b&&b.id,!0),f)},nameToUrl:function(a,b){var c, 31 | e,f,i,h,g;if(j.jsExtRegExp.test(a))i=a+(b||"");else{c=m.paths;e=m.pkgs;i=a.split("/");for(h=i.length;h>0;h-=1)if(g=i.slice(0,h).join("/"),f=e[g],g=c[g]){E(g)&&(g=g[0]);i.splice(0,h,g);break}else if(f){c=a===f.name?f.location+"/"+f.main:f.location;i.splice(0,h,c);break}i=i.join("/");i+=b||(/\?/.test(i)?"":".js");i=(i.charAt(0)==="/"||i.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+i}return m.urlArgs?i+((i.indexOf("?")===-1?"?":"&")+m.urlArgs):i},load:function(a,b){j.load(g,a,b)},execCb:function(a,b,c,e){return b.apply(e, 32 | c)},onScriptLoad:function(a){if(a.type==="load"||ma.test((a.currentTarget||a.srcElement).readyState))H=null,a=J(a),g.completeLoad(a.id)},onScriptError:function(a){var b=J(a);if(!h(b.id))return A(G("scripterror","Script error",a,[b.id]))}}}};j({});ba(j);if(w&&(u=p.head=document.getElementsByTagName("head")[0],B=document.getElementsByTagName("base")[0]))u=p.head=B.parentNode;j.onError=function(b){throw b;};j.load=function(b,e,f){var h=b&&b.config||{},c;if(w)return c=h.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml", 33 | "html:script"):document.createElement("script"),c.type=h.scriptType||"text/javascript",c.charset="utf-8",c.async=!0,c.setAttribute("data-requirecontext",b.contextName),c.setAttribute("data-requiremodule",e),c.attachEvent&&!(c.attachEvent.toString&&c.attachEvent.toString().indexOf("[native code")<0)&&!S?(K=!0,c.attachEvent("onreadystatechange",b.onScriptLoad)):(c.addEventListener("load",b.onScriptLoad,!1),c.addEventListener("error",b.onScriptError,!1)),c.src=f,I=c,B?u.insertBefore(c,B):u.appendChild(c), 34 | I=null,c;else fa&&(importScripts(f),b.completeLoad(e))};w&&M(document.getElementsByTagName("script"),function(b){if(!u)u=b.parentNode;if(s=b.getAttribute("data-main")){if(!r.baseUrl)C=s.split("/"),ca=C.pop(),da=C.length?C.join("/")+"/":"./",r.baseUrl=da,s=ca;s=s.replace(ea,"");r.deps=r.deps?r.deps.concat(s):[s];return!0}});define=function(b,e,f){var h,c;typeof b!=="string"&&(f=e,e=b,b=null);E(e)||(f=e,e=[]);!e.length&&x(f)&&f.length&&(f.toString().replace(ia,"").replace(ja,function(b,c){e.push(c)}), 35 | e=(f.length===1?["require"]:["require","exports","module"]).concat(e));if(K&&(h=I||ha()))b||(b=h.getAttribute("data-requiremodule")),c=z[h.getAttribute("data-requirecontext")];(c?c.defQueue:P).push([b,e,f])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(r)}})(this); 36 | -------------------------------------------------------------------------------- /src/dialog.js: -------------------------------------------------------------------------------- 1 | define(["alertify", "proto", "element", "validate", "transition", "keys"], function (Alertify, AlertifyProto, element, validate, transition, keys) { 2 | "use strict"; 3 | 4 | var dialog, 5 | _dialog = {}; 6 | 7 | var Dialog = function () { 8 | var controls = {}, 9 | dialog = {}, 10 | isOpen = false, 11 | queue = [], 12 | tpl = {}, 13 | prefixEl = Alertify._prefix + "-dialog", 14 | prefixCover = Alertify._prefix + "-cover", 15 | clsElShow = prefixEl + " is-" + prefixEl + "-showing", 16 | clsElHide = prefixEl + " is-" + prefixEl + "-hidden", 17 | clsCoverShow = prefixCover + " is-" + prefixCover + "-showing", 18 | clsCoverHide = prefixCover + " is-" + prefixCover + "-hidden", 19 | elCallee, 20 | $, 21 | appendBtns, 22 | addListeners, 23 | build, 24 | hide, 25 | init, 26 | onBtnCancel, 27 | onBtnOK, 28 | onBtnResetFocus, 29 | onFormSubmit, 30 | onKeyUp, 31 | open, 32 | removeListeners, 33 | setFocus, 34 | setup; 35 | 36 | tpl = { 37 | buttons : { 38 | holder : "", 39 | submit : "", 40 | ok : "", 41 | cancel : "" 42 | }, 43 | input : "
", 44 | message : "

{{message}}

", 45 | log : "
{{message}}
" 46 | }; 47 | 48 | addListeners = function (item) { 49 | // ok event handler 50 | onBtnOK = function (event) { 51 | var val = ""; 52 | if (typeof event.preventDefault !== "undefined") { 53 | event.preventDefault(); 54 | } 55 | removeListeners(); 56 | hide(); 57 | 58 | if (controls.input) { 59 | val = controls.input.value; 60 | } 61 | if (typeof item.accept === "function") { 62 | if (controls.input) { 63 | item.accept(val); 64 | } else { 65 | item.accept(); 66 | } 67 | } 68 | return false; 69 | }; 70 | 71 | // cancel event handler 72 | onBtnCancel = function (event) { 73 | if (typeof event.preventDefault !== "undefined") { 74 | event.preventDefault(); 75 | } 76 | removeListeners(); 77 | hide(); 78 | if (typeof item.deny === "function") { 79 | item.deny(); 80 | } 81 | return false; 82 | }; 83 | 84 | // keyup handler 85 | onKeyUp = function (event) { 86 | var keyCode = event.keyCode; 87 | if (keyCode === keys.SPACE && !controls.input) { 88 | onBtnOK(event); 89 | } 90 | if (keyCode === keys.ESC && controls.cancel) { 91 | onBtnCancel(event); 92 | } 93 | }; 94 | 95 | // reset focus to first item in the dialog 96 | onBtnResetFocus = function (event) { 97 | if (controls.input) { 98 | controls.input.focus(); 99 | } else if (controls.cancel) { 100 | controls.cancel.focus(); 101 | } else { 102 | controls.ok.focus(); 103 | } 104 | }; 105 | 106 | // handle reset focus link 107 | // this ensures that the keyboard focus does not 108 | // ever leave the dialog box until an action has 109 | // been taken 110 | Alertify.on(controls.reset, "focus", onBtnResetFocus); 111 | // handle OK click 112 | if (controls.ok) { 113 | Alertify.on(controls.ok, "click", onBtnOK); 114 | } 115 | // handle Cancel click 116 | if (controls.cancel) { 117 | Alertify.on(controls.cancel, "click", onBtnCancel); 118 | } 119 | // listen for keys, Cancel => ESC 120 | Alertify.on(document.body, "keyup", onKeyUp); 121 | // bind form submit 122 | if (controls.form) { 123 | Alertify.on(controls.form, "submit", onBtnOK); 124 | } 125 | if (!transition.supported) { 126 | setFocus(); 127 | } 128 | }; 129 | 130 | /** 131 | * Append Buttons 132 | * Insert the buttons in the proper order 133 | * 134 | * @param {String} secondary Cancel button string 135 | * @param {String} primary OK button string 136 | * @return {String} 137 | */ 138 | appendBtns = function (secondary, primary) { 139 | return dialog.buttonReverse ? primary + secondary : secondary + primary; 140 | }; 141 | 142 | build = function (item) { 143 | var html = "", 144 | type = item.type, 145 | message = item.message; 146 | 147 | html += "
"; 148 | 149 | if (dialog.buttonFocus === "none") { 150 | html += ""; 151 | } 152 | 153 | if (type === "prompt") { 154 | html += "
"; 155 | } 156 | 157 | html += "
"; 158 | html += tpl.message.replace("{{message}}", message); 159 | 160 | if (type === "prompt") { 161 | html += tpl.input; 162 | } 163 | 164 | html += tpl.buttons.holder; 165 | html += "
"; 166 | 167 | if (type === "prompt") { 168 | html += "
"; 169 | } 170 | 171 | html += "Reset Focus"; 172 | html += "
"; 173 | 174 | switch (type) { 175 | case "confirm": 176 | html = html.replace("{{buttons}}", appendBtns(tpl.buttons.cancel, tpl.buttons.ok)); 177 | html = html.replace("{{ok}}", dialog.labels.ok).replace("{{cancel}}", dialog.labels.cancel); 178 | break; 179 | case "prompt": 180 | html = html.replace("{{buttons}}", appendBtns(tpl.buttons.cancel, tpl.buttons.submit)); 181 | html = html.replace("{{ok}}", dialog.labels.ok).replace("{{cancel}}", dialog.labels.cancel); 182 | break; 183 | case "alert": 184 | html = html.replace("{{buttons}}", tpl.buttons.ok); 185 | html = html.replace("{{ok}}", dialog.labels.ok); 186 | break; 187 | } 188 | 189 | return html; 190 | }; 191 | 192 | hide = function () { 193 | var transitionDone; 194 | queue.splice(0,1); 195 | if (queue.length > 0) { 196 | open(true); 197 | } else { 198 | isOpen = false; 199 | transitionDone = function (event) { 200 | event.stopPropagation(); 201 | //this.className += " alertify-isHidden"; 202 | Alertify.off(this, transition.type, transitionDone); 203 | }; 204 | if (transition.supported) { 205 | Alertify.on(dialog.el, transition.type, transitionDone); 206 | dialog.el.className = clsElHide; 207 | } else { 208 | dialog.el.className = clsElHide; 209 | } 210 | dialog.cover.className = clsCoverHide; 211 | elCallee.focus(); 212 | } 213 | }; 214 | 215 | /** 216 | * Initialize Dialog 217 | * Create the dialog and cover elements 218 | * 219 | * @return {Object} 220 | */ 221 | init = function () { 222 | isOpen = false; 223 | queue = []; 224 | 225 | var cover = element.create("div", { classes: clsCoverHide }), 226 | el = element.create("section", { classes: clsElHide }); 227 | 228 | document.body.appendChild(cover); 229 | document.body.appendChild(el); 230 | element.ready(cover); 231 | element.ready(el); 232 | dialog.cover = cover; 233 | return el; 234 | }; 235 | 236 | open = function (fromQueue) { 237 | var item = queue[0], 238 | onTransitionEnd; 239 | 240 | isOpen = true; 241 | 242 | onTransitionEnd = function (event) { 243 | event.stopPropagation(); 244 | setFocus(); 245 | Alertify.off(this, transition.type, onTransitionEnd); 246 | }; 247 | 248 | if (transition.supported && !fromQueue) { 249 | Alertify.on(dialog.el, transition.type, onTransitionEnd); 250 | } 251 | dialog.el.innerHTML = build(item); 252 | dialog.cover.className = clsCoverShow; 253 | dialog.el.className = clsElShow + " " + "alertify-" + item.type; 254 | 255 | controls.reset = Alertify.get("alertify-resetFocus"); 256 | controls.ok = Alertify.get("alertify-ok") || undefined; 257 | controls.cancel = Alertify.get("alertify-cancel") || undefined; 258 | controls.focus = (dialog.buttonFocus === "cancel" && controls.cancel) ? controls.cancel : ((dialog.buttonFocus === "none") ? Alertify.get("alertify-noneFocus") : controls.ok), 259 | controls.input = Alertify.get("alertify-text") || undefined; 260 | controls.form = Alertify.get("alertify-form") || undefined; 261 | 262 | if (typeof item.placeholder === "string" && item.placeholder !== "") { 263 | controls.input.value = item.placeholder; 264 | } 265 | 266 | if (fromQueue) { 267 | setFocus(); 268 | } 269 | addListeners(item); 270 | }; 271 | 272 | /** 273 | * Remove Event Listeners 274 | * 275 | * @return {undefined} 276 | */ 277 | removeListeners = function () { 278 | Alertify.off(document.body, "keyup", onKeyUp); 279 | Alertify.off(controls.reset, "focus", onBtnResetFocus); 280 | if (controls.input) { 281 | Alertify.off(controls.form, "submit", onFormSubmit); 282 | } 283 | if (controls.ok) { 284 | Alertify.off(controls.ok, "click", onBtnOK); 285 | } 286 | if (controls.cancel) { 287 | Alertify.off(controls.cancel, "click", onBtnCancel); 288 | } 289 | }; 290 | 291 | /** 292 | * Set Focus 293 | * Set focus to proper element 294 | * 295 | * @return {undefined} 296 | */ 297 | setFocus = function () { 298 | if (controls.input) { 299 | controls.input.focus(); 300 | controls.input.select(); 301 | } else { 302 | controls.focus.focus(); 303 | } 304 | }; 305 | 306 | /** 307 | * Setup Dialog 308 | * 309 | * @param {String} type Dialog type 310 | * @param {String} msg Dialog message 311 | * @param {Function} accept [Optional] Accept callback 312 | * @param {Function} deny [Optional] Deny callback 313 | * @param {String} placeholder [Optional] Input placeholder text 314 | * @return {undefined} 315 | */ 316 | setup = function (type, msg, accept, deny, placeholder) { 317 | if (!validate.isString(type) || 318 | !validate.isString(msg) || 319 | !validate.isFunction(accept,true) || 320 | !validate.isFunction(deny,true) || 321 | !validate.isString(placeholder, true)) { 322 | throw new Error(validate.messages.invalidArguments); 323 | } 324 | dialog.el = document.body.contains(dialog.el) ? dialog.el : init(); 325 | elCallee = document.activeElement; 326 | 327 | queue.push({ 328 | type : type, 329 | message : msg, 330 | accept : accept, 331 | deny : deny, 332 | placeholder : placeholder 333 | }); 334 | 335 | if (!isOpen) { 336 | open(); 337 | } 338 | }; 339 | 340 | return { 341 | buttonFocus : "ok", 342 | buttonReverse : false, 343 | cover : undefined, 344 | el : undefined, 345 | labels: { 346 | ok: "OK", 347 | cancel: "Cancel" 348 | }, 349 | alert: function (msg, accept) { 350 | dialog = this; 351 | setup("alert", msg, accept); 352 | return this; 353 | }, 354 | confirm: function (msg, accept, deny) { 355 | dialog = this; 356 | setup("confirm", msg, accept, deny); 357 | return this; 358 | }, 359 | prompt: function (msg, accept, deny, placeholder) { 360 | dialog = this; 361 | setup("prompt", msg, accept, deny, placeholder); 362 | return this; 363 | } 364 | }; 365 | }; 366 | 367 | AlertifyProto.dialog = new Dialog(); 368 | 369 | return new Dialog(); 370 | }); 371 | -------------------------------------------------------------------------------- /example/assets/js/lib/sh/shCore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) 18 | -------------------------------------------------------------------------------- /example/assets/css/main.css: -------------------------------------------------------------------------------- 1 | article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:0 0 0.67em}h2{font-size:1.5em;margin:0 0 0.83em}h3{font-size:1.17em;margin:0 0 1em}h4{font-size:1em;margin:0 0 1.33em}h5{font-size:0.83em;margin:0 0 1.67em}h6{font-size:0.75em;margin:0 0 2.33em}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0 40px 1em}dfn{font-style:italic}mark{background:#ff0;color:#000}p,pre{margin:0 0 1em}code,kbd,pre,samp{font-family:monospace, serif;_font-family:'courier new', monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:75%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:0 0 1em}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}body{font:normal 16px/1.5 Arial,Helvetica,sans-serif;color:#333;background:#FFF}.media,.mediaBody{overflow:hidden;zoom:1}.mediaAside{float:left;display:inline;margin-right:1em}.clearfix,.row{zoom:1}.clearfix:before,.row:before,.clearfix:after,.row:after{content:"";display:table}.clearfix:after,.row:after{clear:both}/* 2 | * Font Awesome 3.0.2 3 | * the iconic font designed for use with Twitter Bootstrap 4 | * ------------------------------------------------------- 5 | * The full suite of pictographic icons, examples, and documentation 6 | * can be found at: http://fortawesome.github.com/Font-Awesome/ 7 | * 8 | * License 9 | * ------------------------------------------------------- 10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL 11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - 12 | * http://opensource.org/licenses/mit-license.html 13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ 14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: 15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" 16 | * 17 | * Contact 18 | * ------------------------------------------------------- 19 | * Email: dave@davegandy.com 20 | * Twitter: http://twitter.com/fortaweso_me 21 | * Work: Lead Product Designer @ http://kyruus.com 22 | */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=3.0.1");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=3.0.1") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=3.0.1") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=3.0.1") format("truetype");font-weight:normal;font-style:normal}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}a [class^="icon-"],a [class*=" icon-"]{display:inline-block}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}.btn [class^="icon-"],.btn [class*=" icon-"],.nav [class^="icon-"],.nav [class*=" icon-"]{display:inline}.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"],.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class^="icon-"],.nav-pills [class^="icon-"].icon-large,.nav-pills [class*=" icon-"],.nav-pills [class*=" icon-"].icon-large{line-height:.9em}li [class^="icon-"],li [class*=" icon-"],.nav li [class^="icon-"],.nav li [class*=" icon-"]{display:inline-block;width:1.25em;text-align:center}li [class^="icon-"].icon-large,li [class*=" icon-"].icon-large,.nav li [class^="icon-"].icon-large,.nav li [class*=" icon-"].icon-large{width:1.5625em}ul.icons{list-style-type:none;text-indent:-0.75em}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em}.icon-muted{color:#eee}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@-moz-document url-prefix(){.icon-spin{height:.9em}.btn .icon-spin{height:auto}.icon-spin.icon-large{height:1.25em}.btn .icon-spin.icon-large{height:.75em}}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"}h1,h2,h3,h4,h5,h6{line-height:1.2;font-weight:normal}h1{font-size:64px;text-align:center;font-family:"lato",Arial,Helvetica,sans-serif;color:#FFF;margin:0 0 40px}h2{font-size:40px;font-family:"lato",Arial,Helvetica,sans-serif;font-weight:900;text-align:center;position:relative;z-index:1}h2 span{display:inline-block;padding:20px;background:#FFF}h2:before{position:absolute;z-index:-1;top:55%;left:0;right:0;border-top:1px dashed #AAA;border-bottom:1px dashed #F5F5F5;content:""}h3{font:bold 20px/1.2 Arial,Helvetica,sans-serif;margin:0 0 20px}h4{font:bold 16px/1.2 Arial,Helvetica,sans-serif}p{margin:0 0 20px}a{color:#0C7AB9}a:hover{color:#FFF;background:#0C7AB9;text-decoration:none}.container{width:900px;margin:0 auto}.masthead{padding:20px 0;background:url(../img/banner.jpg) no-repeat center 0;margin-bottom:60px}.masthead img{display:block;margin:0 auto}.cta{text-align:center}.cta .button-primary{padding:20px 40px;-webkit-box-sizing:border-bottom;-moz-box-sizing:border-bottom;box-sizing:border-bottom}.small{font-size:12px;font-weight:normal}.footer{background:#13181F;color:#666;text-align:center;padding:40px 0}.footer a{color:#FFF;text-decoration:none}.footer i{margin-right:4px}.featured-list{list-style:none;text-align:center;margin:80px 0 0;padding:0}.featured-list li{display:inline-block;margin:0 20px 20px}.featured-list li a{position:relative;display:block;color:#666}.featured-list li a:before{content:"";display:block;margin:0 auto 5px}.featured-list li a:hover{background:none;color:#FFF}.featured-list .treehouse:before{background:url(../img/treehouse.png) no-repeat center bottom;width:58px;height:42px}.featured-list .webdev:before{background:url(../img/webdev.png) no-repeat center bottom;width:103px;height:42px}.block{margin-bottom:60px}.mh-logo{font-family:"lato",Arial,Helvetica,sans-serif;font-weight:900;text-transform:uppercase;font-size:24px;text-align:center;color:#7A7C7C}.mh-logo .extension{text-transform:none}.feature{float:left;width:47%;margin-bottom:20px}.feature.alt{float:right}.feature .mediaAside{font-size:32px;line-height:1;margin:0;width:60px}.syntaxhighlighter .toolbar{display:none}.button-group{margin:0;font-size:0}.button-primary{font-size:16px;background:#0C7AB9;color:#FFF;display:inline-block;padding:5px 20px;text-decoration:none;font-weight:bold;border-radius:2px;margin:0 5px 5px 0}.button-primary:hover,.button-primary:focus{background:#0a6497;outline:none}.button-primary:focus{box-shadow:0 0 10px #0f9ae9}.button-primary:active{box-shadow:inset 0 3px 3px rgba(0,0,0,0.25)}.button-primary.is-disabled{opacity:.5}@media only screen and (max-width: 980px){.container{width:95%}.button{margin-bottom:20px}}@media only screen and (max-width: 830px){img{max-width:100%;height:auto}.feature,.alt{float:none;width:100%}}@media only screen and (max-width: 640px){.mh-logo{font-size:12.8px}h1{font-size:24px}h2{font-size:24px}} 23 | -------------------------------------------------------------------------------- /example/assets/sass/_fontAwesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 3.0.2 3 | * the iconic font designed for use with Twitter Bootstrap 4 | * ------------------------------------------------------- 5 | * The full suite of pictographic icons, examples, and documentation 6 | * can be found at: http://fortawesome.github.com/Font-Awesome/ 7 | * 8 | * License 9 | * ------------------------------------------------------- 10 | * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL 11 | * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - 12 | * http://opensource.org/licenses/mit-license.html 13 | * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ 14 | * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: 15 | * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" 16 | * 17 | * Contact 18 | * ------------------------------------------------------- 19 | * Email: dave@davegandy.com 20 | * Twitter: http://twitter.com/fortaweso_me 21 | * Work: Lead Product Designer @ http://kyruus.com 22 | */ 23 | 24 | $fontAwesomePath: "../fonts" !default; 25 | $borderColor: #eee; 26 | $iconMuted: #eee; 27 | @mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; } 28 | 29 | 30 | @font-face { 31 | font-family: 'FontAwesome'; 32 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?v=3.0.1'); 33 | src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format("embedded-opentype"), 34 | url('#{$fontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format("woff"), 35 | url('#{$fontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format("truetype"); 36 | font-weight: normal; 37 | font-style: normal; 38 | } 39 | 40 | /* Font Awesome styles 41 | ------------------------------------------------------- */ 42 | [class^="icon-"], 43 | [class*=" icon-"] { 44 | font-family: FontAwesome; 45 | font-weight: normal; 46 | font-style: normal; 47 | text-decoration: inherit; 48 | -webkit-font-smoothing: antialiased; 49 | 50 | /* sprites.less reset */ 51 | display: inline; 52 | width: auto; 53 | height: auto; 54 | line-height: normal; 55 | vertical-align: baseline; 56 | background-image: none; 57 | background-position: 0% 0%; 58 | background-repeat: repeat; 59 | margin-top: 0; 60 | } 61 | 62 | /* more sprites.less reset */ 63 | .icon-white, 64 | .nav-pills > .active > a > [class^="icon-"], 65 | .nav-pills > .active > a > [class*=" icon-"], 66 | .nav-list > .active > a > [class^="icon-"], 67 | .nav-list > .active > a > [class*=" icon-"], 68 | .navbar-inverse .nav > .active > a > [class^="icon-"], 69 | .navbar-inverse .nav > .active > a > [class*=" icon-"], 70 | .dropdown-menu > li > a:hover > [class^="icon-"], 71 | .dropdown-menu > li > a:hover > [class*=" icon-"], 72 | .dropdown-menu > .active > a > [class^="icon-"], 73 | .dropdown-menu > .active > a > [class*=" icon-"], 74 | .dropdown-submenu:hover > a > [class^="icon-"], 75 | .dropdown-submenu:hover > a > [class*=" icon-"] { 76 | background-image: none; 77 | } 78 | 79 | [class^="icon-"]:before, 80 | [class*=" icon-"]:before { 81 | text-decoration: inherit; 82 | display: inline-block; 83 | speak: none; 84 | } 85 | 86 | /* makes sure icons active on rollover in links */ 87 | a { 88 | [class^="icon-"], 89 | [class*=" icon-"] { 90 | display: inline-block; 91 | } 92 | } 93 | 94 | /* makes the font 33% larger relative to the icon container */ 95 | .icon-large:before { 96 | vertical-align: -10%; 97 | font-size: 1.3333333333333333em; 98 | } 99 | 100 | .btn, .nav { 101 | [class^="icon-"], 102 | [class*=" icon-"] { 103 | display: inline; 104 | /* keeps button heights with and without icons the same */ 105 | &.icon-large { line-height: .9em; } 106 | &.icon-spin { display: inline-block; } 107 | } 108 | } 109 | 110 | .nav-tabs, .nav-pills { 111 | [class^="icon-"], 112 | [class*=" icon-"] { 113 | /* keeps button heights with and without icons the same */ 114 | &, &.icon-large { line-height: .9em; } 115 | } 116 | } 117 | 118 | li, .nav li { 119 | [class^="icon-"], 120 | [class*=" icon-"] { 121 | display: inline-block; 122 | width: 1.25em; 123 | text-align: center; 124 | &.icon-large { 125 | /* increased font size for icon-large */ 126 | width: 1.5625em; 127 | } 128 | } 129 | } 130 | 131 | ul.icons { 132 | list-style-type: none; 133 | text-indent: -.75em; 134 | 135 | li { 136 | [class^="icon-"], 137 | [class*=" icon-"] { 138 | width: .75em; 139 | } 140 | } 141 | } 142 | 143 | .icon-muted { 144 | color: $iconMuted; 145 | } 146 | 147 | // Icon Borders 148 | // ------------------------- 149 | 150 | .icon-border { 151 | border: solid 1px $borderColor; 152 | padding: .2em .25em .15em; 153 | @include border-radius(3px); 154 | } 155 | 156 | // Icon Sizes 157 | // ------------------------- 158 | 159 | .icon-2x { 160 | font-size: 2em; 161 | &.icon-border { 162 | border-width: 2px; 163 | @include border-radius(4px); 164 | } 165 | } 166 | .icon-3x { 167 | font-size: 3em; 168 | &.icon-border { 169 | border-width: 3px; 170 | @include border-radius(5px); 171 | } 172 | } 173 | .icon-4x { 174 | font-size: 4em; 175 | &.icon-border { 176 | border-width: 4px; 177 | @include border-radius(6px); 178 | } 179 | } 180 | 181 | // Floats 182 | // ------------------------- 183 | 184 | // Quick floats 185 | .pull-right { float: right; } 186 | .pull-left { float: left; } 187 | 188 | [class^="icon-"], 189 | [class*=" icon-"] { 190 | &.pull-left { 191 | margin-right: .3em; 192 | } 193 | &.pull-right { 194 | margin-left: .3em; 195 | } 196 | } 197 | 198 | .btn { 199 | [class^="icon-"], 200 | [class*=" icon-"] { 201 | &.pull-left, &.pull-right { 202 | &.icon-2x { margin-top: .18em; } 203 | } 204 | &.icon-spin.icon-large { line-height: .8em; } 205 | } 206 | } 207 | 208 | .btn.btn-small { 209 | [class^="icon-"], 210 | [class*=" icon-"] { 211 | &.pull-left, &.pull-right { 212 | &.icon-2x { margin-top: .25em; } 213 | } 214 | } 215 | } 216 | 217 | .btn.btn-large { 218 | [class^="icon-"], 219 | [class*=" icon-"] { 220 | margin-top: 0; // overrides bootstrap default 221 | &.pull-left, &.pull-right { 222 | &.icon-2x { margin-top: .05em; } 223 | } 224 | &.pull-left.icon-2x { margin-right: .2em; } 225 | &.pull-right.icon-2x { margin-left: .2em; } 226 | } 227 | } 228 | 229 | 230 | .icon-spin { 231 | display: inline-block; 232 | -moz-animation: spin 2s infinite linear; 233 | -o-animation: spin 2s infinite linear; 234 | -webkit-animation: spin 2s infinite linear; 235 | animation: spin 2s infinite linear; 236 | } 237 | 238 | @-moz-keyframes spin { 239 | 0% { -moz-transform: rotate(0deg); } 240 | 100% { -moz-transform: rotate(359deg); } 241 | } 242 | @-webkit-keyframes spin { 243 | 0% { -webkit-transform: rotate(0deg); } 244 | 100% { -webkit-transform: rotate(359deg); } 245 | } 246 | @-o-keyframes spin { 247 | 0% { -o-transform: rotate(0deg); } 248 | 100% { -o-transform: rotate(359deg); } 249 | } 250 | @-ms-keyframes spin { 251 | 0% { -ms-transform: rotate(0deg); } 252 | 100% { -ms-transform: rotate(359deg); } 253 | } 254 | @keyframes spin { 255 | 0% { transform: rotate(0deg); } 256 | 100% { transform: rotate(359deg); } 257 | } 258 | 259 | @-moz-document url-prefix() { 260 | .icon-spin { height: .9em; } 261 | .btn .icon-spin { height: auto; } 262 | .icon-spin.icon-large { height: 1.25em; } 263 | .btn .icon-spin.icon-large { height: .75em; } 264 | } 265 | 266 | /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen 267 | readers do not read off random characters that represent icons */ 268 | .icon-glass:before { content: "\f000"; } 269 | .icon-music:before { content: "\f001"; } 270 | .icon-search:before { content: "\f002"; } 271 | .icon-envelope:before { content: "\f003"; } 272 | .icon-heart:before { content: "\f004"; } 273 | .icon-star:before { content: "\f005"; } 274 | .icon-star-empty:before { content: "\f006"; } 275 | .icon-user:before { content: "\f007"; } 276 | .icon-film:before { content: "\f008"; } 277 | .icon-th-large:before { content: "\f009"; } 278 | .icon-th:before { content: "\f00a"; } 279 | .icon-th-list:before { content: "\f00b"; } 280 | .icon-ok:before { content: "\f00c"; } 281 | .icon-remove:before { content: "\f00d"; } 282 | .icon-zoom-in:before { content: "\f00e"; } 283 | 284 | .icon-zoom-out:before { content: "\f010"; } 285 | .icon-off:before { content: "\f011"; } 286 | .icon-signal:before { content: "\f012"; } 287 | .icon-cog:before { content: "\f013"; } 288 | .icon-trash:before { content: "\f014"; } 289 | .icon-home:before { content: "\f015"; } 290 | .icon-file:before { content: "\f016"; } 291 | .icon-time:before { content: "\f017"; } 292 | .icon-road:before { content: "\f018"; } 293 | .icon-download-alt:before { content: "\f019"; } 294 | .icon-download:before { content: "\f01a"; } 295 | .icon-upload:before { content: "\f01b"; } 296 | .icon-inbox:before { content: "\f01c"; } 297 | .icon-play-circle:before { content: "\f01d"; } 298 | .icon-repeat:before { content: "\f01e"; } 299 | 300 | /* \f020 doesn't work in Safari. all shifted one down */ 301 | .icon-refresh:before { content: "\f021"; } 302 | .icon-list-alt:before { content: "\f022"; } 303 | .icon-lock:before { content: "\f023"; } 304 | .icon-flag:before { content: "\f024"; } 305 | .icon-headphones:before { content: "\f025"; } 306 | .icon-volume-off:before { content: "\f026"; } 307 | .icon-volume-down:before { content: "\f027"; } 308 | .icon-volume-up:before { content: "\f028"; } 309 | .icon-qrcode:before { content: "\f029"; } 310 | .icon-barcode:before { content: "\f02a"; } 311 | .icon-tag:before { content: "\f02b"; } 312 | .icon-tags:before { content: "\f02c"; } 313 | .icon-book:before { content: "\f02d"; } 314 | .icon-bookmark:before { content: "\f02e"; } 315 | .icon-print:before { content: "\f02f"; } 316 | 317 | .icon-camera:before { content: "\f030"; } 318 | .icon-font:before { content: "\f031"; } 319 | .icon-bold:before { content: "\f032"; } 320 | .icon-italic:before { content: "\f033"; } 321 | .icon-text-height:before { content: "\f034"; } 322 | .icon-text-width:before { content: "\f035"; } 323 | .icon-align-left:before { content: "\f036"; } 324 | .icon-align-center:before { content: "\f037"; } 325 | .icon-align-right:before { content: "\f038"; } 326 | .icon-align-justify:before { content: "\f039"; } 327 | .icon-list:before { content: "\f03a"; } 328 | .icon-indent-left:before { content: "\f03b"; } 329 | .icon-indent-right:before { content: "\f03c"; } 330 | .icon-facetime-video:before { content: "\f03d"; } 331 | .icon-picture:before { content: "\f03e"; } 332 | 333 | .icon-pencil:before { content: "\f040"; } 334 | .icon-map-marker:before { content: "\f041"; } 335 | .icon-adjust:before { content: "\f042"; } 336 | .icon-tint:before { content: "\f043"; } 337 | .icon-edit:before { content: "\f044"; } 338 | .icon-share:before { content: "\f045"; } 339 | .icon-check:before { content: "\f046"; } 340 | .icon-move:before { content: "\f047"; } 341 | .icon-step-backward:before { content: "\f048"; } 342 | .icon-fast-backward:before { content: "\f049"; } 343 | .icon-backward:before { content: "\f04a"; } 344 | .icon-play:before { content: "\f04b"; } 345 | .icon-pause:before { content: "\f04c"; } 346 | .icon-stop:before { content: "\f04d"; } 347 | .icon-forward:before { content: "\f04e"; } 348 | 349 | .icon-fast-forward:before { content: "\f050"; } 350 | .icon-step-forward:before { content: "\f051"; } 351 | .icon-eject:before { content: "\f052"; } 352 | .icon-chevron-left:before { content: "\f053"; } 353 | .icon-chevron-right:before { content: "\f054"; } 354 | .icon-plus-sign:before { content: "\f055"; } 355 | .icon-minus-sign:before { content: "\f056"; } 356 | .icon-remove-sign:before { content: "\f057"; } 357 | .icon-ok-sign:before { content: "\f058"; } 358 | .icon-question-sign:before { content: "\f059"; } 359 | .icon-info-sign:before { content: "\f05a"; } 360 | .icon-screenshot:before { content: "\f05b"; } 361 | .icon-remove-circle:before { content: "\f05c"; } 362 | .icon-ok-circle:before { content: "\f05d"; } 363 | .icon-ban-circle:before { content: "\f05e"; } 364 | 365 | .icon-arrow-left:before { content: "\f060"; } 366 | .icon-arrow-right:before { content: "\f061"; } 367 | .icon-arrow-up:before { content: "\f062"; } 368 | .icon-arrow-down:before { content: "\f063"; } 369 | .icon-share-alt:before { content: "\f064"; } 370 | .icon-resize-full:before { content: "\f065"; } 371 | .icon-resize-small:before { content: "\f066"; } 372 | .icon-plus:before { content: "\f067"; } 373 | .icon-minus:before { content: "\f068"; } 374 | .icon-asterisk:before { content: "\f069"; } 375 | .icon-exclamation-sign:before { content: "\f06a"; } 376 | .icon-gift:before { content: "\f06b"; } 377 | .icon-leaf:before { content: "\f06c"; } 378 | .icon-fire:before { content: "\f06d"; } 379 | .icon-eye-open:before { content: "\f06e"; } 380 | 381 | .icon-eye-close:before { content: "\f070"; } 382 | .icon-warning-sign:before { content: "\f071"; } 383 | .icon-plane:before { content: "\f072"; } 384 | .icon-calendar:before { content: "\f073"; } 385 | .icon-random:before { content: "\f074"; } 386 | .icon-comment:before { content: "\f075"; } 387 | .icon-magnet:before { content: "\f076"; } 388 | .icon-chevron-up:before { content: "\f077"; } 389 | .icon-chevron-down:before { content: "\f078"; } 390 | .icon-retweet:before { content: "\f079"; } 391 | .icon-shopping-cart:before { content: "\f07a"; } 392 | .icon-folder-close:before { content: "\f07b"; } 393 | .icon-folder-open:before { content: "\f07c"; } 394 | .icon-resize-vertical:before { content: "\f07d"; } 395 | .icon-resize-horizontal:before { content: "\f07e"; } 396 | 397 | .icon-bar-chart:before { content: "\f080"; } 398 | .icon-twitter-sign:before { content: "\f081"; } 399 | .icon-facebook-sign:before { content: "\f082"; } 400 | .icon-camera-retro:before { content: "\f083"; } 401 | .icon-key:before { content: "\f084"; } 402 | .icon-cogs:before { content: "\f085"; } 403 | .icon-comments:before { content: "\f086"; } 404 | .icon-thumbs-up:before { content: "\f087"; } 405 | .icon-thumbs-down:before { content: "\f088"; } 406 | .icon-star-half:before { content: "\f089"; } 407 | .icon-heart-empty:before { content: "\f08a"; } 408 | .icon-signout:before { content: "\f08b"; } 409 | .icon-linkedin-sign:before { content: "\f08c"; } 410 | .icon-pushpin:before { content: "\f08d"; } 411 | .icon-external-link:before { content: "\f08e"; } 412 | 413 | .icon-signin:before { content: "\f090"; } 414 | .icon-trophy:before { content: "\f091"; } 415 | .icon-github-sign:before { content: "\f092"; } 416 | .icon-upload-alt:before { content: "\f093"; } 417 | .icon-lemon:before { content: "\f094"; } 418 | .icon-phone:before { content: "\f095"; } 419 | .icon-check-empty:before { content: "\f096"; } 420 | .icon-bookmark-empty:before { content: "\f097"; } 421 | .icon-phone-sign:before { content: "\f098"; } 422 | .icon-twitter:before { content: "\f099"; } 423 | .icon-facebook:before { content: "\f09a"; } 424 | .icon-github:before { content: "\f09b"; } 425 | .icon-unlock:before { content: "\f09c"; } 426 | .icon-credit-card:before { content: "\f09d"; } 427 | .icon-rss:before { content: "\f09e"; } 428 | 429 | .icon-hdd:before { content: "\f0a0"; } 430 | .icon-bullhorn:before { content: "\f0a1"; } 431 | .icon-bell:before { content: "\f0a2"; } 432 | .icon-certificate:before { content: "\f0a3"; } 433 | .icon-hand-right:before { content: "\f0a4"; } 434 | .icon-hand-left:before { content: "\f0a5"; } 435 | .icon-hand-up:before { content: "\f0a6"; } 436 | .icon-hand-down:before { content: "\f0a7"; } 437 | .icon-circle-arrow-left:before { content: "\f0a8"; } 438 | .icon-circle-arrow-right:before { content: "\f0a9"; } 439 | .icon-circle-arrow-up:before { content: "\f0aa"; } 440 | .icon-circle-arrow-down:before { content: "\f0ab"; } 441 | .icon-globe:before { content: "\f0ac"; } 442 | .icon-wrench:before { content: "\f0ad"; } 443 | .icon-tasks:before { content: "\f0ae"; } 444 | 445 | .icon-filter:before { content: "\f0b0"; } 446 | .icon-briefcase:before { content: "\f0b1"; } 447 | .icon-fullscreen:before { content: "\f0b2"; } 448 | 449 | .icon-group:before { content: "\f0c0"; } 450 | .icon-link:before { content: "\f0c1"; } 451 | .icon-cloud:before { content: "\f0c2"; } 452 | .icon-beaker:before { content: "\f0c3"; } 453 | .icon-cut:before { content: "\f0c4"; } 454 | .icon-copy:before { content: "\f0c5"; } 455 | .icon-paper-clip:before { content: "\f0c6"; } 456 | .icon-save:before { content: "\f0c7"; } 457 | .icon-sign-blank:before { content: "\f0c8"; } 458 | .icon-reorder:before { content: "\f0c9"; } 459 | .icon-list-ul:before { content: "\f0ca"; } 460 | .icon-list-ol:before { content: "\f0cb"; } 461 | .icon-strikethrough:before { content: "\f0cc"; } 462 | .icon-underline:before { content: "\f0cd"; } 463 | .icon-table:before { content: "\f0ce"; } 464 | 465 | .icon-magic:before { content: "\f0d0"; } 466 | .icon-truck:before { content: "\f0d1"; } 467 | .icon-pinterest:before { content: "\f0d2"; } 468 | .icon-pinterest-sign:before { content: "\f0d3"; } 469 | .icon-google-plus-sign:before { content: "\f0d4"; } 470 | .icon-google-plus:before { content: "\f0d5"; } 471 | .icon-money:before { content: "\f0d6"; } 472 | .icon-caret-down:before { content: "\f0d7"; } 473 | .icon-caret-up:before { content: "\f0d8"; } 474 | .icon-caret-left:before { content: "\f0d9"; } 475 | .icon-caret-right:before { content: "\f0da"; } 476 | .icon-columns:before { content: "\f0db"; } 477 | .icon-sort:before { content: "\f0dc"; } 478 | .icon-sort-down:before { content: "\f0dd"; } 479 | .icon-sort-up:before { content: "\f0de"; } 480 | 481 | .icon-envelope-alt:before { content: "\f0e0"; } 482 | .icon-linkedin:before { content: "\f0e1"; } 483 | .icon-undo:before { content: "\f0e2"; } 484 | .icon-legal:before { content: "\f0e3"; } 485 | .icon-dashboard:before { content: "\f0e4"; } 486 | .icon-comment-alt:before { content: "\f0e5"; } 487 | .icon-comments-alt:before { content: "\f0e6"; } 488 | .icon-bolt:before { content: "\f0e7"; } 489 | .icon-sitemap:before { content: "\f0e8"; } 490 | .icon-umbrella:before { content: "\f0e9"; } 491 | .icon-paste:before { content: "\f0ea"; } 492 | .icon-lightbulb:before { content: "\f0eb"; } 493 | .icon-exchange:before { content: "\f0ec"; } 494 | .icon-cloud-download:before { content: "\f0ed"; } 495 | .icon-cloud-upload:before { content: "\f0ee"; } 496 | 497 | .icon-user-md:before { content: "\f0f0"; } 498 | .icon-stethoscope:before { content: "\f0f1"; } 499 | .icon-suitcase:before { content: "\f0f2"; } 500 | .icon-bell-alt:before { content: "\f0f3"; } 501 | .icon-coffee:before { content: "\f0f4"; } 502 | .icon-food:before { content: "\f0f5"; } 503 | .icon-file-alt:before { content: "\f0f6"; } 504 | .icon-building:before { content: "\f0f7"; } 505 | .icon-hospital:before { content: "\f0f8"; } 506 | .icon-ambulance:before { content: "\f0f9"; } 507 | .icon-medkit:before { content: "\f0fa"; } 508 | .icon-fighter-jet:before { content: "\f0fb"; } 509 | .icon-beer:before { content: "\f0fc"; } 510 | .icon-h-sign:before { content: "\f0fd"; } 511 | .icon-plus-sign-alt:before { content: "\f0fe"; } 512 | 513 | .icon-double-angle-left:before { content: "\f100"; } 514 | .icon-double-angle-right:before { content: "\f101"; } 515 | .icon-double-angle-up:before { content: "\f102"; } 516 | .icon-double-angle-down:before { content: "\f103"; } 517 | .icon-angle-left:before { content: "\f104"; } 518 | .icon-angle-right:before { content: "\f105"; } 519 | .icon-angle-up:before { content: "\f106"; } 520 | .icon-angle-down:before { content: "\f107"; } 521 | .icon-desktop:before { content: "\f108"; } 522 | .icon-laptop:before { content: "\f109"; } 523 | .icon-tablet:before { content: "\f10a"; } 524 | .icon-mobile-phone:before { content: "\f10b"; } 525 | .icon-circle-blank:before { content: "\f10c"; } 526 | .icon-quote-left:before { content: "\f10d"; } 527 | .icon-quote-right:before { content: "\f10e"; } 528 | 529 | .icon-spinner:before { content: "\f110"; } 530 | .icon-circle:before { content: "\f111"; } 531 | .icon-reply:before { content: "\f112"; } 532 | .icon-github-alt:before { content: "\f113"; } 533 | .icon-folder-close-alt:before { content: "\f114"; } 534 | .icon-folder-open-alt:before { content: "\f115"; } 535 | --------------------------------------------------------------------------------