├── img ├── glyphicons-halflings.png ├── bootstrap-colorpicker │ ├── hue.png │ ├── alpha.png │ └── saturation.png └── glyphicons-halflings-white.png ├── README.md ├── js ├── google-code-prettify │ ├── prettify.css │ └── prettify.js ├── app.js ├── bootstrap-colorpicker.js ├── bootstrap.min.js └── bootstrap.js ├── css ├── bootstrap-colorpicker.css ├── bootstrap-responsive.min.css └── bootstrap-responsive.css ├── less └── bootstrap-colorpicker.less └── index.html /img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/bootstrap-colorpicker/master/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /img/bootstrap-colorpicker/hue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/bootstrap-colorpicker/master/img/bootstrap-colorpicker/hue.png -------------------------------------------------------------------------------- /img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/bootstrap-colorpicker/master/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /img/bootstrap-colorpicker/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/bootstrap-colorpicker/master/img/bootstrap-colorpicker/alpha.png -------------------------------------------------------------------------------- /img/bootstrap-colorpicker/saturation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cviebrock/bootstrap-colorpicker/master/img/bootstrap-colorpicker/saturation.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Colorpicker plugin for Twitter Bootstrap 2 | 3 | Originally written by [Stefan Petre](http://www.eyecon.ro/) 4 | 5 | Read the documentation [here](http://xaguilars.github.com/bootstrap-colorpicker/) -------------------------------------------------------------------------------- /js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .linenums .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 18px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /css/bootstrap-colorpicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | Colorpicker for Bootstrap 3 | Copyright 2012 Stefan Petre 4 | Licensed under the Apache License v2.0 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | */ 7 | .colorpicker-saturation { width: 100px; height: 100px; background-image: url(../img/bootstrap-colorpicker/saturation.png); cursor: crosshair; float: left; } .colorpicker-saturation i { display: block; height: 5px; width: 5px; border: 1px solid #000; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; position: absolute; top: 0; left: 0; margin: -4px 0 0 -4px; } .colorpicker-saturation i b { display: block; height: 5px; width: 5px; border: 1px solid #fff; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .colorpicker-hue, .colorpicker-alpha { width: 15px; height: 100px; float: left; cursor: row-resize; margin-left: 4px; margin-bottom: 4px; } .colorpicker-hue i, .colorpicker-alpha i { display: block; height: 1px; background: #000; border-top: 1px solid #fff; position: absolute; top: 0; left: 0; width: 100%; margin-top: -1px; } .colorpicker-hue { background-image: url(../img/bootstrap-colorpicker/hue.png); } .colorpicker-alpha { background-image: url(../img/bootstrap-colorpicker/alpha.png); display: none; } .colorpicker { *zoom: 1; top: 0; left: 0; padding: 4px; min-width: 120px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .colorpicker:before, .colorpicker:after { display: table; content: ""; } .colorpicker:after { clear: both; } .colorpicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .colorpicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .colorpicker div { position: relative; } .colorpicker.alpha { min-width: 140px; } .colorpicker.alpha .colorpicker-alpha { display: block; } .colorpicker-color { height: 10px; margin-top: 5px; clear: both; background-image: url(../img/bootstrap-colorpicker/alpha.png); background-position: 0 100%; } .colorpicker-color div { height: 10px; } .input-append.color .add-on i, .input-prepend.color .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; } -------------------------------------------------------------------------------- /less/bootstrap-colorpicker.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Colorpicker for Bootstrap 3 | * 4 | * Copyright 2012 Stefan Petre 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | */ 9 | 10 | @colorPickerSaturationImage: '../img/bootstrap-colorpicker/saturation.png'; 11 | @colorPickerHueImage: '../img/bootstrap-colorpicker/hue.png'; 12 | @colorPickerAlphaImage: '../img/bootstrap-colorpicker/alpha.png'; 13 | 14 | .colorpicker-saturation { 15 | width: 100px; 16 | height: 100px; 17 | background-image: url('@{colorPickerSaturationImage}'); 18 | cursor: crosshair; 19 | float: left; 20 | i { 21 | display: block; 22 | height: 5px; 23 | width: 5px; 24 | border: 1px solid #000; 25 | .border-radius(5px); 26 | position: absolute; 27 | top: 0; 28 | left: 0; 29 | margin: -4px 0 0 -4px; 30 | b{ 31 | display: block; 32 | height: 5px; 33 | width: 5px; 34 | border: 1px solid #fff; 35 | .border-radius(5px); 36 | } 37 | } 38 | } 39 | .colorpicker-hue, 40 | .colorpicker-alpha { 41 | width: 15px; 42 | height: 100px; 43 | float: left; 44 | cursor: row-resize; 45 | margin-left: 4px; 46 | margin-bottom: 4px; 47 | i { 48 | display: block; 49 | height: 1px; 50 | background: #000; 51 | border-top: 1px solid #fff; 52 | position: absolute; 53 | top: 0; 54 | left: 0; 55 | width: 100%; 56 | margin-top: -1px; 57 | } 58 | } 59 | .colorpicker-hue { 60 | background-image: url('@{colorPickerHueImage}'); 61 | } 62 | .colorpicker-alpha { 63 | background-image: url('@{colorPickerAlphaImage}'); 64 | display:none; 65 | } 66 | .colorpicker { 67 | .clearfix(); 68 | top: 0; 69 | left: 0; 70 | padding: 4px; 71 | min-width: 120px; 72 | margin-top: 1px; 73 | .border-radius(4px); 74 | &:before { 75 | content: ''; 76 | display: inline-block; 77 | border-left: 7px solid transparent; 78 | border-right: 7px solid transparent; 79 | border-bottom: 7px solid #ccc; 80 | border-bottom-color: rgba(0,0,0,.2); 81 | position: absolute; 82 | top: -7px; 83 | left: 6px; 84 | } 85 | &:after { 86 | content: ''; 87 | display: inline-block; 88 | border-left: 6px solid transparent; 89 | border-right: 6px solid transparent; 90 | border-bottom: 6px solid @white; 91 | position: absolute; 92 | top: -6px; 93 | left: 7px; 94 | } 95 | div { 96 | position: relative; 97 | } 98 | &.alpha { 99 | min-width: 140px; 100 | .colorpicker-alpha { 101 | display: block; 102 | } 103 | } 104 | } 105 | .colorpicker-color { 106 | height: 10px; 107 | margin-top: 5px; 108 | clear: both; 109 | background-image: url('@{colorPickerAlphaImage}'); 110 | background-position: 0 100%; 111 | div { 112 | height: 10px; 113 | } 114 | } 115 | .input-append, 116 | .input-prepend { 117 | &.color { 118 | .add-on i { 119 | display: block; 120 | cursor: pointer; 121 | width: 16px; 122 | height: 16px; 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * index.html scripts 4 | * 5 | */ 6 | !function(root, $) { 7 | /** 8 | * Fetch latest commits from Github API and cache them 9 | * @link https://gist.github.com/4520294 10 | * 11 | */ 12 | root["ghcommits"] = { 13 | "repo_name": "xaguilars/bootstrap-colorpicker", 14 | "cache_enabled": true, //cache api responses? 15 | "cache_ttl": (2 * 60 * 60), // 2h (in seconds) 16 | "onload": {}, 17 | "callback": function() { 18 | }, 19 | "load": function(count, onload) { 20 | var $self = this; 21 | count = count || 10; 22 | $self.onload = onload || function() { 23 | }; 24 | 25 | if ($self.cache_enabled && root["localStorage"]) { 26 | var cache_key = "repo_commits"; 27 | var expiration = localStorage.getItem(cache_key + "_expiration"); 28 | if (expiration && (expiration < +new Date())) { 29 | localStorage.removeItem(cache_key); 30 | localStorage.removeItem(cache_key + "_expiration"); 31 | expiration = false; 32 | } 33 | var commits = localStorage.getItem(cache_key); 34 | if (commits) { 35 | if (root["console"]) 36 | console.info("Commit data feched from localStorage"); 37 | $self.store(JSON.parse(commits), false); 38 | $self.onload($self.data); 39 | return; 40 | } 41 | } 42 | $self.query(count); 43 | }, 44 | "store": function(commitsJson, cache) { 45 | var $self = this; 46 | $self.data = commitsJson; 47 | if (cache && root["localStorage"]) { 48 | localStorage.setItem("repo_commits", JSON.stringify(commitsJson)); 49 | localStorage.setItem("repo_commits_expiration", +new Date() + 1000 * $self.cache_ttl); 50 | } 51 | }, 52 | "query": function(count) { 53 | var $self = this; 54 | var query_url = 'https://api.github.com/repos/' + $self.repo_name + '/commits?per_page=' + count; 55 | console.info("Fetching commit data from " + query_url); 56 | $.ajax({'dataType': "jsonp", 'url': query_url, 'jsonpCallback': 'ghcommits._jsonpcb'}); 57 | }, 58 | "_jsonpcb": function(jsonpresp) { 59 | ghcommits.store(jsonpresp.data, ghcommits.cache_enabled); 60 | ghcommits.onload(ghcommits.data); 61 | } 62 | } 63 | 64 | // App 65 | $(function() { 66 | root.prettyPrint && prettyPrint() 67 | $('#cp1').colorpicker({ 68 | format: 'hex' 69 | }); 70 | $('#cp2').colorpicker(); 71 | $('#cp3').colorpicker(); 72 | var bodyStyle = $('body')[0].style; 73 | $('#cp4').colorpicker().on('changeColor', function(ev) { 74 | bodyStyle.backgroundColor = ev.color.toHex(); 75 | }); 76 | 77 | try { 78 | // load latest commits under a try to not paralize the app 79 | ghcommits.load(10, function(data) { 80 | if (data && (data.length > 0)) { 81 | $(data).each(function(i, item) { 82 | $("#changelog ul").append($('
  • ').html("" + item.commit.author 83 | .date.replace("T", " ").replace("Z", "") + 84 | ": " + item.commit.message)); 85 | }); 86 | } 87 | 88 | }); 89 | } catch (err) { 90 | } 91 | }); 92 | }(window, window.jQuery); -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Colorpicker for Bootstrap, from Twitter 6 | 7 | 8 | 34 | 35 | 36 | 39 | 40 | 41 | 42 |
    43 |
    44 | 47 | 48 |
    49 |
    50 |

    About

    51 |

    52 | Colorpicker plugin for the Twitter Bootstrap toolkit. Originally written by @eyecon 53 | and maintained in Github by @xaguilars and the community 54 |

    Adds a color picker to a field or any other element. 55 |

    56 |
      57 |
    • can be used as a component
    • 58 |
    • alpha picker
    • 59 |
    • multiple formats: hex, rgb, rgba, hsl, hsla
    • 60 |
    61 |
    62 |

    Fork me on Github

    63 |

    Download

    64 | 65 |
    66 |

    ChangeLog
    from master branch

    67 |
      68 |
      69 |
      70 |
      71 |

      Example

      72 |

      Attached to a field with hex format specified via options.

      73 |
      74 | 75 |
      76 |

      Attachet to a field with the rgba format specified via data tag.

      77 |
      78 | 79 |
      80 |

      As component.

      81 |
      82 |
      83 | 84 | 85 |
      86 |
      87 |

      Using events to work with the color.

      88 | 91 |
      92 |

      Using bootstrap-colorpicker.js

      93 |

      Call the colopicker via javascript:

      94 |
      $('.colorpicker').colorpicker()
      95 |

      Options

      96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
      Nametypedefaultdescription
      formatstring'hex'the color format - hex | rgb | rgba.
      114 | 115 |

      Markup

      116 |

      Format a component.

      117 |
      118 | <div class="input-append color" data-color="rgb(255, 146, 180)" data-color-format="rgb">
      119 |   <input type="text" class="span2" value="" >
      120 |   <span class="add-on"><i style="background-color: rgb(255, 146, 180)"></i></span></div>
      121 |                         
      122 |

      Methods

      123 |

      .colorpicker(options)

      124 |

      Initializes an colorpicker.

      125 |

      .colorpicker('show')

      126 |

      Show the color picker

      127 |

      .colorpicker('hide')

      128 |

      Hide the color picker

      129 |

      .colorpicker('place')

      130 |

      Updates the color picker's position relative to the element

      131 |

      .colorpicker('setValue', value)

      132 |

      Set a new value for the color picker. Triggers 'changeColor' event.

      133 |

      Color object methods

      134 |

      Each triggered events have a color object used internally by the picker. This object has several usefull methods.

      135 |

      .setColor(value)

      136 |

      Set a new color. The value is parsed and tries to do a quess on the format.

      137 |

      .setHue(value)

      138 |

      Set the HUE with a value between 0 and 1.

      139 |

      .setSaturation(value)

      140 |

      Set the saturation with a value between 0 and 1.

      141 |

      .setLightness(value)

      142 |

      Set the lightness with a value between 0 and 1.

      143 |

      .setAlpha(value)

      144 |

      Set the transparency with a value between 0 and 1.

      145 |

      .toRGB()

      146 |

      Returns a hash with red, green, blue and alpha.

      147 |

      .toHex()

      148 |

      Returns a string with HEX format for the current color.

      149 |

      .toHSL()

      150 |

      Returns a hash with HSLA values.

      151 | 152 |

      Events

      153 |

      Colopicker class exposes a few events for manipulating the colors.

      154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
      EventDescription
      showThis event fires immediately when the color picker is displayed.
      hideThis event is fired immediately when the color picker is hidden.
      changeColorThis event is fired when the color is changed.
      176 |
      177 | $('.colorpicker').colorpicker().on('changeColor', function(ev){
      178 |   bodyStyle.backgroundColor = ev.color.toHex();
      179 | });
      180 |                         
      181 |
      182 |
      183 |
      184 |
      185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /js/google-code-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",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}pli{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /js/bootstrap-colorpicker.js: -------------------------------------------------------------------------------- 1 | /* ========================================================= 2 | * bootstrap-colorpicker.js 3 | * http://www.eyecon.ro/bootstrap-colorpicker 4 | * ========================================================= 5 | * Copyright 2012 Stefan Petre 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================= */ 19 | 20 | !function($) { 21 | 22 | // Color object 23 | 24 | var Color = function(val) { 25 | this.value = { 26 | h: 1, 27 | s: 1, 28 | b: 1, 29 | a: 1 30 | }; 31 | this.setColor(val); 32 | }; 33 | 34 | Color.prototype = { 35 | constructor: Color, 36 | 37 | //parse a string to HSB 38 | setColor: function(val) { 39 | val = val.toLowerCase(); 40 | var that = this; 41 | $.each(CPGlobal.stringParsers, function(i, parser) { 42 | var match = parser.re.exec(val), 43 | values = match && parser.parse(match), 44 | space = parser.space || 'rgba'; 45 | if (values) { 46 | if (space === 'hsla') { 47 | that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values)); 48 | } else { 49 | that.value = CPGlobal.RGBtoHSB.apply(null, values); 50 | } 51 | return false; 52 | } 53 | return true; 54 | }); 55 | }, 56 | 57 | setHue: function(h) { 58 | this.value.h = 1 - h; 59 | }, 60 | 61 | setSaturation: function(s) { 62 | this.value.s = s; 63 | }, 64 | 65 | setLightness: function(b) { 66 | this.value.b = 1 - b; 67 | }, 68 | 69 | setAlpha: function(a) { 70 | this.value.a = parseInt((1 - a) * 100, 10) / 100; 71 | }, 72 | 73 | // HSBtoRGB from RaphaelJS 74 | // https://github.com/DmitryBaranovskiy/raphael/ 75 | toRGB: function(h, s, b, a) { 76 | if (!h) { 77 | h = this.value.h; 78 | s = this.value.s; 79 | b = this.value.b; 80 | } 81 | h *= 360; 82 | var R, G, B, X, C; 83 | h = (h % 360) / 60; 84 | C = b * s; 85 | X = C * (1 - Math.abs(h % 2 - 1)); 86 | R = G = B = b - C; 87 | 88 | h = ~~h; 89 | R += [C, X, 0, 0, X, C][h]; 90 | G += [X, C, C, X, 0, 0][h]; 91 | B += [0, 0, X, C, C, X][h]; 92 | return { 93 | r: Math.round(R * 255), 94 | g: Math.round(G * 255), 95 | b: Math.round(B * 255), 96 | a: a || this.value.a 97 | }; 98 | }, 99 | 100 | toHex: function(h, s, b, a) { 101 | var rgb = this.toRGB(h, s, b, a); 102 | return '#' + ((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1); 103 | }, 104 | 105 | toHSL: function(h, s, b, a) { 106 | if (!h) { 107 | h = this.value.h; 108 | s = this.value.s; 109 | b = this.value.b; 110 | } 111 | var H = h, 112 | L = (2 - s) * b, 113 | S = s * b; 114 | if (L > 0 && L <= 1) { 115 | S /= L; 116 | } else { 117 | S /= 2 - L; 118 | } 119 | L /= 2; 120 | if (S > 1) { 121 | S = 1; 122 | } 123 | return { 124 | h: H, 125 | s: S, 126 | l: L, 127 | a: a || this.value.a 128 | }; 129 | } 130 | }; 131 | 132 | // Picker object 133 | 134 | var Colorpicker = function(element, options) { 135 | this.element = $(element); 136 | var format = options.format || this.element.data('color-format') || 'hex'; 137 | this.format = CPGlobal.translateFormats[format]; 138 | this.isInput = this.element.is('input'); 139 | this.component = this.element.is('.color') ? this.element.find('.add-on') : false; 140 | 141 | this.picker = $(CPGlobal.template) 142 | .appendTo('body') 143 | .on('mousedown', $.proxy(this.mousedown, this)); 144 | 145 | if (this.isInput) { 146 | this.element.on({ 147 | 'focus': $.proxy(this.show, this), 148 | 'keyup': $.proxy(this.update, this) 149 | }); 150 | } else if (this.component) { 151 | this.component.on({ 152 | 'click': $.proxy(this.show, this) 153 | }); 154 | } else { 155 | this.element.on({ 156 | 'click': $.proxy(this.show, this) 157 | }); 158 | } 159 | if (format === 'rgba' || format === 'hsla') { 160 | this.picker.addClass('alpha'); 161 | this.alpha = this.picker.find('.colorpicker-alpha')[0].style; 162 | } 163 | 164 | if (this.component) { 165 | this.picker.find('.colorpicker-color').hide(); 166 | this.preview = this.element.find('i')[0].style; 167 | } else { 168 | this.preview = this.picker.find('div:last')[0].style; 169 | } 170 | 171 | this.base = this.picker.find('div:first')[0].style; 172 | this.update(); 173 | }; 174 | 175 | Colorpicker.prototype = { 176 | constructor: Colorpicker, 177 | 178 | show: function(e) { 179 | this.picker.show(); 180 | this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); 181 | this.place(); 182 | $(window).on('resize', $.proxy(this.place, this)); 183 | if (!this.isInput) { 184 | if (e) { 185 | e.stopPropagation(); 186 | e.preventDefault(); 187 | } 188 | } 189 | $(document).on({ 190 | 'mousedown': $.proxy(this.hide, this) 191 | }); 192 | this.element.trigger({ 193 | type: 'show', 194 | color: this.color 195 | }); 196 | }, 197 | 198 | update: function() { 199 | var color = this.isInput ? this.element.prop('value') : this.element.data('color'); 200 | if (typeof color === "undefined" || color === null) { 201 | color = '#ffffff'; 202 | } 203 | this.color = new Color(color); 204 | this.picker.find('i') 205 | .eq(0).css({left: this.color.value.s * 100, top: 100 - this.color.value.b * 100}).end() 206 | .eq(1).css('top', 100 * (1 - this.color.value.h)).end() 207 | .eq(2).css('top', 100 * (1 - this.color.value.a)); 208 | this.previewColor(); 209 | }, 210 | 211 | hide: function() { 212 | this.picker.hide(); 213 | $(window).off('resize', this.place); 214 | if (!this.isInput) { 215 | $(document).off({ 216 | 'mousedown': this.hide 217 | }); 218 | if (this.component) { 219 | this.element.find('input').prop('value', this.format.call(this)); 220 | } 221 | this.element.data('color', this.format.call(this)); 222 | } else { 223 | //if the input value is empty, do not set any color 224 | if (this.element.val() != '') { 225 | this.element.prop('value', this.format.call(this)); 226 | } 227 | } 228 | this.element.trigger({ 229 | type: 'hide', 230 | color: this.color 231 | }); 232 | }, 233 | 234 | place: function() { 235 | var offset = this.component ? this.component.offset() : this.element.offset(); 236 | this.picker.css({ 237 | top: offset.top + this.height, 238 | left: offset.left 239 | }); 240 | }, 241 | 242 | //preview color change 243 | previewColor: function() { 244 | try { 245 | this.preview.backgroundColor = this.format.call(this); 246 | } catch (e) { 247 | this.preview.backgroundColor = this.color.toHex(); 248 | } 249 | //set the color for brightness/saturation slider 250 | this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1); 251 | //set te color for alpha slider 252 | if (this.alpha) { 253 | this.alpha.backgroundColor = this.color.toHex(); 254 | } 255 | }, 256 | 257 | pointer: null, 258 | 259 | slider: null, 260 | 261 | mousedown: function(e) { 262 | e.stopPropagation(); 263 | e.preventDefault(); 264 | 265 | var target = $(e.target); 266 | 267 | //detect the slider and set the limits and callbacks 268 | var zone = target.closest('div'); 269 | if (!zone.is('.colorpicker')) { 270 | if (zone.is('.colorpicker-saturation')) { 271 | this.slider = $.extend({}, CPGlobal.sliders.saturation); 272 | } 273 | else if (zone.is('.colorpicker-hue')) { 274 | this.slider = $.extend({}, CPGlobal.sliders.hue); 275 | } 276 | else if (zone.is('.colorpicker-alpha')) { 277 | this.slider = $.extend({}, CPGlobal.sliders.alpha); 278 | } else { 279 | return false; 280 | } 281 | var offset = zone.offset(); 282 | //reference to knob's style 283 | this.slider.knob = zone.find('i')[0].style; 284 | this.slider.left = e.pageX - offset.left; 285 | this.slider.top = e.pageY - offset.top; 286 | this.pointer = { 287 | left: e.pageX, 288 | top: e.pageY 289 | }; 290 | //trigger mousemove to move the knob to the current position 291 | $(document).on({ 292 | mousemove: $.proxy(this.mousemove, this), 293 | mouseup: $.proxy(this.mouseup, this) 294 | }).trigger('mousemove'); 295 | } 296 | return false; 297 | }, 298 | 299 | mousemove: function(e) { 300 | e.stopPropagation(); 301 | e.preventDefault(); 302 | var left = Math.max( 303 | 0, 304 | Math.min( 305 | this.slider.maxLeft, 306 | this.slider.left + ((e.pageX || this.pointer.left) - this.pointer.left) 307 | ) 308 | ); 309 | var top = Math.max( 310 | 0, 311 | Math.min( 312 | this.slider.maxTop, 313 | this.slider.top + ((e.pageY || this.pointer.top) - this.pointer.top) 314 | ) 315 | ); 316 | this.slider.knob.left = left + 'px'; 317 | this.slider.knob.top = top + 'px'; 318 | if (this.slider.callLeft) { 319 | this.color[this.slider.callLeft].call(this.color, left / 100); 320 | } 321 | if (this.slider.callTop) { 322 | this.color[this.slider.callTop].call(this.color, top / 100); 323 | } 324 | this.previewColor(); 325 | 326 | // Set input value on mousemove 327 | try { 328 | this.element.val(this.format.call(this)); 329 | } catch (e) { 330 | this.element.val(this.color.toHex()); 331 | } 332 | 333 | this.element.trigger({ 334 | type: 'changeColor', 335 | color: this.color 336 | }); 337 | return false; 338 | }, 339 | 340 | mouseup: function(e) { 341 | e.stopPropagation(); 342 | e.preventDefault(); 343 | $(document).off({ 344 | mousemove: this.mousemove, 345 | mouseup: this.mouseup 346 | }); 347 | return false; 348 | } 349 | }; 350 | 351 | $.fn.colorpicker = function(option, value) { 352 | return this.each(function() { 353 | var $this = $(this), 354 | data = $this.data('colorpicker'), 355 | options = typeof option === 'object' && option; 356 | if (!data) { 357 | $this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults, options)))); 358 | } 359 | if (typeof option === 'string') data[option](value); 360 | }); 361 | }; 362 | 363 | $.fn.colorpicker.defaults = { 364 | }; 365 | 366 | $.fn.colorpicker.Constructor = Colorpicker; 367 | 368 | var CPGlobal = { 369 | 370 | // translate a format from Color object to a string 371 | translateFormats: { 372 | 'rgb': function() { 373 | var rgb = this.color.toRGB(); 374 | return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')'; 375 | }, 376 | 377 | 'rgba': function() { 378 | var rgb = this.color.toRGB(); 379 | return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')'; 380 | }, 381 | 382 | 'hsl': function() { 383 | var hsl = this.color.toHSL(); 384 | return 'hsl(' + Math.round(hsl.h * 360) + ',' + Math.round(hsl.s * 100) + '%,' + Math.round(hsl.l * 100) + '%)'; 385 | }, 386 | 387 | 'hsla': function() { 388 | var hsl = this.color.toHSL(); 389 | return 'hsla(' + Math.round(hsl.h * 360) + ',' + Math.round(hsl.s * 100) + '%,' + Math.round(hsl.l * 100) + '%,' + hsl.a + ')'; 390 | }, 391 | 392 | 'hex': function() { 393 | return this.color.toHex(); 394 | } 395 | }, 396 | 397 | sliders: { 398 | saturation: { 399 | maxLeft: 100, 400 | maxTop: 100, 401 | callLeft: 'setSaturation', 402 | callTop: 'setLightness' 403 | }, 404 | 405 | hue: { 406 | maxLeft: 0, 407 | maxTop: 100, 408 | callLeft: false, 409 | callTop: 'setHue' 410 | }, 411 | 412 | alpha: { 413 | maxLeft: 0, 414 | maxTop: 100, 415 | callLeft: false, 416 | callTop: 'setAlpha' 417 | } 418 | }, 419 | 420 | // HSBtoRGB from RaphaelJS 421 | // https://github.com/DmitryBaranovskiy/raphael/ 422 | RGBtoHSB: function(r, g, b, a) { 423 | r /= 255; 424 | g /= 255; 425 | b /= 255; 426 | 427 | var H, S, V, C; 428 | V = Math.max(r, g, b); 429 | C = V - Math.min(r, g, b); 430 | H = (C === 0 ? null : 431 | V == r ? (g - b) / C : 432 | V == g ? (b - r) / C + 2 : 433 | (r - g) / C + 4 434 | ); 435 | H = ((H + 360) % 6) * 60 / 360; 436 | S = C === 0 ? 0 : C / V; 437 | return {h: H || 1, s: S, b: V, a: a || 1}; 438 | }, 439 | 440 | HueToRGB: function(p, q, h) { 441 | if (h < 0) 442 | h += 1; 443 | else if (h > 1) 444 | h -= 1; 445 | 446 | if ((h * 6) < 1) 447 | return p + (q - p) * h * 6; 448 | else if ((h * 2) < 1) 449 | return q; 450 | else if ((h * 3) < 2) 451 | return p + (q - p) * ((2 / 3) - h) * 6; 452 | else 453 | return p; 454 | }, 455 | 456 | HSLtoRGB: function(h, s, l, a) { 457 | if (s < 0) { 458 | s = 0; 459 | } 460 | var q; 461 | if (l <= 0.5) { 462 | q = l * (1 + s); 463 | } else { 464 | q = l + s - (l * s); 465 | } 466 | 467 | var p = 2 * l - q; 468 | 469 | var tr = h + (1 / 3); 470 | var tg = h; 471 | var tb = h - (1 / 3); 472 | 473 | var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255); 474 | var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255); 475 | var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255); 476 | return [r, g, b, a || 1]; 477 | }, 478 | 479 | // a set of RE's that can match strings and generate color tuples. 480 | // from John Resig color plugin 481 | // https://github.com/jquery/jquery-color/ 482 | stringParsers: [ 483 | { 484 | re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 485 | parse: function(execResult) { 486 | return [ 487 | execResult[ 1 ], 488 | execResult[ 2 ], 489 | execResult[ 3 ], 490 | execResult[ 4 ] 491 | ]; 492 | } 493 | }, 494 | { 495 | re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 496 | parse: function(execResult) { 497 | return [ 498 | 2.55 * execResult[1], 499 | 2.55 * execResult[2], 500 | 2.55 * execResult[3], 501 | execResult[ 4 ] 502 | ]; 503 | } 504 | }, 505 | { 506 | re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, 507 | parse: function(execResult) { 508 | return [ 509 | parseInt(execResult[ 1 ], 16), 510 | parseInt(execResult[ 2 ], 16), 511 | parseInt(execResult[ 3 ], 16) 512 | ]; 513 | } 514 | }, 515 | { 516 | re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/, 517 | parse: function(execResult) { 518 | return [ 519 | parseInt(execResult[ 1 ] + execResult[ 1 ], 16), 520 | parseInt(execResult[ 2 ] + execResult[ 2 ], 16), 521 | parseInt(execResult[ 3 ] + execResult[ 3 ], 16) 522 | ]; 523 | } 524 | }, 525 | { 526 | re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 527 | space: 'hsla', 528 | parse: function(execResult) { 529 | return [ 530 | execResult[1] / 360, 531 | execResult[2] / 100, 532 | execResult[3] / 100, 533 | execResult[4] 534 | ]; 535 | } 536 | } 537 | ], 538 | template: '
    • ',minLength:1},e.fn.typeahead.Constructor=t,e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); -------------------------------------------------------------------------------- /css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.2.1 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | .clearfix { 12 | *zoom: 1; 13 | } 14 | 15 | .clearfix:before, 16 | .clearfix:after { 17 | display: table; 18 | line-height: 0; 19 | content: ""; 20 | } 21 | 22 | .clearfix:after { 23 | clear: both; 24 | } 25 | 26 | .hide-text { 27 | font: 0/0 a; 28 | color: transparent; 29 | text-shadow: none; 30 | background-color: transparent; 31 | border: 0; 32 | } 33 | 34 | .input-block-level { 35 | display: block; 36 | width: 100%; 37 | min-height: 30px; 38 | -webkit-box-sizing: border-box; 39 | -moz-box-sizing: border-box; 40 | box-sizing: border-box; 41 | } 42 | 43 | .hidden { 44 | display: none; 45 | visibility: hidden; 46 | } 47 | 48 | .visible-phone { 49 | display: none !important; 50 | } 51 | 52 | .visible-tablet { 53 | display: none !important; 54 | } 55 | 56 | .hidden-desktop { 57 | display: none !important; 58 | } 59 | 60 | .visible-desktop { 61 | display: inherit !important; 62 | } 63 | 64 | @media (min-width: 768px) and (max-width: 979px) { 65 | .hidden-desktop { 66 | display: inherit !important; 67 | } 68 | .visible-desktop { 69 | display: none !important ; 70 | } 71 | .visible-tablet { 72 | display: inherit !important; 73 | } 74 | .hidden-tablet { 75 | display: none !important; 76 | } 77 | } 78 | 79 | @media (max-width: 767px) { 80 | .hidden-desktop { 81 | display: inherit !important; 82 | } 83 | .visible-desktop { 84 | display: none !important; 85 | } 86 | .visible-phone { 87 | display: inherit !important; 88 | } 89 | .hidden-phone { 90 | display: none !important; 91 | } 92 | } 93 | 94 | @media (min-width: 1200px) { 95 | .row { 96 | margin-left: -30px; 97 | *zoom: 1; 98 | } 99 | .row:before, 100 | .row:after { 101 | display: table; 102 | line-height: 0; 103 | content: ""; 104 | } 105 | .row:after { 106 | clear: both; 107 | } 108 | [class*="span"] { 109 | float: left; 110 | min-height: 1px; 111 | margin-left: 30px; 112 | } 113 | .container, 114 | .navbar-static-top .container, 115 | .navbar-fixed-top .container, 116 | .navbar-fixed-bottom .container { 117 | width: 1170px; 118 | } 119 | .span12 { 120 | width: 1170px; 121 | } 122 | .span11 { 123 | width: 1070px; 124 | } 125 | .span10 { 126 | width: 970px; 127 | } 128 | .span9 { 129 | width: 870px; 130 | } 131 | .span8 { 132 | width: 770px; 133 | } 134 | .span7 { 135 | width: 670px; 136 | } 137 | .span6 { 138 | width: 570px; 139 | } 140 | .span5 { 141 | width: 470px; 142 | } 143 | .span4 { 144 | width: 370px; 145 | } 146 | .span3 { 147 | width: 270px; 148 | } 149 | .span2 { 150 | width: 170px; 151 | } 152 | .span1 { 153 | width: 70px; 154 | } 155 | .offset12 { 156 | margin-left: 1230px; 157 | } 158 | .offset11 { 159 | margin-left: 1130px; 160 | } 161 | .offset10 { 162 | margin-left: 1030px; 163 | } 164 | .offset9 { 165 | margin-left: 930px; 166 | } 167 | .offset8 { 168 | margin-left: 830px; 169 | } 170 | .offset7 { 171 | margin-left: 730px; 172 | } 173 | .offset6 { 174 | margin-left: 630px; 175 | } 176 | .offset5 { 177 | margin-left: 530px; 178 | } 179 | .offset4 { 180 | margin-left: 430px; 181 | } 182 | .offset3 { 183 | margin-left: 330px; 184 | } 185 | .offset2 { 186 | margin-left: 230px; 187 | } 188 | .offset1 { 189 | margin-left: 130px; 190 | } 191 | .row-fluid { 192 | width: 100%; 193 | *zoom: 1; 194 | } 195 | .row-fluid:before, 196 | .row-fluid:after { 197 | display: table; 198 | line-height: 0; 199 | content: ""; 200 | } 201 | .row-fluid:after { 202 | clear: both; 203 | } 204 | .row-fluid [class*="span"] { 205 | display: block; 206 | float: left; 207 | width: 100%; 208 | min-height: 30px; 209 | margin-left: 2.564102564102564%; 210 | *margin-left: 2.5109110747408616%; 211 | -webkit-box-sizing: border-box; 212 | -moz-box-sizing: border-box; 213 | box-sizing: border-box; 214 | } 215 | .row-fluid [class*="span"]:first-child { 216 | margin-left: 0; 217 | } 218 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 219 | margin-left: 2.564102564102564%; 220 | } 221 | .row-fluid .span12 { 222 | width: 100%; 223 | *width: 99.94680851063829%; 224 | } 225 | .row-fluid .span11 { 226 | width: 91.45299145299145%; 227 | *width: 91.39979996362975%; 228 | } 229 | .row-fluid .span10 { 230 | width: 82.90598290598291%; 231 | *width: 82.8527914166212%; 232 | } 233 | .row-fluid .span9 { 234 | width: 74.35897435897436%; 235 | *width: 74.30578286961266%; 236 | } 237 | .row-fluid .span8 { 238 | width: 65.81196581196582%; 239 | *width: 65.75877432260411%; 240 | } 241 | .row-fluid .span7 { 242 | width: 57.26495726495726%; 243 | *width: 57.21176577559556%; 244 | } 245 | .row-fluid .span6 { 246 | width: 48.717948717948715%; 247 | *width: 48.664757228587014%; 248 | } 249 | .row-fluid .span5 { 250 | width: 40.17094017094017%; 251 | *width: 40.11774868157847%; 252 | } 253 | .row-fluid .span4 { 254 | width: 31.623931623931625%; 255 | *width: 31.570740134569924%; 256 | } 257 | .row-fluid .span3 { 258 | width: 23.076923076923077%; 259 | *width: 23.023731587561375%; 260 | } 261 | .row-fluid .span2 { 262 | width: 14.52991452991453%; 263 | *width: 14.476723040552828%; 264 | } 265 | .row-fluid .span1 { 266 | width: 5.982905982905983%; 267 | *width: 5.929714493544281%; 268 | } 269 | .row-fluid .offset12 { 270 | margin-left: 105.12820512820512%; 271 | *margin-left: 105.02182214948171%; 272 | } 273 | .row-fluid .offset12:first-child { 274 | margin-left: 102.56410256410257%; 275 | *margin-left: 102.45771958537915%; 276 | } 277 | .row-fluid .offset11 { 278 | margin-left: 96.58119658119658%; 279 | *margin-left: 96.47481360247316%; 280 | } 281 | .row-fluid .offset11:first-child { 282 | margin-left: 94.01709401709402%; 283 | *margin-left: 93.91071103837061%; 284 | } 285 | .row-fluid .offset10 { 286 | margin-left: 88.03418803418803%; 287 | *margin-left: 87.92780505546462%; 288 | } 289 | .row-fluid .offset10:first-child { 290 | margin-left: 85.47008547008548%; 291 | *margin-left: 85.36370249136206%; 292 | } 293 | .row-fluid .offset9 { 294 | margin-left: 79.48717948717949%; 295 | *margin-left: 79.38079650845607%; 296 | } 297 | .row-fluid .offset9:first-child { 298 | margin-left: 76.92307692307693%; 299 | *margin-left: 76.81669394435352%; 300 | } 301 | .row-fluid .offset8 { 302 | margin-left: 70.94017094017094%; 303 | *margin-left: 70.83378796144753%; 304 | } 305 | .row-fluid .offset8:first-child { 306 | margin-left: 68.37606837606839%; 307 | *margin-left: 68.26968539734497%; 308 | } 309 | .row-fluid .offset7 { 310 | margin-left: 62.393162393162385%; 311 | *margin-left: 62.28677941443899%; 312 | } 313 | .row-fluid .offset7:first-child { 314 | margin-left: 59.82905982905982%; 315 | *margin-left: 59.72267685033642%; 316 | } 317 | .row-fluid .offset6 { 318 | margin-left: 53.84615384615384%; 319 | *margin-left: 53.739770867430444%; 320 | } 321 | .row-fluid .offset6:first-child { 322 | margin-left: 51.28205128205128%; 323 | *margin-left: 51.175668303327875%; 324 | } 325 | .row-fluid .offset5 { 326 | margin-left: 45.299145299145295%; 327 | *margin-left: 45.1927623204219%; 328 | } 329 | .row-fluid .offset5:first-child { 330 | margin-left: 42.73504273504273%; 331 | *margin-left: 42.62865975631933%; 332 | } 333 | .row-fluid .offset4 { 334 | margin-left: 36.75213675213675%; 335 | *margin-left: 36.645753773413354%; 336 | } 337 | .row-fluid .offset4:first-child { 338 | margin-left: 34.18803418803419%; 339 | *margin-left: 34.081651209310785%; 340 | } 341 | .row-fluid .offset3 { 342 | margin-left: 28.205128205128204%; 343 | *margin-left: 28.0987452264048%; 344 | } 345 | .row-fluid .offset3:first-child { 346 | margin-left: 25.641025641025642%; 347 | *margin-left: 25.53464266230224%; 348 | } 349 | .row-fluid .offset2 { 350 | margin-left: 19.65811965811966%; 351 | *margin-left: 19.551736679396257%; 352 | } 353 | .row-fluid .offset2:first-child { 354 | margin-left: 17.094017094017094%; 355 | *margin-left: 16.98763411529369%; 356 | } 357 | .row-fluid .offset1 { 358 | margin-left: 11.11111111111111%; 359 | *margin-left: 11.004728132387708%; 360 | } 361 | .row-fluid .offset1:first-child { 362 | margin-left: 8.547008547008547%; 363 | *margin-left: 8.440625568285142%; 364 | } 365 | input, 366 | textarea, 367 | .uneditable-input { 368 | margin-left: 0; 369 | } 370 | .controls-row [class*="span"] + [class*="span"] { 371 | margin-left: 30px; 372 | } 373 | input.span12, 374 | textarea.span12, 375 | .uneditable-input.span12 { 376 | width: 1156px; 377 | } 378 | input.span11, 379 | textarea.span11, 380 | .uneditable-input.span11 { 381 | width: 1056px; 382 | } 383 | input.span10, 384 | textarea.span10, 385 | .uneditable-input.span10 { 386 | width: 956px; 387 | } 388 | input.span9, 389 | textarea.span9, 390 | .uneditable-input.span9 { 391 | width: 856px; 392 | } 393 | input.span8, 394 | textarea.span8, 395 | .uneditable-input.span8 { 396 | width: 756px; 397 | } 398 | input.span7, 399 | textarea.span7, 400 | .uneditable-input.span7 { 401 | width: 656px; 402 | } 403 | input.span6, 404 | textarea.span6, 405 | .uneditable-input.span6 { 406 | width: 556px; 407 | } 408 | input.span5, 409 | textarea.span5, 410 | .uneditable-input.span5 { 411 | width: 456px; 412 | } 413 | input.span4, 414 | textarea.span4, 415 | .uneditable-input.span4 { 416 | width: 356px; 417 | } 418 | input.span3, 419 | textarea.span3, 420 | .uneditable-input.span3 { 421 | width: 256px; 422 | } 423 | input.span2, 424 | textarea.span2, 425 | .uneditable-input.span2 { 426 | width: 156px; 427 | } 428 | input.span1, 429 | textarea.span1, 430 | .uneditable-input.span1 { 431 | width: 56px; 432 | } 433 | .thumbnails { 434 | margin-left: -30px; 435 | } 436 | .thumbnails > li { 437 | margin-left: 30px; 438 | } 439 | .row-fluid .thumbnails { 440 | margin-left: 0; 441 | } 442 | } 443 | 444 | @media (min-width: 768px) and (max-width: 979px) { 445 | .row { 446 | margin-left: -20px; 447 | *zoom: 1; 448 | } 449 | .row:before, 450 | .row:after { 451 | display: table; 452 | line-height: 0; 453 | content: ""; 454 | } 455 | .row:after { 456 | clear: both; 457 | } 458 | [class*="span"] { 459 | float: left; 460 | min-height: 1px; 461 | margin-left: 20px; 462 | } 463 | .container, 464 | .navbar-static-top .container, 465 | .navbar-fixed-top .container, 466 | .navbar-fixed-bottom .container { 467 | width: 724px; 468 | } 469 | .span12 { 470 | width: 724px; 471 | } 472 | .span11 { 473 | width: 662px; 474 | } 475 | .span10 { 476 | width: 600px; 477 | } 478 | .span9 { 479 | width: 538px; 480 | } 481 | .span8 { 482 | width: 476px; 483 | } 484 | .span7 { 485 | width: 414px; 486 | } 487 | .span6 { 488 | width: 352px; 489 | } 490 | .span5 { 491 | width: 290px; 492 | } 493 | .span4 { 494 | width: 228px; 495 | } 496 | .span3 { 497 | width: 166px; 498 | } 499 | .span2 { 500 | width: 104px; 501 | } 502 | .span1 { 503 | width: 42px; 504 | } 505 | .offset12 { 506 | margin-left: 764px; 507 | } 508 | .offset11 { 509 | margin-left: 702px; 510 | } 511 | .offset10 { 512 | margin-left: 640px; 513 | } 514 | .offset9 { 515 | margin-left: 578px; 516 | } 517 | .offset8 { 518 | margin-left: 516px; 519 | } 520 | .offset7 { 521 | margin-left: 454px; 522 | } 523 | .offset6 { 524 | margin-left: 392px; 525 | } 526 | .offset5 { 527 | margin-left: 330px; 528 | } 529 | .offset4 { 530 | margin-left: 268px; 531 | } 532 | .offset3 { 533 | margin-left: 206px; 534 | } 535 | .offset2 { 536 | margin-left: 144px; 537 | } 538 | .offset1 { 539 | margin-left: 82px; 540 | } 541 | .row-fluid { 542 | width: 100%; 543 | *zoom: 1; 544 | } 545 | .row-fluid:before, 546 | .row-fluid:after { 547 | display: table; 548 | line-height: 0; 549 | content: ""; 550 | } 551 | .row-fluid:after { 552 | clear: both; 553 | } 554 | .row-fluid [class*="span"] { 555 | display: block; 556 | float: left; 557 | width: 100%; 558 | min-height: 30px; 559 | margin-left: 2.7624309392265194%; 560 | *margin-left: 2.709239449864817%; 561 | -webkit-box-sizing: border-box; 562 | -moz-box-sizing: border-box; 563 | box-sizing: border-box; 564 | } 565 | .row-fluid [class*="span"]:first-child { 566 | margin-left: 0; 567 | } 568 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 569 | margin-left: 2.7624309392265194%; 570 | } 571 | .row-fluid .span12 { 572 | width: 100%; 573 | *width: 99.94680851063829%; 574 | } 575 | .row-fluid .span11 { 576 | width: 91.43646408839778%; 577 | *width: 91.38327259903608%; 578 | } 579 | .row-fluid .span10 { 580 | width: 82.87292817679558%; 581 | *width: 82.81973668743387%; 582 | } 583 | .row-fluid .span9 { 584 | width: 74.30939226519337%; 585 | *width: 74.25620077583166%; 586 | } 587 | .row-fluid .span8 { 588 | width: 65.74585635359117%; 589 | *width: 65.69266486422946%; 590 | } 591 | .row-fluid .span7 { 592 | width: 57.18232044198895%; 593 | *width: 57.12912895262725%; 594 | } 595 | .row-fluid .span6 { 596 | width: 48.61878453038674%; 597 | *width: 48.56559304102504%; 598 | } 599 | .row-fluid .span5 { 600 | width: 40.05524861878453%; 601 | *width: 40.00205712942283%; 602 | } 603 | .row-fluid .span4 { 604 | width: 31.491712707182323%; 605 | *width: 31.43852121782062%; 606 | } 607 | .row-fluid .span3 { 608 | width: 22.92817679558011%; 609 | *width: 22.87498530621841%; 610 | } 611 | .row-fluid .span2 { 612 | width: 14.3646408839779%; 613 | *width: 14.311449394616199%; 614 | } 615 | .row-fluid .span1 { 616 | width: 5.801104972375691%; 617 | *width: 5.747913483013988%; 618 | } 619 | .row-fluid .offset12 { 620 | margin-left: 105.52486187845304%; 621 | *margin-left: 105.41847889972962%; 622 | } 623 | .row-fluid .offset12:first-child { 624 | margin-left: 102.76243093922652%; 625 | *margin-left: 102.6560479605031%; 626 | } 627 | .row-fluid .offset11 { 628 | margin-left: 96.96132596685082%; 629 | *margin-left: 96.8549429881274%; 630 | } 631 | .row-fluid .offset11:first-child { 632 | margin-left: 94.1988950276243%; 633 | *margin-left: 94.09251204890089%; 634 | } 635 | .row-fluid .offset10 { 636 | margin-left: 88.39779005524862%; 637 | *margin-left: 88.2914070765252%; 638 | } 639 | .row-fluid .offset10:first-child { 640 | margin-left: 85.6353591160221%; 641 | *margin-left: 85.52897613729868%; 642 | } 643 | .row-fluid .offset9 { 644 | margin-left: 79.8342541436464%; 645 | *margin-left: 79.72787116492299%; 646 | } 647 | .row-fluid .offset9:first-child { 648 | margin-left: 77.07182320441989%; 649 | *margin-left: 76.96544022569647%; 650 | } 651 | .row-fluid .offset8 { 652 | margin-left: 71.2707182320442%; 653 | *margin-left: 71.16433525332079%; 654 | } 655 | .row-fluid .offset8:first-child { 656 | margin-left: 68.50828729281768%; 657 | *margin-left: 68.40190431409427%; 658 | } 659 | .row-fluid .offset7 { 660 | margin-left: 62.70718232044199%; 661 | *margin-left: 62.600799341718584%; 662 | } 663 | .row-fluid .offset7:first-child { 664 | margin-left: 59.94475138121547%; 665 | *margin-left: 59.838368402492065%; 666 | } 667 | .row-fluid .offset6 { 668 | margin-left: 54.14364640883978%; 669 | *margin-left: 54.037263430116376%; 670 | } 671 | .row-fluid .offset6:first-child { 672 | margin-left: 51.38121546961326%; 673 | *margin-left: 51.27483249088986%; 674 | } 675 | .row-fluid .offset5 { 676 | margin-left: 45.58011049723757%; 677 | *margin-left: 45.47372751851417%; 678 | } 679 | .row-fluid .offset5:first-child { 680 | margin-left: 42.81767955801105%; 681 | *margin-left: 42.71129657928765%; 682 | } 683 | .row-fluid .offset4 { 684 | margin-left: 37.01657458563536%; 685 | *margin-left: 36.91019160691196%; 686 | } 687 | .row-fluid .offset4:first-child { 688 | margin-left: 34.25414364640884%; 689 | *margin-left: 34.14776066768544%; 690 | } 691 | .row-fluid .offset3 { 692 | margin-left: 28.45303867403315%; 693 | *margin-left: 28.346655695309746%; 694 | } 695 | .row-fluid .offset3:first-child { 696 | margin-left: 25.69060773480663%; 697 | *margin-left: 25.584224756083227%; 698 | } 699 | .row-fluid .offset2 { 700 | margin-left: 19.88950276243094%; 701 | *margin-left: 19.783119783707537%; 702 | } 703 | .row-fluid .offset2:first-child { 704 | margin-left: 17.12707182320442%; 705 | *margin-left: 17.02068884448102%; 706 | } 707 | .row-fluid .offset1 { 708 | margin-left: 11.32596685082873%; 709 | *margin-left: 11.219583872105325%; 710 | } 711 | .row-fluid .offset1:first-child { 712 | margin-left: 8.56353591160221%; 713 | *margin-left: 8.457152932878806%; 714 | } 715 | input, 716 | textarea, 717 | .uneditable-input { 718 | margin-left: 0; 719 | } 720 | .controls-row [class*="span"] + [class*="span"] { 721 | margin-left: 20px; 722 | } 723 | input.span12, 724 | textarea.span12, 725 | .uneditable-input.span12 { 726 | width: 710px; 727 | } 728 | input.span11, 729 | textarea.span11, 730 | .uneditable-input.span11 { 731 | width: 648px; 732 | } 733 | input.span10, 734 | textarea.span10, 735 | .uneditable-input.span10 { 736 | width: 586px; 737 | } 738 | input.span9, 739 | textarea.span9, 740 | .uneditable-input.span9 { 741 | width: 524px; 742 | } 743 | input.span8, 744 | textarea.span8, 745 | .uneditable-input.span8 { 746 | width: 462px; 747 | } 748 | input.span7, 749 | textarea.span7, 750 | .uneditable-input.span7 { 751 | width: 400px; 752 | } 753 | input.span6, 754 | textarea.span6, 755 | .uneditable-input.span6 { 756 | width: 338px; 757 | } 758 | input.span5, 759 | textarea.span5, 760 | .uneditable-input.span5 { 761 | width: 276px; 762 | } 763 | input.span4, 764 | textarea.span4, 765 | .uneditable-input.span4 { 766 | width: 214px; 767 | } 768 | input.span3, 769 | textarea.span3, 770 | .uneditable-input.span3 { 771 | width: 152px; 772 | } 773 | input.span2, 774 | textarea.span2, 775 | .uneditable-input.span2 { 776 | width: 90px; 777 | } 778 | input.span1, 779 | textarea.span1, 780 | .uneditable-input.span1 { 781 | width: 28px; 782 | } 783 | } 784 | 785 | @media (max-width: 767px) { 786 | body { 787 | padding-right: 20px; 788 | padding-left: 20px; 789 | } 790 | .navbar-fixed-top, 791 | .navbar-fixed-bottom, 792 | .navbar-static-top { 793 | margin-right: -20px; 794 | margin-left: -20px; 795 | } 796 | .container-fluid { 797 | padding: 0; 798 | } 799 | .dl-horizontal dt { 800 | float: none; 801 | width: auto; 802 | clear: none; 803 | text-align: left; 804 | } 805 | .dl-horizontal dd { 806 | margin-left: 0; 807 | } 808 | .container { 809 | width: auto; 810 | } 811 | .row-fluid { 812 | width: 100%; 813 | } 814 | .row, 815 | .thumbnails { 816 | margin-left: 0; 817 | } 818 | .thumbnails > li { 819 | float: none; 820 | margin-left: 0; 821 | } 822 | [class*="span"], 823 | .uneditable-input[class*="span"], 824 | .row-fluid [class*="span"] { 825 | display: block; 826 | float: none; 827 | width: 100%; 828 | margin-left: 0; 829 | -webkit-box-sizing: border-box; 830 | -moz-box-sizing: border-box; 831 | box-sizing: border-box; 832 | } 833 | .span12, 834 | .row-fluid .span12 { 835 | width: 100%; 836 | -webkit-box-sizing: border-box; 837 | -moz-box-sizing: border-box; 838 | box-sizing: border-box; 839 | } 840 | .row-fluid [class*="offset"]:first-child { 841 | margin-left: 0; 842 | } 843 | .input-large, 844 | .input-xlarge, 845 | .input-xxlarge, 846 | input[class*="span"], 847 | select[class*="span"], 848 | textarea[class*="span"], 849 | .uneditable-input { 850 | display: block; 851 | width: 100%; 852 | min-height: 30px; 853 | -webkit-box-sizing: border-box; 854 | -moz-box-sizing: border-box; 855 | box-sizing: border-box; 856 | } 857 | .input-prepend input, 858 | .input-append input, 859 | .input-prepend input[class*="span"], 860 | .input-append input[class*="span"] { 861 | display: inline-block; 862 | width: auto; 863 | } 864 | .controls-row [class*="span"] + [class*="span"] { 865 | margin-left: 0; 866 | } 867 | .modal { 868 | position: fixed; 869 | top: 20px; 870 | right: 20px; 871 | left: 20px; 872 | width: auto; 873 | margin: 0; 874 | } 875 | .modal.fade { 876 | top: -100px; 877 | } 878 | .modal.fade.in { 879 | top: 20px; 880 | } 881 | } 882 | 883 | @media (max-width: 480px) { 884 | .nav-collapse { 885 | -webkit-transform: translate3d(0, 0, 0); 886 | } 887 | .page-header h1 small { 888 | display: block; 889 | line-height: 20px; 890 | } 891 | input[type="checkbox"], 892 | input[type="radio"] { 893 | border: 1px solid #ccc; 894 | } 895 | .form-horizontal .control-label { 896 | float: none; 897 | width: auto; 898 | padding-top: 0; 899 | text-align: left; 900 | } 901 | .form-horizontal .controls { 902 | margin-left: 0; 903 | } 904 | .form-horizontal .control-list { 905 | padding-top: 0; 906 | } 907 | .form-horizontal .form-actions { 908 | padding-right: 10px; 909 | padding-left: 10px; 910 | } 911 | .media .pull-left, 912 | .media .pull-right { 913 | display: block; 914 | float: none; 915 | margin-bottom: 10px; 916 | } 917 | .media-object { 918 | margin-right: 0; 919 | margin-left: 0; 920 | } 921 | .modal { 922 | top: 10px; 923 | right: 10px; 924 | left: 10px; 925 | } 926 | .modal-header .close { 927 | padding: 10px; 928 | margin: -10px; 929 | } 930 | .carousel-caption { 931 | position: static; 932 | } 933 | } 934 | 935 | @media (max-width: 979px) { 936 | body { 937 | padding-top: 0; 938 | } 939 | .navbar-fixed-top, 940 | .navbar-fixed-bottom { 941 | position: static; 942 | } 943 | .navbar-fixed-top { 944 | margin-bottom: 20px; 945 | } 946 | .navbar-fixed-bottom { 947 | margin-top: 20px; 948 | } 949 | .navbar-fixed-top .navbar-inner, 950 | .navbar-fixed-bottom .navbar-inner { 951 | padding: 5px; 952 | } 953 | .navbar .container { 954 | width: auto; 955 | padding: 0; 956 | } 957 | .navbar .brand { 958 | padding-right: 10px; 959 | padding-left: 10px; 960 | margin: 0 0 0 -5px; 961 | } 962 | .nav-collapse { 963 | clear: both; 964 | } 965 | .nav-collapse .nav { 966 | float: none; 967 | margin: 0 0 10px; 968 | } 969 | .nav-collapse .nav > li { 970 | float: none; 971 | } 972 | .nav-collapse .nav > li > a { 973 | margin-bottom: 2px; 974 | } 975 | .nav-collapse .nav > .divider-vertical { 976 | display: none; 977 | } 978 | .nav-collapse .nav .nav-header { 979 | color: #777777; 980 | text-shadow: none; 981 | } 982 | .nav-collapse .nav > li > a, 983 | .nav-collapse .dropdown-menu a { 984 | padding: 9px 15px; 985 | font-weight: bold; 986 | color: #777777; 987 | -webkit-border-radius: 3px; 988 | -moz-border-radius: 3px; 989 | border-radius: 3px; 990 | } 991 | .nav-collapse .btn { 992 | padding: 4px 10px 4px; 993 | font-weight: normal; 994 | -webkit-border-radius: 4px; 995 | -moz-border-radius: 4px; 996 | border-radius: 4px; 997 | } 998 | .nav-collapse .dropdown-menu li + li a { 999 | margin-bottom: 2px; 1000 | } 1001 | .nav-collapse .nav > li > a:hover, 1002 | .nav-collapse .dropdown-menu a:hover { 1003 | background-color: #f2f2f2; 1004 | } 1005 | .navbar-inverse .nav-collapse .nav > li > a, 1006 | .navbar-inverse .nav-collapse .dropdown-menu a { 1007 | color: #999999; 1008 | } 1009 | .navbar-inverse .nav-collapse .nav > li > a:hover, 1010 | .navbar-inverse .nav-collapse .dropdown-menu a:hover { 1011 | background-color: #111111; 1012 | } 1013 | .nav-collapse.in .btn-group { 1014 | padding: 0; 1015 | margin-top: 5px; 1016 | } 1017 | .nav-collapse .dropdown-menu { 1018 | position: static; 1019 | top: auto; 1020 | left: auto; 1021 | display: none; 1022 | float: none; 1023 | max-width: none; 1024 | padding: 0; 1025 | margin: 0 15px; 1026 | background-color: transparent; 1027 | border: none; 1028 | -webkit-border-radius: 0; 1029 | -moz-border-radius: 0; 1030 | border-radius: 0; 1031 | -webkit-box-shadow: none; 1032 | -moz-box-shadow: none; 1033 | box-shadow: none; 1034 | } 1035 | .nav-collapse .open > .dropdown-menu { 1036 | display: block; 1037 | } 1038 | .nav-collapse .dropdown-menu:before, 1039 | .nav-collapse .dropdown-menu:after { 1040 | display: none; 1041 | } 1042 | .nav-collapse .dropdown-menu .divider { 1043 | display: none; 1044 | } 1045 | .nav-collapse .nav > li > .dropdown-menu:before, 1046 | .nav-collapse .nav > li > .dropdown-menu:after { 1047 | display: none; 1048 | } 1049 | .nav-collapse .navbar-form, 1050 | .nav-collapse .navbar-search { 1051 | float: none; 1052 | padding: 10px 15px; 1053 | margin: 10px 0; 1054 | border-top: 1px solid #f2f2f2; 1055 | border-bottom: 1px solid #f2f2f2; 1056 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1057 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1058 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1059 | } 1060 | .navbar-inverse .nav-collapse .navbar-form, 1061 | .navbar-inverse .nav-collapse .navbar-search { 1062 | border-top-color: #111111; 1063 | border-bottom-color: #111111; 1064 | } 1065 | .navbar .nav-collapse .nav.pull-right { 1066 | float: none; 1067 | margin-left: 0; 1068 | } 1069 | .nav-collapse, 1070 | .nav-collapse.collapse { 1071 | height: 0; 1072 | overflow: hidden; 1073 | } 1074 | .navbar .btn-navbar { 1075 | display: block; 1076 | } 1077 | .navbar-static .navbar-inner { 1078 | padding-right: 10px; 1079 | padding-left: 10px; 1080 | } 1081 | } 1082 | 1083 | @media (min-width: 980px) { 1084 | .nav-collapse.collapse { 1085 | height: auto !important; 1086 | overflow: visible !important; 1087 | } 1088 | } 1089 | -------------------------------------------------------------------------------- /js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.2.1 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) 27 | * ======================================================= */ 28 | 29 | $(function () { 30 | 31 | $.support.transition = (function () { 32 | 33 | var transitionEnd = (function () { 34 | 35 | var el = document.createElement('bootstrap') 36 | , transEndEventNames = { 37 | 'WebkitTransition' : 'webkitTransitionEnd' 38 | , 'MozTransition' : 'transitionend' 39 | , 'OTransition' : 'oTransitionEnd otransitionend' 40 | , 'transition' : 'transitionend' 41 | } 42 | , name 43 | 44 | for (name in transEndEventNames){ 45 | if (el.style[name] !== undefined) { 46 | return transEndEventNames[name] 47 | } 48 | } 49 | 50 | }()) 51 | 52 | return transitionEnd && { 53 | end: transitionEnd 54 | } 55 | 56 | })() 57 | 58 | }) 59 | 60 | }(window.jQuery);/* ========================================================== 61 | * bootstrap-alert.js v2.2.1 62 | * http://twitter.github.com/bootstrap/javascript.html#alerts 63 | * ========================================================== 64 | * Copyright 2012 Twitter, Inc. 65 | * 66 | * Licensed under the Apache License, Version 2.0 (the "License"); 67 | * you may not use this file except in compliance with the License. 68 | * You may obtain a copy of the License at 69 | * 70 | * http://www.apache.org/licenses/LICENSE-2.0 71 | * 72 | * Unless required by applicable law or agreed to in writing, software 73 | * distributed under the License is distributed on an "AS IS" BASIS, 74 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 75 | * See the License for the specific language governing permissions and 76 | * limitations under the License. 77 | * ========================================================== */ 78 | 79 | 80 | !function ($) { 81 | 82 | "use strict"; // jshint ;_; 83 | 84 | 85 | /* ALERT CLASS DEFINITION 86 | * ====================== */ 87 | 88 | var dismiss = '[data-dismiss="alert"]' 89 | , Alert = function (el) { 90 | $(el).on('click', dismiss, this.close) 91 | } 92 | 93 | Alert.prototype.close = function (e) { 94 | var $this = $(this) 95 | , selector = $this.attr('data-target') 96 | , $parent 97 | 98 | if (!selector) { 99 | selector = $this.attr('href') 100 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 101 | } 102 | 103 | $parent = $(selector) 104 | 105 | e && e.preventDefault() 106 | 107 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 108 | 109 | $parent.trigger(e = $.Event('close')) 110 | 111 | if (e.isDefaultPrevented()) return 112 | 113 | $parent.removeClass('in') 114 | 115 | function removeElement() { 116 | $parent 117 | .trigger('closed') 118 | .remove() 119 | } 120 | 121 | $.support.transition && $parent.hasClass('fade') ? 122 | $parent.on($.support.transition.end, removeElement) : 123 | removeElement() 124 | } 125 | 126 | 127 | /* ALERT PLUGIN DEFINITION 128 | * ======================= */ 129 | 130 | $.fn.alert = function (option) { 131 | return this.each(function () { 132 | var $this = $(this) 133 | , data = $this.data('alert') 134 | if (!data) $this.data('alert', (data = new Alert(this))) 135 | if (typeof option == 'string') data[option].call($this) 136 | }) 137 | } 138 | 139 | $.fn.alert.Constructor = Alert 140 | 141 | 142 | /* ALERT DATA-API 143 | * ============== */ 144 | 145 | $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) 146 | 147 | }(window.jQuery);/* ============================================================ 148 | * bootstrap-button.js v2.2.1 149 | * http://twitter.github.com/bootstrap/javascript.html#buttons 150 | * ============================================================ 151 | * Copyright 2012 Twitter, Inc. 152 | * 153 | * Licensed under the Apache License, Version 2.0 (the "License"); 154 | * you may not use this file except in compliance with the License. 155 | * You may obtain a copy of the License at 156 | * 157 | * http://www.apache.org/licenses/LICENSE-2.0 158 | * 159 | * Unless required by applicable law or agreed to in writing, software 160 | * distributed under the License is distributed on an "AS IS" BASIS, 161 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 162 | * See the License for the specific language governing permissions and 163 | * limitations under the License. 164 | * ============================================================ */ 165 | 166 | 167 | !function ($) { 168 | 169 | "use strict"; // jshint ;_; 170 | 171 | 172 | /* BUTTON PUBLIC CLASS DEFINITION 173 | * ============================== */ 174 | 175 | var Button = function (element, options) { 176 | this.$element = $(element) 177 | this.options = $.extend({}, $.fn.button.defaults, options) 178 | } 179 | 180 | Button.prototype.setState = function (state) { 181 | var d = 'disabled' 182 | , $el = this.$element 183 | , data = $el.data() 184 | , val = $el.is('input') ? 'val' : 'html' 185 | 186 | state = state + 'Text' 187 | data.resetText || $el.data('resetText', $el[val]()) 188 | 189 | $el[val](data[state] || this.options[state]) 190 | 191 | // push to event loop to allow forms to submit 192 | setTimeout(function () { 193 | state == 'loadingText' ? 194 | $el.addClass(d).attr(d, d) : 195 | $el.removeClass(d).removeAttr(d) 196 | }, 0) 197 | } 198 | 199 | Button.prototype.toggle = function () { 200 | var $parent = this.$element.closest('[data-toggle="buttons-radio"]') 201 | 202 | $parent && $parent 203 | .find('.active') 204 | .removeClass('active') 205 | 206 | this.$element.toggleClass('active') 207 | } 208 | 209 | 210 | /* BUTTON PLUGIN DEFINITION 211 | * ======================== */ 212 | 213 | $.fn.button = function (option) { 214 | return this.each(function () { 215 | var $this = $(this) 216 | , data = $this.data('button') 217 | , options = typeof option == 'object' && option 218 | if (!data) $this.data('button', (data = new Button(this, options))) 219 | if (option == 'toggle') data.toggle() 220 | else if (option) data.setState(option) 221 | }) 222 | } 223 | 224 | $.fn.button.defaults = { 225 | loadingText: 'loading...' 226 | } 227 | 228 | $.fn.button.Constructor = Button 229 | 230 | 231 | /* BUTTON DATA-API 232 | * =============== */ 233 | 234 | $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { 235 | var $btn = $(e.target) 236 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 237 | $btn.button('toggle') 238 | }) 239 | 240 | }(window.jQuery);/* ========================================================== 241 | * bootstrap-carousel.js v2.2.1 242 | * http://twitter.github.com/bootstrap/javascript.html#carousel 243 | * ========================================================== 244 | * Copyright 2012 Twitter, Inc. 245 | * 246 | * Licensed under the Apache License, Version 2.0 (the "License"); 247 | * you may not use this file except in compliance with the License. 248 | * You may obtain a copy of the License at 249 | * 250 | * http://www.apache.org/licenses/LICENSE-2.0 251 | * 252 | * Unless required by applicable law or agreed to in writing, software 253 | * distributed under the License is distributed on an "AS IS" BASIS, 254 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 255 | * See the License for the specific language governing permissions and 256 | * limitations under the License. 257 | * ========================================================== */ 258 | 259 | 260 | !function ($) { 261 | 262 | "use strict"; // jshint ;_; 263 | 264 | 265 | /* CAROUSEL CLASS DEFINITION 266 | * ========================= */ 267 | 268 | var Carousel = function (element, options) { 269 | this.$element = $(element) 270 | this.options = options 271 | this.options.slide && this.slide(this.options.slide) 272 | this.options.pause == 'hover' && this.$element 273 | .on('mouseenter', $.proxy(this.pause, this)) 274 | .on('mouseleave', $.proxy(this.cycle, this)) 275 | } 276 | 277 | Carousel.prototype = { 278 | 279 | cycle: function (e) { 280 | if (!e) this.paused = false 281 | this.options.interval 282 | && !this.paused 283 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 284 | return this 285 | } 286 | 287 | , to: function (pos) { 288 | var $active = this.$element.find('.item.active') 289 | , children = $active.parent().children() 290 | , activePos = children.index($active) 291 | , that = this 292 | 293 | if (pos > (children.length - 1) || pos < 0) return 294 | 295 | if (this.sliding) { 296 | return this.$element.one('slid', function () { 297 | that.to(pos) 298 | }) 299 | } 300 | 301 | if (activePos == pos) { 302 | return this.pause().cycle() 303 | } 304 | 305 | return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) 306 | } 307 | 308 | , pause: function (e) { 309 | if (!e) this.paused = true 310 | if (this.$element.find('.next, .prev').length && $.support.transition.end) { 311 | this.$element.trigger($.support.transition.end) 312 | this.cycle() 313 | } 314 | clearInterval(this.interval) 315 | this.interval = null 316 | return this 317 | } 318 | 319 | , next: function () { 320 | if (this.sliding) return 321 | return this.slide('next') 322 | } 323 | 324 | , prev: function () { 325 | if (this.sliding) return 326 | return this.slide('prev') 327 | } 328 | 329 | , slide: function (type, next) { 330 | var $active = this.$element.find('.item.active') 331 | , $next = next || $active[type]() 332 | , isCycling = this.interval 333 | , direction = type == 'next' ? 'left' : 'right' 334 | , fallback = type == 'next' ? 'first' : 'last' 335 | , that = this 336 | , e 337 | 338 | this.sliding = true 339 | 340 | isCycling && this.pause() 341 | 342 | $next = $next.length ? $next : this.$element.find('.item')[fallback]() 343 | 344 | e = $.Event('slide', { 345 | relatedTarget: $next[0] 346 | }) 347 | 348 | if ($next.hasClass('active')) return 349 | 350 | if ($.support.transition && this.$element.hasClass('slide')) { 351 | this.$element.trigger(e) 352 | if (e.isDefaultPrevented()) return 353 | $next.addClass(type) 354 | $next[0].offsetWidth // force reflow 355 | $active.addClass(direction) 356 | $next.addClass(direction) 357 | this.$element.one($.support.transition.end, function () { 358 | $next.removeClass([type, direction].join(' ')).addClass('active') 359 | $active.removeClass(['active', direction].join(' ')) 360 | that.sliding = false 361 | setTimeout(function () { that.$element.trigger('slid') }, 0) 362 | }) 363 | } else { 364 | this.$element.trigger(e) 365 | if (e.isDefaultPrevented()) return 366 | $active.removeClass('active') 367 | $next.addClass('active') 368 | this.sliding = false 369 | this.$element.trigger('slid') 370 | } 371 | 372 | isCycling && this.cycle() 373 | 374 | return this 375 | } 376 | 377 | } 378 | 379 | 380 | /* CAROUSEL PLUGIN DEFINITION 381 | * ========================== */ 382 | 383 | $.fn.carousel = function (option) { 384 | return this.each(function () { 385 | var $this = $(this) 386 | , data = $this.data('carousel') 387 | , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) 388 | , action = typeof option == 'string' ? option : options.slide 389 | if (!data) $this.data('carousel', (data = new Carousel(this, options))) 390 | if (typeof option == 'number') data.to(option) 391 | else if (action) data[action]() 392 | else if (options.interval) data.cycle() 393 | }) 394 | } 395 | 396 | $.fn.carousel.defaults = { 397 | interval: 5000 398 | , pause: 'hover' 399 | } 400 | 401 | $.fn.carousel.Constructor = Carousel 402 | 403 | 404 | /* CAROUSEL DATA-API 405 | * ================= */ 406 | 407 | $(document).on('click.carousel.data-api', '[data-slide]', function (e) { 408 | var $this = $(this), href 409 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 410 | , options = $.extend({}, $target.data(), $this.data()) 411 | $target.carousel(options) 412 | e.preventDefault() 413 | }) 414 | 415 | }(window.jQuery);/* ============================================================= 416 | * bootstrap-collapse.js v2.2.1 417 | * http://twitter.github.com/bootstrap/javascript.html#collapse 418 | * ============================================================= 419 | * Copyright 2012 Twitter, Inc. 420 | * 421 | * Licensed under the Apache License, Version 2.0 (the "License"); 422 | * you may not use this file except in compliance with the License. 423 | * You may obtain a copy of the License at 424 | * 425 | * http://www.apache.org/licenses/LICENSE-2.0 426 | * 427 | * Unless required by applicable law or agreed to in writing, software 428 | * distributed under the License is distributed on an "AS IS" BASIS, 429 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 430 | * See the License for the specific language governing permissions and 431 | * limitations under the License. 432 | * ============================================================ */ 433 | 434 | 435 | !function ($) { 436 | 437 | "use strict"; // jshint ;_; 438 | 439 | 440 | /* COLLAPSE PUBLIC CLASS DEFINITION 441 | * ================================ */ 442 | 443 | var Collapse = function (element, options) { 444 | this.$element = $(element) 445 | this.options = $.extend({}, $.fn.collapse.defaults, options) 446 | 447 | if (this.options.parent) { 448 | this.$parent = $(this.options.parent) 449 | } 450 | 451 | this.options.toggle && this.toggle() 452 | } 453 | 454 | Collapse.prototype = { 455 | 456 | constructor: Collapse 457 | 458 | , dimension: function () { 459 | var hasWidth = this.$element.hasClass('width') 460 | return hasWidth ? 'width' : 'height' 461 | } 462 | 463 | , show: function () { 464 | var dimension 465 | , scroll 466 | , actives 467 | , hasData 468 | 469 | if (this.transitioning) return 470 | 471 | dimension = this.dimension() 472 | scroll = $.camelCase(['scroll', dimension].join('-')) 473 | actives = this.$parent && this.$parent.find('> .accordion-group > .in') 474 | 475 | if (actives && actives.length) { 476 | hasData = actives.data('collapse') 477 | if (hasData && hasData.transitioning) return 478 | actives.collapse('hide') 479 | hasData || actives.data('collapse', null) 480 | } 481 | 482 | this.$element[dimension](0) 483 | this.transition('addClass', $.Event('show'), 'shown') 484 | $.support.transition && this.$element[dimension](this.$element[0][scroll]) 485 | } 486 | 487 | , hide: function () { 488 | var dimension 489 | if (this.transitioning) return 490 | dimension = this.dimension() 491 | this.reset(this.$element[dimension]()) 492 | this.transition('removeClass', $.Event('hide'), 'hidden') 493 | this.$element[dimension](0) 494 | } 495 | 496 | , reset: function (size) { 497 | var dimension = this.dimension() 498 | 499 | this.$element 500 | .removeClass('collapse') 501 | [dimension](size || 'auto') 502 | [0].offsetWidth 503 | 504 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') 505 | 506 | return this 507 | } 508 | 509 | , transition: function (method, startEvent, completeEvent) { 510 | var that = this 511 | , complete = function () { 512 | if (startEvent.type == 'show') that.reset() 513 | that.transitioning = 0 514 | that.$element.trigger(completeEvent) 515 | } 516 | 517 | this.$element.trigger(startEvent) 518 | 519 | if (startEvent.isDefaultPrevented()) return 520 | 521 | this.transitioning = 1 522 | 523 | this.$element[method]('in') 524 | 525 | $.support.transition && this.$element.hasClass('collapse') ? 526 | this.$element.one($.support.transition.end, complete) : 527 | complete() 528 | } 529 | 530 | , toggle: function () { 531 | this[this.$element.hasClass('in') ? 'hide' : 'show']() 532 | } 533 | 534 | } 535 | 536 | 537 | /* COLLAPSIBLE PLUGIN DEFINITION 538 | * ============================== */ 539 | 540 | $.fn.collapse = function (option) { 541 | return this.each(function () { 542 | var $this = $(this) 543 | , data = $this.data('collapse') 544 | , options = typeof option == 'object' && option 545 | if (!data) $this.data('collapse', (data = new Collapse(this, options))) 546 | if (typeof option == 'string') data[option]() 547 | }) 548 | } 549 | 550 | $.fn.collapse.defaults = { 551 | toggle: true 552 | } 553 | 554 | $.fn.collapse.Constructor = Collapse 555 | 556 | 557 | /* COLLAPSIBLE DATA-API 558 | * ==================== */ 559 | 560 | $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { 561 | var $this = $(this), href 562 | , target = $this.attr('data-target') 563 | || e.preventDefault() 564 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 565 | , option = $(target).data('collapse') ? 'toggle' : $this.data() 566 | $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 567 | $(target).collapse(option) 568 | }) 569 | 570 | }(window.jQuery);/* ============================================================ 571 | * bootstrap-dropdown.js v2.2.1 572 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 573 | * ============================================================ 574 | * Copyright 2012 Twitter, Inc. 575 | * 576 | * Licensed under the Apache License, Version 2.0 (the "License"); 577 | * you may not use this file except in compliance with the License. 578 | * You may obtain a copy of the License at 579 | * 580 | * http://www.apache.org/licenses/LICENSE-2.0 581 | * 582 | * Unless required by applicable law or agreed to in writing, software 583 | * distributed under the License is distributed on an "AS IS" BASIS, 584 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 585 | * See the License for the specific language governing permissions and 586 | * limitations under the License. 587 | * ============================================================ */ 588 | 589 | 590 | !function ($) { 591 | 592 | "use strict"; // jshint ;_; 593 | 594 | 595 | /* DROPDOWN CLASS DEFINITION 596 | * ========================= */ 597 | 598 | var toggle = '[data-toggle=dropdown]' 599 | , Dropdown = function (element) { 600 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 601 | $('html').on('click.dropdown.data-api', function () { 602 | $el.parent().removeClass('open') 603 | }) 604 | } 605 | 606 | Dropdown.prototype = { 607 | 608 | constructor: Dropdown 609 | 610 | , toggle: function (e) { 611 | var $this = $(this) 612 | , $parent 613 | , isActive 614 | 615 | if ($this.is('.disabled, :disabled')) return 616 | 617 | $parent = getParent($this) 618 | 619 | isActive = $parent.hasClass('open') 620 | 621 | clearMenus() 622 | 623 | if (!isActive) { 624 | $parent.toggleClass('open') 625 | $this.focus() 626 | } 627 | 628 | return false 629 | } 630 | 631 | , keydown: function (e) { 632 | var $this 633 | , $items 634 | , $active 635 | , $parent 636 | , isActive 637 | , index 638 | 639 | if (!/(38|40|27)/.test(e.keyCode)) return 640 | 641 | $this = $(this) 642 | 643 | e.preventDefault() 644 | e.stopPropagation() 645 | 646 | if ($this.is('.disabled, :disabled')) return 647 | 648 | $parent = getParent($this) 649 | 650 | isActive = $parent.hasClass('open') 651 | 652 | if (!isActive || (isActive && e.keyCode == 27)) return $this.click() 653 | 654 | $items = $('[role=menu] li:not(.divider) a', $parent) 655 | 656 | if (!$items.length) return 657 | 658 | index = $items.index($items.filter(':focus')) 659 | 660 | if (e.keyCode == 38 && index > 0) index-- // up 661 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down 662 | if (!~index) index = 0 663 | 664 | $items 665 | .eq(index) 666 | .focus() 667 | } 668 | 669 | } 670 | 671 | function clearMenus() { 672 | $(toggle).each(function () { 673 | getParent($(this)).removeClass('open') 674 | }) 675 | } 676 | 677 | function getParent($this) { 678 | var selector = $this.attr('data-target') 679 | , $parent 680 | 681 | if (!selector) { 682 | selector = $this.attr('href') 683 | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 684 | } 685 | 686 | $parent = $(selector) 687 | $parent.length || ($parent = $this.parent()) 688 | 689 | return $parent 690 | } 691 | 692 | 693 | /* DROPDOWN PLUGIN DEFINITION 694 | * ========================== */ 695 | 696 | $.fn.dropdown = function (option) { 697 | return this.each(function () { 698 | var $this = $(this) 699 | , data = $this.data('dropdown') 700 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 701 | if (typeof option == 'string') data[option].call($this) 702 | }) 703 | } 704 | 705 | $.fn.dropdown.Constructor = Dropdown 706 | 707 | 708 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 709 | * =================================== */ 710 | 711 | $(document) 712 | .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) 713 | .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 714 | .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) 715 | .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) 716 | 717 | }(window.jQuery);/* ========================================================= 718 | * bootstrap-modal.js v2.2.1 719 | * http://twitter.github.com/bootstrap/javascript.html#modals 720 | * ========================================================= 721 | * Copyright 2012 Twitter, Inc. 722 | * 723 | * Licensed under the Apache License, Version 2.0 (the "License"); 724 | * you may not use this file except in compliance with the License. 725 | * You may obtain a copy of the License at 726 | * 727 | * http://www.apache.org/licenses/LICENSE-2.0 728 | * 729 | * Unless required by applicable law or agreed to in writing, software 730 | * distributed under the License is distributed on an "AS IS" BASIS, 731 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 732 | * See the License for the specific language governing permissions and 733 | * limitations under the License. 734 | * ========================================================= */ 735 | 736 | 737 | !function ($) { 738 | 739 | "use strict"; // jshint ;_; 740 | 741 | 742 | /* MODAL CLASS DEFINITION 743 | * ====================== */ 744 | 745 | var Modal = function (element, options) { 746 | this.options = options 747 | this.$element = $(element) 748 | .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) 749 | this.options.remote && this.$element.find('.modal-body').load(this.options.remote) 750 | } 751 | 752 | Modal.prototype = { 753 | 754 | constructor: Modal 755 | 756 | , toggle: function () { 757 | return this[!this.isShown ? 'show' : 'hide']() 758 | } 759 | 760 | , show: function () { 761 | var that = this 762 | , e = $.Event('show') 763 | 764 | this.$element.trigger(e) 765 | 766 | if (this.isShown || e.isDefaultPrevented()) return 767 | 768 | this.isShown = true 769 | 770 | this.escape() 771 | 772 | this.backdrop(function () { 773 | var transition = $.support.transition && that.$element.hasClass('fade') 774 | 775 | if (!that.$element.parent().length) { 776 | that.$element.appendTo(document.body) //don't move modals dom position 777 | } 778 | 779 | that.$element 780 | .show() 781 | 782 | if (transition) { 783 | that.$element[0].offsetWidth // force reflow 784 | } 785 | 786 | that.$element 787 | .addClass('in') 788 | .attr('aria-hidden', false) 789 | 790 | that.enforceFocus() 791 | 792 | transition ? 793 | that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : 794 | that.$element.focus().trigger('shown') 795 | 796 | }) 797 | } 798 | 799 | , hide: function (e) { 800 | e && e.preventDefault() 801 | 802 | var that = this 803 | 804 | e = $.Event('hide') 805 | 806 | this.$element.trigger(e) 807 | 808 | if (!this.isShown || e.isDefaultPrevented()) return 809 | 810 | this.isShown = false 811 | 812 | this.escape() 813 | 814 | $(document).off('focusin.modal') 815 | 816 | this.$element 817 | .removeClass('in') 818 | .attr('aria-hidden', true) 819 | 820 | $.support.transition && this.$element.hasClass('fade') ? 821 | this.hideWithTransition() : 822 | this.hideModal() 823 | } 824 | 825 | , enforceFocus: function () { 826 | var that = this 827 | $(document).on('focusin.modal', function (e) { 828 | if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { 829 | that.$element.focus() 830 | } 831 | }) 832 | } 833 | 834 | , escape: function () { 835 | var that = this 836 | if (this.isShown && this.options.keyboard) { 837 | this.$element.on('keyup.dismiss.modal', function ( e ) { 838 | e.which == 27 && that.hide() 839 | }) 840 | } else if (!this.isShown) { 841 | this.$element.off('keyup.dismiss.modal') 842 | } 843 | } 844 | 845 | , hideWithTransition: function () { 846 | var that = this 847 | , timeout = setTimeout(function () { 848 | that.$element.off($.support.transition.end) 849 | that.hideModal() 850 | }, 500) 851 | 852 | this.$element.one($.support.transition.end, function () { 853 | clearTimeout(timeout) 854 | that.hideModal() 855 | }) 856 | } 857 | 858 | , hideModal: function (that) { 859 | this.$element 860 | .hide() 861 | .trigger('hidden') 862 | 863 | this.backdrop() 864 | } 865 | 866 | , removeBackdrop: function () { 867 | this.$backdrop.remove() 868 | this.$backdrop = null 869 | } 870 | 871 | , backdrop: function (callback) { 872 | var that = this 873 | , animate = this.$element.hasClass('fade') ? 'fade' : '' 874 | 875 | if (this.isShown && this.options.backdrop) { 876 | var doAnimate = $.support.transition && animate 877 | 878 | this.$backdrop = $('