From d1dd46f9239d1b81392aac8535636f749187ffba Mon Sep 17 00:00:00 2001 From: Chip Senkbeil Date: Tue, 29 Sep 2015 22:54:36 -0500 Subject: Removed unused sidecomments js and pointer events polyfill, updated README with new documentation --- README.md | 112 +++++++++++++----------- TODO | 11 --- static/css/side-comments.min.css | 1 - static/css/themes/default-theme.min.css | 1 - static/js/pointer-events-polyfill.js | 146 -------------------------------- static/js/side-comments.min.js | 1 - 6 files changed, 62 insertions(+), 210 deletions(-) delete mode 100644 TODO delete mode 100644 static/css/side-comments.min.css delete mode 100644 static/css/themes/default-theme.min.css delete mode 100644 static/js/pointer-events-polyfill.js delete mode 100644 static/js/side-comments.min.js diff --git a/README.md b/README.md index ede9908..0346971 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ GridSide Theme ============== The GridSide theme is a multi-page portfolio and blog utilizing the -[Materialize][materialize] frontend framework. Medium-style comments may be -added to blog entries using [SideComments.js][sidecomments.js]. +[Materialize][materialize] frontend framework. Comments can be added using +Disqus. The theme contains a main page with a single grid of images representing -different sections of the website. Sections can be marked as blog, project, -contact, or miscellaneous in order to provide slight changes in styling. +different sections of the website. Sections can be _post_, _gallery_, or +_project_ for various rendering. - Current Materialize version is `0.97.0`. - Current Font Awesome version is `4.4.0`. @@ -27,14 +27,10 @@ Contents - [Installation](#installation) - [Getting Started](#getting-started) - [The Config File](#the-config-file) - - [Adding a Blog Section](#adding-a-blog-section) - - [Optional - Adding Medium-style Comments with Hull.io](#optional---adding-medium-style-comments-with-hullio) - - [Adding a Project Section](#adding-a-project-section) - - [Adding a Contact Section](#adding-a-contact-section) - - [Adding a Miscellaneous Section](#adding-a-miscellaneous-section) + - [Adding a custom post section](#adding-a-custom-post-section) + - [Adding a custom project section](#adding-a-custom-project-section) + - [Adding a custom gallery section](#adding-a-custom-gallery-section) - [Nearly Finished](#nearly-finished) -- [TODO](#todo) -- [Notes](#notes) - [Contributing](#contributing) - [License](#license) @@ -45,7 +41,7 @@ Inside the folder of your Hugo site run: $ mkdir themes $ cd themes - $ git clone https://github.com/rcsenkbeil/grid-side + $ git clone https://github.com/chipsenkbeil/grid-side For more information read the official [setup guide][setup_guide] of Hugo. @@ -56,57 +52,77 @@ Getting Started Take a look inside the [`exampleSite`][exampleSite] folder of this theme. You'll find a file called [`config.toml`][config.toml]. To use it, copy the -[`config.toml`][config.toml] in the root folder of your Hugo site. Feel free +[`config.toml`][config.toml] in the root folder of your Hugo site. The config +file contains detailed explanation of each available property. Feel free to customize this theme as you like. -### Adding a Blog Section ### +### Adding a custom post section ### -TODO +By default, the theme provides a custom view of `post/`. If you would like +to have a different section name than post, you can specify the section by +creating the following: -#### Optional - Adding Medium-style Comments with Hull.io #### +``` +For layouts/custom_post_section/single.html: -TODO +{{ partial "post/single.html" . }} -### Adding a Project Section ### +``` -TODO +``` +For layouts/section/custom_post_section.html: -### Adding a Contact Section ### +{{ partial "post/list.html" . }} -TODO +``` -### Adding a Miscellaneous Section ### +### Adding a custom project section ### -TODO +By default, the theme provides a custom view of `project/`. If you would like +to have a different section name than project, you can specify the section by +creating the following: -### Nearly Finished ### +``` +For layouts/custom_project_section/single.html: -In order to see your site in action, run Hugo's built-in local server. +{{ partial "project/single.html" . }} - $ hugo server -w +``` -Now enter `localhost:1313` in the address bar of your browser. +``` +For layouts/section/custom_project_section.html: + +{{ partial "project/list.html" . }} + +``` + +### Adding a custom gallery section ### + +By default, the theme provides a custom view of `gallery/`. If you would like +to have a different section name than gallery, you can specify the section by +creating the following: -TODO ----- +``` +For layouts/custom_gallery_section/single.html: -See [TODO][todo] for more information. +{{ partial "gallery/single.html" . }} -Notes ------ +``` -Currently there are two features that require Javascript: parallax scrolling -and centering text within the grid. +``` +For layouts/section/custom_gallery_section.html: -Parallax is provided by the Materialize library. +{{ partial "gallery/list.html" . }} -Centering text is a hack that will hopefully be removed in the future, but -is needed to center text within a floating element. The culprit is the -Materialize column adding a `float: left`, causing flexbox alignments to -be ignored. See [here][centering_problem] for more information. +``` -Potential grid replacement would be [Flexbox Grid][flexbox_grid], which -should allow proper vertical centering. +### Nearly Finished ### + +In order to see your site in action, run Hugo's built-in local server. + + $ hugo server -w + +Now enter `localhost:1313` in the address bar of your browser. Contributing ------------ @@ -121,14 +137,10 @@ This theme is released under the MIT License. For more information read the [license][license]. [materialize]: http://www.materializecss.com/ -[sidecomments.js]: https://github.com/aroc/side-comments [setup_guide]: http://gohugo.io/overview/installing/ -[exampleSite]: https://github.com/rcsenkbeil/grid-side/tree/master/exampleSite -[config.toml]: https://github.com/rcsenkbeil/grid-side/blob/master/exampleSite/config.toml -[issue_tracker]: https://github.com/rcsenkbeil/grid-side/issues -[pull_request]: https://github.com/rcsenkbeil/grid-side/pulls -[license]: https://github.com/rcsenkbeil/grid-side/blob/master/LICENSE -[centering_problem]: https://github.com/Dogfalo/materialize/issues/1241 -[flexbox_grid]: http://flexboxgrid.com -[todo]: https://github.com/rcsenkbeil/grid-side/blob/master/TODO +[exampleSite]: https://github.com/chipsenkbeil/grid-side/tree/master/exampleSite +[config.toml]: https://github.com/chipsenkbeil/grid-side/blob/master/exampleSite/config.toml +[issue_tracker]: https://github.com/chipsenkbeil/grid-side/issues +[pull_request]: https://github.com/chipsenkbeil/grid-side/pulls +[license]: https://github.com/chipsenkbeil/grid-side/blob/master/LICENSE diff --git a/TODO b/TODO deleted file mode 100644 index 7447d4e..0000000 --- a/TODO +++ /dev/null @@ -1,11 +0,0 @@ -TODO -==== - -1. Add project single page (or pages?) -2. Add project list page -3. Revise 404.html page -4. Refactor gallery to be a section whose entire content is in a partial - (so more easily used in other sections) -5. Add project section whose entire content is in a partial -6. Refactor existing partials to be more organized - diff --git a/static/css/side-comments.min.css b/static/css/side-comments.min.css deleted file mode 100644 index fdd6ce1..0000000 --- a/static/css/side-comments.min.css +++ /dev/null @@ -1 +0,0 @@ -@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}.commentable-section{position:relative}.commentable-section:hover .side-comment .marker{display:block}.side-comment{position:absolute;top:0;right:0;width:20px;min-height:100%;height:100%}.side-comment *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.side-comment .hide{display:none}.side-comment .marker{display:none;position:absolute;top:0;right:0;cursor:pointer}.side-comment .marker span{display:none}.side-comment.active .marker,.side-comment.has-comments .marker,.side-comment.has-comments ul.comments{display:block}.side-comment .add-comment{display:none}.side-comment.has-comments .add-comment,.side-comment.no-current-user .add-comment{display:block}.side-comment.no-current-user .add-comment{margin-top:20px}.side-comment.has-comments .marker:before{content:""}.side-comment.has-comments .marker span{display:block}.side-comment.has-comments .add-comment.hide,.side-comment.has-comments .comment-form{display:none}.side-comment .comments-wrapper{display:none;position:absolute;top:0;left:40px}.side-comment .comments{list-style:none;padding:0;margin:0;display:none;width:100%}.side-comment .comments li{width:100%;overflow:hidden}.side-comment .actions,.side-comment .comment,.side-comment .comment-box{margin:0}.side-comment .actions,.side-comment .delete{margin-left:42px}.side-comment .add-comment.active{display:block}.side-comment .comment-form{overflow:hidden}.side-comment .comment-form.active,.side-comment.active .comments-wrapper{display:block}@media (max-width:768px){body{-webkit-overflow-scrolling:touch;overflow-x:hidden}} \ No newline at end of file diff --git a/static/css/themes/default-theme.min.css b/static/css/themes/default-theme.min.css deleted file mode 100644 index 7a822dd..0000000 --- a/static/css/themes/default-theme.min.css +++ /dev/null @@ -1 +0,0 @@ -.commentable-container{-webkit-transition:all .22s ease;transition:all .22s ease}.side-comments-open{-webkit-transform:translate(-220px,0);-ms-transform:translate(-220px,0);transform:translate(-220px,0)}.commentable-section{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-right:30px}.side-comment{padding-bottom:20px}.side-comment .marker{width:20px;height:18px;background:#DEDEDC;border-radius:2px;text-decoration:none}.side-comment .marker span,.side-comment .marker:before{content:"+";position:absolute;width:20px;height:18px;line-height:16px;font-size:14px;color:#FFF;text-align:center}.side-comment .marker span{line-height:20px;font-size:12px}.side-comment .marker:after{content:"";display:block;position:absolute;bottom:-7px;left:5px;width:0;border-width:7px 8px 0 0;border-style:solid;border-color:#DEDEDC transparent}.side-comment .marker:hover,.side-comment.active .marker{background:#4FAF62}.side-comment .marker:hover:after,.side-comment.active .marker:after{border-color:#4FAF62 transparent}.side-comment .comments-wrapper{top:-22px;width:200px;padding-bottom:120px}.side-comment.active .comments-wrapper{-webkit-animation:fadein .2s;animation:fadein .2s}.side-comment.has-comments .comments-wrapper{top:-22px}.side-comment .comment-form,.side-comment ul.comments li{border:1px solid #F2F2F0;border-left:0;border-right:0;padding:15px 0;margin-top:-1px}.side-comment .comment,.side-comment .comment-box{font-size:14px;line-height:18px}.side-comment .author-avatar{float:left;width:32px;height:32px;margin-right:10px}.side-comment .author-avatar img{width:100%;height:100%}.side-comment .right-of-avatar{float:left;width:158px}.side-comment .author-name{font-size:15px;line-height:16px;margin:0 0 2px;font-weight:700;text-decoration:none;color:#222}.side-comment a.author-name:hover{color:#444}.side-comment .action-link{color:#B3B3B1;font-size:13px;text-decoration:none}.side-comment .action-link:hover{text-decoration:none}.side-comment .action-link.post .post{color:#89C794}.side-comment .action-link.post .post:hover{color:#468c54}.side-comment .action-link.cancel:hover,.side-comment .action-link.delete:hover{color:#57AD68}.side-comment .add-comment{color:#B3B3B1;font-size:14px;line-height:22px;font-weight:300;padding:0 8px;letter-spacing:.05em;text-decoration:none;margin-top:10px}.side-comment .add-comment:before{content:"+";border:2px solid #DEDEDC;border-radius:100px;width:23px;height:23px;color:#DEDEDC;display:block;text-align:center;font-size:16px;font-weight:400;line-height:18px;float:left;margin-right:15px;letter-spacing:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.side-comment .add-comment:hover{text-decoration:none;color:#4FAF62}.side-comment .add-comment:hover:before{border-color:#4FAF62;color:#4FAF62}.side-comment .comment-box{outline:0;border:none;padding:0}.side-comment .actions{margin-top:5px}.side-comment .actions a{float:left}.side-comment .actions .cancel:before{content:'\00B7';color:#B3B3B1;padding:0 5px}@media (max-width:768px){.side-comments-open{-webkit-transform:translate(-220px,0);-ms-transform:translate(-220px,0);transform:translate(-220px,0)}.side-comment .comments-wrapper{width:200px}.side-comment .right-of-avatar{width:158px}.side-comment .marker{display:block}} \ No newline at end of file diff --git a/static/js/pointer-events-polyfill.js b/static/js/pointer-events-polyfill.js deleted file mode 100644 index bb6a77b..0000000 --- a/static/js/pointer-events-polyfill.js +++ /dev/null @@ -1,146 +0,0 @@ -(function() { - /* From http://stackoverflow.com/a/2401861/3164172 , modified by me */ - navigator.browserInfo = (function() { - var newResult = function(name, version, full) { - var result = { name: "", version: "", full: "" }; - result.name = (name || "").toLowerCase(); - result.version = (version || "").toLowerCase(); - result.full = ( - full || (result.name + " " + result.version).trim() - ).toLowerCase(); - return result; - }; - - var ua = navigator.userAgent, tem, - M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; - if (/trident/i.test(M[1])) { - tem = /\brv[ :]+(\d+)/g.exec(ua) || []; - return newResult("IE", tem[1]); - } - if (M[1] === "Chrome") { - tem = ua.match(/\b(OPR|Edge)\/(\d+)/); - if (tem != null) return newResult( - tem[1].replace("OPR", "Opera"), - tem[2], - tem.slice(1).join(" ").replace("OPR", "Opera") - ); - } - M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, "-?"]; - if ((tem = ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]); - return newResult(M[0], M[1], M.join(" ").trim()); - })(); - - /* If browser and version is okay, don't apply polyfill */ - /* TODO: Provide better way to check for CSS4 pointer-events support */ - if (navigator.browserInfo.name === "firefox" && - parseFloat(navigator.browserInfo.version) >= 38) { - console.log("Ignoring pointer events polyfill, browser is okay!"); - return; - } - - // Returns the pointer events for the specified element - var getPointerEventsStyle = function(element) { - var view, computedStyle, pointerEvents; - if (element && element.nodeType === Element.ELEMENT_NODE) { - view = document.defaultView || window; - if (view) { - computedStyle = view.getComputedStyle(element); - if (computedStyle && - typeof computedStyle.getPropertyValue === "function") - { - pointerEvents = - computedStyle.getPropertyValue("pointer-events"); - } - } - } - - return pointerEvents || undefined; - }; - - /* Adds listeners to follow the pointer-events css */ - var attachPointerEventsPolyfill = function(node) { - var initialPointerEvents = getPointerEventsStyle(node); - - // If no pointer events specified, do not attach listeners - if (!node || !initialPointerEvents) { - return; - } else { - console.log("Attaching pointer events to", node.nodeName); - }; - - var events = [ - "click", "dblclick", "mousedown", "mouseup", "mouseover", - "mouseout", "mousemove", "drag", "dragstart", "dragend", - "dragleave", "dragover", "drop", "mousewheel", "scroll", - "contextmenu" - ]; - - var eventFunction = function(e) { - var pointerEvents = getPointerEventsStyle(node) || "auto"; - - // If no pointer events, cancel this mouse event - if (pointerEvents === "none") { - console.log("Cancelling event!"); - e.preventDefault(); - } else { - console.log("Not cancelling event!"); - } - }; - - events.forEach(function(eventName) { - node.addEventListener(eventName, eventFunction, false); - }); - }; - - var target = document.querySelector("body"); - - // Recursively attach handlers to nodes - function runPolyfill(node) { - if (!node) return; - - var name = node.nodeName; - - // Add pointer events to this node - try { - attachPointerEventsPolyfill(node); - } catch (ex) { - console.error("Failed to add pointer events to", name, ":", ex); - } - - // Add pointer events to all child nodes - var childNodes = node.childNodes; - for (var i = 0; i < childNodes.length; ++i) { - runPolyfill(childNodes[i]); - } - } - runPolyfill(target); - - var observer = new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { - var addedNodes = mutations.addedNodes; - if (addedNodes) { - for (var i = 0; i < addedNodes.length; ++i) { - runPolyfill(addedNodes[i]); - } - } - - var removedNodes = mutations.removedNodes; - if (removedNodes) { - for (var i = 0; i < removedNodes.length; ++i) { - /* TODO: Remove listeners? */ - } - } - - // TODO: Handle addition/removal of pointer-events styling - }); - }); - - var config = { - childList: true, - subtree: true - }; - - //observer.observe(target, config); - observer.observe(target, config); -})(); - diff --git a/static/js/side-comments.min.js b/static/js/side-comments.min.js deleted file mode 100644 index 6a29aaf..0000000 --- a/static/js/side-comments.min.js +++ /dev/null @@ -1 +0,0 @@ -function require(e,t,n){var r=require.resolve(e);if(null==r){n=n||e,t=t||"root";var o=new Error('Failed to require "'+n+'" from "'+t+'"');throw o.path=n,o.parent=t,o.require=!0,o}var i=require.modules[r];if(!i._resolving&&!i.exports){var s={};s.exports={},s.client=s.component=!0,i._resolving=!0,i.call(this,s.exports,require.relative(r),s),delete i._resolving,i.exports=s.exports}return i.exports}require.modules={},require.aliases={},require.resolve=function(e){"/"===e.charAt(0)&&(e=e.slice(1));for(var t=[e,e+".js",e+".json",e+"/index.js",e+"/index.json"],n=0;nr;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),require.register("side-comments/js/main.js",function(e,t,n){function r(e,t,n){this.$el=$(e),this.$body=$("body"),this.eventPipe=new s,this.currentUser=o.clone(t)||null,this.existingComments=o.cloneDeep(n)||[],this.sections=[],this.activeSection=null,this.eventPipe.on("showComments",o.bind(this.showComments,this)),this.eventPipe.on("hideComments",o.bind(this.hideComments,this)),this.eventPipe.on("sectionSelected",o.bind(this.sectionSelected,this)),this.eventPipe.on("sectionDeselected",o.bind(this.sectionDeselected,this)),this.eventPipe.on("commentPosted",o.bind(this.commentPosted,this)),this.eventPipe.on("commentDeleted",o.bind(this.commentDeleted,this)),this.eventPipe.on("addCommentAttempted",o.bind(this.addCommentAttempted,this)),this.$body.on("click",o.bind(this.bodyClick,this)),this.initialize(this.existingComments)}var o=t("./vendor/lodash-custom.js"),i=t("./section.js"),s=t("emitter");s(r.prototype),r.prototype.initialize=function(){o.each(this.$el.find(".commentable-section"),function(e){var t=$(e),n=t.data("section-id").toString(),r=o.find(this.existingComments,{sectionId:n});this.sections.push(new i(this.eventPipe,t,this.currentUser,r))},this)},r.prototype.showComments=function(){this.$el.addClass("side-comments-open")},r.prototype.hideComments=function(){this.activeSection&&(this.activeSection.deselect(),this.activeSection=null),this.$el.removeClass("side-comments-open")},r.prototype.sectionSelected=function(e){this.showComments(),this.activeSection&&this.activeSection.deselect(),this.activeSection=e},r.prototype.sectionDeselected=function(){this.hideComments(),this.activeSection=null},r.prototype.commentPosted=function(e){this.emit("commentPosted",e)},r.prototype.commentDeleted=function(e){this.emit("commentDeleted",e)},r.prototype.addCommentAttempted=function(){this.emit("addCommentAttempted")},r.prototype.insertComment=function(e){var t=o.find(this.sections,{id:e.sectionId});t.insertComment(e)},r.prototype.removeComment=function(e,t){var n=o.find(this.sections,{id:e});n.removeComment(t)},r.prototype.deleteComment=function(e,t){var n=o.find(this.sections,{id:e});n.deleteComment(t)},r.prototype.commentsAreVisible=function(){return this.$el.hasClass("side-comments-open")},r.prototype.bodyClick=function(e){var t=$(e.target);t.closest(".side-comment").length<1&&t.closest("body").length>0&&(this.activeSection&&this.activeSection.deselect(),this.hideComments())},r.prototype.setCurrentUser=function(e){this.hideComments(),this.currentUser=e,o.each(this.sections,function(e){e.currentUser=this.currentUser,e.render()})},r.prototype.removeCurrentUser=function(){this.hideComments(),this.currentUser=null,o.each(this.sections,function(e){e.currentUser=null,e.render()})},r.prototype.destroy=function(){this.hideComments(),this.$el.off()},n.exports=r}),require.register("side-comments/js/section.js",function(e,t,n){function r(e,t,n,r){this.eventPipe=e,this.$el=t,this.comments=r?r.comments:[],this.currentUser=n||null,this.clickEventName=a()?"touchstart":"click",this.id=t.data("section-id"),this.$el.on(this.clickEventName,".side-comment .marker",o.bind(this.markerClick,this)),this.$el.on(this.clickEventName,".side-comment .add-comment",o.bind(this.addCommentClick,this)),this.$el.on(this.clickEventName,".side-comment .post",o.bind(this.postCommentClick,this)),this.$el.on(this.clickEventName,".side-comment .cancel",o.bind(this.cancelCommentClick,this)),this.$el.on(this.clickEventName,".side-comment .delete",o.bind(this.deleteCommentClick,this)),this.render()}var o=t("./vendor/lodash-custom.js"),i=t("../templates/section.html"),s=t("../templates/comment.html"),a=t("./helpers/mobile-check.js");r.prototype.markerClick=function(e){e.preventDefault(),this.select()},r.prototype.addCommentClick=function(e){e.preventDefault(),this.currentUser?this.showCommentForm():this.eventPipe.emit("addCommentAttempted")},r.prototype.showCommentForm=function(){this.comments.length>0&&(this.$el.find(".add-comment").addClass("hide"),this.$el.find(".comment-form").addClass("active")),this.focusCommentBox()},r.prototype.hideCommentForm=function(){this.comments.length>0&&(this.$el.find(".add-comment").removeClass("hide"),this.$el.find(".comment-form").removeClass("active")),this.$el.find(".comment-box").empty()},r.prototype.focusCommentBox=function(){setTimeout(o.bind(function(){this.$el.find(".comment-box").get(0).focus()},this),300)},r.prototype.cancelCommentClick=function(e){e.preventDefault(),this.cancelComment()},r.prototype.cancelComment=function(){this.comments.length>0?this.hideCommentForm():(this.deselect(),this.eventPipe.emit("hideComments"))},r.prototype.postCommentClick=function(e){e.preventDefault(),this.postComment()},r.prototype.postComment=function(){var e=this.$el.find(".comment-box"),t=e.val(),n={sectionId:this.id,comment:t,authorAvatarUrl:this.currentUser.avatarUrl,authorName:this.currentUser.name,authorId:this.currentUser.id,authorUrl:this.currentUser.authorUrl||null};e.val(""),this.eventPipe.emit("commentPosted",n)},r.prototype.insertComment=function(e){this.comments.push(e);var t=o.template(s,{comment:e,currentUser:this.currentUser});this.$el.find(".comments").append(t),this.$el.find(".side-comment").addClass("has-comments"),this.updateCommentCount(),this.hideCommentForm()},r.prototype.updateCommentCount=function(){this.$el.find(".marker span").text(this.comments.length)},r.prototype.deleteCommentClick=function(e){e.preventDefault();var t=$(e.target).closest("li").data("comment-id");window.confirm("Are you sure you want to delete this comment?")&&this.deleteComment(t)},r.prototype.deleteComment=function(e){var t=o.find(this.comments,{id:e});t.sectionId=this.id,this.eventPipe.emit("commentDeleted",t)},r.prototype.removeComment=function(e){this.comments=o.reject(this.comments,{id:e}),this.$el.find('.side-comment .comments li[data-comment-id="'+e+'"]').remove(),this.updateCommentCount(),this.comments.length<1&&this.$el.find(".side-comment").removeClass("has-comments")},r.prototype.select=function(){this.isSelected()?(this.deselect(),this.eventPipe.emit("sectionDeselected",this)):(this.$el.find(".side-comment").addClass("active"),0===this.comments.length&&this.currentUser&&this.focusCommentBox(),this.eventPipe.emit("sectionSelected",this))},r.prototype.deselect=function(){this.$el.find(".side-comment").removeClass("active"),this.hideCommentForm()},r.prototype.isSelected=function(){return this.$el.find(".side-comment").hasClass("active")},r.prototype.sectionClasses=function(){var e="";return this.comments.length>0&&(e+=" has-comments"),this.currentUser||(e+=" no-current-user"),e},r.prototype.render=function(){this.$el.find(".side-comment").remove(),$(o.template(i,{commentTemplate:s,comments:this.comments,sectionClasses:this.sectionClasses(),currentUser:this.currentUser})).appendTo(this.$el)},r.prototype.destroy=function(){this.$el.off()},n.exports=r}),require.register("side-comments/js/vendor/lodash-custom.js",function(e,t,n){(function(){function t(e){return"\\"+ht[e]}function r(){return z.pop()||[]}function o(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}function i(e){e.length=0,z.lengtho?0:o);++r-1:void 0});return a.pop(),c.pop(),k&&(i(a),i(c)),l}function f(e,t,n,r,o,i){var a=1&t,l=2&t,u=4&t,m=16&t,h=32&t;if(!l&&!x(e))throw new TypeError;m&&!n.length&&(t&=-17,m=n=!1),h&&!r.length&&(t&=-33,h=r=!1);var d=e&&e.__bindData__;if(d&&d!==!0)return d=s(d),d[2]&&(d[2]=s(d[2])),d[3]&&(d[3]=s(d[3])),!a||1&d[1]||(d[4]=o),!a&&1&d[1]&&(t|=8),!u||4&d[1]||(d[5]=i),m&&St.apply(d[2]||(d[2]=[]),n),h&&Et.apply(d[3]||(d[3]=[]),r),d[1]|=t,f.apply(null,d);var g=1==t||17===t?c:p;return g([e,t,n,r,o,i])}function d(){mt.shadowedProps=X,mt.array=mt.bottom=mt.loop=mt.top="",mt.init="iterable",mt.useHas=!0;for(var e,t=0;e=arguments[t];t++)for(var n in e)mt[n]=e[n];var r=mt.args;mt.firstArg=/^[^,]+/.exec(r)[0];var o=Function("baseCreateCallback, errorClass, errorProto, hasOwnProperty, indicatorObject, isArguments, isArray, isString, keys, objectProto, objectTypes, nonEnumProps, stringClass, stringProto, toString","return function("+r+") {\n"+Nt(mt)+"\n}");return o(m,rt,Ct,Pt,F,b,Ft,_,mt.keys,kt,pt,Lt,ct,xt,wt)}function g(e){return Wt[e]}function v(e){return"function"==typeof e&&_t.test(e)}function b(e){return e&&"object"==typeof e&&"number"==typeof e.length&&wt.call(e)==Z||!1}function y(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(r=n,n=t,t=!1),l(e,t,"function"==typeof n&&m(n,r,1))}function C(e,t,n){return l(e,!0,"function"==typeof t&&m(t,n,1))}function x(e){return"function"==typeof e}function w(e){return!(!e||!pt[typeof e])}function _(e){return"string"==typeof e||e&&"object"==typeof e&&wt.call(e)==ct||!1}function j(e){for(var t=-1,n=Rt(e),r=n.length,o=Array(r);++t2?f(e,17,s(arguments,2),null,t):f(e,1,null,null,t)}function A(e,t,n){var r=typeof e;if(null==e||"function"==r)return m(e,t,n);if("object"!=r)return L(e);var o=Rt(e),i=o[0],s=e[i];return 1!=o.length||s!==s||w(s)?function(t){for(var n=o.length,r=!1;n--&&(r=h(t[o[n]],e[o[n]],null,!0)););return r}:function(e){var t=e[i];return s===t&&(0!==s||1/s==1/t)}}function U(e){return null==e?"":String(e).replace(Gt,g)}function O(e){return e}function D(){}function L(e){return function(t){return t[e]}}function I(e,n,r){var o=a.templateSettings;e=String(e||""),r=Mt({},r,o);var i,s=Mt({},r.imports,o.imports),c=Rt(s),l=j(s),u=0,m=r.interpolate||K,p="__p += '",h=RegExp((r.escape||K).source+"|"+m.source+"|"+(m===J?V:K).source+"|"+(r.evaluate||K).source+"|$","g");e.replace(h,function(n,r,o,s,a,c){return o||(o=s),p+=e.slice(u,c).replace(Q,t),r&&(p+="' +\n__e("+r+") +\n'"),a&&(i=!0,p+="';\n"+a+";\n__p += '"),o&&(p+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),u=c+n.length,n}),p+="';\n";var f=r.variable,d=f;d||(f="obj",p="with ("+f+") {\n"+p+"\n}\n"),p=(i?p.replace(R,""):p).replace(H,"$1").replace(B,"$1;"),p="function("+f+") {\n"+(d?"":f+" || ("+f+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+Y++ +"]")+"\n*/";try{var v=Function(c,"return "+p+g).apply(N,l)}catch(b){throw b.source=p,b}return n?v(n):(v.source=p,v)}var N,z=[],F={},T=40,R=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,W=/\w*$/,G=/^\s*function[ \n\r\t]+\w/,J=/<%=([\s\S]+?)%>/g,K=/($^)/,M=/\bthis\b/,Q=/['\n\r\t\u2028\u2029\\]/g,X=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Y=0,Z="[object Arguments]",et="[object Array]",tt="[object Boolean]",nt="[object Date]",rt="[object Error]",ot="[object Function]",it="[object Number]",st="[object Object]",at="[object RegExp]",ct="[object String]",lt={};lt[ot]=!1,lt[Z]=lt[et]=lt[tt]=lt[nt]=lt[it]=lt[st]=lt[at]=lt[ct]=!0;var ut={configurable:!1,enumerable:!1,value:null,writable:!1},mt={args:"",array:null,bottom:"",firstArg:"",init:"",keys:null,loop:"",shadowedProps:null,support:null,top:"",useHas:!1},pt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},ht={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},ft=pt[typeof window]&&window||this,dt=pt[typeof e]&&e&&!e.nodeType&&e,gt=pt[typeof n]&&n&&!n.nodeType&&n,vt=gt&>.exports===dt&&dt,bt=pt[typeof global]&&global;!bt||bt.global!==bt&&bt.window!==bt||(ft=bt);var yt=[],Ct=Error.prototype,kt=Object.prototype,xt=String.prototype,wt=kt.toString,_t=RegExp("^"+String(wt).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),jt=Function.prototype.toString,Pt=kt.hasOwnProperty,St=yt.push,$t=kt.propertyIsEnumerable,Et=yt.unshift,qt=function(){try{var e={},t=v(t=Object.defineProperty)&&t,n=t(e,e,e)&&t}catch(r){}return n}(),At=v(At=Object.create)&&At,Ut=v(Ut=Array.isArray)&&Ut,Ot=v(Ot=Object.keys)&&Ot,Dt={};Dt[et]=Array,Dt[tt]=Boolean,Dt[nt]=Date,Dt[ot]=Function,Dt[st]=Object,Dt[it]=Number,Dt[at]=RegExp,Dt[ct]=String;var Lt={};Lt[et]=Lt[nt]=Lt[it]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Lt[tt]=Lt[ct]={constructor:!0,toString:!0,valueOf:!0},Lt[rt]=Lt[ot]=Lt[at]={constructor:!0,toString:!0},Lt[st]={constructor:!0},function(){for(var e=X.length;e--;){var t=X[e];for(var n in Lt)Pt.call(Lt,n)&&!Pt.call(Lt[n],t)&&(Lt[n][t]=!1)}}();var It=a.support={};!function(){var e=function(){this.x=1},t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments);It.argsClass=wt.call(arguments)==Z,It.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),It.enumErrorProps=$t.call(Ct,"message")||$t.call(Ct,"name"),It.enumPrototypes=$t.call(e,"prototype"),It.funcDecomp=!v(ft.WinRTError)&&M.test(function(){return this}),It.funcNames="string"==typeof Function.name,It.nonEnumArgs=0!=r,It.nonEnumShadows=!/valueOf/.test(n),It.spliceObjects=(yt.splice.call(t,0,1),!t[0]),It.unindexedChars="x"[0]+Object("x")[0]!="xx";try{It.nodeClass=!(wt.call(document)==st&&!({toString:0}+""))}catch(o){It.nodeClass=!0}}(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:J,variable:"",imports:{_:a}};var Nt=function(e){var t="var index, iterable = "+e.firstArg+", result = "+e.init+";\nif (!iterable) return result;\n"+e.top+";";e.array?(t+="\nvar length = iterable.length; index = -1;\nif ("+e.array+") { ",It.unindexedChars&&(t+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),t+="\n while (++index < length) {\n "+e.loop+";\n }\n}\nelse { "):It.nonEnumArgs&&(t+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+e.loop+";\n }\n } else { "),It.enumPrototypes&&(t+="\n var skipProto = typeof iterable == 'function';\n "),It.enumErrorProps&&(t+="\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");var n=[];if(It.enumPrototypes&&n.push('!(skipProto && index == "prototype")'),It.enumErrorProps&&n.push('!(skipErrorProps && (index == "message" || index == "name"))'),e.useHas&&e.keys)t+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n",n.length&&(t+=" if ("+n.join(" && ")+") {\n "),t+=e.loop+"; ",n.length&&(t+="\n }"),t+="\n } ";else if(t+="\n for (index in iterable) {\n",e.useHas&&n.push("hasOwnProperty.call(iterable, index)"),n.length&&(t+=" if ("+n.join(" && ")+") {\n "),t+=e.loop+"; ",n.length&&(t+="\n }"),t+="\n } ",It.nonEnumShadows){for(t+="\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ",k=0;7>k;k++)t+="\n index = '"+e.shadowedProps[k]+"';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))",e.useHas||(t+=" || (!nonEnum[index] && iterable[index] !== objectProto[index])"),t+=") {\n "+e.loop+";\n } ";t+="\n } "}return(e.array||It.nonEnumArgs)&&(t+="\n}"),t+=e.bottom+";\nreturn result"};At||(u=function(){function e(){}return function(t){if(w(t)){e.prototype=t;var n=new e;e.prototype=null}return n||ft.Object()}}());var zt=qt?function(e,t){ut.value=t,qt(e,"__bindData__",ut)}:D;It.argsClass||(b=function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Pt.call(e,"callee")&&!$t.call(e,"callee")||!1});var Ft=Ut||function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&wt.call(e)==et||!1},Tt=d({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)"}),Rt=Ot?function(e){return w(e)?It.enumPrototypes&&"function"==typeof e||It.nonEnumArgs&&e.length&&b(e)?Tt(e):Ot(e):[]}:Tt,Ht={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",array:"typeof length == 'number'",keys:Rt,loop:"if (callback(iterable[index], index, collection) === false) return result"},Bt={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",keys:Rt,loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},Vt={top:"if (!objectTypes[typeof iterable]) return result;\n"+Ht.top,array:!1},Wt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=RegExp("["+Rt(Wt).join("")+"]","g"),Jt=d(Ht),Kt=d(Bt,{top:Bt.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),Mt=d(Bt),Qt=d(Ht,Vt,{useHas:!1}),Xt=d(Ht,Vt);x(/x/)&&(x=function(e){return"function"==typeof e&&wt.call(e)==ot}),a.assign=Kt,a.bind=q,a.createCallback=A,a.defaults=Mt,a.filter=P,a.forEach=$,a.forIn=Qt,a.forOwn=Xt,a.keys=Rt,a.property=L,a.reject=E,a.values=j,a.each=$,a.extend=Kt,a.select=P,a.clone=y,a.cloneDeep=C,a.escape=U,a.find=S,a.identity=O,a.isArguments=b,a.isArray=Ft,a.isFunction=x,a.isObject=w,a.isString=_,a.noop=D,a.template=I,a.detect=S,a.findWhere=S,a.VERSION="2.4.1",dt&>&&(vt?(gt.exports=a)._=a:dt._=a)}).call(this)}),require.register("side-comments/js/helpers/mobile-check.js",function(e,t,n){n.exports=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}}),require.register("side-comments/templates/section.html",function(e,t,n){n.exports='
\n \n <%= comments.length %>\n \n \n
\n
    \n <% _.each(comments, function( comment ){ %>\n <%= _.template(commentTemplate, { comment: comment, currentUser: currentUser }) %>\n <% }) %>\n
\n \n Leave a comment\n \n <% if (currentUser){ %>\n
\n
\n \n
\n

\n <%= currentUser.name %>\n

\n \n
\n Post\n Cancel\n
\n
\n <% } %>\n
\n
'}),require.register("side-comments/templates/comment.html",function(e,t,n){n.exports='
  • \n
    \n \n
    \n <% if (comment.authorUrl) { %>\n \n <%= comment.authorName %>\n \n <% } else { %>\n

    \n <%= comment.authorName %>\n

    \n <% } %>\n

    \n <%= comment.comment %>\n

    \n <% if (currentUser && comment.authorId === currentUser.id){ %>\n Delete\n <% } %>\n
  • '}),require.alias("component-emitter/index.js","side-comments/deps/emitter/index.js"),require.alias("component-emitter/index.js","emitter/index.js"),require.alias("side-comments/js/main.js","side-comments/index.js"); \ No newline at end of file -- cgit v1.2.3