commit 62d4fe8fe9042df6a07d3da56359d0e05d2d423c
Author: Wayne
").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ");if(t.includes("
")||t.includes("
")){t=`
${t}
`}return t}function bB(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>{if(e.length==1){return" "}return e})).replace(//g,"")}const kB=["figcaption","li"];const wB=["ol","ul"];function AB(t){if(t.is("$text")||t.is("$textProxy")){return t.data}if(t.is("element","img")&&t.hasAttribute("alt")){return t.getAttribute("alt")}if(t.is("element","br")){return"\n"}let e="";let n=null;for(const i of t.getChildren()){e+=CB(i,n)+AB(i);n=i}return e}function CB(t,e){if(!e){return""}if(t.is("element","li")&&!t.isEmpty&&t.getChild(0).is("containerElement")){return"\n\n"}if(wB.includes(t.name)&&wB.includes(e.name)){return"\n\n"}if(!t.is("containerElement")&&!e.is("containerElement")){return""}if(kB.includes(t.name)||kB.includes(e.name)){return"\n"}return"\n\n"}class _B extends rh{static get pluginName(){return"ClipboardPipeline"}init(){const t=this.editor;const e=t.editing.view;e.addObserver(gB);this._setupPasteDrop();this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;this.listenTo(i,"clipboardInput",((e,n)=>{if(n.method=="paste"&&!t.model.canEditAt(t.model.document.selection)){e.stop()}}),{priority:"highest"});this.listenTo(i,"clipboardInput",((t,e)=>{const i=e.dataTransfer;let o;if(e.content){o=e.content}else{let t="";if(i.getData("text/html")){t=bB(i.getData("text/html"))}else if(i.getData("text/plain")){t=pB(i.getData("text/plain"))}o=this.editor.data.htmlProcessor.toView(t)}const r=new D(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:i,targetRanges:e.targetRanges,method:e.method});if(r.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:"low"});this.listenTo(this,"inputTransformation",((t,n)=>{if(n.content.isEmpty){return}const i=this.editor.data;const o=i.toModel(n.content,"$clipboardHolder");if(o.childCount==0){return}t.stop();e.change((()=>{this.fire("contentInsertion",{content:o,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))}),{priority:"low"});this.listenTo(this,"contentInsertion",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;const o=(t,n)=>{const i=n.dataTransfer;n.preventDefault();this._fireOutputTransformationEvent(i,e.selection,t.name)};this.listenTo(i,"copy",o,{priority:"low"});this.listenTo(i,"cut",((e,n)=>{if(!t.model.canEditAt(t.model.document.selection)){n.preventDefault()}else{o(e,n)}}),{priority:"low"});this.listenTo(this,"outputTransformation",((e,n)=>{const o=t.data.toView(n.content);i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:o,method:n.method})}),{priority:"low"});this.listenTo(i,"clipboardOutput",((n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content));i.dataTransfer.setData("text/plain",AB(i.content))}if(i.method=="cut"){t.model.deleteContent(e.selection)}}),{priority:"low"})}}class vB extends($()){constructor(){super(...arguments);this._stack=[]}add(t,e){const n=this._stack;const i=n[0];this._insertDescriptor(t);const o=n[0];if(i!==o&&!yB(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}remove(t,e){const n=this._stack;const i=n[0];this._removeDescriptor(t);const o=n[0];if(i!==o&&!yB(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}_insertDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t.id));if(yB(t,e[n])){return}if(n>-1){e.splice(n,1)}let i=0;while(e[i]&&xB(e[i],t)){i++}e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t));if(n>-1){e.splice(n,1)}}}function yB(t,e){return t&&e&&t.priority==e.priority&&EB(t.classes)==EB(e.classes)}function xB(t,e){if(t.priority>e.priority){return true}else if(t.priority
+ + This may be the first time you hear about this made-up disorder but + it actually isn’t so far from the truth. Even the studies that were conducted almost half a century show that + the language you speak has more effects on you than you realize. +
++ One of the very first experiments conducted on this topic dates back to 1964. + In the experiment + designed by linguist Ervin-Tripp who is an authority expert in psycholinguistic and sociolinguistic studies, + adults who are bilingual in English in French were showed series of pictures and were asked to create 3-minute stories. + In the end participants emphasized drastically different dynamics for stories in English and French. +
++ Another ground-breaking experiment which included bilingual Japanese women married to American men in San Francisco were + asked to complete sentences. The goal of the experiment was to investigate whether or not human feelings and thoughts + are expressed differently in different language mindsets. + Here is a sample from the the experiment: +
+| + | English | +Japanese | +
|---|---|---|
| Real friends should | +Be very frank | +Help each other | +
| I will probably become | +A teacher | +A housewife | +
| When there is a conflict with family | +I do what I want | +It's a time of great unhappiness | +
+ More recent studies show, the language a person speaks affects + their cognition, behaviour, emotions and hence their personality. + This shouldn’t come as a surprise + since we already know that different regions + of the brain become more active depending on the person’s activity at hand. Since structure, information and especially + the culture of languages varies substantially and the language a person speaks is an essential element of daily life. +
+").replace(/\r?\n/g,"
").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," "),(o.includes("
")||o.includes("
"))&&(o=`
${o}
`),o}function sS(o){return o.replace(/(\s+)<\/span>/g,(t,e)=>e.length==1?" ":e).replace(//g,"")}const Hg=["figcaption","li"],Ug=["ol","ul"];function qg(o){if(o.is("$text")||o.is("$textProxy"))return o.data;if(o.is("element","img")&&o.hasAttribute("alt"))return o.getAttribute("alt");if(o.is("element","br"))return` +`;let t="",e=null;for(const n of o.getChildren())t+=aS(n,e)+qg(n),e=n;return t}function aS(o,t){return t?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||Ug.includes(o.name)&&Ug.includes(t.name)?` + +`:!o.is("containerElement")&&!t.is("containerElement")?"":Hg.includes(o.name)||Hg.includes(t.name)?` +`:` + +`:""}class ve extends P{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Do),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method=="paste"&&!t.model.canEditAt(t.model.document.selection)&&r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let c;if(s.content)c=s.content;else{let d="";a.getData("text/html")?d=sS(a.getData("text/html")):a.getData("text/plain")&&(d=rS(a.getData("text/plain"))),c=this.editor.data.htmlProcessor.toView(d)}const l=new Pt(this,"inputTransformation");this.fire(l,{content:c,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),l.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const c=this.editor.data.toModel(s.content,"$clipboardHolder");c.childCount!=0&&(r.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=e.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document,r=(s,a)=>{const c=a.dataTransfer;a.preventDefault(),this._fireOutputTransformationEvent(c,e.selection,s.name)};this.listenTo(i,"copy",r,{priority:"low"}),this.listenTo(i,"cut",(s,a)=>{t.model.canEditAt(t.model.document.selection)?r(s,a):a.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(s,a)=>{const c=t.data.toView(a.content);i.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:c,method:a.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(s,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",qg(a.content))),a.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class cS extends ct(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i!==r&&!ca(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i!==r&&!ca(i,r)&&this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(ca(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&lS(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function ca(o,t){return o&&t&&o.priority==t.priority&&Ii(o.classes)==Ii(t.classes)}function lS(o,t){return o.priority>t.priority?!0:o.priority| t |