├── .gitignore
├── .gitattributes
├── js
├── build
│ └── .gitignore
├── src
│ ├── .htaccess
│ ├── module
│ │ └── GradientCreatorApp.coffee
│ ├── directive
│ │ ├── killContextMenuArea.coffee
│ │ ├── onDomReady.coffee
│ │ ├── tooltip.coffee
│ │ ├── prettify.coffee
│ │ ├── newColorHandleClickArea.coffee
│ │ ├── colorPicker.coffee
│ │ ├── resizableCanvas.coffee
│ │ ├── colorHandle.coffee
│ │ ├── slider.coffee
│ │ └── previewCanvas.coffee
│ ├── model
│ │ ├── ColorHandle.coffee
│ │ └── GradientPreset.coffee
│ └── controller
│ │ └── MainCtrl.coffee
├── .htaccess
├── prettify
│ ├── lang-go.js
│ ├── lang-ml.js
│ ├── lang-vb.js
│ ├── lang-lua.js
│ ├── lang-scala.js
│ ├── lang-sql.js
│ ├── lang-tex.js
│ ├── lang-vhdl.js
│ ├── lang-wiki.js
│ ├── lang-apollo.js
│ ├── lang-proto.js
│ ├── lang-yaml.js
│ ├── lang-hs.js
│ ├── prettify.css
│ ├── lang-lisp.js
│ ├── lang-css.js
│ ├── lang-n.js
│ ├── lang-clj.js
│ ├── sunburst.css
│ ├── prettify.js
│ └── lang-xq.js
├── jpicker
│ ├── images
│ │ ├── Bars.png
│ │ ├── Maps.png
│ │ ├── AlphaBar.png
│ │ ├── NoColor.png
│ │ ├── mappoint.gif
│ │ ├── picker.gif
│ │ ├── bar-opacity.png
│ │ ├── map-opacity.png
│ │ ├── rangearrows.gif
│ │ └── preview-opacity.png
│ ├── jPicker.css
│ ├── ReadMe.txt
│ ├── css
│ │ ├── jPicker-1.1.6.min.css
│ │ └── jPicker-1.1.6.css
│ └── ChangeLog.txt
├── build.sh
├── local-storage
│ ├── localStorageModule.min.js
│ └── localStorageModule.js
└── qtip
│ └── jquery.qtip.min.css
├── img
├── disk.png
├── delete.png
├── canvas-bg.png
├── resizable.png
├── blog-thumb.jpg
└── disk_multiple.png
├── css
├── iconic_fill.eot
├── iconic_fill.otf
├── iconic_fill.ttf
├── iconic_fill.woff
├── iconic_fill.css
├── iconic_fill.afm
├── style.css
└── iconic_fill_demo.html
├── VERSION
├── LICENSE
├── test-gradient.html
├── README.md
└── index.php
/.gitignore:
--------------------------------------------------------------------------------
1 | Thumbs.db
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sh eol=lf
--------------------------------------------------------------------------------
/js/build/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/js/src/.htaccess:
--------------------------------------------------------------------------------
1 | Order allow,deny
2 | Deny from all
--------------------------------------------------------------------------------
/js/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Order allow,deny
3 | Deny from all
4 |
--------------------------------------------------------------------------------
/img/disk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/disk.png
--------------------------------------------------------------------------------
/img/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/delete.png
--------------------------------------------------------------------------------
/img/canvas-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/canvas-bg.png
--------------------------------------------------------------------------------
/img/resizable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/resizable.png
--------------------------------------------------------------------------------
/css/iconic_fill.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/css/iconic_fill.eot
--------------------------------------------------------------------------------
/css/iconic_fill.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/css/iconic_fill.otf
--------------------------------------------------------------------------------
/css/iconic_fill.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/css/iconic_fill.ttf
--------------------------------------------------------------------------------
/css/iconic_fill.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/css/iconic_fill.woff
--------------------------------------------------------------------------------
/img/blog-thumb.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/blog-thumb.jpg
--------------------------------------------------------------------------------
/img/disk_multiple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/img/disk_multiple.png
--------------------------------------------------------------------------------
/js/prettify/lang-go.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-go.js
--------------------------------------------------------------------------------
/js/prettify/lang-ml.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-ml.js
--------------------------------------------------------------------------------
/js/prettify/lang-vb.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-vb.js
--------------------------------------------------------------------------------
/js/prettify/lang-lua.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-lua.js
--------------------------------------------------------------------------------
/js/prettify/lang-scala.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-scala.js
--------------------------------------------------------------------------------
/js/prettify/lang-sql.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-sql.js
--------------------------------------------------------------------------------
/js/prettify/lang-tex.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-tex.js
--------------------------------------------------------------------------------
/js/prettify/lang-vhdl.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-vhdl.js
--------------------------------------------------------------------------------
/js/prettify/lang-wiki.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-wiki.js
--------------------------------------------------------------------------------
/js/jpicker/images/Bars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/Bars.png
--------------------------------------------------------------------------------
/js/jpicker/images/Maps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/Maps.png
--------------------------------------------------------------------------------
/js/prettify/lang-apollo.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/prettify/lang-apollo.js
--------------------------------------------------------------------------------
/js/jpicker/images/AlphaBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/AlphaBar.png
--------------------------------------------------------------------------------
/js/jpicker/images/NoColor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/NoColor.png
--------------------------------------------------------------------------------
/js/jpicker/images/mappoint.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/mappoint.gif
--------------------------------------------------------------------------------
/js/jpicker/images/picker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/picker.gif
--------------------------------------------------------------------------------
/js/src/module/GradientCreatorApp.coffee:
--------------------------------------------------------------------------------
1 | window.GradientCreatorApp = angular.module('GradientCreatorApp', ['LocalStorageModule'], ->);
--------------------------------------------------------------------------------
/js/jpicker/images/bar-opacity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/bar-opacity.png
--------------------------------------------------------------------------------
/js/jpicker/images/map-opacity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/map-opacity.png
--------------------------------------------------------------------------------
/js/jpicker/images/rangearrows.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/rangearrows.gif
--------------------------------------------------------------------------------
/js/jpicker/images/preview-opacity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/evictor/html5-canvas-gradient-creator/HEAD/js/jpicker/images/preview-opacity.png
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 1.0.1
2 | =====
3 | - Fixed CoffeeScript build script line endings.
4 | - Note in readme about CS build script.
5 |
6 | 1.0
7 | ===
8 | - Initial release.
--------------------------------------------------------------------------------
/js/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/bash
2 | SCRIPT_PATH=$0
3 | SCRIPT_DIR=$(dirname $SCRIPT_PATH)
4 | BUILD_DIR=$SCRIPT_DIR"/build/"
5 | SRC_DIR=$SCRIPT_DIR"/src/"
6 | coffee -o $BUILD_DIR -cw $SRC_DIR
7 |
--------------------------------------------------------------------------------
/js/prettify/lang-proto.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]);
2 |
--------------------------------------------------------------------------------
/js/src/directive/killContextMenuArea.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Apply this to an element to prevent the right-click context menu within that element.
3 |
4 | Usage:
5 |
6 | ...
7 | ###
8 | GradientCreatorApp.directive 'killContextMenuArea', ->
9 | return (scope, elem) ->
10 | elem.bind 'contextmenu', false
--------------------------------------------------------------------------------
/js/src/directive/onDomReady.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Eval's a scope expression on DOM ready.
3 |
4 | Usage:
5 | ...
6 |
7 | onDomReady - {expression} - Eval'd on scope.
8 | ###
9 | GradientCreatorApp.directive 'onDomReady', ->
10 | (scope, elem, attrs) ->
11 | jQuery -> scope.$apply attrs.onDomReady
--------------------------------------------------------------------------------
/js/src/model/ColorHandle.coffee:
--------------------------------------------------------------------------------
1 | GradientCreatorApp.factory 'ColorHandle', ->
2 | class ColorHandle
3 | ###
4 | @param {String} color Color string in CSS rgba(0-255, 0-255, 0-255, 0-1) format.
5 | @param {Number} stop Value 0-1, the gradient color stop. 0 means the color appears at 0%, 0.5 means 50%, etc.
6 | ###
7 | constructor: (@color, @stop) ->
--------------------------------------------------------------------------------
/js/prettify/lang-yaml.js:
--------------------------------------------------------------------------------
1 | var a=null;
2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]);
3 |
--------------------------------------------------------------------------------
/js/src/directive/tooltip.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Uses qTip and title attribute to make a tooltip.
3 |
4 | Usage:
5 | ...
6 |
7 | title - {String} - Tooltip text.
8 | tooltip - {expression} - qTip options.
9 | ###
10 | GradientCreatorApp.directive 'tooltip', ->
11 | (scope, elem, attrs) ->
12 | throw 'qTip not loaded.' if !jQuery.fn.qtip?
13 |
14 | elem.qtip scope.$eval(attrs.tooltip || '{}');
--------------------------------------------------------------------------------
/js/prettify/lang-hs.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/,
2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]);
3 |
--------------------------------------------------------------------------------
/js/prettify/prettify.css:
--------------------------------------------------------------------------------
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
--------------------------------------------------------------------------------
/js/src/directive/prettify.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Basic wrapper for Mike Samuel's Prettify plugin (code syntax highlighter). Code language is inferred by Prettify.
3 |
4 | Usage:
5 |
6 |
7 | prettify - {expression} - Code to prettify (probably given as a variable or function on your scope).
8 |
9 | @link http://code.google.com/p/google-code-prettify/
10 | ###
11 | GradientCreatorApp.directive 'prettify', ($timeout) ->
12 | scope: prettify: '='
13 | template: ''
14 | link: (scope, elem, attrs) ->
15 | $pre = elem.find 'pre'
16 |
17 | # Redraw on content change
18 | scope.$watch 'prettify', (content) ->
19 | $pre.text content
20 | prettyPrint()
--------------------------------------------------------------------------------
/js/prettify/lang-lisp.js:
--------------------------------------------------------------------------------
1 | var a=null;
2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a],
3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]);
4 |
--------------------------------------------------------------------------------
/js/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
3 |
--------------------------------------------------------------------------------
/js/jpicker/jPicker.css:
--------------------------------------------------------------------------------
1 | @media all
2 | {
3 | #jPicker { margin: 0px 8px; text-align: left; }
4 | #jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; }
5 | #jPicker ul li { list-style: disc; padding: 2px 0px; }
6 | #jPicker ul li ul { margin-bottom: 10px; }
7 | #jPicker ul li ul li { list-style: circle; }
8 | #jPicker p { font-size: 13px; padding: 0px 10px; }
9 | #jPicker hr { clear: both; }
10 | #jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; }
11 | #jPicker code { color: #8bd; font-size: 14px; font-weight: bold; }
12 | #jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; }
13 | #jPicker span { font-size: 13px; text-align: center; }
14 | #jPicker a { color: #ff8050; }
15 | #jPicker input { font-size: 13px; padding: 2px 5px; }
16 | #jPicker h2 { font-size: 16px; margin: 10px 0px; }
17 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2013 Ezekiel Victor
2 | http://ezekielvictor.com/
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining
5 | a copy of this software and associated documentation files (the
6 | "Software"), to deal in the Software without restriction, including
7 | without limitation the rights to use, copy, modify, merge, publish,
8 | distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to
10 | the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/js/src/directive/newColorHandleClickArea.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Area beneath the working canvas where you can click to add additional color handles.
3 |
4 | Usage:
5 |
6 | ###
7 | GradientCreatorApp.directive 'newColorHandleClickArea', ($document) ->
8 | template: ''
9 | link: (scope, elem) ->
10 | # Get and hide icon
11 | addHandleIcon = elem.find('.addHandleIcon').hide()
12 |
13 | # Track global mousedown/up status
14 | mouseIsDown = false
15 | $document.mousedown -> mouseIsDown = true
16 | $document.mouseup -> mouseIsDown = false
17 |
18 | # Show icon if hovering over click area while mouse is up
19 | elem.mouseover -> addHandleIcon.show() unless mouseIsDown
20 | elem.mouseout -> addHandleIcon.hide()
21 | elem.mousemove (event) -> addHandleIcon.css left: event.offsetX, top: event.offsetY - 5
22 |
23 | # Add color handle on left-mousedown
24 | elem.mousedown (event) ->
25 | leftClicked = event.which == 1
26 | if leftClicked
27 | scope.$apply -> scope.addColorHandle (event.pageX - elem.offset().left) / elem.width()
28 | addHandleIcon.hide()
--------------------------------------------------------------------------------
/test-gradient.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Breakfast (modified)
6 |
11 |
12 |
13 |
14 |
38 |
39 |
--------------------------------------------------------------------------------
/js/prettify/lang-n.js:
--------------------------------------------------------------------------------
1 | var a=null;
2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/,
3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]);
5 |
--------------------------------------------------------------------------------
/js/prettify/lang-clj.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2011 Google Inc.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | var a=null;
17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]);
19 |
--------------------------------------------------------------------------------
/js/src/directive/colorPicker.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Wrapper of jPicker color picker.
3 |
4 | Usage:
5 |
6 |
7 | colorPicker - {expression} - Options object for jPicker.
8 | ngModel - {expression} - Committed color will be bound to or read from this model.
9 | cancel - {expression} - Optional expression to eval on color picker cancel.
10 |
11 | Color model will always be set to rgba color or null; will only accept rgba and null input.
12 | ###
13 | GradientCreatorApp.directive 'colorPicker', ($timeout) ->
14 | require: 'ngModel'
15 | link: (scope, elem, attrs, ngModelCtrl) ->
16 | domElem = elem[0]
17 |
18 | # Init jPicker
19 | opts = angular.extend {images: clientPath: 'js/jpicker/images/'}, scope.$eval attrs.colorPicker
20 | commitColor = (color) -> scope.$apply ->
21 | rgba = color.val 'rgba'
22 | ngModelCtrl.$setViewValue if rgba then "rgba(#{rgba.r}, #{rgba.g}, #{rgba.b}, #{rgba.a / 255})" else null
23 | elem.jPicker opts, commitColor, null, -> if attrs.cancel? then scope.$apply -> scope.$eval attrs.cancel
24 |
25 | # Color model change
26 | ngModelCtrl.$formatters.push (color) ->
27 | if color
28 | colorParts = color.replace(/[^\d.,]/g, '').split(',')
29 |
30 | rgba =
31 | r: parseInt colorParts[0]
32 | g: parseInt colorParts[1]
33 | b: parseInt colorParts[2]
34 | a: 255 * parseFloat colorParts[3]
35 | domElem.color.active.val 'rgba', rgba
36 | domElem.color.current.val 'rgba', rgba
37 |
38 | # Honor ngShow
39 | scope.$watch attrs.ngShow, (show) -> $timeout -> elem.toggle show
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Live app
2 |
3 | https://zeke.blog/html5-canvas-gradient-creator-app/
4 |
5 | # HTML5 Canvas Gradient Creator
6 |
7 | There are plenty of CSS3 gradient creators out there, but much to my surprise there was not a single gradient creator for HTML5 `` to be found. Thus I present to you the only one of its kind, the HTML5 Canvas Gradient Creator.
8 |
9 | ## Features
10 |
11 | * Visual point-and-click, drag-and-slide creation of gradients for HTML5/JS canvas
12 | * 1-n color stops; as many as you need
13 | * 0-255 bit alpha support
14 | * Linear and radial gradients
15 | * Linear gradient rotation
16 | * Radial gradient inner and outer circle position
17 | * Elliptical radial gradients
18 | * Saving of custom presets (browser local storage)
19 | * Valid, commented HTML5 and JS code output
20 | * Responsive design
21 |
22 | ## Minimum compatibility
23 |
24 | This is minimum compatibility for usage of this tool, as well as for gradient code generated by this tool. Earlier versions of Chrome, Safari, or Opera might be supported.
25 |
26 | * Chrome: WinXP/OS X SL Chrome 14
27 | * Firefox: WinXP FF4 (FF3 for gradient code generated by tool), OS X SL FF5
28 | * IE: Win7-8 IE9*
29 | * Safari: WinXP/OS X SL Saf 4
30 | * Opera: WinXP Opera 10, OS X SL Opera 11.1
31 |
32 | \* Inclusion of FlashCanvas or excanvas might enable support for gradients in earlier versions of IE.
33 |
34 | ## Languages and libraries
35 |
36 | * AngularJS
37 | * CoffeeScript
38 | * jPicker color picker
39 | * prettify syntax highlighter
40 | * angular-local-storage
41 | * qTip tooltips
42 | * Iconic icons
43 |
44 | ## Building the CoffeeScript
45 |
46 | See js/build.sh.
47 |
--------------------------------------------------------------------------------
/js/jpicker/ReadMe.txt:
--------------------------------------------------------------------------------
1 | jPicker 1.1.6
2 |
3 | jQuery Plugin for Photoshop style color picker
4 |
5 | Copyright (c) 2010 Christopher T. Tillman
6 | Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/)
7 | MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE
8 |
9 | Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework.
10 |
11 | John Dyers' website: (http://johndyer.name)
12 | Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx)
13 |
14 |
15 | jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects.
16 | It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.
17 |
18 | jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari,
19 | and Opera.
20 |
21 | If you are updating a current version, you MUST always use the CSS and image files from the download as
22 | there may have been changes.
23 |
24 | If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the
25 | Color object returned by the callback functions.
26 |
27 |
28 | Known Issues
29 | ______________
30 | Attaching multiple jPicker objects on a single page will slow performance.
31 | jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances.
32 |
33 |
34 | Coming Soon
35 | ______________
36 |
37 | Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists.
38 |
39 | Planned For Future Release
40 | ______________
41 |
42 | Move the jPicker object to a single instance that all selection instances point to.
43 | - This will result in much faster operation and initialization for pages with multiple pickers.
44 |
45 | Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.
46 |
47 | Add multiple window modes for picker operation, include modal, popup, windowed, and exclusive.
--------------------------------------------------------------------------------
/js/prettify/sunburst.css:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 | /* Vim sunburst theme by David Leibovic */
3 |
4 | pre .str, code .str { color: #65B042; } /* string - green */
5 | pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
6 | pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
7 | pre .typ, code .typ { color: #89bdff; } /* type - light blue */
8 | pre .lit, code .lit { color: #3387CC; } /* literal - blue */
9 | pre .pun, code .pun { color: #fff; } /* punctuation - white */
10 | pre .pln, code .pln { color: #fff; } /* plaintext - white */
11 | pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
12 | pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
13 | pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
14 | pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
15 |
16 | pre.prettyprint, code.prettyprint {
17 | background-color: #000;
18 | -moz-border-radius: 8px;
19 | -webkit-border-radius: 8px;
20 | -o-border-radius: 8px;
21 | -ms-border-radius: 8px;
22 | -khtml-border-radius: 8px;
23 | border-radius: 8px;
24 | }
25 |
26 | pre.prettyprint {
27 | width: 95%;
28 | margin: 1em auto;
29 | padding: 1em;
30 | white-space: pre-wrap;
31 | }
32 |
33 |
34 | /* Specify class=linenums on a pre to get line numbering */
35 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
36 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
37 | /* Alternate shading for lines */
38 | li.L1,li.L3,li.L5,li.L7,li.L9 { }
39 |
40 | @media print {
41 | pre .str, code .str { color: #060; }
42 | pre .kwd, code .kwd { color: #006; font-weight: bold; }
43 | pre .com, code .com { color: #600; font-style: italic; }
44 | pre .typ, code .typ { color: #404; font-weight: bold; }
45 | pre .lit, code .lit { color: #044; }
46 | pre .pun, code .pun { color: #440; }
47 | pre .pln, code .pln { color: #000; }
48 | pre .tag, code .tag { color: #006; font-weight: bold; }
49 | pre .atn, code .atn { color: #404; }
50 | pre .atv, code .atv { color: #060; }
51 | }
--------------------------------------------------------------------------------
/js/local-storage/localStorageModule.min.js:
--------------------------------------------------------------------------------
1 | var angularLocalStorage=angular.module("LocalStorageModule",[]);angularLocalStorage.constant("prefix","ls");angularLocalStorage.constant("cookie",{expiry:30,path:"/"});
2 | angularLocalStorage.service("localStorageService",["$rootScope","prefix","cookie",function(f,d,h){"."!==d.substr(-1)&&(d=d?d+".":"");var g=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(a){return f.$broadcast("LocalStorageModule.notification.error",a.Description),!1}},j=function(a){if(!g())return f.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;try{localStorage.removeItem(d+a)}catch(b){return f.$broadcast("LocalStorageModule.notification.error",
3 | b.Description),!1}return!0},k=function(){try{return navigator.cookieEnabled||"cookie"in document&&(0 resizable by dragging in lower-right corner. It's necessary to target specifically
3 | because browsers depend on width/height DOM attributes for that node type rather than CSS.
4 |
5 | Usage:
6 |
9 |
10 | width - {model name} - Model name that will have width read from and written to.
11 | height - {model name} - Model name that will have height read from and written to.
12 |
13 | A controller is provided with method drawResizeIcon() that can be called to draw a resize icon in the lower-right
14 | corner of the canvas.
15 | ###
16 | GradientCreatorApp.directive 'resizableCanvas', ($document) ->
17 | controller: ($element) ->
18 | ctx = $element[0].getContext('2d')
19 |
20 | ###
21 | Call this after canvas is finished rendering; a resize icon in the lower icon will be overlayed on top.
22 | ###
23 | @drawResizeIcon = ->
24 | iconImage = new Image()
25 | iconImage.src = 'img/resizable.png'
26 | iconImage.onload = ->
27 | ctx.setTransform 1, 0, 0, 1, 0, 0
28 | ctx.drawImage(iconImage, $element.width() - 11, $element.height() - 11)
29 |
30 | link: (scope, elem, attrs) ->
31 | # Pixel square hit area to click and drag resize in bottom-right
32 | cornerHitAreaDim = 15
33 |
34 | # Min width or height of the canvas
35 | minDim = 15
36 |
37 | # Keep DOM width/height up to date with model
38 | scope.$watch attrs.width, (newWidth) -> elem.prop 'width', newWidth
39 | scope.$watch attrs.height, (newHeight) -> elem.prop 'height', newHeight
40 |
41 | ###
42 | @param {Number} offsetX Mouse offset X.
43 | @param {Number} offsetY Mouse offset Y.
44 |
45 | @return {Boolean} TRUE if mouse is within resize hit area.
46 | ###
47 | mouseInHitArea = (offsetX, offsetY) ->
48 | offsetX >= elem.prop('width') - cornerHitAreaDim and offsetY >= elem.prop('height') - cornerHitAreaDim
49 |
50 | # Track mouse down status
51 | dragging = false
52 | mouseDownPos = null
53 | elem.mousedown (event) ->
54 | if mouseInHitArea event.offsetX, event.offsetY
55 | dragging = true
56 | mouseDownPos = right: elem.prop('width') - event.offsetX, bottom: elem.prop('height') - event.offsetY
57 | elem.mouseup -> dragging = false
58 |
59 | $document.mousemove (event) ->
60 | if dragging or mouseInHitArea event.offsetX, event.offsetY
61 | elem.css 'cursor', 'nw-resize'
62 | if dragging
63 | newWidth = (event.pageX - elem.position().left) + mouseDownPos.right
64 | newHeight = (event.pageY - elem.position().top) + mouseDownPos.bottom
65 | if newWidth < minDim then newWidth = minDim
66 | if newHeight < minDim then newHeight = minDim
67 |
68 | # Dims actually changed
69 | if newWidth != elem.prop('width') or newHeight != elem.prop('height')
70 | scope.$apply ->
71 | scope[attrs.width] = newWidth
72 | scope[attrs.height] = newHeight
73 | # Not dragging or mouse not in hit area
74 | else
75 | elem.css 'cursor', 'auto'
--------------------------------------------------------------------------------
/js/src/model/GradientPreset.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Gradient preset with ID, name, color handles, persistence, etc.
3 |
4 | @param {Object} localStorageService From "LocalStorageModule".
5 | ###
6 | GradientCreatorApp.factory 'GradientPreset', (localStorageService) ->
7 | localStorageKey = 'SavedPresets'
8 |
9 | class GradientPreset
10 | ###
11 | @param {String} [id=]
12 | @param {String} [name=]
13 | @param {String} gradientType "linear" or "radial"
14 | @param {Number} width Pixel width.
15 | @param {Number} height Pixel height.
16 | @param {Number} rotate Rotation in degrees 0-360 ("linear" gradientType only).
17 | @param {Number} innerCircleX Percent from 0-100 ("radial" gradientType only).
18 | @param {Number} innerCircleY Percent from 0-100 ("radial" gradientType only).
19 | @param {Number} outerCircleX Percent from 0-100 ("radial" gradientType only).
20 | @param {Number} outerCircleY Percent from 0-100 ("radial" gradientType only).
21 | @param {Array} ColorHandles Array of ColorHandle.
22 | @param {Boolean} [saveable=false]
23 | @param {Boolean} [deleteable=false]
24 | @param {Boolean} [dirty=false]
25 | ###
26 | constructor: (
27 | @id
28 | @name
29 | @gradientType
30 | @width
31 | @height
32 | @rotate
33 | @innerCircleX
34 | @innerCircleY
35 | @outerCircleX
36 | @outerCircleY
37 | @ColorHandles
38 | @saveable = false
39 | @deleteable = false
40 | @dirty = false
41 | ) ->
42 |
43 | ###
44 | @return {GradientPreset} Deep clone of this preset.
45 | ###
46 | clone: ->
47 | angular.extend {}, @,
48 | ColorHandles: (angular.extend({}, CH) for CH in @ColorHandles)
49 |
50 | ###
51 | @return {Array} Array of gradient presets saved to storage.
52 | ###
53 | @query: ->
54 | # Fetch from storage and convert each to this class
55 | for presetConfig in angular.fromJson localStorageService.get(localStorageKey) ? '[]'
56 | angular.extend(new @, presetConfig)
57 |
58 | ###
59 | Saves this preset to storage.
60 | ###
61 | save: ->
62 | throw "This preset isn't saveable." if not @saveable
63 |
64 | # Get from storage
65 | SavedPresets = GradientPreset.query()
66 |
67 | # Save it over the top of preset with same ID if possible
68 | wasSaved = false
69 | for Preset, i in SavedPresets when Preset.id == @id
70 | SavedPresets[i] = @
71 | wasSaved = true
72 |
73 | # Didn't find one with same ID (new preset)
74 | if !wasSaved then SavedPresets.push @
75 |
76 | # Save all to storage
77 | localStorageService.add localStorageKey, angular.toJson SavedPresets
78 |
79 | ###
80 | Deletes this preset from storage.
81 | ###
82 | delete: ->
83 | throw "This preset isn't deleteable." if not @deleteable
84 |
85 | # Get from storage
86 | SavedPresets = GradientPreset.query()
87 |
88 | # Remove
89 | for Preset, i in SavedPresets when Preset.id == @id
90 | SavedPresets.splice i, 1
91 | break
92 |
93 | # Save all to storage
94 | localStorageService.add localStorageKey, angular.toJson SavedPresets
--------------------------------------------------------------------------------
/js/src/directive/colorHandle.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | The little arrow color handles that you drag around to adjust the gradient.
3 |
4 | Usage:
5 |
6 | ###
7 | GradientCreatorApp.directive 'colorHandle', ($document, $timeout) ->
8 | return (scope, elem, attrs) ->
9 | container = elem.parent()
10 | elem.addClass 'iconic'
11 |
12 | # Gets this color handle's color handle model
13 | getColorHandle = -> scope.$eval attrs.colorHandle
14 |
15 | # Color handle model change
16 | scope.$watch attrs.colorHandle, (ColorHandle, OldColorHandle) ->
17 | # Update position from stop
18 | leftExtremePercent = -3.4
19 | rightExtremePercent = 96.7
20 | elem.css 'left', leftExtremePercent + (ColorHandle.stop * (rightExtremePercent + Math.abs(leftExtremePercent))) + '%'
21 |
22 | # Valid color
23 | if ColorHandle.color != null
24 | elem.css 'color', ColorHandle.color
25 | # Null color
26 | else
27 | # Try to delete this handle
28 | deleted = scope.deleteColorHandle ColorHandle
29 |
30 | # Couldn't delete (last handle)
31 | if !deleted
32 | # Revert color
33 | ColorHandle.color = OldColorHandle.color
34 | , true
35 |
36 | scope.$watch 'ActiveColorHandle', (ActiveColorHandle) ->
37 | ThisColorHandle = getColorHandle()
38 |
39 | # Active color handle is this one
40 | elem.toggleClass 'arrow_up_alt1', ActiveColorHandle == ThisColorHandle
41 |
42 | # Active color handle is not this one
43 | elem.toggleClass 'arrow_up', ActiveColorHandle != ThisColorHandle
44 |
45 | # Element draggability
46 | mousemoveListener = null
47 | elem.mousedown (event) ->
48 | leftClicked = event.which == 1
49 | if leftClicked then beginDragging()
50 |
51 | # Triggers dragging... should only be triggered if mouse is actually down
52 | beginDragging = ->
53 | ThisColorHandle = getColorHandle()
54 | scope.$apply -> scope.setActiveColorHandle ThisColorHandle
55 | elem.addClass 'dragging'
56 | if not mousemoveListener then $document.mousemove mousemoveListener = (event) ->
57 | scope.$apply ->
58 | ThisColorHandle.stop = (event.pageX - container.position().left) / container.width()
59 | if ThisColorHandle.stop < 0 then ThisColorHandle.stop = 0
60 | else if ThisColorHandle.stop > 1 then ThisColorHandle.stop = 1
61 |
62 | # Stop dragging as appropriate
63 | $document.mouseup ->
64 | if elem.hasClass 'dragging'
65 | elem.removeClass 'dragging'
66 | if mousemoveListener != null
67 | $document.unbind 'mousemove', mousemoveListener
68 | mousemoveListener = null
69 |
70 | # Right-click to delete
71 | elem.mouseup ->
72 | rightClicked = event.which == 3
73 | if rightClicked then scope.$apply -> scope.deleteColorHandle getColorHandle()
74 |
75 | # Instructed to force a drag immediately (such as when adding a color handle) and mouse is down.
76 | # Timed out to ensure mouseIsDown status is up to date.
77 | $timeout ->
78 | ThisColorHandle = getColorHandle()
79 | if ThisColorHandle.forceDrag and scope.getMouseIsDown()
80 | ThisColorHandle.forceDrag = false
81 | scope.setActiveColorHandle ThisColorHandle
82 | beginDragging()
--------------------------------------------------------------------------------
/js/jpicker/css/jPicker-1.1.6.min.css:
--------------------------------------------------------------------------------
1 | .jPicker .Icon{display:inline-block;height:24px;position:relative;text-align:left;width:25px}.jPicker .Icon span.Color,.jPicker .Icon span.Alpha{background-position:2px 2px;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker .Icon span.Image{background-repeat:no-repeat;cursor:pointer;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker.Container{color:#000;z-index:10}table.jPicker{background-color:#efefef;border:1px outset #666;font-family:Arial,Helvetica,Sans-Serif;font-size:12px!important;margin:0;padding:5px;width:545px;z-index:20}.jPicker .Move{background-color:#ddd;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;cursor:move;height:12px;padding:0}.jPicker .Title{font-size:11px!important;font-weight:bold;margin:-2px 0 0 0;padding:10px 0 0 0;text-align:center;width:100%}.jPicker div.Map{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:crosshair;height:260px;margin:0 10px 10px 10px;overflow:hidden;padding:0;position:relative;width:260px}.jPicker div[class="Map"]{height:256px;width:256px}.jPicker div.Bar{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:n-resize;height:260px;margin:12px 10px 0 5px;overflow:hidden;padding:0;position:relative;width:24px}.jPicker div[class="Bar"]{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3,.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4,.jPicker .Bar .Map5,.jPicker .Bar .Map6{background-color:transparent;background-image:none;display:block;left:0;position:absolute;top:0}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3{height:2596px;width:256px}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{height:3896px;width:20px}.jPicker .Bar .Map5,.jPicker .Bar .Map6{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Bar .Map6{background-repeat:no-repeat}.jPicker .Map .Map3,.jPicker .Bar .Map5{background-repeat:repeat}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{background-repeat:repeat-x}.jPicker .Map .Arrow{display:block;position:absolute}.jPicker .Bar .Arrow{display:block;left:0;position:absolute}.jPicker .Preview{font-size:9px;padding:5px 0 0 0;text-align:center}.jPicker .Preview div{border:2px inset #eee;height:62px;margin:0 auto;padding:0;width:62px}.jPicker .Preview div span{border:1px solid #000;display:block;height:30px;margin:0 auto;padding:0;width:60px}.jPicker .Preview .Active{border-bottom-width:0}.jPicker .Preview .Current{border-top-width:0;cursor:pointer}.jPicker input{font-size:13px}.jPicker .Button{text-align:center;padding:0 4px;width:115px}.jPicker .Button input{padding:2px 0;width:100px}.jPicker .Button .Ok{margin:12px 0 5px 0}.jPicker td{margin:0;padding:0}.jPicker td.Radio{margin:0;padding:0;width:31px}.jPicker td.Radio input{margin:0 5px 0 0;padding:0}.jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px}.jPicker tr.Hex td.Text{width:100px}.jPicker td.Text input{background-color:#fff;border:1px inset #aaa;height:19px;margin:0 0 0 5px;text-align:left;width:30px}.jPicker td[class="Text"] input{height:15px}.jPicker tr.Hex td.Text input.Hex{width:50px}.jPicker tr.Hex td.Text input.AHex{width:20px}.jPicker .Grid{text-align:center;width:114px}.jPicker .Grid span.QuickColor{border:1px inset #aaa;cursor:pointer;display:inline-block;height:15px;line-height:15px;margin:0;padding:0;width:19px}.jPicker .Grid span[class="QuickColor"]{width:17px}
--------------------------------------------------------------------------------
/js/src/directive/slider.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | Horizontal slider.
3 |
4 | Usage:
5 |
6 |
7 | value - {expression} - Model to bind slider value to.
8 | min - {Number} - Slider value at leftmost position.
9 | max - {Number} - Slider value at rightmost position.
10 | precision - {int} - Number of places after decimal to keep in value, 0-20 per limits of Number.toFixed().
11 | ###
12 | GradientCreatorApp.directive 'slider', ($timeout, $document) ->
13 | scope:
14 | value: '='
15 | handleLeft: '@'
16 | template: ''
17 | replace: false
18 | link: (scope, elem, attrs) ->
19 | min = max = precision = handleLeft = rawValue = null
20 | $handle = elem.find '.handle'
21 |
22 | # Keep min/max/round up to date
23 | scope.$watch attrs.min, (watched) -> min = parseFloat watched; if scope.value < min then scope.value = min
24 | scope.$watch attrs.max, (watched) -> max = parseFloat watched; if scope.value > max then scope.value = max
25 | scope.$watch attrs.precision, (watched) ->
26 | precision = watched
27 | if rawValue?
28 | scope.value = parseFloat(rawValue).toFixed precision
29 |
30 | ###
31 | Update slider value directly.
32 | ###
33 | updateSliderValue = (newValue) ->
34 | # Fix precision and bounds
35 | newValue = parseFloat newValue
36 | scope.value = switch
37 | when newValue < min then min
38 | when newValue > max then max
39 | else newValue
40 | scope.value = parseFloat scope.value.toFixed precision
41 |
42 | # Keep slider up to date with value
43 | minLeft = 0
44 | maxLeft = 100
45 | init = true
46 | scope.$watch 'value', (rawValue, oldValue) ->
47 | if rawValue? and (rawValue != oldValue or init)
48 | updateSliderValue rawValue
49 | scope.handleLeft = minLeft + (maxLeft - minLeft) * (rawValue - min) / (max - min) + '%'
50 | init = false
51 |
52 | # Init value if needed
53 | if !scope.value?
54 | $timeout -> scope.value = min
55 |
56 | ###
57 | Updates handle left pos to correspond with mouse pageX.
58 | ###
59 | updateHandleLeftFromMouse = (mousePageX) ->
60 | scope.handleLeft = minLeft + (maxLeft - minLeft) * (mousePageX - elem.position().left) / elem.width()
61 | if scope.handleLeft < minLeft then scope.handleLeft = minLeft
62 | else if scope.handleLeft > maxLeft then scope.handleLeft = maxLeft
63 | scope.handleLeft += '%'
64 |
65 | ###
66 | Update slider value to correspond with mouse pageX.
67 | ###
68 | updateValueFromMouse = (mousePageX) ->
69 | scope.value = min + (max - min) * (mousePageX - elem.position().left) / elem.width()
70 | if scope.value < min then scope.value = min
71 | else if scope.value > max then scope.value = max
72 | scope.value = parseFloat scope.value.toFixed precision
73 |
74 | # Handle draggability
75 | mousemoveListener = null
76 | $handle.mousedown (e) ->
77 | $timeout -> $handle.focus()
78 | $document.mousemove mousemoveListener = (event) ->
79 | scope.$apply ->
80 | updateHandleLeftFromMouse event.pageX
81 | updateValueFromMouse event.pageX
82 | if e.immediateUpdate then mousemoveListener(e)
83 | false
84 | $document.mouseup ->
85 | if mousemoveListener != null
86 | $document.unbind 'mousemove', mousemoveListener
87 | mousemoveListener = null
88 |
89 | # Slider bar mousedown
90 | elem.mousedown (e) ->
91 | # Simulate handle mousedown for dragging + immediate update
92 | $handle.trigger jQuery.Event 'mousedown',
93 | pageX: e.pageX
94 | immediateUpdate: true
95 |
96 | ###
97 | Update value by a percent-of-range delta.
98 | @param {Number} percentDelta Floating point percent from 0-1.
99 | ###
100 | updateValueByPercentDelta = (percentDelta) ->
101 | updateSliderValue parseFloat(scope.value) + percentDelta * (max - min)
102 |
103 | # Handle keypress
104 | $handle.keydown (e) ->
105 | switch e.which
106 | # UP or RIGHT
107 | when 38, 39 then scope.$apply -> updateValueByPercentDelta 0.01
108 | # DOWN or LEFT
109 | when 40, 37 then scope.$apply -> updateValueByPercentDelta -0.01
110 | # HOME
111 | when 36 then scope.$apply -> updateSliderValue min
112 | # END
113 | when 35 then scope.$apply -> updateSliderValue max
114 | # PAGE UP
115 | when 33 then scope.$apply -> updateValueByPercentDelta -0.1
116 | # PAGE DOWN
117 | when 34 then scope.$apply -> updateValueByPercentDelta 0.1
118 | else didntHandleKey = true
119 |
120 | e.preventDefault() unless didntHandleKey? and didntHandleKey
--------------------------------------------------------------------------------
/css/iconic_fill.css:
--------------------------------------------------------------------------------
1 | @font-face { font-family: 'IconicFill'; src: url('iconic_fill.eot'); src: url('iconic_fill.eot?#iefix') format('embedded-opentype'), url('iconic_fill.ttf') format('truetype'), url('iconic_fill.svg#iconic') format('svg'); font-weight: normal; font-style: normal; }.iconic { display:inline-block; font-family: 'IconicFill'; }.lightbulb:before {content:'\e063';}.equalizer:before {content:'\e052';}.brush_alt:before {content:'\e01c';}.move:before {content:'\e03e';}.tag_fill:before {content:'\e02b';}.book_alt2:before {content:'\e06a';}.layers:before {content:'\e01f';}.chat_alt_fill:before {content:'\e007';}.layers_alt:before {content:'\e020';}.cloud_upload:before {content:'\e045';}.chart_alt:before {content:'\e029';}.fullscreen_exit_alt:before {content:'\e051';}.cloud_download:before {content:'\e044';}.paperclip:before {content:'\e08a';}.heart_fill:before {content:'\2764';}.mail:before {content:'\2709';}.pen_alt_fill:before {content:'\e005';}.check_alt:before {content:'\2718';}.battery_charging:before {content:'\e05d';}.lock_fill:before {content:'\e075';}.stop:before {content:'\e04a';}.arrow_up:before {content:'\2191';}.move_horizontal:before {content:'\e038';}.compass:before {content:'\e021';}.minus_alt:before {content:'\e009';}.battery_empty:before {content:'\e05c';}.comment_fill:before {content:'\e06d';}.map_pin_alt:before {content:'\e002';}.question_mark:before {content:'\003f';}.list:before {content:'\e055';}.upload:before {content:'\e043';}.reload:before {content:'\e030';}.loop_alt4:before {content:'\e035';}.loop_alt3:before {content:'\e034';}.loop_alt2:before {content:'\e033';}.loop_alt1:before {content:'\e032';}.left_quote:before {content:'\275d';}.x:before {content:'\2713';}.last:before {content:'\e04d';}.bars:before {content:'\e06f';}.arrow_left:before {content:'\2190';}.arrow_down:before {content:'\2193';}.download:before {content:'\e042';}.home:before {content:'\2302';}.calendar:before {content:'\e001';}.right_quote_alt:before {content:'\e012';}.unlock_fill:before {content:'\e076';}.fullscreen:before {content:'\e04e';}.dial:before {content:'\e058';}.plus_alt:before {content:'\e008';}.clock:before {content:'\e079';}.movie:before {content:'\e060';}.steering_wheel:before {content:'\e024';}.pen:before {content:'\270e';}.pin:before {content:'\e067';}.denied:before {content:'\26d4';}.left_quote_alt:before {content:'\e011';}.volume_mute:before {content:'\e071';}.umbrella:before {content:'\2602';}.list_nested:before {content:'\e056';}.arrow_up_alt1:before {content:'\e014';}.undo:before {content:'\e02f';}.pause:before {content:'\e049';}.bolt:before {content:'\26a1';}.article:before {content:'\e053';}.read_more:before {content:'\e054';}.beaker:before {content:'\e023';}.beaker_alt:before {content:'\e010';}.battery_full:before {content:'\e073';}.arrow_right:before {content:'\2192';}.iphone:before {content:'\e06e';}.arrow_up_alt2:before {content:'\e018';}.cog:before {content:'\2699';}.award_fill:before {content:'\e022';}.first:before {content:'\e04c';}.trash_fill:before {content:'\e05a';}.image:before {content:'\e027';}.comment_alt1_fill:before {content:'\e003';}.cd:before {content:'\e064';}.right_quote:before {content:'\275e';}.brush:before {content:'\e01b';}.cloud:before {content:'\2601';}.eye:before {content:'\e025';}.play_alt:before {content:'\e048';}.transfer:before {content:'\e041';}.pen_alt2:before {content:'\e006';}.camera:before {content:'\e070';}.move_horizontal_alt2:before {content:'\e03a';}.curved_arrow:before {content:'\2935';}.move_horizontal_alt1:before {content:'\e039';}.aperture:before {content:'\e026';}.reload_alt:before {content:'\e031';}.magnifying_glass:before {content:'\e074';}.calendar_alt_fill:before {content:'\e06c';}.fork:before {content:'\e046';}.box:before {content:'\e06b';}.map_pin_fill:before {content:'\e068';}.bars_alt:before {content:'\e00a';}.volume:before {content:'\e072';}.x_alt:before {content:'\2714';}.link:before {content:'\e077';}.move_vertical:before {content:'\e03b';}.eyedropper:before {content:'\e01e';}.spin:before {content:'\e036';}.rss:before {content:'\e02c';}.info:before {content:'\2139';}.target:before {content:'\e02a';}.cursor:before {content:'\e057';}.key_fill:before {content:'\26bf';}.minus:before {content:'\2796';}.book_alt:before {content:'\e00b';}.headphones:before {content:'\e061';}.hash:before {content:'\0023';}.arrow_left_alt1:before {content:'\e013';}.arrow_left_alt2:before {content:'\e017';}.fullscreen_exit:before {content:'\e050';}.share:before {content:'\e02e';}.fullscreen_alt:before {content:'\e04f';}.comment_alt2_fill:before {content:'\e004';}.moon_fill:before {content:'\263e';}.at:before {content:'\0040';}.chat:before {content:'\e05e';}.move_vertical_alt2:before {content:'\e03d';}.move_vertical_alt1:before {content:'\e03c';}.check:before {content:'\2717';}.mic:before {content:'\e05f';}.book:before {content:'\e069';}.move_alt1:before {content:'\e03f';}.move_alt2:before {content:'\e040';}.document_fill:before {content:'\e066';}.plus:before {content:'\2795';}.wrench:before {content:'\e078';}.play:before {content:'\e047';}.star:before {content:'\2605';}.document_alt_fill:before {content:'\e000';}.chart:before {content:'\e028';}.rain:before {content:'\26c6';}.folder_fill:before {content:'\e065';}.new_window:before {content:'\e059';}.user:before {content:'\e062';}.battery_half:before {content:'\e05b';}.aperture_alt:before {content:'\e00c';}.eject:before {content:'\e04b';}.arrow_down_alt1:before {content:'\e016';}.pilcrow:before {content:'\00b6';}.arrow_down_alt2:before {content:'\e01a';}.arrow_right_alt1:before {content:'\e015';}.arrow_right_alt2:before {content:'\e019';}.rss_alt:before {content:'\e02d';}.spin_alt:before {content:'\e037';}.sun_fill:before {content:'\2600';}
--------------------------------------------------------------------------------
/js/jpicker/css/jPicker-1.1.6.css:
--------------------------------------------------------------------------------
1 | .jPicker .Icon {
2 | display: inline-block;
3 | height: 24px; /* change this value if using a different sized color picker icon */
4 | position: relative; /* make this element an absolute positioning container */
5 | text-align: left; /* make the zero width children position to the left of container */
6 | width: 25px; /* change this value if using a different sized color picker icon */
7 | }
8 | .jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
9 | background-position: 2px 2px;
10 | display: block;
11 | height: 100%;
12 | left: 0px;
13 | position: absolute;
14 | top: 0px;
15 | width: 100%;
16 | }
17 | .jPicker .Icon span.Image {
18 | background-repeat: no-repeat;
19 | cursor: pointer;
20 | display: block;
21 | height: 100%;
22 | left: 0px;
23 | position: absolute;
24 | top: 0px;
25 | width: 100%;
26 | }
27 | .jPicker.Container {
28 | color: #000;
29 | z-index: 10;
30 | }
31 | table.jPicker {
32 | background-color: #efefef;
33 | border: 1px outset #666;
34 | font-family: Arial, Helvetica, Sans-Serif;
35 | font-size: 12px !important;
36 | margin: 0px;
37 | padding: 5px;
38 | width: 545px;
39 | z-index: 20;
40 | }
41 | .jPicker .Move {
42 | background-color: #dddddd;
43 | border-color: #fff #666 #666 #fff;
44 | border-style: solid;
45 | border-width: 1px;
46 | cursor: move;
47 | height: 12px;
48 | padding: 0px;
49 | }
50 | .jPicker .Title {
51 | font-size: 11px !important;
52 | font-weight: bold;
53 | margin: -2px 0px 0px 0px;
54 | padding: 10px 0px 0px 0px;
55 | text-align: center;
56 | width: 100%;
57 | }
58 | .jPicker div.Map {
59 | border-bottom: 2px solid #fff;
60 | border-left: 2px solid #9a9a9a;
61 | border-right: 2px solid #fff;
62 | border-top: 2px solid #9a9a9a;
63 | cursor: crosshair;
64 | height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
65 | margin: 0px 10px 10px 10px;
66 | overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */
67 | padding: 0px;
68 | position: relative; /* make this element an absolute positioning container */
69 | width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
70 | }
71 | .jPicker div[class="Map"] {
72 | height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
73 | width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
74 | }
75 | .jPicker div.Bar {
76 | border-bottom: 2px solid #fff;
77 | border-left: 2px solid #9a9a9a;
78 | border-right: 2px solid #fff;
79 | border-top: 2px solid #9a9a9a;
80 | cursor: n-resize;
81 | height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
82 | margin: 12px 10px 0px 5px;
83 | overflow: hidden;
84 | padding: 0px;
85 | position: relative;
86 | width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */
87 | }
88 | .jPicker div[class="Bar"] {
89 | height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
90 | width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
91 | }
92 | .jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
93 | background-color: transparent;
94 | background-image: none;
95 | display: block;
96 | left: 0px;
97 | position: absolute;
98 | top: 0px;
99 | }
100 | .jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 {
101 | height: 2596px;
102 | width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
103 | would not be drawn if its overflow is set to hidden. */
104 | }
105 | .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
106 | height: 3896px;
107 | width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
108 | would not be drawn if its overflow is set to hidden. */
109 | }
110 | .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
111 | height: 256px;
112 | width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
113 | would not be drawn if its overflow is set to hidden. */
114 | }
115 | .jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 {
116 | background-repeat: no-repeat;
117 | }
118 | .jPicker .Map .Map3, .jPicker .Bar .Map5 {
119 | background-repeat: repeat;
120 | }
121 | .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
122 | background-repeat: repeat-x;
123 | }
124 | .jPicker .Map .Arrow {
125 | display: block;
126 | position: absolute;
127 | }
128 | .jPicker .Bar .Arrow {
129 | display: block;
130 | left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */
131 | position: absolute;
132 | }
133 | .jPicker .Preview {
134 | font-size: 9px;
135 | padding: 5px 0px 0px 0px;
136 | text-align: center;
137 | }
138 | .jPicker .Preview div {
139 | border: 2px inset #eee;
140 | height: 62px;
141 | margin: 0px auto;
142 | padding: 0px;
143 | width: 62px;
144 | }
145 | .jPicker .Preview div span {
146 | border: 1px solid #000;
147 | display: block;
148 | height: 30px;
149 | margin: 0px auto;
150 | padding: 0px;
151 | width: 60px;
152 | }
153 | .jPicker .Preview .Active {
154 | border-bottom-width: 0px;
155 | }
156 | .jPicker .Preview .Current {
157 | border-top-width: 0px;
158 | cursor: pointer;
159 | }
160 | .jPicker input {
161 | font-size: 13px;
162 | }
163 | .jPicker .Button {
164 | text-align: center;
165 | padding: 0px 4px;
166 | width: 115px;
167 | }
168 | .jPicker .Button input {
169 | padding: 2px 0px;
170 | width: 100px;
171 | }
172 | .jPicker .Button .Ok {
173 | margin: 12px 0px 5px 0px;
174 | }
175 | .jPicker td {
176 | margin: 0px;
177 | padding: 0px;
178 | }
179 | .jPicker td.Radio {
180 | margin: 0px;
181 | padding: 0px;
182 | width: 31px;
183 | }
184 | .jPicker td.Radio input {
185 | margin: 0px 5px 0px 0px;
186 | padding: 0px;
187 | }
188 | .jPicker td.Text {
189 | font-size: 12px !important;
190 | height: 22px;
191 | margin: 0px;
192 | padding: 0px;
193 | text-align: left;
194 | width: 70px;
195 | }
196 | .jPicker tr.Hex td.Text {
197 | width: 100px;
198 | }
199 | .jPicker td.Text input {
200 | background-color: #fff;
201 | border: 1px inset #aaa;
202 | height: 19px;
203 | margin: 0px 0px 0px 5px;
204 | text-align: left;
205 | width: 30px;
206 | }
207 | .jPicker td[class="Text"] input {
208 | height: 15px;
209 | }
210 | .jPicker tr.Hex td.Text input.Hex {
211 | width: 50px;
212 | }
213 | .jPicker tr.Hex td.Text input.AHex {
214 | width: 20px;
215 | }
216 | .jPicker .Grid {
217 | text-align: center;
218 | width: 114px;
219 | }
220 | .jPicker .Grid span.QuickColor {
221 | border: 1px inset #aaa;
222 | cursor: pointer;
223 | display: inline-block;
224 | height: 15px;
225 | line-height: 15px;
226 | margin: 0px;
227 | padding: 0px;
228 | width: 19px;
229 | }
230 | .jPicker .Grid span[class="QuickColor"] {
231 | width: 17px;
232 | }
--------------------------------------------------------------------------------
/js/local-storage/localStorageModule.js:
--------------------------------------------------------------------------------
1 | /* Start angularLocalStorage */
2 |
3 | var angularLocalStorage = angular.module('LocalStorageModule', []);
4 |
5 | // You should set a prefix to avoid overwriting any local storage variables from the rest of your app
6 | // e.g. angularLocalStorage.constant('prefix', 'youAppName');
7 | angularLocalStorage.constant('prefix', 'ls');
8 | // Cookie options (usually in case of fallback)
9 | // expiry = Number of days before cookies expire // 0 = Does not expire
10 | // path = The web path the cookie represents
11 | angularLocalStorage.constant('cookie', { expiry:30, path: '/'});
12 |
13 | angularLocalStorage.service('localStorageService', [
14 | '$rootScope',
15 | 'prefix',
16 | 'cookie',
17 | function($rootScope, prefix, cookie) {
18 |
19 | // If there is a prefix set in the config lets use that with an appended period for readability
20 | //var prefix = angularLocalStorage.constant;
21 | if (prefix.substr(-1)!=='.') {
22 | prefix = !!prefix ? prefix + '.' : '';
23 | }
24 |
25 | // Checks the browser to see if local storage is supported
26 | var browserSupportsLocalStorage = function () {
27 | try {
28 | return ('localStorage' in window && window['localStorage'] !== null);
29 | } catch (e) {
30 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
31 | return false;
32 | }
33 | };
34 |
35 | // Directly adds a value to local storage
36 | // If local storage is not available in the browser use cookies
37 | // Example use: localStorageService.add('library','angular');
38 | var addToLocalStorage = function (key, value) {
39 |
40 | // If this browser does not support local storage use cookies
41 | if (!browserSupportsLocalStorage()) {
42 | $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
43 | return false;
44 | }
45 |
46 | // 0 and "" is allowed as a value but let's limit other falsey values like "undefined"
47 | if (!value && value!==0 && value!=="") return false;
48 |
49 | try {
50 | localStorage.setItem(prefix+key, value);
51 | } catch (e) {
52 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
53 | return false;
54 | }
55 | return true;
56 | };
57 |
58 | // Directly get a value from local storage
59 | // Example use: localStorageService.get('library'); // returns 'angular'
60 | var getFromLocalStorage = function (key) {
61 | if (!browserSupportsLocalStorage()) {
62 | $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
63 | return false;
64 | }
65 |
66 | var item = localStorage.getItem(prefix+key);
67 | if (!item) return null;
68 | return item;
69 | };
70 |
71 | // Remove an item from local storage
72 | // Example use: localStorageService.remove('library'); // removes the key/value pair of library='angular'
73 | var removeFromLocalStorage = function (key) {
74 | if (!browserSupportsLocalStorage()) {
75 | $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
76 | return false;
77 | }
78 |
79 | try {
80 | localStorage.removeItem(prefix+key);
81 | } catch (e) {
82 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
83 | return false;
84 | }
85 | return true;
86 | };
87 |
88 | // Remove all data for this app from local storage
89 | // Example use: localStorageService.clearAll();
90 | // Should be used mostly for development purposes
91 | var clearAllFromLocalStorage = function () {
92 |
93 | if (!browserSupportsLocalStorage()) {
94 | $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
95 | return false;
96 | }
97 |
98 | var prefixLength = prefix.length;
99 |
100 | for (var key in localStorage) {
101 | // Only remove items that are for this app
102 | if (key.substr(0,prefixLength) === prefix) {
103 | try {
104 | removeFromLocalStorage(key.substr(prefixLength));
105 | } catch (e) {
106 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
107 | return false;
108 | }
109 | }
110 | }
111 | return true;
112 | };
113 |
114 | // Checks the browser to see if cookies are supported
115 | var browserSupportsCookies = function() {
116 | try {
117 | return navigator.cookieEnabled ||
118 | ("cookie" in document && (document.cookie.length > 0 ||
119 | (document.cookie = "test").indexOf.call(document.cookie, "test") > -1));
120 | } catch (e) {
121 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
122 | return false;
123 | }
124 | }
125 |
126 | // Directly adds a value to cookies
127 | // Typically used as a fallback is local storage is not available in the browser
128 | // Example use: localStorageService.cookie.add('library','angular');
129 | var addToCookies = function (key, value) {
130 |
131 | if (typeof value == "undefined") return false;
132 |
133 | if (!browserSupportsCookies()) {
134 | $rootScope.$broadcast('LocalStorageModule.notification.error','COOKIES_NOT_SUPPORTED');
135 | return false;
136 | }
137 |
138 | try {
139 | var expiry = '', expiryDate = new Date();
140 | if (value === null) {
141 | cookie.expiry = -1;
142 | value = '';
143 | }
144 | if (cookie.expiry !== 0) {
145 | expiryDate.setTime(expiryDate.getTime() + (cookie.expiry*24*60*60*1000));
146 | expiry = "; expires="+expiryDate.toGMTString();
147 | }
148 | document.cookie = prefix + key + "=" + encodeURIComponent(value) + expiry + "; path="+cookie.path;
149 | } catch (e) {
150 | $rootScope.$broadcast('LocalStorageModule.notification.error',e.Description);
151 | return false;
152 | }
153 | return true;
154 | };
155 |
156 | // Directly get a value from a cookie
157 | // Example use: localStorageService.cookie.get('library'); // returns 'angular'
158 | var getFromCookies = function (key) {
159 | if (!browserSupportsCookies()) {
160 | $rootScope.$broadcast('LocalStorageModule.notification.error','COOKIES_NOT_SUPPORTED');
161 | return false;
162 | }
163 |
164 | var cookies = document.cookie.split(';');
165 | for(var i=0;i < cookies.length;i++) {
166 | var thisCookie = cookies[i];
167 | while (thisCookie.charAt(0)==' ') {
168 | thisCookie = thisCookie.substring(1,thisCookie.length);
169 | }
170 | if (thisCookie.indexOf(prefix+key+'=') == 0) {
171 | return decodeURIComponent(thisCookie.substring(prefix.length+key.length+1,thisCookie.length));
172 | }
173 | }
174 | return null;
175 | };
176 |
177 | var removeFromCookies = function (key) {
178 | addToCookies(key,null);
179 | }
180 |
181 | var clearAllFromCookies = function () {
182 | var thisCookie = null, thisKey = null;
183 | var prefixLength = prefix.length;
184 | var cookies = document.cookie.split(';');
185 | for(var i=0;i < cookies.length;i++) {
186 | thisCookie = cookies[i];
187 | while (thisCookie.charAt(0)==' ') {
188 | thisCookie = thisCookie.substring(1,thisCookie.length);
189 | }
190 | key = thisCookie.substring(prefixLength,thisCookie.indexOf('='));
191 | removeFromCookies(key);
192 | }
193 | }
194 |
195 |
196 | return {
197 | isSupported: browserSupportsLocalStorage,
198 | add: addToLocalStorage,
199 | get: getFromLocalStorage,
200 | remove: removeFromLocalStorage,
201 | clearAll: clearAllFromLocalStorage,
202 | cookie: {
203 | add: addToCookies,
204 | get: getFromCookies,
205 | remove: removeFromCookies,
206 | clearAll: clearAllFromCookies
207 | }
208 | };
209 |
210 | }]);
211 |
--------------------------------------------------------------------------------
/css/iconic_fill.afm:
--------------------------------------------------------------------------------
1 | StartFontMetrics 2.0
2 | Comment Generated by FontForge 20110222
3 | Comment Creation Date: Sun Apr 1 19:42:26 2012
4 | FontName IconicFill
5 | FullName Iconic Fill
6 | FamilyName Iconic
7 | Weight Medium
8 | Notice (Icons by PJ Onori, font creation script by Yann)
9 | ItalicAngle 0
10 | IsFixedPitch false
11 | UnderlinePosition -100
12 | UnderlineThickness 50
13 | Version 001.000
14 | EncodingScheme ISOLatin1Encoding
15 | FontBBox 14 -14 760 731
16 | Descender -2147483648
17 | StartCharMetrics 151
18 | C 35 ; WX 681 ; N numbersign ; B 15 -14 667 731 ;
19 | C 63 ; WX 402 ; N question ; B 15 -14 388 731 ;
20 | C 64 ; WX 774 ; N at ; B 15 -14 760 731 ;
21 | C 182 ; WX 588 ; N paragraph ; B 15 -14 574 731 ;
22 | C -1 ; WX 495 ; N glyph0 ; B 15 -14 481 731 ;
23 | C -1 ; WX 774 ; N glyph1 ; B 15 -14 760 731 ;
24 | C -1 ; WX 774 ; N glyph2 ; B 15 -14 760 731 ;
25 | C -1 ; WX 774 ; N glyph3 ; B 15 -14 760 731 ;
26 | C -1 ; WX 774 ; N glyph4 ; B 15 -14 760 731 ;
27 | C -1 ; WX 774 ; N glyph5 ; B 15 32 760 684 ;
28 | C -1 ; WX 774 ; N glyph6 ; B 15 32 760 684 ;
29 | C -1 ; WX 774 ; N glyph7 ; B 15 -14 760 731 ;
30 | C -1 ; WX 774 ; N glyph8 ; B 15 -14 760 731 ;
31 | C -1 ; WX 774 ; N glyph9 ; B 15 -14 760 731 ;
32 | C -1 ; WX 728 ; N glyph10 ; B 14 -14 713 731 ;
33 | C -1 ; WX 774 ; N glyph11 ; B 15 -14 760 731 ;
34 | C -1 ; WX 774 ; N glyph12 ; B 15 -14 760 731 ;
35 | C -1 ; WX 681 ; N glyph13 ; B 15 -14 667 730 ;
36 | C -1 ; WX 774 ; N glyph14 ; B 15 32 760 684 ;
37 | C -1 ; WX 774 ; N glyph15 ; B 15 79 760 638 ;
38 | C -1 ; WX 774 ; N glyph16 ; B 15 -14 760 731 ;
39 | C -1 ; WX 774 ; N glyph17 ; B 15 -14 760 731 ;
40 | C -1 ; WX 774 ; N glyph18 ; B 15 172 760 545 ;
41 | C -1 ; WX 588 ; N glyph19 ; B 15 -14 574 731 ;
42 | C -1 ; WX 774 ; N glyph20 ; B 15 -14 760 731 ;
43 | C -1 ; WX 774 ; N glyph21 ; B 15 -14 760 731 ;
44 | C -1 ; WX 774 ; N glyph22 ; B 15 218 760 498 ;
45 | C -1 ; WX 774 ; N glyph23 ; B 15 -14 760 731 ;
46 | C -1 ; WX 774 ; N glyph24 ; B 15 -14 760 731 ;
47 | C -1 ; WX 774 ; N glyph25 ; B 15 172 760 545 ;
48 | C -1 ; WX 774 ; N glyph26 ; B 15 32 760 684 ;
49 | C -1 ; WX 402 ; N glyph27 ; B 15 -14 388 731 ;
50 | C -1 ; WX 774 ; N glyph29 ; B 15 32 760 684 ;
51 | C -1 ; WX 588 ; N glyph30 ; B 15 -14 574 731 ;
52 | C -1 ; WX 588 ; N glyph31 ; B 15 32 574 684 ;
53 | C -1 ; WX 774 ; N glyph32 ; B 15 79 760 638 ;
54 | C -1 ; WX 774 ; N glyph33 ; B 15 79 760 638 ;
55 | C -1 ; WX 774 ; N glyph34 ; B 15 32 760 684 ;
56 | C -1 ; WX 774 ; N glyph35 ; B 15 79 760 638 ;
57 | C -1 ; WX 774 ; N glyph36 ; B 15 79 760 638 ;
58 | C -1 ; WX 681 ; N glyph37 ; B 15 32 667 684 ;
59 | C -1 ; WX 774 ; N glyph38 ; B 15 -14 760 731 ;
60 | C -1 ; WX 774 ; N glyph39 ; B 15 -14 760 731 ;
61 | C -1 ; WX 774 ; N glyph40 ; B 15 -14 760 731 ;
62 | C -1 ; WX 774 ; N glyph41 ; B 15 -14 760 731 ;
63 | C -1 ; WX 588 ; N glyph42 ; B 15 -14 574 731 ;
64 | C -1 ; WX 774 ; N glyph43 ; B 15 -14 760 731 ;
65 | C -1 ; WX 774 ; N glyph44 ; B 15 -14 760 731 ;
66 | C -1 ; WX 774 ; N glyph45 ; B 15 79 760 638 ;
67 | C -1 ; WX 588 ; N glyph46 ; B 15 -14 574 731 ;
68 | C -1 ; WX 774 ; N glyph47 ; B 15 -14 760 731 ;
69 | C -1 ; WX 774 ; N glyph48 ; B 15 -12 760 729 ;
70 | C -1 ; WX 774 ; N glyph49 ; B 15 -14 760 731 ;
71 | C -1 ; WX 774 ; N glyph50 ; B 15 -14 760 731 ;
72 | C -1 ; WX 774 ; N glyph51 ; B 15 -14 760 731 ;
73 | C -1 ; WX 774 ; N glyph52 ; B 15 -14 760 731 ;
74 | C -1 ; WX 774 ; N glyph53 ; B 15 -14 760 731 ;
75 | C -1 ; WX 774 ; N glyph54 ; B 15 -14 760 731 ;
76 | C -1 ; WX 774 ; N glyph55 ; B 15 -14 760 731 ;
77 | C -1 ; WX 774 ; N glyph56 ; B 15 79 760 638 ;
78 | C -1 ; WX 774 ; N glyph57 ; B 15 79 760 638 ;
79 | C -1 ; WX 774 ; N glyph58 ; B 15 -14 760 731 ;
80 | C -1 ; WX 774 ; N glyph59 ; B 15 32 760 684 ;
81 | C -1 ; WX 774 ; N glyph60 ; B 15 -14 760 731 ;
82 | C -1 ; WX 774 ; N glyph61 ; B 15 -14 760 731 ;
83 | C -1 ; WX 588 ; N glyph62 ; B 15 -14 574 731 ;
84 | C -1 ; WX 774 ; N glyph63 ; B 15 -14 760 731 ;
85 | C -1 ; WX 774 ; N glyph64 ; B 15 -14 760 731 ;
86 | C -1 ; WX 774 ; N glyph65 ; B 15 -14 760 731 ;
87 | C -1 ; WX 402 ; N glyph66 ; B 15 -14 388 731 ;
88 | C -1 ; WX 402 ; N glyph67 ; B 15 -14 388 731 ;
89 | C -1 ; WX 774 ; N glyph68 ; B 15 172 760 545 ;
90 | C -1 ; WX 774 ; N glyph69 ; B 15 -14 760 731 ;
91 | C -1 ; WX 588 ; N glyph70 ; B 15 -14 574 731 ;
92 | C -1 ; WX 774 ; N glyph71 ; B 15 -14 760 731 ;
93 | C -1 ; WX 774 ; N glyph72 ; B 15 -14 760 731 ;
94 | C -1 ; WX 402 ; N glyph73 ; B 15 -14 388 731 ;
95 | C -1 ; WX 774 ; N glyph74 ; B 15 -14 760 731 ;
96 | C -1 ; WX 774 ; N glyph75 ; B 15 -14 760 731 ;
97 | C -1 ; WX 774 ; N glyph76 ; B 15 -14 760 731 ;
98 | C -1 ; WX 774 ; N glyph77 ; B 14 79 760 638 ;
99 | C -1 ; WX 774 ; N glyph78 ; B 15 -14 760 731 ;
100 | C -1 ; WX 774 ; N glyph79 ; B 15 79 760 638 ;
101 | C -1 ; WX 774 ; N glyph80 ; B 15 -14 760 731 ;
102 | C -1 ; WX 774 ; N glyph81 ; B 15 125 760 591 ;
103 | C -1 ; WX 774 ; N glyph82 ; B 15 79 760 638 ;
104 | C -1 ; WX 774 ; N glyph83 ; B 15 -14 760 731 ;
105 | C -1 ; WX 774 ; N glyph84 ; B 15 79 760 638 ;
106 | C -1 ; WX 774 ; N glyph85 ; B 15 -14 760 731 ;
107 | C -1 ; WX 774 ; N glyph86 ; B 15 -14 760 731 ;
108 | C -1 ; WX 774 ; N glyph87 ; B 15 -14 760 731 ;
109 | C -1 ; WX 774 ; N glyph88 ; B 15 79 760 638 ;
110 | C -1 ; WX 774 ; N glyph89 ; B 15 218 760 498 ;
111 | C -1 ; WX 774 ; N glyph90 ; B 15 -14 760 731 ;
112 | C -1 ; WX 588 ; N glyph91 ; B 15 32 574 684 ;
113 | C -1 ; WX 774 ; N glyph92 ; B 15 -14 760 731 ;
114 | C -1 ; WX 774 ; N glyph93 ; B 15 -14 760 731 ;
115 | C -1 ; WX 681 ; N glyph94 ; B 15 -14 667 731 ;
116 | C -1 ; WX 774 ; N glyph95 ; B 15 -14 760 731 ;
117 | C -1 ; WX 495 ; N glyph96 ; B 15 -14 481 731 ;
118 | C -1 ; WX 681 ; N glyph97 ; B 15 -14 667 731 ;
119 | C -1 ; WX 774 ; N glyph98 ; B 15 79 760 638 ;
120 | C -1 ; WX 774 ; N glyph99 ; B 15 -14 760 731 ;
121 | C -1 ; WX 774 ; N glyph100 ; B 14 -14 760 731 ;
122 | C -1 ; WX 309 ; N glyph101 ; B 15 -14 295 731 ;
123 | C -1 ; WX 774 ; N glyph102 ; B 15 -14 759 731 ;
124 | C -1 ; WX 681 ; N glyph103 ; B 15 -14 667 731 ;
125 | C -1 ; WX 774 ; N glyph104 ; B 15 -14 760 731 ;
126 | C -1 ; WX 402 ; N glyph105 ; B 15 -14 388 731 ;
127 | C -1 ; WX 774 ; N glyph106 ; B 15 -14 760 731 ;
128 | C -1 ; WX 774 ; N glyph107 ; B 15 -14 760 731 ;
129 | C -1 ; WX 774 ; N glyph108 ; B 15 -14 760 731 ;
130 | C -1 ; WX 774 ; N glyph109 ; B 15 265 760 452 ;
131 | C -1 ; WX 774 ; N glyph110 ; B 15 -14 760 731 ;
132 | C -1 ; WX 774 ; N glyph111 ; B 15 32 760 684 ;
133 | C -1 ; WX 774 ; N glyph113 ; B 15 -14 760 731 ;
134 | C -1 ; WX 774 ; N glyph114 ; B 15 -14 760 731 ;
135 | C -1 ; WX 774 ; N glyph115 ; B 15 -14 760 731 ;
136 | C -1 ; WX 774 ; N glyph116 ; B 15 -14 760 731 ;
137 | C -1 ; WX 774 ; N glyph117 ; B 15 -14 760 731 ;
138 | C -1 ; WX 681 ; N glyph118 ; B 15 -14 667 731 ;
139 | C -1 ; WX 774 ; N glyph119 ; B 15 -14 760 731 ;
140 | C -1 ; WX 774 ; N glyph121 ; B 15 -14 760 731 ;
141 | C -1 ; WX 774 ; N glyph122 ; B 15 -14 760 731 ;
142 | C -1 ; WX 309 ; N glyph123 ; B 15 -14 295 731 ;
143 | C -1 ; WX 774 ; N glyph124 ; B 15 58 760 658 ;
144 | C -1 ; WX 588 ; N glyph125 ; B 15 -14 574 731 ;
145 | C -1 ; WX 681 ; N glyph126 ; B 15 -14 667 731 ;
146 | C -1 ; WX 774 ; N glyph127 ; B 15 -14 760 731 ;
147 | C -1 ; WX 774 ; N glyph128 ; B 15 -14 760 731 ;
148 | C -1 ; WX 774 ; N glyph129 ; B 15 -14 760 731 ;
149 | C -1 ; WX 774 ; N glyph130 ; B 15 -14 760 731 ;
150 | C -1 ; WX 774 ; N glyph131 ; B 15 -14 760 731 ;
151 | C -1 ; WX 588 ; N glyph132 ; B 15 -14 574 731 ;
152 | C -1 ; WX 774 ; N glyph133 ; B 15 -14 760 731 ;
153 | C -1 ; WX 588 ; N glyph134 ; B 15 -14 574 731 ;
154 | C -1 ; WX 774 ; N glyph135 ; B 15 -14 760 731 ;
155 | C -1 ; WX 774 ; N glyph136 ; B 15 32 760 684 ;
156 | C -1 ; WX 774 ; N glyph137 ; B 15 -14 760 731 ;
157 | C -1 ; WX 774 ; N glyph138 ; B 15 -14 760 731 ;
158 | C -1 ; WX 588 ; N glyph139 ; B 15 -14 574 731 ;
159 | C -1 ; WX 774 ; N glyph140 ; B 15 172 760 545 ;
160 | C -1 ; WX 774 ; N glyph141 ; B 15 -14 760 731 ;
161 | C -1 ; WX 774 ; N glyph142 ; B 15 -14 760 731 ;
162 | C -1 ; WX 774 ; N glyph143 ; B 15 -14 760 731 ;
163 | C -1 ; WX 774 ; N glyph145 ; B 15 -14 760 731 ;
164 | C -1 ; WX 774 ; N glyph146 ; B 15 -14 760 731 ;
165 | C -1 ; WX 774 ; N glyph147 ; B 15 -14 760 731 ;
166 | C -1 ; WX 774 ; N glyph148 ; B 15 -14 760 731 ;
167 | C -1 ; WX 774 ; N glyph149 ; B 15 -14 760 731 ;
168 | C -1 ; WX 774 ; N glyph150 ; B 15 -14 760 731 ;
169 | EndCharMetrics
170 | EndFontMetrics
171 |
--------------------------------------------------------------------------------
/js/src/directive/previewCanvas.coffee:
--------------------------------------------------------------------------------
1 | ###
2 | The canvas used to draw the gradient live.
3 |
4 | Usage:
5 |
17 |
18 | gradientType - {expression} - "linear" or "radial".
19 | colorHandles - {expression} - Array of color handle objects used to draw gradient.
20 | width - {expression} - Width of canvas.
21 | height - {expression} - Height of canvas.
22 | rotate - {expression} - Linear gradient type only; the number of degrees to rotate gradient, range is [0, 360).
23 | innerCircleX - {expression} - Radial gradient type only; inner circle x coord in percentage from 0-100.
24 | innerCircleY - {expression} - Radial gradient type only; inner circle y coord in percentage from 0-100.
25 | outerCircleX - {expression} - Radial gradient type only; outer circle x coord in percentage from 0-100.
26 | outerCircleY - {expression} - Radial gradient type only; outer circle y coord in percentage from 0-100.
27 | htmlCode - {model} - Model name that will be stuffed with generated HTML code. This is *not* an expression.
28 | jsCode - {model} - Model name that will be stuffed with generated JS code. This is *not* an expression.
29 | ###
30 | GradientCreatorApp.directive 'previewCanvas', ->
31 | require: '?resizableCanvas'
32 | link: (scope, elem, attrs, resizableCanvasCtrl) ->
33 | canvasDom = elem[0]
34 | ctx = canvasDom.getContext '2d'
35 | jsCodePrecision = 3
36 |
37 | ###
38 | @return {Object} Data on which the canvas rendering depends.
39 | ###
40 | getDependentData = ->
41 | ColorHandles: scope.$eval attrs.colorHandles
42 | gradientType: scope.$eval attrs.gradientType
43 | width: elem.prop 'width'
44 | height: elem.prop 'height'
45 | rotateDegrees: scope.$eval attrs.rotate
46 | innerCircleX: scope.$eval attrs.innerCircleX
47 | innerCircleY: scope.$eval attrs.innerCircleY
48 | outerCircleX: scope.$eval attrs.outerCircleX
49 | outerCircleY: scope.$eval attrs.outerCircleY
50 |
51 | ###
52 | @param {Object} dependentData Result of {@link getDependentData()}.
53 | ###
54 | dependentDataChange = (dependentData) ->
55 | ColorHandles = dependentData.ColorHandles
56 | gradientType = dependentData.gradientType
57 | width = dependentData.width
58 | height = dependentData.height
59 | rotateDegrees = dependentData.rotateDegrees ? 0
60 | innerCircleX = dependentData.innerCircleX ? 50
61 | innerCircleY = dependentData.innerCircleY ? 50
62 | outerCircleX = dependentData.outerCircleX ? 50
63 | outerCircleY = dependentData.outerCircleY ? 50
64 |
65 | # HTML code
66 | if attrs.htmlCode
67 | scope[attrs.htmlCode] = """
68 |
69 | """
70 |
71 | # Init JS code
72 | if attrs.jsCode
73 | scope[attrs.jsCode] = """
74 | var canvasId = 'myPrettyCanvas',
75 | canvas = document.getElementById(canvasId),
76 | ctx = canvas.getContext('2d'),
77 | grd;
78 |
79 |
80 | """
81 |
82 | # Create gradient
83 | scaleX = 1
84 | scaleY = 1
85 | switch gradientType
86 | when 'linear'
87 | if 0 <= rotateDegrees < 45
88 | x1 = 0
89 | y1 = height / 2 * (45 - rotateDegrees) / 45
90 | x2 = width
91 | y2 = height - y1
92 | else if 45 <= rotateDegrees < 135
93 | x1 = width * (rotateDegrees - 45) / (135 - 45)
94 | y1 = 0
95 | x2 = width - x1
96 | y2 = height
97 | else if 135 <= rotateDegrees < 225
98 | x1 = width
99 | y1 = height * (rotateDegrees - 135) / (225 - 135)
100 | x2 = 0
101 | y2 = height - y1
102 | else if 225 <= rotateDegrees < 315
103 | x1 = width * (1 - (rotateDegrees - 225) / (315 - 225))
104 | y1 = height
105 | x2 = width - x1
106 | y2 = 0
107 | else if 315 <= rotateDegrees
108 | x1 = 0
109 | y1 = height - height / 2 * (rotateDegrees - 315) / (360 - 315)
110 | x2 = width
111 | y2 = height - y1
112 | grd = ctx.createLinearGradient x1, y1, x2, y2
113 | if attrs.jsCode
114 | x1Fixed = x1.toFixed jsCodePrecision
115 | y1Fixed = y1.toFixed jsCodePrecision
116 | x2Fixed = x2.toFixed jsCodePrecision
117 | y2Fixed = y2.toFixed jsCodePrecision
118 | scope[attrs.jsCode] += """
119 | // Create gradient
120 | grd = ctx.createLinearGradient(#{x1Fixed}, #{y1Fixed}, #{x2Fixed}, #{y2Fixed});
121 |
122 |
123 | """
124 | when 'radial'
125 | if width > height then scaleY = height / width
126 | if height > width then scaleX = width / height
127 | ctx.setTransform scaleX, 0, 0, scaleY, 0, 0
128 | grd = ctx.createRadialGradient(
129 | x1 = (width * innerCircleX / 100) / scaleX,
130 | y1 = (height * innerCircleY / 100) / scaleY,
131 | r1 = 0,
132 | x2 = (width * outerCircleX / 100) / scaleX,
133 | y2 = (height * outerCircleY / 100) / scaleY,
134 | r2 = (width / 2) / scaleX
135 | )
136 | if attrs.jsCode
137 | if scaleX != 1 or scaleY != 1
138 | scope[attrs.jsCode] += """
139 | // Transform to facilitate ellipse
140 | ctx.setTransform(#{scaleX}, 0, 0, #{scaleY}, 0, 0);
141 |
142 |
143 | """
144 | x1Fixed = x1.toFixed jsCodePrecision
145 | y1Fixed = y1.toFixed jsCodePrecision
146 | r1Fixed = r1.toFixed jsCodePrecision
147 | x2Fixed = x2.toFixed jsCodePrecision
148 | y2Fixed = y2.toFixed jsCodePrecision
149 | r2Fixed = r2.toFixed jsCodePrecision
150 | scope[attrs.jsCode] += """
151 | // Create gradient
152 | grd = ctx.createRadialGradient(#{x1Fixed}, #{y1Fixed}, #{r1Fixed}, #{x2Fixed}, #{y2Fixed}, #{r2Fixed});
153 |
154 |
155 | """
156 | else
157 | throw 'Unknown gradient type.'
158 |
159 | # Add colors
160 | if attrs.jsCode then scope[attrs.jsCode] += '// Add colors\n'
161 | for ColorHandle in ColorHandles when ColorHandle.color
162 | grd.addColorStop ColorHandle.stop, ColorHandle.color
163 | if attrs.jsCode
164 | regEx = /([\d.]+),\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)/
165 | matches = regEx.exec ColorHandle.color
166 | r = matches[1]
167 | g = matches[2]
168 | b = matches[3]
169 | a = parseFloat(matches[4]).toFixed jsCodePrecision
170 | scope[attrs.jsCode] += """
171 | grd.addColorStop(#{ColorHandle.stop.toFixed jsCodePrecision}, 'rgba(#{r}, #{g}, #{b}, #{a})');
172 |
173 | """
174 | if attrs.jsCode then scope[attrs.jsCode] += '\n'
175 |
176 | # Fill
177 | ctx.clearRect 0, 0, width / scaleX, height / scaleY
178 | ctx.fillStyle = grd
179 | ctx.fillRect 0, 0, width / scaleX, height / scaleY
180 | if attrs.jsCode
181 | scope[attrs.jsCode] += """
182 | // Fill with gradient
183 | ctx.fillStyle = grd;
184 | ctx.fillRect(0, 0, #{(width / scaleX).toFixed jsCodePrecision}, #{(height / scaleY).toFixed jsCodePrecision});
185 | """
186 |
187 | if resizableCanvasCtrl? then resizableCanvasCtrl.drawResizeIcon()
188 |
189 | # Update canvas on dependent data change
190 | scope.$watch getDependentData, dependentDataChange, true
--------------------------------------------------------------------------------
/js/qtip/jquery.qtip.min.css:
--------------------------------------------------------------------------------
1 | /*! qTip2 v2.0.1-26- (includes: svg ajax tips modal viewport imagemap ie6 / basic css3) | qtip2.com | Licensed MIT, GPL | Sat Feb 23 2013 21:32:11 */.qtip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr;vertical-align:middle}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}/*! Light tooltip style */.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}/*! Dark tooltip style */.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}/*! Cream tooltip style */.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}/*! Red tooltip style */.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}/*! Green tooltip style */.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}/*! Blue tooltip style */.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));background-image:-webkit-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,black 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px black}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}
--------------------------------------------------------------------------------
/css/style.css:
--------------------------------------------------------------------------------
1 | /* CSS reset by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */
2 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
3 |
4 | [ng\:cloak], [ng-cloak], .ng-cloak {
5 | display: none;
6 | }
7 |
8 | a {
9 | color: #4169e1;
10 | text-decoration: none;
11 | }
12 |
13 | a:hover,
14 | a:focus,
15 | a:active {
16 | outline: 0;
17 | text-decoration: underline;
18 | }
19 |
20 | a:active {
21 | color: navy;
22 | }
23 |
24 | a:visited {
25 | color: #2e8b57;
26 | }
27 |
28 | /* Fixes for Prettify Sunburst theme broken by CSS reset... */
29 | pre.prettyprint {
30 | font-family: "Courier New", monospace;
31 | font-size: 0.8em;
32 | width: auto;
33 | }
34 | /* End Prettify fixes */
35 |
36 | .clear {
37 | clear: both;
38 | font-size: 0;
39 | height: 0;
40 | }
41 |
42 | body {
43 | font-family: Calibri, Helvetica, Arial, sans-serif !important;
44 | padding: 25px;
45 | }
46 |
47 | input[type=number].ng-invalid {
48 | background: #fee;
49 | }
50 |
51 | h1,
52 | h2,
53 | h3 {
54 | font-family: Georgia, serif;
55 | }
56 |
57 | h1 {
58 | font-size: 3em;
59 | float: left;
60 | }
61 |
62 | h3 {
63 | font-style: italic;
64 | }
65 |
66 | .loading {
67 | color: #222;
68 | font-size: 1.7em;
69 | font-style: italic;
70 | font-family: cursive;
71 | position: relative;
72 | padding-right: 1.15em;
73 | float: left;
74 | }
75 |
76 | .loading .ballWrapper {
77 | position: absolute;
78 | right: 0;
79 | bottom: 0.3em;
80 | width: 12px;
81 | height: 12px;
82 |
83 | -webkit-animation: loadingBallAnim 1s infinite linear;
84 | }
85 |
86 | .loading .ball {
87 | position: absolute;
88 | top: -0.3em;
89 |
90 | display: block;
91 | width: 100%;
92 | height: 100%;
93 | background: #fff;
94 |
95 | border-radius: 6px;
96 | -moz-border-radius: 6px;
97 | -webkit-border-radius: 6px;
98 |
99 | box-shadow: inset 0 0 7px 0 #000;
100 | }
101 |
102 | @-webkit-keyframes loadingBallAnim {
103 | from {
104 | -webkit-transform: rotate(0);
105 | }
106 | to {
107 | -webkit-transform: rotate(360deg);
108 | }
109 | }
110 |
111 | .gradientCodeWrapper h2,
112 | .presetsWrapper h2 {
113 | -webkit-user-select: none;
114 | -moz-user-select: none;
115 | -ms-user-select: none;
116 | user-select: none;
117 | }
118 |
119 | .titleCredit {
120 | margin-bottom: 50px;
121 | font-size: 0.3em;
122 | display: block;
123 | text-align: right;
124 | }
125 |
126 | .jPicker .Title {
127 | visibility: hidden;
128 | padding-top: 4px;
129 | }
130 |
131 | .jPicker .Grid {
132 | margin-bottom: 5px;
133 | }
134 |
135 | .gradientEditorWrapper,
136 | .bigPreviewCanvasWrapper,
137 | .gradientCodeWrapper {
138 | margin: 0 50px 50px 0;
139 | float: left;
140 | }
141 |
142 | .gradientEditorWrapper,
143 | .bigPreviewCanvasWrapper {
144 | -webkit-user-select: none;
145 | -moz-user-select: none;
146 | -ms-user-select: none;
147 | user-select: none;
148 | }
149 |
150 | .gradientEditorWrapper.hasActiveColorHandle {
151 | margin-right: 48px;
152 | }
153 |
154 | [preview-canvas] {
155 | background: url(../img/canvas-bg.png);
156 | }
157 |
158 | .bigPreviewCanvas {
159 | border: 1px solid #000;
160 | margin: 10px 0 15px;
161 | }
162 |
163 | .colorHandlesWorkAreaWrapper {
164 | padding: 0 25px;
165 | margin: 0 -25px;
166 | }
167 |
168 | .gradientEditorWrapper,
169 | .colorHandlesWorkArea {
170 | width: 543px;
171 | }
172 |
173 | .colorHandlesWorkArea {
174 | height: 66px;
175 | position: relative;
176 | }
177 |
178 | .smallPreviewCanvas {
179 | border: 1px solid #000;
180 | position: absolute;
181 | top: 0;
182 | left: 0;
183 | z-index: 10;
184 | }
185 |
186 | [color-handle] {
187 | padding: 0 5px;
188 | font-size: 2em;
189 |
190 | position: absolute;
191 | bottom: 0;
192 | cursor: pointer;
193 |
194 | transition: 0.1s bottom linear;
195 | -webkit-transition: 0.1s bottom linear;
196 | -moz-transition: 0.1s bottom linear;
197 | -o-transition: 0.1s bottom linear;
198 |
199 | text-shadow: 0 1px 3px #000;
200 | filter: DropShadow(Color=#000000, OffX=0, OffY=1);
201 | }
202 |
203 | [color-handle]:hover:not(.dragging) {
204 | bottom: -2px;
205 | }
206 |
207 | [new-color-handle-click-area] {
208 | cursor: none;
209 | width: 100%;
210 | height: 42%;
211 | position: absolute;
212 | bottom: 2%;
213 | }
214 |
215 | [new-color-handle-click-area] .addHandleIcon {
216 | position: absolute;
217 | top: 0;
218 | left: 0;
219 | font-size: 1.7em;
220 | z-index: -1;
221 |
222 | transform: rotate(90deg);
223 | -webkit-transform: rotate(90deg);
224 | -moz-transform: rotate(90deg);
225 | -o-transform: rotate(90deg);
226 | -ms-transform: rotate(90deg);
227 | }
228 |
229 | .colorHandleStopInputWrapper {
230 | margin-top: 10px;
231 | }
232 |
233 | .colorHandleStopInputWrapper label {
234 | margin-right: 5px;
235 | }
236 |
237 | .colorHandleStopInputWrapper input[type=number] {
238 | width: 50px;
239 | }
240 |
241 | .error {
242 | margin-left: 5px;
243 | font-weight: bold;
244 | color: #f00;
245 | }
246 |
247 | .instructions {
248 | margin: 25px 0 0;
249 | }
250 |
251 | .instructions .showLink,
252 | .instructions .hideLink {
253 | font-size: 0.8em;
254 | margin-bottom: 15px;
255 | display: block;
256 | }
257 |
258 | h2 {
259 | font-size: 2em;
260 | text-decoration: underline;
261 | }
262 |
263 | .instructions ul + h2,
264 | .gradientCodeWrapper pre + h2 {
265 | margin-top: 20px;
266 | }
267 |
268 | .instructions ul {
269 | list-style-type: disc;
270 | margin: 15px 0 0 25px;
271 | }
272 |
273 | .instructions li + li {
274 | margin: 5px 0 0;
275 | }
276 |
277 | .jPicker td {
278 | vertical-align: top;
279 | }
280 |
281 | [color-picker] {
282 | margin: 15px 0 0;
283 | }
284 |
285 | .gradientTypesAndPersistence {
286 | text-align: left;
287 | }
288 |
289 | .gradientType {
290 | display: inline-block;
291 | margin: 0 5px;
292 | line-height: 1em;
293 | }
294 |
295 | .gradientType label {
296 | margin-left: 5px;
297 | }
298 |
299 | .persistBtns {
300 | text-align: right;
301 | float: right;
302 | }
303 |
304 | .persistBtns .btn {
305 | position: relative;
306 |
307 | width: 16px;
308 | height: 16px;
309 | display: inline-block;
310 | margin-left: 5px;
311 |
312 | transition: 0.1s top linear;
313 | -webkit-transition: 0.1s top linear;
314 | -moz-transition: 0.1s top linear;
315 | -o-transition: 0.1s top linear;
316 | }
317 |
318 | .persistBtns .btn:hover,
319 | .persistBtns .btn:active {
320 | top: -2px;
321 | }
322 |
323 | .save {
324 | background: url(../img/disk.png);
325 | }
326 |
327 | .saveAs {
328 | background: url(../img/disk_multiple.png);
329 | }
330 |
331 | .delete {
332 | background: url(../img/delete.png);
333 | }
334 |
335 | [slider] {
336 | border: 1px solid #777;
337 | background: #eee;
338 | height: 6px;
339 | margin: 12px 0;
340 |
341 | border-radius: 3px;
342 | -moz-border-radius: 3px;
343 | -webkit-border-radius: 3px;
344 | }
345 |
346 | [slider] .inner {
347 | position: relative;
348 | margin: 0 13px 0 2px;
349 | }
350 |
351 | [slider] .handle {
352 | cursor: pointer;
353 | border: 1px solid #444;
354 | background: #aaa;
355 | height: 26px;
356 | position: absolute;
357 | top: -11px;
358 | left: 1%;
359 | width: 9px;
360 |
361 | border-radius: 3px;
362 | -moz-border-radius: 3px;
363 | -webkit-border-radius: 3px;
364 | }
365 |
366 | [slider] .handle:focus,
367 | [slider] .handle:active {
368 | background: #eee;
369 | }
370 |
371 | .sliderValueDisp {
372 | float: right;
373 | }
374 |
375 | .sliderValueDisp input {
376 | width: 50px;
377 | }
378 |
379 | .sliderValueDisp + label {
380 | display: block;
381 | clear: both;
382 | margin-top: 20px;
383 | }
384 |
385 | .error.sliderValueDispError {
386 | float: left;
387 | line-height: 1.6em;
388 | }
389 |
390 | .presetsWrapper {
391 | margin-top: 25px;
392 | }
393 |
394 | .preset {
395 | display: inline-block;
396 | border: 1px solid #ddd;
397 | padding: 1px;
398 | width: 50px;
399 | height: 50px;
400 | cursor: pointer;
401 | margin: 15px 15px 0 0;
402 | }
403 |
404 | .preset:hover {
405 | border-color: #888;
406 | }
407 |
408 | .preset.loaded {
409 | border-color: #87ceeb;
410 | }
411 |
412 | .preset.loaded:hover {
413 | border-color: navy;
414 | }
415 |
416 | .preset.dirty {
417 | border-color: orange;
418 | }
419 |
420 | .preset.dirty:hover {
421 | border-color: #ff4500;
422 | }
423 |
424 | .presetsWrapper h3 {
425 | margin-top: 25px;
426 | }
427 |
428 | /* qTip overrides */
429 | .qtip {
430 | font-size: 0.8em;
431 | }
--------------------------------------------------------------------------------
/js/jpicker/ChangeLog.txt:
--------------------------------------------------------------------------------
1 | Change Log
2 | ______________
3 | 1.1.6
4 | Corrected bug preventing selections inside input values in some browsers - the onselectstart function no longer captures on input boxes.
5 | Added support for up/down arrow adjustments of the currently focused input box making the picker more keyboard friendly.
6 | Added ticks around the backgroundImage assignments to correct for paths with whitespace.
7 |
8 | 1.1.5
9 | Corrected Color object constructor to allow setting of the "alpha" value as per the documentation which previously didn't work.
10 | Added support for translucency for quickList colors with checkered background - Only available if "alphaSupport" is enabled.
11 | Restricted default color to "alpha" of 255 if "alphaSupport" is disabled - It will now assign an explicit alpha of 255 when disabled.
12 | Added new setting variable "alphaPrecision" which indicates the number of decimal points to allow in the alpha percentage display - Now defaults to 0.
13 |
14 | 1.1.4
15 | Changed "alpha" range from 0-100 to 0-255 to correct truncating and rounding errors caused by attempting to get an integer percentage that matches a hex value.
16 | "alpha" percentage display will now show up to 1 decimal point for more accurate representation of "alpha" value.
17 | Color object now accepts "alpha" values in a range of 0-255 and also returns the same when getting the "alpha" value. You will need to run ((alpha * 100) / 255) to retrieve a percentage value.
18 | Reworked the table layout and labels to remove the need for the label to reference the radio input box. This reduces injected code and removes the need to generate unique ids on the radio buttons.
19 | Transparent/invisible caret on NULL color is now corrected - uses the same caret color as a white color.
20 | Setting a binded input value of "" or no value attribute will now create a NULL color on initialization instead of the settings default color.
21 | Added a dynamic, invisible "iframe" behind a dialog picker in all browsers that fail jQuery.support.boxModel (currently IE <= 7 Quirks Mode). This prevents "select" box from showing through the picker.
22 |
23 | 1.1.3
24 | Now adding popup color pickers to document.body instead of inline with the popup control. This corrects issues with the picker not showing beyond a relative container scope.
25 | No longer need to hide popup icon in Internet Explorer for picker elements lower in the DOM than the currently active one since the picker itself is attached to document.body (it is always higher in the DOM now).
26 | Popup pickers are now bring-to-front selectable. Clicking on the picker will bring it above all other pickers on the page instead of having to drag one out from underneath another.
27 | Corrected jPicker.List/setTimeout bug which allowed an instance to bind to the List in an order other than the order the initialization function was called.
28 | Added a updateInputColor option (default true) to allow for a binded input field that does not automatically update its background/text color.
29 |
30 | 1.1.2
31 | Reworked the find methods and contexts for element searches. Now using ":first" instead of ".eq(0)" to take advantage of early out searches. Much faster initialization of the picker, on the order of 6 times.
32 | Now using setTimeout for calling visual updates. Dramatically improved marker dragging in all browsers. Reduces blocking as re-rendering is internal to the browser and independent of the other javascript still in progress.
33 | Marker updates can now cancel a previous valueChanged event when a new mouseMove event comes in. IE8 marker dragging is still slower, much over 5 times faster than it was.
34 | Reworked entire quickPick list creation. It now adds up source code and does a single "html" method instead of multiple "append" methods. This is a large part of the speed increase on initialization.
35 | The vast majority of all running scripts on both initialization and dragging is now occupied altering the style rules and finding elements (init only) instead of jPicker code.
36 | All methods previously called with global context now use the "call" method for using the context of the class running the method. "this" in a callback is now the DOM node (jQuery style) and jPicker instead of "window".
37 | Added "effects" section of window settings to allow different show/hide effects and durations.
38 | Removed change log and read me from the full source code to separate files (ChangeLog.txt and ReadMe.txt) and an HTML demonstration/documentation page (Example.txt).
39 |
40 | 1.1.1
41 | Correct IE exception caused by attempting to set "#transparent" to CSS background-color.
42 |
43 | 1.1.0
44 | Reworked nearly the entire plugin including the internal and external event model, bindings, DOM searches, classes, and overall presentation.
45 | The Color object now supports a changed event that you can bind to (or just bind to the picker events still included).
46 | Event order has been reversed, instead of a change event on the map/bar/text fields updating the display, they now update the Color object which then fires the events that update the display.
47 | alphaSupport re-implemented by request - default behavior is off.
48 | Hex code now only 6 characters again.
49 | Color object can now have its value changed from code, using the "val" method, and it will fire all events necessary to update the display.
50 | Removed all "get_*" methods from the color object, instead opting for a single "val" method for getting and setting, more in line with familiar jQuery methods.
51 | Better rendering for all IE versions in Quirks mode.
52 |
53 | 1.0.13
54 | Updated transparency algorithm for red/green/blue color modes. The algorithm from John Dyers' color picker was close but incorrect. Bar colors are now pixel perfect with the new algorithm.
55 | Changed from using "background-position" on the color maps to an element of full height using the "top" attribute for image-map location using "overflow: hidden" to hide overdraw.
56 | IE7/8 ignores opacity on elements taller than 4096px. Image maps therefore no longer include a blank first map so the Bar is just under 4096. Blank is now accomplished by setting the "top" setting to below the map display.
57 | New colorBar picker image that does not draw outside of the element since the elements now hide overdraw.
58 | Added IE5.5/6 support for the picker. This is why it now uses maps of full height and the "top" attribute for map locations.
59 | Moved the images in the maps to 4 pixels apart from each other. IE7/8 change the first pixel of the bottom-border of 2px to partially transparent showing a portion of a different color map without this.
60 |
61 | 1.0.12
62 | Added minified CSS file.
63 | Added IE7/8 Quirks Mode support.
64 | Added configurable string constants for all text and tooltips. You can now change the default values for different languages.
65 | Privatized the RGBA values in the Color object for better NULL handling. YOU MUST USE THE NEW GET FUNCTIONS TO ACCESS THE COLOR PROPERTIES.
66 | Better NULL color handling and an additional "No Color Selected" quick pick color.
67 | More consistent behavior across multiple versions of browsers.
68 | Added alpha response to the binded color picker icon.
69 | Removed "alphaSupport" variable. It is now always supported.
70 |
71 | 1.0.11b
72 | Corrected NULL behavior in IE. jQuery was getting an exception when attempting to assign a backgroundColor style of '#'. Now assigns 'transparent' if color is NULL.
73 | Can now create new Color object WITH OR WITHOUT the '#' prefix.
74 |
75 | 1.0.11
76 | Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well.
77 | cancelCallback now returns the original color for use in programming responses.
78 |
79 | 1.0.10
80 | Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier.
81 |
82 | 1.0.9
83 | Added optional title variable for each jPicker window.
84 |
85 | 1.0.8
86 | Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run.
87 |
88 | 1.0.7
89 | RENAMED CSS FILE TO INCLUDE VERSION NUMBER!!! YOU MUST USE THIS VERSIONED CSS FILE!!! There will be no need to do your own CSS version number increments from now on.
90 | Added opacity feedback to color preview boxes.
91 | Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code.
92 | Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required.
93 |
94 | 1.0.6
95 | Corrected picker bugs introduced with 1.0.5.
96 | Removed alpha slider bar until activated - default behavior for alpha is now OFF.
97 | Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol).
98 | Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).
99 | THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
100 |
101 | 1.0.5
102 | Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol)
103 | Added title attributes to input elements - gives short tooltip directions on what button or field does.
104 | Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization.
105 | THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
106 |
107 | 1.0.4
108 | Added ability for smaller picker icon with expandable window on any DOM element (not just input).
109 | "draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.
110 |
111 | 1.0.3
112 | Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)
113 |
114 | 1.0.2
115 | Random bug fixes - speed concerns.
116 |
117 | 1.0.1
118 | Corrected closure based memeory leak - there may be others?
119 |
120 | 1.0.0
121 | First Release.
--------------------------------------------------------------------------------
/js/prettify/prettify.js:
--------------------------------------------------------------------------------
1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |