gentelella-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +107 -0
- data/Rakefile +30 -0
- data/assets/javascripts/autosize.js +254 -0
- data/assets/javascripts/bootstrap-progressbar.js +168 -0
- data/assets/javascripts/bootstrap-wysiwyg.js +306 -0
- data/assets/javascripts/data_tables.coffee +12 -0
- data/assets/javascripts/data_tables/jquery.data_tables.js +15277 -0
- data/assets/javascripts/data_tables/net-bs.bootstrap.js +182 -0
- data/assets/javascripts/data_tables/net-buttons-bs.buttons.js +68 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.flash.js +1325 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.html5.js +1322 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.js +1634 -0
- data/assets/javascripts/data_tables/net-buttons.buttons.print.js +172 -0
- data/assets/javascripts/data_tables/net-fixedheader.js +672 -0
- data/assets/javascripts/data_tables/net-keytable.js +883 -0
- data/assets/javascripts/data_tables/net-responsive-bs.js +81 -0
- data/assets/javascripts/data_tables/net-responsive.js +1232 -0
- data/assets/javascripts/data_tables/net-scroller.js +1349 -0
- data/assets/javascripts/echarts.js +56282 -0
- data/assets/javascripts/echarts.map.world.js +27 -0
- data/assets/javascripts/fullcalendar.js +14206 -0
- data/assets/javascripts/gauge.coffee +524 -0
- data/assets/javascripts/gentelella.coffee +50 -0
- data/assets/javascripts/jquery.autocomplete.js +979 -0
- data/assets/javascripts/jquery.easypiechart.js +360 -0
- data/assets/javascripts/jquery.flot.curvedLines.js +483 -0
- data/assets/javascripts/jquery.flot.curved_lines.js +483 -0
- data/assets/javascripts/jquery.flot.orderBars.js +201 -0
- data/assets/javascripts/jquery.flot.order_bars.js +201 -0
- data/assets/javascripts/jquery.flot.spline.js +212 -0
- data/assets/javascripts/jquery.hotkeys.js +204 -0
- data/assets/javascripts/jquery.mCustomScrollbar.concat.min.js +6 -0
- data/assets/javascripts/jquery.mCustomScrollbar.js +2425 -0
- data/assets/javascripts/jquery.sparkline.js +3063 -0
- data/assets/javascripts/jquery.tagsinput.js +390 -0
- data/assets/javascripts/jquery.vmap.js +1281 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.africa.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.asia.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.australia.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.europe.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -0
- data/assets/javascripts/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.algeria.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.argentina.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.brazil.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.canada.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.europe.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.france.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.germany.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.greece.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.iran.js +6 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.iraq.js +1 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.russia.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.tunisia.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.turkey.js +11 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.usa.js +2 -0
- data/assets/javascripts/jqvmap/maps/jquery.vmap.world.js +2 -0
- data/assets/javascripts/jszip.js +9344 -0
- data/assets/javascripts/morris.js +1892 -0
- data/assets/javascripts/parsley.js.map +1 -0
- data/assets/javascripts/pdfmake.js +68149 -0
- data/assets/javascripts/pnotify.buttons.js +8 -0
- data/assets/javascripts/pnotify.js +31 -0
- data/assets/javascripts/pnotify.nonblock.js +6 -0
- data/assets/javascripts/prettify.coffee +29 -0
- data/assets/javascripts/prettify/lang-apollo.js +51 -0
- data/assets/javascripts/prettify/lang-basic.js +32 -0
- data/assets/javascripts/prettify/lang-clj.js +64 -0
- data/assets/javascripts/prettify/lang-css.js +159 -0
- data/assets/javascripts/prettify/lang-dart.js +88 -0
- data/assets/javascripts/prettify/lang-erlang.js +92 -0
- data/assets/javascripts/prettify/lang-go.js +58 -0
- data/assets/javascripts/prettify/lang-hs.js +101 -0
- data/assets/javascripts/prettify/lang-lisp.js +94 -0
- data/assets/javascripts/prettify/lang-llvm.js +61 -0
- data/assets/javascripts/prettify/lang-lua.js +59 -0
- data/assets/javascripts/prettify/lang-matlab.js +180 -0
- data/assets/javascripts/prettify/lang-ml.js +56 -0
- data/assets/javascripts/prettify/lang-mumps.js +139 -0
- data/assets/javascripts/prettify/lang-n.js +65 -0
- data/assets/javascripts/prettify/lang-pascal.js +32 -0
- data/assets/javascripts/prettify/lang-proto.js +35 -0
- data/assets/javascripts/prettify/lang-r.js +57 -0
- data/assets/javascripts/prettify/lang-rd.js +47 -0
- data/assets/javascripts/prettify/lang-scala.js +54 -0
- data/assets/javascripts/prettify/lang-sql.js +58 -0
- data/assets/javascripts/prettify/lang-tcl.js +62 -0
- data/assets/javascripts/prettify/lang-tex.js +46 -0
- data/assets/javascripts/prettify/lang-vb.js +66 -0
- data/assets/javascripts/prettify/lang-vhdl.js +34 -0
- data/assets/javascripts/prettify/lang-wiki.js +53 -0
- data/assets/javascripts/prettify/lang-xq.js +67 -0
- data/assets/javascripts/prettify/lang-yaml.js +27 -0
- data/assets/javascripts/prettify/prettify.js +1655 -0
- data/assets/javascripts/prettify/run_prettify.js +1905 -0
- data/assets/javascripts/raphael.js +8330 -0
- data/assets/javascripts/skycons.js +730 -0
- data/assets/javascripts/starrr.js +98 -0
- data/assets/javascripts/vfs_fonts.js +1 -0
- data/assets/stylesheets/bootstrap-progressbar-3.3.0-3.x.x.scss +74 -0
- data/assets/stylesheets/bootstrap-wysiwyg.css +88 -0
- data/assets/stylesheets/data_tables/net-bs.bootstrap.css +185 -0
- data/assets/stylesheets/data_tables/net-buttons-bs.buttons.css +102 -0
- data/assets/stylesheets/data_tables/net-fixedheader-bs.bootstrap.css +20 -0
- data/assets/stylesheets/data_tables/net-responsive-bs.bootstrap.css +181 -0
- data/assets/stylesheets/data_tables/net-scroller-bs.bootstrap.css +24 -0
- data/assets/stylesheets/fullcalendar.css +1406 -0
- data/assets/stylesheets/fullcalendar.print.css +208 -0
- data/assets/stylesheets/gentelella.scss +39 -0
- data/assets/stylesheets/jquery.mCustomScrollbar.css +1267 -0
- data/assets/stylesheets/jqvmap.css +50 -0
- data/assets/stylesheets/morris.css +2 -0
- data/assets/stylesheets/pnotify.buttons.css +1 -0
- data/assets/stylesheets/pnotify.css +1 -0
- data/assets/stylesheets/pnotify.nonblock.css +1 -0
- data/assets/stylesheets/prettify/prettify.css +52 -0
- data/assets/stylesheets/starrr.css +8 -0
- data/lib/generators/gentelella/install/USAGE +9 -0
- data/lib/generators/gentelella/install/install_generator.rb +14 -0
- data/lib/generators/gentelella/install/templates/gentelella-custom.js +5067 -0
- data/lib/generators/gentelella/install/templates/gentelella-custom.scss +4241 -0
- data/lib/gentelella-rails.rb +58 -0
- data/lib/gentelella/engine.rb +15 -0
- data/lib/gentelella/version.rb +3 -0
- data/lib/tasks/bower.rake +153 -0
- data/lib/tasks/gentelella/rails_tasks.rake +4 -0
- metadata +409 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
(function(d,e){"function"===typeof define&&define.amd?define("pnotify.buttons",["jquery","pnotify"],e):"object"===typeof exports&&"undefined"!==typeof module?module.exports=e(require("jquery"),require("./pnotify")):e(d.jQuery,d.PNotify)})(this,function(d,e){e.prototype.options.buttons={closer:!0,closer_hover:!0,sticker:!0,sticker_hover:!0,show_on_nonblock:!1,labels:{close:"Close",stick:"Stick",unstick:"Unstick"},classes:{closer:null,pin_up:null,pin_down:null}};e.prototype.modules.buttons={closer:null,
|
2
|
+
sticker:null,init:function(a,b){var c=this;a.elem.on({mouseenter:function(b){!c.options.sticker||a.options.nonblock&&a.options.nonblock.nonblock&&!c.options.show_on_nonblock||c.sticker.trigger("pnotify:buttons:toggleStick").css("visibility","visible");!c.options.closer||a.options.nonblock&&a.options.nonblock.nonblock&&!c.options.show_on_nonblock||c.closer.css("visibility","visible")},mouseleave:function(a){c.options.sticker_hover&&c.sticker.css("visibility","hidden");c.options.closer_hover&&c.closer.css("visibility",
|
3
|
+
"hidden")}});this.sticker=d("<div />",{"class":"ui-pnotify-sticker","aria-role":"button","aria-pressed":a.options.hide?"false":"true",tabindex:"0",title:a.options.hide?b.labels.stick:b.labels.unstick,css:{cursor:"pointer",visibility:b.sticker_hover?"hidden":"visible"},click:function(){a.options.hide=!a.options.hide;a.options.hide?a.queueRemove():a.cancelRemove();d(this).trigger("pnotify:buttons:toggleStick")}}).bind("pnotify:buttons:toggleStick",function(){var b=null===c.options.classes.pin_up?a.styles.pin_up:
|
4
|
+
c.options.classes.pin_up,e=null===c.options.classes.pin_down?a.styles.pin_down:c.options.classes.pin_down;d(this).attr("title",a.options.hide?c.options.labels.stick:c.options.labels.unstick).children().attr("class","").addClass(a.options.hide?b:e).attr("aria-pressed",a.options.hide?"false":"true")}).append("<span />").trigger("pnotify:buttons:toggleStick").prependTo(a.container);(!b.sticker||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock)&&this.sticker.css("display","none");
|
5
|
+
this.closer=d("<div />",{"class":"ui-pnotify-closer","aria-role":"button",tabindex:"0",title:b.labels.close,css:{cursor:"pointer",visibility:b.closer_hover?"hidden":"visible"},click:function(){a.remove(!1);c.sticker.css("visibility","hidden");c.closer.css("visibility","hidden")}}).append(d("<span />",{"class":null===b.classes.closer?a.styles.closer:b.classes.closer})).prependTo(a.container);(!b.closer||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock)&&this.closer.css("display",
|
6
|
+
"none")},update:function(a,b){!b.closer||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock?this.closer.css("display","none"):b.closer&&this.closer.css("display","block");!b.sticker||a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock?this.sticker.css("display","none"):b.sticker&&this.sticker.css("display","block");this.sticker.trigger("pnotify:buttons:toggleStick");this.closer.find("span").attr("class","").addClass(null===b.classes.closer?a.styles.closer:b.classes.closer);
|
7
|
+
b.sticker_hover?this.sticker.css("visibility","hidden"):a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock||this.sticker.css("visibility","visible");b.closer_hover?this.closer.css("visibility","hidden"):a.options.nonblock&&a.options.nonblock.nonblock&&!b.show_on_nonblock||this.closer.css("visibility","visible")}};d.extend(e.styling.brighttheme,{closer:"brighttheme-icon-closer",pin_up:"brighttheme-icon-sticker",pin_down:"brighttheme-icon-sticker brighttheme-icon-stuck"});d.extend(e.styling.jqueryui,
|
8
|
+
{closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s"});d.extend(e.styling.bootstrap2,{closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play"});d.extend(e.styling.bootstrap3,{closer:"glyphicon glyphicon-remove",pin_up:"glyphicon glyphicon-pause",pin_down:"glyphicon glyphicon-play"});d.extend(e.styling.fontawesome,{closer:"fa fa-times",pin_up:"fa fa-pause",pin_down:"fa fa-play"})});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
PNotify 3.0.0 sciactive.com/pnotify/
|
3
|
+
(C) 2015 Hunter Perrin; Google, Inc.
|
4
|
+
license Apache-2.0
|
5
|
+
*/
|
6
|
+
(function(b,k){"function"===typeof define&&define.amd?define("pnotify",["jquery"],function(q){return k(q,b)}):"object"===typeof exports&&"undefined"!==typeof module?module.exports=k(require("jquery"),global||b):b.PNotify=k(b.jQuery,b)})(this,function(b,k){var q=function(l){var k={dir1:"down",dir2:"left",push:"bottom",spacing1:36,spacing2:36,context:b("body"),modal:!1},g,h,n=b(l),r=function(){h=b("body");d.prototype.options.stack.context=h;n=b(l);n.bind("resize",function(){g&&clearTimeout(g);g=setTimeout(function(){d.positionAll(!0)},
|
7
|
+
10)})},s=function(c){var a=b("<div />",{"class":"ui-pnotify-modal-overlay"});a.prependTo(c.context);c.overlay_close&&a.click(function(){d.removeStack(c)});return a},d=function(c){this.parseOptions(c);this.init()};b.extend(d.prototype,{version:"3.0.0",options:{title:!1,title_escape:!1,text:!1,text_escape:!1,styling:"brighttheme",addclass:"",cornerclass:"",auto_display:!0,width:"300px",min_height:"16px",type:"notice",icon:!0,animation:"fade",animate_speed:"normal",shadow:!0,hide:!0,delay:8E3,mouse_reset:!0,
|
8
|
+
remove:!0,insert_brs:!0,destroy:!0,stack:k},modules:{},runModules:function(c,a){var p,b;for(b in this.modules)p="object"===typeof a&&b in a?a[b]:a,"function"===typeof this.modules[b][c]&&(this.modules[b].notice=this,this.modules[b].options="object"===typeof this.options[b]?this.options[b]:{},this.modules[b][c](this,"object"===typeof this.options[b]?this.options[b]:{},p))},state:"initializing",timer:null,animTimer:null,styles:null,elem:null,container:null,title_container:null,text_container:null,animating:!1,
|
9
|
+
timerHide:!1,init:function(){var c=this;this.modules={};b.extend(!0,this.modules,d.prototype.modules);this.styles="object"===typeof this.options.styling?this.options.styling:d.styling[this.options.styling];this.elem=b("<div />",{"class":"ui-pnotify "+this.options.addclass,css:{display:"none"},"aria-live":"assertive","aria-role":"alertdialog",mouseenter:function(a){if(c.options.mouse_reset&&"out"===c.animating){if(!c.timerHide)return;c.cancelRemove()}c.options.hide&&c.options.mouse_reset&&c.cancelRemove()},
|
10
|
+
mouseleave:function(a){c.options.hide&&c.options.mouse_reset&&"out"!==c.animating&&c.queueRemove();d.positionAll()}});"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed);this.container=b("<div />",{"class":this.styles.container+" ui-pnotify-container "+("error"===this.options.type?this.styles.error:"info"===this.options.type?this.styles.info:"success"===this.options.type?this.styles.success:this.styles.notice),role:"alert"}).appendTo(this.elem);""!==
|
11
|
+
this.options.cornerclass&&this.container.removeClass("ui-corner-all").addClass(this.options.cornerclass);this.options.shadow&&this.container.addClass("ui-pnotify-shadow");!1!==this.options.icon&&b("<div />",{"class":"ui-pnotify-icon"}).append(b("<span />",{"class":!0===this.options.icon?"error"===this.options.type?this.styles.error_icon:"info"===this.options.type?this.styles.info_icon:"success"===this.options.type?this.styles.success_icon:this.styles.notice_icon:this.options.icon})).prependTo(this.container);
|
12
|
+
this.title_container=b("<h4 />",{"class":"ui-pnotify-title"}).appendTo(this.container);!1===this.options.title?this.title_container.hide():this.options.title_escape?this.title_container.text(this.options.title):this.title_container.html(this.options.title);this.text_container=b("<div />",{"class":"ui-pnotify-text","aria-role":"alert"}).appendTo(this.container);!1===this.options.text?this.text_container.hide():this.options.text_escape?this.text_container.text(this.options.text):this.text_container.html(this.options.insert_brs?
|
13
|
+
String(this.options.text).replace(/\n/g,"<br />"):this.options.text);"string"===typeof this.options.width&&this.elem.css("width",this.options.width);"string"===typeof this.options.min_height&&this.container.css("min-height",this.options.min_height);d.notices="top"===this.options.stack.push?b.merge([this],d.notices):b.merge(d.notices,[this]);"top"===this.options.stack.push&&this.queuePosition(!1,1);this.options.stack.animation=!1;this.runModules("init");this.options.auto_display&&this.open();return this},
|
14
|
+
update:function(c){var a=this.options;this.parseOptions(a,c);this.elem.removeClass("ui-pnotify-fade-slow ui-pnotify-fade-normal ui-pnotify-fade-fast");"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-"+this.options.animate_speed);this.options.cornerclass!==a.cornerclass&&this.container.removeClass("ui-corner-all "+a.cornerclass).addClass(this.options.cornerclass);this.options.shadow!==a.shadow&&(this.options.shadow?this.container.addClass("ui-pnotify-shadow"):this.container.removeClass("ui-pnotify-shadow"));
|
15
|
+
!1===this.options.addclass?this.elem.removeClass(a.addclass):this.options.addclass!==a.addclass&&this.elem.removeClass(a.addclass).addClass(this.options.addclass);!1===this.options.title?this.title_container.slideUp("fast"):this.options.title!==a.title&&(this.options.title_escape?this.title_container.text(this.options.title):this.title_container.html(this.options.title),!1===a.title&&this.title_container.slideDown(200));!1===this.options.text?this.text_container.slideUp("fast"):this.options.text!==
|
16
|
+
a.text&&(this.options.text_escape?this.text_container.text(this.options.text):this.text_container.html(this.options.insert_brs?String(this.options.text).replace(/\n/g,"<br />"):this.options.text),!1===a.text&&this.text_container.slideDown(200));this.options.type!==a.type&&this.container.removeClass(this.styles.error+" "+this.styles.notice+" "+this.styles.success+" "+this.styles.info).addClass("error"===this.options.type?this.styles.error:"info"===this.options.type?this.styles.info:"success"===this.options.type?
|
17
|
+
this.styles.success:this.styles.notice);if(this.options.icon!==a.icon||!0===this.options.icon&&this.options.type!==a.type)this.container.find("div.ui-pnotify-icon").remove(),!1!==this.options.icon&&b("<div />",{"class":"ui-pnotify-icon"}).append(b("<span />",{"class":!0===this.options.icon?"error"===this.options.type?this.styles.error_icon:"info"===this.options.type?this.styles.info_icon:"success"===this.options.type?this.styles.success_icon:this.styles.notice_icon:this.options.icon})).prependTo(this.container);
|
18
|
+
this.options.width!==a.width&&this.elem.animate({width:this.options.width});this.options.min_height!==a.min_height&&this.container.animate({minHeight:this.options.min_height});this.options.hide?a.hide||this.queueRemove():this.cancelRemove();this.queuePosition(!0);this.runModules("update",a);return this},open:function(){this.state="opening";this.runModules("beforeOpen");var c=this;this.elem.parent().length||this.elem.appendTo(this.options.stack.context?this.options.stack.context:h);"top"!==this.options.stack.push&&
|
19
|
+
this.position(!0);this.animateIn(function(){c.queuePosition(!0);c.options.hide&&c.queueRemove();c.state="open";c.runModules("afterOpen")});return this},remove:function(c){this.state="closing";this.timerHide=!!c;this.runModules("beforeClose");var a=this;this.timer&&(l.clearTimeout(this.timer),this.timer=null);this.animateOut(function(){a.state="closed";a.runModules("afterClose");a.queuePosition(!0);a.options.remove&&a.elem.detach();a.runModules("beforeDestroy");if(a.options.destroy&&null!==d.notices){var c=
|
20
|
+
b.inArray(a,d.notices);-1!==c&&d.notices.splice(c,1)}a.runModules("afterDestroy")});return this},get:function(){return this.elem},parseOptions:function(c,a){this.options=b.extend(!0,{},d.prototype.options);this.options.stack=d.prototype.options.stack;for(var p=[c,a],m,f=0;f<p.length;f++){m=p[f];if("undefined"===typeof m)break;if("object"!==typeof m)this.options.text=m;else for(var e in m)this.modules[e]?b.extend(!0,this.options[e],m[e]):this.options[e]=m[e]}},animateIn:function(c){this.animating=
|
21
|
+
"in";var a=this;c=function(){a.animTimer&&clearTimeout(a.animTimer);"in"===a.animating&&(a.elem.is(":visible")?(this&&this.call(),a.animating=!1):a.animTimer=setTimeout(c,40))}.bind(c);"fade"===this.options.animation?(this.elem.one("webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend",c).addClass("ui-pnotify-in"),this.elem.css("opacity"),this.elem.addClass("ui-pnotify-fade-in"),this.animTimer=setTimeout(c,650)):(this.elem.addClass("ui-pnotify-in"),c())},animateOut:function(c){this.animating=
|
22
|
+
"out";var a=this;c=function(){a.animTimer&&clearTimeout(a.animTimer);"out"===a.animating&&("0"!=a.elem.css("opacity")&&a.elem.is(":visible")?a.animTimer=setTimeout(c,40):(a.elem.removeClass("ui-pnotify-in"),this&&this.call(),a.animating=!1))}.bind(c);"fade"===this.options.animation?(this.elem.one("webkitTransitionEnd mozTransitionEnd MSTransitionEnd oTransitionEnd transitionend",c).removeClass("ui-pnotify-fade-in"),this.animTimer=setTimeout(c,650)):(this.elem.removeClass("ui-pnotify-in"),c())},position:function(c){var a=
|
23
|
+
this.options.stack,b=this.elem;"undefined"===typeof a.context&&(a.context=h);if(a){"number"!==typeof a.nextpos1&&(a.nextpos1=a.firstpos1);"number"!==typeof a.nextpos2&&(a.nextpos2=a.firstpos2);"number"!==typeof a.addpos2&&(a.addpos2=0);var d=!b.hasClass("ui-pnotify-in");if(!d||c){a.modal&&(a.overlay?a.overlay.show():a.overlay=s(a));b.addClass("ui-pnotify-move");var f;switch(a.dir1){case "down":f="top";break;case "up":f="bottom";break;case "left":f="right";break;case "right":f="left"}c=parseInt(b.css(f).replace(/(?:\..*|[^0-9.])/g,
|
24
|
+
""));isNaN(c)&&(c=0);"undefined"!==typeof a.firstpos1||d||(a.firstpos1=c,a.nextpos1=a.firstpos1);var e;switch(a.dir2){case "down":e="top";break;case "up":e="bottom";break;case "left":e="right";break;case "right":e="left"}c=parseInt(b.css(e).replace(/(?:\..*|[^0-9.])/g,""));isNaN(c)&&(c=0);"undefined"!==typeof a.firstpos2||d||(a.firstpos2=c,a.nextpos2=a.firstpos2);if("down"===a.dir1&&a.nextpos1+b.height()>(a.context.is(h)?n.height():a.context.prop("scrollHeight"))||"up"===a.dir1&&a.nextpos1+b.height()>
|
25
|
+
(a.context.is(h)?n.height():a.context.prop("scrollHeight"))||"left"===a.dir1&&a.nextpos1+b.width()>(a.context.is(h)?n.width():a.context.prop("scrollWidth"))||"right"===a.dir1&&a.nextpos1+b.width()>(a.context.is(h)?n.width():a.context.prop("scrollWidth")))a.nextpos1=a.firstpos1,a.nextpos2+=a.addpos2+("undefined"===typeof a.spacing2?25:a.spacing2),a.addpos2=0;"number"===typeof a.nextpos2&&(a.animation?b.css(e,a.nextpos2+"px"):(b.removeClass("ui-pnotify-move"),b.css(e,a.nextpos2+"px"),b.css(e),b.addClass("ui-pnotify-move")));
|
26
|
+
switch(a.dir2){case "down":case "up":b.outerHeight(!0)>a.addpos2&&(a.addpos2=b.height());break;case "left":case "right":b.outerWidth(!0)>a.addpos2&&(a.addpos2=b.width())}"number"===typeof a.nextpos1&&(a.animation?b.css(f,a.nextpos1+"px"):(b.removeClass("ui-pnotify-move"),b.css(f,a.nextpos1+"px"),b.css(f),b.addClass("ui-pnotify-move")));switch(a.dir1){case "down":case "up":a.nextpos1+=b.height()+("undefined"===typeof a.spacing1?25:a.spacing1);break;case "left":case "right":a.nextpos1+=b.width()+("undefined"===
|
27
|
+
typeof a.spacing1?25:a.spacing1)}}return this}},queuePosition:function(b,a){g&&clearTimeout(g);a||(a=10);g=setTimeout(function(){d.positionAll(b)},a);return this},cancelRemove:function(){this.timer&&l.clearTimeout(this.timer);this.animTimer&&l.clearTimeout(this.animTimer);"closing"===this.state&&(this.state="open",this.animating=!1,this.elem.addClass("ui-pnotify-in"),"fade"===this.options.animation&&this.elem.addClass("ui-pnotify-fade-in"));return this},queueRemove:function(){var b=this;this.cancelRemove();
|
28
|
+
this.timer=l.setTimeout(function(){b.remove(!0)},isNaN(this.options.delay)?0:this.options.delay);return this}});b.extend(d,{notices:[],reload:q,removeAll:function(){b.each(d.notices,function(){this.remove&&this.remove(!1)})},removeStack:function(c){b.each(d.notices,function(){this.remove&&this.options.stack===c&&this.remove(!1)})},positionAll:function(c){g&&clearTimeout(g);g=null;if(d.notices&&d.notices.length)b.each(d.notices,function(){var a=this.options.stack;a&&(a.overlay&&a.overlay.hide(),a.nextpos1=
|
29
|
+
a.firstpos1,a.nextpos2=a.firstpos2,a.addpos2=0,a.animation=c)}),b.each(d.notices,function(){this.position()});else{var a=d.prototype.options.stack;a&&(delete a.nextpos1,delete a.nextpos2)}},styling:{brighttheme:{container:"brighttheme",notice:"brighttheme-notice",notice_icon:"brighttheme-icon-notice",info:"brighttheme-info",info_icon:"brighttheme-icon-info",success:"brighttheme-success",success_icon:"brighttheme-icon-success",error:"brighttheme-error",error_icon:"brighttheme-icon-error"},jqueryui:{container:"ui-widget ui-widget-content ui-corner-all",
|
30
|
+
notice:"ui-state-highlight",notice_icon:"ui-icon ui-icon-info",info:"",info_icon:"ui-icon ui-icon-info",success:"ui-state-default",success_icon:"ui-icon ui-icon-circle-check",error:"ui-state-error",error_icon:"ui-icon ui-icon-alert"},bootstrap3:{container:"alert",notice:"alert-warning",notice_icon:"glyphicon glyphicon-exclamation-sign",info:"alert-info",info_icon:"glyphicon glyphicon-info-sign",success:"alert-success",success_icon:"glyphicon glyphicon-ok-sign",error:"alert-danger",error_icon:"glyphicon glyphicon-warning-sign"}}});
|
31
|
+
d.styling.fontawesome=b.extend({},d.styling.bootstrap3);b.extend(d.styling.fontawesome,{notice_icon:"fa fa-exclamation-circle",info_icon:"fa fa-info",success_icon:"fa fa-check",error_icon:"fa fa-warning"});l.document.body?r():b(r);return d};return q(k)});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
(function(h,f){"function"===typeof define&&define.amd?define("pnotify.nonblock",["jquery","pnotify"],f):"object"===typeof exports&&"undefined"!==typeof module?module.exports=f(require("jquery"),require("./pnotify")):f(h.jQuery,h.PNotify)})(this,function(h,f){var l=/^on/,m=/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,n=/^(focus|blur|select|change|reset)$|^key(press|down|up)$/,p=/^(scroll|resize|(un)?load|abort|error)$/,k=function(c,b){var d;c=c.toLowerCase();document.createEvent&&
|
2
|
+
this.dispatchEvent?(c=c.replace(l,""),c.match(m)?(h(this).offset(),d=document.createEvent("MouseEvents"),d.initMouseEvent(c,b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)):c.match(n)?(d=document.createEvent("UIEvents"),d.initUIEvent(c,b.bubbles,b.cancelable,b.view,b.detail)):c.match(p)&&(d=document.createEvent("HTMLEvents"),d.initEvent(c,b.bubbles,b.cancelable)),d&&this.dispatchEvent(d)):(c.match(l)||
|
3
|
+
(c="on"+c),d=document.createEventObject(b),this.fireEvent(c,d))},g,e=function(c,b,d){c.elem.addClass("ui-pnotify-nonblock-hide");var a=document.elementFromPoint(b.clientX,b.clientY);c.elem.removeClass("ui-pnotify-nonblock-hide");var f=h(a),e=f.css("cursor");"auto"===e&&"A"===a.tagName&&(e="pointer");c.elem.css("cursor","auto"!==e?e:"default");g&&g.get(0)==a||(g&&(k.call(g.get(0),"mouseleave",b.originalEvent),k.call(g.get(0),"mouseout",b.originalEvent)),k.call(a,"mouseenter",b.originalEvent),k.call(a,
|
4
|
+
"mouseover",b.originalEvent));k.call(a,d,b.originalEvent);g=f};f.prototype.options.nonblock={nonblock:!1};f.prototype.modules.nonblock={init:function(c,b){var d=this;c.elem.on({mouseenter:function(a){d.options.nonblock&&a.stopPropagation();d.options.nonblock&&c.elem.addClass("ui-pnotify-nonblock-fade")},mouseleave:function(a){d.options.nonblock&&a.stopPropagation();g=null;c.elem.css("cursor","auto");d.options.nonblock&&"out"!==c.animating&&c.elem.removeClass("ui-pnotify-nonblock-fade")},mouseover:function(a){d.options.nonblock&&
|
5
|
+
a.stopPropagation()},mouseout:function(a){d.options.nonblock&&a.stopPropagation()},mousemove:function(a){d.options.nonblock&&(a.stopPropagation(),e(c,a,"onmousemove"))},mousedown:function(a){d.options.nonblock&&(a.stopPropagation(),a.preventDefault(),e(c,a,"onmousedown"))},mouseup:function(a){d.options.nonblock&&(a.stopPropagation(),a.preventDefault(),e(c,a,"onmouseup"))},click:function(a){d.options.nonblock&&(a.stopPropagation(),e(c,a,"onclick"))},dblclick:function(a){d.options.nonblock&&(a.stopPropagation(),
|
6
|
+
e(c,a,"ondblclick"))}})}}});
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#= require prettify/prettify
|
2
|
+
#= require prettify/lang-apollo
|
3
|
+
#= require prettify/lang-basic
|
4
|
+
#= require prettify/lang-clj
|
5
|
+
#= require prettify/lang-css
|
6
|
+
#= require prettify/lang-dart
|
7
|
+
#= require prettify/lang-erlang
|
8
|
+
#= require prettify/lang-go
|
9
|
+
#= require prettify/lang-hs
|
10
|
+
#= require prettify/lang-lisp
|
11
|
+
#= require prettify/lang-llvm
|
12
|
+
#= require prettify/lang-lua
|
13
|
+
#= require prettify/lang-matlab
|
14
|
+
#= require prettify/lang-ml
|
15
|
+
#= require prettify/lang-mumps
|
16
|
+
#= require prettify/lang-n
|
17
|
+
#= require prettify/lang-pascal
|
18
|
+
#= require prettify/lang-proto
|
19
|
+
#= require prettify/lang-r
|
20
|
+
#= require prettify/lang-rd
|
21
|
+
#= require prettify/lang-scala
|
22
|
+
#= require prettify/lang-sql
|
23
|
+
#= require prettify/lang-tcl
|
24
|
+
#= require prettify/lang-tex
|
25
|
+
#= require prettify/lang-vb
|
26
|
+
#= require prettify/lang-vhdl
|
27
|
+
#= require prettify/lang-wiki
|
28
|
+
#= require prettify/lang-xq
|
29
|
+
#= require prettify/lang-yaml
|
@@ -0,0 +1,51 @@
|
|
1
|
+
// Copyright (C) 2009 Onno Hommes.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @fileoverview
|
18
|
+
* Registers a language handler for the AGC/AEA Assembly Language as described
|
19
|
+
* at http://virtualagc.googlecode.com
|
20
|
+
* <p>
|
21
|
+
* This file could be used by goodle code to allow syntax highlight for
|
22
|
+
* Virtual AGC SVN repository or if you don't want to commonize
|
23
|
+
* the header for the agc/aea html assembly listing.
|
24
|
+
*
|
25
|
+
* @author ohommes@alumni.cmu.edu
|
26
|
+
*/
|
27
|
+
|
28
|
+
PR['registerLangHandler'](
|
29
|
+
PR['createSimpleLexer'](
|
30
|
+
[
|
31
|
+
// A line comment that starts with ;
|
32
|
+
[PR['PR_COMMENT'], /^#[^\r\n]*/, null, '#'],
|
33
|
+
// Whitespace
|
34
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
35
|
+
// A double quoted, possibly multi-line, string.
|
36
|
+
[PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
|
37
|
+
],
|
38
|
+
[
|
39
|
+
[PR['PR_KEYWORD'], /^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,null],
|
40
|
+
[PR['PR_TYPE'], /^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],
|
41
|
+
// A single quote possibly followed by a word that optionally ends with
|
42
|
+
// = ! or ?.
|
43
|
+
[PR['PR_LITERAL'],
|
44
|
+
/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
|
45
|
+
// Any word including labels that optionally ends with = ! or ?.
|
46
|
+
[PR['PR_PLAIN'],
|
47
|
+
/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],
|
48
|
+
// A printable non-space non-special character
|
49
|
+
[PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0()\"\\\';]+/]
|
50
|
+
]),
|
51
|
+
['apollo', 'agc', 'aea']);
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Contributed by peter dot kofler at code minus cop dot org
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @fileoverview
|
5
|
+
* Registers a language handler for Basic.
|
6
|
+
*
|
7
|
+
* To use, include prettify.js and this file in your HTML page.
|
8
|
+
* Then put your code in an HTML tag like
|
9
|
+
* <pre class="prettyprint lang-basic">(my BASIC code)</pre>
|
10
|
+
*
|
11
|
+
* @author peter dot kofler at code minus cop dot org
|
12
|
+
*/
|
13
|
+
|
14
|
+
PR.registerLangHandler(
|
15
|
+
PR.createSimpleLexer(
|
16
|
+
[ // shortcutStylePatterns
|
17
|
+
// "single-line-string"
|
18
|
+
[PR.PR_STRING, /^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/, null, '"'],
|
19
|
+
// Whitespace
|
20
|
+
[PR.PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0']
|
21
|
+
],
|
22
|
+
[ // fallthroughStylePatterns
|
23
|
+
// A line comment that starts with REM
|
24
|
+
[PR.PR_COMMENT, /^REM[^\r\n]*/, null],
|
25
|
+
[PR.PR_KEYWORD, /^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/, null],
|
26
|
+
[PR.PR_PLAIN, /^[A-Z][A-Z0-9]?(?:\$|%)?/i, null],
|
27
|
+
// Literals .0, 0, 0.0 0E13
|
28
|
+
[PR.PR_LITERAL, /^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, null, '0123456789'],
|
29
|
+
[PR.PR_PUNCTUATION, /^.[^\s\w\.$%"]*/, null]
|
30
|
+
// [PR.PR_PUNCTUATION, /^[-,:;!<>=\+^\/\*]+/]
|
31
|
+
]),
|
32
|
+
['basic','cbm']);
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (C) 2011 Google Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for Clojure.
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-lisp">(my lisp code)</pre>
|
25
|
+
* The lang-cl class identifies the language as common lisp.
|
26
|
+
* This file supports the following language extensions:
|
27
|
+
* lang-clj - Clojure
|
28
|
+
*
|
29
|
+
*
|
30
|
+
* I used lang-lisp.js as the basis for this adding the clojure specific
|
31
|
+
* keywords and syntax.
|
32
|
+
*
|
33
|
+
* "Name" = 'Clojure'
|
34
|
+
* "Author" = 'Rich Hickey'
|
35
|
+
* "Version" = '1.2'
|
36
|
+
* "About" = 'Clojure is a lisp for the jvm with concurrency primitives and a richer set of types.'
|
37
|
+
*
|
38
|
+
*
|
39
|
+
* I used <a href="http://clojure.org/Reference">Clojure.org Reference</a> as
|
40
|
+
* the basis for the reserved word list.
|
41
|
+
*
|
42
|
+
*
|
43
|
+
* @author jwall@google.com
|
44
|
+
*/
|
45
|
+
|
46
|
+
PR['registerLangHandler'](
|
47
|
+
PR['createSimpleLexer'](
|
48
|
+
[
|
49
|
+
// clojure has more paren types than minimal lisp.
|
50
|
+
['opn', /^[\(\{\[]+/, null, '([{'],
|
51
|
+
['clo', /^[\)\}\]]+/, null, ')]}'],
|
52
|
+
// A line comment that starts with ;
|
53
|
+
[PR['PR_COMMENT'], /^;[^\r\n]*/, null, ';'],
|
54
|
+
// Whitespace
|
55
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
56
|
+
// A double quoted, possibly multi-line, string.
|
57
|
+
[PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
|
58
|
+
],
|
59
|
+
[
|
60
|
+
// clojure has a much larger set of keywords
|
61
|
+
[PR['PR_KEYWORD'], /^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, null],
|
62
|
+
[PR['PR_TYPE'], /^:[0-9a-zA-Z\-]+/]
|
63
|
+
]),
|
64
|
+
['clj']);
|
@@ -0,0 +1,159 @@
|
|
1
|
+
// Copyright (C) 2009 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler for CSS.
|
20
|
+
*
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-css"></pre>
|
25
|
+
*
|
26
|
+
*
|
27
|
+
* http://www.w3.org/TR/CSS21/grammar.html Section G2 defines the lexical
|
28
|
+
* grammar. This scheme does not recognize keywords containing escapes.
|
29
|
+
*
|
30
|
+
* @author mikesamuel@gmail.com
|
31
|
+
*/
|
32
|
+
|
33
|
+
// This file is a call to a function defined in prettify.js which defines a
|
34
|
+
// lexical scanner for CSS and maps tokens to styles.
|
35
|
+
|
36
|
+
// The call to PR['registerLangHandler'] is quoted so that Closure Compiler
|
37
|
+
// will not rename the call so that this language extensions can be
|
38
|
+
// compiled/minified separately from one another. Other symbols defined in
|
39
|
+
// prettify.js are similarly quoted.
|
40
|
+
|
41
|
+
// The call is structured thus:
|
42
|
+
// PR['registerLangHandler'](
|
43
|
+
// PR['createSimpleLexer'](
|
44
|
+
// shortcutPatterns,
|
45
|
+
// fallThroughPatterns),
|
46
|
+
// [languageId0, ..., languageIdN])
|
47
|
+
|
48
|
+
// Langugage IDs
|
49
|
+
// =============
|
50
|
+
// The language IDs are typically the file extensions of source files for
|
51
|
+
// that language so that users can syntax highlight arbitrary files based
|
52
|
+
// on just the extension. This is heuristic, but works pretty well in
|
53
|
+
// practice.
|
54
|
+
|
55
|
+
// Patterns
|
56
|
+
// ========
|
57
|
+
// Lexers are typically implemented as a set of regular expressions.
|
58
|
+
// The SimpleLexer function takes regular expressions, styles, and some
|
59
|
+
// pragma-info and produces a lexer. A token description looks like
|
60
|
+
// [STYLE_NAME, /regular-expression/, pragmas]
|
61
|
+
|
62
|
+
// Initially, simple lexer's inner loop looked like:
|
63
|
+
|
64
|
+
// while sourceCode is not empty:
|
65
|
+
// try each regular expression in order until one matches
|
66
|
+
// remove the matched portion from sourceCode
|
67
|
+
|
68
|
+
// This was really slow for large files because some JS interpreters
|
69
|
+
// do a buffer copy on the matched portion which is O(n*n)
|
70
|
+
|
71
|
+
// The current loop now looks like
|
72
|
+
|
73
|
+
// 1. use js-modules/combinePrefixPatterns.js to
|
74
|
+
// combine all regular expressions into one
|
75
|
+
// 2. use a single global regular expresion match to extract all tokens
|
76
|
+
// 3. for each token try regular expressions in order until one matches it
|
77
|
+
// and classify it using the associated style
|
78
|
+
|
79
|
+
// This is a lot more efficient but it does mean that lookahead and lookbehind
|
80
|
+
// can't be used across boundaries to classify tokens.
|
81
|
+
|
82
|
+
// Sometimes we need lookahead and lookbehind and sometimes we want to handle
|
83
|
+
// embedded language -- JavaScript or CSS embedded in HTML, or inline assembly
|
84
|
+
// in C.
|
85
|
+
|
86
|
+
// If a particular pattern has a numbered group, and its style pattern starts
|
87
|
+
// with "lang-" as in
|
88
|
+
// ['lang-js', /<script>(.*?)<\/script>/]
|
89
|
+
// then the token classification step breaks the token into pieces.
|
90
|
+
// Group 1 is re-parsed using the language handler for "lang-js", and the
|
91
|
+
// surrounding portions are reclassified using the current language handler.
|
92
|
+
// This mechanism gives us both lookahead, lookbehind, and language embedding.
|
93
|
+
|
94
|
+
// Shortcut Patterns
|
95
|
+
// =================
|
96
|
+
// A shortcut pattern is one that is tried before other patterns if the first
|
97
|
+
// character in the token is in the string of characters.
|
98
|
+
// This very effectively lets us make quick correct decisions for common token
|
99
|
+
// types.
|
100
|
+
|
101
|
+
// All other patterns are fall-through patterns.
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
// The comments inline below refer to productions in the CSS specification's
|
106
|
+
// lexical grammar. See link above.
|
107
|
+
PR['registerLangHandler'](
|
108
|
+
PR['createSimpleLexer'](
|
109
|
+
// Shortcut patterns.
|
110
|
+
[
|
111
|
+
// The space production <s>
|
112
|
+
[PR['PR_PLAIN'], /^[ \t\r\n\f]+/, null, ' \t\r\n\f']
|
113
|
+
],
|
114
|
+
// Fall-through patterns.
|
115
|
+
[
|
116
|
+
// Quoted strings. <string1> and <string2>
|
117
|
+
[PR['PR_STRING'],
|
118
|
+
/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null],
|
119
|
+
[PR['PR_STRING'],
|
120
|
+
/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null],
|
121
|
+
['lang-css-str', /^url\(([^\)\"\']+)\)/i],
|
122
|
+
[PR['PR_KEYWORD'],
|
123
|
+
/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,
|
124
|
+
null],
|
125
|
+
// A property name -- an identifier followed by a colon.
|
126
|
+
['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],
|
127
|
+
// A C style block comment. The <comment> production.
|
128
|
+
[PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
|
129
|
+
// Escaping text spans
|
130
|
+
[PR['PR_COMMENT'], /^(?:<!--|-->)/],
|
131
|
+
// A number possibly containing a suffix.
|
132
|
+
[PR['PR_LITERAL'], /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
|
133
|
+
// A hex color
|
134
|
+
[PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}\b/i],
|
135
|
+
// An identifier
|
136
|
+
[PR['PR_PLAIN'],
|
137
|
+
/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],
|
138
|
+
// A run of punctuation
|
139
|
+
[PR['PR_PUNCTUATION'], /^[^\s\w\'\"]+/]
|
140
|
+
]),
|
141
|
+
['css']);
|
142
|
+
// Above we use embedded languages to highlight property names (identifiers
|
143
|
+
// followed by a colon) differently from identifiers in values.
|
144
|
+
PR['registerLangHandler'](
|
145
|
+
PR['createSimpleLexer']([],
|
146
|
+
[
|
147
|
+
[PR['PR_KEYWORD'],
|
148
|
+
/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]
|
149
|
+
]),
|
150
|
+
['css-kw']);
|
151
|
+
// The content of an unquoted URL literal like url(http://foo/img.png) should
|
152
|
+
// be colored as string content. This language handler is used above in the
|
153
|
+
// URL production to do so.
|
154
|
+
PR['registerLangHandler'](
|
155
|
+
PR['createSimpleLexer']([],
|
156
|
+
[
|
157
|
+
[PR['PR_STRING'], /^[^\)\"\']+/]
|
158
|
+
]),
|
159
|
+
['css-str']);
|
@@ -0,0 +1,88 @@
|
|
1
|
+
// Copyright (C) 2013 Google Inc.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @fileoverview
|
19
|
+
* Registers a language handler Dart.
|
20
|
+
* Loosely structured based on the DartLexer in Pygments: http://pygments.org/.
|
21
|
+
*
|
22
|
+
* To use, include prettify.js and this file in your HTML page.
|
23
|
+
* Then put your code in an HTML tag like
|
24
|
+
* <pre class="prettyprint lang-dart">(Dart code)</pre>
|
25
|
+
*
|
26
|
+
* @author armstrong.timothy@gmail.com
|
27
|
+
*/
|
28
|
+
|
29
|
+
PR['registerLangHandler'](
|
30
|
+
PR['createSimpleLexer'](
|
31
|
+
[
|
32
|
+
// Whitespace.
|
33
|
+
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
|
34
|
+
],
|
35
|
+
[
|
36
|
+
// Script tag.
|
37
|
+
[PR['PR_COMMENT'], /^#!(?:.*)/],
|
38
|
+
|
39
|
+
// `import`, `library`, `part of`, `part`, `as`, `show`, and `hide`
|
40
|
+
// keywords.
|
41
|
+
[PR['PR_KEYWORD'], /^\b(?:import|library|part of|part|as|show|hide)\b/i],
|
42
|
+
|
43
|
+
// Single-line comments.
|
44
|
+
[PR['PR_COMMENT'], /^\/\/(?:.*)/],
|
45
|
+
|
46
|
+
// Multiline comments.
|
47
|
+
[PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], // */
|
48
|
+
|
49
|
+
// `class` and `interface` keywords.
|
50
|
+
[PR['PR_KEYWORD'], /^\b(?:class|interface)\b/i],
|
51
|
+
|
52
|
+
// General keywords.
|
53
|
+
[PR['PR_KEYWORD'], /^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],
|
54
|
+
|
55
|
+
// Declaration keywords.
|
56
|
+
[PR['PR_KEYWORD'], /^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i],
|
57
|
+
|
58
|
+
// Keywords for types.
|
59
|
+
[PR['PR_TYPE'], /^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],
|
60
|
+
|
61
|
+
// Keywords for constants.
|
62
|
+
[PR['PR_KEYWORD'], /^\b(?:false|null|true)\b/i],
|
63
|
+
|
64
|
+
// Multiline strings, single- and double-quoted.
|
65
|
+
[PR['PR_STRING'], /^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],
|
66
|
+
[PR['PR_STRING'], /^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],
|
67
|
+
|
68
|
+
// Normal and raw strings, single- and double-quoted.
|
69
|
+
[PR['PR_STRING'], /^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],
|
70
|
+
[PR['PR_STRING'], /^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],
|
71
|
+
|
72
|
+
// Identifiers.
|
73
|
+
[PR['PR_PLAIN'], /^[a-z_$][a-z0-9_]*/i],
|
74
|
+
|
75
|
+
// Operators.
|
76
|
+
[PR['PR_PUNCTUATION'], /^[~!%^&*+=|?:<>/-]/],
|
77
|
+
|
78
|
+
// Hex numbers.
|
79
|
+
[PR['PR_LITERAL'], /^\b0x[0-9a-f]+/i],
|
80
|
+
|
81
|
+
// Decimal numbers.
|
82
|
+
[PR['PR_LITERAL'], /^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],
|
83
|
+
[PR['PR_LITERAL'], /^\b\.\d+(?:e[+-]?\d+)?/i],
|
84
|
+
|
85
|
+
// Punctuation.
|
86
|
+
[PR['PR_PUNCTUATION'], /^[(){}\[\],.;]/]
|
87
|
+
]),
|
88
|
+
['dart']);
|