From 42eacba15b3ca6ee85268b9171662c3ab13df80e Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Wed, 20 Mar 2019 10:07:59 +0300 Subject: [PATCH] Add warning tool, fix XSS in image alt-tag (#75) * Add warning tool, fix XSS in image alt-tag * production build * Upgrade editor * Add spaces --- package.json | 9 +- public/dist/code-styling.bundle.js | 2 +- public/dist/editor.bundle.js | 24 +- public/dist/main.bundle.js | 2 +- public/dist/main.css | 2 +- src/frontend/js/classes/codeStyler.js | 6 +- src/frontend/js/classes/editor.js | 6 + src/frontend/styles/components/page.pcss | 25 + src/views/pages/blocks/image.twig | 8 +- src/views/pages/blocks/warning.twig | 11 + src/views/pages/page.twig | 2 +- yarn.lock | 1032 +--------------------- 12 files changed, 84 insertions(+), 1045 deletions(-) create mode 100644 src/views/pages/blocks/warning.twig diff --git a/package.json b/package.json index 3e46a5a..54d942b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:dev": "webpack ./src/frontend/js/app.js --o='./public/dist/[name].bundle.js' --output-library=Docs --output-public-path=/dist/ -p --mode=development --watch", "precommit": "yarn lint && yarn test --exit", "generatePassword": "node ./generatePassword.js", - "editor-upgrade": "yarn add -D @editorjs/{editorjs,header,code,delimiter,list,image,table,inline-code,marker}@latest" + "editor-upgrade": "yarn add -D @editorjs/{editorjs,header,code,delimiter,list,image,table,inline-code,marker,warning}@latest" }, "dependencies": { "bcrypt": "^3.0.3", @@ -42,15 +42,17 @@ "@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/polyfill": "^7.2.5", "@babel/preset-env": "^7.1.0", + "@codexteam/misprints": "^1.0.0", "@editorjs/code": "^2.4.0", "@editorjs/delimiter": "^1.1.0", - "@editorjs/editorjs": "^2.11.8", + "@editorjs/editorjs": "^2.12.0", "@editorjs/header": "^2.2.2", "@editorjs/image": "^2.1.2", "@editorjs/inline-code": "^1.3.0", - "@editorjs/list": "^1.3.1", + "@editorjs/list": "^1.3.2", "@editorjs/marker": "^1.2.0", "@editorjs/table": "^1.2.0", + "@editorjs/warning": "^1.1.0", "autoprefixer": "^9.1.3", "babel": "^6.23.0", "babel-eslint": "^10.0.1", @@ -67,7 +69,6 @@ "eslint-plugin-standard": "^4.0.0", "highlight.js": "^9.13.1", "husky": "^1.1.2", - "@codexteam/misprints": "^1.0.0", "mini-css-extract-plugin": "^0.4.3", "mocha": "^5.2.0", "mocha-sinon": "^2.1.0", diff --git a/public/dist/code-styling.bundle.js b/public/dist/code-styling.bundle.js index 63a00de..66cd60d 100644 --- a/public/dist/code-styling.bundle.js +++ b/public/dist/code-styling.bundle.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(60).concat([function(e,n,t){var r=t(61),a=t(17);e.exports=function(e){return r(a(e))}},function(e,n,t){var r=t(11);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,n,t){var r=t(32)("keys"),a=t(20);e.exports=function(e){return r[e]||(r[e]=a(e))}},function(e,n,t){var r=t(17);e.exports=function(e){return Object(r(e))}},function(e,n,t){var r=t(66),a=t(65);e.exports=Object.keys||function(e){return r(e,a)}},function(e,n){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,n,t){var r=t(18),a=t(60),i=t(67)(!1),s=t(62)("IE_PROTO");e.exports=function(e,n){var t,o=a(e),c=0,l=[];for(t in o)t!=s&&r(o,t)&&l.push(t);for(;n.length>c;)r(o,t=n[c++])&&(~i(l,t)||l.push(t));return l}},function(e,n,t){var r=t(60),a=t(16),i=t(68);e.exports=function(e){return function(n,t,s){var o,c=r(n),l=a(c.length),u=i(s,l);if(e&&t!=t){for(;l>u;)if((o=c[u++])!=o)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===t)return e||u||0;return!e&&-1}}},function(e,n,t){var r=t(21),a=Math.max,i=Math.min;e.exports=function(e,n){return(e=r(e))<0?a(e+n,0):i(e,n)}},function(e,n,t){"use strict";var r=t(23),a=t(9),i=t(14),s=t(10),o=t(19),c=t(84),l=t(33),u=t(87),f=t(1)("iterator"),g=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,n,t,p,v,E,b){c(t,n,p);var h,m,_,y=function(e){if(!g&&e in w)return w[e];switch(e){case"keys":case"values":return function(){return new t(this,e)}}return function(){return new t(this,e)}},N=n+" Iterator",O="values"==v,R=!1,w=e.prototype,x=w[f]||w["@@iterator"]||v&&w[v],S=x||y(v),M=v?O?y("entries"):S:void 0,A="Array"==n&&w.entries||x;if(A&&(_=u(A.call(new e)))!==Object.prototype&&_.next&&(l(_,N,!0),r||"function"==typeof _[f]||s(_,f,d)),O&&x&&"values"!==x.name&&(R=!0,S=function(){return x.call(this)}),r&&!b||!g&&!R&&w[f]||s(w,f,S),o[n]=S,o[N]=d,v)if(h={values:O?S:y("values"),keys:E?S:y("keys"),entries:M},b)for(m in h)m in w||i(w,m,h[m]);else a(a.P+a.F*(g||R),n,h);return h}},,,,,,,,,,,,,,function(e,n,t){"use strict";var r=t(39)(!0);t(69)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,n=this._t,t=this._i;return t>=n.length?{value:void 0,done:!0}:(e=r(n,t),this._i+=e.length,{value:e,done:!1})})},function(e,n,t){"use strict";var r=t(85),a=t(31),i=t(33),s={};t(10)(s,t(1)("iterator"),function(){return this}),e.exports=function(e,n,t){e.prototype=r(s,{next:a(1,t)}),i(e,n+" Iterator")}},function(e,n,t){var r=t(2),a=t(86),i=t(65),s=t(62)("IE_PROTO"),o=function(){},c=function(){var e,n=t(22)("iframe"),r=i.length;for(n.style.display="none",t(37).appendChild(n),n.src="javascript:",(e=n.contentWindow.document).open(),e.write("