diff --git a/composer.lock b/composer.lock index 96345fc..e358fe3 100644 --- a/composer.lock +++ b/composer.lock @@ -1056,12 +1056,12 @@ "source": { "type": "git", "url": "https://github.com/vlucas/valitron.git", - "reference": "9268adeeb48ba155e35dca861f5990283e14eafb" + "reference": "81515dcc951e1f636a1a18ece2f4154dfa123438" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/valitron/zipball/9268adeeb48ba155e35dca861f5990283e14eafb", - "reference": "9268adeeb48ba155e35dca861f5990283e14eafb", + "url": "https://api.github.com/repos/vlucas/valitron/zipball/81515dcc951e1f636a1a18ece2f4154dfa123438", + "reference": "81515dcc951e1f636a1a18ece2f4154dfa123438", "shasum": "" }, "require": { @@ -1097,7 +1097,13 @@ "validation", "validator" ], - "time": "2020-07-10T08:55:05+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/valitron", + "type": "tidelift" + } + ], + "time": "2020-12-01T11:14:45+00:00" } ], "packages-dev": [], diff --git a/system/Controllers/PageController.php b/system/Controllers/PageController.php index 60f3afa..b386a4f 100644 --- a/system/Controllers/PageController.php +++ b/system/Controllers/PageController.php @@ -10,6 +10,7 @@ use Typemill\Models\WriteMeta; use \Symfony\Component\Yaml\Yaml; use Typemill\Models\VersionCheck; use Typemill\Models\Markdown; +use Typemill\Events\OnCacheUpdated; use Typemill\Events\OnPagetreeLoaded; use Typemill\Events\OnBreadcrumbLoaded; use Typemill\Events\OnItemLoaded; @@ -45,6 +46,12 @@ class PageController extends Controller { $structure = $this->getCachedStructure($cache); } + else + { + # dispatch message that the cache has been refreshed + $this->c->dispatcher->dispatch('onCacheUpdated', new OnCacheUpdated(false)); + } + if(!isset($structure) OR !$structure) { # if not, get a fresh structure of the content folder diff --git a/system/Events/OnCacheUpdated.php b/system/Events/OnCacheUpdated.php new file mode 100644 index 0000000..d1631d2 --- /dev/null +++ b/system/Events/OnCacheUpdated.php @@ -0,0 +1,14 @@ +router = $router; - } - - public function __invoke(Request $request, Response $response, $next) - { - if(!isset($_SESSION['login']) || !isset($_SESSION['role'])) - { - $response = $response->withRedirect($this->router->pathFor('auth.show')); - } - - if($_SESSION['role'] != 'administrator') - { - $response = $response->withRedirect($this->router->pathFor('content.raw')); - } - - return $next($request, $response); - } - */ -} \ No newline at end of file diff --git a/system/Models/User.php b/system/Models/User.php index c0ab3fe..1c3cccf 100644 --- a/system/Models/User.php +++ b/system/Models/User.php @@ -60,6 +60,49 @@ class User extends WriteYaml } return $usermails; } + + public function findUserByEmail($email) + { + $userDir = __DIR__ . '/../../settings/users'; + + /* check if users directory exists */ + if(!is_dir($userDir)){ return array(); } + + /* get all user files */ + $users = array_diff(scandir($userDir), array('..', '.')); + + $usermails = array(); + + foreach($users as $key => $user) + { + if($user == '.logins'){ continue; } + + $contents = file_get_contents($userDir . DIRECTORY_SEPARATOR . $user); + + if($contents === false){ continue; } + + $searchfor = 'email:'; + + # escape special characters in the query + $pattern = preg_quote($searchfor, '/'); + + # finalise the regular expression, matching the whole line + $pattern = "/^.*$pattern.*\$/m"; + + # search, and store first occurence in $matches + if(preg_match($pattern, $contents, $match)){ + $usermail = trim(str_replace("email:", "", $match[0])); + + if($usermail == $email) + { + $user = \Symfony\Component\Yaml\Yaml::parse($contents); + unset($user['password']); + return $user; + } + } + } + return false; + } public function getUser($username) { diff --git a/system/Models/Write.php b/system/Models/Write.php index c963815..0f6d771 100644 --- a/system/Models/Write.php +++ b/system/Models/Write.php @@ -79,7 +79,7 @@ class Write } return false; } - + public function getFile($folderName, $fileName) { if($this->checkFile($folderName, $fileName)) @@ -109,6 +109,25 @@ class Write } return false; } + + public function renameFile($folder, $oldname, $newname) + { + + $oldFilePath = $this->basePath . $folder . DIRECTORY_SEPARATOR . $oldname; + $newFilePath = $this->basePath . $folder . DIRECTORY_SEPARATOR . $newname; + + if(!file_exists($oldFilePath)) + { + return false; + } + + if(@rename($oldFilePath, $newFilePath)) + { + return true; + } + + return false; + } public function moveElement($item, $folderPath, $index, $date = null) { diff --git a/system/author/css/color-picker.min.css b/system/author/css/color-picker.min.css deleted file mode 100644 index 50c523f..0000000 --- a/system/author/css/color-picker.min.css +++ /dev/null @@ -1 +0,0 @@ -.color-picker,.color-picker *,.color-picker ::after,.color-picker ::before,.color-picker::after,.color-picker::before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.color-picker{position:absolute;top:0;left:0;z-index:9999}.color-picker-container{background:#000;color:#000;padding:1px;-webkit-box-shadow:1px 5px 10px rgba(0,0,0,.5);-moz-box-shadow:1px 5px 10px rgba(0,0,0,.5);box-shadow:1px 5px 10px rgba(0,0,0,.5);width:calc(11.5em + 3px)}.color-picker-container *,.color-picker-container ::after,.color-picker-container ::before{border-color:inherit}.color-picker-container::after{content:"";display:table;clear:both}.color-picker i{font:inherit;font-size:12px}.color-picker-h{position:relative;width:1.5em;height:10em;float:right;cursor:ns-resize;background:url(color-picker-h.png)50% 50% no-repeat;background:-webkit-linear-gradient(to top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)50% 50%/100% 100% no-repeat;background-image:-moz-linear-gradient(to top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background-image:linear-gradient(to top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);-webkit-background-size:100% 100%;-moz-background-size:100% 100%;overflow:hidden}.color-picker-h i{position:absolute;top:-.25em;right:0;left:0;z-index:3;display:block;height:.5em}.color-picker-h i::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:block;border:.25em solid;border-color:transparent;border-right-color:inherit;border-left-color:inherit}.color-picker-sv{position:relative;width:10em;height:10em;float:left;margin-right:1px;background:url(color-picker-sv.png)50% 50% no-repeat;background-image:-webkit-linear-gradient(to top,#000,rgba(0,0,0,0)),linear-gradient(to right,#fff,rgba(255,255,255,0));background-image:-moz-linear-gradient(to top,#000,rgba(0,0,0,0)),linear-gradient(to right,#fff,rgba(255,255,255,0));background-image:linear-gradient(to top,#000,rgba(0,0,0,0)),linear-gradient(to right,#fff,rgba(255,255,255,0));-webkit-background-size:100% 100%;-moz-background-size:100% 100%;background-size:100% 100%;cursor:crosshair}.color-picker-sv i{position:absolute;top:-.4em;right:-.4em;z-index:3;display:block;width:.8em;height:.8em}.color-picker-sv i::after,.color-picker-sv i::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:block;border:1px solid;border-color:inherit;-webkit-border-radius:100%;-moz-border-radius:100%;border-radius:100%}.color-picker-sv i::before{top:-1px;right:-1px;bottom:-1px;left:-1px;border-color:#fff}.color-picker-h,.color-picker-sv{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent} \ No newline at end of file diff --git a/system/author/css/normalize.css b/system/author/css/normalize.css deleted file mode 100644 index b672540..0000000 --- a/system/author/css/normalize.css +++ /dev/null @@ -1,461 +0,0 @@ -/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ - -/** - * 1. Change the default font family in all browsers (opinionated). - * 2. Correct the line height in all browsers. - * 3. Prevent adjustments of font size after orientation changes in - * IE on Windows Phone and in iOS. - */ - -/* Document - ========================================================================== */ - -html { - font-family: sans-serif; /* 1 */ - line-height: 1.15; /* 2 */ - -ms-text-size-adjust: 100%; /* 3 */ - -webkit-text-size-adjust: 100%; /* 3 */ -} - -/* Sections - ========================================================================== */ - -/** - * Remove the margin in all browsers (opinionated). - */ - -body { - margin: 0; -} - -/** - * Add the correct display in IE 9-. - */ - -article, -aside, -footer, -header, -nav, -section { - display: block; -} - -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/* Grouping content - ========================================================================== */ - -/** - * Add the correct display in IE 9-. - * 1. Add the correct display in IE. - */ - -figcaption, -figure, -main { /* 1 */ - display: block; -} - -/** - * Add the correct margin in IE 8. - */ - -figure { - margin: 1em 40px; -} - -/** - * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. - */ - -hr { - box-sizing: content-box; /* 1 */ - height: 0; /* 1 */ - overflow: visible; /* 2 */ -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -pre { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/* Text-level semantics - ========================================================================== */ - -/** - * 1. Remove the gray background on active links in IE 10. - * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. - */ - -a { - background-color: transparent; /* 1 */ - -webkit-text-decoration-skip: objects; /* 2 */ -} - -/** - * Remove the outline on focused links when they are also active or hovered - * in all browsers (opinionated). - */ - -a:active, -a:hover { - outline-width: 0; -} - -/** - * 1. Remove the bottom border in Firefox 39-. - * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. - */ - -abbr[title] { - border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ - text-decoration: underline dotted; /* 2 */ -} - -/** - * Prevent the duplicate application of `bolder` by the next rule in Safari 6. - */ - -b, -strong { - font-weight: inherit; -} - -/** - * Add the correct font weight in Chrome, Edge, and Safari. - */ - -b, -strong { - font-weight: bolder; -} - -/** - * 1. Correct the inheritance and scaling of font size in all browsers. - * 2. Correct the odd `em` font sizing in all browsers. - */ - -code, -kbd, -samp { - font-family: monospace, monospace; /* 1 */ - font-size: 1em; /* 2 */ -} - -/** - * Add the correct font style in Android 4.3-. - */ - -dfn { - font-style: italic; -} - -/** - * Add the correct background and color in IE 9-. - */ - -mark { - background-color: #ff0; - color: #000; -} - -/** - * Add the correct font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` elements from affecting the line height in - * all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Add the correct display in IE 9-. - */ - -audio, -video { - display: inline-block; -} - -/** - * Add the correct display in iOS 4-7. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Remove the border on images inside links in IE 10-. - */ - -img { - border-style: none; -} - -/** - * Hide the overflow in IE. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Forms - ========================================================================== */ - -/** - * 1. Change the font styles in all browsers (opinionated). - * 2. Remove the margin in Firefox and Safari. - */ - -button, -input, -optgroup, -select, -textarea { - font-family: sans-serif; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - -/** - * Remove the inheritance of text transform in Edge, Firefox, and IE. - * 1. Remove the inheritance of text transform in Firefox. - */ - -button, -select { /* 1 */ - text-transform: none; -} - -/** - * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` - * controls in Android 4. - * 2. Correct the inability to style clickable types in iOS and Safari. - */ - -button, -html [type="button"], /* 1 */ -[type="reset"], -[type="submit"] { - -webkit-appearance: button; /* 2 */ -} - -/** - * Remove the inner border and padding in Firefox. - */ - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** - * Restore the focus styles unset by the previous rule. - */ - -button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** - * Change the border, margin, and padding in all browsers (opinionated). - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct the text wrapping in Edge and IE. - * 2. Correct the color inheritance from `fieldset` elements in IE. - * 3. Remove the padding so developers are not caught out when they zero out - * `fieldset` elements in all browsers. - */ - -legend { - box-sizing: border-box; /* 1 */ - color: inherit; /* 2 */ - display: table; /* 1 */ - max-width: 100%; /* 1 */ - padding: 0; /* 3 */ - white-space: normal; /* 1 */ -} - -/** - * 1. Add the correct display in IE 9-. - * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ - -progress { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Remove the default vertical scrollbar in IE. - */ - -textarea { - overflow: auto; -} - -/** - * 1. Add the correct box sizing in IE 10-. - * 2. Remove the padding in IE 10-. - */ - -[type="checkbox"], -[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Correct the cursor style of increment and decrement buttons in Chrome. - */ - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Correct the odd appearance in Chrome and Safari. - * 2. Correct the outline style in Safari. - */ - -[type="search"] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** - * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. - */ - -[type="search"]::-webkit-search-cancel-button, -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * 1. Correct the inability to style clickable types in iOS and Safari. - * 2. Change font properties to `inherit` in Safari. - */ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* Interactive - ========================================================================== */ - -/* - * Add the correct display in IE 9-. - * 1. Add the correct display in Edge, IE, and Firefox. - */ - -details, /* 1 */ -menu { - display: block; -} - -/* - * Add the correct display in all browsers. - */ - -summary { - display: list-item; -} - -/* Scripting - ========================================================================== */ - -/** - * Add the correct display in IE 9-. - */ - -canvas { - display: inline-block; -} - -/** - * Add the correct display in IE. - */ - -template { - display: none; -} - -/* Hidden - ========================================================================== */ - -/** - * Add the correct display in IE 10-. - */ - -[hidden] { - display: none; -} diff --git a/system/author/js/author.js b/system/author/js/author.js index 8ddc12b..7f6c38d 100644 --- a/system/author/js/author.js +++ b/system/author/js/author.js @@ -330,73 +330,6 @@ }); } - - /************************************* - ** COLOR PICKER ** - *************************************/ - - var target = document.querySelectorAll('input[type=color]'); - // set hooks for each target element - - if(target) - { - for (var i = 0, len = target.length; i < len; ++i) - { - var thisTarget = target[i]; - - (function(thisTarget){ - - /* hide the input field and show color box instead */ - var box = document.createElement('div'); - - box.className = 'color-box'; - box.style.backgroundColor = thisTarget.value; - box.setAttribute('data-color', thisTarget.value); - thisTarget.parentNode.insertBefore(box, thisTarget); - thisTarget.type = 'hidden'; - - var picker = new CP(box), - code = document.createElement('input'); - - picker.target.onclick = function(e) - { - e.preventDefault(); - }; - - code.className = 'color-code'; - code.pattern = '^#[A-Fa-f0-9]{6}$'; - code.type = 'text'; - - picker.on("enter", function() { - code.value = '#' + CP._HSV2HEX(this.get()); - }); - - - picker.on("change", function(color) { - thisTarget.value = '#' + color; - this.target.style.backgroundColor = '#' + color; - code.value = '#' + color; - }); - - picker.picker.firstChild.appendChild(code); - - function update() { - if (this.value.length) { - picker.set(this.value); - picker.trigger("change", [this.value.slice(1)]); - } - } - - code.oncut = update; - code.onpaste = update; - code.onkeyup = update; - code.oninput = update; - - - })(thisTarget); - } - } - /** * Element.closest() polyfill * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill @@ -415,6 +348,4 @@ } while (ancestor !== null); return null; }; - } - - \ No newline at end of file + } \ No newline at end of file diff --git a/system/author/js/color-picker.min.js b/system/author/js/color-picker.min.js deleted file mode 100644 index d294cdd..0000000 --- a/system/author/js/color-picker.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * ========================================================== - * COLOR PICKER PLUGIN 1.4.1 - * ========================================================== - * Author: Taufik Nurrohman - * License: MIT - * ---------------------------------------------------------- - */ -!function(t,n,e){function r(t){return void 0!==t}function i(t){return"string"==typeof t}function o(t){return"object"==typeof t}function u(t){return Object.keys(t).length}function c(t,n,e){return n>t?n:t>e?e:t}function s(t,n){return parseInt(t,n||10)}function a(t){return Math.round(t)}function f(t){var n,e,r,i,o,u,c,s,f=+t[0],l=+t[1],h=+t[2];switch(i=Math.floor(6*f),o=6*f-i,u=h*(1-l),c=h*(1-o*l),s=h*(1-(1-o)*l),i=i||0,c=c||0,s=s||0,i%6){case 0:n=h,e=s,r=u;break;case 1:n=c,e=h,r=u;break;case 2:n=u,e=h,r=s;break;case 3:n=u,e=c,r=h;break;case 4:n=s,e=u,r=h;break;case 5:n=h,e=u,r=c}return[a(255*n),a(255*e),a(255*r)]}function l(t){return p(f(t))}function h(t){var n,e=+t[0],r=+t[1],i=+t[2],o=Math.max(e,r,i),u=Math.min(e,r,i),c=o-u,s=0===o?0:c/o,a=o/255;switch(o){case u:n=0;break;case e:n=r-i+c*(i>r?6:0),n/=6*c;break;case r:n=i-e+2*c,n/=6*c;break;case i:n=e-r+4*c,n/=6*c}return[n,s,a]}function p(t){var n=+t[2]|+t[1]<<8|+t[0]<<16;return n="000000"+n.toString(16),n.slice(-6)}function v(t){return h(d(t))}function d(t){return 3===t.length&&(t=t.replace(/./g,"$&$&")),[s(t[0]+t[1],16),s(t[2]+t[3],16),s(t[4]+t[5],16)]}function g(t){return[+t[0]/360,+t[1]/100,+t[2]/100]}function y(t){return[a(360*+t[0]),a(100*+t[1]),a(100*+t[2])]}function x(t){return[+t[0]/255,+t[1]/255,+t[2]/255]}function H(t){if(o(t))return t;var n=/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i.exec(t),e=/\s*hsv\s*\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)\s*$/i.exec(t),r="#"===t[0]&&t.match(/^#([\da-f]{3}|[\da-f]{6})$/i);return r?v(t.slice(1)):e?g([+e[1],+e[2],+e[3]]):n?h([+n[1],+n[2],+n[3]]):[0,1,1]}var b="__instance__",m="firstChild",k=setTimeout;!function(t){t.version="1.4.1",t[b]={},t.each=function(n,e){return k(function(){var e,r=t[b];for(e in r)n.call(r[e],e,r)},0===e?0:e||1),t},t.parse=H,t._HSV2RGB=f,t._HSV2HEX=l,t._RGB2HSV=h,t._HEX2HSV=v,t._HEX2RGB=function(t){return x(d(t))},t.HSV2RGB=function(t){return f(g(t))},t.HSV2HEX=function(t){return l(g(t))},t.RGB2HSV=function(t){return y(h(t))},t.RGB2HEX=p,t.HEX2HSV=function(t){return y(v(t))},t.HEX2RGB=d}(t[e]=function(s,a,h){function p(t,n,e){t=t.split(/\s+/);for(var r=0,i=t.length;i>r;++r)n.addEventListener(t[r],e,!1)}function v(t,n,e){t=t.split(/\s+/);for(var r=0,i=t.length;i>r;++r)n.removeEventListener(t[r],e)}function d(t,n){var e="touches",r="clientX",i="clientY",o=n[e]?n[e][0][r]:n[r],u=n[e]?n[e][0][i]:n[i],c=g(t);return{x:o-c.l,y:u-c.t}}function g(n){var e,r,i;return n===t?(e=t.pageXOffset||M.scrollLeft,r=t.pageYOffset||M.scrollTop):(i=n.getBoundingClientRect(),e=i.left,r=i.top),{l:e,t:r}}function y(t,n){for(;(t=t.parentElement)&&t!==n;);return t}function x(t){t&&t.preventDefault()}function H(n){return n===t?{w:t.innerWidth,h:t.innerHeight}:{w:n.offsetWidth,h:n.offsetHeight}}function w(t){return j||(r(t)?t:!1)}function E(t){j=t}function S(t,n,e){return r(t)?r(n)?(r(O[t])||(O[t]={}),r(e)||(e=u(O[t])),O[t][e]=n,$):O[t]:O}function X(t,n){return r(t)?r(n)?(delete O[t][n],$):(O[t]={},$):(O={},$)}function _(t,n,e){if(!r(O[t]))return $;if(r(e))r(O[t][e])&&O[t][e].apply($,n);else for(var i in O[t])O[t][i].apply($,n);return $}function B(t,n){t&&"h"!==t||_("change:h",n),t&&"sv"!==t||_("change:sv",n),_("change",n)}function R(){return T.parentNode}function V(e,r){function i(t){var n=t.target,e=n===s||y(n,s)===s;e?(V(),_("enter")):$.exit()}function o(t){var n=(f(I),f([I[0],1,1]));q.style.backgroundColor="rgb("+n.join(",")+")",E(I),x(t)}function u(t){var n=c(d(P,t).y,0,L);I[0]=(L-n)/L,F.style.top=n-D/2+"px",o(t)}function g(t){var n=d(q,t),e=c(n.x,0,j),r=c(n.y,0,O);I[1]=1-(j-e)/j,I[2]=(O-r)/O,J.style.right=j-e-tn/2+"px",J.style.top=r-nn/2+"px",o(t)}function b(t){U&&(u(t),on=[l(I)],K||(_("drag:h",on),_("drag",on),B("h",on))),Z&&(g(t),on=[l(I)],Q||(_("drag:sv",on),_("drag",on),B("sv",on))),K=0,Q=0}function m(t){var n=t.target,e=U?"h":"sv",r=[l(I),$],i=n===s||y(n,s)===s,o=n===T||y(n,T)===T;i||o?o&&(_("stop:"+e,r),_("stop",r),B(e,r)):R()&&a!==!1&&($.exit(),B(0,r)),U=0,Z=0}function k(t){K=1,U=1,b(t),x(t),_("start:h",on),_("start",on),B("h",on)}function S(t){Q=1,Z=1,b(t),x(t),_("start:sv",on),_("start",on),B("sv",on)}e||((h||r||C).appendChild(T),$.visible=!0),en=H(T).w,rn=H(T).h;var X=H(q),M=H(J),L=H(P).h,j=X.w,O=X.h,D=H(F).h,tn=M.w,nn=M.h;e?(T.style.left=T.style.top="-9999px",a!==!1&&p(a,s,i),$.create=function(){return V(1),_("create"),$},$.destroy=function(){return a!==!1&&v(a,s,i),$.exit(),E(!1),_("destroy"),$}):G(),A=function(){I=w(I),o(),F.style.top=L-D/2-L*+I[0]+"px",J.style.right=j-tn/2-j*+I[1]+"px",J.style.top=O-nn/2-O*+I[2]+"px"},$.exit=function(){return R()&&(R().removeChild(T),$.visible=!1),v(N,P,k),v(N,q,S),v(W,n,b),v(Y,n,m),v(z,t,G),_("exit"),$},A(),e||(p(N,P,k),p(N,q,S),p(W,n,b),p(Y,n,m),p(z,t,G))}function G(){return $.fit()}var C=n.body,M=n.documentElement,$=this,L=t[e],j=!1,O={},T=n.createElement("div"),N="touchstart mousedown",W="touchmove mousemove",Y="touchend mouseup",z="orientationchange resize";if(!($ instanceof L))return new L(s,a);L[b][s.id||s.name||u(L[b])]=$,r(a)&&a!==!0||(a=N),E(L.parse(s.getAttribute("data-color")||s.value||[0,1,1])),T.className="color-picker",T.innerHTML='
';var A,D=T[m].children,I=w([0,1,1]),P=D[0],q=D[1],F=P[m],J=q[m],K=0,Q=0,U=0,Z=0,tn=0,nn=0,en=0,rn=0,on=[l(I)];return V(1),k(function(){var t=[l(I)];_("create",t),B(0,t)},0),$.fit=function(n){var e=H(t),i=H(M),u=e.w-i.w,a=e.h-M.clientHeight,f=g(t),l=g(s);if(tn=l.l+f.l,nn=l.t+f.t+H(s).h,o(n))r(n[0])&&(tn=n[0]),r(n[1])&&(nn=n[1]);else{var h=f.l,p=f.t,v=f.l+e.w-en-u,d=f.t+e.h-rn-a;tn=c(tn,h,v)>>0,nn=c(nn,p,d)>>0}return T.style.left=tn+"px",T.style.top=nn+"px",_("fit"),$},$.set=function(t){return r(t)?(i(t)&&(t=L.parse(t)),E(t),A(),$):w()},$.get=function(t){return w(t)},$.source=s,$.self=T,$.visible=!1,$.on=S,$.off=X,$.fire=_,$.hooks=O,$.enter=function(t){return V(0,t),_("enter"),$},$})}(window,document,"CP"); \ No newline at end of file diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index 41353cc..f59fa27 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -1950,10 +1950,6 @@ let editor = new Vue({ .catch(function (error) { publishController.publishDisabled = false; - if(error.response.data.message) - { - publishController.errors.message = error.response.data.message; - } if(error.response.data.errors.message) { publishController.errors.message = error.response.data.errors.message; diff --git a/system/author/layouts/layout.twig b/system/author/layouts/layout.twig index af77634..777311e 100644 --- a/system/author/layouts/layout.twig +++ b/system/author/layouts/layout.twig @@ -16,7 +16,6 @@ - @@ -40,7 +39,6 @@ -