diff --git a/cypress/test01-system-setup.spec.js b/cypress/test01-system-setup.spec.js new file mode 100644 index 0000000..4d77026 --- /dev/null +++ b/cypress/test01-system-setup.spec.js @@ -0,0 +1,126 @@ +describe('Typemill Setup', function() +{ + it('validates form input', function () + { + // visit setup form + cy.visit('/setup') + cy.url().should('include','/setup') + + // add data and check attributes + cy.get('input[name="username"]') + .type('?1') + .should('have.value', '?1') + .and('have.attr', 'required') + + cy.get('input[name="email"]') + .type('trendschau.net') + .should('have.value', 'trendschau.net') + .and('have.attr', 'required') + + cy.get('input[name="password"]') + .type('pass') + .should('have.value', 'pass') + .and('have.attr', 'required') + + // submit and get validation errors + cy.get('form').submit() + cy.get('#flash-message').should('contain', 'Please check your input and try again') + cy.get('.error').should('contain', 'invalid characters') + cy.get('.error').should('contain', 'e-mail is invalid') + cy.get('.error').should('contain', 'Length between 5 - 20') + }) + + it('fails without CSRF-token', function () + { + cy.request({ + method: 'POST', + url: '/setup', // baseUrl is prepended to url + form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers + failOnStatusCode: false, + body: { + username: 'trendschau', + email: 'trendschau@gmail.com', + password: 'password' + } + }) + .its('body') + .should('include', 'Failed CSRF check') + }) + + it('submits valid form data and visit welcome and settings page', function () + { + cy.visit('/setup') + + // enter correct data + cy.get('input[name="username"]').clear().type('trendschau') + cy.get('input[name="email"]').clear().type('trendschau@gmail.com') + cy.get('input[name="password"]').clear().type('password') + + // submits valid form + cy.get('form').submit() + cy.url().should('include','/welcome') + cy.getCookie('typemill-session').should('exist') + Cypress.Cookies.preserveOnce('typemill-session') + + // clicks link on welcome page to settings page + cy.get('.button').should('contain', 'Configure your website') + cy.get('.button').click() + cy.url().should('include', '/tm/settings') + }) + + it('creates default settings data', function() + { + cy.get('input[name="settings[title]"]') + .should('have.value', 'TYPEMILL') + .and('have.attr','required') + cy.get('input[name="settings[author]"]') + .should('have.value', 'Unknown') + cy.get('select[name="settings[copyright]"]') + cy.get('input[name="settings[year]"]') + .should('have.attr', 'required') + cy.get('select[name="settings[language]"]') + cy.get('input[name="settings[sitemap]"]') + .should('have.value', 'http://localhost/typemillTest/cache/sitemap.xml') + .and('have.attr','readonly') + Cypress.Cookies.preserveOnce('typemill-session') + }) + + it('creates default user data', function() + { + cy.visit('/tm/user/trendschau') + cy.url().should('include', '/tm/user/trendschau') + + cy.get('input[name="showusername"]') + .should('have.value', 'trendschau') + .and('have.attr','disabled') + cy.get('input[name="username"]') + .should('have.value', 'trendschau') + cy.get('input[name="email"]') + .should('have.value', 'trendschau@gmail.com') + .and('have.attr','required') + cy.get('select[name="userrole"]') + .should('have.attr','required') + cy.get('input[name="password"]') + .should('have.value', '') + cy.get('input[name="newpassword"]') + .should('have.value', '') + }) + + it('logouts out', function() + { + // visits logout link + cy.visit('/tm/logout') + cy.url().should('include', '/tm/login') + + // tries to open setup form again and gets redirected to login + cy.visit('/setup') + cy.url().should('include','/login') + }) + + it('redirects when tries to setup again', function() + { + // tries to open setup form again and gets redirected to login + cy.visit('/setup') + cy.url().should('include','/login') + }) +}) \ No newline at end of file diff --git a/cypress/test02-initial-frontend.spec.js b/cypress/test02-initial-frontend.spec.js new file mode 100644 index 0000000..ed35f85 --- /dev/null +++ b/cypress/test02-initial-frontend.spec.js @@ -0,0 +1,148 @@ +describe('Typemill Initial Frontend', function() +{ + it('has startpage with buttons and links', function () + { + /* visit homepage */ + cy.visit('/') + + /* has start and setup button */ + cy.get('.actionLink').find('a').should(($a) => { + expect($a).to.have.length(1) + expect($a[0].href).to.match(/welcome/) + }) + + /* has start and setup button */ + cy.get('.toc-nav').find('a').should(($a) => { + expect($a).to.have.length(5) + expect($a[0].href).to.match(/welcome/) + expect($a[1].href).to.match(/welcome\/setup/) + expect($a[2].href).to.match(/welcome\/write-content/) + expect($a[3].href).to.match(/welcome\/get-help/) + expect($a[4].href).to.match(/welcome\/markdown-test/) + }) + }) + + it('has error page', function () + { + cy.request({ + url: '/error', + failOnStatusCode: false, + }) + .then((resp) => { + /* should return 404 not found */ + expect(resp.status).to.eq(404) + }) + + cy.visit('/error', { failOnStatusCode: false }) + cy.url().should('include','/error') + + cy.get('h1').contains('Not Found') + }) + + it('has no access to cache files', function () + { + cy.request({ + url: '/cache/structure.txt', + failOnStatusCode: false, + }) + .then((resp) => { + // redirect status code is 302 + expect(resp.status).to.eq(403) + }) + }) + + it('has sitemap xml', function () + { + cy.request({ + url: '/cache/sitemap.xml', + }) + .then((resp) => { + /* should return xml-format */ + expect(resp.headers).to.have.property('content-type','application/xml') + }) + }) + + it('has no access to dashboard', function () + { + cy.visit('/tm/settings') + cy.url().should('include','/tm/login') + }) + + it('has proper markdown test page', function () + { + cy.visit('/welcome/markdown-test') + cy.url().should('include','/welcome/markdown-test') + + /* has navigation element */ + cy.get('nav').should('exist') + + /* check if toc exists */ + cy.get('.TOC').within(($toc) =>{ + /* check if a certain link in toc exists */ + cy.get('a').eq(2).should('have.attr', 'href', '/typemillTest/welcome/markdown-test#headlines') + }) + + /* check if corresponding anchor exists */ + cy.get('#headlines').should('exist') + + /* soft linebreaks */ + cy.get('br').should('exist') + + /* emphasis */ + cy.get('em').should('exist') + + /* strong */ + cy.get('strong').should('exist') + + /* ordered list */ + cy.get('ol').should('exist') + + /* linebreak */ + cy.get('hr').should('exist') + + /* links exists? hard to test, any idea? We need to wrap it in a div... */ + + /* images */ + cy.get('img').eq(0).should('have.attr', 'alt', 'alt-text') + cy.get('img').eq(0).should('have.attr', 'src', 'media/markdown.png') + cy.get('img').eq(2).should('have.id', 'myid') + .and('have.class', 'otherclass') + .and('have.attr', 'alt', 'alt-text') + .and('have.attr', 'title', 'my title') + .and('have.attr', 'width', '150px') + + /* blockquote */ + cy.get('blockquote').should('exist') + + /* footnote */ + cy.get('sup').eq(0).should('have.id', 'fnref1:1') + cy.get('sup').eq(0).within(($sup) =>{ + cy.get('a').eq(0).should('have.attr', 'href', '/typemillTest/welcome/markdown-test#fn%3A1') + .and('have.class', 'footnote-ref') + }) + + /* abbreviation */ + cy.get('abbr').should('exist') + + /* definition list */ + cy.get('dl').should('exist') + + /* table */ + cy.get('table').should('exist') + + /* code */ + cy.get('pre').should('exist') + cy.get('code').should('exist') + + /* math */ + cy.get('.math').should('exist') + + /* footnote end */ + cy.get('.footnotes').within(($footnotes) => { + cy.get('li').eq(0).should('have.id', 'fn:1') + cy.get('a').eq(0).should('have.class', 'footnote-backref') + .and('have.attr', 'href', '/typemillTest/welcome/markdown-test#fnref1%3A1') + .and('have.attr', 'rev', 'footnote') + }) + }) +}) \ No newline at end of file diff --git a/cypress/test03-system-settings.spec.js b/cypress/test03-system-settings.spec.js new file mode 100644 index 0000000..4211609 --- /dev/null +++ b/cypress/test03-system-settings.spec.js @@ -0,0 +1,109 @@ +describe('Typemill System Settings', function() +{ + before(function () + { + cy.visit('/tm/login') + cy.url().should('include','/tm/login') + + cy.get('input[name="username"]').type('trendschau') + cy.get('input[name="password"]').type('password') + + cy.get('form').submit() + cy.url().should('include','/tm/content') + cy.getCookie('typemill-session').should('exist') + + cy.visit('/tm/settings') + cy.url().should('include','/tm/settings') + }) + + beforeEach(function () + { + Cypress.Cookies.preserveOnce('typemill-session') + }) + + it('validates the form', function() + { + // fill out valid data + cy.get('input[name="settings[title]"]') + .clear() + .type('Cypress 'content', 'cache' => true, 'cachePath' => $rootPath . 'cache', - 'version' => '1.3.4', + 'version' => '1.3.5', 'setup' => true, 'welcome' => true, 'images' => ['live' => ['width' => 820], 'thumbs' => ['width' => 250, 'height' => 150]], diff --git a/system/author/editor/editor-blox.twig b/system/author/editor/editor-blox.twig index 6017c79..fb48f19 100644 --- a/system/author/editor/editor-blox.twig +++ b/system/author/editor/editor-blox.twig @@ -12,7 +12,7 @@ v-bind:key="tab" v-bind:class="['tab-button', { active: currentTab === tab }]" v-on:click="currentTab = tab" - >${ tab|translate } + >${ tab|translate } Choose a content-type ' + '
' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -15,8 +15,8 @@ const contentComponent = Vue.component('content-block', { '' + '' + '
' + - '' + - '' + + '' + + '' + '
' + '
' + '
' + @@ -938,25 +938,25 @@ const tableComponent = Vue.component('table-component', { '' + '{{value}} ' + '
' + - '
{{ $t(\'add right column\') }}
' + - '
{{ $t(\'add left column\') }}
' + - '
{{ $t(\'delete column\') }}
' + + '
{{ \'add right column\'|translate }}
' + + '
{{ \'add left column\'|translate }}
' + + '
{{ \'delete column\'|translate }}
' + '
' + '' + '' + '
' + - '
{{ $t(\'add row above\') }}
' + - '
{{ $t(\'add row below\') }}
' + - '
{{ $t(\'delete row\') }}
' + + '
{{ \'add row above\'|translate }}
' + + '
{{ \'add row below\'|translate }}
' + + '
{{ \'delete row\'|translate }}
' + '
' + - '{{ $t(value) }}' + + '{{ value|translate }}' + '' + '
' + - '
{{ $t(\'add row above\') }}
' + - '
{{ $t(\'add row below\') }}
' + - '
{{ $t(\'delete row\') }}
' + + '
{{ \'add row above\'|translate }}
' + + '
{{ \'add row below\'|translate }}
' + + '
{{ \'delete row\'|translate }}
' + '
' + - '{{ $t(value) }}' + + '{{ value|translate }}' + '' + '' + '' + @@ -1135,13 +1135,13 @@ const definitionComponent = Vue.component('definition-component', { '' + '
' + '' + - '' + + '' + '' + - '' + + '' + '' + '
' + '
' + - '' + + '' + '
' + '
', mounted: function(){ @@ -1211,8 +1211,8 @@ const videoComponent = Vue.component('video-component', { props: ['compmarkdown', 'disabled', 'load'], template: '
' + '
' + - '' + - '
' + + '' + + '
' + '
', mounted: function(){ @@ -1242,7 +1242,7 @@ const imageComponent = Vue.component('image-component', { '' + '
' + ' ' + - '

{{ $t(\'drag a picture or click to select\') }}

' + + '

{{ \'drag a picture or click to select\'|translate }}

' + '
' + '' + '' + @@ -1254,12 +1254,12 @@ const imageComponent = Vue.component('image-component', { '' + '
' + '
' + - '' + - '' + - '' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + + '' + + '' + '
', data: function(){ return { @@ -1534,7 +1534,7 @@ const fileComponent = Vue.component('file-component', { '' + '
' + ' ' + - '

{{ $t(\'upload file\') }}

' + + '

{{ \'upload file\'|translate }}

' + '
' + '' + '' + @@ -1545,7 +1545,7 @@ const fileComponent = Vue.component('file-component', { '
' + '
' + '
' + - '' + + '' + '' + '' + '
', @@ -1725,7 +1725,7 @@ const medialib = Vue.component('medialib', { template: '
' + '
' + '
' + - '' + + '' + '
' + '
' + '
' + @@ -1895,13 +1895,16 @@ const medialib = Vue.component('medialib', { var searchimages = this.search; var filteredImages = {}; var images = this.imagedata; - Object.keys(images).forEach(function(key) { - var searchindex = key + ' ' + images[key].name; - if(searchindex.toLowerCase().indexOf(searchimages.toLowerCase()) !== -1) - { - filteredImages[key] = images[key]; - } - }); + if(images) + { + Object.keys(images).forEach(function(key) { + var searchindex = key + ' ' + images[key].name; + if(searchindex.toLowerCase().indexOf(searchimages.toLowerCase()) !== -1) + { + filteredImages[key] = images[key]; + } + }); + } return filteredImages; }, filteredFiles() { @@ -1909,13 +1912,16 @@ const medialib = Vue.component('medialib', { var searchfiles = this.search; var filteredFiles = {}; var files = this.filedata; - Object.keys(files).forEach(function(key) { - var searchindex = key + ' ' + files[key].name; - if(searchindex.toLowerCase().indexOf(searchfiles.toLowerCase()) !== -1) - { - filteredFiles[key] = files[key]; - } - }); + if(files) + { + Object.keys(files).forEach(function(key) { + var searchindex = key + ' ' + files[key].name; + if(searchindex.toLowerCase().indexOf(searchfiles.toLowerCase()) !== -1) + { + filteredFiles[key] = files[key]; + } + }); + } return filteredFiles; } }, @@ -2217,12 +2223,7 @@ for(var i = 0; i < formatConfig.length; i++) } } -let editor = new Vue({ - i18n: new VueI18n({ - locale: language, - messages: vuejsLabels - }), - +let editor = new Vue({ delimiters: ['${', '}'], el: '#blox', /* components: componentList, */ diff --git a/system/author/js/vue-i18n.min.js b/system/author/js/vue-i18n.min.js deleted file mode 100644 index d3cc572..0000000 --- a/system/author/js/vue-i18n.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * vue-i18n v8.15.3 - * (c) 2019 kazuya kawaguchi - * Released under the MIT License. - */ -var t,e;t=this,e=function(){"use strict";var t=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function n(t){return null!==t&&"object"==typeof t}var r=Object.prototype.toString,i="[object Object]";function a(t){return r.call(t)===i}function s(t){return null==t}function o(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=null,i=null;return 1===t.length?n(t[0])||Array.isArray(t[0])?i=t[0]:"string"==typeof t[0]&&(r=t[0]):2===t.length&&("string"==typeof t[0]&&(r=t[0]),(n(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:r,params:i}}function l(t){return JSON.parse(JSON.stringify(t))}var c=Object.prototype.hasOwnProperty;function u(t,e){return c.call(t,e)}function f(t){for(var e=arguments,r=Object(t),i=1;i0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[t,i.locale,i._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(y),y.mixin(p),y.directive("t",{bind:d,update:F,unbind:k}),y.component(m.name,m),y.component(b.name,b),y.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var T=function(){this._caches=Object.create(null)};T.prototype.interpolate=function(t,e){if(!e)return[t];var r=this._caches[t];return r||(r=function(t){var e=[],n=0,r="";for(;n0)f--,u=N,h[I]();else{if(f=0,void 0===n)return!1;if(!1===(n=z(n)))return!1;h[O]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(i=P(e),(a=(o=V[u])[i]||o.else||R)===R)return;if(u=a[0],(s=h[a[1]])&&(r=void 0===(r=a[2])?e:r,!1===s()))return;if(u===H)return l}}(t))&&(this._cache[t]=e),e||[]},J.prototype.getPathValue=function(t,e){if(!n(t))return null;var r=this.parsePath(e);if(0===r.length)return null;for(var i=r.length,a=t,s=0;s/,B=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,G=/^@(?:\.([a-z]+))?:/,X=/[()]/g,Z={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()}},K=new T,Q=function(t){var e=this;void 0===t&&(t={}),!y&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);var n=t.locale||"en-US",r=t.fallbackLocale||"en-US",i=t.messages||{},a=t.dateTimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||K,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new J,this._dataListeners=[],this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._exist=function(t,n){return!(!t||!n)&&(!s(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(i).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}),this._initVM({locale:n,fallbackLocale:r,messages:i,dateTimeFormats:a,numberFormats:o})},Y={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0}};return Q.prototype._checkLocaleMessage=function(t,n,r){var i=function(t,n,r,s){if(a(r))Object.keys(r).forEach(function(e){var o=r[e];a(o)?(s.push(e),s.push("."),i(t,n,o,s),s.pop(),s.pop()):(s.push(e),i(t,n,o,s),s.pop())});else if(Array.isArray(r))r.forEach(function(e,r){a(e)?(s.push("["+r+"]"),s.push("."),i(t,n,e,s),s.pop(),s.pop()):(s.push("["+r+"]"),i(t,n,e,s),s.pop())});else if("string"==typeof r){if(q.test(r)){var o="Detected HTML in message '"+r+"' of keypath '"+s.join("")+"' at '"+n+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(o):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(o)}}};i(n,t,r,[])},Q.prototype._initVM=function(t){var e=y.config.silent;y.config.silent=!0,this._vm=new y({data:t}),y.config.silent=e},Q.prototype.destroyVM=function(){this._vm.$destroy()},Q.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},Q.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)t.splice(n,1)}}(this._dataListeners,t)},Q.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e=t._dataListeners.length;e--;)y.nextTick(function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()})},{deep:!0})},Q.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},Y.vm.get=function(){return this._vm},Y.messages.get=function(){return l(this._getMessages())},Y.dateTimeFormats.get=function(){return l(this._getDateTimeFormats())},Y.numberFormats.get=function(){return l(this._getNumberFormats())},Y.availableLocales.get=function(){return Object.keys(this.messages).sort()},Y.locale.get=function(){return this._vm.locale},Y.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},Y.fallbackLocale.get=function(){return this._vm.fallbackLocale},Y.fallbackLocale.set=function(t){this._vm.$set(this._vm,"fallbackLocale",t)},Y.formatFallbackMessages.get=function(){return this._formatFallbackMessages},Y.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},Y.missing.get=function(){return this._missing},Y.missing.set=function(t){this._missing=t},Y.formatter.get=function(){return this._formatter},Y.formatter.set=function(t){this._formatter=t},Y.silentTranslationWarn.get=function(){return this._silentTranslationWarn},Y.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},Y.silentFallbackWarn.get=function(){return this._silentFallbackWarn},Y.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},Y.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},Y.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},Y.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},Y.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},Q.prototype._getMessages=function(){return this._vm.messages},Q.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Q.prototype._getNumberFormats=function(){return this._vm.numberFormats},Q.prototype._warnDefault=function(t,e,n,r,i){if(!s(n))return n;if(this._missing){var a=this._missing.apply(null,[t,e,r,i]);if("string"==typeof a)return a}if(this._formatFallbackMessages){var l=o.apply(void 0,i);return this._render(e,"string",l.params,e)}return e},Q.prototype._isFallbackRoot=function(t){return!t&&!s(this._root)&&this._fallbackRoot},Q.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},Q.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},Q.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},Q.prototype._interpolate=function(t,e,n,r,i,o,l){if(!e)return null;var c,u=this._path.getPathValue(e,n);if(Array.isArray(u)||a(u))return u;if(s(u)){if(!a(e))return null;if("string"!=typeof(c=e[n]))return null}else{if("string"!=typeof u)return null;c=u}return(c.indexOf("@:")>=0||c.indexOf("@.")>=0)&&(c=this._link(t,e,c,r,"raw",o,l)),this._render(c,i,o,n)},Q.prototype._link=function(t,e,n,r,i,a,s){var o=n,l=o.match(B);for(var c in l)if(l.hasOwnProperty(c)){var u=l[c],f=u.match(G),h=f[0],p=f[1],m=u.replace(h,"").replace(X,"");if(s.includes(m))return o;s.push(m);var g=this._interpolate(t,e,m,r,"raw"===i?"string":i,"raw"===i?void 0:a,s);if(this._isFallbackRoot(g)){if(!this._root)throw Error("unexpected error");var _=this._root.$i18n;g=_._translate(_._getMessages(),_.locale,_.fallbackLocale,m,r,i,a)}g=this._warnDefault(t,m,g,r,Array.isArray(a)?a:[a]),this._modifiers.hasOwnProperty(p)?g=this._modifiers[p](g):Z.hasOwnProperty(p)&&(g=Z[p](g)),s.pop(),o=g?o.replace(u,g):o}return o},Q.prototype._render=function(t,e,n,r){var i=this._formatter.interpolate(t,n,r);return i||(i=K.interpolate(t,n,r)),"string"===e?i.join(""):i},Q.prototype._translate=function(t,e,n,r,i,a,o){var l=this._interpolate(e,t[e],r,i,a,o,[r]);return s(l)&&s(l=this._interpolate(n,t[n],r,i,a,o,[r]))?null:l},Q.prototype._t=function(t,e,n,r){for(var i,a=[],s=arguments.length-4;s-- >0;)a[s]=arguments[s+4];if(!t)return"";var l=o.apply(void 0,a),c=l.locale||e,u=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[t].concat(a))}return this._warnDefault(c,t,u,r,a)},Q.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},Q.prototype._i=function(t,e,n,r,i){var a=this._translate(n,e,this.fallbackLocale,t,r,"raw",i);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,i)}return this._warnDefault(e,t,a,r,[i])},Q.prototype.i=function(t,e,n){return t?("string"!=typeof e&&(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},Q.prototype._tc=function(t,e,n,r,i){for(var a,s=[],l=arguments.length-5;l-- >0;)s[l]=arguments[l+5];if(!t)return"";void 0===i&&(i=1);var c={count:i,n:i},u=o.apply(void 0,s);return u.params=Object.assign(c,u.params),s=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((a=this)._t.apply(a,[t,e,n,r].concat(s)),i)},Q.prototype.fetchChoice=function(t,e){if(!t&&"string"!=typeof t)return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},Q.prototype.getChoiceIndex=function(t,e){var n,r;return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):(n=t,r=e,n=Math.abs(n),2===r?n?n>1?1:0:1:n?Math.min(n,2):0)},Q.prototype.tc=function(t,e){for(var n,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},Q.prototype._te=function(t,e,n){for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var a=o.apply(void 0,r).locale||e;return this._exist(n[a],t)},Q.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},Q.prototype.getLocaleMessage=function(t){return l(this._vm.messages[t]||{})},Q.prototype.setLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,e)},Q.prototype.mergeLocaleMessage=function(t,e){("warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||(this._checkLocaleMessage(t,this._warnHtmlInMessage,e),"error"!==this._warnHtmlInMessage))&&this._vm.$set(this._vm.messages,t,f({},this._vm.messages[t]||{},e))},Q.prototype.getDateTimeFormat=function(t){return l(this._vm.dateTimeFormats[t]||{})},Q.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e)},Q.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,f(this._vm.dateTimeFormats[t]||{},e))},Q.prototype._localizeDateTime=function(t,e,n,r,i){var a=e,o=r[a];if((s(o)||s(o[i]))&&(o=r[a=n]),s(o)||s(o[i]))return null;var l=o[i],c=a+"__"+i,u=this._dateTimeFormatters[c];return u||(u=this._dateTimeFormatters[c]=new Intl.DateTimeFormat(a,l)),u.format(t)},Q.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},Q.prototype.d=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=this.locale,a=null;return 1===e.length?"string"==typeof e[0]?a=e[0]:n(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(a=e[0].key)):2===e.length&&("string"==typeof e[0]&&(a=e[0]),"string"==typeof e[1]&&(i=e[1])),this._d(t,i,a)},Q.prototype.getNumberFormat=function(t){return l(this._vm.numberFormats[t]||{})},Q.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e)},Q.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,f(this._vm.numberFormats[t]||{},e))},Q.prototype._getNumberFormatter=function(t,e,n,r,i,a){var o=e,l=r[o];if((s(l)||s(l[i]))&&(l=r[o=n]),s(l)||s(l[i]))return null;var c,u=l[i];if(a)c=new Intl.NumberFormat(o,Object.assign({},u,a));else{var f=o+"__"+i;(c=this._numberFormatters[f])||(c=this._numberFormatters[f]=new Intl.NumberFormat(o,u))}return c},Q.prototype._n=function(t,e,n,r){if(!Q.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.format(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return a||""},Q.prototype.n=function(e){for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];var a=this.locale,s=null,o=null;return 1===r.length?"string"==typeof r[0]?s=r[0]:n(r[0])&&(r[0].locale&&(a=r[0].locale),r[0].key&&(s=r[0].key),o=Object.keys(r[0]).reduce(function(e,n){var i;return t.includes(n)?Object.assign({},e,((i={})[n]=r[0][n],i)):e},null)):2===r.length&&("string"==typeof r[0]&&(s=r[0]),"string"==typeof r[1]&&(a=r[1])),this._n(e,a,s,o)},Q.prototype._ntp=function(t,e,n,r){if(!Q.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var i=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),a=i&&i.formatToParts(t);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return a||[]},Object.defineProperties(Q.prototype,Y),Object.defineProperty(Q,"availabilities",{get:function(){if(!U){var t="undefined"!=typeof Intl;U={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return U}}),Q.install=D,Q.version="8.15.3",Q},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e(); diff --git a/system/author/layouts/layout.twig b/system/author/layouts/layout.twig index e96b3ed..b0136b1 100644 --- a/system/author/layouts/layout.twig +++ b/system/author/layouts/layout.twig @@ -17,8 +17,8 @@ - - + + @@ -56,7 +56,7 @@
- - + + \ No newline at end of file diff --git a/system/author/layouts/layoutAuth.twig b/system/author/layouts/layoutAuth.twig index e0abd9e..ff809c9 100644 --- a/system/author/layouts/layoutAuth.twig +++ b/system/author/layouts/layoutAuth.twig @@ -18,7 +18,7 @@ - + @@ -54,6 +54,6 @@ {% block content %}{% endblock %}
- + \ No newline at end of file diff --git a/system/author/layouts/layoutBlank.twig b/system/author/layouts/layoutBlank.twig index 72a8d8c..244ebb6 100644 --- a/system/author/layouts/layoutBlank.twig +++ b/system/author/layouts/layoutBlank.twig @@ -17,7 +17,7 @@ - + diff --git a/system/author/layouts/layoutBlox.twig b/system/author/layouts/layoutBlox.twig index 382265a..7bc2e0e 100644 --- a/system/author/layouts/layoutBlox.twig +++ b/system/author/layouts/layoutBlox.twig @@ -18,7 +18,7 @@ - + {{ assets.renderCSS() }} @@ -196,28 +196,27 @@ const myaxios = axios.create(); myaxios.defaults.baseURL = "{{ base_url }}"; - - - - - - - + + + + + + {{ assets.renderEditorJS() }} - - - - - - + + + + + + {{ assets.renderJS() }} diff --git a/system/author/layouts/layoutEditor.twig b/system/author/layouts/layoutEditor.twig index 13aa684..3430b0a 100644 --- a/system/author/layouts/layoutEditor.twig +++ b/system/author/layouts/layoutEditor.twig @@ -18,7 +18,7 @@ - + {{ assets.renderCSS() }} @@ -83,29 +83,29 @@
- + - - - - - + + + + + {{ assets.renderEditorJS() }} - - - - + + + + {{ assets.renderJS() }} diff --git a/system/author/partials/fields.twig b/system/author/partials/fields.twig index bd81206..41b229b 100644 --- a/system/author/partials/fields.twig +++ b/system/author/partials/fields.twig @@ -62,7 +62,7 @@ {% endif %} - {% if field.description %}
{{field.description}}
{% endif %} + {% if field.description %}
{{ __(field.description) }}
{% endif %} {% if errors[itemName][field.name] %} {{ errors[itemName][field.name] | first }}