weaver 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/weaver/css/bootstrap.css +647 -205
- data/data/weaver/css/bootstrap.css.map +1 -0
- data/data/weaver/css/bootstrap.min.css +3 -3
- data/data/weaver/css/crossfade_style.css +19 -0
- data/data/weaver/css/patterns/1.png +0 -0
- data/data/weaver/css/patterns/2.png +0 -0
- data/data/weaver/css/patterns/3.png +0 -0
- data/data/weaver/css/patterns/4.png +0 -0
- data/data/weaver/css/patterns/5.png +0 -0
- data/data/weaver/css/patterns/6.png +0 -0
- data/data/weaver/css/patterns/7.png +0 -0
- data/data/weaver/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css +251 -0
- data/data/weaver/css/plugins/chartist/chartist.min.css +773 -0
- data/data/weaver/css/plugins/clockpicker/clockpicker.css +168 -0
- data/data/weaver/css/plugins/dataTables/dataTables.bootstrap.css +118 -190
- data/data/weaver/css/plugins/dataTables/dataTables.tableTools.min.css +1 -1
- data/data/weaver/css/plugins/daterangepicker/daterangepicker-bs3.css +335 -0
- data/data/weaver/css/plugins/footable/fonts/footable.eot +0 -0
- data/data/weaver/css/plugins/footable/fonts/footable.svg +78 -0
- data/data/weaver/css/plugins/footable/fonts/footable.ttf +0 -0
- data/data/weaver/css/plugins/footable/fonts/footable.woff +0 -0
- data/data/weaver/css/plugins/footable/footable.core.css +178 -0
- data/data/weaver/css/plugins/select2/select2.min.css +1 -0
- data/data/weaver/css/plugins/slick/ajax-loader.gif +0 -0
- data/data/weaver/css/plugins/slick/fonts/slick.eot +0 -0
- data/data/weaver/css/plugins/slick/fonts/slick.svg +14 -0
- data/data/weaver/css/plugins/slick/fonts/slick.ttf +0 -0
- data/data/weaver/css/plugins/slick/fonts/slick.woff +0 -0
- data/data/weaver/css/plugins/slick/slick-theme.css +201 -0
- data/data/weaver/css/plugins/slick/slick.css +119 -0
- data/data/weaver/css/plugins/sweetalert/sweetalert.css +715 -0
- data/data/weaver/css/style.css +4352 -1310
- data/data/weaver/css/style.min.css +1 -1
- data/data/weaver/fonts/glyphicons-halflings-regular.eot +0 -0
- data/data/weaver/fonts/glyphicons-halflings-regular.svg +273 -214
- data/data/weaver/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/data/weaver/fonts/glyphicons-halflings-regular.woff +0 -0
- data/data/weaver/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/data/weaver/js/bootstrap.js +299 -212
- data/data/weaver/js/bootstrap.min.js +5 -5
- data/data/weaver/js/inspinia.js +184 -42
- data/data/weaver/js/plugins/chartist/chartist.min.js +9 -0
- data/data/weaver/js/plugins/chartist/chartist.min.js.map +1 -0
- data/data/weaver/js/plugins/clockpicker/clockpicker.js +729 -0
- data/data/weaver/js/plugins/dataTables/dataTables.bootstrap.js +195 -234
- data/data/weaver/js/plugins/dataTables/dataTables.tableTools.min.js +46 -45
- data/data/weaver/js/plugins/dataTables/jquery.dataTables.js +628 -373
- data/data/weaver/js/plugins/dataTables/swf/copy_csv_xls.swf +0 -0
- data/data/weaver/js/plugins/dataTables/swf/copy_csv_xls_pdf.swf +0 -0
- data/data/weaver/js/plugins/daterangepicker/daterangepicker.js +1304 -0
- data/data/weaver/js/plugins/diff_match_patch/COPYING +177 -0
- data/data/weaver/js/plugins/diff_match_patch/README.txt +43 -0
- data/data/weaver/js/plugins/diff_match_patch/javascript/diff_match_patch.js +49 -0
- data/data/weaver/js/plugins/footable/footable.all.min.js +14 -0
- data/data/weaver/js/plugins/fullcalendar/moment.min.js +3 -3
- data/data/weaver/js/plugins/idle-timer/idle-timer.min.js +2 -0
- data/data/weaver/js/plugins/jvectormap/jquery-jvectormap-2.0.2.css +130 -0
- data/data/weaver/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js +3328 -0
- data/data/weaver/js/plugins/masonary/masonry.pkgd.min.js +9 -0
- data/data/weaver/js/plugins/metisMenu/jquery.metisMenu.js +3 -113
- data/data/weaver/js/plugins/morris/morris.js +27 -23
- data/data/weaver/js/plugins/pace/pace.min.js +2 -2
- data/data/weaver/js/plugins/preetyTextDiff/jquery.pretty-text-diff.min.js +76 -0
- data/data/weaver/js/plugins/select2/select2.full.min.js +3 -0
- data/data/weaver/js/plugins/slick/slick.min.js +18 -0
- data/data/weaver/js/plugins/slimscroll/jquery.slimscroll.js +96 -90
- data/data/weaver/js/plugins/slimscroll/jquery.slimscroll.min.js +10 -10
- data/data/weaver/js/plugins/sweetalert/sweetalert.min.js +1 -0
- data/data/weaver/js/plugins/tinycon/tinycon.min.js +8 -0
- data/data/weaver/js/plugins/wow/wow.min.js +2 -0
- data/{bin → exe}/weaver +3 -2
- data/lib/weaver.rb +236 -53
- data/lib/weaver/version.rb +1 -1
- data/weaver.gemspec +2 -2
- metadata +50 -7
- data/data/weaver/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js +0 -8
@@ -2,15 +2,15 @@
|
|
2
2
|
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
3
|
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4
4
|
*
|
5
|
-
* Version: 1.3.
|
5
|
+
* Version: 1.3.6
|
6
6
|
*
|
7
7
|
*/
|
8
|
-
(function(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
(function(e){e.fn.extend({slimScroll:function(g){var a=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},g);this.each(function(){function v(d){if(r){d=d||window.event;
|
9
|
+
var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);e(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,e,g){k=!1;var f=d,h=b.outerHeight()-c.outerHeight();e&&(f=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),f=Math.min(Math.max(f,0),h),f=0<d?Math.ceil(f):Math.floor(f),c.css({top:f+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());
|
10
|
+
f=l*(b[0].scrollHeight-b.outerHeight());g&&(f=d,d=f/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),h),c.css({top:d+"px"}));b.scrollTop(f);b.trigger("slimscrolling",~~f);w();p()}function x(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),30);c.css({height:u+"px"});var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function w(){x();clearTimeout(B);l==~~l?(k=a.allowPageScroll,C!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;C=l;u>=b.outerHeight()?k=!0:(c.stop(!0,
|
11
|
+
!0).fadeIn("fast"),a.railVisible&&h.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(B=setTimeout(function(){a.disableFadeOut&&r||y||z||(c.fadeOut("slow"),h.fadeOut("slow"))},1E3))}var r,y,z,B,A,u,l,C,k=!1,b=e(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),c=b.closest("."+a.barClass),h=b.closest("."+a.railClass);x();if(e.isPlainObject(g)){if("height"in g&&"auto"==g.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",
|
12
|
+
q);b.css("height",q)}if("scrollTo"in g)n=parseInt(a.scrollTo);else if("scrollBy"in g)n+=parseInt(a.scrollBy);else if("destroy"in g){c.remove();h.remove();b.unwrap();return}m(n,!1,!0)}}else if(!(e.isPlainObject(g)&&"destroy"in g)){a.height="auto"==a.height?b.parent().height():a.height;n=e("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var h=e("<div></div>").addClass(a.railClass).css({width:a.size,
|
13
|
+
height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=e("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?
|
14
|
+
{right:a.distance}:{left:a.distance};h.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(h);a.railDraggable&&c.bind("mousedown",function(a){var b=e(document);z=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});b.bind("mouseup.slimscroll",function(a){z=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});
|
15
|
+
h.hover(function(){w()},function(){p()});c.hover(function(){y=!0},function(){y=!1});b.hover(function(){r=!0;w();p()},function(){r=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(A=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(m((A-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),A=b.originalEvent.touches[0].pageY)});x();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),
|
16
|
+
m(0,!0)):"top"!==a.start&&(m(e(a.start).position().top,null,!0),a.alwaysVisible||c.hide());window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)}});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t,n){"use strict";!function o(e,t,n){function a(s,l){if(!t[s]){if(!e[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return a(n?n:t)},c,c.exports,o,e,t,n)}return t[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(o){var a,r,s,l,i=function(e){return e&&e.__esModule?e:{"default":e}},u=o("./modules/handle-dom"),c=o("./modules/utils"),d=o("./modules/handle-swal-dom"),f=o("./modules/handle-click"),p=o("./modules/handle-key"),m=i(p),v=o("./modules/default-params"),y=i(v),h=o("./modules/set-params"),g=i(h);s=l=function(){function o(e){var t=s;return t[e]===n?y["default"][e]:t[e]}var s=arguments[0];if(u.addClass(t.body,"stop-scrolling"),d.resetInput(),s===n)return c.logStr("SweetAlert expects at least 1 attribute!"),!1;var l=c.extend({},y["default"]);switch(typeof s){case"string":l.title=s,l.text=arguments[1]||"",l.type=arguments[2]||"";break;case"object":if(s.title===n)return c.logStr('Missing "title" argument!'),!1;l.title=s.title;for(var i in y["default"])l[i]=o(i);l.confirmButtonText=l.showCancelButton?"Confirm":y["default"].confirmButtonText,l.confirmButtonText=o("confirmButtonText"),l.doneFunction=arguments[1]||null;break;default:return c.logStr('Unexpected type of argument! Expected "string" or "object", got '+typeof s),!1}g["default"](l),d.fixVerticalPosition(),d.openModal(arguments[1]);for(var p=d.getModal(),v=p.querySelectorAll("button"),h=["onclick","onmouseover","onmouseout","onmousedown","onmouseup","onfocus"],b=function(e){return f.handleButton(e,l,p)},w=0;w<v.length;w++)for(var C=0;C<h.length;C++){var S=h[C];v[w][S]=b}d.getOverlay().onclick=b,a=e.onkeydown;var x=function(e){return m["default"](e,l,p)};e.onkeydown=x,e.onfocus=function(){setTimeout(function(){r!==n&&(r.focus(),r=n)},0)}},s.setDefaults=l.setDefaults=function(e){if(!e)throw new Error("userParams is required");if("object"!=typeof e)throw new Error("userParams has to be a object");c.extend(y["default"],e)},s.close=l.close=function(){var o=d.getModal();u.fadeOut(d.getOverlay(),5),u.fadeOut(o,5),u.removeClass(o,"showSweetAlert"),u.addClass(o,"hideSweetAlert"),u.removeClass(o,"visible");var s=o.querySelector(".sa-icon.sa-success");u.removeClass(s,"animate"),u.removeClass(s.querySelector(".sa-tip"),"animateSuccessTip"),u.removeClass(s.querySelector(".sa-long"),"animateSuccessLong");var l=o.querySelector(".sa-icon.sa-error");u.removeClass(l,"animateErrorIcon"),u.removeClass(l.querySelector(".sa-x-mark"),"animateXMark");var i=o.querySelector(".sa-icon.sa-warning");return u.removeClass(i,"pulseWarning"),u.removeClass(i.querySelector(".sa-body"),"pulseWarningIns"),u.removeClass(i.querySelector(".sa-dot"),"pulseWarningIns"),setTimeout(function(){var e=o.getAttribute("data-custom-class");u.removeClass(o,e)},300),u.removeClass(t.body,"stop-scrolling"),e.onkeydown=a,e.previousActiveElement&&e.previousActiveElement.focus(),r=n,clearTimeout(o.timeout),!0},s.showInputError=l.showInputError=function(e){var t=d.getModal(),n=t.querySelector(".sa-input-error");u.addClass(n,"show");var o=t.querySelector(".sa-error-container");u.addClass(o,"show"),o.querySelector("p").innerHTML=e,t.querySelector("input").focus()},s.resetInputError=l.resetInputError=function(e){if(e&&13===e.keyCode)return!1;var t=d.getModal(),n=t.querySelector(".sa-input-error");u.removeClass(n,"show");var o=t.querySelector(".sa-error-container");u.removeClass(o,"show")},"undefined"!=typeof e?e.sweetAlert=e.swal=s:c.logStr("SweetAlert is a frontend module!")},{"./modules/default-params":2,"./modules/handle-click":3,"./modules/handle-dom":4,"./modules/handle-key":5,"./modules/handle-swal-dom":6,"./modules/set-params":8,"./modules/utils":9}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var o={title:"",text:"",type:null,allowOutsideClick:!1,showConfirmButton:!0,showCancelButton:!1,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:"OK",confirmButtonColor:"#AEDEF4",cancelButtonText:"Cancel",imageUrl:null,imageSize:null,timer:null,customClass:"",html:!1,animation:!0,allowEscapeKey:!0,inputType:"text",inputPlaceholder:"",inputValue:""};n["default"]=o,t.exports=n["default"]},{}],3:[function(t,n,o){Object.defineProperty(o,"__esModule",{value:!0});var a=t("./utils"),r=(t("./handle-swal-dom"),t("./handle-dom")),s=function(t,n,o){function s(e){m&&n.confirmButtonColor&&(p.style.backgroundColor=e)}var u,c,d,f=t||e.event,p=f.target||f.srcElement,m=-1!==p.className.indexOf("confirm"),v=-1!==p.className.indexOf("sweet-overlay"),y=r.hasClass(o,"visible"),h=n.doneFunction&&"true"===o.getAttribute("data-has-done-function");switch(m&&n.confirmButtonColor&&(u=n.confirmButtonColor,c=a.colorLuminance(u,-.04),d=a.colorLuminance(u,-.14)),f.type){case"mouseover":s(c);break;case"mouseout":s(u);break;case"mousedown":s(d);break;case"mouseup":s(c);break;case"focus":var g=o.querySelector("button.confirm"),b=o.querySelector("button.cancel");m?b.style.boxShadow="none":g.style.boxShadow="none";break;case"click":var w=o===p,C=r.isDescendant(o,p);if(!w&&!C&&y&&!n.allowOutsideClick)break;m&&h&&y?l(o,n):h&&y||v?i(o,n):r.isDescendant(o,p)&&"BUTTON"===p.tagName&&sweetAlert.close()}},l=function(e,t){var n=!0;r.hasClass(e,"show-input")&&(n=e.querySelector("input").value,n||(n="")),t.doneFunction(n),t.closeOnConfirm&&sweetAlert.close()},i=function(e,t){var n=String(t.doneFunction).replace(/\s/g,""),o="function("===n.substring(0,9)&&")"!==n.substring(9,10);o&&t.doneFunction(!1),t.closeOnCancel&&sweetAlert.close()};o["default"]={handleButton:s,handleConfirm:l,handleCancel:i},n.exports=o["default"]},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],4:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=function(e,t){return new RegExp(" "+t+" ").test(" "+e.className+" ")},s=function(e,t){r(e,t)||(e.className+=" "+t)},l=function(e,t){var n=" "+e.className.replace(/[\t\r\n]/g," ")+" ";if(r(e,t)){for(;n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},i=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},u=function(e){e.style.opacity="",e.style.display="block"},c=function(e){if(e&&!e.length)return u(e);for(var t=0;t<e.length;++t)u(e[t])},d=function(e){e.style.opacity="",e.style.display="none"},f=function(e){if(e&&!e.length)return d(e);for(var t=0;t<e.length;++t)d(e[t])},p=function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1},m=function(e){e.style.left="-9999px",e.style.display="block";var t,n=e.clientHeight;return t="undefined"!=typeof getComputedStyle?parseInt(getComputedStyle(e).getPropertyValue("padding-top"),10):parseInt(e.currentStyle.padding),e.style.left="",e.style.display="none","-"+parseInt((n+t)/2)+"px"},v=function(e,t){if(+e.style.opacity<1){t=t||16,e.style.opacity=0,e.style.display="block";var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity+(new Date-n)/100,n=+new Date,+e.style.opacity<1&&setTimeout(o,t)});o()}e.style.display="block"},y=function(e,t){t=t||16,e.style.opacity=1;var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity-(new Date-n)/100,n=+new Date,+e.style.opacity>0?setTimeout(o,t):e.style.display="none"});o()},h=function(n){if("function"==typeof MouseEvent){var o=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent("MouseEvents");a.initEvent("click",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},g=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};a.hasClass=r,a.addClass=s,a.removeClass=l,a.escapeHtml=i,a._show=u,a.show=c,a._hide=d,a.hide=f,a.isDescendant=p,a.getTopMargin=m,a.fadeIn=v,a.fadeOut=y,a.fireClick=h,a.stopEventPropagation=g},{}],5:[function(t,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=t("./handle-dom"),s=t("./handle-swal-dom"),l=function(t,o,a){var l=t||e.event,i=l.keyCode||l.which,u=a.querySelector("button.confirm"),c=a.querySelector("button.cancel"),d=a.querySelectorAll("button[tabindex]");if(-1!==[9,13,32,27].indexOf(i)){for(var f=l.target||l.srcElement,p=-1,m=0;m<d.length;m++)if(f===d[m]){p=m;break}9===i?(f=-1===p?u:p===d.length-1?d[0]:d[p+1],r.stopEventPropagation(l),f.focus(),o.confirmButtonColor&&s.setFocusStyle(f,o.confirmButtonColor)):13===i?("INPUT"===f.tagName&&(f=u,u.focus()),f=-1===p?u:n):27===i&&o.allowEscapeKey===!0?(f=c,r.fireClick(f,l)):f=n}};a["default"]=l,o.exports=a["default"]},{"./handle-dom":4,"./handle-swal-dom":6}],6:[function(n,o,a){var r=function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(a,"__esModule",{value:!0});var s=n("./utils"),l=n("./handle-dom"),i=n("./default-params"),u=r(i),c=n("./injected-html"),d=r(c),f=".sweet-alert",p=".sweet-overlay",m=function(){var e=t.createElement("div");for(e.innerHTML=d["default"];e.firstChild;)t.body.appendChild(e.firstChild)},v=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=t.querySelector(f);return e||(m(),e=v()),e}),y=function(){var e=v();return e?e.querySelector("input"):void 0},h=function(){return t.querySelector(p)},g=function(e,t){var n=s.hexToRgb(t);e.style.boxShadow="0 0 2px rgba("+n+", 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)"},b=function(n){var o=v();l.fadeIn(h(),10),l.show(o),l.addClass(o,"showSweetAlert"),l.removeClass(o,"hideSweetAlert"),e.previousActiveElement=t.activeElement;var a=o.querySelector("button.confirm");a.focus(),setTimeout(function(){l.addClass(o,"visible")},500);var r=o.getAttribute("data-timer");if("null"!==r&&""!==r){var s=n;o.timeout=setTimeout(function(){var e=(s||null)&&"true"===o.getAttribute("data-has-done-function");e?s(null):sweetAlert.close()},r)}},w=function(){var e=v(),t=y();l.removeClass(e,"show-input"),t.value=u["default"].inputValue,t.setAttribute("type",u["default"].inputType),t.setAttribute("placeholder",u["default"].inputPlaceholder),C()},C=function(e){if(e&&13===e.keyCode)return!1;var t=v(),n=t.querySelector(".sa-input-error");l.removeClass(n,"show");var o=t.querySelector(".sa-error-container");l.removeClass(o,"show")},S=function(){var e=v();e.style.marginTop=l.getTopMargin(v())};a.sweetAlertInitialize=m,a.getModal=v,a.getOverlay=h,a.getInput=y,a.setFocusStyle=g,a.openModal=b,a.resetInput=w,a.resetInputError=C,a.fixVerticalPosition=S},{"./default-params":2,"./handle-dom":4,"./injected-html":7,"./utils":9}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var o='<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert"><div class="sa-icon sa-error">\n <span class="sa-x-mark">\n <span class="sa-line sa-left"></span>\n <span class="sa-line sa-right"></span>\n </span>\n </div><div class="sa-icon sa-warning">\n <span class="sa-body"></span>\n <span class="sa-dot"></span>\n </div><div class="sa-icon sa-info"></div><div class="sa-icon sa-success">\n <span class="sa-line sa-tip"></span>\n <span class="sa-line sa-long"></span>\n\n <div class="sa-placeholder"></div>\n <div class="sa-fix"></div>\n </div><div class="sa-icon sa-custom"></div><h2>Title</h2>\n <p>Text</p>\n <fieldset>\n <input type="text" tabIndex="3" />\n <div class="sa-input-error"></div>\n </fieldset><div class="sa-error-container">\n <div class="icon">!</div>\n <p>Not valid!</p>\n </div><div class="sa-button-container">\n <button class="cancel" tabIndex="2">Cancel</button>\n <button class="confirm" tabIndex="1">OK</button>\n </div></div>';n["default"]=o,t.exports=n["default"]},{}],8:[function(e,t,o){Object.defineProperty(o,"__esModule",{value:!0});var a=e("./utils"),r=e("./handle-swal-dom"),s=e("./handle-dom"),l=["error","warning","info","success","input","prompt"],i=function(e){var t=r.getModal(),o=t.querySelector("h2"),i=t.querySelector("p"),u=t.querySelector("button.cancel"),c=t.querySelector("button.confirm");if(o.innerHTML=e.html?e.title:s.escapeHtml(e.title).split("\n").join("<br>"),i.innerHTML=e.html?e.text:s.escapeHtml(e.text||"").split("\n").join("<br>"),e.text&&s.show(i),e.customClass)s.addClass(t,e.customClass),t.setAttribute("data-custom-class",e.customClass);else{var d=t.getAttribute("data-custom-class");s.removeClass(t,d),t.setAttribute("data-custom-class","")}if(s.hide(t.querySelectorAll(".sa-icon")),e.type&&!a.isIE8()){var f=function(){for(var o=!1,a=0;a<l.length;a++)if(e.type===l[a]){o=!0;break}if(!o)return logStr("Unknown alert type: "+e.type),{v:!1};var i=["success","error","warning","info"],u=n;-1!==i.indexOf(e.type)&&(u=t.querySelector(".sa-icon.sa-"+e.type),s.show(u));var c=r.getInput();switch(e.type){case"success":s.addClass(u,"animate"),s.addClass(u.querySelector(".sa-tip"),"animateSuccessTip"),s.addClass(u.querySelector(".sa-long"),"animateSuccessLong");break;case"error":s.addClass(u,"animateErrorIcon"),s.addClass(u.querySelector(".sa-x-mark"),"animateXMark");break;case"warning":s.addClass(u,"pulseWarning"),s.addClass(u.querySelector(".sa-body"),"pulseWarningIns"),s.addClass(u.querySelector(".sa-dot"),"pulseWarningIns");break;case"input":case"prompt":c.setAttribute("type",e.inputType),c.value=e.inputValue,c.setAttribute("placeholder",e.inputPlaceholder),s.addClass(t,"show-input"),setTimeout(function(){c.focus(),c.addEventListener("keyup",swal.resetInputError)},400)}}();if("object"==typeof f)return f.v}if(e.imageUrl){var p=t.querySelector(".sa-icon.sa-custom");p.style.backgroundImage="url("+e.imageUrl+")",s.show(p);var m=80,v=80;if(e.imageSize){var y=e.imageSize.toString().split("x"),h=y[0],g=y[1];h&&g?(m=h,v=g):logStr("Parameter imageSize expects value with format WIDTHxHEIGHT, got "+e.imageSize)}p.setAttribute("style",p.getAttribute("style")+"width:"+m+"px; height:"+v+"px")}t.setAttribute("data-has-cancel-button",e.showCancelButton),e.showCancelButton?u.style.display="inline-block":s.hide(u),t.setAttribute("data-has-confirm-button",e.showConfirmButton),e.showConfirmButton?c.style.display="inline-block":s.hide(c),e.cancelButtonText&&(u.innerHTML=s.escapeHtml(e.cancelButtonText)),e.confirmButtonText&&(c.innerHTML=s.escapeHtml(e.confirmButtonText)),e.confirmButtonColor&&(c.style.backgroundColor=e.confirmButtonColor,r.setFocusStyle(c,e.confirmButtonColor)),t.setAttribute("data-allow-outside-click",e.allowOutsideClick);var b=e.doneFunction?!0:!1;t.setAttribute("data-has-done-function",b),e.animation?"string"==typeof e.animation?t.setAttribute("data-animation",e.animation):t.setAttribute("data-animation","pop"):t.setAttribute("data-animation","none"),t.setAttribute("data-timer",e.timer)};o["default"]=i,t.exports=o["default"]},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],9:[function(t,n,o){Object.defineProperty(o,"__esModule",{value:!0});var a=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},r=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16):null},s=function(){return e.attachEvent&&!e.addEventListener},l=function(t){e.console&&e.console.log("SweetAlert: "+t)},i=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,a="#";for(o=0;3>o;o++)n=parseInt(e.substr(2*o,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),a+=("00"+n).substr(n.length);return a};o.extend=a,o.hexToRgb=r,o.isIE8=s,o.logStr=l,o.colorLuminance=i},{}]},{},[1]),"function"==typeof define&&define.amd?define(function(){return sweetAlert}):"undefined"!=typeof module&&module.exports&&(module.exports=sweetAlert)}(window,document);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
Tinycon - A small library for manipulating the Favicon
|
3
|
+
Tom Moor, http://tommoor.com
|
4
|
+
Copyright (c) 2012 Tom Moor
|
5
|
+
@license MIT Licensed
|
6
|
+
@version 0.6.3
|
7
|
+
*/
|
8
|
+
(function(){var Tinycon={};var currentFavicon=null;var originalFavicon=null;var faviconImage=null;var canvas=null;var options={};var r=window.devicePixelRatio||1;var size=16*r;var defaults={width:7,height:9,font:10*r+'px arial',colour:'#ffffff',background:'#F03D25',fallback:true,crossOrigin:true,abbreviate:true};var ua=(function(){var agent=navigator.userAgent.toLowerCase();return function(browser){return agent.indexOf(browser)!==-1}}());var browser={ie:ua('msie'),chrome:ua('chrome'),webkit:ua('chrome')||ua('safari'),safari:ua('safari')&&!ua('chrome'),mozilla:ua('mozilla')&&!ua('chrome')&&!ua('safari')};var getFaviconTag=function(){var links=document.getElementsByTagName('link');for(var i=0,len=links.length;i<len;i++){if((links[i].getAttribute('rel')||'').match(/\bicon\b/)){return links[i]}}return false};var removeFaviconTag=function(){var links=document.getElementsByTagName('link');var head=document.getElementsByTagName('head')[0];for(var i=0,len=links.length;i<len;i++){var exists=(typeof(links[i])!=='undefined');if(exists&&(links[i].getAttribute('rel')||'').match(/\bicon\b/)){head.removeChild(links[i])}}};var getCurrentFavicon=function(){if(!originalFavicon||!currentFavicon){var tag=getFaviconTag();originalFavicon=currentFavicon=tag?tag.getAttribute('href'):'/favicon.ico'}return currentFavicon};var getCanvas=function(){if(!canvas){canvas=document.createElement("canvas");canvas.width=size;canvas.height=size}return canvas};var setFaviconTag=function(url){removeFaviconTag();var link=document.createElement('link');link.type='image/x-icon';link.rel='icon';link.href=url;document.getElementsByTagName('head')[0].appendChild(link)};var log=function(message){if(window.console)window.console.log(message)};var drawFavicon=function(label,colour){if(!getCanvas().getContext||browser.ie||browser.safari||options.fallback==='force'){return updateTitle(label)}var context=getCanvas().getContext("2d");var colour=colour||'#000000';var src=getCurrentFavicon();faviconImage=document.createElement('img');faviconImage.onload=function(){context.clearRect(0,0,size,size);context.drawImage(faviconImage,0,0,faviconImage.width,faviconImage.height,0,0,size,size);if((label+'').length>0)drawBubble(context,label,colour);refreshFavicon()};if(!src.match(/^data/)&&options.crossOrigin){faviconImage.crossOrigin='anonymous'}faviconImage.src=src};var updateTitle=function(label){if(options.fallback){var originalTitle=document.title;if(originalTitle[0]==='('){originalTitle=originalTitle.slice(originalTitle.indexOf(' '))}if((label+'').length>0){document.title='('+label+') '+originalTitle}else{document.title=originalTitle}}};var drawBubble=function(context,label,colour){if(typeof label=='number'&&label>99&&options.abbreviate){label=abbreviateNumber(label)}var len=(label+'').length-1;var width=options.width*r+(6*r*len),height=options.height*r;var top=size-height,left=size-width-r,bottom=16*r,right=16*r,radius=2*r;context.font=(browser.webkit?'bold ':'')+options.font;context.fillStyle=options.background;context.strokeStyle=options.background;context.lineWidth=r;context.beginPath();context.moveTo(left+radius,top);context.quadraticCurveTo(left,top,left,top+radius);context.lineTo(left,bottom-radius);context.quadraticCurveTo(left,bottom,left+radius,bottom);context.lineTo(right-radius,bottom);context.quadraticCurveTo(right,bottom,right,bottom-radius);context.lineTo(right,top+radius);context.quadraticCurveTo(right,top,right-radius,top);context.closePath();context.fill();context.beginPath();context.strokeStyle="rgba(0,0,0,0.3)";context.moveTo(left+radius/2.0,bottom);context.lineTo(right-radius/2.0,bottom);context.stroke();context.fillStyle=options.colour;context.textAlign="right";context.textBaseline="top";context.fillText(label,r===2?29:15,browser.mozilla?7*r:6*r)};var refreshFavicon=function(){if(!getCanvas().getContext)return;setFaviconTag(getCanvas().toDataURL())};var abbreviateNumber=function(label){var metricPrefixes=[['G',1000000000],['M',1000000],['k',1000]];for(var i=0;i<metricPrefixes.length;++i){if(label>=metricPrefixes[i][1]){label=round(label/metricPrefixes[i][1])+metricPrefixes[i][0];break}}return label};var round=function(value,precision){var number=new Number(value);return number.toFixed(precision)};Tinycon.setOptions=function(custom){options={};for(var key in defaults){options[key]=custom.hasOwnProperty(key)?custom[key]:defaults[key]}return this};Tinycon.setImage=function(url){currentFavicon=url;refreshFavicon();return this};Tinycon.setBubble=function(label,colour){label=label||'';drawFavicon(label,colour);return this};Tinycon.reset=function(){setFaviconTag(originalFavicon)};Tinycon.setOptions(defaults);window.Tinycon=Tinycon;if(typeof define==='function'&&define.amd){define(Tinycon)}})();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! WOW - v1.0.2 - 2014-10-28
|
2
|
+
* Copyright (c) 2014 Matthieu Aussaguel; Licensed MIT */(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]},a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationNameCache=new c}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addedNodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.doSync(c));return f}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=""+a.className+" "+this.config.animateClass},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charAt(0).toUpperCase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getPropertyCSSValue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getPropertyCSSValue("-"+f+"-"+b);return c},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this);
|
data/{bin → exe}/weaver
RENAMED
@@ -20,6 +20,9 @@ class Website < Sinatra::Base
|
|
20
20
|
path = "#{File.join(['source'] + pathToFile)}.weave"
|
21
21
|
indexPath = File.join(["source"] + pathToFile + ["index.weave"])
|
22
22
|
|
23
|
+
#puts path
|
24
|
+
#puts indexPath
|
25
|
+
|
23
26
|
viewFile = path if File.exists?(path)
|
24
27
|
viewFile = indexPath if File.exists?(indexPath)
|
25
28
|
|
@@ -33,8 +36,6 @@ class Website < Sinatra::Base
|
|
33
36
|
{ viewFile: viewFile, path: remainingPath }
|
34
37
|
end
|
35
38
|
|
36
|
-
|
37
|
-
|
38
39
|
get '/*' do
|
39
40
|
|
40
41
|
if params[:splat].first.start_with? "images/"
|
data/lib/weaver.rb
CHANGED
@@ -2,6 +2,7 @@ require "weaver/version"
|
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'sinatra'
|
5
|
+
require 'json'
|
5
6
|
|
6
7
|
module Weaver
|
7
8
|
|
@@ -49,8 +50,8 @@ module Weaver
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
|
-
def ibox(&block)
|
53
|
-
panel = Panel.new(@page, @anchors)
|
53
|
+
def ibox(options={}, &block)
|
54
|
+
panel = Panel.new(@page, @anchors, options)
|
54
55
|
panel.instance_eval(&block)
|
55
56
|
@inner_content << panel.generate
|
56
57
|
end
|
@@ -64,6 +65,22 @@ module Weaver
|
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
68
|
+
def tabs(&block)
|
69
|
+
tabs = Tabs.new(@page, @anchors)
|
70
|
+
tabs.instance_eval(&block)
|
71
|
+
|
72
|
+
@inner_content << tabs.generate
|
73
|
+
end
|
74
|
+
|
75
|
+
def syntax(lang=:javascript, &block)
|
76
|
+
code = Code.new(@page, @anchors, lang)
|
77
|
+
code.instance_eval(&block)
|
78
|
+
|
79
|
+
@inner_content << code.generate
|
80
|
+
|
81
|
+
@page.scripts << code.generate_script
|
82
|
+
end
|
83
|
+
|
67
84
|
def image(name, options={})
|
68
85
|
|
69
86
|
style = ""
|
@@ -84,6 +101,8 @@ module Weaver
|
|
84
101
|
image image_hover, class: "bottom"
|
85
102
|
image image_normal, class: "top"
|
86
103
|
end
|
104
|
+
image image_hover
|
105
|
+
@page.request_css "css/crossfade_style.css"
|
87
106
|
end
|
88
107
|
|
89
108
|
def breadcrumb(patharray)
|
@@ -139,7 +158,7 @@ module Weaver
|
|
139
158
|
end
|
140
159
|
|
141
160
|
def accordion(&block)
|
142
|
-
acc = Accordion.new(@anchors)
|
161
|
+
acc = Accordion.new(@page, @anchors)
|
143
162
|
acc.instance_eval(&block)
|
144
163
|
|
145
164
|
@inner_content << acc.generate
|
@@ -340,17 +359,103 @@ ENDROW
|
|
340
359
|
end
|
341
360
|
end
|
342
361
|
|
362
|
+
class Code
|
363
|
+
def initialize(page, anchors, lang)
|
364
|
+
@page = page
|
365
|
+
@anchors = anchors
|
366
|
+
@content = ""
|
367
|
+
@options = {}
|
368
|
+
|
369
|
+
codeArray = @anchors["code"]
|
370
|
+
|
371
|
+
if !@anchors["code"]
|
372
|
+
@anchors["code"] = []
|
373
|
+
end
|
374
|
+
|
375
|
+
codeArray = @anchors["code"]
|
376
|
+
|
377
|
+
@codeName = "code#{codeArray.length}"
|
378
|
+
codeArray << @accordion_name
|
379
|
+
|
380
|
+
@page.request_css "css/plugins/codemirror/codemirror.css"
|
381
|
+
@page.request_js "js/plugins/codemirror/codemirror.js"
|
382
|
+
|
383
|
+
language lang
|
384
|
+
|
385
|
+
end
|
386
|
+
|
387
|
+
def language(lang)
|
388
|
+
# TODO improve langmap
|
389
|
+
langmap = {
|
390
|
+
javascript: {mime: "text/javascript", file: "javascript/javascript"}
|
391
|
+
}
|
392
|
+
|
393
|
+
if langmap[lang]
|
394
|
+
@options[:mode] = langmap[lang][:mime]
|
395
|
+
@page.request_js "js/plugins/codemirror/mode/#{langmap[lang][:file]}.js"
|
396
|
+
else
|
397
|
+
@options[:mode] = "text/x-#{lang}"
|
398
|
+
@page.request_js "js/plugins/codemirror/mode/#{lang}/#{lang}.js"
|
399
|
+
end
|
400
|
+
|
401
|
+
end
|
402
|
+
|
403
|
+
def content(text)
|
404
|
+
@content = text
|
405
|
+
end
|
406
|
+
|
407
|
+
def theme(name)
|
408
|
+
@options[:theme] = name
|
409
|
+
|
410
|
+
@page.request_css "css/plugins/codemirror/#{name}.css"
|
411
|
+
end
|
412
|
+
|
413
|
+
def generate_script
|
414
|
+
|
415
|
+
@options[:lineNumbers] ||= true
|
416
|
+
@options[:matchBrackets] ||= true
|
417
|
+
@options[:styleActiveLine] ||= true
|
418
|
+
@options[:mode] ||= "javascript"
|
419
|
+
@options[:readOnly] ||= true
|
420
|
+
|
421
|
+
<<-CODESCRIPT
|
422
|
+
$(document).ready(function()
|
423
|
+
{
|
424
|
+
CodeMirror.fromTextArea(document.getElementById("#{@codeName}"),
|
425
|
+
JSON.parse('#{@options.to_json}')
|
426
|
+
);
|
427
|
+
});
|
428
|
+
CODESCRIPT
|
429
|
+
end
|
430
|
+
|
431
|
+
def generate
|
432
|
+
|
433
|
+
content = @content
|
434
|
+
codeName = @codeName
|
435
|
+
|
436
|
+
elem = Elements.new(@page, @anchors)
|
437
|
+
|
438
|
+
elem.instance_eval do
|
439
|
+
textarea id: codeName do
|
440
|
+
text content
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
elem.generate
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
343
448
|
class Panel < Elements
|
344
|
-
def initialize(page, anchors)
|
345
|
-
super
|
449
|
+
def initialize(page, anchors, options)
|
450
|
+
super(page, anchors)
|
346
451
|
@title = nil
|
347
452
|
@footer = nil
|
348
453
|
@type = :ibox
|
349
|
-
@tabs = nil
|
350
454
|
@body = true
|
351
455
|
@extra = nil
|
352
456
|
@min_height = nil
|
353
457
|
@page = page
|
458
|
+
@options = options
|
354
459
|
end
|
355
460
|
|
356
461
|
def generate
|
@@ -370,26 +475,48 @@ ENDROW
|
|
370
475
|
|
371
476
|
title = @title
|
372
477
|
footer = @footer
|
373
|
-
tabs = @tabs
|
374
478
|
hasBody = @body
|
375
479
|
extra = @extra
|
480
|
+
options = @options
|
376
481
|
classNames = types[@type]
|
377
482
|
min_height = @min_height
|
378
483
|
|
379
484
|
elem = Elements.new(@page, @anchors)
|
380
485
|
|
486
|
+
outer_class = classNames[:outer]
|
487
|
+
|
488
|
+
if options[:collapsed]
|
489
|
+
outer_class = "ibox collapsed"
|
490
|
+
end
|
491
|
+
|
381
492
|
elem.instance_eval do
|
382
|
-
div class:
|
383
|
-
if title
|
493
|
+
div class: outer_class do
|
494
|
+
if title
|
384
495
|
div class: classNames[:header] do
|
385
|
-
|
386
|
-
|
496
|
+
h5 title
|
497
|
+
|
498
|
+
div class: "ibox-tools" do
|
499
|
+
if options[:collapsible] or options[:collapsed]
|
500
|
+
a class: "collapse-link" do
|
501
|
+
icon :"chevron-up"
|
502
|
+
end
|
503
|
+
end
|
504
|
+
if options[:expandable]
|
505
|
+
a class: "fullscreen-link" do
|
506
|
+
icon :expand
|
507
|
+
end
|
508
|
+
end
|
509
|
+
if options[:closable]
|
510
|
+
a class: "close-link" do
|
511
|
+
icon :times
|
512
|
+
end
|
513
|
+
end
|
514
|
+
end
|
387
515
|
end
|
388
516
|
end
|
389
517
|
if hasBody
|
390
518
|
div class: classNames[:body], style: "min-height: #{min_height}px" do
|
391
519
|
text inner
|
392
|
-
text tabs.generate_body if tabs
|
393
520
|
end
|
394
521
|
end
|
395
522
|
if extra
|
@@ -400,6 +527,7 @@ ENDROW
|
|
400
527
|
text footer
|
401
528
|
end
|
402
529
|
end
|
530
|
+
|
403
531
|
end
|
404
532
|
end
|
405
533
|
|
@@ -444,12 +572,6 @@ ENDROW
|
|
444
572
|
end
|
445
573
|
end
|
446
574
|
|
447
|
-
def tabs(&block)
|
448
|
-
tabs = Tabs.new(@page, @anchors)
|
449
|
-
tabs.instance_eval(&block)
|
450
|
-
|
451
|
-
@tabs = tabs
|
452
|
-
end
|
453
575
|
end
|
454
576
|
|
455
577
|
class Accordion
|
@@ -557,6 +679,7 @@ ENDROW
|
|
557
679
|
@anchors = anchors
|
558
680
|
@tabs = {}
|
559
681
|
@page = page
|
682
|
+
@orientation = :normal # :left, :right
|
560
683
|
end
|
561
684
|
|
562
685
|
def tab(title, &block)
|
@@ -578,55 +701,55 @@ ENDROW
|
|
578
701
|
title: title,
|
579
702
|
elem: elem
|
580
703
|
}
|
704
|
+
end
|
581
705
|
|
706
|
+
def orientation(direction)
|
707
|
+
@orientation = direction
|
582
708
|
end
|
583
709
|
|
584
|
-
def
|
710
|
+
def generate
|
711
|
+
|
585
712
|
tabbar = Elements.new(@page, @anchors)
|
586
713
|
tabs = @tabs
|
714
|
+
orientation = @orientation
|
587
715
|
|
588
716
|
tabbar.instance_eval do
|
589
717
|
|
590
|
-
div :class => "
|
591
|
-
|
592
|
-
cls = "tab-pane active"
|
593
|
-
tabs.each do |anchor, value|
|
594
|
-
div id: "#{anchor}", :class => cls do
|
595
|
-
text value[:elem].generate
|
596
|
-
end
|
597
|
-
cls = "tab-pane"
|
598
|
-
end
|
599
|
-
end
|
600
|
-
end
|
718
|
+
div :class => "tabs-container" do
|
601
719
|
|
602
|
-
|
603
|
-
end
|
720
|
+
div :class => "tabs-#{orientation}" do
|
604
721
|
|
605
|
-
|
722
|
+
ul :class => "nav nav-tabs" do
|
723
|
+
cls = "active"
|
724
|
+
tabs.each do |anchor, value|
|
725
|
+
li :class => cls do
|
726
|
+
a :"data-toggle" => "tab", href: "##{anchor}" do
|
727
|
+
if value[:title].is_a? Symbol
|
728
|
+
icon value[:title]
|
729
|
+
else
|
730
|
+
text value[:title]
|
731
|
+
end
|
732
|
+
end
|
733
|
+
end
|
606
734
|
|
607
|
-
|
608
|
-
|
735
|
+
cls = ""
|
736
|
+
end
|
737
|
+
end
|
609
738
|
|
610
|
-
|
739
|
+
div :class => "tab-content" do
|
611
740
|
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
li :class => cls do
|
618
|
-
a :"data-toggle" => "tab", href: "##{anchor}" do
|
619
|
-
if value[:title].is_a? Symbol
|
620
|
-
icon value[:title]
|
621
|
-
else
|
622
|
-
text value[:title]
|
741
|
+
cls = "tab-pane active"
|
742
|
+
tabs.each do |anchor, value|
|
743
|
+
div id: "#{anchor}", :class => cls do
|
744
|
+
div :class => "panel-body" do
|
745
|
+
text value[:elem].generate
|
623
746
|
end
|
624
747
|
end
|
748
|
+
cls = "tab-pane"
|
625
749
|
end
|
626
|
-
|
627
|
-
cls = ""
|
628
750
|
end
|
629
751
|
end
|
752
|
+
|
630
753
|
end
|
631
754
|
end
|
632
755
|
|
@@ -636,20 +759,44 @@ ENDROW
|
|
636
759
|
|
637
760
|
class Page
|
638
761
|
|
762
|
+
attr_accessor :scripts
|
763
|
+
|
639
764
|
def initialize(title, options)
|
640
765
|
@title = title
|
641
766
|
@content = ""
|
642
767
|
@body_class = nil
|
643
768
|
@anchors = {}
|
644
769
|
@options = options
|
770
|
+
@scripts = []
|
771
|
+
@top_content = ""
|
772
|
+
|
773
|
+
@requested_scripts = {}
|
774
|
+
@requested_css = {}
|
645
775
|
end
|
646
776
|
|
647
777
|
def root
|
648
778
|
return @options[:root]
|
649
779
|
end
|
650
780
|
|
781
|
+
def request_js(path)
|
782
|
+
@requested_scripts[path] = true
|
783
|
+
end
|
784
|
+
|
785
|
+
def request_css(path)
|
786
|
+
@requested_css[path] = true
|
787
|
+
end
|
788
|
+
|
789
|
+
def top(&block)
|
790
|
+
elem = Elements.new(@page, @anchors)
|
791
|
+
elem.instance_eval(&block)
|
792
|
+
|
793
|
+
@top_content = elem.generate
|
794
|
+
end
|
795
|
+
|
651
796
|
def generate(back_folders, options={})
|
652
797
|
|
798
|
+
scripts = @scripts.join("\n")
|
799
|
+
|
653
800
|
mod = "../" * back_folders
|
654
801
|
|
655
802
|
style = <<-ENDSTYLE
|
@@ -667,6 +814,16 @@ ENDROW
|
|
667
814
|
loading_bar = ""
|
668
815
|
loading_bar = '<script src="js/plugins/pace/pace.min.js"></script>' if @loading_bar_visible
|
669
816
|
|
817
|
+
extra_scripts = @requested_scripts.map {|key,value| <<-SCRIPT_DECL
|
818
|
+
<script src="#{mod}#{key}"></script>
|
819
|
+
SCRIPT_DECL
|
820
|
+
}.join "\n"
|
821
|
+
|
822
|
+
extra_css = @requested_css.map {|key,value| <<-STYLESHEET_DECL
|
823
|
+
<link href="#{mod}#{key}" rel="stylesheet">
|
824
|
+
STYLESHEET_DECL
|
825
|
+
}.join "\n"
|
826
|
+
|
670
827
|
<<-SKELETON
|
671
828
|
<!DOCTYPE html>
|
672
829
|
<html>
|
@@ -682,13 +839,16 @@ ENDROW
|
|
682
839
|
<link href="#{mod}font-awesome/css/font-awesome.css" rel="stylesheet">
|
683
840
|
<link href="#{mod}css/plugins/iCheck/custom.css" rel="stylesheet">
|
684
841
|
<link href="#{mod}css/plugins/blueimp/css/blueimp-gallery.min.css" rel="stylesheet">
|
842
|
+
|
843
|
+
#{extra_css}
|
844
|
+
|
685
845
|
#{style}
|
686
846
|
<link href="#{mod}css/animate.css" rel="stylesheet">
|
687
847
|
|
688
848
|
</head>
|
689
849
|
|
690
850
|
#{body_tag}
|
691
|
-
|
851
|
+
#{@top_content}
|
692
852
|
#{@content}
|
693
853
|
|
694
854
|
<!-- Mainly scripts -->
|
@@ -698,6 +858,8 @@ ENDROW
|
|
698
858
|
<script src="#{mod}js/plugins/metisMenu/jquery.metisMenu.js"></script>
|
699
859
|
<script src="#{mod}js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
|
700
860
|
|
861
|
+
#{extra_scripts}
|
862
|
+
|
701
863
|
<!-- blueimp gallery -->
|
702
864
|
<script src="#{mod}js/plugins/blueimp/jquery.blueimp-gallery.min.js"></script>
|
703
865
|
|
@@ -719,6 +881,10 @@ ENDROW
|
|
719
881
|
<script src="#{mod}js/inspinia.js"></script>
|
720
882
|
#{loading_bar}
|
721
883
|
|
884
|
+
<script>
|
885
|
+
#{scripts}
|
886
|
+
</script>
|
887
|
+
|
722
888
|
<div id="blueimp-gallery" class="blueimp-gallery">
|
723
889
|
<div class="slides"></div>
|
724
890
|
<h3 class="title"></h3>
|
@@ -1140,7 +1306,12 @@ ENDROW
|
|
1140
1306
|
instance_eval(File.read(file), file)
|
1141
1307
|
end
|
1142
1308
|
|
1143
|
-
def center_page(path, title, &block)
|
1309
|
+
def center_page(path, title=nil, &block)
|
1310
|
+
|
1311
|
+
if title == nil
|
1312
|
+
title = path
|
1313
|
+
path = ""
|
1314
|
+
end
|
1144
1315
|
|
1145
1316
|
p = CenterPage.new(title, @options)
|
1146
1317
|
|
@@ -1152,13 +1323,25 @@ ENDROW
|
|
1152
1323
|
@pages[path] = p
|
1153
1324
|
end
|
1154
1325
|
|
1155
|
-
def sidenav_page(path, title, &block)
|
1326
|
+
def sidenav_page(path, title=nil, &block)
|
1327
|
+
|
1328
|
+
if title == nil
|
1329
|
+
title = path
|
1330
|
+
path = ""
|
1331
|
+
end
|
1332
|
+
|
1156
1333
|
p = SideNavPage.new(title, @options)
|
1157
1334
|
p.instance_eval(&block) if block
|
1158
1335
|
@pages[path] = p
|
1159
1336
|
end
|
1160
1337
|
|
1161
|
-
def topnav_page(path, title, &block)
|
1338
|
+
def topnav_page(path, title=nil, &block)
|
1339
|
+
|
1340
|
+
if title == nil
|
1341
|
+
title = path
|
1342
|
+
path = ""
|
1343
|
+
end
|
1344
|
+
|
1162
1345
|
p = TopNavPage.new(title, @options)
|
1163
1346
|
p.instance_eval(&block) if block
|
1164
1347
|
@pages[path] = p
|