From fdb1b3084924ad515deaadf058c4aec53ec2f5ae Mon Sep 17 00:00:00 2001 From: Sibiraj Date: Tue, 3 Oct 2017 17:28:42 +0530 Subject: [PATCH] feat: height property for editable area --- docs/index.html | 2 +- ...e.bundle.js => inline.7592105dd06098fc91a8.bundle.js} | 2 +- docs/main.da145bc5715ac7d23378.bundle.js | 1 - docs/main.e5226f3858d1515860a8.bundle.js | 1 + src/app/app.component.ts | 2 ++ src/app/ngx-editor/ngx-editor.component.html | 2 +- src/app/ngx-editor/ngx-editor.component.ts | 9 ++++++--- src/app/ngx-editor/ngx-editor.defaults.ts | 2 ++ 8 files changed, 14 insertions(+), 7 deletions(-) rename docs/{inline.6c0759721ec60f001dae.bundle.js => inline.7592105dd06098fc91a8.bundle.js} (60%) delete mode 100644 docs/main.da145bc5715ac7d23378.bundle.js create mode 100644 docs/main.e5226f3858d1515860a8.bundle.js diff --git a/docs/index.html b/docs/index.html index 420c3f79..edba9043 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -NgxEditor \ No newline at end of file +NgxEditor \ No newline at end of file diff --git a/docs/inline.6c0759721ec60f001dae.bundle.js b/docs/inline.7592105dd06098fc91a8.bundle.js similarity index 60% rename from docs/inline.6c0759721ec60f001dae.bundle.js rename to docs/inline.7592105dd06098fc91a8.bundle.js index 2bffec5d..a8d06945 100644 --- a/docs/inline.6c0759721ec60f001dae.bundle.js +++ b/docs/inline.7592105dd06098fc91a8.bundle.js @@ -1 +1 @@ -!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var u,i,f,l=0,s=[];l"===l?this.htmlChange.emit(""):this.htmlChange.emit(l)},l.prototype.executeCommand=function(l){document.execCommand(l,!1,null)},l.prototype.blockQuote=function(){document.execCommand("formatBlock",!1,"
")},l.prototype.removeQuote=function(){document.execCommand("formatBlock",!1,"div")},l.prototype.ngOnInit=function(){!1===this.spellcheck&&(this.config.spellcheck=!1),!1===this.editable&&(this.config.editable=!1),this.element.nativeElement.getElementsByClassName("textarea")[0].innerHTML=this.html||""},l.ctorParameters=function(){return[{type:c.k}]},l}(),b=[m],C=c._1({encapsulation:0,styles:b,data:{}}),k=(c.Z("app-ngx-editor",h,e,{config:"config",html:"html",editable:"editable",spellcheck:"spellcheck",placeholder:"placeholder",translate:"translate"},{htmlChange:"htmlChange"},[]),t("qbdv")),x=[g],v=c._1({encapsulation:0,styles:x,data:{}}),O=c.Z("app-root",f,r,{},{},[]),P=t("fc+i"),M=function(){function l(){}return l}(),y=c._0(d,[f],function(l){return c._13([c._14(512,c.i,c.W,[[8,[O]],[3,c.i],c.x]),c._14(5120,c.v,c._12,[[3,c.v]]),c._14(4608,k.e,k.d,[c.v]),c._14(4608,c.h,c.h,[]),c._14(5120,c.a,c._5,[]),c._14(5120,c.t,c._10,[]),c._14(5120,c.u,c._11,[]),c._14(4608,P.b,P.s,[k.b]),c._14(6144,c.H,null,[P.b]),c._14(4608,P.e,P.f,[]),c._14(5120,P.c,function(l,n,t,u){return[new P.k(l),new P.o(n),new P.n(t,u)]},[k.b,k.b,k.b,P.e]),c._14(4608,P.d,P.d,[P.c,c.z]),c._14(135680,P.m,P.m,[k.b]),c._14(4608,P.l,P.l,[P.d,P.m]),c._14(6144,c.F,null,[P.l]),c._14(6144,P.p,null,[P.m]),c._14(4608,c.L,c.L,[c.z]),c._14(4608,P.g,P.g,[k.b]),c._14(4608,P.i,P.i,[k.b]),c._14(4608,s.h,s.m,[k.b,c.B,s.k]),c._14(4608,s.n,s.n,[s.h,s.l]),c._14(5120,s.a,function(l){return[l]},[s.n]),c._14(4608,s.j,s.j,[]),c._14(6144,s.i,null,[s.j]),c._14(4608,s.g,s.g,[s.i]),c._14(6144,s.b,null,[s.g]),c._14(5120,s.f,s.o,[s.b,[2,s.a]]),c._14(4608,s.c,s.c,[s.f]),c._14(512,k.a,k.a,[]),c._14(1024,c.l,P.q,[]),c._14(1024,c.b,function(l,n){return[P.r(l,n)]},[[2,P.h],[2,c.y]]),c._14(512,c.c,c.c,[[2,c.b]]),c._14(131584,c._3,c._3,[c.z,c.X,c.r,c.l,c.i,c.c]),c._14(2048,c.e,null,[c._3]),c._14(512,c.d,c.d,[c.e]),c._14(512,P.a,P.a,[[3,P.a]]),c._14(512,M,M,[]),c._14(512,s.e,s.e,[]),c._14(512,s.d,s.d,[]),c._14(512,d,d,[]),c._14(256,s.k,"XSRF-TOKEN",[]),c._14(256,s.l,"X-XSRF-TOKEN",[])])});a.production&&Object(c.R)(),Object(P.j)().bootstrapModuleFactory(y).catch(function(l){return console.log(l)})},gFIY:function(l,n){function t(l){return Promise.resolve().then(function(){throw new Error("Cannot find module '"+l+"'.")})}t.keys=function(){return[]},t.resolve=t,l.exports=t,t.id="gFIY"}},[0]); \ No newline at end of file diff --git a/docs/main.e5226f3858d1515860a8.bundle.js b/docs/main.e5226f3858d1515860a8.bundle.js new file mode 100644 index 00000000..8ece58f5 --- /dev/null +++ b/docs/main.e5226f3858d1515860a8.bundle.js @@ -0,0 +1 @@ +webpackJsonp([1],{0:function(l,n,t){l.exports=t("cDNt")},cDNt:function(l,n,t){"use strict";function u(l){return c._18(0,[(l()(),c._4(0,null,null,90,"div",[["class","ngx-editor"],["id","ngxEditor"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,85,"div",[["class","toolbar responsive"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,19,"div",[["class","set"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Bold"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("bold")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-bold"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Italic"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("italic")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-italic"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Underline"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("underline")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-underline"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Strikethrough"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("strikeThrough")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-strikethrough"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Superscript"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("superscript")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-superscript"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Subscript"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("subscript")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-subscript"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,19,"div",[["class","set no-sm-device"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Justify Left"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("justifyLeft")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-align-left"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Justify Center"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("justifyCenter")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-align-center"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Justify Right"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("justifyRight")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-align-right"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Justify"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("justifyFull")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-align-justify"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Indent"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("indent")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-indent"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Outdent"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("outdent")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-outdent"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,19,"div",[["class","set no-md-device"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Cut"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("cut")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-scissors"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Copy"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("copy")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-files-o"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Delete"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("delete")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-trash"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Clear Formatting"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("removeFormat")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-eraser"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Undo"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("undo")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-undo"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Redo"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("redo")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-repeat"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,19,"div",[["class","set no-md-device"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Paragraph"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("insertParagraph")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-paragraph"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Blockquote"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.blockQuote()&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-quote-left"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Remove Blockquote"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.removeQuote()&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-quote-right"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Horizontal Line"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("insertHorizontalRule")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-minus"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Unodered List"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("insertUnorderedList")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-list-ul"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"button",[["title","Ordered List"]],null,[[null,"click"]],function(l,n,t){var u=!0,e=l.component;if("click"===n){u=!1!==e.executeCommand("insertOrderedList")&&u}return u},null,null)),(l()(),c._4(0,null,null,0,"i",[["aria-hidden","true"],["class","fa fa-list-ol"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,0,"div",[["class","textarea"]],[[1,"contenteditable",0],[1,"placeholder",0],[1,"translate",0],[1,"spellcheck",0],[4,"height",null],[4,"minHeight",null]],[[null,"input"]],function(l,n,t){var u=!0,e=l.component;if("input"===n){e.html=t.target.innerHTML;u=!1!==e.htmlContentChange(t.target.innerHTML)&&u}return u},null,null)),(l()(),c._17(null,["\n"]))],null,function(l,n){var t=n.component;l(n,89,0,t.getBooleanProperty("editable"),t.placeholder||t.config.placeholder,t.translate||t.config.translate,t.getBooleanProperty("spellcheck"),t.height||t.config.height,t.minHeight||t.config.minHeight)})}function e(l){return c._18(0,[(l()(),c._4(0,null,null,1,"app-ngx-editor",[],null,null,null,u,C)),c._2(114688,null,0,p,[c.k],null,null)],function(l,n){l(n,1,0)},null)}function o(l){return c._18(0,[(l()(),c._4(0,null,null,7,"div",[["class","htmlblock block"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"h6",[],null,null,null,null,null)),(l()(),c._17(null,["HTML Output"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"div",[["class","html"]],null,null,null,null,null)),(l()(),c._17(null,["\n ","\n "])),(l()(),c._17(null,["\n "]))],null,function(l,n){l(n,6,0,n.component.htmlContent)})}function i(l){return c._18(0,[(l()(),c._4(0,null,null,48,"div",[["class","container"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,24,"div",[["class","logo block"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,0,"img",[["alt","ngx-Editor"],["src","assets/icons/ngx-editor.svg"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"h6",[],null,null,null,null,null)),(l()(),c._17(null,["WYSIWYG Editor for Angular Applications."])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"p",[],null,null,null,null,null)),(l()(),c._17(null,["(",")"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"a",[["aria-label","Follow @Sibiraj-S on GitHub"],["class","github-button"],["href","https://github.com/Sibiraj-S"]],null,null,null,null,null)),(l()(),c._17(null,["Follow @Sibiraj-S"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"a",[["aria-label","Fork Sibiraj-S/ngx-editor on GitHub"],["class","github-button"],["href","https://github.com/Sibiraj-S/ngx-editor/fork"]],null,null,null,null,null)),(l()(),c._17(null,["Fork"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"a",[["aria-label","Star Sibiraj-S/ngx-editor on GitHub"],["class","github-button"],["href","https://github.com/Sibiraj-S/ngx-editor"]],null,null,null,null,null)),(l()(),c._17(null,["Star"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"a",[["aria-label","Issue Sibiraj-S/ngx-editor on GitHub"],["class","github-button"],["data-show-count","true"],["href","https://github.com/Sibiraj-S/ngx-editor/issues"]],null,null,null,null,null)),(l()(),c._17(null,["Issue"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"a",[["aria-label","Download Sibiraj-S/ngx-editor on GitHub"],["class","github-button"],["href","https://github.com/Sibiraj-S/ngx-editor/archive/master.zip"]],null,null,null,null,null)),(l()(),c._17(null,["Download"])),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n\n "])),(l()(),c._4(0,null,null,4,"div",[["class","editor block"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"app-ngx-editor",[],null,[[null,"htmlChange"]],function(l,n,t){var u=!0,e=l.component;if("htmlChange"===n){u=!1!==(e.htmlContent=t)&&u}return u},u,C)),c._2(114688,null,0,p,[c.k],{config:[0,"config"],html:[1,"html"],spellcheck:[2,"spellcheck"],placeholder:[3,"placeholder"]},{htmlChange:"htmlChange"}),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n\n "])),(l()(),c.Y(16777216,null,null,1,null,o)),c._2(16384,null,0,k.c,[c.N,c.K],{ngIf:[0,"ngIf"]},null),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,10,"div",[["class","information block"]],null,null,null,null,null)),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,1,"h6",[],null,null,null,null,null)),(l()(),c._17(null,["Documentation"])),(l()(),c._17(null,["\n "])),(l()(),c._4(0,null,null,4,"p",[],null,null,null,null,null)),(l()(),c._17(null,["Check "])),(l()(),c._4(0,null,null,1,"a",[["href","https://github.com/Sibiraj-S/ngx-editor/wiki/ngxEditor"]],null,null,null,null,null)),(l()(),c._17(null,["wiki"])),(l()(),c._17(null,[" for more information"])),(l()(),c._17(null,["\n "])),(l()(),c._17(null,["\n"]))],function(l,n){var t=n.component;l(n,31,0,t.editorConfig,t.htmlContent,!0,"Enter text here..."),l(n,35,0,t.htmlContent)},function(l,n){l(n,10,0,n.component.latestRelease.name)})}function r(l){return c._18(0,[(l()(),c._4(0,null,null,2,"app-root",[],null,null,null,i,v)),c._15(512,null,_,_,[s.c]),c._2(114688,null,0,f,[_],null,null)],function(l,n){l(n,2,0)},null)}Object.defineProperty(n,"__esModule",{value:!0});var c=t("/oeL"),a={production:!0},d=function(){function l(){}return l}(),s=t("XKz0"),_=(t("5v8a"),function(){function l(l){this._http=l,this.releaseURL="https://api.github.com/repos/Sibiraj-S/ngx-editor/releases"}return l.prototype.getLatestRelease=function(){return this._http.get(this.releaseURL).map(function(l){return l&&0!==l.length?l[0]:[]})},l.ctorParameters=function(){return[{type:s.c}]},l}()),f=function(){function l(l){this._appService=l,this.title="ngx-editor",this.latestRelease={},this.editorConfig={editable:!0,spellcheck:!1,height:"5rem",minHeight:"2rem",placeholder:"Enter text here...",translate:"no"},this.htmlContent="WYSIWYG Editor for Angular Applications."}return l.prototype.getLatestRelease=function(){var l=this;this._appService.getLatestRelease().subscribe(function(n){return l.latestRelease=n},function(l){console.log(l)},function(){})},l.prototype.ngOnInit=function(){this.getLatestRelease()},l.ctorParameters=function(){return[{type:_}]},l}(),g=[".container[_ngcontent-%COMP%]{padding-top:1rem}.container[_ngcontent-%COMP%] .block[_ngcontent-%COMP%]{margin-bottom:1rem}.container[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{text-align:center}.container[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-bottom:.3rem}.container[_ngcontent-%COMP%] .htmlblock[_ngcontent-%COMP%] .html[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:4px;padding:.5rem;background-color:#f1f1f1;max-height:10rem;overflow:auto}pre[_ngcontent-%COMP%]{background:#f1f1f1;padding:0 1rem}mark[_ngcontent-%COMP%], pre[_ngcontent-%COMP%]{border-radius:3px}mark[_ngcontent-%COMP%]{background-color:#f1f1f1;padding:.1rem .4rem}"],m=['.ngx-editor[_ngcontent-%COMP%]{position:relative}.ngx-editor[_ngcontent-%COMP%] [contenteditable=true]:empty:before{content:attr(placeholder);display:block}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%]{background-color:#f5f5f5;border-bottom:1px solid #ddd;font-size:.8rem;padding:.2rem;border:1px solid #ddd}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%]{display:inline-block;border:1px solid #ddd;border-radius:5px;background-color:#fff}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#f5f5f5;background-color:transparent;border:0;padding:.4rem;min-width:2.5rem;float:left;border-right:1px solid #ddd}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{cursor:pointer;background-color:#e3e3e3;transition:.5s ease}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%] button.focus[_ngcontent-%COMP%], .ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus{outline:0}.ngx-editor[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .set[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:last-child{border-right:transparent}@media screen and (max-width:992px){.ngx-editor[_ngcontent-%COMP%] .toolbar.responsive[_ngcontent-%COMP%] .no-lg-device[_ngcontent-%COMP%]{display:none}}@media screen and (max-width:768px){.ngx-editor[_ngcontent-%COMP%] .toolbar.responsive[_ngcontent-%COMP%] .no-md-device[_ngcontent-%COMP%]{display:none}}@media screen and (max-width:480px){.ngx-editor[_ngcontent-%COMP%] .toolbar.responsive[_ngcontent-%COMP%] .no-sm-device[_ngcontent-%COMP%]{display:none}}@media screen and (max-width:320px){.ngx-editor[_ngcontent-%COMP%] .toolbar.responsive[_ngcontent-%COMP%] .no-xs-device[_ngcontent-%COMP%]{display:none}}.ngx-editor[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%]{min-height:5rem;padding:.5rem .8rem 1rem .8rem;border:1px solid #ddd;border-top:transparent;resize:vertical;overflow:auto;background-color:#fff}.ngx-editor[_ngcontent-%COMP%] .textarea.focus[_ngcontent-%COMP%], .ngx-editor[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%]:focus{outline:0}.ngx-editor[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%] blockquote{margin-left:1rem;border-left:.2em solid #dfe2e5;padding-left:.5rem}.ngx-editor[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%] .grabber[_ngcontent-%COMP%]{content:"";position:absolute;bottom:0;margin-left:-.8rem;cursor:s-resize;height:9px;width:100%;border-top:1px solid #f1f1f1;overflow:hidden;background-color:#eff0f1;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAFCAYAAABbyvyAAAAAMElEQVQoU2OcPHP+fwYGBobc9ERGEA0D1BZnpLaBuByM4gtkH1GbTdPgQvYd3SwCADaHRZrVIDeAAAAAAElFTkSuQmCC);background-image:url(grabber.734e8b82afd021356622.svg),none;background-size:initial;background-repeat:no-repeat;background-position:50%}.hide[_ngcontent-%COMP%]{display:none!important}'],h={editable:!0,spellcheck:!0,height:"5rem",minHeight:"inherit",translate:"yes",placeholder:"Enter text here...",toolbar:{text:["fontFamily","fontSize","bold","italic","underline","strikeThrough","superscript","subscript"],align:["justifyLeft","justifyCenter","justifyRight","justifyFull","indent","outdent"],action:["cut","copy","paste","delete","removeFormat","undo","redo"],insert:["image","paragraph","blockquote","removeBlockquote","html","horizontalLine","orderedList","unorderedList"],extras:["code","fullscreen","print"]}},p=function(){function l(l){this.element=l,this.htmlChange=new c.m}return Object.defineProperty(l.prototype,"config",{get:function(){return this._config||h},set:function(l){for(var n in h)l.hasOwnProperty(n)||(l[n]=h[n]);this._config=l},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"html",{get:function(){return this._html},set:function(l){this._html=l},enumerable:!0,configurable:!0}),l.prototype.htmlContentChange=function(l){"
"===l?this.htmlChange.emit(""):this.htmlChange.emit(l)},l.prototype.executeCommand=function(l){document.execCommand(l,!1,null)},l.prototype.blockQuote=function(){document.execCommand("formatBlock",!1,"
")},l.prototype.removeQuote=function(){document.execCommand("formatBlock",!1,"div")},l.prototype.getBooleanProperty=function(l){return!1!==this[l]&&(void 0!==this[l]||this.config[l])},l.prototype.ngOnInit=function(){this.element.nativeElement.getElementsByClassName("textarea")[0].innerHTML=this.html||""},l.ctorParameters=function(){return[{type:c.k}]},l}(),b=[m],C=c._1({encapsulation:0,styles:b,data:{}}),k=(c.Z("app-ngx-editor",p,e,{config:"config",html:"html",editable:"editable",spellcheck:"spellcheck",placeholder:"placeholder",translate:"translate",height:"height",minHeight:"minHeight"},{htmlChange:"htmlChange"},[]),t("qbdv")),x=[g],v=c._1({encapsulation:0,styles:x,data:{}}),O=c.Z("app-root",f,r,{},{},[]),P=t("fc+i"),M=function(){function l(){}return l}(),y=c._0(d,[f],function(l){return c._13([c._14(512,c.i,c.W,[[8,[O]],[3,c.i],c.x]),c._14(5120,c.v,c._12,[[3,c.v]]),c._14(4608,k.e,k.d,[c.v]),c._14(4608,c.h,c.h,[]),c._14(5120,c.a,c._5,[]),c._14(5120,c.t,c._10,[]),c._14(5120,c.u,c._11,[]),c._14(4608,P.b,P.s,[k.b]),c._14(6144,c.H,null,[P.b]),c._14(4608,P.e,P.f,[]),c._14(5120,P.c,function(l,n,t,u){return[new P.k(l),new P.o(n),new P.n(t,u)]},[k.b,k.b,k.b,P.e]),c._14(4608,P.d,P.d,[P.c,c.z]),c._14(135680,P.m,P.m,[k.b]),c._14(4608,P.l,P.l,[P.d,P.m]),c._14(6144,c.F,null,[P.l]),c._14(6144,P.p,null,[P.m]),c._14(4608,c.L,c.L,[c.z]),c._14(4608,P.g,P.g,[k.b]),c._14(4608,P.i,P.i,[k.b]),c._14(4608,s.h,s.m,[k.b,c.B,s.k]),c._14(4608,s.n,s.n,[s.h,s.l]),c._14(5120,s.a,function(l){return[l]},[s.n]),c._14(4608,s.j,s.j,[]),c._14(6144,s.i,null,[s.j]),c._14(4608,s.g,s.g,[s.i]),c._14(6144,s.b,null,[s.g]),c._14(5120,s.f,s.o,[s.b,[2,s.a]]),c._14(4608,s.c,s.c,[s.f]),c._14(512,k.a,k.a,[]),c._14(1024,c.l,P.q,[]),c._14(1024,c.b,function(l,n){return[P.r(l,n)]},[[2,P.h],[2,c.y]]),c._14(512,c.c,c.c,[[2,c.b]]),c._14(131584,c._3,c._3,[c.z,c.X,c.r,c.l,c.i,c.c]),c._14(2048,c.e,null,[c._3]),c._14(512,c.d,c.d,[c.e]),c._14(512,P.a,P.a,[[3,P.a]]),c._14(512,M,M,[]),c._14(512,s.e,s.e,[]),c._14(512,s.d,s.d,[]),c._14(512,d,d,[]),c._14(256,s.k,"XSRF-TOKEN",[]),c._14(256,s.l,"X-XSRF-TOKEN",[])])});a.production&&Object(c.R)(),Object(P.j)().bootstrapModuleFactory(y).catch(function(l){return console.log(l)})},gFIY:function(l,n){function t(l){return Promise.resolve().then(function(){throw new Error("Cannot find module '"+l+"'.")})}t.keys=function(){return[]},t.resolve=t,l.exports=t,t.id="gFIY"}},[0]); \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2b0f27e5..54587c7d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,6 +15,8 @@ export class AppComponent implements OnInit { editorConfig = { editable: true, spellcheck: false, + height: '5rem', + minHeight: '2rem', placeholder: 'Enter text here...', translate: 'no' }; diff --git a/src/app/ngx-editor/ngx-editor.component.html b/src/app/ngx-editor/ngx-editor.component.html index cc8159ab..5a2f8d77 100644 --- a/src/app/ngx-editor/ngx-editor.component.html +++ b/src/app/ngx-editor/ngx-editor.component.html @@ -35,5 +35,5 @@
+ [attr.spellcheck]="getBooleanProperty('spellcheck')" [style.height]="height || config['height']" [style.minHeight]="minHeight || config['minHeight']"> \ No newline at end of file diff --git a/src/app/ngx-editor/ngx-editor.component.ts b/src/app/ngx-editor/ngx-editor.component.ts index 99fe6f27..1ed2c57a 100644 --- a/src/app/ngx-editor/ngx-editor.component.ts +++ b/src/app/ngx-editor/ngx-editor.component.ts @@ -49,7 +49,8 @@ export class NgxEditorComponent implements OnInit { @Input() spellcheck: boolean; @Input() placeholder: string; @Input() translate: string; - + @Input() height: string; + @Input() minHeight: string; /* * update html on changes in content editable */ @@ -85,10 +86,12 @@ export class NgxEditorComponent implements OnInit { if (this[value] === false) { return false; } - if (this[value] === undefined) { + else if (this[value] === undefined) { return this.config[value]; } - return true; + else { + return true; + } } /* diff --git a/src/app/ngx-editor/ngx-editor.defaults.ts b/src/app/ngx-editor/ngx-editor.defaults.ts index 61e9f68a..afafadb8 100644 --- a/src/app/ngx-editor/ngx-editor.defaults.ts +++ b/src/app/ngx-editor/ngx-editor.defaults.ts @@ -1,6 +1,8 @@ export const ngxEditorConfig = { editable: true, spellcheck: true, + height: '5rem', + minHeight: 'inherit', translate: 'yes', placeholder: 'Enter text here...', toolbar: {