").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
6 |
--------------------------------------------------------------------------------
/js/jquery.nice-select.js:
--------------------------------------------------------------------------------
1 | /* jQuery Nice Select - v1.1.0
2 | https://github.com/hernansartorio/jquery-nice-select
3 | Made by Hernán Sartorio */
4 |
5 | (function($) {
6 |
7 | $.fn.niceSelect = function(method) {
8 |
9 | // Methods
10 | if (typeof method == 'string') {
11 | if (method == 'update') {
12 | this.each(function() {
13 | var $select = $(this);
14 | var $dropdown = $(this).next('.nice-select');
15 | var open = $dropdown.hasClass('open');
16 |
17 | if ($dropdown.length) {
18 | $dropdown.remove();
19 | create_nice_select($select);
20 |
21 | if (open) {
22 | $select.next().trigger('click');
23 | }
24 | }
25 | });
26 | } else if (method == 'destroy') {
27 | this.each(function() {
28 | var $select = $(this);
29 | var $dropdown = $(this).next('.nice-select');
30 |
31 | if ($dropdown.length) {
32 | $dropdown.remove();
33 | $select.css('display', '');
34 | }
35 | });
36 | if ($('.nice-select').length == 0) {
37 | $(document).off('.nice_select');
38 | }
39 | } else {
40 | console.log('Method "' + method + '" does not exist.')
41 | }
42 | return this;
43 | }
44 |
45 | // Hide native select
46 | this.hide();
47 |
48 | // Create custom markup
49 | this.each(function() {
50 | var $select = $(this);
51 |
52 | if (!$select.next().hasClass('nice-select')) {
53 | create_nice_select($select);
54 | }
55 | });
56 |
57 | function create_nice_select($select) {
58 | $select.after($('
')
59 | .addClass('nice-select')
60 | .addClass($select.attr('class') || '')
61 | .addClass($select.attr('disabled') ? 'disabled' : '')
62 | .attr('tabindex', $select.attr('disabled') ? null : '0')
63 | .html('
')
64 | );
65 |
66 | var $dropdown = $select.next();
67 | var $options = $select.find('option');
68 | var $selected = $select.find('option:selected');
69 |
70 | $dropdown.find('.current').html($selected.data('display') || $selected.text());
71 |
72 | $options.each(function(i) {
73 | var $option = $(this);
74 | var display = $option.data('display');
75 |
76 | $dropdown.find('ul').append($('
')
77 | .attr('data-value', $option.val())
78 | .attr('data-display', (display || null))
79 | .addClass('option' +
80 | ($option.is(':selected') ? ' selected' : '') +
81 | ($option.is(':disabled') ? ' disabled' : ''))
82 | .html($option.text())
83 | );
84 | });
85 | }
86 |
87 | /* Event listeners */
88 |
89 | // Unbind existing events in case that the plugin has been initialized before
90 | $(document).off('.nice_select');
91 |
92 | // Open/close
93 | $(document).on('click.nice_select', '.nice-select', function(event) {
94 | var $dropdown = $(this);
95 |
96 | $('.nice-select').not($dropdown).removeClass('open');
97 | $dropdown.toggleClass('open');
98 |
99 | if ($dropdown.hasClass('open')) {
100 | $dropdown.find('.option');
101 | $dropdown.find('.focus').removeClass('focus');
102 | $dropdown.find('.selected').addClass('focus');
103 | } else {
104 | $dropdown.focus();
105 | }
106 | });
107 |
108 | // Close when clicking outside
109 | $(document).on('click.nice_select', function(event) {
110 | if ($(event.target).closest('.nice-select').length === 0) {
111 | $('.nice-select').removeClass('open').find('.option');
112 | }
113 | });
114 |
115 | // Option click
116 | $(document).on('click.nice_select', '.nice-select .option:not(.disabled)', function(event) {
117 | var $option = $(this);
118 | var $dropdown = $option.closest('.nice-select');
119 |
120 | $dropdown.find('.selected').removeClass('selected');
121 | $option.addClass('selected');
122 |
123 | var text = $option.data('display') || $option.text();
124 | $dropdown.find('.current').text(text);
125 |
126 | $dropdown.prev('select').val($option.data('value')).trigger('change');
127 | });
128 |
129 | // Keyboard events
130 | $(document).on('keydown.nice_select', '.nice-select', function(event) {
131 | var $dropdown = $(this);
132 | var $focused_option = $($dropdown.find('.focus') || $dropdown.find('.list .option.selected'));
133 |
134 | // Space or Enter
135 | if (event.keyCode == 32 || event.keyCode == 13) {
136 | if ($dropdown.hasClass('open')) {
137 | $focused_option.trigger('click');
138 | } else {
139 | $dropdown.trigger('click');
140 | }
141 | return false;
142 | // Down
143 | } else if (event.keyCode == 40) {
144 | if (!$dropdown.hasClass('open')) {
145 | $dropdown.trigger('click');
146 | } else {
147 | var $next = $focused_option.nextAll('.option:not(.disabled)').first();
148 | if ($next.length > 0) {
149 | $dropdown.find('.focus').removeClass('focus');
150 | $next.addClass('focus');
151 | }
152 | }
153 | return false;
154 | // Up
155 | } else if (event.keyCode == 38) {
156 | if (!$dropdown.hasClass('open')) {
157 | $dropdown.trigger('click');
158 | } else {
159 | var $prev = $focused_option.prevAll('.option:not(.disabled)').first();
160 | if ($prev.length > 0) {
161 | $dropdown.find('.focus').removeClass('focus');
162 | $prev.addClass('focus');
163 | }
164 | }
165 | return false;
166 | // Esc
167 | } else if (event.keyCode == 27) {
168 | if ($dropdown.hasClass('open')) {
169 | $dropdown.trigger('click');
170 | }
171 | // Tab
172 | } else if (event.keyCode == 9) {
173 | if ($dropdown.hasClass('open')) {
174 | return false;
175 | }
176 | }
177 | });
178 |
179 | // Detect CSS pointer-events support, for IE <= 10. From Modernizr.
180 | var style = document.createElement('a').style;
181 | style.cssText = 'pointer-events:auto';
182 | if (style.pointerEvents !== 'auto') {
183 | $('html').addClass('no-csspointerevents');
184 | }
185 |
186 | return this;
187 |
188 | };
189 |
190 | }(jQuery));
--------------------------------------------------------------------------------
/js/jquery.nice-select.min.js:
--------------------------------------------------------------------------------
1 | /* jQuery Nice Select - v1.0
2 | https://github.com/hernansartorio/jquery-nice-select
3 | Made by Hernán Sartorio */
4 | !function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("
").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('
'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("
").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
--------------------------------------------------------------------------------
/js/prism.js:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss */
2 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=(o?" ":"")+s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+""+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code,i=n.immediateClose;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),i&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
3 | Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/