From c41b96c6d8b98a0de8da1236049f50bc1fc0834b Mon Sep 17 00:00:00 2001 From: Ruslan Shashkov Date: Sat, 14 Mar 2015 12:40:40 +0300 Subject: [PATCH 1/4] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..952caf8 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Quodo 2 +[Demo](http://ruslanchek.github.io/Quodo-2/index.html) From 8fbc914af4ea078d1a093fd50c85caa6d57ef1f4 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Wed, 18 Mar 2015 00:29:35 +0300 Subject: [PATCH 2/4] Grid col min height added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s for a empty col null width problem solving --- config.codekit | 41 +++++++++++++++++++++++++++++---------- css/screen.css | 4 +++- sass/components/grid.scss | 1 + 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/config.codekit b/config.codekit index 44a73c9..a5f8c77 100644 --- a/config.codekit +++ b/config.codekit @@ -65,6 +65,15 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, + "\/components.html": { + "fileType": 8192, + "ignore": 1, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/components.html", + "outputAbbreviatedPath": "No Output Path", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0 + }, "\/config.rb": { "fileType": 131072, "ignore": 0, @@ -326,15 +335,6 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, - "\/css\/screen.css": { - "fileType": 16, - "ignore": 1, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/css\/screen.css", - "outputAbbreviatedPath": "No Output Path", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0 - }, "\/forms.html": { "fileType": 8192, "ignore": 1, @@ -371,6 +371,15 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, + "\/index.html": { + "fileType": 8192, + "ignore": 1, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/index.html", + "outputAbbreviatedPath": "No Output Path", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0 + }, "\/jade\/_layout.jade": { "compileDebug": 1, "fileType": 512, @@ -583,7 +592,7 @@ "\/jade\/partials\/colorable.jade": { "compileDebug": 1, "fileType": 512, - "ignore": 0, + "ignore": 1, "ignoreWasSetByUser": 0, "inputAbbreviatedPath": "\/jade\/partials\/colorable.jade", "outputAbbreviatedPath": "\/jade\/colorable.html", @@ -803,6 +812,18 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, + "\/README.md": { + "enableFootnoteSupport": 0, + "enableSmartyPants": 1, + "expandTabs": 1, + "fileType": 4096, + "ignore": 0, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/README.md", + "outputAbbreviatedPath": "\/README.html", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0 + }, "\/roadmap.html": { "fileType": 8192, "ignore": 1, diff --git a/css/screen.css b/css/screen.css index 2629e4b..973577a 100644 --- a/css/screen.css +++ b/css/screen.css @@ -3034,7 +3034,8 @@ main { margin-left: 0; } .grid [class^="col-"], .grid [class*=" col-"] { - margin-bottom: 40px; } + margin-bottom: 40px; + min-height: 1px; } @media (min-width: 0) and (max-width: 569px) { .grid [class^="col-"], .grid [class*=" col-"] { @@ -4677,6 +4678,7 @@ html, body { margin-left: -16px; border-radius: 2.5px; } .fullscreen .overlay { + opacity: 0; width: 100%; height: 100%; z-index: 1001; diff --git a/sass/components/grid.scss b/sass/components/grid.scss index 578008f..2f4b093 100644 --- a/sass/components/grid.scss +++ b/sass/components/grid.scss @@ -44,6 +44,7 @@ $one_col: (100% - ($grid-gutter-width * ($grid-cols - 1))) / $grid-cols; [class^="col-"], [class*=" col-"] { margin-bottom: $margin-vertical-space; + min-height: 1px; @include breakpoint($bp-iphone) { float: none !important; From e165ad358d998b3ffe80f00267d7cb078a1fa9c9 Mon Sep 17 00:00:00 2001 From: ruslanchek Date: Fri, 27 Mar 2015 12:01:25 +0300 Subject: [PATCH 3/4] UI.Template bug fixed --- config.codekit | 22 ++++++++++------------ js/min/ui-min.js | 2 +- js/ui.js | 27 +++++++++++++++++---------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/config.codekit b/config.codekit index a5f8c77..40d378d 100644 --- a/config.codekit +++ b/config.codekit @@ -335,6 +335,15 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, + "\/css\/screen.css": { + "fileType": 16, + "ignore": 1, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/css\/screen.css", + "outputAbbreviatedPath": "No Output Path", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0 + }, "\/forms.html": { "fileType": 8192, "ignore": 1, @@ -765,17 +774,6 @@ "outputStyle": 1, "syntaxCheckerStyle": 1 }, - "\/js\/ui.js": { - "fileType": 64, - "ignore": 0, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/js\/ui.js", - "outputAbbreviatedPath": "\/js\/min\/ui-min.js", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0, - "outputStyle": 1, - "syntaxCheckerStyle": 1 - }, "\/nav-h.html": { "fileType": 8192, "ignore": 1, @@ -2687,7 +2685,7 @@ }, "hooks": [ ], -"lastSavedByUser": "Ruslan", +"lastSavedByUser": "Ruslan Shashkov", "manualImportLinks": { }, "projectAttributes": { diff --git a/js/min/ui-min.js b/js/min/ui-min.js index 2e8949b..5c3fefa 100644 --- a/js/min/ui-min.js +++ b/js/min/ui-min.js @@ -1 +1 @@ -var UI={settings:{templateSettings:{interpolate:/\{\{(.+?)\}\}/g}}};UI.ClickOutside=function(t){var n=this,i=_.uniqueId("UIClickOutside_");this.options=$.extend({selector:"",onClickOutside:function(t){}},t),this.bind=function(){this.unbind(),$(document).on("mouseup."+i,function(t){var i=$(n.options.selector);i.is(t.target)||0!==i.has(t.target).length||n.options.onClickOutside(t.target)})},this.unbind=function(){$(document).off("mouseup."+i)}},UI.Animate=function(t){var n=this,i={};this.options=$.extend({$element:"",animationDuration:300},t);var o=this.options.$element;i.fadeIn=function(t){o.transition({opacity:1},n.options.animationDuration,function(){t()})},i.fadeOut=function(t){o.transition({opacity:0},n.options.animationDuration,function(){t()})},i.appear=function(t){o.transition({scale:0,opacity:1,perspective:"1500px",rotateX:"-90deg"},0),o.transition({scale:1,opacity:1,rotateX:"0deg"},n.options.animationDuration,"easeOutBack",function(){t()})},i.disappear=function(t){o.transition({scale:0,opacity:1,rotateX:"90deg"},n.options.animationDuration,"easeInBack",function(){t()})},i.slideDown=function(t){o.transition({scale:.8,opacity:0,y:"-100vh"},0),o.transition({y:"0vh",opacity:1},n.options.animationDuration,"easeOutQuad").transition({scale:1},n.options.animationDuration,"easeOutBack",function(){t()})},i.slideUp=function(t){o.transition({scale:1,opacity:1,y:"0vh"},0),o.transition({scale:.8},n.options.animationDuration,"easeInOutBack").transition({opacity:0,y:"-100vh"},n.options.animationDuration/2,"easeInQuad",function(){t()})},this.play=function(t,e){i[t]?i[t](function(){setTimeout(function(){e&&e(o)},n.options.animationDuration)}):console.error("UI.Animate","Can't find animation method",t)}},UI.Template=function(t){var n=this;_.templateSettings=UI.settings.templateSettings;var i=function(){var n=$("#"+t).html();return n?n:void console.error("UI.Template","Template is empty",t)};this.render=function(t){var n=_.template(i());return n(t)}},UI.Checker=function(t){var n=this;this.options=$.extend({selector:".checker",onCheck:function(t){},onUncheck:function(t){},onToggle:function(t,n){}},t);var i=$(this.options.selector).find(">a");i.each(function(){$(this).data("originalContent",$(this).html())}),i.off("click.UIChecker").on("click.UIChecker",function(t){t.preventDefault();var i="";$(this).data("activeClass")&&(i=" "+$(this).data("activeClass")),$(this).data("toggledContent")&&$(this).html($(this).data("toggledContent")!=$(this).html()?$(this).data("toggledContent"):$(this).data("originalContent")),$(this).hasClass("active")?($(this).removeClass("active"+i),n.options.onUncheck($(this)),n.options.onToggle(!1,$(this))):($(this).addClass("active"+i),n.options.onCheck($(this)),n.options.onToggle(!0,$(this)))})},UI.Popup=function(t){var n=this,i=_.uniqueId("UIPopup_"),o,e,a=!1,s=null,u=null,p=null;this.$popup=null,this.state="idle",this.options=$.extend({width:400,animationDuration:500,modal:!0,overlay:!0,onBeforeShow:function(){},onShow:function(t){},onHide:function(t){}},t),this.options.modal!==!0&&(p=new UI.ClickOutside({selector:".popup#"+i+" .window",onClickOutside:function(t){n.hide()}}));var c=function(){l(),n.$popup&&n.$popup.length>0&&(n.$popup.find(".close").on("click",function(t){t.preventDefault(),n.hide()}),!n.options.modal&&p&&p.bind()),$(window).on("resize."+i,function(){d()}),$(document).on("keyup."+i,function(t){switch(t.keyCode){case 27:n.hide()}})},l=function(){$(document).off("keyup."+i),$(window).off("resize."+i),n.options.modal||null===p||p.unbind()},r=function(t,o){var e=new UI.Template("template-ui-popup");return e.render({title:t,content:o,overlay:n.options.overlay?"":"no-overlay",_id:i})},d=function(){if(n.$popup){var t=n.$popup.find(".window").outerHeight();n.$popup.find(".window").css({width:n.options.width,marginTop:-t/2,marginLeft:-n.options.width/2})}};this.showMessage=function(t,i,o){this.hideMessage(function(){var e=new UI.Template("template-ui-popup-message"),u="";switch(t){case"error":u="error";break;case"success":u="success";break;default:u=""}var p=e.render({className:u,content:o});n.$popup&&(n.$popup.find(".messages").html(p).transition({height:n.$popup.find(".messages > .message").outerHeight()},300,"easeOutQuad"),setTimeout(function(){i>0&&(s=setTimeout(function(){n.hideMessage()},i))},300)),a=!0})},this.hideMessage=function(t){clearTimeout(s),a?(this.$popup.find(".messages").transition({height:0},200,"easeOutQuad"),setTimeout(function(){a=!1,n.$popup.find(".messages").empty(),t&&t()},200)):(a=!1,t&&t())},this.changeContent=function(t){this.$popup&&(this.$popup.find(".content").html(t),d())},this.changeTitle=function(t){this.$popup&&(this.$popup.find(".title").html(t),d())},this.setWaitingMode=function(t,i){clearTimeout(u),this.state="waiting",n.$popup&&(n.$popup.find(".window").addClass("wait"),t>0&&(u=setTimeout(function(){n.removeWaitingMode(),i&&i()},t)))},this.removeWaitingMode=function(){clearTimeout(u),this.state="idle",n.$popup&&n.$popup.find(".window").removeClass("wait")},this.show=function(t,i){this.hide(function(){n.$popup=$(r(t,i)),$("body").append(n.$popup),n.options.modal&&$("html,body").css("overflow","hidden"),d(),n.options.onBeforeShow(n),o=new UI.Animate({$element:n.$popup.find(".window"),animationDuration:n.options.animationDuration}),e=new UI.Animate({$element:n.$popup.find(".overlay"),animationDuration:n.options.animationDuration}),e.play("fadeIn"),o.play("appear",function(){c(),n.options.onShow(n)})})},this.hide=function(t){this.$popup&&this.$popup.length>0?(e.play("fadeOut"),o.play("disappear",function(){l(),n.$popup.remove(),n.$popup=null,o=null,e=null,n.options.modal&&$("html,body").css("overflow","auto"),n.options.onHide(n),t&&t()})):t&&t()}},UI.Tabs=function(t){var n=this,i=_.uniqueId("UITabs_"),o;this.options=$.extend({tabsSelector:"#tabs",tabsContentSelector:"#tabs-content",sliding:!0,onTabOpen:function(t){}},t);var e=$(this.options.tabsSelector),a=$(this.options.tabsContentSelector),s=null;this.openTab=function(t){return o=t,c(),p(),this.options.onTabOpen(t),t},this.next=function(){var t=e.find(">a.active").next("a");return t.length>0?n.openTab(u(t)):void 0},this.prev=function(){var t=e.find(">a.active").prev("a");return t.length>0?n.openTab(u(t)):void 0},this.getActive=function(){return active};var u=function(t){var n=t.attr("href");return n?n.substr(1,n.length):void 0},p=function(t){n.options.sliding!==!0||t||a.addClass("sliding");var i=a.find(".page").filter('[data-tab="'+o+'"]');a.find(".page").removeClass("active"),i.addClass("active"),l(),n.options.sliding!==!0||t||(clearTimeout(s),s=setTimeout(function(){a.removeClass("sliding")},450))},c=function(){var t=e.find('>a[href="#'+o+'"]');e.find(">a").removeClass("active"),t.addClass("active"),t.length>0&&e.find(">.marker").css({left:t.position().left,top:t.position().top,width:t.outerWidth(),height:t.outerHeight()})},l=function(){var t=a.width()-(a.outerWidth()-a.width()),n=a.find(".page"),i=n.filter(".active");n.css({width:t}),a.find(".pages").css({width:t*n.length,left:-i.position().left}),a.css({height:i.outerHeight()})},r=function(){e.find(">a").off("click").on("click",function(t){t.preventDefault(),n.openTab(u($(this)))}),a.wrapInner('
'),a.find(".page").css({display:"block"}),o=u(e.find(">a.active")),c(),p(!0),n.options.sliding===!0&&setTimeout(function(){e.addClass("sliding")},1),$(window).off("resize."+i).on("resize."+i,function(){l()})};e.length>0&&a.length>0&&r()},UI.Fullscreen=function(t){var n=this,i=_.uniqueId("UIFullscreen_"),o=null,e=null,a=null;this.options=$.extend({onBeforeShow:function(){},onShow:function(t){},onHide:function(t){},animationDuration:500},t),this.$fs=null;var s=function(t){var n=new UI.Template("template-ui-fullscreen");return n.render(t)},u=function(){p(),n.$fs&&n.$fs.length>0&&n.$fs.find(".close").on("click",function(t){t.preventDefault(),n.hide()}),$(document).on("keyup."+i,function(t){switch(t.keyCode){case 27:n.hide()}})},p=function(){$(document).off("keyup."+i)},c=function(t){a=new UI.Animate({$element:n.$fs.find(".overlay"),animationDuration:n.options.animationDuration}),a.play("fadeIn",function(){t&&t()})},l=function(t){o=new UI.Animate({$element:n.$fs.find(".window"),animationDuration:n.options.animationDuration}),o.play("slideDown",function(){t&&t()})},r=function(){n.$fs=$(s()),$("body").append(n.$fs),$("html,body").css("overflow","hidden")};this.setWaitingMode=function(){var t=this.$fs.find(".loading");t.show(),e=new UI.Animate({$element:t,animationDuration:300}),e.play("appear")},this.removeWaitingMode=function(){e&&e.play("disappear",function(t){t.hide(),e=null})},this.prepare=function(){this.hide(function(){n.options.onBeforeShow(n),r(),c(),n.setWaitingMode()})},this.render=function(t,n){var i=new UI.Template(n?n:"template-ui-fullscreen-content"),o=i.render(t);this.$fs.find(".viewport").html(o)},this.show=function(){this.removeWaitingMode(),l(function(){u(),n.options.onShow(n)})},this.hide=function(t){this.$fs&&this.$fs.length>0?(p(),o.play("slideUp",function(){a.play("fadeOut",function(){n.$fs.remove(),n.$fs=null,o=null,a=null,$("html,body").css("overflow","auto"),n.options.onHide(n),t&&t()})})):t&&t()}}; \ No newline at end of file +var UI={settings:{templateSettings:{interpolate:/\{\{(.+?)\}\}/g}}};UI.ClickOutside=function(t){var n=this,i=_.uniqueId("UIClickOutside_");this.options=$.extend({selector:"",onClickOutside:function(t){}},t),this.bind=function(){this.unbind(),$(document).on("mouseup."+i,function(t){var i=$(n.options.selector);i.is(t.target)||0!==i.has(t.target).length||n.options.onClickOutside(t.target)})},this.unbind=function(){$(document).off("mouseup."+i)}},UI.Animate=function(t){var n=this,i={};this.options=$.extend({$element:"",animationDuration:300},t);var o=this.options.$element;i.fadeIn=function(t){o.transition({opacity:1},n.options.animationDuration,function(){t()})},i.fadeOut=function(t){o.transition({opacity:0},n.options.animationDuration,function(){t()})},i.appear=function(t){o.transition({scale:0,opacity:1,perspective:"1500px",rotateX:"-90deg"},0),o.transition({scale:1,opacity:1,rotateX:"0deg"},n.options.animationDuration,"easeOutBack",function(){t()})},i.disappear=function(t){o.transition({scale:0,opacity:1,rotateX:"90deg"},n.options.animationDuration,"easeInBack",function(){t()})},i.slideDown=function(t){o.transition({scale:.8,opacity:0,y:"-100vh"},0),o.transition({y:"0vh",opacity:1},n.options.animationDuration,"easeOutQuad").transition({scale:1},n.options.animationDuration,"easeOutBack",function(){t()})},i.slideUp=function(t){o.transition({scale:1,opacity:1,y:"0vh"},0),o.transition({scale:.8},n.options.animationDuration,"easeInOutBack").transition({opacity:0,y:"-100vh"},n.options.animationDuration/2,"easeInQuad",function(){t()})},this.play=function(t,e){i[t]?i[t](function(){setTimeout(function(){e&&e(o)},n.options.animationDuration)}):console.error("UI.Animate","Can't find animation method",t)}},UI.Template=function(t){var n=this,i;_.templateSettings=UI.settings.templateSettings;var o=function(){console.warn("UI.Template","Template is empty",t)},e=function(){var n=$("#"+t).html();n&&(i=_.template(n))};this.render=function(t){return i?i(t):void o()},e()},UI.Checker=function(t){var n=this;this.options=$.extend({selector:".checker",onCheck:function(t){},onUncheck:function(t){},onToggle:function(t,n){}},t);var i=$(this.options.selector).find(">a");i.each(function(){$(this).data("originalContent",$(this).html())}),i.off("click.UIChecker").on("click.UIChecker",function(t){t.preventDefault();var i="";$(this).data("activeClass")&&(i=" "+$(this).data("activeClass")),$(this).data("toggledContent")&&$(this).html($(this).data("toggledContent")!=$(this).html()?$(this).data("toggledContent"):$(this).data("originalContent")),$(this).hasClass("active")?($(this).removeClass("active"+i),n.options.onUncheck($(this)),n.options.onToggle(!1,$(this))):($(this).addClass("active"+i),n.options.onCheck($(this)),n.options.onToggle(!0,$(this)))})},UI.Popup=function(t){var n=this,i=_.uniqueId("UIPopup_"),o,e,a=!1,s=null,u=null,p=null;this.$popup=null,this.state="idle",this.options=$.extend({width:400,animationDuration:500,modal:!0,overlay:!0,onBeforeShow:function(){},onShow:function(t){},onHide:function(t){}},t),this.options.modal!==!0&&(p=new UI.ClickOutside({selector:".popup#"+i+" .window",onClickOutside:function(t){n.hide()}}));var c=function(){l(),n.$popup&&n.$popup.length>0&&(n.$popup.find(".close").on("click",function(t){t.preventDefault(),n.hide()}),!n.options.modal&&p&&p.bind()),$(window).on("resize."+i,function(){d()}),$(document).on("keyup."+i,function(t){switch(t.keyCode){case 27:n.hide()}})},l=function(){$(document).off("keyup."+i),$(window).off("resize."+i),n.options.modal||null===p||p.unbind()},r=function(t,o){var e=new UI.Template("template-ui-popup");return e.render({title:t,content:o,overlay:n.options.overlay?"":"no-overlay",_id:i})},d=function(){if(n.$popup){var t=n.$popup.find(".window").outerHeight();n.$popup.find(".window").css({width:n.options.width,marginTop:-t/2,marginLeft:-n.options.width/2})}};this.showMessage=function(t,i,o){this.hideMessage(function(){var e=new UI.Template("template-ui-popup-message"),u="";switch(t){case"error":u="error";break;case"success":u="success";break;default:u=""}var p=e.render({className:u,content:o});n.$popup&&(n.$popup.find(".messages").html(p).transition({height:n.$popup.find(".messages > .message").outerHeight()},300,"easeOutQuad"),setTimeout(function(){i>0&&(s=setTimeout(function(){n.hideMessage()},i))},300)),a=!0})},this.hideMessage=function(t){clearTimeout(s),a?(this.$popup.find(".messages").transition({height:0},200,"easeOutQuad"),setTimeout(function(){a=!1,n.$popup.find(".messages").empty(),t&&t()},200)):(a=!1,t&&t())},this.changeContent=function(t){this.$popup&&(this.$popup.find(".content").html(t),d())},this.changeTitle=function(t){this.$popup&&(this.$popup.find(".title").html(t),d())},this.setWaitingMode=function(t,i){clearTimeout(u),this.state="waiting",n.$popup&&(n.$popup.find(".window").addClass("wait"),t>0&&(u=setTimeout(function(){n.removeWaitingMode(),i&&i()},t)))},this.removeWaitingMode=function(){clearTimeout(u),this.state="idle",n.$popup&&n.$popup.find(".window").removeClass("wait")},this.show=function(t,i){this.hide(function(){n.$popup=$(r(t,i)),$("body").append(n.$popup),n.options.modal&&$("html,body").css("overflow","hidden"),d(),n.options.onBeforeShow(n),o=new UI.Animate({$element:n.$popup.find(".window"),animationDuration:n.options.animationDuration}),e=new UI.Animate({$element:n.$popup.find(".overlay"),animationDuration:n.options.animationDuration}),e.play("fadeIn"),o.play("appear",function(){c(),n.options.onShow(n)})})},this.hide=function(t){this.$popup&&this.$popup.length>0?(e.play("fadeOut"),o.play("disappear",function(){l(),n.$popup.remove(),n.$popup=null,o=null,e=null,n.options.modal&&$("html,body").css("overflow","auto"),n.options.onHide(n),t&&t()})):t&&t()}},UI.Tabs=function(t){var n=this,i=_.uniqueId("UITabs_"),o;this.options=$.extend({tabsSelector:"#tabs",tabsContentSelector:"#tabs-content",sliding:!0,onTabOpen:function(t){}},t);var e=$(this.options.tabsSelector),a=$(this.options.tabsContentSelector),s=null;this.openTab=function(t){return o=t,c(),p(),this.options.onTabOpen(t),t},this.next=function(){var t=e.find(">a.active").next("a");return t.length>0?n.openTab(u(t)):void 0},this.prev=function(){var t=e.find(">a.active").prev("a");return t.length>0?n.openTab(u(t)):void 0},this.getActive=function(){return active};var u=function(t){var n=t.attr("href");return n?n.substr(1,n.length):void 0},p=function(t){n.options.sliding!==!0||t||a.addClass("sliding");var i=a.find(".page").filter('[data-tab="'+o+'"]');a.find(".page").removeClass("active"),i.addClass("active"),l(),n.options.sliding!==!0||t||(clearTimeout(s),s=setTimeout(function(){a.removeClass("sliding")},450))},c=function(){var t=e.find('>a[href="#'+o+'"]');e.find(">a").removeClass("active"),t.addClass("active"),t.length>0&&e.find(">.marker").css({left:t.position().left,top:t.position().top,width:t.outerWidth(),height:t.outerHeight()})},l=function(){var t=a.width()-(a.outerWidth()-a.width()),n=a.find(".page"),i=n.filter(".active");n.css({width:t}),a.find(".pages").css({width:t*n.length,left:-i.position().left}),a.css({height:i.outerHeight()})},r=function(){e.find(">a").off("click").on("click",function(t){t.preventDefault(),n.openTab(u($(this)))}),a.wrapInner('
'),a.find(".page").css({display:"block"}),o=u(e.find(">a.active")),c(),p(!0),n.options.sliding===!0&&setTimeout(function(){e.addClass("sliding")},1),$(window).off("resize."+i).on("resize."+i,function(){l()})};e.length>0&&a.length>0&&r()},UI.Fullscreen=function(t){var n=this,i=_.uniqueId("UIFullscreen_"),o=null,e=null,a=null;this.options=$.extend({onBeforeShow:function(){},onShow:function(t){},onHide:function(t){},animationDuration:500},t),this.$fs=null;var s=function(t){var n=new UI.Template("template-ui-fullscreen");return n.render(t)},u=function(){p(),n.$fs&&n.$fs.length>0&&n.$fs.find(".close").on("click",function(t){t.preventDefault(),n.hide()}),$(document).on("keyup."+i,function(t){switch(t.keyCode){case 27:n.hide()}})},p=function(){$(document).off("keyup."+i)},c=function(t){a=new UI.Animate({$element:n.$fs.find(".overlay"),animationDuration:n.options.animationDuration}),a.play("fadeIn",function(){t&&t()})},l=function(t){o=new UI.Animate({$element:n.$fs.find(".window"),animationDuration:n.options.animationDuration}),o.play("slideDown",function(){t&&t()})},r=function(){n.$fs=$(s()),$("body").append(n.$fs),$("html,body").css("overflow","hidden")};this.setWaitingMode=function(){var t=this.$fs.find(".loading");t.show(),e=new UI.Animate({$element:t,animationDuration:300}),e.play("appear")},this.removeWaitingMode=function(){e&&e.play("disappear",function(t){t.hide(),e=null})},this.prepare=function(){this.hide(function(){n.options.onBeforeShow(n),r(),c(),n.setWaitingMode()})},this.render=function(t,n){var i=new UI.Template(n?n:"template-ui-fullscreen-content"),o=i.render(t);this.$fs.find(".viewport").html(o)},this.show=function(){this.removeWaitingMode(),l(function(){u(),n.options.onShow(n)})},this.hide=function(t){this.$fs&&this.$fs.length>0?(p(),o.play("slideUp",function(){a.play("fadeOut",function(){n.$fs.remove(),n.$fs=null,o=null,a=null,$("html,body").css("overflow","auto"),n.options.onHide(n),t&&t()})})):t&&t()}}; \ No newline at end of file diff --git a/js/ui.js b/js/ui.js index b008e1c..e371389 100644 --- a/js/ui.js +++ b/js/ui.js @@ -139,25 +139,32 @@ UI.Animate = function(options){ UI.Template = function(templateName){ - var _this = this; + var _this = this, + template; _.templateSettings = UI.settings.templateSettings; + var warn = function(){ + console.warn('UI.Template', 'Template is empty', templateName); + }; + var getTemplate = function(){ - var template = $('#' + templateName).html(); + var t = $('#' + templateName).html(); - if(template){ - return template; - }else{ - console.error('UI.Template', 'Template is empty', templateName); + if(t){ + template = _.template(t); } }; this.render = function(data){ - var template = _.template(getTemplate()); - - return template(data); + if(template){ + return template(data); + }else{ + warn(); + } }; + + getTemplate(); }; @@ -698,7 +705,7 @@ UI.Fullscreen = function(options){ }; this.prepare = function(){ - this.hide(function(){ + this.hide(function(){ _this.options.onBeforeShow(_this); prepareContainer(); From c418a235edd0ceb36e6bb2b45211a12c6eb9ab4d Mon Sep 17 00:00:00 2001 From: Ruslan Date: Mon, 13 Apr 2015 22:41:22 +0300 Subject: [PATCH 4/4] Glossary bug --- config.codekit | 22 ++++++++++++---------- glossary.html | 4 ++-- jade/glossary.jade | 4 ++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/config.codekit b/config.codekit index 40d378d..02e8f9d 100644 --- a/config.codekit +++ b/config.codekit @@ -362,15 +362,6 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, - "\/glossary.html": { - "fileType": 8192, - "ignore": 1, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/glossary.html", - "outputAbbreviatedPath": "No Output Path", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0 - }, "\/grid.html": { "fileType": 8192, "ignore": 1, @@ -774,6 +765,17 @@ "outputStyle": 1, "syntaxCheckerStyle": 1 }, + "\/js\/ui.js": { + "fileType": 64, + "ignore": 0, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/js\/ui.js", + "outputAbbreviatedPath": "\/js\/min\/ui-min.js", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0, + "outputStyle": 1, + "syntaxCheckerStyle": 1 + }, "\/nav-h.html": { "fileType": 8192, "ignore": 1, @@ -2685,7 +2687,7 @@ }, "hooks": [ ], -"lastSavedByUser": "Ruslan Shashkov", +"lastSavedByUser": "Ruslan", "manualImportLinks": { }, "projectAttributes": { diff --git a/glossary.html b/glossary.html index 54e8979..d240aa4 100644 --- a/glossary.html +++ b/glossary.html @@ -39,7 +39,7 @@

Coloured glossary

- +
@@ -58,7 +58,7 @@

Yes, transparent style is applicable too

- +
diff --git a/jade/glossary.jade b/jade/glossary.jade index 8f80dc2..e715fe1 100644 --- a/jade/glossary.jade +++ b/jade/glossary.jade @@ -57,6 +57,8 @@ block content i.fa.fa-gamepad span.text Games + br + .grid.marginless include partials/code include partials/colorable @@ -99,6 +101,8 @@ block content span.icon: i.fa.fa-gamepad.color-dark-gray-light span.text Games + br + .grid.marginless include partials/code include partials/colorable