From 4d3173c495fe8940684b7150f6ec3ebe01463473 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Thu, 2 Jul 2015 17:48:47 +0200 Subject: [PATCH 01/29] update to CakePHP 2.6.8 --- .../Test/Case/Lib/BbcodeParserTest.php | 8 +- app/composer.json | 2 +- app/composer.lock | 82 +++++++++---------- 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php index 912ef99a8..0bc29c907 100755 --- a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php +++ b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php @@ -619,25 +619,25 @@ public function testExternalImage() { // test for standard URIs $input = '[img]http://localhost/img/macnemo.png[/img]'; - $expected = ''; + $expected = ''; $result = $this->_Parser->parse($input); $this->assertEquals($expected, $result); // test for URIs without protocol $input = '[img]/somewhere/macnemo.png[/img]'; - $expected = ''; + $expected = ''; $result = $this->_Parser->parse($input); $this->assertEquals($expected, $result); // test scaling with 1 parameter $input = '[img=50]http://localhost/img/macnemo.png[/img]'; - $expected = ''; + $expected = ''; $result = $this->_Parser->parse($input); $this->assertEquals($expected, $result); // test scaling with 2 parameters $input = '[img=50x100]http://localhost/img/macnemo.png[/img]'; - $expected = ''; + $expected = ''; $result = $this->_Parser->parse($input); $this->assertEquals($expected, $result); diff --git a/app/composer.json b/app/composer.json index e169d01e5..6b1ebf3c5 100644 --- a/app/composer.json +++ b/app/composer.json @@ -30,7 +30,7 @@ "php": ">=5.4.0", "ext-mcrypt": "*", "markstory/geshi": "0.3.*", - "pear-pear.cakephp.org/CakePHP": "2.6.7", + "pear-pear.cakephp.org/CakePHP": "2.6.8", "kzykhys/ciconia": "~1.0.3", "jbbcode/jbbcode": "~1.3", "aura/di": "~2.1" diff --git a/app/composer.lock b/app/composer.lock index abca82e77..b380cd854 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "acf0423b7cc0e6164cc77a50380477de", + "hash": "0b69d3ec1e29b0a6654b4b2246cdfae1", "packages": [ { "name": "aura/di", @@ -293,10 +293,10 @@ }, { "name": "pear-pear.cakephp.org/CakePHP", - "version": "2.6.7", + "version": "2.6.8", "dist": { "type": "file", - "url": "http://pear.cakephp.org/get/CakePHP-2.6.7.tgz", + "url": "http://pear.cakephp.org/get/CakePHP-2.6.8.tgz", "reference": null, "shasum": null }, @@ -304,7 +304,7 @@ "php": ">=5.2.8.0" }, "replace": { - "pear-cakephp/cakephp": "== 2.6.7.0" + "pear-cakephp/cakephp": "== 2.6.8.0" }, "type": "pear-library", "autoload": { @@ -677,16 +677,16 @@ }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -695,20 +695,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -717,20 +714,20 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", "shasum": "" }, "require": { @@ -739,13 +736,10 @@ "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -761,7 +755,7 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2015-06-13 07:35:30" }, { "name": "phpunit/php-token-stream", @@ -1007,16 +1001,16 @@ }, { "name": "symfony/config", - "version": "v2.7.0", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "537e9912063e66aa70cbcddd7d6e6e8db61d98e4" + "reference": "58ded81f1f582a87c528ef3dae9a859f78b5f374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/537e9912063e66aa70cbcddd7d6e6e8db61d98e4", - "reference": "537e9912063e66aa70cbcddd7d6e6e8db61d98e4", + "url": "https://api.github.com/repos/symfony/Config/zipball/58ded81f1f582a87c528ef3dae9a859f78b5f374", + "reference": "58ded81f1f582a87c528ef3dae9a859f78b5f374", "shasum": "" }, "require": { @@ -1053,20 +1047,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:33:16" + "time": "2015-06-11 14:06:56" }, { "name": "symfony/dependency-injection", - "version": "v2.7.0", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "137bf489c5151c7eb1e4b7dd34a123f9a74b966d" + "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/137bf489c5151c7eb1e4b7dd34a123f9a74b966d", - "reference": "137bf489c5151c7eb1e4b7dd34a123f9a74b966d", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/1a409e52a38ec891de0a7a61a191d1c62080b69d", + "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d", "shasum": "" }, "require": { @@ -1113,20 +1107,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-05-29 14:44:44" + "time": "2015-06-11 19:13:11" }, { "name": "symfony/filesystem", - "version": "v2.7.0", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba" + "reference": "a0d43eb3e17d4f4c6990289805a488a0482a07f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba", - "reference": "ae4551fd6d4d4f51f2e7390fbc902fbd67f3b7ba", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a0d43eb3e17d4f4c6990289805a488a0482a07f3", + "reference": "a0d43eb3e17d4f4c6990289805a488a0482a07f3", "shasum": "" }, "require": { @@ -1162,20 +1156,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-05-15 13:33:16" + "time": "2015-06-08 09:37:21" }, { "name": "symfony/yaml", - "version": "v2.7.0", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3" + "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3", - "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", + "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", "shasum": "" }, "require": { @@ -1211,7 +1205,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:21:08" + "time": "2015-06-10 15:30:22" } ], "aliases": [], From e3a0682861c16195ce99471af2ee93d413483a85 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Thu, 2 Jul 2015 17:48:58 +0200 Subject: [PATCH 02/29] refactor markItUp.media.js --- app/webroot/js/lib/saito/markItUp.media.js | 301 ++++++++++++--------- 1 file changed, 172 insertions(+), 129 deletions(-) diff --git a/app/webroot/js/lib/saito/markItUp.media.js b/app/webroot/js/lib/saito/markItUp.media.js index 016e8323e..f9258f415 100644 --- a/app/webroot/js/lib/saito/markItUp.media.js +++ b/app/webroot/js/lib/saito/markItUp.media.js @@ -1,136 +1,179 @@ -define(['jquery', 'underscore'], function($, _) { - - "use strict"; - - var dropbox = { - cleanUp: function(text) { - // see: https://www.dropbox.com/help/201/en - text = text.replace(/https:\/\/www\.dropbox\.com\//, 'https://dl.dropbox.com/'); - return text; +/** + * Helper for converting multimedia content to BBCode tags + */ +define(['jquery', 'underscore'], function ($, _) { + 'use strict'; + var markItUp = { + /** + * Filters applied before URL is evaluated + */ + _preFilters: { + /** + * Convert dropbox HTML-page URL to actual file URL + * + * @see https://www.dropbox.com/help/201/en + */ + dropbox: { + cleanUp: function (text) { + return text.replace(/https:\/\/www\.dropbox\.com\//, 'https://dl.dropbox.com/'); } - }; - - var markItUp = { - - rawUrlCleaner: [dropbox], - - multimedia: function(text, options) { - var textv = $.trim(text), - patternEnd = "([\\/?]|$)", - - patternImage = new RegExp("\\.(png|gif|jpg|jpeg|webp)" + patternEnd, "i"), - patternHtml = new RegExp("\\.(mp4|webm|m4v)" + patternEnd, "i"), - patternAudio = new RegExp("\\.(m4a|ogg|mp3|wav|opus)" + patternEnd, "i"), - patternFlash = /.*?<\/iframe>/i.exec(text)[1]; - inner = inner.replace(/["']/g, ''); - return '[iframe' + inner + '][/iframe]'; + return text; }, - _videoFallback: function(text) { - var out = '', - videoId; - - // manually detect popular video services - if ( /http/.test(text) === false ) { - text = 'http://' + text; - } - if (/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i.test(text)) { - var domain = text.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop(); - // youtube shortener url - if (domain === 'youtu.be') { - if (/youtu.be\/(.*?)(&.*)?$/.test(text)) { - videoId = text.match(/youtu.be\/(.*?)(&.*)?$/)[1]; - out = markItUp._createIframe({ - url: '//www.youtube.com/embed/' + videoId - }); - out = markItUp._videoIframe(out); - return out; - } - } - // youtube url from browser bar - if (domain === 'youtube.com') { - if (/v=(.*?)(&.*)?$/.test(text)) { - videoId = text.match(/v=(.*?)(&.*)?$/)[1]; - out = markItUp._createIframe({ - url: '//www.youtube.com/embed/' + videoId - }); - out = markItUp._videoIframe(out); - } - return out; - } - } - return out; - }, - - _embedly: function(text) { - return '[embed]' + text + '[/embed]'; - }, - - _createIframe: function(args) { - return ''; + /** + * Create HTML iframe tag + * + * @param {object} attr - iframe-tag attributes + * @returns {string} + * @private + */ + _createIframe: function (attr) { + var defaults, attributes, reducer; + + defaults = { + width: 425, + height: 349, + frameborder: 0, + allowfullscreen: 'allowfullscreen' + }; + _.defaults(attr, defaults); + + + reducer = function (memo, value, key) { + return memo + key + '="' + value + '" '; + }; + attributes = _.reduce(attr, reducer, ''); + attributes = attributes.trim(); + + return ''; } - - }; - - return markItUp; - + } + }, + + /** + * Resolve multimedia input to BBCode syntax + * + * @param {string} text - content to embed + * @param {object} options - converting options + * @returns {string} + */ + multimedia: function (text, options) { + var textv = $.trim(text), + patternEnd = '([\\/?]|$)', + + patternImage = new RegExp('\\.(png|gif|jpg|jpeg|webp)' + patternEnd, 'i'), + patternHtml = new RegExp('\\.(mp4|webm|m4v)' + patternEnd, 'i'), + patternAudio = new RegExp('\\.(m4a|ogg|mp3|wav|opus)' + patternEnd, 'i'), + patternFlash = /.*?<\/iframe>/i.exec(text)[1]; + inner = inner.replace(/["']/g, ''); + return '[iframe' + inner + '][/iframe]'; + }, + + _embedly: function (text) { + return '[embed]' + text + '[/embed]'; + } + }; + + return markItUp; }); From 6142e5e9452a8cf43557c5347b29f97baedc8439 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Thu, 2 Jul 2015 18:46:00 +0200 Subject: [PATCH 03/29] set default format for youtube video fallback from 4:3 to 16:9 #316 --- app/webroot/dist/common.min.js | 14 +++++++------- app/webroot/dist/jquery.min.js | 6 +++--- app/webroot/dist/main.min.js | 6 +++--- app/webroot/dist/require.min.js | 2 +- app/webroot/js/lib/saito/markItUp.media.js | 4 ++-- app/webroot/js/tests/lib/MarkItUpSpec.js | 19 ++++++++++--------- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/app/webroot/dist/common.min.js b/app/webroot/dist/common.min.js index 62516b126..4e1f5dc38 100644 --- a/app/webroot/dist/common.min.js +++ b/app/webroot/dist/common.min.js @@ -1,10 +1,10 @@ -function FastClick(t,e){function i(t,e){return function(){return t.apply(e,arguments)}}var n;if(e=e||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=e.touchBoundary||10,this.layer=t,this.tapDelay=e.tapDelay||200,!FastClick.notNeeded(t)){for(var o=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],s=this,r=0,a=o.length;a>r;r++)s[o[r]]=i(s[o[r]],s);deviceIsAndroid&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,i,n){var o=Node.prototype.removeEventListener;"click"===e?o.call(t,e,i.hijacked||i,n):o.call(t,e,i,n)},t.addEventListener=function(e,i,n){var o=Node.prototype.addEventListener;"click"===e?o.call(t,e,i.hijacked||(i.hijacked=function(t){t.propagationStopped||i(t)}),n):o.call(t,e,i,n)}),"function"==typeof t.onclick&&(n=t.onclick,t.addEventListener("click",function(t){n(t)},!1),t.onclick=null)}}!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd&&require.config(t())}(function(){return{shim:{drop:{deps:["tether"],exports:"Drop"},jqueryTinyTimer:{deps:[]}},paths:{backbone:"../dev/bower_components/backbone/js/backbone",backboneLocalStorage:"../dev/bower_components/Backbone.localStorage/js/backbone.localStorage",cakeRest:"lib/saito/backbone.cakeRest",domReady:"../dev/bower_components/requirejs-domready/js/domReady",drop:"../dev/bower_components/drop/drop",fastclick:"../dev/bower_components/fastclick/js/fastclick",humanize:"../dev/bower_components/humanize/js/humanize",jquery:"lib/jquery",jqueryAutosize:"../dev/bower_components/jquery-autosize/js/jquery.autosize",jqueryDropdown:"../dev/bower_components/jquery-dropdown/jquery.dropdown",jqueryTinyTimer:"../dev/bower_components/jquery-tinytimer/jquery.tinytimer",jqueryUi:"lib/jquery-ui/jquery-ui.custom.min",tether:"../dev/bower_components/tether/tether",text:"../dev/bower_components/requirejs-text/js/text",underscore:"../dev/bower_components/lodash/js/lodash",marionette:"../dev/bower_components/marionette/backbone.marionette","backbone.babysitter":"../dev/bower_components/backbone.babysitter/backbone.babysitter","backbone.wreqr":"../dev/bower_components/backbone.wreqr/backbone.wreqr",moment:"../dev/bower_components/momentjs/js/moment","moment-de":"../dev/bower_components/momentjs/lang/de",cs:"../dev/bower_components/require-cs/cs","coffee-script":"../dev/bower_components/coffeescript/extras/coffee-script"}}}),define("common",function(){}),function(){function t(t,e,i){for(var n=(i||0)-1,o=t?t.length:0;++n-1?0:-1:e?0:-1}function i(t){var e=this.cache,i=typeof t;if("boolean"==i||null==t)e[t]=!0;else{"number"!=i&&"string"!=i&&(i="object");var n="number"==i?t:v+t,o=e[i]||(e[i]={});"object"==i?(o[n]||(o[n]=[])).push(t):o[n]=!0}}function n(t){return t.charCodeAt(0)}function o(t,e){for(var i=t.criteria,n=e.criteria,o=-1,s=i.length;++oa||"undefined"==typeof r)return 1;if(a>r||"undefined"==typeof a)return-1}}return t.index-e.index}function s(t){var e=-1,n=t.length,o=t[0],s=t[n/2|0],r=t[n-1];if(o&&"object"==typeof o&&s&&"object"==typeof s&&r&&"object"==typeof r)return!1;var a=l();a["false"]=a["null"]=a["true"]=a.undefined=!1;var h=l();for(h.array=t,h.cache=a,h.push=i;++eo?0:o);++n=b&&r===t,h=[];if(l){var c=s(n);c?(r=e,n=c):l=!1}for(;++o-1:void 0});return o.pop(),s.pop(),b&&(h(o),h(s)),r}function ie(t,e,i,n,o){(Qn(e)?Je:lo)(e,function(e,s){var r,a,l=e,h=t[s];if(e&&((a=Qn(e))||ho(e))){for(var u=n.length;u--;)if(r=n[u]==e){h=o[u];break}if(!r){var c;i&&(l=i(h,e),(c="undefined"!=typeof l)&&(h=l)),c||(h=a?Qn(h)?h:[]:ho(h)?h:{}),n.push(e),o.push(h),c||ie(h,e,i,n,o)}}else i&&(l=i(h,e),"undefined"==typeof l&&(l=e)),"undefined"!=typeof l&&(h=l);t[s]=h})}function ne(t,e){return t+Dn(Xn()*(e-t+1))}function oe(i,n,o){var r=-1,l=le(),c=i?i.length:0,f=[],d=!n&&c>=b&&l===t,p=o||d?a():f;if(d){var g=s(p);l=e,p=g}for(;++r3&&"function"==typeof e[i-2])var n=J(e[--i-1],e[i--],2);else i>2&&"function"==typeof e[i-1]&&(n=e[--i]);for(var o=c(arguments,1,i),s=-1,r=a(),l=a();++si?Un(0,s+i):i)||0,Qn(t)?r=o(t,e,i)>-1:"number"==typeof s?r=(We(t)?t.indexOf(e,i):o(t,e,i))>-1:lo(t,function(t){return++n>=i?!(r=t===e):void 0}),r}function Ve(t,e,i){var n=!0;e=p.createCallback(e,i,3);var o=-1,s=t?t.length:0;if("number"==typeof s)for(;++os&&(s=l)}else e=null==e&&We(t)?n:p.createCallback(e,i,3),Je(t,function(t,i,n){var r=e(t,i,n);r>o&&(o=r,s=t)});return s}function ei(t,e,i){var o=1/0,s=o;if("function"!=typeof e&&i&&i[e]===t&&(e=null),null==e&&Qn(t))for(var r=-1,a=t.length;++rl&&(s=l)}else e=null==e&&We(t)?n:p.createCallback(e,i,3),Je(t,function(t,i,n){var r=e(t,i,n);o>r&&(o=r,s=t)});return s}function ii(t,e,i,n){if(!t)return i;var o=arguments.length<3;e=p.createCallback(e,n,4);var s=-1,r=t.length;if("number"==typeof r)for(o&&(i=t[++s]);++sn?Un(0,o+n):n||0}else if(n){var s=Mi(e,i);return e[s]===i?s:-1}return t(e,i,n)}function bi(t,e,i){var n=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var s=o;for(e=p.createCallback(e,i,3);s--&&e(t[s],s,t);)n++}else n=null==e||i?1:e||n;return c(t,0,Vn(Un(0,o-n),o))}function yi(){for(var i=[],n=-1,o=arguments.length,r=a(),l=le(),c=l===t,f=a();++n=b&&s(n?i[n]:f)))}var p=i[0],g=-1,m=p?p.length:0,v=[];t:for(;++gi?Un(0,n+i):Vn(i,n-1))+1);n--;)if(t[n]===e)return n;return-1}function Ci(t){for(var e=arguments,i=0,n=e.length,o=t?t.length:0;++io;){var r=o+s>>>1;i(t[r])1?arguments:arguments[0],e=-1,i=t?ti(po(t,"length")):0,n=pn(0>i?0:i);++e2?re(t,17,c(arguments,2),null,e):re(t,1,null,null,e)}function Wi(t){for(var e=arguments.length>1?te(arguments,!0,!1,1):_e(t),i=-1,n=e.length;++i2?re(e,19,c(arguments,2),null,t):re(e,3,null,null,t)}function Ai(){for(var t=arguments,e=t.length;e--;)if(!Pe(t[e]))throw new xn;return function(){for(var e=arguments,i=t.length;i--;)e=[t[i].apply(this,e)];return e[0]}}function Ri(t,e){return e="number"==typeof e?e:+e||t.length,re(t,4,null,null,null,e)}function Yi(t,e,i){var n,o,s,r,a,l,h,u=0,c=!1,f=!0;if(!Pe(t))throw new xn;if(e=Un(0,e)||0,i===!0){var p=!0;f=!1}else ze(i)&&(p=i.leading,c="maxWait"in i&&(Un(e,i.maxWait)||0),f="trailing"in i?i.trailing:f);var g=function(){var i=e-(mo()-r);if(0>=i){o&&zn(o);var c=h;o=l=h=d,c&&(u=mo(),s=t.apply(a,n),l||o||(n=a=null))}else l=Ln(g,i)},m=function(){l&&zn(l),o=l=h=d,(f||c!==e)&&(u=mo(),s=t.apply(a,n),l||o||(n=a=null))};return function(){if(n=arguments,r=mo(),a=this,h=f&&(l||!p),c===!1)var i=p&&!l;else{o||p||(u=r);var d=c-(r-u),v=0>=d;v?(o&&(o=zn(o)),u=r,s=t.apply(a,n)):o||(o=Ln(m,d))}return v&&l?l=zn(l):l||e===c||(l=Ln(g,e)),i&&(v=!0,s=t.apply(a,n)),!v||l||o||(n=a=null),s}}function Fi(t){if(!Pe(t))throw new xn;var e=c(arguments,1);return Ln(function(){t.apply(d,e)},1)}function Ni(t,e){if(!Pe(t))throw new xn;var i=c(arguments,2);return Ln(function(){t.apply(d,i)},e)}function ji(t,e){if(!Pe(t))throw new xn;var i=function(){var n=i.cache,o=e?e.apply(this,arguments):v+arguments[0];return Hn.call(n,o)?n[o]:n[o]=t.apply(this,arguments)};return i.cache={},i}function Bi(t){var e,i;if(!Pe(t))throw new xn;return function(){return e?i:(e=!0,i=t.apply(this,arguments),t=null,i)}}function qi(t){return re(t,16,c(arguments,1))}function Ui(t){return re(t,32,null,c(arguments,1))}function Vi(t,e,i){var n=!0,o=!0;if(!Pe(t))throw new xn;return i===!1?n=!1:ze(i)&&(n="leading"in i?i.leading:n,o="trailing"in i?i.trailing:o),q.leading=n,q.maxWait=e,q.trailing=o,Yi(t,e,q)}function $i(t,e){return re(e,16,[t])}function Xi(t){return function(){return t}}function Gi(t,e,i){var n=typeof t;if(null==t||"function"==n)return J(t,e,i);if("object"!=n)return en(t);var o=to(t),s=o[0],r=t[s];return 1!=o.length||r!==r||ze(r)?function(e){for(var i=o.length,n=!1;i--&&(n=ee(e[o[i]],t[o[i]],null,!0)););return n}:function(t){var e=t[s];return r===e&&(0!==r||1/r==1/e)}}function Ji(t){return null==t?"":Cn(t).replace(oo,ae)}function Zi(t){return t}function Qi(t,e,i){var n=!0,o=e&&_e(e);e&&(i||o.length)||(null==i&&(i=e),s=g,e=t,t=p,o=_e(e)),i===!1?n=!1:ze(i)&&"chain"in i&&(n=i.chain);var s=t,r=Pe(s);Je(o,function(i){var o=t[i]=e[i];r&&(s.prototype[i]=function(){var e=this.__chain__,i=this.__wrapped__,r=[i];Wn.apply(r,arguments);var a=o.apply(t,r);if(n||e){if(i===a&&ze(a))return this;a=new s(a),a.__chain__=e}return a})})}function Ki(){return i._=Mn,this}function tn(){}function en(t){return function(e){return e[t]}}function nn(t,e,i){var n=null==t,o=null==e;if(null==i&&("boolean"==typeof t&&o?(i=t,t=1):o||"boolean"!=typeof e||(i=e,o=!0)),n&&o&&(e=1),t=+t||0,o?(e=t,t=0):e=+e||0,i||t%1||e%1){var s=Xn();return Vn(t+s*(e-t+parseFloat("1e-"+((s+"").length-1))),e)}return ne(t,e)}function on(t,e){if(t){var i=t[e];return Pe(i)?t[e]():i}}function sn(t,e,i){var n=p.templateSettings;t=Cn(t||""),i=ro({},i,n);var o,s=ro({},i.imports,n.imports),a=to(s),l=Be(s),h=0,u=i.interpolate||P,c="__p += '",f=wn((i.escape||P).source+"|"+u.source+"|"+(u===S?k:P).source+"|"+(i.evaluate||P).source+"|$","g");t.replace(f,function(e,i,n,s,a,l){return n||(n=s),c+=t.slice(h,l).replace(D,r),i&&(c+="' +\n__e("+i+") +\n'"),a&&(o=!0,c+="';\n"+a+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=l+e.length,e}),c+="';\n";var g=i.variable,m=g;m||(g="obj",c="with ("+g+") {\n"+c+"\n}\n"),c=(o?c.replace(w,""):c).replace(C,"$1").replace(x,"$1;"),c="function("+g+") {\n"+(m?"":g+" || ("+g+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var v="\n/*\n//# sourceURL="+(i.sourceURL||"/lodash/template/source["+O++ +"]")+"\n*/";try{var b=vn(a,"return "+c+v).apply(d,l)}catch(y){throw y.source=c,y}return e?b(e):(b.source=c,b)}function rn(t,e,i){t=(t=+t)>-1?t:0;var n=-1,o=pn(t);for(e=J(e,i,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:S,variable:"",imports:{_:p}},Fn||(G=function(){function t(){}return function(e){if(ze(e)){t.prototype=e;var n=new t;t.prototype=null}return n||i.Object()}}());var Zn=Yn?function(t,e){U.value=e,Yn(t,"__bindData__",U)}:tn,Qn=Nn||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sn.call(t)==W||!1},Kn=function(t){var e,i=t,n=[];if(!i)return n;if(!V[typeof t])return n;for(e in i)Hn.call(i,e)&&n.push(e);return n},to=qn?function(t){return ze(t)?qn(t):[]}:Kn,eo={"&":"&","<":"<",">":">",'"':""","'":"'"},io=Ce(eo),no=wn("("+to(io).join("|")+")","g"),oo=wn("["+to(eo).join("")+"]","g"),so=function(t,e,i){var n,o=t,s=o;if(!o)return s;var r=arguments,a=0,l="number"==typeof i?2:r.length;if(l>3&&"function"==typeof r[l-2])var h=J(r[--l-1],r[l--],2);else l>2&&"function"==typeof r[l-1]&&(h=r[--l]);for(;++a/g,E=RegExp("^["+_+"]*0+(?=.$)"),P=/($^)/,z=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,I=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],O=0,H="[object Arguments]",W="[object Array]",L="[object Boolean]",A="[object Date]",R="[object Function]",Y="[object Number]",F="[object Object]",N="[object RegExp]",j="[object String]",B={};B[R]=!1,B[H]=B[W]=B[L]=B[A]=B[Y]=B[F]=B[N]=B[j]=!0;var q={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},$={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=V[typeof window]&&window||this,G=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Z=J&&J.exports===G&&G,Q=V[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(X=Q);var K=f();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=K,define("underscore",[],function(){return K})):G&&J?Z?(J.exports=K)._=K:G._=K:X._=K}.call(this),function(t,e){if("function"==typeof define&&define.amd)define("backbone",["underscore","jquery","exports"],function(i,n,o){t.Backbone=e(t,o,i,n)});else if("undefined"!=typeof exports){var i=require("underscore");e(t,exports,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,n){{var o=t.Backbone,s=[],r=(s.push,s.slice);s.splice}e.VERSION="1.1.2",e.$=n,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=e.Events={on:function(t,e,i){if(!h(this,"on",t,[e,i])||!e)return this; -this._events||(this._events={});var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:i,ctx:i||this}),this},once:function(t,e,n){if(!h(this,"once",t,[e,n])||!e)return this;var o=this,s=i.once(function(){o.off(t,s),e.apply(this,arguments)});return s._callback=e,this.on(t,s,n)},off:function(t,e,n){var o,s,r,a,l,u,c,f;if(!this._events||!h(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events=void 0,this;for(a=t?[t]:i.keys(this._events),l=0,u=a.length;u>l;l++)if(t=a[l],r=this._events[t]){if(this._events[t]=o=[],e||n)for(c=0,f=r.length;f>c;c++)s=r[c],(e&&e!==s.callback&&e!==s.callback._callback||n&&n!==s.context)&&o.push(s);o.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=r.call(arguments,1);if(!h(this,"trigger",t,e))return this;var i=this._events[t],n=this._events.all;return i&&u(i,e),n&&u(n,arguments),this},stopListening:function(t,e,n){var o=this._listeningTo;if(!o)return this;var s=!e&&!n;n||"object"!=typeof e||(n=this),t&&((o={})[t._listenId]=t);for(var r in o)t=o[r],t.off(e,n,this),(s||i.isEmpty(t._events))&&delete this._listeningTo[r];return this}},l=/\s+/,h=function(t,e,i,n){if(!i)return!0;if("object"==typeof i){for(var o in i)t[e].apply(t,[o,i[o]].concat(n));return!1}if(l.test(i)){for(var s=i.split(l),r=0,a=s.length;a>r;r++)t[e].apply(t,[s[r]].concat(n));return!1}return!0},u=function(t,e){var i,n=-1,o=t.length,s=e[0],r=e[1],a=e[2];switch(e.length){case 0:for(;++nf;f++)this.trigger("change:"+a[f],this,c[a[f]],n)}if(h)return this;if(!l)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):!1;var e,n=!1,o=this._changing?this._previousAttributes:this.attributes;for(var s in t)i.isEqual(o[s],e=t[s])||((n||(n={}))[s]=e);return n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){return e.set(e.parse(i,t),t)?(n&&n(e,i,t),void e.trigger("sync",e,i,t)):!1},A(this,t),this.sync("read",this,t)},save:function(t,e,n){var o,s,r,a=this.attributes;if(null==t||"object"==typeof t?(o=t,n=e):(o={})[t]=e,n=i.extend({validate:!0},n),o&&!n.wait){if(!this.set(o,n))return!1}else if(!this._validate(o,n))return!1;o&&n.wait&&(this.attributes=i.extend({},a,o)),void 0===n.parse&&(n.parse=!0);var l=this,h=n.success;return n.success=function(t){l.attributes=a;var e=l.parse(t,n);return n.wait&&(e=i.extend(o||{},e)),i.isObject(e)&&!l.set(e,n)?!1:(h&&h(l,t,n),void l.trigger("sync",l,t,n))},A(this,n),s=this.isNew()?"create":n.patch?"patch":"update","patch"===s&&(n.attrs=o),r=this.sync(s,this,n),o&&n.wait&&(this.attributes=a),r},destroy:function(t){t=t?i.clone(t):{};var e=this,n=t.success,o=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(i){(t.wait||e.isNew())&&o(),n&&n(e,i,t),e.isNew()||e.trigger("sync",e,i,t)},this.isNew())return t.success(),!1;A(this,t);var s=this.sync("delete",this,t);return t.wait||o(),s},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||L();return this.isNew()?t:t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return n?(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1):!0}});var d=["keys","values","pairs","invert","pick","omit"];i.each(d,function(t){f.prototype[t]=function(){var e=r.call(arguments);return e.unshift(this.attributes),i[t].apply(i,e)}});var p=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},g={add:!0,remove:!0,merge:!0},m={add:!0,remove:!1};i.extend(p.prototype,a,{model:f,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,m))},remove:function(t,e){var n=!i.isArray(t);t=n?[t]:i.clone(t),e||(e={});var o,s,r,a;for(o=0,s=t.length;s>o;o++)a=t[o]=this.get(t[o]),a&&(delete this._byId[a.id],delete this._byId[a.cid],r=this.indexOf(a),this.models.splice(r,1),this.length--,e.silent||(e.index=r,a.trigger("remove",a,this,e)),this._removeReference(a,e));return n?t[0]:t},set:function(t,e){e=i.defaults({},e,g),e.parse&&(t=this.parse(t,e));var n=!i.isArray(t);t=n?t?[t]:[]:i.clone(t);var o,s,r,a,l,h,u,c=e.at,d=this.model,p=this.comparator&&null==c&&e.sort!==!1,m=i.isString(this.comparator)?this.comparator:null,v=[],b=[],y={},_=e.add,w=e.merge,C=e.remove,x=!p&&_&&C?[]:!1;for(o=0,s=t.length;s>o;o++){if(l=t[o]||{},r=l instanceof f?a=l:l[d.prototype.idAttribute||"id"],h=this.get(r))C&&(y[h.cid]=!0),w&&(l=l===a?a.attributes:l,e.parse&&(l=h.parse(l,e)),h.set(l,e),p&&!u&&h.hasChanged(m)&&(u=!0)),t[o]=h;else if(_){if(a=t[o]=this._prepareModel(l,e),!a)continue;v.push(a),this._addReference(a,e)}a=h||a,!x||!a.isNew()&&y[a.id]||x.push(a),y[a.id]=!0}if(C){for(o=0,s=this.length;s>o;++o)y[(a=this.models[o]).cid]||b.push(a);b.length&&this.remove(b,e)}if(v.length||x&&x.length)if(p&&(u=!0),this.length+=v.length,null!=c)for(o=0,s=v.length;s>o;o++)this.models.splice(c+o,0,v[o]);else{x&&(this.models.length=0);var k=x||v;for(o=0,s=k.length;s>o;o++)this.models.push(k[o])}if(u&&this.sort({silent:!0}),!e.silent){for(o=0,s=v.length;s>o;o++)(a=v[o]).trigger("add",a,this,e);(u||x&&x.length)&&this.trigger("sort",this,e)}return n?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,o=this.models.length;o>n;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return r.apply(this.models,arguments)},get:function(t){return null==t?void 0:this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){return i.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){for(var i in t)if(t[i]!==e.get(i))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),i.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=t.success,n=this;return t.success=function(i){var o=t.reset?"reset":"set";n[o](i,t),e&&e(n,i,t),n.trigger("sync",n,i,t)},A(this,t),this.sync("read",this,t)},create:function(t,e){if(e=e?i.clone(e):{},!(t=this._prepareModel(t,e)))return!1;e.wait||this.add(t,e);var n=this,o=e.success;return e.success=function(t,i){e.wait&&n.add(t,e),o&&o(t,i,e)},t.save(null,e),t},parse:function(t){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof f)return t;e=e?i.clone(e):{},e.collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_addReference:function(t){this._byId[t.cid]=t,null!=t.id&&(this._byId[t.id]=t),t.collection||(t.collection=this),t.on("all",this._onModelEvent,this)},_removeReference:function(t){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){("add"!==t&&"remove"!==t||i===this)&&("destroy"===t&&this.remove(e,n),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});var v=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(v,function(t){p.prototype[t]=function(){var e=r.call(arguments);return e.unshift(this.models),i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){p.prototype[t]=function(e,n){var o=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,o,n)}});var y=e.View=function(t){this.cid=i.uniqueId("view"),t||(t={}),i.extend(this,i.pick(t,w)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},_=/^(\S+)\s*(.*)$/,w=["model","collection","el","id","attributes","className","tagName","events"];i.extend(y.prototype,a,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(t){if(!t&&!(t=i.result(this,"events")))return this;this.undelegateEvents();for(var e in t){var n=t[e];if(i.isFunction(n)||(n=this[t[e]]),n){var o=e.match(_),s=o[1],r=o[2];n=i.bind(n,this),s+=".delegateEvents"+this.cid,""===r?this.$el.on(s,n):this.$el.on(s,r,n)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"),!1);else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t["class"]=i.result(this,"className"));var n=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(n,!1)}}}),e.sync=function(t,n,o){var s=x[t];i.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var r={type:s,dataType:"json"};if(o.url||(r.url=i.result(n,"url")||L()),null!=o.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(o.attrs||n.toJSON(o))),o.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),o.emulateHTTP&&("PUT"===s||"DELETE"===s||"PATCH"===s)){r.type="POST",o.emulateJSON&&(r.data._method=s);var a=o.beforeSend;o.beforeSend=function(t){return t.setRequestHeader("X-HTTP-Method-Override",s),a?a.apply(this,arguments):void 0}}"GET"===r.type||o.emulateJSON||(r.processData=!1),"PATCH"===r.type&&C&&(r.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var l=o.xhr=e.ajax(i.extend(r,o));return n.trigger("request",n,l,o),l};var C=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),x={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var k=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},T=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,S=/\*\w+/g,E=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(k.prototype,a,{initialize:function(){},route:function(t,n,o){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(o=n,n=""),o||(o=this[n]);var s=this;return e.history.route(t,function(i){var r=s._extractParameters(t,i);s.execute(o,r),s.trigger.apply(s,["route:"+n].concat(r)),s.trigger("route",n,r),e.history.trigger("route",s,n,r)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(E,"\\$&").replace(T,"(?:$1)?").replace(M,function(t,e){return e?t:"([^/?]+)"}).replace(S,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var P=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},z=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,I=/msie [\w.]+/,O=/\/$/,H=/#.*$/;P.started=!1,i.extend(P.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(O,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace(z,"")},start:function(t){if(P.started)throw new Error("Backbone.history has already been started");P.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),o=document.documentMode,s=I.exec(navigator.userAgent.toLowerCase())&&(!o||7>=o);if(this.root=("/"+this.root+"/").replace(D,"/"),s&&this._wantsHashChange){var r=e.$('\n' -}),define("text!templates/spinner.html",[],function(){return'
\n
\n
\n
\n
\n
\n
'}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
\n
\n
\n
\n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){var i={cleanUp:function(e){return e=e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},n={rawUrlCleaner:[i],multimedia:function(i,o){var s=e.trim(i),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_videoFallback:function(e){var t,i="";if(/http/.test(e)===!1&&(e="http://"+e),/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i.test(e)){var o=e.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop();if("youtu.be"===o&&/youtu.be\/(.*?)(&.*)?$/.test(e))return t=e.match(/youtu.be\/(.*?)(&.*)?$/)[1],i=n._createIframe({url:"//www.youtube.com/embed/"+t}),i=n._videoIframe(i);if("youtube.com"===o)return/v=(.*?)(&.*)?$/.test(e)&&(t=e.match(/v=(.*?)(&.*)?$/)[1],i=n._createIframe({url:"//www.youtube.com/embed/"+t}),i=n._videoIframe(i)),i}return i},_embedly:function(e){return"[embed]"+e+"[/embed]"},_createIframe:function(e){return''}};return n}),define("text!templates/mediaInsert.html",[],function(){return'
\n
\n
\n \n \n \n\n \n
\n
\n
\n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this._setupTextArea(),this.parentThreadline||this._onFormReady(),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){e.preventDefault();var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){this._setupTextArea();var e=this.$(".js-data");if(e.length>0&&"edit"===e.data("meta").action){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0}),this._addCountdown()}n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n=this.$(".btn-submit")[0];if(i.preventDefault(),"object"==typeof n.validity&&n.form.checkValidity()===!1){var o=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(n).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this);o(),this.sendInProgress=!1}else n.disabled=!0,n.form.submit()},_sendInline:function(i){i.preventDefault();var o=this.$("#EntryAddForm").serialize(),s=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),r=t.bind(this._disable,this);e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:r}).done(s).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
    ').parent().wrap("
  • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
    \n <%- $.i18n.__('ncy.bkm') %>\n
    \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,v){var b=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog)},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href); -this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new v({el:e,model:new d({id:"foo"})})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new r({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==r&&(f.stop(!0),r="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=r&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
    ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
    "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
    ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,a,r={};switch(t.dir1){case"down":a="top";break;case"up":a="bottom";break;case"left":a="right";break;case"right":a="left"}n=parseInt(f.css(a)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||r.top||r.bottom||r.right||r.left))switch(t.dir1){case"down":r.top=t.nextpos1+"px";break;case"up":r.bottom=t.nextpos1+"px";break;case"left":r.right=t.nextpos1+"px";break;case"right":r.left=t.nextpos1+"px"}else f.css(a,t.nextpos1+"px");switch((r.top||r.bottom||r.right||r.left)&&f.animate(r,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){r="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){r="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
    ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
    ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
    ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

    ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
    ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
    "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
    ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
    ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
    '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var a={lat:e.get("lat"),lng:e.get("lng")};a.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(a)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
    \n
    \n
    \n
    "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,a){var r=e.module("usermap",{startWithParent:!1});return r.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:a,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=r.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),r}),define("app/time",["moment","moment-de"],function(e){var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var a=e.split("%s");if(a.length>1)for(var r=0;r0&&a[r].lastIndexOf("%")==a[r].length-1&&(a[r]+="s"+a.splice(r+1,1)[0]),i+=a[r]+t[r];return i+a[a.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,a,r,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),r.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:r(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},a=t;return a.addInitializer(s.bootstrapApp),a.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),a}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){require(["app/app"])}),define("main",function(){}); \ No newline at end of file +"undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,a,r=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),a=r},n=function(){o=setTimeout(i,a)},i=e.bind(function(){n(),this.fetch({success:function(){a=Math.floor(a*(1+a/4e4)),a>l&&(a=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var a=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new a}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,a;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))a=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),a=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();a=new n(e)}if(s="normal"===i?this._normal(a):a.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var r=" ",l={title:a.format(this._timeFormats.theRightWay),datetime:a.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){r+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:a,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(r,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.CollectionView.extend({itemView:a,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
    <%= time %>
    '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
    "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(r,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:r.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
    \n \n
    \n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return r}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return r}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
    \n
    \n
    \n
    \n
    \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,a,r,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new a({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new r({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,a){"use strict";var r=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return r}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
    '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
    \n <%= linkImage %>\n
    \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),a=i.value.substring(n,i.value.length);return i.value=s+e+a,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],a=!1,r=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(r=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",a="\r\n",r="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+t+'"',r+=a,r+=a,r+=i,r+=a})}return r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+T.paramname+'"',r+='; filename="'+t+'"',r+=a,r+="Content-Type: "+n,r+=a,r+=a,r+=i,r+=a,r+=s,r+=o,r+=s,r+=a}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(a=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(r>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;r>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(a)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===r)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,r),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===r-o&&g(),d===!1&&(a=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;r>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,r=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
    \n
    \n
    \n
    \n
    \n \n
    \n

    <%- $.i18n.__(\'upload_new_title\') %>

    \n

    \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

    \n
    \n \n
    \n\n' +}),define("text!templates/spinner.html",[],function(){return'
    \n
    \n
    \n
    \n
    \n
    \n
    '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
    \n
    \n
    \n
    \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
    \n
    \n
    \n \n \n \n\n \n
    \n
    \n
    \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this._setupTextArea(),this.parentThreadline||this._onFormReady(),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){e.preventDefault();var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){this._setupTextArea();var e=this.$(".js-data");if(e.length>0&&"edit"===e.data("meta").action){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0}),this._addCountdown()}n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n=this.$(".btn-submit")[0];if(i.preventDefault(),"object"==typeof n.validity&&n.form.checkValidity()===!1){var o=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(n).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this);o(),this.sendInProgress=!1}else n.disabled=!0,n.form.submit()},_sendInline:function(i){i.preventDefault();var o=this.$("#EntryAddForm").serialize(),s=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),r=t.bind(this._disable,this);e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:r}).done(s).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){"use strict";var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
      ').parent().wrap("
    • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
      \n <%- $.i18n.__('ncy.bkm') %>\n
      \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) +},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"})})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new r({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==r&&(f.stop(!0),r="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=r&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
      ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
      "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
      ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,a,r={};switch(t.dir1){case"down":a="top";break;case"up":a="bottom";break;case"left":a="right";break;case"right":a="left"}n=parseInt(f.css(a)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||r.top||r.bottom||r.right||r.left))switch(t.dir1){case"down":r.top=t.nextpos1+"px";break;case"up":r.bottom=t.nextpos1+"px";break;case"left":r.right=t.nextpos1+"px";break;case"right":r.left=t.nextpos1+"px"}else f.css(a,t.nextpos1+"px");switch((r.top||r.bottom||r.right||r.left)&&f.animate(r,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){r="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){r="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
      ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
      ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
      ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

      ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
      ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
      "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
      ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
      ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
      '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var a={lat:e.get("lat"),lng:e.get("lng")};a.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(a)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
      \n
      \n
      \n
      "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,a){"use strict";var r=e.module("usermap",{startWithParent:!1});return r.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:a,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=r.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),r}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var a=e.split("%s");if(a.length>1)for(var r=0;r0&&a[r].lastIndexOf("%")==a[r].length-1&&(a[r]+="s"+a.splice(r+1,1)[0]),i+=a[r]+t[r];return i+a[a.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,a,r,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),r.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:r(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},a=t;return a.addInitializer(s.bootstrapApp),a.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),a}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["app/app"])}),define("main",function(){}); \ No newline at end of file diff --git a/app/webroot/dist/require.min.js b/app/webroot/dist/require.min.js index d3b5ba7e1..5e242c72b 100644 --- a/app/webroot/dist/require.min.js +++ b/app/webroot/dist/require.min.js @@ -1 +1 @@ -var requirejs,require,define;!function(global){function isFunction(a){return"[object Function]"===ostring.call(a)}function isArray(a){return"[object Array]"===ostring.call(a)}function each(a,b){if(a){var c;for(c=0;c-1&&(!a[c]||!b(a[c],c,a));c-=1);}}function hasProp(a,b){return hasOwn.call(a,b)}function getOwn(a,b){return hasProp(a,b)&&a[b]}function eachProp(a,b){var c;for(c in a)if(hasProp(a,c)&&b(a[c],c))break}function mixin(a,b,c,d){return b&&eachProp(b,function(b,e){(c||!hasProp(a,e))&&(!d||"object"!=typeof b||!b||isArray(b)||isFunction(b)||b instanceof RegExp?a[e]=b:(a[e]||(a[e]={}),mixin(a[e],b,c,d)))}),a}function bind(a,b){return function(){return b.apply(a,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(a){throw a}function getGlobal(a){if(!a)return a;var b=global;return each(a.split("."),function(a){b=b[a]}),b}function makeError(a,b,c,d){var e=new Error(b+"\nhttp://requirejs.org/docs/errors.html#"+a);return e.requireType=a,e.requireModules=d,c&&(e.originalError=c),e}function newContext(a){function b(a){var b,c;for(b=0;b0&&(a.splice(b-1,2),b-=2)}}function c(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q=c&&c.split("/"),r=x.map,s=r&&r["*"];if(a&&(a=a.split("/"),k=a.length-1,x.nodeIdCompat&&jsSuffixRegExp.test(a[k])&&(a[k]=a[k].replace(jsSuffixRegExp,"")),"."===a[0].charAt(0)&&q&&(p=q.slice(0,q.length-1),a=p.concat(a)),b(a),a=a.join("/")),d&&r&&(q||s)){g=a.split("/");a:for(h=g.length;h>0;h-=1){if(j=g.slice(0,h).join("/"),q)for(i=q.length;i>0;i-=1)if(f=getOwn(r,q.slice(0,i).join("/")),f&&(f=getOwn(f,j))){l=f,m=h;break a}!n&&s&&getOwn(s,j)&&(n=getOwn(s,j),o=h)}!l&&n&&(l=n,m=o),l&&(g.splice(0,m,l),a=g.join("/"))}return e=getOwn(x.pkgs,a),e?e:a}function d(a){isBrowser&&each(scripts(),function(b){return b.getAttribute("data-requiremodule")===a&&b.getAttribute("data-requirecontext")===u.contextName?(b.parentNode.removeChild(b),!0):void 0})}function e(a){var b=getOwn(x.paths,a);return b&&isArray(b)&&b.length>1?(b.shift(),u.require.undef(a),u.makeRequire(null,{skipMap:!0})([a]),!0):void 0}function f(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function g(a,b,d,e){var g,h,i,j,k=null,l=b?b.name:null,m=a,n=!0,o="";return a||(n=!1,a="_@r"+(F+=1)),j=f(a),k=j[0],a=j[1],k&&(k=c(k,l,e),h=getOwn(C,k)),a&&(k?o=h&&h.normalize?h.normalize(a,function(a){return c(a,l,e)}):-1===a.indexOf("!")?c(a,l,e):a:(o=c(a,l,e),j=f(o),k=j[0],o=j[1],d=!0,g=u.nameToUrl(o))),i=!k||h||d?"":"_unnormalized"+(G+=1),{prefix:k,name:o,parentMap:b,unnormalized:!!i,url:g,originalName:m,isDefine:n,id:(k?k+"!"+o:o)+i}}function h(a){var b=a.id,c=getOwn(y,b);return c||(c=y[b]=new u.Module(a)),c}function i(a,b,c){var d=a.id,e=getOwn(y,d);!hasProp(C,d)||e&&!e.defineEmitComplete?(e=h(a),e.error&&"error"===b?c(e.error):e.on(b,c)):"defined"===b&&c(C[d])}function j(a,b){var c=a.requireModules,d=!1;b?b(a):(each(c,function(b){var c=getOwn(y,b);c&&(c.error=a,c.events.error&&(d=!0,c.emit("error",a)))}),d||req.onError(a))}function k(){globalDefQueue.length&&(apsp.apply(B,[B.length,0].concat(globalDefQueue)),globalDefQueue=[])}function l(a){delete y[a],delete z[a]}function m(a,b,c){var d=a.map.id;a.error?a.emit("error",a.error):(b[d]=!0,each(a.depMaps,function(d,e){var f=d.id,g=getOwn(y,f);!g||a.depMatched[e]||c[f]||(getOwn(b,f)?(a.defineDep(e,C[f]),a.check()):m(g,b,c))}),c[d]=!0)}function n(){var a,b,c=1e3*x.waitSeconds,f=c&&u.startTime+c<(new Date).getTime(),g=[],h=[],i=!1,k=!0;if(!s){if(s=!0,eachProp(z,function(a){var c=a.map,j=c.id;if(a.enabled&&(c.isDefine||h.push(a),!a.error))if(!a.inited&&f)e(j)?(b=!0,i=!0):(g.push(j),d(j));else if(!a.inited&&a.fetched&&c.isDefine&&(i=!0,!c.prefix))return k=!1}),f&&g.length)return a=makeError("timeout","Load timeout for modules: "+g,null,g),a.contextName=u.contextName,j(a);k&&each(h,function(a){m(a,{},{})}),f&&!b||!i||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,n()},50)),s=!1}}function o(a){hasProp(C,a[0])||h(g(a[0],null,!0)).init(a[1],a[2])}function p(a,b,c,d){a.detachEvent&&!isOpera?d&&a.detachEvent(d,b):a.removeEventListener(c,b,!1)}function q(a){var b=a.currentTarget||a.srcElement;return p(b,u.onScriptLoad,"load","onreadystatechange"),p(b,u.onScriptError,"error"),{node:b,id:b&&b.getAttribute("data-requiremodule")}}function r(){var a;for(k();B.length;){if(a=B.shift(),null===a[0])return j(makeError("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));o(a)}}var s,t,u,v,w,x={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},y={},z={},A={},B=[],C={},D={},E={},F=1,G=1;return v={require:function(a){return a.require?a.require:a.require=u.makeRequire(a.map)},exports:function(a){return a.usingExports=!0,a.map.isDefine?a.exports?C[a.map.id]=a.exports:a.exports=C[a.map.id]={}:void 0},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return getOwn(x.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}},t=function(a){this.events=getOwn(A,a.id)||{},this.map=a,this.shim=getOwn(x.shim,a.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},t.prototype={init:function(a,b,c,d){d=d||{},this.inited||(this.factory=b,c?this.on("error",c):this.events.error&&(c=bind(this,function(a){this.emit("error",a)})),this.depMaps=a&&a.slice(0),this.errback=c,this.inited=!0,this.ignore=d.ignore,d.enabled||this.enabled?this.enable():this.check())},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=(new Date).getTime();var a=this.map;return this.shim?void u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return a.prefix?this.callPlugin():this.load()})):a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;D[a]||(D[a]=!0,u.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id,d=this.depExports,e=this.exports,f=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{e=u.execCb(c,f,d,e)}catch(g){a=g}else e=u.execCb(c,f,d,e);if(this.map.isDefine&&void 0===e&&(b=this.module,b?e=b.exports:this.usingExports&&(e=this.exports)),a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",j(this.error=a)}else e=f;this.exports=e,this.map.isDefine&&!this.ignore&&(C[c]=e,req.onResourceLoad&&req.onResourceLoad(u,this.map,this.depMaps)),l(c),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=g(a.prefix);this.depMaps.push(d),i(d,"defined",bind(this,function(d){var e,f,k,m=getOwn(E,this.map.id),n=this.map.name,o=this.map.parentMap?this.map.parentMap.name:null,p=u.makeRequire(a.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(d.normalize&&(n=d.normalize(n,function(a){return c(a,o,!0)})||""),f=g(a.prefix+"!"+n,this.map.parentMap),i(f,"defined",bind(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),k=getOwn(y,f.id),void(k&&(this.depMaps.push(f),this.events.error&&k.on("error",bind(this,function(a){this.emit("error",a)})),k.enable()))):m?(this.map.url=u.nameToUrl(m),void this.load()):(e=bind(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),e.error=bind(this,function(a){this.inited=!0,this.error=a,a.requireModules=[b],eachProp(y,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&l(a.map.id)}),j(a)}),e.fromText=bind(this,function(c,d){var f=a.name,i=g(f),k=useInteractive;d&&(c=d),k&&(useInteractive=!1),h(i),hasProp(x.config,b)&&(x.config[f]=x.config[b]);try{req.exec(c)}catch(l){return j(makeError("fromtexteval","fromText eval for "+b+" failed: "+l,l,[b]))}k&&(useInteractive=!0),this.depMaps.push(i),u.completeLoad(f),p([f],e)}),void d.load(a.name,p,e,x))})),u.enable(d,this),this.pluginMaps[d.id]=d},enable:function(){z[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(a,b){var c,d,e;if("string"==typeof a){if(a=g(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[b]=a,e=getOwn(v,a.id))return void(this.depExports[b]=e(this));this.depCount+=1,i(a,"defined",bind(this,function(a){this.defineDep(b,a),this.check()})),this.errback&&i(a,"error",bind(this,this.errback))}c=a.id,d=y[c],hasProp(v,c)||!d||d.enabled||u.enable(a,this)})),eachProp(this.pluginMaps,bind(this,function(a){var b=getOwn(y,a.id);b&&!b.enabled&&u.enable(a,this)})),this.enabling=!1,this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]),c.push(b)},emit:function(a,b){each(this.events[a],function(a){a(b)}),"error"===a&&delete this.events[a]}},u={config:x,contextName:a,registry:y,defined:C,urlFetched:D,defQueue:B,Module:t,makeModuleMap:g,nextTick:req.nextTick,onError:j,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=x.shim,c={paths:!0,bundles:!0,config:!0,map:!0};eachProp(a,function(a,b){c[b]?(x[b]||(x[b]={}),mixin(x[b],a,!0,!0)):x[b]=a}),a.bundles&&eachProp(a.bundles,function(a,b){each(a,function(a){a!==b&&(E[a]=b)})}),a.shim&&(eachProp(a.shim,function(a,c){isArray(a)&&(a={deps:a}),!a.exports&&!a.init||a.exportsFn||(a.exportsFn=u.makeShimExports(a)),b[c]=a}),x.shim=b),a.packages&&each(a.packages,function(a){var b,c;a="string"==typeof a?{name:a}:a,c=a.name,b=a.location,b&&(x.paths[c]=a.location),x.pkgs[c]=a.name+"/"+(a.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(y,function(a,b){a.inited||a.map.unnormalized||(a.map=g(b))}),(a.deps||a.callback)&&u.require(a.deps||[],a.callback)},makeShimExports:function(a){function b(){var b;return a.init&&(b=a.init.apply(global,arguments)),b||a.exports&&getGlobal(a.exports)}return b},makeRequire:function(b,e){function f(c,d,i){var k,l,m;return e.enableBuildCallback&&d&&isFunction(d)&&(d.__requireJsBuild=!0),"string"==typeof c?isFunction(d)?j(makeError("requireargs","Invalid require call"),i):b&&hasProp(v,c)?v[c](y[b.id]):req.get?req.get(u,c,b,f):(l=g(c,b,!1,!0),k=l.id,hasProp(C,k)?C[k]:j(makeError("notloaded",'Module name "'+k+'" has not been loaded yet for context: '+a+(b?"":". Use require([])")))):(r(),u.nextTick(function(){r(),m=h(g(null,b)),m.skipMap=e.skipMap,m.init(c,d,i,{enabled:!0}),n()}),f)}return e=e||{},mixin(f,{isBrowser:isBrowser,toUrl:function(a){var d,e=a.lastIndexOf("."),f=a.split("/")[0],g="."===f||".."===f;return-1!==e&&(!g||e>1)&&(d=a.substring(e,a.length),a=a.substring(0,e)),u.nameToUrl(c(a,b&&b.id,!0),d,!0)},defined:function(a){return hasProp(C,g(a,b,!1,!0).id)},specified:function(a){return a=g(a,b,!1,!0).id,hasProp(C,a)||hasProp(y,a)}}),b||(f.undef=function(a){k();var c=g(a,b,!0),e=getOwn(y,a);d(a),delete C[a],delete D[c.url],delete A[a],eachReverse(B,function(b,c){b[0]===a&&B.splice(c,1)}),e&&(e.events.defined&&(A[a]=e.events),l(a))}),f},enable:function(a){var b=getOwn(y,a.id);b&&h(a).enable()},completeLoad:function(a){var b,c,d,f=getOwn(x.shim,a)||{},g=f.exports;for(k();B.length;){if(c=B.shift(),null===c[0]){if(c[0]=a,b)break;b=!0}else c[0]===a&&(b=!0);o(c)}if(d=getOwn(y,a),!b&&!hasProp(C,a)&&d&&!d.inited){if(!(!x.enforceDefine||g&&getGlobal(g)))return e(a)?void 0:j(makeError("nodefine","No define call for "+a,null,[a]));o([a,f.deps||[],f.exportsFn])}n()},nameToUrl:function(a,b,c){var d,e,f,g,h,i,j,k=getOwn(x.pkgs,a);if(k&&(a=k),j=getOwn(E,a))return u.nameToUrl(j,b,c);if(req.jsExtRegExp.test(a))h=a+(b||"");else{for(d=x.paths,e=a.split("/"),f=e.length;f>0;f-=1)if(g=e.slice(0,f).join("/"),i=getOwn(d,g)){isArray(i)&&(i=i[0]),e.splice(0,f,i);break}h=e.join("/"),h+=b||(/^data\:|\?/.test(h)||c?"":".js"),h=("/"===h.charAt(0)||h.match(/^[\w\+\.\-]+:/)?"":x.baseUrl)+h}return x.urlArgs?h+((-1===h.indexOf("?")?"?":"&")+x.urlArgs):h},load:function(a,b){req.load(u,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||readyRegExp.test((a.currentTarget||a.srcElement).readyState)){interactiveScript=null;var b=q(a);u.completeLoad(b.id)}},onScriptError:function(a){var b=q(a);return e(b.id)?void 0:j(makeError("scripterror","Script error for: "+b.id,a,[b.id]))}},u.require=u.makeRequire(),u}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(a){return"interactive"===a.readyState?interactiveScript=a:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.15",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(a,b,c,d){var e,f,g=defContextName;return isArray(a)||"string"==typeof a||(f=a,isArray(b)?(a=b,b=c,c=d):a=[]),f&&f.context&&(g=f.context),e=getOwn(contexts,g),e||(e=contexts[g]=req.s.newContext(g)),f&&e.configure(f),e.require(a,b,c)},req.config=function(a){return req(a)},req.nextTick="undefined"!=typeof setTimeout?function(a){setTimeout(a,4)}:function(a){a()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(a){req[a]=function(){var b=contexts[defContextName];return b.require[a].apply(b,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(a){var b=a.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return b.type=a.scriptType||"text/javascript",b.charset="utf-8",b.async=!0,b},req.load=function(a,b,c){var d,e=a&&a.config||{};if(isBrowser)return d=req.createNode(e,b,c),d.setAttribute("data-requirecontext",a.contextName),d.setAttribute("data-requiremodule",b),!d.attachEvent||d.attachEvent.toString&&d.attachEvent.toString().indexOf("[native code")<0||isOpera?(d.addEventListener("load",a.onScriptLoad,!1),d.addEventListener("error",a.onScriptError,!1)):(useInteractive=!0,d.attachEvent("onreadystatechange",a.onScriptLoad)),d.src=c,currentlyAddingScript=d,baseElement?head.insertBefore(d,baseElement):head.appendChild(d),currentlyAddingScript=null,d;if(isWebWorker)try{importScripts(c),a.completeLoad(b)}catch(f){a.onError(makeError("importscripts","importScripts failed for "+b+" at "+c,f,[b]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(a){return head||(head=a.parentNode),dataMain=a.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(a,b,c){var d,e;"string"!=typeof a&&(c=b,b=a,a=null),isArray(b)||(c=b,b=null),!b&&isFunction(c)&&(b=[],c.length&&(c.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(a,c){b.push(c)}),b=(1===c.length?["require"]:["require","exports","module"]).concat(b))),useInteractive&&(d=currentlyAddingScript||getInteractiveScript(),d&&(a||(a=d.getAttribute("data-requiremodule")),e=contexts[d.getAttribute("data-requirecontext")])),(e?e.defQueue:globalDefQueue).push([a,b,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this); \ No newline at end of file +var requirejs,require,define;!function(global){function isFunction(a){return"[object Function]"===ostring.call(a)}function isArray(a){return"[object Array]"===ostring.call(a)}function each(a,b){if(a){var c;for(c=0;c-1&&(!a[c]||!b(a[c],c,a));c-=1);}}function hasProp(a,b){return hasOwn.call(a,b)}function getOwn(a,b){return hasProp(a,b)&&a[b]}function eachProp(a,b){var c;for(c in a)if(hasProp(a,c)&&b(a[c],c))break}function mixin(a,b,c,d){return b&&eachProp(b,function(b,e){(c||!hasProp(a,e))&&(!d||"object"!=typeof b||!b||isArray(b)||isFunction(b)||b instanceof RegExp?a[e]=b:(a[e]||(a[e]={}),mixin(a[e],b,c,d)))}),a}function bind(a,b){return function(){return b.apply(a,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(a){throw a}function getGlobal(a){if(!a)return a;var b=global;return each(a.split("."),function(a){b=b[a]}),b}function makeError(a,b,c,d){var e=new Error(b+"\nhttp://requirejs.org/docs/errors.html#"+a);return e.requireType=a,e.requireModules=d,c&&(e.originalError=c),e}function newContext(a){function b(a){var b,c;for(b=0;b0&&(a.splice(b-1,2),b-=2)}}function c(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q=c&&c.split("/"),r=x.map,s=r&&r["*"];if(a&&(a=a.split("/"),k=a.length-1,x.nodeIdCompat&&jsSuffixRegExp.test(a[k])&&(a[k]=a[k].replace(jsSuffixRegExp,"")),"."===a[0].charAt(0)&&q&&(p=q.slice(0,q.length-1),a=p.concat(a)),b(a),a=a.join("/")),d&&r&&(q||s)){g=a.split("/");a:for(h=g.length;h>0;h-=1){if(j=g.slice(0,h).join("/"),q)for(i=q.length;i>0;i-=1)if(f=getOwn(r,q.slice(0,i).join("/")),f&&(f=getOwn(f,j))){l=f,m=h;break a}!n&&s&&getOwn(s,j)&&(n=getOwn(s,j),o=h)}!l&&n&&(l=n,m=o),l&&(g.splice(0,m,l),a=g.join("/"))}return e=getOwn(x.pkgs,a),e?e:a}function d(a){isBrowser&&each(scripts(),function(b){return b.getAttribute("data-requiremodule")===a&&b.getAttribute("data-requirecontext")===u.contextName?(b.parentNode.removeChild(b),!0):void 0})}function e(a){var b=getOwn(x.paths,a);return b&&isArray(b)&&b.length>1?(b.shift(),u.require.undef(a),u.makeRequire(null,{skipMap:!0})([a]),!0):void 0}function f(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function g(a,b,d,e){var g,h,i,j,k=null,l=b?b.name:null,m=a,n=!0,o="";return a||(n=!1,a="_@r"+(F+=1)),j=f(a),k=j[0],a=j[1],k&&(k=c(k,l,e),h=getOwn(C,k)),a&&(k?o=h&&h.normalize?h.normalize(a,function(a){return c(a,l,e)}):-1===a.indexOf("!")?c(a,l,e):a:(o=c(a,l,e),j=f(o),k=j[0],o=j[1],d=!0,g=u.nameToUrl(o))),i=!k||h||d?"":"_unnormalized"+(G+=1),{prefix:k,name:o,parentMap:b,unnormalized:!!i,url:g,originalName:m,isDefine:n,id:(k?k+"!"+o:o)+i}}function h(a){var b=a.id,c=getOwn(y,b);return c||(c=y[b]=new u.Module(a)),c}function i(a,b,c){var d=a.id,e=getOwn(y,d);!hasProp(C,d)||e&&!e.defineEmitComplete?(e=h(a),e.error&&"error"===b?c(e.error):e.on(b,c)):"defined"===b&&c(C[d])}function j(a,b){var c=a.requireModules,d=!1;b?b(a):(each(c,function(b){var c=getOwn(y,b);c&&(c.error=a,c.events.error&&(d=!0,c.emit("error",a)))}),d||req.onError(a))}function k(){globalDefQueue.length&&(apsp.apply(B,[B.length,0].concat(globalDefQueue)),globalDefQueue=[])}function l(a){delete y[a],delete z[a]}function m(a,b,c){var d=a.map.id;a.error?a.emit("error",a.error):(b[d]=!0,each(a.depMaps,function(d,e){var f=d.id,g=getOwn(y,f);!g||a.depMatched[e]||c[f]||(getOwn(b,f)?(a.defineDep(e,C[f]),a.check()):m(g,b,c))}),c[d]=!0)}function n(){var a,b,c=1e3*x.waitSeconds,f=c&&u.startTime+c<(new Date).getTime(),g=[],h=[],i=!1,k=!0;if(!s){if(s=!0,eachProp(z,function(a){var c=a.map,j=c.id;if(a.enabled&&(c.isDefine||h.push(a),!a.error))if(!a.inited&&f)e(j)?(b=!0,i=!0):(g.push(j),d(j));else if(!a.inited&&a.fetched&&c.isDefine&&(i=!0,!c.prefix))return k=!1}),f&&g.length)return a=makeError("timeout","Load timeout for modules: "+g,null,g),a.contextName=u.contextName,j(a);k&&each(h,function(a){m(a,{},{})}),f&&!b||!i||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,n()},50)),s=!1}}function o(a){hasProp(C,a[0])||h(g(a[0],null,!0)).init(a[1],a[2])}function p(a,b,c,d){a.detachEvent&&!isOpera?d&&a.detachEvent(d,b):a.removeEventListener(c,b,!1)}function q(a){var b=a.currentTarget||a.srcElement;return p(b,u.onScriptLoad,"load","onreadystatechange"),p(b,u.onScriptError,"error"),{node:b,id:b&&b.getAttribute("data-requiremodule")}}function r(){var a;for(k();B.length;){if(a=B.shift(),null===a[0])return j(makeError("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));o(a)}}var s,t,u,v,w,x={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},y={},z={},A={},B=[],C={},D={},E={},F=1,G=1;return v={require:function(a){return a.require?a.require:a.require=u.makeRequire(a.map)},exports:function(a){return a.usingExports=!0,a.map.isDefine?a.exports?C[a.map.id]=a.exports:a.exports=C[a.map.id]={}:void 0},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return getOwn(x.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}},t=function(a){this.events=getOwn(A,a.id)||{},this.map=a,this.shim=getOwn(x.shim,a.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},t.prototype={init:function(a,b,c,d){d=d||{},this.inited||(this.factory=b,c?this.on("error",c):this.events.error&&(c=bind(this,function(a){this.emit("error",a)})),this.depMaps=a&&a.slice(0),this.errback=c,this.inited=!0,this.ignore=d.ignore,d.enabled||this.enabled?this.enable():this.check())},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=(new Date).getTime();var a=this.map;return this.shim?void u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return a.prefix?this.callPlugin():this.load()})):a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;D[a]||(D[a]=!0,u.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id,d=this.depExports,e=this.exports,f=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{e=u.execCb(c,f,d,e)}catch(g){a=g}else e=u.execCb(c,f,d,e);if(this.map.isDefine&&void 0===e&&(b=this.module,b?e=b.exports:this.usingExports&&(e=this.exports)),a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",j(this.error=a)}else e=f;this.exports=e,this.map.isDefine&&!this.ignore&&(C[c]=e,req.onResourceLoad&&req.onResourceLoad(u,this.map,this.depMaps)),l(c),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=g(a.prefix);this.depMaps.push(d),i(d,"defined",bind(this,function(d){var e,f,k,m=getOwn(E,this.map.id),n=this.map.name,o=this.map.parentMap?this.map.parentMap.name:null,p=u.makeRequire(a.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(d.normalize&&(n=d.normalize(n,function(a){return c(a,o,!0)})||""),f=g(a.prefix+"!"+n,this.map.parentMap),i(f,"defined",bind(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),k=getOwn(y,f.id),void(k&&(this.depMaps.push(f),this.events.error&&k.on("error",bind(this,function(a){this.emit("error",a)})),k.enable()))):m?(this.map.url=u.nameToUrl(m),void this.load()):(e=bind(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),e.error=bind(this,function(a){this.inited=!0,this.error=a,a.requireModules=[b],eachProp(y,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&l(a.map.id)}),j(a)}),e.fromText=bind(this,function(c,d){var f=a.name,i=g(f),k=useInteractive;d&&(c=d),k&&(useInteractive=!1),h(i),hasProp(x.config,b)&&(x.config[f]=x.config[b]);try{req.exec(c)}catch(l){return j(makeError("fromtexteval","fromText eval for "+b+" failed: "+l,l,[b]))}k&&(useInteractive=!0),this.depMaps.push(i),u.completeLoad(f),p([f],e)}),void d.load(a.name,p,e,x))})),u.enable(d,this),this.pluginMaps[d.id]=d},enable:function(){z[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(a,b){var c,d,e;if("string"==typeof a){if(a=g(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[b]=a,e=getOwn(v,a.id))return void(this.depExports[b]=e(this));this.depCount+=1,i(a,"defined",bind(this,function(a){this.defineDep(b,a),this.check()})),this.errback&&i(a,"error",bind(this,this.errback))}c=a.id,d=y[c],hasProp(v,c)||!d||d.enabled||u.enable(a,this)})),eachProp(this.pluginMaps,bind(this,function(a){var b=getOwn(y,a.id);b&&!b.enabled&&u.enable(a,this)})),this.enabling=!1,this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]),c.push(b)},emit:function(a,b){each(this.events[a],function(a){a(b)}),"error"===a&&delete this.events[a]}},u={config:x,contextName:a,registry:y,defined:C,urlFetched:D,defQueue:B,Module:t,makeModuleMap:g,nextTick:req.nextTick,onError:j,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=x.shim,c={paths:!0,bundles:!0,config:!0,map:!0};eachProp(a,function(a,b){c[b]?(x[b]||(x[b]={}),mixin(x[b],a,!0,!0)):x[b]=a}),a.bundles&&eachProp(a.bundles,function(a,b){each(a,function(a){a!==b&&(E[a]=b)})}),a.shim&&(eachProp(a.shim,function(a,c){isArray(a)&&(a={deps:a}),!a.exports&&!a.init||a.exportsFn||(a.exportsFn=u.makeShimExports(a)),b[c]=a}),x.shim=b),a.packages&&each(a.packages,function(a){var b,c;a="string"==typeof a?{name:a}:a,c=a.name,b=a.location,b&&(x.paths[c]=a.location),x.pkgs[c]=a.name+"/"+(a.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(y,function(a,b){a.inited||a.map.unnormalized||(a.map=g(b))}),(a.deps||a.callback)&&u.require(a.deps||[],a.callback)},makeShimExports:function(a){function b(){var b;return a.init&&(b=a.init.apply(global,arguments)),b||a.exports&&getGlobal(a.exports)}return b},makeRequire:function(b,e){function f(c,d,i){var k,l,m;return e.enableBuildCallback&&d&&isFunction(d)&&(d.__requireJsBuild=!0),"string"==typeof c?isFunction(d)?j(makeError("requireargs","Invalid require call"),i):b&&hasProp(v,c)?v[c](y[b.id]):req.get?req.get(u,c,b,f):(l=g(c,b,!1,!0),k=l.id,hasProp(C,k)?C[k]:j(makeError("notloaded",'Module name "'+k+'" has not been loaded yet for context: '+a+(b?"":". Use require([])")))):(r(),u.nextTick(function(){r(),m=h(g(null,b)),m.skipMap=e.skipMap,m.init(c,d,i,{enabled:!0}),n()}),f)}return e=e||{},mixin(f,{isBrowser:isBrowser,toUrl:function(a){var d,e=a.lastIndexOf("."),f=a.split("/")[0],g="."===f||".."===f;return-1!==e&&(!g||e>1)&&(d=a.substring(e,a.length),a=a.substring(0,e)),u.nameToUrl(c(a,b&&b.id,!0),d,!0)},defined:function(a){return hasProp(C,g(a,b,!1,!0).id)},specified:function(a){return a=g(a,b,!1,!0).id,hasProp(C,a)||hasProp(y,a)}}),b||(f.undef=function(a){k();var c=g(a,b,!0),e=getOwn(y,a);d(a),delete C[a],delete D[c.url],delete A[a],eachReverse(B,function(b,c){b[0]===a&&B.splice(c,1)}),e&&(e.events.defined&&(A[a]=e.events),l(a))}),f},enable:function(a){var b=getOwn(y,a.id);b&&h(a).enable()},completeLoad:function(a){var b,c,d,f=getOwn(x.shim,a)||{},g=f.exports;for(k();B.length;){if(c=B.shift(),null===c[0]){if(c[0]=a,b)break;b=!0}else c[0]===a&&(b=!0);o(c)}if(d=getOwn(y,a),!b&&!hasProp(C,a)&&d&&!d.inited){if(!(!x.enforceDefine||g&&getGlobal(g)))return e(a)?void 0:j(makeError("nodefine","No define call for "+a,null,[a]));o([a,f.deps||[],f.exportsFn])}n()},nameToUrl:function(a,b,c){var d,e,f,g,h,i,j,k=getOwn(x.pkgs,a);if(k&&(a=k),j=getOwn(E,a))return u.nameToUrl(j,b,c);if(req.jsExtRegExp.test(a))h=a+(b||"");else{for(d=x.paths,e=a.split("/"),f=e.length;f>0;f-=1)if(g=e.slice(0,f).join("/"),i=getOwn(d,g)){isArray(i)&&(i=i[0]),e.splice(0,f,i);break}h=e.join("/"),h+=b||(/^data\:|\?/.test(h)||c?"":".js"),h=("/"===h.charAt(0)||h.match(/^[\w\+\.\-]+:/)?"":x.baseUrl)+h}return x.urlArgs?h+((-1===h.indexOf("?")?"?":"&")+x.urlArgs):h},load:function(a,b){req.load(u,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||readyRegExp.test((a.currentTarget||a.srcElement).readyState)){interactiveScript=null;var b=q(a);u.completeLoad(b.id)}},onScriptError:function(a){var b=q(a);return e(b.id)?void 0:j(makeError("scripterror","Script error for: "+b.id,a,[b.id]))}},u.require=u.makeRequire(),u}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(a){return"interactive"===a.readyState?interactiveScript=a:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.15",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(a,b,c,d){var e,f,g=defContextName;return isArray(a)||"string"==typeof a||(f=a,isArray(b)?(a=b,b=c,c=d):a=[]),f&&f.context&&(g=f.context),e=getOwn(contexts,g),e||(e=contexts[g]=req.s.newContext(g)),f&&e.configure(f),e.require(a,b,c)},req.config=function(a){return req(a)},req.nextTick="undefined"!=typeof setTimeout?function(a){setTimeout(a,4)}:function(a){a()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(a){req[a]=function(){var b=contexts[defContextName];return b.require[a].apply(b,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(a,b,c){var d=a.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return d.type=a.scriptType||"text/javascript",d.charset="utf-8",d.async=!0,d},req.load=function(a,b,c){var d,e=a&&a.config||{};if(isBrowser)return d=req.createNode(e,b,c),d.setAttribute("data-requirecontext",a.contextName),d.setAttribute("data-requiremodule",b),!d.attachEvent||d.attachEvent.toString&&d.attachEvent.toString().indexOf("[native code")<0||isOpera?(d.addEventListener("load",a.onScriptLoad,!1),d.addEventListener("error",a.onScriptError,!1)):(useInteractive=!0,d.attachEvent("onreadystatechange",a.onScriptLoad)),d.src=c,currentlyAddingScript=d,baseElement?head.insertBefore(d,baseElement):head.appendChild(d),currentlyAddingScript=null,d;if(isWebWorker)try{importScripts(c),a.completeLoad(b)}catch(f){a.onError(makeError("importscripts","importScripts failed for "+b+" at "+c,f,[b]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(a){return head||(head=a.parentNode),dataMain=a.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(a,b,c){var d,e;"string"!=typeof a&&(c=b,b=a,a=null),isArray(b)||(c=b,b=null),!b&&isFunction(c)&&(b=[],c.length&&(c.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(a,c){b.push(c)}),b=(1===c.length?["require"]:["require","exports","module"]).concat(b))),useInteractive&&(d=currentlyAddingScript||getInteractiveScript(),d&&(a||(a=d.getAttribute("data-requiremodule")),e=contexts[d.getAttribute("data-requirecontext")])),(e?e.defQueue:globalDefQueue).push([a,b,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this); \ No newline at end of file diff --git a/app/webroot/js/lib/saito/markItUp.media.js b/app/webroot/js/lib/saito/markItUp.media.js index f9258f415..a19f4fa47 100644 --- a/app/webroot/js/lib/saito/markItUp.media.js +++ b/app/webroot/js/lib/saito/markItUp.media.js @@ -77,8 +77,8 @@ define(['jquery', 'underscore'], function ($, _) { var defaults, attributes, reducer; defaults = { - width: 425, - height: 349, + width: 560, + height: 315, frameborder: 0, allowfullscreen: 'allowfullscreen' }; diff --git a/app/webroot/js/tests/lib/MarkItUpSpec.js b/app/webroot/js/tests/lib/MarkItUpSpec.js index 84b9c4460..c1eac05f6 100644 --- a/app/webroot/js/tests/lib/MarkItUpSpec.js +++ b/app/webroot/js/tests/lib/MarkItUpSpec.js @@ -44,25 +44,26 @@ define([ 'lib/saito/markItUp.media' ], function(MarkitUpMedia) { }); it("outputs an [iframe] tag for '; + input = ''; result = markItUp.multimedia(input); - expected = '[iframe src=http://www.youtube.com/embed/qa-4E8ZDj9s width=425 ' + - 'height=349 frameborder=0 allowfullscreen][/iframe]'; + expected = '[iframe src=http://www.youtube.com/embed/qa-4E8ZDj9s width=560 ' + + 'height=315 frameborder=0 allowfullscreen][/iframe]'; expect(result).toEqual(expected); }); it("outputs an [flash_video] tag for tags", function() { - input = ' Date: Thu, 2 Jul 2015 18:58:49 +0200 Subject: [PATCH 04/29] add [quote] BBCode tag #317 --- app/Plugin/BbcodeParser/Lib/Editor.php | 7 +++++++ app/Plugin/BbcodeParser/Lib/Parser.php | 6 ++++++ .../BbcodeParser/Test/Case/Lib/BbcodeParserTest.php | 7 +++++++ .../Paz/webroot/css/src/partials/_posting-content.scss | 9 ++++----- app/View/Themed/Paz/webroot/css/stylesheets/night.css | 2 +- app/View/Themed/Paz/webroot/css/stylesheets/theme.css | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/Plugin/BbcodeParser/Lib/Editor.php b/app/Plugin/BbcodeParser/Lib/Editor.php index b52fb508a..83f2b43e3 100644 --- a/app/Plugin/BbcodeParser/Lib/Editor.php +++ b/app/Plugin/BbcodeParser/Lib/Editor.php @@ -56,6 +56,13 @@ public function getMarkupSet() { 'openWith' => '[spoiler]', 'closeWith' => '[/spoiler]' ], + 'Quote' => [ + 'name' => "", + 'className' => 'btn-markItUp-Quote', + 'title' => __('Cite'), + 'openWith' => '[quote]', + 'closeWith' => '[/quote]' + ], 'separator', 'Link' => array( 'name' => "", diff --git a/app/Plugin/BbcodeParser/Lib/Parser.php b/app/Plugin/BbcodeParser/Lib/Parser.php index 105f84e91..949a9e332 100644 --- a/app/Plugin/BbcodeParser/Lib/Parser.php +++ b/app/Plugin/BbcodeParser/Lib/Parser.php @@ -120,6 +120,12 @@ class Parser extends \Saito\Markup\Parser { 'type' => 'class', 'title' => 'urlWithAttributes' ], + // quotes + 'quote' => [ + 'type' => 'replacement', + 'title' => 'quote', + 'replacement' => '
      {param}
      ' + ] ], 'multimedia' => [ 'embed' => [ diff --git a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php index 0bc29c907..5555d4fee 100755 --- a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php +++ b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php @@ -28,6 +28,13 @@ public function testBold() { $this->assertTags($result, $expected); } + public function testQuote() { + $input = '[quote]foo bar[/quote]'; + $expected = array('blockquote' => array(), 'foo bar', '/blockquote'); + $result = $this->_Parser->parse($input); + $this->assertTags($result, $expected); + } + public function testEmphasis() { $input = '[i]italic[/i]'; $expected = array('em' => array(), 'italic', '/em'); diff --git a/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss b/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss index fa4634547..31db88a67 100644 --- a/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss +++ b/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss @@ -27,11 +27,10 @@ display: inline-block; } -} - -.richtext-citation { - font-style: italic; - color: $info-color; + blockquote, .richtext-citation { + font-style: italic; + color: $info-color; + } } .richtext-float { diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/night.css b/app/View/Themed/Paz/webroot/css/stylesheets/night.css index 2b21e24f2..e5a947788 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/night.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/night.css @@ -1,4 +1,4 @@ body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#f7e7d2;font-weight:400;background-color:#28282b}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#fc0}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#fc0;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #4d3d00}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:-webkit-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:linear-gradient(to top, rgba(40,40,43,0.85),#28282b 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #4d3d00}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #4d3d00;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} .top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #4d3d00;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #4d3d00;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-eh,.disabled{color:#8c8276}.c-category{color:#f7e7d2;font-weight:normal;white-space:nowrap}.c-username{color:#f7e7d2}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#4d3d00}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#71685e;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#1e1e20}.table-simple tr td{border-bottom:1px solid #4d3d00}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#1e1e20;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#28282b;border-color:#4d3d00}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#fc0}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#4d3d00 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#303035;border-left:2px solid #fc0;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#fc0;color:#28282b}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#fc0;color:#28282b;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#1e1e20;background-repeat:repeat-y}.btn-strip-back:active{background-color:#1e1e20}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} -#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#28282b}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #4d3d00}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#fc0;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#fc0}.et-old .et{color:#f7e7d2}.et-current .et{color:#6ffa13}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#f7e7d2}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #4d3d00}.mixEntry{border-bottom:1px solid #4d3d00;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext-citation{font-style:italic;color:#8c8276}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #4d3d00}.postingLayout-slider .preview{border-top:1px solid #4d3d00;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #4d3d00}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #4d3d00}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#fc0;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#f7e7d2}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#28282b;border:1px solid #4d3d00}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #4d3d00;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #4d3d00;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} +#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#28282b}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #4d3d00}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#fc0;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#fc0}.et-old .et{color:#f7e7d2}.et-current .et{color:#6ffa13}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#f7e7d2}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #4d3d00}.mixEntry{border-bottom:1px solid #4d3d00;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#8c8276}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #4d3d00}.postingLayout-slider .preview{border-top:1px solid #4d3d00;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #4d3d00}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #4d3d00}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#fc0;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#f7e7d2}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#28282b;border:1px solid #4d3d00}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #4d3d00;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #4d3d00;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css index d201ed908..aec2e9fa5 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css @@ -1,4 +1,4 @@ body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#222;font-weight:400;background-color:#fff}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#a5a5a5}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#d50606;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #e2e2e2}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:-webkit-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:linear-gradient(to top, rgba(255,255,255,0.85),#ffffff 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #e2e2e2}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #e2e2e2;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} .top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #e2e2e2;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #e2e2e2;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-eh,.disabled{color:#727272}.c-category{color:#222;font-weight:normal;white-space:nowrap}.c-username{color:#222}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#f0f0f0}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#d8d8d8;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#e7e7e7}.table-simple tr td{border-bottom:1px solid #e2e2e2}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#e7e7e7;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#fff;border-color:#e2e2e2}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#a5a5a5}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#e2e2e2 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#fbfbfb;border-left:2px solid #a5a5a5;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#d50606;color:#fff}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#d50606;color:#fff;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#e7e7e7;background-repeat:repeat-y}.btn-strip-back:active{background-color:#e7e7e7}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} -#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#fff}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #e2e2e2}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#d50606;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#d50606}.et-old .et{color:#222}.et-current .et{color:red}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#222}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #e2e2e2}.mixEntry{border-bottom:1px solid #e2e2e2;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext-citation{font-style:italic;color:#727272}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #e2e2e2}.postingLayout-slider .preview{border-top:1px solid #e2e2e2;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #e2e2e2}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #e2e2e2}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#a5a5a5;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#222}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#fff;border:1px solid #e2e2e2}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #e2e2e2;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #e2e2e2;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} +#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#fff}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #e2e2e2}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#d50606;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#d50606}.et-old .et{color:#222}.et-current .et{color:red}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#222}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #e2e2e2}.mixEntry{border-bottom:1px solid #e2e2e2;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#727272}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #e2e2e2}.postingLayout-slider .preview{border-top:1px solid #e2e2e2;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #e2e2e2}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #e2e2e2}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#a5a5a5;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#222}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#fff;border:1px solid #e2e2e2}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #e2e2e2;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #e2e2e2;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} From eb6a93a033f09f1d39aaecb989dc45e7c5810bdf Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Thu, 2 Jul 2015 19:07:29 +0200 Subject: [PATCH 05/29] bump version string --- app/Config/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/version.php b/app/Config/version.php index 2703ce321..16159b3e7 100644 --- a/app/Config/version.php +++ b/app/Config/version.php @@ -1,4 +1,4 @@ Date: Thu, 2 Jul 2015 19:08:25 +0200 Subject: [PATCH 06/29] rename double test function --- app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php index 5555d4fee..7bf1fe71a 100755 --- a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php +++ b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php @@ -28,7 +28,7 @@ public function testBold() { $this->assertTags($result, $expected); } - public function testQuote() { + public function testQuoteblock() { $input = '[quote]foo bar[/quote]'; $expected = array('blockquote' => array(), 'foo bar', '/blockquote'); $result = $this->_Parser->parse($input); From 116ad37834da4dc56daa2ee999ff4560cb2d39eb Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Fri, 3 Jul 2015 12:19:42 +0200 Subject: [PATCH 07/29] add remaining char counter for subject field #312 --- app/View/Entries/add.ctp | 2 + app/View/Helper/JsDataHelper.php | 1 + .../Paz/webroot/css/src/partials/_reply.scss | 5 +++ .../Paz/webroot/css/stylesheets/night.css | 4 +- .../Paz/webroot/css/stylesheets/theme.css | 4 +- app/webroot/dist/main.min.js | 6 +-- app/webroot/js/lib/saito/underscore.extend.js | 18 +++++++++ app/webroot/js/main.js | 2 + app/webroot/js/test.js | 1 + .../js/tests/lib/underscore.extend.Spec.js | 39 +++++++++++++++++++ app/webroot/js/views/answering.js | 22 ++++++++++- 11 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 app/webroot/js/lib/saito/underscore.extend.js create mode 100644 app/webroot/js/tests/lib/underscore.extend.Spec.js diff --git a/app/View/Entries/add.ctp b/app/View/Entries/add.ctp index e15ee62c7..738ce43f6 100644 --- a/app/View/Entries/add.ctp +++ b/app/View/Entries/add.ctp @@ -59,6 +59,8 @@ 'required' => ($is_answer) ? false : "required" ] ); + echo $this->Html->div('postingform-subject-count', ''); + echo $this->Form->hidden('pid'); echo $this->MarkitupEditor->getButtonSet('markItUp_' . $form_id); echo $this->MarkitupEditor->editor( diff --git a/app/View/Helper/JsDataHelper.php b/app/View/Helper/JsDataHelper.php index e142afde8..6d9c390b5 100644 --- a/app/View/Helper/JsDataHelper.php +++ b/app/View/Helper/JsDataHelper.php @@ -28,6 +28,7 @@ public function getAppJs(View $View) { 'pathPrefix' => Configure::read('App.imageBaseUrl'), 'fullBase' => true ]), + 'subject_maxlength' => (int)Configure::read('Saito.Settings.subject_maxlength'), 'upload_max_img_size' => (int)Configure::read('Saito.Settings.upload_max_img_size') * 1024, 'upload_max_number_of_uploads' => (int)Configure::read('Saito.Settings.upload_max_number_of_uploads'), 'webroot' => $View->request->webroot diff --git a/app/View/Themed/Paz/webroot/css/src/partials/_reply.scss b/app/View/Themed/Paz/webroot/css/src/partials/_reply.scss index 134ac1ea0..a1ea646b3 100644 --- a/app/View/Themed/Paz/webroot/css/src/partials/_reply.scss +++ b/app/View/Themed/Paz/webroot/css/src/partials/_reply.scss @@ -11,6 +11,11 @@ } } +.postingform-subject-count { + @extend .infoText; + float: right; +} + .postingform-eh { @extend .infoText; float:right; diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/night.css b/app/View/Themed/Paz/webroot/css/stylesheets/night.css index e5a947788..71c5912d1 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/night.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/night.css @@ -1,4 +1,4 @@ body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#f7e7d2;font-weight:400;background-color:#28282b}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#fc0}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#fc0;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #4d3d00}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:-webkit-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:linear-gradient(to top, rgba(40,40,43,0.85),#28282b 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #4d3d00}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #4d3d00;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} -.top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #4d3d00;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #4d3d00;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-eh,.disabled{color:#8c8276}.c-category{color:#f7e7d2;font-weight:normal;white-space:nowrap}.c-username{color:#f7e7d2}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#4d3d00}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#71685e;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#1e1e20}.table-simple tr td{border-bottom:1px solid #4d3d00}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#1e1e20;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#28282b;border-color:#4d3d00}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#fc0}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#4d3d00 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#303035;border-left:2px solid #fc0;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#fc0;color:#28282b}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#fc0;color:#28282b;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#1e1e20;background-repeat:repeat-y}.btn-strip-back:active{background-color:#1e1e20}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} -#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#28282b}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #4d3d00}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#fc0;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#fc0}.et-old .et{color:#f7e7d2}.et-current .et{color:#6ffa13}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#f7e7d2}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #4d3d00}.mixEntry{border-bottom:1px solid #4d3d00;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#8c8276}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #4d3d00}.postingLayout-slider .preview{border-top:1px solid #4d3d00;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #4d3d00}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #4d3d00}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#fc0;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#f7e7d2}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#28282b;border:1px solid #4d3d00}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #4d3d00;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #4d3d00;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} +.top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #4d3d00;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #4d3d00;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-subject-count,.postingform-eh,.disabled{color:#8c8276}.c-category{color:#f7e7d2;font-weight:normal;white-space:nowrap}.c-username{color:#f7e7d2}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#4d3d00}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#71685e;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#1e1e20}.table-simple tr td{border-bottom:1px solid #4d3d00}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#1e1e20;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#28282b;border-color:#4d3d00}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#fc0}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#4d3d00 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#303035;border-left:2px solid #fc0;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#fc0;color:#28282b}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#fc0;color:#28282b;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#1e1e20;background-repeat:repeat-y}.btn-strip-back:active{background-color:#1e1e20}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} +#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#28282b}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #4d3d00}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#fc0;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-subject-count,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#fc0}.et-old .et{color:#f7e7d2}.et-current .et{color:#6ffa13}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#f7e7d2}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #4d3d00}.mixEntry{border-bottom:1px solid #4d3d00;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#8c8276}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #4d3d00}.postingLayout-slider .preview{border-top:1px solid #4d3d00;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-subject-count{float:right}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #4d3d00}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #4d3d00}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#fc0;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#f7e7d2}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#28282b;border:1px solid #4d3d00}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #4d3d00;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #4d3d00;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css index aec2e9fa5..8e88a3f3a 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css @@ -1,4 +1,4 @@ body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#222;font-weight:400;background-color:#fff}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#a5a5a5}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#d50606;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #e2e2e2}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:-webkit-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:linear-gradient(to top, rgba(255,255,255,0.85),#ffffff 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #e2e2e2}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #e2e2e2;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} -.top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #e2e2e2;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #e2e2e2;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-eh,.disabled{color:#727272}.c-category{color:#222;font-weight:normal;white-space:nowrap}.c-username{color:#222}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#f0f0f0}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#d8d8d8;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#e7e7e7}.table-simple tr td{border-bottom:1px solid #e2e2e2}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#e7e7e7;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#fff;border-color:#e2e2e2}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#a5a5a5}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#e2e2e2 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#fbfbfb;border-left:2px solid #a5a5a5;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#d50606;color:#fff}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#d50606;color:#fff;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#e7e7e7;background-repeat:repeat-y}.btn-strip-back:active{background-color:#e7e7e7}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} -#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#fff}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #e2e2e2}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#d50606;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#d50606}.et-old .et{color:#222}.et-current .et{color:red}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#222}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #e2e2e2}.mixEntry{border-bottom:1px solid #e2e2e2;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#727272}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #e2e2e2}.postingLayout-slider .preview{border-top:1px solid #e2e2e2;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #e2e2e2}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #e2e2e2}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#a5a5a5;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#222}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#fff;border:1px solid #e2e2e2}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #e2e2e2;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #e2e2e2;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} +.top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #e2e2e2;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #e2e2e2;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-subject-count,.postingform-eh,.disabled{color:#727272}.c-category{color:#222;font-weight:normal;white-space:nowrap}.c-username{color:#222}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#f0f0f0}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#d8d8d8;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#e7e7e7}.table-simple tr td{border-bottom:1px solid #e2e2e2}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#e7e7e7;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#fff;border-color:#e2e2e2}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#a5a5a5}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#e2e2e2 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#fbfbfb;border-left:2px solid #a5a5a5;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#d50606;color:#fff}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#d50606;color:#fff;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#e7e7e7;background-repeat:repeat-y}.btn-strip-back:active{background-color:#e7e7e7}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} +#slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#fff}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #e2e2e2}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#d50606;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-subject-count,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#d50606}.et-old .et{color:#222}.et-current .et{color:red}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#222}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #e2e2e2}.mixEntry{border-bottom:1px solid #e2e2e2;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#727272}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #e2e2e2}.postingLayout-slider .preview{border-top:1px solid #e2e2e2;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-subject-count{float:right}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #e2e2e2}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #e2e2e2}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#a5a5a5;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#222}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#fff;border:1px solid #e2e2e2}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #e2e2e2;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #e2e2e2;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} diff --git a/app/webroot/dist/main.min.js b/app/webroot/dist/main.min.js index 528e19a8b..c6940e7ce 100644 --- a/app/webroot/dist/main.min.js +++ b/app/webroot/dist/main.min.js @@ -1,3 +1,3 @@ -"undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,a,r=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),a=r},n=function(){o=setTimeout(i,a)},i=e.bind(function(){n(),this.fetch({success:function(){a=Math.floor(a*(1+a/4e4)),a>l&&(a=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var a=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new a}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,a;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))a=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),a=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();a=new n(e)}if(s="normal"===i?this._normal(a):a.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var r=" ",l={title:a.format(this._timeFormats.theRightWay),datetime:a.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){r+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:a,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(r,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.CollectionView.extend({itemView:a,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
      <%= time %>
      '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
      "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(r,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:r.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
      \n \n
      \n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return r}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return r}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
      \n
      \n
      \n
      \n
      \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,a,r,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new a({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new r({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,a){"use strict";var r=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return r}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
      '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
      \n <%= linkImage %>\n
      \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),a=i.value.substring(n,i.value.length);return i.value=s+e+a,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],a=!1,r=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(r=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",a="\r\n",r="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+t+'"',r+=a,r+=a,r+=i,r+=a})}return r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+T.paramname+'"',r+='; filename="'+t+'"',r+=a,r+="Content-Type: "+n,r+=a,r+=a,r+=i,r+=a,r+=s,r+=o,r+=s,r+=a}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(a=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(r>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;r>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(a)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===r)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,r),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===r-o&&g(),d===!1&&(a=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;r>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,r=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
      \n
      \n
      \n
      \n
      \n \n
      \n

      <%- $.i18n.__(\'upload_new_title\') %>

      \n

      \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

      \n
      \n \n
      \n\n' -}),define("text!templates/spinner.html",[],function(){return'
      \n
      \n
      \n
      \n
      \n
      \n
      '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
      \n
      \n
      \n
      \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
      \n
      \n
      \n \n \n \n\n \n
      \n
      \n
      \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this._setupTextArea(),this.parentThreadline||this._onFormReady(),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){e.preventDefault();var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){this._setupTextArea();var e=this.$(".js-data");if(e.length>0&&"edit"===e.data("meta").action){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0}),this._addCountdown()}n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n=this.$(".btn-submit")[0];if(i.preventDefault(),"object"==typeof n.validity&&n.form.checkValidity()===!1){var o=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(n).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this);o(),this.sendInProgress=!1}else n.disabled=!0,n.form.submit()},_sendInline:function(i){i.preventDefault();var o=this.$("#EntryAddForm").serialize(),s=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),r=t.bind(this._disable,this);e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:r}).done(s).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){"use strict";var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
        ').parent().wrap("
      • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
        \n <%- $.i18n.__('ncy.bkm') %>\n
        \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) -},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"})})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new r({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==r&&(f.stop(!0),r="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=r&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
        ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
        "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
        ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,a,r={};switch(t.dir1){case"down":a="top";break;case"up":a="bottom";break;case"left":a="right";break;case"right":a="left"}n=parseInt(f.css(a)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||r.top||r.bottom||r.right||r.left))switch(t.dir1){case"down":r.top=t.nextpos1+"px";break;case"up":r.bottom=t.nextpos1+"px";break;case"left":r.right=t.nextpos1+"px";break;case"right":r.left=t.nextpos1+"px"}else f.css(a,t.nextpos1+"px");switch((r.top||r.bottom||r.right||r.left)&&f.animate(r,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){r="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){r="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
        ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
        ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
        ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

        ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
        ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
        "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
        ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
        ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
        '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var a={lat:e.get("lat"),lng:e.get("lng")};a.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(a)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
        \n
        \n
        \n
        "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,a){"use strict";var r=e.module("usermap",{startWithParent:!1});return r.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:a,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=r.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),r}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var a=e.split("%s");if(a.length>1)for(var r=0;r0&&a[r].lastIndexOf("%")==a[r].length-1&&(a[r]+="s"+a.splice(r+1,1)[0]),i+=a[r]+t[r];return i+a[a.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,a,r,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),r.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:r(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},a=t;return a.addInitializer(s.bootstrapApp),a.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),a}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["app/app"])}),define("main",function(){}); \ No newline at end of file +"undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("lib/saito/underscore.extend",["underscore"],function(e){"use strict";e.mixin({chars:function(e){var t,i;return i=e.match(/(\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDFFF])/g)||[],t=e.length-i.length}})}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,r,a=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),r=a},n=function(){o=setTimeout(i,r)},i=e.bind(function(){n(),this.fetch({success:function(){r=Math.floor(r*(1+r/4e4)),r>l&&(r=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var r=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new r}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,r;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))r=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),r=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();r=new n(e)}if(s="normal"===i?this._normal(r):r.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var a=" ",l={title:r.format(this._timeFormats.theRightWay),datetime:r.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){a+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,r,a){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:r,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(a,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,r,a){"use strict";var l=n.CollectionView.extend({itemView:r,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
        <%= time %>
        '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
        "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(a,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:a.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
        \n \n
        \n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,r){"use strict";var a=n.ItemView.extend({template:t.template(r),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return a}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,r){"use strict";var a=n.ItemView.extend({template:t.template(r),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return a}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
        \n
        \n
        \n
        \n
        \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,r,a,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new r({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new a({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,r){"use strict";var a=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new r({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return a}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
        '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
        \n <%= linkImage %>\n
        \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),r=i.value.substring(n,i.value.length);return i.value=s+e+r,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],r=!1,a=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(a=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",r="\r\n",a="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);a+=s,a+=o,a+=r,a+='Content-Disposition: form-data; name="'+t+'"',a+=r,a+=r,a+=i,a+=r})}return a+=s,a+=o,a+=r,a+='Content-Disposition: form-data; name="'+T.paramname+'"',a+='; filename="'+t+'"',a+=r,a+="Content-Type: "+n,a+=r,a+=r,a+=i,a+=r,a+=s,a+=o,a+=s,a+=r}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(r=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(a>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;a>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(r)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===a)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,a),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===a-o&&g(),d===!1&&(r=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;a>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,a=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
        \n
        \n
        \n
        \n
        \n \n
        \n

        <%- $.i18n.__(\'upload_new_title\') %>

        \n

        \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

        \n
        \n \n
        \n\n' +}),define("text!templates/spinner.html",[],function(){return'
        \n
        \n
        \n
        \n
        \n
        \n
        '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,r,a){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(r)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:a.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
        \n
        \n
        \n
        \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,r,a){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(a)),this.uploadNewView=new r({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),r="([\\/?]|$)",a=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+r,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+r,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+r,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
        \n
        \n
        \n \n \n \n\n \n
        \n
        \n
        \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,r=t._elementBottom(i);return o>=r&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,r,a,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject","input .js-subject":"_updateSubjectCharCount"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this._setupTextArea(),this.parentThreadline||this._onFormReady(),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){e.preventDefault();var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_updateSubjectCharCount:function(){var e,t,i;e=this.$(".postingform-subject-count"),t=n.settings.get("subject_maxlength"),i=this.$(".js-subject").val(),e.html(t-i.length)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new a,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){this._setupTextArea(),this._updateSubjectCharCount();var e=this.$(".js-data");if(e.length>0&&"edit"===e.data("meta").action){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0}),this._addCountdown()}n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new r({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n=this.$(".btn-submit")[0];if(i.preventDefault(),"object"==typeof n.validity&&n.form.checkValidity()===!1){var o=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(n).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this);o(),this.sendInProgress=!1}else n.disabled=!0,n.form.submit()},_sendInline:function(i){i.preventDefault();var o=this.$("#EntryAddForm").serialize(),s=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),r=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),a=t.bind(this._disable,this);e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:a}).done(s).fail(r)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,r){"use strict";var a=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(r),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return a}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,r,a){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new a({id:e}),this.postings.add(this.postingModel),t=new r({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var r=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
          ').parent().wrap("
        • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return r}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
          \n <%- $.i18n.__('ncy.bkm') %>\n
          \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,r,a,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new r,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) +},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"})})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new a({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==a&&(f.stop(!0),a="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=a&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
          ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
          "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
          ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,r,a={};switch(t.dir1){case"down":r="top";break;case"up":r="bottom";break;case"left":r="right";break;case"right":r="left"}n=parseInt(f.css(r)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||a.top||a.bottom||a.right||a.left))switch(t.dir1){case"down":a.top=t.nextpos1+"px";break;case"up":a.bottom=t.nextpos1+"px";break;case"left":a.right=t.nextpos1+"px";break;case"right":a.left=t.nextpos1+"px"}else f.css(r,t.nextpos1+"px");switch((a.top||a.bottom||a.right||a.left)&&f.animate(a,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){a="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){a="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
          ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
          ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
          ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

          ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
          ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
          "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
          ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
          ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
          '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var r={lat:e.get("lat"),lng:e.get("lng")};r.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(r)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
          \n
          \n
          \n
          "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,r){"use strict";var a=e.module("usermap",{startWithParent:!1});return a.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:r,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=a.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),a}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var r=e.split("%s");if(r.length>1)for(var a=0;a0&&r[a].lastIndexOf("%")==r[a].length-1&&(r[a]+="s"+r.splice(a+1,1)[0]),i+=r[a]+t[a];return i+r[r.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,r,a,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),a.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:a(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},r=t;return r.addInitializer(s.bootstrapApp),r.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),r}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["lib/saito/underscore.extend"]),require(["app/app"])}),define("main",function(){}); \ No newline at end of file diff --git a/app/webroot/js/lib/saito/underscore.extend.js b/app/webroot/js/lib/saito/underscore.extend.js new file mode 100644 index 000000000..24421c3df --- /dev/null +++ b/app/webroot/js/lib/saito/underscore.extend.js @@ -0,0 +1,18 @@ +define(['underscore'], function(_) { + 'use strict'; + + _.mixin({ + /** + * Calculate chars in string + * + * @param {string} string + * @return int + */ + chars: function(string) { + var count, twoByteEmojis; + twoByteEmojis = string.match(/(\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDFFF])/g) || []; + count = string.length - twoByteEmojis.length; + return count; + } + }); +}); diff --git a/app/webroot/js/main.js b/app/webroot/js/main.js index 73bdd8e57..ecc6ba47d 100644 --- a/app/webroot/js/main.js +++ b/app/webroot/js/main.js @@ -43,5 +43,7 @@ require.config({ require(['lib/bootstrapHelper', 'common'], function() { "use strict"; + + require(['lib/saito/underscore.extend']); require(['app/app']); }); diff --git a/app/webroot/js/test.js b/app/webroot/js/test.js index c4a7fc6a9..369c222c8 100644 --- a/app/webroot/js/test.js +++ b/app/webroot/js/test.js @@ -36,6 +36,7 @@ require(['lib/bootstrapHelper', 'common', 'tests/jasmineBootstrapHelper'], funct 'lib/MarkItUpSpec.js', 'lib/jquery.i18n.extendSpec.js', 'lib/TemplateHelpersSpec.js', + 'lib/underscore.extend.Spec.js', 'views/AppViewSpec.js', 'views/MapViewSpec.js', 'views/PrerequisitesTesterSpec.js', diff --git a/app/webroot/js/tests/lib/underscore.extend.Spec.js b/app/webroot/js/tests/lib/underscore.extend.Spec.js new file mode 100644 index 000000000..1ec80b09a --- /dev/null +++ b/app/webroot/js/tests/lib/underscore.extend.Spec.js @@ -0,0 +1,39 @@ +describe('underscore', function() { + 'use strict'; + + describe('counts chars in _.chars()', function() { + + var _; + + beforeEach(function(done) { + require(['underscore', 'lib/saito/underscore.extend'], function(underscore) { + _ = underscore; + done(); + }); + + }); + + it('count ASCII only char', function() { + var input, expected, result; + + input = 'abc d'; + expected = 5; + result = _.chars(input); + expect(result).toEqual(expected); + }); + + it('count multibyte chars', function() { + var input, expected, result; + + input = '🎬'; + expected = 1; + result = _.chars(input); + expect(result).toEqual(expected); + + input = 'abc d 🎬🏁'; + expected = 8; + result = _.chars(input); + expect(result).toEqual(expected); + }); + }); +}); diff --git a/app/webroot/js/views/answering.js b/app/webroot/js/views/answering.js index 57934c47c..e51d9549e 100644 --- a/app/webroot/js/views/answering.js +++ b/app/webroot/js/views/answering.js @@ -45,7 +45,8 @@ define([ "click .btn-markItUp-Media": "_media", "click .btn-submit": "_send", "click .btn-cite": "_cite", - "keypress .js-subject": "_onKeyPressSubject" + "keypress .js-subject": "_onKeyPressSubject", + 'input .js-subject': '_updateSubjectCharCount' }, initialize: function(options) { @@ -93,6 +94,24 @@ define([ } }, + /** + * Update char counter for remaining subject length + * + * @private + */ + _updateSubjectCharCount: function() { + var count, $count, max, subject; + $count = this.$('.postingform-subject-count'); + max = App.settings.get('subject_maxlength'); + subject = this.$('.js-subject').val(); + // Should be _.chars(subject) for counting multibyte chars as one char only, but + // maxlength attribute also counts all bytes in multibyte char. + // This shortends the allowed subject by one byte-char per multibyte char, + // but we can life with that. + count = max - subject.length; + $count.html(count); + }, + _upload: function(event) { var uploadsView; if (event) { @@ -161,6 +180,7 @@ define([ _onFormReady: function() { this._setupTextArea(); + this._updateSubjectCharCount(); var _$data = this.$('.js-data'); if (_$data.length > 0 && _$data.data('meta').action === 'edit') { From d66e0643b536877c692b3c2ce837a61326a94072 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Fri, 3 Jul 2015 13:03:43 +0200 Subject: [PATCH 08/29] add PHP-info to admin panel backported from 5.0.0 --- app/Controller/AdminsController.php | 8 +++++ .../Case/Controller/AdminsControllerTest.php | 35 +++++++++++++++++++ app/View/Admins/admin_index.ctp | 7 +++- app/View/Admins/admin_phpinfo.ctp | 15 ++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 app/Test/Case/Controller/AdminsControllerTest.php create mode 100644 app/View/Admins/admin_phpinfo.ctp diff --git a/app/Controller/AdminsController.php b/app/Controller/AdminsController.php index ff011c1ff..09fa18ac2 100755 --- a/app/Controller/AdminsController.php +++ b/app/Controller/AdminsController.php @@ -11,6 +11,14 @@ class AdminsController extends AppController { public function admin_index() { } + /** + * Show PHP-info + * + * @return void + */ + public function admin_phpinfo() { + } + public function admin_logs() { // order here is output order in frontend $_logsToRead = ['error', 'debug']; diff --git a/app/Test/Case/Controller/AdminsControllerTest.php b/app/Test/Case/Controller/AdminsControllerTest.php new file mode 100644 index 000000000..d4e5b9986 --- /dev/null +++ b/app/Test/Case/Controller/AdminsControllerTest.php @@ -0,0 +1,35 @@ +setExpectedException('ForbiddenException'); + $this->testAction('/admin/admins/phpinfo'); + } + + public function testPhpInfoNotAllowedUser() { + $this->generate('Admins'); + $this->_loginUser(3); + $this->setExpectedException('ForbiddenException'); + $this->testAction('/admin/admins/phpinfo'); + } + + public function testPhpInfo() { + $this->generate('Admins'); + $this->_loginUser(1); + $this->testAction('/admin/admins/phpinfo'); + } + + } diff --git a/app/View/Admins/admin_index.ctp b/app/View/Admins/admin_index.ctp index 22ef6cde5..b7c210384 100755 --- a/app/View/Admins/admin_index.ctp +++ b/app/View/Admins/admin_index.ctp @@ -11,6 +11,11 @@ __('admin.sysInfo.cce', $this->Admin->badge(Cache::settings('_cake_core_')['engine'], '_cBadge')), __('admin.sysInfo.cse', $this->Admin->badge(Cache::settings('default')['engine'], '_cBadge')) ]; + $si[] = $this->Html->link( + __('PHP Info'), + ['controller' => 'admins', 'action' => 'phpinfo', 'prefix' => 'admin'] + ); + echo $this->Html->nestedList($si) ?>
          @@ -19,4 +24,4 @@ $this->Html->link(__('Empty Caches'), ['controller' => 'tools', 'action' => 'emptyCaches', 'admin' => true], ['class' => 'btn']) -?> \ No newline at end of file +?> diff --git a/app/View/Admins/admin_phpinfo.ctp b/app/View/Admins/admin_phpinfo.ctp new file mode 100644 index 000000000..7770fd2c0 --- /dev/null +++ b/app/View/Admins/admin_phpinfo.ctp @@ -0,0 +1,15 @@ +Html->addCrumb(__('admin.sysInfo.h'), '/admin'); + $this->Html->addCrumb(__('PHP Info'), '/admin/admins/phpinfo'); + + echo $this->Html->tag('h1', __('PHP Info')); + + ob_start(); + phpinfo(); + $info = ob_get_clean(); + if (preg_match('/\(?P.*)\<\/body\>/is', $info, $matches)) { + $body = $matches['body']; + $body = str_replace(' Date: Sat, 4 Jul 2015 09:59:25 +0200 Subject: [PATCH 09/29] code formatting --- app/webroot/js/views/answering.js | 49 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/app/webroot/js/views/answering.js b/app/webroot/js/views/answering.js index e51d9549e..924e1e7da 100644 --- a/app/webroot/js/views/answering.js +++ b/app/webroot/js/views/answering.js @@ -39,13 +39,13 @@ define([ model: null, events: { - "click .btn-previewClose": "_closePreview", - "click .btn-preview": "_showPreview", - "click .btn-markItUp-Upload": "_upload", - "click .btn-markItUp-Media": "_media", - "click .btn-submit": "_send", - "click .btn-cite": "_cite", - "keypress .js-subject": "_onKeyPressSubject", + 'click .btn-previewClose': '_closePreview', + 'click .btn-preview': '_showPreview', + 'click .btn-markItUp-Upload': '_upload', + 'click .btn-markItUp-Media': '_media', + 'click .btn-submit': '_send', + 'click .btn-cite': '_cite', + 'keypress .js-subject': '_onKeyPressSubject', 'input .js-subject': '_updateSubjectCharCount' }, @@ -58,10 +58,10 @@ define([ this._onFormReady(); } this._requestUrl = App.settings.get('webroot') + - 'entries/add/' + this.model.get('id'); + 'entries/add/' + this.model.get('id'); // focus can only be set after element is visible in page - this.listenTo(App.eventBus, "isAppVisible", this._focusSubject); + this.listenTo(App.eventBus, 'isAppVisible', this._focusSubject); // auto-open upload view for easy developing // this._upload(); @@ -71,17 +71,17 @@ define([ this.$('.btn.btn-submit').attr('disabled', 'disabled'); }, - _enable: function() { + _enable: function() { this.$('.btn.btn-submit').removeAttr('disabled'); }, _cite: function(event) { - event.preventDefault(); var citeContainer = this.$('.cite-container'), - citeText = this.$('.btn-cite').data('text'), - currentText = this.$textarea.val(); + citeText = this.$('.btn-cite').data('text'), + currentText = this.$textarea.val(); + event.preventDefault(); - this.$textarea.val(citeText + "\n\n" + currentText); + this.$textarea.val(citeText + '\n\n' + currentText); citeContainer.slideToggle(); this.$textarea.trigger('autosize.resize'); this.$textarea.focus(); @@ -179,12 +179,13 @@ define([ }, _onFormReady: function() { + var _$data, _entry; this._setupTextArea(); this._updateSubjectCharCount(); - var _$data = this.$('.js-data'); + _$data = this.$('.js-data'); if (_$data.length > 0 && _$data.data('meta').action === 'edit') { - var _entry = this.$('.js-data').data('entry'); + _entry = this.$('.js-data').data('entry'); this.model.set(_entry, {silent: true}); this._addCountdown(); } @@ -208,7 +209,7 @@ define([ _focusSubject: function() { // focus is broken in Mobile Safari iOS 8 - var iOS = window.navigator.userAgent.match('iPad|iPhone'); + var iOS = window.navigator.userAgent.match('iPad|iPhone'); if (iOS) { return; } @@ -230,13 +231,14 @@ define([ }, _sendRedirect: function(event) { + var submit; var button = this.$('.btn-submit')[0]; event.preventDefault(); if (typeof button.validity === 'object' && - button.form.checkValidity() === false) { + button.form.checkValidity() === false) { // we can't trigger JS validation messages via form.submit() // so we create and click this hidden dummy submit button - var submit = _.bind(function() { + submit = _.bind(function() { if (!this.checkValidityDummy) { this.checkValidityDummy = $('', { type: 'submit', @@ -256,9 +258,10 @@ define([ }, _sendInline: function(event) { + var data, disable, fail, success; event.preventDefault(); - var data = this.$('#EntryAddForm').serialize(); - var success = _.bind(function(data) { + data = this.$('#EntryAddForm').serialize(); + success = _.bind(function(data) { this.model.set({isAnsweringFormShown: false}); if (this.parentThreadline !== null) { this.parentThreadline.set('isInlineOpened', false); @@ -270,7 +273,7 @@ define([ isNewToUser: true }); }, this); - var fail = _.bind(function(jqXHR, text) { + fail = _.bind(function(jqXHR, text) { this.sendInProgress = false; this._enable(); App.eventBus.trigger('notification', { @@ -279,7 +282,7 @@ define([ message: jqXHR.responseText }); }, this); - var disable = _.bind(this._disable, this); + disable = _.bind(this._disable, this); $.ajax({ url: this._requestUrl, From 4213b4dd58814773da4709140496b0b819cb1ff7 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 10:10:19 +0200 Subject: [PATCH 10/29] fix answering form is initialized to early if request via ajax --- app/webroot/dist/main.min.js | 6 +++--- app/webroot/js/views/answering.js | 14 ++++++++++---- app/webroot/js/views/app.js | 5 +++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/webroot/dist/main.min.js b/app/webroot/dist/main.min.js index c6940e7ce..ddc7908a5 100644 --- a/app/webroot/dist/main.min.js +++ b/app/webroot/dist/main.min.js @@ -1,3 +1,3 @@ -"undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("lib/saito/underscore.extend",["underscore"],function(e){"use strict";e.mixin({chars:function(e){var t,i;return i=e.match(/(\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDFFF])/g)||[],t=e.length-i.length}})}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,r,a=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),r=a},n=function(){o=setTimeout(i,r)},i=e.bind(function(){n(),this.fetch({success:function(){r=Math.floor(r*(1+r/4e4)),r>l&&(r=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var r=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new r}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,r;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))r=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),r=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();r=new n(e)}if(s="normal"===i?this._normal(r):r.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var a=" ",l={title:r.format(this._timeFormats.theRightWay),datetime:r.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){a+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,r,a){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:r,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(a,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,r,a){"use strict";var l=n.CollectionView.extend({itemView:r,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
          <%= time %>
          '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
          "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(a,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:a.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
          \n \n\n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,r){"use strict";var a=n.ItemView.extend({template:t.template(r),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return a}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,r){"use strict";var a=n.ItemView.extend({template:t.template(r),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return a}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
          \n
          \n
          \n
          \n
          \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,r,a,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new r({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new a({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,r){"use strict";var a=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new r({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return a}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
          '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
          \n <%= linkImage %>\n
          \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),r=i.value.substring(n,i.value.length);return i.value=s+e+r,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],r=!1,a=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(a=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",r="\r\n",a="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);a+=s,a+=o,a+=r,a+='Content-Disposition: form-data; name="'+t+'"',a+=r,a+=r,a+=i,a+=r})}return a+=s,a+=o,a+=r,a+='Content-Disposition: form-data; name="'+T.paramname+'"',a+='; filename="'+t+'"',a+=r,a+="Content-Type: "+n,a+=r,a+=r,a+=i,a+=r,a+=s,a+=o,a+=s,a+=r}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(r=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(a>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;a>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(r)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===a)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,a),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===a-o&&g(),d===!1&&(r=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;a>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,a=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
          \n
          \n
          \n
          \n
          \n \n
          \n

          <%- $.i18n.__(\'upload_new_title\') %>

          \n

          \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

          \n
          \n \n\n\n' -}),define("text!templates/spinner.html",[],function(){return'
          \n
          \n
          \n
          \n
          \n
          \n
          '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,r,a){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(r)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:a.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
          \n
          \n
          \n
          \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,r,a){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(a)),this.uploadNewView=new r({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),r="([\\/?]|$)",a=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+r,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+r,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+r,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
          \n
          \n
          \n \n \n \n\n \n \n
          \n
          \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,r=t._elementBottom(i);return o>=r&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,r,a,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject","input .js-subject":"_updateSubjectCharCount"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this._setupTextArea(),this.parentThreadline||this._onFormReady(),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){e.preventDefault();var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_updateSubjectCharCount:function(){var e,t,i;e=this.$(".postingform-subject-count"),t=n.settings.get("subject_maxlength"),i=this.$(".js-subject").val(),e.html(t-i.length)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new a,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){this._setupTextArea(),this._updateSubjectCharCount();var e=this.$(".js-data");if(e.length>0&&"edit"===e.data("meta").action){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0}),this._addCountdown()}n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new r({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n=this.$(".btn-submit")[0];if(i.preventDefault(),"object"==typeof n.validity&&n.form.checkValidity()===!1){var o=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(n).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this);o(),this.sendInProgress=!1}else n.disabled=!0,n.form.submit()},_sendInline:function(i){i.preventDefault();var o=this.$("#EntryAddForm").serialize(),s=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),r=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),a=t.bind(this._disable,this);e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:a}).done(s).fail(r)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,r){"use strict";var a=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(r),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return a}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,r,a){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new a({id:e}),this.postings.add(this.postingModel),t=new r({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var r=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
            ').parent().wrap("
          • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return r}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
            \n <%- $.i18n.__('ncy.bkm') %>\n
            \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,r,a,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new r,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) -},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"})})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new a({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==a&&(f.stop(!0),a="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=a&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
            ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
            "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
            ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,r,a={};switch(t.dir1){case"down":r="top";break;case"up":r="bottom";break;case"left":r="right";break;case"right":r="left"}n=parseInt(f.css(r)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||a.top||a.bottom||a.right||a.left))switch(t.dir1){case"down":a.top=t.nextpos1+"px";break;case"up":a.bottom=t.nextpos1+"px";break;case"left":a.right=t.nextpos1+"px";break;case"right":a.left=t.nextpos1+"px"}else f.css(r,t.nextpos1+"px");switch((a.top||a.bottom||a.right||a.left)&&f.animate(a,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){a="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){a="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
            ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
            ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
            ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

            ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
            ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
            "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
            ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
            ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
            '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var r={lat:e.get("lat"),lng:e.get("lng")};r.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(r)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
            \n
            \n
            \n
            "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,r){"use strict";var a=e.module("usermap",{startWithParent:!1});return a.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:r,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=a.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),a}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var r=e.split("%s");if(r.length>1)for(var a=0;a0&&r[a].lastIndexOf("%")==r[a].length-1&&(r[a]+="s"+r.splice(a+1,1)[0]),i+=r[a]+t[a];return i+r[r.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,r,a,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),a.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:a(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},r=t;return r.addInitializer(s.bootstrapApp),r.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),r}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["lib/saito/underscore.extend"]),require(["app/app"])}),define("main",function(){}); \ No newline at end of file +"undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("lib/saito/underscore.extend",["underscore"],function(e){"use strict";e.mixin({chars:function(e){var t,i;return i=e.match(/(\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDFFF])/g)||[],t=e.length-i.length}})}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,a,r=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),a=r},n=function(){o=setTimeout(i,a)},i=e.bind(function(){n(),this.fetch({success:function(){a=Math.floor(a*(1+a/4e4)),a>l&&(a=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var a=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new a}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,a;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))a=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),a=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();a=new n(e)}if(s="normal"===i?this._normal(a):a.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var r=" ",l={title:a.format(this._timeFormats.theRightWay),datetime:a.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){r+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:a,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(r,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.CollectionView.extend({itemView:a,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
            <%= time %>
            '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
            "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(r,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:r.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
            \n \n\n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return r}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return r}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
            \n
            \n
            \n
            \n
            \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,a,r,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new a({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new r({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,a){"use strict";var r=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return r}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
            '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
            \n <%= linkImage %>\n
            \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),a=i.value.substring(n,i.value.length);return i.value=s+e+a,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],a=!1,r=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(r=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",a="\r\n",r="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+t+'"',r+=a,r+=a,r+=i,r+=a})}return r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+T.paramname+'"',r+='; filename="'+t+'"',r+=a,r+="Content-Type: "+n,r+=a,r+=a,r+=i,r+=a,r+=s,r+=o,r+=s,r+=a}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(a=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(r>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;r>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(a)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===r)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,r),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===r-o&&g(),d===!1&&(a=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;r>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,r=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
            \n
            \n
            \n
            \n
            \n \n
            \n

            <%- $.i18n.__(\'upload_new_title\') %>

            \n

            \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

            \n
            \n \n\n\n' +}),define("text!templates/spinner.html",[],function(){return'
            \n
            \n
            \n
            \n
            \n
            \n
            '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
            \n
            \n
            \n
            \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
            \n
            \n
            \n \n \n \n\n \n \n
            \n
            \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject","input .js-subject":"_updateSubjectCharCount"},initialize:function(e){t.defaults(e,{ajax:!0,parentThreadline:!1}),this.options=e,this.options.ajax===!1&&(this._setupTextArea(),this._onFormReady()),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();e.preventDefault(),this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_updateSubjectCharCount:function(){var e,t,i,o;t=this.$(".postingform-subject-count"),i=n.settings.get("subject_maxlength"),o=this.$(".js-subject").val(),e=i-o.length,t.html(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){var e,t;this._setupTextArea(),this._updateSubjectCharCount(),e=this.$(".js-data"),e.length>0&&"edit"===e.data("meta").action&&(t=this.$(".js-data").data("entry"),this.model.set(t,{silent:!0}),this._addCountdown()),n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n,o=this.$(".btn-submit")[0];i.preventDefault(),"object"==typeof o.validity&&o.form.checkValidity()===!1?(n=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(o).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this),n(),this.sendInProgress=!1):(o.disabled=!0,o.form.submit())},_sendInline:function(i){var o,s,a,r;i.preventDefault(),o=this.$("#EntryAddForm").serialize(),r=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),s=t.bind(this._disable,this),e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:s}).done(r).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){"use strict";var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
              ').parent().wrap("
            • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
              \n <%- $.i18n.__('ncy.bkm') %>\n
              \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) +},initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"}),ajax:!1})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new r({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==r&&(f.stop(!0),r="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=r&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
              ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
              "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
              ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,a,r={};switch(t.dir1){case"down":a="top";break;case"up":a="bottom";break;case"left":a="right";break;case"right":a="left"}n=parseInt(f.css(a)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||r.top||r.bottom||r.right||r.left))switch(t.dir1){case"down":r.top=t.nextpos1+"px";break;case"up":r.bottom=t.nextpos1+"px";break;case"left":r.right=t.nextpos1+"px";break;case"right":r.left=t.nextpos1+"px"}else f.css(a,t.nextpos1+"px");switch((r.top||r.bottom||r.right||r.left)&&f.animate(r,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){r="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){r="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
              ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
              ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
              ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

              ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
              ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
              "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
              ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
              ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
              '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var a={lat:e.get("lat"),lng:e.get("lng")};a.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(a)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
              \n
              \n
              \n
              "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,a){"use strict";var r=e.module("usermap",{startWithParent:!1});return r.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:a,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=r.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),r}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var a=e.split("%s");if(a.length>1)for(var r=0;r0&&a[r].lastIndexOf("%")==a[r].length-1&&(a[r]+="s"+a.splice(r+1,1)[0]),i+=a[r]+t[r];return i+a[a.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,a,r,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),r.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:r(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},a=t;return a.addInitializer(s.bootstrapApp),a.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),a}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["lib/saito/underscore.extend"]),require(["app/app"])}),define("main",function(){}); \ No newline at end of file diff --git a/app/webroot/js/views/answering.js b/app/webroot/js/views/answering.js index 924e1e7da..a321b7d27 100644 --- a/app/webroot/js/views/answering.js +++ b/app/webroot/js/views/answering.js @@ -50,11 +50,17 @@ define([ }, initialize: function(options) { - this.parentThreadline = options.parentThreadline || null; + _.defaults(options, { + // answering form was loaded via ajax request + ajax: true, + // answering form is in posting which is inline-opened + parentThreadline: false + }); + this.options = options; - this._setupTextArea(); - if (!this.parentThreadline) { - //* view came directly from server and is ready without rendering + if (this.options.ajax === false) { + // view came directly from server and is ready without rendering + this._setupTextArea(); this._onFormReady(); } this._requestUrl = App.settings.get('webroot') + diff --git a/app/webroot/js/views/app.js b/app/webroot/js/views/app.js index 8a89c977f..1c0400484 100644 --- a/app/webroot/js/views/app.js +++ b/app/webroot/js/views/app.js @@ -92,7 +92,8 @@ define([ _initAnsweringNotInlined: function(element) { this.answeringForm = new AnsweringView({ el: element, - model: new PostingModel({id: 'foo'}) + model: new PostingModel({id: 'foo'}), + ajax: false }); }, @@ -314,4 +315,4 @@ define([ return AppView; -}); \ No newline at end of file +}); From 8a6eb7833d0408365e6ed35fc33a633e330cb277 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 11:36:21 +0200 Subject: [PATCH 11/29] improved [float] BBCode --- app/Plugin/BbcodeParser/Lib/Parser.php | 2 +- app/Plugin/BbcodeParser/docs/help/eng/1-bbcodes.md | 4 +++- .../Themed/Paz/webroot/css/src/partials/_modules.scss | 11 +++++++++++ .../webroot/css/src/partials/_posting-content.scss | 2 ++ app/View/Themed/Paz/webroot/css/stylesheets/night.css | 2 +- app/View/Themed/Paz/webroot/css/stylesheets/theme.css | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/Plugin/BbcodeParser/Lib/Parser.php b/app/Plugin/BbcodeParser/Lib/Parser.php index 949a9e332..da61cfdab 100644 --- a/app/Plugin/BbcodeParser/Lib/Parser.php +++ b/app/Plugin/BbcodeParser/Lib/Parser.php @@ -54,7 +54,7 @@ class Parser extends \Saito\Markup\Parser { 'float' => [ 'type' => 'replacement', 'title' => 'float', - 'replacement' => '
              {param}
              ' + 'replacement' => '
              {param}
              ' ], // email 'email' => [ diff --git a/app/Plugin/BbcodeParser/docs/help/eng/1-bbcodes.md b/app/Plugin/BbcodeParser/docs/help/eng/1-bbcodes.md index 14cdc3deb..d19af23f3 100755 --- a/app/Plugin/BbcodeParser/docs/help/eng/1-bbcodes.md +++ b/app/Plugin/BbcodeParser/docs/help/eng/1-bbcodes.md @@ -152,6 +152,8 @@ If activated `[embed][/embed]` tries to embed the URL via [embed.ly](http:/ ### Float ### - [float]content[/float] + [float]float this to the side[/float] main content + … + [float]another float[/float] main content Floats the content to the side. \ No newline at end of file diff --git a/app/View/Themed/Paz/webroot/css/src/partials/_modules.scss b/app/View/Themed/Paz/webroot/css/src/partials/_modules.scss index 074a2c328..399d9923b 100644 --- a/app/View/Themed/Paz/webroot/css/src/partials/_modules.scss +++ b/app/View/Themed/Paz/webroot/css/src/partials/_modules.scss @@ -35,6 +35,17 @@ h4 { font-size: 1em; } +%clearfix { + &:before, + &:after { + content: " "; + display: table; + } + &:after { + clear: both; + } +} + .btnLink { border: none; background: none; diff --git a/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss b/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss index 31db88a67..036cffc54 100644 --- a/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss +++ b/app/View/Themed/Paz/webroot/css/src/partials/_posting-content.scss @@ -2,6 +2,8 @@ // ------------------------------------- .richtext { + @extend %clearfix; + ul { @extend %ul; } diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/night.css b/app/View/Themed/Paz/webroot/css/stylesheets/night.css index 71c5912d1..553fc5f4a 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/night.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/night.css @@ -1,4 +1,4 @@ -body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#f7e7d2;font-weight:400;background-color:#28282b}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#fc0}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#fc0;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #4d3d00}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:-webkit-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:linear-gradient(to top, rgba(40,40,43,0.85),#28282b 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #4d3d00}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #4d3d00;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} +body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#f7e7d2;font-weight:400;background-color:#28282b}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#fc0}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.richtext:before,.richtext:after{content:" ";display:table}.richtext:after{clear:both}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#fc0;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #4d3d00}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:-webkit-linear-gradient(bottom, rgba(40,40,43,0.85),#28282b 90%);background:linear-gradient(to top, rgba(40,40,43,0.85),#28282b 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #4d3d00}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #4d3d00;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} .top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #4d3d00;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #4d3d00;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-subject-count,.postingform-eh,.disabled{color:#8c8276}.c-category{color:#f7e7d2;font-weight:normal;white-space:nowrap}.c-username{color:#f7e7d2}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#4d3d00}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#71685e;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#1e1e20}.table-simple tr td{border-bottom:1px solid #4d3d00}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#1e1e20;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#28282b;border-color:#4d3d00}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#fc0}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#4d3d00 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#303035;border-left:2px solid #fc0;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#fc0;color:#28282b}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#fc0;color:#28282b;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#1e1e20;background-repeat:repeat-y}.btn-strip-back:active{background-color:#1e1e20}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} #slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#28282b}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #4d3d00}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#fc0;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-subject-count,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#fc0}.et-old .et{color:#f7e7d2}.et-current .et{color:#6ffa13}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#f7e7d2}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #4d3d00}.mixEntry{border-bottom:1px solid #4d3d00;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#8c8276}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #4d3d00}.postingLayout-slider .preview{border-top:1px solid #4d3d00;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-subject-count{float:right}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #4d3d00}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #4d3d00}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#fc0;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#f7e7d2}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#28282b;border:1px solid #4d3d00}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #4d3d00;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #4d3d00;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} diff --git a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css index 8e88a3f3a..38d673925 100644 --- a/app/View/Themed/Paz/webroot/css/stylesheets/theme.css +++ b/app/View/Themed/Paz/webroot/css/stylesheets/theme.css @@ -1,4 +1,4 @@ -body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#222;font-weight:400;background-color:#fff}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#a5a5a5}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#d50606;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #e2e2e2}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:-webkit-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:linear-gradient(to top, rgba(255,255,255,0.85),#ffffff 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #e2e2e2}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #e2e2e2;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} +body,ul{margin:0;padding:0}ul{list-style:none}html,body{height:100%}html{font-size:62.5%}code,pre,tt{line-height:inherit;font-family:courier-new, courier, monospace}ins{text-decoration:inherit}.richtext ul{margin-top:1em;padding-left:0;list-style-type:none;position:relative}.richtext ul>li:before{content:"\2022";display:block;position:absolute;left:-1em}body,.btnLink,.btn-submit,textarea,input[type=text],input[type=password]{font-family:Cabin;color:#222;font-weight:400;background-color:#fff}body{font-size:1.4em}.postingBody-heading,.postingform .subject{font-family:'Fenix', Serif;text-rendering:optimizeLegibility}input,textarea{font-size:1em;padding:0.5em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-color:#a5a5a5}body,h1,h2,h3,h4{line-height:1.5em}h1,h2,h3,h4,#hero-home-link{font-size:1.35em}h4{font-size:1em}.richtext:before,.richtext:after{content:" ";display:table}.richtext:after{clear:both}.btnLink,.btn-submit{border:none;background:none;margin:0;padding:0;cursor:pointer;line-height:inherit;font-size:1em;-webkit-appearance:none}.ui-dialog-titlebar-close:active,.ui-dialog-titlebar-close:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}a,.btnLink,.btn-submit{color:inherit;text-decoration:inherit;cursor:inherit;color:#d50606;cursor:pointer}a:active,a:focus,.btnLink:active,.btn-submit:active,.btnLink:focus,.btn-submit:focus{outline:none}u{text-decoration:underline}hr{border-width:0;border-bottom:1px solid #e2e2e2}#site-header{text-align:center}body.headerClosed .top-menu{display:none}body.headerClosed header{margin-left:-2em;margin-right:-2em;position:-webkit-sticky;top:0;z-index:100;background:-moz-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:-webkit-linear-gradient(bottom, rgba(255,255,255,0.85),#ffffff 90%);background:linear-gradient(to top, rgba(255,255,255,0.85),#ffffff 90%)}body.headerClosed #js-top-menu-open{display:block;line-height:40px;padding:0 2em}body.headerClosed #hero-home-link{padding-top:0.5em;padding-bottom:0.5em}#hero{position:relative;border-bottom:1px solid #e2e2e2}#hero-home-link{font-weight:bold;padding:1em}#js-top-menu-open{position:absolute;bottom:0;right:0;display:none}.top-menu{border-bottom:1px solid #e2e2e2;position:relative}.top-menu .saito-icon-text{display:none}@media (min-width: 600px){.top-menu .saito-icon-text{display:inline}} .top-menu-item{padding:0.5em;display:inline-block}@media (min-width: 600px){.top-menu-item{padding:1em}} .top-menu-aside{position:absolute;right:0}.navbar{margin:1em 0}.navbar .saito-icon-text{display:none}@media (min-width: 600px){.navbar .saito-icon-text{display:inline}}.navbar .paginator{margin-left:1em}.navbar .pageHeading,.navbar .panel-heading h1,.panel-heading .navbar h1,.navbar .panel-heading h2,.panel-heading .navbar h2{margin:0}.navbar-item{padding:0 1em}.navbar-item.left{padding-left:0}.navbar-item.right{padding-right:0}.heading-3{height:24px;position:relative}.heading-3 h1,.heading-3 h2,.heading-3 h3{margin:0;padding:0}.heading-3>div{line-height:24px;padding:0px 0;text-align:center;white-space:nowrap;vertical-align:middle}.heading-3>div:first-child{position:absolute}.heading-3>div:last-child{position:absolute;top:0;right:0;text-align:right}.pageHeading,.panel-heading h1,.panel-heading h2,.ui-dialog-title{font-size:1em;display:inline-block;font-weight:normal;margin:0 auto}.pageHeading:after,.panel-heading h1:after,.panel-heading h2:after,.ui-dialog-title:after{content:"";position:relative;border-bottom:2px solid #e2e2e2;height:1px;display:block}#content{padding:0 2em}#footer-pinned{position:absolute;bottom:0;left:0;right:0;padding:0 2em}.disclaimer{border-top:1px solid #e2e2e2;font-size:0.85em;padding-bottom:1em}#debugFooter{font-size:12px}.infoText,.postingBody-signature,.threadLine-post,.richtext-linkInfo,.richtext-editMark,.postingBody-info,.postingform-subject-count,.postingform-eh,.disabled{color:#727272}.c-category{color:#222;font-weight:normal;white-space:nowrap}.c-username{color:#222}.postingBody-signature{font-size:0.85em;text-align:center}.postingBody-signature-divider{padding-bottom:1em}.solves-isSolved{color:#008000}.threadLine-content:hover{background:#f0f0f0}.no-content-yet{font-weight:bold;text-align:center;font-size:3em;color:#d8d8d8;letter-spacing:0.1em;word-spacing:0.1em;padding:1em 0}.ui-dialog,.markItUp .markItUpHeader>ul>li>ul,.flash-error>.alert,.flash-warning>.alert,.flash-notice>.alert,.flash-success>.alert{box-shadow:0px 1px 3px rgba(0,0,0,0.25)}.sort-menu .asc,.sort-menu .desc{font-weight:bold}.sort-menu .asc:after{content:"\002005\002193\002005"}.sort-menu .desc:after{content:"\002005\002191\002005"}.sort-menu-item{padding:0 0.5em}.table-simple{width:100%;text-align:center}.table-simple th{background-color:#e7e7e7}.table-simple tr td{border-bottom:1px solid #e2e2e2}.prev{margin-right:0.5em}.next{margin-left:0.5em}.panel{padding:1em}.panel-heading{margin:0 0 1em}.panel-heading.pageTitle{display:none}.panel-footer{padding:1em 0}.panel-footer.panel-form{margin-top:2em;padding:0.3em 1em}.panel-form{background:#e7e7e7;padding:1em 1em}.panel-footer-form-btn{margin-right:1em}.ui-dialog{background:#fff;border-color:#e2e2e2}.ui-dialog .ui-dialog-titlebar-close{left:1em}.ui-dialog .jqueryUi-closethick-fix{color:#a5a5a5}.ui-dialog>.ui-dialog-content{padding:0}.ui-dialog>.ui-dialog-content>.panel{padding-top:0}.spinner>div{background-color:#e2e2e2 !important}.spinner{padding:1em}.spinner{margin:0 auto;width:50px;height:30px;text-align:center;font-size:10px}.spinner>div{background-color:#333;height:100%;width:6px;display:inline-block;-webkit-animation:stretchdelay 1.2s infinite ease-in-out;animation:stretchdelay 1.2s infinite ease-in-out}.spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.spinner .rect5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.shp-show-btn{display:none}.shp-show-btn.is-active{display:inline-block}.shp-icon{margin:0.5em}.category-chooser-ul{margin-bottom:1em}.category-chooser-li{margin:0.5em}.input{margin:0 0 1em}textarea,input[type=text],input[type=password],.markItUp textarea{outline-style:none;border-style:none;width:100%;background:#fbfbfb;border-left:2px solid #a5a5a5;-webkit-appearance:none;border-radius:0}.required label:after{color:#ee3322;content:"\2217";vertical-align:super;padding-right:0.5em}.btn-submit{padding:0em 0.8em;border-radius:3px;background-color:#d50606;color:#fff}.btn-submit[disabled=disabled]{opacity:0.5;cursor:not-allowed}.btn-icon{padding-left:0.5em;padding-right:0.5em}.dropdown .dropdown-menu>li>a:hover{background-color:#d50606;color:#fff;cursor:pointer}.btn-strip{cursor:pointer;height:100%;position:absolute}.btn-strip-top{width:25px;text-align:center;margin:4px 0px 0px -1px}.btn-strip-back{width:15px;background-color:#e7e7e7;background-repeat:repeat-y}.btn-strip-back:active{background-color:#e7e7e7}.btn-strip-back:before{font-family:'FontAwesome';content:'\f060';font-size:12px;width:15px;text-align:center;display:block;position:absolute;top:50%}#site{min-width:400px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:100%;position:relative;padding:0 2em 3em;max-width:70em;margin:0 auto}.bp-threeColumn{*zoom:1;max-width:60em;_width:60em;padding-left:1em;padding-right:1em;margin-left:auto;margin-right:auto}.bp-threeColumn:after{content:"";display:table;clear:both}@media (min-width: 600px){.bp-threeColumn .left{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .center{width:32.98429%;float:left;margin-right:0.52356%}.bp-threeColumn .right{width:32.98429%;float:right;margin-right:0}} #slidetabs{float:right;position:relative;z-index:5;margin-right:-2em;margin-left:1em;background:#fff}.slidetab{width:28px;margin-bottom:2em;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:0.85em;float:right;clear:both}.slidetab h4{margin:0}.slidetab.is-open{width:280px}.slidetab.is-open .slidetab-outer{display:block}.slidetab-outer{display:none;min-height:40px;margin-left:28px;padding:1em 2em;border-left:1px solid #e2e2e2}.slidetab-tab{float:left;padding:4px;width:20px;height:20px;position:relative}.slidetab-tab-button{color:#d50606;cursor:pointer}.slidetab-content{word-break:break-word}.slidetab-userlist-icon{display:inline-block;width:1.1em;padding-left:1em}#slidetabUserlist-counter{position:absolute;min-width:6px;background:#111111;border:1px solid white;padding:0 1px;right:0px;bottom:0px}.slidetabUserlist-counter-inner{text-align:center;color:white;line-height:12px;font-size:8px}#shoutbox{word-wrap:break-word}#shoutbox img{max-width:100%}#shoutbox .infoText,#shoutbox .postingBody-signature,#shoutbox .threadLine-post,#shoutbox .richtext-linkInfo,#shoutbox .richtext-editMark,#shoutbox .postingBody-info,#shoutbox .postingform-subject-count,#shoutbox .postingform-eh{text-align:center}.threadBox.ignored{display:none}.threadLeaf.ignored{opacity:0}.mix .ignored .postingLayout{visibility:hidden;height:1em}.threadTree-node{padding-left:30px}.threadTree-node,.threadCollection-node{list-style:none}.threadTree-node.root,.threadCollection-node.root{margin:0;padding:0}.threadCollection-node .threadTree-node{padding-left:0}.btn-threadCollapse{width:28px;text-align:center;position:absolute;left:-4px}.threadBox{margin:1em 0}.threadBox-body.panel{border:none}.threadBox-tools{padding-left:2em;font-size:0.85em}.threadBox .threadTree-node.root{padding-left:20px}.btn-threadBox-tools{margin-right:1em}.et-root .et,.et-reply .et{color:#d50606}.et-old .et{color:#222}.et-current .et{color:red}.threadLine-pre{float:left;text-align:center;width:2em;max-height:1.5em}.threadLine-content{word-wrap:break-word;display:block;padding-left:2em}.threadLine-content .c-category{color:#222}.threadLine-post{font-size:0.85em;font-weight:normal}.threadInline-slider{overflow:hidden;margin-left:25px}.entry.view .threadBox{border-top:1px solid #e2e2e2}.mixEntry{border-bottom:1px solid #e2e2e2;margin-bottom:1em}.richtext hr{margin-left:0.5em;width:10em}.richtext object,.richtext embed,.richtext video,.richtext iframe,.richtext img{display:block;margin:0 auto;max-width:100%}.richtext .saito-smiley-image{margin:inherit;display:inline-block}.richtext blockquote,.richtext .richtext-citation{font-style:italic;color:#727272}.richtext-float{max-width:50%;clear:both;float:left;margin:1em}.geshi-wrapper{padding:1em}.geshi-wrapper ol{color:#333;background:#F0FCEF}.geshi-wrapper ol li{padding-left:0.5em}.richtext-linkInfo{font-size:0.85em}.richtext-spoiler-link{color:black;background-color:black;text-shadow:none;word-break:break-word}.richtext-spoiler-link:hover{color:inherit;background-color:inherit;text-shadow:inherit}.richtext-editMark{padding:0 0.3em}.postingLayout{margin:0 auto;max-width:54em}.threadInline-slider .postingLayout{padding:0 1em 1em}.threadInline-slider .postingLayout .postingBody-signature{display:none}.postingLayout-slider{display:none}.postingLayout-slider .postingform{border-top:1px solid #e2e2e2}.postingLayout-slider .preview{border-top:1px solid #e2e2e2;border-bottom:none}.postingBody-heading{margin-bottom:2px;margin-top:0;font-weight:normal;font-size:1.485em}.threadInline-slider .postingBody-heading{font-size:1.25em}.postingBody-info{margin-bottom:1em}.postingBody-info>.meta{font-size:0.85em}.postingBody-text{margin-bottom:1em;word-wrap:break-word}.postingBody-text:after{content:'';display:block;clear:both}.postingBody-signature{margin-bottom:1em}.posting-badge{margin-left:0.5em;padding:0 0.5em;font-size:0.85em;vertical-align:top}.postingform .subject{font-size:1.2em}.postingform textarea,.postingform input[type=text]{padding-left:10px;padding-right:10px}.postingform-subject-count{float:right}.postingform-eh{float:right;font-size:0.85em;margin-top:-1em;line-height:1em}.preview{display:none;margin-bottom:1em;padding:1em;border-bottom:1px solid #e2e2e2}.table.th-left{margin:0 auto;border-collapse:collapse;width:100%}.table.th-left th,.table.th-left td{padding:1em 1em;text-align:left;vertical-align:top}.table.th-left td:first-child{font-weight:bold;text-align:right;width:38%;border-right:1px solid #e2e2e2}.table.th-left.row-sep{border-spacing:0 2em;border-collapse:separate}.table.th-left ul{margin:0;padding:0;list-style-type:none}.table-menu{float:right}.l-bookmarks-container{overflow:hidden}.l-bookmarks-row{white-space:nowrap}.l-bookmarks-cell{display:inline-table;vertical-align:middle;white-space:normal;min-width:16px;box-sizing:border-box}.bookmarks-cell{padding:1em}.markItUp{border:none}.markItUp .markItUpHeader>ul .markItUpSeparator{min-width:1px;width:1px;overflow:hidden;background-color:#a5a5a5;margin-left:8px;margin-right:8px}.markItUp .markItUpHeader>ul,.markItUp .markItUpHeader>ul li{padding:0;margin:0;list-style:none}.markItUp .markItUpHeader>ul li{margin:0;min-width:32px;height:32px;position:relative}@media (min-width: 600px){.markItUp .markItUpHeader>ul li{margin:3px}}.markItUp .markItUpHeader>ul a{display:block;text-align:center;line-height:32px;min-width:32px;height:32px;background-repeat:no-repeat}@media (min-width: 600px){.markItUp .markItUpHeader>ul a{font-size:18px}}.markItUp .markItUpHeader>ul a:link,.markItUp .markItUpHeader>ul a:visited{color:#222}.markItUp .markItUpHeader>ul>li{float:left}.markItUp .markItUpHeader>ul>li>ul{display:block}.markItUp .markItUpHeader>ul>li>ul{display:none;position:absolute;top:18px;left:0px;background:#fff;border:1px solid #e2e2e2}.markItUp .markItUpHeader>ul>li>ul>li{margin:0;padding:0;list-style:none;float:left;position:relative}.markItUp .btn-markItUp-Smilies>ul{width:260px;z-index:1;margin:-21px 0 0 -2px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton{margin:0px}.markItUp .btn-markItUp-Smilies>ul .markItUpButton>a{background-position:9px 9px;height:32px;width:32px;padding:0px}.markItUp .saito-smiley-font{font-size:16px;line-height:32px;text-align:center;cursor:pointer}.markItUp .saito-smiley-font>a{display:none !important}.searchForm-wrapper{margin-bottom:20px}.searchForm{display:table;width:100%;vertical-align:middle}.searchForm>div{display:table-cell;vertical-align:middle}.searchForm .search_form>div{overflow:hidden}.searchForm #search_fulltext_textfield{height:38px}.searchForm .btn_search_submit{float:right;white-space:nowrap;margin-left:1em;height:38px}@font-face{font-family:'smilies';src:url("../../img/smilies/smilies.eot?6246308");src:url("../../img/smilies/smilies.eot?6246308#iefix") format("embedded-opentype"),url("../../img/smilies/smilies.woff?6246308") format("woff"),url("../../img/smilies/smilies.ttf?6246308") format("truetype"),url("../../img/smilies/smilies.svg?6246308#smilies") format("svg");font-weight:normal;font-style:normal}.saito-smiley-font:before{font-family:"smilies";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.saito-smiley-font.saito-smiley-heart-empty-1:before{content:'\e802'}.saito-smiley-font.saito-smiley-wink:before{content:'\e801'}.saito-smiley-font.saito-smiley-sleep:before{content:'\e806'}.saito-smiley-font.saito-smiley-devil:before{content:'\e807'}.saito-smiley-font.saito-smiley-happy:before{content:'\e808'}.saito-smiley-font.saito-smiley-sunglasses:before{content:'\e809'}.saito-smiley-font.saito-smiley-cry:before{content:'\e80a'}.saito-smiley-font.saito-smiley-displeased:before{content:'\e80b'}.saito-smiley-font.saito-smiley-unhappy:before{content:'\e80c'}.saito-smiley-font.saito-smiley-surprised:before{content:'\e80d'}.saito-smiley-font.saito-smiley-grin:before{content:'\e80e'}.saito-smiley-font.saito-smiley-thumbsup:before{content:'\e80f'}.saito-smiley-font.saito-smiley-saint:before{content:'\e810'}.saito-smiley-font.saito-smiley-angry:before{content:'\e811'}.saito-smiley-font.saito-smiley-tongue:before{content:'\e812'}.saito-smiley-font.saito-smiley-coffee:before{content:'\e813'}.saito-smiley-font.saito-smiley-squint:before{content:'\e814'}#markitup_upload{-webkit-overflow-scrolling:touch}#upload_index form,#upload_index input[type=file]{width:auto;margin:0;padding:0}#upload_index .content{text-align:center}#upload_index h2{margin-bottom:2px;font-size:110%}#upload_index .upload_box{border:1px solid #e2e2e2;margin:12px;width:170px;height:180px;position:relative;display:inline-block;padding:0}#upload_index .upload_box_header{height:130px;width:160px;position:relative;padding:5px;display:table-cell;vertical-align:middle;text-align:center}#upload_index .upload_box_image{max-width:140px;max-height:110px;border:1px solid #e2e2e2;padding:4px;background:white}#upload_index .upload_box_delete{position:absolute;z-index:10;bottom:8px;right:5px;font-size:16px}#upload_index .upload_box_footer{margin:0;text-align:center;line-height:25px;height:30px;padding:5px !important}#upload_index .upload-drag-indicator,#upload_index .upload-layer{top:0;left:0;position:absolute;width:170px;height:140px}#upload_index .upload-layer{z-index:100;opacity:0}#upload_index .upload-drag-indicator{background:#ffffff;opacity:0.9;font-size:70px;line-height:140px;display:none}.thread_inline{position:relative}.ui-pnotify h4{margin:0;padding:0}.ui-pnotify .ui-pnotify-title{font-weight:bolder}.flash>.alert,.message{clear:both;margin:0px 0px 1em;padding:1em;color:#333;background-color:#ff2120;border:1px #d41b1a solid}.flash-error>.alert{border:1px #aa1615 solid;color:#000;text-shadow:#fff 0px 1px;background-color:#ff2120;text-shadow:none;color:white}.flash-warning>.alert{border:1px #aaa13e solid;color:#000;text-shadow:#fff 0px 1px;background-color:#fff25e}.flash-notice>.alert{border:1px #999faa solid;color:#002e80;text-shadow:#fff 0px 1px;background-color:#e6efff}.flash-success>.alert{border:1px #84aa49 solid;color:#050800;text-shadow:#fff 0px 1px;background-color:#c6ff6e}.error-message,.message{padding:5px;background-color:#ff2120;color:white}@media only screen and (max-width: 768px){body{-webkit-text-size-adjust:110%}#content{padding-left:1em;padding-right:1em}.panel-footer{margin-left:-1em;margin-right:-1em}}@media only screen and (orientation: landscape) and (max-width: 568px){body{width:568px}}@media only screen and (max-width: 568px){body{-webkit-text-size-adjust:100%}#slidetabs{float:none}.slidetabs{margin:0}.slidetab.is-open{float:none;width:100%}.threadBox{max-width:100%;overflow-x:scroll;-webkit-overflow-scrolling:touch}.threadBox-body{width:100%;padding:0}.threadTree-node{min-width:10em}}@media only screen and (device-width: 768px){body{-webkit-text-size-adjust:110%}} From bcb8aadc2cf965ec38ebf223871e5cf7fe435738 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 11:49:51 +0200 Subject: [PATCH 12/29] fix answering --- app/webroot/dist/main.min.js | 2 +- app/webroot/js/views/answering.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/webroot/dist/main.min.js b/app/webroot/dist/main.min.js index ddc7908a5..87424020f 100644 --- a/app/webroot/dist/main.min.js +++ b/app/webroot/dist/main.min.js @@ -1,3 +1,3 @@ "undefined"==typeof console&&(console={},console.log=function(){"use strict"},console.error=console.debug=console.info=console.log),window.redirect=function(e){"use strict";document.location.replace(e)},$.ajaxSetup({cache:!1}),define("jquery",[],function(){"use strict";return jQuery}),define("lib/bootstrapHelper",function(){}),define("lib/saito/underscore.extend",["underscore"],function(e){"use strict";e.mixin({chars:function(e){var t,i;return i=e.match(/(\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDFFF])/g)||[],t=e.length-i.length}})}),define("app/core",["marionette"],function(e){"use strict";return new e.Application}),define("app/vent",["marionette"],function(){var e=function(){this.vent=new Backbone.Wreqr.EventAggregator,this.commands=new Backbone.Wreqr.Commands,this.reqres=new Backbone.Wreqr.RequestResponse,this.request=function(){var e=Array.prototype.slice.apply(arguments);return this.reqres.request.apply(this.reqres,e)}};return new e}),define("models/appSetting",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({});return i}),define("models/appStatus",["underscore","backbone","cakeRest","app/vent"],function(e,t,i,n){"use strict";var o=t.Model.extend({stream:null,initialize:function(t,i){this.settings=i.settings,this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="status/",this.listenTo(this,"change:lastShoutId",this._onNewShout)},start:function(){this._setWebroot(this.settings.get("webroot")),this._poll()},_onNewShout:function(e){var t=e.get("lastShoutId");n.commands.execute("shoutbox:update",t)},_setWebroot:function(e){this.webroot=e+"status/"},_eventStream:function(){this.stream=new EventSource(this.webroot+this.methodToCakePhpUrl.read),this.stream.addEventListener("message",e.bind(function(e){var t=JSON.parse(e.data);this.set(t)},this),!1)},_poll:function(){var t,i,n,o,s,a,r=1e4,l=9e4;s=function(){void 0!==o&&clearTimeout(o)},t=function(){s(),a=r},n=function(){o=setTimeout(i,a)},i=e.bind(function(){n(),this.fetch({success:function(){a=Math.floor(a*(1+a/4e4)),a>l&&(a=l)},error:s})},this),this.listenTo(this,"change",function(){t(),n()}),i(),t(),n()}});return e.extend(o.prototype,i),o}),define("models/currentUser",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({isLoggedIn:function(){return this.get("id")>0}});return i}),define("models/app",["underscore","backbone","app/vent","models/appSetting","models/appStatus","models/currentUser"],function(e,t,i,n,o,s){"use strict";var a=t.Model.extend({eventBus:null,settings:null,status:null,currentUser:null,request:null,initialize:function(){this.eventBus=i.vent,this.commands=i.commands,this.reqres=i.reqres,this.settings=new n,this.status=new o({},{settings:this.settings}),this.currentUser=new s}});return new a}),define("modules/html5-notification/views/notification",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.View.extend({_hideAfter:10,_iconUrl:!1,initialize:function(e){this._iconUrl=e.iconUrl,this.listenTo(i.eventBus,"html5-notification",this.notification),i.commands.setHandler("app:html5-notification:activate",this._activate,this),i.reqres.setHandler("app:html5-notification:available",this._isEnabled,this)},notification:function(t){var n=!i.reqres.request("isAppVisible");if(t=e.defaults(t,{icon:this._iconUrl,always:!1}),t.always||n){var o=new window.Notification(t.title,{icon:t.icon,body:t.message}),s=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;s&&setTimeout(function(){o.close()},1e3*this._hideAfter)}},_activate:function(){return"permission"in window.Notification&&"granted"!==window.Notification.permission?void window.Notification.requestPermission():void window.Notification.requestPermission()},_isEnabled:function(){return"Notification"in window?!0:!1}});return n}),define("modules/html5-notification/html5-notification",["app/core","marionette","modules/html5-notification/views/notification"],function(e,t,i){"use strict";var n=e.module("html5-notification");return n.addInitializer(function(e){new i({iconUrl:e.SaitoApp.app.settings.notificationIcon})}),n}),define("modules/shoutbox/models/shout",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({initialize:function(e,t){this.urlRoot=t.urlRoot}});return i}),define("modules/shoutbox/collections/shouts",["underscore","backbone","modules/shoutbox/models/shout"],function(e,t,i){"use strict";var n=t.Collection.extend({model:i,initialize:function(e,t){this.apiroot=t.apiroot+"shouts/"},fetch:function(){$.ajax({url:this.apiroot,dataType:"json",context:this}).done(function(e){e.length>0&&this.reset(e)})}});return n}),define("templateHelpers",["jquery","underscore","app/vent","moment"],function(e,t,i,n){"use strict";var o=function(){this.webroot=i.reqres.request("webroot")};return{Time:t.extend(new o,{moment:n,_timeFormats:{"long":"DD.MM.YYYY",longWithTime:"DD.MM.YYYY HH:mm",RFC3339:"YYYY-MM-DDTHH:mm:ssZ",theRightWay:"YYYY-MM-DD HH:mm:ss",time:"HH:mm"},lastMidnight:function(){return n(this.now().format("YYYY-MM-DD"))},now:function(){return n()},_normal:function(t){var i=this.now(),n=this.lastMidnight(),o=i.diff(t)/1e3;return t.isAfter(n)||21600>o?t.format(this._timeFormats.time):64800>o?e.i18n.__("yesterday")+" "+t.format(this._timeFormats.time):t.format(this._timeFormats["long"])},format:function(e,i,o){var s,a;if(i=i||"normal",o=o||{},t.defaults(o,{wrap:!0}),n.isMoment(e))a=e;else if(t.isNumber(e))(""+e).length<13&&(e=Math.round(1e3*e)),a=new n(e);else{if(!t.isDate(e))throw"No valid timestamp: "+e.toJSON();a=new n(e)}if(s="normal"===i?this._normal(a):a.format(this._timeFormats[i]?this._timeFormats[i]:i),o.wrap){var r=" ",l={title:a.format(this._timeFormats.theRightWay),datetime:a.format(this._timeFormats.RFC3339)};t.each(l,function(e,t){r+=t+'="'+e+'" '}),s=""+s+""}return s}}),User:t.extend(new o,{templates:{linkToUserProfile:t.template('<%- name %>')},linkToUserProfile:function(e,t){var i=this.urlToUserProfile(e);return this.templates.linkToUserProfile({url:i,name:t})},urlToUserProfile:function(e){return this.webroot+"users/view/"+e}})}}),define("lib/saito/localStorageHelper",["underscore","app/vent"],function(e,t){"use strict";var i=function(){};e.extend(i.prototype,{_available:null,_prefix:"saito-",available:function(){return null===this._available&&(this._available=this._isAvailable()),this._available},_clear:function(){if(this.available()){var t=Object.keys(localStorage);e.each(t,function(e){0===e.indexOf(this._prefix)&&localStorage.removeItem(e)},this)}},_key:function(e){return this._prefix+e},_isAvailable:function(){if(!("localStorage"in window))return!1;try{var e="localStorageAvailableTestKey",t=window.localStorage;return t.setItem(e,"1"),t.removeItem(e),!0}catch(i){return!1}return!1}});var n=new i;t.reqres.setHandler("app:localStorage:available",n.available,n),t.reqres.setHandler("app:localStorage:key",n._key,n),t.commands.setHandler("app:localStorage:clear",n._clear,n)}),define("modules/shoutbox/models/control",["underscore","backbone","models/app","lib/saito/localStorageHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{id:1,lastId:0,mar:0,notify:!1},localStorage:function(){var e=i.reqres.request("app:localStorage:key","shoutbox-control");return new t.LocalStorage(e)}(),initialize:function(){this._restore(["notify","mar"]),this.listenTo(this,"change:notify",this._onChangeNotify),i.commands.setHandler("shoutbox:mar",this._mar,this)},_mar:function(t){t=t||{},e.defaults(t,{silent:!1}),this.set({mar:this.get("lastId")},{silent:t.silent}),this._save("mar")},setLastId:function(e){e<=this.get("lastId")||this.set("lastId",e)},_onChangeNotify:function(){this._save("notify")},_onChangeMar:function(){this._save("mar")},_restore:function(t){e.isArray(t)&&e.each(t,function(e){this._restore(e)},this),i.reqres.request("app:localStorage:available")&&this.fetch()},_save:function(){i.reqres.request("app:localStorage:available")&&this.save()}});return new n}),define("text!modules/shoutbox/templates/shout.html",[],function(){return'\n <%= User.linkToUserProfile(user_id, user_name) %>:\n\n<%= html %>\n'}),define("modules/shoutbox/views/shout",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","templateHelpers","text!modules/shoutbox/templates/shout.html"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.ItemView.extend({className:"shout",templateHelpers:a,initialize:function(e){this.webroot=e.webroot,this.listenTo(s,"change:mar",this.render)},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("id")>s.get("mar"),i=this.model.get("user_id")===o.currentUser.get("id");return i&&this.$el.addClass("shoutbox-shout-cu"),this.$el.addClass(t&&!i?"shoutbox-shout-new":"shoutbox-shout-old"),e},onRender:function(){s.setLastId(this.model.get("id"))},template:function(e){return t.template(r,e)}});return l}),define("modules/shoutbox/views/shouts",["jquery","underscore","backbone","marionette","models/app","templateHelpers","modules/shoutbox/views/shout","modules/shoutbox/models/control"],function(e,t,i,n,o,s,a,r){"use strict";var l=n.CollectionView.extend({itemView:a,itemViewOptions:{},_Notifications:{_last:0,_models:[],_isEnabled:!1,init:function(e){this._currentUserId=e.currentUserId,this._isEnabled=e.isEnabled,this._last=e.last},add:function(e){this._isEnabled===!0&&this._currentUserId!==e.get("user_id")&&(e.get("id")<=this._last||this._models.push(e))},send:function(){0!==this._models.length&&(t.each(this._models,function(e){o.eventBus.trigger("html5-notification",{title:e.get("user_name"),message:e.get("text")})}),this._last=t.first(this._models).get("id"),this._models=[])}},_Delimiter:{_conversationCoolOff:300,_previousItemTime:null,tpl:t.template('
              <%= time %>
              '),append:function(e){var t=s.Time.moment(e.model.get("time"));return null===this._previousItemTime?void(this._previousItemTime=t):(this._itemTime=t,this.$el=e.$el,this._prepend(this._previousItemTime.unix()-t.unix()>this._conversationCoolOff?this._previousItemTime:"
              "),void(this._previousItemTime=t))},finish:function(){this._previousItemTime=null,this._itemTime&&this.$el.after(this._formatTime(this._itemTime))},_prepend:function(e){this.$el.before(this._formatTime(e))},_formatTime:function(e){var i=e;if(t.isObject(e)){var n=s.Time.moment().utc().diff(e)/1e3,o="normal";n>64800&&(o="longWithTime"),i=this.tpl({time:s.Time.format(e,o)})}return i}},initialize:function(e){this.itemViewOptions.webroot=e.webroot,this.setupNotifications(),this.listenTo(r,"change:notify",this.setupNotifications)},setupNotifications:function(){var e=0;this.collection.size()>0&&(e=this.collection.first().get("id")),this._Notifications.init({currentUserId:o.currentUser.get("id"),isEnabled:r.get("notify"),last:e})},onBeforeRender:function(){this.$el.html("")},onAfterItemAdded:function(e){this._Delimiter.append(e),this._Notifications.add(e.model)},onRender:function(){this._Delimiter.finish(),this._Notifications.send()}});return l}),define("text!modules/shoutbox/templates/add.html",[],function(){return'
              \n \n\n'}),define("modules/shoutbox/views/add",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/shout","text!modules/shoutbox/templates/add.html","jqueryAutosize"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),_placeholder:{a:e.i18n.__("Shout :shortcut",{shortcut:"⌃s"}),b:e.i18n.__("Hit enter to mark as read")},events:{"keyup form":"formUp","keydown form":"formDown","blur #shoutbox-input":"_setPlaceholder","focus #shoutbox-input":"_setPlaceholder"},submit:function(){this.model.save({text:this.textarea.val()},{success:t.bind(function(e,t){o.commands.execute("shoutbox:mar",{silent:!0}),this.collection.reset(t)},this)})},_setPlaceholder:function(){t.defer(t.bind(function(){var e;e=this.textarea.is(":focus")?this._placeholder.b:this._placeholder.a,this.textarea.attr("placeholder",e)},this))},_firefoxRowFix:function(){if(-1!==navigator.userAgent.toLowerCase().indexOf("firefox")){var e=parseFloat(this.textarea.css("line-height")),t=1*this.textarea.attr("rows");this.textarea.css("height",t*e)}},serializeData:function(){return{placeholder:this._placeholder.a}},clearForm:function(){this.textarea.val("").trigger("autosize.resize")},formDown:function(e){13===e.keyCode&&e.shiftKey===!1&&(e.preventDefault(),this.textarea.val().length>0?(this.submit(),this.clearForm()):o.commands.execute("shoutbox:mar"))},formUp:function(){this.textarea.val().length>0?o.eventBus.trigger("breakAutoreload"):0===this.textarea.val().length&&o.eventBus.trigger("initAutoreload")},onShow:function(){this.textarea=this.$("#shoutbox-input"),this._firefoxRowFix(),this.textarea.autosize(),this._setPlaceholder(),e(window).keydown(t.bind(function(e){e.ctrlKey===!0&&83===e.which&&this.textarea.focus()},this))}});return r}),define("text!modules/shoutbox/templates/control.html",[],function(){return"\n"}),define("modules/shoutbox/views/control",["jquery","underscore","backbone","marionette","models/app","modules/shoutbox/models/control","text!modules/shoutbox/templates/control.html"],function(e,t,i,n,o,s,a){"use strict";var r=n.ItemView.extend({template:t.template(a),events:{"click #shoutbox-notify":"onChangeNotify"},initialize:function(){this.model=s},onRender:function(){this._putNotifyCheckbox()},serializeData:function(){return{n:e.i18n.__("Notification")}},_putNotifyCheckbox:function(){var e=o.reqres.request("app:html5-notification:available");e===!0&&(this.notify=this.$("#shoutbox-notify"),this.model.get("notify")?this.notify.attr("checked","checked"):this.notify.removeAttr("checked"),this.$("#shoutbox-notify-label").show())},onChangeNotify:function(){var e=this.notify.is(":checked");this.model.set("notify",e),e&&o.commands.execute("app:html5-notification:activate")}});return r}),define("text!modules/shoutbox/templates/layout.html",[],function(){return"
              \n
              \n
              \n
              \n
              \n"}),define("modules/shoutbox/shoutbox",["jquery","app/app","models/app","marionette","modules/shoutbox/collections/shouts","modules/shoutbox/models/shout","modules/shoutbox/views/shouts","modules/shoutbox/views/add","modules/shoutbox/views/control","text!modules/shoutbox/templates/layout.html"],function(e,t,i,n,o,s,a,r,l,d){"use strict";var c=t.module("Shoutbox");return c.addInitializer(function(t){var c=t.SaitoApp.shouts,u=i.reqres.request("webroot"),h=i.reqres.request("apiroot");if(e("#shoutbox").length){var p={layout:null,shoutsCollection:null,initialize:function(){this.initLayout(),this.initShoutsCollection(),this.initAdd(),this.initShouts(),this.initControl()},initShoutsCollection:function(){this.shoutsCollection=new o(c,{apiroot:h});var e=_.bind(function(){var e=!i.reqres.request("slidetab:open","shoutbox");e||this.shoutsCollection.fetch()},this);i.eventBus.on("slidetab:open",_.bind(function(t){"shoutbox"===t.slidetab&&e()},this)),i.commands.setHandler("shoutbox:update",_.bind(function(t){var i=0;this.shoutsCollection.size()>0&&(i=this.shoutsCollection.at(0).get("id")),t!==i&&e()},this))},initLayout:function(){var e=n.Layout.extend({el:"#shoutbox",template:d,regions:{add:"#shoutbox-add",shouts:"#shoutbox-shouts",control:"#shoutbox-control"}});this.layout=new e,this.layout.render(),this.layout.$("#shoutbox-add").addClass("slidetab-header"),this.layout.$("#shoutbox-shouts").addClass("slidetab-content"),this.layout.$("#shoutbox-control").addClass("slidetab-footer")},initShouts:function(){var e=new a({collection:this.shoutsCollection,webroot:u});this.layout.shouts.show(e)},initControl:function(){var e=new l;this.layout.control.show(e)},initAdd:function(){var e=new s({},{urlRoot:h+"shouts/"});this.layout.add.show(new r({model:e,collection:this.shoutsCollection}))}};p.initialize()}}),c}),define("models/threadline",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({defaults:{isInlineOpened:!1,shouldScrollOnInlineOpen:!0,isAlwaysShownInline:!1,isNewToUser:!1,posting:"",html:""},initialize:function(){this.webroot=i.settings.get("webroot")+"entries/",this.methodToCakePhpUrl=e.clone(this.methodToCakePhpUrl),this.methodToCakePhpUrl.read="threadLine/",this.set("isAlwaysShownInline",i.currentUser.get("user_show_inline")||!1)}});return e.extend(o.prototype,n),o}),define("collections/threadlines",["underscore","backbone","models/threadline"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("text!templates/threadline-spinner.html",[],function(){return''}),define("views/postingActionBookmark",["jquery","underscore","marionette","models/app"],function(e,t,i,n){"use strict";return i.ItemView.extend({tagName:"a",className:"btn-bookmark-add btn-icon panel-footer-form-btn",template:t.template(''),events:{click:"_onClick"},modelEvents:{"change:isBookmarked":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr("href","#"),this.render())},_shouldRender:function(){return n.currentUser.isLoggedIn()?!0:!1},_onClick:function(e){e.preventDefault(),this.model.get("isBookmarked")?window.location=n.settings.get("webroot")+"bookmarks/index/#"+this.model.get("id"):this.model.set("isBookmarked",!0)},_toggle:function(){var t=this.$("i");this.model.get("isBookmarked")?(t.removeClass("fa-bookmark-o"),t.addClass("fa-bookmark"),this.$el.attr("title",e.i18n.__("Entry is bookmarked"))):(t.removeClass("fa-bookmark"),t.addClass("fa-bookmark-o"),this.$el.attr("title",e.i18n.__("Bookmark the entry")))},onRender:function(){this._toggle()}})}),define("views/postingActionSolves",["jquery","marionette","models/app"],function(e,t,i){"use strict";return t.ItemView.extend({tagName:"a",className:"btn-solves btn-icon panel-footer-form-btn",template:_.template(''),events:{click:"_onClick"},modelEvents:{"change:isSolves":"_toggle"},initialize:function(){this._shouldRender()&&(this.$el.attr({href:"#",title:e.i18n.__("Mark entry as helpful")}),this.render())},_shouldRender:function(){return i.currentUser.isLoggedIn()?this.model.isRoot()?!1:this.model.get("rootEntryUserId")!==i.currentUser.get("id")?!1:!0:!1},_onClick:function(e){e.preventDefault(),this.model.toggle("isSolves")},_toggle:function(){var t=this.$("i"),i=this.model.get("isSolves"),n="";i?(t.addClass("solves-isSolved"),t.removeClass("fa-badge-solves-o"),t.addClass("fa-badge-solves"),n=this.$el.html(),n=e(n).removeClass("fa-lg")):(t.removeClass("fa-badge-solves"),t.addClass("fa-badge-solves-o"),t.removeClass("solves-isSolved")),this._toggleGlobal(n)},_toggleGlobal:function(t){var i=e(".solves."+this.model.get("id"));i.html(t)},onRender:function(){this._toggle()}})}),define("views/editCountdown",["jquery","underscore","marionette","moment","jqueryTinyTimer"],function(e,t,i,n){"use strict";return i.ItemView.extend({_editEnd:null,_buttonText:null,_$countdownDummy:null,_doneAction:"remove",initialize:function(t){this._editEnd=n(this.model.get("time")).unix()+60*t.editPeriod,n().unix()>this._editEnd||(t.done&&(this._doneAction=t.done),this._buttonText=this.$el.html(),this._$countdownDummy=e(''),this.$el.append(this._$countdownDummy),this._start())},_setButtonText:function(e){this.$el.text(this._buttonText+" "+e)},_onTick:function(e){e.m>1||1===e.m&&e.s>30?(e.m=e.m+1,this._setButtonText("("+e.m+" min)")):this._setButtonText(1===e.m?"("+e.m+" min "+e.s+" s)":"("+e.s+" s)")},_onEnd:function(){switch(this._doneAction){case"disable":this._disable();break;default:this._remove()}},_remove:function(){this.remove()},_disable:function(){this.$el.attr("disabled","disabled")},_start:function(){this._$countdownDummy.tinyTimer({to:n.unix(this._editEnd).toDate(),format:"",onTick:t.bind(this._onTick,this),onEnd:t.bind(this._onEnd,this)})}})}),define("views/postingAction",["jquery","underscore","marionette","models/app","views/postingActionBookmark","views/postingActionSolves","views/editCountdown"],function(e,t,i,n,o,s,a){"use strict";var r=i.ItemView.extend({events:{"click .js-btn-setAnsweringForm":"onBtnAnswer"},_jsButtons:[o,s],initialize:function(){this._initFormElements(),this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm)},_initFormElements:function(){t.each(this._jsButtons,function(e){this.$el.append(new e({model:this.model}).$el)},this);var e=this.$(".js-btn-edit");if(e.length>0){new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod")})}},onBtnAnswer:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!0)},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this.$el.slideUp("fast"):this.$el.slideDown("fast")}});return r}),define("models/geshi",["underscore","backbone"],function(e,t){"use strict";var i=t.Model.extend({defaults:{isPlaintext:!1}});return i}),define("collections/geshis",["underscore","backbone","models/geshi"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/geshi",["jquery","underscore","backbone","models/geshi"],function(e,t,i,n){"use strict";var o=i.View.extend({plainText:!1,htmlText:!1,events:{"click .geshi-plain-text":"_togglePlaintext"},initialize:function(){this.model=new n,this.collection.push(this.model),this.block=this.$(".geshi-plain-text").next(),this._setPlaintextButton(),this.listenTo(this.model,"change",this.render)},_setPlaintextButton:function(e){var t;e&&e.preventDefault(),t=this.model.get("isPlaintext")?"fa-list-ol":"fa-align-justify",this.$(".geshi-plain-text").html("")},_togglePlaintext:function(e){e.preventDefault(),this.model.set("isPlaintext",!this.model.get("isPlaintext"))},_extractPlaintext:function(){this.plainText===!1&&(this.htmlText=this.block.html(),"Microsoft Internet Explorer"===navigator.appName?(this.htmlText=this.htmlText.replace(/\n\r/g,"+"),this.plainText=e(this.htmlText).text().replace(/\+\+/g,"\r")):this.plainText=this.block.text().replace(/code /g,"code \n"))},_renderText:function(){this.model.get("isPlaintext")?this.block.text(this.plainText).wrapInner('
              '):this.block.html(this.htmlText)},render:function(){return this._setPlaintextButton(),this._extractPlaintext(),this._renderText(),this}});return o}),define("views/postingContent",["jquery","underscore","marionette","collections/geshis","views/geshi"],function(e,t,i,n,o){"use strict";return i.ItemView.extend({initialize:function(){this.listenTo(this.model,"change:isAnsweringFormShown",this._toggleAnsweringForm),this.listenTo(this.model,"change:html",this.render),this._initGeshi(".geshi-wrapper")},_toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?this._hideSignature():this._showSignature()},_showSignature:function(){this.$(".postingBody-signature").slideDown("fast")},_hideSignature:function(){this.$(".postingBody-signature").slideUp("fast")},_initGeshi:function(e){var t=this.$(e);if(t.length>0){var i=new n;t.each(function(e,t){new o({el:t,collection:i})})}},render:function(){return this.$el.html(this.model.get("html")),this._initGeshi(".geshi-wrapper"),this}})}),define("models/upload",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"uploads/"}});return e.extend(o.prototype,n),o}),define("collections/uploads",["underscore","backbone","models/upload"],function(e,t,i){var n=t.Collection.extend({model:i,initialize:function(e){this.url=e.url+"uploads/index/"}});return n}),define("text!templates/upload.html",[],function(){return'
              \n <%= linkImage %>\n
              \n\n'}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/jquery.insertAtCaret",["jquery"],function(e){return t(e)}):t(jQuery)}(this,function(e){"use strict";e.fn.insertAtCaret=function(e){var t,i=this[0],n=0,o=i.selectionStart||"0"===i.selectionStart?"standard":document.selection?"ie":!1;"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),n=t.text.length):"standard"===o&&(n=i.selectionStart);var s=i.value.substring(0,n),a=i.value.substring(n,i.value.length);return i.value=s+e+a,n+=e.length,"ie"===o?(i.focus(),t=document.selection.createRange(),t.moveStart("character",-i.value.length),t.moveStart("character",n),t.moveEnd("character",0),t.select()):"standard"===o&&(i.selectionStart=n,i.selectionEnd=n,i.focus()),this}}),define("views/upload",["jquery","underscore","backbone","models/app","text!templates/upload.html","lib/saito/jquery.insertAtCaret"],function(e,t,i,n,o){"use strict";var s=i.View.extend({className:"panel-content upload_box current",events:{"click .upload_box_delete":"_removeUpload","click .btn-submit":"_insert"},initialize:function(e){this.textarea=e.textarea,this.listenTo(this.model,"destroy",this._uploadRemoved)},_removeUpload:function(e){e.preventDefault(),this.model.destroy({success:t.bind(function(e,t){n.eventBus.trigger("notification",t)},this)})},_uploadRemoved:function(){this.remove()},_insert:function(t){t.preventDefault(),e(this.textarea).insertAtCaret("[upload]"+this.model.get("name")+"[/upload]")},render:function(){return this.$el.html(t.template(o,this.model.toJSON())),this}});return s}),function(e){function t(){}jQuery.event.props.push("dataTransfer");var i,n,o={fallback_id:"",url:"",refresh:1e3,paramname:"userfile",allowedfiletypes:[],maxfiles:25,maxfilesize:1,queuefiles:0,queuewait:200,data:{},headers:{},drop:t,dragStart:t,dragEnter:t,dragOver:t,dragLeave:t,docEnter:t,docOver:t,docLeave:t,beforeEach:t,afterAll:t,rename:t,error:function(e){alert(e)},uploadStarted:t,uploadFinished:t,progressUpdated:t,globalProgressUpdated:t,speedUpdated:t},s=["BrowserNotSupported","TooManyFiles","FileTooLarge","FileTypeNotAllowed","NotFound","NotReadable","AbortError","ReadError"],a=!1,r=0;e.fn.filedrop=function(t){function l(e){return T.drop.call(this,e)===!1?!1:(n=e.dataTransfer.files,null===n||void 0===n||0===n.length?(T.error(s[0]),!1):(r=n.length,h(),e.preventDefault(),!1))}function d(t,i,n,o){var s="--",a="\r\n",r="";if(T.data){var l=e.param(T.data).replace(/\+/g,"%20").split(/&/);e.each(l,function(){var e=this.split("=",2),t=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+t+'"',r+=a,r+=a,r+=i,r+=a})}return r+=s,r+=o,r+=a,r+='Content-Disposition: form-data; name="'+T.paramname+'"',r+='; filename="'+t+'"',r+=a,r+="Content-Type: "+n,r+=a,r+=a,r+=i,r+=a,r+=s,r+=o,r+=s,r+=a}function c(e){if(e.lengthComputable){var t=Math.round(100*e.loaded/e.total);if(this.currentProgress!==t){this.currentProgress=t,T.progressUpdated(this.index,this.file,this.currentProgress),S[this.global_progress_index]=this.currentProgress,u();var i=(new Date).getTime(),n=i-this.currentStart;if(n>=T.refresh){var o=e.loaded-this.startData,s=o/n;T.speedUpdated(this.index,this.file,s),this.startData=e.loaded,this.currentStart=i}}}}function u(){if(0!==S.length){var e,t=0;for(e in S)S.hasOwnProperty(e)&&(t+=S[e]);T.globalProgressUpdated(Math.round(t/S.length))}}function h(){if(a=!1,!n)return T.error(s[0]),!1;if(T.allowedfiletypes.push&&T.allowedfiletypes.length)for(var t=n.length;t--;)if(!n[t].type||e.inArray(n[t].type,T.allowedfiletypes)<0)return T.error(s[3],n[t]),!1;var i=0,o=0;if(r>T.maxfiles&&0===T.queuefiles)return T.error(s[1]),!1;for(var l=[],h=[],b=[],v=0;r>v;v++)l.push(v);var _=function(e){setTimeout(w,e)},w=function(){var e;if(a)return!1;if(T.queuefiles>0&&h.length>=T.queuefiles)return _(T.queuewait);e=l[0],l.splice(0,1),h.push(e);try{if(m(n[e])!==!1){if(e===r)return;var t=new FileReader,i=1048576*T.maxfilesize;if(t.index=e,n[e].size>i)return T.error(s[2],n[e],e),h.forEach(function(t,i){t===e&&h.splice(i,1)}),o++,!0;t.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return T.error(s[4]),!1;case e.target.error.NOT_READABLE_ERR:return T.error(s[5]),!1;case e.target.error.ABORT_ERR:return T.error(s[6]),!1;default:return T.error(s[7]),!1}},t.onloadend=T.beforeSend?function(t){T.beforeSend(n[e],e,function(){y(t)})}:y,t.readAsBinaryString(n[e])}else o++}catch(d){return h.forEach(function(t,i){t===e&&h.splice(i,1)}),T.error(s[0]),!1}l.length>0&&w()},y=function(t){var s=("undefined"==typeof t.srcElement?t.target:t.srcElement).index;void 0===t.target.index&&(t.target.index=p(t.total));var l,m=new XMLHttpRequest,v=m.upload,_=n[t.target.index],w=t.target.index,y=(new Date).getTime(),x="------multipartformboundary"+(new Date).getTime(),k=S.length,$=f(_.name),I=_.type;T.withCredentials&&(m.withCredentials=T.withCredentials),l="string"==typeof $?d($,t.target.result,I,x):d(_.name,t.target.result,I,x),v.index=w,v.file=_,v.downloadStartTime=y,v.currentStart=y,v.currentProgress=0,v.global_progress_index=k,v.startData=0,v.addEventListener("progress",c,!1),jQuery.isFunction(T.url)?m.open("POST",T.url(),!0):m.open("POST",T.url,!0),m.setRequestHeader("content-type","multipart/form-data; boundary="+x),e.each(T.headers,function(e,t){m.setRequestHeader(e,t)}),m.sendAsBinary(l),S[k]=0,u(),T.uploadStarted(w,_,r),m.onload=function(){var e=null;if(m.responseText)try{e=jQuery.parseJSON(m.responseText)}catch(t){e=m.responseText}var n=(new Date).getTime(),l=n-y,d=T.uploadFinished(w,_,e,l,m);i++,h.forEach(function(e,t){e===s&&h.splice(t,1)}),b.push(s),S[k]=100,u(),i===r-o&&g(),d===!1&&(a=!0),(m.status<200||m.status>299)&&T.error(m.statusText,_,s,m.status)}};w()}function p(e){for(var t=0;r>t;t++)if(n[t].size===e)return t;return void 0}function f(e){return T.rename(e)}function m(e){return T.beforeEach(e)}function g(){return T.afterAll()}function b(e){clearTimeout(i),e.preventDefault(),T.dragEnter.call(this,e)}function v(e){clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),T.dragOver.call(this,e)}function _(e){clearTimeout(i),T.dragLeave.call(this,e),e.stopPropagation()}function w(e){return e.preventDefault(),T.docLeave.call(this,e),!1}function y(e){return clearTimeout(i),e.preventDefault(),T.docEnter.call(this,e),!1}function x(e){return clearTimeout(i),e.preventDefault(),T.docOver.call(this,e),!1}function k(e){i=setTimeout(function(t){return function(){T.docLeave.call(t,e)}}(this),200)}var T=e.extend({},o,t),S=[];return this.on("drop",l).on("dragstart",T.dragStart).on("dragenter",b).on("dragover",v).on("dragleave",_),e(document).on("drop",w).on("dragenter",y).on("dragover",x).on("dragleave",k),e("#"+T.fallback_id).change(function(e){T.drop(e),n=e.target.files,r=n.length,h()}),this};try{if(XMLHttpRequest.prototype.sendAsBinary)return;XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var i=Array.prototype.map.call(e,t),n=new Uint8Array(i);this.send(n.buffer)}}catch(l){}}(jQuery),define("views/../../dev/vendors/jquery-filedrop/jquery.filedrop",function(){}),define("text!templates/uploadNew.html",[],function(){return'
              \n
              \n
              \n
              \n
              \n \n
              \n

              <%- $.i18n.__(\'upload_new_title\') %>

              \n

              \n <%- $.i18n.__(\'upload_info\', {size: upload_size}) %>\n

              \n
              \n \n\n\n' -}),define("text!templates/spinner.html",[],function(){return'
              \n
              \n
              \n
              \n
              \n
              \n
              '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
              \n
              \n
              \n
              \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
              \n
              \n
              \n \n \n \n\n \n \n
              \n
              \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject","input .js-subject":"_updateSubjectCharCount"},initialize:function(e){t.defaults(e,{ajax:!0,parentThreadline:!1}),this.options=e,this.options.ajax===!1&&(this._setupTextArea(),this._onFormReady()),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();e.preventDefault(),this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_updateSubjectCharCount:function(){var e,t,i,o;t=this.$(".postingform-subject-count"),i=n.settings.get("subject_maxlength"),o=this.$(".js-subject").val(),e=i-o.length,t.html(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){var e,t;this._setupTextArea(),this._updateSubjectCharCount(),e=this.$(".js-data"),e.length>0&&"edit"===e.data("meta").action&&(t=this.$(".js-data").data("entry"),this.model.set(t,{silent:!0}),this._addCountdown()),n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n,o=this.$(".btn-submit")[0];i.preventDefault(),"object"==typeof o.validity&&o.form.checkValidity()===!1?(n=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(o).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this),n(),this.sendInProgress=!1):(o.disabled=!0,o.form.submit())},_sendInline:function(i){var o,s,a,r;i.preventDefault(),o=this.$("#EntryAddForm").serialize(),r=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.parentThreadline&&this.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),s=t.bind(this._disable,this),e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:s}).done(r).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){"use strict";var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
                ').parent().wrap("
              • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
                \n <%- $.i18n.__('ncy.bkm') %>\n
                \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) +}),define("text!templates/spinner.html",[],function(){return'
                \n
                \n
                \n
                \n
                \n
                \n
                '}),define("views/uploadNew",["jquery","underscore","backbone","../../dev/vendors/jquery-filedrop/jquery.filedrop","models/app","text!templates/uploadNew.html","text!templates/spinner.html","humanize"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.View.extend({className:"panel upload_box upload-new",wasChild:"unset",events:{"change #Upload0File":"_uploadManual"},initialize:function(e){this.uploadUrl=o.settings.get("webroot")+"uploads/add",this.collection=e.collection},_initDropUploader:function(){this._browserSupportsDragAndDrop()&&window.FileReader?this.$(".upload-layer").filedrop({maxfiles:1,maxfilesize:o.settings.get("upload_max_img_size")/1024,url:this.uploadUrl,paramname:"data[Upload][0][file]",allowedfiletypes:["image/jpeg","image/jpg","image/png","image/gif"],dragOver:t.bind(function(){this._showDragIndicator()},this),dragLeave:t.bind(function(){this._hideDragIndicator()},this),uploadFinished:t.bind(function(e,t,i){this._postUpload(i)},this),beforeSend:t.bind(function(e,t,i){this._hideDragIndicator(),this._setUploadSpinner(),i()},this),error:t.bind(function(t,i){var n;switch(this._hideDragIndicator(),t){case"FileTypeNotAllowed":n=e.i18n.__("upload_fileTypeNotAllowed");break;case"FileTooLarge":n=e.i18n.__("upload_fileToLarge",{name:i.name});break;case"BrowserNotSupported":n=e.i18n.__("upload_browserNotSupported");break;case"TooManyFiles":n=e.i18n.__("upload_toManyFiles");break;default:n=t}o.eventBus.trigger("notification",{title:"Error",message:n,type:"error"})},this)}):this.$("h2").html(e.i18n.__("Upload"))},_browserSupportsDragAndDrop:function(){var e=this.$(".upload-layer")[0];return"draggable"in e||"ondragstart"in e&&"ondrop"in e},_showDragIndicator:function(){this.$(".upload-drag-indicator").fadeIn()},_hideDragIndicator:function(){this.$(".upload-drag-indicator").fadeOut()},_setUploadSpinner:function(){this.$(".upload_box_header").html(a)},_uploadManual:function(e){var t,i,n=!0;e.preventDefault();try{t=new FormData,i=this.$("#Upload0File")[0],t.append(i.name,i.files[0])}catch(o){n=!1}this._setUploadSpinner(),n?this._uploadAjax(t):this._uploadIFrame()},_uploadIFrame:function(){var e=this.$("form"),i=this.$("#uploadIFrame");i.load(t.bind(function(){this._postUpload(i.contents().find("body").html()),i.off("load")},this)),e.submit()},_uploadAjax:function(e){var i=new XMLHttpRequest;i.open("POST",this.uploadUrl),i.onloadend=t.bind(function(e){this._postUpload(e.target.response)},this),i.onerror=this._onUploadError,i.send(e)},_onUploadError:function(){o.eventBus.trigger("notification",{type:"error",message:e.i18n.__("upload_genericError")})},_postUpload:function(e){if(t.isString(e))try{e=JSON.parse(e)}catch(i){this._onUploadError()}o.eventBus.trigger("notification",e),this.collection.fetch({reset:!0}),this.render()},render:function(){return this.$el.html(t.template(s)({url:this.uploadUrl,upload_size:r.filesize(o.settings.get("upload_max_img_size"))})),this._initDropUploader(),this}});return l}),define("text!templates/uploads.html",[],function(){return'
                \n
                \n
                \n
                \n'}),define("views/uploads",["jquery","underscore","backbone","models/app","collections/uploads","views/upload","views/uploadNew","text!templates/uploads.html"],function(e,t,i,n,o,s,a,r){var l=i.View.extend({events:{"click .current .btn-submit":"_closeDialog"},initialize:function(e){this.textarea=e.textarea,this.collection=new o({url:n.settings.get("webroot")}),this.listenTo(this.collection,"reset",this._addAll),this.$(".body").html(t.template(r)),this.uploadNewView=new a({collection:this.collection}),this.$(".content").append(this.uploadNewView.el),this.render(),this.collection.fetch({reset:!0})},_addOne:function(e){var t=new s({model:e,textarea:this.textarea});this.$(".upload-new").after(t.render().el)},_addAll:function(){this._removeAll(),this.collection.each(this._addOne,this)},_removeAll:function(){this.$(".upload_box.current").remove()},_setDialogSize:function(){this.$el.dialog("option","width",window.innerWidth-80),this.$el.dialog("option","height",window.innerHeight-80)},_closeDialog:function(){this.$el.dialog("close")},render:function(){return this.uploadNewView.render(),this.$el.dialog({title:e.i18n.__("Upload"),modal:!0,draggable:!1,resizable:!1,position:[40,40],hide:"fade"}),this._setDialogSize(),e(window).resize(t.bind(function(){this._setDialogSize()},this)),window.onorientationchange=t.bind(function(){this._setDialogSize()},this),this}});return l}),define("lib/saito/markItUp.media",["jquery","underscore"],function(e,t){"use strict";var i={_preFilters:{dropbox:{cleanUp:function(e){return e.replace(/https:\/\/www\.dropbox\.com\//,"https://dl.dropbox.com/")}},youtube:{cleanUp:function(e){var t,i,n,o=e;if(/http/.test(e)===!1&&(o="http://"+e),i=/(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i,!i.test(o))return e;switch(t=o.match(/(https?:\/\/)?(www\.)?(.[^\/:]+)/i).pop()){case"youtu.be":i=/youtu.be\/(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1]);break;case"youtube.com":i=/v=(.*?)(&.*)?$/,i.test(o)&&(n=o.match(i)[1])}return void 0!==n&&(e=this._createIframe({src:"//www.youtube.com/embed/"+n})),e},_createIframe:function(e){var i,n,o;return i={width:560,height:315,frameborder:0,allowfullscreen:"allowfullscreen"},t.defaults(e,i),o=function(e,t,i){return e+i+'="'+t+'" '},n=t.reduce(e,o,""),n=n.trim(),""}}},multimedia:function(n,o){var s=e.trim(n),a="([\\/?]|$)",r=new RegExp("\\.(png|gif|jpg|jpeg|webp)"+a,"i"),l=new RegExp("\\.(mp4|webm|m4v)"+a,"i"),d=new RegExp("\\.(m4a|ogg|mp3|wav|opus)"+a,"i"),c=/.*?<\/iframe>/i.exec(e)[1];return t=t.replace(/["']/g,""),"[iframe"+t+"][/iframe]"},_embedly:function(e){return"[embed]"+e+"[/embed]"}};return i}),define("text!templates/mediaInsert.html",[],function(){return'
                \n
                \n
                \n \n \n \n\n \n \n
                \n
                \n'}),define("views/mediaInsert",["jquery","underscore","backbone","models/app","lib/saito/markItUp.media","text!templates/mediaInsert.html"],function(e,t,i,n,o,s){"use strict";return i.View.extend({template:t.template(s),events:{"click #markitup_media_btn":"_insert"},initialize:function(){void 0!==this.model&&null!==this.model&&this.listenTo(this.model,"change:isAnsweringFormShown",this.remove)},_insert:function(t){var i,s;t.preventDefault(),s=o,i=s.multimedia(this.$("#markitup_media_txta").val(),{embedlyEnabled:n.settings.get("embedly_enabled")===!0}),""===i?this._invalidInput():(e.markItUp({replaceWith:i}),this._closeDialog())},_hideErrorMessages:function(){this.$("#markitup_media_message").hide()},_invalidInput:function(){this.$("#markitup_media_message").show(),this.$el.dialog().parent().effect("shake",{times:2},250)},_closeDialog:function(){this.$el.dialog("close"),this._hideErrorMessages(),this.$("#markitup_media_txta").val("")},_showDialog:function(){this.$el.dialog({show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},title:e.i18n.__("Multimedia"),minWidth:346,position:{at:"left+50% top+40%"},resizable:!1,open:function(){setTimeout(function(){e("#markitup_media_txta").focus()},210)},close:t.bind(function(){this._hideErrorMessages()},this)})},render:function(){return this.$el.html(this.template),this._showDialog(),this}})}),define("models/preview",["underscore","backbone","models/app"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isFetchingData:!1,rendered:null,data:null},initialize:function(){this.webroot=i.settings.get("webroot"),this.listenTo(this,"change:data",this._fetchRendered)},_fetchRendered:function(){this.set("fetchingData",!0),$.post(this.webroot+"entries/preview/",this.get("data"),e.bind(function(e){this.set("fetchingData",!1),this.set("rendered",e.html),i.eventBus.trigger("notificationUnset","all"),i.eventBus.trigger("notification",e)},this),"json")}});return n}),define("views/preview",["jquery","underscore","marionette","text!templates/spinner.html"],function(e,t,i,n){"use strict";var o=i.ItemView.extend({templates:{content:t.template("<%= rendered %>"),spinner:t.template(n)},modelEvents:{"change:fetchingData":"_fetchingData","change:rendered":"render"},_fetchingData:function(){this.model.get("fetchingData")&&this.render()},getTemplate:function(){return this.model.get("fetchingData")?this.templates.spinner:this.templates.content}});return o}),function(e){"use strict";var t={_scrollToTop:function(t){e("body").animate({scrollTop:t.offset().top-10,easing:"swing"},300)},_scrollToBottom:function(i){e("body").animate({scrollTop:t._elementBottom(i)-e(window).height()+20,easing:"swing"},300,function(){t._isHeigherThanView(i)&&t._scrollToTop(i)})},_elementBottom:function(e){return e.offset().top+e.height()},_isScrolledIntoView:function(i){if(0===e(i).length)return!0;var n=e(window).scrollTop(),o=n+e(window).height(),s=e(i).offset().top,a=t._elementBottom(i);return o>=a&&s>=n},_isHeigherThanView:function(t){return e(window).height()<=t.height()}},i={top:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToTop(i),this},bottom:function(){var i;return i=e(this),t._isScrolledIntoView(i)||t._scrollToBottom(i),this},isInView:function(){var i;return i=e(this),t._isScrolledIntoView(i)}};e.fn.scrollIntoView=function(t){return i[t]?i[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.scrollIntoView"):i.init.apply(this,arguments)}}(jQuery),define("lib/saito/jquery.scrollIntoView",function(){}),define("views/answering",["jquery","underscore","backbone","models/app","views/uploads","views/mediaInsert","views/editCountdown","models/preview","views/preview","lib/saito/jquery.scrollIntoView","jqueryAutosize"],function(e,t,i,n,o,s,a,r,l){"use strict";var d=i.View.extend({_requestUrl:null,rendered:!1,answeringForm:!1,preview:!1,mediaView:!1,sendInProgress:!1,_action:null,model:null,events:{"click .btn-previewClose":"_closePreview","click .btn-preview":"_showPreview","click .btn-markItUp-Upload":"_upload","click .btn-markItUp-Media":"_media","click .btn-submit":"_send","click .btn-cite":"_cite","keypress .js-subject":"_onKeyPressSubject","input .js-subject":"_updateSubjectCharCount"},initialize:function(e){t.defaults(e,{ajax:!0,parentThreadline:null}),this.options=e,this.options.ajax===!1&&(this._setupTextArea(),this._onFormReady()),this._requestUrl=n.settings.get("webroot")+"entries/add/"+this.model.get("id"),this.listenTo(n.eventBus,"isAppVisible",this._focusSubject)},_disable:function(){this.$(".btn.btn-submit").attr("disabled","disabled")},_enable:function(){this.$(".btn.btn-submit").removeAttr("disabled")},_cite:function(e){var t=this.$(".cite-container"),i=this.$(".btn-cite").data("text"),n=this.$textarea.val();e.preventDefault(),this.$textarea.val(i+"\n\n"+n),t.slideToggle(),this.$textarea.trigger("autosize.resize"),this.$textarea.focus()},_onKeyPressSubject:function(e){13===e.keyCode&&this._send(e)},_updateSubjectCharCount:function(){var e,t,i,o;t=this.$(".postingform-subject-count"),i=n.settings.get("subject_maxlength"),o=this.$(".js-subject").val(),e=i-o.length,t.html(e)},_upload:function(e){var t;e&&e.preventDefault(),t=new o({el:"#markitup_upload",textarea:this.$textarea[0]})},_media:function(e){e.preventDefault(),this.mediaView===!1&&(this.mediaView=new s({el:"#markitup_media",model:this.model})),this.mediaView.render()},_showPreview:function(e){var t;e.preventDefault(),this.$(".preview").slideDown("fast"),this.preview===!1&&(t=new r,this.preview=new l({el:this.$(".preview .panel-content"),model:t})),this.preview.model.set("data",this.$("form").serialize())},_closePreview:function(e){e.preventDefault(),this.$(".preview").slideUp("fast")},_setupTextArea:function(){this.$textarea=this.$("textarea#EntryText"),this.$textarea.autosize()},_requestAnsweringForm:function(){e.ajax({cache:!0,url:this._requestUrl,success:t.bind(function(e){this.answeringForm=e,this.render()},this)})},_postRendering:function(){this.$el.scrollIntoView("bottom"),this._focusSubject(),this._onFormReady()},_onFormReady:function(){var e,t;this._setupTextArea(),this._updateSubjectCharCount(),e=this.$(".js-data"),e.length>0&&"edit"===e.data("meta").action&&(t=this.$(".js-data").data("entry"),this.model.set(t,{silent:!0}),this._addCountdown()),n.eventBus.trigger("change:DOM")},_addCountdown:function(){{var e=this.$(".js-btn-submit");new a({el:e,model:this.model,editPeriod:n.settings.get("editPeriod"),done:"disable"})}},_focusSubject:function(){var e=window.navigator.userAgent.match("iPad|iPhone");e||this.$(".postingform input[type=text]:first").focus()},_send:function(e){return this.sendInProgress?void e.preventDefault():(this.sendInProgress=!0,void(this.parentThreadline?this._sendInline(e):this._sendRedirect(e)))},_sendRedirect:function(i){var n,o=this.$(".btn-submit")[0];i.preventDefault(),"object"==typeof o.validity&&o.form.checkValidity()===!1?(n=t.bind(function(){this.checkValidityDummy||(this.checkValidityDummy=e("",{type:"submit",style:"display: none;"}),e(o).after(this.checkValidityDummy)),this.checkValidityDummy.click()},this),n(),this.sendInProgress=!1):(o.disabled=!0,o.form.submit())},_sendInline:function(i){var o,s,a,r;i.preventDefault(),o=this.$("#EntryAddForm").serialize(),r=t.bind(function(e){this.model.set({isAnsweringFormShown:!1}),null!==this.options.parentThreadline&&this.options.parentThreadline.set("isInlineOpened",!1),n.eventBus.trigger("newEntry",{tid:e.tid,pid:this.model.get("id"),id:e.id,isNewToUser:!0})},this),a=t.bind(function(e,t){this.sendInProgress=!1,this._enable(),n.eventBus.trigger("notification",{title:t,type:"error",message:e.responseText})},this),s=t.bind(this._disable,this),e.ajax({url:this._requestUrl,type:"POST",dataType:"json",data:o,beforeSend:s}).done(r).fail(a)},render:function(){return this.answeringForm===!1?this._requestAnsweringForm():this.rendered===!1?(this.rendered=!0,this.$el.html(this.answeringForm),t.defer(function(e){e._postRendering()},this)):n.eventBus.trigger("change:DOM"),this}});return d}),define("views/postingSlider",["jquery","marionette","models/app","views/answering","text!templates/spinner.html"],function(e,t,i,n,o){"use strict";return t.ItemView.extend({answeringForm:!1,events:{"click .btn-answeringClose":"onBtnClose"},initialize:function(e){this.parentThreadline=e.parentThreadline||null,this.listenTo(this.model,"change:isAnsweringFormShown",this.toggleAnsweringForm)},onBtnClose:function(e){e.preventDefault(),this.model.set("isAnsweringFormShown",!1)},toggleAnsweringForm:function(){this.model.get("isAnsweringFormShown")?(this._hideAllAnsweringForms(),this._showAnsweringForm()):this._hideAnsweringForm()},_showAnsweringForm:function(){i.eventBus.trigger("breakAutoreload"),this.answeringForm===!1&&this.$el.html(o),this.$el.slideDown("fast"),this.answeringForm===!1&&(this.answeringForm=new n({el:this.$el,model:this.model,parentThreadline:this.parentThreadline})),this.answeringForm.render()},_hideAnsweringForm:function(){this.$el.slideUp("fast",function(){i.eventBus.trigger("change:DOM")})},_hideAllAnsweringForms:function(){this.collection.forEach(function(e){e.get("id")!==this.model.get("id")&&e.set("isAnsweringFormShown",!1)},this)}})}),define("views/postingLayout",["underscore","marionette","app/core","views/postingAction","views/postingContent","views/postingSlider","text!templates/spinner.html"],function(e,t,i,n,o,s,a){"use strict";var r=t.Layout.extend({initialize:function(t){e.defaults(t,{inline:!1,parentThreadline:!1}),t.inline?this._loadData(t):this._dataReady(t)},_loadData:function(t){this.$el.html(a),this.model.fetchHtml({success:e.bind(function(){this.$el.html(this.model.get("html")),this._dataReady(t)},this)})},_dataReady:function(e){var t=this.$(".js-data").data("entry");this.model.set(t,{silent:!0});new o({el:this.$(".postingBody"),model:this.model}),new n({el:this.$(".postingLayout-actions"),model:this.model}),new s({el:this.$(".postingLayout-slider"),model:this.model,collection:this.collection,parentThreadline:e.parentThreadline});i.vent.trigger("Vent.Posting.View.afterRender",{$el:this.$el})}});return r}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("lib/saito/backbone.modelHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){"use strict";t.Model.prototype.toggle=function(e){this.set(e,!this.get(e))}}),define("models/posting",["underscore","backbone","models/app","lib/saito/backbone.modelHelper"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isBookmarked:!1,isSolves:!1,isAnsweringFormShown:!1,html:""},initialize:function(){this.listenTo(this,"change:isSolves",this.syncSolved),this.listenTo(this,"change:isBookmarked",this.syncBookmarked)},isRoot:function(){var t=this.get("pid");if(!e.isNumber(t))throw"pid is not a number.";return 0===t},syncBookmarked:function(){this.get("isBookmarked")&&$.ajax({url:i.settings.get("webroot")+"bookmarks/add",type:"POST",dataType:"json",data:"id="+this.get("id")})},syncSolved:function(){$.ajax({url:i.settings.get("webroot")+"entries/solve/"+this.get("id"),type:"POST",dateType:"json"})},fetchHtml:function(t){$.ajax({success:e.bind(function(e){this.set("html",e),t&&t.success&&t.success()},this),type:"POST",dateType:"html",url:i.settings.get("webroot")+"entries/view/"+this.get("id")})}});return n}),define("views/threadlines",["jquery","underscore","marionette","models/app","models/threadline","text!templates/threadline-spinner.html","views/postingLayout","models/posting","lib/saito/jquery.scrollIntoView"],function(e,t,i,n,o,s,a,r){"use strict";var l=i.ItemView.extend({className:"threadLeaf",tagName:"li",spinnerTpl:s,postings:null,ui:{btnShowThread:".btn_show_thread",linkShowThread:".link_show_thread"},events:{"click @ui.btnShowThread":"toggleInlineOpen","click @ui.linkShowThread":"toggleInlineOpenFromLink"},initialize:function(e){this.postings=e.postings,this.model=new o({id:e.leafData.id,isNewToUser:e.leafData.isNewToUser}),void 0===e.el?this.model.fetch():this.model.set({html:this.el}),this.collection.add(this.model,{silent:!0}),this.attributes={"data-id":e.id},this.listenTo(this.model,"change:isInlineOpened",this._toggleInlineOpened),this.listenTo(this.model,"change:html",this.render)},toggleInlineOpenFromLink:function(e){this.model.get("isAlwaysShownInline")&&this.toggleInlineOpen(e)},toggleInlineOpen:function(e){e.preventDefault(),this.model.toggle("isInlineOpened")},_toggleInlineOpened:function(e,i){return i?(this.model.get("isContentLoaded")||(this.$(".threadLine").after(this.spinnerTpl),this.$(".js-btn-strip").on("click",t.bind(this.toggleInlineOpen,this)),this._insertContent(),this.model.set("isContentLoaded",!0)),void this._showInlineView()):void this._closeInlineView()},_insertContent:function(){var e,t;e=this.model.get("id"),this.postingModel=new r({id:e}),this.postings.add(this.postingModel),t=new a({el:this.$(".threadInline-slider"),inline:!0,model:this.postingModel,collection:this.postings,parentThreadline:this.model})},_showInlineView:function(){var e=t.bind(function(){var e=this.model.get("shouldScrollOnInlineOpen");e?this.$el.scrollIntoView("isInView")===!1&&this.$el.scrollIntoView("bottom"):this.model.set("shouldScrollOnInlineOpen",!0)},this);this.$(".threadLine").fadeOut(100,t.bind(function(){this.$(".js-thread_inline").show(0,e)},this))},_closeInlineView:function(){n.eventBus.trigger("change:DOM"),this.$(".js-thread_inline").hide(0,t.bind(function(){this.$el.find(".threadLine").slideDown(),this._scrollLineIntoView()},this))},_scrollLineIntoView:function(){var e=this.$(".threadLine");e.scrollIntoView("isInView")||e.scrollIntoView("top").effect("highlight",{times:1},3e3)},render:function(){var t,i,n;return i=this.model.get("html"),i.length>0&&(t=this.$el,n=e(this.model.get("html")),this.setElement(n),t.replaceWith(n)),this}});return l}),define("models/thread",["underscore","backbone","collections/threadlines"],function(e,t,i){"use strict";var n=t.Model.extend({defaults:{isThreadCollapsed:!1},initialize:function(){this.threadlines=new i}});return n}),define("collections/threads",["underscore","backbone","models/thread","models/app","backboneLocalStorage","lib/saito/localStorageHelper"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:i,localStorage:function(){var e=n.reqres.request("app:localStorage:key","Threads");return new t.LocalStorage(e)}(),fetch:function(e){return n.reqres.request("app:localStorage:available")?t.Model.prototype.fetch.call(this,e):void 0}});return o}),define("views/thread",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines"],function(e,t,i,n,o,s){"use strict";var a=i.View.extend({className:"threadBox",events:{"click .btn-threadCollapse":"collapseThread","click .js-btn-openAllThreadlines":"openAllThreadlines","click .js-btn-closeAllThreadlines":"closeAllThreadlines","click .js-btn-showAllNewThreadlines":"showAllNewThreadlines"},initialize:function(t){this.postings=t.postings,this.$rootUl=this.$("ul.root"),this.$subThreadRootIl=e(this.$rootUl.find("li:not(:first-child)")[0]),this.model.get("isThreadCollapsed")?this.hide():this.show(),n.reqres.request("app:localStorage:available")||this._hideCollapseButton(),this.listenTo(n.eventBus,"newEntry",this._showNewThreadLine),this.listenTo(this.model,"change:isThreadCollapsed",this.toggleCollapseThread)},_showNewThreadLine:function(e){var t;e.tid===this.model.get("id")&&(t=new s({leafData:e,collection:this.model.threadlines,postings:this.postings}),this._appendThreadlineToThread(e.pid,t.render().$el))},_appendThreadlineToThread:function(e,t){var i,n;i=this.$('.threadLeaf[data-id="'+e+'"]'),n=i.next().not(".js_threadline").find("ul:first"),0===n.length?t.wrap('
                  ').parent().wrap("
                • ").parent().insertAfter(i):n.append(t)},openAllThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},closeAllThreadlines:function(e){e&&e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!0}),function(e){e.set({isInlineOpened:!1})},this)},showAllNewThreadlines:function(e){e.preventDefault(),t.each(this.model.threadlines.where({isInlineOpened:!1,isNewToUser:!0}),function(e){e.set({isInlineOpened:!0,shouldScrollOnInlineOpen:!1})},this)},_hideCollapseButton:function(){this.$(".btn-threadCollapse").css("visibility","hidden")},collapseThread:function(e){e.preventDefault(),this.closeAllThreadlines(),this.model.toggle("isThreadCollapsed"),this.model.save()},toggleCollapseThread:function(e,t){t?this.slideUp():this.slideDown()},slideUp:function(){this.$subThreadRootIl.slideUp(300),this.markHidden()},slideDown:function(){this.$subThreadRootIl.slideDown(300),this.markShown()},hide:function(){this.$subThreadRootIl.hide(),this.markHidden()},show:function(){this.$subThreadRootIl.show(),this.markShown()},markShown:function(){e(this.el).find(".fa-thread-closed").removeClass("fa-thread-closed").addClass("fa-thread-open")},markHidden:function(){e(this.el).find(".fa-thread-open").removeClass("fa-thread-open").addClass("fa-thread-closed")}});return a}),define("collections/postings",["underscore","backbone","models/posting"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("models/bookmark",["underscore","backbone","models/app","cakeRest"],function(e,t,i,n){"use strict";var o=t.Model.extend({initialize:function(){this.webroot=i.settings.get("webroot")+"bookmarks/"}});return e.extend(o.prototype,n),o}),define("collections/bookmarks",["underscore","backbone","models/bookmark"],function(e,t,i){var n=t.Collection.extend({model:i});return n}),define("views/bookmark",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .btn-bookmark-delete":"deleteBookmark"},initialize:function(){t.bindAll(this,"render"),this.model.on("destroy",this.removeBookmark,this)},deleteBookmark:function(e){e.preventDefault(),this.model.destroy()},removeBookmark:function(){var t=this.collection;this.$el.hide("slide",null,500,function(){e(this).remove(),t.trigger("bookmark.removed")})}});return n}),define("text!templates/no-content-yet.html",[],function(){return"
                  \n <%- $.i18n.__('ncy.bkm') %>\n
                  \n"}),define("views/bookmarks",["jquery","underscore","backbone","views/bookmark","text!templates/no-content-yet.html"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.initCollectionFromDom(".js-bookmark",this.collection,n),this._fillNoContentYet(),this.listenTo(this.collection,"bookmark.removed",this._fillNoContentYet)},_fillNoContentYet:function(){this.collection.isEmpty()&&this.$el.html(t.template(o))}});return s}),define("views/helps",["jquery","underscore","backbone","models/app","drop"],function(e,t,i,n,o){"use strict";var s=i.View.extend({isHelpShown:!1,_popups:[],_elements:null,tpl:t.template(''),events:function(){var e={};return e["click "+this.indicatorName]="toggle",e},initialize:function(e){this.indicatorName=e.indicatorName,this.elementName=e.elementName,this.webroot=e.webroot,this.activateHelpButton(),this.listenTo(n.eventBus,"change:DOM",this._onDomChange)},activateHelpButton:function(){var t=e(this.indicatorName);t&&(this._isHelpOnPage()?t.addClass("is-active"):t.removeClass("is-active"))},_onDomChange:function(){this.activateHelpButton(),this._reset()},_isHelpOnPage:function(){return this._getElements().length>0},toggle:function(e){e.preventDefault(),this.isHelpShown?this._hide():this._show()},_reset:function(){this._hide(),this._elements=null,this._popups=[]},_getElements:function(){return null===this._elements&&(this._elements=this.$(this.elementName).filter(":visible")),this._elements},_show:function(){if(this.isHelpShown=!0,this._isHelpOnPage()){if(0===this._popups.length){var t=this;this._getElements().each(function(){var i=e(this),n=i.data("shpid"),s=t.tpl({id:n,webroot:t.webroot});t._popups.push(new o({target:this,content:s,classes:"drop-theme-arrows",position:"top center"}))})}this._popups.forEach(function(e){e.open()})}},_hide:function(){this.isHelpShown=!1,this._popups.forEach(function(e){e.close()})}});return s}),define("views/categoryChooser",["jquery","underscore","backbone"],function(e,t,i){"use strict";return i.View.extend({initialize:function(){this._initDialog()},_initDialog:function(){this.$el.dialog({autoOpen:!1,show:{effect:"scale",duration:200},hide:{effect:"fade",duration:200},width:400,title:e.i18n.__("Categories"),resizable:!1})},_updateDialogPosition:function(){var t=e("#btn-category-chooser"),i=e(window),n=t.offset().left+t.width()-i.scrollLeft()-410,o=t.offset().top-i.scrollTop()+t.height();this.$el.dialog({position:[n,o]})},toggle:function(){this.$el.dialog("isOpen")?this.$el.dialog("close"):(this._updateDialogPosition(),this.$el.dialog("open"))}})}),define("models/slidetab",["jquery","underscore","backbone","app/vent","models/app"],function(e,t,i,n,o){"use strict";var s=i.Model.extend({defaults:{isOpen:!1},initialize:function(){this.webroot=o.settings.get("webroot"),this.listenTo(this,"change:isOpen",this.onChangeIsOpen)},onChangeIsOpen:function(){n.vent.trigger("slidetab:open",{slidetab:this.get("id"),open:this.get("isOpen")})},sync:function(){var t="show_"+this.get("id");e.post(this.webroot+"users/slidetab_toggle",{slidetabKey:t})}});return s}),define("collections/slidetabs",["underscore","backbone","models/app","models/slidetab"],function(e,t,i,n){"use strict";var o=t.Collection.extend({model:n,initialize:function(){i.reqres.setHandler("slidetab:open",e.bind(this.isOpen,this))},isOpen:function(e){return this.get(e).get("isOpen")}});return o}),define("views/slidetab",["jquery","underscore","backbone"],function(e,t,i){"use strict";var n=i.View.extend({events:{"click .slidetab-tab":"clickSlidetab"},initialize:function(){this.model.set({isOpen:this.isOpen()},{silent:!0}),this.listenTo(this.model,"change",this.toggleSlidetab)},isOpen:function(){return this.$el.find(".slidetab-outer").is(":visible")},clickSlidetab:function(){this.model.save("isOpen",!this.model.get("isOpen"))},toggleSlidetab:function(){this.model.get("isOpen")?this.show():this.hide(),this.toggleSlidetabTabInfo()},show:function(){this.$el.animate({width:280}),this.$el.addClass("is-open")},hide:function(){this.$el.animate({width:28},t.bind(function(){this.$el.removeClass("is-open")},this))},toggleSlidetabTabInfo:function(){this.$el.find(".slidetab-tab-info").toggle()}});return n}),define("views/slidetabs",["jquery","underscore","backbone","models/app","views/slidetab"],function(e,t,i,n,o){"use strict";var s=i.View.extend({initialize:function(){this.webroot=n.settings.get("webroot"),this.initCollectionFromDom(".slidetab",this.collection,o),this.makeSortable()},makeSortable:function(){var i=this.webroot;this.$el.sortable({handle:".slidetab-tab",start:t.bind(function(){this.$el.css("overflow","visible")},this),stop:t.bind(function(){this.$el.css("overflow","hidden")},this),update:function(){var t=e(this).sortable("toArray",{attribute:"data-id"});t=t.map(function(e){return"slidetab_"+e}),e.post(i+"users/slidetab_order",{slidetabOrder:t})}})}});return s}),define("views/app",["jquery","underscore","backbone","models/app","collections/threadlines","views/threadlines","collections/threads","views/thread","collections/postings","models/posting","views/postingLayout","collections/bookmarks","views/bookmarks","views/helps","views/categoryChooser","collections/slidetabs","views/slidetabs","views/answering","jqueryUi"],function(e,t,i,n,o,s,a,r,l,d,c,u,h,p,f,m,g,b){"use strict";var v=i.View.extend({el:e("body"),autoPageReloadTimer:!1,_domInitializers:{".entry.add-not-inline":"_initAnsweringNotInlined","#bookmarks":"_initBookmarks","#category-chooser":"_initCategoryChooser",".js-entry-view-core":"_initPostings","#slidetabs":"_initSlidetabs",".threadBox":"_initThreadBoxes",".threadLeaf":"_initThreadLeafs",".users.logout":"_initLogout"},events:{"click #showLoginForm":"showLoginForm","focus #header-searchField":"widenSearchField","click #btn-scrollToTop":"scrollToTop","click #btn-manuallyMarkAsRead":"manuallyMarkAsRead","click #btn-category-chooser":"toggleCategoryChooser","click #btn_header_logo":"_onEntriesIndexReload"},initialize:function(){this.threads=new a,"entries"===n.request.controller&&"index"===n.request.action&&this.threads.fetch(),this.postings=new l,this.threadLines=new o,this.listenTo(n.eventBus,"initAutoreload",this.initAutoreload),this.listenTo(n.eventBus,"breakAutoreload",this.breakAutoreload),this.$el.on("dialogopen",this.fixJqueryUiDialog) },initFromDom:function(i){if(t.each(this._domInitializers,function(t,i){var n=e(i);n.length>0&&this[t](n)},this),this.initAutoreload(),this.initHelp(".shp"),n.status.start(),this._showPage(i.SaitoApp.timeAppStart,i.contentTimer),n.eventBus.trigger("notification",i.SaitoApp),window.location.href.indexOf("/jump:")>-1){var o=/jump:(\d+)/.exec(window.location.href);this.scrollToThread(o[1]),window.history.replaceState("object or string","Title",window.location.pathname.replace(/jump:\d+(\/)?/,""))}},_initAnsweringNotInlined:function(e){this.answeringForm=new b({el:e,model:new d({id:"foo"}),ajax:!1})},_initBookmarks:function(e){var t,i=new u;t=new h({el:e,collection:i})},_initCategoryChooser:function(e){this.categoryChooser=new f({el:e})},_initLogout:function(){n.commands.execute("app:localStorage:clear")},_initPostings:function(i){t.each(i,function(t){var i,n,o;i=parseInt(t.getAttribute("data-id"),10),o=new d({id:i}),this.postings.add(o,{silent:!0}),n=new c({el:e(t),model:this.postings.get(i),collection:this.postings})},this)},_initSlidetabs:function(e){var t,i;t=new m,i=new g({el:e,collection:t})},_initThreadBoxes:function(i){t.each(i,function(t){var i,o;o=parseInt(e(t).attr("data-id"),10),this.threads.get(o)||this.threads.add([{id:o,isThreadCollapsed:"entries"===n.request.controller&&"index"===n.request.action&&n.currentUser.get("user_show_thread_collapsed")}],{silent:!0}),i=new r({el:e(t),postings:this.postings,model:this.threads.get(o)})},this)},_initThreadLeafs:function(i){t.each(i,function(t){var i=JSON.parse(t.getAttribute("data-leaf"));i.isNewToUser=i["new"],delete i["new"];var n,o=this.threads.get(i.tid);n=o?o.threadlines:this.threadLines;new s({el:e(t),leafData:i,postings:this.postings,collection:n})},this)},_showPage:function(t,i){var o=function(){n.eventBus.trigger("isAppVisible",!0)};n.request.isMobile||(new Date).getTime()-t>1500?(e("#content").css("visibility","visible"),o()):e("#content").css({visibility:"visible",opacity:0}).animate({opacity:1},{duration:150,easing:"easeInOutQuart",complete:o}),i.cancel()},fixJqueryUiDialog:function(){e(".ui-icon-closethick").attr("class","jqueryUi-closethick-fix").html("")},toggleCategoryChooser:function(e){e.preventDefault(),this.categoryChooser.toggle()},initHelp:function(e){new p({el:"body",elementName:e,indicatorName:"#shp-show",webroot:n.settings.get("webroot")})},scrollToThread:function(t){e(".threadBox[data-id="+t+"]")[0].scrollIntoView("top")},initAutoreload:function(){this.breakAutoreload(),n.settings.get("autoPageReload")&&(this.autoPageReloadTimer=setTimeout(t.bind(function(){window.location=n.settings.get("webroot")+"entries/"},this),1e3*n.settings.get("autoPageReload")))},breakAutoreload:function(){this.autoPageReloadTimer!==!1&&(clearTimeout(this.autoPageReloadTimer),this.autoPageReloadTimer=!1)},widenSearchField:function(t){var i=350;t.preventDefault(),e(t.currentTarget).width()",{"class":"ui-pnotify "+l.addclass,css:{display:"none"},mouseenter:function(e){l.nonblock&&e.stopPropagation(),l.mouse_reset&&"out"==r&&(f.stop(!0),r="in",f.css("height","auto").animate({width:l.width,opacity:l.nonblock?l.nonblock_opacity:l.opacity},"fast")),l.nonblock&&f.animate({opacity:l.nonblock_opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_cancel_remove(),l.sticker&&!l.nonblock&&f.sticker.trigger("pnotify_icon").css("visibility","visible"),l.closer&&!l.nonblock&&f.closer.css("visibility","visible")},mouseleave:function(t){l.nonblock&&t.stopPropagation(),c=null,f.css("cursor","auto"),l.nonblock&&"out"!=r&&f.animate({opacity:l.opacity},"fast"),l.hide&&l.mouse_reset&&f.pnotify_queue_remove(),l.sticker_hover&&f.sticker.css("visibility","hidden"),l.closer_hover&&f.closer.css("visibility","hidden"),e.pnotify_position_all()},mouseover:function(e){l.nonblock&&e.stopPropagation()},mouseout:function(e){l.nonblock&&e.stopPropagation()},mousemove:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onmousemove"))},mousedown:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmousedown"))},mouseup:function(e){l.nonblock&&(e.stopPropagation(),e.preventDefault(),h(e,"onmouseup"))},click:function(e){l.nonblock&&(e.stopPropagation(),h(e,"onclick"))},dblclick:function(e){l.nonblock&&(e.stopPropagation(),h(e,"ondblclick"))}});f.opts=l,f.container=e("
                  ",{"class":p.container+" ui-pnotify-container "+("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice)}).appendTo(f),""!=l.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow&&f.container.addClass("ui-pnotify-shadow"),f.pnotify_version="1.2.0",f.pnotify=function(t){var i=l;"string"==typeof t?l.text=t:l=e.extend({},l,t);for(var n in l)"string"==typeof n&&n.match(/^pnotify_/)&&(l[n.replace(/^pnotify_/,"")]=l[n]);return f.opts=l,l.cornerclass!=i.cornerclass&&f.container.removeClass("ui-corner-all").addClass(l.cornerclass),l.shadow!=i.shadow&&(l.shadow?f.container.addClass("ui-pnotify-shadow"):f.container.removeClass("ui-pnotify-shadow")),l.addclass===!1?f.removeClass(i.addclass):l.addclass!==i.addclass&&f.removeClass(i.addclass).addClass(l.addclass),l.title===!1?f.title_container.slideUp("fast"):l.title!==i.title&&(l.title_escape?f.title_container.text(l.title).slideDown(200):f.title_container.html(l.title).slideDown(200)),l.text===!1?f.text_container.slideUp("fast"):l.text!==i.text&&(l.text_escape?f.text_container.text(l.text).slideDown(200):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
                  "):l.text).slideDown(200)),f.pnotify_history=l.history,f.pnotify_hide=l.hide,l.type!=i.type&&f.container.removeClass(p.error+" "+p.notice+" "+p.success+" "+p.info).addClass("error"==l.type?p.error:"info"==l.type?p.info:"success"==l.type?p.success:p.notice),(l.icon!==i.icon||l.icon===!0&&l.type!=i.type)&&(f.container.find("div.ui-pnotify-icon").remove(),l.icon!==!1&&e("
                  ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container)),l.width!==i.width&&f.animate({width:l.width}),l.min_height!==i.min_height&&f.container.animate({minHeight:l.min_height}),l.opacity!==i.opacity&&f.fadeTo(l.animate_speed,l.opacity),!l.closer||l.nonblock?f.closer.css("display","none"):f.closer.css("display","block"),!l.sticker||l.nonblock?f.sticker.css("display","none"):f.sticker.css("display","block"),f.sticker.trigger("pnotify_icon"),l.sticker_hover?f.sticker.css("visibility","hidden"):l.nonblock||f.sticker.css("visibility","visible"),l.closer_hover?f.closer.css("visibility","hidden"):l.nonblock||f.closer.css("visibility","visible"),l.hide?i.hide||f.pnotify_queue_remove():f.pnotify_cancel_remove(),f.pnotify_queue_position(),f},f.pnotify_position=function(e){var t=f.opts.stack;if(t){t.nextpos1||(t.nextpos1=t.firstpos1),t.nextpos2||(t.nextpos2=t.firstpos2),t.addpos2||(t.addpos2=0);var i="none"==f.css("display");if(!i||e){var n,s,a,r={};switch(t.dir1){case"down":a="top";break;case"up":a="bottom";break;case"left":a="right";break;case"right":a="left"}n=parseInt(f.css(a)),isNaN(n)&&(n=0),"undefined"!=typeof t.firstpos1||i||(t.firstpos1=n,t.nextpos1=t.firstpos1);var l;switch(t.dir2){case"down":l="top";break;case"up":l="bottom";break;case"left":l="right";break;case"right":l="left"}if(s=parseInt(f.css(l)),isNaN(s)&&(s=0),"undefined"!=typeof t.firstpos2||i||(t.firstpos2=s,t.nextpos2=t.firstpos2),("down"==t.dir1&&t.nextpos1+f.height()>o.height()||"up"==t.dir1&&t.nextpos1+f.height()>o.height()||"left"==t.dir1&&t.nextpos1+f.width()>o.width()||"right"==t.dir1&&t.nextpos1+f.width()>o.width())&&(t.nextpos1=t.firstpos1,t.nextpos2+=t.addpos2+("undefined"==typeof t.spacing2?25:t.spacing2),t.addpos2=0),t.animation&&t.nextpos2t.addpos2&&(t.addpos2=f.height());break;case"left":case"right":f.outerWidth(!0)>t.addpos2&&(t.addpos2=f.width())}if(t.nextpos1)if(t.animation&&(n>t.nextpos1||r.top||r.bottom||r.right||r.left))switch(t.dir1){case"down":r.top=t.nextpos1+"px";break;case"up":r.bottom=t.nextpos1+"px";break;case"left":r.right=t.nextpos1+"px";break;case"right":r.left=t.nextpos1+"px"}else f.css(a,t.nextpos1+"px");switch((r.top||r.bottom||r.right||r.left)&&f.animate(r,{duration:500,queue:!1}),t.dir1){case"down":case"up":t.nextpos1+=f.height()+("undefined"==typeof t.spacing1?25:t.spacing1);break;case"left":case"right":t.nextpos1+=f.width()+("undefined"==typeof t.spacing1?25:t.spacing1)}}}},f.pnotify_queue_position=function(t){i&&clearTimeout(i),t||(t=10),i=setTimeout(e.pnotify_position_all,t)},f.pnotify_display=function(){f.parent().length||f.appendTo(n),l.before_open&&l.before_open(f)===!1||("top"!=l.stack.push&&f.pnotify_position(!0),"fade"==l.animation||"fade"==l.animation.effect_in?f.show().fadeTo(0,0).hide():1!=l.opacity&&f.show().fadeTo(0,l.opacity).hide(),f.animate_in(function(){l.after_open&&l.after_open(f),f.pnotify_queue_position(),l.hide&&f.pnotify_queue_remove()}))},f.pnotify_remove=function(){f.timer&&(window.clearTimeout(f.timer),f.timer=null),l.before_close&&l.before_close(f)===!1||f.animate_out(function(){l.after_close&&l.after_close(f)===!1||(f.pnotify_queue_position(),l.remove&&f.detach())})},f.animate_in=function(e){r="in";var t;t="undefined"!=typeof l.animation.effect_in?l.animation.effect_in:l.animation,"none"==t?(f.show(),e()):"show"==t?f.show(l.animate_speed,e):"fade"==t?f.show().fadeTo(l.animate_speed,l.opacity,e):"slide"==t?f.slideDown(l.animate_speed,e):"function"==typeof t?t("in",e,f):f.show(t,"object"==typeof l.animation.options_in?l.animation.options_in:{},l.animate_speed,e)},f.animate_out=function(e){r="out";var t;t="undefined"!=typeof l.animation.effect_out?l.animation.effect_out:l.animation,"none"==t?(f.hide(),e()):"show"==t?f.hide(l.animate_speed,e):"fade"==t?f.fadeOut(l.animate_speed,e):"slide"==t?f.slideUp(l.animate_speed,e):"function"==typeof t?t("out",e,f):f.hide(t,"object"==typeof l.animation.options_out?l.animation.options_out:{},l.animate_speed,e)},f.pnotify_cancel_remove=function(){f.timer&&window.clearTimeout(f.timer)},f.pnotify_queue_remove=function(){f.pnotify_cancel_remove(),f.timer=window.setTimeout(function(){f.pnotify_remove()},isNaN(l.delay)?0:l.delay)},f.closer=e("
                  ",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:l.closer_hover?"hidden":"visible"},click:function(){f.pnotify_remove(),f.sticker.css("visibility","hidden"),f.closer.css("visibility","hidden")}}).append(e("",{"class":p.closer})).appendTo(f.container),(!l.closer||l.nonblock)&&f.closer.css("display","none"),f.sticker=e("
                  ",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:l.sticker_hover?"hidden":"visible"},click:function(){l.hide=!l.hide,l.hide?f.pnotify_queue_remove():f.pnotify_cancel_remove(),e(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){e(this).children().removeClass(p.pin_up+" "+p.pin_down).addClass(l.hide?p.pin_up:p.pin_down)}).append(e("",{"class":p.pin_up})).appendTo(f.container),(!l.sticker||l.nonblock)&&f.sticker.css("display","none"),l.icon!==!1&&e("
                  ",{"class":"ui-pnotify-icon"}).append(e("",{"class":l.icon===!0?"error"==l.type?p.error_icon:"info"==l.type?p.info_icon:"success"==l.type?p.success_icon:p.notice_icon:l.icon})).prependTo(f.container),f.title_container=e("

                  ",{"class":"ui-pnotify-title"}).appendTo(f.container),l.title===!1?f.title_container.hide():l.title_escape?f.title_container.text(l.title):f.title_container.html(l.title),f.text_container=e("
                  ",{"class":"ui-pnotify-text"}).appendTo(f.container),l.text===!1?f.text_container.hide():l.text_escape?f.text_container.text(l.text):f.text_container.html(l.insert_brs?String(l.text).replace(/\n/g,"
                  "):l.text),"string"==typeof l.width&&f.css("width",l.width),"string"==typeof l.min_height&&f.container.css("min-height",l.min_height),f.pnotify_history=l.history,f.pnotify_hide=l.hide;var m=o.data("pnotify");if((null==m||"object"!=typeof m)&&(m=[]),m="top"==l.stack.push?e.merge([f],m):e.merge(m,[f]),o.data("pnotify",m),"top"==l.stack.push&&f.pnotify_queue_position(1),l.after_init&&l.after_init(f),l.history){var g=o.data("pnotify_history");if("undefined"==typeof g){g=e("
                  ",{"class":"ui-pnotify-history-container "+p.hi_menu,mouseleave:function(){g.animate({top:"-"+t+"px"},{duration:100,queue:!1})}}).append(e("
                  ",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(e("\n <% if (geolocation) { %>\n \n <% } %>\n \n \n
                  '}),define("modules/usermap/views/controls",["jquery","marionette","lib/leaflet/mq","text!modules/usermap/templates/controls.html"],function(e,t,i,n){"use strict";return t.ItemView.extend({template:_.template(n),ui:{search:".js-btn-search",locate:".js-btn-locate",clear:".js-btn-clear",spinner:".saito-usermap-spinner"},events:{"click @ui.search":"_search","click @ui.locate":"_locate","click @ui.clear":"_clear"},initialize:function(t){this.mapLayer=t.mapLayer,this.mapModel=t.mapModel,this.params=t.params,this.mapLayer.on("click",this._repin,this),this.mapLayer.on("locationfound",this._repin,this),e(this.params.fields.edit).on("keypress",_.bind(this._onSearchFieldChange,this)),e(this.params.fields.edit).on("keyup",_.bind(this._updateSearchButtonTitle,this))},_clear:function(e){e.preventDefault(),this.model.set({lat:"",lng:"",zoom:""}),this._updateFields()},_search:function(t){t.preventDefault(),this._activityStart();var n=e(this.params.fields.edit).val();i.geocode().search(n).on("success",_.bind(function(e){var t=e.result.best;this._repin(t)},this))},_onSearchFieldChange:function(e){13===e.which&&this._search(e)},_activityStart:function(){this.ui.spinner.show()},_activityStop:function(){this.ui.spinner.hide()},_updateSearchButtonTitle:function(){var t=e(this.params.fields.edit).val();return t?(this.ui.search.removeAttr("disabled"),void this.ui.search.html(e.i18n.__("user.map.b.search",{string:t}))):void this.ui.search.attr("disabled","disabled")},_locate:function(e){e.preventDefault(),this._activityStart(),this.mapLayer.locate()},_repin:function(e){var t=this._round({lat:e.latlng.lat,lng:e.latlng.lng,zoom:this.mapLayer.getZoom()});this._activityStop(),this.model.set(t),this.mapModel.set(t),this._updateFields()},_round:function(e){return _.each(["lat","lng"],function(t){e[t]=e[t].toFixed(4)}),e},onRender:function(){this._updateSearchButtonTitle()},_updateFields:function(){var t=this.params.fields.update,i=this.model;_.each(["lat","lng","zoom"],_.bind(function(n){var o=n;t&&t[n]&&_.each(t[n],function(t){var n=e(t),s=i.get(o);"input"===n.prop("tagName").toLowerCase()?n.val(s):n.html(s)})},this)),this.render()},_geolocation:function(){return"geolocation"in navigator},serializeData:function(){var e=this.model.toJSON();return e.geolocation=this._geolocation(),e}})}),define("lib/leaflet/leaflet",[],function(){return"undefined"!=typeof L?L:void 0}),define("modules/usermap/views/map",["marionette","templateHelpers","lib/leaflet/leaflet","lib/leaflet/mq"],function(e,t,i,n){"use strict";return e.ItemView.extend({collectionEvents:{add:"_createMarker",change:"_repinMarker"},modelEvents:{"change:lat":"_setView"},template:{},templateHelpers:t,mapLayer:null,markersLayer:null,markers:{},initialize:function(){"world"===this.model.get("type")&&this._zoomView(),this.markersLayer=new i.MarkerClusterGroup,this._map()},_zoomView:function(){var e=40,t=$("#content"),i={width:t.width(),top:t.offset().top},n={height:i.width*(120/198)},o={height:$(window).height()};o.available=o.height-i.top,n.height>o.available&&(n.height=o.available-e),this.$el.height(n.height)},_createMarker:function(e){var t,n=e.latlng(),o=i.marker(n);if(n[0]){if(e){var s=this.templateHelpers.User.linkToUserProfile(e.get("id"),e.get("name"));o.bindPopup(s)}if(this.markersLayer.addLayer(o),this.markers[e.get("id")]=o,t=this.model.get("type"),"single"===t||"edit"===t){var a={lat:e.get("lat"),lng:e.get("lng")};a.zoom="edit"===t?e.get("zoom"):this.model.get("maxZoom"),this.model.set(a)}}},_repinMarker:function(e){if(!e.get("lat"))return void this._clearMarkers();var t=this.markers[e.get("id")];if(!t)return void this._createMarker(e);var i=t.getLatLng();i.lat=e.get("lat"),i.lng=e.get("lng"),t.update()},_clearMarkers:function(){this.markers={},this.markersLayer.clearLayers()},_setView:function(){var e=this.model.get("lat"),t=this.model.get("lng"),i=this.model.get("zoom");this.mapLayer.setView([e,t],i)},_map:function(){var e=n.mapLayer();this.mapLayer=i.map(this.el,{closePopupOnClick:!1,maxZoom:this.model.get("maxZoom"),minZoom:this.model.get("minZoom"),maxBounds:this.model.get("maxBounds")}),this._setView(),this.mapLayer.addLayer(e),this.mapLayer.addLayer(this.markersLayer)}})}),define("modules/usermap/models/map",["backbone"],function(e){"use strict";var t=e.Model.extend({maxZoom:{edit:14,single:11,world:11},defaults:{lat:30,lng:0,zoom:2,maxZoom:11,minZoom:1,maxBounds:[[-90,-180],[90,180]]},initialize:function(){this.maxZoom[this.get("type")]&&this.set("maxZoom",this.maxZoom[this.get("type")])}});return t}),define("modules/usermap/models/user",["backbone"],function(e){"use strict";var t=e.Model.extend({latlng:function(){return[this.get("lat"),this.get("lng")]}});return t}),define("modules/usermap/collections/users",["backbone","modules/usermap/models/user"],function(e,t){"use strict";var i=e.Collection.extend({model:t});return i}),define("text!modules/usermap/templates/layout.html",[],function(){return"
                  \n
                  \n
                  \n
                  "}),define("modules/usermap/usermap",["app/core","marionette","modules/usermap/views/controls","modules/usermap/views/map","modules/usermap/models/map","modules/usermap/collections/users","text!modules/usermap/templates/layout.html"],function(e,t,i,n,o,s,a){"use strict";var r=e.module("usermap",{startWithParent:!1});return r.addInitializer(function(){var e=$(".saito-usermap");if(e.length){var l,d,c=e.data("users"),u=new s,h=e.data("params"),p=t.Layout.extend({el:e,template:a,regions:{mapr:".saito-usermap-map",controls:".saito-usermap-controls"}}),f=(new p).render(),m=new o(h);d=new n({el:f.$(".saito-usermap-map"),model:m,collection:u}),u.add(c),"edit"===h.type&&(d.$el.addClass("input"),l=r.ControlView=new i({model:u.at(0),mapLayer:d.mapLayer,mapModel:m,params:h}),f.controls.show(l))}}),r}),define("app/time",["moment","moment-de"],function(e){"use strict";var t=e().lang()._longDateFormat;t.LT="H:mm",e.lang("de",{longDateFormat:t})}),define("lib/Saito/isAppVisible",["jquery","underscore","models/app"],function(e,t,i){"use strict";var n=function(){this.initialize.apply(this,arguments)};return t.extend(n.prototype,{_isVisibleOldSchool:!0,initialize:function(){i.reqres.setHandler("isAppVisible",this.isVisible,this),this._isVisibleOldSchool=this._isAppVisibleHtml5(),this._initAppVisibleOldSchool()},isVisible:function(){return this._isVisibleOldSchool},_initAppVisibleOldSchool:function(){e(window).blur(t.bind(function(){this._isVisibleOldSchool=!1},this)),e(window).focus(t.bind(function(){this._isVisibleOldSchool=!0},this))},_isAppVisibleHtml5:function(){var e,t=!1;return"undefined"!=typeof document.hidden?e="hidden":"undefined"!=typeof document.webkitHidden&&(e="webkitHidden"),document[e]&&(t=document[e]),!t}}),new n}),function(e){e.i18n={dict:null,setDictionary:function(e){this.dict=e},_:function(e,t){var i=e;return this.dict&&this.dict[e]&&(i=this.dict[e]),this.printf(i,t)},printf:function(e,t){if(!t)return e;for(var i="",n=/%(\d+)\$s/g,o=n.exec(e);o;){var s=parseInt(o[1],10)-1;e=e.replace("%"+o[1]+"$s",t[s]),o=n.exec(e)}var a=e.split("%s");if(a.length>1)for(var r=0;r0&&a[r].lastIndexOf("%")==a[r].length-1&&(a[r]+="s"+a.splice(r+1,1)[0]),i+=a[r]+t[r];return i+a[a.length-1]}},e.fn._t=function(t,i){return e(this).text(e.i18n._(t,i))}}(jQuery),define("lib/jquery.i18n/jquery.i18n",function(){}),define("lib/jquery.i18n/jquery.i18n.extend",["jquery","lib/jquery.i18n/jquery.i18n"],function(e){"use strict";e.extend(e.i18n,{currentString:"",setDict:function(e){this.dict=e},setUrl:function(e){this.dictUrl=e,this._loadDict()},_loadDict:function(){return e.ajax({url:this.dictUrl,dataType:"json",async:!1,cache:!0,success:e.proxy(function(e){this.dict=e},this)})},__:function(e,t){var i=e;return"object"==typeof this.dict[e]&&""!==this.dict[e][""]&&(i=this.dict[e][""]),"object"==typeof t&&(i=this._insert(i,t)),i},_insert:function(e,t){return e.replace(/:([-\w]+)/g,function(e,i){return"undefined"!=typeof t[i]?t[i]:e})}})}),function(e,t){"function"==typeof define&&define.amd?define("lib/saito/backbone.initHelper",["underscore","backbone"],function(i,n){return t(i||e._,n||e.Backbone)}):t(_,Backbone)}(this,function(e,t){t.View.prototype.initCollectionFromDom=function(e,t,i){var n=function(e,t,n){e.add({id:t}),new i({el:n,model:e.get(t),collection:e})};$(e).each(function(){n(t,$(this).data("id"),this)})}}),define("app/app",["marionette","app/core","app/vent","modules/html5-notification/html5-notification"],function(e,t,i){var n=SaitoApp,o=function(e){require(["jquery","domReady"],function(t,i){t.isReady?e():i(function(){e()})})},s={fireOnPageCallbacks:function(e){var t=e.afterAppInit;_.each(t,function(e){e()}),i.vent.on("isAppVisible",_.once(function(){var t=e.afterViewInit;_.each(t,function(e){e()})}))},bootstrapShoutbox:function(){o(function(){require(["modules/shoutbox/shoutbox"],function(e){e.start()})})},bootstrapApp:function(e){require(["domReady","views/app","backbone","jquery","models/app","views/notification","views/prerequisitesTester","modules/html5-notification/html5-notification","modules/usermap/usermap","app/time","lib/Saito/isAppVisible","lib/jquery.i18n/jquery.i18n.extend","jqueryDropdown","lib/saito/backbone.initHelper","lib/saito/backbone.modelHelper","fastclick"],function(t,i,a,r,l,d,c,u,h){var p,f,m;l.settings.set(e.SaitoApp.app.settings),r.i18n.setUrl(l.settings.get("webroot")+"da/langJs"),l.currentUser.set(e.SaitoApp.currentUser),l.request=e.SaitoApp.request,u.start(),h.start(),new d;var g=e.SaitoApp.callbacks.beforeAppInit;_.each(g,function(e){e()}),window.addEventListener("load",function(){new FastClick(document.body)},!1),m=new c({el:r(".app-prerequisites-warnings")}),p=new i,f=function(){"shouts"in n&&s.bootstrapShoutbox(),s.fireOnPageCallbacks(e.SaitoApp.callbacks),p.initFromDom({SaitoApp:e.SaitoApp,contentTimer:e.contentTimer})},o(f)})}},a=t;return a.addInitializer(s.bootstrapApp),a.start({contentTimer:contentTimer,SaitoApp:n}),i.reqres.setHandler("webroot",function(){return n.app.settings.webroot}),i.reqres.setHandler("apiroot",function(){return n.app.settings.webroot+"api/v1/"}),a}),require.config({paths:{common:"../dist/common.min",templateHelpers:"lib/saito/templateHelpers"}}),function(e){"use strict";e.contentTimer={show:function(){$("#content").css("visibility","visible"),console.warn("DOM ready timed out: show content fallback used."),delete this.timeoutID},setup:function(){this.cancel();var t=this;this.timeoutID=e.setTimeout(function(){t.show()},5e3)},cancel:function(){"number"==typeof this.timeoutID&&(e.clearTimeout(this.timeoutID),delete this.timeoutID)}},e.contentTimer.setup()}(window),require(["lib/bootstrapHelper","common"],function(){"use strict";require(["lib/saito/underscore.extend"]),require(["app/app"])}),define("main",function(){}); \ No newline at end of file diff --git a/app/webroot/js/views/answering.js b/app/webroot/js/views/answering.js index a321b7d27..8b16c3c94 100644 --- a/app/webroot/js/views/answering.js +++ b/app/webroot/js/views/answering.js @@ -54,7 +54,7 @@ define([ // answering form was loaded via ajax request ajax: true, // answering form is in posting which is inline-opened - parentThreadline: false + parentThreadline: null }); this.options = options; @@ -269,8 +269,8 @@ define([ data = this.$('#EntryAddForm').serialize(); success = _.bind(function(data) { this.model.set({isAnsweringFormShown: false}); - if (this.parentThreadline !== null) { - this.parentThreadline.set('isInlineOpened', false); + if (this.options.parentThreadline !== null) { + this.options.parentThreadline.set('isInlineOpened', false); } App.eventBus.trigger('newEntry', { tid: data.tid, From 7903a05f85ca1c59dc22909ab6d9650f4793d003 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 13:50:02 +0200 Subject: [PATCH 13/29] fix empty smiley menu --- app/Config/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index 863211719..627c76ce7 100755 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -220,7 +220,7 @@ * Add additional buttons to editor * @td document in namespace */ -Configure::write('Saito.markItUp.nextCssId', 10); +Configure::write('Saito.markItUp.nextCssId', 11); //= attach Saito event manager to Cake event manager App::uses('SaitoEventManager', 'Lib/Saito/Event'); From 535b6e4353110cdf29a67e5ace25ff678507b774 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 13:51:40 +0200 Subject: [PATCH 14/29] fix smiley admin index --- app/View/Smilies/admin_index.ctp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/View/Smilies/admin_index.ctp b/app/View/Smilies/admin_index.ctp index 3a77a0a83..8e0371c88 100644 --- a/app/View/Smilies/admin_index.ctp +++ b/app/View/Smilies/admin_index.ctp @@ -9,7 +9,7 @@

                  - + @@ -33,7 +33,7 @@ > - + @@ -45,4 +45,4 @@
                  Paginator->sort('id');?> Paginator->sort('order');?>Paginator->sort('sort');?> Paginator->sort('icon');?> Paginator->sort('image');?> Paginator->sort('title');?>          
                  -
                  \ No newline at end of file +

                  From a47812c8d124f569d2788baf4947d81e60f8b9bc Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Sat, 4 Jul 2015 13:51:56 +0200 Subject: [PATCH 15/29] fix failing test cases --- app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php index 7bf1fe71a..553ffa24d 100755 --- a/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php +++ b/app/Plugin/BbcodeParser/Test/Case/Lib/BbcodeParserTest.php @@ -419,7 +419,9 @@ public function testFlash() { public function testFloat() { $expected = [ - 'div' => ['class' => 'richtext-float'], + ['div' => ['class' => 'clearfix']], + '/div', + ['div' => ['class' => 'richtext-float']], 'text', '/div', 'more' From bf036cfdd0d3b67b65f94e0fed45c5f88112a7e0 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Fri, 24 Jul 2015 10:02:06 +0200 Subject: [PATCH 16/29] [mobile] fix body HTML not initialized before JS is started --- app/Plugin/M/Controller/MsController.php | 7 ++++ app/Plugin/M/View/Layouts/plugin-m.ctp | 25 +++++++------- app/Plugin/M/webroot/dist/js.js | 44 +++++++++++------------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/app/Plugin/M/Controller/MsController.php b/app/Plugin/M/Controller/MsController.php index 4c9d02e31..26de8d5df 100644 --- a/app/Plugin/M/Controller/MsController.php +++ b/app/Plugin/M/Controller/MsController.php @@ -23,6 +23,12 @@ public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('index', 'manifest'); + if ($this->request->action === 'clientLog') { + if ($this->Components->enabled('Security')) { + $this->Components->disable('Security'); + } + } + Configure::write('Asset.timestamp', 'force'); } @@ -37,6 +43,7 @@ public function clientLog() { $this->autoRender = false; if (isset($this->request->data['message'])) { $message = $this->request->data['message']; + $message = substr($message, 0, 500); echo CakeLog::error($message, 'mobile-client') ? 0 : 1; } else { echo 1; diff --git a/app/Plugin/M/View/Layouts/plugin-m.ctp b/app/Plugin/M/View/Layouts/plugin-m.ctp index 1143b7615..a5f576f32 100644 --- a/app/Plugin/M/View/Layouts/plugin-m.ctp +++ b/app/Plugin/M/View/Layouts/plugin-m.ctp @@ -21,18 +21,10 @@ }; element('custom_html_header') ?> - RequireJs->scriptTag($requireJsScript, ['jsUrl' => 'm/dev/js/']); - ?> - - - Html->script('M.../dist/js.js'); - } ?> + + + +
                  @@ -43,5 +35,14 @@
                  +RequireJs->scriptTag($requireJsScript, ['jsUrl' => 'm/dev/js/']); +} else { + echo $this->Html->script('M.../dist/js.js'); +} +?> diff --git a/app/Plugin/M/webroot/dist/js.js b/app/Plugin/M/webroot/dist/js.js index 129b171da..c4c0817bb 100644 --- a/app/Plugin/M/webroot/dist/js.js +++ b/app/Plugin/M/webroot/dist/js.js @@ -75,7 +75,7 @@ var requirejs,require,define; // http://backbonejs.org /** - * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/requirejs/text for details */ @@ -108,31 +108,29 @@ THE SOFTWARE. */ /*! - Autosize v1.18.7 - 2014-04-13 - Automatically adjust textarea height based on user input. - (c) 2014 Jack Moore - http://www.jacklmoore.com/autosize - license: http://www.opensource.org/licenses/mit-license.php + Autosize 3.0.8 + license: MIT + http://www.jacklmoore.com/autosize */ /*! alertify 0.4.0rc1 (Fabien Doiron) | MIT */ -/*! NProgress (c) 2013, Rico Sta. Cruz - * http://ricostacruz.com/nprogress */ +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */ /** - * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. - * - * @version 1.0.1 - * @codingstandard ftlabs-jsv2 - * @copyright The Financial Times Limited [All Rights Reserved] - * @license MIT License (see LICENSE.txt) - */ - -function FastClick(e,t){function n(e,t){return function(){return e.apply(t,arguments)}}var i;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=e,this.tapDelay=t.tapDelay||200,!FastClick.notNeeded(e)){for(var r=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],s=this,o=0,a=r.length;a>o;o++)s[r[o]]=n(s[r[o]],s);deviceIsAndroid&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,i){var r=Node.prototype.removeEventListener;"click"===t?r.call(e,t,n.hijacked||n,i):r.call(e,t,n,i)},e.addEventListener=function(t,n,i){var r=Node.prototype.addEventListener;"click"===t?r.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),i):r.call(e,t,n,i)}),"function"==typeof e.onclick&&(i=e.onclick,e.addEventListener("click",function(e){i(e)},!1),e.onclick=null)}}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=et.type(e);return"function"===n||et.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(et.isFunction(t))return et.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return et.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(at.test(t))return et.filter(t,e,n);t=et.filter(t,e)}return et.grep(e,function(e){return W.call(t,e)>=0!==n})}function r(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function s(e){var t=dt[e]={};return et.each(e.match(ft)||[],function(e,n){t[n]=!0}),t}function o(){K.removeEventListener("DOMContentLoaded",o,!1),e.removeEventListener("load",o,!1),et.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=et.expando+Math.random()}function u(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(xt,"-$1").toLowerCase(),n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:bt.test(n)?et.parseJSON(n):n}catch(r){}yt.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function h(){try{return K.activeElement}catch(e){}}function p(e,t){return et.nodeName(e,"table")&&et.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function f(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function d(e){var t=Pt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,i=e.length;i>n;n++)vt.set(e[n],"globalEval",!t||vt.get(t[n],"globalEval"))}function m(e,t){var n,i,r,s,o,a,u,l;if(1===t.nodeType){if(vt.hasData(e)&&(s=vt.access(e),o=vt.set(t,s),l=s.events)){delete o.handle,o.events={};for(r in l)for(n=0,i=l[r].length;i>n;n++)et.event.add(t,r,l[r][n])}yt.hasData(e)&&(a=yt.access(e),u=et.extend({},a),yt.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&et.nodeName(e,t)?et.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ct.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function b(t,n){var i=et(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle?e.getDefaultComputedStyle(i[0]).display:et.css(i[0],"display");return i.detach(),r}function x(e){var t=K,n=Rt[e];return n||(n=b(e,t),"none"!==n&&n||(Mt=(Mt||et("