\n Drop files or click here to upload
\n'},{}],15:[function(e,t,n){t.exports='\n\n
\n
![Image Preview]()
\n
![Image Preview]()
\n
\n
\n
\n\n
\n
|\n
\n\n
\n
'},{}],16:[function(e,t,n){t.exports=''},{}],17:[function(e,t,n){"use strict";var r=e("moment");t.exports=function(t,n){t.controller("ImageManagerController",["$scope","$attrs","$http","$timeout","imageManagerService",function(e,t,r,i,o){function a(){e.searching=!1,e.searchTerm="",e.images=m,e.hasMore=g}function s(t){p&&p(t),e.showing=!1}function u(t){p=t,e.showing=!0,h||(l(),h=!0)}function l(){var t=v+c+"?",n={};e.uploadedTo&&(n.page_id=e.uploadedTo),e.searching&&(n.term=e.searchTerm);var i=Object.keys(n).map(function(e){return e+"="+encodeURIComponent(n[e])}).join("&");t+=i,r.get(t).then(function(t){e.images=e.images.concat(t.data.images),e.hasMore=t.data.hasMore,c++})}e.images=[],e.imageType=t.imageType,e.selectedImage=!1,e.dependantPages=!1,e.showing=!1,e.hasMore=!1,e.imageUpdateSuccess=!1,e.imageDeleteSuccess=!1,e.uploadedTo=t.uploadedTo,e.view="all",e.searching=!1,e.searchTerm="";var c=0,f=0,d=0,h=!1,p=!1,m=[],g=!1;e.getUploadUrl=function(){return window.baseUrl("/images/"+e.imageType+"/upload")},e.cancelSearch=a,e.uploadSuccess=function(t,r){e.$apply(function(){e.images.unshift(r)}),n.emit("success","Image uploaded")},e.imageSelect=function(t){var n=300,r=Date.now(),i=r-f;i tr",containment:"parent",axis:"y"},e.addEmptyTag=i,o(),e.tagChange=function(t){var n=e.tags.indexOf(t);n===e.tags.length-1&&(""===t.name&&""===t.value||i())},e.tagBlur=function(t){var n=e.tags.length-1===e.tags.indexOf(t);if(""===t.name&&""===t.value&&!n){var r=e.tags.indexOf(t);e.tags.splice(r,1)}},e.saveTags=function(){a();var r={tags:e.tags},o=window.baseUrl("/ajax/tags/update/page/"+s);t.post(o,r).then(function(t){e.tags=t.data.tags,i(),n.emit("success",t.data.message)})},e.removeTag=function(t){var n=e.tags.indexOf(t);e.tags.splice(n,1)}}])}},{"./pages/page-form":20,moment:12}],18:[function(e,t,n){"use strict";var r=e("dropzone"),i=e("marked"),o=e("./components/toggle-switch.html"),a=e("./components/image-picker.html"),s=e("./components/drop-zone.html");t.exports=function(e,t){e.directive("toggleSwitch",function(){return{restrict:"A",template:o,scope:!0,link:function(e,t,n){e.name=n.name,e.value=n.value,e.isActive=1==e.value&&"false"!=e.value,e.value=1==e.value&&"false"!=e.value?"true":"false",e["switch"]=function(){e.isActive=!e.isActive,e.value=e.isActive?"true":"false"}}}}),e.directive("imagePicker",["$http","imageManagerService",function(e,t){return{restrict:"E",template:a,scope:{name:"@",resizeHeight:"@",resizeWidth:"@",resizeCrop:"@",showRemove:"=",currentImage:"@",currentId:"@",defaultImage:"@",imageClass:"@"},link:function(n,r,i){function o(e,t){n.image=t,n.value=a?e.id:t}var a="undefined"!=typeof n.currentId||"false"===n.currentId;n.image=n.currentImage,n.value=n.currentImage||"",a&&(n.value=n.currentId),n.reset=function(){o({id:0},n.defaultImage)},n.remove=function(){n.image="none",n.value="none"},n.showImageManager=function(){t.show(function(e){n.updateImageFromModel(e)})},n.updateImageFromModel=function(t){var r=n.resizeWidth&&n.resizeHeight;if(!r)return void n.$apply(function(){o(t,t.url)});var i=n.resizeCrop?"true":"false",a="/images/thumb/"+t.id+"/"+n.resizeWidth+"/"+n.resizeHeight+"/"+i;a=window.baseUrl(a),e.get(a).then(function(e){o(t,e.data.url)})}}}}]),e.directive("dropZone",[function(){return{restrict:"E",template:s,scope:{uploadUrl:"@",eventSuccess:"=",eventError:"=",uploadedTo:"@"},link:function(e,t,n){new r(t[0].querySelector(".dropzone-container"),{url:e.uploadUrl,init:function(){var t=this;t.on("sending",function(t,n,r){var i=window.document.querySelector("meta[name=token]").getAttribute("content");r.append("_token",i);var o="undefined"==typeof e.uploadedTo?0:e.uploadedTo;r.append("uploaded_to",o)}),"undefined"!=typeof e.eventSuccess&&t.on("success",e.eventSuccess),t.on("success",function(e,n){$(e.previewElement).fadeOut(400,function(){t.removeFile(e)})}),"undefined"!=typeof e.eventError&&t.on("error",e.eventError),t.on("error",function(e,t,n){function r(t){$(e.previewElement).find("[data-dz-errormessage]").text(t)}console.log(t),console.log(n),413===n.status&&r("The server does not allow uploads of this size. Please try a smaller file."),t.file&&r(t.file[0])})}})}}}]),e.directive("dropdown",[function(){return{restrict:"A",link:function(e,t,n){var r=t.find("ul");t.find("[dropdown-toggle]").on("click",function(){r.show().addClass("anim menuIn"),t.mouseleave(function(){r.hide(),r.removeClass("anim menuIn")})})}}}]),e.directive("tinymce",["$timeout",function(e){return{restrict:"A",scope:{tinymce:"=",mceModel:"=",mceChange:"="},link:function(t,n,r){function i(n){n.on("ExecCommand change NodeChange ObjectResized",function(r){var i=n.getContent();e(function(){t.mceModel=i}),t.mceChange(i)}),n.on("keydown",function(e){t.$emit("editor-keydown",e)}),n.on("init",function(e){t.mceModel=n.getContent()}),t.$on("html-update",function(e,r){n.setContent(r),n.selection.select(n.getBody(),!0),n.selection.collapse(!1),t.mceModel=n.getContent()})}t.tinymce.extraSetups.push(i),tinymce.PluginManager.add("customhr",function(e){e.addCommand("InsertHorizontalRule",function(){var t=document.createElement("hr"),n=e.selection.getNode(),r=n.parentNode;r.insertBefore(t,n)}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),tinymce.init(t.tinymce)}}}]),e.directive("markdownInput",["$timeout",function(e){return{restrict:"A",scope:{mdModel:"=",mdChange:"="},link:function(t,n,r){n=n.find("textarea").first();var o=n.val();t.mdModel=o,t.mdChange(i(o)),console.log("test"),n.on("change input",function(r){o=n.val(),e(function(){t.mdModel=o,t.mdChange(i(o))})}),t.$on("markdown-update",function(e,r){n.val(r),t.mdModel=r,t.mdChange(i(r))})}}}]),e.directive("markdownEditor",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){function r(){u=i[0].scrollHeight,l=i.height(),c=o[0].scrollHeight,f=o.height()}var i=t.find("[markdown-input] textarea").first(),o=t.find(".markdown-display").first(),a=t.find('button[data-action="insertImage"]'),s=0;i.blur(function(e){s=i[0].selectionStart});var u=void 0,l=void 0,c=void 0,f=void 0;setTimeout(function(){r()},200),window.addEventListener("resize",r);var d=800,h=0;i.on("scroll",function(e){var t=Date.now();t-h>d&&r();var n=i.scrollTop()/(u-l),a=(c-f)*n;o.scrollTop(a),h=t}),i.keydown(function(t){if(73===t.which&&t.ctrlKey&&t.shiftKey){t.preventDefault();var n=i[0].selectionStart,r=i.val(),o="";return i.val(r.substring(0,n)+o+r.substring(n)),i.focus(),i[0].selectionStart=n+"}e.$emit("editor-keydown",t)}),a.click(function(e){window.ImageManager.showExternal(function(e){var t=s,n=i.val(),r="";i.val(n.substring(0,t)+r+n.substring(t)),i.change()})})}}}]),e.directive("toolbox",[function(){return{restrict:"A",link:function(e,t,n){function r(e,n){i.removeClass("active"),o.hide(),i.filter('[tab-button="'+e+'"]').addClass("active"),o.filter('[tab-content="'+e+'"]').show(),n&&t.addClass("open")}var i=t.find("[tab-button]"),o=t.find("[tab-content]"),a=t.find("[toolbox-toggle]");a.click(function(e){t.toggleClass("open")}),r(o.first().attr("tab-content"),!1),i.click(function(e){var t=$(this).attr("tab-button");r(t,!0)})}}}]),e.directive("tagAutosuggestions",["$http",function(e){return{restrict:"A",link:function(t,n,r){function i(e,t){t[h].className="",h=e,t[h].className="active"}function o(e,t){if(0===t.length)return c.hide(),f=!1,void(m=t);if(f||(c.show(),f=!0),e!==d&&(c.detach(),e.after(c),d=e),m.join()===t.join())return void(m=t);c[0].innerHTML="";for(var n=0;n=0}}),$(function(){var e=$(".notification"),t=e.filter(".pos"),n=e.filter(".neg"),r=e.filter(".warning");window.Events.listen("success",function(e){t.hide(),t.find("span").text(e),setTimeout(function(){t.show()},1)}),window.Events.listen("warning",function(e){r.find("span").text(e),r.show()}),window.Events.listen("error",function(e){n.find("span").text(e),n.show()}),e.click(function(){$(this).fadeOut(100)}),$(".chapter-toggle").click(function(e){e.preventDefault(),$(this).toggleClass("open"),$(this).closest(".chapter").find(".inset-list").slideToggle(180)}),$("#back-to-top").click(function(){$("#header").smoothScrollTo()});var i=!1,o=document.getElementById("back-to-top"),a=1200;window.addEventListener("scroll",function(){!i&&document.body.scrollTop>a?(o.style.display="block",i=!0,setTimeout(function(){o.style.opacity=.4},1)):i&&document.body.scrollTop';i+='
',i+="",r.tinyMCE.activeEditor.execCommand("mceInsertContent",!1,i)})},paste_preprocess:function(e,t){var n=t.content;n.indexOf('
';n+='
',n+="