From 854842095f48037357c49599bd9c972d5fe71fa5 Mon Sep 17 00:00:00 2001 From: Vitalii Parfonov Date: Thu, 26 Jan 2017 19:13:54 +0200 Subject: [PATCH] CHE-3811: move js file to the che-lib/che-orion-editor Signed-off-by: Vitalii Parfonov --- assembly/assembly-ide-war/pom.xml | 4 + .../resources/org/eclipse/che/ide/IDE.gwt.xml | 1 + .../che-plugin-orion-compare/pom.xml | 12 - .../eclipse/che/ide/orion/public/Compare.html | 104 - .../OrionIconFont-Regular.eot | Bin 24134 -> 0 bytes .../OrionIconFont-Regular.svg | 259 - .../OrionIconFont-Regular.ttf | Bin 23816 -> 0 bytes .../OrionIconFont-Regular.woff | Bin 14336 -> 0 bytes .../built-compare-amd.min.js | 18 - .../built-compare-12.0/built-compare.css | 4558 -- .../orion/public/built-compare-codenvy.css | 4589 -- .../public/built-compare-dark-codenvy.css | 4592 -- .../che-plugin-orion-editor/pom.xml | 59 - .../src/main/patches/fix_focus.diff | 15 - .../src/main/patches/fix_goto_line.diff | 55 - .../src/main/patches/fix_linked_mode.diff | 70 - .../src/main/patches/fix_scrolling.diff | 13 - .../code_edit/built-codeEdit-amd.js | 43964 ---------------- .../code_edit/built-codeEdit.css | 2457 - .../javascript/plugins/javascriptPlugin.html | 11 - .../javascript/plugins/javascriptPlugin.js | 10 - .../javascript/plugins/ternWorker.js | 20 - .../javascript/plugins/ternWorkerCore.js | 500 - .../orion/require-config.js | 29 - .../plugins/embeddedToolingPlugin.html | 11 - .../plugins/embeddedToolingPlugin.js | 4 - .../requirejs/require.min.js | 36 - .../webtools/plugins/webToolsPlugin.html | 11 - .../webtools/plugins/webToolsPlugin.js | 11 - .../cheJavaHighlightingPlugin/lib/plugin.js | 576 - .../cheJavaHighlightingPlugin/plugin.html | 117 - .../public/orion/CheContentAssistMode.js | 39 - pom.xml | 5 + 33 files changed, 10 insertions(+), 62140 deletions(-) delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/Compare.html delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.eot delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.svg delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.ttf delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.woff delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare-amd.min.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare.css delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-codenvy.css delete mode 100644 plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-dark-codenvy.css delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_focus.diff delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_goto_line.diff delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_linked_mode.diff delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_scrolling.diff delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit.css delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.html delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorker.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorkerCore.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/orion/require-config.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/plugins/embeddedToolingPlugin.html delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/plugins/embeddedToolingPlugin.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/requirejs/require.min.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/webtools/plugins/webToolsPlugin.html delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/webtools/plugins/webToolsPlugin.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/cheJavaHighlightingPlugin/lib/plugin.js delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/cheJavaHighlightingPlugin/plugin.html delete mode 100644 plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/orion/CheContentAssistMode.js diff --git a/assembly/assembly-ide-war/pom.xml b/assembly/assembly-ide-war/pom.xml index 829c8a6d4fe..9f2141d614b 100644 --- a/assembly/assembly-ide-war/pom.xml +++ b/assembly/assembly-ide-war/pom.xml @@ -80,6 +80,10 @@ org.eclipse.che.core wsmaster-local + + org.eclipse.che.lib + che-orion-editor + org.eclipse.che.lib che-swagger-module diff --git a/assembly/assembly-ide-war/src/main/resources/org/eclipse/che/ide/IDE.gwt.xml b/assembly/assembly-ide-war/src/main/resources/org/eclipse/che/ide/IDE.gwt.xml index ede032b0f8f..9e4ccdb75a3 100644 --- a/assembly/assembly-ide-war/src/main/resources/org/eclipse/che/ide/IDE.gwt.xml +++ b/assembly/assembly-ide-war/src/main/resources/org/eclipse/che/ide/IDE.gwt.xml @@ -87,6 +87,7 @@ + diff --git a/plugins/plugin-orion/che-plugin-orion-compare/pom.xml b/plugins/plugin-orion/che-plugin-orion-compare/pom.xml index 354ac2967d0..9ba574758f3 100644 --- a/plugins/plugin-orion/che-plugin-orion-compare/pom.xml +++ b/plugins/plugin-orion/che-plugin-orion-compare/pom.xml @@ -60,17 +60,5 @@ src/main/resources - - - com.mycila - license-maven-plugin - - - - **/orion/public/built-compare-12.0/* - - - - diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/Compare.html b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/Compare.html deleted file mode 100644 index e1ddb6f4934..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/Compare.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - -
- - diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.eot b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.eot deleted file mode 100644 index 25608db65d428dd8ef0fad7f387f7b135a55c990..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24134 zcmdsf4{Q`yn&*2})zyF8ZdbSaAGWc(?RMMP#%*`EZA=Jp2yqBu7{=o;hGjDR3n2_~ zIL6B`QI_jPEX#RVmg7*A%|;Q+W;qn)a#eOuCPFC3MmZLtY{W*K4{~Xe9UI*oQjLm05>}mE4`(3u3Z9p!@ z0)H=MH(QN7JK4{icO+Oh>ttQ>_W)bPe#jCsJUewO-aqD)wF~#{d!4KgIUiupp{$?c zos?$_-nAWX-pH~D^~hrZ%OTc}+WdBP#{<+A22L7dgM-80d;avL6^yOBj?}uxmOeVj z4$_@o+~OVaK2S?H`zAZbR zd9JFM`S*DFI^=o!nGHYNarZ7$@xJ$Q-}B7&Uu;?QJOAT(+Zn)GtX_&po}UZElINCku?JzrW-8pN;+H`z-^EtwEdAGdp%Zz2iTxIlq@No$9kr_654) zmv3zQ!B46d{T*xYAephhSrT}%e7$>HjCksFJOjci6C9rL)QAEl-MxMHQ%{|I6FpM? zOUjg=uwATLCMk$3EK055BQiyG-{psyi+NmG?E|E|Y+scR*k)yda+IlB=ALzW@`)d< zWCK^()o1jADDYQ2HN1e^sME|}f^ii+Mt{m1R7+N%mN{3S6Q;Ox@YNo?;JXj`Y{7n( z<4OnHgJUlaw{xgSH=MKrMpx!%1$G2QEMOjXjGbi#rGO4B@B;ckRu@%9*#1Ks3M?0}I@=MW;_8@&Nr_p2 zAMRh}SNpCmySnn~nyVYHJ_CAX=v(#b!mG=#uDZJZ>gKz56KX<9u!g%0qTyD<|CaB- z_u9W+ zQ;U2frP}|wrnV_*y4pv~!ChV-4c4Vx&w_E|3m7w<(r$v-DYCd$fDXaxD)P}WCMI)$rAp=I|d}2JX7W;QS-$3 z&`8rp)V^s+EiSxi33`5DXk>yV*dv>kOz;H9#Y}86=R92}Yl=5UI!vUZUvQd_S@RCR z`v)ffBld*pSv6vDerSy~NVH-aAhhrh0);hmF|g}Kn8^~4nriz}lP4aXV20985pF6@ zs)|$vsg^ppt9|JjGu$qD4RMoAa(b?YXkX3t@ooGBzpV@@Zz>;lw zJ*7XTzo!d#mwU7OCHDuOb)M_q)4mShuVC4^%dC8 za%0T68QdEDEYuO&ANruWt9pO+t?>Hr$%qnJ7VU_hjeZ&P#g@cgj0fV&R?=+>FvQ1l>&ZO3*K5A}jK9sIc?@6C$ zE^34NnQJ%r5hM+(U{z?1>CY6w_gb}fvm#Thlp$^!8Ph*i1oNVFZdh*KUaXQaE6Cds z4TgTDsG9DpNX7b@RiPrznal0*BHq{PKq}dA+UoFmqw1M zpJ}J2H7-ggxmYU{by}?B;`Vjd?%M~bnyhfQ;4Zid2)R+yB*rd-!TsFSGL{P$PsZ}{ z&pB#uRq}S$)g41I+&Kzv_6;7R1A}*$DYMR!8w*Gzy@1=R*k3ZUK2zkJxzW=0jOoo; z9rXUJ>B^wYL|xSu3|Y;&{(iGQIO$@Iz33oIof`~Ia;k1a#EtD7ZyjdVgc(0biXKknuMw;O$t zPq*+Eo^I*nEy-ZAw{Nl1he27)dvLE_jYS)HG{$4R-W5~F_`ubx;>=aoc5$FGP~~yA z@c2986D{GZ57fuoy6&=5b>hn+kL#hDMvr)kAFl{idlH(sHo?Pnr#OqZ)u%j_jq!-W zQ*VoFcrfY-Xk7n0>4u`ljDR9jJ)K5dBA*~~R#-t?a~JeD#RHxIL9V++?YJbgUflV{0njO$^HNVbnh-9o%_m%TVTeIgVW*P@0xlI2@D z+cGL{rPIaqwlw#&YBfT<+(|ijO*EvAjO`J8TdTO4-kN?po#wtRcK6PSqtBgWYsOg~!(w$rGJx2U?9?Z||=Nh9lG4Osq|O2*W3W-K$o z^gu3`E5;dXM%UKXXS3W)WUM3#v|>syWU819Tust{6Z$v7dccJ2Yg13IFP7|!<@CYp z{Da%aaMC_K&9gMD820S+D?IOnd*A$YXh^+0JbY7IH~pHr7RQe1J@1R_Jp8`8cY2o- z8b5jC#?71e_pzH*qEr)<=jF^#T^NvjR8=WvRoRr+sE4E3-aJowm1;G7^R2gTzBxUh zzNqb+-goCk%~k)_*KfV`wPM_PaeAM&kH1HK;*6n+j;UY_^Sh6$&0fug$+y|OeekTZ zTsf+Q@1&+b=7#H>DPEl@?JT{0R_`cXztbqbQd3k<&R2^w`gwhT1=&2t&5*1cUJpv0 zV18n1%;jyjszJ2OkN&Lc$4EBkve8H|tT!ba)8HFm=&sgl3x-xLEbUr2B%V^dNQD z$Pq@tUd$CnfeIQ?Nk>FbU{wVdkx=0_Q;+hSyIcrppp~gLapZD8mJ70-e#Ka@hK7T zT!yDmJ7T`PCmESJX4OXkQ%D)yNdFK&DVr#!6GYA-0;Qta{YD-mrX-KOtLihh*Ot<8~}=NPd(;n>sLm zduvYJc=Nr@EYj`^n7U!Q&RAjX8#8j|)K~R?xu23P-Q~IO4x4o8;YcU`_)N$gsNq(~ z2gX)g2O*~ff5j^NRdZ@cOvOW1WdMl{!3i+Ceqw>F1|3)1ZyLc#Um#vbx%|l0hFncS zGl3p$&i3Tf8Az>kzBe0-q-nY|@OmEB8(Vs!He;bPB$wL$9~KSvZtd#ae}3~*$5!{Q z$ZuP}_miF5g-K*mVniS6(HHp(yH5S<2NwqX@viK|?$#}fmTt?2{PAsPM?1C;inC=3 z8W+2XgxI|?2(U1#Wxr%*G-Fjs!YTK>B9$f@gK)-*(HPWa%;=O=g)yiyK)mfmm+bWk z=8_Xjfwtf>ECa+8!2ry~l~tkB+}{3v%Wwrl6QSz3>>FYPukQEG}bHYLN z8cl|#o+M@?bww`Qdw*~2ewU}VU0J_+`?3YXGph$Asqt6&@zug}a98K9p=Dx4xzXFj zOVsFlZSDY+)W`mcnfZ)0A8n3-OXRFLLcXlom@#?IYC?o%&1}Z%p_VVmnE5GdK3YEC zuxdbA4OyBvW;$zv0KxRkd0ESg1T|}V4XYDP&!G$YajlsTr6v-CwgWl{1t+6*^-}Mt z3R(JGwAu@m$z9n&cRNEwSY6$uKQSvFLyrZjs?lR+WAInOaC2*0J7sGMndyEr8?-Wg z{nTHPCO7_Lxd{H7TAF%VC>kMgfPac3NOviEuQ$0?81oM7qqT3v1JD zYnLqwZ-04l+oGkZ#iiF~cd$}`!WtSKJGi;7P*}cu#fW&os zW3n%*DXMrYT{P#=WEU6`kI;EO0+=b_oc4TCR`6Z{z5~`&fV}&lv}aZ$_7?b_0yn=p z$OrcDB?sT$BhDQB>gK`emF1dm6|cy;L+6^&&AsdqX6hM>q25q}+)@d$HFICa)TfGI zgUc{Wm;vQo&I!aweUKc~@__mwV{%kQs%Q0=dg7a_`r&VwdgN;rTKgS{5MVG6QU%D9 z0^|wlG1WlQzy>Y9EYF878n^~$ zvfro*LRX+pKaqFWgo1g07(V>LL4~5m!wWbz4iN6`c-dWGXZmycu$~ zSq%qxle@7c-J>dEkFtNI(jmr`-rbAqULUMe&gyFK_EMKVeIvgzuWV?MP#ww;kisqj zsY_)*zhG0vO1lhFDk@268nO&E-`CsMn~P;*(MWYO6dG0W)Xm@6+g$h113MMIt8{T? z=>=t>>dCh}6!j}L*=^I;J*BSgDoWyP51>YnF4}^1AxAM%)rT5G4YNoCg`Ah|L3316 zmR#9-9*KqBdXsv}GyTDK<$^~IJ9X###Eai*Aj;T_GWMd3AeG?)jsyAYsQ94_=}3@e zZj_mcAQf=Yv5Z1Z21dJ=n<7&;UBYk9*l-Hi(7?t5J-LxAevCJ7Vq@_pF0EVb#gU z>N(bgi#hA$y?s2uUGcMgo)QJeJ8$f+qSLSW*yqza-^J3nY!>)$Cgs# zmYa9d7uI)fQLb#cDT@4}nC8VnQFvE7ylv}N@&0`$)x7Ve+qUtAPQty6uJaeJ-K4j5 z+*(2*l+cN}|6BBrisf!|x!p5;G^=l@pZ=l#alibYI6lHpim!H+TYRsN{x7=++&0Q} zv2q#Te@-#(>lxYpe?s?wDphgO{df8jn57<&tB(+P7)^#<8FSN=wPkBITU@S?#%TQ< z({TAF$WHd`Po=gIf|_mBjFGHljh!k8xKmxMC1O$hvQeEb^&IM#@&NCB2=s$rG(;!^ zC>@c-yi;jOs{k0%Ze7)*y)oPkAO_4~G4Df^&JXh5p5C68#rz?@Snca=(Uo%-myOle zYc;*$7sHAt6dF6i10#R>-54%Z zde_%QwRoN9(#ELf7TGzLw=v3#aj)3Lie8)AHOh~9~^w@ zz#l*TaCKuKUhnx^UbQo&xPCY-UT%&0Lv3REjlx(>XwR~<=bj3vy4w?~nlm@Dpsvne z*R?XcJl?n^WVCh=^3S;ed1<%`(5uqSY{McWXJx?aE3tru@|2u{Hf7a85J4V6D?QIwF;A>Q4mF4xmt{J;IO zbo*$dqKCqlHZ~53H^e90I5=^a@tfQ8M!go*>p$L(IzZnL1?U@u5msUiu!`0IWt0%W zU=?FMG{d0v*GOck6G{%yKmz}QDqD=HMk>Av2~qR{Pm4-TjYl!rJU%(u5~+MDp@qG? z#mn8Hghp#@ttpY}3Fehgl@2~GAOyuOWmvgbEL{~}y?tEyOz~eABiF@irBAeT!(+q4 zW4ABST{Pis?c7V-ZZ8@o`L0@mz?anh3jgUFU? zcDue%Isxa&cBu(yO&gVZB{9978dmzGvB@UP!lS%G(uR`n-$qv4Fpz8Aea}^a&~Kh>skS{ zcEZJ~XqADb2-gf-1ye!J8|ETVoZ;KCPyVrRsh%d3E>*ES`36kLKs*yc+}5nK#3?l2GsHPqG1oH zA)83)7*IksR4|%9i`bjsx2p^f1>cXgHupz!=~cfbwYJ06+sFjs}_DDOx&HI@Zgy zXb8yI1P@5P+yFuqM#WvIxasaUd2m9n0J@4rVGuAnKr2%X7Ga2}49Mk>gn8YBTZMql z8O+s_a<4_@Z;3-GenJ?+;78K@BjpJHRCJ07?%`uf9aO?IUy2%jjpzAsQCAufjlL5; z@CAh}z!;p9W6;fh&7kBKVT7XE0(l0xlNBKebrcQ^2sLNSrZQqlu;5&o%&~OF(yrKM zH?z&Ky3tH~9-8%8%)z2tVQD;%)j$qy?S>7Z7^-QC&qtF?cW}Uq!qZ(AxM^p8hTS>3o#xRG+1*GLYvYO zFdPJR2=a)*l8L^wp&z{T^2?WA5&QXqE0ne%KErYB?8*l-fer?8; zqaLO7+Ed~)x_8>AtRLg6V0L zU!xRi&U62T3r9Df=sfhHu@m!%v$N>ah3L}|+bY)v0m-c<0ut~D1c7pRCA%uKUl_{# zHeUir0=TjmlrhP34Oj&x$;|7tKZMTm0)3iLR1dKiR}dVTBq8{0Gh|>;m)y5Hr?^&? z)`~iQ9JBvZQTL@d!}o#9?g3MUiux&-@5K~9BAM}tlsE+Dyoc}P9x*|@z%`?bVR|yc zf99}1XXYFUlTCW&aLioT8?gK*LJ6_YCp{4jX|M%Qnvo>{2vE_ar>X+UFn>v;peAF^ znX;lFmSA=wI)^w%G>-15&YDqU(i8O|FL*M&0*VE!U=)hlz>$_Mf?O#<&sw#hE=~Zr zABuv>f)ev4C7#e3=mIuM6G`%1Fd0EwBh5l4?psHEtdqs!n;2YxtCO=?C z@V_fSTvmWWA@59AZkAEs%VW@vrHtCl%3)Vwj?DieaSjH!se@ zva3NU_3Td>pj0yOU>qf`mMda`Ogf*E1%(4)%Szl;&rSrS6)eC&1|Y9GQm7h8g(T?J z4BK{3tkryo@$7`Jf{4cF0ccp^qhLiP9)x)mV4+n5A(6l}0?L?(#ers{D?`vwtY{2m zGAAe{G0#QpUy?euCr3Y`7aP~(WGX6P@aZ2XOobV<2Ixd%b}9hbLV*lTwk52zAA0f( zzDzc-DBCA(V1$>Vi=pa5X8O=_1^Mo^Q3ju{N(05h0_le(cVqscmm15MVY?}M(P z$!?t+naODiKG(NGEio(FO?f~G$^QCCY>kO#9pMxnBV>S(h z$kD?#N@A#Clw=rO0KXVRb8c1+d_{I5EH#U80PT*1>1B~xybKfp1y$NEX{b3S3Lt1; z+8AmVM2w}#wVrFH#k?8QzsdgfG|3N{lRn@(+QT7Vm#SFekZy$xUk^ z@CoV1LVU53ka*~e4iXOogXD5BK;LUqxw5dyK%k<2-b$*fNHF0$G2#0=?txXCqWU2U8a;u2$Tt?Ig~;X z?gpt4t@O>B`}g`!S-qAU+*k{MgHGa0L`BW4{=>9TF5G{c@|4cZ^dl%ot|J|Lf{nQj zFfa$p4RY~GS-~MQ%!(floUp~KQ1^knbtaCN zKHi}u#OtEdLFBc<^!t2W>B?@bp001PDpa%RX>g z8hsv9_8r@?Xx17p?Hds1-0@Lv@1+fq}O;geR(G=x&mcSgwH`lGfBm z&N1*oh(T$E0_Bc+*vGF!ChjXum!`2!W3PYw+MYVzaq*Sgi-*=7yQ=Nt?~9AK<2uY- zT4`FqH|RFcf07+pc9D0S*xzyWSfH*KymI#3p%un%X@4WX064KIgw8qICY%CdGlpHv zpt99S%MzO)Qx@5WXf4g5H$r`vNQec#8=6GR>^>*AhDl#lHQ_*JW$;&;UJ(cpm|)wK zVAD-Xt%)=z=ODWh%`C9Q01%-->8ny*=_`IoU8RhaPEMPplLaUS@P#NSGxuFP?K{ed zx@s1GAm6B3ww%19%8E1^D$%Q|85$>LnT$+j-0D{zFHnKFBpDZ~|0^F>FhN3j91U+) zU0t)}v~uXXYYX|k`VD9abP{jiiW6M(zO(LvuYMEDOXM0BZz3xnev@pb=n>ekX!hEA z;A1pXEFFV&Z_EOSm7N1&<#J77Nne=-0&id0Fq|KzE~50dg87CIV6^M(lYSkuCzH zaal3ycFa>U_D6zneKA?c^pF6dL@yDDEir>$rCH4bgqJomy}%j#)0j3axr<_7>&n7+OK0n@myS;< z3;5T3vy;hCUgejrPnC{e*Gp&5D2wXeZk2-X1}WHS^Ri@I1>Ku%*l!&rhhen4D2bVe70V%&4_6_FBK0(=LLj~=)QtmH@- zyFK>vl`l_u_{V(MbLJpF#a{`FBjWn#{^^axCd3WV3J|$f-1vHkf56+sO|e8dH+?J* zU~5pE5P>>%tC$k`p#pzbdt;SYBre0-u~-^Z*VTzA=IRoDB|rTpPxJRz6~qeVOzET; z5ns>?d5B-)QGQa=RGF8~!zLu~QQHSI0IxDnCCMxgluK?d1Z*=!ymB&7R};Y4@B{5!cwjTHmFb_`uqAd)E5S zu3lSMyLz?naOtGFTirc<;LPEa=5L!m+_sxeZR!pL)E!!J-Qsx7B_A@c#j^2i>2}Au z#q03jp`<$2g=-F%PD~%b3tl*L$R|AaJ=%u%fP)!#Js!h#6EjlBOo&R|O@Z`LLE+Fr zK&hC2E-#<1zGt zIae^SHH*$8fIcI?wk?jRX+rCJW{o~35%bY2X zbQM*)4A@Emv1hwL)SMVG&gB9XnL=d}19VEn@^Z$WL~?_?M`GYJe?orWWCtOonH(^% zU7|K8T}t5l4Ro9oX}IE$M-DWwM*g`Kos%WNk^G;ynaY@n85OJ%T|-C$;DO4Dc3`+f z=S0*Y-0&b+C)rP|0*n>0IW|y5IASw0gn+rjxZq+WYe^bKNZ_) z7Y5*xS0J}Mz3>f+MQQh!+dtzEGqaSLT`>8>P=%yR4A!Hw$|T*Dex!b%p|{h45|uMj zMJklaMWUzBFLK>PUKVM1So~LJc4VvsT3ZKK+p00ia3^Npya4P)MgtC|KYYw3XWP=XU$ zLyF`{9pNp6E3$sGmON#E+)uizqGZSbYHTH%kf||fwMt<#7Yx#Bn~x+G#9j<!Uf{0`lNwGW;RBXr8@{kN#I49tFC)^>8+907<<<|Fnq%rq7hl4^ zRuDVdAjFS}FWRsd=WrXu_aaf2f-u(xJsv3sZvT{5tAee?gvn5A}SYx(J%lMK+Lr4AaKdSkg#-}2uiIX zSd9!pY(2tbuxC0NX_*-kroxjwNdi=G2}-8Mi0_lCP6CKV2NDQO59|?4j{vf10H?TJ z00$(V$RG>Kyx=$cUM+<8)e`t$EoUqFf*G73pP6iF&peun<;V+mV&432D5usV7}Yc! z(rhQ$g&C_43Cj~xK^TlaH5p16Ub*hik=HETS2u*qCX!stUM+RAWp~dRgZq8 zT}s%Z#1N!D@1lxi5MYK`L*Y3HV<0+kza7DL2rvXOCcsE(EYiGvqVIu+sElSPaxDuM z4Nw)E4XYK|Tj7R&4=Y)Pfz5Q4#W%)@*7P)d#G!$EHo0(+tZQ}-N~^|Ly2=N56fpCq zAdU!*a+u<3fgo}WFou;JE5Xl!ju-CWAb}`7GH1>%q+-NLB+fn)wnldf5J}FTt*=0@ zD7e`zyz>@bj#~~M2kIfZk$(z;8bg%aENO?CeSoC?rD#f>O;aErOtbGKtXVV#Hu*0> zQ^3prK25nmDA3yO(UfZzO<|MAchHpbPoydS&r4Gp#@SXWOaF{C1$Ikp2*2C^1fs&O zpZl<0(qU_{KdOnfuy(AN|CT{LvF3q~V4(|+0`5yj4|3agRN1-qHWI>1kVyNcaKVgC zW4|M5H(ePsGiA-gRG()^49JxLXi{f;?`n;pHbCcXnA0$qo3M~a!3vlW2P>du9I$4K zOZC{0Ds3m!oNi>U!$wEx@nl8d`vjjEY}FzsC_fCUR-7R6NL0_0Kz_u22j71%M>5th24f!BXU=Lv2xC|W zeY6LXU@q1j$qahGBV!^;J2JX4Z3rJGQ>W>bDg?vMIKsg!1p`9n4{X`M9s;u_Yd)MY zzn`;~Ao9H|ybY~IKS0)gWPR`nWL=gq2XofrxVtoK{wQOuAyQbEF-NAXVUWVGRBbKS z0xaPs7uc@W3{g zBgG$<9kU4*7=)mOAoL^%?sq_VKbC7}4#6R{g`Ql5jBB*%1G{H(pp+bk3;|`xL>JOj zJ2`@EShU#pD4j$SvICJu09r;_e34YZ@(HAY(Fg0tiAdoNE2sqp#B(nRA=vIHm1GmC z9*EL~P((*^k*(JjOhiibHp)<##)Xn+UXL`2+XBu`my*eTf(X!-S&%^hNgaOS0=i(Y zd20!qiQAS?tgf&RkJh)e0*=8Kj0PUwjPV&;CmAtmg-UpE1eUE|GbosTBj|&Y$t*V+ zg~{&Xru8aqA(XOR9WBqf1%(Ba;nH&DC3N>piwTQma({>}TT6g2P>h-V0K_$_Vd0=X zK0Knj;6O{Gh3-ZV5@Uw;AW)(Uy}g=@%&SSaphOHQ2ASkK+1t)w-8g_^1K_{F)9o!U zb|pRRw73Od z8IL&qUA5h3-#o4T##)1r?w$oky@0{QP9Qy8g5EiIXLad~bNrBN!Pz^*%Ib4sCt>U2 z7;vEVXeFW9P2^cgpgO3-5g9;Bpx@7^_P{?Hr=)5Ky%77H$t;4MZ6=^?4po5m)xbRB zL9h;~P#+;a{2(RZA5uaz1i{p!67#O=hoM$V2h$(Ku1aQAMbK$;>Ke%ZhK8;u*@r{z z=?%dclwgr?C>BwGn1&Tti+a*Zk72LaFkGO76PLwB;FK3HpBPudeAmS{1$*oWvc(vf2UcAZp&z*o^h96L41v4l_`AkMUlltEW3h9x_j2um-Inv9K-XnI zCirPuadZzkl#ojwy2tUppk-cHH*qXZ2mXmuIo>5mA`>#Ld58yqzf6N3w1T}ENm^?W zrwvM^tGWt6fiTf*sYln_plzLsc{tMab6Nz)8W zsLt*>vH`%S2Y?Rw^tiHw>5!3}wrY}rMun5pq{mlLDJL<-V4?x;LPi_6?Jo;!069bB z4mkspjw0Jd4l=HC>okK4q0oUd#)n42X&s{Y1jh7HF0hbb$Z}`L{cS8b{EZOI7&N~Y zwt@XIGjs4o=PZR<&nx?PPbT?1PdnjQlpM(vpJ3#@$jyz?z|$!=qnn+EwH7VggrgGx z$)v8#lN%`40$+NPK!v&F1?P)*bS_>;JUtnlYpj-7UZJoThxrE6hTig z7iDdKM8olgQ=Is>uUezKF&ZLoINjX{SGksSMxh-eJ<_L0x)#C6h3``+wEHANj;NiQ zHhpm8M(5uS-jK0?JZoPa*-^Li<@LsX63RazkJkh1h!^F>Bk=0T->$c zi4XS3T~S|JUBCIj=FJDD3v}MBIk7sK$Ul&m)A29F8|$M-_2vr0-U`5@sxXEA0AA&P79jffQ4 zmudGb>17NaXVRl2I)_XnJsGRl)>$I*6CN&iOMs(e+%3)Y>5iTxHhILRu==sX;^I(V^>0&VP1($@L)~)$nPKVg3fJOh-L6(}$IS_+se# zQ?K3{<|##0HJ%#2_1e1YL*k17pB~@X)n!~;dHE&tt(UG0er>GZI6gkk!wYV#ynJcJ zwH4xqqVUj)Yb&R&EW6zcF~ZN>E$9QT0$Ru*N%hewaYmsOo$QpREgy_i`W)j;p45D;QWIyQNOKBB; z=|*nqv@GfB2C6NULoh7q?}6rOr1pVXfw9i`e2@#Di(z`t^7tU1=CbWI$~y2(gr)er zAc28AM~?8cmmFjfG)TP;Mo`CrOtH%`%|1%dGr1>|X%?Ulvj!kOi?LMa;)mtT!#-!7 z_O`*W4G-x{|>va_VPW$uv#q#K}qV0l8`Xtf9eif4f0xk6s~RuZXoWU7^lSOWmnKoxz* z$YQi0)uc}pnHs^*L6$jPaf2~6J1(snix~JS0USDr5^_O(^DFx4SBJLWejUc}wfvk| zfbWQW`p)qQwfD=?iLdwv6XNXFb1SbNQq=zbxaMD$Y?UMkXZef}k(3ASS=-5S{~ib^9v` z1jck~#;#8=R(N`%=A5Z@$1!lGBM8iMB3MV71;wN|UmvmFXOn#ylkL*!IaFWCCB@uyJAX zqk)A^{*REl#T@i`G)Cr}5Pg!1o#-uV@9s{dAOitSITp5AdWP5E`{xCAw zJ_%%5B7yqt!^VDr`(mQqA%zFE`gWL9ATEEiuV{h`Uv_-KeH(jl(V>vAb72Ynv7DVC zG;B_R1&7nly?Ik*PjjdTv@?ZFJJ_C2J5t(lRDpsfRjq>594ky(19yAmh*(w7f{NVh zV{_$p;eKIAu)Mo?iKcKt-@n#hV<{tH}DhJ-kVZ#9aY zr9)!01|NeMeSP|}?=nApo9|Tu9_igzI3Xcuy~Ud#(7e z5k7yfsOMi<%NMl5^Y4}EUh%qP<>M#T@_ZWiUww70IG>`s#F1z0j4<-wXWy)%9ewcE zAtNtZK-w&nTKjtf^o1}EYTPT0j3@&D+A zbrw=TNNdF^@B-h}1!y0keVUAtqy-rxc%9iE;<-wRU@>HO(hCKhv3A@;C z-s6OI*2b?pVJ}N4ole-#+LR59KAyXS{X%|D_Zdj(G1UG!Si*iLKaM+!59zW^&+quf z&S#(5I+l3u*`NLF*-<3@7N6h!{?2EgAANk&^P_{$kB-eBdit5)-M#_p!M8rrJCi>9 zlegsxczPb9qZz%e=c-e1w!~e6d2d{p5=g-ic3A>T2ewgU$ zvV&WnA43=Kq8pukT@O6B;ipeOKenZF`?DLfojsjB3v${1e~wXm7$007lOI}6uL=kX`6FzzTLWd}clbK~WB2clKKm%h z*12{&*PL_BJJ%lP+Us2Voa+MT+V5N+cCJgD>m$x}sdIhQxenUbZl~OCr`+zWlkSw? z?Udi`l;7=?-|dv&?Udi`l;7=?-|dv&?Udi`l;7=?-|dv2b;{2=y)2$%FjCGXPxr1PWf4<{H#-c)+s;hl%I3T&pGAiobq!{`8lWjoKt?zDL?0w zpL5E~IpyV?@^VgjIj6jwQ(oRFFYlC>cgo8<<>j67@=keqr@XvVUfyYM-YGZll$&?T z%{%4hopO7e@_L-|dYtllobq~{@_L-|dYtllobq~{@_L;9?RDPQ>%6bmd0(&do?hoY zz0P}j`)GFJJIw^5)92W+lEOi=niRdKa1cmj&vDAZ{(8aJVY>d!!~f+IdByj={|`<2 Bu)Y8Q diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.svg b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.svg deleted file mode 100644 index b6a85d8f10d..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.svg +++ /dev/null @@ -1,259 +0,0 @@ - - - - -Created by FontPrep 20130207 at Wed Apr 1 17:06:29 2015 - By Anton McConville -copyright missing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.ttf b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/OrionIconFont-Regular.ttf deleted file mode 100644 index 1be2983cfd54ace42c4019f7bc99df89668ba1c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23816 zcmdsfeQ*>T#6=c|%>JPv~JX&pY6AiNIN!RZK&BM6^^FkX&u z_`Dnjb#lL#RT9GMiQT>3`{&fEuFR~D%zXLsy_diDvKeQL8Tir|>+c`@-ixO%u3&84 z4V2bAvGnnNc95>D`w02O_kWnl4h#;iVT>O@e*LBwHthJbzx{)=j47X^Z0Dw3BMH7q z!6kPBU%o9no_nF9nECg3`8wS5>~kA_zT@6Krs91c;=1R#?Z4Wx=*R!#Mcj}2zISBn zvl}*h|9Z>s<6VAS@7{_6Bd702ekt;)tuKu1_Wde>=Q-8Kw!gS(!&>hPc-Gy9>k}_* z*u8^~@=tJWEAolq4KF;qsAX=6v8M}+slUJD#h;J-<%dmujIBYR)QKHCpWX4F*PPqS zm`?3khgZ^T*{|Q)_Jf~REc!cE=RpBuf3qa;^z`}O9Wmso(eVuPFzPD(;TcbrC{WS8 zJNG{G)W|oULq1!upXE5y!S>+Ti^J_4D#{I~tboy#_p<^!j4Bo|4?D)ru!2$m0SmkU8p!6N z$w=FO=tF_!W!eCL;x6R-@S(q%yX>4SDd77A-d|v6_yoO^awdVudcbe@#=HnR|eXuR~KGges$H=^;b9FyO&TCN`lqh zs}ps%>;AWV2OgjO$MyRIK&@bO%>JA1=IpZn@6sk~Gg;+RX3MG}bNQ|{CTn;kZtAT= z53iABzqclF!Q_?g@%biiOI$Mjt@BN#?WuvG#~aop=bLKV^YMh)w`wS9_N|$3YHjpr zvLX4>(0{M~>owK5Z>UuLKi5<@Bu!WAklDX$jl8gC4c_N!D_^&EzNxoa_51*8PaIgc zuG(aHjl0cC$)diQB2QZ=nCQ*SH@$6%-=j)C#QPJb+W2Hc!qn2sO}1)i^x4r32}&%e zPA1n>kILMDoudkUcI%94BZ*4N+7h40?)cjh8PnamZYYs>qM?7ow!~0k^G5p>bYD5u zjH(l(i6=(;H#CeUMjK>x4JI2HGW&2R`bX88ea}(`&je&m4^PIE$?C-9D9C_^o(c|&68sUKD+O}=Jm6dii9VYDGJ`s8TC25Jd)hrX#j1`R_9!w{qn zP$KlL4xph8{S6zot)JZ!dbF|)of!Q?BHQxK4Wn)|v1({h^#rbj+s0WR?_08jKlPr$ zHZl24H$RP*Cq@T`8aAT!4NIzV;tfkc`M!anF_vJDZCWzM6C5WqvB{kCY>jLw-WX{! zQ3|@?Yd&Vpd;H!XnEa2}Q>JItkj43-HC8|IifMq+!UISY*38Agt{Y+|OFV9>txHXw zczlc*N-Jf!sW_!7N)?n^YX7d*rEAP^tCTe)O*YBtxth^uAK%7L@H@(Y^0snWWooy& zQ~g9c;tIIV=qddf{R3UNJKUSyuev|-tn=LPp7yo*27RykZk25;yXx=rA1_}WSQWTa zv998?imxDcmK!6+t>D(+=b^UH{?JF29hLhlZ->{1Pezo;vS?fMO!Ui`FSaE1ay$@U z9^W@->74hfs;Wk-i#1o~zFT{%Zn*AP-JL`raU>Z?ZckpRf3G3ckZst~Fp*l9`lPX? z@ld)py(fK+xu_57=dRt5N6<8^j8&jFrax1J+-ufa&9Y3fT&B2bWK92L5yFegxna3^ zYq3J+tRQbiHW>PiqH4OYEEVfzR+)-CXD+wLi+o3CWzfr$yob|C4JLz|`Jnh*IVs*= zgv1U$SQtLU6IWf^ z#ewobg~#2*nUDyew4dNoeBQ7!TK+;w;`$ zoAQ*`$0G_)y(_Na!Kf#oas5-i=+jTdhdh3d4a}WeQIQv4yvwV!u*dKO^nfOY`C)x& zSX{%aeO2k@%Q^c|s=;XY@G86|yj150#BRl>8;Tk;0*Wm4v>Ppne1h0nVFhu`UC`qg z%L>-Q%<@dpV~-`z6kX2nft%IIqT3!6@GsZ}62_o|Clf4~G?;cu929rB&PTXjiYkNL z;Qik)-me_B%fuaVu=IwwhMp|qRg5#AIN%nr1n0s|G1W}53Ko;r%E3%#V6qrhDQDGz z0ippgfXm;DX;Ou0B9k4RJj{~yO3%doheP8ZYL(%jRmRS9vlo$laO(U3YcvPbZ3&Ei&iYx>=En)|lc^kELK z(`%cAsIDf$7z3vBJJo zVHCN2iDyVWfV>?1HvQp9Xa$7{%tV0^_K z#?*3VEHlRRKrWXn#u;k_X{&3qS#BmWRuUCjF(nu>RZIr1Ch5Nc^i8lX2qF92(3R_n zC3|8yz5fRP=*}^GX`h|uSsGRhdv@wIo_EsSZ+|v0pk5jryrr$1dP7}{W5?8<55)~0 z{!raJwaZD3p1gVU)~yF=>}KVt)dc5xIr9?<15%EvD&?#SoAc`Ra5USU=Si;S~wt{ zQQlF`h-bbWSSUVUI54nKeMjw|I)%|AvFoOBbfLwI7^cc?50hfsbWd7bxlYPO zL4~?*>V0-4M36k12Zmv<#2Gsmo!DrlBK0fh%m>rH3Q!_~SDv zv#*L*u~)&<8P?0QKAvMLa+y4N&<PBsv#>F z0&&7YP>m)-Lst^Bkw}rtc0Wjs-S6|%wkzvbZ(p`RcxF*RvKoJ#A73pz2Y0pa8dxS) zOm}*_c$GSRzt3$f%X-*fF*BdB=A+LsNQs;kN6MEq>oX?LSq;drteMSNUDWdh88bg= z%}3AY8&(xKt1e3u$4qBUFd&4UIWKE@QJ`i`uVJ;L>p7617w4+^Flr((SUcc@P;fk2 zQ!DMBijbwxMX$XuncU@VbhSN1jMdRe_7k(>F;FZ}Q3;Bf^}*i+!;Q@?t#n&M$V~T| z*`Sr_=_Pta8r=AgJ1f0gx8LDoS*%&X|!&D*(a;BpIzRs8$22RluTv z#&vsRk`|SeRlMacnsex~3j&Ep=zBgAm?@B)_Iy!R@NNOQ1JP7~zWb=OXI3Zn7Wke5 zH@`Z_`}Xi92jATzCJuge>)_PN>6UL5ugSK<=9;n1z3ee&>KTin-7tdO(g?CGb6>{P zCyNk+%P>or0pnfH3FOFpkP_7Lfcv3ia@0g>XXTfA;+w1bE8j5n@YgD=_PbCaz+j-H z3eYD7=o7MIDuJXy3|f9!tLe*Gnl#zRRE;K^%Dt^)no3Dc$Goe6RYC*}XG~+#@`Ip$ z*&Nt37K7dH&WYl!nDJKT*ZTEHR+^E&^^M*tZ76Wr$0nfTH9!784(pIRzYB( zb#{kAAI+59VgBv}Ptgmy0_xR5_roHtm@MkHl}al*9m2>|XfSvq z^lYOV4)6wdeN(ziRm2`;|4OAzj4Iu`7uUSmU!$DS)$Z-34t?roeq~@H{>VSR0CX3~E9b{CLlhQO~9csR(yQe!B%f_OS%0?J8s^Y1czp=Zq=8=bXDtuSz z!phQ1%0ktXZ+ax^SE{nxrfzsj9otpZ#MvG|jbL5$1?xhNYNV+TGln{5kp&7pFZ+Y; zsAMd;vb8)C3%m6O^^|AoqwUIhj~aH`&i9Fzztut1u@`mhMIAw^!v!1%`qwe>Lm9G> zpv&B-L!&8|R6#S<1#*F4J?I->sD?et`R!95d8TgXoBATu2lW8oEjz~d`sQ~0v`2Q9 zdf^s-=)SG*#@P8-fQ5hzSAl}{EDZ~w9rC!FEoS}bc(4-HxOh`f?13ZZZgS5$xRX|$ z`&ccPKhHo4aLp&h*w{G1gK78PdFWk0m>$X{kws$%+eV;OU{+YHd zrTQ(m?xxSLZ{MO^*>X!1`2{h>i~XYTzV^ztty{&14}7WS125gSjW2Wx?%(J-cmCQf zdRyD=C6q!9?U?)j1p260?lw;Mdxl1{XhU@Rhv?%z`hhq;#7~N^c1`#AK8^k_$pdK{ z<+@n8jPF0I7!OcJ_Wz$j9&n{9F1Y_rU&4OD9+In%5M&rlhFuwR)1nsu4MJ?Dj2w3U92TyQGBvdoldnJ=9lsi?|uaQgHJR> zC<8bhnZ>+aX-caA7}9QC)uY`pTn!)x%waL_L6*KB=G|T0T}_MmBYd&i)7_*iXD=)p zsjbzjy2CGr6;CKMa+n8({`4o+jft9YHuTej)rPCW7l`VHFI4M~b}Zd@ZuQFL+h4so zSSa_duZe2$8qdXzHC66l_LvX!?B2U-N%xu42iN7B+jp>ZELH%r1|n__g31Pc-cd zG`OPL8>zOauGPl<&x8$MAY5NxoBy}1p_;AdQ?9AC`0;=xzgevCDjV!3C z@z->$%r1}DZwVRAZG`-DZa`let^(|;G&5VU$jDh4$og_DU|~EZCt*!lHBdy*N3e=W z2E+8ls*88mDsG<4MrrxQqXDIflkJCf7}wi@+6w8M7w)JJ)v6OlXB^JXDn37nsgpo zthTGECjJ`NwsZvkP0t%G9a-Mb1GVDpu?6wb)#Bx|Uy75*>q8zz2^nqT{e9|kJ>9|o z+pkM^j?^o9D132aeV=$se9Dc3WA_-pwLNdtYEixR@^-WV_J%0H-XM&y9BY78v<8?) z2>}dNFxEvg3|4=YM3&lN(|N}~wug38s5G(F3xLoVi*9Wp&Zvz(SFMXm)5xiBVR&F&Z{I|(p| z?3rfw>kFkFaGva!nt;``QK?lDQ`@OyrB6$X(5=aVU4w(WrnV`CQla#zQmfshZVi8I z_v*oM3BY$Z%CJD0M*M(ZJ2>ui59emgYB@aAh4L(o5SI03S$0+jfz=WS=Eby}-CN+g zRsg*nbFm6qWnd}7HN&>JJy?C1fnKvr_MeALKZ(!jj-%hey_E-tbXM1u#B}ezeqc!L zzTZ6wL-Ks-YU!#w@xYK`Ob>%6hb2#z0oV8`;Tp4g41_~M7+5rT)ax{$#FQQb=6Gw- zum{wTU8HghC?OlF7sx$x`O8CSYJ@r#lTvskA zTIptKS?Q)Tes{+DwZ493%Y$Rbf$jBsnClcQ9PlGx49E*Wd9-it$Lr1Y~ZE2c%tY0HF$_;Vv}XboZJ(IHs2YUB#j>2pAopm8k}ca72^`=ITnh*P`*a#i0~GAq-*g!)gABa+rT6+Qk_6@DZg3CgH@FqKaSRd462fl!ipT z?}QI>L17Cp2503Mbh6(v7`a6_p{TV$p26Z@d^60<><1&R{YUAs(wmpXxyzx$Z}Lz15GZ;%&0i6#55M=dc5Z%aB?fY%@AmCT%HqcB|=vnEF?IszdggbrK1$i%Z_ zy%A!O-aaolsXt@(Oad1Mf?-HV6PSaUGptsSx?EvT(1;ngd&v)5X(7$cRe?^yI0%B=Yq z7i-=lAbcuVEDKcln(0n&$n5L2+)ZHC1TpJ)yk_oFTmS=i;f0>^rWU#_66~w+`utVZ zwRNd<>-=o4yN8Nd?-3`r zpB7)AI<-Gv&vzcW!WUhAmG5lZFCW}T&+XnP)BMP3aqIMHI3biRieB0tf9KZw?|*H^ zl_MUd^u{ydbGmlgr>r00tKfEeYozq1AM))O#(cdq<~jBkjNpC3-2jXbcnqm7*YWv` zSwCquWv7wa6vhH$VpiMZMmT6&mY`5*W4UC@%rc1ChL)hgt2@Oh^8y_+fZdJUY+Ws+st6ltfIN((40AAAm*ML`GoZP%l|3e^_7wFTNqIyWYxPp+#qzNHs8=(V(x|F_^ImNZA zv{uyc5TK%QPemDu;r^0HK~=__ zGigP^EWzwpbPh?5XdL9I%$iYS+!OWTUdUv61q=&#!6+5Afg>$j1iMm!p0%pMU7P@L zKMVzv1tsQ9Mm(W2umxx5wqgxk^*O?sbhqVF#1*w5E}SbL$E>mfP%F2!}^Z~8TjDU z&~5P+Kg-XF)Boz3pLF*e_$ws4#cSe~DdwC4jv9ytUG{)bW6szTzSUt(#!k3Ed1u;n3x5XgJ_}dp| zVcC`7lv?(u3{WaLcrcCS4K?Z^8hp~^HH*_91p@h3b4?sf|5w!906yH#o|D-LCO#;6e}77 zo6HGHP0Vu<`;#QXcID_p{9@yJoLof(3_kti3sYgntpPsKm|Y4$woo8PlkEvB?T4K_ zgD;a0EXwvt9~j}KATdl`=u97auAmcM*$L`$&~bx-9pDCYa8ftyWpr5wbD+z*jD65G zblI)bgKjS#)NP!Uyk*2WI+@KCMnrZwNHZf4CGN31MxC>}H`7U2ynrj|!_mP9J4ryM zeT8F&%=8g#bH9%+;AXY#sPr-t5)GpO;CUcNBWU`wV>Q*()S6l}wZ?$idmTcd7_)gG zM1dZ*QxZcBrzFGR0{F!knsc*q;LEaOVQE=}1L$`oOfQR6<7MCo7^u>BNkh#sQ2;>$ z)5cJ{pkgdVuJv3qJ?4#={tfo0t3iGsAHe=I!@5`5Q)1*9lz&Lf^mzYEf;q(nOm12W zK~Bgx7LtqQgv7&MbdY#B7^IYg1NwfSrW*^N3=}Hb=PjqEs+9D=hDP8HnyS+9H1#y~ zaEVz<-@KwNyL4$8ufNA!sQfnL9m_6VTrRH2c6^K1md^0ncQO=#*wdU+4uvwtG>20t z!`)yN;+39RbN@d5l+|mw!Hu;5IOt1!iL9uaML$dn<@|$}>7LTW3?0EaavkaT6Ku@2 zk3l$CZm^3_>Ix2>VU|r=ZZHF^J}imJ5hLAq9&oqCG$Nc&CRN#9NWvzsLgWK`>r5Ok zUEZN2#G9hsLFBc<)Q5as>B?@bp02vtr84;D%cVHG* z0myX^MVdg$(2|H62HEPBvejGTMK8QD>IK}_Fx_B6VBjqd<%uR4x|?()mTM4)WHt3r za13G)VlY}^K)ItHcKJ={#C@fy(iGNd?9Iz>?5W{x7hb!wcwpVJtJ*I9p}24-uEWix zm8Jw@gYNMBr`e%p7kJx={cTr|1!}q>D`(FgT4C&#{x^yXKoE;U=$vD1A}Am>+us8243F5)NdR2Y;jKWq}ZZ3ARrO zKHa3Wn#gi;4)QC}%z{V^01*n5zADv}zTy|vRmxE54N zt7gduijAsf%PBf)+K@&^C3;mc!{cNulapy0xB8983sfL3S;mFt|Hg+EOps6>$HJS{ zR@W>&tsMI9)M)4e46Jcu@g_pSb^=Z441Ko{M11M;aga}xr7_sMRM1}~E z#bw2a?3kzI?2iNy`eL$>=^+I|gjN~4+w2rqqRdVw>Y_r&YMFJ8w&|LeO~`9dM0ROJ{0sl#Wj- z3;5T3vvZT7yv{G)m@FN?p_k4~D2r;|ZJtD1yfbrMzbbM>-uJtHDqaNkF^UT5sDtWER`iB z3`1Zxf)(ttd0BF#HbXQ$fSS6CNHkTndl#9RaaLKOim~n$ShR81-CuO{Bz@0N=sm!v}5wD>)p- zZjb$Z<m@mA$6y8!Rpu!to#laX$<2j;Z6--pjt6S00vMYd%?8{> zaUqp5!hzOXD6k&FAXL@_Lw!CLi>K1f?HP%ESY;G3qX&u99xUg7s|OnzTUxU@DU$$t zKs`t`A$=tIo~9tJxZy6z_XO#y$*bZz3%fbuXLvf_!x3P_HP*M*cd;tow|3p0wZ1c} z*A~{UUhR9ObW+`|?w&d@@k&bbw@kg#vYWnI)E!8uJGA1u#qp|(KHR((%f>UMJ8kP0 zufudihrVsNLiXr*6D4^@auownIHVwbZp*+`OCDZ+;V^xedpT$IuH> zJ|dJ)S8nr9N?3a-?WMRYu6%w5IA^;+M)}+oFCmZ;wnqUP5+AgJe9!a9Pe4+PR0Tw- zw1X5x>OoRb>=LIqOP7obB&j3~9!O0m2!ev%DA>)GoCOj@b`%_K`yx&DkE;(NbEZDB zRa6-=U>gM_p6v?JauUS&o~}@lB~&K~K&M75FK7Hoq&FyfBnCP2ClvQheh@O6DF6f8 zC8~2Wqy(|wK*!0DMko$Nf@*1k4@I1s5Y-OWG(RKhi9t?m9=MqX&?Mi^;|h z1iH!D9a02rsz4}$Dp!I9r~xDZu7E=L!+tZs2fR?iSuJ2FFzoVj0cyEG8ny3UpL@bJ zffVUhJ1&KSC4sSO6dz0>lha`-F7yH5ypFazt0h`lI1wtuw#nc;8YDWjK57-UZK~id z^dTg#Kw)`$;Tu$o+8(U8cP1WYW+^kfVv2{M2FZ{ZtVd_nNwzC}$o!t5x6^?dl?iDg z6-v`pf>NN1TsKjaMH&$n|CO0-87qO_)&QgDtOh~}F(qy$LHJb0YNoztGG_avl|~cN zwxdsxs?t;pa*Y8uDpsrX03l{kQcVV}hG{PVLHUS$BQ9ydn0Mf;rXk9j+Mqp@;FwmI zB7IUrcnjf*tkxOn6S-h>KZEE=ip?tS( zH;exEeEi4S-iU&tA=h9{**q}Y_I5pBdm~2bzU|G)#f7aZj`ghs0Rua>_w*F|HYxsL z+gokpU}%L+4gQW^O8XFjUGOoC*mO6(y*Viv}iF}+2>@iR>C zBB7;)n}DMV3Iv6}z+WCFGn`n$2Q0~Ud|_{hTalwajYz|8)ZuuQTR-4xj;XI+coqLz zLF{OO5W7`#;NrfMm3Fq zG&@LkVaDn~!Scjp5Dug3=8}x{2u>?0&$V36dI~wj7Grr&Mo@ibEI4N_EMBV)Xmv%b z8jhu`S!Y;_aoaR5@%`DjL_cpGudI9GDcom04$6g>t)NyULC?nxD~|~Sh|_U=)q;++ zO9@+)7?MQu4r)jS31*m8l%9h$2BHnuTaj#q0z(pG0*sW#BF$UJdLDX&>S%-^*R)_! zA2qSju$pmuGs4jCVl&Sd$|^CIuIU3Z3Yd9A z5Jv>Zbei&Nfgo}WFou-^DeCGn3XlO!aw&#DH80fF?C|^sZJ9ZUc1Qf;kO$xd{(>6rz9`afkw1#sO=# zxHOLqY0|dC%<06s`w-P!Y4avxcAePo7Gf4CkL=2GH4WQV~p#(@1$a30}<5-{+u?8np(~}Clg4Zv<2yp-% zLf1$>+>ty3aUnOd84rwC*{reZ0lM)Bu=*$15802{kMa8t=1|5O#9+*W_{>=?NMQ_X zV2^e|6U@cBBbfp9+cGAyv?HSv(}wV2a&?+sX+kjUj3XS(QZOLo{=k+E>>)6#vgV^1 z^ZPk#2{PZyBHGYe^aI@5i(4Ol3b!uHnEg5HNnBl;HGh<`)(|VK%a}ux)*x76P@1-u zYXJm)9r6paV|6vOq_2Yqh&0nYa6#Ln%Sa(KL;tk*El1L9Hmq(eg9frz7no&5*6f1n zC~F<-Sh~tl9b?(YSJIu(7eU+^fg=vDhbl1)@|u~8vc(3QtJq@PR!Pb!fH)0LL&5{! zT#gKXcy`PNcwmr%6@t{$V7MQH@qQxL&K!zES_@sd2szhi(+76Xg+KP!-iQYyx6sB;Z;+fZ@jPkaEv&*GsvY#LZv~?DA5I|B#UbuiR z*lXTu!e-*OClsqI?8Bq=EvJ!6#@9(sOj@B59vp#Z>$eOBrr!wqU}Q4O zO-^BoyFw74<%1i^tPG7a9;hJ0)CgKG1x2wCtaa%fk&{#^cj;MDkNiQC$e2rO^VpK|vDCupR_zbb;Ed$;rH$Yzr#HkYbQYuam!R0_(;;R2zW&1)gqi zd7+puSi}{M9q+=%d5JaKP5~eoBWn8qQg)n3;@ge%u+!o; zVr4wy^mny(pMCMP_B&e*M!I(f81(`M7dwIU2nl-c?A_I+x6blIt_5fA4l1k9ik*b5 zi(|ln)}xn%W;ak|C4uVT4o77GErESMW7-4%sGpRkA?!lzb0)V4cD9*-wmD1z+E)Yj zhzH3Ul)`+3`tXC5fPY90Q5S?zk4ntDq8E-@sU1vz5W6awRS^Nv=G4?t{0$9VSF#6( z+SMI`Gbq6#;ZQ8105J_K@D_EYl`g|xv0=Et2`4Uz3&1HaTskqTg!!%uZwvPJ1#t}1 zhqF&wc-Vv|NL;vJiW@DTxcbDXxb=bfaK)`#EBK-hxQ{3`OV=9M12~7le~y3vnljkI zI_qZ$u%x5F0_-{|3qh`eKpZw8w<-Q#xU(J!s-bQWI)%` zaZHHQwBjHS1(Z-oAIRfGU(hnIqmv{Srvv{ashsE%6p;&=);uHwAYZ1y4_d+Aj3m9a z$kPTTvQ=FLpg@>tw$`Kb9q_i!PTW)6$FXn7_VptHN(`T{QHFZZT=u;Tj z!X5>P)}B3gQTEL~ed-%PIn?&UX!{|j?LK(IgW%xbBM*W^@2JsOKoQJ`6MWKGZb{b+ zT&T|OI`RP^rU!ry#q_wcgz1ozoVIF`gGNP=)40c1RxT$o<=~lZ_(#MFBFd>E3Au7eb)}-xwbn38#0+;wLbsj&Om61j8+NcRbj~f+ODu!HmK3 zYhoMNA2TzDSai-(X!X45`0nu}pXX^M9E*x0nc`E7q8GWjQ95|qqw?2gX1latX_|##pl5XQs0ETX!;g4qaj7m z6Wm2vJ08(+V&N1g|LwC@@2-!AC>l<8*CSM}DVnD15*Y1-mE#f8d=CclBd)0FT`8xqet|{GQ;1J z%`RE8?D$uGgTw#nQg2mrU(3S0$Je%^Z84QDS+!$hztQ4fzioLx;Xh|EW(%Q;tMMBV zDe^DV?pdurp}4394UIh|ZTL-u zrR+(Hf(K7fAUy3Q2U`RUGOvRXw6QN!>~LJOj}!Dv;mPEh1?a=9KB&)PEY-gFQ91Ll z&snFvZE$S4n|ji;tC@JF2|R;cfW$K~`~Zez7WX&6|W7*&iydbsb?CBx~x zhIZx*2L7bx7h4s5Z+f_G+0OIE_dfzduR`t~{+f~2$)mOKq zb}j7a>+35RTT)xL)NilfQ%G$~ZQfeD!w}2A!#T|R?t72P?~fg*I{m%_;i$Cg{TYMq zDPm3BL}Cq&8;|q{V@D3{IHxVrbud4$JfUc`Y9s;0GeGfNp{RT-iP9Q!)k;IG4uEQ) zf_}%yVzeODWK0yf8X?cYmN{Kr*!2m)ibzkioJ=Kmvb)Pp#gb{4GSIg9)WA;h&RTxs?l8rRAXtFNJX*RT zMs=}AJGbie=C*+m{>57H_DlRE1)YeYX!9ZkUh7?CG%1Ukna6~II$<>MNy`h+m`p~?V_>z1$w@n&%OfzG?5GXP zAI1%KOagh9NTGiFu(4m@zL;ot$>2e&zMUo$h|ACHGrHiyFFU^EzJoouASg8KTzEo% zB4;NU4VzQo!Qr%XZ{Fl|q&dt3+L=PG9c<619Vx9iD!@VGs#Zp3juj@WfxA6&M63!} zK}GKMvAJ@_Hu6fILQ@rJ28nz|Q`qLl8q=EMRy>NvLW+l{JUpbVQr6um9WUMDN0cr6 zfFjnGUJ?71myaKB7W~9*-6sNKuMq2RDjL5gKIS)-dT?PJe*Hx0n#hXV{_|W>281|< z-)a;)ONYd86@Cn2_|2(HzDxX-JAAJa@MxcktyAKVVERt3C&VZ6*}Rwv^Ax|Vq(GHE z$3JLWhCiCI3}FNkp!AP20%bfTtb0%bYXMjfdQcW&?PyWhBxW1pOQ6`2gzI3Xc;7C3 zcdhui9x;Efspno>%NH~w^6#~&ZtM#T@_ZWCUw?hAIG3WUB#~$QjBxTl;NPsE z9es$`Atx_-K-MgbTKo3|=r>}dqS9u9LCF?$40xM|ka$5RIV{+XPFlgtI^d*LOyy6UG$awPbJ8xh zi2p|?t+R*{chb;~$|@)ANBJLNB)Nvj8&;3QPIK%s?{?A(R<<+;=pKwYqeulxYq;ls zIcXQ$&AXhm&RX~lC+%ekrQJ#US&OoPZDKF79qd!zg2$ zUfl7kozFkFbtLh^^FROj^TR0mzP$fMTz^u&VHmy_%8ju3Y=AwBr+&eFgwt_7eK0? z;hl8P77$=NNWT$3D$vflAkN63$;HM-s{QQCr(d6M?sKGMs=jGVyR>2J( zL_}025Az7zsWHTF%|XytHLu}w@zX_hJb}F!^}GSnv=Px%O}rU#Jpj{r8=ueHd4_lJ zPQ(l5cpksl(hU)~fcL^)cnH5W_b|5PJ;M9=qX@=&j4$PnW0&(2d>Ma|FXvD375saA zCI3EO#ecvD_z$tA`e{T<{s`Ob*1#C~F<-}j;{L_(^N)jVopYyi&N=72bMA7^-Ojnk zIWKU|z0Ubj=e)!@Kjxg5I_JlobH9D=bn5MN>g~)r(rlh>d!j$XPx@9PW@S@{;X4f)~P@1 z)Sq?g&pP#Io%*v*{W+)poKt_!sXyn`pL6QZIrZn9`g2bGIj6pyQ(w-hFXz;kbLz`E z_2r%V@=kqur@p*XU*4%N@6?xf>dQOz<(>ZKoqF?5y?LkJyi;%9skh6iugj^g%c-x+ zsjthaugj^g%c-x+sjthaugjrtxAVSk=Y8GI`?{U?bUW|qcHYz7L$edV(@Y>bgZ9Eo l3J1+Yzjh$?4+r0Vy{;%#mccz|GQ%_e>Aer*$Cz&;IZE|9y#xsmKBVK-NDj?tifBT9pwO5f%I4!hdYM z9}ohf0ig2A49q`V*^e#q1AQeG6%8XB1N$HD;>R}o(T@4&A!A0a&V&E}u*wey{U3mg zfB~lVW;Q>Z{*O=nk2XPQVkk8;aQdkWiu&UN`5(T&0U&199;QFsPe15;007x!9<6;l za}xt&0DyVp$A{?$>`+st0p>p>0KoEJWcWWIMPvaFHMeng|KS*a?2w;!0MH(UAl7z9 z|M|83aDD$l6Uyeo#=!ljUDhAppSXSi6bUqMYhYvY!=?RS|3CtGsPR7S?VOx{nv?nA zQ~>~xzWyN!0eeT2pSm1HKlQYJpgpWH5%{BlegK%_eE2UGz?|UH-v6`^ysCSak-o9M z{tk#C6gZ;3p+4vUC!s0OJthEB1(5LL^k2E@_Y7x1KuSQ+QurY(2*@BTQ8YU%zz}JLR+l z5jWuwKmvwV34g7lHm1h|Ux%95?YVZJ}}hogHRw;40^HxH>XrCk`0Q7 zA>|8@4^K{Kizr~_=5BPFPG^yxNT_hL=sqrYLYLUJ4KmI2r6^h#^@o^$j1d!C?`W&!r6q9*Vl4vhg^oGVz^yq-}%M!p@T6W=}-Sp9XGjSsf#=kjqu%$roz~ z<@jn{1xH>|#Xl}$Z@{dxq(aBi<7%IKLCdvTB;~XN1Yf6`6BxE%2o>@`7r`to92~St z%_KBL8YU$7%dLT*N`Wsin8_}2e!9(|I>6z8jj?QM0k>z;RQaD)7^5$e_{}E6NFqF6 zLq5A$@M^3&v_5b`yrODP{)iJp6j1x(7YibpzQ^089tChUH#-u8iA}aqG+JQJHv9Ig z$?#@{_OWPwr<*F9%4zbEFoW6lK9YP~$ZlT!&eXAwU!lMyToevm21tMWR?OD-oTkf= z>J|*anjKqXJ^FtG@@Jg>%rRj1tY&XGYZbNBBi`#;U+o&tT5Z2olTK~=KQT7iM=5@c z`FI?%xCm3su>1KI2-yba=yR|_w1yh&6Aki^^|UdVsWHT%5yYwEgsAm%Ual@&LX>|+ zkb)FY>yhq=(TPw+DUA_@D5Jv5J1%}bcQc!?(@kAG=x=TN)ShiRU9}&3A0MMDV|^v{ zDn7GBluyo_sR!HWyOt>=Vx22_UUUeR>t+R1V_eKyLy^wGckBn{D2ZtQ0)N;kM*55) zrO~XT|AT8FmmR&*r;^L>zw#-K6AftUXPgyeUyrV49Pdq-zK5Z?G3Jo@&7PCct4N=U zwv%$-SK3DU=aqcN31RWmNxUp`($n^pc4>fx;HfEQt!f9b(V7xixYw^|4{T3R_bkWz zQ1?|V=?&+ed1$oF;@0TTYo;`nL-ZJ}-dLpk&bnK1@*AXw`mc8?=|F{arpj3Q?gmb&D=muxNw~H zI8KTnS zUg|b0zNq^VUWInb z^>ut6zS`uPFJsfA&4V}|N$hi!No)u*&c_sh?R9qkX{Gg5CDfy~Pww7Fh? zWNpu0uHe}(t?dom2-q7t{y;IZqm@qsx~dx;dnGNj{pXv?pqSUC%79PWm73?*e578o z7O5Z-?_ShJXGys;1Iebh_lK)VfzXKhrWfAa;$nMRlB&$L$B@KrJZZ{g6}uOOjKj6W z89Y?saG1Z0+3ez1S?64BxemiyukP8saj)ZZjDl&UwDg*!C0B~ z1$~D`n}e#-;TW~(ld%I{Pj%?PxOuds#+(nE3IL=7lmJU}P>5E=C%N}OLeb48+=7F< zSfL*~04tWHykUEhNdt)&PX5oV?&eBw`i#A2G_;&3mTf@IiDa`SuT+A zDs2{rOJ&L^Lg7~R$emSa&dpj>>QV}_X=PaGv}w_$sYbZsn`P-rpj=CKns#Bbi;P8V z(qE`s=e}JJ>_XuRkR9VLgNApF|JgT`#qj&j98d4ay}lu*u~uYx*rQ;^yv2L z_OShW6eUEKdCaR=NdG&E4BpHI7x zg5p5NP&tfzGz(|~D+2%ZbTEjJt4$drE&0~iIuVvEd_#3R z^zMs=r96r`eQglW4ICMnWLL@Sb`ja6>8TaT`!~fds7AN>wR0hbHzlsdygLPArs1PL ztI!wNdgo8G)jB52sv)?m%0mp4WVR`hlBEpX11B716K(KEbhN%3ccdw??NHNGi#7fu zIJI;0`BuZ@d8*nIo!-oLJYRCn4F`U;-gK`0EXqfkJ5pAECc+Gwt=&fI0aEWwZ>daml;IVj&YZ{ae{M!#^2x&od1644pN zL+hd|-l$Bbe^7+CI2(TDUUa|R4UuncaF=Jaw(6+Xbv2xLcKx^;9;NehOUuBMePn1G zG*zKPzaI2s^fQfP3q*k{Ftm~?Oh}5}uIo@RRwPL;S6M7aFfyuSikYwtRw1+!8DWcA z?O;NIEuDW*fy_M{DP4!-4#K@;gn+mMYtnoTAY#FqS#Y)pK@YcBo9+*;R5y=HmA-nt zrWpxqd49(0X?cuc!3kZ4y;$|WspREumxZlmRIU4`c{lE;?h-RzTW8qe`Cl<1=$od0nUeKuCFFB7{1mkMB z9I=Bb;*7eLlStjhH>JWSrG`5uL-;9EM4N~^^SIS5`Y2CFM_MJ4$`DJ%)O>prLfzAr?l3R0|d^LXvV;g9A2^UkFqm8ub;$7gi z6p2<@Rqp+~I25@$tz5WC^ZQVY=6Z=)y#cXK%Gk8t2-(b}aRFDrSP}>-vb`?7VBSIE& zbrz{B>Q{goC_yl|%LnDBxlts(l)06Akx5T)W%f(XI7M#~QZ2vm7tiwtP$*{{6z)Rb z6O&4ioJ7|WJUX7Jz>|eW{y4dCo|$ICsmh%FmMCHhqOcK|R<4WC*lhd>ydicNk?nK( z0_+ei+#Uqd`YzQN(419+B;43@TiqsJa~(K`hCt@=klY2WIxd8!k<%pc=%AHHtZ)q! zxUZgcm{qRt&=@vVAp9cs^SB&156Ee*3+hE>LE&H!&pm8W1>v?oRF9x62dRN|4$Ji; zv(}9+;Jm#^BO`dj$^dv>)KoenN@=`sK>=$m@ns&qsS(eS7WT5o+RRrW^#$nkMzj16 zK}zUTT*)?pytEpthq+m?9t}UPIyd2`$FYAD18pq3%%Qo9mbQ1lsr2I&H>Ap9(%j-O z_d&pJ{%*eEybSps93G^(@p!IogGm|5=NXL`>8e_Leal@*llBvWb591OWXw_Q9f)7C zUum=*u&X~4K_vbByqGx*-7kaRy-^xqz@pp?C;4hf>Pl1S;S@%E)jB;V41PVz9an#h zbhmdA{m#jNZ}A}hC*a+}qHTdsD_-JF0tb0?_q*Jvp5mF&JV~m?7|hm~7D0!OlMFiB z8ebcFzFf1v&?&GFNb2+u!6AaCKK-aFSLmA7;Y3fW!wjmApdVJpD zzt#frXt(Q)-eWUlf2ntu@exny`W3oqk#$~v_EL_l&hO7SF#>)w&T`N$`uiYzqIodfoPZEVh!R1-@ zHBVO48A#>=6j{pC_C})Z1J+SG;hodTPDhHc8a>`W*4d?2yFqzujQqbPv`Ax-^0V%_VQ zf%KU>56nj&hp;gX++dIhE|w#_2=m1>_d(uEp*1`(#5oWrQ{ksrw$=mjG<1}u?I#FG zIlY|9)0s!9XG>c3=Xfn#J;)FNcBZ#2=hPQeKGjqNPS~dvDgL*h?z!tUO}cs#+LApq9M=;tUp7B;@If# zb(VHPBY`)~vyejE7{YA|St$;wl+KS^akFB(qFIohTOhyMyA($k$LoWGt@cc349ORX z_P6QScC>wpR^NK*PwUaZuP{ZeuSg>N!mm-0Z@f*AwDL8jY{)%CIAK(fWjy}**&Q)g zZ0ATF1?~Zqz#JEm_z9sv!hd$Fj|T3KdAz9T`ZD zRMzyXvW=?qXR_Et&gYk0jiG)1I33Wa=t}>DZ26VAs~g6`&m;W{I>Z0PZH3|C*Pnxa zA~p-Nkx(PL0g6I|HHABp%axut1BqNL{9N%3_8%uUCv@~o`{Ri(DH5J^0-v~2js3(N zVz496yAi>;;Cx?wRVhEY25xf_ujVUZkl(eDsTznNV4bTL6?~fd(dNKW=LB@B!`Vq= zrojeZ6ejZ7IsKJ92({>g$T#DYCk7`(4)etaHy+xU+39VxI9>Zz?;ZG+84AF@(RQB` ziG(~3ID?0<2nAjBQ#U{@)pSaUXlqJ{Xzkna1;oSc8C^G?h@N9Cs_99s)AOV9Qs{8V zatX|`aqvnRYvcBQDk^e+`B0Z9jw-Vu+2*q+iyLz!1N`|&; zu!3|9?J;G`I-3i zNJdK#Rx=NO^F*R6v*v<*a5{z)4^=6?`8V=rGSg)e_9?7rv&n%dWTFXj$8ydkDV0g+ zG#4!E`eN#MVe#B-{HV)vD%SM*dVOZ8+$PTy!e9e;>y}Q7HAAm^y57#_4VZIb`75kg zF3-*%Tk@CP%0C=e0o9O&lk(3MVe)gM)YscbE4JeDJqUXJVh1OeJXt$9a=ssU-#c?l z%HGh^ZXd39TfSfZTFUHc=mO|*7#F)56cO+$N*G(>Nb*q~3qe&ie^$?l7cXh^{nNbtMp}(oHQLS#eSBp|>oA)Gl1^U=-mdVPRvtgsd5`pXQOw4k=?*v|9XzI!J&Rn{BaN;^3}g@)WJ?xjszo@kg5Sb?K4xz|sBd6Kfd=M} zl%y_e_n1X!;9{2?C7j5Zp3+nXThnlcq7o<%@fjR-SuqY{o(<-a!9`}7AX32MfMoBq zAfQc=?f`|YLkO>@-oHO(Z;xJIlp4KOwausE^*AT+zq(WKAFi-pcTN%L`B*jP=5BjL z__^Kg?FP_Z{PKnPz2O7#^ni~}z$4Q688-B*%O`@r-5DzIUy)7X@3r)|n{kR( z)=#CwZjKiY=W8W}^)8I%&F;Vat6CoX!Ecwav9G3flTjCTSRv0AL;JQj>W?2U0fE`s z&D>L#MeN715t|3GIKzTovd|$DIrn@Lg)&Y>^jR7*ASmWS)fmxDt{88kT(OC^8A#F@ zhM0RNFyG{embMmukw^RO1IrL?*xvq`3o|bzYe~heg&J_oYu~v~cQNU2eT*M-;b``m zJlD-Z3|+d*+><3A#Csm?3y1OXsk}bS4hx6TPv{`__-6aPYn<`;nZ?{KubqE9VPLpj zw7J9Gt+d)e3SRw%rR8@&-RYN3nHh#i;i$dW(#zpS{P1LvFXr1vsL>0XZ5A81>;lg} zU)kRBths){c*Dj-FX8yAcQ3wCfY}04LWw0&{0vL=h1@d_^2ciOd}oI zhRmggptzn`&KLJZd78sWjV<|<nIAoK_~M{44WW`CHS`s_7A2BqJ<ct zNhTB&@0_D|6aa7cJ^7v^q><^s@tNTFue6WRd*iVCFf@M|+ulD#iZtWyFdj!ZE;%K)iqWrZLkhC!Hn?gKQ3WOL{99oJzAVfJzl1aXK=gc6!sz_fj zNC1OjK?OmrWu?me9T<=5*=%IHh2qmpcvwAos*lHu_W#B(qIhjg zxgM9ulr6*7xy4S5N|7MKq+tvx4LjWSz9JTlM?0@4iGV78AN5>4 zPp)_cZcWUwGCXZRd;~7$uyn#OkO51OM0>CZC@7Lh!)|eZA~D?2u%r+Dcm}P+vdCpn z3E?^Y>@b)ga^nGROCQhr!wvNf8d zWT-O>Q>ber6?o5dRxFe;5)8@aEoSye=FMM2A)N3HGB~y&NGB>F!PZFfk%Zvd(w@9# zkW#MvYYBk<5p=$uEnqf?b*X#P~>JmkEG>L-iwd{Xo*a8wo)s(b03y zbWQmSbI-uAcVjE#5S{O6@11;ztOL=6<+@q5KgjnUEG-j(nb31z=*%sXj}I|iPWxu1 zAWz1CSX`~1Hw&|CmmQI2@=>l zICcrn;o@^Ld9`WgO2Zvdu9iEX_+rktJMFr_`z2vGb41S{xbIzc7lY7l=kbLH9c5Wh zi&G+nvdDaZyadJa3lFh_EgpWBPg11`1G0lC7*bJ+gxFh7=YIH~Hp&9KM43feq|wh7 z;V+R8NG8338Qb1C_FIKwZK}fDk*(g(tpL`CElysJ4&R0J&I!Jk=!U_Sd zox>`UduDns$r8(rGmbBTGQJGtO||kZhH(67q-UvV^e5Ho`i1#hf-Ac9Yd8WzsXV-I zKwO*Gv~SxrF1xnCGjeXm0mhADT9?2t<%94iVmEYy+65U0)-t?Cds&CPSbIZsoj1<~ zR_RFls}c>yhrP4npS>BYs1xnRoP62x&EUs=Su|mx_{pgt_!rto>?iVR-|4chA&BS7 zHWZmUltmzFY*O&TvgExho|q_PAR%qJ`KSuT27X(GyB-s|GjCj3pz zS5phpdsdMq87rC#KD11GJw|#np%Hp}vlLsQOv0xDHSfG*_Sxu%4*uSCLE-miW2e2c z=X1aHig-rTN76*fL(s&Uh6R>4gjRQ$^QlhTtA2~)Q^4p;7t|&v5)wzf*S&Q%+AY>o<_Z$uGovQNbAoXEIanOZHNU6Sx zj*7uU#%*F&Yb5UsA%!TK^8HfsR+IDJiS{9c)yO3JuNb#W@OC+3^_GABZ=CfyWE{V= zFkXZ%){w}*fcP?lmwtvBT$XF_Z-h#I9~#*s$&J29e(A65-l1o>e-K?)Z0zWK?7E%r zI-MNJzet^0zD@!*f*gEf!xrvb`TjyIYu!ZL^>g(EZUe(fr8syfXHeMJ)C6;b9Kyth z%`9tp$2hk;=GYx<&tnLo+6n*z|VkmzqhcO$RT; z7~p0SPlYmS&@I>^qQM{783f%!Q!Oi;U}0Xdj_sqDhPJ_vx#tdh=b3O5@iW2-n22xpIlhX>LAm^qcfKywY3;(1KiHJASTL`+HAN)I5o*1aGO2M} zI3fSoraAQF7{-=YnNEq@!RYdMb&r3?@NU9kPzXAm`SjKC3EWt)Cnp7UO@i!9SK$&& zjJ%hJ>oWxWA}qI}=Ahw739IY+*y+CWg2t}fyeqz=b^-Bwu@>-p@kt&L9CeuG%^X?u zC+7`epgHl9^hrt1NbG3`)|2wVWhk;+R3Rg)gXlodAUh)5%^OapAf!7gR|*I!(tt3= z_y8nC<=U=f!x0yovM9)x76ZU36hq1eeGI9O;E` zi$tosi(bKy%@IfRzH%TBR93g=oh6W-rS}$e*i9fK?w12dg5-o1`+oOQRWNNRW!2r_ zWYccAAxFtTb1HqJthNVcr-$ilRNN0QfDZiQirh`iN>UJqV%)RPEXy^rEP z8M`WI-X^FLR5>}7r%>hpbyS_$%GPz01G^SQU|$4S9y{y#%q6T3jX(R8hElS^h}d1&v0I zn=`zm>1`72De6O`#b*U8*dZ#Q)7XRIV#d(zX552sx|QP5jvtz?D+#N)n&HOoUPbic zlirif?p^4tAwXKR;bj8%R7f4jb8hq( z)@ipqu56N-d6E=d-b9wIWaJv8VVQUeg32TvZ!r%Qtn3@nL$)I&$>G|Ti})K~Rl}^d zEG_G|rjxP!JgQxO8#YdTW|`8692QHD1o4GfOtwsCnX6MraJ_{X*r_uE5>e^4gkzui z->3@#XYzmbZ8NG78hXdGbr|kLy^u|25Mspv)84}G`nNyJB){iY-dyn3>%ghTeQ{y2 zUWShd);EXTwbJdjeh6R8#c?-&IlT3c5emDQ%XOTpYe>8Gw(H9|yv^>zC62ZSZu`@3 zhNq`c?Sx8Zg{bZ&uvM+{;Vl6wdeO=PyYaO2(XAz_C;8DWM}|BB=_;OA?lROD#81A+ z1*GM-l&Bu6Cqnde%q3BBIb3b2$1~&*OX4*xQK5rZN_*6NA%(RxsHM@p90|~*rJ2eO3ht=uNGUG`*f{qWKDDm0^dv7+~rHKB!{y2R=cU z1_+b-0|6nlu(LVGCBt-$;2pZi5=~=VY)i(I>k2x}X|Xja_SmllO?7qx3QWpL=OQ6pUYmo=K zDG-zCWN@M~kZ!rEFTP|**B+$kE!L|$SfCm9kp0wg{$PgXq=zoA_(jhAswFx$M6oKv zuo;_KaW(^pgfB>YHxm+Aq$shx;k(e!yqA-JWyp7IN*qUR1e^@N^SZAGfmg{zLwR&^ zqI;aAn8byU6L?07mSSKMGIgca2m8vg{+5ecgP)59$+izN?J~B$9eygMAiPgM8VrW<1I8)`yTBGlejnsQ4<3huad3-6Mn{~2`MTAlKzT?QDEn5!GbjNtX>^V zTpLmP&w8DZSm%r4q4QE>TLOz$Zlwx>SjxF;V4R~uNT*Zz#(ji;L?g^YbN8zq`VL?Mbro$~$ zxi2)58@%!=)hP%ouvl|;>Yh7fa-fx^i_*ev4Aj^iH%cq2Q{Z;M#Sq=PO65Y{7lyWLQhBX4~UE3%n^K|5@b`Z?u#BH z++0yFd};K*{)!kV3G8-QP8U&3L!Dh#{Ih#tJ$!z6jr8AU}I> zDWo&U(Sj|1Nxz9D#9`ij3R_TD#dIl{b>zak@L9R+vEaS#Z9~T!;qR$=fDypVH7+DDxb=&)>Ye%-&N!_L(6V-lL zsGWr~At@W(FBS9~?=A9yH7X92GZZR@J3E*9kx`9<;UMMv_UX3c{6zZj(dZL9Ea1s_ zTTrmFCq<>Svl{E(UC{H}Rm5xq#8^beB{*lKdMYf@Ci(^v!$fFNT4w2nTaaB9= zoT3dkkHDkV>Ik0K%9%>sL^svr4Q4AWUVEqJ2lxiB9K&+*T;at;l3gd^zI&#vP-B33 z48oAf5+L#x`P*NGtvJM9pE?{qw-GMccuQb45Zgh*A-?jpn{T%mYQ)xu5}bfYLrzn-ydW*EQFysd0GN)s2w#Y%_0Xf1UiMS|YW$Yi45 zG{YM%Eli5Tn1xHCC%nTVCmoujB24+H4PnqyWkm>U`>J~JnJc|b)o&;eFTLFz4cO)g zy0bCP0E(qx&H=4x(uU?DhG2F#B+4Po8;9{!;3MbipY*?1GR778;CYQ(yVGm`TX23aG5TpkUP7g8=u+hE9SyluOys>2QS2kF2=sdZEc z3#S>-76P0i*f+Gaql3lqbSF%7eQ{o#8X&Ux|8>WYRQNiPkXMJ3ePw-;HAaOffvU$g zU@g5}rL(JFT<3HCmP-~%@tr91M7p3O?q8rlFZ}1z!4i`Enb@ZZC|@WVHUv6M-gW+r z2xm}4(`H=y$I&rPN0WW(>oRBxUE60!!j*mbffA`P9FthkdVB{%jL@M5L*cQ)K#)?! zkQv?~SZ68zPX0>n z`d72Y_o3dUZtGpI+^6^D(1czu`uyO(Df6#Kwbs<9&sX_g&Nklxn@7>6l*~7j{;n>M z^Mq=xxMaF@JJqhrCeFU&J$tH0x^I1_J)7!6IRux?qlpw0GlDqTt2csHG3?Hfjz0)5 zLEToK;^i)f9h+Jsk5{utc$K5$_oVYr@>{ElC%YjWBUDA zjxj3QAHiW~=dd8mBP(ly{F_Xx>?+pM6E;WoqxO#B&@7=-#B^3tq+v;x1Fc!x$#6OW zLvIi?wLVTZhe40=3e3>C!3eC9zW=t>`G`VZTh9r)Zm$+3$0Qr71Z?k4y)yBuj<-Ye zy`81~dVTFKtKBXTw%b|0vU@!K&J~IiwOs73YjLb>XblobA&dNIZZ9)K+i=Skdj8fX zCe_8<{Di>2ks*m1x61&}M{T4BXGLix*MwAz#qJj>_}rH{AWLJI#JZ(z%setWQ{oy8 zvnLftuj#BclFcnA@PegA7L^r=UIu?x#CJpiI67)_36`ar7I?@;u;3I`MIhzwQv{Wj zLM0xJ;FEGp(-J=1Imvkk;;^#1g!MC_g6NIqF{wueor?frH$yjY|Gi^KQsaE}V=F$& z^{RR3*^EepNNzQ!TBzl}zw1;l5Xyd*4}s9T%6k;QO5k*cdiGXF>xIg;zUunsld3B#}h4~U*S7v!8 zV5Z`XHlVyWXl;9#Y1wYyebv`9NpGkAYoY68@#>qn9JATnYS22a^dtNQYsAnnn*99d z1t`YK7B_{byjS1cOX>v04cUn~89UGWCht87;-J2X_`@9S)~!?$J*B^ilz^1Fw^R?- zVSbJp(TdGfXczJ`Heqm#NL54@wHRA5S2-ky{8fR;#ht7gI_iAfUDuH;-`reF-s;bm zPOsCIPmu?7&7FyNtl#JDnuW)S;^BtTi+6_Jny<^{W~;%kteJt#uDIucTiVv%{nibxZ{DrB~`JUs=b$E0FRu8L)=XtwqhCMC$g3q*TscOZK-C7Ja+k^aBfeU}L$g@iOIJVPHG>HTepODNGe>*e91eWmy$~3nbpxo~b zp#Bw4LqUY6LcxM1gF^6iNEkJr|U z1z2%#JXLn|w%u}1_eUWx@F>OH-v9b4v6K53=ZuIpWzF;+l9r8B&q*c^GOJUEG4q>d zisWhnRq8T$SbcT^m||We!M!+EKNf{#5y01ri9}JbQ1K}c&(>+eKMVM!*qClaER`}Q z8dg|EQY*nX&Ok*={YrEkR@Nl9&Z_oH%LCX>`rl6YP$@OVi@|Aiqgf|smRALsM;gI_ z_r0)WfY%3%JEe&tw6b@q8TE79cy4G-5NY-C2duhpPpM4vD^c{u~B5DKo~8 zzF+rn57!=^*cP+TlyxPWMbAd^4U0A+VN5Nn`pNsx=L{%N-G?M0F~pqHmsAvpH4yTV z&NSGrhpyuyaFcY<>QAUXbL<|lXs`W=xig3L1}vR;(0tJLUP>$^Ppl0YP1#mH7nO@0$- zq|`gE(h+731I^2~t?uhv!xggk9Q7Kiias+$c$U5$ca6tFixcy|Bl>{f|GR^MEP+aZ z-hh>WtAIB^03hrjjv(`($zbqcBjBXqy5IxgUl5EC#t^9xlaShw7f@Z$w9qQhsnAa_ zhA=y@0QOC({<& zq1km&`GjPG9Z4ez8v#Jkb`m5|Xk%ls4Vm)HJQCLTOURRR6*?b&gdUsG3x_H{H?Im} z_=s(ih>Bp;INCHct{Rt;H*#-&?eN7=_Bzr%>QDyTHrod|ZR{mJ5Inl7Vun^{-v9f% z%rDj3{c7iYcm;vx&>vO8-BzM>vu!CDrd4_kgK$h7wgx@*x_xP>j`CYC#1SpRxP&-_kLp>gCut%jQ$(3S>M4 zSw1y~V1DnBqW=<`e&)uks8g~as@U!|EHY1^1^w7MaeH zi|e)W=AikDm#+^&5BxW`-j{YL63KF1s!NqwD4ex1O6JY-xJQuUzeXI6IQu2#95Pt44snm$`$Xv-(rL6!Wa3e&W2S>W(A!2_Z0(b@Hjdz< zXzM4Tm4CPY<-NN1598Tml6RkA$+-{w)3wKD=l+*_>pmdPd+&a7hG4s7|8_N$u4Ub{ zGkeveQy=3pQKyB*)l%)7%~_aZ{w&P*J1US;x*p+6%HDZIX01jX{jH3?t Fe*nxXXa4{I diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare-amd.min.js b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare-amd.min.js deleted file mode 100644 index 658a2c7ef95..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare-amd.min.js +++ /dev/null @@ -1,18 +0,0 @@ -!function(){"use strict";function e(e,t,i,n,o,r){t[e]&&(i.push(e),(t[e]===!0||1===t[e])&&n.push(o+e+"/"+r))}function t(e,t,i,n,o){var r=n+t+"/"+o;require._fileExists(e.toUrl(r+".js"))&&i.push(r)}function i(e,t,n){var o;for(o in t)!t.hasOwnProperty(o)||e.hasOwnProperty(o)&&!n?"object"==typeof t[o]&&(!e[o]&&t[o]&&(e[o]={}),i(e[o],t[o],n)):e[o]=t[o]}var n=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(o){var r=o.config?o.config():{};return r=r||{},{version:"2.0.4",load:function(o,s,a,l){l=l||{},l.locale&&(r.locale=l.locale);var d,c,h,u=n.exec(o),p=u[1],f=u[4],g=u[5],_=f.split("-"),m=[],v={},y="";if(u[5]?(p=u[1],d=p+g):(d=o,g=u[4],f=r.locale,f||(f=r.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),_=f.split("-")),l.isBuild){for(m.push(d),t(s,"root",m,p,g),c=0;c<_.length;c++)h=_[c],y+=(y?"-":"")+h,t(s,y,m,p,g);if(l.locales){var x,b;for(x=0;x-1&&o[e];e--)r=o[e],n=t[r],(n===!0||1===n)&&(n=s(p+r+"/"+g)),i(v,n);a(v)})})}}})}(),define("orion/nls/messages",{root:!0}),define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plug-ins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Edit",EditorRelatedLinkProj:"Show Project",sidebar:"Sidebar","Filter bindings":"Filter bindings",BindingPrompt:"Enter the new binding",NoBinding:"---",orionClientLabel:"Orion client repository","Orion Editor":"Text Editor","Orion Image Viewer":"Image Viewer","Orion Markdown Editor":"Markdown Editor","Orion Markdown Viewer":"Markdown Viewer","Orion JSON Editor":"JSON Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.",ShowAllKeyBindings:"Show a list of all the keybindings on this page","Show Keys":"Show Keys",HideShowBannerFooter:"Hide or show the page banner","Toggle banner and footer":"Toggle banner",ChooseFileOpenEditor:"Choose a file by name and open an editor on it",FindFile:"Open File...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item",NoSearchAvailableErr:"Can't search: no search service is available",Related:"Related",Options:"Options","LOG: ":"LOG: ",View:"View",SplashTitle:"Setting up Workspace",SplashTitleSettings:"Loading Settings",SplashTitleGit:"Loading Git Repositories",LoadingPage:"Loading Page",LoadingPlugins:"Loading Plugins",LoadingResources:"Loading Resources",plugin_started:'"${0}" started',"plugin_lazy activation":'"${0}" lazily activated',plugin_starting:'"${0}" starting',"no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",Operations:"Operations","Operations running":"Operations running",SomeOpWarning:"Some operations finished with warning",SomeOpErr:"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Recent searches":"Recent searches","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Home","Close notification":"Close notification",OpPressSpaceMsg:"Operations - Press spacebar to show current operations","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plug-in","Generate a sample plugin for integrating with Orion.":"Generate a sample plug-in for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",outlineTimeout:"Outline service timed out. Try reloading the page and opening the outline again.",UnknownError:"An unknown error occurred.",Filter:"Filter (* = any string, ? = any character)",TemplateExplorerLabel:"Templates",OpenTemplateExplorer:"Open Template Explorer",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu","Wrote: ${0}":"Wrote: ${0}",GenerateHTML:"Generate HTML file",GenerateHTMLTooltip:"Write an HTML file generated from the current Markdown editor content","alt text":"alt text",blockquote:"blockquote",code:"code","code (block)":"code (block)","code (span)":"code (span)",emphasis:"emphasis","fenced code (${0})":"fenced code (${0})","header (${0})":"header (${0})","horizontal rule":"horizontal rule",label:"label","link (auto)":"link (auto)","link (image)":"link (image)","link (inline)":"link (inline)","link label":"link label","link label (optional)":"link label (optional)","link (ref)":"link (ref)","list item (bullet)":"list item (bullet)","list item (numbered)":"list item (numbered)","strikethrough (${0})":"strikethrough (${0})",strong:"strong","table (${0})":"table (${0})",text:"text","title (optional)":"title (optional)",url:"url",workedProgress:"${0} (${1}/${2})",TogglePaneOrientationTooltip:"Toggle split pane orientation",WarningDuplicateLinkId:"Duplicate link ID: ${0} (link IDs are not case-sensitive)",WarningHeaderTooDeep:"Header level cannot exceed 6",WarningLinkHasNoText:"Link has no text",WarningLinkHasNoURL:"Link has no URL",WarningOrderedListItem:"Ordered list item within unordered list",WarningOrderedListShouldStartAt1:"The first item in an ordered list should have index 1",WarningUndefinedLinkId:"Undefined link ID: ${0}",WarningUnorderedListItem:"Unordered list item within ordered list",PageTitleFormat:"${0} - ${1}",KeyCTRL:"Ctrl",KeySHIFT:"Shift",KeyALT:"Alt",KeyBKSPC:"Backspace",KeyDEL:"Del",KeyEND:"End",KeyENTER:"Enter",KeyESCAPE:"Esc",KeyHOME:"Home",KeyINSERT:"Ins",KeyPAGEDOWN:"Page Down",KeyPAGEUP:"Page Up",KeySPACE:"Space",KeyTAB:"Tab","a year":"a year",years:"${0} years","a month":"a month",months:"${0} months","a day":"a day",days:"${0} days","an hour":"an hour",hours:"${0} hours","a minute":"a minute",minutes:"${0} minutes",timeAgo:"${0} ago",justNow:"just now",fixAll:"Fix all"}),define("orion/util",[],function(){function e(e){var t=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(e,i){return t[(i<<0)+1]})}function t(e,t){return e.createElementNS?e.createElementNS(x,t):e.createElement(t)}function i(e,t){t.addEventListener("keydown",function(t){9!==t.keyCode||t.shiftKey||(t.preventDefault(),e.focus())}),e.addEventListener("keydown",function(e){9===e.keyCode&&e.shiftKey&&(e.preventDefault(),t.focus())})}var n=navigator.userAgent,o=-1!==n.indexOf("MSIE")||-1!==n.indexOf("Trident")?document.documentMode:void 0,r=parseFloat(n.split("Firefox/")[1]||n.split("Minefield/")[1])||void 0,s=-1!==n.indexOf("Opera")?parseFloat(n.split("Version/")[1]):void 0,a=parseFloat(n.split("Chrome/")[1])||void 0,l=-1!==n.indexOf("Safari")&&!a,d=parseFloat(n.split("WebKit/")[1])||void 0,c=-1!==n.indexOf("Android"),h=-1!==n.indexOf("iPad"),u=-1!==n.indexOf("iPhone"),p=h||u,f=-1!==n.indexOf("Electron"),g=-1!==navigator.platform.indexOf("Mac"),_=-1!==navigator.platform.indexOf("Win"),m=-1!==navigator.platform.indexOf("Linux"),v="undefined"!=typeof document&&"ontouchstart"in document.createElement("input"),y=_?"\r\n":"\n",x="http://www.w3.org/1999/xhtml";return{formatMessage:e,createElement:t,confineDialogTab:i,isIE:o,isFirefox:r,isOpera:s,isChrome:a,isSafari:l,isWebkit:d,isAndroid:c,isIPad:h,isIPhone:u,isIOS:p,isElectron:f,isMac:g,isWindows:_,isLinux:m,isTouch:v,platformDelimiter:y}}),define("orion/webui/littlelib",["orion/util"],function(e){function t(e,t){return t||(t=document),t.querySelector(e)}function i(e,t){return t||(t=document),t.querySelectorAll(e)}function n(e,t){return Array.prototype.slice.call(i(e,t))}function o(e){var t=e;return"string"==typeof e&&(t=document.getElementById(e)),t}function r(e,t){if(!e||!t)return!1;if(e===t)return!0;var i=e.compareDocumentPosition(t);return Boolean(16&i)}function s(e){var t=e.getBoundingClientRect(),i=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),n=Math.max(document.documentElement.scrollTop,document.body.scrollTop);return{left:t.left+i,top:t.top+n,width:t.width,height:t.height}}function a(e){for(;e.hasChildNodes();){var t=e.firstChild;e.removeChild(t)}}function l(t){var i=t.tabIndex;if(0===i&&e.isIE){var n={a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0};n[t.nodeName.toLowerCase()]||t.attributes.tabIndex||(i=-1)}return i}function d(e){if(l(e)>=0)return e;if(e.hasChildNodes())for(var t=0;t=0)return e;if(e.hasChildNodes())for(var t=e.childNodes.length-1;t>=0;t--){var i=c(e.childNodes[t]);if(i)return i}return null}function h(e,t){if(3===e.nodeType){var i=w.exec(e.nodeValue);i&&i.length>1&&t(e,i)}if(e.hasChildNodes())for(var n=0;n2&&-1!==r.indexOf("px",r.length-2)){r=r.slice(0,-2);var s=parseInt(r,10);return s!==s?0:s}}return 0}function p(e,t){h(e,function(e,i){var n=t[i[1]]||i[1];e.parentNode.replaceChild(document.createTextNode(n),e)})}function f(e,t){h(e,function(e,i){var n=t[i[1]];if(n){var o=document.createRange(),r=i.index;o.setStart(e,r),o.setEnd(e,r+i[0].length),o.deleteContents(),o.insertNode(n)}})}function g(t,i){function n(e){C.forEach(function(t){var i=!1,n=t.excludeNodes.some(function(t){return document.body.contains(t)?(i=!0,t.contains(e.target)):!1});if(i&&!n)try{t.dismiss(e)}catch(o){"undefined"!=typeof console&&console&&console.error(o&&o.message)}}),C=C.filter(function(e){return e.excludeNodes.some(function(e){return document.body.contains(e)})})}null===C&&(C=[],document.addEventListener("click",n,!0),e.isIOS&&document.addEventListener("touchend",function(e){function t(){e.target.removeEventListener("click",t)}0===e.touches.length&&e.target.addEventListener("click",t)},!1)),C.push({excludeNodes:t,dismiss:i})}function _(e){C=C.filter(function(t){return e!==t.dismiss})}function m(e){for(var t=e.parentNode,i=document.documentElement;t&&t!==i;){var n=window.getComputedStyle(t,null);if(!n)break;var o=n.getPropertyValue("overflow-y");if("auto"===o||"scroll"===o)break;t=t.parentNode}return t}function v(e){window.document.all&&(e.keyCode=0),e.preventDefault&&(e.preventDefault(),e.stopPropagation())}function y(e){for(var t=document.getElementsByTagName("iframe"),i=0;i1?i.children:i.firstChild}var w=/\$\{([^\}]+)\}/,C=null,T={BKSPC:8,TAB:9,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46,COMMAND:991},L=Object.create(null);return Object.keys(T).forEach(function(e){L[T[e]]=e}),{$:t,$$:i,$$array:n,node:o,contains:r,bounds:s,empty:a,firstTabbable:d,lastTabbable:c,pixelValueOf:u,stop:v,processTextNodes:p,processDOMNodes:f,addAutoDismiss:g,setFramesEnabled:y,getOffsetParent:m,removeAutoDismiss:_,keyName:x,KEY:T,createNodes:b}}),define("orion/commandsProxy",["orion/util","orion/webui/littlelib"],function(e,t){function i(t,i){function n(t){if(e.isMac){if(t.metaKey&&!t.altKey)return t.shiftKey||t.ctrlKey||65!==t.keyCode&&67!==t.keyCode&&86!==t.keyCode&&88!==t.keyCode&&90!==t.keyCode?!1:!0;if(t.ctrlKey)return!1}else{if(t.ctrlKey&&!t.altKey)return t.shiftKey||65!==t.keyCode&&67!==t.keyCode&&86!==t.keyCode&&88!==t.keyCode&&90!==t.keyCode?!1:!0;if(t.altKey&&!t.ctrlKey)return!1;if(t.ctrlKey&&t.altKey)return!1}if(t["char"])return t["char"].length>0;if(t.charCode||t.keyCode){var i=t.charCode||t.keyCode;switch(i){case 8:case 9:case 13:case 46:return!0;default:return i>=32&&112>i||i>123}}return!1}if(t=t||window.event,n(t)){if("true"===t.target.contentEditable)return;var o=t.target.nodeName.toLowerCase();if("input"===o){var r=t.target.type.toLowerCase();switch(r){case"text":case"password":case"search":case"color":case"date":case"datetime":case"datetime-local":case"email":case"month":case"number":case"range":case"tel":case"time":case"url":case"week":return}}else if("textarea"===o)return}i(t)}function n(){this._init()}return n.prototype={destroy:function(){this._listener&&(document.removeEventListener("keydown",this._listener),this._listener=null)},setProxy:function(e){this.proxy=e},setKeyBindings:function(e){this.bindings=e},_init:function(){var e=this;document.addEventListener("keydown",this._listener=function(n){return i(n,function(i){var n=e.proxy,o=e.bindings;if(o&&n)for(var r=0;r0){e.setFramesEnabled(!1),this._boundAutoDismiss&&e.removeAutoDismiss(this._boundAutoDismiss),this._boundAutoDismiss=this._autoDismiss.bind(this);var o=e.$$array(".dropdownSubMenu",this._dropdownNode);e.addAutoDismiss([this._triggerNode].concat(o),this._boundAutoDismiss),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(t),this._focusDropdownNode(),i=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return i},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(e){if(this.close(!1)&&this._dropdownNode.contains(e.target))for(var t=this._parentDropdown;t;)t.close(!1),t=t._parentDropdown},_positionDropdown:function(){if(this._dropdownNode.style.left="",this._dropdownNode.style.top="",this._positioningNode)return void(this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px");var t=e.bounds(this._dropdownNode),i=e.bounds(document.body);if(t.left+t.width>i.left+i.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-t.width+"px";else{var n=e.bounds(this._boundingNode(this._triggerNode)),o=e.bounds(this._triggerNode);this._dropdownNode.style.left=o.left-n.left-t.width+o.width+"px"}var r=t.top+t.height-(i.top+i.height);r>0&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-r)+"px")},_boundingNode:function(e){var t=window.getComputedStyle(e,null);if(null===t)return e;var i=t.getPropertyValue("position");return"absolute"!==i&&e.parentNode&&e!==document.body?this._boundingNode(e.parentNode):e},close:function(t){var i=!1;return this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),e.setFramesEnabled(!0),t&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=null),this._boundAutoDismiss&&(e.removeAutoDismiss(this._boundAutoDismiss),this._boundAutoDismiss=null),i=!0),i},getItems:function(){var t=e.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0),i=[],n=this;return t.forEach(function(e){e.parentNode.parentNode===n._dropdownNode&&i.push(e)}),i.forEach(function(t){t._hasDropdownMouseover||(t.addEventListener("mouseover",function(i){t.dropdown?t.dropdown.open(i):(n._closeSelectedSubmenu(),e.stop(i)),n._selectItem(t)}),t._hasDropdownMouseover=!0)}),i},empty:function(){var t=e.$$array("li",this._dropdownNode),i=this;t.forEach(function(e){e.parentNode===i._dropdownNode&&e.parentNode.removeChild(e)})},_dropdownKeyDown:function(t){if(t.keyCode===e.KEY.UP||t.keyCode===e.KEY.DOWN||t.keyCode===e.KEY.RIGHT||t.keyCode===e.KEY.ENTER||t.keyCode===e.KEY.LEFT){var i=this.getItems();if(i.length&&i.length>0){if(this._selectedItem){var n=i.indexOf(this._selectedItem);0>n&&(n=i.indexOf(this._selectedItem.parentNode)),n>=0&&(t.keyCode===e.KEY.UP&&n>0?(n--,this._selectItem(i[n])):t.keyCode===e.KEY.DOWN&&n/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,d="undefined"!=typeof location&&location.href,c=d&&location.protocol&&location.protocol.replace(/\:/,""),h=d&&location.hostname,u=d&&(location.port||void 0),p={},f=e.config&&e.config()||{};return t={version:"2.0.12",strip:function(e){if(e){e=e.replace(a,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){i=s[t];try{e=new ActiveXObject(i)}catch(n){}if(e){s=[i];break}}return e},parseName:function(e){var t,i,n,o=!1,r=e.indexOf("."),s=0===e.indexOf("./")||0===e.indexOf("../");return-1!==r&&(!s||r>1)?(t=e.substring(0,r),i=e.substring(r+1,e.length)):t=e,n=i||t,r=n.indexOf("!"),-1!==r&&(o="strip"===n.substring(r+1),n=n.substring(0,r),i?i=n:t=n),{moduleName:t,ext:i,strip:o}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,n,o){var r,s,a,l=t.xdRegExp.exec(e);return l?(r=l[2],s=l[3],s=s.split(":"),a=s[1],s=s[0],!(r&&r!==i||s&&s.toLowerCase()!==n.toLowerCase()||(a||s)&&a!==o)):!0},finishLoad:function(e,i,n,o){n=i?t.strip(n):n,f.isBuild&&(p[e]=n),o(n)},load:function(e,i,n,o){if(o&&o.isBuild&&!o.inlineText)return void n();f.isBuild=o&&o.isBuild;var r=t.parseName(e),s=r.moduleName+(r.ext?"."+r.ext:""),a=i.toUrl(s),l=f.useXhr||t.useXhr;return 0===a.indexOf("empty:")?void n():void(!d||l(a,c,h,u)?t.get(a,function(i){t.finishLoad(e,r.strip,i,n)},function(e){n.error&&n.error(e)}):i([s],function(e){t.finishLoad(r.moduleName+"."+r.ext,r.strip,e,n)}))},write:function(e,i,n){if(p.hasOwnProperty(i)){var o=t.jsEscape(p[i]);n.asModule(e+"!"+i,"define(function () { return '"+o+"';});\n")}},writeFile:function(e,i,n,o,r){var s=t.parseName(i),a=s.ext?"."+s.ext:"",l=s.moduleName+a,d=n.toUrl(s.moduleName+a)+".js";t.load(l,n,function(){var i=function(e){return o(d,e)};i.asModule=function(e,t){return o.asModule(e,d,t)},t.write(e,l,i,r)},r)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(i=require.nodeRequire("fs"),t.get=function(e,t,n){try{var o=i.readFileSync(e,"utf8");0===o.indexOf("")&&(o=o.substring(1)),t(o)}catch(r){n&&n(r)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,i,n,o){var r,s=t.createXhr();if(s.open("GET",e,!0),o)for(r in o)o.hasOwnProperty(r)&&s.setRequestHeader(r.toLowerCase(),o[r]);f.onXhr&&f.onXhr(s,e),s.onreadystatechange=function(){var t,o;4===s.readyState&&(t=s.status||0,t>399&&600>t?(o=new Error(e+" HTTP status: "+t),o.xhr=s,n&&n(o)):i(s.responseText),f.onXhrComplete&&f.onXhrComplete(s,e))},s.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var i,n,o="utf-8",r=new java.io.File(e),s=java.lang.System.getProperty("line.separator"),a=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r),o)),l="";try{for(i=new java.lang.StringBuffer,n=a.readLine(),n&&n.length()&&65279===n.charAt(0)&&(n=n.substring(1)),null!==n&&i.append(n);null!==(n=a.readLine());)i.append(s),i.append(n);l=String(i.toString())}finally{a.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(n=Components.classes,o=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),r="@mozilla.org/windows-registry-key;1"in n,t.get=function(e,t){var i,s,a,l={};r&&(e=e.replace(/\//g,"\\")),a=new FileUtils.File(e);try{i=n["@mozilla.org/network/file-input-stream;1"].createInstance(o.nsIFileInputStream),i.init(a,1,0,!1),s=n["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),s.init(i,"utf-8",i.available(),o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),s.readString(i.available(),l),s.close(),i.close(),t(l.value)}catch(d){throw new Error((a&&a.path||"")+": "+d)}}),t}),define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return''}),define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return''}),define("text!orion/webui/checkedmenuitem.html",[],function(){return'
  • '}),define("orion/webui/tooltip",["orion/webui/littlelib"],function(e){function t(e){this._init(e)}return t.prototype={_init:function(t){if(this._node=e.node(t.node),!this._node)throw"no dom node for tooltip found";this._position=t.position||["right","above","below","left"],this._text=t.text,this._hideDelay=void 0===t.hideDelay?200:t.hideDelay,this._tailSize=t.tailSize||10,this._trigger=t.trigger||"mouseover",this._afterShowing=t.afterShowing,this._afterHiding=t.afterHiding;var i=this;if("click"===this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(t){t.target===i._node&&(i.show(),e.stop(t))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===t.showDelay?500:t.showDelay;var n=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(t){e.contains(i._node,t.target)&&(i.show(),e.stop(t))},!1),this._leaveHandler=function(t){e.contains(i._node,t.target)&&i.hide()};for(var o=0;op){if(!i)return!1;r=p-a.height-1}if(s+a.width>u){if(!i)return!1;s=u-a.width-1}if(c>s){if(!i)return!1;s=c+4}if(h>r){if(!i)return!1;r=h+4}return this._tail&&this._tail.previousPosition!==t&&(this._tip.removeChild(this._tail),this._tail=null),this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+t),"above"===t||"left"===t?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=t),this._tip.style.top=r+"px",this._tip.style.left=s+"px",!0},contentContainer:function(){return this._makeTipNode(),this._tipInner},isShowing:function(){return this._tip&&this._tip.classList.contains("tooltipShowing")},show:function(){this.isShowing()||(this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately())},_showImmediately:function(){for(var e=!1,t=0;!e&&t"+n.name),n.callback.call(n,i)}.bind(this),!1),s.addEventListener("keydown",function(e){(e.keyCode===t.KEY.ENTER||e.keyCode===t.KEY.SPACE)&&(l.logEvent("command","invoke",this.id+">"+n.name),n.callback.call(n,i))}.bind(this),!1)}else r._generateMenuSeparator(e)}.bind(this))},getChoices:function(e,t,i){return this.choiceCallback?this.choiceCallback.call(t,e,i):null},makeChoiceCallback:function(e,t){return function(i){e.callback&&e.callback.call(e,t,i)}},hasImage:function(){return this.imageClass||this.image!==w}},b.prototype.constructor=b,{Command:b,CommandInvocation:x,createDropdownMenu:g,createCheckedMenuItem:_,createQuickfixItem:m,createCommandItem:v,createCommandMenuItem:y,executeBinding:c,setKeyBindingProvider:d,localKeyBindings:T,getKeyBindings:u,processKey:p,NO_IMAGE:w,_testMethodProcessKey:h}}),define("orion/keyBinding",["orion/util"],function(e){function t(e,t,i,n,o,r){this.type=r||"keydown",this.keyCode="string"==typeof e&&"keydown"===this.type?e.toUpperCase().charCodeAt(0):e,this.mod1=void 0!==t&&null!==t?t:!1,this.mod2=void 0!==i&&null!==i?i:!1,this.mod3=void 0!==n&&null!==n?n:!1,this.mod4=void 0!==o&&null!==o?o:!1}function i(e){this.keys=e}return t.prototype={getKeys:function(){return[this]},match:function(t,i){if(void 0!==i){if(0!==i)return!1}else if(t instanceof Array){if(t.length>1)return!1;t=t[0]}if(t.type!==this.type)return!1;if(this.keyCode===t.keyCode||this.keyCode===String.fromCharCode(e.isOpera?t.which:void 0!==t.charCode?t.charCode:t.keyCode)){var n=e.isMac?t.metaKey:t.ctrlKey;return this.mod1!==n?!1:"keydown"===this.type&&this.mod2!==t.shiftKey?!1:this.mod3!==t.altKey?!1:e.isMac&&this.mod4!==t.ctrlKey?!1:!0}return!1},equals:function(e){return e?this.keyCode!==e.keyCode?!1:this.mod1!==e.mod1?!1:this.mod2!==e.mod2?!1:this.mod3!==e.mod3?!1:this.mod4!==e.mod4?!1:this.type!==e.type?!1:!0:!1}},i.prototype={getKeys:function(){return this.keys.slice(0)},match:function(e,t){var i=this.keys;if(void 0!==t)return t>i.length?!1:i[t].match(e)?t===i.length-1?!0:t+1:!1;if(e instanceof Array||(e=[e]),e.length>i.length)return!1;var n;for(n=0;n":".";break;case 191:l=i.mod2?"?":"/";break;case 192:l=i.mod2?"~":"`";break;case 219:l=i.mod2?"{":"[";break;case 220:l=i.mod2?"|":"\\";break;case 221:l=i.mod2?"}":"]";break;case 222:l=i.mod2?'"':"'"}return l?n+l:i.keyCode>=112&&i.keyCode<=123?n+"F"+(i.keyCode-111):n+String.fromCharCode(i.keyCode)}function o(e){for(var t="",i=e.getKeys(),o=0;o0)if(e.createTextRange){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",0),o.moveEnd("character",n),o.select()}else e.setSelectionRange?e.setSelectionRange(0,n):void 0!==e.selectionStart&&(e.selectionStart=0,e.selectionEnd=n);else e.select()}},0)}function s(e){var t=-1!==window.navigator.platform.indexOf("Mac");return t&&e.metaKey||!t&&e.ctrlKey}function a(e,t){t&&s(t)?window.open(e):window.location=e}function l(e,i){var n=document.createElement("button");return n.className="orionButton commandButton commandMargins",n.addEventListener("click",function(e){i(),t.stop(e)},!1),e&&n.appendChild(document.createTextNode(e)),n}function d(){}function c(e,t){if(!e||!e.tagName)return!1;switch(e.tagName.toLowerCase()){case"button":case"fieldset":case"form":case"input":case"keygen":case"label":case"legend":case"meter":case"optgroup":case"output":case"progress":case"select":case"textarea":return!0}return e.parentNode===t?!1:e.parentNode&&c(e.parentNode,t)}function h(e,t,i){var n=i?0:1;return e.substring(0,e.length-encodeURIComponent(t).length-n)}function u(e){var t=new Date,i=new Date(e),n=t.getTime()-i.getTime(),o=Math.floor(n/1e3/60/60/24/365);n-=1e3*o*60*60*24*365;var r=Math.floor(n/1e3/60/60/24/30);n-=1e3*r*60*60*24*30;var s=Math.floor(n/1e3/60/60/24);n-=1e3*s*60*60*24;var a=Math.floor(n/1e3/60/60);n-=1e3*a*60*60;var l=Math.floor(n/1e3/60);n-=1e3*l*60;var d=Math.floor(n/1e3);return{year:o,month:r,day:s,hour:a,minute:l,second:d}}function p(t,n,o){return t>0?1===t?e[n]:i.formatMessage(e[o],t):""}function f(e){var t=u(e),i=p(t.year,"a year","years"),n=p(t.month,"a month","months"),o=p(t.day,"a day","days"),r=p(t.hour,"an hour","hours"),s=p(t.minute,"a minute","minutes"),a="";return i?a=t.year>0?i:i+n:n?a=t.month>0?n:n+o:o?a=t.day>0?o:o+r:r?a=t.hour>0?r:r+s:s&&(a=s),a}function g(t){var n=f(t);return n?i.formatMessage(e.timeAgo,n):e.justNow}var _=-1!==navigator.platform.indexOf("Mac"),m=Object.create(null);return m[t.KEY.DOWN]="↓",m[t.KEY.UP]="↑",m[t.KEY.RIGHT]="→",m[t.KEY.LEFT]="←",_&&(m[t.KEY.BKSPC]="⌫",m[t.KEY.DEL]="⌦",m[t.KEY.END]="⇲",m[t.KEY.ENTER]="⏎",m[t.KEY.ESCAPE]="⎋",m[t.KEY.HOME]="⇱",m[t.KEY.PAGEDOWN]="⇟",m[t.KEY.PAGEUP]="⇞",m[t.KEY.SPACE]="␣",m[t.KEY.TAB]="⇥"),{getUserKeyString:o,getUserText:r,openInNewWindow:s,followLink:a,createButton:l,createDropdownButton:d,isFormElement:c,path2FolderName:h,timeElapsed:f,displayableTimeElapsed:g}}),define("text!orion/webui/submenutriggerbutton.html",[],function(){return''}),function(e,t){"function"==typeof define&&define.amd?define("orion/Deferred",t):"object"==typeof exports?module.exports=t():(e.orion=e.orion||{},e.orion.Deferred=t())}(this,function(){function e(){for(var e;e=r.shift();)e();s=!1}function t(e){r.push(e),s||(s=!0,a())}function i(e){return function(t){e(t)}}function n(e,t,n){try{var o=e(t),r=o&&("object"==typeof o||"function"==typeof o)&&o.then;if("function"==typeof r)if(o===n.promise)n.reject(new TypeError);else{var s=o.cancel;"function"==typeof s?n._parentCancel=s.bind(o):delete n._parentCancel,r.call(o,i(n.resolve),i(n.reject),i(n.progress))}else n.resolve(o)}catch(a){n.reject(a)}}function o(){function e(){for(var e;e=d.shift();){var t=e.deferred,i="fulfilled"===l?"resolve":"reject",o=e[i];"function"==typeof o?n(o,a,t):t[i](a)}}function i(i){delete c._parentCancel,l="rejected",a=i,d.length&&t(e)}function r(n){function s(e){return function(t){l&&"assumed"!==l||e(t)}}delete c._parentCancel;try{var h=n&&("object"==typeof n||"function"==typeof n)&&n.then;if("function"==typeof h)if(n===c)i(new TypeError);else{l="assumed";var u=n&&n.cancel;if("function"!=typeof u){var p=new o;n=p.promise;try{h(p.resolve,p.reject,p.progress)}catch(f){p.reject(f)}u=n.cancel,h=n.then}a=n,h.call(n,s(r),s(i)),c._parentCancel=u.bind(n)}else l="fulfilled",a=n,d.length&&t(e)}catch(g){s(i)(g)}}function s(){var e=c._parentCancel;if(e)delete c._parentCancel,e();else if(!l){var t=new Error("Cancel");t.name="Cancel",i(t)}}var a,l,d=[],c=this;this.resolve=function(e){return l||r(e),c},this.reject=function(e){return l||i(e),c},this.progress=function(e){return l||d.forEach(function(t){if(t.progress)try{t.progress(e)}catch(i){}}),c.promise},this.cancel=function(){return c._parentCancel?setTimeout(s,0):s(),c},this.then=function(i,n,r){var s=new o;return s._parentCancel=c.promise.cancel,d.push({resolve:i,reject:n,progress:r,deferred:s}),("fulfilled"===l||"rejected"===l)&&t(e),s.promise},this.promise={then:c.then,cancel:c.cancel}}var r=[],s=!1,a=function(){if("undefined"!=typeof process&&"function"==typeof process.nextTick){var t=process.nextTick;return function(){t(e)}}if("function"==typeof MutationObserver){var i=document.createElement("div"),n=new MutationObserver(e);return n.observe(i,{attributes:!0}),function(){i.setAttribute("class","_tick")}}return function(){setTimeout(e,0)}}();return o.all=function(e,t){function i(e,t){a||(s[e]=t,0===--r&&l.resolve(s))}function n(e,n){if(!a){if(t)try{return void i(e,t(n))}catch(o){n=o}l.reject(n)}}var r=e.length,s=[],a=!1,l=new o;return l.then(void 0,function(){a=!0,e.forEach(function(e){e.cancel&&e.cancel()})}),0===r?l.resolve(s):e.forEach(function(e,t){e.then(i.bind(void 0,t),n.bind(void 0,t))}),l.promise},o.when=function(e,t,i,n){var r,s;return e&&"function"==typeof e.then?r=e:(s=new o,s.resolve(e),r=s.promise),r.then(t,i,n)},o}),define("orion/commandRegistry",["orion/commands","orion/keyBinding","orion/explorers/navigationUtils","orion/i18nUtil","orion/PageUtil","orion/uiUtils","orion/webui/littlelib","orion/webui/dropdown","orion/webui/tooltip","text!orion/webui/submenutriggerbutton.html","orion/metrics","orion/Deferred","orion/EventTarget"],function(e,t,i,n,o,r,s,a,l,d,c,h,u){function p(e){this._commandList={},this._contributionsByScopeId={},this._activeBindings={},this._urlBindings={},this._pendingBindings={},this._parameterCollector=null,this._init(e||{})}function f(e,t){this.token=e,this.parameterName=t}function g(e,t,i){this.event=e,this.handler=t,this.capture=i||!1}function _(e,t,i,n,o,r,s){this.name=e,this.type=t,this.label=i,this.value=n,this.lines=o||1,this.validator=s,this.eventListeners=Array.isArray(r)?r:r?[r]:[]}function m(e,t,i){this._storeParameters(e),this._hasOptionalParameters=t&&t.hasOptionalParameters,this._options=t,this.optionsRequested=!1,this.getParameters=i,this.clientCollect=t&&t.clientCollect,this.getParameterElement=t&&t.getParameterElement,this.getSubmitName=t&&t.getSubmitName,this.getCancelName=t&&t.getCancelName,this.message=t&&t.message}return p.prototype={_init:function(t){this._selectionService=t.selection;var i=this;e.setKeyBindingProvider(function(){return i._activeBindings}),u.attach(p.prototype),this.addEventListener("bindingChanged",function(e){this._handleBindingChanges(e)}.bind(this)),this.addEventListener=function(e,t){this._bindingOverrides&&"bindingChanged"===e&&this._updateBindingOverrides(t),p.prototype.addEventListener.call(this,e,t)}},processURL:function(e){for(var t in this._urlBindings)if(this._urlBindings[t]&&this._urlBindings[t].urlBinding&&this._urlBindings[t].command){var i=this._urlBindings[t].urlBinding.match(e);if(i){var n=this._urlBindings[t],o=n.command,r=n.invocation;if(r&&r.parameters&&o.callback){r.parameters.setValue(i.parameterName,i.parameterValue);var s=this;return void window.setTimeout(function(){s._invoke(r)},0)}}}},findCommand:function(e){return this._commandList[e]},runCommand:function(t,i,n,o,r,s){var a=this;if(i){var l=this._commandList[t],d=l&&(l.visibleWhen?l.visibleWhen(i):!0);if(d&&l.callback){var c=new e.CommandInvocation(n,i,r,l,a);return c.domParent=s,a._invoke(c,o)}}else{var h=this._urlBindings[t];if(h&&h.command&&h.command.callback)return a._invoke(h.invocation,o)}},getSelectionService:function(){return this._selectionService},setParameterCollector:function(e){this._parameterCollector=e},openParameterCollector:function(e,t,i){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(e,t,i))},confirm:function(e,t,i,n,o,r){var s=!1;if(!this._parameterCollector||o)s=window.confirm(t),r(s);else{var a=this,d=function(){r(s)},c=function(){a._parameterCollector.close()},h=function(e,o){var r=document.createElement("span");r.classList.add("parameterPrompt"),r.textContent=t,e.appendChild(r);var a=document.createElement("button");a.addEventListener("click",function(){s=!0,d(),c()},!1),o.appendChild(a),a.appendChild(document.createTextNode(i)),a.className="dismissButton";var l=document.createElement("button");return l.addEventListener("click",function(){s=!1,c()},!1),o.appendChild(l),l.appendChild(document.createTextNode(n)),l.className="dismissButton",a};this._parameterCollector.close();var u=this._parameterCollector.open(e,h,function(){});if(!u){var p=new l.Tooltip({node:e,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),f=p.contentContainer();f.classList.add("parameterPopup");var g=window.document.activeElement;c=function(){g&&g.focus(),p.destroy()};var _=document.createElement("div");_.classList.add("parameterMessage"),f.appendChild(_);var m=document.createElement("div");f.appendChild(m),m.classList.add("layoutRight"),m.classList.add("parametersDismiss");var v=h(_,m);p.show(),v&&window.setTimeout(function(){v.focus(),v.select&&v.select()},0)}}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(e,t){return this._collectAndInvoke(e.makeCopy(t),!1)},_collectAndInvoke:function(e,t,i){if(e){if(!(this._parameterCollector&&e.parameters&&e.parameters.hasParameters()&&(t||e.parameters.shouldCollectParameters())))return c.logEvent("command","invoke",e.command.id),e.command.callback.call(e.handler||window,e);var n=!1;if(e.parameters.updateParameters(e),e.parameters.shouldCollectParameters()&&(n=this._parameterCollector.collectParameters(e,i),!n)){var o=new l.Tooltip({node:e.domNode||e.domParent,afterHiding:function(){this.destroy(),e.domParent&&e.domParent.classList.remove("parameterPopupOpen")},trigger:"click",position:["below","right","above","left"]}),r=o.contentContainer();r.classList.add("parameterPopup");var s=window.document.activeElement,a=this._parameterCollector.getFillFunction(e,function(){s&&s.focus(),o.destroy(),e.domParent&&e.domParent.classList.remove("parameterPopupOpen")},i)(r);o.show(),e.domParent&&e.domParent.classList.add("parameterPopupOpen"),a&&window.setTimeout(function(){a.focus(),a.select&&a.select()},0),n=!0}if(!n)return c.logEvent("command","invoke",e.command.id),e.command.callback.call(e.handler||window,e)}else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(e,t){this._collectAndInvoke(e,!0,t)},showKeyBindings:function(t){function i(t){return function(){e.executeBinding(t)}}var n,o={},r=[];for(var s in this._activeBindings)n=this._activeBindings[s],n&&n.keyBinding&&n.command&&(n.command.name||n.command.tooltip)&&r.push(n);r.sort(function(e,t){var i=e.command.name||e.command.tooltip,n=t.command.name||t.command.tooltip;return i.localeCompare(n)});for(var a=0;a0&&(t.createHeader(l),o[l].forEach(function(e){t.createItem(e.keyBinding,e.command.name||e.command.tooltip,e.command.id,i(e))}))},_handleBindingChanges:function(t){var i=this.findCommand(t.id);if(i){var n=this._activeBindings[t.id];n?n.keyBinding=t.newBinding:this._addBinding(i,"key",t.newBinding)}if(this._renderedCommands&&this._renderedCommands[t.id])for(var o=this._renderedCommands[t.id],s=Object.keys(o),a=0;a=0;t--){var i=this._bindingOverrides[t];if(i.id===e)return i.newBinding}return null},addCommand:function(e){this._commandList[e.id]=e;var t=this._pendingBindings[e.id];if(t){var i=this;t.forEach(function(t){i._addBinding(e,t.type,t.binding,t.bindingOnly)}),delete this._pendingBindings[e.id]}},addCommandGroup:function(e,t,i,n,o,r,s,a,l,d,c){this._contributionsByScopeId[e]||(this._contributionsByScopeId[e]={});var h=this._contributionsByScopeId[e];o&&(h=this._createEntryForPath(h,o)),h[t]?(n&&(h[t].title=n),i&&(h[t].position=i),s&&(h[t].imageClass=s),a&&(h[t].tooltip=a),l&&(h[t].selectionClass=l),c&&(h[t].extraClass=c),d===!0?h[t].pretendDefaultActionId=!0:h[t].defaultActionId=d,h[t].emptyGroupMessage=r):(h[t]={title:n,position:i,emptyGroupMessage:r,imageClass:s,tooltip:a,selectionClass:l,defaultActionId:d===!0?null:d,pretendDefaultActionId:d===!0,children:{},extraClasses:c},h.sortedContributions=null)},_createEntryForPath:function(e,t){if(t){var i=t.split("/");i.forEach(function(t){t.length>1&&(e[t]||(e[t]={position:0,children:{}},e.sortedContributions=null),e=e[t].children)})}return e},registerSelectionService:function(e,t){this._contributionsByScopeId[e]||(this._contributionsByScopeId[e]={}),this._contributionsByScopeId[e].localSelectionService=t},setServiceRegistry:function(e){this._serviceRegistry=e,this._prefService=e.getService("orion.core.preference"),this._prefService&&(this._getBindingOverrides().then(function(e){this._bindingOverrides=e,this._updateBindingOverrides()}.bind(this)),this._prefService.addEventListener("changed",function(e){"/KeyBindings"===e.namespace&&this._getBindingOverrides().then(function(e){if(e.length>this._bindingOverrides.length)for(var t=this._bindingOverrides.length;t1){if(!n[e])return;n=n[e].children}})}delete n[t],n.sortedContributions=null}},_addBinding:function(e,t,i,n){if(!e.id)throw new Error("No command id: "+e);"key"===t?this._activeBindings[e.id]={command:e,keyBinding:i,bindingOnly:n}:"url"===t&&(this._urlBindings[e.id]={command:e,urlBinding:i,bindingOnly:n})},_addPendingBinding:function(e,t,i,n){this._pendingBindings[e]=this._pendingBindings[e]||[],this._pendingBindings[e].push({type:t,binding:i,bindingOnly:n})},_checkForTrailingSeparator:function(e,t,i){var n;if(("tool"===t||"button"===t)&&(n=e.childNodes.length>0?e.childNodes[e.childNodes.length-1]:null,n&&n.classList.contains("commandSeparator")))return i?(e.removeChild(n),!1):!0;if("menu"===t){var o=s.$$array("li > *",e);if(o.length>0&&o[o.length-1].classList.contains("dropdownSeparator"))return n=o[o.length-1],i?(n.parentNode.parentNode.removeChild(n.parentNode),!1):!0}return!1},renderCommands:function(e,t,i,n,o,r,a){if("string"!=typeof e)throw"a scope id for rendering must be specified";if(t=s.node(t),!t)throw"no parent";var l=this._contributionsByScopeId[e];if(!i&&l){var d=l.localSelectionService||this._selectionService,c=this;return void(d&&d.getSelections(function(i){c.renderCommands(e,t,i,n,o,r)}))}l&&(this._render(e,l,t,i,n,o||"button",r,a),this._checkForTrailingSeparator(t,o,!0))},destroy:function(e){if(e=s.node(e),!e)throw"no parent";for(;e.hasChildNodes();){var t=e.firstChild;t.commandTooltip&&t.commandTooltip.destroy(),t.emptyGroupTooltip&&t.emptyGroupTooltip.destroy(),this.destroy(t),e.removeChild(t)}},_render:function(t,n,o,s,a,d,c,h){var u=n.sortedContributions;if(!u){u=[];var p=!1;for(var f in n)if(Object.prototype.hasOwnProperty.call(n,f)){var g=n[f];g&&"number"==typeof g.position&&(g.id=f,u.push(g),p=!0)}p&&(u.sort(function(e,t){return e.position-t.position}),n.sortedContributions=u)}var _=0,m=this;u.forEach(function(n){function u(e){e&&e.parentNode&&e.parentNode.removeChild(e)}var p,f;if(n.imageClass||(n.imageClass=null),n.children&&Object.getOwnPropertyNames(n.children).length>0){var g,v=n.children;if("tool"===d||"button"===d)if(n.title){var y;if(n.defaultActionId){n.pretendDefaultActionId=n.defaultActionId===!0;var x=m._commandList[n.defaultActionId];x&&(x.visibleWhen?x.visibleWhen(s):!0)?(y=new e.CommandInvocation(a,s,c,x,m),y.domParent=o):n.pretendDefaultActionId=!0}g=m._createDropdownMenu(o,n.title,null,null,n.imageClass,n.tooltip,n.selectionClass,null,y,n.pretendDefaultActionId,n.extraClasses),h&&i.generateNavGrid(h,g.menuButton),g&&(m._render(t,n.children,g.menu,s,a,"menu",c,h),m._checkForTrailingSeparator(g.menu,"menu",!0),0===g.menu.childNodes.length?n.emptyGroupMessage?g.menuButton.emptyGroupTooltip||(g.menuButton.emptyGroupTooltip=new l.Tooltip({node:g.menuButton,text:n.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(h&&i.removeNavGrid(h,g.menuButton),u(g.menu),u(g.menuButton),u(g.destroyButton)):g.menuButton.style.visibility="visible")}else{var b;if(o.childNodes.length>0&&!m._checkForTrailingSeparator(o,d)&&(b=m.generateSeparatorImage(o)),m._render(t,v,o,s,a,d,c,h),o.childNodes.length>0){var w=o.childNodes[o.childNodes.length-1];w!==b&&(b=m.generateSeparatorImage(o))}}else if(n.title){var C=m._createDropdownMenu(o,n.title,!0,null,null,n.imageClass);C&&(m._render(t,v,C.menu,s,a,"menu",c,h),m._checkForTrailingSeparator(C.menu,"menu",!0),0===C.menu.childNodes.length&&C.destroyButton&&o.removeChild(C.destroyButton))}else o.childNodes.length>0&&m._generateMenuSeparator(o),m._render(t,v,o,s,a,d,c,h),o.childNodes.length>0&&m._generateMenuSeparator(o)}else{var T=m._commandList[n.id],L=T?!0:!1,k=null,D=null;if(T){f=new e.CommandInvocation(n.handler||a,s,c,T,m),f.domParent=o;var A=!1;try{A=L&&(T.visibleWhen?T.visibleWhen(s,f):!0)}catch(S){throw console.log(S),S}m._activeBindings[T.id]&&m._activeBindings[T.id].keyBinding&&(k=m._activeBindings[T.id],k.invocation=A?f:null,k.bindingOnly&&(L=!1)),m._urlBindings[T.id]&&m._urlBindings[T.id].urlBinding&&(D=m._urlBindings[T.id],D.invocation=A?f:null,D.bindingOnly&&(L=!1)),L=L&&A}if(L)if(T.choiceCallback){var E,O;"tool"===d||"button"===d?(E=o,O=!1,"ul"===o.nodeName.toLowerCase()&&(E=document.createElement("li"),o.appendChild(E))):(E=o,O=!0);var N=function(e){T.populateChoicesMenu(e,s,a,c,m)};m._createDropdownMenu(E,T.name,O,N.bind(T),T.imageClass,T.tooltip||T.title,T.selectionClass,T.positioningNode)}else{f.handler=f.handler||this,f.domParent=o;var M,I=function(){m._invoke(f)};if("menu"===d){var B=null;k&&k.keyBinding&&(B=r.getUserKeyString(k.keyBinding)),M=e.createCommandMenuItem(o,T,f,null,I,B),f.onClick=I,m._registerRenderedCommand(T.id,t,f)}else if("quickfix"===d){p=d+T.id+_;var R=document.createElement("div");o.appendChild(R),o.classList.add("quickFixList"),M=e.createQuickfixItem(R,T,f,I,m._prefService)}else p=d+T.id+_,M=e.createCommandItem(o,T,f,p,null,"tool"===d,I);i.generateNavGrid(h,M),f.domNode=M,_++}}})},_createDropdownMenu:function(t,i,n,o,r,c,h,u,p,f,g){if(t=s.node(t),!t||!s.contains(document.body,t))return null;var _,m,v,y,x=t;if(n){var b=document.createRange();b.selectNode(t);var w=b.createContextualFragment(d);s.processTextNodes(w,{ButtonText:i}),t.appendChild(w),y=t.lastChild,m=y.lastChild,_=m.previousSibling,_.dropdown=new a.Dropdown({dropdown:m,populate:o,parentDropdown:t.dropdown}),m.dropdown=_.dropdown}else{"ul"===t.nodeName.toLowerCase()&&(x=document.createElement("li"),t.appendChild(x),y=x);var C=null;r&&(C="dropdownButtonWithIcon",c=c||i),c=r?c||i:c;var T=e.createDropdownMenu(x,i,o,C,r,!1,h,u,p||f,g);if(v=T.dropdownArrow,_=T.menuButton,v){p&&(p.domNode=T.menuButton);var L=this;_.onclick=function(e){var t=s.bounds(v);(e.clientX>=t.left||f===!0)&&T.dropdown?T.dropdown.toggle(e):L._invoke(p)},T.dropdown&&(_.onkeydown=function(e){s.KEY.DOWN===e.keyCode&&(T.dropdown.toggle(e),s.stop(e))})}m=T.menu;var k,D=p&&p.command&&(p.command.tooltip||p.command.name);k=D?p.command.tooltip||p.command.name:c,k&&(_.commandTooltip=new l.Tooltip({node:_,text:k,position:["above","below","right","left"]}))}return{menuButton:_,menu:m,dropdown:_.dropdown,destroyButton:y,dropdownArrow:v}},_generateMenuSeparator:function(e){if(!this._checkForTrailingSeparator(e,"menu")){var t=document.createElement("li");t.classList.add("dropdownSeparator");var i=document.createElement("span");i.classList.add("dropdownSeparator"),t.appendChild(i),e.appendChild(t)}},generateSeparatorImage:function(e){var t;return"ul"===e.nodeName.toLowerCase()?(t=document.createElement("li"),e.appendChild(t)):(t=document.createElement("span"),e.appendChild(t)),t.classList.add("core-sprite-sep"),t.classList.add("imageSprite"),t.classList.add("commandSeparator"),t}},p.prototype.constructor=p,f.prototype={match:function(e){var t=o.matchResourceParameters(e);return"undefined"!=typeof t[this.token]?(this.parameterValue=t[this.token],this):null}},f.prototype.constructor=f,g.prototype.constructor=g,_.prototype={optionsRequested:function(){return this.optionsRequested}},_.prototype.constructor=_,m.prototype={_storeParameters:function(e){if(this.parameterTable=null,e){var t=this.parameterTable={};e.forEach(function(e){t[e.name]=e})}},updateParameters:function(e){"function"==typeof this.getParameters&&this._storeParameters(this.getParameters(e))},hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(e){return this.parameterTable[e]},valueFor:function(e){var t=this.parameterTable[e];return t?t.value:null},setValue:function(e,t){var i=this.parameterTable[e];i&&(i.value=t)},forEach:function(e){for(var t in this.parameterTable)this.parameterTable[t].type&&this.parameterTable[t].name&&e(this.parameterTable[t])},validate:function(e,t){var i=this.parameterTable[e];return i&&i.validator?i.validator(t):!0},makeCopy:function(){var e=[];this.forEach(function(t){var i=new _(t.name,t.type,t.label,t.value,t.lines,t.eventListeners,t.validator);e.push(i)});var t=new m(e,this._options,this.getParameters);return t.clientCollect=this.clientCollect,t.message=this.message,t},hasOptionalParameters:function(){return this._hasOptionalParameters}},m.prototype.constructor=m,{CommandRegistry:p,URLBinding:f,ParametersDescription:m,CommandParameter:_,CommandEventListener:g}}),define("orion/editor/nls/messages",{root:!0}),define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",diffAdded:"Diff Added Lines",diffDeleted:"Diff Deleted Lines",diffModified:"Diff Modified Lines",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",escape:"Escape",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",findReplace:"Find/Replace",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode: Enter or ESC to exit",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",noProposals:"No proposals found",computingProposals:"Computing content assist proposals...",lineColumn:"Line ${0} : Column ${1}",lineColumnOffset:"Line ${0} : Column ${1} : Offset ${2}",multiSelections:"${0} selection regions",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace All",findWith:"Find With",replaceWith:"Replace With",caseInsensitive:"Aa",regex:"/.*/",wholeWord:"\\b",caseInsensitiveTooltip:"Toggle Case Insensitive",regexTooltip:"Toggle Regular Expression",wholeWordTooltip:"Toggle Whole Word",closeTooltip:"Close",replacingAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"}),define("orion/editor/eventTarget",[],function(){function e(){}return e.addMixin=function(t){var i=e.prototype;for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},e.prototype={addEventListener:function(e,t,i){this._eventTypes||(this._eventTypes={});var n=this._eventTypes[e];n||(n=this._eventTypes[e]={level:0,listeners:[]});var o=n.listeners;o.push({listener:t,useCapture:i})},dispatchEvent:function(e){var t=e.type;this._dispatchEvent("pre"+t,e),this._dispatchEvent(t,e),this._dispatchEvent("post"+t,e)},_dispatchEvent:function(e,t){var i=this._eventTypes?this._eventTypes[e]:null;if(i){var n=i.listeners;try{if(i.level++,n)for(var o=0,r=n.length;r>o;o++)if(n[o]){var s=n[o].listener;"function"==typeof s?s.call(this,t):s.handleEvent&&"function"==typeof s.handleEvent&&s.handleEvent(t)}}finally{if(i.level--,i.compact&&0===i.level){for(var a=n.length-1;a>=0;a--)n[a]||n.splice(a,1);0===n.length&&delete this._eventTypes[e],i.compact=!1}}}},isListening:function(e){return this._eventTypes?void 0!==this._eventTypes[e]:!1},removeEventListener:function(e,t,i){if(this._eventTypes){var n=this._eventTypes[e];if(n){for(var o=n.listeners,r=0,s=o.length;s>r;r++){var a=o[r];if(a&&a.listener===t&&a.useCapture===i){0!==n.level?(o[r]=null,n.compact=!0):o.splice(r,1);break}}0===o.length&&delete this._eventTypes[e]}}}},{EventTarget:e}}),define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(e,t){function i(){}function n(e,t,i){this.start=e,this.end=t,this._projectionModel=i,this.html=this._expandedHTML,this.style=this._expandedStyle,this.expanded=!0}function o(t,n){var o=t.lastIndexOf("."),r=t.substring(o+1),s={title:e[r],style:{styleClass:"annotation "+r},html:"
    ",overviewStyle:{styleClass:"annotationOverview "+r}};n?s.lineStyle={styleClass:"annotationLine "+r}:s.rangeStyle={styleClass:"annotationRange "+r},i.registerType(t,s)}function r(){}function s(e,t,i,n,o){var r;for(void 0===n&&(n=-1),void 0===o&&(o=e.length);o-n>1;)if(r=Math.floor((o+n)/2),t<=e[r].start)o=r;else{if(i&&t",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"",_collapsedStyle:{styleClass:"annotation collapsed"},_collapse:function(){return this.expanded?(this.expanded=!1,this.html=this._collapsedHTML,this.style=this._collapsedStyle,this._annotationModel&&this._annotationModel.modifyAnnotation(this),!0):!1},_expand:function(){return this.expanded?!1:(this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._annotationModel&&this._annotationModel.modifyAnnotation(this),!0)},_collapseImpl:function(e){if(this._collapse()){e&&this._forEachOverlaping(function(e){e.expanded||(e._expandImpl(!1),e._recollapse=!0)});var t=this._projectionModel,i=t.getBaseModel();this._projection={annotation:this,start:i.getLineStart(i.getLineAtOffset(this.start)+1),end:i.getLineEnd(i.getLineAtOffset(this.end),!0)},t.addProjection(this._projection)}},_expandImpl:function(e){this._expand()&&(this._projectionModel._removeProjection(this._projection,!this._annotationModel),e&&this._forEachOverlaping(function(e){e._recollapse&&(e._collapseImpl(!1),e._recollapse=!1)}))},_forEachOverlaping:function(e){if(this._annotationModel)for(var t=this._annotationModel.getAnnotations(this.start,this.end);t.hasNext();){var n=t.next();n!==this&&n.type===i.ANNOTATION_FOLDING&&e.call(this,n)}},collapse:function(){this._recollapse=!1,this._collapseImpl(!0)},expand:function(){this._recollapse=!1,this._expandImpl(!0)}},i.ANNOTATION_ERROR="orion.annotation.error",i.ANNOTATION_WARNING="orion.annotation.warning",i.ANNOTATION_TASK="orion.annotation.task",i.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint",i.ANNOTATION_BOOKMARK="orion.annotation.bookmark",i.ANNOTATION_FOLDING="orion.annotation.folding",i.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket",i.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket",i.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine",i.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch",i.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch",i.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence",i.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence",i.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup",i.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup",i.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup",i.ANNOTATION_BLAME="orion.annotation.blame",i.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame",i.ANNOTATION_DIFF_ADDED="orion.annotation.diffAdded",i.ANNOTATION_DIFF_DELETED="orion.annotation.diffDeleted",i.ANNOTATION_DIFF_MODIFIED="orion.annotation.diffModified";var d={};return i.registerType=function(e,t){var i=t;return"function"!=typeof i&&(i=function(e,t,i){this.start=e,this.end=t,void 0!==i&&(this.title=i)},i.prototype=t),i.prototype.type=e,d[e]=i,e},i.createAnnotation=function(e,t,i,n){return new(this.getType(e))(t,i,n)},i.getType=function(e){return d[e]},o(i.ANNOTATION_ERROR),o(i.ANNOTATION_WARNING),o(i.ANNOTATION_TASK),o(i.ANNOTATION_BREAKPOINT),o(i.ANNOTATION_BOOKMARK),o(i.ANNOTATION_CURRENT_BRACKET),o(i.ANNOTATION_MATCHING_BRACKET),o(i.ANNOTATION_CURRENT_SEARCH),o(i.ANNOTATION_MATCHING_SEARCH),o(i.ANNOTATION_READ_OCCURRENCE),o(i.ANNOTATION_WRITE_OCCURRENCE),o(i.ANNOTATION_SELECTED_LINKED_GROUP),o(i.ANNOTATION_CURRENT_LINKED_GROUP),o(i.ANNOTATION_LINKED_GROUP),o(i.ANNOTATION_CURRENT_LINE,!0),o(i.ANNOTATION_BLAME,!0),o(i.ANNOTATION_CURRENT_BLAME,!0),o(i.ANNOTATION_DIFF_ADDED),o(i.ANNOTATION_DIFF_DELETED),o(i.ANNOTATION_DIFF_MODIFIED),i.registerType(i.ANNOTATION_FOLDING,n),r.addMixin=function(e){var t=r.prototype;for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},r.prototype={addAnnotationType:function(e,t){this._annotationTypes||(this._annotationTypes=[]);var i=t-1;void 0!=t&&i>=0&&ii.start?e=t)break}return null},i=n(),{next:function(){var e=i;return e&&(i=n()),e},hasNext:function(){return null!==i}}},modifyAnnotation:function(e){if(e){var t=this._getAnnotationIndex(e);if(!(0>t)){var i={type:"Changed",added:[],removed:[],changed:[e]};this.onChanged(i)}}},onChanged:function(e){return this.dispatchEvent(e)},removeAnnotations:function(e){var t,i,n=this._annotations;if(e)for(t=[],i=n.length-1;i>=0;i--){var o=n[i];o.type===e&&(n.splice(i,1),t.splice(0,0,o),o._annotationModel=null)}else t=n,n=[];var r={type:"Changed",removed:t,added:[],changed:[]};this.onChanged(r)},removeAnnotation:function(e){if(e){var t=this._getAnnotationIndex(e);if(!(0>t)){e._annotationModel=null;var i={type:"Changed",removed:this._annotations.splice(t,1),added:[],changed:[]};this.onChanged(i)}}},replaceAnnotations:function(e,t){var i,n,o,r=this._annotations,a=[];if(e)for(i=e.length-1;i>=0;i--)o=e[i],n=this._getAnnotationIndex(o),0>n||(o._annotationModel=null,r.splice(n,1),a.splice(0,0,o));for(t||(t=[]),i=0;i=0&&s=r?(c._oldStart=c.start,c._oldEnd=c.end,c.start+=d,c.end+=d,l.changed.push(c)):c.end<=t||(c.start0||l.removed.length>0||l.changed.length>0)&&this.onChanged(l)}}},t.EventTarget.addMixin(a.prototype),l.prototype={destroy:function(){var e=this._view;e&&(e.removeEventListener("Destroy",this._listener.onDestroy),e.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);var t=this._annotationModel;t&&(t.removeEventListener("Changed",this._listener.onChanged),t=null)},_mergeStyle:function(e,t){if(t){e||(e={}),e.styleClass&&t.styleClass&&e.styleClass!==t.styleClass?e.styleClass+=" "+t.styleClass:e.styleClass=t.styleClass;var i;if(t.tagName&&(e.tagName||(e.tagName=t.tagName)),t.style){e.style||(e.style={});for(i in t.style)e.style[i]||(e.style[i]=t.style[i])}if(t.attributes){e.attributes||(e.attributes={});for(i in t.attributes)e.attributes[i]||(e.attributes[i]=t.attributes[i])}}return e},_mergeStyleRanges:function(e,t){e||(e=[]);for(var i,n=s(e,t.start,!0);n=o.end)){i=this._mergeStyle({},o.style),i=this._mergeStyle(i,t.style);var r=[];r.push(n,1),t.starto.start&&r.push({start:o.start,end:t.start,style:o.style}),r.push({start:Math.max(o.start,t.start),end:Math.min(o.end,t.end),style:i}),t.endo.end?{start:o.end,end:t.end,style:t.style}:null,Array.prototype.splice.apply(e,r)}}return t&&(i=this._mergeStyle({},t.style),e.splice(n,0,{start:t.start,end:t.end,style:i})),e},_onAnnotationModelChanged:function(e){function t(e,t){r.getBaseModel&&(e=r.mapOffset(e,!0),t=r.mapOffset(t,!0)),-1!==e&&-1!==t&&n.redrawRange(e,t)}function i(e,i){for(var n=0;n=5e4)var c=(new Date).getTime();if(this._rootBlock=this._stylerAdapter.createBlock(d,this,s,null),c){var h=(new Date).getTime()-c;h>10&&i.logTiming("editor","styler compute blocks (ms/50000 chars)",5e4*h/l,o.getContentType())}if(n){var u=[];n.removeAnnotations(e.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),t.getModel(),u),this._detectTasks&&(n.removeAnnotations(e.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,s,u)),n.replaceAnnotations([],u)}t.redrawLines()}var d=function(e,t,i,n,o){var r;for(void 0===n&&(n=-1),void 0===o&&(o=e.length);o-n>1;)if(r=Math.floor((o+n)/2),t<=e[r].start)o=r;else{if(i&&tt.result.index?1:e.pattern.pattern.index0;){var h=d[0];if(d.splice(0,1),rt.result.index?1:e.pattern.pattern.index0;){var c=l[0];if(l.splice(0,1),c.result.indext.start?1:0});for(var g=0;g=r);u++){var p=c[u].start,f=c[u].end;if(p>l){var g=e.getLineAtOffset(l),_=e.getLineStart(g);this._stylerAdapter.parse(n.substring(_-o,p-o),_,l-_,i,a),a.forEach(function(e){e.style&&(0===e.style.indexOf(t.beginName)?s.push(e.start+1):0===e.style.indexOf(t.endName)&&s.push(-(e.start+1)))}),a=[]}l=f}return r>l&&(g=e.getLineAtOffset(l),_=e.getLineStart(g),this._stylerAdapter.parse(n.substring(_-o,r-o),_,l-_,i,a),a.forEach(function(e){e.style&&(0===e.style.indexOf(t.beginName)?s.push(e.start+1):0===e.style.indexOf(t.endName)&&s.push(-(e.start+1)))})),s},_findMatchingBracket:function(e,t,i){var n=e.getLineAtOffset(i),o=e.getLineEnd(n),r=e.getText(i,o),s=this._stylerAdapter.getBracketMatch(t,r);if(!s)return-1;for(var a=e.getLine(n),l=e.getLineStart(n),d=this._findBrackets(e,s,t,a,l,o),c=0;c=0?1:-1;if(d[c]*h-1===i){var u=1;if(s.atStart){for(c++;c=0?1:-1,u+=h,0===u)return d[c]*h-1;n+=1;for(var p=e.getLineCount();p>n;){a=e.getLine(n),l=e.getLineStart(n),o=e.getLineEnd(n),d=this._findBrackets(e,s,t,a,l,o);for(var f=0;f=0?1:-1,u+=h,0===u)return d[f]*h-1;n++}}else{for(c--;c>=0;c--)if(h=d[c]>=0?1:-1,u+=h,0===u)return d[c]*h-1;for(n-=1;n>=0;){a=e.getLine(n),l=e.getLineStart(n),o=e.getLineEnd(n),d=this._findBrackets(e,s,t,a,l,o);for(var g=d.length-1;g>=0;g--)if(h=d[g]>=0?1:-1,u+=h,0===u)return d[g]*h-1;n--}}break}}return-1},_getLineStyle:function(e){if(this._highlightCaretLine){var t=this._view,i=t.getModel(),n=t.getSelections(),o=!1;if(!n.some(function(t){return t.start===t.end?(o=o||i.getLineAtOffset(t.start)===e,!1):!0})&&o)return this._caretLineStyle}return null},_getStyles:function(e,t,i,n,o){for(var r=n+i.length,s=[],a=n+o,l=e.getBlocks(),c=d(l,a,!0),h=c;h=r);h++){var u=l[h].start,p=l[h].end;if(u>a){var f=t.getLineAtOffset(a),g=t.getLineStart(f);this._stylerAdapter.parse(i.substring(g-n,u-n),g,a-g,e,s)}var _=Math.max(a,u);if(_===u){var m=this._stylerAdapter.getBlockStartStyle(l[h],i.substring(_-n),_,s);m&&(_+=m.length)}var v=Math.min(r,p),y=[];if(v===p){var x=i.substring(v-a-(l[h].end-l[h].contentEnd)),b=this._stylerAdapter.getBlockEndStyle(l[h],x,v,y);b&&(v-=b.length)}f=t.getLineAtOffset(_),g=t.getLineStart(f);var w=this._getStyles(l[h],t,i.substring(g-n,v-n),g,_-g),C=this._stylerAdapter.getBlockContentStyleName(l[h]);if(C){var T=_;w.forEach(function(e){e.start-T&&s.push({start:T,end:e.start,style:C}),e.mergeable&&(e.style+=","+C),s.push(e),T=e.end}),v-T&&s.push({start:T,end:v,style:C})}else s=s.concat(w);s=s.concat(y),a=p}return r>a&&(f=t.getLineAtOffset(a),g=t.getLineStart(f),this._stylerAdapter.parse(i.substring(g-n,r-n),g,a-g,e,s)),s},_isRenderingWhitespace:function(){return this._whitespacesVisible},_onDestroy:function(){this.destroy()},_onLineStyle:function(e){e.textView===this._view&&(e.style=this._getLineStyle(e.lineIndex));var t=e.lineStart,i=e.textView.getModel();if(i.getBaseModel){t=i.mapOffset(t);var n=i.getBaseModel()}e.ranges=this._getStyles(this._rootBlock,n||i,e.lineText,t,0);for(var o=e.ranges.length-1;o>=0;o--){var r=e.ranges[o];if(r.style){if(r.style={styleClass:r.style.replace(/\./g," ")},n){var s=r.end-r.start;r.start=i.mapOffset(r.start,!0),r.end=r.start+s}}else e.ranges.splice(o,1)}this._isRenderingWhitespace()&&(this._spliceStyles(this._spacePattern,e.ranges,e.lineText,e.lineStart),this._spliceStyles(this._tabPattern,e.ranges,e.lineText,e.lineStart))},_onModelChanged:function(t){for(var i,n,o,r,s,a,l,c=t.start,h=t.removedCharCount,u=t.addedCharCount,p=u-h,f=this._view.getModel(),g=f.getBaseModel?f.getBaseModel():f,_=c+h,m=g.getCharCount(),v=g.getLineStart(g.getLineAtOffset(c)),y=this._findBlock(this._rootBlock,c);;){if(o=y.parent,!i&&o){if(0>p&&y.end-c<=-p){y=o;continue}if(s=g.getText(y.start,Math.min(m,y.end+p+1)),!this._stylerAdapter.verifyBlock(g,s,y,p)){y=o;continue}}n=y.getBlocks();var x=n.length,b=d(n,v,!0),w=d(n,_,!1,b-1,x);if(i=!1,b&&n.length&&n[b-1].end===c){s=g.getText(n[b-1].start,Math.min(m,c+1));var C=this.computeBlocks(g,s,y,n[b-1].start,null,null,null);C.length&&C[0].end!==n[b-1].end&&(b--,i=!0)}x>b&&n[b].start<=v&&(vc&&(l+=p)):b===x&&x>0&&y.end-p===n[x-1].end?(l=n[--b].start,l>c&&(l+=p)):l=Math.max(v,y.contentStart),a=x>w?n[w].end:y.contentEnd,a>=c&&(a+=p),a=Math.min(a,m-1),s=g.getText(l,a+1);var T=this.computeBlocks(g,s,y,l,null,null,null);if(x>w){if(T.length&&T[T.length-1].end===a&&T[T.length-1].typeId===n[w].typeId)break;if(T.length&&this._stylerAdapter.blockSpansBeyondEnd(T[T.length-1])){w++;for(var L=T[T.length-1].getBlocks(),k=(L.length?L[L.length-1]:T[T.length-1]).typeId;x>w;){if(n[w].typeId===k){var D=n[w].end+p;D=Math.min(D,m-1),s=g.getText(l,D+1);var A=this.computeBlocks(g,s,y,l,null,null,null);if(A.length&&A[A.length-1].end===D){a=D,T=A;break}}w++}if(x>w)break}}else if(!T.length||T[T.length-1].end<=y.contentEnd+p)break;if(!o){a=m,w=x,s=g.getText(l,a),T=this.computeBlocks(g,s,y,l,null,null,null);break}y=o,r=!0}this._rootBlock.adjustBounds(c,p),w=Math.min(w+1,x);var S;if(r||(r=w-b!==T.length),!r)for(var E=0;Ec&&($-=p),G>c&&(G-=p),c>=$&&G>c&&_>=$&&G>_){var z=g.getLineAtOffset(H.start),Y=g.getLineAtOffset(H.end);z!==Y?H.expanded||H.expand():F.push(H)}}else F.push(H),H.expand()}else H.type===e.AnnotationType.ANNOTATION_TASK&&y.start<=H.start&&H.end<=y.end&&F.push(H)}j&&U.getBlocks().forEach(function(e){this._updateFolding(e,g,f,W,P,l,a)}.bind(this)),this._detectTasks&&this._computeTasks(y,g,P,l,a),this._annotationProviders.forEach(function(e){var t=[],i=[];e(this._annotationModel,g,y,l,a,t,i),F=F.concat(t),P=P.concat(i)}.bind(this)),this._annotationModel.replaceAnnotations(F,P)}},_onMouseDown:function(e){if(2===e.clickCount){var t=this._view.getModel(),i=this._view.getOffsetAtLocation(e.x,e.y);if(i>0){var n=i-1,o=t;t.getBaseModel&&(n=t.mapOffset(n),o=t.getBaseModel());var r=this._findBlock(this._rootBlock,n),s=this._findMatchingBracket(o,r,n);if(-1!==s){e.preventDefault();var a=s;t.getBaseModel&&(a=t.mapOffset(a,!0)),i>a&&(i--,a++),this._view.setSelection(a,i)}}}},_onSelection:function(t){function i(e){var t={};return e.some(function(e){return e.isEmpty()?(t[l.getLineAtOffset(e.start).toString()]=!0,!1):!0})?{}:t}function n(e,t){for(var i in e)t[i]||(o=i>>0,a.redrawLines(o,o+1))}var o,r=Array.isArray(t.oldValue)?t.oldValue:[t.oldValue],s=Array.isArray(t.newValue)?t.newValue:[t.newValue],a=this._view,l=a.getModel();if(this._highlightCaretLine){var d=i(r),c=i(s);n(d,c),n(c,d)}if(this._annotationModel){var h,u,p=this._bracketAnnotations;if(1===s.length&&s[0].isEmpty()&&(u=s[0].getCaret())>0){var f=u-1;l.getBaseModel&&(f=l.mapOffset(f),l=l.getBaseModel());var g=this._findBlock(this._rootBlock,f),_=this._findMatchingBracket(l,g,f);-1!==_&&(h=[e.AnnotationType.createAnnotation(e.AnnotationType.ANNOTATION_MATCHING_BRACKET,_,_+1),e.AnnotationType.createAnnotation(e.AnnotationType.ANNOTATION_CURRENT_BRACKET,f,f+1)])}this._bracketAnnotations=h,this._annotationModel.replaceAnnotations(p,h)}},_spliceStyles:function(e,t,i,o){var r=e.regex;r.lastIndex=0;for(var s=0,a=r.exec(i);a;){for(var l=o+a.index;s|<|&|(\\|\\|))+",name:"punctuation.operator"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"meta.documentation.annotation"},{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}}),define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["class","const","debugger","delete","enum","export","extends","function","implements","import","in","instanceof","interface","let","new","package","private","protected","public","static","super","typeof","var","void","with"],i=["break","case","catch","continue","default","do","else","finally","for","if","return","switch","throw","try","while","yield"],n=["this"],o=["false","null","true","undefined"],r=[];return r.push.apply(r,e.grammars),r.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{include:"#string_multiline_singleQuote"},{include:"#string_multiline_doubleQuote"},{include:"#templateLiteral"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"#regex"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#jsFunctionDef"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{include:"#keywordsOperator"},{include:"#keywordsControl"},{include:"#languageConstant"},{include:"#languageVariable"}],repository:{jsFunctionDef:{begin:"(function)(\\s+[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(",end:"\\)",captures:{1:{name:"keyword.operator.js"},2:{name:"entity.name.function.js"}},patterns:[{include:"orion.c-like#comment_singleLine"},{include:"orion.c-like#comment_block"},{match:"[^\\s,]+",name:"variable.parameter.js"}]},keywordsControl:{match:"\\b(?:"+i.join("|")+")\\b",name:"keyword.control.js"},keywordsOperator:{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.js"},languageConstant:{match:"\\b(?:"+o.join("|")+")\\b",name:"constant.language.js"},languageVariable:{match:"\\b(?:"+n.join("|")+")\\b",name:"variable.language.js"},string_multiline_singleQuote:{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},string_multiline_doubleQuote:{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},regex:{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},templateLiteral:{begin:"`",end:"`",name:"string.quoted.backtick.js",patterns:[{begin:"\\$\\{",end:"\\}",name:"string.interpolated.js",patterns:[{include:"#string_multiline_singleQuote"},{include:"#string_multiline_doubleQuote"},{include:"#templateLiteral"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"#regex"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#jsFunctionDef"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{include:"#keywordsOperator"},{include:"#keywordsControl"},{include:"#languageConstant"},{include:"#languageVariable"}]}]}}}),{id:r[r.length-1].id,grammars:r,keywords:t.concat(i).concat(n).concat(o)}}),define("orion/editor/stylers/application_vnd.coffeescript/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/application_javascript/syntax"],function(e,t){var i=["break","case","catch","continue","default","do","else","finally","for","if","loop","return","switch","then","throw","try","unless","until","when","while","yield"],n=["and","arguments","by","class","const","debugger","delete","enum","eval","export","extends","function","implements","import","instanceof","interface","in","isnt","is","let","native","new","not","no","off","of","on","or","package","private","protected","public","static","super","typeof","var","void","with","yes","__bind","__extends","__hasProp","__indexOf","__slice"],o=["false","null","true","undefined"],r=["this"],s=[];return s.push.apply(s,e.grammars),s.push.apply(s,t.grammars),s.push({id:"orion.coffeescript",contentTypes:["application/vnd.coffeescript"],patterns:[{include:"#comment_block"},{include:"#embedded_js"},{include:"#string_singleline"},{include:"#string_multiline"},{include:"#heregex"},{include:"#regex"},{include:"orion.lib#string_singleQuote"},{include:"#comment_singleLine"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{include:"#reserved_words"},{include:"#keyword_control"},{include:"#keyword_operator"},{include:"#language_variable"},{include:"#constant"},{include:"#punctuation"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"}],repository:{comment_block:{begin:{match:"###(?!#)",literal:"###"},end:{match:"###",literal:"###"},name:"comment.block.coffeescript"},comment_singleLine:{match:{match:"#[^$]*",literal:"#"},name:"comment.line.coffeescript"},constant:{match:"\\b(?:"+o.join("|")+")\\b",name:"constant.language.coffeescript"},embedded_js:{begin:"`",end:"`",patterns:[{include:"orion.js"}]},heregex:{begin:"\\/{3}",end:"\\/{3}(?:[gim]{0,3})",name:"string.heregexp.coffeescript",patterns:[{match:"\\s#[^$]*",name:"comment.block.coffeescript"}]},keyword_control:{match:"\\b(?:"+i.join("|")+")\\b",name:"keyword.control.coffeescript"},keyword_operator:{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.operator.coffeescript"},language_variable:{match:"\\b(?:"+r.join("|")+")\\b",name:"variable.language.coffeescript"},punctuation:{match:"[-=]?>|<|[-+*\\/%<>&|^!?=]?=|>>>=?|([-+*/%:])\\1|([&|<>])\\2=?|\\?\\.?|\\.{2,3}|%|@",name:"punctuation.operator.coffeescript"},regex:{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.coffeescript"},string_singleline:{match:'"(?:\\\\.|[^"])*"',name:"string.quoted.double.coffeescript",patterns:[{begin:"#{",end:"}",name:"string.interpolated.coffeescript",patterns:[{include:"#comment_block"},{include:"#embedded_js"},{include:"#comment_singleLine"},{include:"#heregex"},{include:"#regex"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#number_decimal"},{include:"#reserved_words"},{include:"#keyword_control"},{include:"#keyword_operator"},{include:"#language_variable"},{include:"#constant"},{include:"#punctuation"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"}]}]},string_multiline:{begin:'("("")?)',end:"\\1",name:"string.quoted.multiline.coffeescript",patterns:[{begin:"#{",end:"}",name:"string.interpolated.coffeescript",patterns:[{include:"#comment_block"},{include:"#embedded_js"},{include:"#comment_singleLine"},{include:"#heregex"},{include:"#regex"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#number_decimal"},{include:"#reserved_words"},{include:"#keyword_control"},{include:"#keyword_operator"},{include:"#language_variable"},{include:"#constant"},{include:"#punctuation"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"}]}]}}}),{id:s[s.length-1].id,grammars:s,keywords:i.concat(o)}}),define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["abstract","boolean","byte","char","class","double","extends","final","float","implements","import","instanceof","int","interface","long","native","new","package","private","protected","public","short","static","synchronized","throws","transient","void","volatile"],i=["break","case","catch","continue","default","do","else","finally","for","if","return","switch","throw","try","while"],n=["false","null","true"],o=["this","super"],r=[];return r.push.apply(r,e.grammars),r.push({id:"orion.java",contentTypes:["text/x-java-source"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.java"},{match:"\\b(?:"+i.join("|")+")\\b",name:"keyword.control.java"},{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.java"},{match:"\\b(?:"+o.join("|")+")\\b",name:"variable.language.java"}]}),{id:r[r.length-1].id,grammars:r,keywords:t.concat(i).concat(n).concat(o)} -}),define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["alignment-adjust","alignment-baseline","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animation","appearance","azimuth","backface-visibility","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","background","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-bottom","border-collapse","border-color","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-image","border-left-color","border-left-style","border-left-width","border-left","border-radius","border-right-color","border-right-style","border-right-width","border-right","border-spacing","border-style","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-top","border-width","border","bottom","box-align","box-decoration-break","box-direction","box-flex-group","box-flex","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color-profile","color","column-count","column-fill","column-gap","column-rule-color","column-rule-style","column-rule-width","column-rule","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue-after","cue-before","cue","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit-position","fit","flex-align","flex-flow","flex-inline-pack","flex-order","flex-pack","float-offset","float","font-family","font-size-adjust","font-size","font-stretch","font-style","font-variant","font-weight","font","grid-columns","grid-rows","hanging-punctuation","height","hyphenate-after","hyphenate-before","hyphenate-character","hyphenate-lines","hyphenate-resource","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","left","letter-spacing","line-height","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","line-stacking","list-style-image","list-style-position","list-style-type","list-style","margin-bottom","margin-left","margin-right","margin-top","margin","mark-after","mark-before","mark","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","orphans","outline-color","outline-offset","outline-style","outline-width","outline","overflow-style","overflow-x","overflow-y","overflow","padding-bottom","padding-left","padding-right","padding-top","padding","page-break-after","page-break-before","page-break-inside","page-policy","page","pause-after","pause-before","pause","perspective-origin","perspective","phonemes","pitch-range","pitch","play-during","position","presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest-after","rest-before","rest","richness","right","rotation-point","rotation","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak-header","speak-numeral","speak-punctuation","speak","speech-rate","stress","string-set","table-layout","target-name","target-new","target-position","target","text-align-last","text-align","text-decoration","text-emphasis","text-height","text-indent","text-justify","text-outline","text-shadow","text-transform","text-wrap","top","transform-origin","transform-style","transform","transition-delay","transition-duration","transition-property","transition-timing-function","transition","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch-range","voice-pitch","voice-rate","voice-stress","voice-volume","volume","white-space-collapse","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"],i=["AliceBlue","AntiqueWhite","Aquamarine","Aqua","Azure","Beige","Bisque","Black","BlanchedAlmond","BlueViolet","Blue","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","GreenYellow","Green","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","LavenderBlush","Lavender","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","LimeGreen","Lime","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","OliveDrab","Olive","OrangeRed","Orange","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","WhiteSmoke","White","YellowGreen","Yellow"],n=["charset","document","font-face","import","keyframes","media","namespace","page","supports"],o=[];return o.push.apply(o,e.grammars),o.push({id:"orion.css",contentTypes:["text/css"],patterns:[{include:"#string_single_multiline"},{include:"#string_double_multiline"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{include:"#numeric_value"},{include:"#color"},{include:"#keyword"},{include:"#directive"}],repository:{color:{match:"(?i)\\b(?:"+i.join("|")+")\\b",name:"constant.other.color.css"},directive:{match:"(^|\\s)(@("+n.join("|")+"))\\b",captures:{2:{name:"keyword.other.directive.css"}}},keyword:{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+t.join("|")+")\\b",name:"support.type.propertyName.css"},number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"},numeric_value:{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},string_double_multiline:{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},string_single_multiline:{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"}}}),{id:o[o.length-1].id,grammars:o,keywords:t}}),define("orion/editor/stylers/application_xml/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=[];return t.push.apply(t,e.grammars),t.push({id:"orion.xml",contentTypes:["application/xml","application/xhtml+xml"],patterns:[{include:"#comment"},{include:"#doctype"},{include:"#xmlDeclaration"},{include:"#tag"},{include:"#ampersandEscape"}],repository:{ampersandEscape:{match:"<|>|&",name:"constant.character"},comment:{begin:{match:"",literal:"-->"},name:"comment.block.xml",patterns:[{match:"(\\b)(TODO)(\\b)(((?!-->).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}]},doctype:{begin:"",name:"meta.tag.doctype.xml",captures:{0:{name:"meta.tag.doctype.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},tag:{begin:"",captures:{0:{name:"meta.tag.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},xmlDeclaration:{begin:"<\\?xml",end:"\\?>",captures:{0:{name:"meta.tag.declaration.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}],name:"meta.tag.declaration.xml"}}}),{id:t[t.length-1].id,grammars:t,keywords:[]}}),define("orion/editor/stylers/text_html/syntax",["orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_css/syntax","orion/editor/stylers/application_xml/syntax"],function(e,t,i){var n=["accept-charset","accept","accesskey","action","align","alt","async","autocomplete","autoplay","autosave","bgcolor","border","buffered","challenge","charset","checked","cite","class","codebase","code","color","colspan","cols","contenteditable","content","contextmenu","controls","coords","data-[A-Za-z_:][\\w.:-]*","data","datetime","default","defer","dirname","dir","disabled","download","draggable","dropzone","enctype","formaction","form","for","headers","height","hidden","high","hreflang","href","http-equiv","icon","id","ismap","itemprop","keytype","kind","label","language","lang","list","loop","low","manifest","maxlength","max","media","method","min","multiple","name","novalidate","open","optimum","pattern","ping","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","reversed","rowspan","rows","sandbox","scoped","scope","seamless","selected","shape","sizes","size","span","spellcheck","srcdoc","srclang","srcset","src","start","step","style","summary","tabindex","target","title","type","usemap","value","width","wrap"],o=["activedescendant","atomic","autocomplete","busy","checked","controls","describedby","disabled","dropeffect","expanded","flowto","grabbed","haspopup","hidden","invalid","labelledby","label","level","live","multiline","multiselectable","orientation","owns","posinset","pressed","readonly","relevant","required","selected","setsize","sort","valuemax","valuemin","valuenow","valuetext"],r=[];return r.push.apply(r,e.grammars),r.push.apply(r,t.grammars),r.push.apply(r,i.grammars),r.push({id:"orion.html",contentTypes:["text/html"],patterns:[{begin:"(?i)(]*)(>)",end:"(?i)()",captures:{1:{name:"meta.tag.html"},3:{name:"meta.tag.html"}},contentName:"source.css.embedded.html",patterns:[{include:"orion.css"}]},{begin:"(?i)|",end:"(?i)",captures:{0:{name:"meta.tag.html"}},contentName:"source.js.embedded.html",patterns:[{include:"orion.js"}]},{begin:"",captures:{0:{name:"meta.tag.html"}},patterns:[{include:"orion.xml#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"#attribute"}]},{include:"orion.xml#comment"},{include:"orion.xml#doctype"},{include:"orion.xml#ampersandEscape"}],repository:{attribute:{match:"\\b(?:"+n.join("|")+"|role|aria-("+o.join("|")+"))\\b",name:"meta.tag.attribute.html"}}}),{id:r[r.length-1].id,grammars:r,keywords:[],attributes:n}}),define("orion/editor/stylers/application_x-jsp/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_html/syntax"],function(e,t,i){var n=["autoFlush","buffer","contentType","errorPage","extends","import","info","isErrorPage","isThreadSafe","language","pageEncoding","session"],o=[];return o.push.apply(o,e.grammars),o.push.apply(o,t.grammars),o.push.apply(o,i.grammars),o.push({id:"orion.jsp",contentTypes:["application/x-jsp"],patterns:[{include:"orion.html"},{include:"#jspComment"},{include:"#jspJavaFragment"},{include:"#jspDirectiveInclude"},{include:"#jspDirectivePage"},{include:"#jspDirectiveTaglib"}],repository:{jspComment:{begin:{match:"<%--",literal:"<%--"},end:{match:"--%>",literal:"<%--"},name:"comment.block.jsp",patterns:[{match:"(\\b)(TODO)(\\b)(((?!--%>).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}]},jspDirectiveInclude:{begin:"<%@\\s+include(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.directive.include.jsp"}},patterns:[{match:"\\bfile\\b",name:"entity.other.attribute-name.jsp"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},jspDirectivePage:{begin:"<%@\\s+page(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.directive.page.jsp"}},patterns:[{match:"\\b(?:"+n.join("|")+")\\b",name:"entity.other.attribute-name.jsp"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},jspDirectiveTaglib:{begin:"<%@\\s+taglib(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.directive.taglib.jsp"}},patterns:[{match:"\\b(?:uri|prefix)\\b",name:"entity.other.attribute-name.jsp"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},jspJavaFragment:{begin:"<%(?:=|!)?(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.declaration.java"}},contentName:"source.java.embedded.jsp",patterns:[{include:"orion.java"}]}}}),{id:o[o.length-1].id,grammars:o,keywords:[]}}),define("orion/editor/stylers/application_xquery/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["zero-digit","xquery","window","where","when","version","variable","validate","unordered","union","typeswitch","type","tumbling","try","treat","to","then","text","switch","strip","strict","start","stable","some","sliding","self","schema-element","schema-attribute","schema","satisfies","return","processing-instruction","previous","preserve","preceding-sibling","preceding","percent","per-mille","pattern-separator","parent","ordering","order","or","option","only","of","node","no-preserve","no-inherit","next","ne","NaN","namespace-node","namespace","module","mod","minus-sign","lt","let","least","le","lax","item","is","intersect","instance","inherit","infinity","in","import","if","idiv","gt","grouping-separator","group","greatest","ge","function","for","following-sibling","following","external","except","every","eq","end","encoding","empty-sequence","empty","else","element","document-node","div","digit","descending","descendant-or-self","descendant","default","declare","decimal-separator","decimal-format","count","copy-namespaces","context","construction","comment","collation","child","catch","castable","cast","case","by","boundary-space","base-uri","attribute","at","ascending","as","and","ancestor-or-self","ancestor","allowing"],i=[];return i.push.apply(i,e.grammars),i.push({id:"orion.xquery",contentTypes:["application/xquery"],patterns:[{include:"#comment"},{include:"#variable"},{include:"#multiLineDoubleQuote"},{include:"#multiLineSingleQuote"},{include:"orion.xml#tag"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.js"}],repository:{comment:{begin:{match:"\\(:",literal:"(:"},end:{match:":\\)",literal:":)"},name:"comment.block.xquery",patterns:[{match:"(\\b)(TODO)(\\b)(((?!:\\)).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},variable:{match:"\\$[a-zA-z0-9_]+",name:"variable.other.xquery"},multiLineDoubleQuote:{begin:'"',end:'"',name:"string.quoted.double"},multiLineSingleQuote:{begin:"'",end:"'",name:"string.quoted.single"}}}),{id:i[i.length-1].id,grammars:i,keywords:t}}),define("orion/editor/stylers/application_sql/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["ADD","ALTER\\s+TABLE","AND","ASC","BETWEEN","COMMIT","CREATE\\s+(TABLE|DATABASE)","CREATE\\s+(UNIQUE\\s+)?INDEX","DELETE\\s+FROM","DESC","DROP(\\s+(INDEX|TABLE|DATABASE))?","FROM","GROUP\\s+BY","HAVING","INSERT\\s+INTO","IN","LIKE","MODIFY","ON","ORDER\\s+BY","OR","PRIMARY\\s+KEY","ROLLBACK","SELECT(\\s+(COUNT|DISTINCT|SUM))?","SET","TO","TRUNCATE\\s+TABLE","UPDATE","USE","VALUES","WHERE"],i=[];return i.push.apply(i,e.grammars),i.push({id:"orion.sql",contentTypes:["application/sql"],patterns:[{include:"orion.lib#string_singleQuote"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#number_decimal"},{match:"(?i)\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.sql"},{match:"<>|>=?|<=?|=",name:"punctuation.operator.sql"}]}),{id:i[i.length-1].id,grammars:i,keywords:t}}),define("orion/editor/stylers/text_x-scss/syntax",["orion/editor/stylers/text_css/syntax","orion/editor/stylers/lib/syntax"],function(e,t){var i=["default","global","optional"],n=["false","null","true"],o=["at-root","content","debug","each","else","error","extend","for","function","if","include","mixin","return","warn","while"],r=[];return r.push.apply(r,e.grammars),r.push.apply(r,t.grammars),r.push({id:"orion.scss",contentTypes:["text/x-scss"],patterns:[{include:"orion.css#string_single_multiline"},{include:"orion.css#string_double_multiline"},{include:"orion.c-like#comment_block"},{include:"#eachin"},{include:"#forto"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"#variable"},{include:"#placeholder"},{include:"#flag"},{include:"#directive"},{include:"orion.css#directive"},{include:"#constant"},{include:"#interpolated"},{include:"#operator"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.css#number_hex"},{include:"orion.css#numeric_value"},{include:"orion.css#color"},{include:"orion.css#keyword"}],repository:{constant:{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.scss"},directive:{match:"(^|\\s)(@("+o.join("|")+"))\\b",captures:{2:{name:"keyword.other.directive.scss"}}},eachin:{begin:"@each\\s",end:"\\sin\\b",captures:{0:{name:"keyword.other.directive.scss"}},patterns:[{include:"#variable"}]},flag:{match:"(^|\\s)(!("+i.join("|")+"))\\b",captures:{2:{name:"keyword.other.flag.scss"}}},forto:{begin:"@for\\s",end:"(^|\\s)(t(o|hrough))(\\s|$)",beginCaptures:{0:{name:"keyword.other.directive.scss"}},endCaptures:{2:{name:"keyword.other.directive.scss"}},patterns:[{include:"#variable"},{include:"orion.lib#number_decimal"},{match:"(^|\\s)(from)(\\s|$)",name:"keyword.other.directive.scss"}]},interpolated:{match:"#\\{[^}]*\\}",name:"string.interpolated.scss"},operator:{match:"\\+|\\*|\\/|%|==?|!=|&|<=?|=?>|!",name:"punctuation.operator.scss"},placeholder:{match:"%[\\w-]+",name:"variable.other.placeholder.sas"},variable:{match:"\\$[\\w-]+(\\.{3})?",name:"variable.other.scss"}}}),{id:r[r.length-1].id,grammars:r,keywords:o.concat(i)}}),define("orion/editor/stylers/text_x-less/syntax",["orion/editor/stylers/text_css/syntax","orion/editor/stylers/lib/syntax"],function(e,t){var i=["important"],n=["true"],o=["arguments"],r=["all","and","not","when"],s=["css","inline","less","multiple","once","optional","reference"],a=[];return a.push.apply(a,e.grammars),a.push.apply(a,t.grammars),a.push({id:"orion.less",contentTypes:["text/x-less"],patterns:[{include:"orion.css#string_single_multiline"},{include:"orion.css#string_double_multiline"},{include:"orion.c-like#comment_block"},{include:"#string_doubleQuote"},{include:"#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"#importDirective"},{include:"orion.css#directive"},{include:"#directive"},{include:"#variable"},{include:"#interpolated"},{include:"#constant"},{include:"#flag"},{include:"#operator"},{include:"#keyword"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.css#number_hex"},{include:"orion.css#numeric_value"},{include:"orion.css#color"},{include:"orion.css#keyword"}],repository:{constant:{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.less"},directive:{match:"(^|\\s)(@("+o.join("|")+"))\\b",captures:{2:{name:"keyword.other.directive.less"}}},flag:{match:"(^|\\s)(!("+i.join("|")+"))\\b",captures:{2:{name:"keyword.other.flag.less"}}},importDirective:{begin:"(@import)\\s*\\(",end:"\\)",beginCaptures:{1:{name:"keyword.other.directive.less"}},patterns:[{match:"\\b(?:"+s.join("|")+")\\b",name:"keyword.operator.less"}]},interpolated:{match:"@\\{[^}]*\\}",name:"string.interpolated.less"},keyword:{match:"\\b(?:"+r.join("|")+")\\b",name:"keyword.operator.less"},operator:{match:"\\+_?|\\*|\\/|=|>=?|<=?|&",name:"punctuation.operator.less"},string_doubleQuote:{match:'~?"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"~?'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},variable:{match:"@[\\w-]+(\\.{3})?",name:"variable.other.less"}}}),{id:a[a.length-1].id,grammars:a,keywords:o.concat(i).concat(s).concat(r)}}),define("orion/editor/stylers/text_jsx/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_xml/syntax"],function(e,t,i){var n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push.apply(n,i.grammars),n.push({id:"orion.jsx",contentTypes:["text/jsx"],patterns:[{begin:"",captures:{0:{name:"meta.tag.jsx"}},patterns:[{include:"#jsExpression"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.c-like#comment_block"}]},{include:"orion.xml#ampersandEscape"},{include:"orion.js"}],repository:{jsExpression:{begin:"\\{",end:"\\}",contentName:"source.js.embedded.jsx",patterns:[{include:"orion.js"}]}}}),{id:n[n.length-1].id,grammars:n,keywords:[]}}),define("orion/editor/stylers/application_json/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["false","true"],i=[];return i.push.apply(i,e.grammars),i.push({id:"orion.json",contentTypes:["application/json"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.json"}]}),{id:i[i.length-1].id,grammars:i,keywords:t}}),define("orion/editor/stylers/text_x-csrc/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["auto","break","case","char","const","continue","default","double","do","else","enum","extern","float","for","goto","if","inline","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","_Bool","_Complex","_Imaginary"],i=["define","elif","else","endif","error","ifdef","ifndef","if","include","line","pragma","undef"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.c",contentTypes:["text/x-csrc","text/x-c"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#directive"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.c"}],repository:{directive:{match:"#\\s*(?:"+i.join("|")+")\\b[^$]*",name:"meta.preprocessor.c"}}}),{id:n[n.length-1].id,grammars:n,keywords:t.concat(i)}}),define("orion/editor/stylers/text_x-csharp/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["abstract","as","base","bool","break","byte","by","case","catch","char","checked","class","const","continue","decimal","default","delegate","descending","double","do","else","enum","event","explicit","extern","false","finally","fixed","float","foreach","for","from","goto","group","if","implicit","int","interface","internal","into","in","is","lock","long","namespace","new","null","object","operator","orderby","out","override","params","private","protected","public","readonly","ref","return","sbyte","sealed","select","short","sizeof","stackalloc","static","string","struct","switch","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","while","where","yield"],i=["define","elif","else","endif","endregion","error","if","line","pragma checksum","pragma warning","pragma","region","undef","warning"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.csharp",contentTypes:["text/x-csharp"],patterns:[{match:"^\\s*#(?:"+i.join("|")+")\\b[^$]*",name:"meta.preprocessor.csharp"},{include:"#string_verbatim"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"#doc_line"},{include:"orion.c-like#comment_singleLine"},{include:"#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.csharp"}],repository:{doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation.csharp",patterns:[{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},doc_line:{match:"// /.*",name:"comment.line.documentation.csharp",patterns:[{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{include:"orion.lib#todo_comment_singleLine"}]},string_verbatim:{begin:'@"',end:'^(?:""|[^"])*"(?!")',name:"string.quoted.verbatim.csharp"}}}),{id:n[n.length-1].id,grammars:n,keywords:t}}),define("orion/editor/stylers/text_x-cshtml/syntax",["orion/editor/stylers/application_xml/syntax","orion/editor/stylers/text_html/syntax","orion/editor/stylers/text_x-csharp/syntax"],function(e,t,i){var n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push.apply(n,i.grammars),n.push({id:"orion.cshtml",contentTypes:["text/x-cshtml"],patterns:[{include:"#comment"},{include:"#codeBlock"},{include:"#expression"},{include:"#reference"},{include:"orion.html"}],repository:{comment:{begin:{match:"@\\*",literal:"@*"},end:{match:"\\*@",literal:"*@"},name:"comment.block.cshtml"},codeBlock:{begin:"(^\\s*)(@)(?=([^{]*){)",end:"}",captures:{2:{name:"entity.name.declaration.csharp"}},contentName:"source.csharp.embedded.cshtml",patterns:[{include:"orion.xml#tag"},{include:"#reference"},{include:"orion.csharp"}]},expression:{match:"^\\s*@[^{]*$",name:"source.csharp.embedded.cshtml",patterns:[{include:"#reference"},{include:"orion.csharp"}]},reference:{match:"@",name:"entity.name.declaration.csharp"}}}),{id:n[n.length-1].id,grammars:n,keywords:[]}}),define("orion/editor/stylers/text_x-c__src/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["alignas","alignof","asm","and_eq","and","auto","bitand","bitor","bool","break","case","catch","char16_t","char32_t","char","class","compl","constexpr","const_cast","const","continue","decltype","default","delete","double","do","dynamic_cast","else","enum","explicit","export","extern","false","float","for","friend","goto","if","inline","int","long","mutable","namespace","new","noexcept","not_eq","not","nullptr","operator","or_eq","or","private","protected","public","register","reinterpret_cast","return","short","signed","sizeof","static_assert","static_cast","static","struct","switch","template","this","thread_local","throw","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","while","xor_eq","xor","_Bool","_Complex","_Imaginary"],i=["define","elif","else","endif","error","ifdef","ifndef","if","include","line","pragma","undef"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.cpp",contentTypes:["text/x-c++src","text/x-c++"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#directive"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.cpp"}],repository:{directive:{match:"#\\s*(?:"+i.join("|")+")\\b[^$]*",name:"meta.preprocessor.cpp"}}}),{id:n[n.length-1].id,grammars:n,keywords:t}}),define("orion/editor/stylers/text_x-dockerfile/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["add","cmd","copy","entrypoint","env","expose","from","maintainer","onbuild","run","user","volume","workdir"],i="orion.dockerfile",n=[];return n.push.apply(n,e.grammars),n.push({id:i,contentTypes:["text/x-dockerfile"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"#numberSignComment"},{match:"\\b-?[0-9]+(\\.[0-9]+)?\\b",name:"constant.numeric.dockerfile"},{match:"(?i)^\\s*(?:"+t.join("|")+")\\b",name:"keyword.operator.dockerfile"}],repository:{numberSignComment:{begin:{match:"^\\s*#",literal:"#"},end:{match:"$",literal:""},name:"comment.line.number-sign.dockerfile",patterns:[{include:"orion.lib#todo_comment_singleLine"}]}}}),{id:i,grammars:n,keywords:t}}),define("orion/editor/stylers/text_x-erlang/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["xor","when","try","rem","receive","query","orelse","or","of","not","let","if","fun","end","div","cond","catch","case","bxor","bsr","bsl","bor","bnot","begin","band","andalso","and","after"],i=["vsn","undef","type","spec","record","on_load","opaque","module","include_lib","include","import","ifndef","ifdef","file","export_type","export","endif","else","define","callback","compile","behaviour"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.erlang",contentTypes:["text/x-erlang"],patterns:[{include:"#comment"},{include:"#stringSingleLine"},{include:"#stringMultiLine"},{include:"#method"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.erlang"},{match:"^\\s*-(?:"+i.join("|")+")\\b",name:"keyword.operator.erlang"}],repository:{comment:{match:{match:"%.*",literal:"%"},name:"comment.line.erlang",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},method:{match:"(^|\\s)[a-zA-Z0-9_.]+(?=\\(|\\s\\()",name:"entity.name.function.erlang"},stringMultiLine:{begin:'"(?:\\\\.|[^\\\\"])*$',end:'^(?:\\\\.|[^\\\\"])*"',name:"string.quoted.double.erlang"},stringSingleLine:{match:'"(?:\\\\.|[^\\\\"])*"',name:"string.quoted.double.erlang"}}}),{id:n[n.length-1].id,grammars:n,keywords:t} -}),define("orion/editor/stylers/text_x-ruby/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["alias_method","alias","attr_accessor","attr_reader","attr_writer","attr","BEGIN","class","defined?","def","END","extend","gem","include","initialize","in","load","lambda","module_function","module","new","not","public","prepend","private","protected","require_relative","require","undef","__ENCODING__","__END__","__FILE__","__LINE__"],i=["and","begin","break","case","catch","do","else","elsif","end","ensure","fail","for","if","loop","next","or","raise","redo","rescue","retry","return","then","throw","unless","until","when","while","yield"],n=["false","nil","true"],o=["self","super"],r=[];return r.push.apply(r,e.grammars),r.push({id:"orion.ruby",contentTypes:["text/x-ruby"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"#symbol_quoted_single"},{include:"#symbol_quoted_double"},{include:"#symbol"},{include:"#classRef"},{match:"/(?![\\s])(?:\\\\.|[^/])+/(?:[ioxmuesn]\\b)?",name:"string.regexp.ruby"},{match:{match:"#.*",literal:"#"},name:"comment.line.number-sign.ruby",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},{begin:{match:"^=begin\\b",literal:"\n=begin "},end:{match:"^=end\\b",literal:"\n=end "},name:"comment.block.ruby",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{include:"#variable"},{match:"\\b0[bB][01]+\\b",name:"constant.numeric.binary.ruby"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.ruby"},{match:"\\b(?:"+i.join("|")+")\\b",name:"keyword.control.ruby"},{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.ruby"},{match:"\\b(?:"+o.join("|")+")\\b",name:"variable.language.ruby"}],repository:{classRef:{match:"\\w+::\\w+"},symbol:{match:":\\w+",name:"entity.name.symbol.ruby"},symbol_quoted_single:{match:":'[^']*'",name:"entity.name.symbol.quoted.single.ruby"},symbol_quoted_double:{match:':"[^"]*"',name:"entity.name.symbol.quoted.double.ruby"},variable:{match:"@\\w+",name:"entity.name.variable.ruby"}}}),{id:r[r.length-1].id,grammars:r,keywords:t.concat(i).concat(n).concat(o)}}),define("orion/editor/stylers/text_x-haml/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/text_x-ruby/syntax"],function(e,t){var i=[];return i.push.apply(i,e.grammars),i.push.apply(i,t.grammars),i.push({id:"orion.haml",contentTypes:["text/x-haml"],patterns:[{include:"#inlineRuby"},{include:"#interpolatedRuby"},{include:"#tagWithRubySymbols"},{include:"#tagWithHTMLAttributes"},{include:"#doctype"},{include:"#tag"},{include:"#htmlComment"}],repository:{doctype:{match:"^!!!.*$",name:"meta.tag.doctype.haml"},htmlComment:{match:{match:"/[^[].*$",literal:"/"},name:"comment.line.html.haml"},inlineRuby:{begin:"(?:^|[^\\\\])(?:=|-|~|&==?|!==?)",end:"(?:^|[^,])$",contentName:"source.ruby.embedded.haml",patterns:[{include:"orion.ruby"}]},interpolatedRuby:{begin:"#{",end:"}",contentName:"source.ruby.embedded.haml",patterns:[{include:"orion.ruby"}]},tag:{match:"^\\s*%[^\\b]+?\\b",name:"meta.tag.haml"},tagWithHTMLAttributes:{begin:"(^\\s*)(%[^\\s(]+?)\\(",end:"\\)\\s*$",beginCaptures:{2:{name:"meta.tag.haml"}},patterns:[{match:"[^\\s=]+(?==)",name:"entity.name.attribute.html.haml"},{include:"orion.ruby#variable"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},tagWithRubySymbols:{begin:"(^\\s*)(%[^\\b]+?)\\b{",end:"}\\s*$",beginCaptures:{2:{name:"meta.tag.haml"}},patterns:[{include:"orion.ruby#symbol"},{include:"orion.ruby#variable"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]}}}),{id:i[i.length-1].id,grammars:i,keywords:[]}}),define("orion/editor/stylers/text_x-jade/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/application_javascript/syntax"],function(e,t){var i=["&attributes","block","case","default","doctype","each","else","extends","for","if","include","mixin","unless","when","while"],n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push({id:"orion.jade",contentTypes:["text/x-jade"],patterns:[{include:"#comment_singleLine"},{include:"#code"},{include:"#control"},{include:"#caseBranch"},{include:"#mixinWithParameters"},{include:"#mixinRefWithArguments"},{include:"#tagWithAttributes"},{include:"#interpolatedJS"},{include:"#interpolatedTag"},{include:"#mixin"},{include:"#mixinRef"},{include:"#doctype"},{include:"#filter"},{include:"#case"},{include:"#andAttributes"},{include:"#otherKeywords"},{include:"#tag"}],repository:{andAttributes:{match:"&attributes\\b",name:"keyword.operator.jade"},"case":{match:"(^\\s*)(case)\\b",captures:{2:{name:"keyword.control.jade"}}},caseBranch:{begin:"(^\\s*)(when|default)\\s*",end:":|$",contentName:"source.js.embedded.jade",patterns:[{include:"orion.js"}],beginCaptures:{2:{name:"keyword.control.jade"}}},code:{match:"(^\\s*- |= |!= ).*$",name:"source.js.embedded.jade",patterns:[{include:"orion.js"}]},comment_singleLine:{match:{match:"^\\s*//.*",literal:"//"},name:"comment.line.double-slash.jade",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},control:{begin:"(^\\s*)(if|else( if)?|each|for|unless|while)\\b",end:"$",beginCaptures:{2:{name:"keyword.control.jade"}},contentName:"source.js.embedded.jade",patterns:[{include:"orion.js"}]},doctype:{match:"(^\\s*)(doctype.+$)",captures:{2:{name:"meta.tag.doctype.jade"}}},filter:{match:"(^\\s*)(:\\w+)",captures:{2:{name:"entity.other.filter.jade"}}},interpolatedJS:{begin:"(#{)",end:"(})",captures:{1:{name:"string.interpolated.js.jade"}},contentName:"source.js.embedded.jade",patterns:[{include:"orion.js"}]},interpolatedTag:{begin:"(#\\[)",end:"(\\])",captures:{1:{name:"string.interpolated.tag.jade"}},patterns:[{begin:"(\\.|\\w+)\\s*\\(",end:"(\\))(/)?",beginCaptures:{1:{name:"meta.tag.jade"}},endCaptures:{2:{name:"meta.tag.jade"}},contentName:"source.js.embedded.jade",patterns:[{include:"orion.js"}]}]},mixin:{match:"(^\\s*)(mixin)(\\s+)(\\w+)",captures:{2:{name:"keyword.operator.jade"},4:{name:"entity.name.mixin.jade"}}},mixinRef:{match:"(^\\s*)(\\+\\w+)",captures:{2:{name:"entity.name.mixin.jade"}}},mixinRefWithArguments:{begin:"(^\\s*)(\\+\\w+)\\s*\\(",end:"\\)|$",captures:{2:{name:"entity.name.mixin.jade"}},patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#number_decimal"}]},mixinWithParameters:{begin:"(^\\s*)(mixin)(\\s+)(\\w+)\\s*\\(",end:"\\)|$",beginCaptures:{2:{name:"keyword.operator.jade"},4:{name:"entity.name.mixin.jade"}},patterns:[{match:"[^\\s,]+",name:"variable.parameter.jade"}]},otherKeywords:{match:"(^\\s*)(block|extends|include)\\b",captures:{2:{name:"keyword.operator.jade"}}},tag:{match:"(^\\s*)(\\w+|(?=\\.)|(?=#))(#\\w*|\\.\\w*)*(/?)",captures:{2:{name:"meta.tag.jade"},4:{name:"meta.tag.jade"}}},tagWithAttributes:{begin:"(^\\s*)(\\w+|(?=\\.)|(?=#))(#\\w*|\\.\\w*)*\\s*\\(",end:"(\\))(/)?",beginCaptures:{2:{name:"meta.tag.jade"}},endCaptures:{2:{name:"meta.tag.jade"}},contentName:"source.js.embedded.jade",patterns:[{include:"orion.js"}]}}}),{id:n[n.length-1].id,grammars:n,keywords:i}}),define("orion/editor/stylers/text_x-lua/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["and","break","do","else","elseif","end","false","for","function","if","in","local","nil","not","or","repeat","return","then","true","until","while"],i=["assert","arg","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall"],n=["_G","LUA_INIT","LUA_PATH","LUA_CPATH","_VERSION"],o=[];return o.push.apply(o,e.grammars),o.push({id:"orion.lua",contentTypes:["text/x-luasrc","text/x-lua"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"#comment_block_dash_dash"},{include:"#comment_singleLine_dash_dash"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{include:"#base_functions"},{include:"#base_variables"},{include:"#reserved_underscore_capital"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.lua"}],repository:{comment_block_dash_dash:{begin:{match:"--\\[\\[",literal:"--[["},end:{match:"\\]\\]",literal:"]]"},name:"comment.block.dash-dash.lua",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\]\\]).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},comment_singleLine_dash_dash:{begin:{match:"--",literal:"--"},end:{match:"$",literal:""},name:"comment.line.dash-dash.lua",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},base_functions:{match:"\\b(?:"+i.join("|")+")\\b",name:"support.function.lua"},base_variables:{match:"\\b(?:"+n.join("|")+")\\b",name:"support.variable.lua"},reserved_underscore_capital:{match:"\\b_[A-Z]*\\b",name:"constant.other.userdefined.lua"}}}),{id:o[o.length-1].id,grammars:o,keywords:t}}),define("orion/editor/stylers/text_x-php/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["abstract","and","array","as","callable","class","clone","const","declare","echo","empty","eval","extends","final","function","global","implements","include","include_once","insteadof","interface","instanceof","isset","list","namespace","new","or","parent","print","private","protected","public","require","require_once","static","trait","unset","use","var","xor","__halt_compiler","__CLASS__","__DIR__","__FILE__","__FUNCTION__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__"],i=["break","case","catch","continue","default","die","do","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","exit","finally","for","foreach","goto","if","return","switch","throw","try","while","yield"],n=["false","FALSE","null","NULL","true","TRUE"],o=["self"],r=[];return r.push.apply(r,e.grammars),r.push({id:"orion.php-core",patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{match:{match:"#.*",literal:"#"},name:"comment.line.number-sign.php",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},{begin:"<<<(\\w+)$",end:"^\\1;$",name:"string.unquoted.heredoc.php"},{begin:"<<<'(\\w+)'$",end:"^\\1;$",name:"string.unquoted.heredoc.nowdoc.php"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{match:"\\b0[bB][01]+\\b",name:"constant.numeric.binary.php"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.php"},{match:"\\b(?:"+i.join("|")+")\\b",name:"keyword.control.php"},{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.php"},{match:"\\b(?:"+o.join("|")+")\\b",name:"variable.language.php"}]}),r.push({id:"orion.php",contentTypes:["text/x-php"],patterns:[{begin:"(?i)<(\\?|%(?!php))(?:=|php)?(?:\\s|$)",end:"[\\1]>",captures:{0:{name:"entity.name.declaration.php"}},contentName:"source.php.embedded",patterns:[{include:"orion.php-core"}]},{include:"orion.html"}]}),{id:r[r.length-1].id,grammars:r,keywords:t.concat(i).concat(n).concat(o)}}),define("orion/editor/stylers/text_x-python/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["and","as","assert","break","class","continue","def","del","exec","elif","else","except","Ellipsis","False","finally","for","from","global","if","import","in","is","lambda","not","None","NotImplemented","or","pass","print","raise","return","try","True","while","with","yield"],i=[];return i.push.apply(i,e.grammars),i.push({id:"orion.python",contentTypes:["text/x-python"],patterns:[{begin:"(['\"])\\1\\1",end:"\\1\\1\\1",name:"string.quoted.triple.python"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{begin:{match:"#",literal:"#"},end:{match:"$",literal:""},name:"comment.line.number-sign.python",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.python"}],repository:{number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)[lL]?\\b",name:"constant.numeric.number.python"}}}),{id:i[i.length-1].id,grammars:i,keywords:t}}),define("orion/editor/stylers/text_x-go/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["break","case","const","continue","default","defer","else","fallthrough","false","for","func","goto","go","if","import","nil","package","range","return","select","switch","true","type","var"],i=[];return i.push.apply(i,e.grammars),i.push({id:"orion.go",contentTypes:["text/x-go"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{begin:"`",end:"`",name:"string.quoted.raw.go"},{include:"orion.c-like#comment_singleLine"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.go"},{match:"\\b(?:len|cap|new|make|append|close|copy|delete|complex|real|imag|panic|recover)\\b",name:"support.function.go"},{match:"\\b(?:bool|chan|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|float64|complex64|complex128|byte|map|rune|uint|interface|int|uintptr|string|struct|error)\\b",name:"support.function.type"}]}),{id:i[i.length-1].id,grammars:i,keywords:t}}),define("orion/editor/stylers/text_x-objective-c/syntax",["orion/editor/stylers/text_x-csrc/syntax"],function(e){var t=["atomic","BOOL","bycopy","byref","Class","id","IMP","inout","in","nil","nonatomic","NO","NULL","oneway","out","Protocol","retain","SEL","self","super","YES"],i=["@catch","@class","@dynamic","@end","@finally","@implementation","@interface","@private","@property","@protected","@protocol","@public","@selector","@synthesize","@throw","@try"],n=["import"],o=[];return o.push.apply(o,e.grammars),o.push({id:"orion.objectiveC",contentTypes:["text/x-objective-c"],patterns:[{include:"#objectiveCString"},{include:"orion.c"},{include:"#objectiveCDirective"},{include:"#objectiveCKeyword"}],repository:{objectiveCDirective:{match:"#\\s*(?:"+n.join("|")+")\\b[^$]*",name:"meta.preprocessor.objective-c"},objectiveCKeyword:{match:"(\\b(?:"+t.join("|")+")|(?:"+i.join("|")+"))\\b",name:"keyword.operator.objective-c"},objectiveCString:{match:'@"(?:\\\\.|[^"])*"?',name:"string.quoted.double.objective-c"}}}),{id:o[o.length-1].id,grammars:o,keywords:e.keywords.concat(t).concat(n).concat(i)}}),define("orion/editor/stylers/text_x-properties/syntax",[],function(){var e=[];return e.push({id:"orion.properties",contentTypes:["text/x-properties"],patterns:[{match:"^\\s*#[^$]*",name:"comment.line.properties"},{begin:"(^[^=]*)(=)",end:".*[^\\\\]$",beginCaptures:{1:{name:"entity.name.properties"},2:{name:"punctuation.operator.properties"}},endCaptures:{0:{name:"string.unquoted.properties"}},contentName:"string.unquoted.properties"}]}),{id:e[e.length-1].id,grammars:e,keywords:[]}}),define("orion/editor/stylers/text_x-smarty/syntax",["orion/editor/stylers/lib/syntax","orion/editor/stylers/text_html/syntax","orion/editor/stylers/text_x-php/syntax"],function(e,t,i){var n=["false","no","off","on","true","yes"],o="{",r="}",s=[];return s.push.apply(s,e.grammars),s.push.apply(s,t.grammars),s.push.apply(s,i.grammars),s.push({id:"orion.smarty",contentTypes:["text/x-smarty"],patterns:[{include:"orion.html"},{include:"#smartyCommentBlock"},{include:"#literalBlock"},{include:"#phpBlock"},{include:"#smartyBlock"}],repository:{literalBlock:{begin:"({)literal(})",end:"({)/literal(})",captures:{1:"punctuation.brace.begin.smarty",2:"punctuation.brace.end.smarty"}},phpBlock:{begin:"({)php(})",end:"({)/php(})",captures:{1:"punctuation.brace.begin.smarty",2:"punctuation.brace.end.smarty"},contentName:"source.php.embedded.smarty",patterns:[{include:"orion.php-core"}]},smartyBlock:{begin:"("+o+")",end:"("+r+")",captures:{1:"punctuation.brace.begin.smarty",2:"punctuation.brace.end.smarty"},patterns:[{include:"orion.lib#string_singleQuote"},{include:"#smartyString_doubleQuote"},{include:"#smartyVariable"},{include:"#smartyConfigVariable"},{include:"#smartyConstant"},{include:"orion.lib#number_decimal"}]},smartyCommentBlock:{begin:{match:o+"\\*",literal:o+"*"},end:{match:"\\*"+r,literal:"*"+r},name:"comment.block.smarty"},smartyConfigVariable:{match:"#\\w+#",name:"variable.other.config.smarty"},smartyConstant:{match:"\\b(?:"+n.join("|")+")\\b",name:"constant.language.smarty"},smartyEscapedVariable:{match:"`\\$[^`]+`",name:"variable.other.escaped.smarty"},smartyString_doubleQuote:{begin:'"',end:'"',name:"string.quoted.double.smarty",patterns:[{include:"#smartyEscapedVariable"},{include:"#smartyVariable"},{include:"#smartyConfigVariable"}]},smartyVariable:{match:"\\$(?:smarty\\.(?:config|server)\\.)?\\w+",name:"variable.other.smarty"}}}),{id:s[s.length-1].id,grammars:s,keywords:[]}}),define("orion/editor/stylers/text_x-swift/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["associativity","as","class","convenience","deinit","didSet","dynamicType","dynamic","enum","extension","final","func","get","import","infix","init","inout","internal","in","is","lazy","left","let","mutating","none","nonmutating","operator","optional","override","postfix","precedence","prefix","private","protocol","Protocol","public","required","right","Self","set","static","struct","subscript","typealias","Type","unowned","var","weak","willSet","@objc"],i=["break","case","continue","default","do","else","fallthrough","for","if","return","switch","where","while"],n=["false","nil","true"],o=["self","super"],r=["__COLUMN__","__FILE__","__FUNCTION__","__LINE__"],s=[];return s.push.apply(s,e.grammars),s.push({id:"orion.swift",contentTypes:["text/x-swift"],patterns:[{include:"#string_doubleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"#number_binary"},{include:"#number_hex"},{include:"#number_octal"},{include:"#number_decimal"},{include:"#keywords_operator"},{include:"#keywords_control"},{include:"#constants"},{include:"#languageVars1"},{include:"#languageVars2"}],repository:{comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block.swift",patterns:[{include:"#comment_block"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task.swift"},4:{name:"comment.block.swift"}}}]},constants:{match:"(^|[^\\w`])("+n.join("|")+")\\b",captures:{2:{name:"constant.language.swift"}}},keywords_operator:{match:"(^|[^\\w`])("+t.join("|")+")\\b",captures:{2:{name:"keyword.operator.swift"}}},keywords_control:{match:"(^|[^\\w`])("+i.join("|")+")\\b",captures:{2:{name:"keyword.control.swift"}}},languageVars1:{match:"(^|[^\\w`])("+o.join("|")+")\\b",captures:{2:{name:"variable.language.swift"}}},languageVars2:{match:"(^|[^\\w`])("+r.join("|")+")(?:$|[^\\w])",captures:{2:{name:"variable.language.swift"}}},number_binary:{match:"\\b0b[01]+\\b",name:"constant.numeric.binary.swift"},number_decimal:{match:"\\b-?(?:\\.\\d[\\d_]*|\\d[\\d_]*\\.?[\\d_]*)(?:[eE][+-]?\\d[\\d_]*)?\\b",name:"constant.numeric.decimal.swift"},number_hex:{match:"\\b0[xX](?:\\.[0-9A-Fa-f][0-9A-Fa-f_]*|[0-9A-Fa-f][0-9A-Fa-f_]*\\.?[0-9A-Fa-f_]*)(?:[pP][+-]?\\d[\\d_]*)?\\b",name:"constant.numeric.hex.swift"},number_octal:{match:"\\b0o[01234567][01234567_]*\\b",name:"constant.numeric.octal.swift"},segment:{begin:"\\(",end:"\\)",patterns:[{include:"#segment"},{include:"#comment_block"},{include:"#number_binary"},{include:"#number_hex"},{include:"#number_octal"},{include:"#number_decimal"},{include:"#keywords_operator"},{include:"#keywords_control"},{include:"#constants"},{include:"#languageVars1"},{include:"#languageVars2"}]},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double.swift",patterns:[{begin:"\\\\\\(",end:"\\)",name:"string.interpolated.swift",patterns:[{include:"#segment"},{include:"#comment_block"},{include:"#number_binary"},{include:"#number_hex"},{include:"#number_octal"},{include:"#number_decimal"},{include:"#keywords_operator"},{include:"#keywords_control"},{include:"#constants"},{include:"#languageVars1"},{include:"#languageVars2"}]}]}}}),{id:s[s.length-1].id,grammars:s,keywords:t.concat(i).concat(n).concat(o).concat(r)}}),define("orion/editor/stylers/text_x-typescript/syntax",["orion/editor/stylers/application_javascript/syntax"],function(e){var t=["constructor","declare","module"],i=["any","boolean","number","string"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.typescript",contentTypes:["text/x-typescript"],patterns:[{include:"orion.js"},{include:"#keywords"},{include:"#types"}],repository:{keywords:{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.typescript"},types:{match:"\\b(?:"+i.join("|")+")\\b",name:"storage.type.typescript"}}}),{id:n[n.length-1].id,grammars:n,keywords:t.concat(i)}}),define("orion/editor/stylers/text_x-vb/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["AddHandler","AddressOf","Aggregate","Alias","AndAlso","And","Ansi","Assembly","Async","As","Auto","Await","Binary","Boolean","ByRef","Byte","ByVal","Call","Case","Catch","CBool","CByte","CChar","CDate","CDbl","CDec","Char","CInt","Class","CLng","CObj","Compare","Const","CShort","CSng","CStr","CType","Custom","Date","Decimal","Declare","Default","Delegate","Dim","DirectCast","Distinct","Double","Do","Each","ElseIf","Else","EndIf","End","Enum","Equals","Erase","Error","Event","Exit","Explicit","False","Finally","For","Friend","From","Function","GetType","Get","GoSub","GoTo","Group By","Group Join","Handles","If","Implements","Imports","Inherits","Integer","Interface","Into","In","IsFalse","IsTrue","Is","Iterator","Join","Key","Let","Lib","Like","Long","Loop","Me","Mid","Module","Mod","MustInherit","MustOverride","MyBase","MyClass","Namespace","New","Next","Nothing","NotInheritable","NotOverridable","Not","Object","Off","On","Optional","Option","Order By","OrElse","Or","Overloads","Overridable","Overrides","ParamArray","Preserve","Private","Property","Protected","Public","RaiseEvent","ReadOnly","ReDim","REM","RemoveHandler","Resume","Return","Select","Set","Shadows","Shared","Short","Single","Skip While","Skip","Static","Step","Stop","Strict","String","Structure","Sub","SyncLock","Take While","Take","Text","Then","Throw","To","True","Try","TypeOf","Unicode","Until","Variant","Wend","When","Where","While","WithEvents","With","WriteOnly","Xor","Yield"],i=["Const","ElseIf","Else","End","ExternalSource","If","Region"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.vb",contentTypes:["text/x-vb"],patterns:[{match:"^\\s*#(?:"+i.join("|")+")\\b[^$]*",name:"meta.preprocessor.vb"},{include:"orion.lib#string_doubleQuote"},{include:"#doc"},{include:"#comment"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.vb"}],repository:{comment:{begin:{match:"'",literal:"'"},end:{match:"$",literal:""},name:"comment.line.vb",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},doc:{match:{match:"'''.*",literal:"'''"},name:"comment.line.documentation.vb",patterns:[{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{include:"orion.lib#todo_comment_singleLine"}]},number_hex:{match:"&[hH][0-9A-Fa-f]+\\b",name:"constant.numeric.hex.vb"}}}),{id:n[n.length-1].id,grammars:n,keywords:t}}),define("orion/editor/stylers/text_x-vbhtml/syntax",["orion/editor/stylers/application_xml/syntax","orion/editor/stylers/text_html/syntax","orion/editor/stylers/text_x-vb/syntax"],function(e,t,i){var n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push.apply(n,i.grammars),n.push({id:"orion.vbhtml",contentTypes:["text/x-vbhtml"],patterns:[{include:"#vbhtmlComment"},{include:"#codeBlock"},{include:"#expression"},{include:"#reference"},{include:"orion.html"}],repository:{vbhtmlComment:{begin:{match:"@\\*",literal:"@*"},end:{match:"\\*@",literal:"*@"},name:"comment.block.vbhtml"},codeBlock:{begin:"(?i)^\\s*@code",end:"(?i)end code",captures:{0:{name:"entity.name.declaration.vb"}},contentName:"source.vb.embedded.vbhtml",patterns:[{include:"orion.xml#tag"},{include:"#reference"},{include:"orion.vb"}]},expression:{match:"(?i)^\\s*@(?!code)[^$]*",name:"source.vb.embedded.vbhtml",patterns:[{include:"#reference"},{include:"orion.vb"}]},reference:{match:"@",name:"entity.name.declaration.vb"}}}),{id:n[n.length-1].id,grammars:n,keywords:[]}}),define("orion/editor/stylers/application_x-ejs/syntax",["orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_xml/syntax"],function(e,t){var i=[];return i.push.apply(i,e.grammars),i.push.apply(i,t.grammars),i.push({id:"orion.ejs",contentTypes:["application/x-ejs"],patterns:[{include:"orion.xml#comment"},{include:"orion.xml#doctype"},{begin:"<%=?(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.declaration.js"}},contentName:"source.js.embedded.ejs",patterns:[{include:"orion.js"}]},{include:"orion.xml#tag"},{include:"orion.xml#ampersandEscape"}]}),{id:i[i.length-1].id,grammars:i,keywords:[]}}),define("orion/editor/stylers/text_x-yaml/syntax",[],function(){var e=["false","null","true"],t=["!!bool","!!float","!!int","!!map","!!null","!!omap","!!seq","!!str"],i="orion.yaml",n={id:i,contentTypes:["text/x-yaml"],patterns:[{include:"#numberSignComment"},{match:"^%(?:YAML|TAG)\\s.*",name:"meta.directive.yaml"},{begin:"^.*?:(?:[\\t ]|$)",end:"$",contentName:"string.unquoted.yaml",beginCaptures:{0:{name:"entity.name.key.yaml"}},patterns:[{include:"#numberSignComment"},{match:"^\\s*[&*]\\s*$",name:"entity.name.tag.yaml"},{match:"(?i)^\\s*(?:"+e.join("|")+")\\s*$",name:"keyword.operator.yaml"},{match:"(?i)^\\s*(?:"+t.join("|")+")\\b",name:"keyword.operator.yaml"},{match:"(?i)^\\s*(?:-?[0-9]*(?:\\.[0-9]+)?(?:e[-+][1-9][0-9]*)?)\\s*$",name:"constant.numeric.yaml"},{match:"(?i)^\\s*(?:-?[1-9][0-9]*|0|-?\\.inf|\\.nan)\\s*$",name:"constant.numeric.yaml"}]},{match:"---|\\.\\.\\.",name:"meta.separator.yaml"}],repository:{numberSignComment:{begin:{match:"(?:^|\\s)#",literal:"#"},end:{match:"$",literal:""},name:"comment.line.number-sign.yaml",patterns:[{include:"orion.lib#todo_comment_singleLine"}]}}};return{id:i,grammars:[n],keywords:t.concat(e)}}),define("orion/staticDataSource",["orion/Deferred","orion/editor/textStyler","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_vnd.coffeescript/syntax","orion/editor/stylers/application_x-jsp/syntax","orion/editor/stylers/application_xquery/syntax","orion/editor/stylers/application_sql/syntax","orion/editor/stylers/text_css/syntax","orion/editor/stylers/text_x-scss/syntax","orion/editor/stylers/text_x-less/syntax","orion/editor/stylers/text_html/syntax","orion/editor/stylers/text_jsx/syntax","orion/editor/stylers/application_json/syntax","orion/editor/stylers/text_x-csrc/syntax","orion/editor/stylers/text_x-csharp/syntax","orion/editor/stylers/text_x-cshtml/syntax","orion/editor/stylers/text_x-c__src/syntax","orion/editor/stylers/text_x-dockerfile/syntax","orion/editor/stylers/text_x-erlang/syntax","orion/editor/stylers/text_x-haml/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_x-jade/syntax","orion/editor/stylers/text_x-lua/syntax","orion/editor/stylers/text_x-php/syntax","orion/editor/stylers/text_x-python/syntax","orion/editor/stylers/text_x-ruby/syntax","orion/editor/stylers/text_x-go/syntax","orion/editor/stylers/text_x-objective-c/syntax","orion/editor/stylers/text_x-properties/syntax","orion/editor/stylers/text_x-smarty/syntax","orion/editor/stylers/text_x-swift/syntax","orion/editor/stylers/text_x-typescript/syntax","orion/editor/stylers/text_x-vb/syntax","orion/editor/stylers/text_x-vbhtml/syntax","orion/editor/stylers/application_x-ejs/syntax","orion/editor/stylers/application_xml/syntax","orion/editor/stylers/text_x-yaml/syntax"],function(e,t,i,n,o,r,s,a,l,d,c,h,u,p,f,g,_,m,v,y,x,b,w,C,T,L,k,D,A,S,E,O,N,M,I,B,R){function F(){this.styler=null}var P=[{id:"text/plain",name:"Text",extension:["txt"],imageClass:"file-sprite-text modelDecorationSprite"},{id:"application/javascript","extends":"text/plain",name:"JavaScript",extension:["js"],imageClass:"file-sprite-javascript modelDecorationSprite"},{id:"application/vnd.coffeescript","extends":"text/plain",name:"CoffeeScript",extension:["coffee"]},{id:"text/jsx","extends":"text/plain",name:"JSX",extension:["jsx"]},{id:"text/html","extends":"text/plain",name:"HTML",extension:["html","htm"],imageClass:"file-sprite-html modelDecorationSprite"},{id:"text/css","extends":"text/plain",name:"CSS",extension:["css"],imageClass:"file-sprite-css modelDecorationSprite"},{id:"text/x-scss","extends":"text/plain",name:"SCSS",extension:["scss","sass"]},{id:"text/x-less","extends":"text/plain",name:"Less",extension:["less"]},{id:"application/json","extends":"text/plain",name:"JSON",extension:["json"],imageClass:"file-sprite-text modelDecorationSprite"},{id:"application/sql","extends":"text/plain",name:"SQL",extension:["sql"]},{id:"application/xml","extends":"text/plain",name:"XML",extension:["xml"],imageClass:"file-sprite-xml modelDecorationSprite"},{id:"application/x-ejs","extends":"text/plain",name:"Embedded Javascript",extension:["ejs"],imageClass:"file-sprite-javascript modelDecorationSprite"},{id:"text/x-java-source","extends":"text/plain",name:"Java",extension:["java"]},{id:"application/x-jsp","extends":"text/plain",name:"Java Server Page",extension:["jsp"]},{id:"text/x-jade","extends":"text/plain",name:"Jade",extension:["jade"]},{id:"text/x-python","extends":"text/plain",name:"Python",extension:["py","rpy","pyw","cpy","SConstruct","Sconstruct","sconstruct","SConscript","gyp","gypi"]},{id:"text/x-ruby","extends":"text/plain",name:"Ruby",extension:["rb","rbx","rjs","Rakefile","rake","cgi","fcgi","gemspec","irbrc","capfile","ru","prawn","Gemfile","Guardfile","Vagrantfile","Appraisals","Rantfile"]},{id:"text/x-go",name:"Go",extension:["go"],"extends":"text/plain"},{id:"text/x-launch","extends":"application/json",name:"Launch file",extension:["launch"]},{id:"text/x-objective-c","extends":"text/plain",name:"Objective-C",extension:["m","mm","h"]},{id:"text/x-php","extends":"text/plain",name:"PHP",extension:["php","php3","php4","php5","phpt","phtml","aw","ctp"]},{id:"text/x-properties","extends":"text/plain",name:"Properties",extension:["properties"]},{id:"text/x-smarty","extends":"text/plain",name:"Smarty",extension:["tpl"]},{id:"text/x-swift","extends":"text/plain",name:"Swift",extension:["swift"]},{id:"text/x-typescript","extends":"text/plain",name:"Typescript",extension:["ts"]},{id:"text/x-markdown","extends":"text/plain",name:"Markdown",extension:["md"]},{id:"text/x-yaml","extends":"text/plain",name:"YAML",extension:["yaml","yml"]},{id:"text/conf","extends":"text/plain",name:"Conf",extension:["conf"]},{id:"text/sh","extends":"text/plain",name:"sh",extension:["sh"]},{id:"application/browser-renderable",name:"browser-renderable"},{id:"application/pdf","extends":"application/browser-renderable",name:"PDF",extension:["pdf"]},{id:"application/octet-stream",name:"octet-stream",extension:["exe","bin","doc","ppt"]},{id:"application/zip","extends":"application/octet-stream",name:"ZIP",extension:["war","jar","zip","rar","gz","tar"]},{id:"text/x-arduino","extends":"text/x-csrc",name:"Arduino",extension:["ino","pde"]},{id:"text/x-csrc","extends":"text/plain",name:"C",extension:["c","h"]},{id:"text/x-csharp","extends":"text/plain",name:"C#",extension:["cs"]},{id:"text/x-cshtml","extends":"text/plain",name:"cshtml",extension:["cshtml"]},{id:"text/x-c++src","extends":"text/plain",name:"C++",extension:["cpp","hpp"]},{id:"text/x-dockerfile","extends":"text/plain",name:"dockerfile",filename:["dockerfile"]},{id:"text/x-erlang","extends":"text/plain",name:"Erlang",extension:["erl","hrl"]},{id:"text/x-haml","extends":"text/plain",name:"Haml",extension:["haml"]},{id:"text/x-lua","extends":"text/plain",name:"Lua",extension:["lua"]},{id:"application/xquery","extends":"text/plain",name:"XQuery",extension:["xq","xqy","xquery"]},{id:"text/x-vb","extends":"text/plain",name:"VB.NET",extension:["vb"]},{id:"text/x-vbhtml","extends":"text/plain",name:"vbhtml",extension:["vbhtml"]},{id:"image/gif",name:"GIF",extension:["gif"],imageClass:"file-sprite-image modelDecorationSprite"},{id:"image/jpeg",name:"JPG",extension:["jpg","jpeg","jpe"],imageClass:"file-sprite-image modelDecorationSprite"},{id:"image/ico",name:"ICO",extension:["ico"],imageClass:"file-sprite-image modelDecorationSprite"},{id:"image/png",name:"PNG",extension:["png"],imageClass:"file-sprite-image modelDecorationSprite"},{id:"image/tiff",name:"TIFF",extension:["tif","tiff"],imageClass:"file-sprite-image modelDecorationSprite"},{id:"image/svg",name:"SVG",extension:["svg"],imageClass:"file-sprite-image modelDecorationSprite"}]; -return F.prototype={setup:function(e,t,i){return this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null),this._highlight(e,t,i)},highlight:function(e,t,i){var n=i.getTextView(),o=i.getAnnotationModel();return this._highlight(t,n,o)},_highlight:function(F,P,W){this.styler&&(this.styler.destroy(),this.styler=null);var V=null;if(F)switch(F.id){case"application/javascript":V=new t.createPatternBasedAdapter(i.grammars,"orion.js",F.id);break;case"application/vnd.coffeescript":V=new t.createPatternBasedAdapter(n.grammars,"orion.coffeescript",F.id);break;case"application/x-ejs":V=new t.createPatternBasedAdapter(I.grammars,"orion.ejs",F.id);break;case"text/css":V=new t.createPatternBasedAdapter(a.grammars,"orion.css",F.id);break;case"text/x-scss":V=new t.createPatternBasedAdapter(l.grammars,"orion.scss",F.id);break;case"text/x-less":V=new t.createPatternBasedAdapter(d.grammars,"orion.less",F.id);break;case"text/html":V=new t.createPatternBasedAdapter(c.grammars,"orion.html",F.id);break;case"text/jsx":V=new t.createPatternBasedAdapter(h.grammars,"orion.jsx",F.id);break;case"text/x-java-source":V=new t.createPatternBasedAdapter(x.grammars,"orion.java",F.id);break;case"application/x-jsp":V=new t.createPatternBasedAdapter(o.grammars,"orion.jsp",F.id);break;case"application/json":case"text/x-launch":V=new t.createPatternBasedAdapter(u.grammars,"orion.json",F.id);break;case"application/sql":V=new t.createPatternBasedAdapter(s.grammars,"orion.sql",F.id);break;case"text/x-jade":V=new t.createPatternBasedAdapter(b.grammars,"orion.jade",F.id);break;case"text/x-python":V=new t.createPatternBasedAdapter(T.grammars,"orion.python",F.id);break;case"text/x-ruby":V=new t.createPatternBasedAdapter(L.grammars,"orion.ruby",F.id);break;case"text/x-go":V=new t.createPatternBasedAdapter(k.grammars,"orion.go",F.id);break;case"text/x-objective-c":V=new t.createPatternBasedAdapter(D.grammars,"orion.objectiveC",F.id);break;case"text/x-php":V=new t.createPatternBasedAdapter(C.grammars,"orion.php",F.id);break;case"text/x-properties":V=new t.createPatternBasedAdapter(A.grammars,"orion.properties",F.id);break;case"text/x-smarty":V=new t.createPatternBasedAdapter(S.grammars,"orion.smarty",F.id);break;case"text/x-swift":V=new t.createPatternBasedAdapter(E.grammars,"orion.swift",F.id);break;case"text/x-typescript":V=new t.createPatternBasedAdapter(O.grammars,"orion.typescript",F.id);break;case"application/xml":case"application/xhtml+xml":V=new t.createPatternBasedAdapter(B.grammars,"orion.xml",F.id);break;case"text/x-yaml":V=new t.createPatternBasedAdapter(R.grammars,"orion.yaml",F.id);break;case"text/x-arduino":case"text/x-csrc":case"text/x-c":V=new t.createPatternBasedAdapter(p.grammars,"orion.c",F.id);break;case"text/x-csharp":V=new t.createPatternBasedAdapter(f.grammars,"orion.csharp",F.id);break;case"text/x-cshtml":V=new t.createPatternBasedAdapter(g.grammars,"orion.cshtml",F.id);break;case"text/x-c++src":V=new t.createPatternBasedAdapter(_.grammars,"orion.cpp",F.id);break;case"text/x-dockerfile":V=new t.createPatternBasedAdapter(m.grammars,"orion.dockerfile",F.id);break;case"text/x-erlang":V=new t.createPatternBasedAdapter(v.grammars,"orion.erlang",F.id);break;case"text/x-haml":V=new t.createPatternBasedAdapter(y.grammars,"orion.haml",F.id);break;case"text/x-lua":V=new t.createPatternBasedAdapter(w.grammars,"orion.lua",F.id);break;case"application/xquery":V=new t.createPatternBasedAdapter(r.grammars,"orion.xquery",F.id);break;case"text/x-vb":V=new t.createPatternBasedAdapter(N.grammars,"orion.vb",F.id);break;case"text/x-vbhtml":V=new t.createPatternBasedAdapter(M.grammars,"orion.vbhtml",F.id)}return V&&(this.styler=new t.TextStyler(P,W,V)),(new e).resolve()},getStyler:function(){return this.styler}},{ContentTypes:P,SyntaxHighlighter:F}}),define("orion/serviceTracker",[],function(){function e(e,n){function o(e){var t=e.getProperty("service.id"),i=this.addingService(e);i&&(d[t]=e,c[t]=i)}function r(e){var t=e.getProperty("service.id"),i=c[t];delete d[t],delete c[t],this.removedService(e,i)}function s(e){return-1!==e.getProperty("objectClass").indexOf(n)}this.serviceRegistry=e;var a,l,d={},c={},h=t;this.close=function(){if(h!==i)throw new Error("Already closed");h=t,e.removeEventListener("registered",a),e.removeEventListener("unregistering",l),a=null,l=null;var n=this;this.getServiceReferences().forEach(function(e){r.call(n,e)}),"function"==typeof this.onClose&&this.onClose()},this.getServiceReferences=function(){var e=Object.keys(d);return e.length?e.map(function(e){return d[e]}):null},this.open=function(d){if("undefined"==typeof d&&(d=!0),h!==t)throw new Error("Already open");h=i;var c=this;a=function(e){return s(e.serviceReference)&&(o.call(c,e.serviceReference),"function"==typeof c.onServiceAdded)?c.onServiceAdded(e.serviceReference,c.serviceRegistry.getService(e.serviceReference)):void 0},l=function(e){s(e.serviceReference)&&r.call(c,e.serviceReference)},e.addEventListener("registered",a),e.addEventListener("unregistering",l),d&&e.getServiceReferences(n).forEach(function(t){return o.call(c,t),"function"==typeof c.onServiceAdded?c.onServiceAdded(t,e.getService(t)):void 0}),"function"==typeof this.onOpen&&this.onOpen()}}var t=0,i=1;return e.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}},e}),define("orion/contentTypes",["orion/serviceTracker"],function(e){function t(e,t){return-1!==e.indexOf(t)}function i(e){switch(e&&e.id){case"image/jpeg":case"image/png":case"image/gif":case"image/ico":case"image/tiff":case"image/svg":return!0}return!1}function n(e){return e?"application/octet-stream"===e.id||"application/octet-stream"===e["extends"]:!1}function o(e,i){if("string"!=typeof e)return null;var n,o=null,r=e.indexOf(".");r++;for(var s=e.substring(r).toLowerCase(),a=0;a=0){o=n;break}t(n.extension,s)&&(o=n)}if(!o)for(r=s.indexOf(".");!o&&r>=0;){for(r++,s=s.substring(r),a=0;as;s++){this._addFileModeProperties(this._diffContents[s],o);var a=this._parseHunkRange(s);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return o.outPutFile=e,o;this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(e){console.log(e)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(var l=0;l0){console.log(" **Diff content on change/add: \n");for(var t=0;th;h++)if(0!==this._diffContents[h].length){var u=this._diffContents[h][0];if("\\"!==u||i!==this._diffContents[h].substring(0,this._diffContents[h].length-1)&&i!==this._diffContents[h]){switch(u){case"-":case"+":case" ":break;default:continue}if(t!==u){switch("+"===u&&(d=h),"-"===u&&(c=h),t){case" ":a=this._hunkRanges[e][1]+r,l=this._hunkRanges[e][3]+s;break;case"-":this._createMinusBlock(a,l,this._hunkRanges[e][1]+r-a,c);break;case"+":this._createPlusBlock(a,l,this._hunkRanges[e][3]+s-l,d)}t=u}switch(u){case"-":r++;break;case"+":s++;break;case" ":r++,s++}}else"-"===t?this._oNewLineAtEnd=!1:" "===t?(this._nNewLineAtEnd=!1,this._oNewLineAtEnd=!1):this._nNewLineAtEnd=!1,h>n&&"\r"===this._diffContents[h-1][this._diffContents[h-1].length-1]&&(this._diffContents[h-1]=this._diffContents[h-1].substring(0,this._diffContents[h-1].length-1))}switch(t){case"-":this._createMinusBlock(a,l,this._hunkRanges[e][1]+r-a,c);break;case"+":this._createPlusBlock(a,l,this._hunkRanges[e][3]+s-l,d)}},_detectConflictes:function(e,t){if(0>e)return!1;for(var i=e+t,n=e;i>n;n++){var o=this._diffContents[n];if(o.indexOf("<<<<<")>-1||o.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(e){for(var t,i=this._oBlocks.length,n=this._oFileContents.length,o=0,r=1,s=0;i>s;s++)t=this._oBlocks[s][0]-r,t>0&&(this._deltaMap.push([t,t,0]),o+=t),this._deltaMap.push(e&&this._detectConflictes(this._nBlocks[s][2],this._nBlocks[s][1])?[this._nBlocks[s][1],this._oBlocks[s][1],this._nBlocks[s][2]+1,1]:[this._nBlocks[s][1],this._oBlocks[s][1],this._nBlocks[s][2]+1]),o+=this._oBlocks[s][1],r=this._oBlocks[s][0]+this._oBlocks[s][1];if(n-r>0&&(this._deltaMap.push([n-r+1,n-r+1,0]),o+=n-r+1),n>o){t=n-o;var a=this._deltaMap[this._deltaMap.length-1];0===a[2]?(a[0]+=t,a[1]+=t):-1===a[2]?this._deltaMap.push([t,t,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([t,t,0]):(this._nNewLineAtEnd&&(a[0]+=t),this._oNewLineAtEnd&&(a[1]+=t))}},_buildNewFile:function(){var e,t,i=1,n=!1,o=this._deltaMap.length;for(e=0;o>e;e++){if(n=!1,0===this._deltaMap[e][2]){for(t=0;t0)for(t=0;t=0?i:1)}else t.push(1)},_parseHunkRange:function(e){var t=this._diffContents[e],i=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,n=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,o=i.exec(t),r=null;return o&&5===o.length?(r=[e],this._converHRangeBody(o[1],r),this._converHRangeBody(o[2],r),this._converHRangeBody(o[3],r),this._converHRangeBody(o[4],r)):(o=n.exec(t),o&&5===o.length&&(r=[e],this._converHRangeBody(o[3],r),this._converHRangeBody(o[4],r),this._converHRangeBody(o[1],r),this._converHRangeBody(o[2],r))),r}},e}(),e}),define("orion/URITemplate",[],function(){function e(e){this._text=e}function t(e){return e.replace("%25","%")}function i(e,i){if("U"===i)return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===i)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(h,t);if("U+R-,"===i)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+i)}function n(e,t,n){for(var o=[],r=0;r=n&&n+r>i)return{mapperIndex:o,startFrom:n};if(o===e.length-1)break;n+=e[o][t]}return{mapperIndex:e.length-1,startFrom:n}},t.compareUtils.lookUpLineIndex=function(e,t,i){if(0===i)return 0;for(var n=0,o=0;i>o;o++)n+=e[o][t];return n},t.compareUtils.updateMapper=function(e,i,n,o,r){if(o!==r&&(o>0||r>0)){var s=t.compareUtils.lookUpMapper(e,i,n);if(s.mapperIndex<0)return;if(o>0)for(var a=o,l=n-s.startFrom,d=s.mapperIndex;d=a){e[d][i]-=a;break}e[d][i]-=c,a-=c,l=0}r>0&&(e[s.mapperIndex][i]+=r)}},t.compareUtils.overlapMapper=function(e,t,i,n,o){var r=i+e[t]-1;return i>r&&(r=i),n>o&&(o=n),n>r||i>o?!1:!0},t.compareUtils.findFirstDiff=function(e,i,n,o){for(var r=0,s=null,a=0;ao)&&(!t.compareUtils.overlapMapper(e[a],i,r,n,o)||(s={mapperIndex:a,startFrom:r},0===e[a][2]));a++)r+=e[a][i];return s},t.compareUtils.matchMapper=function(e,i,n,o){if(0===e.length)return n;var r=n+Math.round((o-n)/3),s=t.compareUtils.findFirstDiff(e,i,n,o),a=0===e[s.mapperIndex][i]?s.startFrom:s.startFrom+e[s.mapperIndex][i]-1,l=t.compareUtils.lookUpLineIndex(e,1-i,s.mapperIndex),d=s.startFrom-n;if(0===e[s.mapperIndex][2])return l-d;if(r>=s.startFrom&&a>=r)return l-Math.round((o-n)/3);if(rt?!1:e[t][3]?1===e[t][3]:!1},t.compareUtils.mergeDiffBlocks=function(e,t,i,n,o,r){for(var s=0;s0){for(var c="",h=0;h=p){var f=e.getLineEnd(p-1),g=e.getLineEnd(p-1,!0);f===g?(e.setText(r,f,f),a=p):a=p-1}var _=e.getLineStart(a);e.setText(c,_,_)}}},t.compareUtils.convertMergedLineNumber=function(e,i,n){var o=t.compareUtils.lookUpMapper(e,n?1:0,i),r=i;if(n||0===e[o.mapperIndex][2]||(r+=e[o.mapperIndex][1]),o.mapperIndex<0)return r;for(var s=0;s0)for(var r=n-1;r>-1;r--)t=""===o?"":"/",o=o+t+i[r].Name;return t=""===o?"":"/",o=o+t+e.Name},t.compareUtils}),define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(e){var t=t||{};return t.CompareRuler=function(){function e(e,t,i){this._location=e||"left",this._overview=t||"page",this._rulerStyle=i,this._editor=null;var n=this;this._listener={onModelChanged:function(e){n._onModelChanged(e)}}}return e.prototype={setView:function(e){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged),this._editor=e,this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(e,t){for(var i=[],n=e;t>n;n++){var o=this.getStyle(n);o&&(i[n]={html:this.getHTML(n),style:o})}return i},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}},e}(),t.LineNumberCompareRuler=function(){function e(e,i,n,o,r,s){t.CompareRuler.call(this,n,"page",o),this._diffNavigator=e,this._oddStyle=r||{style:{backgroundColor:"white"}},this._evenStyle=s||{style:{backgroundColor:"white"}},this._numOfDigits=0,this._mapperColumnIndex=i}return e.prototype=new t.CompareRuler,e.prototype.getStyle=function(e){return void 0===e?this._rulerStyle:this._evenStyle},e.prototype.getHTML=function(e){var t=this._editor.getModel(),i=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);if(!i)return"";if(-1===e)return t.getLineCount();if(i.getLineNumber){var n=i.getLineNumber(e);return-1===n?"":n+1}return e+1},e.prototype._onModelChanged=function(e){var t=e.start,i=this._editor.getModel(),n=i.getLineCount(),o=(n+"").length;if(this._numOfDigits!==o){this._numOfDigits=o;var r=i.getLineAtOffset(t);this._editor.redrawLines(r,n,this)}},e}(),t.CompareOverviewRuler=function(){function i(e,i,n,o){this._diffNavigator=n,this._onClick=o,t.CompareRuler.call(this,e,"document",i)}return i.prototype=new t.CompareRuler,i.prototype.getStyle=function(t){var i,n;if(void 0===t)i=this._rulerStyle||{},n=i.style||(i.style={}),n.lineHeight="1px",n.fontSize="1px",n.width="14px";else{if(i=-1!==t?{styleClass:"annotationOverview breakpoint"}||{}:{},n=i.style||(i.style={}),n.cursor="pointer",n.width="8px",n.left="2px",!(t>=0))return null;var o;if(!this._diffNavigator||!this._diffNavigator.getFeeder())return null;o=this._diffNavigator.getFeeder().getDiffBlocks();var r=e.getAnnotationIndex(o,t);if(-1===r)return null;var s,a=e.getAnnotationMapperIndex(o,r);s=this._diffNavigator.getMapper();var l=e.isMapperConflict(s,a);l&&(n.border="1px #FF0000 solid"),r===this._diffNavigator.getCurrentBlockIndex()&&(n.backgroundColor=l?"red":"blue");var d=this._diffNavigator.getFeeder().getDiffBlockH(r),c=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>d)return null;var h=this._editor.getClientArea(),u=Math.floor(h.height*d/c);2>u&&(u=2),n.height=u+"px"}return i},i.prototype.setDiffNavigator=function(e){this._diffNavigator=e},i.prototype.getHTML=function(){return" "},i.prototype.onClick=function(e){void 0!==e&&this._onClick(e,this)},i.prototype._onModelChanged=function(){var e=this._editor.getModel(),t=e.getLineCount();t>0&&this._editor.redrawLines(0,1,this)},i}(),t.CompareCurveRuler=function(){function t(e){this._canvasDiv=e,this._mapper=void 0}return t.prototype={init:function(e,t,i,n){this._leftIniting=!0,this._rightIniting=!0,this._rightIniting=!0,this._mapper=e,this._leftEditor=t,this._rightEditor=i,this._leftTextView=t.getTextView(),this._rightTextView=i.getTextView(),this._diffNavigator=n,this.render()},matchPositionFrom:function(t){var i=t?this._leftTextView:this._rightTextView,n=t?this._rightTextView:this._leftTextView,o=i.getTopIndex(),r=i.getBottomIndex(),s=e.matchMapper(this._mapper,t?0:1,o,r);n.setTopIndex(s)},copyTo:function(e){if(this._diffNavigator.iterator){var t=this._diffNavigator.iterator.cursor();if(t){var i;if(i="word"===t.type?!t.copied&&!t.parent.copied:!t.copied,!i)return;var n=e?this._rightTextView.getText(t.oldA.start,t.oldA.end):this._leftTextView.getText(t.newA.start,t.newA.end),o=e?t.newA:t.oldA,r=e?this._leftTextView:this._rightTextView;r.setText(n,o.start,o.end),t.copied=!0}}},render:function(){if(this._mapper){var t=this._canvasDiv.getContext("2d");t.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height),t.strokeStyle="#AAAAAA",t.lineWidth=1,t.beginPath();var i=this._leftTextView.getTopIndex(),n=this._leftTextView.getBottomIndex(),o=this._rightTextView.getTopIndex(),r=this._rightTextView.getBottomIndex();this._leftLineH=this._leftTextView.getLineHeight(),this._rightLineH=this._rightTextView.getLineHeight();for(var s=0,a=0,l=!1,d=0;d0||t.addedLineCount>0)&&this.render()}return i?this._rightIniting=!1:this._leftIniting=!1,n}},t}(),t}),define("orion/regex",[],function(){function e(e){return e.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function t(e){var t=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(e);return t?{pattern:t[1],flags:t[2]}:null}return{escape:e,parse:t}}),define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(e,t,i){function n(e,t){this._lastLineIndex=-1,this._text=[""],this._lineOffsets=[0],this.setText(e),this.setLineDelimiter(t)}return n.prototype={destroy:function(){},find:function(e){this._text.length>1&&(this._text=[this._text.join("")]);var i=e.string,n=e.regex,o=i,r="",s=e.caseInsensitive;if(o)if(n){var a=t.parse(o);a&&(o=a.pattern,r=a.flags)}else o=i.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),s&&(o=o.replace(/[iI\u0130\u0131]/g,"[Iiİı]"));var l,d=null;if(o){var c=e.reverse,h=e.wrap,u=e.wholeWord,p=e.start||0,f=e.end,g=null!==f&&void 0!==f;-1===r.indexOf("g")&&(r+="g"),-1===r.indexOf("m")&&(r+="m"),s&&-1===r.indexOf("i")&&(r+="i"),u&&(o="\\b"+o+"\\b");var _,m,v=this._text[0],y=0;if(g){var x=f>p?p:f,b=f>p?f:p;v=v.substring(x,b),y=x}var w=new RegExp(o,r);c?l=function(){var e=null;for(w.lastIndex=0;;){if(m=w.lastIndex,_=w.exec(v),m===w.lastIndex)return null;if(!_)break;if(_.index+y=0&&i>e))return null;var n=this._lineOffsets[e];if(i>e+1){var o=this.getText(n,this._lineOffsets[e+1]);if(t)return o;for(var r,s=o.length;10===(r=o.charCodeAt(s-1))||13===r;)s--;return o.substring(0,s)}return this.getText(n)},getLineAtOffset:function(e){var t=this.getCharCount();if(!(e>=0&&t>=e))return-1; -var i=this.getLineCount();if(e===t)return i-1;var n,o,r=this._lastLineIndex;if(r>=0&&i>r&&(n=this._lineOffsets[r],o=i>r+1?this._lineOffsets[r+1]:t,e>=n&&o>e))return r;for(var s=i,a=-1;s-a>1;)if(r=Math.floor((s+a)/2),n=this._lineOffsets[r],o=i>r+1?this._lineOffsets[r+1]:t,n>=e)s=r;else{if(o>e){s=r;break}a=r}return this._lastLineIndex=s,s},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,t){var i=this.getLineCount();if(!(e>=0&&i>e))return-1;if(i>e+1){var n=this._lineOffsets[e+1];if(t)return n;for(var o,r=this.getText(Math.max(this._lineOffsets[e],n-2),n),s=r.length;10===(o=r.charCodeAt(s-1))||13===o;)s--;return n-(r.length-s)}return this.getCharCount()},getLineStart:function(e){return e>=0&&e=e));)n+=i,o++;for(var r=n,s=o;o=t));)n+=i,o++;var a=n,l=o;if(s>=this._text.length||l>=this._text.length||s>l)return"";if(s===l)return this._text[s].substring(e-r,t-a);var d=this._text[s].substring(e-r),c=this._text[l].substring(0,t-a);return d+this._text.slice(s+1,l).join("")+c},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e,t){if("auto"===e&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0)))),this._lineDelimiter=e?e:i.platformDelimiter,t){var n=this.getLineCount();if(n>1){for(var o=new Array(n),r=0;n>r;r++)o[r]=this.getLine(r);this.setText(o.join(this._lineDelimiter))}}},setText:function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=0),void 0===i&&(i=this.getCharCount()),t!==i||""!==e){for(var n=this.getLineAtOffset(t),o=this.getLineAtOffset(i),r=t,s=i-t,a=o-n,l=e.length,d=0,c=this.getLineCount(),h=0,u=0,p=0,f=[];;){if(-1!==h&&p>=h&&(h=e.indexOf("\r",p)),-1!==u&&p>=u&&(u=e.indexOf("\n",p)),-1===u&&-1===h)break;p=-1!==h&&-1!==u?h+1===u?u+1:(u>h?h:u)+1:-1!==h?h+1:u+1,f.push(t+p),d++}var g={type:"Changing",text:e,start:r,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};if(this.onChanging(g),0===f.length){var _,m=this.getLineStart(n);_=c>o+1?this.getLineStart(o+1):this.getCharCount(),t!==m&&(e=this.getText(m,t)+e,t=m),i!==_&&(e+=this.getText(i,_),i=_)}for(var v=l-s,y=n+a+1;c>y;y++)this._lineOffsets[y]+=v;var x,b=5e4,w=b;if(f.length=t));)L+=T,k++;for(var D=L,A=k;k=i));)L+=T,k++;var S=L,E=k,O=this._text[A],N=this._text[E],M=O.substring(0,t-D),I=N.substring(i-S),B=[A,E-A+1];M&&B.push(M),e&&B.push(e),I&&B.push(I),Array.prototype.splice.apply(this._text,B),0===this._text.length&&(this._text=[""]);var R={type:"Changed",start:r,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanged(R)}}},e.EventTarget.addMixin(n.prototype),{TextModel:n}}),define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(e,t){function i(e){e&&(this._view=e,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function n(e){i.call(this,e)}return i.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(e){for(var t=[],i=this._keyBindings,n=0;nn){var h=o(n);t=s+h*l,r(t)}else r(a),c.stop()}var t,i="number"==typeof this.options.duration?this.options.duration:350,n="number"==typeof this.options.rate?this.options.rate:20,o=this.options.easing||this.defaultEasing,r=this.options.onAnimate||function(){},s=this.options.curve[0],a=this.options.curve[1],l=a-s,d=-1,c=this;this.interval=this.options.window.setInterval(e,n)},e.prototype.stop=function(){this.options.window.clearInterval(this.interval);var e=this.options.onEnd||function(){};e()},e.prototype.defaultEasing=function(e){return Math.sin(e*(Math.PI/2))},e}();return{contains:i,getNodeStyle:n,addEventListener:e,removeEventListener:t,Animation:o}}),define("orion/bidiUtils",["orion/util"],function(e){function t(){var e;window.dojoConfig&&(e=window.dojoConfig.locale),e||(e=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage);var t=e&&-1!="ar iw he".indexOf(e.substring(0,2));if(t){var i=document.getElementsByTagName("html")[0];i&&i.setAttribute("dir","rtl")}}function i(){var e=localStorage.getItem(c);return e&&"true"==e?!0:!1}function n(){var e=localStorage.getItem(h);return!e||"rtl"!=e&&"ltr"!=e&&"auto"!=e?"ltr":e}function o(t){return g=n(),i()?"auto"==g&&e.isIE?s(t):g:""}function r(e){if(i()&&e.trim()){g=n();var t="auto"==g?s(e):g;return("ltr"==t?u:f)+e+p}return e}function s(e){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(e);return t?t[0]<="z"?"ltr":"rtl":"ltr"}function a(e){if(!e._hasBidiEventListeners){e._hasBidiEventListeners=!0;for(var t=["keyup","cut","paste"],i=0;i0;)(!s.isIE||s.isIE>=9||s.isIE<9&&n[o].specified)&&t.removeAttribute(n[o].name)}if(e){e.styleClass&&(t.className=e.styleClass);var r=e.style;if(r)for(var a in r)r.hasOwnProperty(a)&&(t.style[a]=r[a]);var l=e.attributes;if(l)for(var d in l)l.hasOwnProperty(d)&&t.setAttribute(d,l[d])}}function u(e){return e instanceof Array?e.slice(0):e}function p(e,t){if(!e)return t;if(!t)return e;for(var i in t)t.hasOwnProperty(i)&&(e.hasOwnProperty(i)||(e[i]=t[i]));return e}function f(e,t){if(e===t)return!0;if(e&&!t||!e&&t)return!1;if(e&&e.constructor===String||t&&t.constructor===String)return!1;if(e instanceof Array||t instanceof Array){if(!(e instanceof Array&&t instanceof Array))return!1;if(e.length!==t.length)return!1;for(var i=0;ir;){-1!==n&&r>=n&&(n=e.indexOf("\r",r)),-1!==o&&r>=o&&(o=e.indexOf("\n",r));var a,l=r;if(-1===o&&-1===n){t(e.substring(r));break}-1!==n&&-1!==o?n+1===o?(a=n,r=o+1):(a=o>n?n:o,r=(o>n?n:o)+1):-1!==n?(a=n,r=n+1):(a=o,r=o+1),t(e.substring(l,a)),i?i():r===s&&t("")}}function _(e){var t,i,n,o,r=d(e.ownerDocument);if(r.getComputedStyle){var s=r.getComputedStyle(e,null);t=s.getPropertyValue("border-left-width"),i=s.getPropertyValue("border-top-width"),n=s.getPropertyValue("border-right-width"),o=s.getPropertyValue("border-bottom-width")}else e.currentStyle&&(t=e.currentStyle.borderLeftWidth,i=e.currentStyle.borderTopWidth,n=e.currentStyle.borderRightWidth,o=e.currentStyle.borderBottomWidth);return{left:parseInt(t,10)||0,top:parseInt(i,10)||0,right:parseInt(n,10)||0,bottom:parseInt(o,10)||0}}function m(e){var t,i,n,o,r=d(e.ownerDocument);if(r.getComputedStyle){var s=r.getComputedStyle(e,null);t=s.getPropertyValue("padding-left"),i=s.getPropertyValue("padding-top"),n=s.getPropertyValue("padding-right"),o=s.getPropertyValue("padding-bottom")}else e.currentStyle&&(t=e.currentStyle.paddingLeft,i=e.currentStyle.paddingTop,n=e.currentStyle.paddingRight,o=e.currentStyle.paddingBottom);return{left:parseInt(t,10)||0,top:parseInt(i,10)||0,right:parseInt(n,10)||0,bottom:parseInt(o,10)||0}}function v(e){var t=e._trim;if(!t){t=m(e);var i=_(e);t.left+=i.left,t.top+=i.top,t.right+=i.right,t.bottom+=i.bottom,e._trim=t}return t}function y(e,t,i,n){function o(t){if(t.animationName===a){var i=t.target;"function"==typeof i.__DOMReady&&d(e).setTimeout(function(){i.__DOMReady()},0)}}function r(e,t){for(var i=["","-webkit-","-moz-","-ms-","-o-"],n="",o="body ."+e+" {\n",r=0;ri;i++){var n=e._createSelectionDiv();t.appendChild(n),this._divs.push(n)}}function w(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom}function C(e,t,i){this.view=e,this.lineIndex=t,this._lineDiv=i}function T(e){this._init(e||{})}var L=r.addEventListener,k=r.removeEventListener,D=r.Animation;return x.compare=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i=0;i--)if(e[i]._editing)return e[i];return e[e.length-1]}for(i=0;i=i.end||i._editing||e[n]._editing?(t.push(i),i=e[n]):i.end=Math.max(i.end,e[n].end);return t.push(i),t},x.prototype={clone:function(){var e=new x(this.start,this.end,this.caret);return e._columnX=this._columnX,e._editing=this._editing,e._docX=this._docX,e},contains:function(e){return this.start<=e&&ethis.end){var t=this.start;this.start=this.end,this.end=t,this.caret=!this.caret}},setCaret:function(e){this.start=e,this.end=e,this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},getAnchor:function(){return this.caret?this.end:this.start},getOrientedSelection:function(){return{start:this.getAnchor(),end:this.getCaret()}},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(e){return this.caret===e.caret&&this.start===e.start&&this.end===e.end&&this._editing===e._editing}},b.prototype={destroy:function(){this._divs&&(this._divs.forEach(function(e){e.parentNode.removeChild(e)}),this._divs=null)},setPrimary:function(e){this.primary=e},update:function(){var e,t=this._view,i=this.primary,n=t._hasFocus,o=t._cursorVisible,r=!this.primary&&this._selection&&this._selection.isEmpty();e=r?"textviewSelectionCaret":n?"textviewSelection":"textviewSelectionUnfocused",this._divs[0].style.visibility=r&&o&&n||!r?"visible":"hidden",this._divs[0].style.zIndex=o&&r?"2":"0",this._divs.forEach(function(t){t.className=e,s.isWebkit<537.36&&i&&(t.style.background=n?"transparent":"")})},setSelection:function(e){this._selection=e,this.update();var t=this._view,i=t._model,n=i.getLineAtOffset(e.start),o=i.getLineAtOffset(e.end),r=t._getLineNext();if(r){var s,a,l,d,c=t._getLinePrevious();nc.lineIndex?(s=c,l=i.getLineStart(c.lineIndex)):(s=t._getLineNode(n),l=e.start),oc.lineIndex?(a=c,d=i.getLineStart(c.lineIndex)):(a=t._getLineNode(o),d=e.end),this._setDOMSelection(s,l,a,d,e.caret)}},_setDOMSelection:function(e,t,i,n,o){if(this._setDOMFullSelection(e,t,i,n),this.primary){var r=this._view,a=e._line.getNodeOffset(t),l=i._line.getNodeOffset(n);if(a.node&&l.node){var d,c=r._getWindow(),h=r._parent.ownerDocument;if(c.getSelection){var u=c.getSelection();if(d=h.createRange(),d.setStart(a.node,a.offset),d.setEnd(l.node,l.offset),!r._hasFocus||u.anchorNode===a.node&&u.anchorOffset===a.offset&&u.focusNode===l.node&&u.focusOffset===l.offset&&u.anchorNode===l.node&&u.anchorOffset===l.offset&&u.focusNode===a.node&&u.focusOffset===a.offset||(r._anchorNode=a.node,r._anchorOffset=a.offset,r._focusNode=l.node,r._focusOffset=l.offset,r._ignoreSelect=!1,u.rangeCount>0&&u.removeAllRanges(),u.addRange(d),r._ignoreSelect=!0),r._cursorDiv){d=h.createRange(),o?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(l.node,l.offset),d.setEnd(l.node,l.offset));var p=d.getClientRects()[0],f=r._cursorDiv.parentNode,g=f.getBoundingClientRect();p&&g&&(r._cursorDiv.style.top=p.top-g.top+f.scrollTop+"px",r._cursorDiv.style.left=p.left-g.left+f.scrollLeft+"px")}}else if(h.selection){if(!r._hasFocus)return;var _=h.body,m=s.createElement(h,"div");_.appendChild(m),_.removeChild(m),d=_.createTextRange(),d.moveToElementText(a.node.parentNode),d.moveStart("character",a.offset);var v=_.createTextRange();v.moveToElementText(l.node.parentNode),v.moveStart("character",l.offset),d.setEndPoint("EndToStart",v),r._ignoreSelect=!1,d.select(),r._ignoreSelect=!0}}}},_setDOMFullSelection:function(e,t,i,n){this._divs.forEach(function(e){e.style.width=e.style.height="0px"});var o=this._view;if(o._fullSelection&&!(s.isIOS||e===i&&t===n&&this.primary)){var r=o._getViewPadding(),a=o._clientDiv.getBoundingClientRect(),l=o._viewDiv.getBoundingClientRect(),d=l.left+r.left,c=a.right,h=l.top+r.top,u=a.bottom,p=0,f=0;if(o._clipDiv){var g=o._clipDiv.getBoundingClientRect();p=g.left-o._clipDiv.scrollLeft,f=g.top}else{var _=o._rootDiv.getBoundingClientRect();p=_.left,f=_.top}o._ignoreDOMSelection=!0;var m,v,y=new C(o,e.lineIndex,e),x=y.getBoundingClientRect(t,!1),b=x.left;e===i&&t===n?(m=y,v=x):(m=new C(o,i.lineIndex,i),v=m.getBoundingClientRect(n,!1));var w=v.left;o._ignoreDOMSelection=!1;var T=this._divs[0],L=Math.min(c,Math.max(d,b)),k=Math.min(u,Math.max(h,x.top)),D=c,A=Math.min(u,Math.max(h,x.bottom));if(T.style.left=L-p+"px",T.style.top=k-f+"px",T.style.width=Math.max(0,D-L)+"px",T.style.height=Math.max(0,A-k)+"px",e.lineIndex===i.lineIndex)D=Math.min(w,c),T.style.width=Math.max(this.primary?0:1,D-L)+"px";else{var S=d,E=Math.min(u,Math.max(h,v.top)),O=Math.min(c,Math.max(d,w)),N=Math.min(u,Math.max(h,v.bottom)),M=this._divs[2];if(M.style.left=S-p+"px",M.style.top=E-f+"px",M.style.width=Math.max(0,O-S)+"px",M.style.height=Math.max(0,N-E)+"px",Math.abs(e.lineIndex-i.lineIndex)>1){var I=this._divs[1];I.style.left=d-p+"px",I.style.top=A-f+"px",I.style.width=Math.max(0,c-d)+"px",I.style.height=Math.max(0,E-A)+"px"}}}}},w.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}},C.prototype={create:function(e,t){if(!this._lineDiv){var i=this._lineDiv=this._createLine(e,t,this.lineIndex);return i._line=this,i}},_createLine:function(e,t,i){var n=this.view,o=n._model,r=o.getLine(i),a=o.getLineStart(i),l={type:"LineStyle",textView:n,lineIndex:i,lineText:r,lineStart:a};n.onLineStyle(l);var d=e.ownerDocument,c=t||s.createElement(d,"div");if(t&&f(t.viewStyle,l.style)||(h(l.style,c,t),t&&(t._trim=null),c.viewStyle=l.style),c.lineIndex=i,t&&c.viewLineText===r&&f(l.ranges,c.viewRanges))return c;c.viewRanges=l.ranges,c.viewLineText=r;var u=[],p={tabOffset:0,ranges:u};this._createRanges(l.ranges,r,0,r.length,a,p);var g=" ";!n._fullSelection&&s.isIE<9&&(g="");var _={text:g,style:n._metrics.largestFontStyle,ignoreChars:1};0!==u.length&&u[u.length-1].style&&"div"===u[u.length-1].style.tagName?u.splice(u.length-1,0,_):u.push(_);var m,v,y,x,b,w,C,T,L=0,k=0;if(s.isFirefox&&r.length>2e3){t&&(c.innerHTML="",t.lineWidth=void 0);var D=d.createDocumentFragment();for(T=0;T=S&&(O-=A);var N=y.firstChild.data,M=N?N.length:0;if(k+M>O)break;k+=M}C=y.nextSibling,c.removeChild(y),y=C}}m=this._createSpan(c,b,v,_.ignoreChars),y?c.insertBefore(m,y):c.appendChild(m),t&&(t.lineWidth=void 0)}if(t)for(var I=m?m.nextSibling:null;I;)C=I.nextSibling,t.removeChild(I),I=C}return c.parentNode||e.appendChild(c),c},_createRanges:function(e,t,i,n,o,r){if(!(i>n)){if(e)for(var s=0;sn)break;var d=Math.min(o+n,a.end)-o;if(d>=l){if(l=Math.max(i,l),d=Math.min(n,d),l>i&&this._createRange(t,i,l,null,r),!a.style||!a.style.unmergeable)for(;s+1i&&this._createRange(t,i,n,null,r)}},_createRange:function(e,t,i,n,o){if(!(t>i)){var r,s=this.view._customTabSize,l={tagName:"span",bidi:!0,style:{unicodeBidi:"embed",direction:"ltr"}},d={text:"‎",style:l};if(s&&8!==s)for(var c=e.indexOf(" ",t);-1!==c&&i>c;){c>t&&(r={text:e.substring(t,c),style:n},o.ranges.push(r),a.isBidiEnabled&&o.ranges.push(d),o.tabOffset+=r.text.length);var h=s-o.tabOffset%s;if(h>0){for(var u=" ",p=1;h>p;p++)u+=" ";r={text:u,style:n,ignoreChars:h-1},o.ranges.push(r),a.isBidiEnabled&&o.ranges.push(d),o.tabOffset+=r.text.length}if(t=c+1,t===i)return;c=e.indexOf(" ",t)}i>=t&&(r={text:e.substring(t,i),style:n},o.ranges.push(r),a.isBidiEnabled&&o.ranges.push(d),o.tabOffset+=r.text.length)}},_createSpan:function(e,t,i,n){var o=this.view,r="span";i&&i.tagName&&(r=i.tagName.toLowerCase());var a="a"===r;a&&(this.hasLink=!0),a&&!o._linksVisible&&(r="span");var l=e.ownerDocument,d=s.createElement(e.ownerDocument,r);if(d.appendChild(l.createTextNode(i&&i.text?i.text:t)),i&&i.html?(d.innerHTML=i.html,d.ignore=!0):i&&i.node?(d.appendChild(i.node),d.ignore=!0):i&&i.bidi&&(d.ignore=!0),h(i,d),"a"===r){var c=o._getWindow();L(d,"click",function(e){return o._handleLinkClick(e?e:c.event)},!1)}return d.viewStyle=i,n&&(d.ignoreChars=n),d},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(e,t){var i=this._ensureCreated(),n=this.view;if(void 0===e)return this._getLineBoundingClientRect(i,!0);var o=n._model,r=i.ownerDocument,a=this.lineIndex,l=null;if(ee){var h,u=e-c;if(1===o.length)l=new w(t.getBoundingClientRect());else if(n._isRangeRects)h=r.createRange(),h.setStart(o,u),h.setEnd(o,u+1),l=new w(h.getBoundingClientRect());else if(s.isIE){h=r.body.createTextRange(),h.moveToElementText(t),h.collapse();var p=0===u&&8===s.isIE;p&&(u=1),h.moveEnd("character",u+1),h.moveStart("character",u),l=new w(h.getBoundingClientRect()),p&&(l.left=t.getClientRects()[0].left)}else{var f=o.data;t.removeChild(o),t.appendChild(r.createTextNode(f.substring(0,u)));var g=s.createElement(r,"span");if(g.appendChild(r.createTextNode(f.substring(u,u+1))),t.appendChild(g),t.appendChild(r.createTextNode(f.substring(u+1))),l=new w(g.getBoundingClientRect()),t.innerHTML="",t.appendChild(o),!this._createdDiv){var _=n._getSelections()[0]; -(c<=_.start&&_.starts.right&&(s.right=a.right),a.bottom>s.bottom&&(s.bottom=a.bottom))}}return!0}),void 0!==e?i[e]:i},_getLineBoundingClientRect:function(e,t){var i=new w(e.getBoundingClientRect());if(this.view._wrapMode);else{i.right=i.left;for(var n=e.lastChild;n&&n.ignoreChars===n.firstChild.length;)n=n.previousSibling;if(n){var o=n.getBoundingClientRect();i.right=o.right+v(e).right}}if(t){var r=v(e);i.left=i.left+r.left,i.right=i.right-r.right}return i},getLineCount:function(){return this.view._wrapMode?this.getClientRects().length:1},getLineIndex:function(e){if(!this.view._wrapMode)return 0;for(var t=this.getClientRects(),i=this.getBoundingClientRect(e),n=i.top+(i.bottom-i.top)/2,o=0;os||n+r>=a?(t=o,i=s-n,e.ignoreChars&&r>0&&i===r&&(i+=e.ignoreChars),!1):(n+=r,!0)}),{node:t,offset:i}},getText:function(e){var t="",i=0;return this.forEach(function(n){var o;if(n.ignoreChars){o=n.lastChild;for(var r=0,s=[],a=-1;o;){var l=o.data;if(l)for(var d=l.length-1;d>=0;d--){var c=l.substring(d,d+1);r1;){var N=Math.floor((E+O)/2);y=O+1,x=N===T-1&&i.ignoreChars?C.length:N+1,b=0===y&&8===s.isIE,o._isRangeRects?(v.setStart(C,y),v.setEnd(C,x)):(b&&(y=1),v.moveToElementText(i),v.move("character",y),v.moveEnd("character",x-y)),w=v.getClientRects();for(var M=!1,I=0;I=h&&_>e&&(!o._wrapMode||t>=u&&m>=t)){M=!0;break}M?E=N:O=N}n+=E,y=E,x=E===T-1&&i.ignoreChars?C.length:Math.min(E+1,C.length),o._isRangeRects?(v.setStart(C,y),v.setEnd(C,x)):(v.moveToElementText(i),v.move("character",y),v.moveEnd("character",x-y)),w=v.getClientRects();var B=!1;w.length>0&&(c=w[0],h=(b?S:c.left)*D-f.left,_=c.right*D-f.left,B=e>h+(_-h)/2);var R=n-l,F=r.getLine(a),P=F.charCodeAt(R);P>=55296&&56319>=P&&B?R=56320&&57343>=P&&(n+=1)):P>=56320&&57343>=P&&!B&&R>0&&(P=F.charCodeAt(R-1),P>=55296&&56319>=P&&(n-=1)),B&&n++}else{for(var W=[],V=0;T>V;V++)W.push(""),W.push(V===T-1?C.data.substring(V):C.data.substring(V,V+1)),W.push("");i.innerHTML=W.join("");for(var j=i.firstChild;j;){if(c=j.getBoundingClientRect(),h=c.left-f.left,_=c.right-f.left,e>=h&&_>e){e>h+(_-h)/2&&n++;break}n++,j=j.nextSibling}if(!g._createdDiv){i.innerHTML="",i.appendChild(C);var U=o._getSelections()[0];(n<=U.start&&U.startu.right&&(e=u.right-1)}else 0>e&&(e=0),e>f.right-f.left&&(e=f.right-f.left);var m,v;if(this._lastHitChild&&this._lastHitChild.parentNode){if(m=this._lastHitOffset,v=this._lastHitChild,u=n(v),!u)for(var y=m,x=m+this._nodeLength(v),b=v.previousSibling,w=v.nextSibling;b||w;){if(b){if(y-=this._nodeLength(b),u=n(b)){v=b,m=y;break}b=b.previousSibling}if(w){if(u=n(w)){v=w,m=x;break}x+=this._nodeLength(w),w=w.nextSibling}}}else m=l,this.forEach(function(e){return v=e,(u=n(v))?!1:(m+=this._nodeLength(v),!0)});return v&&u&&(this._lastHitChild=v,this._lastHitOffset=m,m=i(v,m,u)),Math.min(c,Math.max(l,m))},getNextOffset:function(e,t){if("line"===t.unit){var i=this.view,n=i._model,o=n.getLineAtOffset(e);return t.count>0?(t.count--,n.getLineEnd(o)):(t.count++,n.getLineStart(o))}return"wordend"===t.unit||"wordWS"===t.unit||"wordendWS"===t.unit?this._getNextOffset_W3C(e,t):s.isIE?this._getNextOffset_IE(e,t):this._getNextOffset_W3C(e,t)},_getNextOffset_W3C:function(e,t){function i(e){return e>=33&&47>=e||e>=58&&64>=e||e>=91&&94>=e||96===e||e>=123&&126>=e}function n(e){return 32===e||9===e}var o,r=this.view,s=r._model,a=s.getLineAtOffset(e),l=s.getLine(a),d=s.getLineStart(a),c=s.getLineEnd(a),h=l.length,u=e-d,p=t.count<0?-1:1;if("word"===t.unit||"wordend"===t.unit||"wordWS"===t.unit||"wordendWS"===t.unit)for(var f,g,_,m;0!==t.count;){if(t.count>0){if(u===h)return c;for(o=l.charCodeAt(u),f=i(o),g=!f&&!n(o),u++;h>u;){if(o=l.charCodeAt(u),"wordWS"!==t.unit&&"wordendWS"!==t.unit){if(_=i(o),"wordend"===t.unit){if(!_&&f)break}else if(_&&!f)break;m=!_&&!n(o)}else m=!n(o);if("wordend"===t.unit||"wordendWS"===t.unit){if(!m&&g)break}else if(m&&!g)break;g=m,f=_,u++}}else{if(0===u)return d;for(u--,o=l.charCodeAt(u),f=i(o),g=!f&&!n(o);u>0;){if(o=l.charCodeAt(u-1),"wordWS"!==t.unit&&"wordendWS"!==t.unit){if(_=i(o),"wordend"===t.unit){if(_&&!f)break}else if(!_&&f)break;m=!_&&!n(o)}else m=!n(o);if("wordend"===t.unit||"wordendWS"===t.unit){if(m&&!g)break}else if(!m&&g)break;g=m,f=_,u--}}t.count-=p}else for(;0!==t.count&&u+p>=0&&h>=u+p;)u+=p,o=l.charCodeAt(u),o>=56320&&57343>=o&&u>0&&(o=l.charCodeAt(u-1),o>=55296&&56319>=o&&(u+=p)),t.count-=p;return d+u},_getNextOffset_IE:function(e,t){var i,n,o,r=this._ensureCreated(),s=this.view,a=s._model,l=this.lineIndex,d=0,c=a.getLineStart(l),h=a.getLine(l),u=a.getLineStart(l),p=r.ownerDocument,f=t.count<0?-1:1;if(e===a.getLineEnd(l)){for(o=r.lastChild;o&&o.ignoreChars===o.firstChild.length;)o=o.previousSibling;if(!o)return c;i=p.body.createTextRange(),i.moveToElementText(o),n=i.text.length,i.moveEnd(t.unit,f),d=e+i.text.length-n}else if(e===c&&t.count<0)d=c;else for(o=r.firstChild;o;){var g=this._nodeLength(o);if(c+g>e){if(i=p.body.createTextRange(),e===c&&t.count<0){for(var _=o.previousSibling;_&&(!_.firstChild||!_.firstChild.length);)_=_.previousSibling;i.moveToElementText(_?_:o.previousSibling)}else i.moveToElementText(o),i.collapse(),i.moveEnd("character",e-c);n=i.text.length,i.moveEnd(t.unit,f),d=e+i.text.length-n;break}c=g+c,o=o.nextSibling}var m=d-u,v=h.charCodeAt(m);return v>=56320&&57343>=v&&m>0&&(v=h.charCodeAt(m-1),v>=55296&&56319>=v&&(m+=f)),d=m+u,t.count-=f,d},updateLinks:function(){var e=this._ensureCreated();if(this.hasLink){var t=this;this.forEach(function(i){var n=i.viewStyle;return n&&n.tagName&&"a"===n.tagName.toLowerCase()&&e.replaceChild(t._createSpan(e,i.firstChild.data,n),i),!0})}},destroy:function(){var e=this._createdDiv;e&&(e.parentNode.removeChild(e),this._createdDiv=null)}},T.prototype={addKeyMode:function(e,t){var i=this._keyModes;void 0!==t?i.splice(t,0,e):i.push(e),e._modeAdded&&e._modeAdded()},addRuler:function(e,t){var i=this._rulers;if(void 0!==t){var n,o;for(n=0,o=0;no;n++)e.getLocation()===i[n].getLocation()&&o++;i.splice(o,0,e),t=o}else i.push(e);this._createRuler(e,t),e.setView(this),this._update()},computeSize:function(){var e=0,t=0,i=this._model,n=this._clientDiv;if(!n)return{width:e,height:t};var o=n.style.width;s.isWebkit&&(n.style.width="0x7fffffffpx");for(var r=i.getLineCount(),a=0;r>a;a++){var l=this._getLine(a),d=l.getBoundingClientRect();e=Math.max(e,d.right-d.left),t+=d.bottom-d.top,l.destroy()}s.isWebkit&&(n.style.width=o);var c=this._getViewPadding();return e+=c.right+c.left+this._metrics.scrollWidth,t+=c.bottom+c.top+this._metrics.scrollWidth,{width:e,height:t}},convert:function(e,t,i){if(!this._clientDiv)return e;var n=this._getScroll(),o=this._getViewPadding(),r=this._viewDiv.getBoundingClientRect();return"document"===t&&(void 0!==e.x&&(e.x+=-n.x+r.left+o.left),void 0!==e.y&&(e.y+=-n.y+r.top+o.top)),"document"===i&&(void 0!==e.x&&(e.x+=n.x-r.left-o.left),void 0!==e.y&&(e.y+=n.y-r.top-o.top)),e},copy:function(){return this._clientDiv?this._doCopy():!1},cut:function(){return this._clientDiv?this._doCut():!1},destroy:function(){for(var e=0;ei)return!1;var n=this._getLine(i),o=this.getOffsetAtLocation(e,t),r=n.getBoundingClientRect(o);return n.destroy(),e>r.right?!1:!0},getLinePixel:function(e){return this._clientDiv?this._getLinePixel(e):0},getLocationAtOffset:function(e){if(!this._clientDiv)return{x:0,y:0};var t=this._model;e=Math.min(Math.max(0,e),t.getCharCount());var i=t.getLineAtOffset(e),n=this._getLine(i),o=n.getBoundingClientRect(e);n.destroy();var r=o.left,s=this._getLinePixel(i)+o.top;return{x:r,y:s}},getNextOffset:function(e,t){var i=new x(e,e,!1);return this._doMove(t,i),i.getCaret()},getOptions:function(){var e;if(0===arguments.length)e=this._defaultOptions();else if(1===arguments.length){var t=arguments[0];if("string"==typeof t)return u(this["_"+t]);e=t}else{e={};for(var i in arguments)arguments.hasOwnProperty(i)&&(e[arguments[i]]=void 0)}for(var n in e)e.hasOwnProperty(n)&&(e[n]=u(this["_"+n]));return e},getModel:function(){return this._model},getOffsetAtLocation:function(e,t){if(!this._clientDiv)return 0;var i=this._getLineIndex(t),n=this._getLine(i),o=n.getOffset(e,t-this._getLinePixel(i));return n.destroy(),o},getLineAtOffset:function(e){return this.getModel().getLineAtOffset(e)},getLineStart:function(e){return this.getModel().getLineStart(e)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){return this._getSelection()},getSelections:function(){return this._getSelections()},getSelectionText:function(e){var t=[],i=this,n=this._getSelections();return n.forEach(function(e){e.isEmpty()||t.push(i._getBaseText(e.start,e.end))}),t.join(void 0!==e?e:this._model.getLineDelimiter())},getText:function(e,t){var i=this._model;return i.getText(e,t)},getTopIndex:function(e){return this._clientDiv?this._getTopIndex(e):0},getTopPixel:function(){return this._clientDiv?this._getScroll().y:0},invokeAction:function(e,t,i){if(this._clientDiv){var n=this._actions[e];if(n){if(n.actionDescription&&n.actionDescription.id&&l.logEvent("editor","action",n.actionDescription.id),!t&&n.handler&&n.handler(i))return!0;if(n.defaultHandler)return"boolean"==typeof n.defaultHandler(i)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(e){return this.dispatchEvent(e)},onDragStart:function(e){return this.dispatchEvent(e)},onDrag:function(e){return this.dispatchEvent(e)},onDragEnd:function(e){return this.dispatchEvent(e)},onDragEnter:function(e){return this.dispatchEvent(e)},onDragOver:function(e){return this.dispatchEvent(e)},onDragLeave:function(e){return this.dispatchEvent(e)},onDrop:function(e){return this.dispatchEvent(e)},onDestroy:function(e){return this.dispatchEvent(e)},onSaving:function(e){return this.dispatchEvent(e)},onInputChanged:function(e){return this.dispatchEvent(e)},onLineStyle:function(e){return this.dispatchEvent(e)},onKeyDown:function(e){return this.dispatchEvent(e)},onKeyPress:function(e){return this.dispatchEvent(e)},onKeyUp:function(e){return this.dispatchEvent(e)},onModelChanged:function(e){return this.dispatchEvent(e)},onModelChanging:function(e){return this.dispatchEvent(e)},onModify:function(e){return this.dispatchEvent(e)},onMouseDown:function(e){return this.dispatchEvent(e)},onMouseUp:function(e){return this.dispatchEvent(e)},onMouseMove:function(e){return this.dispatchEvent(e)},onMouseOver:function(e){return this.dispatchEvent(e)},onMouseOut:function(e){return this.dispatchEvent(e)},onTouchStart:function(e){return this.dispatchEvent(e)},onTouchMove:function(e){return this.dispatchEvent(e)},onTouchEnd:function(e){return this.dispatchEvent(e)},onOptions:function(e){return this.dispatchEvent(e)},onSelection:function(e){return this.dispatchEvent(e)},onScroll:function(e){return this.dispatchEvent(e)},onVerify:function(e){return this.dispatchEvent(e)},onFocus:function(e){return this.dispatchEvent(e)},onBlur:function(e){return this.dispatchEvent(e)},paste:function(){return this._clientDiv?this._doPaste():!1},redraw:function(){if(!(this._redrawCount>0)){var e=this._model.getLineCount();this.redrawRulers(0,e),this.redrawLines(0,e)}},redrawRulers:function(e,t){if(!(this._redrawCount>0))for(var i=this.getRulers(),n=0;n0)&&(void 0===e&&(e=0),void 0===t&&(t=this._model.getLineCount()),e!==t)){var n=this._clientDiv;if(n){if(i){var o=this._getRulerParent(i);for(n=o.firstChild;n&&n._ruler!==i;)n=n.nextSibling}i?n.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(e,t);var r=-1;if(i||-1===this._imeOffset||(r=this._model.getLineAtOffset(this._imeOffset)),!i||"page"===i.getOverview())for(var s=n.firstChild;s;){var a=s.lineIndex;a>=e&&t>a&&a!==r&&(s.lineChanged=!0),s=s.nextSibling}i||this._wrapMode||e<=this._maxLineIndex&&this._maxLineIndex0)){var i=this._model;void 0===e&&(e=0),void 0===t&&(t=i.getCharCount());var n=i.getLineAtOffset(e),o=i.getLineAtOffset(Math.max(e,t-1))+1;this.redrawLines(n,o)}},removeKeyMode:function(e){for(var t=this._keyModes,i=0;it;if(o){var r=e;e=t,t=r}var s=this._model.getCharCount();e=Math.max(0,Math.min(e,s)),t=Math.max(0,Math.min(t,s));var a=new x(e,t,o);this._setSelection(a,void 0===i||i,!0,n)},setSelections:function(e,t,i){var n=this._rangesToSelections(e);this._setSelection(n,void 0===t||t,!0,i)},setText:function(e,t,i,n,o){var r,a="string"==typeof e,l=void 0===t&&void 0===i&&a;a?(void 0===t&&(t=0),void 0===i&&(i=this._model.getCharCount()),r={text:e,selection:[new x(t,i,!1)]}):(r=e,r.selection=this._rangesToSelections(r.selection)),r._code=!0,l&&(this._variableLineHeight=!1),this._modifyContent(r,!l,void 0===n||n,o),l&&s.isFirefox<13&&this._fixCaret()},setTopIndex:function(e,t){this._clientDiv&&this._scrollViewAnimated(0,this._getLinePixel(Math.max(0,e))-this._getScroll().y,t)},setTopPixel:function(e,t){this._clientDiv&&this._scrollViewAnimated(0,Math.max(0,e)-this._getScroll().y,t)},showSelection:function(e,t){return this._showCaret(e?!1:!0,t,e)},update:function(e,t){this._clientDiv&&((e||this._metrics.invalid)&&this._updateStyle(),void 0===t||t?this._update():this._queueUpdate())},_handleRootMouseDown:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)){s.isFirefox<13&&1===e.which&&(this._clientDiv.contentEditable=!1,(this._overlayDiv||this._clientDiv).draggable=!0,this._ignoreBlur=!0);var t=this._overlayDiv||this._clientDiv;s.isIE<9&&(t=this._viewDiv);for(var i=e.target?e.target:e.srcElement;i;){if(t===i)return;if(i.className&&-1!==i.className.indexOf("textViewFind"))return;i=i.parentNode}if(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!this._isW3CEvents){var n=this,o=this._getWindow();o.setTimeout(function(){n._clientDiv.focus()},0)}}},_handleRootMouseUp:function(e){this._ignoreEvent(e)||(s.isFirefox<13&&1===e.which&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1),s.isFirefox&&1===e.which&&(this._fixCaret(),this._ignoreBlur=!1))},_handleBlur:function(){if(this._cancelCheckSelection(),!this._ignoreBlur){if(this._commitIME(),this._hasFocus=!1,s.isIE<9&&!this._getSelections()[0].isEmpty()){var e=this._rootDiv,t=s.createElement(e.ownerDocument,"div");e.appendChild(t),e.removeChild(t)}if(this._cursorDiv&&(this._cursorDiv.style.display="none"),this._domSelection){this._domSelection.forEach(function(e){e.update()});var i,n=this._getWindow(),o=this._parent.ownerDocument;if(n.getSelection){var r=n.getSelection();for(i=r.anchorNode;i;){if(i===this._clientDiv){r.rangeCount>0&&r.removeAllRanges();break}i=i.parentNode}}else if(o.selection){for(this._ignoreSelect=!1,i=o.selection.createRange().parentElement();i;){if(i===this._clientDiv){o.selection.empty();break}i=i.parentNode}this._ignoreSelect=!0}}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleCompositionStart:function(e){if(!this._ignoreEvent(e)){if(this._imeTimeout){var t=this._getWindow();t.clearTimeout(this._imeTimeout),this._imeTimeout=null}this._imeText&&(this._commitIME(this._imeText),this._imeText=null),this._startIME(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)}},_handleCompositionUpdate:function(e){this._ignoreEvent(e)||(this._imeText=e.data)},_handleCompositionEnd:function(e){if(!this._ignoreEvent(e)){this._imeText=e.data;var t=this._getWindow();this._imeTimeout=t.setTimeout(function(){this._commitIME(this._imeText),this._imeText=this._imeTimeout=null}.bind(this),0)}},_handleContextMenu:function(e){if(!this._ignoreEvent(e)){s.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var t=!1;if(this.isListening("ContextMenu")){var i=this._createMouseEvent("ContextMenu",e);i.screenX=e.screenX,i.screenY=e.screenY,this.onContextMenu(i),t=i.defaultPrevented}else s.isMac&&s.isFirefox&&0===e.button&&(t=!0);return t?(e.preventDefault&&e.preventDefault(),!1):(this._contextMenuOpen=!0,void(s.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))))}},_handleCopy:function(e){return this._cancelCheckSelection(),this._ignoreEvent(e)||this._ignoreCopy?void 0:this._doCopy(e)?(e.preventDefault&&e.preventDefault(),!1):void 0},_handleCut:function(e){return this._cancelCheckSelection(),this._ignoreEvent(e)?void 0:this._doCut(e)?(e.preventDefault&&e.preventDefault(),!1):void 0},_handleDataModified:function(e){this._ignoreEvent(e)||this._startIME()},_handleDblclick:function(e){if(!this._ignoreEvent(e)){var t=e.timeStamp?e.timeStamp:(new Date).getTime();this._lastMouseTime=t,2!==this._clickCount&&(this._clickCount=2,this._handleMouse(e))}},_handleDragStart:function(e){if(!this._ignoreEvent(e)){if(s.isFirefox<13){var t=this,i=this._getWindow();i.setTimeout(function(){t._clientDiv.contentEditable=!0,t._clientDiv.draggable=!1,t._ignoreBlur=!1},0)}return this.isListening("DragStart")&&-1!==this._dragOffset?(this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",e)),this._dragOffset=-1,void 0):(e.preventDefault&&e.preventDefault(),!1)}},_handleDrag:function(e){this._ignoreEvent(e)||this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",e))},_handleDragEnd:function(e){this._ignoreEvent(e)||(this._dropTarget=!1,this._dragOffset=-1,this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",e)),s.isFirefox<13&&(this._fixCaret(),"none"!==e.dataTransfer.dropEffect||e.dataTransfer.mozUserCancelled||this._fixCaret()))},_handleDragEnter:function(e){if(!this._ignoreEvent(e)){var t=!0;return this._dropTarget=!0,this.isListening("DragEnter")&&(t=!1,this.onDragEnter(this._createMouseEvent("DragEnter",e))),s.isWebkit||t?(e.preventDefault&&e.preventDefault(),!1):void 0}},_handleDragOver:function(e){if(!this._ignoreEvent(e)){var t=!0;return this.isListening("DragOver")&&(t=!1,this.onDragOver(this._createMouseEvent("DragOver",e))),s.isWebkit||t?(t&&(e.dataTransfer.dropEffect="none"),e.preventDefault&&e.preventDefault(),!1):void 0}},_handleDragLeave:function(e){this._ignoreEvent(e)||(this._dropTarget=!1,this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",e)))},_handleDrop:function(e){return this._ignoreEvent(e)?void 0:(this._dropTarget=!1,this.isListening("Drop")&&this.onDrop(this._createMouseEvent("Drop",e)),e.preventDefault&&e.preventDefault(),!1)},_handleFocus:function(){this._hasFocus=!0,s.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection(),this._cursorDiv&&(this._cursorDiv.style.display="block"),this._domSelection&&this._domSelection.forEach(function(e){e.update()}),this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)){if(this.isListening("KeyDown")){var t=this._createKeyEvent("KeyDown",e);if(this.onKeyDown(t),t.defaultPrevented)return s.isFirefox&&(this._keyDownPrevented=!0),void e.preventDefault()}var i=!1;switch(e.keyCode){case 16:case 17:case 18:case 91:i=!0;break;default:this._setLinksVisible(!1)}if(229===e.keyCode){if(this._readonly)return e.preventDefault&&e.preventDefault(),!1;var n=!0;s.isSafari&&s.isMac&&e.ctrlKey&&(n=!1,e.keyCode=129),n&&this._startIME()}else i||this._commitIME();return(s.isMac||s.isLinux)&&s.isFirefox<4||s.isOpera<12.16?(this._keyDownEvent=e,!0):this._doAction(e)?(e.preventDefault?(e.preventDefault(),e.stopPropagation()):(e.cancelBubble=!0,e.returnValue=!1,e.keyCode=0),!1):void 0}},_handleKeyPress:function(e){if(!this._ignoreEvent(e)){if(this._keyDownPrevented)return e.preventDefault&&(e.preventDefault(),e.stopPropagation()),void(this._keyDownPrevented=void 0);if(s.isMac&&s.isWebkit&&(63232<=e.keyCode&&e.keyCode<=63487||13===e.keyCode||8===e.keyCode))return e.preventDefault&&e.preventDefault(),!1;if(((s.isMac||s.isLinux)&&s.isFirefox<4||s.isOpera<12.16)&&this._doAction(this._keyDownEvent))return e.preventDefault&&e.preventDefault(),!1;var t=s.isMac?e.metaKey:e.ctrlKey;if(void 0!==e.charCode&&t)switch(e.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")){var i=this._createKeyEvent("KeyPress",e);if(this.onKeyPress(i),i.defaultPrevented)return void e.preventDefault()}if(this._doAction(e))return e.preventDefault?(e.preventDefault(),e.stopPropagation()):(e.cancelBubble=!0,e.returnValue=!1,e.keyCode=0),!1;var n=!1;if(s.isMac?(e.ctrlKey||e.metaKey)&&(n=!0):s.isFirefox?(e.ctrlKey||e.altKey)&&(n=!0):e.ctrlKey^e.altKey&&(n=!0),!n){var o=s.isOpera?e.which:void 0!==e.charCode?e.charCode:e.keyCode;if(o>31)return this._doContent(String.fromCharCode(o)),e.preventDefault&&e.preventDefault(),!1}}},_handleDocKeyUp:function(e){var t=s.isMac?e.metaKey:e.ctrlKey;t||this._setLinksVisible(!1)},_handleKeyUp:function(e){if(!this._ignoreEvent(e)){if(this.isListening("KeyUp")){var t=this._createKeyEvent("KeyUp",e);if(this.onKeyUp(t),t.defaultPrevented)return void e.preventDefault()}this._handleDocKeyUp(e),13===e.keyCode&&this._commitIME()}},_handleLinkClick:function(e){var t=s.isMac?e.metaKey:e.ctrlKey;return t?void 0:(e.preventDefault&&e.preventDefault(),!1)},_handleMouse:function(e){var t=this._getWindow(),i=!0,n=t;if((s.isIE||s.isFirefox&&!this._overlayDiv)&&(n=this._clientDiv),this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var o=this;t.setTimeout(function(){o.focus(),o._ignoreFocus=!1},0)}var r=e.shiftKey,a=e.altKey,l=s.isMac?e.metaKey:e.ctrlKey;if(this._blockSelection=this._doubleClickSelection=null,1===this._clickCount){var d=(!s.isOpera||s.isOpera>=12.16)&&this._hasFocus&&this.isListening("DragStart");i=this._setSelectionTo(e.clientX,e.clientY,!0,r,l,d),i&&this._setGrab(n)}else this._isW3CEvents&&this._setGrab(n),this._setSelectionTo(e.clientX,e.clientY,!0,r,l,!1),this._doubleClickSelection=x.editing(this._getSelections());return a&&(this._blockSelection=x.editing(this._getSelections())),i},_handleMouseDown:function(e){if(!this._ignoreEvent(e)){if(this._linksVisible){var t=e.target||e.srcElement;if("A"===t.tagName)return;this._setLinksVisible(!1)}this._commitIME();var i=e.which;i||(4===e.button&&(i=2),2===e.button&&(i=3),1===e.button&&(i=1));var n=2!==i&&e.timeStamp?e.timeStamp:(new Date).getTime(),o=n-this._lastMouseTime,r=Math.abs(this._lastMouseX-e.clientX),a=Math.abs(this._lastMouseY-e.clientY),l=this._lastMouseButton===i;if(this._lastMouseX=e.clientX,this._lastMouseY=e.clientY,this._lastMouseTime=n,this._lastMouseButton=i,1===i&&(this._isMouseDown=!0,l&&o<=this._clickTime&&r<=this._clickDist&&a<=this._clickDist?this._clickCount++:this._clickCount=1),this.isListening("MouseDown")){var d=this._createMouseEvent("MouseDown",e);if(this.onMouseDown(d),d.defaultPrevented)return void e.preventDefault()}1===i&&this._handleMouse(e)&&(s.isIE>=9||s.isOpera||s.isChrome||s.isSafari||s.isFirefox&&!this._overlayDiv)&&(this._hasFocus||this.focus(),e.preventDefault()),s.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(e){this._ignoreEvent(e)||this._animation||this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",e))},_handleMouseOut:function(e){this._ignoreEvent(e)||this._animation||this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",e))},_handleMouseMove:function(e){if(!this._animation){var t=this._isClientDiv(e);if(this.isListening("MouseMove")&&(t||this._isMouseDown)){var i=this._createMouseEvent("MouseMove",e);if(this.onMouseMove(i),i.defaultPrevented)return void e.preventDefault()}if(!this._dropTarget){var n=this._linksVisible||this._lastMouseMoveX!==e.clientX||this._lastMouseMoveY!==e.clientY;if(this._lastMouseMoveX=e.clientX,this._lastMouseMoveY=e.clientY,this._setLinksVisible(n&&!this._isMouseDown&&e.altKey&&(s.isMac?e.metaKey:e.ctrlKey)),this._checkOverlayScroll(),!this._isW3CEvents){if(0===e.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===e.button&&0!==(1&this._clickCount)&&t)return this._clickCount=2,this._handleMouse(e,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){var o=e.clientX,r=e.clientY,a=this._getViewPadding(),l=this._viewDiv.getBoundingClientRect(),d=this._getClientWidth(),c=this._getClientHeight(),h=l.left+a.left,u=l.top+a.top,p=l.left+a.left+d,f=l.top+a.top+c;u>r?this._doAutoScroll("up",o,r-u):r>f?this._doAutoScroll("down",o,r-f):h>o&&!this._wrapMode?this._doAutoScroll("left",o-h,r):o>p&&!this._wrapMode?this._doAutoScroll("right",o-p,r):(this._endAutoScroll(),this._setSelectionTo(o,r,!1,!0))}}}},_isClientDiv:function(e){for(var t=this._overlayDiv||this._clientDiv,i=e.target?e.target:e.srcElement;i;){if(t===i)return!0;i=i.parentNode}return!1},_createKeyEvent:function(e,t){return{type:e,event:t,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(e,t){var i=this.convert({x:t.clientX,y:t.clientY},"page","document"); -return{type:e,event:t,clickCount:this._clickCount,x:i.x,y:i.y,preventDefault:function(){this.defaultPrevented=!0}}},_createTouchEvent:function(e,t){var i=t.touches.length?this.convert({x:t.touches[0].clientX,y:t.touches[0].clientY},"page","document"):{};return{type:e,event:t,touchCount:t.touches.length,x:i.x,y:i.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(e){var t=e.which?0===e.button:1===e.button;if(this.isListening("MouseUp")&&(this._isClientDiv(e)||t&&this._isMouseDown)){var i=this._createMouseEvent("MouseUp",e);if(this.onMouseUp(i),i.defaultPrevented)return e.preventDefault(),void(this._isMouseDown=!1)}if(!this._linksVisible){if(t&&this._isMouseDown){var n=this._getSelections(),o=x.editing(n);n.forEach(function(e){e._editing=!1}),-1!==this._dragOffset&&(o.extend(this._dragOffset),o.collapse(),n=o,this._dragOffset=-1),this._setSelection(n,!1),this._isMouseDown=!1,this._endAutoScroll(),this._isW3CEvents&&this._setGrab(null)}t&&this._isMouseDown&&s.isFirefox&&(this._updateDOMSelection(),e.preventDefault())}},_handleMouseWheel:function(e){if(!this._noScroll){var t=this._getLineHeight(),i=0,n=0;if(s.isIE||s.isOpera)n=-e.wheelDelta/40*t;else if(s.isFirefox){var o=256;if("wheel"===e.type)e.deltaMode?(i=Math.max(-o,Math.min(o,e.deltaX))*t,n=Math.max(-o,Math.min(o,e.deltaY))*t):(i=e.deltaX,n=e.deltaY);else{var r;r=s.isMac?3*e.detail:Math.max(-o,Math.min(o,e.detail))*t,e.axis===e.HORIZONTAL_AXIS?i=r:n=r}}else if(s.isMac){var a,l,d=e.timeStamp-this._wheelTimeStamp;this._wheelTimeStamp=e.timeStamp,a=e.wheelDeltaX%120!==0?1:40>d?40/(40-d):40,l=e.wheelDeltaY%120!==0?1:40>d?40/(40-d):40,i=Math.ceil(-e.wheelDeltaX/a),i>-1&&0>i&&(i=-1),i>0&&1>i&&(i=1),n=Math.ceil(-e.wheelDeltaY/l),n>-1&&0>n&&(n=-1),n>0&&1>n&&(n=1)}else{i=-e.wheelDeltaX;var c=8;n=-e.wheelDeltaY/120*c*t}if(s.isSafari||s.isChrome&&s.isMac){for(var h=e.target;h&&void 0===h.lineIndex;)h=h.parentNode;this._mouseWheelLine=h}var u=this._getScroll();this._scrollView(i,n);var p=this._getScroll();return u.x!==p.x||u.y!==p.y?(e.preventDefault&&e.preventDefault(),!1):void 0}},_handlePaste:function(e){if(this._cancelCheckSelection(),!this._ignoreEvent(e)&&!this._ignorePaste&&this._doPaste(e)){if(s.isIE){var t=this;this._ignoreFocus=!0;var i=this._getWindow();i.setTimeout(function(){t._updateDOMSelection(),t._ignoreFocus=!1},0)}return e.preventDefault&&e.preventDefault(),!1}},_handleResize:function(){var e=this._rootDiv.clientWidth,t=this._rootDiv.clientHeight;if(this._rootWidth!==e||this._rootHeight!==t){this._rootWidth!==e&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=e,this._rootHeight=t;var i=s.isIE<9,n=this._calculateMetrics();f(n,this._metrics)||(this._metrics.invalid&&!n.invalid?this._updateStyle(!1,n):(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=n),i=!0),i?this._queueUpdate():this._update(),this.dispatchEvent({type:"Resize"})}},_handleRulerEvent:function(e){for(var t=e.target?e.target:e.srcElement,i=t.lineIndex,n=t;n&&!n._ruler;)void 0===i&&void 0!==n.lineIndex&&(i=n.lineIndex),n=n.parentNode;var o=n?n._ruler:null;if(void 0===i&&o&&"document"===o.getOverview()){var r,s,a=this._getClientHeight(),l=this._model.getLineCount(),d=this._getViewPadding(),c=this._viewDiv.getBoundingClientRect(),h=this._getLineHeight(),u=h*l,p=a+d.top+d.bottom-2*this._metrics.scrollWidth;p>u?(r=h,s=d.top):(r=p/l,s=this._metrics.scrollWidth),i=Math.floor((e.clientY-c.top-s)/r),i>=0&&l>i||(i=void 0)}if(o)switch(e.type){case"click":o.onClick&&o.onClick(i,e);break;case"dblclick":o.onDblClick&&o.onDblClick(i,e);break;case"mousemove":o.onMouseMove&&o.onMouseMove(i,e);break;case"mouseover":o.onMouseOver&&o.onMouseOver(i,e);break;case"mouseout":if(o.onMouseOut){for(var f=e.relatedTarget;f&&f!==this._rootDiv;){if(f===n)return;f=f.parentNode}o.onMouseOut(i,e)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var e=this._getScroll(!1),t=this._hScroll,i=this._vScroll;if(t!==e.x||i!==e.y){this._hScroll=e.x,this._vScroll=e.y,this._commitIME(),this._update(i===e.y);var n={type:"Scroll",oldValue:{x:t,y:i},newValue:e};this.onScroll(n)}},_handleSelectStart:function(e){var t=this._contextMenuOpen;return this._contextMenuOpen=!1,t?void(this._checkSelectionChange=!0):this._ignoreSelect?(e&&e.preventDefault&&e.preventDefault(),!1):void 0},_getModelOffset:function(e,t){if(e){var i;return i="DIV"===e.tagName?e:e.parentNode.parentNode,i._line?i._line.getModelOffset(e,t):0}},_updateSelectionFromDOM:function(){if(!(s.isIOS||s.isAndroid||this._checkSelectionChange))return!1;var e=this._getWindow(),t=e.getSelection(),i=this._getModelOffset(t.anchorNode,t.anchorOffset),n=this._getModelOffset(t.focusNode,t.focusOffset),o=this._getSelections()[0];if(void 0===i||void 0===n||o.start===i&&o.end===n)return!1;if(this._checkSelectionChange){var r=this._getLineNext(),a=this._getLinePrevious();if(t.anchorNode===r.firstChild.firstChild&&0===t.anchorOffset&&t.focusNode===a.firstChild.firstChild&&0===t.focusOffset)return!1;(t.anchorNode===r.firstChild.firstChild&&0===t.anchorOffset&&t.focusNode===a.lastChild.firstChild||t.anchorNode===this._clientDiv&&t.focusNode===this._clientDiv)&&(i=0,n=this.getModel().getCharCount())}return this._setSelection(new x(i,n),!1,!1),this._checkSelectionChange=!1,!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){if(this._selPollTimer){var e=this._getWindow();e.clearTimeout(this._selPollTimer),this._selPollTimer=null}},_pollSelectionChange:function(e){var t=this,i=this._getWindow();this._cancelPollSelectionChange(),this._selPollTimer=i.setTimeout(function(){if(t._selPollTimer=null,t._clientDiv){var i=t._updateSelectionFromDOM();!i&&e&&t._pollSelectionChange(e)}},100)},_handleSelectionChange:function(){-1===this._imeOffset&&(s.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(e){if(!this._ignoreEvent(e)&&-1===this._imeOffset){var t=this._getWindow().getSelection();if(t.anchorNode!==this._anchorNode||t.focusNode!==this._focusNode||t.anchorOffset!==this._anchorOffset||t.focusOffset!==this._focusOffset){for(var i=t.anchorNode;i&&void 0===i.lineIndex;)i=i.parentNode;if(i){var n=this._model,o=i.lineIndex,r=n.getLine(o),s=r,a=0,l=n.getLineStart(o);if(t.rangeCount>0){t.getRangeAt(0).deleteContents();var d=i.ownerDocument.createTextNode(e.data);t.getRangeAt(0).insertNode(d);var c=this._getDOMText(i,d);s=c.text,a=c.offset,d.parentNode.removeChild(d)}i.lineRemoved=!0;for(var h=0;r.charCodeAt(h)===s.charCodeAt(h)&&a>h;)h++;for(var u=r.length-1,p=s.length-r.length;r.charCodeAt(u)===s.charCodeAt(u+p)&&u+p>=a+e.data.length;)u--;u++;var f=s.substring(h,u+p);h+=l,u+=l;var g=this._getSelections(),_=g[0].start-h,m=g[0].end-u;g[0].start=h,g[0].end=u;for(var v=1;v=0;i--)if(t=n[i],"function"==typeof t.match){var o=t.match(e);if(void 0!==o)return this.invokeAction(o)}return!1},_doMove:function(e,t){var i=this._model,n=t.getCaret(),o=i.getLineAtOffset(n);for(e.count||(e.count=1);0!==e.count;){var r=i.getLineStart(o);if(e.count<0&&n===r){if(!(o>0))break;"character"===e.unit&&e.count++,o--,t.extend(i.getLineEnd(o))}else if(e.count>0&&n===i.getLineEnd(o)){if(!(o+10&&(r=Math.min(r+e.count-1,t.getLineCount()-1)),o=t.getLineEnd(r);n.extend(o)}e.select||n.collapse()}),this._setSelection(n,!0,!0,e.ctrl?function(){}:null),!0},_doEnter:function(e){if(this._singleMode)return!0;var t=this._model,i=this._getSelections();return this._doContent(t.getLineDelimiter()),e&&e.noCursor&&(i.forEach(function(e){e.end=e.start}),this._setSelection(i,!0)),!0},_doEscape:function(){var e=this._getSelections();return e.length>1&&this._setSelection(e[0],!0),!0},_doHome:function(e){var t=this._model,i=this,n=this._getSelections();return n.forEach(function(n){if(e.ctrl)n.extend(0);else{var o=n.getCaret(),r=t.getLineAtOffset(o);if(i._wrapMode){var s=i._getLine(r),a=s.getLineIndex(o);o=s.getLineStart(a),s.destroy()}else o=t.getLineStart(r);n.extend(o)}e.select||n.collapse()}),this._setSelection(n,!0,!0,e.ctrl?function(){}:null),!0},_doLineDown:function(e){var t=this._model,i=this,n=this._getSelections();return n.forEach(function(n){var o,r=n.getCaret(),a=t.getLineAtOffset(r),l=i._getLine(a),d=n._columnX,c=1,h=!1;if(-1===d||e.wholeLine||e.select&&s.isIE){var u=e.wholeLine?t.getLineEnd(a+1):r;d=n._columnX=l.getBoundingClientRect(u).left}if((o=l.getLineIndex(r))0?a=Math.min(a+e.count,p):a++}var f=!1;h?(e.select||s.isMac||s.isLinux)&&(n.extend(t.getCharCount()),f=!0):(l.lineIndex!==a&&(l.destroy(),l=i._getLine(a)),n.extend(l.getOffset(d,c)),f=!0),f&&(e.select||n.collapse()),l.destroy()}),i._setSelection(n,!0,!0,null,0,!1,!0),!0},_doLineUp:function(e){var t=this._model,i=this,n=this._getSelections();return n.forEach(function(n){var o,r,a=n.getCaret(),l=t.getLineAtOffset(a),d=i._getLine(l),c=n._columnX,h=!1;if(-1===c||e.wholeLine||e.select&&s.isIE){var u=e.wholeLine?t.getLineStart(l-1):a;c=n._columnX=d.getBoundingClientRect(u).left}(o=d.getLineIndex(a))>0?r=d.getClientRects(o-1).top+1:(h=0===l,h||(e.count&&e.count>0?l=Math.max(l-e.count,0):l--,r=i._getLineHeight(l)-1));var p=!1;h?(e.select||s.isMac||s.isLinux)&&(n.extend(0),p=!0):(d.lineIndex!==l&&(d.destroy(),d=i._getLine(l)),n.extend(d.getOffset(c,r)),p=!0),p&&(e.select||n.collapse()),d.destroy()}),i._setSelection(n,!0,!0,null,0,!1,!0),!0},_doNoop:function(){return!0},_doPageDown:function(e){var t,i,n,o=this,r=this._model,a=this._getSelections(),l=r.getLineCount(),d=this._getScroll(),c=this._getClientHeight(),h=this._getLineHeight(),u=Math.floor(c/h);return a.forEach(function(a){var p=a.getCaret(),f=r.getLineAtOffset(p);if(o._lineHeight){t=a._columnX;var g=o._getBoundsAtOffset(p);(-1===t||e.select&&s.isIE)&&(t=a._columnX=g.left);var _=o._getLineIndex(g.top+c);i=o._getLine(_);var m=o._getLinePixel(_),v=g.top+c-m;p=i.getOffset(t,v);var y=i.getBoundingClientRect(p);i.destroy(),a.extend(p),e.select||a.collapse(),n=void 0!==n?Math.min(n,y.top+m-g.top):y.top+m-g.top}else if(l-1>f){var x=Math.min(l-f-1,u);x=Math.max(1,x),t=a._columnX,(-1===t||e.select&&s.isIE)&&(i=o._getLine(f),t=a._columnX=i.getBoundingClientRect(p).left,i.destroy()),i=o._getLine(f+x),a.extend(i.getOffset(t,0)),i.destroy(),e.select||a.collapse();var b=l*h,w=d.y+x*h;w+c>b&&(w=b-c),n=void 0!==n?Math.min(n,w-d.y):w-d.y}}),this._setSelection(a,!0,!0,function(){},n,!1,!0),!0},_doPageUp:function(e){var t,i,n,o=this,r=this._model,a=this._getSelections(),l=this._getScroll(),d=this._getClientHeight(),c=this._getLineHeight(),h=Math.floor(d/c);return a.forEach(function(a){var u=a.getCaret(),p=r.getLineAtOffset(u);if(o._lineHeight){t=a._columnX;var f=o._getBoundsAtOffset(u);(-1===t||e.select&&s.isIE)&&(t=a._columnX=f.left);var g=o._getLineIndex(f.bottom-d);i=o._getLine(g);var _=o._getLinePixel(g),m=f.bottom-d-_;u=i.getOffset(t,m);var v=i.getBoundingClientRect(u);i.destroy(),a.extend(u),e.select||a.collapse(),n=void 0!==n?Math.max(n,v.top+_-f.top):v.top+_-f.top}else if(p>0){var y=Math.max(1,Math.min(p,h));t=a._columnX,(-1===t||e.select&&s.isIE)&&(i=o._getLine(p),t=a._columnX=i.getBoundingClientRect(u).left,i.destroy()),i=o._getLine(p-y),a.extend(i.getOffset(t,o._getLineHeight(p-y)-1)),i.destroy(),e.select||a.collapse();var x=Math.max(0,l.y-y*c);n=void 0!==n?Math.max(n,x-l.y):x-l.y}}),this._setSelection(a,!0,!0,function(){},n,!1,!0),!0},_doPaste:function(e){var t=this,i=this._getClipboardText(e,function(e){if(e.length){if(s.isLinux&&2===t._lastMouseButton){var i=(new Date).getTime()-t._lastMouseTime;i<=t._clickTime&&t._setSelectionTo(t._lastMouseX,t._lastMouseY,!0)}var n=t._getSelections(),o=t._singleMode?"":t._model.getLineDelimiter();t._doContent(n.length>1&&n.length===e.length?e:e.join(o))}});return null!==i},_doScroll:function(e){var t,i=e.type,n=this._model,o=n.getLineCount(),r=this._getClientHeight(),s=this._getLineHeight(),a=this._lineHeight?this._scrollHeight:o*s,l=this._getScroll().y;switch(i){case"textStart":t=0;break;case"textEnd":t=a-r;break;case"pageDown":t=l+r;break;case"pageUp":t=l-r;break;case"lineDown":t=l+s;break;case"lineUp":t=l-s;break;case"centerLine":var d=this._getSelections()[0],c=n.getLineAtOffset(d.start),h=n.getLineAtOffset(d.end),u=(h-c+1)*s;t=c*s-r/2+u/2}return void 0!==t&&(t=Math.min(Math.max(0,t),a-r),this._scrollViewAnimated(0,t-l,function(){})),!0},_doSelectAll:function(){var e=this._model;return this._setSelection(new x(0,e.getCharCount()),!1),!0},_doTab:function(){if(this._tabMode&&!this._readonly){var e=" ",t=this._getSelections();if(this._expandTab){e=[];var i=this._model,n=this._tabSize;t.forEach(function(t){var o=t.getCaret(),r=i.getLineAtOffset(o),s=i.getLineStart(r),a=n-(o-s)%n;e.push(c(a+1).join(" "))})}return this._modifyContent({text:e,selection:t,_ignoreDOMSelection:!0},!0)}},_doShiftTab:function(){return this._tabMode&&!this._readonly?!0:void 0},_doOverwriteMode:function(){return this._readonly?void 0:(this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0)},_doTabMode:function(){return this.setOptions({tabMode:!this.getOptions("tabMode")}),!0},_doWrapMode:function(){return this.setOptions({wrapMode:!this.getOptions("wrapMode")}),!0},_autoScroll:function(){var e,t,i=this._model,n=this._getSelections(),o=x.editing(n,"down"===this._autoScrollDir),r=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),a=o.getCaret(),l=i.getLineCount(),d=i.getLineAtOffset(a);if("up"===this._autoScrollDir||"down"===this._autoScrollDir){var c=this._autoScrollY/this._getLineHeight();c=0>c?Math.floor(c):Math.ceil(c),e=d,e=Math.max(0,Math.min(l-1,e+c))}else("left"===this._autoScrollDir||"right"===this._autoScrollDir)&&(e=this._getLineIndex(r.y),t=this._getLine(d),r.x+=t.getBoundingClientRect(a,!1).left,t.destroy());this._blockSelection?n=this._getBlockSelections(n,e,r):0===e&&(s.isMac||s.isLinux)?o.extend(0):e===l-1&&(s.isMac||s.isLinux)?o.extend(i.getCharCount()):(t=this._getLine(e),o.extend(t.getOffset(r.x,r.y-this._getLinePixel(e))),t.destroy()),this._setSelection(n,!0)},_autoScrollTimer:function(){this._autoScroll();var e=this,t=this._getWindow();this._autoScrollTimerID=t.setTimeout(function(){e._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(e){if(this._lineHeight&&!this._calculateLHTimer){var t=this._model.getLineCount(),i=0;if(e){for(var n=0,o=100,r=(new Date).getTime(),s=0;t>i&&(this._lineHeight[i]||(n++,s||(s=i),this._lineHeight[i]=this._calculateLineHeight(i)),i++,!((new Date).getTime()-r>o)););this.redrawRulers(0,t),this._queueUpdate()}var a=this._getWindow();if(i!==t){var l=this;return void(this._calculateLHTimer=a.setTimeout(function(){l._calculateLHTimer=null,l._calculateLineHeightTimer(!0)},0))}this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(e){var t=this._getLine(e),i=t.getBoundingClientRect();return t.destroy(),Math.max(1,i.bottom-i.top)},_calculateMetrics:function(){var e=this._clientDiv,t=e.ownerDocument,i=" ",n=s.createElement(t,"div");n.style.lineHeight="normal";var o=this._model,r=o.getLine(0),a={type:"LineStyle",textView:this,0:0,lineText:r,lineStart:0};this.onLineStyle(a),h(a.style,n),n.style.position="fixed",n.style.left="-1000px";var l=s.createElement(t,"span");l.appendChild(t.createTextNode(i)),n.appendChild(l);var d=s.createElement(t,"span");d.style.fontStyle="italic",d.appendChild(t.createTextNode(i)),n.appendChild(d);var u=s.createElement(t,"span");u.style.fontWeight="bold",u.appendChild(t.createTextNode(i)),n.appendChild(u);var p=s.createElement(t,"span");p.style.fontWeight="bold",p.style.fontStyle="italic",p.appendChild(t.createTextNode(i)),n.appendChild(p),e.appendChild(n);var f=n.getBoundingClientRect(),g=l.getBoundingClientRect(),_=d.getBoundingClientRect(),y=u.getBoundingClientRect(),x=p.getBoundingClientRect(),b=g.bottom-g.top,w=_.bottom-_.top,C=y.bottom-y.top,T=x.bottom-x.top,L=0,k=f.bottom-f.top<=0,D=Math.max(1,f.bottom-f.top);w>b&&(L=1),C>w&&(L=2),T>C&&(L=3);var A;0!==L&&(A={style:{}},0!==(1&L)&&(A.style.fontStyle="italic"),0!==(2&L)&&(A.style.fontWeight="bold"));var S=v(n);e.removeChild(n);var E=m(this._viewDiv),O=s.createElement(t,"div");O.style.position="fixed",O.style.left="-1000px",O.style.paddingLeft=E.left+"px",O.style.paddingTop=E.top+"px",O.style.paddingRight=E.right+"px",O.style.paddingBottom=E.bottom+"px",O.style.width="100px",O.style.height="100px";var N=s.createElement(t,"div");N.style.width="100%",N.style.height="100%",O.appendChild(N),e.appendChild(O);var M=O.getBoundingClientRect(),I=N.getBoundingClientRect(),B=0;if(!this._singleMode&&!this._noScroll){O.style.overflow="hidden",N.style.height="200px";var R=O.clientWidth;O.style.overflow="scroll";var F=O.clientWidth;B=R-F}e.removeChild(O),E={left:I.left-M.left,top:I.top-M.top,right:M.right-I.right,bottom:M.bottom-I.bottom};var P=0,W=0,V=0;return k||(O=s.createElement(t,"div"),O.style.position="fixed",O.style.left="-1000px",e.appendChild(O),O.innerHTML=c(2).join("a"),M=O.getBoundingClientRect(),V=Math.ceil(M.right-M.left),(this._wrapOffset||this._marginOffset)&&(O.innerHTML=c(this._wrapOffset+1+(s.isWebkit?0:1)).join(" "),M=O.getBoundingClientRect(),P=Math.ceil(M.right-M.left),O.innerHTML=c(this._marginOffset+1).join(" "),I=O.getBoundingClientRect(),W=Math.ceil(I.right-I.left)),e.removeChild(O)),{lineHeight:D,largestFontStyle:A,lineTrim:S,viewPadding:E,scrollWidth:B,wrapWidth:P,marginWidth:W,charWidth:V,invalid:k}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(e){var t=this._getSelections();return t.forEach(function(t){"next"===e?t.start=t.end:t.end=t.start}),this._setSelection(t,!0),!0},_commitIME:function(e){if(-1!==this._imeOffset){var t=this._model,i=t.getLineAtOffset(this._imeOffset),n=t.getLineStart(i),o=this._getLineNode(i);if(!e){this._scrollDiv.focus(),this._clientDiv.focus();var r=this._getDOMText(o).text,a=t.getLine(i),l=this._imeOffset-n,d=l+r.length-a.length;l!==d&&(e=r.substring(l,d))}this._imeOffset=-1,e&&(this._doContent(e)||s.isWebkit||(o.lineRemoved=!0,this._queueUpdate()))}},_createActions:function(){this.addKeyMode(new i.DefaultKeyMode(this));var t=this;this._actions={noop:{defaultHandler:function(){return t._doNoop()}},lineUp:{defaultHandler:function(e){return t._doLineUp(p(e,{select:!1}))},actionDescription:{name:e.lineUp}},lineDown:{defaultHandler:function(e){return t._doLineDown(p(e,{select:!1}))},actionDescription:{name:e.lineDown}},lineStart:{defaultHandler:function(e){return t._doHome(p(e,{select:!1,ctrl:!1}))},actionDescription:{name:e.lineStart}},lineEnd:{defaultHandler:function(e){return t._doEnd(p(e,{select:!1,ctrl:!1}))},actionDescription:{name:e.lineEnd}},charPrevious:{defaultHandler:function(e){return t._doCursorPrevious(p(e,{select:!1,unit:"character"}))},actionDescription:{name:e.charPrevious}},charNext:{defaultHandler:function(e){return t._doCursorNext(p(e,{select:!1,unit:"character"}))},actionDescription:{name:e.charNext}},pageUp:{defaultHandler:function(e){return t._doPageUp(p(e,{select:!1}))},actionDescription:{name:e.pageUp}},pageDown:{defaultHandler:function(e){return t._doPageDown(p(e,{select:!1}))},actionDescription:{name:e.pageDown}},scrollPageUp:{defaultHandler:function(e){return t._doScroll(p(e,{type:"pageUp"}))},actionDescription:{name:e.scrollPageUp}},scrollPageDown:{defaultHandler:function(e){return t._doScroll(p(e,{type:"pageDown"}))},actionDescription:{name:e.scrollPageDown}},scrollLineUp:{defaultHandler:function(e){return t._doScroll(p(e,{type:"lineUp"}))},actionDescription:{name:e.scrollLineUp}},scrollLineDown:{defaultHandler:function(e){return t._doScroll(p(e,{type:"lineDown"}))},actionDescription:{name:e.scrollLineDown}},wordPrevious:{defaultHandler:function(e){return t._doCursorPrevious(p(e,{select:!1,unit:"word"}))},actionDescription:{name:e.wordPrevious}},wordNext:{defaultHandler:function(e){return t._doCursorNext(p(e,{select:!1,unit:"word"}))},actionDescription:{name:e.wordNext}},textStart:{defaultHandler:function(e){return t._doHome(p(e,{select:!1,ctrl:!0}))},actionDescription:{name:e.textStart}},textEnd:{defaultHandler:function(e){return t._doEnd(p(e,{select:!1,ctrl:!0}))},actionDescription:{name:e.textEnd}},scrollTextStart:{defaultHandler:function(e){return t._doScroll(p(e,{type:"textStart"}))},actionDescription:{name:e.scrollTextStart}},scrollTextEnd:{defaultHandler:function(e){return t._doScroll(p(e,{type:"textEnd"}))},actionDescription:{name:e.scrollTextEnd}},centerLine:{defaultHandler:function(e){return t._doScroll(p(e,{type:"centerLine"}))},actionDescription:{name:e.centerLine}},selectLineUp:{defaultHandler:function(e){return t._doLineUp(p(e,{select:!0}))},actionDescription:{name:e.selectLineUp}},selectLineDown:{defaultHandler:function(e){return t._doLineDown(p(e,{select:!0}))},actionDescription:{name:e.selectLineDown}},selectWholeLineUp:{defaultHandler:function(e){return t._doLineUp(p(e,{select:!0,wholeLine:!0}))},actionDescription:{name:e.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(e){return t._doLineDown(p(e,{select:!0,wholeLine:!0}))},actionDescription:{name:e.selectWholeLineDown}},selectLineStart:{defaultHandler:function(e){return t._doHome(p(e,{select:!0,ctrl:!1}))},actionDescription:{name:e.selectLineStart}},selectLineEnd:{defaultHandler:function(e){return t._doEnd(p(e,{select:!0,ctrl:!1}))},actionDescription:{name:e.selectLineEnd}},selectCharPrevious:{defaultHandler:function(e){return t._doCursorPrevious(p(e,{select:!0,unit:"character"}))},actionDescription:{name:e.selectCharPrevious}},selectCharNext:{defaultHandler:function(e){return t._doCursorNext(p(e,{select:!0,unit:"character"}))},actionDescription:{name:e.selectCharNext}},selectPageUp:{defaultHandler:function(e){return t._doPageUp(p(e,{select:!0}))},actionDescription:{name:e.selectPageUp}},selectPageDown:{defaultHandler:function(e){return t._doPageDown(p(e,{select:!0}))},actionDescription:{name:e.selectPageDown}},selectWordPrevious:{defaultHandler:function(e){return t._doCursorPrevious(p(e,{select:!0,unit:"word"}))},actionDescription:{name:e.selectWordPrevious}},selectWordNext:{defaultHandler:function(e){return t._doCursorNext(p(e,{select:!0,unit:"word"}))},actionDescription:{name:e.selectWordNext}},selectTextStart:{defaultHandler:function(e){return t._doHome(p(e,{select:!0,ctrl:!0}))},actionDescription:{name:e.selectTextStart}},selectTextEnd:{defaultHandler:function(e){return t._doEnd(p(e,{select:!0,ctrl:!0}))},actionDescription:{name:e.selectTextEnd}},deletePrevious:{defaultHandler:function(e){return t._doBackspace(p(e,{unit:"character"}))},actionDescription:{name:e.deletePrevious}},deleteNext:{defaultHandler:function(e){return t._doDelete(p(e,{unit:"character"}))},actionDescription:{name:e.deleteNext}},deleteWordPrevious:{defaultHandler:function(e){return t._doBackspace(p(e,{unit:"word"}))},actionDescription:{name:e.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(e){return t._doDelete(p(e,{unit:"word"}))},actionDescription:{name:e.deleteWordNext}},deleteLineStart:{defaultHandler:function(e){return t._doBackspace(p(e,{unit:"line"}))},actionDescription:{name:e.deleteLineStart}},deleteLineEnd:{defaultHandler:function(e){return t._doDelete(p(e,{unit:"line"}))},actionDescription:{name:e.deleteLineEnd}},tab:{defaultHandler:function(e){return t._doTab(p(e,{}))},actionDescription:{name:e.tab}},shiftTab:{defaultHandler:function(e){return t._doShiftTab(p(e,{}))},actionDescription:{name:e.shiftTab}},enter:{defaultHandler:function(e){return t._doEnter(p(e,{}))},actionDescription:{name:e.enter}},enterNoCursor:{defaultHandler:function(e){return t._doEnter(p(e,{noCursor:!0}))},actionDescription:{name:e.enterNoCursor}},escape:{defaultHandler:function(e){return t._doEscape(p(e,{}))},actionDescription:{name:e.escape}},selectAll:{defaultHandler:function(e){return t._doSelectAll(p(e,{}))},actionDescription:{name:e.selectAll}},copy:{defaultHandler:function(e){return t._doCopy(p(e,{}))},actionDescription:{name:e.copy}},cut:{defaultHandler:function(e){return t._doCut(p(e,{}))},actionDescription:{name:e.cut}},paste:{defaultHandler:function(e){return t._doPaste(p(e,{}))},actionDescription:{name:e.paste}},uppercase:{defaultHandler:function(e){return t._doCase(p(e,{type:"upper"}))},actionDescription:{name:e.uppercase}},lowercase:{defaultHandler:function(e){return t._doCase(p(e,{type:"lower"}))},actionDescription:{name:e.lowercase}},capitalize:{defaultHandler:function(e){return t._doCase(p(e,{unit:"word",type:"capitalize"}))},actionDescription:{name:e.capitalize}},reversecase:{defaultHandler:function(e){return t._doCase(p(e,{type:"reverse"}))},actionDescription:{name:e.reversecase}},toggleOverwriteMode:{defaultHandler:function(e){return t._doOverwriteMode(p(e,{}))},actionDescription:{name:e.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(e){return t._doTabMode(p(e,{}))},actionDescription:{name:e.toggleTabMode}},toggleWrapMode:{defaultHandler:function(e){return t._doWrapMode(p(e,{}))},actionDescription:{name:e.toggleWrapMode}}}},_createRulerParent:function(e,t){var i=s.createElement(e,"div");return i.className=t,i.tabIndex=-1,i.style.overflow="hidden",i.style.MozUserSelect="none",i.style.WebkitUserSelect="none",i.style.position="absolute",i.style.top="0px",i.style.bottom="0px",i.style.cursor="default",i.style.display="none",i.setAttribute("aria-hidden","true"),this._rootDiv.appendChild(i),i},_createRuler:function(e,t){if(this._clientDiv){var i=this._getRulerParent(e);if(i){(i!==this._marginDiv||this._marginOffset)&&(i.style.display="block"),i.rulerWidth=void 0;var n=s.createElement(i.ownerDocument,"div");if(n._ruler=e,e.node=n,n.rulerChanged=!0,n.style.position="relative",n.style.cssFloat="left",n.style.styleFloat="left",n.style.outline="none",void 0===t||0>t||t>=i.children.length)i.appendChild(n);else{for(var o=i.firstChild;o&&t-->0;)o=o.nextSibling;i.insertBefore(n,o)}}}},_createSelectionDiv:function(){var e=s.createElement(this._parent.ownerDocument,"div");return e.className="textviewSelection",e.style.position="absolute",e.style.borderWidth="0px",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.width="0px",e.style.height="0px",e.style.zIndex="0",e},_createView:function(){function e(){b._rootDiv&&(b.update(!0),b._metrics.invalid&&b._getWindow().setTimeout(function(){e()},100))}if(!this._clientDiv){for(var t=this._parent;t.hasChildNodes();)t.removeChild(t.lastChild);var i=t.ownerDocument,n=s.createElement(i,"div");this._rootDiv=n,n.tabIndex=-1,n.style.position="relative",n.style.overflow="hidden",n.style.width="100%",n.style.height="100%",n.style.overflow="hidden",n.style.WebkitTextSizeAdjust="100%",n.setAttribute("role","application"),t.appendChild(n);var o=this._createRulerParent(i,"textviewLeftRuler");this._leftDiv=o;var r=s.createElement(i,"div");r.className="textviewScroll",this._viewDiv=r,r.tabIndex=-1,r.style.position="absolute",r.style.top="0px",r.style.bottom="0px",r.style.borderWidth="0px",r.style.margin="0px",r.style.outline="none",r.style.background="transparent",n.appendChild(r); -var l=this._createRulerParent(i,"textviewRightRuler");this._rightDiv=l,"rtl"==document.dir?l.style.left="0px":l.style.right="0px";var d=this._createRulerParent(i,"textviewInnerRightRuler");this._innerRightDiv=d,d.style.zIndex="1";var c=s.createElement(i,"div");this._scrollDiv=c,c.style.margin="0px",c.style.borderWidth="0px",c.style.padding="0px",r.appendChild(c);var h=this._marginDiv=this._createRulerParent(i,"textviewMarginRuler");if(h.style.zIndex="4",!s.isIE&&!s.isIOS){var u=s.createElement(i,"div");this._clipDiv=u,u.style.position="absolute",u.style.overflow="hidden",u.style.margin="0px",u.style.borderWidth="0px",u.style.padding="0px",u.style.background="transparent",n.appendChild(u);var p=s.createElement(i,"div");this._clipScrollDiv=p,p.style.position="absolute",p.style.height="1px",p.style.top="-1000px",p.style.background="transparent",u.appendChild(p)}var f=s.createElement(i,"div");if(f.className="textviewContent",this._clientDiv=f,f.tabIndex=0,f.style.position="absolute",f.style.borderWidth="0px",f.style.margin="0px",f.style.padding="0px",f.style.outline="none",f.style.zIndex="1",f.style.WebkitUserSelect="text",f.setAttribute("spellcheck","false"),(s.isIOS||s.isAndroid)&&(f.style.WebkitTapHighlightColor="transparent"),(this._clipDiv||n).appendChild(f),this._setFullSelection(this._fullSelection,!0),s.isIOS||s.isAndroid){var g=s.createElement(i,"div");this._vScrollDiv=g,g.style.position="absolute",g.style.borderWidth="1px",g.style.borderColor="white",g.style.borderStyle="solid",g.style.borderRadius="4px",g.style.backgroundColor="black",g.style.opacity="0.5",g.style.margin="0px",g.style.padding="0px",g.style.outline="none",g.style.zIndex="3",g.style.width="8px",g.style.display="none",n.appendChild(g);var _=s.createElement(i,"div");this._hScrollDiv=_,_.style.position="absolute",_.style.borderWidth="1px",_.style.borderColor="white",_.style.borderStyle="solid",_.style.borderRadius="4px",_.style.backgroundColor="black",_.style.opacity="0.5",_.style.margin="0px",_.style.padding="0px",_.style.outline="none",_.style.zIndex="3",_.style.height="8px",_.style.display="none",n.appendChild(_)}if(s.isFirefox&&!f.setCapture){var m=s.createElement(i,"div");this._overlayDiv=m,m.style.position=f.style.position,m.style.borderWidth=f.style.borderWidth,m.style.margin=f.style.margin,m.style.padding=f.style.padding,m.style.cursor="text",m.style.zIndex="2",(this._clipDiv||n).appendChild(m)}f.contentEditable="true",this._setWrapMode(this._wrapMode,!0),this._setReadOnly(this._readonly),this._setThemeClass(this._themeClass,!0),this._setTabSize(this._tabSize,!0),this._setMarginOffset(this._marginOffset,!0),this._hookEvents(),a.initInputField(f);for(var v=this._rulers,x=0;xthis._getLineHeight()){var i=t.getBoundingClientRect(),n=this._clientDiv.getBoundingClientRect();i.bottom>n.bottom&&(t=this._getLinePrevious(t)||t)}return t.lineIndex},_getBlockSelections:function(e,t,i){var n=this._model;e=e.filter(function(e){return!e._editing});var o,r=n.getLineAtOffset(this._blockSelection.getAnchor());t>r?o=t:(o=r,r=t);for(var s=r;o>=s;s++){var a=this._getLine(s),l=a.getOffset(i.x,1),d=a.getOffset(this._blockSelection._docX,1);if(a.destroy(),l!==d||l!==n.getLineEnd(s)){var c=d>l,h=new x(c?l:d,c?d:l,c);h._editing=!0,e.push(h)}}return e},_getBoundsAtOffset:function(e){var t=this._model,i=this._getLine(t.getLineAtOffset(e)),n=i.getBoundingClientRect(e),o=this._getLinePixel(i.lineIndex);return n.top+=o,n.bottom+=o,i.destroy(),n},_getClientHeight:function(){var e=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-e.top-e.bottom)},_getInnerRightWidth:function(){var e=this._innerRightDiv.rulerWidth;if(void 0===e){var t=this._innerRightDiv.getBoundingClientRect();this._innerRightDiv.rulerWidth=e=t.right-t.left}return e},_getClientWidth:function(){var e=this._getViewPadding(),t=this._getInnerRightWidth();return Math.max(0,this._viewDiv.clientWidth-e.left-e.right-t)},_getClipboardText:function(e,t){function i(e){var i=[];return g(e,function(e){i.push(e)},null),t&&t(i),i}var n=this._getWindow(),o=n.clipboardData;if(!o&&e&&(o=e.clipboardData),o)return i(o.getData(s.isIE?"Text":"text/plain"));if(s.isElectron&&!e)return i(window.__clipboardModule.readText());if(s.isFirefox){this._ignoreFocus=!0;var r=this._clipboardDiv,a=this._rootDiv.ownerDocument;r||(r=s.createElement(a,"div"),this._clipboardDiv=r,r.style.position="fixed",r.style.whiteSpace="pre",r.style.left="-1000px",this._rootDiv.appendChild(r)),r.innerHTML="
    ",r.firstChild.focus();var l=this,d=function(){var e=l._getTextFromElement(r);return r.innerHTML="",i(e)},c=!1;if(this._ignorePaste=!0,!s.isLinux||2!==this._lastMouseButton)try{c=a.execCommand("paste",!1,null)}catch(h){c=r.childNodes.length>1||r.firstChild&&r.firstChild.childNodes.length>0}return this._ignorePaste=!1,c?(this.focus(),this._ignoreFocus=!1,d()):e?(n.setTimeout(function(){l.focus(),d(),l._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"")}return""},_getDOMText:function(e,t){return e._line.getText(t)},_getTextFromElement:function(e){var t=e.ownerDocument,i=t.defaultView;if(!i.getSelection)return e.innerText||e.textContent;var n=t.createRange();n.selectNode(e);var o,r=i.getSelection(),s=[];for(o=0;oi)for(t=i;e>t;t++)n+=this._getLineHeight(t);else for(t=i-1;t>=e;t--)n-=this._getLineHeight(t);return n}var o=this._getLineHeight();return o*e},_getLineIndex:function(e,t){var i,n=0,o=this._model.getLineCount();if(this._lineHeight){n=this._getTopIndex();var r=-this._topIndexY+this._getScroll().y;if(e!==r)if(r>e)for(;r>e&&n>0;)e+=this._getLineHeight(--n);else for(i=this._getLineHeight(n);e-i>=r&&o-1>n;)e-=i,i=this._getLineHeight(++n)}else i=this._getLineHeight(),n=Math.floor(e/i);return t&&(0===o||0>n||n>o-1)?-1:Math.max(0,Math.min(o-1,n))},_getRulerParent:function(e){switch(e.getLocation()){case"left":return this._leftDiv;case"right":return this._rightDiv;case"innerRight":return this._innerRightDiv;case"margin":return this._marginDiv}return null},_getScroll:function(e){(void 0===e||e)&&this._cancelAnimation();var t=this._viewDiv;return{x:t.scrollLeft,y:t.scrollTop}},_getSelection:function(){return(Array.isArray(this._selection)?this._selection[0]:this._selection).clone()},_getSelections:function(){return(Array.isArray(this._selection)?this._selection:[this._selection]).map(function(e){return e.clone()})},_getTopIndex:function(e){var t=this._topChild;if(e&&this._getClientHeight()>this._getLineHeight()){var i=t.getBoundingClientRect(),n=this._getViewPadding(),o=this._viewDiv.getBoundingClientRect();i.top26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(t){return e._handleMouseWheel(t?t:l.event)}}),this._clipDiv&&t.push({target:this._clipDiv,type:s.isFirefox>26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(t){return e._handleMouseWheel(t?t:l.event)}}),s.isFirefox&&(!s.isWindows||s.isFirefox>=15)){var u=l.MutationObserver||l.MozMutationObserver;u?(this._mutationObserver=new u(function(t){e._handleDataModified(t)}),this._mutationObserver.observe(i,{subtree:!0,characterData:!0})):t.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(t){return e._handleDataModified(t?t:l.event)}})}(s.isFirefox&&(!s.isWindows||s.isFirefox>=15)||s.isIE||s.isWebkit)&&(t.push({target:this._clientDiv,type:"compositionstart",handler:function(t){return e._handleCompositionStart(t?t:l.event)}}),t.push({target:this._clientDiv,type:"compositionend",handler:function(t){return e._handleCompositionEnd(t?t:l.event)}}),t.push({target:this._clientDiv,type:"compositionupdate",handler:function(t){return e._handleCompositionUpdate(t?t:l.event)}})),this._overlayDiv&&(t.push({target:this._overlayDiv,type:"mousedown",handler:function(t){return e._handleMouseDown(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"mouseover",handler:function(t){return e._handleMouseOver(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"mouseout",handler:function(t){return e._handleMouseOut(t?t:l.event)}}),t.push({target:this._overlayDiv,type:"contextmenu",handler:function(t){return e._handleContextMenu(t?t:l.event)}})),this._isW3CEvents||t.push({target:this._clientDiv,type:"dblclick",handler:function(t){return e._handleDblclick(t?t:l.event)}})}this._hookRulerEvents(this._leftDiv,t),this._hookRulerEvents(this._rightDiv,t),this._hookRulerEvents(this._innerRightDiv,t),this._hookRulerEvents(this._marginDiv,t);for(var p=0;p26?"wheel":s.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(e){return i._handleMouseWheel(e?e:n.event)}}),t.push({target:e,type:"click",handler:function(e){i._handleRulerEvent(e?e:n.event)}}),t.push({target:e,type:"dblclick",handler:function(e){i._handleRulerEvent(e?e:n.event)}}),t.push({target:e,type:"mousemove",handler:function(e){i._handleRulerEvent(e?e:n.event)}}),t.push({target:e,type:"mouseover",handler:function(e){i._handleRulerEvent(e?e:n.event)}}),t.push({target:e,type:"mouseout",handler:function(e){i._handleRulerEvent(e?e:n.event)}})}},_getWindow:function(){return d(this._parent.ownerDocument)},_ignoreEvent:function(e){for(var t=e.target;t&&t!==this._clientDiv;){if(t.ignore)return!0;t=t.parentNode}return!1},_init:function(e){var i=e.parent;if("string"==typeof i&&(i=(e.document||document).getElementById(i)),!i)throw new Error("no parent");e.parent=i,e.model=e.model||new t.TextModel;var n=this._defaultOptions();for(var o in n)if(n.hasOwnProperty(o)){var r;r=void 0!==e[o]?e[o]:n[o].value,this["_"+o]=r}this._keyModes=[],this._rulers=[],this._selection=[new x(0,0,!1)],this._linksVisible=!1,this._redrawCount=0,this._maxLineWidth=0,this._maxLineIndex=-1,this._ignoreSelect=!0,this._ignoreFocus=!1,this._hasFocus=!1,this._dragOffset=-1,this._isRangeRects=(!s.isIE||s.isIE>=9)&&"function"==typeof i.ownerDocument.createRange().getBoundingClientRect,this._isW3CEvents=i.addEventListener,this._autoScrollX=null,this._autoScrollY=null,this._autoScrollTimerID=null,this._AUTO_SCROLL_RATE=50,this._grabControl=null,this._moseMoveClosure=null,this._mouseUpClosure=null,this._lastMouseX=0,this._lastMouseY=0,this._lastMouseTime=0,this._clickCount=0,this._clickTime=250,this._clickDist=5,this._isMouseDown=!1,this._doubleClickSelection=null,this._hScroll=0,this._vScroll=0,this._imeOffset=-1,this._createActions(),this._createView()},_checkOverlayScroll:function(){if(s.isMac&&s.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var e=this._viewDiv,t=this._isOverOverlayScroll();e.style.pointerEvents=t.vertical||t.horizontal?"":"none"}},_isOverOverlayScroll:function(){var e=(new Date).getTime()-this._lastScrollTime<200;if(!e)return{};var t=this._viewDiv.getBoundingClientRect(),i=this._lastMouseMoveX,n=this._lastMouseMoveY,o=15;return{vertical:t.top<=n&&n1&&this.setRedraw(!1);var s=this._compoundChange;s?x.compare(this._getSelections(),s.owner.selection)||(this._endUndo(),e.selection.length>1&&this._startUndo()):e.selection.length>1&&this._startUndo();var a=this._model;try{e._ignoreDOMSelection&&(this._ignoreDOMSelection=!0);var l=0,d=0;e.selection.forEach(function(i){i.start+=l,i.end+=l;var n=Array.isArray(e.text)?e.text[d]:e.text;a.setText(n,i.start,i.end),l+=i.start-i.end+n.length,i.setCaret(t?i.start+n.length:i.start),d++})}finally{e._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}return this._setSelection(e.selection,i,!0,n),s=this._compoundChange,s&&(s.owner.selection=e.selection),e.selection.length>1&&this.setRedraw(!0),this.onModify({type:"Modify"}),!0},_onModelChanged:function(e){e.type="ModelChanged",this.onModelChanged(e),e.type="Changed";var t=e.start,i=e.addedCharCount,n=e.removedCharCount,o=e.addedLineCount,r=e.removedLineCount,s=this._getSelections();s.forEach(function(e){e.end>t&&(e.end>t&&e.start=l&&l+r>=h&&(l!==h||d.modelChangedEvent||d.lineRemoved?(d.lineRemoved=!0,d.lineChanged=!1,d.modelChangedEvent=null):(d.modelChangedEvent=e,d.lineChanged=!0)),h>l+r&&(d.lineIndex=h+o-r,d._line.lineIndex=d.lineIndex),d=this._getLineNext(d)}if(this._lineHeight){var u=[l,r].concat(c(o));Array.prototype.splice.apply(this._lineHeight,u)}this._wrapMode||l<=this._maxLineIndex&&this._maxLineIndex<=l+r&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0),this._update()},_onModelChanging:function(e){e.type="ModelChanging",this.onModelChanging(e),e.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var e=this,t=this._getWindow();this._updateTimer=t.setTimeout(function(){e._updateTimer=null,e._update()},0)}},_rangesToSelections:function(e){var t=[],i=this._model.getCharCount();return e.forEach(function(e){var n;if(e instanceof x)n=e.clone();else{var o=e.start,r=e.end,s=o>r;if(s){var a=o;o=r,r=a}o=Math.max(0,Math.min(o,i)),r=Math.max(0,Math.min(r,i)),n=new x(o,r,s)}t.push(n)}),t},_resetLineHeight:function(e,t){if(this._wrapMode||this._variableLineHeight){if(void 0!==e&&void 0!==t)for(var i=e;t>i;i++)this._lineHeight[i]=void 0;else this._lineHeight=c(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var e=this._clientDiv;if(e)for(var t=e.firstChild;t;)t.lineWidth=void 0,t=t.nextSibling},_reset:function(){this._maxLineIndex=-1,this._maxLineWidth=0,this._topChild=null,this._bottomChild=null,this._topIndexY=0,this._variableLineHeight=!1,this._resetLineHeight(),this._setSelection(new x(0,0,!1),!1,!1),this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var e=this._clientDiv;if(e){for(var t=e.firstChild;t;)t.lineRemoved=!0,t=t.nextSibling;s.isFirefox<13&&this._fixCaret()}},_scrollViewAnimated:function(e,t,i){var n=this._getWindow();if(i&&this._scrollAnimation){var o=this;this._animation=new D({window:n,duration:this._scrollAnimation,curve:[t,0],onAnimate:function(e){var i=t-Math.floor(e);o._scrollView(0,i),t-=i},onEnd:function(){o._animation=null,o._scrollView(e,t),i&&n.setTimeout(i,0)}}),this._animation.play()}else this._scrollView(e,t),i&&n.setTimeout(i,0)},_scrollView:function(e,t){this._ensureCaretVisible=!1;var i=this._viewDiv;e&&(i.scrollLeft+=e),t&&(i.scrollTop+=t)},_setClipboardText:function(e,t){if(s.isElectron&&!t)return window.__clipboardModule.writeText(e),!0;var i,n=this._getWindow(),o=n.clipboardData;if(!o&&t&&(o=t.clipboardData),o){i=[],g(e,function(e){i.push(e)},function(){i.push(s.platformDelimiter)});var r=o.setData(s.isIE?"Text":"text/plain",i.join(""));if(r||t&&(s.isFirefox>21||s.isWebkit))return!0;if(!t)return!1}var a=this._parent.ownerDocument,l=s.createElement(a,"pre");l.style.position="fixed",l.style.left="-1000px",g(e,function(e){l.appendChild(a.createTextNode(e))},function(){l.appendChild(s.createElement(a,"br"))}),l.appendChild(a.createTextNode(" ")),this._clientDiv.appendChild(l);var d=a.createRange();d.setStart(l.firstChild,0),d.setEndBefore(l.lastChild);var c=n.getSelection();c.rangeCount>0&&c.removeAllRanges(),c.addRange(d);var h=this,u=function(){l&&l.parentNode===h._clientDiv&&h._clientDiv.removeChild(l),h._updateDOMSelection()},p=!1;this._ignoreCopy=!0;try{p=a.execCommand("copy",!1,null)}catch(f){}return this._ignoreCopy=!1,!p&&t?(n.setTimeout(u,0),!1):(u(),!0)},_setGrab:function(e){e!==this._grabControl&&(e?(e.setCapture&&e.setCapture(),this._grabControl=e):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(e){if(this._linksVisible!==e){this._linksVisible=e,s.isIE&&e&&(this._hadFocus=this._hasFocus);var t=this._clientDiv;t.contentEditable=!e,this._hadFocus&&!e&&t.focus(),this._overlayDiv&&(this._overlayDiv.style.zIndex=e?"-1":"1");for(var i=this._getLineNext();i;)i._line.updateLinks(),i=this._getLineNext(i);this._updateDOMSelection()}},_setSelection:function(e,t,i,n,o,r,s){if(e){void 0===i&&(i=!0);var a,l=this._getSelections();if(a=Array.isArray(e)?e:r?l.concat([e]):[e],this._selection=x.merge(a),s||a.forEach(function(e){e._columnX=-1}),t!==!1&&this._showCaret(!1,n,t,o),i&&this._updateDOMSelection(),!x.compare(l,a)){var d={type:"Selection",oldValue:x.convert(l),newValue:x.convert(a)};this.onSelection(d)}}},_setSelectionTo:function(e,t,i,n,o,r){var s=this._model,a=this._getSelections(),l=this.convert({x:e,y:t},"page","document"),d=this._getLineIndex(l.y),c=this._getLine(d),h=c.getOffset(l.x,l.y-this._getLinePixel(d));if(r&&!n&&x.contains(a,h))return this._dragOffset=h,c.destroy(),!1;if(this._blockSelection)a=this._getBlockSelections(a,d,l);else{var u;if(i?n?(u=a[a.length-1],u._editing=!0):(u=new x(0,0),u._editing=!0,o?a.push(u):a=[u],u._docX=l.x):u=x.editing(a),1===this._clickCount)u.extend(h),n||u.collapse();else{var p,f,g=0===(1&this._clickCount);if(g)this._doubleClickSelection?h>=this._doubleClickSelection.start?(p=this._doubleClickSelection.start,f=c.getNextOffset(h,{unit:"wordend",count:1})):(p=c.getNextOffset(h,{unit:"word",count:-1}),f=this._doubleClickSelection.end):(p=c.getNextOffset(h,{unit:"word",count:-1}),f=c.getNextOffset(p,{unit:"wordend",count:1}));else if(this._doubleClickSelection){var _=s.getLineAtOffset(this._doubleClickSelection.start);d>=_?(p=s.getLineStart(_),f=s.getLineEnd(d)):(p=s.getLineStart(d),f=s.getLineEnd(_))}else p=s.getLineStart(d),f=s.getLineEnd(d);u.setCaret(p),u.extend(f)}}return this._setSelection(a,!0,!0,null,!1),c.destroy(),!0},_setFullSelection:function(e,t){this._fullSelection=e,s.isWebkit<537.36&&(this._fullSelection=e=!0),this._domSelection||(this._domSelection=[],this._cursorVisible=!0),t||this._updateDOMSelection()},_setBlockCursor:function(e){this._blockCursorVisible=e,this._updateBlockCursorVisible()},_setOverwriteMode:function(e){this._overwriteMode=e,this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var e=this._viewDiv,t=s.createElement(e.ownerDocument,"div");t.className="textviewBlockCursor",this._cursorDiv=t,t.tabIndex=-1,t.style.zIndex="2",t.style.color="transparent",t.style.position="absolute",t.style.pointerEvents="none",t.innerHTML=" ",e.appendChild(t),this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(e,t){this._marginOffset=e,this._marginDiv.style.display=e?"block":"none",t||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(e,t){this._wrapOffset=e,t||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(e){this._readonly=e},_setSingleMode:function(e,t){this._singleMode=e,this._updateOverflow(),this._updateStyle(t)},_setNoScroll:function(e,t){this._noScroll=e,this._updateOverflow(),this._updateStyle(t)},_setTabSize:function(e,t){this._tabSize=e,this._customTabSize=void 0;var i=this._clientDiv;s.isOpera?i&&(i.style.OTabSize=this._tabSize+""):s.isWebkit>=537.1?i&&(i.style.tabSize=this._tabSize+""):s.isFirefox>=4?i&&(i.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize),t||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(e){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged),this._theme=e,this._theme&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged),this._setThemeClass(this._themeClass)},_setThemeClass:function(e,t){this._themeClass=e;var i="textview",n=this._theme.getThemeClass();n&&(i+=" "+n),this._themeClass&&n!==this._themeClass&&(i+=" "+this._themeClass),this._rootDiv.className=i,this._updateStyle(t)},_setUndoStack:function(e){this._undoStack=e},_setWrapMode:function(e,t){this._wrapMode=e&&this._wrappable;var i=this._clientDiv;this._wrapMode?(i.style.whiteSpace="pre-wrap",i.style.wordWrap="break-word"):(i.style.whiteSpace="pre",i.style.wordWrap="normal"),this._updateOverflow(),t||(this.redraw(),this._resetLineWidth()),this._resetLineHeight()},_showCaret:function(e,t,i,n){if(this._clientDiv&&!(this._redrawCount>0||this._ignoreDOMSelection||-1!==this._imeOffset)){var o=this._model,r=this._getSelections(),s=x.editing(r,"down"===this._autoScrollDir),a=this._getScroll(),l=s.getCaret(),d=s.start,c=s.end,h=o.getLineAtOffset(d),u=o.getLineAtOffset(c),p=Math.max(Math.max(d,o.getLineStart(u)),c-1),f=this._getClientWidth(),g=this._getClientHeight(),_=f/4,m=this._getBoundsAtOffset(l===d?d:p),v=m.left,y=m.right,b=m.top,w=m.bottom,C=0,T="object"==typeof i;!e&&!T||s.isEmpty()||(m=this._getBoundsAtOffset(l===c?d:p),C=(m.bottom>w?m.bottom:w)-(m.topa.x+f&&(L=Math.max(y-a.x-f,_));var k=0;ba.y+g&&(k=w-a.y-g),n&&(n>0?k>0&&(k=Math.max(k,n)):0>k&&(k=Math.min(k,n)));var D=T&&"always"===i.scrollPolicy;if(0!==L||0!==k||D){if(T){var A=k>0;0===k&&(k=b-a.y);var S=i.viewAnchor,E=i.selectionAnchor,O=Math.min(Math.max(0,i.viewAnchorOffset||0));k+=Math.floor("top"===S?A?(1-O)*g:-O*g:"bottom"===S?A?O*g:-(1-O)*g:"center"===S?A?g/2+O*g:g/2-(1-O)*g:A?O*g:-O*g),h!==u&&("top"===E&&l!==d?k+=Math.floor(-C):"bottom"===E&&l!==c?k+=Math.floor(C):"center"===E&&(k+=Math.floor(C/2)))}else 0!==k&&"number"==typeof i&&(0>i&&(i=0),i>1&&(i=1),k+=Math.floor(k>0?i*g:-i*g));return this._scrollViewAnimated(L,k,t),g!==this._getClientHeight()||f!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0}return t&&t(),!1}},_startIME:function(){if(-1===this._imeOffset){for(var e=!1,t=this._getSelections(),i=0;i0)&&!this._ignoreDOMSelection&&-1===this._imeOffset&&this._clientDiv){var e,t=this._getSelections(),i=this._domSelection;if(i.lengtht.length&&i.splice(t.length).forEach(function(e){e.destroy()});for(e=0;e1?this._cursorTimer||(this._cursorTimer=n.setInterval(function(){o._cursorVisible=!o._cursorVisible,o._domSelection.forEach(function(e){e.update()})},500)):this._cursorTimer&&(n.clearInterval(this._cursorTimer),this._cursorTimer=null)}},_update:function(e){if(!(this._redrawCount>0)){if(this._updateTimer){var t=this._getWindow();t.clearTimeout(this._updateTimer),this._updateTimer=null,e=!1}var i=this._clientDiv,n=this._viewDiv;if(i){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);
    -var o=this._model,r=this._getScroll(!1),a=this._getViewPadding(),l=o.getLineCount(),d=this._getLineHeight(),c=!1,h=!1,u=!1,p=this._metrics.scrollWidth;this._wrapMode&&(i.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var f,g,_,m,v,y,x,b,w,T,L,k=0,D=0;if(this._lineHeight){for(;l>D&&(L=this._getLineHeight(D),!(k+L>r.y));)k+=L,D++;f=D,g=Math.max(0,f-1),m=_=r.y-k,f>0&&(_+=this._getLineHeight(f-1))}else{var A=Math.max(0,r.y)/d;f=Math.floor(A),g=Math.max(0,f-1),_=Math.round((A-g)*d),m=Math.round((A-f)*d),T=l*d}this._topIndexY=m;var S=this._rootDiv,E=S.clientWidth,O=S.clientHeight;if(e){for(v=0,this._leftDiv&&(y=this._leftDiv.getBoundingClientRect(),v=y.right-y.left),x=this._getClientWidth(),b=this._getClientHeight(),w=x,this._wrapMode?this._metrics.wrapWidth&&(w=this._metrics.wrapWidth):w=Math.max(this._maxLineWidth,w);l>D;)L=this._getLineHeight(D,!1),k+=L,D++;T=k}else{b=this._getClientHeight();for(var N,M,I=Math.floor((b+m)/d),B=Math.min(f+I,l-1),R=Math.min(B+1,l-1),F=i.firstChild;F;){N=F.lineIndex;var P=F.nextSibling;N>=g&&R>=N&&!F.lineRemoved&&-1!==F.lineIndex||(this._mouseWheelLine===F?(F.style.display="none",F.lineIndex=-1):i.removeChild(F)),F=P}F=this._getLineNext();var W=n.ownerDocument,V=W.createDocumentFragment();for(N=g;R>=N;N++)!F||F.lineIndex>N?new C(this,N).create(V,null):(V.firstChild&&(i.insertBefore(V,F),V=W.createDocumentFragment()),F&&F.lineChanged&&(F=new C(this,N).create(V,F),F.lineChanged=!1),F=this._getLineNext(F));V.firstChild&&i.insertBefore(V,F),s.isWebkit&&!this._wrapMode&&(i.style.width="0x7fffffffpx");var j;F=this._getLineNext();for(var U=b+_,H=!1;F;){if(M=F.lineWidth,void 0===M){j=F._line.getBoundingClientRect(),M=F.lineWidth=Math.ceil(j.right-j.left);var K=j.bottom-j.top;this._lineHeight?this._lineHeight[F.lineIndex]=K:0!==d&&0!==K&&Math.ceil(d)!==Math.ceil(K)&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[F.lineIndex]=K)}this._lineHeight&&!H&&(U-=this._lineHeight[F.lineIndex],0>U&&(B=F.lineIndex,H=!0)),this._wrapMode||(M>=this._maxLineWidth&&(this._maxLineWidth=M,this._maxLineIndex=F.lineIndex),this._checkMaxLineIndex===F.lineIndex&&(this._checkMaxLineIndex=-1)),F.lineIndex===f&&(this._topChild=F),F.lineIndex===B&&(this._bottomChild=F),F=this._getLineNext(F)}if(-1!==this._checkMaxLineIndex&&(N=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,N>=0&&l>N)){var $=new C(this,N);j=$.getBoundingClientRect(),M=j.right-j.left,M>=this._maxLineWidth&&(this._maxLineWidth=M,this._maxLineIndex=N),$.destroy()}for(;l>D;)L=this._getLineHeight(D,B>=D),k+=L,D++;T=k,this._updateRuler(this._leftDiv,f,R,O),this._updateRuler(this._rightDiv,f,R,O),this._updateRuler(this._innerRightDiv,f,R,O),this._updateRuler(this._marginDiv,f,R,O),v=0,this._leftDiv&&(y=this._leftDiv.getBoundingClientRect(),v=y.right-y.left);var G=0;if(this._rightDiv){var z=this._rightDiv.getBoundingClientRect();G=z.right-z.left}n.style.left=v+"px",n.style.right=G+"px";var Y=this._scrollDiv;if(Y.style.height=T+(s.isWebkit?0:a.bottom)+"px",x=this._getClientWidth(),!this._singleMode&&!this._wrapMode&&!this._noScroll){var q=b,X=b,Q="scroll"===n.style.overflowX;Q?q+=p:X-=p;var J=x,Z=x,et="scroll"===n.style.overflowY;et?J+=p:Z-=p,b=q,x=J,T>b&&(u=!0,x=Z),this._maxLineWidth>x&&(h=!0,b=X,T>b&&(u=!0,x=Z)),Q!==h&&(n.style.overflowX=h?"scroll":"hidden"),et!==u&&(n.style.overflowY=u?"scroll":"hidden"),c=Q!==h||et!==u}var tt=x;this._wrapMode?this._metrics.wrapWidth&&(tt=this._metrics.wrapWidth):tt=Math.max(this._maxLineWidth+this._getInnerRightWidth(),tt),w=tt,(!s.isIE||s.isIE>=9)&&this._maxLineWidth>x&&(tt+=a.right+a.left),Y.style.width=tt+"px",this._clipScrollDiv&&(this._clipScrollDiv.style.width=tt+"px"),r=this._getScroll(!1);var it=this._innerRightDiv;it&&(it.style.right=G+("scroll"===n.style.overflowY?this._metrics.scrollWidth:0)+"px",it.style.bottom=("scroll"===n.style.overflowX?p:0)+"px")}if(this._scrollHeight=T,this._vScrollDiv){var nt=b-8,ot=Math.max(15,Math.ceil(Math.min(1,nt/(T+a.top+a.bottom))*nt));this._vScrollDiv.style.left=v+x-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,r.y*nt/T))+"px",this._vScrollDiv.style.height=ot+"px"}if(!this._wrapMode&&this._hScrollDiv){var rt=x-8,st=Math.max(15,Math.ceil(Math.min(1,rt/(this._maxLineWidth+a.left+a.right))*rt));this._hScrollDiv.style.left=v+Math.floor(Math.max(0,Math.floor(r.x*rt/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=b-9+"px",this._hScrollDiv.style.width=st+"px"}var at,lt,dt=r.x,ct=this._clipDiv,ht=this._overlayDiv,ut=this._marginDiv;if(ut&&(ut.style.left=-dt+v+this._metrics.marginWidth+a.left+"px",ut.style.bottom=("scroll"===n.style.overflowX?p:0)+"px"),ct){ct.scrollLeft=dt,ct.scrollTop=0,at=v+a.left,lt=a.top;var pt=x,ft=b,gt=0,_t=-_;0===r.x&&(at-=a.left,pt+=a.left,gt=a.left),r.x+x===w&&(pt+=a.right),0===r.y&&(lt-=a.top,ft+=a.top,_t+=a.top),r.y+b===T&&(ft+=a.bottom),ct.style.left=at+"px",ct.style.top=lt+"px",ct.style.right=E-pt-at+"px",ct.style.bottom=O-ft-lt+"px",i.style.left=gt+"px",i.style.top=_t+"px",i.style.width=w+"px",i.style.height=b+_+"px",ht&&(ht.style.left=i.style.left,ht.style.top=i.style.top,ht.style.width=i.style.width,ht.style.height=i.style.height)}else{at=dt,lt=_;var mt=dt+x,vt=_+b;0===at&&(at-=a.left),0===lt&&(lt-=a.top),mt===w&&(mt+=a.right),r.y+b===T&&(vt+=a.bottom),i.style.clip="rect("+lt+"px,"+mt+"px,"+vt+"px,"+at+"px)","rtl"==document.dir?i.style.right=-dt+v+a.left+"px":i.style.left=-dt+v+a.left+"px",i.style.width=(this._wrapMode||s.isWebkit?w:x+dt)+"px",e||(i.style.top=-_+a.top+"px",i.style.height=b+_+"px"),ht&&(ht.style.clip=i.style.clip,ht.style.left=i.style.left,ht.style.width=i.style.width,e||(ht.style.top=i.style.top,ht.style.height=i.style.height))}if(this._updateDOMSelection(),c){var yt=this._ensureCaretVisible;this._ensureCaretVisible=!1,yt&&this._showCaret(),this._queueUpdate()}}}},_updateOverflow:function(){var e=this._viewDiv;this._noScroll?e.style.overflow="hidden":this._wrapMode?(e.style.overflowX="hidden",e.style.overflowY="scroll"):e.style.overflow="hidden"},_updateRuler:function(e,t,i,n){if(e)for(var o=this._parent.ownerDocument,r=this._getLineHeight(),a=this._getViewPadding(),l=e.firstChild;l;){var d=l._ruler,c=d.getOverview();if(l.rulerChanged&&(h(d.getRulerStyle(),l),e.rulerWidth=void 0),"fixed"!==c){var u=r;"page"===c&&(u+=this._topIndexY),l.style.top=-u+"px",l.style.height=n+u+"px";var p,f=l.firstChild;f?(p=f,f=f.nextSibling):(p=s.createElement(o,"div"),p.style.visibility="hidden",l.appendChild(p));var g,_;l.rulerChanged&&p&&(g=-1,_=d.getWidestAnnotation(),_&&(h(_.style,p),_.html&&(p.innerHTML=_.html)),p.lineIndex=g,p.style.height=r+a.top+"px");var m,v,y;if("page"===c){for(y=d.getAnnotations(t,i+1);f;){g=f.lineIndex;var x=f.nextSibling;g>=t&&i>=g&&!f.lineChanged||l.removeChild(f),f=x}for(f=l.firstChild.nextSibling,v=o.createDocumentFragment(),g=t;i>=g;g++)!f||f.lineIndex>g?(m=s.createElement(o,"div"),_=y[g],_&&(h(_.style,m),_.html&&(m.innerHTML=_.html),m.annotation=_),m.lineIndex=g,m.style.height=this._getLineHeight(g)+"px",v.appendChild(m)):(v.firstChild&&(l.insertBefore(v,f),v=o.createDocumentFragment()),f&&(f=f.nextSibling));v.firstChild&&l.insertBefore(v,f)}else{var b,w,C=this._getClientHeight(),T=this._model.getLineCount(),L=r*T,k=C+a.top+a.bottom-2*this._metrics.scrollWidth;if(k>L?(b=r,w=a.top):(b=k/T,w=this._metrics.scrollWidth),l.rulerChanged){for(var D=l.childNodes.length;D>1;)l.removeChild(l.lastChild),D--;y=d.getAnnotations(0,T),v=o.createDocumentFragment();for(var A in y)g=A>>>0,0>g||(m=s.createElement(o,"div"),_=y[A],h(_.style,m),m.style.position="absolute",m.style.top=w+r+Math.floor(g*b)+"px",_.html&&(m.innerHTML=_.html),m.annotation=_,m.lineIndex=g,v.appendChild(m));l.appendChild(v)}else if(l._oldTrackHeight!==k)for(m=l.firstChild?l.firstChild.nextSibling:null;m;)m.style.top=this._metrics.scrollWidth+r+Math.floor(m.lineIndex*b)+"px",m=m.nextSibling;l._oldTrackHeight=k}l.rulerChanged=!1,l=l.nextSibling}else l.rulerChanged=!1,l=l.nextSibling}},_updateStyleSheet:function(){var e="";if(s.isWebkit&&this._metrics.scrollWidth>0&&(e+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}"),e){var t=this._clientDiv.ownerDocument,i=t.getElementById("_textviewStyle");if(i)i.removeChild(i.firstChild),i.appendChild(t.createTextNode(e));else{i=s.createElement(t,"style"),i.id="_textviewStyle";var n=t.getElementsByTagName("head")[0]||t.documentElement;i.appendChild(t.createTextNode(e)),n.insertBefore(i,n.firstChild)}}},_updateStyle:function(e,t){if(!e&&s.isIE&&(this._rootDiv.style.lineHeight="normal"),t=this._metrics=t||this._calculateMetrics(),this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._rootDiv.style.lineHeight=s.isIE?t.lineHeight-(t.lineTrim.top+t.lineTrim.bottom)+"px":"normal",this._updateStyleSheet(),s.isMac&&s.isWebkit){var i=this._viewDiv;t.invalid||0!==t.scrollWidth?(i.style.pointerEvents="",i.style.zIndex=""):(i.style.pointerEvents="none",i.style.zIndex="2")}e||(this.redraw(),this._resetLineWidth())}},n.EventTarget.addMixin(T.prototype),{TextView:T}}),define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(e,t){function i(e){this._model=e,this._projections=[];var t=this;this._listener={onChanged:function(e){t._onChanged(e)},onChanging:function(e){t._onChanging(e)}},e.addEventListener("postChanged",this._listener.onChanged),e.addEventListener("preChanging",this._listener.onChanging)}return i.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(t){if(t){var i=this._model,n=this._projections;t._lineIndex=i.getLineAtOffset(t.start),t._lineCount=i.getLineAtOffset(t.end)-t._lineIndex;var o=t.text;o||(o=""),t._model="string"==typeof o?new e.TextModel(o,i.getLineDelimiter()):o;var r=this.mapOffset(t.start,!0),s=t.end-t.start,a=t._lineCount,l=t._model.getCharCount(),d=t._model.getLineCount()-1,c={type:"Changing",text:t._model.getText(),start:r,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanging(c);var h=this._binarySearch(n,t.start);n.splice(h,0,t);var u={type:"Changed",start:r,removedCharCount:s,addedCharCount:l,removedLineCount:a,addedLineCount:d};this.onChanged(u)}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(e,t){var i,n,o=this._projections,r=0;if(t){for(i=0;ie));i++){if(n.end>e)return-1;r+=n._model.getCharCount()-(n.end-n.start)}return e+r}for(i=0;ie-r));i++){var s=n._model.getCharCount();if(n.start+s>e-r)return-1;r+=s-(n.end-n.start)}return e-r},removeProjection:function(e){this._removeProjection(e)},_removeProjection:function(e,t){var i,n=0;for(i=0;i1;)i=Math.floor((n+o)/2),t<=e[i].start?n=i:o=i;return n},getCharCount:function(){for(var e=this._model.getCharCount(),t=this._projections,i=0;ie)return null;var i,n,o,r=this._model,s=this._projections,a=0,l=[],d=0;for(i=0;i=e-a));i++){if(n=o._model.getLineCount()-1,o._lineIndex+n>=e-a){var c=e-(o._lineIndex+a);if(n>c)return o._model.getLine(c,t);l.push(o._model.getLine(n))}d=o.end,a+=n-o._lineCount}for(d=Math.max(d,r.getLineStart(e-a));ie-a));i++){if(l.push(r.getText(d,o.start)),n=o._model.getLineCount()-1,o._lineIndex+n>e-a)return l.push(o._model.getLine(0,t)),l.join("");l.push(o._model.getText()),d=o.end,a+=n-o._lineCount}var h=r.getLineEnd(e-a,t);return h>d&&l.push(r.getText(d,h)),l.join("")},getLineAtOffset:function(e){for(var t=this._model,i=this._projections,n=0,o=0,r=0;re-n)break;var a=s._model.getCharCount();if(s.start+a>e-n){var l=e-(s.start+n);o+=s._model.getLineAtOffset(l),n+=l;break}o+=s._model.getLineCount()-1-s._lineCount,n+=a-(s.end-s.start)}return t.getLineAtOffset(e-n)+o},getLineCount:function(){for(var e=this._model,t=this._projections,i=e.getLineCount(),n=0;ne)return-1;for(var i=this._model,n=this._projections,o=0,r=0,s=0;se-o)break;var l=a._model.getLineCount()-1;if(a._lineIndex+l>e-o){var d=e-(a._lineIndex+o);return a._model.getLineEnd(d,t)+a.start+r}r+=a._model.getCharCount()-(a.end-a.start),o+=l-a._lineCount}return i.getLineEnd(e-o,t)+r},getLineStart:function(e){if(0>e)return-1;for(var t=this._model,i=this._projections,n=0,o=0,r=0;r=e-n)break;var a=s._model.getLineCount()-1;if(s._lineIndex+a>=e-n){var l=e-(s._lineIndex+n);return s._model.getLineStart(l)+s.start+o}o+=s._model.getCharCount()-(s.end-s.start),n+=a-s._lineCount}return t.getLineStart(e-n)+o},getText:function(e,t){void 0===e&&(e=0);var i,n,o,r=this._model,s=this._projections,a=0,l=[];for(i=0;ie-a));i++){if(o=n._model.getCharCount(),n.start+o>e-a){if(void 0!==t&&n.start+o>t-a)return n._model.getText(e-(n.start+a),t-(n.start+a));l.push(n._model.getText(e-(n.start+a))),e=n.end+a+o-(n.end-n.start)}a+=o-(n.end-n.start)}var d=e-a;if(void 0!==t){for(;it-a));i++){if(l.push(r.getText(d,n.start)),o=n._model.getCharCount(),n.start+o>t-a)return l.push(n._model.getText(0,t-(n.start+a))),l.join("");l.push(n._model.getText()),d=n.end,a+=o-(n.end-n.start)}l.push(r.getText(d,t-a))}else{for(;in));e++);var s=e;for(e=0;e=o));e++);var a=e,l=this._model,d=i.baseText.length-(o-n);for(e=a;ee));a++){if(l.end>e)return-1;s+=l._model.getCharCount()-(l.end-l.start)}return e+s}var i=!!this._change,n=this._change||{},o=e.start,r=o+e.removedCharCount;if(n.baseStart=o,n.baseEnd=r,n.baseText=e.text,n.addedLineCount=e.addedLineCount,!i){this._change=n,n.text=e.text;var s,a,l,d=this._projections;n.start=t(o),-1===n.start&&(n.text=this._model.getText(l.start,o)+n.text,n.addedLineCount+=this._model.getLineAtOffset(o)-this._model.getLineAtOffset(l.start),n.start=l.start+s),n.end=t(r),-1===n.end&&(n.text+=this._model.getText(r,l.end),n.addedLineCount+=this._model.getLineAtOffset(l.end)-this._model.getLineAtOffset(r),n.end=l.start+s)}n.addedCharCount=n.text.length,n.removedCharCount=n.end-n.start,n.removedLineCount=this.getLineAtOffset(n.end)-this.getLineAtOffset(n.start);var c={type:"Changing",text:n.text,start:n.start,removedCharCount:n.removedCharCount,addedCharCount:n.addedCharCount,removedLineCount:n.removedLineCount,addedLineCount:n.addedLineCount};this.onChanging(c)},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e){this._model.setLineDelimiter(e)},setText:function(e,t,i){function n(e){for(r=0,o=0;re-o));r++){var t=s._model.getCharCount();if(s.start+t>e-o)return-1;o+=t-(s.end-s.start)}return e-o}this._change={text:e||"",start:t||0,end:void 0===i?this.getCharCount():i};var o,r,s,a,l,d=this._projections,c=n(this._change.start);-1===c&&(a={projection:s,start:this._change.start-(s.start+o)},c=s.end);var h=n(this._change.end);-1===h&&(l={projection:s,end:this._change.end-(s.start+o)},h=s.start),a&&l&&a.projection===l.projection?s._model.setText(this._change.text,a.start,l.end):(this._model.setText(this._change.text,c,h),a&&(s=a.projection,s._model.setText("",a.start)),l&&(s=l.projection,s._model.setText("",0,l.end),s.start=s.end,s._lineCount=0)),this._change=void 0}},t.EventTarget.addMixin(i.prototype),{ProjectionTextModel:i}}),define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/projectionTextModel","orion/Deferred","orion/editor/util","orion/webui/littlelib","orion/util"],function(e,t,i,n,o,r,s){function a(e,t){this._view=e,this._editor=t;var i=e.getOptions("parent");this._create(i?i.ownerDocument:document)}return a.getTooltip=function(e,t){return e._tooltip||(e._tooltip=new a(e,t)),e._tooltip},a.prototype={_create:function(e){if(!this._tooltipDiv){var t=this._tooltipDiv=s.createElement(e,"div");t.tabIndex=0,t.className="textviewTooltip",t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),this._tooltipDiv.style.visibility="hidden",this._tipShowing=!1,e.body.appendChild(t);var i=this;o.addEventListener(e,"mousedown",this._mouseDownHandler=function(e){i.isVisible()&&(o.contains(t,e.target||e.srcElement)||i._locked||i.hide())},!0),o.addEventListener(e,"scroll",this._scrollHandler=function(e){i.isVisible()&&(o.contains(t,e.target||e.srcElement)||(i._topPixel!==i._view.getTopPixel()||i._leftPixel!==i._view.getHorizontalPixel())&&i.hide())},!0),o.addEventListener(e,"mousemove",this._mouseMoveHandler=function(e){i._prevX&&i._prevX===e.clientX&&i._prevY&&i._prevY===e.clientY||(i._prevX=e.clientX,i._prevY=e.clientY,!i.isVisible()||i._locked||i._hasFocus()||i._isInRect(i._outerArea,e.clientX,e.clientY)||i.hide())},!0),o.addEventListener(t,"focus",function(){i._locked||i._tooltipDiv.classList.add("textViewTooltipOnFocus")},!1),o.addEventListener(t,"blur",function(){i._tooltipDiv.classList.remove("textViewTooltipOnFocus")},!1),o.addEventListener(t,"mouseenter",function(){i._locked||i._tooltipDiv.classList.add("textViewTooltipOnHover")},!1),o.addEventListener(t,"mouseleave",function(){i._hasFocus()||i._tooltipDiv.classList.remove("textViewTooltipOnHover")},!1),o.addEventListener(t,"keydown",function(e){27===e.keyCode&&(i._locked||i.hide())},!1),this._view.addEventListener("Destroy",function(){i.destroy()})}},destroy:function(){if(this._tooltipDiv){this.hide();var e=this._tooltipDiv.parentNode;e&&e.removeChild(this._tooltipDiv);var t=this._tooltipDiv.ownerDocument;o.removeEventListener(t,"mousedown",this._mouseDownHandler,!0),o.removeEventListener(t,"scroll",this._scrollHandler,!0),o.removeEventListener(t,"mousemove",this._mouseMoveHandler,!0),this._tooltipDiv=null}},show:function(e,t,i){this._locked=t,this._giveFocus=i,this._topPixel=this._view.getTopPixel(),this._leftPixel=this._view.getHorizontalPixel(),this._processInfo(e.getTooltipInfo())},update:function(e,t){e&&(t?this._showContents(null,e.getTooltipInfo(),!0):this._processInfo(e.getTooltipInfo(),!0))},onHover:function(e,t,i){e&&(this._isInRect(this._anchorArea,t,i)||this._isInRect(this._tooltipArea,t,i)||this._locked||this._hasFocus()||this._processInfo(e.getTooltipInfo()))},hide:function(e){e&&(this._locked=void 0),!this._locked&&this.isVisible()&&(this.hover&&this.hover.clearQuickFixes(),this._hasFocus()&&this._view.focus(),this._tooltipContents&&(this._tooltipDiv.removeChild(this._tooltipContents),this._tooltipContents=null),this._tooltipDiv.classList.remove("textviewTooltipCodeProjection"),this._tooltipDiv.classList.remove("textviewTooltipOnHover"),this._tooltipDiv.classList.remove("textviewTooltipOnFocus"),this._tooltipDiv.style.visibility="hidden",this._tipShowing=!1,this._tooltipDiv.style.left="",this._tooltipDiv.style.right="",this._tooltipDiv.style.top="",this._tooltipDiv.style.bottom="",this._tooltipDiv.style.width="auto",this._tooltipDiv.style.maxWidth="",this._tooltipDiv.style.height="auto",this._tooltipDiv.style.maxHeight="",this._tooltipDiv.style.overflowX="",this._tooltipDiv.style.overflowY="",this._giveFocus=void 0,this._anchorArea=void 0,this._tooltipArea=void 0,this._outerArea=void 0,this._hoverPromises&&this._hoverPromises.forEach(function(e){e.resolved||e.cancel()}),this._hoverPromises=void 0,this._tipRect=void 0)},isVisible:function(){return this._tipShowing},_processInfo:function(e,t){if(this._tooltipDiv){var i;if(t&&this._tooltipContents?(this._tooltipContents.innerHTML="",i=this._tooltipContents):i=s.createElement(this._tooltipDiv.ownerDocument,"div"),e){if(e.contents&&this._renderImmediateInfo(i,e.contents,e.context))return this._showContents(i,e,t),!0;if(this.hover&&e.context&&(this._hoverPromises=this.hover.computeHoverInfo(e.context),this._hoverPromises)){var o=this,r=this._hoverPromises.slice(0);return r.forEach(function(r){n.when(r,function(n){if(o._hoverPromises){var s=o._hoverPromises.indexOf(r);s>=0&&o._hoverPromises.splice(s,1)}n&&o._renderPluginContent(i,n)&&(n.offsetStart&&(e.context.offsetStart=n.offsetStart),n.offsetEnd&&(e.context.offsetEnd=n.offsetEnd),n.allowFullWidth&&(e.allowFullWidth=n.allowFullWidth),o._showContents(i,e,t))},function(e){console&&e&&"Cancel"!==e.name&&(console.log("Error computing hover tooltip"),console.log(e&&e.stack))})}),!0}}}},_showContents:function(e,t,i){i?this._tooltipArea&&t.tooltipArea&&(this._tooltipArea.left!==t.tooltipArea.left||this._tooltipArea.top!==t.tooltipArea.top||this._tooltipArea.width!==t.tooltipArea.width||this._tooltipArea.height!==t.tooltipArea.height)&&(this._anchorArea=null,this._tooltipArea=null,this._outerArea=null):this.hide(),e&&(this._tooltipContents&&this._tooltipDiv.removeChild(this._tooltipContents),this._tooltipContents=e,this._tooltipDiv.appendChild(e)),this._anchorArea||(this._anchorArea=this._computeAnchorArea(t)),this._tooltipArea||(this._tooltipArea=this._computeTooltipArea(t,this._anchorArea,this._tooltipDiv)),this._outerArea||(this._outerArea=this._computeOuterArea(this._anchorArea,this._tooltipArea)),this._tooltipDiv.style.visibility="visible",this._tipShowing=!0,this._giveFocus&&(this._setInitialFocus(this._tooltipDiv),this._giveFocus=void 0)},_computeAnchorArea:function(e){if(e.anchorArea&&e.anchorArea.top&&e.anchorArea.left&&e.anchorArea.height&&e.anchorArea.width)return e.anchorArea;if(e.context){if(e.context.offsetStart&&e.context.offsetEnd){var t=this.mapOffset(e.context.offsetStart,!1),i=this.mapOffset(e.context.offsetEnd,!1);return this._computeRectangleFromOffset(t,i)}if(e.context.offset>=0){var n=this.mapOffset(e.context.offset,!1),o=this._view.getNextOffset(n,{unit:"wordend",count:0}),r=this._view.getNextOffset(o,{unit:"word",count:-1});return this._computeRectangleFromOffset(r,o)}}return{top:0,left:0,height:0,width:0}},_computeTooltipArea:function(e,t,i){var n=i.ownerDocument.documentElement,o=16;if(e.tooltipArea&&e.tooltipArea.top&&e.tooltipArea.left&&e.tooltipArea.height&&e.tooltipArea.width)return i.style.overflowY="auto",i.style.resize="none",i.style.top=e.tooltipArea.top+"px",i.style.left=e.tooltipArea.left+"px",i.style.height=e.tooltipArea.height-o+"px",i.style.width=e.tooltipArea.width-o+"px",e.tooltipArea;var r=i.getBoundingClientRect(),s={width:r.width,height:r.height},a=i.getElementsByTagName("img")[0];a&&!a.complete&&0===a.width&&(s.width+=30);var l=e.position?e.position:"below",d=(this._view._rootDiv?this._view._rootDiv:n).getBoundingClientRect(),c=d.left,h=d.top,u=d.width,p=d.height,f=u,g=p;e.allowFullWidth?s.width>u&&(s.width=u):(f=Math.min(u/2,600),g=Math.min(p/2,400),s.width=Math.min(s.width,f),s.height=Math.min(s.height,g)),i.style.width=s.width-o+"px",s.height=Math.min(i.getBoundingClientRect().height,g),25+o>s.height&&s.width>f-o&&(s.height=40+o);var _=p-(t.top+t.height-h),m=t.top-h,v=u-(t.left+t.width-c);"above"===l&&s.height>m&&s.height<=_?l="below":"below"===l&&s.height>_&&s.height<=m&&(l="above");var y=e.tooltipOffsetX?e.tooltipOffsetX:0,x=e.tooltipOffsetY?e.tooltipOffsetY:0;switch(l){case"left":s.top=s.height+x>_+t.height?p+h-s.height:t.top+x,s.top=Math.max(s.top,h),s.left=Math.max(t.left-s.width+y,c);break;case"right":s.top=s.height+x>_+t.height?p+h-s.height:t.top+x,s.top=Math.max(s.top,h),s.left=Math.max(t.left+t.width+y,c);break;case"above":s.left=s.width+y>v+t.width?u+c-s.width:t.left+y,s.left=Math.max(s.left,c),s.top=Math.max(t.top-s.height+x,h);break;case"below":s.left=s.width+y>v+t.width?u+c-s.width:t.left+y,s.left=Math.max(s.left,c),s.top=Math.max(t.top+t.height+x,h)}return s.maxWidth=Math.min(u+c-s.left,u),s.maxHeight=Math.min(p+h-s.top,p),i.style.maxWidth=s.maxWidth-o+"px",i.style.maxHeight=s.maxHeight-o+"px",i.style.width=s.width-o+"px",i.style.height=s.height-o+"px",i.style.left=s.left+"px",i.style.top=s.top+"px",s},_computeOuterArea:function(e,t){var i=Math.min(e.left,t.left),n=Math.min(e.top,t.top),o=e.left+e.width,r=t.left+t.width,s=Math.max(o,r),a=e.top+e.height,l=t.top+t.height,d=Math.max(a,l);return{left:i,top:n,width:s-i,height:d-n}},_hasFocus:function(){var e=this._tooltipDiv;return e?o.contains(e,e.ownerDocument.activeElement):!1},_isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},_setInitialFocus:function(e){var t=r.$("button",e);if(t)return void t.focus();var i=r.$("a",e);if(i){i.focus();var n=this;return void i.addEventListener("click",function(){n.hide()})}var o=r.firstTabbable(e);o&&o.focus()},_isInRect:function(e,t,i){if(!e)return!1;var n=t>=e.left&&t<=e.left+e.width,o=i>=e.top&&i<=e.top+e.height;return n&&o},mapOffset:function(e){var t=this._view,i=t.getModel();return i.getBaseModel&&(e=i.mapOffset(e,!0)),e},_computeRectangleFromOffset:function(e,t){var i,n,o=this._view,r=o.getLineAtOffset(e),s=o.getLineAtOffset(t);if(r!==s){var a=o.getLocationAtOffset(e).y;i=0;for(var l=0;s>=r;){i+=o.getLineHeight(r);var d=o.getModel().getLineEnd(r),c=o.getLocationAtOffset(d).x;c>t&&(l=c),r++}var h=o.getModel().getLineStart(s),u=o.getLocationAtOffset(h).x;n={x:u,y:a,width:l-u,height:i}}else{var p=o.getLocationAtOffset(e),f=o.getLocationAtOffset(t);i=o.getLineHeight(r),n={x:p.x,y:p.y,width:f.x-p.x,height:i}}return n=this._view.convert(n,"document","page"),{left:n.x,top:n.y,width:n.width,height:n.height}},_renderPluginContent:function(e,t){var i=this._tooltipDiv.ownerDocument;if("string"!=typeof t&&"undefined"==typeof t.content)return!1;var n=s.createElement(i,"div");if(t.title){var o=s.createElement(i,"div");this.hover.renderMarkDown?o.innerHTML=this.hover.renderMarkDown(t.title):o.textContent=t.title,o.classList.add("hoverTooltipTitle"),n.appendChild(o)}var r=s.createElement(i,"div");if("string"==typeof t)r.appendChild(i.createTextNode(t));else switch(t.type){case"delegatedUI":case"html":if(t.content){var a=i.createElement("iframe");a.id="HtmlHover",a.name="HTML Hover",a.type="text/html",a.sandbox="allow-scripts allow-same-origin allow-forms",a.style.border="none",a.style.width="100%",a.style.height="100%",this._tooltipDiv.style.paddingBottom="5px",a.srcdoc=t.content,t.width&&(a.style.width=t.width),t.height&&(a.style.height=t.height),n.style.height="100%",e.style.height="100%",n.appendChild(a)}break;case"markdown":this.hover.renderMarkDown&&(r.innerHTML=this.hover.renderMarkDown(t.content));break;default:r.appendChild(i.createTextNode(t.content))}return n.appendChild(r),e.appendChild(n),!0},_renderImmediateInfo:function(e,n,o){if(n instanceof Array&&(n=this._getAnnotationContents(n,o),!n))return!1;if("string"==typeof n)return e.textContent=n,!0;if(this._isNode(n))return e.appendChild(n),!0;if(n instanceof i.ProjectionTextModel){var r=this._view,s=r.getOptions();s.wrapMode=!1,s.parent=e;var a="tooltipTheme",l=s.themeClass;l?(l=l.replace(a,""),l&&(l=" "+l),l=a+l):l=a,s.themeClass=l;var d=this._contentsView=new t.TextView(s),c={onLineStyle:function(e){r.onLineStyle(e)}};d.addEventListener("LineStyle",c.onLineStyle),d.setModel(n),this._tooltipDiv.appendChild(e),this._tooltipDiv.classList.add("textviewTooltipCodeProjection");var h=d.computeSize();return e.style.width=h.width+8+"px",e.style.height=h.height+8+"px",d.resize(),this._tooltipDiv.removeChild(e),!0}return!1},_getAnnotationContents:function(t,n){function r(e,t,i){var r=e.title,l=s.createElement(p,"div");if(l.className="tooltipRow",e.html){var d=s.createElement(p,"div");d.className="tooltipImage",d.innerHTML=e.html,d.lastChild&&o.addEventListener(d.lastChild,"click",function(){var t=e.start,i=e.end;g.getBaseModel&&(t=g.mapOffset(t,!0),i=g.mapOffset(i,!0)),f.setSelection(t,i,1/3,function(){a.hide()})},!1),l.appendChild(d)}if(!r){var c=_.getLineStart(_.getLineAtOffset(e.start)),h=_.getLineEnd(_.getLineAtOffset(e.end),!0);r=_.getText(c,h)}if("function"==typeof r&&(r=e.title()),"string"==typeof r){var u=s.createElement(p,"span");u.className="tooltipTitle",u.appendChild(p.createTextNode(r)),r=u}return l.appendChild(r),i&&a.hover.renderQuickFixes(e,t,l),n&&(n.offsetStart=e.start,n.offsetEnd=e.end),l}var a=this,l=a.hover?!0:!1;l&&n&&n.source&&n.source.indexOf("ruler")>=0&&t.length>1&&(l=!1);for(var d,c=[],h=0;h0&&m.addProjection({start:0,end:v}),m}var x;if(t.length>0&&this._editor&&(x=this._editor.getAnnotationModel().getAnnotations()),1===t.length){if(u=r(t[0],x,l),u&&u.firstChild){var b=u.firstChild.className;b&&(b+=" "),b+="single",u.firstChild.className=b}return u}var w=s.createElement(p,"div"),C=s.createElement(p,"multi_anno");C.appendChild(p.createTextNode(e.multipleAnnotations)),w.appendChild(C);for(var T=0;Ti;i++){var o=arguments[i];for(var r in o)t.call(o,r)&&(e[r]=o[r])}return e}return{clone:function(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var i=Object.create(Object.getPrototypeOf(t));return e(i,t),i},mixin:e,toArray:function(e){return Array.isArray(e)?e:[e]}}}),define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/editor/eventTarget","orion/editor/tooltip","orion/editor/annotations","orion/objects","orion/util"],function(e,t,i,n,o,r){function s(e){e=e||{},this._domNode=e.domNode,this._model=e.model,this._undoStack=e.undoStack,this._statusReporter=e.statusReporter,this._title=null;var t=this;this._listener={onChanged:function(e){t.onChanged(e)}},this._model&&this._model.addEventListener("Changed",this._listener.onChanged),this.checkDirty()}function a(e){e=e||{},s.call(this,e),this._textViewFactory=e.textViewFactory,this._undoStackFactory=e.undoStackFactory,this._textDNDFactory=e.textDNDFactory,this._annotationFactory=e.annotationFactory,this._zoomRulerFactory=e.zoomRulerFactory,this._foldingRulerFactory=e.foldingRulerFactory,this._lineNumberRulerFactory=e.lineNumberRulerFactory,this._contentAssistFactory=e.contentAssistFactory,this._keyBindingFactory=e.keyBindingFactory,this._hoverFactory=e.hoverFactory,this._syntaxHighlighter=e.syntaxHighlighter,this._annotationStyler=null,this._annotationModel=null,this._annotationRuler=null,this._lineNumberRuler=null,this._overviewRuler=null,this._zoomRuler=null,this._foldingRuler=null,this._contentAssist=null
    -}var l=n.AnnotationType,d="orion.annotation.highlightError";return s.prototype={destroy:function(){this.uninstall(),this._statusReporter=this._domNode=null,this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(e,t){return this.getModel().getText(e,t)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},install:function(){this.installed=!0},isDirty:function(){return this._undoStack?!this._undoStack.isClean():this._dirty},markClean:function(){this.getUndoStack().markClean(),this.setDirty(!1)},onDirtyChanged:function(e){return this.dispatchEvent(e)},onInputChanged:function(e){return this.dispatchEvent(e)},onChanged:function(){this.checkDirty()},reportStatus:function(e,t,i){this._statusReporter&&this._statusReporter(e,t,i)},resize:function(){},setDirty:function(e){this._dirty!==e&&(this._dirty=e,this.onDirtyChanged({type:"DirtyChanged"}))},_setModelText:function(e){this._model&&this._model.setText(e)},setInput:function(e,t,i,n){this._title=e,n||(t?this.reportStatus(t,"error"):null!==i&&void 0!==i&&("string"==typeof i&&this._setModelText(i),this._undoStack&&this._undoStack.reset())),this.checkDirty(),this.onInputChanged({type:"InputChanged",title:e,message:t,contents:i,contentsSaved:n})},setText:function(e,t,i){this.getModel().setText(e,t,i)},uninstall:function(){this.installed=!1}},t.EventTarget.addMixin(s.prototype),a.prototype=new s,o.mixin(a.prototype,{destroy:function(){s.prototype.destroy.call(this),this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._hoverFactory=this._zoomRulerFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationRulerVisible:function(){return this._annotationRulerVisible},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},getFoldingRuler:function(){return this._foldingRuler},getFoldingRulerVisible:function(){return this._foldingRulerVisible},getLineNumberRuler:function(){return this._lineNumberRuler},getLineNumberRulerVisible:function(){return this._lineNumberRulerVisible},getTooltip:function(){return i.Tooltip.getTooltip(this._textView,this)},getZoomRuler:function(){return this._zoomRuler},getZoomRulerVisible:function(){return this._zoomRulerVisible},getModel:function(){if(!this._textView)return null;var e=this._textView.getModel();return e.getBaseModel&&(e=e.getBaseModel()),e},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(e,t){if((this._annotationRulerVisible!==e||t)&&(this._annotationRulerVisible=e,this._annotationRuler)){var i=this._textView;e?i.addRuler(this._annotationRuler,0):i.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(e,t){if(this._foldingRulerVisible!==e||t){if(!e){var i=this.getTextActions();i&&i.expandAnnotations(!0)}if(this._foldingRulerVisible=e,this._foldingRuler){var n=this._textView;n.getModel().getBaseModel&&(e?n.addRuler(this._foldingRuler):n.removeRuler(this._foldingRuler))}}},setLineNumberRulerVisible:function(e,t){if((this._lineNumberRulerVisible!==e||t)&&(this._lineNumberRulerVisible=e,this._lineNumberRuler)){var i=this._textView;e?i.addRuler(this._lineNumberRuler,this._annotationRulerVisible?1:0):i.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(e,t){if((this._overviewRulerVisible!==e||t)&&(this._overviewRulerVisible=e,this._overviewRuler)){var i=this._textView;e?i.addRuler(this._overviewRuler):i.removeRuler(this._overviewRuler)}},setZoomRulerVisible:function(e,t){if((this._zoomRulerVisible!==e||t)&&(this._zoomRulerVisible=e,this._zoomRuler)){var i=this._textView;e?i.addRuler(this._zoomRuler):i.removeRuler(this._zoomRuler)}},mapOffset:function(e,t){var i=this._textView,n=i.getModel();return n.getBaseModel&&(e=n.mapOffset(e,t)),e},getLineAtOffset:function(e){return this.getModel().getLineAtOffset(this.mapOffset(e))},getLineStart:function(e){return this.getModel().getLineStart(e)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelectionText:function(e){var t=this._textView;return t.getSelectionText(e)},getSelection:function(){var e=this._textView,t=e.getSelection(),i=e.getModel();return i.getBaseModel&&(t.start=i.mapOffset(t.start),t.end=i.mapOffset(t.end)),t},getSelections:function(){var e=this._textView,t=e.getModel(),i=e.getSelections();return i.forEach(function(e){t.getBaseModel&&(e.start=t.mapOffset(e.start),e.end=t.mapOffset(e.end))}),i},getStyleAccessor:function(){var e=null;if(this._syntaxHighlighter){var t=this._syntaxHighlighter.getStyler();t&&t.getStyleAccessor&&(e=t.getStyleAccessor())}return e},_expandOffset:function(e){var t=this._textView.getModel(),i=this._annotationModel;if(i&&t.getBaseModel)for(var n=i.getAnnotations(e,e+1);n.hasNext();){var o=n.next();o.type===l.ANNOTATION_FOLDING&&o.expand&&o.expand()}},setCaretOffset:function(e,t,i){var n=this._textView,o=n.getModel();o.getBaseModel&&(this._expandOffset(e),e=o.mapOffset(e,!0)),n.setCaretOffset(e,t,i)},setText:function(e,t,i,n,o){var r=this._textView,s=r.getModel();s.getBaseModel&&(void 0!==t&&(this._expandOffset(t),t=s.mapOffset(t,!0)),void 0!==i&&(this._expandOffset(i),i=s.mapOffset(i,!0))),r.setText(e,t,i,n,o)},setSelection:function(e,t,i,n){var o=this._textView,r=o.getModel();r.getBaseModel&&(this._expandOffset(e),this._expandOffset(t),e=r.mapOffset(e,!0),t=r.mapOffset(t,!0)),o.setSelection(e,t,i,n)},setSelections:function(e,t,i){var n=this,o=this._textView,r=o.getModel();e.forEach(function(e){var t=e.start,i=e.end;r.getBaseModel&&(n._expandOffset(t),n._expandOffset(i),t=r.mapOffset(t,!0),i=r.mapOffset(i,!0)),e.start=t,e.end=i}),o.setSelections(e,t,i)},moveSelection:function(e,t,i,n){t=t||e;var o=this._textView;this.setSelection(e,t,1/3,function(){(void 0===n||n)&&o.focus(),i&&i()})},_getTooltipInfo:function(e,t){var i=this._textView,n=this.getAnnotationModel();if(!n)return null;var o=this._annotationStyler;if(!o)return null;if(!i.isValidTextPosition(e,t))return null;var r=i.getOffsetAtLocation(e,t);if(-1===r)return null;r=this.mapOffset(r);for(var s=o.getAnnotationsByType(n,r,r+1),a=[],l=0;l>0,f=s.getLineStart(p),g=s.getLineEnd(p);s.getBaseModel&&(f=s.mapOffset(f),g=s.mapOffset(g));var _=l.ANNOTATION_CURRENT_LINE,m=l.createAnnotation(_,f,g);h.push(m)}this._currentLineAnnotations=h,o.replaceAnnotations(c,h)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){if(this._textView=this._textViewFactory(),this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this._textView.setOptions({undoStack:this._undoStack}),this.checkDirty()),this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack)),this._contentAssistFactory){var e=this._contentAssistFactory.createContentAssistMode(this);this._contentAssist=e.getContentAssist()}var t=i.Tooltip.getTooltip(this._textView,this);this._hoverFactory&&(this._hover=this._hoverFactory.createHover(this),t.hover=this._hover);var n=this,o=this._textView,r=this;if(this._listener={onModelChanged:function(){r.checkDirty()},onMouseOver:function(e){r._listener.onMouseMove(e)},onMouseDown:function(){r._listener.mouseDown=!0},onMouseUp:function(){r._listener.mouseDown=!1},onMouseMove:function(e){t&&!r._listener.mouseDown&&(e.event.clientX!==r._listener.lastMouseX||e.event.clientY!==r._listener.lastMouseY)&&(r._listener.lastMouseX=e.event.clientX,r._listener.lastMouseY=e.event.clientY,r._hoverTimeout&&(window.clearTimeout(r._hoverTimeout),r._hoverTimeout=null),r._hoverTimeout=window.setTimeout(function(){r._hoverTimeout=null,r._listener&&t.onHover({y:e.y,x:e.x,getTooltipInfo:function(){return r._getTooltipInfo(this.x,this.y)}},e.x,e.y)},175))},onMouseOut:function(){r._hoverTimeout&&(window.clearTimeout(r._hoverTimeout),r._hoverTimeout=null)},onSelection:function(e){t&&t.hide(),r._updateCursorStatus(),r._highlightCurrentLine(e.newValue,e.oldValue)}},o.addEventListener("ModelChanged",this._listener.onModelChanged),o.addEventListener("Selection",this._listener.onSelection),o.addEventListener("MouseOver",this._listener.onMouseOver),o.addEventListener("MouseOut",this._listener.onMouseOut),o.addEventListener("MouseDown",this._listener.onMouseDown),o.addEventListener("MouseUp",this._listener.onMouseUp),o.addEventListener("MouseMove",this._listener.onMouseMove),this._keyBindingFactory){var a;a="function"==typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(n,this._undoStack,this._contentAssist),a&&(this._textActions=a.textActions,this._linkedMode=a.linkedMode,this._sourceCodeActions=a.sourceCodeActions)}var c=function(e){if(void 0!==e&&-1!==e){for(var t=this.getView(),i=t.getModel(),o=this.getAnnotationModel(),r=n.mapOffset(i.getLineStart(e)),s=n.mapOffset(i.getLineEnd(e)),a=o.getAnnotations(r,s),d=null;a.hasNext();){var c=a.next();if(c.type===l.ANNOTATION_BOOKMARK){d=c;break}}d?o.removeAnnotation(d):(d=l.createAnnotation(l.ANNOTATION_BOOKMARK,r,s,n.getText(r,s)),o.addAnnotation(d))}};if(this._annotationFactory){var h=o.getModel();if(h.getBaseModel&&(h=h.getBaseModel()),this._annotationModel=this._annotationFactory.createAnnotationModel(h),this._annotationModel){var u=this._annotationStyler=this._annotationFactory.createAnnotationStyler(o,this._annotationModel);u&&(u.addAnnotationType(l.ANNOTATION_CURRENT_SEARCH),u.addAnnotationType(l.ANNOTATION_MATCHING_SEARCH),u.addAnnotationType(l.ANNOTATION_ERROR),u.addAnnotationType(l.ANNOTATION_WARNING),u.addAnnotationType(l.ANNOTATION_MATCHING_BRACKET),u.addAnnotationType(l.ANNOTATION_CURRENT_BRACKET),u.addAnnotationType(l.ANNOTATION_CURRENT_LINE),u.addAnnotationType(l.ANNOTATION_READ_OCCURRENCE),u.addAnnotationType(l.ANNOTATION_WRITE_OCCURRENCE),u.addAnnotationType(l.ANNOTATION_SELECTED_LINKED_GROUP),u.addAnnotationType(l.ANNOTATION_CURRENT_LINKED_GROUP),u.addAnnotationType(l.ANNOTATION_LINKED_GROUP),u.addAnnotationType(d))}var p=this._annotationFactory.createAnnotationRulers(this._annotationModel),f=this._annotationRuler=p.annotationRuler;f&&(f.onDblClick=c,f.setMultiAnnotationOverlay({html:"
    "}),f.addAnnotationType(l.ANNOTATION_ERROR),f.addAnnotationType(l.ANNOTATION_WARNING),f.addAnnotationType(l.ANNOTATION_TASK),f.addAnnotationType(l.ANNOTATION_BOOKMARK),f.addAnnotationType(l.ANNOTATION_DIFF_ADDED),f.addAnnotationType(l.ANNOTATION_DIFF_DELETED),f.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED)),this.setAnnotationRulerVisible(this._annotationRulerVisible||void 0===this._annotationRulerVisible,!0),f=this._overviewRuler=p.overviewRuler,f&&(f.addAnnotationType(l.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(l.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(l.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(l.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType(l.ANNOTATION_CURRENT_BLAME),f.addAnnotationType(l.ANNOTATION_ERROR),f.addAnnotationType(l.ANNOTATION_WARNING),f.addAnnotationType(l.ANNOTATION_TASK),f.addAnnotationType(l.ANNOTATION_BOOKMARK),f.addAnnotationType(l.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(l.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(l.ANNOTATION_CURRENT_LINE),f.addAnnotationType(l.ANNOTATION_DIFF_ADDED),f.addAnnotationType(l.ANNOTATION_DIFF_DELETED),f.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED)),this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._zoomRulerFactory&&(this._zoomRuler=this._zoomRulerFactory.createZoomRuler(this._annotationModel),this.setZoomRulerVisible(this._zoomRulerVisible,!0)),this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_BLAME),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_ADDED),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_MODIFIED),this._lineNumberRuler.addAnnotationType(l.ANNOTATION_DIFF_DELETED),this._lineNumberRuler.onDblClick=c,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||void 0===this._lineNumberRulerVisible,!0)),this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(l.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));var g={type:"TextViewInstalled",textView:o};this.dispatchEvent(g),s.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var e=this._textView;if(e){e.destroy(),this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._zoomRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotations=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._zoomRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0;var t={type:"TextViewUninstalled",textView:e};this.dispatchEvent(t),s.prototype.uninstall.call(this)}},_updateCursorStatus:function(){for(var t=this.getKeyModes(),i=0;i1)o=r.formatMessage(e.multiSelections,a.length);else{var l=a[0].getCaret(),d=s.getLineAtOffset(l),c=s.getLineStart(d),h=l-c;o=localStorage.languageTools?r.formatMessage(e.lineColumnOffset,d+1,h+1,l):r.formatMessage(e.lineColumn,d+1,h+1)}this.reportStatus(o)},showAnnotations:function(e,t,i,n){var o=this._annotationModel;if(o){for(var r,s=[],a=[],d=o.getTextModel(),c=o.getAnnotations();c.hasNext();)r=c.next(),-1!==t.indexOf(r.type)&&r.creatorID===this&&s.push(r);if(e)for(var h=0;h',s.blame=e,s})},showDiffAnnotations:function(e){this.showAnnotations(e,[l.ANNOTATION_DIFF_ADDED,l.ANNOTATION_DIFF_MODIFIED,l.ANNOTATION_DIFF_DELETED],null,function(e){return"added"===e.type?l.ANNOTATION_DIFF_ADDED:"modified"===e.type?l.ANNOTATION_DIFF_MODIFIED:l.ANNOTATION_DIFF_DELETED})},showSelection:function(e,t,i,n,o){if("number"==typeof e)return"number"!=typeof t&&(t=e),this.moveSelection(e,t),!0;if("number"==typeof i){var r=this.getModel(),s=r.getLineStart(i-1);return"number"==typeof n&&(s+=n),"number"!=typeof o&&(o=0),this.moveSelection(s,s+o),!0}return!1},_setModelText:function(e){this._textView&&(this._textView.setText(e),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelections()))},setInput:function(e,t,i,n,o){s.prototype.setInput.call(this,e,t,i,n),!this._textView||n||o||this._textView.focus()},onGotoLine:function(e,t,i,n){if(this._textView){var o=this.getModel();e=Math.max(0,Math.min(e,o.getLineCount()-1));var r=o.getLineStart(e),s=0;if(void 0===i&&(i=0),"string"==typeof t){var a=o.getLine(e).indexOf(t);-1!==a&&(s=a,i=s+t.length)}else{s=t;var l=o.getLineEnd(e)-r;s=Math.min(s,l),i=Math.min(i,l)}this.moveSelection(r+s,r+i,n)}}}),{BaseEditor:s,Editor:a}}),define("orion/editor/find",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/keyModes","orion/editor/annotations","orion/regex","orion/objects","orion/Deferred","orion/util"],function(e,t,i,n,o,r,s,a){function l(e){var t=e.getTextView();i.KeyMode.call(this,t),this.editor=e,this._active=!1,this._success=!0,this._ignoreSelection=!1,this._prefix="",t.setAction("incrementalFindCancel",function(){return this.setActive(!1),!0}.bind(this)),t.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));var n=this;this._listener={onVerify:function(e){var t=n.editor,i=t.getModel(),r=t.mapOffset(e.start),s=t.mapOffset(e.end),a=i.getText(r,s),l=n._prefix,d=l.match(new RegExp("^"+o.escape(a),"i"));d&&d.length>0&&(l=n._prefix+=e.text,n._success=!0,n._status(),n.find(n._forward,!0),e.text=null)},onSelection:function(){n._ignoreSelection||n.setActive(!1)}}}function d(e,t,i){if(e){this._editor=e,this._undoStack=t,this._showAll=!0,this._visible=!1,this._caseInsensitive=!0,this._wrap=!0,this._wholeWord=!1,this._incremental=!0,this._regex=!1,this._findAfterReplace=!0,this._hideAfterFind=!1,this._reverse=!1,this._start=void 0,this._end=void 0,this._timer=void 0,this._lastString="";var n=this;this._listeners={onEditorFocus:function(e){n._removeCurrentAnnotation(e)}},this.setOptions(i)}}var c={};return l.prototype=new i.KeyMode,r.mixin(l.prototype,{createKeyBindings:function(){var e=t.KeyBinding,i=[];return i.push({actionID:"incrementalFindBackspace",keyBinding:new e(8)}),i.push({actionID:"incrementalFindCancel",keyBinding:new e(13)}),i.push({actionID:"incrementalFindCancel",keyBinding:new e(27)}),i.push({actionID:"incrementalFindReverse",keyBinding:new e(38)}),i.push({actionID:"incrementalFind",keyBinding:new e(40)}),i.push({actionID:"incrementalFindReverse",keyBinding:new e("k",!0,!0)}),i.push({actionID:"incrementalFind",keyBinding:new e("k",!0)}),i},find:function(e,t){if(this._forward=e,!this.isActive())return this.setActive(!0),!1;var i=this._prefix;if(0===i.length)return!1;var n,o=this.editor,r=o.getModel();return n=e?this._success?t?this._start:o.getCaretOffset()+1:0:this._success?t?this._start:o.getCaretOffset():r.getCharCount()-1,s.when(o.getModel().find({string:i,start:n,reverse:!e,caseInsensitive:i.toLowerCase()===i}),function(i){var r=i.next();r?(t||(this._start=n),this._success=!0,this._ignoreSelection=!0,o.moveSelection(e?r.start:r.end,e?r.end:r.start),this._ignoreSelection=!1):this._success=!1,this._status()}.bind(this)),!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(e){if(this._active!==e){this._active=e,this._prefix="",this._success=!0;var t=this.editor,i=t.getTextView();this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(i.addEventListener("Verify",this._listener.onVerify),i.addEventListener("Selection",this._listener.onSelection),i.addKeyMode(this)):(i.removeEventListener("Verify",this._listener.onVerify),i.removeEventListener("Selection",this._listener.onSelection),i.removeKeyMode(this)),this._status()}},_backspace:function(){var e=this._prefix;return e=this._prefix=e.substring(0,e.length-1),0===e.length?(this._success=!0,this._ignoreSelection=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(!this.isActive())return void this.editor.reportStatus("");var t;t=this._forward?this._success?e.incrementalFindStr:e.incrementalFindStrNotFound:this._success?e.incrementalFindReverseStr:e.incrementalFindReverseStrNotFound,t=a.formatMessage(t,this._prefix),this.editor.reportStatus(t,this._success?"":"error")}}),c.IncrementalFind=l,d.prototype={find:function(e,t,i){this.setOptions({reverse:!e});var n,o=this.getFindString();t&&(o=t.findString||o,n=t.count);var r=this.getOptions();this.setOptions(t);var s=i?this._startOffset:this.getStartOffset();return this._doFind(o,s,n).then(function(e){return e&&(i||(this._startOffset=e.start)),this.setOptions(r),this._hideAfterFind&&this.hide(),e}.bind(this))},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var e=this._editor.getSelection(),t=this._editor.getText(e.start,e.end);return this._regex&&(t=o.escape(t)),t||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1,this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null)),this._removeAllAnnotations();var e=this._editor.getTextView();e&&(e.removeEventListener("Focus",this._listeners.onEditorFocus),e.focus())},_processReplaceString:function(e){var t=e;if(this._regex){t="";for(var i=!1,n=this._editor.getModel().getLineDelimiter(),o=0;o0&&(r.endUndo(),n.setRedraw(!0)),s>0?i.reportStatus(a.formatMessage(e.replacedMatches,l)):i.reportStatus(e.nothingReplaced,"error"),r._replacingAll=!1},100)}},setOptions:function(e){if(e){if((e.showAll===!0||e.showAll===!1)&&this._showAll!==e.showAll&&(this._showAll=e.showAll,this.isVisible()))if(this._showAll)this._markAllOccurrences();else{var t=this._editor.getAnnotationModel();t&&t.removeAnnotations(n.AnnotationType.ANNOTATION_MATCHING_SEARCH)}(e.caseInsensitive===!0||e.caseInsensitive===!1)&&(this._caseInsensitive=e.caseInsensitive),(e.wrap===!0||e.wrap===!1)&&(this._wrap=e.wrap),(e.wholeWord===!0||e.wholeWord===!1)&&(this._wholeWord=e.wholeWord),(e.incremental===!0||e.incremental===!1||"disabled"===e.incremental)&&("disabled"===e.incremental?(this._incremental=!1,this._incrementalDisabled=!0):this._incremental=e.incremental),(e.regex===!0||e.regex===!1)&&(this._regex=e.regex),(e.findAfterReplace===!0||e.findAfterReplace===!1)&&(this._findAfterReplace=e.findAfterReplace),(e.hideAfterFind===!0||e.hideAfterFind===!1)&&(this._hideAfterFind=e.hideAfterFind),(e.reverse===!0||e.reverse===!1)&&(this._reverse=e.reverse),e.hasOwnProperty("findCallback")&&(this._findCallback=e.findCallback),e.hasOwnProperty("start")&&(this._start=e.start),e.hasOwnProperty("end")&&(this._end=e.end)}},show:function(e){this._visible=!0,e&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(e)),this._startOffset=this._editor.getSelection().start,this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var t=this;window.setTimeout(function(){t._incremental&&t.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_findFromModel:function(e,t,i){return this._editor.getModel().find({string:e,start:t,end:this._end,reverse:this._reverse,wrap:i?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_find:function(e,t,i,n){var o;if(this._regex)try{o=this._findFromModel(t,i,n)}catch(r){return e.reportStatus(r.message,"error"),null}else o=this._findFromModel(t,i,n);return o},_doFindForReplaceAll:function(e,t,i,n){i=i||1;var o=this._editor;if(!e)return this._removeAllAnnotations(),null;this._lastString=e;var r,s;if(s=this._find(o,e,t,n),!s)return null;if(!s.hasNext||!s.next)return null;for(var a=0;i>a&&s.hasNext();a++)r=s.next();return r},_doFind:function(t,i,o,r){o=o||1;var a=this._editor;if(!t)return this._removeAllAnnotations(),(new s).resolve();this._lastString=t;var l;return s.when(this._find(a,t,i,r)).then(function(t){if(t){for(var i=0;o>i&&t.hasNext();i++)l=t.next();if(!this._replacingAll){if(l?this._editor.reportStatus(""):this._editor.reportStatus(e.notFound,"error"),this.isVisible()){var r=n.AnnotationType.ANNOTATION_CURRENT_SEARCH,s=a.getAnnotationModel();if(s&&(s.removeAnnotations(r),l&&s.addAnnotation(n.AnnotationType.createAnnotation(r,l.start,l.end))),this._showAll){this._timer&&window.clearTimeout(this._timer);var d=this;this._timer=window.setTimeout(function(){d._markAllOccurrences(),d._timer=null},500)}}this._findCallback?this._findCallback(l):l&&a.moveSelection(l.start,l.end,null,!1)}return l}}.bind(this))},_doReplace:function(e,t,i,n){var o=this._editor;this._regex&&(n=o.getText(e,t).replace(new RegExp(i,this._caseInsensitive?"i":""),n)),o.setText(n,e,t),o.setSelection(e,e+n.length,!0)},_markAllOccurrences:function(){var e=this._editor.getAnnotationModel();if(e){for(var t,i=n.AnnotationType.ANNOTATION_MATCHING_SEARCH,o=e.getAnnotations(),r=[];o.hasNext();){var a=o.next();a.type===i&&r.push(a)}if(this.isVisible()){var l=this.getFindString();s.when(this._editor.getModel().find({string:l,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})).then(function(o){if(o){for(t=[];o.hasNext();){var s=o.next();t.push(n.AnnotationType.createAnnotation(i,s.start,s.end))}e.replaceAnnotations(r,t)}}.bind(this))}else e.replaceAnnotations(r,t)}},_removeAllAnnotations:function(){var e=this._editor.getAnnotationModel();e&&(e.removeAnnotations(n.AnnotationType.ANNOTATION_CURRENT_SEARCH),e.removeAnnotations(n.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(n.AnnotationType.ANNOTATION_CURRENT_SEARCH)}},c.Find=d,c}),define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(e,t,i,n,o){function r(e,i,n){t.Find.call(this,e,i,n)}return r.prototype=new t.Find,i.mixin(r.prototype,{getFindString:function(){var e=this._findInput;return e?e.value:t.Find.prototype.getFindString.call(this)},getReplaceString:function(){var e=this._replaceInput;return e?e.value:t.Find.prototype.getReplaceString(this)},hide:function(){var e=this.isVisible();t.Find.prototype.hide.call(this),e&&(this._rootDiv.className="textViewFind")},show:function(e){t.Find.prototype.show.call(this,e);var i=e.findString,n=e.replaceString,o=this._findInput;if(o||(this._create(),o=this._findInput),i&&(o.value=i),n){var r=this._replaceInput;r.value=n}var s=this;window.setTimeout(function(){s._rootDiv.className="textViewFind show",o.select(),o.focus()},0)},_create:function(){var t=this,i=this._editor.getTextView(),r=i.getOptions("parent"),s=r.ownerDocument,a=o.createElement(s,"div");a.className="textViewFind",n.addEventListener(a,"keydown",function(e){t._handleKeyDown(e)}),this._rootDiv=a,a.setAttribute("role","dialog"),a.setAttribute("aria-label",e.findReplace),this._createContents(s,a),i._rootDiv.insertBefore(a,i._rootDiv.firstChild)},_createContents:function(t,i){var r=this,s=o.createElement(t,"input");s.className="textViewFindInput",this._findInput=s,s.type="text",s.placeholder=e.findWith,n.addEventListener(s,"input",function(e){return r._handleInput(e)}),i.appendChild(s);var a=o.createElement(t,"span");r._createButton(t,a,e.next,function(){r.find(!0)}),r._createButton(t,a,e.previous,function(){r.find(!1)}),i.appendChild(a);var l=r._editor.getTextView().getOptions("readonly");if(!l){var d=o.createElement(t,"input");d.className="textViewReplaceInput",this._replaceInput=d,d.type="text",d.placeholder=e.replaceWith,i.appendChild(d),a=o.createElement(t,"span"),r._createButton(t,a,e.replace,function(){r.replace()}),r._createButton(t,a,e.replaceAll,function(){r.replaceAll() -}),i.appendChild(a)}a=o.createElement(t,"span"),r._createButton(t,a,e.regex,function(e){r._toggle("regex",e.target)},this._regex,e.regexTooltip,e.regexTooltip),r._createButton(t,a,e.caseInsensitive,function(e){r._toggle("caseInsensitive",e.target)},this._caseInsensitive,e.caseInsensitiveTooltip,e.caseInsensitiveTooltip),r._createButton(t,a,e.wholeWord,function(e){r._toggle("wholeWord",e.target)},this._wholeWord,e.wholeWordTooltip,e.wholeWordTooltip),i.appendChild(a);var c=r._createButton(t,i,"",function(){r.hide()});c.className="textViewFindCloseButton",c.title=e.closeTooltip,o.confineDialogTab(s,c)},_createButton:function(e,t,i,o,r,s,a){var l=e.createElement("button");return l.type="button",this._checked(r,l),s&&(l.title=s),n.addEventListener(l,"click",function(e){o.call(this,e)},!1),i&&l.appendChild(e.createTextNode(i)),a&&l.setAttribute("aria-label",a),t.appendChild(l),l},_toggle:function(e,t){var i={};i[e]=!this["_"+e],this.setOptions(i),this._checked(i[e],t)},_checked:function(e,t){t.className="textViewFindButton",e&&(t.className+=" checked")},_handleInput:function(){return this._incremental&&this.find(!0,null,!0),!0},_handleKeyDown:function(e){var t,i=(o.isMac?e.metaKey:e.ctrlKey)&&!e.altKey&&!e.shiftKey;return i&&70===e.keyCode&&(t=!0),((o.isMac?e.metaKey:e.ctrlKey)&&!e.altKey&&75===e.keyCode||13===e.keyCode)&&(this.find(13===e.keyCode?this._reverse?e.shiftKey:!e.shiftKey:!e.shiftKey),t=!0),i&&82===e.keyCode&&(this.replace(),t=!0),27===e.keyCode&&(this.hide(),t=!0),t?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,!1):!0}}),{FindUI:r}}),define("orion/editor/actions",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/annotations","orion/editor/tooltip","orion/editor/find","orion/editor/findUI","orion/util"],function(e,t,i,n,o,r,s){function a(e,t,i,n){function o(e,t,i){s.setText(e,t,i),r+=t-i+e.length}var r=0,s=e.editor,a=s.getSelections();!n&&(t||a.length>1)&&e.startUndo(),a.forEach(function(e){e.start+=r,e.end+=r,i(e,o)}),s.setSelections(a),!n&&(t||a.length>1)&&e.endUndo()}function l(e,t,i){this.editor=e,this.undoStack=t,this._incrementalFind=new o.IncrementalFind(e),this._find=i?i:new r.FindUI(e,t),this._lastEditLocation=null,this.init()}function d(e,t,i,n){this.editor=e,this.undoStack=t,this.contentAssist=i,this.linkedMode=n,this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",this.contentAssistProposalApplied.bind(this)),this.init()}var c=i.AnnotationType,h={};return l.prototype={init:function(){var i=this.editor.getTextView();this._lastEditListener={onModelChanged:function(e){this.editor.isDirty()&&(this._lastEditLocation=e.start+e.addedCharCount)}.bind(this)},i.addEventListener("ModelChanged",this._lastEditListener.onModelChanged),i.setAction("undo",function(e){if(this.undoStack){var t=1;for(e&&e.count&&(t=e.count);t>0;)this.undoStack.undo(),--t;return!0}return!1}.bind(this),{name:e.undo}),i.setAction("redo",function(e){if(this.undoStack){var t=1;for(e&&e.count&&(t=e.count);t>0;)this.undoStack.redo(),--t;return!0}return!1}.bind(this),{name:e.redo}),i.setKeyBinding(new t.KeyBinding("f",!0),"find"),i.setAction("find",function(){if(this._find){var e=this.editor.getSelection();return this._find.show({findString:this.editor.getText(e.start,e.end)}),!0}return!1}.bind(this),{name:e.find}),i.setKeyBinding(new t.KeyBinding("k",!0),"findNext"),i.setAction("findNext",function(e){return this._find?(this._find.find(!0,e),!0):!1}.bind(this),{name:e.findNext}),i.setKeyBinding(new t.KeyBinding("k",!0,!0),"findPrevious"),i.setAction("findPrevious",function(e){return this._find?(this._find.find(!1,e),!0):!1}.bind(this),{name:e.findPrevious}),i.setKeyBinding(new t.KeyBinding("j",!0),"incrementalFind"),i.setAction("incrementalFind",function(){return this._incrementalFind&&this._incrementalFind.find(!0),!0}.bind(this),{name:e.incrementalFind}),i.setKeyBinding(new t.KeyBinding("j",!0,!0),"incrementalFindReverse"),i.setAction("incrementalFindReverse",function(){return this._incrementalFind&&this._incrementalFind.find(!1),!0}.bind(this),{name:e.incrementalFindReverse}),i.setAction("tab",function(){return this.indentLines()}.bind(this)),i.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:e.unindentLines}),i.setKeyBinding(new t.KeyBinding(38,!1,!1,!0),"moveLinesUp"),i.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:e.moveLinesUp}),i.setKeyBinding(new t.KeyBinding(40,!1,!1,!0),"moveLinesDown"),i.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:e.moveLinesDown}),i.setKeyBinding(new t.KeyBinding(38,!0,!1,!0),"copyLinesUp"),i.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:e.copyLinesUp}),i.setKeyBinding(new t.KeyBinding(40,!0,!1,!0),"copyLinesDown"),i.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:e.copyLinesDown}),i.setKeyBinding(new t.KeyBinding("d",!0,!1,!1),"deleteLines"),i.setAction("deleteLines",function(e){return this.deleteLines(e)}.bind(this),{name:e.deleteLines}),i.setKeyBinding(new t.KeyBinding("l",!s.isMac,!1,!1,s.isMac),"gotoLine"),i.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:e.gotoLine}),i.setKeyBinding(new t.KeyBinding(190,!0),"nextAnnotation"),i.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:e.nextAnnotation}),i.setKeyBinding(new t.KeyBinding(188,!0),"previousAnnotation"),i.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:e.prevAnnotation}),i.setKeyBinding(new t.KeyBinding("e",!0,!1,!0,!1),"expand"),i.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:e.expand}),i.setKeyBinding(new t.KeyBinding("c",!0,!1,!0,!1),"collapse"),i.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:e.collapse}),i.setKeyBinding(new t.KeyBinding("e",!0,!0,!0,!1),"expandAll"),i.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:e.expandAll}),i.setKeyBinding(new t.KeyBinding("c",!0,!0,!0,!1),"collapseAll"),i.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:e.collapseAll}),i.setKeyBinding(new t.KeyBinding("q",!s.isMac,!1,!1,s.isMac),"lastEdit"),i.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:e.lastEdit})},copyLinesDown:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var i=e.getModel();return a(this,!1,function(e,t){var n=i.getLineAtOffset(e.start),o=i.getLineAtOffset(e.end>e.start?e.end-1:e.end),r=i.getLineStart(n),s=i.getLineEnd(o,!0),a=i.getLineCount(),l="",d=i.getText(r,s);o===a-1&&(d=(l=i.getLineDelimiter())+d);var c=s;t(d,c,c),e.start=c+l.length,e.end=c+d.length}),!0},copyLinesUp:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var i=e.getModel();return a(this,!1,function(e,t){var n=i.getLineAtOffset(e.start),o=i.getLineAtOffset(e.end>e.start?e.end-1:e.end),r=i.getLineStart(n),s=i.getLineEnd(o,!0),a=i.getLineCount(),l="",d=i.getText(r,s);o===a-1&&(d+=l=i.getLineDelimiter());var c=r;t(d,c,c),e.start=c,e.end=c+d.length-l.length}),!0},deleteLines:function(e){var t=this.editor,i=t.getTextView();if(i.getOptions("readonly"))return!1;var n=1;e&&e.count&&(n=e.count);var o=t.getModel();return a(this,!1,function(e,t){var i,r=o.getLineAtOffset(e.start),s=o.getLineStart(r);i=e.start!==e.end||1===n?o.getLineAtOffset(e.end>e.start?e.end-1:e.end):Math.min(r+n-1,o.getLineCount()-1);var a=o.getLineEnd(i,!0);t("",s,a),e.start=e.end=s}),!0},expandAnnotation:function(e){var t=this.editor;if(!t.getFoldingRulerVisible())return!0;var n=t.getAnnotationModel();if(!n)return!0;var o=t.getModel(),r=t.getCaretOffset(),s=o.getLineAtOffset(r),a=o.getLineStart(s),l=o.getLineEnd(s,!0);o.getBaseModel&&(a=o.mapOffset(a),l=o.mapOffset(l),o=o.getBaseModel());for(var d,c=n.getAnnotations(a,l);!d&&c.hasNext();){var h=c.next();h.type===i.AnnotationType.ANNOTATION_FOLDING&&(d=h)}return d&&e!==d.expanded&&(e?d.expand():(t.setCaretOffset(d.start),d.collapse())),!0},expandAnnotations:function(e){var t=this.editor;if(!t.getFoldingRulerVisible())return!0;var n=t.getTextView(),o=t.getAnnotationModel();if(!o)return!0;var r,s=o.getAnnotations();for(n.setRedraw(!1);s.hasNext();)r=s.next(),r.type===i.AnnotationType.ANNOTATION_FOLDING&&e!==r.expanded&&(e?r.expand():r.collapse());return n.setRedraw(!0),!0},indentLines:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;if(t.getOptions("tabMode")){var i=e.getModel(),n=0,o=e.getSelections();return o.length>1&&this.startUndo(),o.some(function(r){r.start+=n,r.end+=n;var s=i.getLineAtOffset(r.start),a=i.getLineAtOffset(r.end>r.start?r.end-1:r.end);if(!(s!==a||o.length>1))return!0;var l=[];l.push("");for(var d=s;a>=d;d++)l.push(i.getLine(d,!0));var c=i.getLineStart(s),h=i.getLineEnd(a,!0),u=t.getOptions("tabSize","expandTab"),p=u.expandTab?new Array(u.tabSize+1).join(" "):" ",f=l.join(p);e.setText(f,c,h);var g=c===r.start?r.start:r.start+p.length,_=r.end+(a-s+1)*p.length;return n+=c-h+f.length,r.start=g,r.end=_,!1})?!1:(e.setSelections(o),o.length>1&&this.endUndo(),!0)}},gotoLastEdit:function(){return"number"==typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation),!0},gotoLine:function(){var t=this.editor,i=t.getModel(),n=i.getLineAtOffset(t.getCaretOffset());return n=prompt(e.gotoLinePrompty,n+1),n&&(n=parseInt(n,10),t.onGotoLine(n-1,0)),!0},moveLinesDown:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var i=e.getModel();return a(this,!0,function(e,t){var n=i.getLineAtOffset(e.start),o=i.getLineAtOffset(e.end>e.start?e.end-1:e.end),r=i.getLineCount();if(o!==r-1){var s,a=i.getLineStart(n),l=i.getLineEnd(o,!0),d=i.getLineEnd(o+1,!0)-(l-a),c=0;if(o!==r-2)s=i.getText(a,l);else{var h=i.getLineEnd(o);s=i.getText(h,l)+i.getText(a,h),c+=l-h}t("",a,l),t(s,d,d),e.start=d+c,e.end=d+c+s.length}}),!0},moveLinesUp:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var i=e.getModel();return a(this,!0,function(e,t){var n=i.getLineAtOffset(e.start);if(0!==n){var o=i.getLineAtOffset(e.end>e.start?e.end-1:e.end),r=i.getLineCount(),s=i.getLineStart(n-1),a=i.getLineStart(n),l=i.getLineEnd(o,!0),d=i.getText(a,l),c=0;if(o===r-1){var h=i.getLineEnd(n-1),u=i.getLineEnd(n-1,!0);d+=i.getText(h,u),a=h,c=u-h}t("",a,l),t(d,s,s),e.start=s,e.end=s+d.length-c}}),!0},nextAnnotation:function(e){function t(e){return!!e.lineStyle||e.type===c.ANNOTATION_MATCHING_BRACKET||e.type===c.ANNOTATION_CURRENT_BRACKET||!r.isAnnotationTypeVisible(e.type)}var i=this.editor,o=i.getAnnotationModel();if(!o)return!0;var r=i.getOverviewRuler()||i.getAnnotationStyler();if(!r)return!0;for(var s=i.getModel(),a=i.getCaretOffset(),l=o.getAnnotations(e?a:0,e?s.getCharCount():a),d=null;l.hasNext();){var h=l.next();if(e){if(h.start<=a)continue}else if(h.start>=a)continue;if(!t(h)&&(d=h,e))break}if(d){var u=[d];for(l=o.getAnnotations(d.start,d.start);l.hasNext();)h=l.next(),h===d||t(h)||u.push(h);var p=i.getTextView(),f=n.Tooltip.getTooltip(p,i);if(!f)return i.moveSelection(d.start),!0;i.moveSelection(d.start,d.start,function(){setTimeout(function(){var e=i.getTextView(),t=d.start,n=e.getLocationAtOffset(t);f.show({x:n.x,y:n.y,getTooltipInfo:function(){return i._getTooltipInfo(this.x,this.y)}},!1,!1)},0)})}return!0},unindentLines:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;if(t.getOptions("tabMode")){var i=e.getModel();return a(this,!1,function(e,n){for(var o=i.getLineAtOffset(e.start),r=i.getLineAtOffset(e.end>e.start?e.end-1:e.end),s=t.getOptions("tabSize"),a=new Array(s+1).join(" "),l=[],d=0,c=0,h=o;r>=h;h++){var u=i.getLine(h,!0);if(i.getLineStart(h)!==i.getLineEnd(h))if(0===u.indexOf(" "))u=u.substring(1),d++;else{if(0!==u.indexOf(a))return!0;u=u.substring(s),d+=s}h===o&&(c=d),l.push(u)}var p=i.getLineStart(o),f=i.getLineEnd(r,!0),g=i.getLineStart(r),_=l.join("");n(_,p,f);var m=p===e.start?e.start:e.start-c,v=Math.max(m,e.end-d+(e.end===g+1&&e.start!==e.end?1:0));e.start=m,e.end=v}),!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}},h.TextActions=l,d.prototype={init:function(){var i=this.editor.getTextView();i.setAction("lineStart",function(){return this.lineStart()}.bind(this)),i.setAction("enter",function(){return this.autoIndent()}.bind(this)),i.setKeyBinding(new t.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces"),i.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:e.trimTrailingWhitespaces}),i.setKeyBinding(new t.KeyBinding(191,!0),"toggleLineComment"),i.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:e.toggleLineComment}),i.setKeyBinding(new t.KeyBinding(191,!0,!s.isMac,!1,s.isMac),"addBlockComment"),i.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:e.addBlockComment}),i.setKeyBinding(new t.KeyBinding(220,!0,!s.isMac,!1,s.isMac),"removeBlockComment"),i.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:e.removeBlockComment}),i.setKeyBinding(new t.KeyBinding("[",!1,!1,!1,!1,"keypress"),"autoPairSquareBracket"),i.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this)),i.setKeyBinding(new t.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket"),i.setAction("skipClosingSquareBracket",function(){return this.handleClosingBracket("]")}.bind(this)),i.setKeyBinding(new t.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket"),i.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this)),i.setKeyBinding(new t.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket"),i.setAction("skipClosingAngleBracket",function(){return this.handleClosingBracket(">")}.bind(this)),i.setKeyBinding(new t.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses"),i.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this)),i.setKeyBinding(new t.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis"),i.setAction("skipClosingParenthesis",function(){return this.handleClosingBracket(")")}.bind(this)),i.setKeyBinding(new t.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces"),i.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this)),i.setKeyBinding(new t.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace"),i.setAction("skipClosingBrace",function(){return this.handleClosingBracket("}")}.bind(this)),i.setKeyBinding(new t.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation"),i.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this)),i.setKeyBinding(new t.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation"),i.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this)),i.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){function e(e,t){if(e.start===e.end){for(var i,o=n.getLineAtOffset(e.start),a=n.getLine(o,!1),u=n.getLineStart(o),p=0,f=e.start-u;f>p&&(32===(i=a.charCodeAt(p))||9===i);)p++;var g,_,m=a.substring(0,p),v=a.substring(0,f),y=a.substring(f);if(h.smartIndentation&&123===a.charCodeAt(_=v.trimRight().length-1)){var x=f-_-1,b=y.length-y.trimLeft().length;return g=125===a.charCodeAt(f+b)?s+m+r+s+m:s+m+r,t(g,e.start-x,e.end+b),e.start=e.end=e.start+s.length+m.length+r.length-x,!0}if(h.autoCompleteComments&&!c.test(v)&&(l.test(v)||d.test(v))){var w,C=l.exec(v);if(C)return g=s+m+" * ",g+=c.test(y)?y.substring(0,y.length-2).trim():y.trim(),n.getLineCount()!==o+1&&d.test(n.getLine(o+1))||(g+=s+m+" */"),t(g,e.start,e.end+y.length),e.start=e.end=e.start+s.length+m.length+3,!0;if(C=d.exec(v))for(var T=o-1;T>=0;T--){var L=n.getLine(T,!1);if(l.test(L))return c.test(y)||47===a.charCodeAt(f)?(g=s+m+"*"+y,w=e.start+s.length+m.length+1):(g=s+m+"* "+y,w=e.start+s.length+m.length+2),t(g,e.start,e.end+y.length),e.start=e.end=w,!0;if(!d.test(L))return!1}return!1}if(c.test(v)&&32===m.charCodeAt(m.length-1))return g=s+m.substring(0,m.length-1),t(g,e.start,e.end),e.start=e.end=e.start+g.length,!0;if(p>0){for(p=f;p]"),r=i.getModel();return a(this,!1,function(i,n){var s,a=i.start===r.getCharCount()?"":r.getText(i.start,i.start+1).trim();i.start===i.end&&o.test(a)?(s=e+t,n(s,i.start,i.start),i.start=i.end=i.start+1):i.start!==i.end?(s=e+r.getText(i.start,i.end)+t,n(s,i.start,i.end),i.start+=1,i.end+=1):(n(e,i.start,i.end),i.start=i.end=i.start+e.length)}),!0},autoPairQuotations:function(e){if(!this.autoPairQuotation)return!1;var t=this.editor,i=t.getTextView();if(i.getOptions("readonly"))return!1;var n=new RegExp("^\"$|^'$"),o=new RegExp("\\w"),r=new RegExp("^$|[)}\\]>]"),s=t.getModel();return a(this,!1,function(t,i){function a(){i(e,t.start,t.end),t.start=t.end=t.start+e.length}var l=0===t.start?"":s.getText(t.start-1,t.start).trim(),d=t.start===s.getCharCount()?"":s.getText(t.start,t.start+1).trim();if(t.start!==t.end){var c=s.getText(t.start,t.end);n.test(c)?a():(i(e+c+e,t.start,t.end),t.start+=1,t.end+=1)}else d===e?t.start=t.end=t.start+1:l===e||n.test(d)||o.test(l)||!r.test(d)?a():(i(e+e,t.start,t.end),t.start=t.end=t.start+e.length)}),!0},contentAssistProposalApplied:function(e){function t(){return"number"==typeof i.escapePosition?i.escapePosition:e.data.start+i.proposal.length}var i=e.data.proposal;if(i.positions&&i.positions.length>0&&this.linkedMode){for(var n=[],o=0;o0&&this.linkedMode)this.linkedMode.enterLinkedMode({groups:i.groups,escapePosition:t()});else if("number"==typeof i.escapePosition){var r=this.editor.getTextView();r.setCaretOffset(i.escapePosition)}return!0},deletePrevious:function(){var e=this.editor,t=e.getTextView();if(t.getOptions("readonly"))return!1;var i=e.getModel();return a(this,!1,function(e,t){if(e.start===e.end){var n=0===e.start?"":i.getText(e.start-1,e.start),o=e.start===i.getCharCount()?"":i.getText(e.start,e.start+1);("("===n&&")"===o||"["===n&&"]"===o||"{"===n&&"}"===o||"<"===n&&">"===o||'"'===n&&'"'===o||"'"===n&&"'"===o)&&t("",e.start,e.start+1)}},!0),!1},_findEnclosingComment:function(e,t,i,n,o){var r,s,a,l,d,c,h,u=e.getLineAtOffset(t),p=e.getLineAtOffset(i);for(r=u;r>=0&&(s=e.getLine(r),a=r===u?t-e.getLineStart(u):s.length,l=s.lastIndexOf(n,a),d=s.lastIndexOf(o,a),!(d>l));r--)if(-1!==l){c=e.getLineStart(r)+l;break}for(r=p;rl));r++)if(-1!==d){h=e.getLineStart(r)+d;break}return{commentStart:c,commentEnd:h}},lineStart:function(){var e=this.editor,t=e.getModel();return a(this,!1,function(e){var i,n=e.getCaret(),o=t.getLineAtOffset(n),r=t.getLineStart(o),s=t.getLine(o);for(i=0;ie.start?e.end-1:e.end);o=n?n.getLineCommentDelimiter(i.getLineStart(r)):"//";for(var a,l=!0,d=[],c=r;s>=c;c++){var h=i.getLine(c,!0);if(a=h.indexOf(o),d.push(a),l&&-1!==a){if(0!==a){var u;for(u=0;a>u;u++){var p=h.charCodeAt(u);if(32!==p&&9!==p)break}l=u===a}}else l=!1}var f,g,_,m=o.length,v=i.getLineStart(r);if(l){for(_=d.length-1;_>=0;_--)a=d[_]+i.getLineStart(r+_),t("",a,a+m);var y=i.getLineStart(s);f=v===e.start?e.start:e.start-m,g=e.end-m*(s-r+1)+(e.end===y+1?m:0)}else{for(_=d.length-1;_>=0;_--)a=i.getLineStart(r+_),t(o,a,a);f=v===e.start?e.start:e.start+m,g=e.end+m*(s-r+1)}e.start=f,e.end=g}),t.setRedraw(!0),!0},trimTrailingWhitespaces:function(){var e=this.editor,t=e.getModel(),i=e.getSelections();e.getTextView().setRedraw(!1),this.startUndo();for(var n=/(\s+$)/,o=t.getLineCount(),r=0;o>r;r++){var s=t.getLine(r),a=n.exec(s);if(a){var l=t.getLineStart(r),d=a[0].length,c=l+a.index;t.setText("",c,c+d),i.forEach(function(e){e.start>c&&(e.start=Math.max(c,e.start-d)),e.start!==e.end&&e.end>c&&(e.end=Math.max(c,e.end-d))})}}this.endUndo(),e.setSelections(i,!1),e.getTextView().setRedraw(!0)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},handleClosingBracket:function(e){var t=this.editor,i=t.getTextView();if(i.getOptions("readonly"))return!1;var n=t.getModel(),o=t.getSelections();if(1===o.length&&o[0].start===o[0].end){var r=o[0].start===n.getCharCount()?"":n.getText(o[0].start,o[0].start+1);if(r===e)return o[0].start=o[0].end=o[0].start+1,t.setSelections(o),!0;var s=n.getLineAtOffset(o[0].start),a=n.getLine(s,!0);if(a.match(/^\s*$/)&&i.getOptions("tabMode")){var l=i.getOptions("tabSize"),d=new Array(l+1).join(" "),c=n.getLineStart(s),h=n.getLineEnd(s);if(c!==h){if(0===a.indexOf(" "))return a=a.substring(1),n.setText(a,c,h),t.setSelection(o[0].start-1,o[0].end-1),!1;if(0===a.indexOf(d))return a=a.substring(l),n.setText(a,c,h),t.setSelection(o[0].start-l,o[0].end-l),!1}}}return!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(e){this.autoPairParentheses=e},setAutoPairBraces:function(e){this.autoPairBraces=e},setAutoPairSquareBrackets:function(e){this.autoPairSquareBrackets=e},setAutoPairAngleBrackets:function(e){this.autoPairAngleBrackets=e},setAutoPairQuotations:function(e){this.autoPairQuotation=e},setAutoCompleteComments:function(e){this.autoCompleteComments=e},setSmartIndentation:function(e){this.smartIndentation=e}},h.SourceCodeActions=d,String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")}),String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")}),h}),define("orion/editor/undoStack",[],function(){function e(e,t,i,n,o){this.model=e,this.offset=t,this.text=i,this.previousText=n,this.type=o}function t(e){this.owner=e,this.changes=[]}function i(e,t){this.size=void 0!==t?t:100,this.reset();var i=this;if(this._listener={onChanging:function(e){i._onChanging(e)},onDestroy:function(e){i._onDestroy(e)}},e.getModel){var n=e.getModel();n.getBaseModel&&(n=n.getBaseModel()),this.model=n,this.setView(e)}else this.shared=!0,this.model=e;this.model.addEventListener("Changing",this._listener.onChanging)}return e.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(e,t){return this._doUndoRedo(this.offset,this.previousText,this.text,e,t),!0},redo:function(e,t){return this._doUndoRedo(this.offset,this.text,this.previousText,e,t),!0},merge:function(e,t,i,n,o){if(n===this.type){if(1===n&&e===this.offset+this.text.length)return this.text+=t,!0;if(-1===n&&o===this.offset)return this.offset=e,this.previousText=i+this.previousText,!0;if(-1===n&&e===this.offset)return this.previousText=this.previousText+i,!0}return!1},_doUndoRedo:function(e,t,i,n,o){if(this.model.setText(t,e,e+i.length),o&&n){var r=n.getModel();r!==this.model&&(e=r.mapOffset(e,!0)),n.setSelection(e,e+t.length)}}},t.prototype={getRedoChanges:function(){for(var e=[],t=0;t=0;t--)e=e.concat(this.changes[t].getUndoChanges());return e},add:function(e){this.changes.push(e)},end:function(e){e&&(this.endSelection=e.getSelections());var t=this.owner;t&&t.end&&t.end()},undo:function(e,t){this.changes.length>1&&e&&e.setRedraw(!1);for(var i=this.changes.length-1;i>=0;i--)this.changes[i].undo(e,!1);t&&e&&e.setSelections(this.startSelection),this.changes.length>1&&e&&e.setRedraw(!0);var n=this.owner;return n&&n.undo&&n.undo(),this.changes.length>0},redo:function(e,t){this.changes.length>1&&e&&e.setRedraw(!1);for(var i=0;i1,e&&e.setRedraw(!0);var n=this.owner;return n&&n.redo&&n.redo(),this.changes.length>0},merge:function(e,t,i,n,o,r){var s=this.changes.length;return s>0&&this===r?this.changes[s-1].merge(e,t,i,n,o):!1},start:function(e){e&&(this.startSelection=e.getSelections());var t=this.owner;t&&t.start&&t.start()}},i.prototype={destroy:function(){this._onDestroy()},add:function(e){if(this.compoundChange)this.compoundChange.add(e);else{var t=this.stack.length;this.stack.splice(this.index,t-this.index,e),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--)}},markClean:function(){this._commitUndo(),this.cleanChange=this.stack[this.index-1],this.cleanChange&&(this.cleanChange.type=2)},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view),this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var e=[],t=this.index;t=0;t--)e=e.concat(this.stack[t].getUndoChanges());return e},undo:function(){this._commitUndo();var e,t=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;e=this.stack[--this.index]}while(!(t=e.undo(this.view,!0)));return this._ignoreUndo=!1,t},redo:function(){this._commitUndo();var e,t=!1;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;e=this.stack[this.index++]}while(!(t=e.redo(this.view,!0)));return this._ignoreUndo=!1,t},reset:function(){this.index=0,this.cleanChange=void 0,this.stack=[],this._ignoreUndo=!1,this._compoundChange=void 0},setView:function(e){this.view!==e&&(this.view&&e.removeEventListener("Destroy",this._listener.onDestroy),this.view=e,this.view&&e.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(e){this._commitUndo();var i=new t(e);return this.add(i),this.compoundChange=i,this.compoundChange.start(this.view),this.compoundChange},_commitUndo:function(){this.endCompoundChange()},_onDestroy:function(e){e&&this.shared||this.model.removeEventListener("Changing",this._listener.onChanging),this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_trackUnsavedChanges:function(e){if(this._unsavedChanges){var t=this._unsavedChanges.length,i=e.addedCharCount,n=e.removedCharCount,o=e.start,r=e.start+n,s=0;if(0===i?s=-1:0===n&&(s=1),t>0&&s===this._previousChangeType){var a=this._unsavedChanges[t-1];if(0===n&&o===a.end+a.text.length)return void(a.text+=e.text);if(0===e.addedCharCount&&r===a.start)return void(a.start=o)}this._previousChangeType=s,this._unsavedChanges.push({start:o,end:r,text:e.text})}},_onChanging:function(t){if(this._trackUnsavedChanges(t),!this._ignoreUndo){var i=t.text,n=t.start,o=t.addedCharCount,r=t.removedCharCount,s=n+r,a=0;0===o&&1===r?a=-1:1===o&&0===r&&(a=1);var l=this.stack.length,d=this.model.getText(n,s);if(l>0&&this.index===l){var c=this.stack[l-1];if(c.merge(n,i,d,a,s,this.compoundChange))return}this.add(new e(this.model,n,i,d,a))}}},{UndoStack:i}}),define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/annotations","orion/editor/tooltip","orion/objects","orion/editor/util","orion/util"],function(e,t,i,n,o,r,s){function a(e,t,i){this._location=e||"left",this._overview=t||"page",this._rulerStyle=i,this._view=null}function l(e,t,i,n){a.call(this,t,i,n);var o=this;this._listener={onTextModelChanged:function(e){o._onTextModelChanged(e)},onAnnotationModelChanged:function(e){o._onAnnotationModelChanged(e)}},this.setAnnotationModel(e)}function d(e,t,i,n,o){l.call(this,e,t,"page",i),this._oddStyle=n||{style:{backgroundColor:"white"}},this._evenStyle=o||{style:{backgroundColor:"white"}},this._numOfDigits=0,this._firstLine=1}function c(e,t,i){l.call(this,e,t,"page",i)}function h(e,t,i){l.call(this,e,t,"document",i)}function u(e,t,i){c.call(this,e,t,i)}a.prototype={getLocation:function(){return this._location},getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},setView:function(e){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged),this._view=e,this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)}},l.prototype=o.mixin(new a,{getAnnotations:function(e,t){var i=this._annotationModel;if(!i)return[];var n=this._view.getModel(),o=n.getLineStart(e),r=n.getLineEnd(t-1),s=n;n.getBaseModel&&(s=n.getBaseModel(),o=n.mapOffset(o),r=n.mapOffset(r));for(var a=[],l=this.getAnnotationsByType(i,o,r),d=0;d=p;p++){var f=p;if(n!==s){var g=s.getLineStart(p);if(g=n.mapOffset(g,!0),-1===g)continue;f=n.getLineAtOffset(g)}if(f>=e&&t>f){var _=this._mergeAnnotation(a[f],c,p-h,u-h+1);_&&(a[f]=_)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var m in a)a[m]._multiple&&(a[m].html=a[m].html+this._multiAnnotationOverlay.html); -return a},getAnnotationModel:function(){return this._annotationModel},getWidestAnnotation:function(){return null},setAnnotationModel:function(e){this._annotationModel&&this._annotationModel.removeEventListener("Changed",this._listener.onAnnotationModelChanged),this._annotationModel=e,this._annotationModel&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(e){this._multiAnnotation=e},setMultiAnnotationOverlay:function(e){this._multiAnnotationOverlay=e},onClick:function(e){if(void 0!==e){var t,i,o,r=this._view,s=r.getModel(),a=s.getLineStart(e),l=s.getLineEnd(e,!0),d=r.getSelection().start,c=r.getSelection().end,h=this._annotationModel;if(h){s.getBaseModel&&(a=s.mapOffset(a),l=s.mapOffset(l),d=s.mapOffset(d),c=s.mapOffset(c));var u=this;t=this._findNextAnnotation(h,a,l,d,c,function(e){return u.isAnnotationTypeVisible(e)}),i=t?t.start:a,o=t?t.end:a,s.getBaseModel&&(i=s.mapOffset(i,!0),o=s.mapOffset(o,!0)),t&&void 0!==t.groupId&&(this._currentClickGroup=this._currentClickGroup===t.groupId?null:t.groupId,this._setCurrentGroup(e))}this._view.setSelection(o,i,1/3,function(){});var p=n.Tooltip.getTooltip(this._view);p&&(t&&"left"===this.getLocation()?p.show({getTooltipInfo:function(){return u._getTooltipInfo([t])}},!1,!1):p.hide())}},onDblClick:function(){},onMouseMove:function(e,t){var i=n.Tooltip.getTooltip(this._view);if(i&&(!i.isVisible()||this._tooltipLineIndex!==e)&&(this._tooltipLineIndex=e,t.clientX!==this._lastMouseX||t.clientY!==this._lastMouseY)){this._lastMouseX=t.clientX,this._lastMouseY=t.clientY,this._hoverTimeout&&(window.clearTimeout(this._hoverTimeout),this._hoverTimeout=null);var o=t.target?t.target:t.srcElement,r=o.getBoundingClientRect();this._curElementBounds=Object.create(null),this._curElementBounds.top=r.top,this._curElementBounds.left=r.left,this._curElementBounds.height=r.height,this._curElementBounds.width=r.width,o===this.node&&(this._curElementBounds.top=t.clientY,this._curElementBounds.height=1);var s=this;s._hoverTimeout=window.setTimeout(function(){s._hoverTimeout=null,i.onHover({getTooltipInfo:function(){var e=s._getAnnotationsAtLineIndex(s._tooltipLineIndex),i=s._getTooltipContents(s._tooltipLineIndex,e);return s._getTooltipInfo(i,t.clientY,{source:"ruler",rulerLocation:s.getLocation()})}},t.clientX,t.clientY)},175)}},onMouseOver:function(e,t){this.onMouseMove(e,t),this._currentClickGroup||this._setCurrentGroup(e)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1),this._hoverTimeout&&(window.clearTimeout(this._hoverTimeout),this._hoverTimeout=null)},_findNextAnnotation:function(e,t,i,n,o,r){var s,a=null,l=t;if(n>=0&&o>=0&&n>=t&&i>n){l=n;for(var d=e.getAnnotations(n,o);!s&&d.hasNext();){var c=d.next();(!r||r(c.type))&&c.start===n&&c.end===o&&(s=c)}}for(var h,u=e.getAnnotations(l,i);u.hasNext();)if(c=u.next(),!r||r(c.type)){if(a||(a=c),!s){a=c;break}if(h&&(s.start!==c.start||s.end!==c.end)){h=!1,a=c;break}s&&s===c&&(h=!0)}return h&&(a=null),a},_getAnnotationsAtLineIndex:function(e){if(void 0!==e){var t,i=this._view,n=this._annotationModel,o=[];if(!i)return[];if(t=i.getModel(),n&&t){var r=t.getLineStart(e),s=t.getLineEnd(e);t.getBaseModel&&(r=t.mapOffset(r),s=t.mapOffset(s)),o=this.getAnnotationsByType(n,r,s)}return o}},_getTooltipInfo:function(e,t,i){if(!e)return null;var n=Object.create(null);n.top=this._curElementBounds.top,n.left=this._curElementBounds.left,n.height=this._curElementBounds.height,n.width=this._curElementBounds.width,"string"==typeof e&&t&&(n.top=t,n.height=1);var o=this.getLocation(),r=this.getRulerStyle(),s="left"===o?"right":"left",a=0,l=0;if(this._view){var d=this._view._clientDiv.getBoundingClientRect();a=d.left-(n.left+n.width)}else a=n.width;l=n.height,"left"===s&&(a=-25,1===n.height&&(a+=2)),r.styleClass.indexOf("folding")>=0&&(l-=14);var c={contents:e,position:s,tooltipOffsetX:a,tooltipOffsetY:l,anchorArea:n,context:i};return c},_getTooltipContents:function(e,t){return t},_getOnClickTooltipInfo:function(e){var t=this._view,i=Object.create(null);i.top=this._curElementBounds.top,i.left=this._curElementBounds.left,i.height=this._curElementBounds.height,i.width=this._curElementBounds.width;var n=this.getLocation(),o="left"===n?"right":"left",r={contents:[e],position:o,anchorArea:i};if(t){var s=t._clientDiv.getBoundingClientRect();r.offsetX=s.left-(i.left+i.width)}else r.offsetX=i.width;return r.offsetY=i.height,"left"===r.position&&(r.offsetX=20),r},_onAnnotationModelChanged:function(e){function t(e){for(var t=0;t=l&&void 0!==t.groupId){o=t;break}if(s&&o&&s.groupId===o.groupId)return}if(this._currentGroupAnnotation=null,s&&n.removeAnnotations(s.groupType),o&&-1!==e){this._currentGroupAnnotation=o,i=n.getAnnotations();for(var d=[];i.hasNext();)t=i.next(),delete t.groupAnnotation,t.groupId===o.groupId&&(t=t.createGroupAnnotation(),d.push(t));n.replaceAnnotations(null,d)}}}),i.AnnotationTypeList.addMixin(l.prototype),d.prototype=new l,d.prototype.getAnnotations=function(e,t){for(var i=l.prototype.getAnnotations.call(this,e,t),n=this._view.getModel(),o=e;t>o;o++){var r=o-this._firstLine&1?this._oddStyle:this._evenStyle,s=o;if(n.getBaseModel){var a=n.getLineStart(s);s=n.getBaseModel().getLineAtOffset(n.mapOffset(a))}i[o]||(i[o]={}),i[o].html=this._firstLine+s+"",i[o].style||(i[o].style=r)}return i},d.prototype.getWidestAnnotation=function(){var e=this._view.getModel().getLineCount();return this.getAnnotations(e-1,e)[e-1]},d.prototype.setFirstLine=function(e){this._firstLine=void 0!==e?e:1},d.prototype._onTextModelChanged=function(e){var t=e.start,i=this._view.getModel(),n=i.getBaseModel?i.getBaseModel().getLineCount():i.getLineCount(),o=(this._firstLine+n-1+"").length;if(this._numOfDigits!==o){this._numOfDigits=o;var r=i.getLineAtOffset(t);this._view.redrawLines(r,i.getLineCount(),this)}},c.prototype=new l,h.prototype=new l,h.prototype.getRulerStyle=function(){var e={style:{lineHeight:"1px",fontSize:"1px"}};return e=this._mergeStyle(e,this._rulerStyle)},h.prototype._getTooltipContents=function(t,i){if(i&&0===i.length){var n=this._view.getModel(),o=t;if(n.getBaseModel){var r=n.getLineStart(o);o=n.getBaseModel().getLineAtOffset(n.mapOffset(r))}return s.formatMessage(e.line,o+1)}return l.prototype._getTooltipContents.call(this,t,i)},h.prototype._mergeAnnotation=function(e,t,i,n){if(0!==i)return void 0;var o=e;if(!o){var r=3*n;o={html:" ",style:{style:{height:r+"px"}}},o.style=this._mergeStyle(o.style,t.overviewStyle)}return o},u.prototype=new c,u.prototype.onClick=function(e){if(void 0!==e){var t=this._annotationModel;if(t){var i=this._view,o=i.getModel(),r=o.getLineStart(e),s=o.getLineEnd(e,!0);o.getBaseModel&&(r=o.mapOffset(r),s=o.mapOffset(s),o=o.getBaseModel());for(var a,l=t.getAnnotations(r,s);!a&&l.hasNext();){var d=l.next();this.isAnnotationTypeVisible(d.type)&&o.getLineAtOffset(d.start)===o.getLineAtOffset(r)&&(a=d)}if(a){var c=n.Tooltip.getTooltip(this._view);c&&c.hide(),a.expanded?a.collapse():a.expand()}}}},u.prototype._getTooltipContents=function(e,t){if(t&&t.length>0){var i=this._view,n=i.getModel(),o=n.getLineStart(e);n.getBaseModel&&(o=n.mapOffset(o),n=n.getBaseModel());for(var r=n.getLineAtOffset(o),s=0;s=e.end?s-=e.end-e.start:s>=e.start&&(s=e.start)}),i.setText(r,s,s),i.setSelection(s,s+r.length),this._dropText=null,this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange(),this._dragSelection=null}},_onDragEnter:function(e){this._onDragOver(e)},_onDragOver:function(t){var i=t.event.dataTransfer.types,n=!this._view.getOptions("readonly");if(n&&i&&(n=i.contains?i.contains("text/plain")||i.contains("Text"):-1!==i.indexOf("text/plain")||-1!==i.indexOf("Text")),n){if(!e.isFirefox){var o=e.isMac?t.event.altKey:t.event.ctrlKey;this._dropEffect=t.event.dataTransfer.dropEffect=o?"copy":"move"}}else t.event.dataTransfer.dropEffect="none"},_onDrop:function(t){var i=this._view,n=t.event.dataTransfer.getData("Text");if(n){e.isFirefox||(t.event.dataTransfer.dropEffect=this._dropEffect);var o=i.getOffsetAtLocation(t.x,t.y);this._dragSelection?(this._dropOffset=o,this._dropText=n):(i.setText(n,o,o),i.setSelection(o,o+n.length))}}},{TextDND:t}}),define("orion/editor/linkedMode",["i18n!orion/editor/nls/messages","orion/keyBinding","orion/editor/keyModes","orion/editor/annotations","orion/objects","orion/util"],function(e,t,i,n,o){function r(e){this._data=e}function s(e,t,n){var o=e.getTextView();i.KeyMode.call(this,o),this.editor=e,this.undoStack=t,this.contentAssist=n,this.linkedModeModel=null,o.setAction("linkedModeEnter",function(){return this.exitLinkedMode(!0),!0}.bind(this)),o.setAction("linkedModeCancel",function(){return this.exitLinkedMode(!0),!0}.bind(this)),o.setAction("linkedModeNextGroup",function(){var e=this.linkedModeModel;return this.selectLinkedGroup((e.selectedGroupIndex+1)%e.groups.length),!0}.bind(this)),o.setAction("linkedModePreviousGroup",function(){var e=this.linkedModeModel;return this.selectLinkedGroup(e.selectedGroupIndex>0?e.selectedGroupIndex-1:e.groups.length-1),!0}.bind(this)),this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(e){if(!this.ignoreVerify){for(var t,i,n=this.editor.mapOffset(e.start),o=this.linkedModeModel;o&&(t=this._getPositionChanged(o,n,n+e.removedCharCount),i=t.position,void 0===i||i.model!==o);)this.exitLinkedMode(!1),o=this.linkedModeModel;if(o){for(var r,s,a=0,l=e.addedCharCount-e.removedCharCount,d=t.positions,c=0;c=0;f--)l=h[f],l.model===r&&l.group===i.group&&this.editor.setText(e.text,l.oldOffset+u,l.oldOffset+p,!1);this.ignoreVerify=!1,e.text=null,this._updateAnnotations(h)}}}.bind(this)}}var a={};return r.prototype={chop:function(e,t){return t.substring(e.length)},computeProposals:function(e,t,i){var n=i.prefix,o=[],r=this._data.style?this._data.style:null;r=r?r:"emphasis";for(var s=this._data.values,a=0;a=0;r--)if(!o[r].escape){var s=o[r].position;if(s.offset<=t&&i<=s.offset+s.length){n=o[r];break}}return{position:n,positions:o}},_updateAnnotations:function(e){var t=this.editor.getAnnotationModel();if(t){for(var i,o=[],r=[],s=t.getAnnotations();s.hasNext();)switch(i=s.next(),i.type){case n.AnnotationType.ANNOTATION_LINKED_GROUP:case n.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case n.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:o.push(i)}var a=this.linkedModeModel;if(a){e=e||this._getSortedPositions(a);for(var l=0;l0?(localStorage.setItem(this._prefix+this._offsetStorageLabel,this._offset),this._closed=!1):this._closed=!0,e!==this._closed&&(localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null),i.logEvent("preferenceChange","splitterClosed",this._prefix,this._closed?0:1))},_mouseDown:function(e){return e.target===this._thumb?(n.stop(e),this._thumbDown()):void(this._tracking||(this._down(e),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),n.setFramesEnabled(!1),n.stop(e)))},_mouseMove:function(e){this._tracking&&(this._move(e.clientX,e.clientY),this._resize())},_mouseUp:function(e){this._tracking&&(n.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),n.stop(e))},_touchStart:function(e){var t=e.touches;if(1===t.length){if(n.stop(e),e.target===this._thumb)return this._thumbDown();this._down(e),this._touching=!0}},_touchMove:function(e){if(this._touching){var t=e.touches;if(1===t.length){var i=t[0];this._move(i.clientX,i.clientY)}}},_touchEnd:function(e){var t=e.touches;0===t.length&&(this._touching=!1,this._up())}},o.prototype.constructor=o,{Splitter:o,ORIENTATION_HORIZONTAL:r,ORIENTATION_VERTICAL:s}}),define("text!orion/compare/sideBySideTemplate.html",[],function(){return'
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n'}),define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(e,t,i){var n=n||{};return n.TwoWayCompareUIFactory=function(){function n(e){this._parentDivID=e.parentDivID,this._commandSpanId=e.commandSpanId,this._showTitle=e.showTitle,this._leftTitle=e.leftTitle,this._rightTitle=e.rightTitle,this._showLineStatus=e.showLineStatus}return n.prototype={_init:function(){var t=this._parentDivID+"_";this._topWidgetDiv=e.node("topWidget_id"),this._topWidgetDiv.id=t+"topWidget_id",this._leftEditorParentDiv=e.node("left_editor_id"),this._leftEditorParentDiv.id=t+"left_editor_id",this._rightEditorParentDiv=e.node("right_editor_id"),this._rightEditorParentDiv.id=t+"right_editor_id",this._rightEditorWrapperDiv=e.node("right_editor_wrapper_id"),this._rightEditorWrapperDiv.id=t+"right_editor_wrapper_id",this._leftActionDiv=e.node("left_action_id"),this._leftActionDiv.id=t+"left_action_id",this._rightActionDiv=e.node("right_action_id"),this._rightActionDiv.id=t+"right_action_id",this._leftTitleDiv=e.node("left_title_id"),this._leftTitleDiv.id=t+"left_title_id",this._rightTitleDiv=e.node("right_title_id"),this._rightTitleDiv.id=t+"right_title_id",this._leftStatusDiv=e.node("left_status_id"),this._leftStatusDiv.id=t+"left_status_id",this._rightStatusDiv=e.node("right_status_id"),this._rightStatusDiv.id=t+"right_status_id",this._diffCanvasDiv=e.node("diff_canvas_id"),this._diffCanvasDiv.id=t+"diff_canvas_id",this._splitterId=t+"orion_splitter",this._showTitle||this.disableTitle(),this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var i=e.$(".split",this._topWidgetDiv);i.id=this._splitterId;var n=e.$(".leftPanelLayout",this._topWidgetDiv),o=e.$(".rightPanelLayout",this._topWidgetDiv);i&&n&&o&&(this._splitter=new t.Splitter({node:i,sidePanel:n,mainPanel:o,proportional:!0}))},buildUI:function(){e.node(this._parentDivID).innerHTML=i,this._init(),this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(t){var i=e.$(".leftPanelLayout",this._topWidgetDiv);return i===t},getEditorParentDiv:function(e){return e?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(e){return e?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(e){return e?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(e){return e?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"}},n}(),n});var JsDiff=function(){function e(e){return{newPos:e.newPos,components:e.components.slice(0)}}function t(e){for(var t=[],i=0;i/g,">"),t=t.replace(/"/g,""")}var n=function(e){this.ignoreWhitespace=e};n.prototype={diff:function(t,i,n){if(this.ignoreWhitespace=n,i===t)return[{value:i}];if(!i)return[{value:t,removed:!0}];if(!t)return[{value:i,added:!0}];i=this.tokenize(i),t=this.tokenize(t);var o=i.length,r=t.length,s=o+r,a=[{newPos:-1,components:[]}],l=this.extractCommon(a[0],i,t,0);if(a[0].newPos+1>=o&&l+1>=r)return a[0].components;for(var d=1;s>=d;d++)for(var c=-1*d;d>=c;c+=2){var h,u=a[c-1],p=a[c+1];l=(p?p.newPos:0)-c,u&&(a[c-1]=void 0);var f=u&&u.newPos+1=0&&r>l;if(f||g){!f||g&&u.newPos=o&&l+1>=r)return h.components;a[c]=h}else a[c]=void 0}},pushComponent:function(e,t,i,n,o){var r=e[e.length-1];r&&r.added===n&&r.removed===o?e[e.length-1]={value:this.join(r.value,t),helperValue:this.join(r.helperValue,i),added:n,removed:o}:e.push({value:t,helperValue:i,added:n,removed:o})},extractCommon:function(e,t,i,n){for(var o=t.length,r=i.length,s=e.newPos,a=s-n;o>s+1&&r>a+1&&this.equals(t[s+1],i[a+1]);)s++,a++,this.pushComponent(e.components,t[s],i[a],void 0,void 0);return e.newPos=s,a},equals:function(e,t){var i=/\S/;return!this.ignoreWhitespace||i.test(e)||i.test(t)?this._equals(e,t):!0},join:function(e,t){return e+t},tokenize:function(e){return e}};var o=new n;o._equals=function(e,t){return e===t};var r=new n(!1);r.tokenize=function(e){return t(e.split(/(\s+|\b)/))},r._equals=function(e,t){return e===t};var s=new n(!0);s.tokenize=function(e){return t(e.split(/([{}:;,]|\s+)/))},s._equals=function(e,t){return e===t};var a=new n;return a.tokenize=function(e){var t=e.split(/^/m);return t&&t.length>0&&!t[t.length-1]&&t.pop(),t},a._equals=function(e,t){if(this.ignoreWhitespace){var i=e.replace(/^\s+|\s+$|\s+(?=\s)/g,""),n=t.replace(/^\s+|\s+$|\s+(?=\s)/g,"");return i===n}return e===t},{diffChars:function(e,t,i){return o.diff(e,t,i)},diffWords:function(e,t,i){return r.diff(e,t,i)},diffLines:function(e,t,i){return a.diff(e,t,i)},diffCss:function(e,t){return s.diff(e,t)},createPatch:function(e,t,i,n,o){var r=[];r.push("Index: "+e),r.push("==================================================================="),r.push("--- "+e+" "+n),r.push("+++ "+e+" "+o);var s=a.diff(t,i);s.push({value:"",lines:[]});for(var l=0,d=0,c=[],h=1,u=1,p=0;p1&&!/\n$/.test(s[s.length-2].value)&&r.push("\\ No newline at end of file\n"),r.join("\n")},convertChangesToXML:function(e){for(var t=[],n=0;n"):o.removed&&t.push(""),t.push(i(o.value)),o.added?t.push(""):o.removed&&t.push("")}return t.join("")}}}();"undefined"!=typeof module&&(module.exports=JsDiff),"function"==typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff}),define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(e){var t=t||{};return t.JSDiffAdapter=function(){function t(e){this._ignoreWhitespace=e}return t.prototype={_specialLine:function(e,t,i){return t.value===e&&i!==e},adapt:function(t,i,n){n||(n="\n");for(var o=t.split(n),r=i.split(n),s=""===o[o.length-1],a=""===r[r.length-1],l=e.diffLines(t,i,this._ignoreWhitespace),d=[],c=[],h=0,u=0,p=-1,f=0,g=!0,_=n,m=0;m1&&""===y[y.length-1]&&x--,x>1&&!g&&""===y[0]&&(x--,b++),v.lines=y,v.added||v.removed)if(v.added){-1===p&&(p=c.length+1),h+=x;for(var w=b;x+b>w;w++)c.push(v.lines[w])}else u+=x;else this._specialLine(n,v,_)||((h||u)&&(d.push([h,u,p]),h=0,u=0,p=-1,f+=u),d.push([x,x,0]),f+=x);g=!1,y.length>1&&""===y[y.length-1]&&(g=!0),_=v.value?v.value[v.value.length-1]:n}if((h||u)&&(d.push([h,u,p]),f+=u),f1){var C=d[d.length-1];0===C[2]?(C[0]+=1,C[1]+=1):-1===C[2]?d.push([1,1,0]):s===a?d.push([1,1,0]):(a&&(C[0]+=1),s&&(C[1]+=1))}return{mapper:d,changContents:{array:c,index:0}}},adaptCharDiff:function(t,i,n){for(var o=n?e.diffWords(t,i,this._ignoreWhitespace):e.diffChars(t,i,this._ignoreWhitespace),r=[],s=0,a=0,l=0,d=0,c=0;c0||d>0)&&(r.push([a,a+l,s,s+d]),a+=l,s+=d,l=0,d=0),a+=h.value.length,s+=h.helperValue?h.helperValue.length:h.value.length)}return(l>0||d>0)&&r.push([a,a+l,s,s+d]),r}},t}(),t}),define("orion/treeModelIterator",[],function(){var e={};return e.TreeModelIterator=function(){function e(e,t){this.firstLevelChildren=e,this.reset(),this._init(t)}return e.prototype={_init:function(e){e&&(this.isExpanded=e.isExpanded,this.isExpandable=e.isExpandable,this.forceExpandFunc=e.forceExpandFunc,this.getChildrenFunc=e.getChildrenFunc)},topLevel:function(e){return e.parent?e.parent===this.root:!0},_getChildren:function(e){return"function"==typeof this.getChildrenFunc?this.getChildrenFunc(e):e?e.children:null},_expanded:function(e){if(!e)return!0;var t=this._getChildren(e),i=t&&t.length>0;return this.isExpanded&&i&&(i=this.isExpanded(e)),i},_expandable:function(e){return e?this.isExpandable?this.isExpandable(e):!1:!0},_diveIn:function(e){if(this._expanded(e)){var t=this._getChildren(e);return this.setCursor(t[0]),this.cursor()}return null},_drillToLast:function(e){if(this._expanded(e)){var t=this._getChildren(e);return this._drillToLast(t[t.length-1])}return e},_forward:function(e){if(!this._cursor)return null;var t=this._diveIn(this._cursor);if(!t){if(e&&this._expandable(this._cursor)&&this.forceExpandFunc){var i=this;return this.forceExpandFunc(this._cursor,"first",function(e){e&&i.setCursor(e)})}t=this._findSibling(this._cursor,!0),t&&this.setCursor(t)}return t},_backward:function(e){if(!this._cursor)return null;var t=this._findSibling(this._cursor,!1);if(t&&t!==this._cursor.parent&&(t=this._drillToLast(t)),e&&t&&this._expandable(t)&&this.forceExpandFunc&&t!==this._cursor.parent){var i=this;return this.forceExpandFunc(t,"last",function(e){e&&i.setCursor(e)})}return t&&this.setCursor(t),t},_findSibling:function(e,t){for(var i=this.topLevel(e),n=this._getChildren(e.parent),o=i?this.firstLevelChildren:n,r=0;r0&&(this.root=this.firstLevelChildren[0].parent)},scan:function(e,t){var i=this.cursor(),n=this._scan(!0,e,t);return n||(n=this._scan(!1,e,t)),this.setCursor(i),n},iterate:function(e,t){return e?this._forward(t):this._backward(t)},iterateOnTop:function(e,t){var i=this._findSibling(this._getTopLevelParent(this.cursor()),e);i?this.setCursor(i):t&&this.firstLevelChildren.length>0&&this.setCursor(e?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(e){return this._cursor&&this._inParentChain(this._cursor,e)?(this.setCursor(e),this._cursor):null},reset:function(){this._cursor=null,this._prevCursor=null,this.root=null,this.firstLevelChildren.length>0&&(this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent)},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}},e}(),e}),define("orion/compare/diffTreeNavigator",["i18n!orion/compare/nls/messages","orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(e,t,i,n,o){var r={},s={};return r.DiffTreeNavigator=function(){function r(e,t,i,n,o,r){this._root={type:"root",children:[]},this._initialized=!1,this.initAll(e,t,i,n,o,r)}s.ANNO_DIFF_ADDED_BLOCK="orion.annotation.diff.addedBlock",s.ANNO_DIFF_CURRENT_ADDED_BLOCK="orion.annotation.diff.currentAddedBlock",s.ANNO_DIFF_DELETED_BLOCK="orion.annotation.diff.deletedBlock",s.ANNO_DIFF_CURRENT_DELETED_BLOCK="orion.annotation.diff.currentDeletedBlock",s.ANNO_DIFF_BLOCK_TOPONLY="orion.annotation.diff.blockTop",s.ANNO_DIFF_CURRENT_BLOCK_TOPONLY="orion.annotation.diff.currentBlockTop",s.ANNO_DIFF_BLOCK_CONFLICT="orion.annotation.diff.blockConflict",s.ANNO_DIFF_CURRENT_BLOCK_CONFLICT="orion.annotation.diff.currentBlockConflict",s.ANNO_DIFF_ADDED_WORD="orion.annotation.diff.addedWord",s.ANNO_DIFF_CURRENT_ADDED_WORD="orion.annotation.diff.currentAddedWord",s.ANNO_DIFF_DELETED_WORD="orion.annotation.diff.deletedWord",s.ANNO_DIFF_CURRENT_DELETED_WORD="orion.annotation.diff.currentDeletedWord",s.ANNO_DIFF_EMPTY_DELETED_WORD_LEFT="orion.annotation.diff.emptyDeletedWordLeft",s.ANNO_DIFF_EMPTY_DELETED_WORD_RIGHT="orion.annotation.diff.emptyDeletedWordRight",s.ANNO_DIFF_EMPTY_ADDED_WORD_LEFT="orion.annotation.diff.emptyAddedWordLeft",s.ANNO_DIFF_EMPTY_ADDED_WORD_RIGHT="orion.annotation.diff.emptyAddedWordRight",n.AnnotationType.registerType(s.ANNO_DIFF_ADDED_BLOCK,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_ADDED_BLOCK,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_DELETED_BLOCK,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_DELETED_BLOCK,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_BLOCK_TOPONLY,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_BLOCK_TOPONLY,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}}),n.AnnotationType.registerType(s.ANNO_DIFF_BLOCK_CONFLICT,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_BLOCK_CONFLICT,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}}),n.AnnotationType.registerType(s.ANNO_DIFF_ADDED_WORD,{title:e["word added"],html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_ADDED_WORD,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_DELETED_WORD,{title:e["word deleted"],html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_CURRENT_DELETED_WORD,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}}),n.AnnotationType.registerType(s.ANNO_DIFF_EMPTY_DELETED_WORD_LEFT,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}}),n.AnnotationType.registerType(s.ANNO_DIFF_EMPTY_DELETED_WORD_RIGHT,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}}),n.AnnotationType.registerType(s.ANNO_DIFF_EMPTY_ADDED_WORD_LEFT,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}}),n.AnnotationType.registerType(s.ANNO_DIFF_EMPTY_ADDED_WORD_RIGHT,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});var a=5e3;return r.prototype={initAll:function(e,t,i,n,o,r,s){this._charOrWordDiff=e?e:"word",t&&(this._initialized=!0),this.editorWrapper=[{editor:t,diffFeeder:n},{editor:i,diffFeeder:o}],this._curveRuler=s,this._overviewRuler=r,this._overviewRuler&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(e){if(e)for(var t=0;t0&&this.iterator.iterate(e),this.updateCurrentAnnotation(!0)}return t},gotoChangeUsingIndex:function(e){var t=0,i=0;if(e>=0)for(;it+n-1)){var o=e-t;return this.gotoBlock(i,o)}t+=n,i++}},gotoBlock:function(e,t){this.iterator&&((0>e||e>=this._root.children.length||0===this._root.children.length)&&(e=0),this.iterator.setCursor(void 0!==t&&t>=0&&this._root.children[e].children&&t=r.start&&t<=r.end){var s=o;if(o.children&&o.children.length>0)for(var a=0;a=d.start&&t<=d.end){s=l;break}}return s}}return null}},gotoChange:function(e,t){for(var i=0;ie&&(e=0);var t=this.getFeeder().getDiffBlocks();return t&&0!==t.length?(e>t.length-1&&(e=0),t[e][1]):-1},replaceDiffAnnotations:function(e,t,i,n){if(t&&i){var o=e.getAnnotationModel();if(o){for(var r=o.getAnnotations(),s=[];n&&r.hasNext();){var a=r.next();a.type===i&&s.push(a)}o.replaceAnnotations(s,t)}}},updateCurrentAnnotation:function(e,t){if(this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),this.replaceAllAnnotations(!0,1,"word",!1,[]),this.iterator){var i=this.iterator.cursor();if(i){var o,r,s={start:i.oldA.start,end:i.oldA.end},a={start:i.newA.start,end:i.newA.end};"word"===i.type?(o=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(s,this.editorWrapper[0].editor.getTextView().getModel()),r=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(a,this.editorWrapper[1].editor.getTextView().getModel())):(o=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(i.index),r=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(i.index)),o&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new(n.AnnotationType.getType(o.current))(s.start,s.end)],o,!0),r&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new(n.AnnotationType.getType(r.current))(a.start,a.end)],r,!0),e?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(i.oldA.start,i.oldA.end,!0),this.editorWrapper[1].editor.setSelection(i.newA.start,i.newA.end,!0),this.autoSelecting=!1):t&&(this.autoSelecting=!0,t!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(i.oldA.start,i.oldA.end,!0),t!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(i.newA.start,i.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(e,t){var i=this.generateBlockDiffAnnotations(0,t),n=this.generateBlockDiffAnnotations(1,t);return{parent:e,index:t,type:"block",oldA:i,newA:n}},generatePairWordAnnotations:function(e,t,i){var n=this.editorWrapper[0].diffFeeder.getTextOnBlock(t),o=this.editorWrapper[1].diffFeeder.getTextOnBlock(t),r=null,s=0,l=0;if(!(n&&o&&n.text&&o.text&&n.text.length<=a&&o.text.length<=a))return null;r=i.adaptCharDiff(n.text,o.text,"word"===this._charOrWordDiff),l=o.start,s=n.start;var d=[],c=[];this.generateWordDiffAnnotations(0,d,s,r,2,3),this.generateWordDiffAnnotations(1,c,l,r,0,1);for(var h=[],u=0;u0?t-o:0)},_positionDiffBlock:function(){var e=this.getCurrentBlockIndex();0>e&&(e=0);var t=this.getFeeder().getDiffBlocks();if(0!==t.length){if(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),t[e][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor){var n=i.lookUpLineIndex(this.getMapper(),0,t[e][1]);this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),n)}this._updateOverviewRuler(),this._updateCurveRuler()}},matchPositionFromOverview:function(e){if(this._initialized){var t;t=0>e?0:i.getAnnotationIndex(this.getFeeder().getDiffBlocks(),e),this.gotoBlock(t)}},gotoDiff:function(e,t){this.gotoChange(e,t)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0),this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0),this._positionDiffBlock()},nextChange:function(){var e=this.iterateOnChange(!0);return this._positionDiffBlock(),e},prevChange:function(){this.iterateOnChange(!1),this._positionDiffBlock()}},r}(),r.DiffBlockFeeder=function(){function e(){}return e.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(e){e.push(this._isAddedSide()?{type:"word",current:s.ANNO_DIFF_CURRENT_ADDED_WORD,normal:s.ANNO_DIFF_ADDED_WORD,list:[]}:{type:"word",current:s.ANNO_DIFF_CURRENT_DELETED_WORD,normal:s.ANNO_DIFF_DELETED_WORD,list:[]}),e.push({type:"word",current:s.ANNO_DIFF_EMPTY_DELETED_WORD_LEFT}),e.push({type:"word",current:s.ANNO_DIFF_EMPTY_DELETED_WORD_RIGHT}),e.push({type:"word",current:s.ANNO_DIFF_EMPTY_ADDED_WORD_LEFT}),e.push({type:"word",current:s.ANNO_DIFF_EMPTY_ADDED_WORD_RIGHT})},getCurrentWordAnnoType:function(e,t){return e.start===e.end&&t?this._isAddedSide()?{current:this._repositionEmptyWord(e,t),normal:s.ANNO_DIFF_ADDED_WORD}:{current:this._repositionEmptyWord(e,t),normal:s.ANNO_DIFF_DELETED_WORD}:this._isAddedSide()?{current:s.ANNO_DIFF_CURRENT_ADDED_WORD,normal:s.ANNO_DIFF_ADDED_WORD}:{current:s.ANNO_DIFF_CURRENT_DELETED_WORD,normal:s.ANNO_DIFF_DELETED_WORD}},_repositionEmptyWord:function(e,t){var i=t.getLineAtOffset(e.start),n=t.getLineStart(i),o=t.getLineEnd(i);return n!==o?e.start===o?(e.start--,this._isAddedSide()?s.ANNO_DIFF_EMPTY_ADDED_WORD_RIGHT:s.ANNO_DIFF_EMPTY_DELETED_WORD_RIGHT):(e.end++,this._isAddedSide()?s.ANNO_DIFF_EMPTY_ADDED_WORD_LEFT:s.ANNO_DIFF_EMPTY_DELETED_WORD_LEFT):i>0&&(i--,n=t.getLineStart(i),o=t.getLineEnd(i),n!==o)?(e.start=o-1,e.end=o,this._isAddedSide()?s.ANNO_DIFF_EMPTY_ADDED_WORD_RIGHT:s.ANNO_DIFF_EMPTY_DELETED_WORD_RIGHT):this._isAddedSide()?s.ANNO_DIFF_EMPTY_ADDED_WORD_LEFT:s.ANNO_DIFF_EMPTY_DELETED_WORD_LEFT},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(e){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;var t=this._diffBlocks[e][1];return-1===t?0:this._mapper[t][this._mapperColumnIndex] -},getOverviewLineCount:function(){return this._textModel.getLineCount()},getLineNumber:function(e){return e},getCharRange:function(e){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var t=this._diffBlocks[e][1],i=this._diffBlocks[e][0],n=i+this._mapper[t][this._mapperColumnIndex]-1,o=this._textModel.getLineStart(i);if(i>n)return{start:o,end:o};var r=this._textModel.getLineEnd(n,!0);return{start:o,end:r}},getTextOnBlock:function(e){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var t=this._diffBlocks[e][1];0===this._mapper[t][0]||0===this._mapper[t][1]||0===this._mapper[t][2];var i=this.getCharRange(e);return{start:i.start,text:this._textModel.getText(i.start,i.end)}},isMapperEmpty:function(){return 0===this._mapper.length}},e}(),r.TwoWayDiffBlockFeeder=function(){function e(e,t,i,n){this._mapperColumnIndex=i,this._reverseAnnotation=n,this.init(e,t)}return e.prototype=new r.DiffBlockFeeder,e.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex},e.prototype.init=function(e,t){if(this._textModel=e,this._diffBlocks=void 0,t){this._mapper=t,this._diffBlocks=[];for(var i=0,n=0;n=this._gapBlocks[t][0]&&e0){if(e.length<1||e.length>2)return;this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:e[0]}],2===e.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:e[1]})}},_highlightSyntax:function(){if(this._syntaxHighlighters){var e=[];this._syntaxHighlighters.forEach(function(t){e.push(t.highlighter.highlight(t.target.fileName,t.target.contentType,t.target.editor))}.bind(this)),t.all(e,function(e){return{_error:e}}).then(function(){this._diffNavigator.renderAnnotations(this.isWhitespaceIgnored()),this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1),this.dispatchEvent({type:"contentLoaded"}),this.options.toggler&&this.options.toggler.dispatchEvent({type:"contentLoaded"})}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations(this.isWhitespaceIgnored()),this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1),this.dispatchEvent({type:"contentLoaded"}),this.options.toggler&&this.options.toggler.dispatchEvent({type:"contentLoaded"})}.bind(this),50)},isWhitespaceIgnored:function(){return this.getWidget().options.ignoreWhitespace},ignoreWhitespace:function(e){var t=this.getWidget().options;if(t.ignoreWhitespace=e,t.diffProvider&&t.diffContent){var i=e?"true":"false";t.diffProvider._diffProvider.getDiffContent(t.resource,{ignoreWS:i}).then(function(e){t.diffContent=t.hasConflicts?e.split("diff --git")[1]:e,this.getWidget().refresh(!0,!0)}.bind(this),function(){})}else this.getWidget().refresh(!0,!0)},setOptions:function(e,t){if(t&&this._clearOptions(),this.options||(this.options={}),e&&Object.keys(e).forEach(function(t){this.options[t]=e[t]}.bind(this)),e.newFileOnRight){var i=this.options.newFile;this.options.newFile=this.options.oldFile,this.options.oldFile=i}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors(),this.refresh(!0)},initEditors:function(){},initImageMode:function(){}},e}(),g.TwoWayCompareView=function(){function i(e){g.CompareView.call(this,e),this.setOptions(e,!0),this._diffNavigator=new f.DiffTreeNavigator("word"),this.type="twoWay",this._uiFactory=this.options.uiFactory,this._uiFactory||(this._uiFactory=new h.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI()),this._viewLoadedCounter=0,this.options.commandProvider&&this.options.commandProvider.initCommands(this),this._curveRuler=new r.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}return i.prototype=Object.create(g.CompareView.prototype),i.prototype.initEditors=function(t){this.options.preCreate&&this.options.preCreate(),this._editors=[],this._editors.push(this._createEditor(t,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile)),this._editors.push(this._createEditor(t,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0)),this._overviewRuler=new r.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(e){this._diffNavigator.matchPositionFromOverview(e)}.bind(this)),this.options.postCreate&&this.options.postCreate(),window.onbeforeunload=function(){return this.isDirty()?e["There are unsaved changes."]:void 0}.bind(this)},i.prototype.disableAnnoBookMark=function(){this._disableAnnoBookMark(this._editors)},i.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(e){e.destroy()}),this._editors=null),this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode"),this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode"),this._uiFactory.disableTitle(),this._uiFactory.disableLineStatus(),this._imageMode=!0},i.prototype.getImageMode=function(){return this._imageMode},i.prototype.getEditors=function(){return this._editors},i.prototype.gotoDiff=function(e,t,i){var n=i?this._editors[1].getTextView():this._editors[0].getTextView(),o=n.getModel().getLineStart(e)+t;this._diffNavigator.gotoDiff(o,n)},i.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)},i.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)},i.prototype.resizeEditors=function(){this._editors.forEach(function(e){e.getTextView().resize()})},i.prototype.getSplitter=function(){return this._uiFactory.getSplitter()},i.prototype._createEditor=function(t,i,n,o,r){var l="undefined"==typeof o.readonly?!0:o.readonly,h=function(){var e=new c.TextView({parent:i,readonly:l,theme:d.TextTheme.getTheme("nothing"),tabSize:4});this._viewLoadedCounter++,2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1),this.onLoad&&this.onLoad();var t=this.getSplitter();return t&&t.addResizeListener(function(t){if(t){var i=!1;i=this._uiFactory.isLeftPane(t)?r:!r,i&&e.resize()}}.bind(this)),e}.bind(this),u=o.keyBindingFactory;u||(u=new a.KeyBindingsFactory);var p=null;if(n){var f="",g="";p=function(t,i){n&&(g=i?e["ERROR: "]+t:t,n.textContent=f+g)}}var _=new s.Editor({textViewFactory:h,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:u,statusReporter:p,domNode:i});_.installTextView(),_.setInput(null,null,o.Content?o.Content:t),_.setOverviewRulerVisible(!1);var m=_.getTextView();return m.addEventListener("Selection",function(e){var t=Array.isArray(e.newValue)?e.newValue:[e.newValue];t.length>1||!t[0].isEmpty()||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(t[0].getCaret(),m)}.bind(this)),m.getModel().addEventListener("Changed",function(e){this._curveRuler.onChanged(e,!r)||(this.options.mapper=null)}.bind(this)),r?m.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render()),this.onScroll&&this.onScroll()}.bind(this)):m.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this)),_},i.prototype.isDirty=function(){return this._editors?this._editors.some(function(e){return e.isDirty()}):!1},i.prototype._destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(e){e.destroy()}),this._uiFactory.destroy())},i.prototype.destroy=function(){this._destroyed=!0,this._destroy()},i.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var e=new r.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),t=new r.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(e),this._editors[0].getTextView().addRuler(t),this._editors[0].getTextView().addRuler(this._overviewRuler),this._hasRuler=!0}},i.prototype.refresh=function(e,i,n){if(!this._destroyed){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var o=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(e){return o._loadImageFile(o.options.oldFile.URL,o._uiFactory.getEditorParentDiv()).then(function(i){return(new t).resolve(e>i?e:i)})})}var r=this._generateMapper(i,this.options.oldFile.Content,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler),s=this.options.oldFile.Content,a=this.options.newFile.Content;"string"!=typeof a&&(a=r.output);var l=new f.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),r.mapper,1,this.options.newFileOnRight),d=new f.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),r.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],l,d,this._overviewRuler,this._curveRuler),this._curveRuler.init(r.mapper,this._editors[1],this._editors[0],this._diffNavigator),e&&("number"==typeof n?1===n?this._editors[1].setInput(this.options.newFile.Name,null,a):this._editors[0].setInput(this.options.oldFile.Name,null,s):(this._editors[1].setInput(this.options.newFile.Name,null,a),this._editors[0].setInput(this.options.oldFile.Name,null,s))),this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]),this._highlightSyntax(),this.options.commandProvider&&this.options.commandProvider.renderCommands(this),this.addRulers(),2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1),this.refreshTitle(0),this.refreshTitle(1);var c=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5,h=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return c>h?c:h}},i.prototype.refreshTitle=function(e,t){var i,o=this.options.newFile.Name,r=this.options.oldFile.Name,s="/",a=" ... ",l=o.split(s),d=r.split(s),c=[],h=[],u=!1;for(i=0;i1||!t[0].isEmpty()||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(t[0].getCaret(),this._textView)}.bind(this))},i.prototype.disableAnnoBookMark=function(){this._disableAnnoBookMark([this._editor])},i.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null),n.node(this._editorDiv).classList.add("compareEditorParentImageMode"),this._imageMode=!0},i.prototype.getImageMode=function(){return this._imageMode},i.prototype._initDiffPosition=function(e){var t=e.getModel();if(t&&t.getAnnotations){var i=t.getAnnotations();if(i.length>0){var n=i[0][0],o=e.getLineHeight(),r=e.getClientArea(),s=Math.floor(r.height/o/3);e.setTopIndex(n-s>0?n-s:0)}}},i.prototype.refresh=function(i,o){if(!this._destroyed){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var r=this;return this._loadImageFile(this.options.newFile.URL,n.node(this._editorDiv),!0).then(function(e){return r._loadImageFile(r.options.oldFile.URL,n.node(r._editorDiv)).then(function(i){return(new t).resolve(e+i+20)})})}var s=this._generateMapper(o,this.options.oldFile.Content,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);if(s.submoduleChanged)switch(s.submoduleChanged){case"removed":this._textView.getModel().setText(e["Removed Submodule Message"]);break;case"added":this._textView.getModel().setText(e["Added Submodule Message"])}else{this._mapper=s.mapper,this._textView.getModel().setText(this.options.oldFile.Content);var a=new f.inlineDiffBlockFeeder(s.mapper,1),l=new f.inlineDiffBlockFeeder(s.mapper,0);u.mergeDiffBlocks(this._textView.getModel(),l.getDiffBlocks(),s.mapper,s.diffArray.array,s.diffArray.index,this._diffParser._lineDelimiter),a.setModel(this._textView.getModel()),l.setModel(this._textView.getModel()),this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,l,this._overviewRuler),this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]),this._highlightSyntax(),this.options.commandProvider&&this.options.commandProvider.renderCommands(this),this.removeRulers(),this.addRulers();var d=this._textView.getTopIndex();this._textView.redrawLines(d,d+1,this._overviewRuler),this._textView.redrawLines(d,d+1,this._rulerOrigin),this._textView.redrawLines(d,d+1,this._rulerNew),this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5}},i.prototype.setConflicting=function(e){this._conflcit=e},i.prototype.gotoDiff=function(e){this._diffNavigator.gotoChangeUsingIndex(e)},i.prototype.gotoLine=function(e,t,i,n){"number"!=typeof t&&(t=0);var o=u.convertMergedLineNumber(this._mapper,e),r=function(){n&&n(o)}.bind(this);this._editor.onGotoLine(o,t,i,r)},i.prototype.getMainEditor=function(){return this._editor?this._editor:null},i.prototype.getLineNumber=function(e,t,i){if(t){var n=this._diffNavigator.getFeeder(i?!1:!0);return n?n.getLineNumber(e):e}var o=u.convertMergedLineNumber(this._mapper,e,i);return o},i}(),g.toggleableCompareView=function(){function e(e,t){i.attach(this),t&&(t.toggler=this),this._widget="inline"===e?new g.InlineCompareView(t):new g.TwoWayCompareView(t)}return e.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0,this._widget.initImageMode()},_toggle:function(e){this._widget.destroy(),n.empty(n.node(e.parentDivId)),this._widget="inline"===this._widget.type?new g.TwoWayCompareView(e):new g.InlineCompareView(e),this._imageMode?this._widget.initImageMode():this._widget.initEditors(),this._widget.refresh(!0),e.onInputChanged&&"twoWay"===this._widget.type&&e.onInputChanged()},toggle:function(){var e=this._widget.options;if(!this._imageMode){var t=this._widget.getCurrentDiffPos();e.blockNumber=t.block,e.changeNumber=t.change}this._toggle(e)},isDirty:function(){return this._widget.isDirty()},destroy:function(){return this._widget.destroy()},getWidget:function(){return this._widget}},e}(),g}),define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/Deferred","orion/keyBinding","orion/webui/littlelib","orion/EventTarget"],function(e,t,i,n,o,r){var s={};return s.CompareCommandFactory=function(){function s(e){r.attach(this),this.setOptions(e,!0)}return s.prototype={setOptions:function(e,t){t&&(this.options={}),this.options||(this.options={}),e&&Object.keys(e).forEach(function(t){this.options[t]=e[t]}.bind(this))},getOptions:function(){return this.options},initCommands:function(o){var r=this.options.commandSpanId,s=this.options.toggleCommandSpanId,a=this.options.commandService;if(a&&(r||s)){var l=new t.Command({name:e.CpCurChangeRightToLeft,tooltip:e.CpCurChangeRightToLeft,imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(){return"twoWay"===o.type&&!o.getImageMode()&&o.options.newFile&&!o.options.newFile.readonly}.bind(this),callback:function(e){e.items.copyToLeft()}}),d=new t.Command({name:e.CpCurChangeLeftToRight,tooltip:e.CpCurChangeLeftToRight,imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(){return"twoWay"===o.type&&!o.getImageMode()&&o.options.oldFile&&!o.options.oldFile.readonly}.bind(this),callback:function(e){e.items.copyToRight()}}),c=new t.Command({tooltip:e.IgnoreWhitespaceTooltip,name:e.IgnoreWhitespace,imageClass:"core-sprite-whitespace",id:"orion.compare.ignoreWhitespace",groupId:"orion.compareGroup",type:"toggle",visibleWhen:function(t){var i=t.isWhitespaceIgnored();return c.checked=i,c.name=i?e.UseWhitespace:e.IgnoreWhitespace,c.tooltip=i?e.UseWhitespaceTooltip:e.IgnoreWhitespaceTooltip,!0},preCallback:function(t){var n=t.handler.getWidget();if("function"==typeof n.options.onSave&&n.isDirty()){var o=window.confirm(e.confirmUnsavedChanges);return o?n.options.onSave(o):(new i).resolve()}return(new i).resolve(!0)},callback:function(e){e.items.ignoreWhitespace(c.checked),this.dispatchEvent({type:"compareConfigChanged",name:"ignoreWhiteSpace",value:c.checked})}.bind(this)}),h=new t.Command({tooltip:e["Switch to unified diff"],name:e.Unified,imageClass:"compare-sprite-inline-2way",id:"orion.compare.toggleInline2Way",groupId:"orion.compareGroup",type:"switch",visibleWhen:function(t){if(!t.options.toggler)return!1;var i="twoWay"===t.options.toggler.getWidget().type;return h.checked=!i,h.name=i?e.Unified:e["Side by side"],h.tooltip=i?e["Switch to unified diff"]:e["Switch to side by side diff"],!0},preCallback:function(t){var n=t.handler.getWidget();if("function"==typeof n.options.onSave&&n.isDirty()){var o=window.confirm(e.confirmUnsavedChanges);return o?n.options.onSave(o):(new i).resolve()}return(new i).resolve(!0)},callback:function(e){this.dispatchEvent({type:"compareConfigChanged",name:"mode",value:"twoWay"===e.items.options.toggler.getWidget().type?"inline":"twoWay"}),e.items.options.toggler.toggle()}.bind(this)}),u=new t.Command({name:e["Next diff block"],tooltip:e["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!o.getImageMode()},callback:function(e){e.items.nextDiff()}}),p=new t.Command({name:e["Previous diff block"],tooltip:e["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(){return!o.getImageMode()},callback:function(e){e.items.prevDiff()}}),f=new t.Command({name:e["Next diff change"],tooltip:e["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(){return!o.getImageMode()},callback:function(e){e.items.nextChange()}}),g=new t.Command({name:e["Previous diff change"],tooltip:e["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(){return!o.getImageMode()},callback:function(e){e.items.prevChange(e)}});a.addCommand(l),a.addCommand(d),a.addCommand(c),a.addCommand(h),a.addCommand(u),a.addCommand(p),a.addCommand(f),a.addCommand(g),s?a.registerCommandContribution(s,"orion.compare.toggleInline2Way",108):r&&a.registerCommandContribution(r,"orion.compare.toggleInline2Way",108),r&&(a.registerCommandContribution(r,"orion.compare.copyToLeft",110,null,!1,new n.KeyBinding(37,!0,!1,!0)),a.registerCommandContribution(r,"orion.compare.copyToRight",111,null,!1,new n.KeyBinding(39,!0,!1,!0)),a.registerCommandContribution(r,"orion.compare.nextDiff",112,null,!1,new n.KeyBinding(40,!0)),a.registerCommandContribution(r,"orion.compare.prevDiff",113,null,!1,new n.KeyBinding(38,!0)),o.options.wordLevelNav?(a.registerCommandContribution(r,"orion.compare.nextChange",114,null,!1,new n.KeyBinding(40,!0,!0)),a.registerCommandContribution(r,"orion.compare.prevChange",115,null,!1,new n.KeyBinding(38,!0,!0))):(a.registerCommandContribution(r,"orion.compare.nextChange",114,null,!0,new n.KeyBinding(40,!0,!0)),a.registerCommandContribution(r,"orion.compare.prevChange",115,null,!0,new n.KeyBinding(38,!0,!0))),a.registerCommandContribution(r,"orion.compare.ignoreWhitespace",109))}},renderCommands:function(e){var t=this.options.commandSpanId,i=this.options.toggleCommandSpanId,n=this.options.commandService;n&&(t||i)&&(i&&(o.empty(o.node(i)),n.renderCommands(i,i,e,e,"tool",null)),t&&(o.empty(o.node(t)),this.options.gridRenderer&&this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),n.renderCommands(t,t,e,e,"tool",null,this.options.gridRenderer.navGridHolder)):(n.renderCommands(t,t,e,e,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):n.renderCommands(t,t,e,e,"tool",null,this.options.gridRenderer.navGridHolder)):n.renderCommands(t,t,e,e,"tool",null)))}},s}(),s}),define("compare/builder/compare",["orion/commandRegistry","orion/staticDataSource","orion/contentTypes","orion/Deferred","orion/webui/littlelib","orion/compare/compareView","orion/compare/compareCommands"],function(e,t,i,n,o,r,s){function a(e){return u.getFilenameContentType(e)}function l(e){var t=new n,i=new XMLHttpRequest;return i.open("GET",e,!0),i.onreadystatechange=function(){if(4===i.readyState){var e="undefined"!=typeof i.response?i.response:i.responseText,n="string"==typeof e?e:null,o=i.status;o>=200&&400>o?t.resolve(n):t.reject(n)}},i.send(),t}function d(e){if(!e)return e;var t=o.node(e);if(t){if("ul"!==t.nodeName.toLowerCase()){var i=document.createElement("ul");return i.id=e+"__compareCmdUL",i.classList.add("layoutLeft"),i.classList.add("commandList"),t.appendChild(i),i.id}t.classList.add("commandList")}return e}function c(e,i,n,o,l){var c=e;if(!c.highlighters&&c.oldFile&&c.oldFile.Name&&c.newFile&&c.newFile.Name&&(c.highlighters=[new t.SyntaxHighlighter,new t.SyntaxHighlighter]),c.oldFile&&c.oldFile.Name&&(c.oldFile.Type=a(c.oldFile.Name)),c.newFile&&c.newFile.Name&&(c.newFile.Type=a(c.newFile.Name)),i||l){var u=new s.CompareCommandFactory({commandService:h,commandSpanId:d(i),toggleCommandSpanId:d(l)});c.commandProvider=u}var p="inline"===n?"inline":"twoWay";this.compareView=o?new r.toggleableCompareView(p,c):"inline"===p?new r.inlineCompareView(c):new r.TwoWayCompareView(c),this.compareView.startup()}var h=new e.CommandRegistry({}),u=new i.ContentTypeRegistry(t.ContentTypes);return c.prototype={getCompareView:function(){return this.compareView},setFileNames:function(e,t){var i=this.getCompareView().getWidget().options;i.newFile&&e&&(i.newFile.Name=e,i.newFile.Type=a(e)),i.oldFile&&t&&(i.oldFile.Name=t,i.oldFile.Type=a(t))},refresh:function(){var e=this.getCompareView().getWidget().options;if(e.oldFile.URL&&e.newFile.URL){var t=[];t.push(l(e.oldFile.URL)),t.push(l(e.newFile.URL)),n.all(t,function(e){return{_error:e}}).then(function(e){this.getCompareView().getWidget().options.oldFile.Content=e[0],this.getCompareView().getWidget().options.newFile.Content=e[1],this.getCompareView().getWidget().refresh(!0)}.bind(this))}else this.getCompareView().getWidget().refresh(!0) -}},c}),define(["compare/builder/compare"],function(e){return e}); \ No newline at end of file diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare.css b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare.css deleted file mode 100644 index 2d9a66b9a41..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-12.0/built-compare.css +++ /dev/null @@ -1,4558 +0,0 @@ - -.headerLayout { - height: 35px; -} -.toolbarLayout { - height: 35px; - - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex-direction: row; - -ms-flex-direction: row; - -webkit-flex-direction: row; - -webkit-align-items: center; - align-items: center; -} -.fsToolbarLayout { - height: 30px; -} -.bannerLeftArea{ - - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 1; - -webkit-order: 1; - -ms-flex-order: 1; - order: 1; - -moz-box-flex: 1; - -webkit-box-flex:1; - -webkit-box-ordinal-group: 1; - - width: 20%; - - padding-left:5px; -} -.bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 60%; -} -@media only screen and (device-width: 768px) { - - - .bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 59%; -} - -} -.bannerRightArea{ - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 3; - -webkit-order: 3; - -ms-flex-order: 3; - order: 3; - -moz-box-flex: 1; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 3; - width: 20%; - padding-right:5px; -} -.banner-maximized { - display: none; -} -.footer-maximized { - display: none; -} -.content-fixedHeight { - clear: both; - overflow: hidden; - position: absolute; - top: 0; - - bottom: 0; - left: 35px; - right: 0; - background: #3b4b54; - -} -.content-fixedHeight-animation { - transition: left 0.3s ease; -} -.content-fixedHeight-maximized { - top: 0; - bottom: 0; -} -.content-sideMenu-closed { - left: 0; -} -.content-fluid { -} -.footer-fixed-bottom { - position: fixed; - bottom: 0; - z-index: 50; - right: 0; - left: 0; - - height: 0; - background:#ededed; -} -.layoutBlock { - clear: both; - margin: 0; - - padding: 4px 4px 0 4px; - vertical-align: baseline; -} -.layoutLeft { - float: left; - margin: 0; -} -.layoutRight { - float: right; - margin: 0; -} -.layoutFlexStretch { - flex: 1 1; - -ms-flex: 1 1; - -webkit-flex: 1 1; -} -.spacingLeft { - margin-left: 5px; -} -.spacingRight { - margin-right: 5px; -} -.clear { - clear: both; -} -.hidden { - visibility: hidden; -} -.sidePanelLayout { - display: block; - position: absolute; - left: 0; - width: 33%; - height: 100%; -} -.generalAnimation { - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: all 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelLayoutAnimation { - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -o-transition: width 0.5s ease; - transition: width 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelVerticalLayout { - display: block; - position: absolute; - top: 0; - height: 33%; - width: 100%; -} -.sidePanelVerticalLayoutAnimation { - -webkit-transition: height 0.5s ease; - -moz-transition: height 0.5s ease; - -o-transition: height 0.5s ease; - transition: height 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelMargins { - margin-left: 8px; - margin-top: 2px; - margin-bottom: 8px; - width: auto; -} -.mainPanelLayout { - display: block; - position: absolute; - right: 0; - height: 100%; -} -.mainPanelLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.mainPanelVerticalLayout { - display: block; - position: absolute; - bottom: 0; - width: 100%; -} -.mainPanelVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.fixedToolbarHolder { - position: relative; - left: 0; - top: 0; - height: 100%; - width: 100%; - min-width:140px; - background:#3b4b54; -} -.sidebarWrapper { - overflow-x: auto; - overflow-y: hidden; - min-width: 0; -} -.sidebarWrapper > .sidebar { - position: relative; - left: 0; - top: 0; - height: calc(100% - 29px); - overflow-x: visible; -} -.projectNavSidebarWrapper > .sidebar { - height: calc(100% - 0px); -} -.workingTarget { - position: absolute; - top: 0; - width: 100%; - bottom: 0; - overflow-y: auto; - background:white; -} -.toolbarTarget { - position: absolute; - top: 35px; - width: 100%; - overflow-y: auto; -} -.toolbarTarget-toolbarHidden { - top: 0; -} -.pageLayoutTarget { - position: absolute; - width: calc( 100% - 15px ); - bottom: 0; - overflow-y: auto; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33); - margin: 5px; - margin-right: 0; - padding-top: 10px; - padding-bottom: 5px; - background: white; -} -.hasSplit { - display: none; -} -.editorViewerFrame { - width: 100%; - height: 100%; -} -.editorViewerHeader { - display:flex; - background: #3B4B54; - color: white; - flex-direction:row; - align-items:center; - line-height:26px; - border-bottom: 1px solid #263238; -} -.editorViewerHeaderDirtyIndicator { - padding-left: 5px; -} -.editorViewerHeaderTitle { - padding-left: 5px; -} -.editorViewerContent { - position: absolute; - width: 100%; - top: 27px; - bottom: 0; - overflow: auto -} -.editorViewerPicInPic { - position: absolute; - border: 1px solid #ccc; - background-color: white; - z-index: 100; - bottom: 35px; - right: 35px; - width: 40%; - height: 40%; -} -.splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 51; - width: 3px; - cursor: e-resize; - visibility: hidden; -} -.splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 51; - height: 3px; - cursor: n-resize; - visibility: hidden; -} -@media only screen -and (min-device-width : 768px) -and (max-device-width : 1024px) { - - .splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 50; - width: 20px; - cursor: e-resize; - visibility: hidden; - } - - - .splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 50; - height: 20px; - cursor: n-resize; - visibility: hidden; - } - -} -.splitThumbLeftLayout { - position: absolute; - left: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-left: -1px; - cursor: pointer; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitThumbRightLayout { - position: absolute; - right: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-right: -1px; - cursor: pointer; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; -} -.splitVerticalThumbUpLayout { - position: absolute; - top: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - margin-top: -1px; - cursor: pointer; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitVerticalThumbDownLayout { - position: absolute; - bottom: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - cursor: pointer; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} -.splitLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.splitVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.panelTracking { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: auto; -} -.commandList { - padding: 0; - margin-left: 0; - margin-right: 0; - list-style-type: none; - vertical-align: baseline; -} -.commandList > li { - float: left; - margin-left: 4px; - margin-right: 4px; -} -.commandMargins { - margin-left: 4px !important; - margin-right: 4px !important; -} -.commandMargins:last-child { - margin-right: 0 !important; -} -.sideMenu{ - width: 35px; - background: #26343F; - float: left; - position: absolute; - top: 0; - - bottom: 0; - -webkit-animation: slide 0.5s forwards; - -webkit-animation-delay: 2s; - animation: slide 0.5s forwards; - animation-delay: 2s; - display:block; - margin:0; - font-family: sans-serif; - font-size:10px; - text-decoration:none !important; - user-select: none; - -webkit-user-select: none; - -moz-user-select: -moz-none; -} -.sideMenu.animating { - z-index: 0; -} -.sideMenu-maximized { - top: 0; - bottom: 0; -} -.sideMenu-closed { - width: 0; - display: none; -} -.sideMenuHome{ - width: 100%; - height: 35px; -} -.sideMenuList{ - display:inline-block !important; - height: calc(100% - 64px); - margin: 0; - overflow-y: hidden; - padding: 0; - text-align: center; - width: 100%; -} -.sideMenuItem{ - list-style-type: none; - font-size:16px !important; - padding: 0; - margin: 3px; -} -.sideMenuItem:hover, .sideMenuItem.expanded { - text-decoration:none; - color:#F47D64 !important; -} -.sideMenu:hover > .sideMenuScrollButton { - opacity: 1; -} -.sideMenuScrollButton { - background-color: rgba(0,0,0,0.5) !important; - color: white !important; - cursor: pointer; - display: none; - height: 19px; - opacity: 0.5; - position: absolute; - width: 100%; - z-index: 100; -} -.sideMenuScrollButton.visible { - display: block; -} -.sideMenuTopScrollButton { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); -} -.sideMenuBottomScrollButton { - bottom: 0; - left: 0; -} -.sideMenuItem > .submenu-trigger { - color: #6D8B93 !important; - font-size:16px; - text-decoration:none !important; - width: 100%; - display: inline-block; - padding: 4px 0 4px 0; -} -.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{ - text-decoration:none; - color:white !important; -} -.sideMenuItemActive { -} -.sideMenuItemActive > .submenu-trigger { - color: white !important; -} -.sideMenuToggle { - display: none; -} -.sideMenu-notification { - position: relative; -} -.sideMenu-notification[level=info] { - background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=warn] { - background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=error] { - background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenuSubMenu{ - display: none; - list-style-type:none; - position:absolute; - font-family:sans-serif; - padding-left: 0; - z-index:100; - text-align: left; - left: 40px; -} -.sideMenuSubMenuItem{ - display: inline-block; - width: 100%; - white-space: nowrap; - font-size: 12px; - background: white; - border-right:1px solid #ddd; -} -.sideMenuSubMenuItem:before { - width: 0; - height: 0; - top: 13px; - content: ""; - left: -8px; - position: absolute; - z-index: 200; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-right: 8px solid white; -} -.sideMenuSubMenuItem:first-child{ - border-top:1px solid #ddd; - border-top-right-radius: 4px; -} -.sideMenuSubMenuItem:last-child{ - border-bottom:1px solid #ddd; - border-bottom-right-radius: 4px; -} -.sideMenuSubMenuItem a { - display: inline-block; - color: #444; - padding: 12px 30px 12px 10px; - width: calc(100% - 30px - 10px + 8px); -} -.sideMenuSubMenuItem a:hover{ - text-decoration:none; - color: black !important; -} - -.sideMenuSubMenuItem:hover { - background-color: #fde7cf; -} -.sideMenuSubMenuItem:only-child:hover { - -} -.sideMenuSubMenuItem:only-child:hover a { - color: #333; -} -.sideMenuSubMenuItem a span { - display: inline-block; -} -.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded { - display:inline-block; -} -.sidebar-decorate-active { - position: relative; - background: - radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat, - #47575F; - background-position: - 30px 29px, - 0 0; - background-size: - 8px 8px; -} -.mainContent{ - position:absolute; - left:35px; -} -.innerPanels{ - position:absolute; - width:100%; - top:35px; - bottom:0; -} -.userMenu { -} -.splash { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgb(57,75,84); - z-index: 149; - display: block; - box-shadow: 0 3px 7pt 0 rgba(0,0,0,0.3) inset; -} -.splashSeeThroughX { - -webkit-animation-name: splashSeeThrough; - animation-name: splashSeeThrough; - animation-duration: 0.7s; - background-color: rgba(38,52,63, 0.7); -} -@-webkit-keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -@keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -.splashContainer { - display: flex; - display: -webkit-flex; - align-items: center; - -webkit-align-items: center; - justify-content: center; - -webkit-justify-content: center; - height:100%; - flex-direction: column; - -webkit-flex-direction: column; - font-family: sans-serif; - font-size: 14px; -} -.splashLoader { - display: flex; - display: -webkit-flex; - height:300px; - width:100%; - flex-direction: column; - -webkit-flex-direction: column; - align-items: center; - -webkit-align-items: center; - background-color: rgb(57,75,84); -} -.splashAbout { - text-align: center; - color: #FFFFFF; - font-size:16px; - font-family: 'helvetica'; - font-weight: bold; - margin-bottom: 10px; -} -.splashSteps { - margin:20px; - max-width: 300px; -} -.splashStep { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - padding-top: 10px; - padding-bottom:10px; - height:24px; -} -.splashMessages { -} -.splashMessage { - color: white; - font-size: 14px; -} -.splashDetailedMessage { - color: white; - font-size: 12px; - padding-left: 20px; -} -.splashVisual { - width: 24px; -} -.splashVerbal { - margin-left:20px; - color: #3BDEFF; - font-family: 'helvetica'; - font-weight: bold; - margin-top: 3px; -} -.splashVerbalwaiting { - color:grey; -} -.splashLoadingImage { - background: url(../../images/loading_24.gif) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.splashSuccessImage { - background: url(../../images/message_success_24.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.progress { - text-align: right; - margin-right: 8px; -} -.progressIcon { - margin: 0 6px 0 0; -} -.progressInfo { - color: white !important; - background-color: #1BB199 !important; -} -.progressInfo a { - text-decoration: underline; -} -.progressWarning { - color: white !important; - background-color: #f0ad4e !important; - border: 1px solid #f0ad4e !important; -} -.progressError { - color: white !important; - background-color: #d9534f !important; - border: 1px solid #d9534f !important; -} -.progressNormal { - color: white !important; - background-color: #1BB199 !important; - border: 1px solid #1BB199 !important; -} -.progressPane { - vertical-align: middle; - margin-right: 24px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressWatch { - cursor: pointer; - text-align: center; - position: relative; - display: inline-block; - width: 16px; - height: 16px; - background: transparent; - border: none; - margin-right: 6px; - margin-left: 12px; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.watchButton { - border-top: 1px solid #626e76; - position: relative; - top: 0; - width: 3px; - left: calc(50% - 2px); - height: 0px; - border-radius: 40%; - transition: top 0.5s ease, border-color 1s ease; -} -.watchBody { - position: relative; - left: 1px; - top: 1px; - width: calc(100% - 5px); - height: calc(100% - 5px); - background: transparent; - border: 1px solid #626e76; - -moz-border-radius: 50%; - -webkit-border-radius: 50%; - border-radius: 50%; - - transition: border-color 1s ease; -} -.watchBody span.hand { - position: absolute; - border-radius: 40%; -} -.watchBody .hand.longMinute { - top: 1px; - left: 5px; - position: absolute; - height: 9px; - width: 1px; -} -.watchBody .hand.longMinute > .darkSide { - position: absolute; - left: 0; - width: 1px; - display: block; - border-radius: 40%; - height: 5px; - background: #626e76; - transition: background-color 1s ease; -} -.watchBody .hand.longHour { - top: 5px; - left: 2px; - position: absolute; - width: calc(100% - 4px); - height: 1px; -} -.watchBody .hand.longHour > .darkSide { - position: absolute; - height: 1px; - display: inline-block; - border-radius: 40%; - right: 0; - width: 4px; - background: #626e76; - - transition: background-color 1s ease; -} -.progressWatch.running .watchBody .hand { - -webkit-animation: rotate 60s infinite linear; - -moz-animation: rotate 60s infinite linear; - -ms-animation: rotate 60s infinite linear; - -o-animation: rotate 60s infinite linear; - animation: rotate 60s infinite linear; -} -.progressWatch.running .watchBody .hand.longHour { - -webkit-animation-duration: 6s; - -moz-animation-duration: 6s; - -ms-animation-duration: 6s; - -o-animation-duration: 6s; - animation-duration: 6s; -} -.progressWatch.running .watchBody .hand.longMinute { - -webkit-animation-duration: 0.5s; - -moz-animation-duration: 0.5s; - -ms-animation-duration: 0.5s; - -o-animation-duration: 0.5s; - animation-duration: 0.5s; -} -.progressWatch.running .watchButton { - border-color: white; - top: 1px; -} -.progressWatch.running .watchBody { - border-color: white; -} -.progressWatch.running .watchBody .hand.longHour > .darkSide { - background-color: white; -} -.progressWatch.running .watchBody .hand.longMinute > .darkSide { - background-color: white; -} -.progressWatch.warning .watchButton { - border-color: #d99608; -} -.progressWatch.warning .watchBody { - border-color: #d99608; - background-color: #fce1a9; -} -.progressWatch.warning .watchBody .hand.longHour > .darkSide { - background-color: #d99608; -} -.progressWatch.warning .watchBody .hand.longMinute > .darkSide { - background-color: #d99608; -} -.progressWatch.error .watchButton { - border-color: #b94a48; -} -.progressWatch.error .watchBody { - border-color: #b94a48; - background-color: #EFA1A7; -} -.progressWatch.error .watchBody .hand.longHour > .darkSide { - background-color: #b94a48; -} -.progressWatch.error .watchBody .hand.longMinute > .darkSide { - background-color: #b94a48; -} -@-webkit-keyframes rotate { - 0% { -webkit-transform: rotate(0deg);} - 100% { -webkit-transform: rotate(360deg);} -} -@-moz-keyframes rotate { - 0% { -moz-transform: rotate(0deg);} - 100% { -moz-transform: rotate(360deg);} -} -@keyframes rotate { - 0% { transform: rotate(0deg);} - 100% { transform: rotate(360deg);} -} -.progressWarning .progressPane_running, .progressWarning .core-sprite-progress { - border-color: #f0ad4e; -} -.progressError .progressPane_running, .progressError .core-sprite-progress { - border-color: #b94a48; -} -.progressNormal .progressPane_running, .progressNormal .core-sprite-progress { - border-color: #468847; -} -.progressPane_running_dialog { - vertical-align: middle; - margin: 2px 8px 2px 2px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressPane_finished_dialog { - vertical-align: middle; - background: url(../../images/none.png) no-repeat center; - width: 16px; height: 16px; -} -.progressPane_empty { - -} -.notificationShow { - color: white; - background-color: #1BB199; - top: 0; - position: fixed; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - max-height: 1000px; - overflow: hidden; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 5px; - z-index: 7000; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - border:none; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notificationHide { - color: white; - background-color: #1BB199; - top: -45px; - position: fixed; - text-align:center; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - box-shadow: 0 2px 0 rgba(0,0,0,0.1); - max-height: 1000px; - overflow: hidden; - padding-left: 5px; - z-index: 300; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notifications a { - color: white; - text-decoration: underline; -} -.notifications { - display: inline-block; - text-align: left; -} -.notifications p:first-child { - margin-top: 0; -} -.notifications p:last-child { - margin-bottom: 0; -} -@font-face { - font-family: 'Orion Icon Font'; - src: url(../../font/OrionIconFont-Regular.eot); - src: url(../../font/OrionIconFont-Regular.eot?#iefix) format('embedded-opentype'), - url(../../font/OrionIconFont-Regular.woff) format('woff'), - url(../../font/OrionIconFont-Regular.ttf) format('truetype'), - url(../../font/OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f) format('svg'); - - font-style: normal; - font-weight: 400; -} - -html { - cursor: default; - height: 100%; -} -body { - margin: 0; - padding: 0; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - font-size: 9pt; - min-width:700px; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -h2 { - font-size: 1.1em; - font-weight: bold; - color: #6d6d6d; - margin-top: 4px; - margin-bottom: 4px; -} -img { - border: 0; -} - -button::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - -moz-user-select: text; - text-indent: 0; - text-shadow: none; - border: 1px solid #bbb; - color: #333; - font-size: 9pt; - padding: 2px; - margin-left: 5px; -} -textarea { - border: 1px solid #bbb; -} -html[dir="rtl"] input{ - margin-right: 5px; - margin-left: auto; -} - -.navlink { - display: inline-block; - padding: 2px; - color: #333333; -} -.navlink:hover { - color: #00AED1; -} -.navlink > span { - color: inherit; -} -.nav_fakelink:hover { - cursor: pointer; -} -.navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: #555; -} -.navlinkonpage:active { - text-decoration: none; -} -.navlinkonpage:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; -} -#auxpane .navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: inherit; -} -#auxpane .navlink { - display: inline-block; - padding: 2px; - color: inherit; - vertical-align: bottom; - line-height: 12px; - border-bottom: 1px solid transparent; -} -#auxpane .navlink:hover { - border-bottom: 1px dotted; -} -.dragOver { - color: white !important; - background: #1bb199; - outline: #AAA 2px dotted !important; -} -.logo { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 0 -517px; - width: 37px; height: 14px; - margin-top: 6px; - margin-right:5px; -} -html[dir="rtl"] .logo { - margin-left:5px; - margin-right:auto; -} -.toolbarTarget:focus{ - outline:none; -} -.pageNav { - color: #808080; - font-size: 8pt; -} -.pageActions { - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.runBar { - -webkit-align-items: center; - align-items: center; - display: -webkit-inline-flex !important; - display: inline-flex !important; - height: 100%; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.status { - color: white; - vertical-align: baseline; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.toolComposite { -} -.taskTitle { - min-width: 10em; -} -.taskDescription { - font-size: 8pt; - padding: 8px; -} -.pageNavigationActions { - text-align: right; - min-height: 30px; -} -html[dir="rtl"] .pageNavigationActions { - text-align: left; -} -.parameters { - color: whitesmoke; - vertical-align: middle; -} -.parametersDismiss { - color: whitesmoke; - vertical-align: middle; - font-weight: normal; - padding: 3px 0 0 3px; - padding-bottom: 0; -} -html[dir="rtl"] .parametersDismiss { - padding: 3px 3px 0px 0px; -} -.dismissButton { - border: 1px solid transparent; - background: transparent; - color: white; - cursor: pointer; - border-radius: 1px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.githubCloneAuth .dismissButton { - color: #1bb199; - margin-left: 0; -} -.githubCloneAuth .dismissButton:hover { - color: #1bb199; -} -.parametersDismiss .core-sprite-close { - margin-right: 0; - padding-right: 0; - padding-top: 0; -} -html[dir="rtl"] .parametersDismiss .core-sprite-close { - margin-left: 0; - margin-right: auto; - padding-left: 0; -} -.cancelButton { - border: 1px solid transparent; - background: #D3D3D3 !important; - color: black; - border-radius: 3px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; -} -.dismissButton:hover { - color: #fdfdfd; -} -.parameterPrompt { - color: #fdfdfd; - display: block; - padding: 6px 4px 0; -} -.parameterMessage { - max-width: 400px; - padding: 6px 4px; -} -.parameterInlineButton { - vertical-align: baseline; -} -label.parameterInput { - color: #555; - white-space: nowrap; -} -.parameterInput { - margin: 4px; - font-weight: normal; - vertical-align: middle; - color:#333; - outline:none; -} -button.dismissButton.parameterInput { - color: whitesmoke; - margin-top: 3px; - margin-bottom: 3px; -} -.parameterInvalid { - background-color: rgb(243, 224, 220); -} -input.parameterInput[type=url] { - width: 30em; -} -input.parameterInput[type=checkbox] { - width: auto; -} -textarea.parameterInput { - vertical-align: top; - width: 50em; -} -.parameterPopup { - min-width: 15em; - max-width: 100em; - color: #333; -} -.parameterPopup > label{ - color: whitesmoke; -} -.parameterPopup > input{ - color: #333; -} -.navTableHeading { - color: #404040; - border-bottom: 1px solid #404040; -} -.navColumn { - min-width: 150px; - vertical-align: baseline; - padding: 2px; -} -.navColumnNoIcon { - padding: 6px; -} -.navRow { - vertical-align: baseline; - border-spacing: 8px; -} -.selectableNavRow:hover { -} -.disabledNavRow > .navColumn > .mainNavColumn { - outline: 1px dashed lightgray; -} -.disabledNavRow > .navColumn > .mainNavColumn > * { - color: gray; - cursor: default; -} -.disabledNavRow > .navColumn > .mainNavColumn > *:hover { - border: none; -} -.mainNavColumn { - display: inline-block; - vertical-align: baseline; - white-space: nowrap; -} -.singleNavColumn { - width: calc(100% - 6px); - white-space: nowrap; -} -.actionsColumn { - min-width: 300px; - text-align: right; - padding-left: 16px; - vertical-align: middle; - height: 24px; -} -html[dir="rtl"] .actionsColumn { - text-align: left; - padding-right: 16px; - padding-left: 0px; -} -.selectionCheckmarkSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - border: 0; -} -.modelDecorationSprite { - display: inline-block; - vertical-align: middle; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; -} -html[dir="rtl"] .modelDecorationSprite { - padding-left: 8px; - padding-right: 0px; -} -.advancedSearchDecorationSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - margin-left: 0px; - padding-right: 0px; -} -.thumbnail { - vertical-align: middle; - padding: 0; - margin: 0; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; - height: 16px; - width: 16px; - vertical-align:bottom; -} -html[dir="rtl"] .thumbnail { - padding-left: 8px; - padding-right: 0px; -} -@media all and (min-device-width: 1025px) { - .modelDecorationSprite { - padding: 0; - margin: 0; - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .modelDecorationSprite { - padding-left: 2px; - padding-right: 0px; - } - - .thumbnail { - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - max-height: 24px; - max-width: 48px; - vertical-align:bottom; - } - - html[dir="rtl"] .thumbnail { - padding-left: 2px; - padding-right: 0px; - } - - .selectionCheckmarkSprite { - padding: 0; - padding-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .selectionCheckmarkSprite { - padding-left: 2px; - padding-right: 0px; - } - - .checkColumn { - width: 22px; - } -} -.pane { - margin: 0; - padding: 0; - background: #FFFFFF; - min-width: 300px; -} -.userEditBoxPrompt { - background: white; - color: black; -} -.auxPadding { - padding-left: 8px; - padding-top: 2px; - padding-bottom: 8px; -} -html[dir="rtl"] .auxPadding { - padding-right: 8px; - padding-left: 0px; -} - -.help { - font-weight: bold; - font-size: 1.2em; - padding-left: 8px; - padding-right: 8px; -} -.footer { - text-align: left; - width: 100%; - border: 0; - padding: 0; -} -html[dir="rtl"] .footer { - text-align: right; -} -.toolbarLabel { - padding-left: 8px; -} -html[dir="rtl"] .toolbarLabel { - padding-right: 8px; - padding-left: 0px; -} -.slideContainer { - height: auto; - float: right; - margin: 2px; - margin-top: 0; - margin-left: 4px; - display: none; - vertical-align: middle; - font-size: 11px; - z-index: 70; - color: #999; -} -html[dir="rtl"] .slideContainer { - float: left; - margin-right: 4px; - margin-left: auto; -} -.slideParameters { - background-color: #5fc8b7; -} -.mainToolbar .slideContainer { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; - top: -36px; - -webkit-transition: top 0.3s ease; - -moz-transition: top 0.3s ease; - -o-transition: top 0.3s ease; - transition: top 0.3s ease; -} -.mainToolbar .slideParameters { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; -} -.slideContainerActive { - display: block; -} -.activeCommand { - background-color: #e3e3e3; - border: 1px solid #9a9a9a; -} -.commandMarker { -} -.bannerMenu { - margin: 0; - margin-left: 8px; - margin-right: 8px; - font-size: 7pt; - display: inline-block; - padding-top:0 !important; - vertical-align: baseline; -} -.bannerMenuSearchOptions { - margin-left: -20px; -} -html[dir="rtl"] .bannerMenuSearchOptions { - margin-right: -20px; - margin-left: 0px; -} -.bannerButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - border-radius:3px; - margin: 2px; - padding: 2px; -} -.bannerButton:hover { - background-color: #e6e6e6; - border: 1px solid #808080; -} -.toolbarButton { - border: 0; - padding: 0; - height: 20px; -} -.keyAssistFloat { - color: white; - display: none; - background: rgba(55, 71, 79, 0.9); - position: fixed; - right: 44px; - top: 80px; - min-width: 250px; - padding: 5px; - z-index:100; - border-radius: 4px; -} -html[dir="rtl"] .keyAssistFloat { - left: 44px !important; - right: auto !important; -} -.keyAssistContents { - width: auto; - height: 400px; - margin-top: 8px; - margin-bottom: 1px; - overflow: hidden; -} -.keyAssistInput { - color: inherit; - background: #263238; - width: 100%; - margin: 0; - padding-left: 0; - padding-right: 0; -} -.keyAssistBindingInput { - font-size: 10pt; - font-weight: bold; - color: #efc100; - background: #263238; - border: none; - outline: none; - height: 100%; - text-align: right; - margin: 0; - padding: 0; -} -.keyAssistList { - width: 100%; - border-collapse: collapse; - outline: none; -} -.keyAssistItem { -} -.keyAssistItem.selected { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistItem:hover { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistEditButton { - display: block; - visibility: hidden; - font-size: 13px !important; - color: white !important; -} -.keyAssistEditButtonVisible { - visibility: visible; -} -.keyAssistActions { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.keyAssistItem:hover .keyAssistEditButton { - visibility: visible; -} -.keyAssistSpacer { - width: 16px; - height: 14px; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.keyAssistFloat h2 { - color: gold; -} -.keyAssistName { - text-align: left; - padding: 3px; -} -.keyAssistAccel { - - font-size: 10pt; - font-weight: bold; - color: #efc100; - text-align: right; - padding: 3px; - min-width: 150px; -} -.inputCompletionContainer { - border-radius:1px; - color: black; - display: block; - border: 1px solid #DDD; - background: #fefefe; - max-height: 300px; - max-width: 300px; - min-width: 150px; - position: absolute; - overflow-y: auto; - overflow-x: hidden; - padding: 2px; - box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); - z-index:200; -} -.inputCompletionDismissButton { - background: transparent; - color: silver; - border-radius: 1px; - padding: 0; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.inputCompletionLILeftTD { - height: 19px; - font-size: 9pt; -} -.inputCompletionLIRightTD { - width: 19px; - height: 19px; -} -.inputCompletionUL { - list-style : none; - margin: 0; - padding: 0; -} -.inputCompletionLISelected { - background : #ffeecc; -} -.inputCompletionLICategory { - font-weight: bold; -} -.inputCompletionLINormal { - background : white; -} -#tree { - margin-right: 9em; - overflow-x: hidden; -} -html[dir="rtl"] #tree { - margin-left: 9em; - margin-right: auto; -} -#treeButtons br { - line-height: 0.5em; -} -#treeButtons { - margin: 0; - padding: 0; - float: right; - width: 9em; -} -html[dir="rtl"] #treeButtons { - float: left; -} -#treeButtons .contentButton { - width: 8.5em; - margin: 0; - margin-bottom: 3px; - font-size: 1em; -} -.testResult { - background-color: #444444 !important; - color: white; -} -.folderItem { - background: url(../../images/folder.png); -} -.fileItem { - background: url(../../images/file.png); -} -.newItem { - background: url(../../images/addcontent.png); -} -.treetable { - border-spacing: 0; - width:100%; -} -.miniNavTreeTable { - border-spacing: 0; - width:100%; - padding-left:0px; -} -.secondaryColumn { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; -} -html[dir="rtl"] .secondaryColumn { - padding-left: 8px; - padding-right: 0px; -} -.secondaryColumnRight { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; - text-align: right; -} -html[dir="rtl"] .secondaryColumnRight { - padding-left: 8px; - padding-right: 0px; - text-align: left; -} - -.secondaryColumnLeft { - color: #666666; - padding-right: 8px; - padding-left: 8px; - padding-top: 8px; - vertical-align:top; - text-align: left; -} -html[dir="rtl"] .secondaryColumnLeft { - text-align: right; -} -.primaryColumn { - color: #3087B3; - text-decoration: none; - vertical-align:top; -} -.checkColumn { - padding: 0; - padding-left:10px; -} -html[dir="rtl"] .checkColumn { - padding-right:10px; - padding-left:0px; -} -.testNavTreetable { - min-width: 150px; -} -.testResultTreetable { - min-width: 600px; -} -.selectionModelContainer { - outline: none; -} -.treeIterationCursor { - border-radius:4px; -} -.lightSectionTreeTableRow { - background-color: #FFFFFF; -} -.darkSectionTreeTableRow { - background-color: #f5f7f9; -} -.treeIterationCursorRow { - background-color: rgba(27, 177, 153, 0.3); -} -.treeIterationCursorRow_Dotted { - background-color: rgba(27, 177, 153, 0.3); -} -.searchCmdGroupMargin { - margin-left: 16px; - margin-top: 2px; -} -html[dir="rtl"] .searchCmdGroupMargin { - margin-right: 16px; - margin-left: auto; -} -.LoginWindowLeft { - padding-left: 0.5em; -} -html[dir="rtl"] .LoginWindowLeft { - padding-right: 0.5em; - padding-left: 0em; -} -.LoginWindowRight { - padding-right: 0.5em; -} -html[dir="rtl"] .LoginWindowRight { - padding-left: 0.5em; - padding-right: 0em; -} -.LoginWindowComment { - font-size: 0.9em; - padding-left: 15px; -} -html[dir="rtl"] .LoginWindowComment { - padding-right: 15px; - padding-left: 0px; -} -#outline #switchOutlineMenu { - float: right; -} -html[dir="rtl"] #outline #switchOutlineMenu { - float: left; -} -#outline #switchOutlineMenu .commandImage { - display: none; -} -#outline>ul { - padding-left: 0 !important; - clear: both; - margin: 4px 0 0 8px; -} -html[dir="rtl"] #outline>ul { - padding-right: 0 !important; - margin: 4px 8px 0px 0px; -} -#outline ul { - padding-left: 14px; -} -html[dir="rtl"] #outline ul { - padding-right: 14px; - padding-left: 0px; -} -#outline li { - padding-bottom: 2px; - list-style-type: none; - white-space: nowrap; -} -.uploadContainer{ - padding:20px; - font-weight:bold; -} -.dottedOutline{ - border: #DDD 4px dashed; - border-radius: 2px; - padding:50px; - height:300px; - width: 300px; -} -.floatingSection{ - color: #DDD; -} -.uploadInstruction{ - font-size: 18pt; - color: #CCC; - padding: 0 0 25px; - text-align:center; -} -.tipInstruction{ - font-size: 12pt; - color: #CCC; - padding: 0 0 100px; - text-align:center; -} -.uploadOptions { - font-size: 14pt; - color: #BBB; - padding: 0 0 100px; - text-align: center; - vertical-align: middle; -} -.uploadOptionsItem { - font-size: 12pt; - color: #BBB; - text-align: center; - vertical-align: middle; - margin: 0 8px !important; -} -.uploadChooser{ - vertical-align: middle; - margin-right: 24px; - margin-bottom: 4px; - border: 1px solid #dedede; - border-radius:1px; -} -html[dir="rtl"] .uploadChooser{ - margin-left: 24px; - margin-right: auto; -} -.targetSelector{ -} -#folderNameparameterCollector{ - color:#333; -} -#urlparameterCollector{ - color:#333; -} -.setting-control { - display: table-cell; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; - vertical-align: middle; -} -.setting-control[type="text"] { - width: 120px; -} -.local { - display: table; -} -.local > div { - display: table-row; -} -.local .setting-label { - padding-left: 8px; - text-align: right; - display: table-cell; - vertical-align: middle; -} -html[dir="rtl"] .local .setting-label { - padding-right: 8px; - padding-left: 0px; - text-align: left; -} -.delegatedUI { - position: absolute; - min-width: 250px; - min-height: 100px; - - width: 600px; - height: 400px; - z-index: 150; - border: 1px inset; - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, 0.2); - border: 1px solid #BBBBBB; - border-collapse: separate; - border-radius: 1px; -} -.centralNavigation { - margin-bottom:2px; - cursor:pointer; -} -.centralNavigation:hover{ - color: #00AED1; -} -.navigationLabel{ - color:#ddd; - cursor:pointer; - display: inline; - padding-right: 3px; -} -html[dir="rtl"] .navigationLabel{ - padding-left: 3px; - padding-right: 0px; -} -.groupedContentDivider{ - float: left; - width: 1px; - height: 160px; - margin-top: 10px; - margin-bottom: 10px; - border-left: dashed 1px #ddd; -} -html[dir="rtl"] .groupedContentDivider{ - float: right; - border-right: dashed 1px #ddd; - border-left: 0px; -} -.navigationBreadcrumb{ - font-family: sans-serif; -} -.currentLocation{ - margin-left:auto; - margin-right:auto; -} -.modifiedFileMarker{ - color:#333; - padding-left:5px; -} -html[dir="rtl"] .modifiedFileMarker{ - padding-right:5px; - padding-left:0px; -} -.noFile { - padding: 10px; - vertical-align: middle; -} -.navColumnBold { - font-weight: bold; -} -.icon-inline { - display: inline-block; - vertical-align: middle; - margin: 0 2px 0 2px; -} -.projectNavColumn { - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn { - color: white; -} -.projectNavColumn a{ - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn a{ - color: white; - font-weight: bold; -} -.projectInformationNode{ -} -.sectionWrapper, .sectionTable{ - text-align: left; - border-collapse: collapse; - border-spacing: 0; - padding: 0; - margin-top: 5px; - overflow-y: hidden; -} -html[dir="rtl"] .sectionWrapper, html[dir="rtl"] .sectionTable{ - text-align: right; -} -.mainpane .sectionTable .treetable, .mainpane .sectionWrapper .treetable, .mainpane .sectionTable .treetable .actionsColumn{ - min-width: inherit; -} -.fixedMinWidthText { - overflow: hidden; - text-overflow: ellipsis; - display: block; - max-width: 300px; -} -.sectionTable { - margin-top: 0; - margin-left: 5px; - margin-right: 5px; - border: 1px solid #f1f3f4; - -webkit-transition: all 0.1s ease, left 0; - transition: all 0.1s ease, left 0; - -webkit-transform-origin: top; - -ms-transform-origin: top; - transform-origin: top; -} -.sectionWrapper+.sectionTable { - border-top: none; -} -.sectionTable:last-child { - margin-bottom: 5px; -} -.sectionTable.sectionClosed { - height: 0; - -webkit-transform: scaleY(0); - -ms-transform: scaleY(0); - transform: scaleY(0); -} -.sectionWrapper{ - border: 1px solid; - margin-left: 5px; - margin-right: 5px; - background: none repeat scroll 0 0 #f4f4f4; - vertical-align: middle; - font-weight: bold; - padding: 6px; - color: gray; - margin-bottom: 0; - border-color: #e3e7ea; - transition: all 0.1s ease; -} -.sectionWrapper.sectionClosed { - box-shadow: none; - opacity: 0.9; - background: none; -} -.sectionWrapper.sectionClosed:hover { - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); - opacity: 1; - transition: all 0.1s; -} -.sectionTable td { - border-bottom: 1px solid #f1f3f4; - vertical-align: middle; - color: gray; -} -.sectionTable tr:last-child td{ - border-bottom: 0; -} -.sectionTable div.lightTreeTableRow:last-child, .sectionTable div.lightTreeTableRow:last-child{ - border-bottom: 0; -} -#searchSectionContent.sectionTable { - box-shadow: none; -} -#searchSectionContent.sectionTable .mainNavColumn { - padding-right: 0; -} -.treeTableRow span.core-sprite-closedarrow, .treeTableRow span.core-sprite-openarrow { - cursor: pointer; -} -.treeTableRow span.core-sprite-closedarrow:hover, .treeTableRow span.core-sprite-openarrow:hover { - color: #00AED1; -} -.searchOutlineContainer { - height:100%; - width:100%; - position:relative; - overflow-y: auto; - overflow-x: auto; -} -.searchOutlineContainer .filesystemSwitcher .dropdownMenu { - position: fixed; -} -.orionMarkdown { - padding: 8px; - color: gray; -} -.orionMarkdown h1 { - position: relative; -} -.orionMarkdown h2 { - font-size: initial; -} -.orionMarkdown img { - max-width: 100%; -} -.orionMarkdown pre, .orionMarkdown code { - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 3px; -} -.orionMarkdown pre { - padding: 6px 10px; - overflow: auto; -} -.orionMarkdown code { - padding: 0 5px; - margin: 0 2px; -} -.orionMarkdown pre code { - background-color: transparent; - padding: 0; - border: 0; - margin: 0; -} -.markdownSelected { - background-color: #f7f7d5; -} -.orionProject input, .orionProject textarea{ - border: 1px solid lightgrey; -} -.orionProject .discreetInput { - border: 1px solid transparent; - color: gray; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - width: 90%; - margin-left: 0; - min-height: 15px; - background-color: inherit; -} -html[dir="rtl"] .orionProject .discreetInput { - margin-right: 0; - margin-left: auto !important; -} -.orionProject .discreetInput:hover, .orionProject .discreetInput:focus { - border: 1px solid lightgrey; - color: black; - background-color: white; -} -.discreetInputLabel { - font-weight: bold; - padding: 8px; -} -.discreetInputHidden { - display: none !important; -} -.discreetInputURLWrapper { - padding: 2px; -} -.discreetInputCell { - color: #666666; - padding: 1px; -} -.discreetInfoCell { - color: #666666; - padding: 8px; -} -.sectionTreeTable { - border-spacing: 0; - width:100%; -} -.sectionTreeTable td { - border-bottom: none !important; -} -.sectionTreeTableHeader{ - background: none !important; -} -.lightTreeTableRow, .darkTreeTableRow { - border-bottom: 1px solid #dadada; -} -.progressBar { - border-radius: 3px; - width: 0; - background-color: #fab467; - background: linear-gradient(#fabb76, #e1a25c); - display: inline-block; - height: 100%; -} -.progressBarWrapper { - border: 1px solid #dadada; - border-radius: 3px; - display: inline-block; - height: 14px; - margin-left: 5px; - overflow: hidden; - padding: 1px; - vertical-align: middle; - width: 100px; -} -html[dir="rtl"] .progressBarWrapper { - margin-right: 5px; - margin-left: auto; -} -.uploadNode { - background-color: whitesmoke; - padding: 2px 0; - vertical-align: middle; -} -.uploadNodeText { - display: inline-block; - overflow: hidden; - max-width: calc(100% - 145px); - padding: 4px; - text-overflow: ellipsis; - vertical-align: middle; - white-space: nowrap; -} -.progressBarWrapper .progressBar { - vertical-align: top; -} -.uploadNode .uploadCancelButton { - cursor: pointer; - float: right; - font-size: 14px; - padding: 2px 6px; - vertical-align: middle; -} -html[dir="rtl"] .uploadNode .uploadCancelButton { - float: left; -} -.uploadCancelButton:hover { - color: #00AED1; -} -.progressBar.continuous { - -webkit-animation:uploadAnimation 1s infinite linear; - -moz-animation:uploadAnimation 1s infinite linear; - animation:uploadAnimation 1s infinite linear; - background: linear-gradient(to right, transparent, #fab467, transparent); - width: 100%; -} -@-webkit-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@-moz-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -.promptDialogMessage { - color: #222; - margin: 0 2px 4px 2px; -} -.promptDialogInput { - min-width: 200px; - padding: 4px; - margin: 2px 2px 0 2px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.openResourceDialogInput { - display: inline-block; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.fileExplorerProgressDiv { - margin-left: 10px; -} -html[dir="rtl"] .fileExplorerProgressDiv { - margin-right: 10px; - margin-left: auto; -} -.commandSprite { - background: url(../../images/core_sprites.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; -} -.imageSprite { - display: inline-block; - vertical-align: middle; -} -.core-sprite-progress { - height:14px; - width:14px; - -webkit-animation: progressAnimation .7s infinite linear; - -moz-animation: progressAnimation .7s infinite linear; - animation: progressAnimation .7s infinite linear; - border-radius:100%; - background-image: none; - padding: 0px; - padding-top:2px; - border:2px solid rgba(1,1,1,0.7); - border-top:0px solid rgba(1,1,1,0); - outline: none; -} -@-webkit-keyframes progressAnimation { - from {-webkit-transform:scale(0.7) rotate(0deg);} - to {-webkit-transform: scale(0.7) rotate(360deg);} -} -@-moz-keyframes progressAnimation { - from {-moz-transform: scale(0.7) rotate(0deg);} - to {-moz-transform: scale(0.7) rotate(360deg);} -} -@keyframes progressAnimation { - from {transform: scale(0.7) rotate(0deg);} - to {transform: scale(0.7) rotate(360deg);} -} - -.core-sprite-check{ background-position: 0 -18px; width: 16px; height: 16px; } -.core-sprite-check_on{ background-position: 0 -36px; width: 16px; height: 16px; } -.core-sprite-compare-addition{ background-position: 0 -108px; width: 16px; height: 16px; } -.core-sprite-compare-removal{ background-position: 0 -126px; width: 16px; height: 16px; } -.core-sprite-copy-folder{ background-position: 0 -144px; width: 16px; height: 16px; } -.core-sprite-file_model{ background-position: 0 -257px; width: 16px; height: 16px; } -.core-sprite-go-down{ background-position: 0 -311px; width: 16px; height: 16px; } -.core-sprite-information{ background-position: 0 -365px; width: 16px; height: 16px; } -.core-sprite-initproject{ background-position: 0 -383px; width: 16px; height: 16px; } -.core-sprite-link{ background-position: 0 -419px; width: 16px; height: 16px; } -.core-sprite-list{ background-position: 0 -437px; width: 16px; height: 16px; } -.core-sprite-none{ background-position: 0 -491px; width: 16px; height: 16px; } -.core-sprite-ok{ background-position: 0 -509px; width: 16px; height: 16px; } -.core-sprite-replaceAll{ background-position: 0 -608px; width: 16px; height: 16px; } -.core-sprite-sep{ background-position: 0 -644px; width: 1px; height: 16px; } -.core-sprite-start{ background-position: 0 -680px; width: 16px; height: 16px; } -.core-sprite-thumbnail{ background-position: 0 -716px; width: 16px; height: 16px; } -.core-sprite-applicationrunning { - border-radius: 50%; - background-color: green; - width: 14px; - height: 14px; -} -.core-sprite-applicationstopped { - border-radius: 50%; - background-color: red; - width: 14px; - height: 14px; -} -.core-sprite-applicationnotdeployed { - border-radius: 50%; - background-color: white; - border: 1px solid grey; - width: 12px; - height: 12px; -} -.core-sprite-hamburger, -.core-sprite-silhouette, -.core-sprite-addcontent, -.core-sprite-gear, -.core-sprite-wrench, -.core-sprite-go-up, -.core-sprite-outline, -.core-sprite-move-down, -.core-sprite-move-up, -.core-sprite-openarrow, -.core-sprite-closedarrow, -.core-sprite-delete, -.core-sprite-refresh, -.core-sprite-expandAll, -.core-sprite-collapseAll, -.core-sprite-folder, -.core-sprite-file, -.core-sprite-close, -.core-sprite-edit, -.core-sprite-leftarrow, -.core-sprite-rightarrow, -.file-sprite-css, -.file-sprite-html, -.file-sprite-javascript, -.file-sprite-xml, -.file-sprite-text, -.file-sprite-image, -.core-sprite-shell, -.core-sprite-warning, -.core-sprite-error, -.core-sprite-deploy, -.core-sprite-repository, -.core-sprite-sites, -.core-sprite-shell, -.core-sprite-search, -.core-sprite-git-logo, -.core-sprite-delta, -.core-sprite-blank-menu-item, -.core-sprite-printer, -.core-sprite-split-pane-orientation, -.core-sprite-trashcan, -.core-sprite-whitespace, -.core-sprite-compare-view, -.core-sprite-compare-inline, -.core-sprite-filter, -.core-sprite-show-filtered, -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip, -.core-sprite-dashboard, -.core-sprite-runlogs, -.core-sprite-play, -.core-sprite-stop, -.core-sprite-open, -.core-sprite-debug, -.core-sprite-restart, -.core-sprite-download, -.core-sprite-collected-errors, -.core-sprite-listed-errors, -.core-sprite-checkmark, -.core-sprite-save, -.core-sprite-questionmark, -.core-sprite-eraser -{ - color: inherit; - font-size: 16px; - line-height: normal; - vertical-align: middle; - font-family: 'Orion Icon Font'; - padding: 0; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.core-sprite-questionmark { - padding-bottom: 3px; -} -.core-sprite-hamburger { - margin-top: -3px; -} -.core-sprite-silhouette { - line-height: 14px; - padding: 3px; -} -.core-sprite-wrench { - font-size: 14px; - line-height:16px; - padding: 2px; -} -.core-sprite-folder { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-file { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-close { - line-height: 14px; - padding-right: 5px; - margin-top: -3px; -} -.core-sprite-leftarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.core-sprite-rightarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.file-sprite-css { - padding-right: 5px; -} -.file-sprite-html { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-javascript { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-xml { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-text { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-image { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-warning { - line-height: 14px; - padding-right: 5px; -} -.core-sprite-error { - color: #b94a48; - line-height: 14px; - padding-right: 5px; -} -.core-sprite-git-logo { - font-size: 20px; -} -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip{ - padding: 2px; - padding-top: 0; -} -.core-sprite-hamburger:before{ content:'\E000'; } -.core-sprite-gear:before{ content:'\E001'; } -.core-sprite-silhouette:before{ content:'\E003'; float: right;} -.core-sprite-wrench:before{ content:'\E004'; } -.core-sprite-addcontent:before{ content:'\E004'; } -.core-sprite-go-up:before{ content:'\E009'; } -.core-sprite-outline:before{ content:'\E026'; } -.core-sprite-openarrow:before{ content:'\E028'; } -.core-sprite-closedarrow:before{ content:'\E027'; } -.core-sprite-delete:before{ content:'\E02A'; } -.core-sprite-refresh:before{ content:'\E025'; } -.core-sprite-expandAll:before{ content:'\E011'; } -.core-sprite-collapseAll:before{ content:'\E012'; } -.core-sprite-folder:before{ content:'\E010'; } -.core-sprite-file:before{ content:'\E00A'; } -.core-sprite-edit:before{ content:'\E008'; } -.core-sprite-move-down:before{ content:'\E014'; } -.core-sprite-move-up:before{ content:'\E013'; } -.core-sprite-close:before{ content:'\E02A'; } -.core-sprite-leftarrow:before{content:'\E015';} -.core-sprite-rightarrow:before{content:'\E016';} -.core-sprite-deploy:before{content:'\E032';} -.core-sprite-warning:before{content:'\E033';} -.core-sprite-error:before{content:'\E034';} -.core-sprite-repository:before{ content:'\E020'; } -.core-sprite-sites:before{ content:'\E03A'; } -.core-sprite-shell:before{ content:'\E02E'; } -.core-sprite-search:before{ content:'\E037'; } -.core-sprite-git-logo:before{ content:'\E03B'; } -.core-sprite-delta:before{ content:'\E03C'; } -.core-sprite-blank-menu-item:before{ content:'\0079'; } -.core-sprite-printer:before{ content:'\E040'; } -.core-sprite-split-pane-orientation:before{ content:'\E041'; } -.core-sprite-split-pane-orientation:after{ content:'\E042'; } -.core-sprite-trashcan:before{ content:'\E046'; } -.core-sprite-compare-view:before{ content:'\E04A'; } -.core-sprite-whitespace:before{ content:'\E04B'; } -.core-sprite-compare-inline:before{ content:'\E04C'; } -.core-sprite-filter:before{ content:'\E04D'; } -.core-sprite-show-filtered:before{ content:'\E04E'; } -.core-sprite-eraser:before{ content:'\E03D'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-save:before{ content:'\E052'; } -.core-sprite-listed-errors:before{ content:'\E053'; } -.core-sprite-collected-errors:before{ content:'\E054'; } -.core-sprite-download:before{ content:'\E036'; } -.core-sprite-debug:before{ content:'\E056'; } -.core-sprite-restart:before{ content:'\E025'; } -.core-sprite-play:before{ content:'\E057'; } -.core-sprite-stop:before{ content:'\E058'; } -.core-sprite-open:before{ content:'\E059'; } -.core-sprite-dashboard:before{ content:'\E062'; } -.core-sprite-runlogs:before{ content:'\E064'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-page:before{ content:'\E066'; } -.core-sprite-horizontal:before{ content:'\E042'; } -.core-sprite-vertical:before{ content:'\E041'; } -.core-sprite-pip:before{ content:'\E067'; } -.core-sprite-questionmark:before{ content:'\E043'; } - -.file-sprite-javascript:before{ content:'\E00D'; } -.file-sprite-css:before{ content:'\E00C'; } -.file-sprite-xml:before{ content:'\E00E'; } -.file-sprite-html:before{ content:'\E00F'; } -.file-sprite-text:before{ content:'\E00B'; } -.file-sprite-image:before{ content:'\E031'; } -.file-sprite-javascript:hover{ - text-decoration:none; -} -.textview { - background-color: white; - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - min-width: 50px; - min-height: 50px; -} -.textviewSelection { - background: rgb(180, 213, 255); -} -.textviewContent ::-moz-selection { - background: rgb(180, 213, 255); -} -.textviewContent ::selection { - background: rgb(180, 213, 255); -} -.textviewSelectionUnfocused { - background: lightgray; -} -.textviewSelectionCaret { - background: black; -} -.textviewScroll { - padding: 4px 2px 4px 2px; -} -.textviewContent { - cursor: auto; -} -.textviewLeftRuler { - border-right: 1px solid #eaeaea; -} -.textviewRightRuler { - border-left: 1px solid #eaeaea; -} -.textviewInnerRightRuler { - border-left: 1px solid #eaeaea; - background-color: white; -} -.textviewMarginRuler { - border-left: 1px solid #eaeaea; -} -.textviewBlockCursor { - background: black; - opacity: 0.4; -} -.ruler { -} -.ruler.annotations { - width: 16px; -} -.ruler.folding { - width: 14px; -} -.ruler.lines { - text-align: right; -} -.ruler.overview { - width: 14px; -} -.ruler.zoom { - width: 100px; - height: 100%; -} -.rulerLines { - color: #767676; -} -.rulerLines.even -.rulerLines.odd { -} -.rulerZoomWindow { - background-color: rgba(0, 0, 0, 0.1); - margin-left: 1px; - border: 1px solid #eee; - position: absolute; - width: calc(100% - 4px); - border-radius: 5px; - z-index: 100; -} -.textviewZoom { - font-size: 2px !important; - cursor: pointer; -} -.textviewZoom .textviewContent { - cursor: pointer; -} -.textviewZoom .textviewScroll { - padding: 0; -} -.textviewZoom .punctuation.separator.tab { - background-image: none; -} -.textviewZoom .punctuation.separator.space { - background-image: none; -} -.textviewTooltip { - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - background-color: #325C80; - color: #FAFAFA; - padding: 8px; - - box-sizing: content-box; - border-radius: 3px; - z-index: 101; - position: fixed; - overflow: hidden; -} -.tooltipTheme .textviewScroll { - padding: 0; -} -.tooltipTheme .annotationLine.currentLine { - background-color: transparent !important; -} -.textviewTooltipCodeProjection { - border: 1px solid black !important; - - padding: 0 !important; -} -.textviewTooltip a { - color: #7CC7FF; -} -.textviewTooltip h3 { - -webkit-margin-before: 0; - margin-top: 0; -} -.textviewTooltip p:first-of-type { - -webkit-margin-before: 0; - margin-top: 0; - -webkit-margin-after: 0; - margin-bottom: 0; -} -.textviewTooltip p { - word-wrap: break-word; -} -.textviewTooltip multi_anno { - font-style: normal; - font-weight: bold; -} -.textviewTooltip span { - vertical-align: baseline; -} -.textviewTooltip .tooltipRow { - display: table-row; -} -.textviewTooltip .tooltipImage { - display: inline-block; - vertical-align: middle; - padding: 1px; -} -.textviewTooltip .tooltipTitle { - padding-left: 3px; - vertical-align: middle; -} -.textviewTooltip .hoverTooltipTitle { - font-weight: normal; -} -.textviewTooltip .quickFixList { - margin-top: 5px; -} -.textviewTooltip .commandButton { - border: 1px solid #325C80; - background-color: inherit; - color: white; -} -.textviewTooltip .commandButton:not(.dropdownTrigger){ - text-transform: initial; -} -.textviewTooltip .commandList > li { - margin: 0; -} -.textviewTooltip .quickfixAllParameter { - margin-bottom: 4px; - vertical-align: middle; - font-weight: normal; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; -} -.textViewTooltipOnFocus { - resize: both; - overflow: auto; -} -.textViewTooltipOnHover { - overflow: auto; -} - -.textViewFind { - background-color: #ddd; - position: absolute; - border: 1px solid #aaa; - border-top: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - padding: 2px; - z-index: 100; - display: none; -} -.textViewFind.show { - top: 0; - right: 40px; - transition: top 0.3s ease-out; - -ms-transition: top 0.3s ease-out; - -moz-transition: top 0.3s ease-out; - -webkit-transition: top 0.3s ease-out; - -o-transition: top 0.3s ease-out; - display: inline-block; -} -.textViewFindButton { - margin-right: 1px; - margin-left: 0; -} -.textViewFindButton:first-child { - margin-left: 5px; -} -.textViewFindButton:last-child { - margin-right: 5px; -} -.textViewFindButton.checked { - color: blue; - text-decoration: underline; -} -.textViewReplaceInput { -} -.textViewFindInput { -} -.textViewFindCloseButton { - width: 16px; - height: 16px; - border-width: 0; - background-color: transparent; - vertical-align: baseline; - background-position: center; - background-repeat: no-repeat; - background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==); -} -.contentassist { - font-size:12px; - display: none; - background-color: white; - position: fixed; - top: 100px; - left: 100px; - z-index:100; - cursor: default; - min-width: 70px; - width: 350px; - height: 170px; - overflow-x: hidden; - overflow-y: auto; - white-space: nowrap; - border-radius: 5px; - box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px; - line-height: 18px; - resize: both; -} -.contentassist:focus { - outline: none; -} -.contentassist .proposal-emphasis { - font-weight: normal; -} -.contentassist hr{ - border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} -.contentassist .proposal-noemphasis-keyword { - background-color: aliceblue; - color: #CC4C07; - font-weight: bold; -} -.contentassist .proposal-noemphasis { - background-color: aliceblue; - font-weight: lighter; - color: black; -} -.contentassist .proposal-noemphasis-title-keywords { - background-color: aliceblue; - color: #717171; -} -.contentassist .proposal-noemphasis-title { - background-color: aliceblue; - color: #717171; - padding-top: 5px; -} -.contentassist .proposal-default { - -} -.contentassist .proposal-name { - font-weight: bold; -} -.contentassist .selected { - background-color: rgb(48, 135, 179); - background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160)); - border-radius: 3px; - color: white; -} -.contentassist .cloneProposal { - box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px; - position: fixed; - visibility: visible; - z-index: 1000; -} -.contentassist .proposalTag { - display: inline-block; - line-height: 11px; - height: 10px; - border-radius: 2px; - background: #325C80; - padding: 2px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist .iconTagGreen { - display: inline-block; - font-size: 10px; - font-weight: bold; - line-height: 13px; - height: 12px; - width: 12px; - border-radius: 50%; - background: green; - padding: 1px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist>div { - padding: 1px 3px 1px 5px; -} -.cloneWrapper { - display: block; - height: 0; - overflow: visible; - visibility: hidden; - width: 0; - z-index: 1000; -} -.contentassist.cloneWrapper:hover { - overflow: visible; -} -.comment { - color: #3C802C; -} -.constant { - color: blue; -} -.entity { - color: #3f7f7f; -} -.invalid { - color: red; - font-weight: bold; -} -.keyword { - color: #9F4177; - font-weight: bold; -} -.storage { - color: #7F0055; -} -.string { - color: #446fbd; -} -.support { - color: #21439c; -} -.variable { - color: #0000c0; -} -.punctuation.separator.space { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center center; -} -.punctuation.separator.tab { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: left center; -} -.comment-block-documentation { - color: #00008F; -} -.constant-character-entity { - font-style: normal; -} -.entity-name-function, .entity-name-type { - font-weight: bold; - color: #67BBB8; -} -.entity-name-tag { - color: #98937B; -} -.entity-other-attribute-name { - color: #3C802C; -} -.invalid-illegal { - color: white; - background-color: red; -} -.invalid-deprecated { - text-decoration: line-through; -} -.keyword-operator { - color: #CC4C07; - font-weight: bold; -} -.meta.annotation.currentLine { - background-color: #EAF2FE; -} -.meta.tag { - color: #3f7f7f; -} -.punctuation-definition-comment { - color: #3f5fbf; -} -.punctuation-definition-string { - color: blue; -} -.variable-parameter { - color: #D1416F; -} -.variable-language { - color: #7F0055; - font-weight: bold; -} -.cm-meta { color: #00008F; } -.cm-keyword { font-weight: bold; color: #7F0055; } -.cm-atom { color: #21439c; } -.cm-number { color: black; } -.cm-def { color: green; } -.cm-variable { color: black; } -.cm-variable-2 { color: #004080; } -.cm-variable-3 { color: #004080; } -.cm-property { color: black; } -.cm-operator { color: #222; } -.cm-comment { color: green; } -.cm-string { color: blue; } -.cm-error { color: #ff0000; } -.cm-qualifier { color: gray; } -.cm-builtin { color: #7F0055; } -.cm-bracket { color: white; background-color: gray; } -.cm-tag { color: #3f7f7f; } -.cm-attribute { color: #7f007f; } - -.annotation { -} -.annotation.error, -.annotation.warning, -.annotation.task, -.annotation.bookmark, -.annotation.breakpoint, -.annotation.collapsed, -.annotation.expanded, -.annotation.currentBracket, -.annotation.matchingBracket, -.annotation.currentLine, -.annotation.matchingSearch, -.annotation.currentSearch, -.annotation.readOccurrence, -.annotation.writeOccurrence, -.annotation.linkedGroup, -.annotation.currentLinkedGroup, -.annotation.selectedLinkedGroup { -} -.annotation.blame { - color: gray; - background-color: rgb(255, 132, 44); -} -.annotation.currentBlame { - color: black; - background-color: rgb(184, 103, 163); -} -.annotation.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - color: #CCCCCC; -} -.lines .annotation.diffAdded { - background-image: none; - background-color: rgba(159, 202, 86, 0.68); - color: #555555; -} -.lines .annotation.diffModified { - background-image: none; - background-color: rgba(85, 181, 219, 0.67); - color: #555555; -} -.annotationHTML { - cursor: pointer; - width: 16px; - height: 16px; - display: inline-block; - vertical-align: middle; - background-position: center; - background-repeat: no-repeat; -} -.annotationHTML.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII="); -} -.annotationHTML.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg=="); -} -.annotationHTML.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg=="); -} -.annotationHTML.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII="); -} -.annotationHTML.breakpoint { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs="); -} -.annotationHTML.collapsed { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII="); -} -.annotationHTML.expanded { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg=="); -} -.annotationHTML.multiple { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7"); -} -.annotationHTML.overlay { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII="); - background-position: right bottom; - position: relative; - top: -16px; -} -.annotationHTML.currentBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.matchingBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.currentLine { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs="); -} -.annotationHTML.matchingSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.currentSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.readOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.writeOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.blame { - float: left; -} -.annotationHTML.currentBlame { - float: left; -} -.annotationHTML.blame.single { - width: 32px; - height: 32px; -} -.annotationHTML.currentBlame.single { - width: 32px; - height: 32px; -} -.annotationHTML.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - background-position: left top; -} -.annotationHTML.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - background-position: left top; -} -.annotationHTML.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - background-position: left top; -} -.annotationOverview { - cursor: pointer; - border-radius: 2px; - left: 2px; - width: 8px; -} -.annotationOverview.task { - background-color: #93bb7a; - border: 1px solid #79aa59; -} -.annotationOverview.breakpoint { - background-color: lightblue; - border: 1px solid blue; -} -.annotationOverview.bookmark { - background-color: #84b3cf; - border: 1px solid #9cc2d8; -} -.annotationOverview.error { - background-color: #EFA1A7; - border: 1px solid #ec8a91; -} -.annotationOverview.warning { - background-color: #fce1a9; - border: 1px solid #face70; -} -.annotationOverview.currentBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.matchingBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.currentLine { - background-color: #EAF2FE; - border: 1px solid black; -} -.annotationOverview.matchingSearch { - background-color: #C3E1FF; - border: 1px solid #afcae5; -} -.annotationOverview.currentSearch { - background-color: #53D1FF; - border: 1px solid #42a7cc; -} -.annotationOverview.readOccurrence { - background-color: lightgray; - border: 1px solid black; -} -.annotationOverview.writeOccurrence { - background-color: Gold; - border: 1px solid darkred; -} -.annotationOverview.currentBlame { - background-color: rgb(184, 103, 163); - border: 1px solid black; -} -.annotationOverview.diffAdded { - background-color: rgba(159, 202, 86, 0.52); - border: 1px solid black; -} -.annotationOverview.diffDeleted { -} -.annotationOverview.diffModified { - background-color: rgba(85, 181, 219, 0.61); - border: 1px solid black; -} -.annotationRange { - background-repeat: repeat-x; - background-position: left bottom; -} -.annotationRange.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg=="); -} -.annotationRange.breakpoint { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg=="); -} -.annotationRange.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); -} -.annotationRange.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.currentBracket { - background-color: #00FE00; -} -.annotationRange.matchingBracket { - background-color: #00FE00; -} -.annotationRange.readOccurrence { - background-color: lightgray; -} -.annotationRange.writeOccurrence { - background-color: yellow; -} -.annotationRange.matchingSearch { - background-color: #C3E1FF; -} -.annotationRange.currentSearch { - background-color: #53D1FF; -} -.annotationRange.linkedGroup { - outline: 1px solid grey; -} -.annotationRange.currentLinkedGroup { - background-color: #C3E1FF; -} -.annotationRange.selectedLinkedGroup { - background-color: #53D1FF; -} -.annotationLine { -} -.annotationLine.currentLine { - background-color: #EAF2FE; -} -.diffNormal { - background: #DDDDDD; -} -.diffConflict { - background: #EEB4B4; -} -.diffNormalSelect { - background: #BBBBBB; -} -.diffConflictSelect { - background: #F08080; -} -.diffInlineAddedSelect { - background: #00B400; -} -.diffInlineAdded { - background: #99EE99; -} -.diffInlineRemovedSelect { - background: #B44040; -} -.diffInlineRemoved { - background: #EE9999; -} -.compareCanvas { - background: white; - border: 0; -} -.inlineRulerLeft { - border-right: 1px solid #EAEAEA; -} -.compareEditorParent { - clear: both; - overflow: hidden; - position: absolute; - top: 30px; - bottom: 0; - left: 0; - width: 100%; - margin-bottom: 30px; -} -.compareEditorParentImageMode { - overflow: auto !important; -} -.compareEditorParentWithCanvas { - clear: both; - overflow: hidden; - position: absolute; - left: 44px; - right: 0; - height:100%; - border-left: 1px solid #eaeaea; -} -.canvasContainer { - position: absolute; - width:44px; - height:100%; - overflow: hidden; -} -.compareActionContainer { - float: left; - padding-top: 3px; - padding-bottom: 3px; - overflow: hidden; -} -.titleActionContainer { - width:100%; - height:30px; - overflow: hidden; - color: gray; - white-space: nowrap; -} -.titleContainer { - padding-left: 5px; - padding-top: 8px; - overflow: hidden; -} -.statusContainer { - position: absolute; - bottom:0; - width:100%; - height:30px; - overflow: hidden; - text-align: center; - color: gray; -} -.leftPanelLayout { - display: block; - position: absolute; - left: 0; - overflow: hidden; - width: 50%; - height: 100%; -} -.rightPanelLayout { - display: block; - position: absolute; - right: 0; - overflow: hidden; - height: 100%; -} -.compareSplitLayout { - position: absolute; - left: 50%; - height: 100%; - z-index: 50; - width: 4px; - cursor: e-resize; - - visibility: hidden; -} -.annotationLine.addedBlockDiff { - background-color: #E5FFCF; -} -.annotationLine.currentAddedBlockDiff { - background-color: #CFFFCF; -} -.annotationLine.deletedBlockDiff { - background-color: #FAE6E6; -} -.annotationLine.currentDeletedBlockDiff { - background-color: #FCD6D6; -} -.annotationLine.blockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVBhXY6yvr2cYHAAAzPsBf2hZ98wAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.currentBlockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY2AYNAAAAIsAAR6L5FUAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.blockDiffConflict { - background-color: #FFFFCA; -} -.annotationLine.currentBlockDiffConflict { - background-color: #FFFF5B; -} -.annotationRange.addedWordDiff { - background-color: #B8E8B8; -} -.annotationRange.currentAddedWordDiff { - background-color: #93FF93; -} -.annotationRange.deletedWordDiff { - background-color: #F9BDBD; -} -.annotationRange.currentDeletedWordDiff { - background-color: #FF8B8B; -} -.annotationRange.emptyDeletedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyDeletedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.annotationRange.emptyAddedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyAddedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.compare-sprite-inline-2way{ - font-size: 16px; - line-height: normal; - vertical-align:middle; - color: inherit; - font-family: 'Orion Icon Font'; - padding-right:5px; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.compare-sprite-inline-2way:before{ content: '\E04C'; } -.compare-sprite-inline-2way:after{ content: '\E04A'; } -.orionPage { - background-color: #26343F; - width: 100%; - height: 100%; -} -.topRowBanner { - margin: 0; - border: 0; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - border-top-width: 0px; - border-right-width: 0px; - border-left-width: 0px; - border-bottom-style: none; - background-color: white; - height: 16px; - padding: 8px 2px 7px 6px !important; - box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px; - z-index: 100; - display: none; -} -a { - text-decoration: none; - color: #00AED1; -} -a:hover { - cursor: pointer; - text-decoration: underline; -} -.primaryNav { - font-size: 8pt; - font-weight: normal; - color: #BFBFBF; - vertical-align: baseline; -} -.primaryNav > div { - padding-top: 6px; -} -.primaryNav > nav { - padding-top: 6px; -} -.primaryNav > nav > a { - color: #BFBFBF; - margin-right: 6px; - margin-left: 6px; - text-decoration: none; -} -.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover { - cursor: pointer; - color: white; -} -.titleArea { - margin: 0; - padding-top: 3px; - border: 0; - background: #EFEFEF; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF)); - border-bottom: 1px solid #DEDEDE; - min-height: 20px; -} -.checkedRow { - color: white !important; - background-color: #1bb199 !important; -} -.checkedRow.disabledRow { - background-color: #dadada !important; -} -.checkedRow > td > span -{ - color:white !important; -} -.checkedRow > td > span > a -{ - color:white !important; -} -.checkedRow > td > span > span -{ - color:white !important; -} -.checkedRow > td > span > a > span -{ - color:white !important; -} -.checkedRow > td > a > span > span -{ - color:white !important; -} -.checkedRow .secondaryColumn { - color: white; -} -.checkedRow .navColumnNoIcon { - color: white; -} -.checkedRow .secondaryColumn > a:hover { - color: white !important; - font-weight:bold; - text-decoration: none; -} -.checkedRow .sectionTableItem { - color: white !important; -} -.checkedRow a { - color: white; -} -.checkedRow .jazz-description { - color: white; -} -.checkedRow .commandButton { - color: white; - border-color: white; -} -.checkedRow .commandImage { - color: white; -} -.navRow > td:first-child { - -} -.navRow.checkedRow > td:first-child { - border-left-color: #d57152; -} -.navbar-item-selected { - color: #FFFFFF !important; - font-weight: bold; - position: relative; - background: #1bb199 !important; -} -.breadcrumbContainer { - align-items: baseline; - display: inline-flex; - justify-content: center; - - -webkit-align-items: baseline; - display: -webkit-inline-flex; - -webkit-justify-content: center; - - margin-right: 0; - overflow: hidden; - visibility: visible; - width: 100%; -} -.breadcrumb { - color: #E6E6E6; - -webkit-flex-grow: 0; - flex-grow: 0; - font: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - overflow: hidden; - text-decoration: none; - text-overflow: ellipsis; -} -a.breadcrumb:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; - cursor: pointer; -} -.breadcrumbSeparator { - color: #E6E6E6; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - font-weight: bold; - -webkit-flex-shrink: 0; - flex-shrink: 0; - margin: 2px; - text-decoration: none; -} -.currentLocation { - padding-top:1px; - font-weight: bold; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - color: #E6E6E6; - text-decoration: none; - line-height: 10pt; - white-space:nowrap; -} -div.currentLocation { - width: 100%; -} -.breadcrumbContainer > .currentLocation { - margin: 0; -} -a.currentLocation:hover { - font-weight: bold; - color: #00AED1; - text-decoration: none; - border-bottom: 1px dotted; -} -a.breadcrumb.currentLocation { - font-weight: bold; - margin: 0; -} -.tooltipContainer .currentLocation { - color: white; -} -.tooltipContainer .breadcrumb { - color: white; -} -.tooltipContainer .breadcrumbSeparator { - color: white; -} -.tooltipContainer a.currentLocation:hover { - color: white; -} -.tooltipContainer a.breadcrumb:hover { - color: white; -} -.auxpane { - border: 0; - background: #3B4B54; - color: white; -} -.mainpane { - border: 0; - background: #3B4B54 !important; - padding-right:5px; -} -.mainToolbar { - color: white; - background: #26343f; - padding-left: 2px; - padding-right: 5px; - white-space: nowrap; -} -.fsToolbar { - padding: 2px 4px 2px 4px; - background-color: #DFE6EB; - - -} -.filesystemName { - display: inline-block; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; - margin-bottom: 8px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - max-width: calc(100% - 6px - 4px - 24px); - max-width: -webkit-calc(100% - 6px - 4px - 24px); - -moz-user-select: -moz-none; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; - color: white; -} -.filesystemSwitcher { - display: inline-block; - margin: 0; -} -.filesystemSwitcherWrapper { - display: block; - max-width: 100%; - white-space: nowrap; -} -.sidebarToolbar { - display: inline; - overflow: visible; - padding: 0 !important; -} -.searchbox { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 4px -297px; - width: 12px; height: 12px; - background-color: #444; - border: 1px solid #222; - font-size: 11px; - width: 15em; - height: 16px; - border-radius: 10px; - color: #999; - padding: 0; - padding-left: 20px; - padding-right: 16px; - margin-left: 5px; - font-size: 7pt; -} -.searchbox:focus{ - color: white; - outline: none; -} - -.orionButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - display: inline-block; - padding: 4px 6px; - border-radius: 1px; - line-height: 12px; - font-size: 9pt; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - margin: 0; -} -.commandButton.orionButton.dropdownTrigger { - -} -.commandButton.orionButton.dropdownTrigger:hover { - border-color: #ccc; -} -.mainToolbar .commandButton.orionButton.dropdownTrigger { - color:white; -} -.commandButton { - color: #00AED1; - border: 1px solid #00AED1; - background-color: rgba(0, 0, 0, 0); - - vertical-align: middle; - -webkit-transition: color 0.2s ease; - transition: color 0.2s ease; -} -.commandButton:not(.dropdownTrigger) { - -} -.extraActions .commandButton { - text-transform: uppercase; -} -.commandButton.dropdownDefaultButton { - -} -.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus { - color: white; - background-color: #a5b5bc; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); -} -.commandButton.disabled { - color: #cdcdcd; -} -.primaryButton{ - background: #1bb199; - border-color: #1bb199; - color: white; -} -.primaryButton:hover, .primaryButton:focus { - background: #01CDB0; - border-color: #01CDB0; -} -.commandImage { - border: 1px solid transparent; - border-radius: 1px; - color: inherit; - background-color: transparent; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - padding: 2px; - padding-top: 0; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandImage:hover, .commandImage:focus { - background-color: #a5b5bc; - border: 1px solid #ccc; -} -.mainToolbar .commandImage.dropdownTrigger { - color: white; -} -.orionToggleOff { - color: inherit; - border-radius: 3px; - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn { - color: inherit; - background-color: whitesmoke; - border-radius: 3px; - box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3); - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn:hover { - background: white; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleOff:hover { - background: whitesmoke; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleAnimate { - -webkit-animation-name: pulse; - animation-name: pulse; -} -@-webkit-keyframes pulse { - 0% { -webkit-transform: scale(1); } - 50% { -webkit-transform: scale(1.3); } - 100% { -webkit-transform: scale(1); } -} -@keyframes pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.3); } - 100% { transform: scale(1); } -} -.orionSwitch { - position: relative; - width: auto; -} -.orionSwitchCheck { - display: none; -} -.orionSwitchLabel { - display: block; - overflow: hidden; - cursor: pointer; - border: 1px solid #DFE6EB; - border-radius: 3px; - height: 20px; -} -.orionSwitchInner { - display: block; - width: 200%; - margin-left: -100%; - margin-top:-1px; - text-align: left; - -moz-transition: margin 0.2s ease-in 0s; - -webkit-transition: margin 0.2s ease-in 0s; - -o-transition: margin 0.2s ease-in 0s; - transition: margin 0.2s ease-in 0s; -} -.orionSwitchInner:before, .orionSwitchInner:after { - display: block; - float: left; - width: 50%; - padding: 0; - padding-bottom: 2px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.orionSwitchInner:before { - padding-left: 3px; - padding-right: 2px; - background-color: #FFF; - color: #808080; -} -.orionSwitchInner:after { - padding-right: 3px; - background-color: #eee; - color: #808080; - text-align: right; -} -.orionSwitchSwitch { - display: block; - width: calc(50% - 2px); - margin: 0; - background: #DFE6EB; - border: 1px solid #DFE6EB; - border-radius: 3px; - position: absolute; - top: 0; - bottom: 0; - right: calc(50% + 2px); - -moz-transition: all 0.2s ease-in 0s; - -webkit-transition: all 0.2s ease-in 0s; - -o-transition: all 0.2s ease-in 0s; - transition: all 0.2s ease-in 0s; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner { - margin-left: 0; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch { - right: 0px; -} -.commandMissingImageButton { - font-weight: normal; -} -.commandLink { - display: inline-block; - vertical-align: middle; - padding: 4px 0 1px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandSeparator { - padding: 2px; -} -.commandActive { - background-color: #e6e6e6 !important; - border: 1px solid #808080 !important; - border-radius: 2px !important; -} -.commandActiveItem { -} -.commandInactiveItem { -} -.split { - background: #3B4B54; -} -.splitTracking { - background: #3B4B54; -} -.splitThumb { - background: #3B4B54; -} -.dropdown { -} -.dropdownArrowDown { - display: inline-block; - vertical-align: top; - line-height: 12px; - text-transform: lowercase; -} -.dropdownArrowRight { - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 12px; -} -.dropdownTrigger:not(.dropdownDefaultButton) { - font-weight: normal; - color: #FFFFFF; - border-color: transparent; -} -.dropdownTrigger a { - text-decoration: none; -} -.dropdownMenu { - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2); - color: #3b4b54; - background-color: white; - border-collapse: separate; - border: 1px solid #bbbbbb; - border-radius: 1px; - visibility: hidden; - z-index: 150; - position: absolute; - list-style-type: none; - display: none; - line-height: normal; - margin: 0; - cursor: default; - font-size: 12px; - margin: 0; - outline: none; - padding: 3px 0 3px; -} -.dropdownMenuOpen { - min-width: 120px; - display: block; - visibility: visible; -} -.dropdownSubMenu { - position: relative; - line-height: normal; -} -.dropdownSubMenu > ul { - top: 0; - left: 100%; -} -.dropdownMenu > li { - min-width: 120px; - display: flex; - display: -webkit-flex; -} -.dropdownMenu > li > a, .dropdownMenu > li > span { - width: calc( 100% - 9px ); - margin: 0; -} -.dropdownMenu > li > *:focus { - outline: none; -} -.dropdownSeparator { - height: 1px; - background-color: #ddd; - color: #ddd; - padding: 0 !important; - margin: 0; -} -.dropdownMenuItem, .dropdownMenuItem a { - align-items: center; - -webkit-align-items: center; - align-content: stretch; - -webkit-align-content: stretch; - display: inline-flex; - display: -webkit-inline-flex; - vertical-align: middle; - color: #3b4b54 !important; - padding: 3px 3px 3px 5px; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - border-left: 4px solid transparent; -} -.dropdownMenu .dropdownMenuItemSelected { - background-color: rgba(27,177,153, 0.1); - border-left-color: #1BB199; -} -.dropdownMenuItem .check { - display: inline-block; - width: 12px; -} -.dropdownMenuItem .dropdownKeyBinding { - color: grey !important; - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 11px; - padding-left: 15px; - padding-right: 10px; -} -.dropdownMenuItem .dropdownCommandName { - -webkit-align-items: center; - align-items: center; - display: inline-flex; - display: -webkit-inline-flex; - - flex-grow: 1; - -webkit-flex-grow: 1; - text-decoration: inherit; -} -.dropdownSelection { - background-color: white !important; - color: #3b4b54 !important; - border: 1px solid #bbbbbb !important; - border-bottom: none !important; - border-bottom-left-radius: 0 !important; - border-bottom-right-radius: 0 !important; - box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important; - margin-bottom: -1px !important; - position: relative !important; - z-index: 200 !important; -} -.checkedMenuItem { - margin: 4px 6px 2px 0; - vertical-align: bottom; -} -.tooltipContainer { - display: none; - z-index: 200; - background: transparent; - position: absolute; - max-width: 110em; -} -.tooltip .textContent { - max-width: 40em; -} -.tooltip { - color: white; - background-color: #158d7a; - border-radius: 3px; - padding: 8px; - clear: both; - float: left; - border: 1px solid #158d7a; - box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5); -} -.tooltip.left { -} -.tooltip .navlinkonpage { - color: #00aed1 !important; -} -.tooltip h2 { - color: #3b4b54; -} -.tooltip .operationStatus { - color: #00aed1; -} -.tooltip .operationError { - color: #a6b5bc; -} -.tooltipTailFromleft { - position: absolute; - display: inline-block; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromleft:after, .tooltipTailFromleft:before { - left: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromleft:after { - border-color: transparent; - border-left-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromleft:before { - border-color: transparent; - border-left-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromleft { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent transparent transparent #158d7a; - top: 2px; - right: -17px; - content: ''; -} -.tooltipTailFromright { - position: absolute; - display: inline-block; - left: 0; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromright:after, .tooltipTailFromright:before { - right: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromright:after { - border-color: transparent; - border-right-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromright:before { - border-color: transparent; - border-right-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromright { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent #158d7a transparent transparent; - left: -17px; - top: 2px; - content: ''; -} -.tooltipTailFrombelow { - position: absolute; - display: block; - left: 16px; - top: 0; - content: ''; - z-index: 201; -} -.tooltipTailFrombelow:after, .tooltipTailFrombelow:before { - bottom: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFrombelow:after { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFrombelow:before { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFrombelow { - position: absolute; - display: block; - border: 10px solid; - border-color: transparent transparent #158d7a transparent; - left: 14px; - top: -17px; - content: ''; -} -.tooltipTailFromabove { - position: absolute; - display: block; - left: 16px; - content: ''; - bottom: 0; - z-index: 201; -} -.tooltipTailFromabove:after, .tooltipTailFromabove:before { - top: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromabove:after { - border-color: transparent; - border-top-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFromabove:before { - border-color: transparent; - border-top-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFromabove { - position: absolute; - display: block; - border: 10px solid; - border-color: #158d7a transparent transparent transparent; - left: 14px; - bottom: -17px; - content: ''; -} -.tooltipShowing { - display: block; -} -.tooltip > .parametersDismiss > .dismissButton { - color: whitesmoke; -} -.tooltip > .parametersDismiss > .dismissButton:hover { - color: white; -} -.dialog { - visibility: hidden; - z-index: 175; - position: absolute; - color: #222; - background-color: #fbfbfb; - border-radius: 2px; - border: 1px solid #BBB; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - padding-bottom:5px; -} -.dialogShowing { - visibility: visible; -} -.dialogTitle { - display: block; -} -.dialogTitle { - padding-top: 5px; - display: inline-block; - background: #555; - width: 100%; - padding-bottom: 5px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; -} -.dialogTitle > .dismissButton { - margin-right: 0; -} -.dialogTitleText { - margin: 2px 2px 0; - color: whitesmoke; - font-size: 1em; - height: 18px; - padding-left: 4px; - font-weight: bold; -} -.dialogDismiss { - display: block; - cursor: pointer; - padding: 2px; -} -.dialogContent { - padding: 8px; -} -.parameterPopup .dismissButton, .dialogTitle .dismissButton { - color: rgb(221, 221, 221); - cursor: pointer; -} -.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover { - color: white; -} -.dialogButtons { - -webkit-align-items: center; - align-items: center; - - display: -webkit-flex; - display: flex; - - -webkit-justify-content: center; - justify-content: center; - margin: 2px 4px 4px 4px; -} -.dialogButtons > button.commandButton { - min-width: 60px; -} -.confirmDialog { - min-width: 300px; - max-width: 450px; -} -.confirmDialog .checkboxWrapper { - margin: 10px 2px 5px 2px; -} -.checkboxMessage > .confirmDialogCheckbox { - margin: 0 5px 0 0; - outline: none; - vertical-align: top; -} -.modalBackdrop { - opacity: 0.5; - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; -} -.textviewTooltip { - background-color: #158d7a; -} -.textviewTooltip .commandButton { - border-color: white; - color: white; - margin-bottom: 2px; -} -.core-sprite-git-logo { - font-size: 20px !important; -} -.outlineExplorer .navlinkonpage { - color: #333 !important; -} -.outlineExplorer .treeIterationCursorRow_Dotted { - background-color: #1BB199; -} -.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite { - color: white; -} -.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage { - color: white !important; -} -.contentassist .selected { - background-color: #1BB199 !important; - background: #1BB199 !important; - border-radius: 0; - color: #FFF; -} -.titleActionContainer, -.statusContainer, -.workingTarget { - color: white; - background: #3B4B54; -} - -@font-face { - font-family: 'Orion Icon Font'; - src: url('OrionIconFont-Regular.eot'); - src: url('OrionIconFont-Regular.eot?#iefix') format('embedded-opentype'), - url('OrionIconFont-Regular.woff') format('woff'), - url('OrionIconFont-Regular.ttf') format('truetype'), - url('OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f') format('svg'); - - font-style: normal; - font-weight: 400; -} diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-codenvy.css b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-codenvy.css deleted file mode 100644 index d9099959bff..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-codenvy.css +++ /dev/null @@ -1,4589 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -.headerLayout { - height: 50px; -} -.toolbarLayout { - height: 50px; - - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex-direction: row; - -ms-flex-direction: row; - -webkit-flex-direction: row; - -webkit-align-items: center; - align-items: center; -} -.fsToolbarLayout { - height: 30px; -} -.bannerLeftArea{ - - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 1; - -webkit-order: 1; - -ms-flex-order: 1; - order: 1; - -moz-box-flex: 1; - -webkit-box-flex:1; - -webkit-box-ordinal-group: 1; - - width: 20%; - - padding-left:5px; -} -.bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 60%; -} -@media only screen and (device-width: 768px) { - - - .bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 59%; -} - -} -.bannerRightArea{ - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 3; - -webkit-order: 3; - -ms-flex-order: 3; - order: 3; - -moz-box-flex: 1; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 3; - width: 20%; - padding-right:5px; -} -.content-fixedHeight { - clear: both; - overflow: hidden; - position: absolute; - top: 0; - - bottom: 0; - left: 50px; - right: 0; - background: #3b4b54; - -} -.content-fixedHeight-animation { - transition: left 0.3s ease; -} -.content-fixedHeight-maximized { - top: 0; - bottom: 0; -} -.content-sideMenu-closed { - left: 0; -} -.content-fluid { -} -.footer-fixed-bottom { - position: fixed; - bottom: 0; - z-index: 50; - right: 0; - left: 0; - - height: 0; - background:#ededed; -} -.layoutBlock { - clear: both; - margin: 0; - - padding: 4px 4px 0 4px; - vertical-align: baseline; -} -.layoutLeft { - float: left; - margin: 0; -} -.layoutRight { - float: right; - margin: 0; -} -.layoutFlexStretch { - flex: 1 1; - -ms-flex: 1 1; - -webkit-flex: 1 1; -} -.spacingLeft { - margin-left: 5px; -} -.spacingRight { - margin-right: 5px; -} -.clear { - clear: both; -} -.hidden { - visibility: hidden; -} -.sidePanelLayout { - display: block; - position: absolute; - left: 0; - width: 33%; - height: 100%; -} -.generalAnimation { - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: all 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelLayoutAnimation { - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -o-transition: width 0.5s ease; - transition: width 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelVerticalLayout { - display: block; - position: absolute; - top: 0; - height: 33%; - width: 100%; -} -.sidePanelVerticalLayoutAnimation { - -webkit-transition: height 0.5s ease; - -moz-transition: height 0.5s ease; - -o-transition: height 0.5s ease; - transition: height 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelMargins { - margin-left: 8px; - margin-top: 2px; - margin-bottom: 8px; - width: auto; -} -.mainPanelLayout { - display: block; - position: absolute; - right: 0; - height: 100%; -} -.mainPanelLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.mainPanelVerticalLayout { - display: block; - position: absolute; - bottom: 0; - width: 100%; -} -.mainPanelVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.fixedToolbarHolder { - position: relative; - left: 0; - top: 0; - height: 100%; - width: 100%; - min-width:140px; - background:#3b4b54; -} -.sidebarWrapper { - overflow-x: auto; - overflow-y: hidden; - min-width: 0; -} -.sidebarWrapper > .sidebar { - position: relative; - left: 0; - top: 0; - height: calc(100% - 29px); - overflow-x: visible; -} -.projectNavSidebarWrapper > .sidebar { - height: calc(100% - 0px); -} -.workingTarget { - position: absolute; - top: 0; - width: 100%; - bottom: 0; - overflow-y: auto; - background:white; -} -.toolbarTarget { - position: absolute; - top: 50px; - width: 100%; - overflow-y: auto; -} -.toolbarTarget-toolbarHidden { - top: 0; -} -.pageLayoutTarget { - position: absolute; - width: calc( 100% - 60px ); - bottom: 0; - overflow-y: auto; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33); - margin: 20px; - margin-right: 0; - padding-top: 10px; - padding-bottom: 5px; - background: white; -} -.hasSplit { - display: none; -} -.editorViewerFrame { - width: 100%; - height: 100%; -} -.editorViewerHeader { - display:flex; - background: #3B4B54; - color: white; - flex-direction:row; - align-items:center; - line-height:26px; - border-bottom: 1px solid #263238; -} -.editorViewerHeaderDirtyIndicator { - padding-left: 5px; -} -.editorViewerHeaderTitle { - padding-left: 5px; -} -.editorViewerContent { - position: absolute; - width: 100%; - top: 27px; - bottom: 0; - overflow: auto -} -.editorViewerPicInPic { - position: absolute; - border: 1px solid #ccc; - background-color: white; - z-index: 100; - bottom: 35px; - right: 35px; - width: 40%; - height: 40%; -} -.splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 51; - width: 3px; - cursor: e-resize; - visibility: hidden; -} -.splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 51; - height: 3px; - cursor: n-resize; - visibility: hidden; -} -@media only screen -and (min-device-width : 768px) -and (max-device-width : 1024px) { - - .splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 50; - width: 20px; - cursor: e-resize; - visibility: hidden; - } - - - .splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 50; - height: 20px; - cursor: n-resize; - visibility: hidden; - } - -} -.splitThumbLeftLayout { - position: absolute; - left: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-left: -1px; - cursor: pointer; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitThumbRightLayout { - position: absolute; - right: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-right: -1px; - cursor: pointer; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; -} -.splitVerticalThumbUpLayout { - position: absolute; - top: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - margin-top: -1px; - cursor: pointer; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitVerticalThumbDownLayout { - position: absolute; - bottom: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - cursor: pointer; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} -.splitLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.splitVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.panelTracking { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: auto; -} -.commandList { - padding: 0; - margin-left: 0; - margin-right: 0; - list-style-type: none; - vertical-align: baseline; -} -.commandList > li { - float: left; - margin-left: 4px; - margin-right: 4px; -} -.commandMargins { - margin-left: 4px !important; - margin-right: 4px !important; -} -.commandMargins:last-child { - margin-right: 0 !important; -} -.sideMenu{ - width: 50px; - background: #26343F; - float: left; - position: absolute; - top: 0; - - bottom: 0; - -webkit-animation: slide 0.5s forwards; - -webkit-animation-delay: 2s; - animation: slide 0.5s forwards; - animation-delay: 2s; - display:block; - margin:0; - font-family: sans-serif; - font-size:10px; - text-decoration:none !important; - user-select: none; - -webkit-user-select: none; - -moz-user-select: -moz-none; -} -.sideMenu.animating { - z-index: 0; -} -.sideMenu-maximized { - top: 0; - bottom: 0; -} -.sideMenu-closed { - width: 0; - display: none; -} -.sideMenuHome{ - width: 100%; - height: 50px; -} -.sideMenuList{ - display:inline-block !important; - height: calc(100% - 64px); - margin: 0; - overflow-y: hidden; - padding: 0; - text-align: center; - width: 100%; -} -.sideMenuItem{ - list-style-type: none; - font-size:16px !important; - padding: 0; - margin: 3px; -} -.sideMenuItem:hover, .sideMenuItem.expanded { - text-decoration:none; - color:#F47D64 !important; -} -.sideMenu:hover > .sideMenuScrollButton { - opacity: 1; -} -.sideMenuScrollButton { - background-color: rgba(0,0,0,0.5) !important; - color: white !important; - cursor: pointer; - display: none; - height: 19px; - opacity: 0.5; - position: absolute; - width: 100%; - z-index: 100; -} -.sideMenuScrollButton.visible { - display: block; -} -.sideMenuTopScrollButton { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); -} -.sideMenuBottomScrollButton { - bottom: 0; - left: 0; -} -.sideMenuItem > .submenu-trigger { - color: #6D8B93 !important; - font-size:16px; - text-decoration:none !important; - width: 100%; - display: inline-block; - padding: 9px 0px 12px 0px; -} -.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{ - text-decoration:none; - color:white !important; -} -.sideMenuItemActive { -} -.sideMenuItemActive > .submenu-trigger { - color: white !important; -} -.sideMenuToggle { - display: none; -} -.sideMenu-notification { - position: relative; -} -.sideMenu-notification[level=info] { - background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=warn] { - background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=error] { - background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenuSubMenu{ - display: none; - list-style-type:none; - position:absolute; - font-family:sans-serif; - padding-left: 0; - z-index:100; - text-align: left; - left: 40px; -} -.sideMenuSubMenuItem{ - display: inline-block; - width: 100%; - white-space: nowrap; - font-size: 12px; - background: white; - border-right:1px solid #ddd; -} -.sideMenuSubMenuItem:before { - width: 0; - height: 0; - top: 13px; - content: ""; - left: -8px; - position: absolute; - z-index: 200; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-right: 8px solid white; -} -.sideMenuSubMenuItem:first-child{ - border-top:1px solid #ddd; - border-top-right-radius: 4px; -} -.sideMenuSubMenuItem:last-child{ - border-bottom:1px solid #ddd; - border-bottom-right-radius: 4px; -} -.sideMenuSubMenuItem a { - display: inline-block; - color: #444; - padding: 12px 30px 12px 10px; - width: calc(100% - 30px - 10px + 8px); -} -.sideMenuSubMenuItem a:hover{ - text-decoration:none; - color: black !important; -} - -.sideMenuSubMenuItem:hover { - background-color: #fde7cf; -} -.sideMenuSubMenuItem:only-child:hover { - -} -.sideMenuSubMenuItem:only-child:hover a { - color: #333; -} -.sideMenuSubMenuItem a span { - display: inline-block; -} -.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded { - display:inline-block; -} -.sidebar-decorate-active { - position: relative; - background: - radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat, - #47575F; - background-position: - 30px 29px, - 0 0; - background-size: - 8px 8px; -} -.mainContent{ - position:absolute; - left:50px; -} -.innerPanels{ - position:absolute; - width:100%; - top:50px; - bottom:0; -} -.userMenu { -} -.splash { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgb(57,75,84); - z-index: 149; - display: block; - box-shadow: 0 3px 7pt 0 rgba(0,0,0,0.3) inset; -} -.splashSeeThroughX { - -webkit-animation-name: splashSeeThrough; - animation-name: splashSeeThrough; - animation-duration: 0.7s; - background-color: rgba(38,52,63, 0.7); -} -@-webkit-keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -@keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -.splashContainer { - display: flex; - display: -webkit-flex; - align-items: center; - -webkit-align-items: center; - justify-content: center; - -webkit-justify-content: center; - height:100%; - flex-direction: column; - -webkit-flex-direction: column; - font-family: sans-serif; - font-size: 14px; -} -.splashLoader { - display: flex; - display: -webkit-flex; - height:300px; - width:400px; - flex-direction: column; - -webkit-flex-direction: column; - align-items: center; - -webkit-align-items: center; - background-color: rgb(57,75,84); - padding: 20px; - padding-top: 60px; - padding-bottom: 0px; - border-radius: 4px; - Xbox-shadow: 5px 5px 5px 0 rgba(0,0,0,0.2); - Xborder-bottom: 1px solid rgb(59,222,255); -} -.splashAbout { - text-align: center; - color: #FFFFFF; - font-size:16px; - font-family: 'helvetica'; - font-weight: bold; - margin-bottom: 10px; -} -.splashSteps { - margin:20px; - max-width: 300px; -} -.splashStep { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - padding-top: 10px; - padding-bottom:10px; - height:24px; -} -.splashMessage { - color: white; - font-size: 12px; -} -.splashDetailedMessage { - color: white; - font-size: 12px; -} -.splashVisual { - width: 24px; -} -.splashVerbal { - margin-left:20px; - color: #3BDEFF; - font-family: 'helvetica'; - font-weight: bold; - margin-top: 3px; -} -.splashVerbalwaiting { - color:grey; -} -.splashLoadingImage { - background: url(../../images/loading_24.gif) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.splashSuccessImage { - background: url(../../images/message_success_24.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.progress { - text-align: right; - margin-right: 8px; -} -.progressIcon { - margin: 0 6px 0 0; -} -.progressInfo { - color: white !important; - background-color: #1BB199 !important; -} -.progressInfo a { - text-decoration: underline; -} -.progressWarning { - color: white !important; - background-color: #f0ad4e !important; - border: 1px solid #f0ad4e !important; -} -.progressError { - color: white !important; - background-color: #d9534f !important; - border: 1px solid #d9534f !important; -} -.progressNormal { - color: white !important; - background-color: #1BB199 !important; - border: 1px solid #1BB199 !important; -} -.progressPane { - vertical-align: middle; - margin-right: 24px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressWatch { - cursor: pointer; - text-align: center; - position: relative; - display: inline-block; - width: 16px; - height: 16px; - background: transparent; - border: none; - margin-right: 6px; - margin-left: 12px; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.watchButton { - border-top: 1px solid #626e76; - position: relative; - top: 0; - width: 3px; - left: calc(50% - 2px); - height: 0px; - border-radius: 40%; - transition: top 0.5s ease, border-color 1s ease; -} -.watchBody { - position: relative; - left: 1px; - top: 1px; - width: calc(100% - 5px); - height: calc(100% - 5px); - background: transparent; - border: 1px solid #626e76; - -moz-border-radius: 50%; - -webkit-border-radius: 50%; - border-radius: 50%; - - transition: border-color 1s ease; -} -.watchBody span.hand { - position: absolute; - border-radius: 40%; -} -.watchBody .hand.longMinute { - top: 1px; - left: 5px; - position: absolute; - height: 9px; - width: 1px; -} -.watchBody .hand.longMinute > .darkSide { - position: absolute; - left: 0; - width: 1px; - display: block; - border-radius: 40%; - height: 5px; - background: #626e76; - transition: background-color 1s ease; -} -.watchBody .hand.longHour { - top: 5px; - left: 2px; - position: absolute; - width: calc(100% - 4px); - height: 1px; -} -.watchBody .hand.longHour > .darkSide { - position: absolute; - height: 1px; - display: inline-block; - border-radius: 40%; - right: 0; - width: 4px; - background: #626e76; - - transition: background-color 1s ease; -} -.progressWatch.running .watchBody .hand { - -webkit-animation: rotate 60s infinite linear; - -moz-animation: rotate 60s infinite linear; - -ms-animation: rotate 60s infinite linear; - -o-animation: rotate 60s infinite linear; - animation: rotate 60s infinite linear; -} -.progressWatch.running .watchBody .hand.longHour { - -webkit-animation-duration: 6s; - -moz-animation-duration: 6s; - -ms-animation-duration: 6s; - -o-animation-duration: 6s; - animation-duration: 6s; -} -.progressWatch.running .watchBody .hand.longMinute { - -webkit-animation-duration: 0.5s; - -moz-animation-duration: 0.5s; - -ms-animation-duration: 0.5s; - -o-animation-duration: 0.5s; - animation-duration: 0.5s; -} -.progressWatch.running .watchButton { - border-color: white; - top: 1px; -} -.progressWatch.running .watchBody { - border-color: white; -} -.progressWatch.running .watchBody .hand.longHour > .darkSide { - background-color: white; -} -.progressWatch.running .watchBody .hand.longMinute > .darkSide { - background-color: white; -} -.progressWatch.warning .watchButton { - border-color: #d99608; -} -.progressWatch.warning .watchBody { - border-color: #d99608; - background-color: #fce1a9; -} -.progressWatch.warning .watchBody .hand.longHour > .darkSide { - background-color: #d99608; -} -.progressWatch.warning .watchBody .hand.longMinute > .darkSide { - background-color: #d99608; -} -.progressWatch.error .watchButton { - border-color: #b94a48; -} -.progressWatch.error .watchBody { - border-color: #b94a48; - background-color: #EFA1A7; -} -.progressWatch.error .watchBody .hand.longHour > .darkSide { - background-color: #b94a48; -} -.progressWatch.error .watchBody .hand.longMinute > .darkSide { - background-color: #b94a48; -} -@-webkit-keyframes rotate { - 0% { -webkit-transform: rotate(0deg);} - 100% { -webkit-transform: rotate(360deg);} -} -@-moz-keyframes rotate { - 0% { -moz-transform: rotate(0deg);} - 100% { -moz-transform: rotate(360deg);} -} -@keyframes rotate { - 0% { transform: rotate(0deg);} - 100% { transform: rotate(360deg);} -} -.progressWarning .progressPane_running, .progressWarning .core-sprite-progress { - border-color: #f0ad4e; -} -.progressError .progressPane_running, .progressError .core-sprite-progress { - border-color: #b94a48; -} -.progressNormal .progressPane_running, .progressNormal .core-sprite-progress { - border-color: #468847; -} -.progressPane_running_dialog { - vertical-align: middle; - margin: 2px 8px 2px 2px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressPane_finished_dialog { - vertical-align: middle; - background: url(../../images/none.png) no-repeat center; - width: 16px; height: 16px; -} -.progressPane_empty { - -} -.notificationShow { - color: white; - background-color: #1BB199; - top: 0; - position: fixed; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - max-height: 1000px; - overflow: hidden; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 5px; - z-index: 300; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - border:none; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notificationHide { - color: white; - background-color: #1BB199; - top: -45px; - position: fixed; - text-align:center; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - box-shadow: 0 2px 0 rgba(0,0,0,0.1); - max-height: 1000px; - overflow: hidden; - padding-left: 5px; - z-index: 300; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notifications a { - color: white; - text-decoration: underline; -} -.notifications { - display: inline-block; - text-align: left; -} -.notifications p:first-child { - margin-top: 0; -} -.notifications p:last-child { - margin-bottom: 0; -} -@font-face { - font-family: 'Orion Icon Font'; - src: url(../../font/OrionIconFont-Regular.eot); - src: url(../../font/OrionIconFont-Regular.eot?#iefix) format('embedded-opentype'), - url(../../font/OrionIconFont-Regular.woff) format('woff'), - url(../../font/OrionIconFont-Regular.ttf) format('truetype'), - url(../../font/OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f) format('svg'); - - font-style: normal; - font-weight: 400; -} - -html { - cursor: default; - height: 100%; -} -html, body { - margin: 0; - padding: 0; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - font-size: 9pt; - min-width:700px; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -h2 { - font-size: 1.1em; - font-weight: bold; - color: #6d6d6d; - margin-top: 4px; - margin-bottom: 4px; -} -img { - border: 0; -} - -button::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - -moz-user-select: text; - text-indent: 0; - text-shadow: none; - border: 1px solid #bbb; - color: #333; - font-size: 9pt; - padding: 2px; - margin-left: 5px; -} -textarea { - border: 1px solid #bbb; -} -html[dir="rtl"] input{ - margin-right: 5px; - margin-left: auto; -} - -.navlink { - display: inline-block; - padding: 2px; - color: #333333; -} -.navlink:hover { - color: #00AED1; -} -.navlink > span { - color: inherit; -} -.nav_fakelink:hover { - cursor: pointer; -} -.navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: #555; -} -.navlinkonpage:active { - text-decoration: none; -} -.navlinkonpage:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; -} -#auxpane .navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: inherit; -} -#auxpane .navlink { - display: inline-block; - padding: 2px; - color: inherit; - vertical-align: bottom; - line-height: 12px; -} -.dragOver { - color: white !important; - background: #1bb199; - outline: #AAA 2px dotted !important; -} -.logo { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 0 -517px; - width: 37px; height: 14px; - margin-top: 6px; - margin-right:5px; -} -html[dir="rtl"] .logo { - margin-left:5px; - margin-right:auto; -} -.toolbarTarget:focus{ - outline:none; -} -.pageNav { - color: #808080; - font-size: 8pt; -} -.pageActions { - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.runBar { - -webkit-align-items: center; - align-items: center; - display: -webkit-inline-flex !important; - display: inline-flex !important; - height: 100%; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.status { - color: white; - vertical-align: baseline; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.toolComposite { -} -.taskTitle { - min-width: 10em; -} -.taskDescription { - font-size: 8pt; - padding: 8px; -} -.pageNavigationActions { - text-align: right; - min-height: 30px; -} -html[dir="rtl"] .pageNavigationActions { - text-align: left; -} -.parameters { - color: whitesmoke; - vertical-align: middle; -} -.parametersDismiss { - color: whitesmoke; - vertical-align: middle; - font-weight: normal; - padding: 3px 0 0 3px; - padding-bottom: 0; -} -html[dir="rtl"] .parametersDismiss { - padding: 3px 3px 0px 0px; -} -.dismissButton { - border: 1px solid transparent; - background: transparent; - color: white; - cursor: pointer; - border-radius: 1px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.githubCloneAuth .dismissButton { - color: #1bb199; - margin-left: 0; -} -.githubCloneAuth .dismissButton:hover { - color: #1bb199; -} -.parametersDismiss .core-sprite-close { - margin-right: 0; - padding-right: 0; - padding-top: 0; -} -html[dir="rtl"] .parametersDismiss .core-sprite-close { - margin-left: 0; - margin-right: auto; - padding-left: 0; -} -.cancelButton { - border: 1px solid transparent; - background: #D3D3D3 !important; - color: black; - border-radius: 3px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; -} -.dismissButton:hover { - color: #fdfdfd; -} -.parameterPrompt { - color: #fdfdfd; - display: block; - padding: 6px 4px 0; -} -.parameterMessage { - max-width: 400px; - padding: 6px 4px; -} -.parameterInlineButton { - vertical-align: baseline; -} -label.parameterInput { - color: #555; - white-space: nowrap; -} -.parameterInput { - margin: 4px; - font-weight: normal; - vertical-align: middle; - color:#333; - outline:none; -} -button.dismissButton.parameterInput { - color: whitesmoke; - margin-top: 3px; - margin-bottom: 3px; -} -.parameterInvalid { - background-color: rgb(243, 224, 220); -} -input.parameterInput[type=url] { - width: 30em; -} -input.parameterInput[type=checkbox] { - width: auto; -} -textarea.parameterInput { - vertical-align: top; - width: 50em; -} -.parameterPopup { - min-width: 15em; - max-width: 100em; - color: #333; -} -.parameterPopup > label{ - color: whitesmoke; -} -.parameterPopup > input{ - color: #333; -} -.navTableHeading { - color: #404040; - border-bottom: 1px solid #404040; -} -.navColumn { - min-width: 150px; - vertical-align: baseline; - padding: 2px; -} -.navColumnNoIcon { - padding: 6px; -} -.navRow { - vertical-align: baseline; - border-spacing: 8px; -} -.selectableNavRow:hover { -} -.disabledNavRow > .navColumn > .mainNavColumn { - outline: 1px dashed lightgray; -} -.disabledNavRow > .navColumn > .mainNavColumn > * { - color: gray; - cursor: default; -} -.disabledNavRow > .navColumn > .mainNavColumn > *:hover { - border: none; -} -.mainNavColumn { - display: inline-block; - padding: 2px; - vertical-align: baseline; - white-space: nowrap; -} -.singleNavColumn { - width: calc(100% - 6px); - white-space: nowrap; -} -.actionsColumn { - min-width: 300px; - text-align: right; - padding-left: 16px; - vertical-align: middle; - height: 24px; -} -html[dir="rtl"] .actionsColumn { - text-align: left; - padding-right: 16px; - padding-left: 0px; -} -.selectionCheckmarkSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - border: 0; -} -.modelDecorationSprite { - display: inline-block; - vertical-align: middle; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; -} -html[dir="rtl"] .modelDecorationSprite { - padding-left: 8px; - padding-right: 0px; -} -.advancedSearchDecorationSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - margin-left: 0px; - padding-right: 0px; -} -.thumbnail { - vertical-align: middle; - padding: 0; - margin: 0; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; - height: 16px; - width: 16px; - vertical-align:bottom; -} -html[dir="rtl"] .thumbnail { - padding-left: 8px; - padding-right: 0px; -} -@media all and (min-device-width: 1025px) { - .modelDecorationSprite { - padding: 0; - margin: 0; - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .modelDecorationSprite { - padding-left: 2px; - padding-right: 0px; - } - - .thumbnail { - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - max-height: 24px; - max-width: 48px; - vertical-align:bottom; - } - - html[dir="rtl"] .thumbnail { - padding-left: 2px; - padding-right: 0px; - } - - .selectionCheckmarkSprite { - padding: 0; - padding-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .selectionCheckmarkSprite { - padding-left: 2px; - padding-right: 0px; - } - - .checkColumn { - width: 22px; - } -} -.pane { - margin: 0; - padding: 0; - background: #FFFFFF; - min-width: 300px; -} -.userEditBoxPrompt { - background: white; - color: black; -} -.auxPadding { - padding-left: 8px; - padding-top: 2px; - padding-bottom: 8px; -} -html[dir="rtl"] .auxPadding { - padding-right: 8px; - padding-left: 0px; -} - -.help { - font-weight: bold; - font-size: 1.2em; - padding-left: 8px; - padding-right: 8px; -} -.footer { - text-align: left; - width: 100%; - border: 0; - padding: 0; -} -html[dir="rtl"] .footer { - text-align: right; -} -.toolbarLabel { - padding-left: 8px; -} -html[dir="rtl"] .toolbarLabel { - padding-right: 8px; - padding-left: 0px; -} -.slideContainer { - height: auto; - float: right; - margin: 2px; - margin-top: 0; - margin-left: 4px; - display: none; - vertical-align: middle; - font-size: 11px; - z-index: 70; - color: #999; -} -html[dir="rtl"] .slideContainer { - float: left; - margin-right: 4px; - margin-left: auto; -} -.slideParameters { - background-color: #5fc8b7; -} -.mainToolbar .slideContainer { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; - top: -36px; - -webkit-transition: top 0.3s ease; - -moz-transition: top 0.3s ease; - -o-transition: top 0.3s ease; - transition: top 0.3s ease; -} -.mainToolbar .slideParameters { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; -} -.slideContainerActive { - display: block; -} -.activeCommand { - background-color: #e3e3e3; - border: 1px solid #9a9a9a; -} -.commandMarker { -} -.bannerMenu { - margin: 0; - margin-left: 8px; - margin-right: 8px; - font-size: 7pt; - display: inline-block; - padding-top:0 !important; - vertical-align: baseline; -} -.bannerMenuSearchOptions { - margin-left: -20px; -} -html[dir="rtl"] .bannerMenuSearchOptions { - margin-right: -20px; - margin-left: 0px; -} -.bannerButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - border-radius:3px; - margin: 2px; - padding: 2px; -} -.bannerButton:hover { - background-color: #e6e6e6; - border: 1px solid #808080; -} -.toolbarButton { - border: 0; - padding: 0; - height: 20px; -} -.keyAssistFloat { - color: white; - display: none; - background: rgba(55, 71, 79, 0.9); - position: fixed; - right: 44px; - top: 80px; - min-width: 250px; - padding: 5px; - z-index:100; - border-radius: 4px; -} -html[dir="rtl"] .keyAssistFloat { - left: 44px !important; - right: auto !important; -} -.keyAssistContents { - width: auto; - height: 400px; - margin-top: 8px; - margin-bottom: 1px; - overflow: hidden; -} -.keyAssistInput { - color: inherit; - background: #263238; - width: 100%; - margin: 0; - padding-left: 0; - padding-right: 0; -} -.keyAssistBindingInput { - font-size: 10pt; - font-weight: bold; - color: #efc100; - background: #263238; - border: none; - outline: none; - height: 100%; - text-align: right; - margin: 0; - padding: 0; -} -.keyAssistList { - width: 100%; - border-collapse: collapse; - outline: none; -} -.keyAssistItem { -} -.keyAssistItem.selected { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistItem:hover { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistEditButton { - display: block; - visibility: hidden; - font-size: 13px !important; - color: white !important; -} -.keyAssistEditButtonVisible { - visibility: visible; -} -.keyAssistActions { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.keyAssistItem:hover .keyAssistEditButton { - visibility: visible; -} -.keyAssistSpacer { - width: 16px; - height: 14px; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.keyAssistFloat h2 { - color: gold; -} -.keyAssistName { - text-align: left; - padding: 3px; -} -.keyAssistAccel { - - font-size: 10pt; - font-weight: bold; - color: #efc100; - text-align: right; - padding: 3px; - min-width: 150px; -} -.inputCompletionContainer { - border-radius:1px; - color: black; - display: block; - border: 1px solid #DDD; - background: #fefefe; - max-height: 300px; - max-width: 300px; - min-width: 150px; - position: absolute; - overflow-y: auto; - overflow-x: hidden; - padding: 2px; - box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); - z-index:200; -} -.inputCompletionDismissButton { - background: transparent; - color: silver; - border-radius: 1px; - padding: 0; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.inputCompletionLILeftTD { - height: 19px; - font-size: 9pt; -} -.inputCompletionLIRightTD { - width: 19px; - height: 19px; -} -.inputCompletionUL { - list-style : none; - margin: 0; - padding: 0; -} -.inputCompletionLISelected { - background : #ffeecc; -} -.inputCompletionLICategory { - font-weight: bold; -} -.inputCompletionLINormal { - background : white; -} -#tree { - margin-right: 9em; - overflow-x: hidden; -} -html[dir="rtl"] #tree { - margin-left: 9em; - margin-right: auto; -} -#treeButtons br { - line-height: 0.5em; -} -#treeButtons { - margin: 0; - padding: 0; - float: right; - width: 9em; -} -html[dir="rtl"] #treeButtons { - float: left; -} -#treeButtons .contentButton { - width: 8.5em; - margin: 0; - margin-bottom: 3px; - font-size: 1em; -} -.testResult { - background-color: #444444 !important; - color: white; -} -.folderItem { - background: url(../../images/folder.png); -} -.fileItem { - background: url(../../images/file.png); -} -.newItem { - background: url(../../images/addcontent.png); -} -.treetable { - border-spacing: 0; - width:100%; -} -.miniNavTreeTable { - border-spacing: 0; - width:100%; - padding-left:0px; -} -.secondaryColumn { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; -} -html[dir="rtl"] .secondaryColumn { - padding-left: 8px; - padding-right: 0px; -} -.secondaryColumnRight { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; - text-align: right; -} -html[dir="rtl"] .secondaryColumnRight { - padding-left: 8px; - padding-right: 0px; - text-align: left; -} - -.secondaryColumnLeft { - color: #666666; - padding-right: 8px; - padding-left: 8px; - padding-top: 8px; - vertical-align:top; - text-align: left; -} -html[dir="rtl"] .secondaryColumnLeft { - text-align: right; -} -.primaryColumn { - color: #3087B3; - text-decoration: none; - vertical-align:top; -} -.checkColumn { - padding: 0; - padding-left:10px; -} -html[dir="rtl"] .checkColumn { - padding-right:10px; - padding-left:0px; -} -.testNavTreetable { - min-width: 150px; -} -.testResultTreetable { - min-width: 600px; -} -.selectionModelContainer { - outline: none; -} -.treeIterationCursor { - border-radius:4px; -} -.lightSectionTreeTableRow { - background-color: #FFFFFF; -} -.darkSectionTreeTableRow { - background-color: #f5f7f9; -} -.treeIterationCursorRow { - background-color: rgba(27, 177, 153, 0.3); -} -.treeIterationCursorRow_Dotted { - background-color: rgba(27, 177, 153, 0.3); -} -.searchCmdGroupMargin { - margin-left: 16px; - margin-top: 2px; -} -html[dir="rtl"] .searchCmdGroupMargin { - margin-right: 16px; - margin-left: auto; -} -.LoginWindowLeft { - padding-left: 0.5em; -} -html[dir="rtl"] .LoginWindowLeft { - padding-right: 0.5em; - padding-left: 0em; -} -.LoginWindowRight { - padding-right: 0.5em; -} -html[dir="rtl"] .LoginWindowRight { - padding-left: 0.5em; - padding-right: 0em; -} -.LoginWindowComment { - font-size: 0.9em; - padding-left: 15px; -} -html[dir="rtl"] .LoginWindowComment { - padding-right: 15px; - padding-left: 0px; -} -#outline #switchOutlineMenu { - float: right; -} -html[dir="rtl"] #outline #switchOutlineMenu { - float: left; -} -#outline #switchOutlineMenu .commandImage { - display: none; -} -#outline>ul { - padding-left: 0 !important; - clear: both; - margin: 4px 0 0 8px; -} -html[dir="rtl"] #outline>ul { - padding-right: 0 !important; - margin: 4px 8px 0px 0px; -} -#outline ul { - padding-left: 14px; -} -html[dir="rtl"] #outline ul { - padding-right: 14px; - padding-left: 0px; -} -#outline li { - padding-bottom: 2px; - list-style-type: none; - white-space: nowrap; -} -.uploadContainer{ - padding:20px; - font-weight:bold; -} -.dottedOutline{ - border: #DDD 4px dashed; - border-radius: 2px; - padding:50px; - height:300px; - width: 300px; -} -.floatingSection{ - color: #DDD; -} -.uploadInstruction{ - font-size: 18pt; - color: #CCC; - padding: 0 0 25px; - text-align:center; -} -.tipInstruction{ - font-size: 12pt; - color: #CCC; - padding: 0 0 100px; - text-align:center; -} -.uploadOptions { - font-size: 14pt; - color: #BBB; - padding: 0 0 100px; - text-align: center; - vertical-align: middle; -} -.uploadOptionsItem { - font-size: 12pt; - color: #BBB; - text-align: center; - vertical-align: middle; - margin: 0 8px !important; -} -.uploadChooser{ - vertical-align: middle; - margin-right: 24px; - margin-bottom: 4px; - border: 1px solid #dedede; - border-radius:1px; -} -html[dir="rtl"] .uploadChooser{ - margin-left: 24px; - margin-right: auto; -} -.targetSelector{ -} -#folderNameparameterCollector{ - color:#333; -} -#urlparameterCollector{ - color:#333; -} -.setting-control { - display: table-cell; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; - vertical-align: middle; -} -.setting-control[type="text"] { - width: 120px; -} -.local { - display: table; -} -.local > div { - display: table-row; -} -.local .setting-label { - padding-left: 8px; - text-align: right; - display: table-cell; - vertical-align: middle; -} -html[dir="rtl"] .local .setting-label { - padding-right: 8px; - padding-left: 0px; - text-align: left; -} -.delegatedUI { - position: absolute; - min-width: 250px; - min-height: 100px; - - width: 600px; - height: 400px; - z-index: 150; - border: 1px inset; - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, 0.2); - border: 1px solid #BBBBBB; - border-collapse: separate; - border-radius: 1px; -} -.centralNavigation { - margin-bottom:2px; - cursor:pointer; -} -.centralNavigation:hover{ - color: #00AED1; -} -.navigationLabel{ - color:#ddd; - cursor:pointer; - display: inline; - padding-right: 3px; -} -html[dir="rtl"] .navigationLabel{ - padding-left: 3px; - padding-right: 0px; -} -.groupedContentDivider{ - float: left; - width: 1px; - height: 160px; - margin-top: 10px; - margin-bottom: 10px; - border-left: dashed 1px #ddd; -} -html[dir="rtl"] .groupedContentDivider{ - float: right; - border-right: dashed 1px #ddd; - border-left: 0px; -} -.navigationBreadcrumb{ - font-family: sans-serif; -} -.currentLocation{ - margin-left:auto; - margin-right:auto; -} -.modifiedFileMarker{ - color:#333; - padding-left:5px; -} -html[dir="rtl"] .modifiedFileMarker{ - padding-right:5px; - padding-left:0px; -} -.noFile { - padding: 10px; - vertical-align: middle; -} -.navColumnBold { - font-weight: bold; -} -.icon-inline { - display: inline-block; - vertical-align: middle; - margin: 0 2px 0 2px; -} -.projectNavColumn { - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn { - color: white; -} -.projectNavColumn a{ - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn a{ - color: white; - font-weight: bold; -} -.projectInformationNode{ -} -.sectionWrapper, .sectionTable{ - text-align: left; - border-collapse: collapse; - border-spacing: 0; - padding: 0; - margin-top: 40px; - overflow-y: hidden; -} -html[dir="rtl"] .sectionWrapper, html[dir="rtl"] .sectionTable{ - text-align: right; -} -.mainpane .sectionTable .treetable, .mainpane .sectionWrapper .treetable, .mainpane .sectionTable .treetable .actionsColumn{ - min-width: inherit; -} -.fixedMinWidthText { - overflow: hidden; - text-overflow: ellipsis; - display: block; - max-width: 300px; -} -.sectionTable { - margin-top: 0; - margin-left: 8%; - margin-right: 8%; - border: 1px solid #f1f3f4; - -webkit-transition: all 0.1s ease, left 0; - transition: all 0.1s ease, left 0; - -webkit-transform-origin: top; - -ms-transform-origin: top; - transform-origin: top; -} -.sectionWrapper+.sectionTable { - border-top: none; -} -.sectionTable:last-child { - margin-bottom: 20px; -} -.sectionTable.sectionClosed { - height: 0; - -webkit-transform: scaleY(0); - -ms-transform: scaleY(0); - transform: scaleY(0); -} -.sectionWrapper{ - border: 1px solid; - margin-left: 8%; - margin-right: 8%; - background: none repeat scroll 0 0 #f4f4f4; - vertical-align: middle; - font-weight: bold; - padding: 6px; - color: gray; - margin-bottom: 0; - border-color: #e3e7ea; - transition: all 0.1s ease; -} -.sectionWrapper.sectionClosed { - box-shadow: none; - opacity: 0.9; - background: none; -} -.sectionWrapper.sectionClosed:hover { - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); - opacity: 1; - transition: all 0.1s; -} -.sectionTable td { - border-bottom: 1px solid #f1f3f4; - vertical-align: middle; - color: gray; -} -.sectionTable tr:last-child td{ - border-bottom: 0; -} -.sectionTable div.lightTreeTableRow:last-child, .sectionTable div.lightTreeTableRow:last-child{ - border-bottom: 0; -} -#searchSectionContent.sectionTable { - box-shadow: none; -} -#searchSectionContent.sectionTable .mainNavColumn { - padding-right: 0; -} -.treeTableRow span.core-sprite-closedarrow, .treeTableRow span.core-sprite-openarrow { - cursor: pointer; -} -.treeTableRow span.core-sprite-closedarrow:hover, .treeTableRow span.core-sprite-openarrow:hover { - color: #00AED1; -} -.searchOutlineContainer { - height:100%; - width:100%; - position:relative; - overflow-y: auto; - overflow-x: auto; -} -.searchOutlineContainer .filesystemSwitcher .dropdownMenu { - position: fixed; -} -.orionMarkdown { - padding: 8px; - color: gray; -} -.orionMarkdown h1 { - position: relative; -} -.orionMarkdown h2 { - font-size: initial; -} -.orionMarkdown img { - max-width: 100%; -} -.orionMarkdown pre, .orionMarkdown code { - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 3px; -} -.orionMarkdown pre { - padding: 6px 10px; - overflow: auto; -} -.orionMarkdown code { - padding: 0 5px; - margin: 0 2px; -} -.orionMarkdown pre code { - background-color: transparent; - padding: 0; - border: 0; - margin: 0; -} -.markdownSelected { - background-color: #f7f7d5; -} -.orionProject input, .orionProject textarea{ - border: 1px solid lightgrey; -} -.orionProject .discreetInput { - border: 1px solid transparent; - color: gray; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - width: 90%; - margin-left: 0; - min-height: 15px; - background-color: inherit; -} -html[dir="rtl"] .orionProject .discreetInput { - margin-right: 0; - margin-left: auto !important; -} -.orionProject .discreetInput:hover, .orionProject .discreetInput:focus { - border: 1px solid lightgrey; - color: black; - background-color: white; -} -.discreetInputLabel { - font-weight: bold; - padding: 8px; -} -.discreetInputHidden { - display: none !important; -} -.discreetInputURLWrapper { - padding: 2px; -} -.discreetInputCell { - color: #666666; - padding: 1px; -} -.discreetInfoCell { - color: #666666; - padding: 8px; -} -.sectionTreeTable { - border-spacing: 0; - width:100%; -} -.sectionTreeTable td { - border-bottom: none !important; -} -.sectionTreeTableHeader{ - background: none !important; -} -.lightTreeTableRow, .darkTreeTableRow { - border-bottom: 1px solid #dadada; -} -.progressBar { - border-radius: 3px; - width: 0; - background-color: #fab467; - background: linear-gradient(#fabb76, #e1a25c); - display: inline-block; - height: 100%; -} -.progressBarWrapper { - border: 1px solid #dadada; - border-radius: 3px; - display: inline-block; - height: 14px; - margin-left: 5px; - overflow: hidden; - padding: 1px; - vertical-align: middle; - width: 100px; -} -html[dir="rtl"] .progressBarWrapper { - margin-right: 5px; - margin-left: auto; -} -.uploadNode { - background-color: whitesmoke; - padding: 2px 0; - vertical-align: middle; -} -.uploadNodeText { - display: inline-block; - overflow: hidden; - max-width: calc(100% - 145px); - padding: 4px; - text-overflow: ellipsis; - vertical-align: middle; - white-space: nowrap; -} -.progressBarWrapper .progressBar { - vertical-align: top; -} -.uploadNode .uploadCancelButton { - cursor: pointer; - float: right; - font-size: 14px; - padding: 2px 6px; - vertical-align: middle; -} -html[dir="rtl"] .uploadNode .uploadCancelButton { - float: left; -} -.uploadCancelButton:hover { - color: #00AED1; -} -.progressBar.continuous { - -webkit-animation:uploadAnimation 1s infinite linear; - -moz-animation:uploadAnimation 1s infinite linear; - animation:uploadAnimation 1s infinite linear; - background: linear-gradient(to right, transparent, #fab467, transparent); - width: 100%; -} -@-webkit-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@-moz-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -.promptDialogMessage { - color: #222; - margin: 0 2px 4px 2px; -} -.promptDialogInput { - min-width: 200px; - padding: 4px; - margin: 2px 2px 0 2px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.openResourceDialogInput { - display: inline-block; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.fileExplorerProgressDiv { - margin-left: 10px; -} -html[dir="rtl"] .fileExplorerProgressDiv { - margin-right: 10px; - margin-left: auto; -} -.commandSprite { - background: url(../../images/core_sprites.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; -} -.imageSprite { - display: inline-block; - vertical-align: middle; -} -.core-sprite-progress { - height:14px; - width:14px; - -webkit-animation: progressAnimation .7s infinite linear; - -moz-animation: progressAnimation .7s infinite linear; - animation: progressAnimation .7s infinite linear; - border-radius:100%; - background-image: none; - padding: 0px; - padding-top:2px; - border:2px solid rgba(1,1,1,0.7); - border-top:0px solid rgba(1,1,1,0); - outline: none; -} -@-webkit-keyframes progressAnimation { - from {-webkit-transform:scale(0.7) rotate(0deg);} - to {-webkit-transform: scale(0.7) rotate(360deg);} -} -@-moz-keyframes progressAnimation { - from {-moz-transform: scale(0.7) rotate(0deg);} - to {-moz-transform: scale(0.7) rotate(360deg);} -} -@keyframes progressAnimation { - from {transform: scale(0.7) rotate(0deg);} - to {transform: scale(0.7) rotate(360deg);} -} - -.core-sprite-check{ background-position: 0 -18px; width: 16px; height: 16px; } -.core-sprite-check_on{ background-position: 0 -36px; width: 16px; height: 16px; } -.core-sprite-compare-addition{ background-position: 0 -108px; width: 16px; height: 16px; } -.core-sprite-compare-removal{ background-position: 0 -126px; width: 16px; height: 16px; } -.core-sprite-copy-folder{ background-position: 0 -144px; width: 16px; height: 16px; } -.core-sprite-file_model{ background-position: 0 -257px; width: 16px; height: 16px; } -.core-sprite-go-down{ background-position: 0 -311px; width: 16px; height: 16px; } -.core-sprite-information{ background-position: 0 -365px; width: 16px; height: 16px; } -.core-sprite-initproject{ background-position: 0 -383px; width: 16px; height: 16px; } -.core-sprite-link{ background-position: 0 -419px; width: 16px; height: 16px; } -.core-sprite-list{ background-position: 0 -437px; width: 16px; height: 16px; } -.core-sprite-none{ background-position: 0 -491px; width: 16px; height: 16px; } -.core-sprite-ok{ background-position: 0 -509px; width: 16px; height: 16px; } -.core-sprite-replaceAll{ background-position: 0 -608px; width: 16px; height: 16px; } -.core-sprite-sep{ background-position: 0 -644px; width: 1px; height: 16px; } -.core-sprite-start{ background-position: 0 -680px; width: 16px; height: 16px; } -.core-sprite-thumbnail{ background-position: 0 -716px; width: 16px; height: 16px; } -.core-sprite-applicationrunning { - border-radius: 50%; - background-color: green; - width: 14px; - height: 14px; -} -.core-sprite-applicationstopped { - border-radius: 50%; - background-color: red; - width: 14px; - height: 14px; -} -.core-sprite-applicationnotdeployed { - border-radius: 50%; - background-color: white; - border: 1px solid grey; - width: 12px; - height: 12px; -} -.core-sprite-hamburger, -.core-sprite-silhouette, -.core-sprite-addcontent, -.core-sprite-gear, -.core-sprite-wrench, -.core-sprite-go-up, -.core-sprite-outline, -.core-sprite-move-down, -.core-sprite-move-up, -.core-sprite-openarrow, -.core-sprite-closedarrow, -.core-sprite-delete, -.core-sprite-refresh, -.core-sprite-expandAll, -.core-sprite-collapseAll, -.core-sprite-folder, -.core-sprite-file, -.core-sprite-close, -.core-sprite-edit, -.core-sprite-leftarrow, -.core-sprite-rightarrow, -.file-sprite-css, -.file-sprite-html, -.file-sprite-javascript, -.file-sprite-xml, -.file-sprite-text, -.file-sprite-image, -.core-sprite-shell, -.core-sprite-warning, -.core-sprite-error, -.core-sprite-deploy, -.core-sprite-repository, -.core-sprite-sites, -.core-sprite-shell, -.core-sprite-search, -.core-sprite-git-logo, -.core-sprite-delta, -.core-sprite-blank-menu-item, -.core-sprite-printer, -.core-sprite-split-pane-orientation, -.core-sprite-trashcan, -.core-sprite-whitespace, -.core-sprite-compare-view, -.core-sprite-compare-inline, -.core-sprite-filter, -.core-sprite-show-filtered, -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip, -.core-sprite-dashboard, -.core-sprite-runlogs, -.core-sprite-play, -.core-sprite-stop, -.core-sprite-open, -.core-sprite-debug, -.core-sprite-restart, -.core-sprite-download, -.core-sprite-collected-errors, -.core-sprite-listed-errors, -.core-sprite-checkmark, -.core-sprite-save, -.core-sprite-questionmark, -.core-sprite-eraser -{ - color: inherit; - font-size: 16px; - line-height: normal; - vertical-align: middle; - font-family: 'Orion Icon Font'; - padding: 0; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.core-sprite-questionmark { - font-weight: bold; -} -.core-sprite-hamburger { - margin-top: -3px; -} -.core-sprite-silhouette { - line-height: 14px; - padding: 3px; -} -.core-sprite-wrench { - font-size: 14px; - line-height:16px; - padding: 2px; -} -.core-sprite-folder { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-file { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-close { - line-height: 14px; - padding-right: 5px; - margin-top: -3px; -} -.core-sprite-leftarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.core-sprite-rightarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.file-sprite-css { - padding-right: 5px; -} -.file-sprite-html { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-javascript { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-xml { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-text { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-image { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-warning { - line-height: 14px; - padding-right: 5px; -} -.core-sprite-error { - color: #b94a48; - line-height: 14px; - padding-right: 5px; -} -.core-sprite-git-logo { - font-size: 20px; - padding-bottom: 10px !important; -} -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip{ - padding: 2px; - padding-top: 0; -} -.core-sprite-hamburger:before{ content:'\E000'; } -.core-sprite-gear:before{ content:'\E001'; } -.core-sprite-silhouette:before{ content:'\E003'; float: right;} -.core-sprite-wrench:before{ content:'\E004'; } -.core-sprite-addcontent:before{ content:'\E004'; } -.core-sprite-go-up:before{ content:'\E009'; } -.core-sprite-outline:before{ content:'\E026'; } -.core-sprite-openarrow:before{ content:'\E028'; } -.core-sprite-closedarrow:before{ content:'\E027'; } -.core-sprite-delete:before{ content:'\E02A'; } -.core-sprite-refresh:before{ content:'\E025'; } -.core-sprite-expandAll:before{ content:'\E011'; } -.core-sprite-collapseAll:before{ content:'\E012'; } -.core-sprite-folder:before{ content:'\E010'; } -.core-sprite-file:before{ content:'\E00A'; } -.core-sprite-edit:before{ content:'\E008'; } -.core-sprite-move-down:before{ content:'\E014'; } -.core-sprite-move-up:before{ content:'\E013'; } -.core-sprite-close:before{ content:'\E02A'; } -.core-sprite-leftarrow:before{content:'\E015';} -.core-sprite-rightarrow:before{content:'\E016';} -.core-sprite-deploy:before{content:'\E032';} -.core-sprite-warning:before{content:'\E033';} -.core-sprite-error:before{content:'\E034';} -.core-sprite-repository:before{ content:'\E020'; } -.core-sprite-sites:before{ content:'\E03A'; } -.core-sprite-shell:before{ content:'\E02E'; } -.core-sprite-search:before{ content:'\E037'; } -.core-sprite-git-logo:before{ content:'\E03B'; } -.core-sprite-delta:before{ content:'\E03C'; } -.core-sprite-blank-menu-item:before{ content:'\0079'; } -.core-sprite-printer:before{ content:'\E040'; } -.core-sprite-split-pane-orientation:before{ content:'\E041'; } -.core-sprite-split-pane-orientation:after{ content:'\E042'; } -.core-sprite-trashcan:before{ content:'\E046'; } -.core-sprite-compare-view:before{ content:'\E04A'; } -.core-sprite-whitespace:before{ content:'\E04B'; } -.core-sprite-compare-inline:before{ content:'\E04C'; } -.core-sprite-filter:before{ content:'\E04D'; } -.core-sprite-show-filtered:before{ content:'\E04E'; } -.core-sprite-eraser:before{ content:'\E03D'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-save:before{ content:'\E052'; } -.core-sprite-listed-errors:before{ content:'\E053'; } -.core-sprite-collected-errors:before{ content:'\E054'; } -.core-sprite-download:before{ content:'\E036'; } -.core-sprite-debug:before{ content:'\E056'; } -.core-sprite-restart:before{ content:'\E025'; } -.core-sprite-play:before{ content:'\E057'; } -.core-sprite-stop:before{ content:'\E058'; } -.core-sprite-open:before{ content:'\E059'; } -.core-sprite-dashboard:before{ content:'\E062'; } -.core-sprite-runlogs:before{ content:'\E064'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-page:before{ content:'\E066'; } -.core-sprite-horizontal:before{ content:'\E042'; } -.core-sprite-vertical:before{ content:'\E041'; } -.core-sprite-pip:before{ content:'\E067'; } -.core-sprite-questionmark:before{ content:'?'; } - -.file-sprite-javascript:before{ content:'\E00D'; } -.file-sprite-css:before{ content:'\E00C'; } -.file-sprite-xml:before{ content:'\E00E'; } -.file-sprite-html:before{ content:'\E00F'; } -.file-sprite-text:before{ content:'\E00B'; } -.file-sprite-image:before{ content:'\E031'; } -.file-sprite-javascript:hover{ - text-decoration:none; -} -.textview { - background-color: white; - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - min-width: 50px; - min-height: 50px; -} -.textviewSelection { - background: rgb(180, 213, 255); -} -.textviewContent ::-moz-selection { - background: rgb(180, 213, 255); -} -.textviewContent ::selection { - background: rgb(180, 213, 255); -} -.textviewSelectionUnfocused { - background: lightgray; -} -.textviewSelectionCaret { - background: black; -} -.textviewScroll { - padding: 4px 2px 4px 2px; -} -.textviewScroll::-webkit-scrollbar { - width: 7px; - height: 7px; -} -.textviewScroll::-webkit-resizer { - display: none; -} -.textviewScroll::-webkit-scrollbar-corner { - background-color: transparent; - display: none; -} -.textviewScroll::-webkit-scrollbar-button { - width: 0px; - height: 0px; - display: none; -} -.textviewScroll::-webkit-scrollbar-track, -.textviewScroll::-webkit-scrollbar-track:hover, -.textviewScroll::-webkit-scrollbar-track:active { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: none; -} -.textviewScroll::-webkit-scrollbar-thumb { - background-clip: padding-box; - background-color: rgba(27, 27, 27, 0.10); - border: 2px solid transparent; - border-radius: 4px; - -webkit-box-shadow: inset 0px 0px 2px rgba(59, 59, 59, 0.3); - box-shadow: inset 0px 0px 2px rgba(59, 59, 59, 0.3); - min-height: 32px; -} -.textviewScroll::-webkit-scrollbar-thumb:hover { - background-color: rgba(27, 27, 27, 0.15); -} -.textviewContent { - cursor: auto; -} -.textviewLeftRuler { - border-right: 5px solid #F6F6F6; - background-color: #F6F6F6; -} -.textviewRightRuler { - border-left: 1px solid #eaeaea; -} -.textviewInnerRightRuler { - border-left: 1px solid #eaeaea; - background-color: white; -} -.textviewMarginRuler { - border-left: 1px solid #eaeaea; -} -.textviewBlockCursor { - background: black; - opacity: 0.4; -} -.ruler { -} -.ruler.annotations { - width: 16px; -} -.ruler.folding { - width: 14px; -} -.ruler.breakpoints { - width: 14px; -} -.ruler.lines { - text-align: right; -} -.ruler.overview { - width: 14px; -} -.ruler.zoom { - width: 100px; - height: 100%; -} -.rulerLines { - color: #8E8E8E; -} -.rulerLines.even -.rulerLines.odd { -} -.rulerZoomWindow { - background-color: rgba(0, 0, 0, 0.1); - margin-left: 1px; - border: 1px solid #eee; - position: absolute; - width: calc(100% - 4px); - border-radius: 5px; - z-index: 100; -} -.textviewZoom { - font-size: 2px !important; - cursor: pointer; -} -.textviewZoom .textviewContent { - cursor: pointer; -} -.textviewZoom .textviewScroll { - padding: 0; -} -.textviewZoom .punctuation.separator.tab { - background-image: none; -} -.textviewZoom .punctuation.separator.space { - background-image: none; -} -.textviewTooltip { - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - background-color: #325C80; - color: #FAFAFA; - padding: 8px; - - box-sizing: content-box; - border-radius: 3px; - z-index: 101; - position: fixed; - overflow: hidden; -} -.tooltipTheme .textviewScroll { - padding: 0; -} -.tooltipTheme { - background-color: transparent !important; -} -.textviewTooltipCodeProjection { - border: 1px solid black !important; - - padding: 0 !important; -} -.textviewTooltip a { - color: #7CC7FF; -} -.textviewTooltip h3 { - -webkit-margin-before: 0; - margin-top: 0; -} -.textviewTooltip p:first-of-type { - -webkit-margin-before: 0; - margin-top: 0; - -webkit-margin-after: 0; - margin-bottom: 0; -} -.textviewTooltip p { - word-wrap: break-word; -} -.textviewTooltip multi_anno { - font-style: normal; - font-weight: bold; -} -.textviewTooltip span { - vertical-align: baseline; -} -.textviewTooltip .tooltipRow { - display: table-row; -} -.textviewTooltip .tooltipImage { - display: inline-block; - vertical-align: middle; - padding: 1px; -} -.textviewTooltip .tooltipTitle { - padding-left: 3px; - vertical-align: middle; -} -.textviewTooltip .hoverTooltipTitle { - font-weight: normal; -} -.textviewTooltip .commandButton { - border: 1px solid #325C80; - background-color: inherit; - color: white; -} -.textviewTooltip .commandButton:not(.dropdownTrigger){ - text-transform: initial; -} -.textViewTooltipOnFocus { - resize: both; - overflow: auto; -} -.textViewTooltipOnHover { - overflow: auto; -} - -.textViewFind { - background-color: #ddd; - position: absolute; - top: -50px; - right: -1000px; - border: 1px solid #aaa; - border-top: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - padding: 2px; - z-index: 100; -} -.textViewFind.show { - top: 0; - right: 40px; - transition: top 0.3s ease-out; - -ms-transition: top 0.3s ease-out; - -moz-transition: top 0.3s ease-out; - -webkit-transition: top 0.3s ease-out; - -o-transition: top 0.3s ease-out; -} -.textViewFindButton { - margin-right: 1px; - margin-left: 0; -} -.textViewFindButton:first-child { - margin-left: 5px; -} -.textViewFindButton:last-child { - margin-right: 5px; -} -.textViewFindButton.checked { - color: blue; - text-decoration: underline; -} -.textViewReplaceInput { -} -.textViewFindInput { -} -.textViewFindCloseButton { - width: 16px; - height: 16px; - border-width: 0; - background-color: transparent; - vertical-align: baseline; - background-position: center; - background-repeat: no-repeat; - background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==); -} -.contentassist { - font-size:12px; - display: none; - background-color: white; - position: fixed; - top: 100px; - left: 100px; - z-index:100; - cursor: default; - min-width: 70px; - width: 350px; - height: 170px; - overflow-x: hidden; - overflow-y: auto; - white-space: nowrap; - border-radius: 5px; - box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px; - line-height: 18px; - resize: both; -} -.contentassist:focus { - outline: none; -} -.contentassist .proposal-emphasis { - font-weight: normal; -} -.contentassist hr{ - border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} -.contentassist .proposal-noemphasis-keyword { - background-color: aliceblue; - color: #CC4C07; - font-weight: bold; -} -.contentassist .proposal-noemphasis { - background-color: aliceblue; - font-weight: lighter; - color: black; -} -.contentassist .proposal-noemphasis-title-keywords { - background-color: aliceblue; - color: gray; -} -.contentassist .proposal-noemphasis-title { - background-color: aliceblue; - color: gray; - padding-top: 5px; -} -.contentassist .proposal-default { - -} -.contentassist .proposal-name { - font-weight: bold; -} -.contentassist .selected { - background-color: rgb(48, 135, 179); - background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160)); - border-radius: 3px; - color: white; -} -.contentassist .cloneProposal { - box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px; - position: fixed; - visibility: visible; - z-index: 1000; -} -.contentassist .proposalTag { - display: inline-block; - line-height: 11px; - height: 10px; - border-radius: 2px; - background: #325C80; - padding: 2px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist .iconTagGreen { - display: inline-block; - font-size: 10px; - font-weight: bold; - line-height: 13px; - height: 12px; - width: 12px; - border-radius: 50%; - background: green; - padding: 1px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist>div { - padding: 1px 3px 1px 5px; -} -.cloneWrapper { - display: block; - height: 0; - overflow: visible; - visibility: hidden; - width: 0; - z-index: 1000; -} -.contentassist.cloneWrapper:hover { - overflow: visible; -} -.comment { - color: #3C802C; -} -.constant { - color: blue; -} -.entity { - color: #3f7f7f; -} -.invalid { - color: red; - font-weight: bold; -} -.keyword { - color: #9F4177; - font-weight: bold; -} -.storage { - color: #7F0055; -} -.string { - color: #446fbd; -} -.support { - color: #21439c; -} -.variable { - color: #0000c0; -} -.punctuation.separator.space { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center center; -} -.punctuation.separator.tab { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: left center; -} -.comment-block-documentation { - color: #00008F; -} -.constant-character-entity { - font-style: normal; -} -.entity-name-function, .entity-name-type { - font-weight: bold; - color: #67BBB8; -} -.entity-name-tag { - color: #98937B; -} -.entity-other-attribute-name { - color: #3C802C; -} -.invalid-illegal { - color: white; - background-color: red; -} -.invalid-deprecated { - text-decoration: line-through; -} -.keyword-operator { - color: #CC4C07; - font-weight: bold; -} -.meta.annotation.currentLine { - background-color: #EAF2FE; -} -.meta.tag { - color: #3f7f7f; -} -.punctuation-definition-comment { - color: #3f5fbf; -} -.punctuation-definition-string { - color: blue; -} -.variable-parameter { - color: #D1416F; -} -.variable-language { - color: #7F0055; - font-weight: bold; -} -.cm-meta { color: #00008F; } -.cm-keyword { font-weight: bold; color: #7F0055; } -.cm-atom { color: #21439c; } -.cm-number { color: black; } -.cm-def { color: green; } -.cm-variable { color: black; } -.cm-variable-2 { color: #004080; } -.cm-variable-3 { color: #004080; } -.cm-property { color: black; } -.cm-operator { color: #222; } -.cm-comment { color: green; } -.cm-string { color: blue; } -.cm-error { color: #ff0000; } -.cm-qualifier { color: gray; } -.cm-builtin { color: #7F0055; } -.cm-bracket { color: white; background-color: gray; } -.cm-tag { color: #3f7f7f; } -.cm-attribute { color: #7f007f; } - -.annotation { -} -.annotation.error, -.annotation.warning, -.annotation.task, -.annotation.bookmark, -.annotation.breakpoint, -.annotation.collapsed, -.annotation.expanded, -.annotation.currentBracket, -.annotation.matchingBracket, -.annotation.currentLine, -.annotation.matchingSearch, -.annotation.currentSearch, -.annotation.readOccurrence, -.annotation.writeOccurrence, -.annotation.linkedGroup, -.annotation.currentLinkedGroup, -.annotation.selectedLinkedGroup { -} -.annotation.blame { - color: gray; - background-color: rgb(255, 132, 44); -} -.annotation.currentBlame { - color: black; - background-color: rgb(184, 103, 163); -} -.annotation.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - color: #CCCCCC; -} -.lines .annotation.diffAdded { - background-image: none; - background-color: rgba(159, 202, 86, 0.68); - color: #555555; -} -.lines .annotation.diffModified { - background-image: none; - background-color: rgba(85, 181, 219, 0.67); - color: #555555; -} -.annotationHTML { - cursor: pointer; - width: 16px; - height: 16px; - display: inline-block; - vertical-align: middle; - background-position: center; - background-repeat: no-repeat; -} -.annotationHTML.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII="); -} -.annotationHTML.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg=="); -} -.annotationHTML.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg=="); -} -.annotationHTML.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII="); -} -.annotationHTML.breakpoint { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs="); -} -.annotationHTML.collapsed { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII="); -} -.annotationHTML.expanded { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg=="); -} -.annotationHTML.multiple { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7"); -} -.annotationHTML.overlay { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII="); - background-position: right bottom; - position: relative; - top: -16px; -} -.annotationHTML.currentBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.matchingBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.currentLine { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs="); -} -.annotationHTML.matchingSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.currentSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.readOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.writeOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.blame { - float: left; -} -.annotationHTML.currentBlame { - float: left; -} -.annotationHTML.blame.single { - width: 32px; - height: 32px; -} -.annotationHTML.currentBlame.single { - width: 32px; - height: 32px; -} -.annotationHTML.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - background-position: left top; -} -.annotationHTML.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - background-position: left top; -} -.annotationHTML.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - background-position: left top; -} -.annotationOverview { - cursor: pointer; - border-radius: 2px; - left: 2px; - width: 8px; -} -.annotationOverview.task { - background-color: #93bb7a; - border: 1px solid #79aa59; -} -.annotationOverview.breakpoint { - background-color: #C68076; - border: 1px solid black; -} -.annotationOverview.bookmark { - background-color: #84b3cf; - border: 1px solid #9cc2d8; -} -.annotationOverview.error { - background-color: #EFA1A7; - border: 1px solid #ec8a91; -} -.annotationOverview.warning { - background-color: #fce1a9; - border: 1px solid #face70; -} -.annotationOverview.currentBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.matchingBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.currentLine { - background-color: #EAF2FE; - border: 1px solid black; -} -.annotationOverview.matchingSearch { - background-color: #C3E1FF; - border: 1px solid #afcae5; -} -.annotationOverview.currentSearch { - background-color: #53D1FF; - border: 1px solid #42a7cc; -} -.annotationOverview.readOccurrence { - background-color: lightgray; - border: 1px solid black; -} -.annotationOverview.writeOccurrence { - background-color: Gold; - border: 1px solid darkred; -} -.annotationOverview.currentBlame { - background-color: rgb(184, 103, 163); - border: 1px solid black; -} -.annotationOverview.diffAdded { - background-color: rgba(159, 202, 86, 0.52); - border: 1px solid black; -} -.annotationOverview.diffDeleted { -} -.annotationOverview.diffModified { - background-color: rgba(85, 181, 219, 0.61); - border: 1px solid black; -} -.annotationRange { - background-repeat: repeat-x; - background-position: left bottom; -} -.annotationRange.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg=="); -} -.annotationRange.breakpoint { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg=="); -} -.annotationRange.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); -} -.annotationRange.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.currentBracket { - background-color: #00FE00; -} -.annotationRange.matchingBracket { - background-color: #00FE00; -} -.annotationRange.readOccurrence { - background-color: lightgray; -} -.annotationRange.writeOccurrence { - background-color: yellow; -} -.annotationRange.matchingSearch { - background-color: #C3E1FF; -} -.annotationRange.currentSearch { - background-color: #53D1FF; -} -.annotationRange.linkedGroup { - outline: 1px solid grey; -} -.annotationRange.currentLinkedGroup { - background-color: #C3E1FF; -} -.annotationRange.selectedLinkedGroup { - background-color: #53D1FF; -} -.annotationLine { -} -.annotationLine.currentLine { - background-color: #EDEDED ; -} -.diffNormal { - background: #DDDDDD; -} -.diffConflict { - background: #EEB4B4; -} -.diffNormalSelect { - background: #BBBBBB; -} -.diffConflictSelect { - background: #F08080; -} -.diffInlineAddedSelect { - background: #00B400; -} -.diffInlineAdded { - background: #99EE99; -} -.diffInlineRemovedSelect { - background: #B44040; -} -.diffInlineRemoved { - background: #EE9999; -} -.compareCanvas { - background: #F6F6F6; - border: 0; -} -.inlineRulerLeft { - border-right: 1px solid #EAEAEA; -} -.compareEditorParent { - clear: both; - overflow: hidden; - position: absolute; - top: 30px; - bottom: 0; - left: 0; - width: 100%; - margin-bottom: 30px; -} -.compareEditorParentImageMode { - overflow: auto !important; -} -.compareEditorParentWithCanvas { - clear: both; - overflow: hidden; - position: absolute; - left: 44px; - right: 0; - height:100%; - border-left: 1px solid #eaeaea; -} -.canvasContainer { - position: absolute; - width:44px; - height:100%; - overflow: hidden; -} -.compareActionContainer { - float: left; - padding-top: 3px; - padding-bottom: 3px; - overflow: hidden; -} -.titleActionContainer { - width:100%; - height:30px; - overflow: hidden; - color: gray; - white-space: nowrap; -} -.titleContainer { - padding-left: 5px; - padding-top: 8px; - overflow: hidden; -} -.statusContainer { - position: absolute; - bottom:0; - width:100%; - height:30px; - overflow: hidden; - text-align: center; - color: gray; -} -.leftPanelLayout { - display: block; - position: absolute; - left: 0; - overflow: hidden; - width: 50%; - height: 100%; -} -.rightPanelLayout { - display: block; - position: absolute; - right: 0; - overflow: hidden; - height: 100%; -} -.compareSplitLayout { - position: absolute; - left: 50%; - height: 100%; - z-index: 50; - width: 4px; - cursor: e-resize; - - visibility: hidden; -} -.annotationLine.addedBlockDiff { - background-color: #9EC676; -} -.annotationLine.currentAddedBlockDiff { - background-color: #CCE2B8; -} -.annotationLine.deletedBlockDiff { - background-color: #C68076; -} -.annotationLine.currentDeletedBlockDiff { - background-color: #E49489; -} -.annotationLine.blockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVBhXY6yvr2cYHAAAzPsBf2hZ98wAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.currentBlockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY2AYNAAAAIsAAR6L5FUAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.blockDiffConflict { - background-color: #FFFFCA; -} -.annotationLine.currentBlockDiffConflict { - background-color: #FFFF5B; -} -.annotationRange.addedWordDiff { - background-color: #ABDE7D; -} -.annotationRange.currentAddedWordDiff { - background-color: #A5DA6F; -} -.annotationRange.deletedWordDiff { - background-color: #D07668; -} -.annotationRange.currentDeletedWordDiff { - background-color: #E48071; -} -.annotationRange.emptyDeletedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyDeletedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.annotationRange.emptyAddedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyAddedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.compare-sprite-inline-2way{ - font-size: 16px; - line-height: normal; - vertical-align:middle; - color: inherit; - font-family: 'Orion Icon Font'; - padding-right:5px; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.compare-sprite-inline-2way:before{ content: '\E04C'; } -.compare-sprite-inline-2way:after{ content: '\E04A'; } -.orionPage { - background-color: #26343F; - width: 100%; - height: 100%; -} -.topRowBanner { - margin: 0; - border: 0; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - border-top-width: 0px; - border-right-width: 0px; - border-left-width: 0px; - border-bottom-style: none; - background-color: white; - height: 16px; - padding: 8px 2px 7px 6px !important; - box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px; - z-index: 100; - display: none; -} -a { - text-decoration: none; - color: #00AED1; -} -a:hover { - cursor: pointer; - text-decoration: underline; -} -.primaryNav { - font-size: 8pt; - font-weight: normal; - color: #BFBFBF; - vertical-align: baseline; -} -.primaryNav > div { - padding-top: 6px; -} -.primaryNav > nav { - padding-top: 6px; -} -.primaryNav > nav > a { - color: #BFBFBF; - margin-right: 6px; - margin-left: 6px; - text-decoration: none; -} -.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover { - cursor: pointer; - color: white; -} -.titleArea { - margin: 0; - padding-top: 3px; - border: 0; - background: #EFEFEF; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF)); - border-bottom: 1px solid #DEDEDE; - min-height: 20px; -} -.checkedRow { - color: white !important; - background-color: #1bb199 !important; -} -.checkedRow.disabledRow { - background-color: #dadada !important; -} -.checkedRow > td > span -{ - color:white !important; -} -.checkedRow > td > span > a -{ - color:white !important; -} -.checkedRow > td > span > span -{ - color:white !important; -} -.checkedRow > td > span > a > span -{ - color:white !important; -} -.checkedRow > td > a > span > span -{ - color:white !important; -} -.checkedRow .secondaryColumn { - color: white; -} -.checkedRow .navColumnNoIcon { - color: white; -} -.checkedRow .secondaryColumn > a:hover { - color: white !important; - font-weight:bold; - text-decoration: none; -} -.checkedRow .sectionTableItem { - color: white !important; -} -.checkedRow a { - color: white; -} -.checkedRow .jazz-description { - color: white; -} -.checkedRow .commandButton { - color: white; - border-color: white; -} -.checkedRow .commandImage { - color: white; -} -.navRow > td:first-child { - -} -.navRow.checkedRow > td:first-child { - border-left-color: #d57152; -} -.navbar-item-selected { - color: #FFFFFF !important; - font-weight: bold; - position: relative; - background: #1bb199 !important; -} -.breadcrumbContainer { - align-items: baseline; - display: inline-flex; - justify-content: center; - - -webkit-align-items: baseline; - display: -webkit-inline-flex; - -webkit-justify-content: center; - - margin-right: 0; - overflow: hidden; - visibility: visible; - width: 100%; -} -.breadcrumb { - color: #E6E6E6; - -webkit-flex-grow: 0; - flex-grow: 0; - font: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - overflow: hidden; - text-decoration: none; - text-overflow: ellipsis; -} -a.breadcrumb:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; - cursor: pointer; -} -.breadcrumbSeparator { - color: #E6E6E6; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - font-weight: bold; - -webkit-flex-shrink: 0; - flex-shrink: 0; - margin: 2px; - text-decoration: none; -} -.currentLocation { - padding-top:1px; - font-weight: bold; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - color: #E6E6E6; - text-decoration: none; - line-height: 10pt; - white-space:nowrap; -} -div.currentLocation { - width: 100%; -} -.breadcrumbContainer > .currentLocation { - margin: 0; -} -a.currentLocation:hover { - font-weight: bold; - color: #00AED1; - text-decoration: none; - border-bottom: 1px dotted; -} -a.breadcrumb.currentLocation { - font-weight: bold; - margin: 0; -} -.tooltipContainer .currentLocation { - color: white; -} -.tooltipContainer .breadcrumb { - color: white; -} -.tooltipContainer .breadcrumbSeparator { - color: white; -} -.tooltipContainer a.currentLocation:hover { - color: white; -} -.tooltipContainer a.breadcrumb:hover { - color: white; -} -.auxpane { - border: 0; - background: #3B4B54; - color: white; -} -.mainpane { - border: 0; - background: #3B4B54 !important; - padding-right:20px; -} -.mainToolbar { - color: white; - background: #26343f; - padding-left: 2px; - padding-right: 5px; - white-space: nowrap; -} -.fsToolbar { - padding: 2px 4px 2px 4px; - background-color: #DFE6EB; - - -} -.filesystemName { - display: inline-block; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; - margin-bottom: 8px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - max-width: calc(100% - 6px - 4px - 24px); - max-width: -webkit-calc(100% - 6px - 4px - 24px); - -moz-user-select: -moz-none; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; - color: white; -} -.filesystemSwitcher { - display: inline-block; - margin: 0; -} -.filesystemSwitcherWrapper { - display: block; - max-width: 100%; - white-space: nowrap; -} -.sidebarToolbar { - display: inline; - overflow: visible; - padding: 0 !important; -} -.searchbox { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 4px -297px; - width: 12px; height: 12px; - background-color: #444; - border: 1px solid #222; - font-size: 11px; - width: 15em; - height: 16px; - border-radius: 10px; - color: #999; - padding: 0; - padding-left: 20px; - padding-right: 16px; - margin-left: 5px; - font-size: 7pt; -} -.searchbox:focus{ - color: white; - outline: none; -} - -.orionButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - display: inline-block; - padding: 4px 6px; - border-radius: 1px; - line-height: 12px; - font-size: 9pt; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - margin: 0; -} -.commandButton.orionButton.dropdownTrigger { - -} -.commandButton.orionButton.dropdownTrigger:hover { - border-color: #ccc; -} -.mainToolbar .commandButton.orionButton.dropdownTrigger { - color:white; -} -.commandButton { - color: #00AED1; - border: 1px solid #00AED1; - background-color: rgba(0, 0, 0, 0); - - vertical-align: middle; - -webkit-transition: color 0.2s ease; - transition: color 0.2s ease; -} -.commandButton:not(.dropdownTrigger) { - -} -.extraActions .commandButton { - text-transform: uppercase; -} -.commandButton.dropdownDefaultButton { - -} -.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus { - color: white; - background-color: #a5b5bc; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); -} -.commandButton.disabled { - color: #cdcdcd; -} -.primaryButton{ - background: #1bb199; - border-color: #1bb199; - color: white; -} -.primaryButton:hover, .primaryButton:focus { - background: #01CDB0; - border-color: #01CDB0; -} -.commandImage { - border: 1px solid transparent; - border-radius: 1px; - color: inherit; - background-color: transparent; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - padding: 2px; - padding-top: 0; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandImage:hover, .commandImage:focus { - background-color: #a5b5bc; - border: 1px solid #ccc; -} -.mainToolbar .commandImage.dropdownTrigger { - color: white; -} -.orionToggleOff { - color: inherit; - border-radius: 3px; - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn { - color: inherit; - background-color: whitesmoke; - border-radius: 3px; - box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3); - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn:hover { - background: white; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleOff:hover { - background: whitesmoke; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleAnimate { - -webkit-animation-name: pulse; - animation-name: pulse; -} -@-webkit-keyframes pulse { - 0% { -webkit-transform: scale(1); } - 50% { -webkit-transform: scale(1.3); } - 100% { -webkit-transform: scale(1); } -} -@keyframes pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.3); } - 100% { transform: scale(1); } -} -.orionSwitch { - position: relative; - width: auto; -} -.orionSwitchCheck { - display: none; -} -.orionSwitchLabel { - display: block; - overflow: hidden; - cursor: pointer; - border: 1px solid #DFE6EB; - border-radius: 3px; - height: 20px; -} -.orionSwitchInner { - display: block; - width: 200%; - margin-left: -100%; - margin-top:-1px; - text-align: left; - -moz-transition: margin 0.2s ease-in 0s; - -webkit-transition: margin 0.2s ease-in 0s; - -o-transition: margin 0.2s ease-in 0s; - transition: margin 0.2s ease-in 0s; -} -.orionSwitchInner:before, .orionSwitchInner:after { - display: block; - float: left; - width: 50%; - padding: 0; - padding-bottom: 2px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.orionSwitchInner:before { - padding-left: 3px; - padding-right: 2px; - background-color: #FFF; - color: #808080; -} -.orionSwitchInner:after { - padding-right: 3px; - background-color: #eee; - color: #808080; - text-align: right; -} -.orionSwitchSwitch { - display: block; - width: calc(50% - 2px); - margin: 0; - background: #DFE6EB; - border: 1px solid #DFE6EB; - border-radius: 3px; - position: absolute; - top: 0; - bottom: 0; - right: calc(50% + 2px); - -moz-transition: all 0.2s ease-in 0s; - -webkit-transition: all 0.2s ease-in 0s; - -o-transition: all 0.2s ease-in 0s; - transition: all 0.2s ease-in 0s; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner { - margin-left: 0; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch { - right: 0px; -} -.commandMissingImageButton { - font-weight: normal; -} -.commandLink { - display: inline-block; - vertical-align: middle; - padding: 4px 0 1px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandSeparator { - padding: 2px; -} -.commandActive { - background-color: #e6e6e6 !important; - border: 1px solid #808080 !important; - border-radius: 2px !important; -} -.commandActiveItem { -} -.commandInactiveItem { -} -.split { - background: #C3C3C3; -} -.splitTracking { - background: #3B4B54; -} -.splitThumb { - background: #3B4B54; -} -.dropdown { -} -.dropdownArrowDown { - display: inline-block; - vertical-align: top; - line-height: 12px; - text-transform: lowercase; -} -.dropdownArrowRight { - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 12px; -} -.dropdownTrigger:not(.dropdownDefaultButton) { - font-weight: normal; - color: #FFFFFF; - border-color: transparent; -} -.dropdownTrigger a { - text-decoration: none; -} -.dropdownMenu { - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2); - color: #3b4b54; - background-color: white; - border-collapse: separate; - border: 1px solid #bbbbbb; - border-radius: 1px; - visibility: hidden; - z-index: 150; - position: absolute; - list-style-type: none; - display: none; - line-height: normal; - margin: 0; - cursor: default; - font-size: 12px; - margin: 0; - outline: none; - padding: 3px 0 3px; -} -.dropdownMenuOpen { - min-width: 120px; - display: block; - visibility: visible; -} -.dropdownSubMenu { - position: relative; - line-height: normal; -} -.dropdownSubMenu > ul { - top: 0; - left: 100%; -} -.dropdownMenu > li { - min-width: 120px; - display: flex; - display: -webkit-flex; -} -.dropdownMenu > li > a, .dropdownMenu > li > span { - width: calc( 100% - 9px ); - margin: 0; -} -.dropdownMenu > li > *:focus { - outline: none; -} -.dropdownSeparator { - height: 1px; - background-color: #ddd; - color: #ddd; - padding: 0 !important; - margin: 0; -} -.dropdownMenuItem, .dropdownMenuItem a { - align-items: center; - -webkit-align-items: center; - align-content: stretch; - -webkit-align-content: stretch; - display: inline-flex; - display: -webkit-inline-flex; - vertical-align: middle; - color: #3b4b54 !important; - padding: 3px 3px 3px 5px; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - border-left: 4px solid transparent; -} -.dropdownMenu .dropdownMenuItemSelected { - background-color: rgba(27,177,153, 0.1); - border-left-color: #1BB199; -} -.dropdownMenuItem .check { - display: inline-block; - width: 12px; -} -.dropdownMenuItem .dropdownKeyBinding { - color: grey !important; - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 11px; - padding-left: 15px; - padding-right: 10px; -} -.dropdownMenuItem .dropdownCommandName { - -webkit-align-items: center; - align-items: center; - display: inline-flex; - display: -webkit-inline-flex; - - flex-grow: 1; - -webkit-flex-grow: 1; - text-decoration: inherit; -} -.dropdownSelection { - background-color: white !important; - color: #3b4b54 !important; - border: 1px solid #bbbbbb !important; - border-bottom: none !important; - border-bottom-left-radius: 0 !important; - border-bottom-right-radius: 0 !important; - box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important; - margin-bottom: -1px !important; - position: relative !important; - z-index: 200 !important; -} -.checkedMenuItem { - margin: 4px 6px 2px 0; - vertical-align: bottom; -} -.tooltipContainer { - display: none; - z-index: 200; - background: transparent; - position: absolute; - max-width: 110em; -} -.tooltip .textContent { - max-width: 40em; -} -.tooltip { - color: white; - background-color: #158d7a; - border-radius: 3px; - padding: 8px; - clear: both; - float: left; - border: 1px solid #158d7a; - box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5); -} -.tooltip.left { -} -.tooltip .navlinkonpage { - color: #00aed1 !important; -} -.tooltip h2 { - color: #3b4b54; -} -.tooltip .operationStatus { - color: #00aed1; -} -.tooltip .operationError { - color: #a6b5bc; -} -.tooltipTailFromleft { - position: absolute; - display: inline-block; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromleft:after, .tooltipTailFromleft:before { - left: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromleft:after { - border-color: transparent; - border-left-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromleft:before { - border-color: transparent; - border-left-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromleft { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent transparent transparent #158d7a; - top: 2px; - right: -17px; - content: ''; -} -.tooltipTailFromright { - position: absolute; - display: inline-block; - left: 0; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromright:after, .tooltipTailFromright:before { - right: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromright:after { - border-color: transparent; - border-right-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromright:before { - border-color: transparent; - border-right-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromright { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent #158d7a transparent transparent; - left: -17px; - top: 2px; - content: ''; -} -.tooltipTailFrombelow { - position: absolute; - display: block; - left: 16px; - top: 0; - content: ''; - z-index: 201; -} -.tooltipTailFrombelow:after, .tooltipTailFrombelow:before { - bottom: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFrombelow:after { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFrombelow:before { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFrombelow { - position: absolute; - display: block; - border: 10px solid; - border-color: transparent transparent #158d7a transparent; - left: 14px; - top: -17px; - content: ''; -} -.tooltipTailFromabove { - position: absolute; - display: block; - left: 16px; - content: ''; - bottom: 0; - z-index: 201; -} -.tooltipTailFromabove:after, .tooltipTailFromabove:before { - top: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromabove:after { - border-color: transparent; - border-top-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFromabove:before { - border-color: transparent; - border-top-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFromabove { - position: absolute; - display: block; - border: 10px solid; - border-color: #158d7a transparent transparent transparent; - left: 14px; - bottom: -17px; - content: ''; -} -.tooltipShowing { - display: block; -} -.tooltip > .parametersDismiss > .dismissButton { - color: whitesmoke; -} -.tooltip > .parametersDismiss > .dismissButton:hover { - color: white; -} -.dialog { - visibility: hidden; - z-index: 175; - position: absolute; - background-color: #fbfbfb; - border-radius: 2px; - border: 1px solid #BBB; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - padding-bottom:5px; -} -.dialogShowing { - visibility: visible; -} -.dialogTitle { - display: block; -} -.dialogTitle { - padding-top: 5px; - display: inline-block; - background: #555; - width: 100%; - padding-bottom: 5px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; -} -.dialogTitle > .dismissButton { - margin-right: 0; -} -.dialogTitleText { - margin: 2px 2px 0; - color: whitesmoke; - font-size: 1em; - height: 18px; - padding-left: 4px; - font-weight: bold; -} -.dialogDismiss { - display: block; - cursor: pointer; - padding: 2px; -} -.dialogContent { - padding: 8px; -} -.parameterPopup .dismissButton, .dialogTitle .dismissButton { - color: rgb(221, 221, 221); - cursor: pointer; -} -.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover { - color: white; -} -.dialogButtons { - -webkit-align-items: center; - align-items: center; - - display: -webkit-flex; - display: flex; - - -webkit-justify-content: center; - justify-content: center; - margin: 2px 4px 4px 4px; -} -.dialogButtons > button.commandButton { - min-width: 60px; -} -.confirmDialog { - min-width: 300px; - max-width: 450px; -} -.confirmDialog .checkboxWrapper { - margin: 10px 2px 5px 2px; -} -.checkboxMessage > .confirmDialogCheckbox { - margin: 0 5px 0 0; - outline: none; - vertical-align: top; -} -.modalBackdrop { - opacity: 0.5; - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; -} -.textviewTooltip { - background-color: #158d7a; -} -.textviewTooltip .commandButton { - border-color: white; - color: white; - margin-bottom: 2px; -} -.core-sprite-git-logo { - font-size: 20px !important; -} -.outlineExplorer .navlinkonpage { - color: #333 !important; -} -.outlineExplorer .treeIterationCursorRow_Dotted { - background-color: #1BB199; -} -.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite { - color: white; -} -.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage { - color: white !important; -} -.contentassist .selected { - background-color: #1BB199 !important; - background: #1BB199 !important; - border-radius: 0; - color: #FFF; -} -.titleActionContainer, -.statusContainer, -.workingTarget { - color: white; - background: #3B4B54; -} - -@font-face { - font-family: 'Orion Icon Font'; - src: url('built-compare-12.0/OrionIconFont-Regular.eot'); - src: url('built-compare-12.0/OrionIconFont-Regular.eot?#iefix') format('embedded-opentype'), - url('built-compare-12.0/OrionIconFont-Regular.woff') format('woff'), - url('built-compare-12.0/OrionIconFont-Regular.ttf') format('truetype'), - url('built-compare-12.0/OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f') format('svg'); - - font-style: normal; - font-weight: 400; -} diff --git a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-dark-codenvy.css b/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-dark-codenvy.css deleted file mode 100644 index 273c4824b74..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-compare/src/main/resources/org/eclipse/che/ide/orion/public/built-compare-dark-codenvy.css +++ /dev/null @@ -1,4592 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012-2017 Codenvy, S.A. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Codenvy, S.A. - initial API and implementation - *******************************************************************************/ -.headerLayout { - height: 50px; -} -.toolbarLayout { - height: 50px; - - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex-direction: row; - -ms-flex-direction: row; - -webkit-flex-direction: row; - -webkit-align-items: center; - align-items: center; -} -.fsToolbarLayout { - height: 30px; -} -.bannerLeftArea{ - - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 1; - -webkit-order: 1; - -ms-flex-order: 1; - order: 1; - -moz-box-flex: 1; - -webkit-box-flex:1; - -webkit-box-ordinal-group: 1; - - width: 20%; - - padding-left:5px; -} -.bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 60%; -} -@media only screen and (device-width: 768px) { - - - .bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 59%; -} - -} -.bannerRightArea{ - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 3; - -webkit-order: 3; - -ms-flex-order: 3; - order: 3; - -moz-box-flex: 1; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 3; - width: 20%; - padding-right:5px; -} -.content-fixedHeight { - clear: both; - overflow: hidden; - position: absolute; - top: 0; - - bottom: 0; - left: 50px; - right: 0; - background: #3b4b54; - -} -.content-fixedHeight-animation { - transition: left 0.3s ease; -} -.content-fixedHeight-maximized { - top: 0; - bottom: 0; -} -.content-sideMenu-closed { - left: 0; -} -.content-fluid { -} -.footer-fixed-bottom { - position: fixed; - bottom: 0; - z-index: 50; - right: 0; - left: 0; - - height: 0; - background:#ededed; -} -.layoutBlock { - clear: both; - margin: 0; - - padding: 4px 4px 0 4px; - vertical-align: baseline; -} -.layoutLeft { - float: left; - margin: 0; -} -.layoutRight { - float: right; - margin: 0; -} -.layoutFlexStretch { - flex: 1 1; - -ms-flex: 1 1; - -webkit-flex: 1 1; -} -.spacingLeft { - margin-left: 5px; -} -.spacingRight { - margin-right: 5px; -} -.clear { - clear: both; -} -.hidden { - visibility: hidden; -} -.sidePanelLayout { - display: block; - position: absolute; - left: 0; - width: 33%; - height: 100%; -} -.generalAnimation { - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: all 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelLayoutAnimation { - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -o-transition: width 0.5s ease; - transition: width 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelVerticalLayout { - display: block; - position: absolute; - top: 0; - height: 33%; - width: 100%; -} -.sidePanelVerticalLayoutAnimation { - -webkit-transition: height 0.5s ease; - -moz-transition: height 0.5s ease; - -o-transition: height 0.5s ease; - transition: height 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelMargins { - margin-left: 8px; - margin-top: 2px; - margin-bottom: 8px; - width: auto; -} -.mainPanelLayout { - display: block; - position: absolute; - right: 0; - height: 100%; -} -.mainPanelLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.mainPanelVerticalLayout { - display: block; - position: absolute; - bottom: 0; - width: 100%; -} -.mainPanelVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.fixedToolbarHolder { - position: relative; - left: 0; - top: 0; - height: 100%; - width: 100%; - min-width:140px; - background:#3b4b54; -} -.sidebarWrapper { - overflow-x: auto; - overflow-y: hidden; - min-width: 0; -} -.sidebarWrapper > .sidebar { - position: relative; - left: 0; - top: 0; - height: calc(100% - 29px); - overflow-x: visible; -} -.projectNavSidebarWrapper > .sidebar { - height: calc(100% - 0px); -} -.workingTarget { - position: absolute; - top: 0; - width: 100%; - bottom: 0; - overflow-y: auto; - background:white; -} -.toolbarTarget { - position: absolute; - top: 50px; - width: 100%; - overflow-y: auto; -} -.toolbarTarget-toolbarHidden { - top: 0; -} -.pageLayoutTarget { - position: absolute; - width: calc( 100% - 60px ); - bottom: 0; - overflow-y: auto; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33); - margin: 20px; - margin-right: 0; - padding-top: 10px; - padding-bottom: 5px; - background: white; -} -.hasSplit { - display: none; -} -.editorViewerFrame { - width: 100%; - height: 100%; -} -.editorViewerHeader { - display:flex; - background: #3B4B54; - color: white; - flex-direction:row; - align-items:center; - line-height:26px; - border-bottom: 1px solid #263238; -} -.editorViewerHeaderDirtyIndicator { - padding-left: 5px; -} -.editorViewerHeaderTitle { - padding-left: 5px; -} -.editorViewerContent { - position: absolute; - width: 100%; - top: 27px; - bottom: 0; - overflow: auto -} -.editorViewerPicInPic { - position: absolute; - border: 1px solid #ccc; - background-color: white; - z-index: 100; - bottom: 35px; - right: 35px; - width: 40%; - height: 40%; -} -.splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 51; - width: 3px; - cursor: e-resize; - visibility: hidden; -} -.splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 51; - height: 3px; - cursor: n-resize; - visibility: hidden; -} -@media only screen -and (min-device-width : 768px) -and (max-device-width : 1024px) { - - .splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 50; - width: 20px; - cursor: e-resize; - visibility: hidden; - } - - - .splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 50; - height: 20px; - cursor: n-resize; - visibility: hidden; - } - -} -.splitThumbLeftLayout { - position: absolute; - left: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-left: -1px; - cursor: pointer; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitThumbRightLayout { - position: absolute; - right: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-right: -1px; - cursor: pointer; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; -} -.splitVerticalThumbUpLayout { - position: absolute; - top: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - margin-top: -1px; - cursor: pointer; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitVerticalThumbDownLayout { - position: absolute; - bottom: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - cursor: pointer; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} -.splitLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.splitVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.panelTracking { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: auto; -} -.commandList { - padding: 0; - margin-left: 0; - margin-right: 0; - list-style-type: none; - vertical-align: baseline; -} -.commandList > li { - float: left; - margin-left: 4px; - margin-right: 4px; -} -.commandMargins { - margin-left: 4px !important; - margin-right: 4px !important; -} -.commandMargins:last-child { - margin-right: 0 !important; -} -.sideMenu{ - width: 50px; - background: #26343F; - float: left; - position: absolute; - top: 0; - - bottom: 0; - -webkit-animation: slide 0.5s forwards; - -webkit-animation-delay: 2s; - animation: slide 0.5s forwards; - animation-delay: 2s; - display:block; - margin:0; - font-family: sans-serif; - font-size:10px; - text-decoration:none !important; - user-select: none; - -webkit-user-select: none; - -moz-user-select: -moz-none; -} -.sideMenu.animating { - z-index: 0; -} -.sideMenu-maximized { - top: 0; - bottom: 0; -} -.sideMenu-closed { - width: 0; - display: none; -} -.sideMenuHome{ - width: 100%; - height: 50px; -} -.sideMenuList{ - display:inline-block !important; - height: calc(100% - 64px); - margin: 0; - overflow-y: hidden; - padding: 0; - text-align: center; - width: 100%; -} -.sideMenuItem{ - list-style-type: none; - font-size:16px !important; - padding: 0; - margin: 3px; -} -.sideMenuItem:hover, .sideMenuItem.expanded { - text-decoration:none; - color:#F47D64 !important; -} -.sideMenu:hover > .sideMenuScrollButton { - opacity: 1; -} -.sideMenuScrollButton { - background-color: rgba(0,0,0,0.5) !important; - color: white !important; - cursor: pointer; - display: none; - height: 19px; - opacity: 0.5; - position: absolute; - width: 100%; - z-index: 100; -} -.sideMenuScrollButton.visible { - display: block; -} -.sideMenuTopScrollButton { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); -} -.sideMenuBottomScrollButton { - bottom: 0; - left: 0; -} -.sideMenuItem > .submenu-trigger { - color: #6D8B93 !important; - font-size:16px; - text-decoration:none !important; - width: 100%; - display: inline-block; - padding: 9px 0px 12px 0px; -} -.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{ - text-decoration:none; - color:white !important; -} -.sideMenuItemActive { -} -.sideMenuItemActive > .submenu-trigger { - color: white !important; -} -.sideMenuToggle { - display: none; -} -.sideMenu-notification { - position: relative; -} -.sideMenu-notification[level=info] { - background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=warn] { - background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=error] { - background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenuSubMenu{ - display: none; - list-style-type:none; - position:absolute; - font-family:sans-serif; - padding-left: 0; - z-index:100; - text-align: left; - left: 40px; -} -.sideMenuSubMenuItem{ - display: inline-block; - width: 100%; - white-space: nowrap; - font-size: 12px; - background: white; - border-right:1px solid #ddd; -} -.sideMenuSubMenuItem:before { - width: 0; - height: 0; - top: 13px; - content: ""; - left: -8px; - position: absolute; - z-index: 200; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-right: 8px solid white; -} -.sideMenuSubMenuItem:first-child{ - border-top:1px solid #ddd; - border-top-right-radius: 4px; -} -.sideMenuSubMenuItem:last-child{ - border-bottom:1px solid #ddd; - border-bottom-right-radius: 4px; -} -.sideMenuSubMenuItem a { - display: inline-block; - color: #444; - padding: 12px 30px 12px 10px; - width: calc(100% - 30px - 10px + 8px); -} -.sideMenuSubMenuItem a:hover{ - text-decoration:none; - color: black !important; -} - -.sideMenuSubMenuItem:hover { - background-color: #fde7cf; -} -.sideMenuSubMenuItem:only-child:hover { - -} -.sideMenuSubMenuItem:only-child:hover a { - color: #333; -} -.sideMenuSubMenuItem a span { - display: inline-block; -} -.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded { - display:inline-block; -} -.sidebar-decorate-active { - position: relative; - background: - radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat, - #47575F; - background-position: - 30px 29px, - 0 0; - background-size: - 8px 8px; -} -.mainContent{ - position:absolute; - left:50px; -} -.innerPanels{ - position:absolute; - width:100%; - top:50px; - bottom:0; -} -.userMenu { -} -.splash { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgb(57,75,84); - z-index: 149; - display: block; - box-shadow: 0 3px 7pt 0 rgba(0,0,0,0.3) inset; -} -.splashSeeThroughX { - -webkit-animation-name: splashSeeThrough; - animation-name: splashSeeThrough; - animation-duration: 0.7s; - background-color: rgba(38,52,63, 0.7); -} -@-webkit-keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -@keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -.splashContainer { - display: flex; - display: -webkit-flex; - align-items: center; - -webkit-align-items: center; - justify-content: center; - -webkit-justify-content: center; - height:100%; - flex-direction: column; - -webkit-flex-direction: column; - font-family: sans-serif; - font-size: 14px; -} -.splashLoader { - display: flex; - display: -webkit-flex; - height:300px; - width:400px; - flex-direction: column; - -webkit-flex-direction: column; - align-items: center; - -webkit-align-items: center; - background-color: rgb(57,75,84); - padding: 20px; - padding-top: 60px; - padding-bottom: 0px; - border-radius: 4px; - Xbox-shadow: 5px 5px 5px 0 rgba(0,0,0,0.2); - Xborder-bottom: 1px solid rgb(59,222,255); -} -.splashAbout { - text-align: center; - color: #FFFFFF; - font-size:16px; - font-family: 'helvetica'; - font-weight: bold; - margin-bottom: 10px; -} -.splashSteps { - margin:20px; - max-width: 300px; -} -.splashStep { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - padding-top: 10px; - padding-bottom:10px; - height:24px; -} -.splashMessage { - color: white; - font-size: 12px; -} -.splashDetailedMessage { - color: white; - font-size: 12px; -} -.splashVisual { - width: 24px; -} -.splashVerbal { - margin-left:20px; - color: #3BDEFF; - font-family: 'helvetica'; - font-weight: bold; - margin-top: 3px; -} -.splashVerbalwaiting { - color:grey; -} -.splashLoadingImage { - background: url(../../images/loading_24.gif) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.splashSuccessImage { - background: url(../../images/message_success_24.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.progress { - text-align: right; - margin-right: 8px; -} -.progressIcon { - margin: 0 6px 0 0; -} -.progressInfo { - color: white !important; - background-color: #1BB199 !important; -} -.progressInfo a { - text-decoration: underline; -} -.progressWarning { - color: white !important; - background-color: #f0ad4e !important; - border: 1px solid #f0ad4e !important; -} -.progressError { - color: white !important; - background-color: #d9534f !important; - border: 1px solid #d9534f !important; -} -.progressNormal { - color: white !important; - background-color: #1BB199 !important; - border: 1px solid #1BB199 !important; -} -.progressPane { - vertical-align: middle; - margin-right: 24px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressWatch { - cursor: pointer; - text-align: center; - position: relative; - display: inline-block; - width: 16px; - height: 16px; - background: transparent; - border: none; - margin-right: 6px; - margin-left: 12px; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.watchButton { - border-top: 1px solid #626e76; - position: relative; - top: 0; - width: 3px; - left: calc(50% - 2px); - height: 0px; - border-radius: 40%; - transition: top 0.5s ease, border-color 1s ease; -} -.watchBody { - position: relative; - left: 1px; - top: 1px; - width: calc(100% - 5px); - height: calc(100% - 5px); - background: transparent; - border: 1px solid #626e76; - -moz-border-radius: 50%; - -webkit-border-radius: 50%; - border-radius: 50%; - - transition: border-color 1s ease; -} -.watchBody span.hand { - position: absolute; - border-radius: 40%; -} -.watchBody .hand.longMinute { - top: 1px; - left: 5px; - position: absolute; - height: 9px; - width: 1px; -} -.watchBody .hand.longMinute > .darkSide { - position: absolute; - left: 0; - width: 1px; - display: block; - border-radius: 40%; - height: 5px; - background: #626e76; - transition: background-color 1s ease; -} -.watchBody .hand.longHour { - top: 5px; - left: 2px; - position: absolute; - width: calc(100% - 4px); - height: 1px; -} -.watchBody .hand.longHour > .darkSide { - position: absolute; - height: 1px; - display: inline-block; - border-radius: 40%; - right: 0; - width: 4px; - background: #626e76; - - transition: background-color 1s ease; -} -.progressWatch.running .watchBody .hand { - -webkit-animation: rotate 60s infinite linear; - -moz-animation: rotate 60s infinite linear; - -ms-animation: rotate 60s infinite linear; - -o-animation: rotate 60s infinite linear; - animation: rotate 60s infinite linear; -} -.progressWatch.running .watchBody .hand.longHour { - -webkit-animation-duration: 6s; - -moz-animation-duration: 6s; - -ms-animation-duration: 6s; - -o-animation-duration: 6s; - animation-duration: 6s; -} -.progressWatch.running .watchBody .hand.longMinute { - -webkit-animation-duration: 0.5s; - -moz-animation-duration: 0.5s; - -ms-animation-duration: 0.5s; - -o-animation-duration: 0.5s; - animation-duration: 0.5s; -} -.progressWatch.running .watchButton { - border-color: white; - top: 1px; -} -.progressWatch.running .watchBody { - border-color: white; -} -.progressWatch.running .watchBody .hand.longHour > .darkSide { - background-color: white; -} -.progressWatch.running .watchBody .hand.longMinute > .darkSide { - background-color: white; -} -.progressWatch.warning .watchButton { - border-color: #d99608; -} -.progressWatch.warning .watchBody { - border-color: #d99608; - background-color: #fce1a9; -} -.progressWatch.warning .watchBody .hand.longHour > .darkSide { - background-color: #d99608; -} -.progressWatch.warning .watchBody .hand.longMinute > .darkSide { - background-color: #d99608; -} -.progressWatch.error .watchButton { - border-color: #b94a48; -} -.progressWatch.error .watchBody { - border-color: #b94a48; - background-color: #EFA1A7; -} -.progressWatch.error .watchBody .hand.longHour > .darkSide { - background-color: #b94a48; -} -.progressWatch.error .watchBody .hand.longMinute > .darkSide { - background-color: #b94a48; -} -@-webkit-keyframes rotate { - 0% { -webkit-transform: rotate(0deg);} - 100% { -webkit-transform: rotate(360deg);} -} -@-moz-keyframes rotate { - 0% { -moz-transform: rotate(0deg);} - 100% { -moz-transform: rotate(360deg);} -} -@keyframes rotate { - 0% { transform: rotate(0deg);} - 100% { transform: rotate(360deg);} -} -.progressWarning .progressPane_running, .progressWarning .core-sprite-progress { - border-color: #f0ad4e; -} -.progressError .progressPane_running, .progressError .core-sprite-progress { - border-color: #b94a48; -} -.progressNormal .progressPane_running, .progressNormal .core-sprite-progress { - border-color: #468847; -} -.progressPane_running_dialog { - vertical-align: middle; - margin: 2px 8px 2px 2px; - background-position: 0 0; - text-align: right; - border: 0; - width: 16px; - height: 16px; -} -.progressPane_finished_dialog { - vertical-align: middle; - background: url(../../images/none.png) no-repeat center; - width: 16px; height: 16px; -} -.progressPane_empty { - -} -.notificationShow { - color: white; - background-color: #1BB199; - top: 0; - position: fixed; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - max-height: 1000px; - overflow: hidden; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 5px; - z-index: 300; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - border:none; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notificationHide { - color: white; - background-color: #1BB199; - top: -45px; - position: fixed; - text-align:center; - float: left; - margin-left: 20%; - margin-right: auto; - width: 60%; - box-shadow: 0 2px 0 rgba(0,0,0,0.1); - max-height: 1000px; - overflow: hidden; - padding-left: 5px; - z-index: 300; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; - transition:top 0.7s; - -webkit-transition: top 0.7s; - -moz-transition: top 0.7s; - -ms-transition: top 0.7s; - -o-transition: top 0.7s; -} -.notifications a { - color: white; - text-decoration: underline; -} -.notifications { - display: inline-block; - text-align: left; -} -.notifications p:first-child { - margin-top: 0; -} -.notifications p:last-child { - margin-bottom: 0; -} -@font-face { - font-family: 'Orion Icon Font'; - src: url(../../font/OrionIconFont-Regular.eot); - src: url(../../font/OrionIconFont-Regular.eot?#iefix) format('embedded-opentype'), - url(../../font/OrionIconFont-Regular.woff) format('woff'), - url(../../font/OrionIconFont-Regular.ttf) format('truetype'), - url(../../font/OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f) format('svg'); - - font-style: normal; - font-weight: 400; -} - -html { - cursor: default; - height: 100%; -} -html, body { - margin: 0; - padding: 0; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - font-size: 9pt; - min-width:700px; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -h2 { - font-size: 1.1em; - font-weight: bold; - color: #6d6d6d; - margin-top: 4px; - margin-bottom: 4px; -} -img { - border: 0; -} - -button::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - color: #e4e4e4; - border: 1px solid #161819; - border-radius: 1px; - font-family: "Open Sans", sans-serif; -} -textarea { - border: 1px solid #bbb; -} -html[dir="rtl"] input{ - margin-right: 5px; - margin-left: auto; -} - -.navlink { - display: inline-block; - padding: 2px; - color: #333333; -} -.navlink:hover { - color: #00AED1; -} -.navlink > span { - color: inherit; -} -.nav_fakelink:hover { - cursor: pointer; -} -.navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: #555; -} -.navlinkonpage:active { - text-decoration: none; -} -.navlinkonpage:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; -} -#auxpane .navlinkonpage, .nav_fakelink { - text-decoration: none; - padding-top: 2px; - padding-bottom: 2px; - color: inherit; -} -#auxpane .navlink { - display: inline-block; - padding: 2px; - color: inherit; - vertical-align: bottom; - line-height: 12px; -} -.dragOver { - color: white !important; - background: #1bb199; - outline: #AAA 2px dotted !important; -} -.logo { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 0 -517px; - width: 37px; height: 14px; - margin-top: 6px; - margin-right:5px; -} -html[dir="rtl"] .logo { - margin-left:5px; - margin-right:auto; -} -.toolbarTarget:focus{ - outline:none; -} -.pageNav { - color: #808080; - font-size: 8pt; -} -.pageActions { - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.runBar { - -webkit-align-items: center; - align-items: center; - display: -webkit-inline-flex !important; - display: inline-flex !important; - height: 100%; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.status { - color: white; - vertical-align: baseline; - flex: 0 0 auto; - -ms-flex: 0 0 auto; - -webkit-flex: 0 0 auto; -} -.toolComposite { -} -.taskTitle { - min-width: 10em; -} -.taskDescription { - font-size: 8pt; - padding: 8px; -} -.pageNavigationActions { - text-align: right; - min-height: 30px; -} -html[dir="rtl"] .pageNavigationActions { - text-align: left; -} -.parameters { - color: whitesmoke; - vertical-align: middle; -} -.parametersDismiss { - color: whitesmoke; - vertical-align: middle; - font-weight: normal; - padding: 3px 0 0 3px; - padding-bottom: 0; -} -html[dir="rtl"] .parametersDismiss { - padding: 3px 3px 0px 0px; -} -.dismissButton { - border: 1px solid transparent; - background: transparent; - color: white; - cursor: pointer; - border-radius: 1px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.githubCloneAuth .dismissButton { - color: #1bb199; - margin-left: 0; -} -.githubCloneAuth .dismissButton:hover { - color: #1bb199; -} -.parametersDismiss .core-sprite-close { - margin-right: 0; - padding-right: 0; - padding-top: 0; -} -html[dir="rtl"] .parametersDismiss .core-sprite-close { - margin-left: 0; - margin-right: auto; - padding-left: 0; -} -.cancelButton { - border: 1px solid transparent; - background: #D3D3D3 !important; - color: black; - border-radius: 3px; - padding: 2px; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - margin: 0 4px 0; - vertical-align: middle; - min-height: 16px; -} -.dismissButton:hover { - color: #fdfdfd; -} -.parameterPrompt { - color: #fdfdfd; - display: block; - padding: 6px 4px 0; -} -.parameterMessage { - max-width: 400px; - padding: 6px 4px; -} -.parameterInlineButton { - vertical-align: baseline; -} -label.parameterInput { - color: #555; - white-space: nowrap; -} -.parameterInput { - margin: 4px; - font-weight: normal; - vertical-align: middle; - color:#333; - outline:none; -} -button.dismissButton.parameterInput { - color: whitesmoke; - margin-top: 3px; - margin-bottom: 3px; -} -.parameterInvalid { - background-color: rgb(243, 224, 220); -} -input.parameterInput[type=url] { - width: 30em; -} -input.parameterInput[type=checkbox] { - width: auto; -} -textarea.parameterInput { - vertical-align: top; - width: 50em; -} -.parameterPopup { - min-width: 15em; - max-width: 100em; - color: #333; -} -.parameterPopup > label{ - color: whitesmoke; -} -.parameterPopup > input{ - color: #333; -} -.navTableHeading { - color: #404040; - border-bottom: 1px solid #404040; -} -.navColumn { - min-width: 150px; - vertical-align: baseline; - padding: 2px; -} -.navColumnNoIcon { - padding: 6px; -} -.navRow { - vertical-align: baseline; - border-spacing: 8px; -} -.selectableNavRow:hover { -} -.disabledNavRow > .navColumn > .mainNavColumn { - outline: 1px dashed lightgray; -} -.disabledNavRow > .navColumn > .mainNavColumn > * { - color: gray; - cursor: default; -} -.disabledNavRow > .navColumn > .mainNavColumn > *:hover { - border: none; -} -.mainNavColumn { - display: inline-block; - padding: 2px; - vertical-align: baseline; - white-space: nowrap; -} -.singleNavColumn { - width: calc(100% - 6px); - white-space: nowrap; -} -.actionsColumn { - min-width: 300px; - text-align: right; - padding-left: 16px; - vertical-align: middle; - height: 24px; -} -html[dir="rtl"] .actionsColumn { - text-align: left; - padding-right: 16px; - padding-left: 0px; -} -.selectionCheckmarkSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - border: 0; -} -.modelDecorationSprite { - display: inline-block; - vertical-align: middle; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; -} -html[dir="rtl"] .modelDecorationSprite { - padding-left: 8px; - padding-right: 0px; -} -.advancedSearchDecorationSprite { - display: inline-block; - vertical-align: middle; - background: url(../../images/core_sprites.png) no-repeat top left; - margin-left: 0px; - padding-right: 0px; -} -.thumbnail { - vertical-align: middle; - padding: 0; - margin: 0; - margin-left: 8px; - padding-right: 8px; - margin-right: 8px; - height: 16px; - width: 16px; - vertical-align:bottom; -} -html[dir="rtl"] .thumbnail { - padding-left: 8px; - padding-right: 0px; -} -@media all and (min-device-width: 1025px) { - .modelDecorationSprite { - padding: 0; - margin: 0; - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .modelDecorationSprite { - padding-left: 2px; - padding-right: 0px; - } - - .thumbnail { - margin-left: 2px; - padding-right: 2px; - margin-right: 2px; - max-height: 24px; - max-width: 48px; - vertical-align:bottom; - } - - html[dir="rtl"] .thumbnail { - padding-left: 2px; - padding-right: 0px; - } - - .selectionCheckmarkSprite { - padding: 0; - padding-left: 2px; - padding-right: 2px; - margin-right: 2px; - } - - html[dir="rtl"] .selectionCheckmarkSprite { - padding-left: 2px; - padding-right: 0px; - } - - .checkColumn { - width: 22px; - } -} -.pane { - margin: 0; - padding: 0; - background: #FFFFFF; - min-width: 300px; -} -.userEditBoxPrompt { - background: white; - color: black; -} -.auxPadding { - padding-left: 8px; - padding-top: 2px; - padding-bottom: 8px; -} -html[dir="rtl"] .auxPadding { - padding-right: 8px; - padding-left: 0px; -} - -.help { - font-weight: bold; - font-size: 1.2em; - padding-left: 8px; - padding-right: 8px; -} -.footer { - text-align: left; - width: 100%; - border: 0; - padding: 0; -} -html[dir="rtl"] .footer { - text-align: right; -} -.toolbarLabel { - padding-left: 8px; -} -html[dir="rtl"] .toolbarLabel { - padding-right: 8px; - padding-left: 0px; -} -.slideContainer { - height: auto; - float: right; - margin: 2px; - margin-top: 0; - margin-left: 4px; - display: none; - vertical-align: middle; - font-size: 11px; - z-index: 70; - color: #999; -} -html[dir="rtl"] .slideContainer { - float: left; - margin-right: 4px; - margin-left: auto; -} -.slideParameters { - background-color: #5fc8b7; -} -.mainToolbar .slideContainer { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; - top: -36px; - -webkit-transition: top 0.3s ease; - -moz-transition: top 0.3s ease; - -o-transition: top 0.3s ease; - transition: top 0.3s ease; -} -.mainToolbar .slideParameters { - border-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - position: absolute; -} -.slideContainerActive { - display: block; -} -.activeCommand { - background-color: #e3e3e3; - border: 1px solid #9a9a9a; -} -.commandMarker { -} -.bannerMenu { - margin: 0; - margin-left: 8px; - margin-right: 8px; - font-size: 7pt; - display: inline-block; - padding-top:0 !important; - vertical-align: baseline; -} -.bannerMenuSearchOptions { - margin-left: -20px; -} -html[dir="rtl"] .bannerMenuSearchOptions { - margin-right: -20px; - margin-left: 0px; -} -.bannerButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - border-radius:3px; - margin: 2px; - padding: 2px; -} -.bannerButton:hover { - background-color: #e6e6e6; - border: 1px solid #808080; -} -.toolbarButton { - border: 0; - padding: 0; - height: 20px; -} -.keyAssistFloat { - color: white; - display: none; - background: rgba(55, 71, 79, 0.9); - position: fixed; - right: 44px; - top: 80px; - min-width: 250px; - padding: 5px; - z-index:100; - border-radius: 4px; -} -html[dir="rtl"] .keyAssistFloat { - left: 44px !important; - right: auto !important; -} -.keyAssistContents { - width: auto; - height: 400px; - margin-top: 8px; - margin-bottom: 1px; - overflow: hidden; -} -.keyAssistInput { - color: inherit; - background: #263238; - width: 100%; - margin: 0; - padding-left: 0; - padding-right: 0; -} -.keyAssistBindingInput { - font-size: 10pt; - font-weight: bold; - color: #efc100; - background: #263238; - border: none; - outline: none; - height: 100%; - text-align: right; - margin: 0; - padding: 0; -} -.keyAssistList { - width: 100%; - border-collapse: collapse; - outline: none; -} -.keyAssistItem { -} -.keyAssistItem.selected { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistItem:hover { - color: black; - background: rgba(255, 255, 255, 0.3); -} -.keyAssistEditButton { - display: block; - visibility: hidden; - font-size: 13px !important; - color: white !important; -} -.keyAssistEditButtonVisible { - visibility: visible; -} -.keyAssistActions { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.keyAssistItem:hover .keyAssistEditButton { - visibility: visible; -} -.keyAssistSpacer { - width: 16px; - height: 14px; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.keyAssistFloat h2 { - color: gold; -} -.keyAssistName { - text-align: left; - padding: 3px; -} -.keyAssistAccel { - - font-size: 10pt; - font-weight: bold; - color: #efc100; - text-align: right; - padding: 3px; - min-width: 150px; -} -.inputCompletionContainer { - border-radius:1px; - color: black; - display: block; - border: 1px solid #DDD; - background: #fefefe; - max-height: 300px; - max-width: 300px; - min-width: 150px; - position: absolute; - overflow-y: auto; - overflow-x: hidden; - padding: 2px; - box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); - z-index:200; -} -.inputCompletionDismissButton { - background: transparent; - color: silver; - border-radius: 1px; - padding: 0; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - vertical-align: middle; - min-height: 16px; - min-width: 16px; -} -.inputCompletionLILeftTD { - height: 19px; - font-size: 9pt; -} -.inputCompletionLIRightTD { - width: 19px; - height: 19px; -} -.inputCompletionUL { - list-style : none; - margin: 0; - padding: 0; -} -.inputCompletionLISelected { - background : #ffeecc; -} -.inputCompletionLICategory { - font-weight: bold; -} -.inputCompletionLINormal { - background : white; -} -#tree { - margin-right: 9em; - overflow-x: hidden; -} -html[dir="rtl"] #tree { - margin-left: 9em; - margin-right: auto; -} -#treeButtons br { - line-height: 0.5em; -} -#treeButtons { - margin: 0; - padding: 0; - float: right; - width: 9em; -} -html[dir="rtl"] #treeButtons { - float: left; -} -#treeButtons .contentButton { - width: 8.5em; - margin: 0; - margin-bottom: 3px; - font-size: 1em; -} -.testResult { - background-color: #444444 !important; - color: white; -} -.folderItem { - background: url(../../images/folder.png); -} -.fileItem { - background: url(../../images/file.png); -} -.newItem { - background: url(../../images/addcontent.png); -} -.treetable { - border-spacing: 0; - width:100%; -} -.miniNavTreeTable { - border-spacing: 0; - width:100%; - padding-left:0px; -} -.secondaryColumn { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; -} -html[dir="rtl"] .secondaryColumn { - padding-left: 8px; - padding-right: 0px; -} -.secondaryColumnRight { - color: #666666; - padding-right: 8px; - padding-top: 8px; - vertical-align:top; - text-align: right; -} -html[dir="rtl"] .secondaryColumnRight { - padding-left: 8px; - padding-right: 0px; - text-align: left; -} - -.secondaryColumnLeft { - color: #666666; - padding-right: 8px; - padding-left: 8px; - padding-top: 8px; - vertical-align:top; - text-align: left; -} -html[dir="rtl"] .secondaryColumnLeft { - text-align: right; -} -.primaryColumn { - color: #3087B3; - text-decoration: none; - vertical-align:top; -} -.checkColumn { - padding: 0; - padding-left:10px; -} -html[dir="rtl"] .checkColumn { - padding-right:10px; - padding-left:0px; -} -.testNavTreetable { - min-width: 150px; -} -.testResultTreetable { - min-width: 600px; -} -.selectionModelContainer { - outline: none; -} -.treeIterationCursor { - border-radius:4px; -} -.lightSectionTreeTableRow { - background-color: #FFFFFF; -} -.darkSectionTreeTableRow { - background-color: #f5f7f9; -} -.treeIterationCursorRow { - background-color: rgba(27, 177, 153, 0.3); -} -.treeIterationCursorRow_Dotted { - background-color: rgba(27, 177, 153, 0.3); -} -.searchCmdGroupMargin { - margin-left: 16px; - margin-top: 2px; -} -html[dir="rtl"] .searchCmdGroupMargin { - margin-right: 16px; - margin-left: auto; -} -.LoginWindowLeft { - padding-left: 0.5em; -} -html[dir="rtl"] .LoginWindowLeft { - padding-right: 0.5em; - padding-left: 0em; -} -.LoginWindowRight { - padding-right: 0.5em; -} -html[dir="rtl"] .LoginWindowRight { - padding-left: 0.5em; - padding-right: 0em; -} -.LoginWindowComment { - font-size: 0.9em; - padding-left: 15px; -} -html[dir="rtl"] .LoginWindowComment { - padding-right: 15px; - padding-left: 0px; -} -#outline #switchOutlineMenu { - float: right; -} -html[dir="rtl"] #outline #switchOutlineMenu { - float: left; -} -#outline #switchOutlineMenu .commandImage { - display: none; -} -#outline>ul { - padding-left: 0 !important; - clear: both; - margin: 4px 0 0 8px; -} -html[dir="rtl"] #outline>ul { - padding-right: 0 !important; - margin: 4px 8px 0px 0px; -} -#outline ul { - padding-left: 14px; -} -html[dir="rtl"] #outline ul { - padding-right: 14px; - padding-left: 0px; -} -#outline li { - padding-bottom: 2px; - list-style-type: none; - white-space: nowrap; -} -.uploadContainer{ - padding:20px; - font-weight:bold; -} -.dottedOutline{ - border: #DDD 4px dashed; - border-radius: 2px; - padding:50px; - height:300px; - width: 300px; -} -.floatingSection{ - color: #DDD; -} -.uploadInstruction{ - font-size: 18pt; - color: #CCC; - padding: 0 0 25px; - text-align:center; -} -.tipInstruction{ - font-size: 12pt; - color: #CCC; - padding: 0 0 100px; - text-align:center; -} -.uploadOptions { - font-size: 14pt; - color: #BBB; - padding: 0 0 100px; - text-align: center; - vertical-align: middle; -} -.uploadOptionsItem { - font-size: 12pt; - color: #BBB; - text-align: center; - vertical-align: middle; - margin: 0 8px !important; -} -.uploadChooser{ - vertical-align: middle; - margin-right: 24px; - margin-bottom: 4px; - border: 1px solid #dedede; - border-radius:1px; -} -html[dir="rtl"] .uploadChooser{ - margin-left: 24px; - margin-right: auto; -} -.targetSelector{ -} -#folderNameparameterCollector{ - color:#333; -} -#urlparameterCollector{ - color:#333; -} -.setting-control { - display: table-cell; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; - vertical-align: middle; -} -.setting-control[type="text"] { - width: 120px; -} -.local { - display: table; -} -.local > div { - display: table-row; -} -.local .setting-label { - padding-left: 8px; - text-align: right; - display: table-cell; - vertical-align: middle; -} -html[dir="rtl"] .local .setting-label { - padding-right: 8px; - padding-left: 0px; - text-align: left; -} -.delegatedUI { - position: absolute; - min-width: 250px; - min-height: 100px; - - width: 600px; - height: 400px; - z-index: 150; - border: 1px inset; - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, 0.2); - border: 1px solid #BBBBBB; - border-collapse: separate; - border-radius: 1px; -} -.centralNavigation { - margin-bottom:2px; - cursor:pointer; -} -.centralNavigation:hover{ - color: #00AED1; -} -.navigationLabel{ - color:#ddd; - cursor:pointer; - display: inline; - padding-right: 3px; -} -html[dir="rtl"] .navigationLabel{ - padding-left: 3px; - padding-right: 0px; -} -.groupedContentDivider{ - float: left; - width: 1px; - height: 160px; - margin-top: 10px; - margin-bottom: 10px; - border-left: dashed 1px #ddd; -} -html[dir="rtl"] .groupedContentDivider{ - float: right; - border-right: dashed 1px #ddd; - border-left: 0px; -} -.navigationBreadcrumb{ - font-family: sans-serif; -} -.currentLocation{ - margin-left:auto; - margin-right:auto; -} -.modifiedFileMarker{ - color:#333; - padding-left:5px; -} -html[dir="rtl"] .modifiedFileMarker{ - padding-right:5px; - padding-left:0px; -} -.noFile { - padding: 10px; - vertical-align: middle; -} -.navColumnBold { - font-weight: bold; -} -.icon-inline { - display: inline-block; - vertical-align: middle; - margin: 0 2px 0 2px; -} -.projectNavColumn { - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn { - color: white; -} -.projectNavColumn a{ - color: #EEE; - font-weight: bold; -} -.projectPrimaryNavColumn a{ - color: white; - font-weight: bold; -} -.projectInformationNode{ -} -.sectionWrapper, .sectionTable{ - text-align: left; - border-collapse: collapse; - border-spacing: 0; - padding: 0; - margin-top: 40px; - overflow-y: hidden; -} -html[dir="rtl"] .sectionWrapper, html[dir="rtl"] .sectionTable{ - text-align: right; -} -.mainpane .sectionTable .treetable, .mainpane .sectionWrapper .treetable, .mainpane .sectionTable .treetable .actionsColumn{ - min-width: inherit; -} -.fixedMinWidthText { - overflow: hidden; - text-overflow: ellipsis; - display: block; - max-width: 300px; -} -.sectionTable { - margin-top: 0; - margin-left: 8%; - margin-right: 8%; - border: 1px solid #f1f3f4; - -webkit-transition: all 0.1s ease, left 0; - transition: all 0.1s ease, left 0; - -webkit-transform-origin: top; - -ms-transform-origin: top; - transform-origin: top; -} -.sectionWrapper+.sectionTable { - border-top: none; -} -.sectionTable:last-child { - margin-bottom: 20px; -} -.sectionTable.sectionClosed { - height: 0; - -webkit-transform: scaleY(0); - -ms-transform: scaleY(0); - transform: scaleY(0); -} -.sectionWrapper{ - border: 1px solid; - margin-left: 8%; - margin-right: 8%; - background: none repeat scroll 0 0 #f4f4f4; - vertical-align: middle; - font-weight: bold; - padding: 6px; - color: gray; - margin-bottom: 0; - border-color: #e3e7ea; - transition: all 0.1s ease; -} -.sectionWrapper.sectionClosed { - box-shadow: none; - opacity: 0.9; - background: none; -} -.sectionWrapper.sectionClosed:hover { - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); - opacity: 1; - transition: all 0.1s; -} -.sectionTable td { - border-bottom: 1px solid #f1f3f4; - vertical-align: middle; - color: gray; -} -.sectionTable tr:last-child td{ - border-bottom: 0; -} -.sectionTable div.lightTreeTableRow:last-child, .sectionTable div.lightTreeTableRow:last-child{ - border-bottom: 0; -} -#searchSectionContent.sectionTable { - box-shadow: none; -} -#searchSectionContent.sectionTable .mainNavColumn { - padding-right: 0; -} -.treeTableRow span.core-sprite-closedarrow, .treeTableRow span.core-sprite-openarrow { - cursor: pointer; -} -.treeTableRow span.core-sprite-closedarrow:hover, .treeTableRow span.core-sprite-openarrow:hover { - color: #00AED1; -} -.searchOutlineContainer { - height:100%; - width:100%; - position:relative; - overflow-y: auto; - overflow-x: auto; -} -.searchOutlineContainer .filesystemSwitcher .dropdownMenu { - position: fixed; -} -.orionMarkdown { - padding: 8px; - color: gray; -} -.orionMarkdown h1 { - position: relative; -} -.orionMarkdown h2 { - font-size: initial; -} -.orionMarkdown img { - max-width: 100%; -} -.orionMarkdown pre, .orionMarkdown code { - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 3px; -} -.orionMarkdown pre { - padding: 6px 10px; - overflow: auto; -} -.orionMarkdown code { - padding: 0 5px; - margin: 0 2px; -} -.orionMarkdown pre code { - background-color: transparent; - padding: 0; - border: 0; - margin: 0; -} -.markdownSelected { - background-color: #f7f7d5; -} -.orionProject input, .orionProject textarea{ - border: 1px solid lightgrey; -} -.orionProject .discreetInput { - border: 1px solid transparent; - color: gray; - font: 8pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif; - width: 90%; - margin-left: 0; - min-height: 15px; - background-color: inherit; -} -html[dir="rtl"] .orionProject .discreetInput { - margin-right: 0; - margin-left: auto !important; -} -.orionProject .discreetInput:hover, .orionProject .discreetInput:focus { - border: 1px solid lightgrey; - color: black; - background-color: white; -} -.discreetInputLabel { - font-weight: bold; - padding: 8px; -} -.discreetInputHidden { - display: none !important; -} -.discreetInputURLWrapper { - padding: 2px; -} -.discreetInputCell { - color: #666666; - padding: 1px; -} -.discreetInfoCell { - color: #666666; - padding: 8px; -} -.sectionTreeTable { - border-spacing: 0; - width:100%; -} -.sectionTreeTable td { - border-bottom: none !important; -} -.sectionTreeTableHeader{ - background: none !important; -} -.lightTreeTableRow, .darkTreeTableRow { - border-bottom: 1px solid #dadada; -} -.progressBar { - border-radius: 3px; - width: 0; - background-color: #fab467; - background: linear-gradient(#fabb76, #e1a25c); - display: inline-block; - height: 100%; -} -.progressBarWrapper { - border: 1px solid #dadada; - border-radius: 3px; - display: inline-block; - height: 14px; - margin-left: 5px; - overflow: hidden; - padding: 1px; - vertical-align: middle; - width: 100px; -} -html[dir="rtl"] .progressBarWrapper { - margin-right: 5px; - margin-left: auto; -} -.uploadNode { - background-color: whitesmoke; - padding: 2px 0; - vertical-align: middle; -} -.uploadNodeText { - display: inline-block; - overflow: hidden; - max-width: calc(100% - 145px); - padding: 4px; - text-overflow: ellipsis; - vertical-align: middle; - white-space: nowrap; -} -.progressBarWrapper .progressBar { - vertical-align: top; -} -.uploadNode .uploadCancelButton { - cursor: pointer; - float: right; - font-size: 14px; - padding: 2px 6px; - vertical-align: middle; -} -html[dir="rtl"] .uploadNode .uploadCancelButton { - float: left; -} -.uploadCancelButton:hover { - color: #00AED1; -} -.progressBar.continuous { - -webkit-animation:uploadAnimation 1s infinite linear; - -moz-animation:uploadAnimation 1s infinite linear; - animation:uploadAnimation 1s infinite linear; - background: linear-gradient(to right, transparent, #fab467, transparent); - width: 100%; -} -@-webkit-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@-moz-keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -@keyframes uploadAnimation{ - from{margin-left: -100%;} - to{margin-left: 100%;} -} -.promptDialogMessage { - color: #222; - margin: 0 2px 4px 2px; -} -.promptDialogInput { - min-width: 200px; - padding: 4px; - margin: 2px 2px 0 2px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.openResourceDialogInput { - display: inline-block; - width: 130px; - padding: 4px; - margin: 5px; - background-color: white; - border: 1px solid #CCC; - border-radius: 3px; - font-size: 12px; - color: #222; -} -.fileExplorerProgressDiv { - margin-left: 10px; -} -html[dir="rtl"] .fileExplorerProgressDiv { - margin-right: 10px; - margin-left: auto; -} -.commandSprite { - background: url(../../images/core_sprites.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; -} -.imageSprite { - display: inline-block; - vertical-align: middle; -} -.core-sprite-progress { - height:14px; - width:14px; - -webkit-animation: progressAnimation .7s infinite linear; - -moz-animation: progressAnimation .7s infinite linear; - animation: progressAnimation .7s infinite linear; - border-radius:100%; - background-image: none; - padding: 0px; - padding-top:2px; - border:2px solid rgba(1,1,1,0.7); - border-top:0px solid rgba(1,1,1,0); - outline: none; -} -@-webkit-keyframes progressAnimation { - from {-webkit-transform:scale(0.7) rotate(0deg);} - to {-webkit-transform: scale(0.7) rotate(360deg);} -} -@-moz-keyframes progressAnimation { - from {-moz-transform: scale(0.7) rotate(0deg);} - to {-moz-transform: scale(0.7) rotate(360deg);} -} -@keyframes progressAnimation { - from {transform: scale(0.7) rotate(0deg);} - to {transform: scale(0.7) rotate(360deg);} -} - -.core-sprite-check{ background-position: 0 -18px; width: 16px; height: 16px; } -.core-sprite-check_on{ background-position: 0 -36px; width: 16px; height: 16px; } -.core-sprite-compare-addition{ background-position: 0 -108px; width: 16px; height: 16px; } -.core-sprite-compare-removal{ background-position: 0 -126px; width: 16px; height: 16px; } -.core-sprite-copy-folder{ background-position: 0 -144px; width: 16px; height: 16px; } -.core-sprite-file_model{ background-position: 0 -257px; width: 16px; height: 16px; } -.core-sprite-go-down{ background-position: 0 -311px; width: 16px; height: 16px; } -.core-sprite-information{ background-position: 0 -365px; width: 16px; height: 16px; } -.core-sprite-initproject{ background-position: 0 -383px; width: 16px; height: 16px; } -.core-sprite-link{ background-position: 0 -419px; width: 16px; height: 16px; } -.core-sprite-list{ background-position: 0 -437px; width: 16px; height: 16px; } -.core-sprite-none{ background-position: 0 -491px; width: 16px; height: 16px; } -.core-sprite-ok{ background-position: 0 -509px; width: 16px; height: 16px; } -.core-sprite-replaceAll{ background-position: 0 -608px; width: 16px; height: 16px; } -.core-sprite-sep{ background-position: 0 -644px; width: 1px; height: 16px; } -.core-sprite-start{ background-position: 0 -680px; width: 16px; height: 16px; } -.core-sprite-thumbnail{ background-position: 0 -716px; width: 16px; height: 16px; } -.core-sprite-applicationrunning { - border-radius: 50%; - background-color: green; - width: 14px; - height: 14px; -} -.core-sprite-applicationstopped { - border-radius: 50%; - background-color: red; - width: 14px; - height: 14px; -} -.core-sprite-applicationnotdeployed { - border-radius: 50%; - background-color: white; - border: 1px solid grey; - width: 12px; - height: 12px; -} -.core-sprite-hamburger, -.core-sprite-silhouette, -.core-sprite-addcontent, -.core-sprite-gear, -.core-sprite-wrench, -.core-sprite-go-up, -.core-sprite-outline, -.core-sprite-move-down, -.core-sprite-move-up, -.core-sprite-openarrow, -.core-sprite-closedarrow, -.core-sprite-delete, -.core-sprite-refresh, -.core-sprite-expandAll, -.core-sprite-collapseAll, -.core-sprite-folder, -.core-sprite-file, -.core-sprite-close, -.core-sprite-edit, -.core-sprite-leftarrow, -.core-sprite-rightarrow, -.file-sprite-css, -.file-sprite-html, -.file-sprite-javascript, -.file-sprite-xml, -.file-sprite-text, -.file-sprite-image, -.core-sprite-shell, -.core-sprite-warning, -.core-sprite-error, -.core-sprite-deploy, -.core-sprite-repository, -.core-sprite-sites, -.core-sprite-shell, -.core-sprite-search, -.core-sprite-git-logo, -.core-sprite-delta, -.core-sprite-blank-menu-item, -.core-sprite-printer, -.core-sprite-split-pane-orientation, -.core-sprite-trashcan, -.core-sprite-whitespace, -.core-sprite-compare-view, -.core-sprite-compare-inline, -.core-sprite-filter, -.core-sprite-show-filtered, -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip, -.core-sprite-dashboard, -.core-sprite-runlogs, -.core-sprite-play, -.core-sprite-stop, -.core-sprite-open, -.core-sprite-debug, -.core-sprite-restart, -.core-sprite-download, -.core-sprite-collected-errors, -.core-sprite-listed-errors, -.core-sprite-checkmark, -.core-sprite-save, -.core-sprite-questionmark, -.core-sprite-eraser -{ - color: inherit; - font-size: 16px; - line-height: normal; - vertical-align: middle; - font-family: 'Orion Icon Font'; - padding: 0; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.core-sprite-questionmark { - font-weight: bold; -} -.core-sprite-hamburger { - margin-top: -3px; -} -.core-sprite-silhouette { - line-height: 14px; - padding: 3px; -} -.core-sprite-wrench { - font-size: 14px; - line-height:16px; - padding: 2px; -} -.core-sprite-folder { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-file { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-close { - line-height: 14px; - padding-right: 5px; - margin-top: -3px; -} -.core-sprite-leftarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.core-sprite-rightarrow { - line-height: 14px; - padding-top: 2px; - padding-bottom: 2px; -} -.file-sprite-css { - padding-right: 5px; -} -.file-sprite-html { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-javascript { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-xml { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-text { - line-height: 16px; - padding-right: 5px; -} -.file-sprite-image { - line-height: 16px; - padding-right: 5px; -} -.core-sprite-warning { - line-height: 14px; - padding-right: 5px; -} -.core-sprite-error { - color: #b94a48; - line-height: 14px; - padding-right: 5px; -} -.core-sprite-git-logo { - font-size: 20px; - padding-bottom: 10px !important; -} -.core-sprite-page, -.core-sprite-horizontal, -.core-sprite-vertical, -.core-sprite-pip{ - padding: 2px; - padding-top: 0; -} -.core-sprite-hamburger:before{ content:'\E000'; } -.core-sprite-gear:before{ content:'\E001'; } -.core-sprite-silhouette:before{ content:'\E003'; float: right;} -.core-sprite-wrench:before{ content:'\E004'; } -.core-sprite-addcontent:before{ content:'\E004'; } -.core-sprite-go-up:before{ content:'\E009'; } -.core-sprite-outline:before{ content:'\E026'; } -.core-sprite-openarrow:before{ content:'\E028'; } -.core-sprite-closedarrow:before{ content:'\E027'; } -.core-sprite-delete:before{ content:'\E02A'; } -.core-sprite-refresh:before{ content:'\E025'; } -.core-sprite-expandAll:before{ content:'\E011'; } -.core-sprite-collapseAll:before{ content:'\E012'; } -.core-sprite-folder:before{ content:'\E010'; } -.core-sprite-file:before{ content:'\E00A'; } -.core-sprite-edit:before{ content:'\E008'; } -.core-sprite-move-down:before{ content:'\E014'; } -.core-sprite-move-up:before{ content:'\E013'; } -.core-sprite-close:before{ content:'\E02A'; } -.core-sprite-leftarrow:before{content:'\E015';} -.core-sprite-rightarrow:before{content:'\E016';} -.core-sprite-deploy:before{content:'\E032';} -.core-sprite-warning:before{content:'\E033';} -.core-sprite-error:before{content:'\E034';} -.core-sprite-repository:before{ content:'\E020'; } -.core-sprite-sites:before{ content:'\E03A'; } -.core-sprite-shell:before{ content:'\E02E'; } -.core-sprite-search:before{ content:'\E037'; } -.core-sprite-git-logo:before{ content:'\E03B'; } -.core-sprite-delta:before{ content:'\E03C'; } -.core-sprite-blank-menu-item:before{ content:'\0079'; } -.core-sprite-printer:before{ content:'\E040'; } -.core-sprite-split-pane-orientation:before{ content:'\E041'; } -.core-sprite-split-pane-orientation:after{ content:'\E042'; } -.core-sprite-trashcan:before{ content:'\E046'; } -.core-sprite-compare-view:before{ content:'\E04A'; } -.core-sprite-whitespace:before{ content:'\E04B'; } -.core-sprite-compare-inline:before{ content:'\E04C'; } -.core-sprite-filter:before{ content:'\E04D'; } -.core-sprite-show-filtered:before{ content:'\E04E'; } -.core-sprite-eraser:before{ content:'\E03D'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-save:before{ content:'\E052'; } -.core-sprite-listed-errors:before{ content:'\E053'; } -.core-sprite-collected-errors:before{ content:'\E054'; } -.core-sprite-download:before{ content:'\E036'; } -.core-sprite-debug:before{ content:'\E056'; } -.core-sprite-restart:before{ content:'\E025'; } -.core-sprite-play:before{ content:'\E057'; } -.core-sprite-stop:before{ content:'\E058'; } -.core-sprite-open:before{ content:'\E059'; } -.core-sprite-dashboard:before{ content:'\E062'; } -.core-sprite-runlogs:before{ content:'\E064'; } -.core-sprite-checkmark:before{ content:'\E050'; } -.core-sprite-page:before{ content:'\E066'; } -.core-sprite-horizontal:before{ content:'\E042'; } -.core-sprite-vertical:before{ content:'\E041'; } -.core-sprite-pip:before{ content:'\E067'; } -.core-sprite-questionmark:before{ content:'?'; } - -.file-sprite-javascript:before{ content:'\E00D'; } -.file-sprite-css:before{ content:'\E00C'; } -.file-sprite-xml:before{ content:'\E00E'; } -.file-sprite-html:before{ content:'\E00F'; } -.file-sprite-text:before{ content:'\E00B'; } -.file-sprite-image:before{ content:'\E031'; } -.file-sprite-javascript:hover{ - text-decoration:none; -} -.textview { - background-color: #272b33; - font-family: 'Andale Mono', monospace; - font-size: 13px; - min-width: 50px; - min-height: 50px; - color: #A9B7C6; - background-color: #272b33; -} -.textviewSelection { - background: rgb(180, 213, 255); -} -.textviewContent ::-moz-selection { - background: rgb(180, 213, 255); -} -.textviewContent ::selection { - background: rgb(180, 213, 255); -} -.textviewSelectionUnfocused { - background: gray; -} -.textviewSelectionCaret { - background: black; -} -.textviewScroll { - padding: 4px 2px 4px 2px; -} -.textviewScroll::-webkit-scrollbar { - width: 7px; - height: 7px; -} -.textviewScroll::-webkit-resizer { - display: none; -} -.textviewScroll::-webkit-scrollbar-corner { - background-color: transparent; - display: none; -} -.textviewScroll::-webkit-scrollbar-button { - width: 0px; - height: 0px; - display: none; -} -.textviewScroll::-webkit-scrollbar-track, -.textviewScroll::-webkit-scrollbar-track:hover, -.textviewScroll::-webkit-scrollbar-track:active { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; - border: none; -} -.textviewScroll::-webkit-scrollbar-thumb { - background-clip: padding-box; - background-color: rgba(215, 215, 215, 0.10); - border: 2px solid transparent; - border-radius: 4px; - -webkit-box-shadow: inset 0px 0px 2px rgba(235, 235, 235, 0.3); - box-shadow: inset 0px 0px 2px rgba(235, 235, 235, 0.3); - min-height: 32px; -} -.textviewScroll::-webkit-scrollbar-thumb:hover { - background-color: rgba(215, 215, 215, 0.3); -} -.textviewContent { - cursor: auto; -} -.textviewLeftRuler { - border-right: 5px solid #31353E; - background-color: #31353E; -} -.textviewRightRuler { - border-left: 1px solid #353535; -} -.textviewInnerRightRuler { - border-left: 1px solid #eaeaea; - background-color: white; -} -.textviewMarginRuler { - border-left: 1px solid #eaeaea; -} -.textviewBlockCursor { - background: #A9B7C6; - opacity: 1; -} -.ruler { -} -.ruler.annotations { - width: 16px; -} -.ruler.folding { - width: 14px; -} -.ruler.breakpoints { - width: 14px; -} -.ruler.lines { - text-align: right; -} -.ruler.overview { - width: 14px; - background-color: #272b33; -} -.ruler.zoom { - width: 100px; - height: 100%; -} -.rulerLines { - color: #888888; - font-family: "DejaVu Sans Mono", alternativeFontFamily; - font-size: 12px; -} -.rulerLines.even -.rulerLines.odd { -} -.rulerZoomWindow { - background-color: rgba(0, 0, 0, 0.1); - margin-left: 1px; - border: 1px solid #eee; - position: absolute; - width: calc(100% - 4px); - border-radius: 5px; - z-index: 100; -} -.textviewZoom { - font-size: 2px !important; - cursor: pointer; -} -.textviewZoom .textviewContent { - cursor: pointer; -} -.textviewZoom .textviewScroll { - padding: 0; -} -.textviewZoom .punctuation.separator.tab { - background-image: none; -} -.textviewZoom .punctuation.separator.space { - background-image: none; -} -.textviewTooltip { - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - background-color: #325C80; - color: #FAFAFA; - padding: 8px; - - box-sizing: content-box; - border-radius: 3px; - z-index: 101; - position: fixed; - overflow: hidden; -} -.tooltipTheme .textviewScroll { - padding: 0; -} -.tooltipTheme { - background-color: #424242 !important; -} -.textviewTooltipCodeProjection { - border: 1px solid black !important; - - padding: 0 !important; -} -.textviewTooltip a { - color: #7CC7FF; -} -.textviewTooltip h3 { - -webkit-margin-before: 0; - margin-top: 0; -} -.textviewTooltip p:first-of-type { - -webkit-margin-before: 0; - margin-top: 0; - -webkit-margin-after: 0; - margin-bottom: 0; -} -.textviewTooltip p { - word-wrap: break-word; -} -.textviewTooltip multi_anno { - font-style: normal; - font-weight: bold; -} -.textviewTooltip span { - vertical-align: baseline; -} -.textviewTooltip .tooltipRow { - display: table-row; -} -.textviewTooltip .tooltipImage { - display: inline-block; - vertical-align: middle; - padding: 1px; -} -.textviewTooltip .tooltipTitle { - padding-left: 3px; - vertical-align: middle; -} -.textviewTooltip .hoverTooltipTitle { - font-weight: normal; -} -.textviewTooltip .commandButton { - border: 1px solid #325C80; - background-color: inherit; - color: white; -} -.textviewTooltip .commandButton:not(.dropdownTrigger){ - text-transform: initial; -} -.textViewTooltipOnFocus { - resize: both; - overflow: auto; -} -.textViewTooltipOnHover { - overflow: auto; -} - -.textViewFind { - background-color: #ddd; - position: absolute; - top: -50px; - right: -1000px; - border: 1px solid #aaa; - border-top: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - padding: 2px; - z-index: 100; -} -.textViewFind.show { - top: 0; - right: 40px; - transition: top 0.3s ease-out; - -ms-transition: top 0.3s ease-out; - -moz-transition: top 0.3s ease-out; - -webkit-transition: top 0.3s ease-out; - -o-transition: top 0.3s ease-out; -} -.textViewFindButton { - margin-right: 1px; - margin-left: 0; -} -.textViewFindButton:first-child { - margin-left: 5px; -} -.textViewFindButton:last-child { - margin-right: 5px; -} -.textViewFindButton.checked { - color: blue; - text-decoration: underline; -} -.textViewReplaceInput { -} -.textViewFindInput { -} -.textViewFindCloseButton { - width: 16px; - height: 16px; - border-width: 0; - background-color: transparent; - vertical-align: baseline; - background-position: center; - background-repeat: no-repeat; - background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==); -} -.contentassist { - font-size:12px; - display: none; - background-color: white; - position: fixed; - top: 100px; - left: 100px; - z-index:100; - cursor: default; - min-width: 70px; - width: 350px; - height: 170px; - overflow-x: hidden; - overflow-y: auto; - white-space: nowrap; - border-radius: 5px; - box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px; - line-height: 18px; - resize: both; -} -.contentassist:focus { - outline: none; -} -.contentassist .proposal-emphasis { - font-weight: normal; -} -.contentassist hr{ - border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} -.contentassist .proposal-noemphasis-keyword { - background-color: aliceblue; - color: #CC4C07; - font-weight: bold; -} -.contentassist .proposal-noemphasis { - background-color: aliceblue; - font-weight: lighter; - color: black; -} -.contentassist .proposal-noemphasis-title-keywords { - background-color: aliceblue; - color: gray; -} -.contentassist .proposal-noemphasis-title { - background-color: aliceblue; - color: gray; - padding-top: 5px; -} -.contentassist .proposal-default { - -} -.contentassist .proposal-name { - font-weight: bold; -} -.contentassist .selected { - background-color: rgb(48, 135, 179); - background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160)); - border-radius: 3px; - color: white; -} -.contentassist .cloneProposal { - box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px; - position: fixed; - visibility: visible; - z-index: 1000; -} -.contentassist .proposalTag { - display: inline-block; - line-height: 11px; - height: 10px; - border-radius: 2px; - background: #325C80; - padding: 2px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist .iconTagGreen { - display: inline-block; - font-size: 10px; - font-weight: bold; - line-height: 13px; - height: 12px; - width: 12px; - border-radius: 50%; - background: green; - padding: 1px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist>div { - padding: 1px 3px 1px 5px; -} -.cloneWrapper { - display: block; - height: 0; - overflow: visible; - visibility: hidden; - width: 0; - z-index: 1000; -} -.contentassist.cloneWrapper:hover { - overflow: visible; -} -.comment { - color: #808080; -} -.constant { - color: #cc7832; - font-weight: normal; -} -.entity { - color: #3f7f7f; -} -.invalid { - color: red; - font-weight: bold; -} -.keyword { - color: #cc7832; - font-weight: normal; -} -.storage { - color: #7F0055; -} -.string { - color: #6AAF32; -} -.support { - color: #21439c; -} -.variable { - color: #0000c0; -} -.punctuation.separator.space { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center center; -} -.punctuation.separator.tab { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: left center; -} -.comment-block-documentation { - color: #00008F; -} -.constant-character-entity { - font-style: normal; -} -.entity-name-function, .entity-name-type { - font-weight: bold; - color: #67BBB8; -} -.entity-name-tag { - color: #E8BF6A; -} -.entity-other-attribute-name { - color: rgb(152,118,170); -} -.invalid-illegal { - color: white; - background-color: red; -} -.invalid-deprecated { - text-decoration: line-through; -} -.keyword-operator { - color: #CC4C07; - font-weight: bold; -} -.meta.annotation.currentLine { - background-color: #424242 !important; -} -.meta.tag { - color: #3f7f7f; -} -.punctuation-definition-comment { - color: #3f5fbf; -} -.punctuation-definition-string { - color: blue; -} -.variable-parameter { - color: #D1416F; -} -.variable-language { - color: #7F0055; - font-weight: bold; -} -.cm-meta { color: #00008F; } -.cm-keyword { font-weight: bold; color: #7F0055; } -.cm-atom { color: #21439c; } -.cm-number { color: black; } -.cm-def { color: green; } -.cm-variable { color: black; } -.cm-variable-2 { color: #004080; } -.cm-variable-3 { color: #004080; } -.cm-property { color: black; } -.cm-operator { color: #222; } -.cm-comment { color: green; } -.cm-string { color: blue; } -.cm-error { color: #ff0000; } -.cm-qualifier { color: gray; } -.cm-builtin { color: #7F0055; } -.cm-bracket { color: white; background-color: gray; } -.cm-tag { color: #3f7f7f; } -.cm-attribute { color: #7f007f; } - -.annotation { - color: #BBB529; -} -.annotation.error, -.annotation.warning, -.annotation.task, -.annotation.bookmark, -.annotation.breakpoint, -.annotation.collapsed, -.annotation.expanded, -.annotation.currentBracket, -.annotation.matchingBracket, -.annotation.currentLine, -.annotation.matchingSearch, -.annotation.currentSearch, -.annotation.readOccurrence, -.annotation.writeOccurrence, -.annotation.linkedGroup, -.annotation.currentLinkedGroup, -.annotation.selectedLinkedGroup { -} -.annotation.blame { - color: gray; - background-color: rgb(255, 132, 44); -} -.annotation.currentBlame { - color: black; - background-color: rgb(184, 103, 163); -} -.annotation.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - color: #CCCCCC; -} -.lines .annotation.diffAdded { - background-image: none; - background-color: rgba(159, 202, 86, 0.68); - color: #555555; -} -.lines .annotation.diffModified { - background-image: none; - background-color: rgba(85, 181, 219, 0.67); - color: #555555; -} -.annotationHTML { - cursor: pointer; - width: 16px; - height: 16px; - display: inline-block; - vertical-align: middle; - background-position: center; - background-repeat: no-repeat; -} -.annotationHTML.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII="); -} -.annotationHTML.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg=="); -} -.annotationHTML.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg=="); -} -.annotationHTML.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII="); -} -.annotationHTML.breakpoint { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs="); -} -.annotationHTML.collapsed { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII="); -} -.annotationHTML.expanded { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg=="); -} -.annotationHTML.multiple { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7"); -} -.annotationHTML.overlay { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII="); - background-position: right bottom; - position: relative; - top: -16px; -} -.annotationHTML.currentBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.matchingBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.currentLine { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs="); -} -.annotationHTML.matchingSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.currentSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.readOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.writeOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.blame { - float: left; -} -.annotationHTML.currentBlame { - float: left; -} -.annotationHTML.blame.single { - width: 32px; - height: 32px; -} -.annotationHTML.currentBlame.single { - width: 32px; - height: 32px; -} -.annotationHTML.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - background-position: left top; -} -.annotationHTML.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - background-position: left top; -} -.annotationHTML.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - background-position: left top; -} -.annotationOverview { - cursor: pointer; - border-radius: 2px; - left: 2px; - width: 8px; -} -.annotationOverview.task { - background-color: #93bb7a; - border: 1px solid #79aa59; -} -.annotationOverview.breakpoint { - background-color: #4D4D4D; - border: 1px solid black; -} -.annotationOverview.bookmark { - background-color: #84b3cf; - border: 1px solid #9cc2d8; -} -.annotationOverview.error { - background-color: #EFA1A7; - border: 1px solid #ec8a91; -} -.annotationOverview.warning { - background-color: #fce1a9; - border: 1px solid #face70; -} -.annotationOverview.currentBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.matchingBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.currentLine { - background-color: #EAF2FE; - border: 1px solid black; -} -.annotationOverview.matchingSearch { - background-color: #C3E1FF; - border: 1px solid #afcae5; -} -.annotationOverview.currentSearch { - background-color: #53D1FF; - border: 1px solid #42a7cc; -} -.annotationOverview.readOccurrence { - background-color: lightgray; - border: 1px solid black; -} -.annotationOverview.writeOccurrence { - background-color: Gold; - border: 1px solid darkred; -} -.annotationOverview.currentBlame { - background-color: rgb(184, 103, 163); - border: 1px solid black; -} -.annotationOverview.diffAdded { - background-color: rgba(159, 202, 86, 0.52); - border: 1px solid black; -} -.annotationOverview.diffDeleted { -} -.annotationOverview.diffModified { - background-color: rgba(85, 181, 219, 0.61); - border: 1px solid black; -} -.annotationRange { - background-repeat: repeat-x; - background-position: left bottom; -} -.annotationRange.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg=="); -} -.annotationRange.breakpoint { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg=="); -} -.annotationRange.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); -} -.annotationRange.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.currentBracket { - background-color: #00FE00; -} -.annotationRange.matchingBracket { - background-color: #00FE00; -} -.annotationRange.readOccurrence { - background-color: lightgray; -} -.annotationRange.writeOccurrence { - background-color: yellow; -} -.annotationRange.matchingSearch { - background-color: #C3E1FF; -} -.annotationRange.currentSearch { - background-color: #53D1FF; -} -.annotationRange.linkedGroup { - outline: 1px solid grey; -} -.annotationRange.currentLinkedGroup { - background-color: #C3E1FF; -} -.annotationRange.selectedLinkedGroup { - background-color: #53D1FF; -} -.annotationLine { -} -.annotationLine.currentLine { - background-color: #2C323B ; -} -.diffNormal { - background: #DDDDDD; -} -.diffConflict { - background: #EEB4B4; -} -.diffNormalSelect { - background: #BBBBBB; -} -.diffConflictSelect { - background: #F08080; -} -.diffInlineAddedSelect { - background: #00B400; -} -.diffInlineAdded { - background: #99EE99; -} -.diffInlineRemovedSelect { - background: #B44040; -} -.diffInlineRemoved { - background: #EE9999; -} -.compareCanvas { - background: #31353E; - border: 0; -} -.inlineRulerLeft { - border-right: 1px solid #EAEAEA; -} -.compareEditorParent { - clear: both; - overflow: hidden; - position: absolute; - top: 30px; - bottom: 0; - left: 0; - width: 100%; - margin-bottom: 30px; -} -.compareEditorParentImageMode { - overflow: auto !important; -} -.compareEditorParentWithCanvas { - clear: both; - overflow: hidden; - position: absolute; - left: 44px; - right: 0; - height:100%; - border-left: 1px solid black; -} -.canvasContainer { - position: absolute; - width:44px; - height:100%; - overflow: hidden; -} -.compareActionContainer { - float: left; - padding-top: 3px; - padding-bottom: 3px; - overflow: hidden; -} -.titleActionContainer { - width:100%; - height:30px; - overflow: hidden; - color: gray; - white-space: nowrap; -} -.titleContainer { - padding-left: 5px; - padding-top: 8px; - overflow: hidden; -} -.statusContainer { - position: absolute; - bottom:0; - width:100%; - height:30px; - overflow: hidden; - text-align: center; - color: gray; -} -.leftPanelLayout { - display: block; - position: absolute; - left: 0; - overflow: hidden; - width: 50%; - height: 100%; -} -.rightPanelLayout { - display: block; - position: absolute; - right: 0; - overflow: hidden; - height: 100%; -} -.compareSplitLayout { - position: absolute; - left: 50%; - height: 100%; - z-index: 50; - width: 4px; - cursor: e-resize; - - visibility: hidden; -} -.annotationLine.addedBlockDiff { - background-color: #335041; -} -.annotationLine.currentAddedBlockDiff { - background-color: #2A5A2A; -} -.annotationLine.deletedBlockDiff { - background-color: #4D4D4D; -} -.annotationLine.currentDeletedBlockDiff { - background-color: #5F5D5D; -} -.annotationLine.blockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAPSURBVBhXY6yvr2cYHAAAzPsBf2hZ98wAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.currentBlockDiffTopOnly { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAABCAIAAAAuIQuDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAMSURBVBhXY2AYNAAAAIsAAR6L5FUAAAAASUVORK5CYII="); - background-repeat: repeat-x; - background-position: left top -} -.annotationLine.blockDiffConflict { - background-color: #FFFFCA; -} -.annotationLine.currentBlockDiffConflict { - background-color: #FFFF5B; -} -.annotationRange.addedWordDiff { - background-color: #214421; -} -.annotationRange.currentAddedWordDiff { - background-color: #2A5A2A; -} -.annotationRange.deletedWordDiff { - background-color: #3E3E3E; -} -.annotationRange.currentDeletedWordDiff { - background-color: #5F5D5D; -} -.annotationRange.emptyDeletedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyDeletedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.annotationRange.emptyAddedWordDiffLeft { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: left top -} -.annotationRange.emptyAddedWordDiffRight { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAASCAYAAABxYA+/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAUSURBVBhXY2RgYPgPxAxMIGIwMgCpaAEjILHq8AAAAABJRU5ErkJggg=="); - background-repeat: repeat-y; - background-position: right top -} -.compare-sprite-inline-2way{ - font-size: 16px; - line-height: normal; - vertical-align:middle; - color: inherit; - font-family: 'Orion Icon Font'; - padding-right:5px; - background: none; - border: none; - margin: 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.compare-sprite-inline-2way:before{ content: '\E04C'; } -.compare-sprite-inline-2way:after{ content: '\E04A'; } -.orionPage { - background-color: #26343F; - width: 100%; - height: 100%; -} -.topRowBanner { - margin: 0; - border: 0; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - border-top-width: 0px; - border-right-width: 0px; - border-left-width: 0px; - border-bottom-style: none; - background-color: white; - height: 16px; - padding: 8px 2px 7px 6px !important; - box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px; - z-index: 100; - display: none; -} -a { - text-decoration: none; - color: #00AED1; -} -a:hover { - cursor: pointer; - text-decoration: underline; -} -.primaryNav { - font-size: 8pt; - font-weight: normal; - color: #BFBFBF; - vertical-align: baseline; -} -.primaryNav > div { - padding-top: 6px; -} -.primaryNav > nav { - padding-top: 6px; -} -.primaryNav > nav > a { - color: #BFBFBF; - margin-right: 6px; - margin-left: 6px; - text-decoration: none; -} -.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover { - cursor: pointer; - color: white; -} -.titleArea { - margin: 0; - padding-top: 3px; - border: 0; - background: #EFEFEF; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF)); - border-bottom: 1px solid #DEDEDE; - min-height: 20px; -} -.checkedRow { - color: white !important; - background-color: #1bb199 !important; -} -.checkedRow.disabledRow { - background-color: #dadada !important; -} -.checkedRow > td > span -{ - color:white !important; -} -.checkedRow > td > span > a -{ - color:white !important; -} -.checkedRow > td > span > span -{ - color:white !important; -} -.checkedRow > td > span > a > span -{ - color:white !important; -} -.checkedRow > td > a > span > span -{ - color:white !important; -} -.checkedRow .secondaryColumn { - color: white; -} -.checkedRow .navColumnNoIcon { - color: white; -} -.checkedRow .secondaryColumn > a:hover { - color: white !important; - font-weight:bold; - text-decoration: none; -} -.checkedRow .sectionTableItem { - color: white !important; -} -.checkedRow a { - color: white; -} -.checkedRow .jazz-description { - color: white; -} -.checkedRow .commandButton { - color: white; - border-color: white; -} -.checkedRow .commandImage { - color: white; -} -.navRow > td:first-child { - -} -.navRow.checkedRow > td:first-child { - border-left-color: #d57152; -} -.navbar-item-selected { - color: #FFFFFF !important; - font-weight: bold; - position: relative; - background: #1bb199 !important; -} -.breadcrumbContainer { - align-items: baseline; - display: inline-flex; - justify-content: center; - - -webkit-align-items: baseline; - display: -webkit-inline-flex; - -webkit-justify-content: center; - - margin-right: 0; - overflow: hidden; - visibility: visible; - width: 100%; -} -.breadcrumb { - color: #E6E6E6; - -webkit-flex-grow: 0; - flex-grow: 0; - font: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - overflow: hidden; - text-decoration: none; - text-overflow: ellipsis; -} -a.breadcrumb:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; - cursor: pointer; -} -.breadcrumbSeparator { - color: #E6E6E6; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - font-weight: bold; - -webkit-flex-shrink: 0; - flex-shrink: 0; - margin: 2px; - text-decoration: none; -} -.currentLocation { - padding-top:1px; - font-weight: bold; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - color: #E6E6E6; - text-decoration: none; - line-height: 10pt; - white-space:nowrap; -} -div.currentLocation { - width: 100%; -} -.breadcrumbContainer > .currentLocation { - margin: 0; -} -a.currentLocation:hover { - font-weight: bold; - color: #00AED1; - text-decoration: none; - border-bottom: 1px dotted; -} -a.breadcrumb.currentLocation { - font-weight: bold; - margin: 0; -} -.tooltipContainer .currentLocation { - color: white; -} -.tooltipContainer .breadcrumb { - color: white; -} -.tooltipContainer .breadcrumbSeparator { - color: white; -} -.tooltipContainer a.currentLocation:hover { - color: white; -} -.tooltipContainer a.breadcrumb:hover { - color: white; -} -.auxpane { - border: 0; - background: #3B4B54; - color: white; -} -.mainpane { - border: 0; - background: #3B4B54 !important; - padding-right:20px; -} -.mainToolbar { - color: white; - background: #26343f; - padding-left: 2px; - padding-right: 5px; - white-space: nowrap; -} -.fsToolbar { - padding: 2px 4px 2px 4px; - background-color: #DFE6EB; - - -} -.filesystemName { - display: inline-block; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; - margin-bottom: 8px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - max-width: calc(100% - 6px - 4px - 24px); - max-width: -webkit-calc(100% - 6px - 4px - 24px); - -moz-user-select: -moz-none; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; - color: white; -} -.filesystemSwitcher { - display: inline-block; - margin: 0; -} -.filesystemSwitcherWrapper { - display: block; - max-width: 100%; - white-space: nowrap; -} -.sidebarToolbar { - display: inline; - overflow: visible; - padding: 0 !important; -} -.searchbox { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 4px -297px; - width: 12px; height: 12px; - background-color: #444; - border: 1px solid #222; - font-size: 11px; - width: 15em; - height: 16px; - border-radius: 10px; - color: #999; - padding: 0; - padding-left: 20px; - padding-right: 16px; - margin-left: 5px; - font-size: 7pt; -} -.searchbox:focus{ - color: white; - outline: none; -} - -.orionButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - display: inline-block; - padding: 4px 6px; - border-radius: 1px; - line-height: 12px; - font-size: 9pt; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - margin: 0; -} -.commandButton.orionButton.dropdownTrigger { - -} -.commandButton.orionButton.dropdownTrigger:hover { - border-color: #ccc; -} -.mainToolbar .commandButton.orionButton.dropdownTrigger { - color:white; -} -.commandButton { - color: #00AED1; - border: 1px solid #00AED1; - background-color: rgba(0, 0, 0, 0); - - vertical-align: middle; - -webkit-transition: color 0.2s ease; - transition: color 0.2s ease; -} -.commandButton:not(.dropdownTrigger) { - -} -.extraActions .commandButton { - text-transform: uppercase; -} -.commandButton.dropdownDefaultButton { - -} -.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus { - color: white; - background-color: #a5b5bc; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); -} -.commandButton.disabled { - color: #cdcdcd; -} -.primaryButton{ - background: #1bb199; - border-color: #1bb199; - color: white; -} -.primaryButton:hover, .primaryButton:focus { - background: #01CDB0; - border-color: #01CDB0; -} -.commandImage { - border: 1px solid transparent; - border-radius: 1px; - color: inherit; - background-color: transparent; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - padding: 2px; - padding-top: 0; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandImage:hover, .commandImage:focus { - background-color: #a5b5bc; - border: 1px solid #ccc; -} -.mainToolbar .commandImage.dropdownTrigger { - color: white; -} -.orionToggleOff { - color: inherit; - border-radius: 3px; - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn { - color: inherit; - background-color: whitesmoke; - border-radius: 3px; - box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3); - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn:hover { - background: white; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleOff:hover { - background: whitesmoke; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleAnimate { - -webkit-animation-name: pulse; - animation-name: pulse; -} -@-webkit-keyframes pulse { - 0% { -webkit-transform: scale(1); } - 50% { -webkit-transform: scale(1.3); } - 100% { -webkit-transform: scale(1); } -} -@keyframes pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.3); } - 100% { transform: scale(1); } -} -.orionSwitch { - position: relative; - width: auto; -} -.orionSwitchCheck { - display: none; -} -.orionSwitchLabel { - display: block; - overflow: hidden; - cursor: pointer; - border: 1px solid #DFE6EB; - border-radius: 3px; - height: 20px; -} -.orionSwitchInner { - display: block; - width: 200%; - margin-left: -100%; - margin-top:-1px; - text-align: left; - -moz-transition: margin 0.2s ease-in 0s; - -webkit-transition: margin 0.2s ease-in 0s; - -o-transition: margin 0.2s ease-in 0s; - transition: margin 0.2s ease-in 0s; -} -.orionSwitchInner:before, .orionSwitchInner:after { - display: block; - float: left; - width: 50%; - padding: 0; - padding-bottom: 2px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.orionSwitchInner:before { - padding-left: 3px; - padding-right: 2px; - background-color: #FFF; - color: #808080; -} -.orionSwitchInner:after { - padding-right: 3px; - background-color: #eee; - color: #808080; - text-align: right; -} -.orionSwitchSwitch { - display: block; - width: calc(50% - 2px); - margin: 0; - background: #DFE6EB; - border: 1px solid #DFE6EB; - border-radius: 3px; - position: absolute; - top: 0; - bottom: 0; - right: calc(50% + 2px); - -moz-transition: all 0.2s ease-in 0s; - -webkit-transition: all 0.2s ease-in 0s; - -o-transition: all 0.2s ease-in 0s; - transition: all 0.2s ease-in 0s; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner { - margin-left: 0; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch { - right: 0px; -} -.commandMissingImageButton { - font-weight: normal; -} -.commandLink { - display: inline-block; - vertical-align: middle; - padding: 4px 0 1px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandSeparator { - padding: 2px; -} -.commandActive { - background-color: #e6e6e6 !important; - border: 1px solid #808080 !important; - border-radius: 2px !important; -} -.commandActiveItem { -} -.commandInactiveItem { -} -.split { - background: #3B4B54; -} -.splitTracking { - background: #3B4B54; -} -.splitThumb { - background: #3B4B54; -} -.dropdown { -} -.dropdownArrowDown { - display: inline-block; - vertical-align: top; - line-height: 12px; - text-transform: lowercase; -} -.dropdownArrowRight { - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 12px; -} -.dropdownTrigger:not(.dropdownDefaultButton) { - font-weight: normal; - color: #FFFFFF; - border-color: transparent; -} -.dropdownTrigger a { - text-decoration: none; -} -.dropdownMenu { - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2); - color: #3b4b54; - background-color: white; - border-collapse: separate; - border: 1px solid #bbbbbb; - border-radius: 1px; - visibility: hidden; - z-index: 150; - position: absolute; - list-style-type: none; - display: none; - line-height: normal; - margin: 0; - cursor: default; - font-size: 12px; - margin: 0; - outline: none; - padding: 3px 0 3px; -} -.dropdownMenuOpen { - min-width: 120px; - display: block; - visibility: visible; -} -.dropdownSubMenu { - position: relative; - line-height: normal; -} -.dropdownSubMenu > ul { - top: 0; - left: 100%; -} -.dropdownMenu > li { - min-width: 120px; - display: flex; - display: -webkit-flex; -} -.dropdownMenu > li > a, .dropdownMenu > li > span { - width: calc( 100% - 9px ); - margin: 0; -} -.dropdownMenu > li > *:focus { - outline: none; -} -.dropdownSeparator { - height: 1px; - background-color: #ddd; - color: #ddd; - padding: 0 !important; - margin: 0; -} -.dropdownMenuItem, .dropdownMenuItem a { - align-items: center; - -webkit-align-items: center; - align-content: stretch; - -webkit-align-content: stretch; - display: inline-flex; - display: -webkit-inline-flex; - vertical-align: middle; - color: #3b4b54 !important; - padding: 3px 3px 3px 5px; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - border-left: 4px solid transparent; -} -.dropdownMenu .dropdownMenuItemSelected { - background-color: rgba(27,177,153, 0.1); - border-left-color: #1BB199; -} -.dropdownMenuItem .check { - display: inline-block; - width: 12px; -} -.dropdownMenuItem .dropdownKeyBinding { - color: grey !important; - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 11px; - padding-left: 15px; - padding-right: 10px; -} -.dropdownMenuItem .dropdownCommandName { - -webkit-align-items: center; - align-items: center; - display: inline-flex; - display: -webkit-inline-flex; - - flex-grow: 1; - -webkit-flex-grow: 1; - text-decoration: inherit; -} -.dropdownSelection { - background-color: white !important; - color: #3b4b54 !important; - border: 1px solid #bbbbbb !important; - border-bottom: none !important; - border-bottom-left-radius: 0 !important; - border-bottom-right-radius: 0 !important; - box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important; - margin-bottom: -1px !important; - position: relative !important; - z-index: 200 !important; -} -.checkedMenuItem { - margin: 4px 6px 2px 0; - vertical-align: bottom; -} -.tooltipContainer { - display: none; - z-index: 200; - background: transparent; - position: absolute; - max-width: 110em; -} -.tooltip .textContent { - max-width: 40em; -} -.tooltip { - color: white; - background-color: #158d7a; - border-radius: 3px; - padding: 8px; - clear: both; - float: left; - border: 1px solid #158d7a; - box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5); -} -.tooltip.left { -} -.tooltip .navlinkonpage { - color: #00aed1 !important; -} -.tooltip h2 { - color: #3b4b54; -} -.tooltip .operationStatus { - color: #00aed1; -} -.tooltip .operationError { - color: #a6b5bc; -} -.tooltipTailFromleft { - position: absolute; - display: inline-block; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromleft:after, .tooltipTailFromleft:before { - left: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromleft:after { - border-color: transparent; - border-left-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromleft:before { - border-color: transparent; - border-left-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromleft { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent transparent transparent #158d7a; - top: 2px; - right: -17px; - content: ''; -} -.tooltipTailFromright { - position: absolute; - display: inline-block; - left: 0; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromright:after, .tooltipTailFromright:before { - right: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromright:after { - border-color: transparent; - border-right-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromright:before { - border-color: transparent; - border-right-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromright { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent #158d7a transparent transparent; - left: -17px; - top: 2px; - content: ''; -} -.tooltipTailFrombelow { - position: absolute; - display: block; - left: 16px; - top: 0; - content: ''; - z-index: 201; -} -.tooltipTailFrombelow:after, .tooltipTailFrombelow:before { - bottom: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFrombelow:after { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFrombelow:before { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFrombelow { - position: absolute; - display: block; - border: 10px solid; - border-color: transparent transparent #158d7a transparent; - left: 14px; - top: -17px; - content: ''; -} -.tooltipTailFromabove { - position: absolute; - display: block; - left: 16px; - content: ''; - bottom: 0; - z-index: 201; -} -.tooltipTailFromabove:after, .tooltipTailFromabove:before { - top: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromabove:after { - border-color: transparent; - border-top-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFromabove:before { - border-color: transparent; - border-top-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFromabove { - position: absolute; - display: block; - border: 10px solid; - border-color: #158d7a transparent transparent transparent; - left: 14px; - bottom: -17px; - content: ''; -} -.tooltipShowing { - display: block; -} -.tooltip > .parametersDismiss > .dismissButton { - color: whitesmoke; -} -.tooltip > .parametersDismiss > .dismissButton:hover { - color: white; -} -.dialog { - visibility: hidden; - z-index: 175; - position: absolute; - background-color: #fbfbfb; - border-radius: 2px; - border: 1px solid #BBB; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - padding-bottom:5px; -} -.dialogShowing { - visibility: visible; -} -.dialogTitle { - display: block; -} -.dialogTitle { - padding-top: 5px; - display: inline-block; - background: #555; - width: 100%; - padding-bottom: 5px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; -} -.dialogTitle > .dismissButton { - margin-right: 0; -} -.dialogTitleText { - margin: 2px 2px 0; - color: whitesmoke; - font-size: 1em; - height: 18px; - padding-left: 4px; - font-weight: bold; -} -.dialogDismiss { - display: block; - cursor: pointer; - padding: 2px; -} -.dialogContent { - padding: 8px; -} -.parameterPopup .dismissButton, .dialogTitle .dismissButton { - color: rgb(221, 221, 221); - cursor: pointer; -} -.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover { - color: white; -} -.dialogButtons { - -webkit-align-items: center; - align-items: center; - - display: -webkit-flex; - display: flex; - - -webkit-justify-content: center; - justify-content: center; - margin: 2px 4px 4px 4px; -} -.dialogButtons > button.commandButton { - min-width: 60px; -} -.confirmDialog { - min-width: 300px; - max-width: 450px; -} -.confirmDialog .checkboxWrapper { - margin: 10px 2px 5px 2px; -} -.checkboxMessage > .confirmDialogCheckbox { - margin: 0 5px 0 0; - outline: none; - vertical-align: top; -} -.modalBackdrop { - opacity: 0.5; - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; -} -.textviewTooltip { - background-color: #158d7a; -} -.textviewTooltip .commandButton { - border-color: white; - color: white; - margin-bottom: 2px; -} -.core-sprite-git-logo { - font-size: 20px !important; -} -.outlineExplorer .navlinkonpage { - color: #333 !important; -} -.outlineExplorer .treeIterationCursorRow_Dotted { - background-color: #1BB199; -} -.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite { - color: white; -} -.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage { - color: white !important; -} -.contentassist .selected { - background-color: #1BB199 !important; - background: #1BB199 !important; - border-radius: 0; - color: #FFF; -} -.titleActionContainer, -.statusContainer, -.workingTarget { - color: white; - background: #3B4B54; -} - -@font-face { - font-family: 'Orion Icon Font'; - src: url('built-compare-12.0/OrionIconFont-Regular.eot'); - src: url('built-compare-12.0/OrionIconFont-Regular.eot?#iefix') format('embedded-opentype'), - url('built-compare-12.0/OrionIconFont-Regular.woff') format('woff'), - url('built-compare-12.0/OrionIconFont-Regular.ttf') format('truetype'), - url('built-compare-12.0/OrionIconFont-Regular.svg#04b530a8db6e0f4a0fdb83697b7ace5f') format('svg'); - - font-style: normal; - font-weight: 400; -} diff --git a/plugins/plugin-orion/che-plugin-orion-editor/pom.xml b/plugins/plugin-orion/che-plugin-orion-editor/pom.xml index 64487fa5afd..59dfbdb5594 100644 --- a/plugins/plugin-orion/che-plugin-orion-editor/pom.xml +++ b/plugins/plugin-orion/che-plugin-orion-editor/pom.xml @@ -107,64 +107,5 @@ target/requirejs-${requirejs.upstream.version} - - - - org.apache.maven.plugins - maven-patch-plugin - 1.1.1 - - - bugfix-patches - compile - - apply - - - ${patches.location} - - fix_linked_mode.diff - fix_goto_line.diff - fix_scrolling.diff - fix_focus.diff - - false - true - 1 - ${project.build.directory}/classes - - - - - - org.codehaus.mojo - wagon-maven-plugin - 1.0-beta-4 - - - generate-resources - - download-single - - - ${requirejs.upstream.url} - require.js - ${project.build.directory}/requirejs-${requirejs.upstream.version}/org/eclipse/che/ide/editor/orion/public/require.js - - - - - - com.mycila - license-maven-plugin - - - - **/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/** - **/org/eclipse/che/ide/editor/orion/public/cheJavaHighlightingPlugin/lib/plugin.js - - - - diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_focus.diff b/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_focus.diff deleted file mode 100644 index 3c962f4bbc2..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_focus.diff +++ /dev/null @@ -1,15 +0,0 @@ -This patch fixes bug related to setting active EditorView on switching between different tabs. -=================================================================== -diff --git a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js ---- a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -+++ b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -@@ -43282,6 +43282,9 @@ - domNode.addEventListener("mousedown", function() { //$NON-NLS-0$ - this.setActiveEditorView(this.editorView); - }.bind(this), true); -+ domNode.addEventListener("focus", function() { //$NON-NLS-0$ -+ this.setActiveEditorView(this.editorView); -+ }.bind(this), true); - domNode.addEventListener("keyup", function() { //$NON-NLS-0$ - this.setActiveEditorView(this.editorView); - }.bind(this), true); diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_goto_line.diff b/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_goto_line.diff deleted file mode 100644 index ca97648b838..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_goto_line.diff +++ /dev/null @@ -1,55 +0,0 @@ -This patch replaces using browser's native prompt dialog by Che's dialog. -=================================================================== -diff --git a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js ---- a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -+++ b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -@@ -13126,16 +13126,40 @@ - var model = editor.getModel(); - if (data.parameters && data.parameters.valueFor('line')) { //$NON-NLS-0$ - line = data.parameters.valueFor('line'); //$NON-NLS-0$ -- } else { -+ if (!line) return; -+ editor.onGotoLine(line - 1, 0); -+ return; -+ } -+ -- line = model.getLineAtOffset(editor.getCaretOffset()); -+ line = model.getLineAtOffset(editor.getCaretOffset()); -- line = prompt(messages.gotoLinePrompt, line + 1); -- if (line) { -- line = parseInt(line, 10); -+ -+ // try to use promptIDE(title, text, defaultValue, callback) function -+ if (window["promptIDE"]) { -+ window["promptIDE"](messages.gotoLineTooltip, messages.gotoLinePrompt, line + 1, -+ function(value) { -+ if (!value) return; -+ if (value.indexOf(":") > 0) { -+ var values = value.split(":"); -+ if (!values[0] || !values[1]) return; -+ values[0] = parseInt(values[0], 10); -+ values[1] = parseInt(values[1], 10); -+ if (!values[0] || !values[1]) return; -+ editor.onGotoLine(values[0] - 1, values[1] - 1, values[1] - 1); -+ } else { -+ value = parseInt(value, 10); -+ if (!value) return; -+ editor.onGotoLine(value - 1, 0); -- } -+ } -+ }); -+ return; - } -- if (line) { -+ -+ // use browser based -+ line = prompt(messages.gotoLinePrompt, line + 1); -+ if (!line) return; -+ line = parseInt(line, 10); -+ if (!line) return; -- editor.onGotoLine(line - 1, 0); -+ editor.onGotoLine(line - 1, 0); -- } - } - }); - this.commandService.addCommand(gotoLineCommand); diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_linked_mode.diff b/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_linked_mode.diff deleted file mode 100644 index ccd36a4ecc6..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_linked_mode.diff +++ /dev/null @@ -1,70 +0,0 @@ -This patch fixes bug related to linked mode. -=================================================================== -diff --git a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js ---- a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -+++ b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -@@ -32269,8 +32269,9 @@ - 'orion/editor/keyModes', - 'orion/editor/annotations', - 'orion/objects', -+ 'orion/editor/eventTarget', - 'orion/util' --], function(messages, mKeyBinding, mKeyModes, mAnnotations, objects) { -+], function(messages, mKeyBinding, mKeyModes, mAnnotations, objects, mEventTarget) { - - var exports = {}; - -@@ -32354,11 +32355,11 @@ - this.linkedModeModel = null; - - textView.setAction("linkedModeEnter", function() { //$NON-NLS-0$ -- this.exitLinkedMode(true); -+ this.exitLinkedMode(true, true); - return true; - }.bind(this)); - textView.setAction("linkedModeCancel", function() { //$NON-NLS-0$ -- this.exitLinkedMode(true); -+ this.exitLinkedMode(false, false); - return true; - }.bind(this)); - textView.setAction("linkedModeNextGroup", function() { //$NON-NLS-0$ -@@ -32396,7 +32397,7 @@ - changed = positionChanged.position; - if (changed === undefined || changed.model !== model) { - // The change has been done outside of the positions, exit the Linked Mode -- this.exitLinkedMode(false); -+ this.exitLinkedMode(false, false); - model = this.linkedModeModel; - } else { - break; -@@ -32441,7 +32442,7 @@ - changed = positionChanged.position; - if (changed === undefined || changed.model !== model) { - // The change has been done outside of the positions, exit the Linked Mode -- this.exitLinkedMode(false); -+ this.exitLinkedMode(false, false); - model = this.linkedModeModel; - } else { - break; -@@ -32573,10 +32574,11 @@ - * Exits Linked Mode. Optionally places the caret at linkedMode escapePosition. - * @param {Boolean} [escapePosition=false] if true, place the caret at the escape position. - */ -- exitLinkedMode: function(escapePosition) { -+ exitLinkedMode: function(escapePosition, successful) { - if (!this.isActive()) { - return; - } -+ this.dispatchEvent({type:"LinkedModeExit", isSuccessful: successful}); - if (this._compoundChange) { - this.endUndo(); - this._compoundChange = null; -@@ -32822,6 +32824,7 @@ - annotationModel.replaceAnnotations(remove, add); - } - }); -+ mEventTarget.EventTarget.addMixin(LinkedMode.prototype); - exports.LinkedMode = LinkedMode; - - return exports; -\ No newline at end of file diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_scrolling.diff b/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_scrolling.diff deleted file mode 100644 index a982e8259dc..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/patches/fix_scrolling.diff +++ /dev/null @@ -1,13 +0,0 @@ -This patch reduces amount of scrolling lines. -=================================================================== -diff --git a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js ---- a/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -+++ b/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js -@@ -22588,6 +22588,7 @@ - }, - _handleMouseWheel: function (e) { - if (this._noScroll) return; -+ if(e.defaultPrevented) return; - var lineHeight = this._getLineHeight(); - var pixelX = 0, pixelY = 0; - // Note: On the Mac the correct behaviour is to scroll by pixel. diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js deleted file mode 100644 index 8a4f6eee8a5..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit-amd.js +++ /dev/null @@ -1,43964 +0,0 @@ -/** - * @license RequireJS i18n 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/i18n for details - */ -/*jslint regexp: true */ -/*global require: false, navigator: false, define: false */ - -/** - * This plugin handles i18n! prefixed modules. It does the following: - * - * 1) A regular module can have a dependency on an i18n bundle, but the regular - * module does not want to specify what locale to load. So it just specifies - * the top-level bundle, like "i18n!nls/colors". - * - * This plugin will load the i18n bundle at nls/colors, see that it is a root/master - * bundle since it does not have a locale in its name. It will then try to find - * the best match locale available in that master bundle, then request all the - * locale pieces for that best match locale. For instance, if the locale is "en-us", - * then the plugin will ask for the "en-us", "en" and "root" bundles to be loaded - * (but only if they are specified on the master bundle). - * - * Once all the bundles for the locale pieces load, then it mixes in all those - * locale pieces into each other, then finally sets the context.defined value - * for the nls/colors bundle to be that mixed in locale. - * - * 2) A regular module specifies a specific locale to load. For instance, - * i18n!nls/fr-fr/colors. In this case, the plugin needs to load the master bundle - * first, at nls/colors, then figure out what the best match locale is for fr-fr, - * since maybe only fr or just root is defined for that locale. Once that best - * fit is found, all of its locale pieces need to have their bundles loaded. - * - * Once all the bundles for the locale pieces load, then it mixes in all those - * locale pieces into each other, then finally sets the context.defined value - * for the nls/fr-fr/colors bundle to be that mixed in locale. - */ -(function () { - 'use strict'; - - //regexp for reconstructing the master bundle name from parts of the regexp match - //nlsRegExp.exec("foo/bar/baz/nls/en-ca/foo") gives: - //["foo/bar/baz/nls/en-ca/foo", "foo/bar/baz/nls/", "/", "/", "en-ca", "foo"] - //nlsRegExp.exec("foo/bar/baz/nls/foo") gives: - //["foo/bar/baz/nls/foo", "foo/bar/baz/nls/", "/", "/", "foo", ""] - //so, if match[5] is blank, it means this is the top bundle definition. - var nlsRegExp = /(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/; - - //Helper function to avoid repeating code. Lots of arguments in the - //desire to stay functional and support RequireJS contexts without having - //to know about the RequireJS contexts. - function addPart(locale, master, needed, toLoad, prefix, suffix) { - if (master[locale]) { - needed.push(locale); - if (master[locale] === true || master[locale] === 1) { - toLoad.push(prefix + locale + '/' + suffix); - } - } - } - - function addIfExists(req, locale, toLoad, prefix, suffix) { - var fullName = prefix + locale + '/' + suffix; - if (require._fileExists(req.toUrl(fullName + '.js'))) { - toLoad.push(fullName); - } - } - - /** - * Simple function to mix in properties from source into target, - * but only if target does not already have a property of the same name. - * This is not robust in IE for transferring methods that match - * Object.prototype names, but the uses of mixin here seem unlikely to - * trigger a problem related to that. - */ - function mixin(target, source, force) { - var prop; - for (prop in source) { - if (source.hasOwnProperty(prop) && (!target.hasOwnProperty(prop) || force)) { - target[prop] = source[prop]; - } else if (typeof source[prop] === 'object') { - if (!target[prop] && source[prop]) { - target[prop] = {}; - } - mixin(target[prop], source[prop], force); - } - } - } - - define('i18n',['module'], function (module) { - var masterConfig = module.config ? module.config() : {}; - masterConfig = masterConfig || {}; - - return { - version: '2.0.4', - /** - * Called when a dependency needs to be loaded. - */ - load: function (name, req, onLoad, config) { - config = config || {}; - - if (config.locale) { - masterConfig.locale = config.locale; - } - - var masterName, - match = nlsRegExp.exec(name), - prefix = match[1], - locale = match[4], - suffix = match[5], - parts = locale.split("-"), - toLoad = [], - value = {}, - i, part, current = ""; - - //If match[5] is blank, it means this is the top bundle definition, - //so it does not have to be handled. Locale-specific requests - //will have a match[4] value but no match[5] - if (match[5]) { - //locale-specific bundle - prefix = match[1]; - masterName = prefix + suffix; - } else { - //Top-level bundle. - masterName = name; - suffix = match[4]; - locale = masterConfig.locale; - if (!locale) { - locale = masterConfig.locale = - typeof navigator === "undefined" ? "root" : - (navigator.language || - navigator.userLanguage || "root").toLowerCase(); - } - parts = locale.split("-"); - } - - if (config.isBuild) { - //Check for existence of all locale possible files and - //require them if exist. - toLoad.push(masterName); - addIfExists(req, "root", toLoad, prefix, suffix); - for (i = 0; i < parts.length; i++) { - part = parts[i]; - current += (current ? "-" : "") + part; - addIfExists(req, current, toLoad, prefix, suffix); - } - - if(config.locales) { - var j, k; - for (j = 0; j < config.locales.length; j++) { - locale = config.locales[j]; - parts = locale.split("-"); - current = ""; - for (k = 0; k < parts.length; k++) { - part = parts[k]; - current += (current ? "-" : "") + part; - addIfExists(req, current, toLoad, prefix, suffix); - } - } - } - - req(toLoad, function () { - onLoad(); - }); - } else { - //First, fetch the master bundle, it knows what locales are available. - req([masterName], function (master) { - //Figure out the best fit - var needed = [], - part; - - //Always allow for root, then do the rest of the locale parts. - addPart("root", master, needed, toLoad, prefix, suffix); - for (i = 0; i < parts.length; i++) { - part = parts[i]; - current += (current ? "-" : "") + part; - addPart(current, master, needed, toLoad, prefix, suffix); - } - - //Load all the parts missing. - req(toLoad, function () { - var i, partBundle, part; - for (i = needed.length - 1; i > -1 && needed[i]; i--) { - part = needed[i]; - partBundle = master[part]; - if (partBundle === true || partBundle === 1) { - partBundle = req(prefix + part + '/' + suffix); - } - mixin(value, partBundle); - } - - //All done, notify the loader. - onLoad(value); - }); - }); - } - } - }; - }); -}()); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/nls/messages',{ - root:true -}); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/nls/root/messages',{//Default message bundle - "Navigator": "Navigator", - "Sites": "Sites", - "Shell": "Shell", - "Get Plugins": "Get Plug-ins", - "Global": "Global", - "Editor": "Editor", - "EditorRelatedLink": "Show Current Folder", - "EditorRelatedLinkParent": "Show Enclosing Folder", - "EditorLinkWorkspace": "Edit", - "EditorRelatedLinkProj": "Show Project", - "sidebar": "Sidebar", - "Filter bindings": "Filter bindings", - "BindingPrompt": "Enter the new binding", - "NoBinding": "---", - "orionClientLabel": "Orion client repository", - "Orion Editor": "Text Editor", - "Orion Image Viewer": "Image Viewer", - "Orion Markdown Editor": "Markdown Editor", - "Orion Markdown Viewer": "Markdown Viewer", - "Orion JSON Editor": "JSON Editor", - "View on Site": "View on Site", - "View this file or folder on a web site hosted by Orion": "View this file or folder on a web site hosted by Orion.", - "ShowAllKeyBindings": "Show a list of all the keybindings on this page", - "Show Keys": "Show Keys", - "HideShowBannerFooter": "Hide or show the page banner", - "Toggle banner and footer": "Toggle banner", - "ChooseFileOpenEditor": "Choose a file by name and open an editor on it", - "FindFile": "Open File...", - "System Configuration Details": "System Configuration Details", - "System Config Tooltip": "Go to the System Configuration Details page", - "Background Operations": "Background Operations", - "Background Operations Tooltip": "Go to the Background Operations page", - "Operation status is unknown": "Operation status is unknown", - "Unknown item": "Unknown item", - "NoSearchAvailableErr": "Can't search: no search service is available", - "Related": "Related", - "Options": "Options", - "LOG: ": "LOG: ", - "View": "View", - "SplashTitle": "Setting up Workspace", - "SplashTitleSettings": "Loading Settings", - "SplashTitleGit": "Loading Git Repositories", - "LoadingPage": "Loading Page", - "LoadingPlugins": "Loading Plugins", - "LoadingResources": "Loading Resources", - "plugin_started": "\"${0}\" started", - "plugin_lazy activation": "\"${0}\" lazily activated", - "plugin_starting": "\"${0}\" starting", - "no parent": "no parent", - "no tree model": "no tree model", - "no renderer": "no renderer", - "could not find table row ": "could not find table row ", - "Operations": "Operations", - "Operations running": "Operations running", - "SomeOpWarning": "Some operations finished with warning", - "SomeOpErr": "Some operations finished with error", - "no service registry": "no service registry", - "Tasks": "Tasks", - "Close": "Close", - "Expand all": "Expand all", - "Collapse all": "Collapse all", - "Search" : "Search", - "Advanced search" : "Advanced search", - "Submit" : "Submit", - "More" : "More", - "Recent searches" : "Recent searches", - "Regular expression" : "Regular expression", - "Search options" : "Search options", - "Global search" : "Global search", - "Orion Home" : "Home", - "Close notification" : "Close notification", - "OpPressSpaceMsg" : "Operations - Press spacebar to show current operations", - "Toggle side panel" : "Toggle side panel", - "Open or close the side panel": "Open or close the side panel", - "Projects" : "Projects", - "Toggle Sidebar" : "Toggle Sidebar", - "Sample HTML5 Site": "Sample HTML5 Site", - "Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.": "Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.", - "Sample Orion Plugin": "Sample Orion Plug-in", - "Generate a sample plugin for integrating with Orion.": "Generate a sample plug-in for integrating with Orion.", - "Browser": "Web Browser", - "OutlineProgress": "Getting outline for ${0} from ${1}", - "outlineTimeout": "Outline service timed out. Try reloading the page and opening the outline again.", - "UnknownError": "An unknown error occurred.", - "Filter": "Filter (* = any string, ? = any character)", - "TemplateExplorerLabel": "Templates", - "OpenTemplateExplorer": "Open Template Explorer", - "Edit": "Edit", - "CentralNavTooltip": "Toggle Navigation Menu", - "Wrote: ${0}": "Wrote: ${0}", - "GenerateHTML": "Generate HTML file", - "GenerateHTMLTooltip": "Write an HTML file generated from the current Markdown editor content", - "alt text": "alt text", - "blockquote": "blockquote", - "code": "code", - "code (block)": "code (block)", - "code (span)": "code (span)", - "emphasis": "emphasis", - "fenced code (${0})": "fenced code (${0})", - "header (${0})": "header (${0})", - "horizontal rule": "horizontal rule", - "label": "label", - "link (auto)": "link (auto)", - "link (image)": "link (image)", - "link (inline)": "link (inline)", - "link label": "link label", - "link label (optional)": "link label (optional)", - "link (ref)": "link (ref)", - "list item (bullet)": "list item (bullet)", - "list item (numbered)": "list item (numbered)", - "strikethrough (${0})": "strikethrough (${0})", - "strong": "strong", - "table (${0})": "table (${0})", - "text": "text", - "title (optional)": "title (optional)", - "url": "url", - "workedProgress": "${0} (${1}/${2})", - "TogglePaneOrientationTooltip": "Toggle split pane orientation", - "WarningDuplicateLinkId": "Duplicate link ID: ${0} (link IDs are not case-sensitive)", - "WarningHeaderTooDeep": "Header level cannot exceed 6", - "WarningLinkHasNoText": "Link has no text", - "WarningLinkHasNoURL": "Link has no URL", - "WarningOrderedListItem": "Ordered list item within unordered list", - "WarningOrderedListShouldStartAt1": "The first item in an ordered list should have index 1", - "WarningUndefinedLinkId": "Undefined link ID: ${0}", - "WarningUnorderedListItem": "Unordered list item within ordered list", - "PageTitleFormat": "${0} - ${1}", // ${0} is the file or resource being edited; ${1} is the task (eg. "Editor") - // Display names for keys: - "KeyCTRL": "Ctrl", - "KeySHIFT": "Shift", - "KeyALT": "Alt", - "KeyBKSPC": "Backspace", - "KeyDEL": "Del", - "KeyEND": "End", - "KeyENTER": "Enter", - "KeyESCAPE": "Esc", - "KeyHOME": "Home", - "KeyINSERT": "Ins", - "KeyPAGEDOWN": "Page Down", - "KeyPAGEUP": "Page Up", - "KeySPACE": "Space", - "KeyTAB": "Tab", - // Display elapsed time: - "a year": "a year", - "years": "${0} years", - "a month": "a month", - "months": "${0} months", - "a day": "a day", - "days": "${0} days", - "an hour": "an hour", - "hours": "${0} hours", - "a minute": "a minute", - "minutes": "${0} minutes", - "timeAgo": "${0} ago", //${0} represent the time elapsed - "justNow": "just now", //Represent that the time elapsed is less than 1 minute - "fixAll": "Fix all" -}); - - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/util',[],function() { - - var userAgent = navigator.userAgent; - var isIE = (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident") !== -1) ? document.documentMode : undefined; //$NON-NLS-1$ //$NON-NLS-0$ - var isFirefox = parseFloat(userAgent.split("Firefox/")[1] || userAgent.split("Minefield/")[1]) || undefined; //$NON-NLS-1$ //$NON-NLS-0$ - var isOpera = userAgent.indexOf("Opera") !== -1 ? parseFloat(userAgent.split("Version/")[1]) : undefined; //$NON-NLS-0$ - var isChrome = parseFloat(userAgent.split("Chrome/")[1]) || undefined; //$NON-NLS-0$ - var isSafari = userAgent.indexOf("Safari") !== -1 && !isChrome; //$NON-NLS-0$ - var isWebkit = parseFloat(userAgent.split("WebKit/")[1]) || undefined; //$NON-NLS-0$ - var isAndroid = userAgent.indexOf("Android") !== -1; //$NON-NLS-0$ - var isIPad = userAgent.indexOf("iPad") !== -1; //$NON-NLS-0$ - var isIPhone = userAgent.indexOf("iPhone") !== -1; //$NON-NLS-0$ - var isIOS = isIPad || isIPhone; - var isElectron = userAgent.indexOf("Electron") !== -1; //$NON-NLS-0$ - var isMac = navigator.platform.indexOf("Mac") !== -1; //$NON-NLS-0$ - var isWindows = navigator.platform.indexOf("Win") !== -1; //$NON-NLS-0$ - var isLinux = navigator.platform.indexOf("Linux") !== -1; //$NON-NLS-0$ - var isTouch = typeof document !== "undefined" && "ontouchstart" in document.createElement("input"); //$NON-NLS-1$ //$NON-NLS-0$ - - var platformDelimiter = isWindows ? "\r\n" : "\n"; //$NON-NLS-1$ //$NON-NLS-0$ - - function formatMessage(msg) { - var args = arguments; - return msg.replace(/\$\{([^\}]+)\}/g, function(str, index) { return args[(index << 0) + 1]; }); - } - - var XHTML = "http://www.w3.org/1999/xhtml"; //$NON-NLS-0$ - function createElement(document, tagName) { - if (document.createElementNS) { - return document.createElementNS(XHTML, tagName); - } - return document.createElement(tagName); - } - function confineDialogTab(firstElement, lastElement) { - lastElement.addEventListener("keydown", function(evt) { - if(evt.keyCode === 9 && !evt.shiftKey) { - evt.preventDefault(); - firstElement.focus(); - } - }); - firstElement.addEventListener("keydown", function(evt) { - if(evt.keyCode === 9 && evt.shiftKey) { - evt.preventDefault(); - lastElement.focus(); - } - }); - } - - return { - formatMessage: formatMessage, - - createElement: createElement, - confineDialogTab: confineDialogTab, - - /** Browsers */ - isIE: isIE, - isFirefox: isFirefox, - isOpera: isOpera, - isChrome: isChrome, - isSafari: isSafari, - isWebkit: isWebkit, - isAndroid: isAndroid, - isIPad: isIPad, - isIPhone: isIPhone, - isIOS: isIOS, - isElectron: isElectron, - - /** OSs */ - isMac: isMac, - isWindows: isWindows, - isLinux: isLinux, - - /** Capabilities */ - isTouch: isTouch, - - platformDelimiter: platformDelimiter - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/webui/littlelib',["orion/util"], function(util) { - /** - * @name orion.webui.littlelib - * @class A small library of DOM and UI helpers. - */ - - /** - * Alias for node.querySelector(). - * @name orion.webui.littlelib.$ - * @function - * @static - * @param {String} selectors Selectors to match on. - * @param {Node} [node=document] Node to query under. - * @returns {Element} - */ - function $(selector, node) { - if (!node) { - node = document; - } - return node.querySelector(selector); - } - - /** - * Alias for node.querySelectorAll(). - * @name orion.webui.littlelib.$$ - * @function - * @static - * @param {String} selectors Selectors to match on. - * @param {Node} [node=document] Node to query under. - * @returns {NodeList} - */ - function $$(selector, node) { - if (!node) { - node = document; - } - return node.querySelectorAll(selector); - } - - /** - * Identical to {@link orion.webui.littlelib.$$}, but returns an Array instead of a NodeList. - * @name orion.webui.littlelib.$$array - * @function - * @static - * @param {String} selectors Selectors to match on. - * @param {Node} [node=document] Node to query under. - * @returns {Element[]} - */ - function $$array(selector, node) { - return Array.prototype.slice.call($$(selector,node)); - } - - /** - * Alias for document.getElementById, but returns the input unmodified when passed a Node (or other non-string). - * @function - * @param {String|Element} elementOrId - * @returns {Element} - */ - function node(either) { - var theNode = either; - if (typeof(either) === "string") { //$NON-NLS-0$ - theNode = document.getElementById(either); - } - return theNode; - } - - /** - * Returns whether child is a descendant of parent in the DOM order. - * @function - * @param {Node} parent - * @param {Node} child - * @returns {Boolean} - */ - function contains(parent, child) { - if (!parent || !child) { return false; } - if (parent === child) { return true; } - var compare = parent.compareDocumentPosition(child); // useful to break out for debugging - return Boolean(compare & 16); - } - - /** - * Returns the bounds of a node. The returned coordinates are absolute (not relative to the viewport). - * @function - * @param {Node} node - * @returns {Object} - */ - function bounds(node) { - var clientRect = node.getBoundingClientRect(); - var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); - var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); - return { - left: clientRect.left + scrollLeft, - top: clientRect.top + scrollTop, - width: clientRect.width, - height: clientRect.height - }; - } - - /** - * Removes all children of the given node. - * @name orion.webui.littlelib.empty - * @function - * @static - * @param {Node} node - */ - function empty(node) { - while (node.hasChildNodes()) { - var child = node.firstChild; - node.removeChild(child); - } - } - - function _getTabIndex(node) { - var result = node.tabIndex; - if (result === 0 && util.isIE) { - /* - * The default value of tabIndex is 0 on IE, even for elements that are not focusable - * by default (http://msdn.microsoft.com/en-us/library/ie/ms534654(v=vs.85).aspx). - * Handle this browser difference by treating this value as -1 if the node is a type - * that is not focusable by default according to the MS doc and has not had this - * attribute value explicitly set on it. - */ - var focusableElements = { - a: true, - body: true, - button: true, - frame: true, - iframe: true, - img: true, - input: true, - isindex: true, - object: true, - select: true, - textarea: true - }; - if (!focusableElements[node.nodeName.toLowerCase()] && !node.attributes.tabIndex) { - result = -1; - } - } - return result; - } - - /* - * Inspired by http://brianwhitmer.blogspot.com/2009/05/jquery-ui-tabbable-what.html - */ - function firstTabbable(node) { - if (_getTabIndex(node) >= 0) { - return node; - } - if (node.hasChildNodes()) { - for (var i=0; i= 0) { - return node; - } - if (node.hasChildNodes()) { - for (var i=node.childNodes.length - 1; i>=0; i--) { - var result = lastTabbable(node.childNodes[i]); - if (result) { - return result; - } - } - } - return null; - } - - var variableRegEx = /\$\{([^\}]+)\}/; - // Internal helper - function processNodes(node, replace) { - if (node.nodeType === 3) { // TEXT_NODE - var matches = variableRegEx.exec(node.nodeValue); - if (matches && matches.length > 1) { - replace(node, matches); - } - } - if (node.hasChildNodes()) { - for (var i=0; i 2 && value.indexOf("px", value.length - 2) !== -1) { - value = value.slice(0,-2); - var intVal = parseInt(value,10); - if (intVal !== intVal) { - return 0; // value was NaN - } else { - return intVal; - } - } - } - return 0; - } - - /** - * Performs substitution of strings into textContent within the given node and its descendants. An occurrence of ${n} - * in text content will be replaced with the string messages[n]. - *

    This function is recommended for binding placeholder text in template-created DOM elements to actual display strings.

    - * @name orion.webui.littlelib.processTextNodes - * @function - * @param {Node} node The node to perform replacement under. - * @param {String[]} messages The replacement strings. - */ - function processTextNodes(node, messages) { - processNodes(node, function(targetNode, matches) { - var replaceText = messages[matches[1]] || matches[1]; - targetNode.parentNode.replaceChild(document.createTextNode(replaceText), targetNode); - }); - } - - /** - * Performs substitution of DOM nodes into textContent within the given node and its descendants. An occurrence of ${n} - * in text content will be replaced by the DOM node replaceNodes[n]. - *

    This function is recommended for performing rich-text replacement within a localized string. The use of actual DOM nodes - * avoids the need for embedded HTML in strings.

    - * @name orion.webui.littlelib.processDOMNodes - * @function - * @param {Node} node The node to perform replacement under. - * @param {Node[]} replaceNodes The replacement nodes. - */ - function processDOMNodes(node, replaceNodes) { - processNodes(node, function(targetNode, matches) { - var replaceNode = replaceNodes[matches[1]]; - if (replaceNode) { - var range = document.createRange(); - var start = matches.index; - range.setStart(targetNode, start); - range.setEnd(targetNode, start + matches[0].length); - range.deleteContents(); - range.insertNode(replaceNode); - } - }); - } - - /** - * Adds auto-dismiss functionality to the document. When a click event occurs whose target is not a descendant of - * one of the excludeNodes, the dismissFunction is invoked. - * @name orion.webui.littlelib.addAutoDismiss - * @function - * @static - * @param {Node[]} excludeNodes Clicks targeting any descendant of these nodes will not trigger the dismissFunction. - * @param {Function} dismissFunction The dismiss handler. - */ - - var autoDismissNodes = null; - - function addAutoDismiss(excludeNodes, dismissFunction) { - // auto dismissal. Click anywhere else means close. - function onclick(event) { - autoDismissNodes.forEach(function(autoDismissNode) { - var excludeNodeInDocument = false; - var excluded = autoDismissNode.excludeNodes.some(function(excludeNode) { - if(document.body.contains(excludeNode)) { - excludeNodeInDocument = true; - return excludeNode.contains(event.target); - } - return false; - }); - if (excludeNodeInDocument && !excluded) { - try { - autoDismissNode.dismiss(event); - } catch (e) { - if (typeof console !== "undefined" && console) { //$NON-NLS-0$ - console.error(e && e.message); - } - } - } - }); - autoDismissNodes = autoDismissNodes.filter(function(autoDismissNode) { - // true if at least one excludeNode is in document.body - return autoDismissNode.excludeNodes.some(function(excludeNode) { - return document.body.contains(excludeNode); - }); - }); - } - - // Hook listener only once - if (autoDismissNodes === null) { - autoDismissNodes = []; - document.addEventListener("click", onclick, true); //$NON-NLS-0$ - if (util.isIOS) { - document.addEventListener("touchend", function(event){ - function unhook(){ - event.target.removeEventListener("click", unhook); - } - if (event.touches.length === 0) { - // we need a click eventlistener on the target to have ios really trigger a click - event.target.addEventListener("click", unhook); - } - }, false); - } - } - - autoDismissNodes.push({excludeNodes: excludeNodes, dismiss: dismissFunction}); - } - - /** - * Removes all auto-dismiss nodes which trigger the specified dismiss function. - * - * @name orion.webui.littlelib.removeAutoDismiss - * @function - * @static - * @param {Function} dismissFunction The dismiss function to look for. - */ - function removeAutoDismiss(dismissFunction) { - autoDismissNodes = autoDismissNodes.filter(function(autoDismissNode) { - return dismissFunction !== autoDismissNode.dismiss; - }); - } - - /** - * Returns the parent of the node that has the vertical scroll bar. - * - * @name orion.webui.littlelib.getOffsetParent - * @function - * @static - * @param {Element} node The node to lookup the offset parent - */ - function getOffsetParent(node) { - var offsetParent = node.parentNode, documentElement = document.documentElement; - while (offsetParent && offsetParent !== documentElement) { - var style = window.getComputedStyle(offsetParent, null); - if (!style) { break; } - var overflow = style.getPropertyValue("overflow-y"); //$NON-NLS-0$ - if (overflow === "auto" || overflow === "scroll") { break; } //$NON-NLS-1$ //$NON-NLS-0$ - offsetParent = offsetParent.parentNode; - } - return offsetParent; - } - - /** - * Cancels the default behavior of an event and stops its propagation. - * @name orion.webui.littlelib.stop - * @function - * @static - * @param {Event} event - */ - function stop(event) { - if (window.document.all) { - event.keyCode = 0; - } - if (event.preventDefault) { - event.preventDefault(); - event.stopPropagation(); - } - } - - function setFramesEnabled(enable) { - var frames = document.getElementsByTagName("iframe"); //$NON-NLS-0$ - for (var i = 0; ikeyCode values. - * @name orion.webui.littlelib.KEY - * @static - */ - var KEY = { - BKSPC: 8, - TAB: 9, - ENTER: 13, - SHIFT: 16, - CONTROL: 17, - ALT: 18, - ESCAPE: 27, - SPACE: 32, - PAGEUP: 33, - PAGEDOWN: 34, - END: 35, - HOME: 36, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - INSERT: 45, - DEL: 46, - COMMAND: 991 - }; - /** - * Maps a keyCode to KEY name. This is the inverse of {@link orion.webui.littlelib.KEY}. - * @private - */ - var KEY_CODE = Object.create(null); - Object.keys(KEY).forEach(function(name) { - KEY_CODE[KEY[name]] = name; - }); - - /** - * @param {Number} keyCode - * @returns The name of the lib.KEY entry for keyCode, or null. - */ - function keyName(keyCode) { - return KEY_CODE[keyCode] || null; - } - - /** - * Creates DOM nodes from the specified template string. - * - * @param {String} templateString A string containing the HTML template to use - * @param {Node} parentNode Optional. The parent node to insert the new nodes into. - * The parent's contents will be completely replaced. - * @returns If the template string contains a single node or a wrapper node which - * wraps all the other nodes that single DOM node will be returned. - * Otherwise if the template string contains multiple top-level nodes an - * {HTMLCollection} object containing all the top-level nodes will be returned. - */ - function createNodes(templateString, parentNode) { - var parent = parentNode; - var newNodes = null; - - if (undefined === parent) { - parent = document.createElement("div"); //$NON-NLS-0$ - } - - parent.innerHTML = templateString; - if (parent.children.length > 1) { - newNodes = parent.children; - } else { - newNodes = parent.firstChild; - } - - return newNodes; - } - - //return module exports - return { - $: $, - $$: $$, - $$array: $$array, - node: node, - contains: contains, - bounds: bounds, - empty: empty, - firstTabbable: firstTabbable, - lastTabbable: lastTabbable, - pixelValueOf: pixelValueOf, - stop: stop, - processTextNodes: processTextNodes, - processDOMNodes: processDOMNodes, - addAutoDismiss: addAutoDismiss, - setFramesEnabled: setFramesEnabled, - getOffsetParent: getOffsetParent, - removeAutoDismiss: removeAutoDismiss, - keyName: keyName, - KEY: KEY, - createNodes: createNodes - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010,2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ - -define('orion/commandsProxy',[ - 'orion/util', - 'orion/webui/littlelib' -], function(util, lib) { - - function handleKeyEvent(evt, processKeyFunc) { - function isContentKey(e) { - // adapted from handleKey in http://git.eclipse.org/c/platform/eclipse.platform.swt.git/plain/bundles/org.eclipse.swt/Eclipse%20SWT%20Custom%20Widgets/common/org/eclipse/swt/custom/StyledText.java - if (util.isMac) { - // COMMAND+ALT combinations produce characters on the mac, but COMMAND or COMMAND+SHIFT do not. - if (e.metaKey && !e.altKey) { //command without alt - // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=390341 - // special case for select all, cut, copy, paste, and undo. A slippery slope... - if (!e.shiftKey && !e.ctrlKey && (e.keyCode === 65 || e.keyCode === 67 || e.keyCode === 86 || e.keyCode === 88 || e.keyCode === 90)) { - return true; - } - return false; - } - if (e.ctrlKey) { - return false; - } - } else { - // CTRL or ALT combinations are not characters, however both of them together (CTRL+ALT) - // are the Alt Gr key on some keyboards. See Eclipse bug 20953. If together, they might - // be a character. However there aren't usually any commands associated with Alt Gr keys. - if (e.ctrlKey && !e.altKey) { - // special case for select all, cut, copy, paste, and undo. - if (!e.shiftKey && (e.keyCode === 65 || e.keyCode === 67 || e.keyCode === 86 || e.keyCode === 88 || e.keyCode === 90)) { - return true; - } - return false; - } - if (e.altKey && !e.ctrlKey) { - return false; - } - if (e.ctrlKey && e.altKey){ - return false; - } - } - if (e['char']) { //$NON-NLS-0$ - return e['char'].length > 0; // empty string for non characters //$NON-NLS-0$ - } else if (e.charCode || e.keyCode) { - var keyCode= e.charCode || e.keyCode; - // anything below SPACE is not a character except for line delimiter keys, tab, and delete. - switch (keyCode) { - case 8: // backspace - case 9: // tab - case 13: // enter - case 46: // delete - return true; - default: - return (keyCode >= 32 && keyCode < 112) || // space key and above until function keys - keyCode > 123; // above function keys - } - } - // If we can't identify as a character, assume it's not - return false; - } - - evt = evt || window.event; - if (isContentKey(evt)) { - // bindings that are text content keys are ignored if we are in a text field or editor - // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=375058 - if (evt.target.contentEditable === "true") { //$NON-NLS-0$ - return; - } - var tagType = evt.target.nodeName.toLowerCase(); - if (tagType === 'input') { //$NON-NLS-0$ - var inputType = evt.target.type.toLowerCase(); - // Any HTML5 input type that involves typing text should be ignored - switch (inputType) { - case "text": //$NON-NLS-0$ - case "password": //$NON-NLS-0$ - case "search": //$NON-NLS-0$ - case "color": //$NON-NLS-0$ - case "date": //$NON-NLS-0$ - case "datetime": //$NON-NLS-0$ - case "datetime-local": //$NON-NLS-0$ - case "email": //$NON-NLS-0$ - case "month": //$NON-NLS-0$ - case "number": //$NON-NLS-0$ - case "range": //$NON-NLS-0$ - case "tel": //$NON-NLS-0$ - case "time": //$NON-NLS-0$ - case "url": //$NON-NLS-0$ - case "week": //$NON-NLS-0$ - return; - } - } else if (tagType === 'textarea') { //$NON-NLS-0$ - return; - } - } - processKeyFunc(evt); - } - - function CommandsProxy() { - this._init(); - } - CommandsProxy.prototype = { - destroy: function() { - if (this._listener) { - document.removeEventListener("keydown", this._listener); //$NON-NLS-0$ - this._listener = null; - } - }, - setProxy: function(proxy) { - this.proxy = proxy; - }, - setKeyBindings: function(bindings) { - this.bindings = bindings; - }, - _init: function() { - var self = this; - document.addEventListener("keydown", this._listener = function(evt) { //$NON-NLS-0$ - return handleKeyEvent(evt, function(evt) { - var proxy = self.proxy; - var bindings = self.bindings; - if (!bindings || !proxy) { - return; - } - for (var i=0; ieventName - * will be passed to the event listener(s). - * @param {Object} event The event to dispatch. The event object MUST have a type field - * @returns {boolean} false if the event has been canceled and any associated default action should not be performed - * listeners (if any) have resolved. - */ - dispatchEvent: function(event) { - if (!event.type) { - throw new Error("unspecified type"); - } - var listeners = this._namedListeners[event.type]; - if (listeners) { - listeners.forEach(function(listener) { - try { - if (typeof listener === "function") { - listener(event); - } else { - listener.handleEvent(event); - } - } catch (e) { - if (typeof console !== 'undefined') { - console.log(e); // for now, probably should dispatch an ("error", e) - } - } - }); - } - return !event.defaultPrevented; - }, - - /** - * Adds an event listener for a named event - * @param {String} eventName The event name - * @param {Function} listener The function called when an event occurs - */ - addEventListener: function(eventName, listener) { - if (typeof listener === "function" || listener.handleEvent) { - this._namedListeners[eventName] = this._namedListeners[eventName] || []; - this._namedListeners[eventName].push(listener); - } - }, - - /** - * Removes an event listener for a named event - * @param {String} eventName The event name - * @param {Function} listener The function called when an event occurs - */ - removeEventListener: function(eventName, listener) { - var listeners = this._namedListeners[eventName]; - if (listeners) { - for (var i = 0; i < listeners.length; i++) { - if (listeners[i] === listener) { - if (listeners.length === 1) { - delete this._namedListeners[eventName]; - } else { - listeners.splice(i, 1); - } - break; - } - } - } - } - }; - EventTarget.prototype.constructor = EventTarget; - - EventTarget.attach = function(obj) { - var eventTarget = new EventTarget(); - obj.dispatchEvent = eventTarget.dispatchEvent.bind(eventTarget); - obj.addEventListener = eventTarget.addEventListener.bind(eventTarget); - obj.removeEventListener = eventTarget.removeEventListener.bind(eventTarget); - }; - - return EventTarget; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/webui/dropdown',['orion/webui/littlelib', 'orion/EventTarget'], function(lib, EventTarget) { - - /** - * Attaches dropdown behavior to a given node. Assumes the triggering node and dropdown node - * have the same parent. Trigger should have "dropdownTrigger" class, and the dropdown node should - * have "dropdownMenu" class. Dropdown items should be
  • elements, so typically the dropdown node - * supplied is a
      . - * - * "dropdowntriggerbutton.html" contains an appropriate HTML fragment for a triggering button and associated - * dropdown. Clients can add this fragment to the DOM and then attach Dropdown behavior to it. - * - * Nested ("sub") menu behavior is accomplished by adding the class "dropdownSubMenu" to one of the
    • items. - * This item can then parent another trigger and
        . - * - * "submenutriggerbutton.html" contains an appropriate HTML fragment for a menu item that triggers a sub menu. - * Clients can add this fragment to a dropdown menu and then attach Dropdown behavior to the sub menu item. - * - * The items inside each
      • item in a dropdown can be almost any type of node. The class "dropdownMenuItem" is - * used on the node inside the li to find items and style them appropriately. There are HTML fragments for some - * common menu types. For example, "checkedmenuitem.html" is a fragment appropriate for checked menu items. - * - * @param {Object} options The options object, which must minimally specify the dropdown dom node - * @param options.dropdown The node for the dropdown presentation. Required. - * @param options.populate A function that should be called to populate the dropdown before it - * opens each time. Optional. - * @param options.triggerNode The node which will listen for events that trigger the - * opening of this drop down. If it is not specified the parent of the dropdown node will be searched - * for a node containing the dropdownTrigger class. Optional. - * @param options.parentDropdown The Dropdown that is the parent of this one if this is a sub-dropdown. Optional. - * @param options.positioningNode The Node that the dropdown uses so that it always renders under the positioningNode's left bottom corner. Optional. - * @param options.skipTriggerEventListeners A boolean indicating whether or not to skip adding event - * listeners to the triggerNode. Optional. - * - * @name orion.webui.dropdown.Dropdown - * - */ - function Dropdown(options) { - EventTarget.attach(this); - this._init(options); - } - Dropdown.prototype = /** @lends orion.webui.dropdown.Dropdown.prototype */ { - - _init: function(options) { - this._dropdownNode = lib.node(options.dropdown); - if (!this._dropdownNode) { throw "no dom node for dropdown found"; } //$NON-NLS-0$ - this._populate = options.populate; - this._selectionClass = options.selectionClass; - this._parentDropdown = options.parentDropdown; - this._positioningNode = options.positioningNode; - - if (!this._parentDropdown) { - //if a parentDropdown isn't specified move up in dom tree looking for one - var parentNode = this._dropdownNode.parentNode; - while(parentNode && (document !== parentNode)) { - if (parentNode.classList && parentNode.classList.contains("dropdownMenu")) { //$NON-NLS-0$ - this._parentDropdown = parentNode.dropdown; - break; - } - parentNode = parentNode.parentNode; - } - } - - this._dropdownNode.tabIndex = 0; - - if (options.triggerNode) { - this._triggerNode = options.triggerNode; - } else { - this._triggerNode = lib.$(".dropdownTrigger", this._dropdownNode.parentNode); //$NON-NLS-0$ - } - if (!this._triggerNode) { throw "no dom node for dropdown trigger found"; } //$NON-NLS-0$ - - var triggerClickHandler = function(event) { - var actionTaken = false; - - if (this._triggerNode.classList.contains("dropdownMenuItem")) { //$NON-NLS-0$ - // if the trigger is a dropdownMenuItem we only want it to open the submenu - actionTaken = this.open(event); - } else { - actionTaken = this.toggle(event); - } - - if (actionTaken) { - lib.stop(event); - } - }.bind(this); - - if (!options.skipTriggerEventListeners) { - // click on trigger opens or toggles. - this._triggerNode.addEventListener("click", triggerClickHandler, false); //$NON-NLS-0$ - - // if trigger node is not key enabled... - if (this._triggerNode.tagName.toLowerCase() === "span") { //$NON-NLS-0$ - this._triggerNode.addEventListener("keydown", function(event) { //$NON-NLS-0$ - if (event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.SPACE) { - triggerClickHandler(event); - } - }.bind(this), false); - } - } - - // keys - this._dropdownNode.addEventListener("keydown", this._dropdownKeyDown.bind(this), false); //$NON-NLS-0$ - }, - - addTriggerNode: function(node){ - var self = this; - node.addEventListener("click", function(event) { //$NON-NLS-0$ - if (self.toggle(event)) { - lib.stop(event); - } - }, false); - }, - - /** - * Toggle the open/closed state of the dropdown. Return a boolean that indicates whether action was taken. - */ - toggle: function(mouseEvent /* optional */) { - if (this.isVisible()) { - return this.close(); - } else { - return this.open(mouseEvent); - } - }, - - /** - * Answers whether the dropdown is visible. - */ - isVisible: function() { - return this._isVisible; - }, - - /** - * Open the dropdown. - */ - open: function(mouseEvent /* optional */) { - var actionTaken = false; - if (!this.isVisible()) { - this.dispatchEvent({type: "triggered", dropdown: this, event: mouseEvent}); //$NON-NLS-0$ - if (this._populate) { - this.empty(); - this._populate(this._dropdownNode); - } - var items = this.getItems(); - if (items.length > 0) { - lib.setFramesEnabled(false); - if (this._boundAutoDismiss) { - lib.removeAutoDismiss(this._boundAutoDismiss); - } - this._boundAutoDismiss = this._autoDismiss.bind(this); - - // add auto dismiss. Clicking anywhere but trigger or a submenu item means close. - var submenuNodes = lib.$$array(".dropdownSubMenu", this._dropdownNode); //$NON-NLS-0$ - lib.addAutoDismiss([this._triggerNode].concat(submenuNodes), this._boundAutoDismiss); - - this._triggerNode.classList.add("dropdownTriggerOpen"); //$NON-NLS-0$ - if (this._selectionClass) { - this._triggerNode.classList.add(this._selectionClass); - } - this._dropdownNode.classList.add("dropdownMenuOpen"); //$NON-NLS-0$ - this._isVisible = true; - - this._positionDropdown(mouseEvent); - - this._focusDropdownNode(); - actionTaken = true; - - if (this._parentDropdown) { - this._parentDropdown.submenuOpen(this); - } - } - } - return actionTaken; - }, - - _focusDropdownNode :function() {//Sub classes can override this to set focus on different items. - this._dropdownNode.focus(); - }, - - _autoDismiss: function(event) { - if (this.close(false)) { - // only trigger dismissal of parent menus if - // this dropdown's node contains the event.target - if (this._dropdownNode.contains(event.target)) { - // Dismiss parent menus - var temp = this._parentDropdown; - while (temp) { - temp.close(false); - temp = temp._parentDropdown; - } - } - } - }, - - /** - * This method positions the dropdown menu. - * The specified mouseEvent is ignored. However, subclasses - * can override this method if they wish to take the mouse - * position contained in the mouse event into account. - * - * @param {MouseEvent} mouseEvent - */ - _positionDropdown: function(mouseEvent) {//Sub classes can override this to position the drop down differently. - this._dropdownNode.style.left = ""; - this._dropdownNode.style.top = ""; - - if(this._positioningNode) { - this._dropdownNode.style.left = this._positioningNode.offsetLeft + "px"; - return; - } - - var bounds = lib.bounds(this._dropdownNode); - var bodyBounds = lib.bounds(document.body); - if (bounds.left + bounds.width > (bodyBounds.left + bodyBounds.width)) { - if (this._triggerNode.classList.contains("dropdownMenuItem")) { //$NON-NLS-0$ - this._dropdownNode.style.left = -bounds.width + "px"; //$NON-NLS-0$ - } else { - var totalBounds = lib.bounds(this._boundingNode(this._triggerNode)); - var triggerBounds = lib.bounds(this._triggerNode); - this._dropdownNode.style.left = (triggerBounds.left - totalBounds.left - bounds.width + triggerBounds.width) + "px"; //$NON-NLS-0$ - } - } - - //ensure menu fits on page vertically - var overflowY = (bounds.top + bounds.height) - (bodyBounds.top + bodyBounds.height); - if (0 < overflowY) { - this._dropdownNode.style.top = Math.floor(this._dropdownNode.style.top - overflowY) + "px"; //$NON-NLS-0$ - } - }, - - _boundingNode: function(node) { - var style = window.getComputedStyle(node, null); - if (style === null) { - return node; - } - var position = style.getPropertyValue("position"); //$NON-NLS-0$ - if (position === "absolute" || !node.parentNode || node === document.body) { //$NON-NLS-0$ - return node; - } - return this._boundingNode(node.parentNode); - }, - - - /** - * Close the dropdown. - */ - close: function(restoreFocus) { - var actionTaken = false; - if (this.isVisible()) { - this._triggerNode.classList.remove("dropdownTriggerOpen"); //$NON-NLS-0$ - if (this._selectionClass) { - this._triggerNode.classList.remove(this._selectionClass); - } - this._dropdownNode.classList.remove("dropdownMenuOpen"); //$NON-NLS-0$ - lib.setFramesEnabled(true); - if (restoreFocus) { - this._triggerNode.focus(); - } - - this._isVisible = false; - if (this._selectedItem) { - this._selectedItem.classList.remove("dropdownMenuItemSelected"); //$NON-NLS-0$ - this._selectedItem = null; - } - - if (this._boundAutoDismiss) { - lib.removeAutoDismiss(this._boundAutoDismiss); - this._boundAutoDismiss = null; - } - actionTaken = true; - } - return actionTaken; - }, - - /** - * - */ - getItems: function() { - var items = lib.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem", this._dropdownNode, true); //$NON-NLS-0$ - // We only want the direct li children, not any descendants. But we can't preface a query with ">" - // So we do some reachy filtering here. - var filtered = []; - var self = this; - items.forEach(function(item) { - if (item.parentNode.parentNode === self._dropdownNode) { - filtered.push(item); - } - }); - - //add handler to close open submenu when other items in the parent menu are hovered - filtered.forEach(function(item){ - if (!item._hasDropdownMouseover) { - item.addEventListener("mouseover", function(e){ //$NON-NLS-0$ - if (item.dropdown) { - item.dropdown.open(e); - } else { - self._closeSelectedSubmenu(); - lib.stop(e); - } - self._selectItem(item); // select the item on mouseover - }); - item._hasDropdownMouseover = true; - } - }); - return filtered; - }, - - /** - * - */ - empty: function() { - var items = lib.$$array("li", this._dropdownNode); //$NON-NLS-0$ - var self = this; - // We only want the direct li children, not any descendants. - items.forEach(function(item) { - if (item.parentNode === self._dropdownNode) { - item.parentNode.removeChild(item); - } - }); - }, - - - /** - * A key is down in the dropdown node - */ - _dropdownKeyDown: function(event) { - if (event.keyCode === lib.KEY.UP || event.keyCode === lib.KEY.DOWN || event.keyCode === lib.KEY.RIGHT || event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.LEFT) { - var items = this.getItems(); - if (items.length && items.length > 0) { - if (this._selectedItem) { - var index = items.indexOf(this._selectedItem); - // for inputs nested in labels, we should check the parent node since the label is the item - if (index < 0) { - index = items.indexOf(this._selectedItem.parentNode); - } - if (index >= 0) { - if (event.keyCode === lib.KEY.UP && index > 0) { - index--; - this._selectItem(items[index]); - } else if (event.keyCode === lib.KEY.DOWN && index < items.length - 1) { - index++; - this._selectItem(items[index]); - } else if (event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.RIGHT) { - if (this._selectedItem.classList.contains("dropdownTrigger") && this._selectedItem.dropdown) { //$NON-NLS-0$ - this._selectedItem.dropdown.open(); - this._selectedItem.dropdown._selectItem(); // select first item in submenu - } else if (event.keyCode === lib.KEY.ENTER) { - this._selectedItem.click(); - } - } else if (event.keyCode === lib.KEY.LEFT && this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")) { //$NON-NLS-0$ - this.close(true); - if (this._parentDropdown) { - this._parentDropdown._dropdownNode.focus(); - } - } - } - } else { - this._selectItem(items[0]); - } - lib.stop(event); - } - } else if (event.keyCode === lib.KEY.ESCAPE) { - this.close(true); - lib.stop(event); - } - }, - - /** - * Selects the specified dropdown menu item or the first - * dropdown menu item if none is specified. - * @param {Object} item The dropdown menu item that should be selected. See @ref getItems() for details. Optional. - */ - _selectItem: function(item){ - var itemToSelect = item || this.getItems()[0]; - if (itemToSelect) { - if (this._selectedItem) { - this._selectedItem.classList.remove("dropdownMenuItemSelected"); //$NON-NLS-0$ - } - this._selectedItem = itemToSelect; - this._selectedItem.classList.add("dropdownMenuItemSelected"); //$NON-NLS-0$ - } - if (document.activeElement !== this._dropdownNode) { - // ensure that the dropdown node has the focus in - // order for keydown events to be handled properly - this._dropdownNode.focus(); - } - }, - - /** - * Closes this._selectedSubmenu, and its children, if it is open. - * Sets the this._selectedSubmenu to the one that's passed in. - * @param submenu The submenu that was opened and should be set as the next this._selectedSubmenu - */ - submenuOpen: function(submenu) { - if (submenu !== this._selectedSubmenu) { - //close the current menu and all its children - this._closeSelectedSubmenu(); - this._selectedSubmenu = submenu; - } - }, - - _closeSelectedSubmenu: function() { - var currentSubmenu = this._selectedSubmenu; - while(currentSubmenu) { - currentSubmenu.close(); - currentSubmenu = currentSubmenu._selectedSubmenu; - } - }, - - destroy: function() { - this.empty(); - if (this._boundAutoDismiss) { - lib.removeAutoDismiss(this._boundAutoDismiss); - this._boundAutoDismiss = null; - } - }, - - /** - * Creates a new menu item and appends it to the bottom of this dropdown. - * @param {String} text The text to display inside the new menu item. Optional. - * @param {String} innerNodeType The type of the inner node to create. The default is "span". Optional. - * @returns {Object} The top-most new element that was created - */ - appendMenuItem: function(text, innerNodeType) { - var li = createMenuItem(text, innerNodeType); - this._dropdownNode.appendChild(li); - return li; - }, - - /** - * Creates a new separator and appends it to the bottom of this dropdown. - */ - appendSeparator: function() { - // Add a separator - var li = createSeparator(); - this._dropdownNode.appendChild(li); - return li; - } - }; - - /** - * Creates a new menu item and returns it to the caller. - * @param {String} text The text to display inside the new menu item. Optional. - * @param {String} innerNodeType The type of the inner node to create. The default is "span". Optional. - * @returns {Object} The top-most new element that was created - */ - function createMenuItem(text, innerNodeType) { - innerNodeType = innerNodeType === undefined ? "span" : innerNodeType; //$NON-NLS-0$ - - var element = document.createElement(innerNodeType); //$NON-NLS-0$ - element.tabIndex = 0; - element.className = "dropdownMenuItem"; //$NON-NLS-0$ - element.setAttribute("role", "menuitem"); //$NON-NLS-0$ //$NON-NLS-1$ - - if (text) { - var span = document.createElement("span"); //$NON-NLS-0$ - span.appendChild(document.createTextNode(text)); - span.classList.add("dropdownCommandName"); //$NON-NLS-0$ - element.appendChild(span); - } - - var li = document.createElement("li"); //$NON-NLS-0$ - li.appendChild(element); //$NON-NLS-0$ - - return li; - } - - /** - * Creates a new separator menu item and returns it to the caller. - * @returns {Object} The new separator element that was created - */ - function createSeparator() { - var li = document.createElement("li"); //$NON-NLS-0$ - li.classList.add("dropdownSeparator"); //$NON-NLS-0$ - return li; - } - - /** - * Appends the specified keyBindingString to the specified menu item. - * @param {Object} element The menu item to append the keybinding string to. Required. - * @param {String} keyBindingString The keybinding string to append. Required. - */ - function appendKeyBindingString(element, keyBindingString) { - var span = document.createElement("span"); //$NON-NLS-0$ - span.classList.add("dropdownKeyBinding"); //$NON-NLS-0$ - span.appendChild(document.createTextNode(keyBindingString)); - element.appendChild(span); - } - - Dropdown.prototype.constructor = Dropdown; - //return the module exports - return {Dropdown: Dropdown, - appendKeyBindingString: appendKeyBindingString, - createMenuItem: createMenuItem, - createSeparator: createSeparator}; -}); - -/** - * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/text for details - */ -/*jslint regexp: true */ -/*global require, XMLHttpRequest, ActiveXObject, - define, window, process, Packages, - java, location, Components, FileUtils */ - -define('text',['module'], function (module) { - 'use strict'; - - var text, fs, Cc, Ci, xpcIsWindows, - progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], - xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, - bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, - hasLocation = typeof location !== 'undefined' && location.href, - defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), - defaultHostName = hasLocation && location.hostname, - defaultPort = hasLocation && (location.port || undefined), - buildMap = {}, - masterConfig = (module.config && module.config()) || {}; - - text = { - version: '2.0.12', - - strip: function (content) { - //Strips declarations so that external SVG and XML - //documents can be added to a document without worry. Also, if the string - //is an HTML document, only the part inside the body tag is returned. - if (content) { - content = content.replace(xmlRegExp, ""); - var matches = content.match(bodyRegExp); - if (matches) { - content = matches[1]; - } - } else { - content = ""; - } - return content; - }, - - jsEscape: function (content) { - return content.replace(/(['\\])/g, '\\$1') - .replace(/[\f]/g, "\\f") - .replace(/[\b]/g, "\\b") - .replace(/[\n]/g, "\\n") - .replace(/[\t]/g, "\\t") - .replace(/[\r]/g, "\\r") - .replace(/[\u2028]/g, "\\u2028") - .replace(/[\u2029]/g, "\\u2029"); - }, - - createXhr: masterConfig.createXhr || function () { - //Would love to dump the ActiveX crap in here. Need IE 6 to die first. - var xhr, i, progId; - if (typeof XMLHttpRequest !== "undefined") { - return new XMLHttpRequest(); - } else if (typeof ActiveXObject !== "undefined") { - for (i = 0; i < 3; i += 1) { - progId = progIds[i]; - try { - xhr = new ActiveXObject(progId); - } catch (e) {} - - if (xhr) { - progIds = [progId]; // so faster next time - break; - } - } - } - - return xhr; - }, - - /** - * Parses a resource name into its component parts. Resource names - * look like: module/name.ext!strip, where the !strip part is - * optional. - * @param {String} name the resource name - * @returns {Object} with properties "moduleName", "ext" and "strip" - * where strip is a boolean. - */ - parseName: function (name) { - var modName, ext, temp, - strip = false, - index = name.indexOf("."), - isRelative = name.indexOf('./') === 0 || - name.indexOf('../') === 0; - - if (index !== -1 && (!isRelative || index > 1)) { - modName = name.substring(0, index); - ext = name.substring(index + 1, name.length); - } else { - modName = name; - } - - temp = ext || modName; - index = temp.indexOf("!"); - if (index !== -1) { - //Pull off the strip arg. - strip = temp.substring(index + 1) === "strip"; - temp = temp.substring(0, index); - if (ext) { - ext = temp; - } else { - modName = temp; - } - } - - return { - moduleName: modName, - ext: ext, - strip: strip - }; - }, - - xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, - - /** - * Is an URL on another domain. Only works for browser use, returns - * false in non-browser environments. Only used to know if an - * optimized .js version of a text resource should be loaded - * instead. - * @param {String} url - * @returns Boolean - */ - useXhr: function (url, protocol, hostname, port) { - var uProtocol, uHostName, uPort, - match = text.xdRegExp.exec(url); - if (!match) { - return true; - } - uProtocol = match[2]; - uHostName = match[3]; - - uHostName = uHostName.split(':'); - uPort = uHostName[1]; - uHostName = uHostName[0]; - - return (!uProtocol || uProtocol === protocol) && - (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && - ((!uPort && !uHostName) || uPort === port); - }, - - finishLoad: function (name, strip, content, onLoad) { - content = strip ? text.strip(content) : content; - if (masterConfig.isBuild) { - buildMap[name] = content; - } - onLoad(content); - }, - - load: function (name, req, onLoad, config) { - //Name has format: some.module.filext!strip - //The strip part is optional. - //if strip is present, then that means only get the string contents - //inside a body tag in an HTML string. For XML/SVG content it means - //removing the declarations so the content can be inserted - //into the current doc without problems. - - // Do not bother with the work if a build and text will - // not be inlined. - if (config && config.isBuild && !config.inlineText) { - onLoad(); - return; - } - - masterConfig.isBuild = config && config.isBuild; - - var parsed = text.parseName(name), - nonStripName = parsed.moduleName + - (parsed.ext ? '.' + parsed.ext : ''), - url = req.toUrl(nonStripName), - useXhr = (masterConfig.useXhr) || - text.useXhr; - - // Do not load if it is an empty: url - if (url.indexOf('empty:') === 0) { - onLoad(); - return; - } - - //Load the text. Use XHR if possible and in a browser. - if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { - text.get(url, function (content) { - text.finishLoad(name, parsed.strip, content, onLoad); - }, function (err) { - if (onLoad.error) { - onLoad.error(err); - } - }); - } else { - //Need to fetch the resource across domains. Assume - //the resource has been optimized into a JS module. Fetch - //by the module name + extension, but do not include the - //!strip part to avoid file system issues. - req([nonStripName], function (content) { - text.finishLoad(parsed.moduleName + '.' + parsed.ext, - parsed.strip, content, onLoad); - }); - } - }, - - write: function (pluginName, moduleName, write, config) { - if (buildMap.hasOwnProperty(moduleName)) { - var content = text.jsEscape(buildMap[moduleName]); - write.asModule(pluginName + "!" + moduleName, - "define(function () { return '" + - content + - "';});\n"); - } - }, - - writeFile: function (pluginName, moduleName, req, write, config) { - var parsed = text.parseName(moduleName), - extPart = parsed.ext ? '.' + parsed.ext : '', - nonStripName = parsed.moduleName + extPart, - //Use a '.js' file name so that it indicates it is a - //script that can be loaded across domains. - fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; - - //Leverage own load() method to load plugin value, but only - //write out values that do not have the strip argument, - //to avoid any potential issues with ! in file names. - text.load(nonStripName, req, function (value) { - //Use own write() method to construct full module value. - //But need to create shell that translates writeFile's - //write() to the right interface. - var textWrite = function (contents) { - return write(fileName, contents); - }; - textWrite.asModule = function (moduleName, contents) { - return write.asModule(moduleName, fileName, contents); - }; - - text.write(pluginName, nonStripName, textWrite, config); - }, config); - } - }; - - if (masterConfig.env === 'node' || (!masterConfig.env && - typeof process !== "undefined" && - process.versions && - !!process.versions.node && - !process.versions['node-webkit'])) { - //Using special require.nodeRequire, something added by r.js. - fs = require.nodeRequire('fs'); - - text.get = function (url, callback, errback) { - try { - var file = fs.readFileSync(url, 'utf8'); - //Remove BOM (Byte Mark Order) from utf8 files if it is there. - if (file.indexOf('\uFEFF') === 0) { - file = file.substring(1); - } - callback(file); - } catch (e) { - if (errback) { - errback(e); - } - } - }; - } else if (masterConfig.env === 'xhr' || (!masterConfig.env && - text.createXhr())) { - text.get = function (url, callback, errback, headers) { - var xhr = text.createXhr(), header; - xhr.open('GET', url, true); - - //Allow plugins direct access to xhr headers - if (headers) { - for (header in headers) { - if (headers.hasOwnProperty(header)) { - xhr.setRequestHeader(header.toLowerCase(), headers[header]); - } - } - } - - //Allow overrides specified in config - if (masterConfig.onXhr) { - masterConfig.onXhr(xhr, url); - } - - xhr.onreadystatechange = function (evt) { - var status, err; - //Do not explicitly handle errors, those should be - //visible via console output in the browser. - if (xhr.readyState === 4) { - status = xhr.status || 0; - if (status > 399 && status < 600) { - //An http 4xx or 5xx error. Signal an error. - err = new Error(url + ' HTTP status: ' + status); - err.xhr = xhr; - if (errback) { - errback(err); - } - } else { - callback(xhr.responseText); - } - - if (masterConfig.onXhrComplete) { - masterConfig.onXhrComplete(xhr, url); - } - } - }; - xhr.send(null); - }; - } else if (masterConfig.env === 'rhino' || (!masterConfig.env && - typeof Packages !== 'undefined' && typeof java !== 'undefined')) { - //Why Java, why is this so awkward? - text.get = function (url, callback) { - var stringBuffer, line, - encoding = "utf-8", - file = new java.io.File(url), - lineSeparator = java.lang.System.getProperty("line.separator"), - input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), - content = ''; - try { - stringBuffer = new java.lang.StringBuffer(); - line = input.readLine(); - - // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 - // http://www.unicode.org/faq/utf_bom.html - - // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: - // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 - if (line && line.length() && line.charAt(0) === 0xfeff) { - // Eat the BOM, since we've already found the encoding on this file, - // and we plan to concatenating this buffer with others; the BOM should - // only appear at the top of a file. - line = line.substring(1); - } - - if (line !== null) { - stringBuffer.append(line); - } - - while ((line = input.readLine()) !== null) { - stringBuffer.append(lineSeparator); - stringBuffer.append(line); - } - //Make sure we return a JavaScript string and not a Java string. - content = String(stringBuffer.toString()); //String - } finally { - input.close(); - } - callback(content); - }; - } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env && - typeof Components !== 'undefined' && Components.classes && - Components.interfaces)) { - //Avert your gaze! - Cc = Components.classes; - Ci = Components.interfaces; - Components.utils['import']('resource://gre/modules/FileUtils.jsm'); - xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc); - - text.get = function (url, callback) { - var inStream, convertStream, fileObj, - readData = {}; - - if (xpcIsWindows) { - url = url.replace(/\//g, '\\'); - } - - fileObj = new FileUtils.File(url); - - //XPCOM, you so crazy - try { - inStream = Cc['@mozilla.org/network/file-input-stream;1'] - .createInstance(Ci.nsIFileInputStream); - inStream.init(fileObj, 1, 0, false); - - convertStream = Cc['@mozilla.org/intl/converter-input-stream;1'] - .createInstance(Ci.nsIConverterInputStream); - convertStream.init(inStream, "utf-8", inStream.available(), - Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); - - convertStream.readString(inStream.available(), readData); - convertStream.close(); - inStream.close(); - callback(readData.value); - } catch (e) { - throw new Error((fileObj && fileObj.path || '') + ': ' + e); - } - }; - } - return text; -}); - - -define('text!orion/webui/dropdowntriggerbutton.html',[],function () { return '';}); - - -define('text!orion/webui/dropdowntriggerbuttonwitharrow.html',[],function () { return '';}); - - -define('text!orion/webui/checkedmenuitem.html',[],function () { return '
      • ';}); - -/******************************************************************************* - * @license - * Copyright (c) 2012, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/webui/tooltip',['orion/webui/littlelib'], function(lib) { - - /** - * Attaches tooltip behavior to a given node. The tooltip will be assigned class "tooltip" which can be - * used to control appearance. Uses the "CSS Triangle Trick" - * http://css-tricks.com/snippets/css/css-triangle/ - * for the tooltip shape and CSS transitions for fade in and fade out. - * - * Clients should destroy the tooltip if removing the node from the document. - * - * @param {Object} options The options object, which must minimally specify the tooltip dom node - * @param options.node The node showing the tooltip. Required. - * @param options.text The text in the tooltip. Optional. If not specified, the client is expected to add content - * to the tooltip prior to triggering it. - * @param options.trigger The event that triggers the tooltip. Optional. Defaults to "mouseover". Can be one of "mouseover", - * "click", "focus", or "none". If "none" then the creator will be responsible for showing, hiding, and destroying the tooltip. - * If "mouseover" then the aria attributes for tooltips will be set up. - * @param options.position An array specifying the preferred positions to try positioning the tooltip. Positions can be "left", "right", - * "above", or "below". If no position will fit on the screen, the first position specified is used. Optional. Defaults to - * ["right", "above", "below", "left"]. - * @param options.showDelay Specifies the number of millisecond delay before the tooltip begins to appear. - * Optional. Valid only for "mouseover" trigger. Defaults to 1000. - * @param options.hideDelay Specifies the number of millisecond delay before the tooltip begins to disappear. - * Optional. Defaults to 200. Valid only for "mouseover" trigger. - * @param options.tailSize Specifies the number of pixels to allocate for the tail. Optional. Defaults to 10. - * @name orion.webui.tooltip.Tooltip - * - */ - function Tooltip(options) { - this._init(options); - } - Tooltip.prototype = /** @lends orion.webui.tooltip.Tooltip.prototype */ { - - _init: function(options) { - this._node = lib.node(options.node); - if (!this._node) { throw "no dom node for tooltip found"; } //$NON-NLS-0$ - this._position = options.position || ["right", "above", "below", "left"]; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - this._text = options.text; - this._hideDelay = options.hideDelay === undefined ? 200 : options.hideDelay; - this._tailSize = options.tailSize || 10; - this._trigger = options.trigger || "mouseover"; //$NON-NLS-0$ - this._afterShowing = options.afterShowing; - this._afterHiding = options.afterHiding; - - var self = this; - // set up events - if (this._trigger === "click") { //$NON-NLS-0$ - this._showDelay = 0; - this._node.addEventListener("click", this._clickHandler = function(event) { //$NON-NLS-0$ - if (event.target === self._node) { - self.show(); - lib.stop(event); - } - }, false); - } else if (this._trigger === "mouseover") { //$NON-NLS-0$ - this._showDelay = options.showDelay === undefined ? 500 : options.showDelay; - var leave = ["mouseout", "click"]; //$NON-NLS-1$ //$NON-NLS-0$ - this._node.addEventListener("mouseover", this._mouseoverHandler = function(event) { //$NON-NLS-0$ - if (lib.contains(self._node, event.target)) { - self.show(); - lib.stop(event); - } - }, false); - - this._leaveHandler = function(event) { //$NON-NLS-0$ - if (lib.contains(self._node, event.target)) { - self.hide(); - } - }; - - for (var i=0; i vPortBottom) { - if (force) { - top = vPortBottom - tipRect.height - 1; - } else { - return false; - } - } - if (left + tipRect.width > vPortRight) { - if (force) { - left = vPortRight - tipRect.width - 1; - } else { - return false; - } - } - if (left < vPortLeft) { - if (force) { - left = vPortLeft + 4; - } else { - return false; - } - } - if (top < vPortTop) { - if (force) { - top = vPortTop + 4; - } else { - return false; - } - } - - if (this._tail && (this._tail.previousPosition !== position)) { - //position has changed, tail needs to be modified - this._tip.removeChild(this._tail); - this._tail = null; - } - - if (!this._tail) { - this._tail = document.createElement("span"); //$NON-NLS-0$ - this._tail.classList.add("tooltipTailFrom"+position); //$NON-NLS-0$ - if (position === "above" || position === "left") { //$NON-NLS-1$//$NON-NLS-0$ - // tip goes after content - this._tip.appendChild(this._tail); - } else { - this._tip.insertBefore(this._tail, this._tipInner); - } - this._tail.previousPosition = position; - } - this._tip.style.top = top + "px"; //$NON-NLS-0$ - this._tip.style.left = left + "px"; //$NON-NLS-0$ - return true; - }, - - contentContainer: function() { - this._makeTipNode(); - return this._tipInner; - }, - - /** - * @return True if this tooltip is visible, false otherwise - */ - isShowing: function() { - return this._tip && this._tip.classList.contains("tooltipShowing"); //$NON-NLS-0$ - }, - - /** - * Show the tooltip. - */ - show: function() { - if (this.isShowing()) { //$NON-NLS-0$ - return; - } - if (this._timeout) { - window.clearTimeout(this._timeout); - this._timeout = null; - } - if (this._showDelay) { - this._timeout = window.setTimeout(this._showImmediately.bind(this), this._showDelay); - } else { - this._showImmediately(); - } - }, - - _showImmediately: function() { - var positioned = false; - var index = 0; - while (!positioned && index < this._position.length) { - positioned = this._positionTip(this._position[index]); - index++; - } - if (!positioned) { - this._positionTip(this._position[0], true); // force it in, it doesn't fit anywhere - } - if (this._afterShowing) { - this._afterShowing(); - } - }, - - /** - * Hide the tooltip. - */ - hide: function(hideDelay) { - if (this._timeout) { - window.clearTimeout(this._timeout); - this._timeout = null; - } - if (!this.isShowing()) { //$NON-NLS-0$ - return; - } - if (hideDelay === undefined) { - hideDelay = this._hideDelay; - } - var self = this; - this._timeout = window.setTimeout(function() { - self._tip.classList.remove("tooltipShowing"); //$NON-NLS-0$ - self._tip.removeAttribute("style"); //$NON-NLS-0$ - if (self._afterHiding) { - self._afterHiding(); - } - }, hideDelay); - }, - - destroy: function() { - if (this._timeout) { - window.clearTimeout(this._timeout); - this._timeout = null; - } - if (this._tip) { - document.body.removeChild(this._tip); - this._tip = null; - this._tipInner = null; - this._tipTextContent = null; - this._tail = null; - } - if (this._node) { - this._node.removeEventListener("click", this._clickHandler, false); //$NON-NLS-0$ - this._node.removeEventListener("mouseover", this._mouseoverHandler, false); //$NON-NLS-0$ - this._node.removeEventListener("focus", this._focusHandler, false); //$NON-NLS-0$ - this._node.removeEventListener("blur", this._blurHandler, false); //$NON-NLS-0$ - var leave = ["mouseout", "click"]; //$NON-NLS-1$ //$NON-NLS-0$ - for (var i=0; itrue if the binding was executed, false otherwise. - */ - function executeBinding(binding) { - var invocation = binding.invocation; - if (invocation) { - var command = binding.command; - if (typeof(command.hrefCallback) === 'function') { - var href = command.hrefCallback.call(invocation.handler || window, invocation); - if (href.then){ - href.then(function(l){ - window.open(l); - }); - } else { - // We assume window open since there's no link gesture to tell us what to do. - window.open(href); - } - return true; - } else if (invocation.commandRegistry) { - // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=411282 - invocation.commandRegistry._invoke(invocation); - return true; - } else if (command.onClick || command.callback) { - // TODO: what is this timeout for? - window.setTimeout(function() { - (command.onClick || command.callback).call(invocation.handler || window, invocation); - }, 0); - return true; - } - } - return false; - } - - /* - * Process a key event against the provided bindings. - */ - function _processKey(event, bindings) { - for (var id in bindings) { - if (bindings[id] && bindings[id].keyBinding && bindings[id].command) { - if (bindings[id].keyBinding.match(event)) { - var activeBinding = bindings[id]; - var keyBinding = activeBinding.keyBinding; - // Check for keys that are scoped to a particular part of the DOM - if (!keyBinding.domScope || lib.contains(lib.node(keyBinding.domScope), event.target)) { - if (executeBinding(activeBinding)) { - lib.stop(event); - return; - } - } - } - } - } - } - - function getKeyBindings() { - var allBindings = {}; - - if (getBindings) { - var i, keys, objectKey; - keys = Object.keys(localKeyBindings); - for (i=0; iNote: When retrieving parameters from a command invocation, clients should always use {@link #parameters} - * rather than obtaining the parameter object originally specified for the command (using {@link #command}.parameters). - * This ensures that the parameter values for a unique invocation are used vs. any default parameters that may have been - * specified originally. Similarly, if a client wishes to store data that will preserved across multiple invocations of a command, - * that data can be stored in the original parameters description and a reference maintained by the client. - *

        - * - * @name orion.commands.CommandInvocation - * @class Carries information about a command invocation. - * @param {Object} handler - * @param {Array} items - * @param {Object} [userData] - * @param {orion.commands.Command} command - * @param {orion.commandregistry.CommandRegistry} [commandRegistry] - */ - /** - * @name orion.commands.CommandInvocation#commandRegistry - * @type orion.commandregistry.CommandRegistry - */ - /** - * @name orion.commands.CommandInvocation#handler - * @type Object - */ - /** - * @name orion.commands.CommandInvocation#command - * @type orion.commands.Command - */ - /** - * @name orion.commands.CommandInvocation#items - * @type Array - */ - /** - * @name orion.commands.CommandInvocation#parameters - * @type orion.commands.ParametersDescription - */ - /** - * @name orion.commands.CommandInvocation#userData - * @type Object - */ - /** - * @name orion.commands.CommandInvocation#userData - * @type Object - */ - function CommandInvocation (handler, items, /* optional */userData, command, /* optional */ commandRegistry) { - this.commandRegistry = commandRegistry; - this.handler = handler; - this.items = items; - this.userData = userData; - this.command = command; - if (command.parameters) { - this.parameters = command.parameters.makeCopy(); // so that we aren't retaining old values from previous invocations - } - this.id = command.id; - } - CommandInvocation.prototype = /** @lends orion.commands.CommandInvocation.prototype */ { - /** - * Returns whether this command invocation can collect parameters. - * - * @returns {Boolean} whether parameters can be collected - */ - collectsParameters: function() { - return this.commandRegistry && this.commandRegistry.collectsParameters(); - }, - - /** - * Makes and returns a (shallow) copy of this command invocation. - * @param {orion.commands.ParametersDescription} parameters A description of parameters to be used in the copy. Optional. - * If not specified, then the existing parameters should be copied. - */ - makeCopy: function(parameters) { - var copy = new CommandInvocation(this.handler, this.items, this.userData, this.command, this.commandRegistry); - copy.domNode = this.domNode; - copy.domParent = this.domParent; - if (parameters) { - copy.parameters = parameters.makeCopy(); - } else if (this.parameters) { - copy.parameters = this.parameters.makeCopy(); - } - return copy; - } - - }; - CommandInvocation.prototype.constructor = CommandInvocation; - - - - /** - * Constructs a new command with the given options. - * @param {Object} [options] The command options object. - * @param {String} [options.id] the unique id to be used when referring to the command in the command service. - * @param {String} [options.name] the name to be used when showing the command as text. - * @param {String} [options.tooltip] the tooltip description to use when explaining the purpose of the command. - * @param {Function} [options.callback] the callback to call when the command is activated. The callback should either - * perform the command or return a deferred that represents the asynchronous performance of the command. Optional. - * @param {Function} [options.hrefCallback] if specified, this callback is used to retrieve - * a URL that can be used as the location for a command represented as a hyperlink. The callback should return - * the URL. In this release, the callback may also return a deferred that will eventually return the URL, but this - * functionality may not be supported in the future. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=341540. - * Optional. - * @param {Function} [options.choiceCallback] a callback which retrieves choices that should be shown in a secondary - * menu from the command itself. Returns a list of choices that supply the name and image to show, and the callback - * to call when the choice is made. Optional. - * @param {String} [options.imageClass] a CSS class name suitable for showing a background image. Optional. - * @param {Boolean} [options.addImageClassToElement] If true, the image class will be added to the element's - * class list. Otherwise, a span element with the image class is created and appended to the element. Optional. - * @param {String} [options.selectionClass] a CSS class name to be appended when the command button is selected. Optional. - * @param {String} [options.spriteClass] an additional CSS class name that can be used to specify a sprite background image. This - * useful with some sprite generation tools, where imageClass specifies the location in a sprite, and spriteClass describes the - * sprite itself. Optional. - * @param {Function} [options.visibleWhen] A callback that returns a boolean to indicate whether the command should be visible - * given a particular set of items that are selected. Optional, defaults to always visible. - * @param {orion.commands.ParametersDescription} [options.parameters] A description of parameters that should be collected before invoking - * the command. - * @param {Image} [options.image] the image that may be used to represent the callback. A text link will be shown in lieu - * of an image if no image is supplied. Optional. - * @class A command is an object that describes an action a user can perform, as well as when and - * what it should look like when presented in various contexts. Commands are identified by a - * unique id. - * @name orion.commands.Command - */ - function Command (options) { - this._init(options); - } - Command.prototype = /** @lends orion.commands.Command.prototype */ { - _init: function(options) { - this.id = options.id; // unique id - this.name = options.name; - this.tooltip = options.tooltip; - this.fixAllEnabled = options.fixAllEnabled; // optional toggle for quickfix command to apply to all annotations - this.callback = options.callback; // optional callback that should be called when command is activated (clicked) - this.preCallback = options.preCallback; // optional callback that should be called when command is activated (clicked) - this.hrefCallback = options.hrefCallback; // optional callback that returns an href for a command link - this.choiceCallback = options.choiceCallback; // optional callback indicating that the command will supply secondary choices. - // A choice is an object with a name, callback, and optional image - this.positioningNode = options.positioningNode; // optional positioning node choice command. - this.image = options.image || NO_IMAGE; - this.imageClass = options.imageClass; // points to the location in a sprite - this.addImageClassToElement = options.addImageClassToElement; // optional boolean if true will add the image class to the - // element's class list - this.extraClass = options.extraClass; - this.selectionClass = options.selectionClass; - this.spriteClass = options.spriteClass || "commandSprite"; // defines the background image containing sprites //$NON-NLS-0$ - this.visibleWhen = options.visibleWhen; - this.parameters = options.parameters; // only used when a command is used in the command registry. - this.isEditor = options.isEditor; - this.type = options.type; - this.checked = options.checked; - this.track = options.track; - }, - - /** - * Populate the specified menu with choices using the choiceCallback. - * Used internally by the command service. Not intended to be overridden or called - * externally. - */ - populateChoicesMenu: function(parent, items, handler, userData, commandService) { - var choices = this.getChoices(items, handler, userData); - var addCheck = choices.some(function(choice) { - return choice.checked; - }); - choices.forEach(function(choice) { - if (choice.name) { - var itemNode = document.createElement("li"); //$NON-NLS-0$ - parent.appendChild(itemNode); - var node = document.createElement("span"); //$NON-NLS-0$ - node.tabIndex = 0; - node.setAttribute("role", "menuitem"); //$NON-NLS-2$ //$NON-NLS-1$ - node.classList.add("dropdownMenuItem"); //$NON-NLS-0$ - if (addCheck) { - var check = document.createElement("span"); //$NON-NLS-0$ - check.classList.add("check"); //$NON-NLS-0$ - check.appendChild(document.createTextNode(choice.checked ? "\u25CF" : "")); //$NON-NLS-1$ //$NON-NLS-0$ - node.appendChild(check); - } - if (choice.imageClass) { - var image = document.createElement("span"); //$NON-NLS-0$ - image.classList.add(choice.imageClass); - node.appendChild(image); - } - var span = document.createElement("span"); //$NON-NLS-0$ - var text = document.createTextNode(choice.name); - span.appendChild(text); - node.appendChild(span); - itemNode.appendChild(node); - node.choice = choice; - node.addEventListener("click", function(event) { //$NON-NLS-0$ - mMetrics.logEvent("command", "invoke", this.id + ">" + choice.name); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - choice.callback.call(choice, items); - }.bind(this), false); - node.addEventListener("keydown", function(event) { //$NON-NLS-0$ - if (event.keyCode === lib.KEY.ENTER || event.keyCode === lib.KEY.SPACE) { - mMetrics.logEvent("command", "invoke", this.id + ">" + choice.name); //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-0$ - choice.callback.call(choice, items); - } - }.bind(this), false); - } else { // anything not named is a separator - commandService._generateMenuSeparator(parent); - } - }.bind(this)); - }, - - /** - * Get the appropriate choices using the choiceCallback. - * Used internally by the command service. Not intended to be overridden or called - * externally. - */ - getChoices: function(items, handler, userData) { - if (this.choiceCallback) { - return this.choiceCallback.call(handler, items, userData); - } - return null; - }, - - /** - * Make a choice callback appropriate for the given choice and items. - * Used internally by the command service. Not intended to be overridden or called - * externally. - */ - makeChoiceCallback: function(choice, items) { - return function(event) { - if (choice.callback) { - choice.callback.call(choice, items, event); - } - }; - }, - - /** - * Return a boolean indicating whether this command has a specific image associated - * with it. Used internally by the command service. Not intended to be overridden or called - * externally. - */ - hasImage: function() { - return this.imageClass || this.image !== NO_IMAGE; //$NON-NLS-0$ - } - }; // end Command prototype - Command.prototype.constructor = Command; - - //return the module exports - return { - Command: Command, - CommandInvocation: CommandInvocation, - createDropdownMenu: createDropdownMenu, - createCheckedMenuItem: createCheckedMenuItem, - createQuickfixItem: createQuickfixItem, - createCommandItem: createCommandItem, - createCommandMenuItem: createCommandMenuItem, - executeBinding: executeBinding, - setKeyBindingProvider: setKeyBindingProvider, - localKeyBindings: localKeyBindings, - getKeyBindings: getKeyBindings, - processKey: processKey, - NO_IMAGE: NO_IMAGE, - _testMethodProcessKey: _processKey // only exported for test cases - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/keyBinding", ['orion/util'], function(util) { //$NON-NLS-1$ //$NON-NLS-0$ - - /** - * @class A KeyBinding is an interface used to define keyboard shortcuts. - * @name orion.KeyBinding - * - * @property {Function} match The function to match events. - * @property {Function} equals The funtion to compare to key bindings. - * - * @see orion.KeyStroke - * @see orion.KeySequence - */ - - /** - * Constructs a new key stroke with the given key code, modifiers and event type. - * - * @param {String|Number} keyCode the key code. - * @param {Boolean} mod1 the primary modifier (usually Command on Mac and Control on other platforms). - * @param {Boolean} mod2 the secondary modifier (usually Shift). - * @param {Boolean} mod3 the third modifier (usually Alt). - * @param {Boolean} mod4 the fourth modifier (usually Control on the Mac). - * @param {String} type the type of event that the keybinding matches; either "keydown" or "keypress". - * - * @class A KeyStroke represents of a key code and modifier state that can be triggered by the user using the keyboard. - * @name orion.KeyStroke - * - * @property {String|Number} keyCode The key code. - * @property {Boolean} mod1 The primary modifier (usually Command on Mac and Control on other platforms). - * @property {Boolean} mod2 The secondary modifier (usually Shift). - * @property {Boolean} mod3 The third modifier (usually Alt). - * @property {Boolean} mod4 The fourth modifier (usually Control on the Mac). - * @property {String} [type=keydown] The type of event that the keybinding matches; either "keydown" or "keypress" - * - * @see orion.editor.TextView#setKeyBinding - */ - function KeyStroke (keyCode, mod1, mod2, mod3, mod4, type) { - this.type = type || "keydown"; //$NON-NLS-0$ - if (typeof(keyCode) === "string" && this.type === "keydown") { //$NON-NLS-1$ //$NON-NLS-0$ - this.keyCode = keyCode.toUpperCase().charCodeAt(0); - } else { - this.keyCode = keyCode; - } - this.mod1 = mod1 !== undefined && mod1 !== null ? mod1 : false; - this.mod2 = mod2 !== undefined && mod2 !== null ? mod2 : false; - this.mod3 = mod3 !== undefined && mod3 !== null ? mod3 : false; - this.mod4 = mod4 !== undefined && mod4 !== null ? mod4 : false; - } - KeyStroke.prototype = /** @lends orion.KeyStroke.prototype */ { - getKeys: function() { - return [this]; - }, - /** - * Determines either this key stroke matches the specifed event. It can match either a - * a whole sequence of key events or a single key event at a specified index. - *

        - * KeyStroke only matches single key events. KeySequence handles - * matching a sequence of events. - *

        - * TODO explain this better - * - * @param {DOMEvent|DOMEvent[]} e the key event or list of events to match. - * @param index the key event to match. - * @returns {Boolean} true whether the key binding matches the key event. - * - * @see orion.KeySequence#match - */ - match: function (e, index) { - if (index !== undefined) { - if (index !== 0) { - return false; - } - } else { - if (e instanceof Array) { - if (e.length > 1) { - return false; - } - e = e[0]; - } - } - if (e.type !== this.type) { - return false; - } - if (this.keyCode === e.keyCode || this.keyCode === String.fromCharCode(util.isOpera ? e.which : (e.charCode !== undefined ? e.charCode : e.keyCode))) { - var mod1 = util.isMac ? e.metaKey : e.ctrlKey; - if (this.mod1 !== mod1) { return false; } - if (this.type === "keydown") { //$NON-NLS-0$ - if (this.mod2 !== e.shiftKey) { return false; } - } - if (this.mod3 !== e.altKey) { return false; } - if (util.isMac && this.mod4 !== e.ctrlKey) { return false; } - return true; - } - return false; - }, - /** - * Returns whether this key stroke is the same as the given parameter. - * - * @param {orion.KeyBinding} kb the key binding to compare with. - * @returns {Boolean} whether or not the parameter and the receiver describe the same key binding. - */ - equals: function(kb) { - if (!kb) { return false; } - if (this.keyCode !== kb.keyCode) { return false; } - if (this.mod1 !== kb.mod1) { return false; } - if (this.mod2 !== kb.mod2) { return false; } - if (this.mod3 !== kb.mod3) { return false; } - if (this.mod4 !== kb.mod4) { return false; } - if (this.type !== kb.type) { return false; } - return true; - } - }; - - /** - * Constructs a new key sequence with the given key strokes. - * - * @param {orion.KeyStroke[]} keys the key strokes for this sequence. - * - * @class A KeySequence represents of a list of key codes and a modifiers state that can be triggered by the user using the keyboard. - * @name orion.KeySequence - * - * @property {orion.KeyStroke[]} keys the list of key strokes. - * - * @see orion.editor.TextView#setKeyBinding - */ - function KeySequence (keys) { - this.keys = keys; - } - KeySequence.prototype = /** @lends orion.KeySequence.prototype */ { - getKeys: function() { - return this.keys.slice(0); - }, - match: function (e, index) { - var keys = this.keys; - if (index !== undefined) { - if (index > keys.length) { - return false; - } - if (keys[index].match(e)) { - if (index === keys.length - 1) { - return true; - } - return index + 1; - } - return false; - } else { - if (!(e instanceof Array)) { - e = [e]; - } - if (e.length > keys.length) { - return false; - } - var i; - for (i = 0; i < e.length; i++) { - if (!keys[i].match(e[i])) { - return false; - } - } - if (i === keys.length) { - return true; - } - return i; - } - }, - /** - * Returns whether this key sequence is the same as the given parameter. - * - * @param {orion.KeyBinding|orion.KeySequence} kb the key binding to compare with. - * @returns {Boolean} whether or not the parameter and the receiver describe the same key binding. - */ - equals: function(kb) { - if (!kb.keys) { return false; } - if (kb.keys.length !== this.keys.length) { return false; } - for (var i=0; i" : "."; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 191: - character = binding.mod2 ? "?" : "/"; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 192: - character = binding.mod2 ? "~" : "`"; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 219: - character = binding.mod2 ? "{" : "["; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 220: - character = binding.mod2 ? "|" : "\\"; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 221: - character = binding.mod2 ? "}" : "]"; //$NON-NLS-1$ //$NON-NLS-0$ - break; - case 222: - character = binding.mod2 ? '"' : "'"; //$NON-NLS-1$ //$NON-NLS-0$ - break; - } - if (character) { - return userString+character; - } - if (binding.keyCode >= 112 && binding.keyCode <= 123) { - return userString+"F"+ (binding.keyCode - 111); //$NON-NLS-0$ - } - return userString+String.fromCharCode(binding.keyCode); - } - - function getUserKeyString(binding) { - var result = ""; - var keys = binding.getKeys(); - for (var i = 0; i < keys.length; i++) { - if (i !== 0) { - result += " "; //$NON-NLS-0$ - } - result += getUserKeyStrokeString(keys[i]); - } - return result; - } - - /** - * @name orion.uiUtils.getUserText - * @function - * @param {Object} options The options object - * @param {String} options.id - * @param {Element} options.refNode - * @param {Boolean} options.hideRefNode - * @param {String} options.initialText - * @param {Function} options.onComplete - * @param {Function} options.onEditDestroy - * @param {String} options.selectTo - * @param {Boolean} options.isInitialValid - * @param {Boolean} options.insertAsChild - */ - function getUserText(options) { - var id = options.id; - var refNode = options.refNode; - var hideRefNode = options.hideRefNode; - var initialText = options.initialText; - var onComplete = options.onComplete; - var onEditDestroy = options.onEditDestroy; - var selectTo = options.selectTo; - var isInitialValid = options.isInitialValid; - var insertAsChild = options.insertAsChild; - - var done = false; - var handler = function(isKeyEvent) { - return function(event) { - if (done) { - return; - } - var editBox = lib.node(id), - newValue = editBox.value; - if (!editBox) { - return; - } - if (isKeyEvent && event.keyCode === lib.KEY.ESCAPE) { - if (hideRefNode) { - refNode.style.display = "inline"; //$NON-NLS-0$ - } - done = true; - editBox.parentNode.removeChild(editBox); - if (onEditDestroy) { - onEditDestroy(); - } - return; - } - if (isKeyEvent && event.keyCode !== lib.KEY.ENTER) { - return; - } else if (newValue.length === 0 || (!isInitialValid && newValue === initialText)) { - if (hideRefNode) { - refNode.style.display = "inline"; //$NON-NLS-0$ - } - done = true; - } else { - onComplete(newValue); - if (hideRefNode && refNode.parentNode) { - refNode.style.display = "inline"; //$NON-NLS-0$ - } - done = true; - } - // some clients remove temporary dom structures in the onComplete processing, so check that we are still in DOM - if (editBox.parentNode) { - editBox.parentNode.removeChild(editBox); - } - if (onEditDestroy) { - onEditDestroy(); - } - }; - }; - - // Swap in an editable text field - var editBox = document.createElement("input"); //$NON-NLS-0$ - editBox.id = id; - editBox.value = initialText || ""; - if (insertAsChild) { - refNode.appendChild(editBox); - } else { - refNode.parentNode.insertBefore(editBox, refNode.nextSibling); - } - editBox.classList.add("userEditBoxPrompt"); //$NON-NLS-0$ - if (hideRefNode) { - refNode.style.display = "none"; //$NON-NLS-0$ - } - editBox.addEventListener("keydown", handler(true), false); //$NON-NLS-0$ - editBox.addEventListener("blur", handler(false), false); //$NON-NLS-0$ - window.setTimeout(function() { - editBox.focus(); - if (initialText) { - var box = lib.node(id); - var end = selectTo ? initialText.indexOf(selectTo) : -1; - if (end > 0) { - if(box.createTextRange) { - var range = box.createTextRange(); - range.collapse(true); - range.moveStart("character", 0); //$NON-NLS-0$ - range.moveEnd("character", end); //$NON-NLS-0$ - range.select(); - } else if(box.setSelectionRange) { - box.setSelectionRange(0, end); - } else if(box.selectionStart !== undefined) { - box.selectionStart = 0; - box.selectionEnd = end; - } - } else { - box.select(); - } - } - }, 0); - } - - /** - * Returns whether the given event should cause a reference - * to open in a new window or not. - * @param {Object} event The key event - * @name orion.util#openInNewWindow - * @function - */ - function openInNewWindow(event) { - var isMac = window.navigator.platform.indexOf("Mac") !== -1; //$NON-NLS-0$ - return (isMac && event.metaKey) || (!isMac && event.ctrlKey); - } - - /** - * Opens a link in response to some event. Whether the link - * is opened in the same window or a new window depends on the event - * @param {String} href The link location - * @name orion.util#followLink - * @function - */ - function followLink(href, event) { - if (event && openInNewWindow(event)) { - window.open(href); - } else { - window.location = href; - } - } - - function createButton(text, callback) { - var button = document.createElement("button"); //$NON-NLS-0$ - button.className = "orionButton commandButton commandMargins"; //$NON-NLS-0$ - button.addEventListener("click", function(e) { //$NON-NLS-0$ - callback(); - lib.stop(e); - }, false); - if (text) { - button.appendChild(document.createTextNode(text)); - } - return button; - } - - function createDropdownButton(parent, name, populateFunction) { - } - - /** - * Returns whether element or its parent is an HTML5 form element. - * @param {Element} element - * @param {Element} parentLimit - * @function - * @returns {Boolean} - */ - function isFormElement(element, parentLimit) { - if (!element || !element.tagName) return false; - switch (element.tagName.toLowerCase()) { - case "button": //$NON-NLS-0$ - case "fieldset": //$NON-NLS-0$ - case "form": //$NON-NLS-0$ - case "input": //$NON-NLS-0$ - case "keygen": //$NON-NLS-0$ - case "label": //$NON-NLS-0$ - case "legend": //$NON-NLS-0$ - case "meter": //$NON-NLS-0$ - case "optgroup": //$NON-NLS-0$ - case "output": //$NON-NLS-0$ - case "progress": //$NON-NLS-0$ - case "select": //$NON-NLS-0$ - case "textarea": //$NON-NLS-0$ - return true; - } - if (element.parentNode === parentLimit) return false; - return element.parentNode && isFormElement(element.parentNode, parentLimit); - } - - /** - * Returns the folder name from path. - * @param {String} filePath - * @param {String} fileName - * @param {Boolean} keepTailSlash - * @returns {String} - */ - function path2FolderName(filePath, fileName, keepTailSlash){ - var tail = keepTailSlash ? 0: 1; - return filePath.substring(0, filePath.length - encodeURIComponent(fileName).length - tail); - } - - function _timeDifference(timeStamp) { - var currentDate = new Date(); - var commitDate = new Date(timeStamp); - var difference = currentDate.getTime() - commitDate.getTime(); - var yearDiff = Math.floor(difference/1000/60/60/24/365); - difference -= yearDiff*1000*60*60*24*365; - var monthDiff = Math.floor(difference/1000/60/60/24/30); - difference -= monthDiff*1000*60*60*24*30; - var daysDifference = Math.floor(difference/1000/60/60/24); - difference -= daysDifference*1000*60*60*24; - var hoursDifference = Math.floor(difference/1000/60/60); - difference -= hoursDifference*1000*60*60; - var minutesDifference = Math.floor(difference/1000/60); - difference -= minutesDifference*1000*60; - var secondsDifference = Math.floor(difference/1000); - return {year: yearDiff, month: monthDiff, day: daysDifference, hour: hoursDifference, minute: minutesDifference, second: secondsDifference}; - } - - function _generateTimeString(number, singleTerm, term) { - if(number > 0) { - if(number === 1) { - return messages[singleTerm]; - } - return i18nUtil.formatMessage(messages[term], number); - } - return ""; - } - - /** - * Returns the time duration passed by now. E.g. "2 minutes", "an hour", "a day", "3 months", "2 years" - * @param {String} timeStamp - * @returns {String} If the duration is less than 1 minute, it returns empty string "". Otherwise it returns a duration value. - */ - function timeElapsed(timeStamp) { - var diff = _timeDifference(timeStamp); - var yearStr = _generateTimeString(diff.year, "a year", "years"); - var monthStr = _generateTimeString(diff.month, "a month", "months"); - var dayStr = _generateTimeString(diff.day, "a day", "days"); - var hourStr = _generateTimeString(diff.hour, "an hour", "hours"); - var minuteStr = _generateTimeString(diff.minute, "a minute", "minutes"); - var disPlayStr = ""; - if(yearStr) { - disPlayStr = diff.year > 0 ? yearStr : yearStr + monthStr; - } else if(monthStr) { - disPlayStr = diff.month > 0 ? monthStr : monthStr + dayStr; - } else if(dayStr) { - disPlayStr = diff.day > 0 ? dayStr : dayStr + hourStr; - } else if(hourStr) { - disPlayStr = diff.hour > 0 ? hourStr : hourStr + minuteStr; - } else if(minuteStr) { - disPlayStr = minuteStr; - } - return disPlayStr; - } - /** - * Returns the displayable time duration passed by now. E.g. "just now", "2 minutes ago", "an hour ago", "a day ago", "3 months ago", "2 years ago" - * @param {String} timeStamp - * @returns {String} If the duration is less than 1 minute, it returns empty string "just now". Otherwise it returns a duration value. - */ - function displayableTimeElapsed(timeStamp) { - var duration = timeElapsed(timeStamp); - if(duration) { - return i18nUtil.formatMessage(messages["timeAgo"], duration); - } - return messages["justNow"]; - } - //return module exports - return { - getUserKeyString: getUserKeyString, - getUserText: getUserText, - openInNewWindow: openInNewWindow, - followLink: followLink, - createButton: createButton, - createDropdownButton: createDropdownButton, - isFormElement: isFormElement, - path2FolderName: path2FolderName, - timeElapsed: timeElapsed, - displayableTimeElapsed: displayableTimeElapsed - }; -}); - - -define('text!orion/webui/submenutriggerbutton.html',[],function () { return '';}); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd, node*/ -(function(root, factory) { // UMD - if (typeof define === "function" && define.amd) { //$NON-NLS-0$ - define('orion/Deferred',factory); - } else if (typeof exports === "object") { //$NON-NLS-0$ - module.exports = factory(); - } else { - root.orion = root.orion || {}; - root.orion.Deferred = factory(); - } -}(this, function() { - var queue = [], - running = false; - - function run() { - var fn; - while ((fn = queue.shift())) { - fn(); - } - running = false; - } - - var runAsync = (function() { - if (typeof process !== "undefined" && typeof process.nextTick === "function") { - var nextTick = process.nextTick; - return function() { - nextTick(run); - }; - } else if (typeof MutationObserver === "function") { - var div = document.createElement("div"); - var observer = new MutationObserver(run); - observer.observe(div, { - attributes: true - }); - return function() { - div.setAttribute("class", "_tick"); - }; - } - return function() { - setTimeout(run, 0); - }; - })(); - - function enqueue(fn) { - queue.push(fn); - if (!running) { - running = true; - runAsync(); - } - } - - function noReturn(fn) { - return function(result) { - fn(result); - }; - } - - function settleDeferred(fn, result, deferred) { - try { - var listenerResult = fn(result); - var listenerThen = listenerResult && (typeof listenerResult === "object" || typeof listenerResult === "function") && listenerResult.then; - if (typeof listenerThen === "function") { - if (listenerResult === deferred.promise) { - deferred.reject(new TypeError()); - } else { - var listenerResultCancel = listenerResult.cancel; - if (typeof listenerResultCancel === "function") { - deferred._parentCancel = listenerResultCancel.bind(listenerResult); - } else { - delete deferred._parentCancel; - } - listenerThen.call(listenerResult, noReturn(deferred.resolve), noReturn(deferred.reject), noReturn(deferred.progress)); - } - } else { - deferred.resolve(listenerResult); - } - } catch (e) { - deferred.reject(e); - } - } - - - /** - * @name orion.Promise - * @class Interface representing an eventual value. - * @description Promise is an interface that represents an eventual value returned from the single completion of an operation. - * - *

        For a concrete class that implements Promise and provides additional API, see {@link orion.Deferred}.

        - * @see orion.Deferred - * @see orion.Deferred#promise - */ - /** - * @name then - * @function - * @memberOf orion.Promise.prototype - * @description Adds handlers to be called on fulfillment or progress of this promise. - * @param {Function} [onResolve] Called when this promise is resolved. - * @param {Function} [onReject] Called when this promise is rejected. - * @param {Function} [onProgress] May be called to report progress events on this promise. - * @returns {orion.Promise} A new promise that is fulfilled when the given onResolve or onReject - * callback is finished. The callback's return value gives the fulfillment value of the returned promise. - */ - /** - * Cancels this promise. - * @name cancel - * @function - * @memberOf orion.Promise.prototype - * @param {Object} reason The reason for canceling this promise. - * @param {Boolean} [strict] - */ - - /** - * @name orion.Deferred - * @borrows orion.Promise#then as #then - * @borrows orion.Promise#cancel as #cancel - * @class Provides abstraction over asynchronous operations. - * @description Deferred provides abstraction over asynchronous operations. - * - *

        Because Deferred implements the {@link orion.Promise} interface, a Deferred may be used anywhere a Promise is called for. - * However, in most such cases it is recommended to use the Deferred's {@link #promise} field instead, which exposes a - * simplified, minimally Promises/A+-compliant interface to callers.

        - */ - function Deferred() { - var result, state, listeners = [], - _this = this; - - function notify() { - var listener; - while ((listener = listeners.shift())) { - var deferred = listener.deferred; - var methodName = state === "fulfilled" ? "resolve" : "reject"; //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - var fn = listener[methodName]; - if (typeof fn === "function") { //$NON-NLS-0$ - settleDeferred(fn, result, deferred); - } else { - deferred[methodName](result); - } - } - } - - function _reject(error) { - delete _this._parentCancel; - state = "rejected"; - result = error; - if (listeners.length) { - enqueue(notify); - } - } - - function _resolve(value) { - function once(fn) { - return function(result) { - if (!state || state === "assumed") { - fn(result); - } - }; - } - delete _this._parentCancel; - try { - var valueThen = value && (typeof value === "object" || typeof value === "function") && value.then; - if (typeof valueThen === "function") { - if (value === _this) { - _reject(new TypeError()); - } else { - state = "assumed"; - var valueCancel = value && value.cancel; - if (typeof valueCancel !== "function") { - var deferred = new Deferred(); - value = deferred.promise; - try { - valueThen(deferred.resolve, deferred.reject, deferred.progress); - } catch (thenError) { - deferred.reject(thenError); - } - valueCancel = value.cancel; - valueThen = value.then; - } - result = value; - valueThen.call(value, once(_resolve), once(_reject)); - _this._parentCancel = valueCancel.bind(value); - } - } else { - state = "fulfilled"; - result = value; - if (listeners.length) { - enqueue(notify); - } - } - } catch (error) { - once(_reject)(error); - } - } - - function cancel() { - var parentCancel = _this._parentCancel; - if (parentCancel) { - delete _this._parentCancel; - parentCancel(); - } else if (!state) { - var cancelError = new Error("Cancel"); - cancelError.name = "Cancel"; - _reject(cancelError); - } - } - - - /** - * Resolves this Deferred. - * @name resolve - * @function - * @memberOf orion.Deferred.prototype - * @param {Object} value - * @returns {orion.Promise} - */ - this.resolve = function(value) { - if (!state) { - _resolve(value); - } - return _this; - }; - - /** - * Rejects this Deferred. - * @name reject - * @function - * @memberOf orion.Deferred.prototype - * @param {Object} error - * @param {Boolean} [strict] - * @returns {orion.Promise} - */ - this.reject = function(error) { - if (!state) { - _reject(error); - } - return _this; - }; - - /** - * Notifies listeners of progress on this Deferred. - * @name progress - * @function - * @memberOf orion.Deferred.prototype - * @param {Object} update The progress update. - * @returns {orion.Promise} - */ - this.progress = function(update) { - if (!state) { - listeners.forEach(function(listener) { - if (listener.progress) { - try { - listener.progress(update); - } catch (ignore) { - // ignore - } - } - }); - } - return _this.promise; - }; - - this.cancel = function() { - if (_this._parentCancel) { - setTimeout(cancel, 0); - } else { - cancel(); - } - return _this; - }; - - // Note: "then" ALWAYS returns before having onResolve or onReject called as per http://promises-aplus.github.com/promises-spec/ - this.then = function(onFulfill, onReject, onProgress) { - var deferred = new Deferred(); - deferred._parentCancel = _this.promise.cancel; - listeners.push({ - resolve: onFulfill, - reject: onReject, - progress: onProgress, - deferred: deferred - }); - if (state === "fulfilled" || state === "rejected") { - enqueue(notify); - } - return deferred.promise; - }; - - /** - * The promise exposed by this Deferred. - * @name promise - * @field - * @memberOf orion.Deferred.prototype - * @type orion.Promise - */ - this.promise = { - then: _this.then, - cancel: _this.cancel - }; - } - - /** - * Returns a promise that represents the outcome of all the input promises. - *

        When all is called with a single parameter, the returned promise has eager semantics, - * meaning that if any input promise rejects, the returned promise immediately rejects, without waiting for the rest of the - * input promises to fulfill.

        - * - * To obtain lazy semantics (meaning the returned promise waits for every input promise to fulfill), pass the - * optional parameter optOnError. - * @name all - * @function - * @memberOf orion.Deferred - * @static - * @param {orion.Promise[]} promises The input promises. - * @param {Function} [optOnError] Handles a rejected input promise. optOnError is invoked for every rejected - * input promise, and is passed the reason the input promise was rejected.

        optOnError can return a value, which - * allows it to act as a transformer: the return value serves as the final fulfillment value of the rejected promise in the - * results array generated by all. - * @returns {orion.Promise} A new promise. The returned promise is generally fulfilled to an Array whose elements - * give the fulfillment values of the input promises.

        However, if an input promise rejects and eager semantics is used, the - * returned promise will instead be fulfilled to a single error value.

        - */ - Deferred.all = function(promises, optOnError) { - var count = promises.length, - result = [], - rejected = false, - deferred = new Deferred(); - - deferred.then(undefined, function() { - rejected = true; - promises.forEach(function(promise) { - if (promise.cancel) { - promise.cancel(); - } - }); - }); - - function onResolve(i, value) { - if (!rejected) { - result[i] = value; - if (--count === 0) { - deferred.resolve(result); - } - } - } - - function onReject(i, error) { - if (!rejected) { - if (optOnError) { - try { - onResolve(i, optOnError(error)); - return; - } catch (e) { - error = e; - } - } - deferred.reject(error); - } - } - - if (count === 0) { - deferred.resolve(result); - } else { - promises.forEach(function(promise, i) { - promise.then(onResolve.bind(undefined, i), onReject.bind(undefined, i)); - }); - } - return deferred.promise; - }; - - /** - * Applies callbacks to a promise or to a regular object. - * @name when - * @function - * @memberOf orion.Deferred - * @static - * @param {Object|orion.Promise} value Either a {@link orion.Promise}, or a normal value. - * @param {Function} onResolve Called when the value promise is resolved. If value is not a promise, - * this function is called immediately. - * @param {Function} onReject Called when the value promise is rejected. If value is not a promise, - * this function is never called. - * @param {Function} onProgress Called when the value promise provides a progress update. If value is - * not a promise, this function is never called. - * @returns {orion.Promise} A new promise. - */ - Deferred.when = function(value, onResolve, onReject, onProgress) { - var promise, deferred; - if (value && typeof value.then === "function") { //$NON-NLS-0$ - promise = value; - } else { - deferred = new Deferred(); - deferred.resolve(value); - promise = deferred.promise; - } - return promise.then(onResolve, onReject, onProgress); - }; - - return Deferred; -})); -/******************************************************************************* - * @license - * Copyright (c) 2010,2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ - -define('orion/commandRegistry',[ - 'orion/commands', - 'orion/keyBinding', - 'orion/explorers/navigationUtils', - 'orion/i18nUtil', - 'orion/PageUtil', - 'orion/uiUtils', - 'orion/webui/littlelib', - 'orion/webui/dropdown', - 'orion/webui/tooltip', - 'text!orion/webui/submenutriggerbutton.html', - 'orion/metrics', - 'orion/Deferred', - 'orion/EventTarget' -], function(Commands, mKeyBinding, mNavUtils, i18nUtil, PageUtil, UIUtil, lib, mDropdown, mTooltip, SubMenuButtonFragment, mMetrics, mDeferred, mEventTarget) { - - /** - * Constructs a new command registry with the given options. - * @class CommandRegistry can render commands appropriate for a particular scope and DOM element. - * @name orion.commandregistry.CommandRegistry - * @param {Object} options The registry options object - * @param {orion.selection.Selection} [options.selection] Optional selection service. - */ - function CommandRegistry(options) { - this._commandList = {}; - this._contributionsByScopeId = {}; - this._activeBindings = {}; - this._urlBindings = {}; - this._pendingBindings = {}; // bindings for as-yet-unknown commands - this._parameterCollector = null; - this._init(options || {}); - } - CommandRegistry.prototype = /** @lends orion.commandregistry.CommandRegistry.prototype */ { - _init: function(options) { - this._selectionService = options.selection; - var self = this; - Commands.setKeyBindingProvider(function() { return self._activeBindings; }); - - // Make the CommandRegistry an EventTarget. This is somewhat different from the normal pattern - // so that we can override the normal 'addEventTarget' processing (see below) - mEventTarget.attach(CommandRegistry.prototype); - - // Add a listener so our bindings get updated immediately - this.addEventListener("bindingChanged", function(info) { - this._handleBindingChanges(info); - }.bind(this)); - - - /** - * @name addEventListener - * - * @description This is an override of the normal addEventListener to allow it to - * keep listeners synch'd with the current binding overrides whether or not they get added before or - * after the actual binding overrides have been retrieved from the preference store. - * - * Once the overrides preference is loaded any currently registered listeners are informed of the current - * binding overrides. Subsequent listeners are also informed when they get added. - * @param eventType The type of event being listened on. - * @param listener The listener to call when the event is dispatched. - */ - this.addEventListener = function(eventType, listener) { - // if we've already received the overrides from the preference store then broadcast them to the new listener - if (this._bindingOverrides && eventType === "bindingChanged") { - this._updateBindingOverrides(listener); - } - - // hook the listener for future changes - CommandRegistry.prototype.addEventListener.call(this, eventType, listener); - } - }, - - /** - * Process the provided URL to determine whether any commands should be invoked. Note that we never - * invoke a command callback by URL, only its parameter collector. If a parameter collector is not - * specified, commands in the URL will be ignored. - * - * @param {String} url a url that may contain URL bindings. - */ - processURL: function(url) { - for (var id in this._urlBindings) { - if (this._urlBindings[id] && this._urlBindings[id].urlBinding && this._urlBindings[id].command) { - var match = this._urlBindings[id].urlBinding.match(url); - if (match) { - var urlBinding = this._urlBindings[id]; - var command = urlBinding.command; - var invocation = urlBinding.invocation; - // If the command has not rendered (visibleWhen=false, etc.) we don't have an invocation. - if (invocation && invocation.parameters && command.callback) { - invocation.parameters.setValue(match.parameterName, match.parameterValue); - var self = this; - window.setTimeout(function() { - self._invoke(invocation); - }, 0); - return; - } - } - } - } - }, - - /** - * @param {String} commandId - * @returns {orion.commands.Command} - */ - findCommand: function(commandId) { - return this._commandList[commandId]; - }, - - /** - * Run the command with the specified commandId. - * - * @param {String} commandId the id of the command to run. - * @param {Object} item the item on which the command should run. - * @param {Object} handler the handler for the command. - * @param {orion.commands.ParametersDescription} [parameters] Parameters used on this invocation. Optional. - * @param {Object} [userData] Optional user data that should be attached to generated command callbacks. - * @param {DOMElement} [parent] Optional parent for the parameter collector. - * - * Note: The current implementation will only run the command if a URL binding has been - * specified, or if an item to run the command against has been specified. - */ - runCommand: function(commandId, item, handler, parameters, userData, parent) { - var self = this; - if (item) { - var command = this._commandList[commandId]; - var enabled = command && (command.visibleWhen ? command.visibleWhen(item) : true); - if (enabled && command.callback) { - var commandInvocation = new Commands.CommandInvocation(handler, item, userData, command, self); - commandInvocation.domParent = parent; - return self._invoke(commandInvocation, parameters); - } - } else { - //TODO should we be keeping invocation context for commands without bindings? - var binding = this._urlBindings[commandId]; - if (binding && binding.command) { - if (binding.command.callback) { - return self._invoke(binding.invocation, parameters); - } - } - } - }, - - /** - * Return the default selection service that is being used when commands should apply against a selection. - */ - getSelectionService: function() { - return this._selectionService; - }, - - - /** - * Interface for a parameter collector. - * @name orion.commandregistry.ParameterCollector - * @class - */ - /** - * Open a parameter collector and return the dom node where parameter information should be inserted. - * @name orion.commandregistry.ParameterCollector#open - * @function - * @param {String|DOMElement} commandNode the node containing the triggering command - * @param {Function} fillFunction a function that will fill the parameter area - * @param {Function} onClose a function that will be called when the parameter area is closed - * @returns {Boolean} Whether the node is open. - */ - /** - * Closes any active parameter collectors. - * @name orion.commandregistry.ParameterCollector#close - * @function - */ - /** - * Returns a function that can be used to fill a specified parent node with parameter information. - * @name orion.commandregistry.ParameterCollector#getFillFunction - * @function - * @param {orion.commands.CommandInvocation} the command invocation used when gathering parameters - * @param {Function} closeFunction an optional function called when the area must be closed. - * @returns {Function} a function that can fill the specified dom node with parameter collection behavior - */ - /** - * Collect parameters for the given command. - * @name orion.commandregistry.ParameterCollector#collectParameters - * @function - * @param {orion.commands.CommandInvocation} commandInvocation The command invocation - * @returns {Boolean} Whether or not required parameters were collected. - */ - /** - * Provide an object that can collect parameters for a given "tool" command. When a command that - * describes its required parameters is shown in a toolbar (as an image, button, or link), clicking - * the command will invoke any registered parameterCollector before calling the command's callback. - * This hook allows a page to define a standard way for collecting required parameters that is - * appropriate for the page architecture. If no parameterCollector is specified, then the command callback - * will be responsible for collecting parameters. - * - * @param {orion.commandregistry.ParameterCollector} parameterCollector - */ - setParameterCollector: function(parameterCollector) { - this._parameterCollector = parameterCollector; - }, - - /** - * Open a parameter collector suitable for collecting information about a command. - * Once a collector is created, the specified function is used to fill it with - * information needed by the command. This method is used for commands that cannot - * rely on a simple parameter description to collect parameters. Commands that describe - * their required parameters do not need to use this method because the command framework - * will open and close parameter collectors as needed and call the command callback with - * the values of those parameters. - * - * @param {DOMElement} node the dom node that is displaying the command, or a node in the parameter collector area - * @param {Function} fillFunction a function that will fill the parameter area - * @param {Function} onClose a function that will be called when the user closes the collector - */ - openParameterCollector: function(node, fillFunction, onClose) { - if (this._parameterCollector) { - this._parameterCollector.close(); - this._parameterCollector.open(node, fillFunction, onClose); - } - }, - - /** - * Open a parameter collector to confirm a command. - * - * @param {DOMElement} node the dom node that is displaying the command - * @param {String} message the message to show when confirming the command - * @param {String} yesString the label to show on a yes/true choice - * @param {String} noString the label to show on a no/false choice - * @param {Boolean} modal indicates whether the confirmation prompt should be modal. - * @param {Function} onConfirm a function that will be called when the user confirms the command. The function - * will be called with boolean indicating whether the command was confirmed. - */ - confirm: function(node, message, yesString, noString, modal, onConfirm) { - var result = false; - if (this._parameterCollector && !modal) { - var self = this; - var okCallback = function() {onConfirm(result);}; - var closeFunction = function(){self._parameterCollector.close();} - var fillFunction = function(parent, buttonParent) { - var label = document.createElement("span"); //$NON-NLS-0$ - label.classList.add("parameterPrompt"); //$NON-NLS-0$ - label.textContent = message; - - parent.appendChild(label); - var yesButton = document.createElement("button"); //$NON-NLS-0$ - yesButton.addEventListener("click", function(event) { //$NON-NLS-0$ - result = true; - okCallback(); - closeFunction(); - }, false); - buttonParent.appendChild(yesButton); - yesButton.appendChild(document.createTextNode(yesString)); //$NON-NLS-0$ - yesButton.className = "dismissButton"; //$NON-NLS-0$ - var button = document.createElement("button"); //$NON-NLS-0$ - button.addEventListener("click", function(event) { //$NON-NLS-0$ - result = false; - closeFunction(); - }, false); - buttonParent.appendChild(button); - button.appendChild(document.createTextNode(noString)); //$NON-NLS-0$ - button.className = "dismissButton"; //$NON-NLS-0$ - return yesButton; - }; - this._parameterCollector.close(); - var opened = this._parameterCollector.open(node, fillFunction, function(){}); - if (!opened) { - var tooltip = new mTooltip.Tooltip({ - node: node, - afterHiding: function() { - this.destroy(); - }, - trigger: "click", //$NON-NLS-0$ - position: ["below", "right", "above", "left"] //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - }); - var parameterArea = tooltip.contentContainer(); - parameterArea.classList.add("parameterPopup"); //$NON-NLS-0$ - var originalFocusNode = window.document.activeElement; - closeFunction = function() { - if (originalFocusNode) { - originalFocusNode.focus(); - } - tooltip.destroy(); - }; - var messageArea = document.createElement("div"); //$NON-NLS-0$ - messageArea.classList.add("parameterMessage"); //$NON-NLS-0$ - parameterArea.appendChild(messageArea); - - var buttonArea = document.createElement("div"); //$NON-NLS-0$ - parameterArea.appendChild(buttonArea); - buttonArea.classList.add("layoutRight"); //$NON-NLS-0$ - buttonArea.classList.add("parametersDismiss"); //$NON-NLS-0$ - - var focusNode = fillFunction(messageArea, buttonArea); - tooltip.show(); - if (focusNode) { - window.setTimeout(function() { - focusNode.focus(); - if (focusNode.select) { - focusNode.select(); - } - }, 0); - } - } - return; - } - result = window.confirm(message); - onConfirm(result); - }, - - /** - * Close any active parameter collector. This method should be used to deactivate a - * parameter collector that was opened with openParameterCollector. - * Commands that describe their required parameters do not need to use this method - * because the command framework will open and close parameter collectors as needed and - * call the command callback with the values of those parameters. - */ - closeParameterCollector: function() { - if (this._parameterCollector) { - this._parameterCollector.close(); - } - }, - - /** - * Returns whether this registry has been configured to collect command parameters - * - * @returns {Boolean} whether or not this registry is configured to collect parameters. - */ - collectsParameters: function() { - return this._parameterCollector; - }, - - /* - * Invoke the specified command, collecting parameters if necessary. This is used inside the framework - * when the user invokes a command. If parameters are specified, then these parameters should be used - * in lieu of the invocation's parameters. - * - */ - _invoke: function(commandInvocation, parameters) { - return this._collectAndInvoke(commandInvocation.makeCopy(parameters), false); - }, - - /* - * This method is the actual implementation for collecting parameters and invoking a callback. - * "forceCollect" specifies whether we should always collect parameters or consult the parameters description to see if we should. - */ - _collectAndInvoke: function(commandInvocation, forceCollect, cancelCallback) { - if (commandInvocation) { - // Establish whether we should be trying to collect parameters. - if (this._parameterCollector && commandInvocation.parameters && commandInvocation.parameters.hasParameters() && - (forceCollect || commandInvocation.parameters.shouldCollectParameters())) { - var collecting = false; - commandInvocation.parameters.updateParameters(commandInvocation); - // Consult shouldCollectParameters() again to verify we still need collection. Due to updateParameters(), the CommandInvocation - // could have dynamically set its parameters to null (meaning no collection should be done). - if (commandInvocation.parameters.shouldCollectParameters()) { - collecting = this._parameterCollector.collectParameters(commandInvocation,cancelCallback); - // The parameter collector cannot collect. We will do a default implementation using a popup. - if (!collecting) { - var tooltip = new mTooltip.Tooltip({ - node: commandInvocation.domNode || commandInvocation.domParent, - afterHiding: function() { - this.destroy(); - if (commandInvocation.domParent) commandInvocation.domParent.classList.remove("parameterPopupOpen"); //$NON-NLS-1$ - }, - trigger: "click", //$NON-NLS-0$ - position: ["below", "right", "above", "left"] //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - }); - var parameterArea = tooltip.contentContainer(); - parameterArea.classList.add("parameterPopup"); //$NON-NLS-0$ - var originalFocusNode = window.document.activeElement; - var focusNode = this._parameterCollector.getFillFunction(commandInvocation, function() { - if (originalFocusNode) { - originalFocusNode.focus(); - } - tooltip.destroy(); - if (commandInvocation.domParent) commandInvocation.domParent.classList.remove("parameterPopupOpen"); //$NON-NLS-0$ - }, cancelCallback)(parameterArea); - tooltip.show(); - if (commandInvocation.domParent) commandInvocation.domParent.classList.add("parameterPopupOpen"); //$NON-NLS-0$ - if (focusNode) { - window.setTimeout(function() { - focusNode.focus(); - if (focusNode.select) { - focusNode.select(); - } - }, 0); - } - collecting = true; - } - } - if (!collecting) { - mMetrics.logEvent("command", "invoke", commandInvocation.command.id); //$NON-NLS-2$ //$NON-NLS-1$ - // Just call the callback with the information we had. - return commandInvocation.command.callback.call(commandInvocation.handler || window, commandInvocation); - } - } else { - mMetrics.logEvent("command", "invoke", commandInvocation.command.id); //$NON-NLS-2$ //$NON-NLS-1$ - // We should not be trying to collect parameters, just call the callback. - return commandInvocation.command.callback.call(commandInvocation.handler || window, commandInvocation); - } - } else { - window.console.log("Client attempted to invoke command without an available (rendered) command invocation"); //$NON-NLS-0$ - } - }, - - /** - * Collect the parameters specified in the given command invocation. If parameters are - * collected successfully, invoke the command's callback. This method is used by clients who want to - * control the timing of parameter collection. For example, if a command must be executed before it can - * be determined what parameters are known, the client can try the command in the callback and then call - * this function if parameters are needed. In this case, clients typically configure the parameters description - * options with "options.clientWillCollect" set to true. - * - * @see orion.commands.ParametersDescription - * - * @param {orion.commands.CommandInvocation} commandInvocation the current invocation of the command - */ - collectParameters: function(commandInvocation,cancelCallback) { - this._collectAndInvoke(commandInvocation, true, cancelCallback); - }, - - /** - * Show the keybindings that are registered with the command registry inside the specified target node. - * @param {KeyAssistPanel} keyAssist the key assist panel - */ - showKeyBindings: function(keyAssist) { - var scopes = {}; - var binding; - // see commands.js _processKey - function execute(activeBinding) { - return function() { - Commands.executeBinding(activeBinding); - }; - } - - var bindings = []; - for (var aBinding in this._activeBindings) { - binding = this._activeBindings[aBinding]; - if (binding && binding.keyBinding && binding.command && (binding.command.name || binding.command.tooltip)) { - bindings.push(binding); - } - } - bindings.sort(function (a, b) { - var ta = a.command.name || a.command.tooltip; - var tb = b.command.name || b.command.tooltip; - return ta.localeCompare(tb); - }); - for (var i=0; i 0) { - keyAssist.createHeader(scopedBinding); - scopes[scopedBinding].forEach(function(binding) { - keyAssist.createItem(binding.keyBinding, binding.command.name || binding.command.tooltip, binding.command.id, execute(binding)); - }); - } - } - }, - - _handleBindingChanges: function(args) { - // Change the command's current binding - var command = this.findCommand(args.id); - if (command) { - // Add the new binding (overrides any existing one) - var curBinding = this._activeBindings[args.id]; - if (curBinding) { - curBinding.keyBinding = args.newBinding; - } else { - this._addBinding(command, "key", args.newBinding); //$NON-NLS-1$ - } - } - - // Now see if we have any menu items to update - if (this._renderedCommands && this._renderedCommands[args.id]) { - var scopes = this._renderedCommands[args.id]; - var keys = Object.keys(scopes); - for (var i=0; i= 0; i--) { - var override = this._bindingOverrides[i]; - if (override.id === cmdId) { - return override.newBinding; - } - } - return null; - }, - - /** - * Add a command to the command registry. Nothing will be shown in the UI - * until this command is referenced in a contribution. - * @param {orion.commands.Command} command The command being added. - * @see registerCommandContribution - */ - addCommand: function(command) { - this._commandList[command.id] = command; - // Resolve any pending key/url bindings against this command - var pending = this._pendingBindings[command.id]; - if (pending) { - var _self = this; - pending.forEach(function(binding) { - _self._addBinding(command, binding.type, binding.binding, binding.bindingOnly); - }); - delete this._pendingBindings[command.id]; - } - }, - - /** - * Registers a command group and specifies visual information about the group. - * @param {String} scopeId The id of a DOM element in which the group should be visible. Required. - * When commands are rendered for a particular element, the group will be shown only if its scopeId - * matches the id being rendered. - * @param {String} groupId The id of the group, must be unique. May be used for a dom node id of - * the element representing the group - * @param {Number} position The relative position of the group within its parent. Required. - * @param {String} [title] The title of the group, optional - * @param {String} [parentPath] The path of parent groups, separated by '/'. For example, - * a path of "group1Id/group2Id" indicates that the group belongs as a child of - * group2Id, which is itself a child of group1Id. Optional. - * @param {String} [emptyGroupMessage] A message to show if the group is empty and the user activates the UI element - * representing the group. Optional. If not specified, then the group UI element won't be shown when it is empty. - * @param {String} [imageClass] CSS class of an image to use for this group. - * @param {String} [tooltip] Tooltip to show on this group. If not provided, and the group uses an imageClass, - * the title will be used as the tooltip. - * @param {String} [selectionClass] CSS class to be appended when the command button is selected. Optional. - * @param {String} or {boolean} [defaultActionId] Id of an action from this group that should be invoked when the group is selected. This will add an - * arrow to the group that will open the dropdown. Optionally this can be set to true instead of adding a particular action. - * If set to true the group will be rendered as if there was a default action, but instead of invoking the default action it will - * open the dropdown. Optional. - * @param {String} [extraClasses] A string containing space separated css classes that will be applied to group button - */ - addCommandGroup: function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId, extraClasses) { - if (!this._contributionsByScopeId[scopeId]) { - this._contributionsByScopeId[scopeId] = {}; - } - var parentTable = this._contributionsByScopeId[scopeId]; - if (parentPath) { - parentTable = this._createEntryForPath(parentTable, parentPath); - } - - if (parentTable[groupId]) { - // update existing group definition if info has been supplied - if (title) { - parentTable[groupId].title = title; - } - if (position) { - parentTable[groupId].position = position; - } - if (imageClass) { - parentTable[groupId].imageClass = imageClass; - } - if (tooltip) { - parentTable[groupId].tooltip = tooltip; - } - if (selectionClass) { - parentTable[groupId].selectionClass = selectionClass; - } - - if (extraClasses) { - parentTable[groupId].extraClass = extraClasses; - } - - if(defaultActionId === true){ - parentTable[groupId].pretendDefaultActionId = true; - } else { - parentTable[groupId].defaultActionId = defaultActionId; - } - - - parentTable[groupId].emptyGroupMessage = emptyGroupMessage; - } else { - // create new group definition - parentTable[groupId] = {title: title, - position: position, - emptyGroupMessage: emptyGroupMessage, - imageClass: imageClass, - tooltip: tooltip, - selectionClass: selectionClass, - defaultActionId: defaultActionId === true ? null : defaultActionId, - pretendDefaultActionId: defaultActionId === true, - children: {}, - extraClasses: extraClasses}; - parentTable.sortedContributions = null; - } - }, - - _createEntryForPath: function(parentTable, parentPath) { - if (parentPath) { - var segments = parentPath.split("/"); //$NON-NLS-0$ - segments.forEach(function(segment) { - if (segment.length > 1) { - if (!parentTable[segment]) { - // empty slot with children - parentTable[segment] = {position: 0, children: {}}; - parentTable.sortedContributions = null; - } - parentTable = parentTable[segment].children; - } - }); - } - return parentTable; - }, - - /** - * Register a selection service that should be used for certain command scopes. - * @param {String} scopeId The id describing the scope for which this selection service applies. Required. - * Only contributions made to this scope will use the selection service. - * @param {orion.selection.Selection} selectionService the selection service for the scope. - */ - registerSelectionService: function(scopeId, selectionService) { - if (!this._contributionsByScopeId[scopeId]) { - this._contributionsByScopeId[scopeId] = {}; - } - this._contributionsByScopeId[scopeId].localSelectionService = selectionService; - }, - - /** - * Register the serviceRegistry. Use this gain access to any other services we need (i.e. the preferenceService) - * @param serviceRegistry {orion.serviceregistry.ServiceRegistry} the current service registry. - */ - setServiceRegistry: function(serviceRegistry) { - this._serviceRegistry = serviceRegistry; - this._prefService = serviceRegistry.getService("orion.core.preference"); //$NON-NLS-1$ - - if (this._prefService) { - // Get the overrides from the preference store - this._getBindingOverrides().then(function(overrides) { - this._bindingOverrides = overrides; - - // Update all folks that are listening - this._updateBindingOverrides(); - }.bind(this)); - - // listen for changes from other pages - this._prefService.addEventListener("changed", function (e) { - if (e.namespace === "/KeyBindings") { //$NON-NLS-1$ - // Refresh the binding overrides - this._getBindingOverrides().then(function(overrides) { - if (overrides.length > this._bindingOverrides.length) { - // handle any new changes - for (var i = this._bindingOverrides.length; i < overrides.length; i++) { - var override = overrides[i]; - var bindingChangeEvent = {type: "bindingChanged", id: override.id, newBinding: override.newBinding, //$NON-NLS-1$ - prevBinding: override.prevBinding}; - this.dispatchEvent(bindingChangeEvent); - } - } - this._bindingOverrides = overrides; - }.bind(this)); - } - }.bind(this)); - } - }, - - _updateBindingOverrides: function(listener) { - for(var i = 0; i < this._bindingOverrides.length; i++) { - var override = this._bindingOverrides[i]; - var bindingChangeEvent = {type: "bindingChanged", id: override.id, newBinding: override.newBinding, //$NON-NLS-1$ - prevBinding: override.prevBinding}; - if (listener) { - listener(bindingChangeEvent); - } else { - this.dispatchEvent(bindingChangeEvent); - } - } - }, - - /** - * Register a command contribution, which identifies how a command appears - * on a page and how it is invoked. - * @param {String} scopeId The id describing the scope of the command. Required. - * This scope id is used when rendering commands. - * @param {String} commandId the id of the command. Required. - * @param {Number} position the relative position of the command within its parent. Required. - * @param {String} [parentPath=null] the path of any parent groups, separated by '/'. For example, - * a path of "group1Id/group2Id/command" indicates that the command belongs as a child of - * group2Id, which is itself a child of group1Id. Optional. - * @param {boolean} [bindingOnly=false] if true, then the command is never rendered, but the key or URL binding is hooked. - * @param {orion.KeyBinding} [keyBinding] a keyBinding for the command. Optional. - * @param {orion.commands.URLBinding} [urlBinding] a url binding for the command. Optional. - * @param {Object} [handler] the object that should perform the command for this contribution. Optional. - */ - registerCommandContribution: function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) { - if (!this._contributionsByScopeId[scopeId]) { - this._contributionsByScopeId[scopeId] = {}; - } - var parentTable = this._contributionsByScopeId[scopeId]; - if (parentPath) { - parentTable = this._createEntryForPath(parentTable, parentPath); - } - - // store the contribution - parentTable[commandId] = {position: position, handler: handler}; - - var command; - if (this._bindingOverrides) { - var bindingOverride = this.getBindingOverride(commandId, keyBinding); - if (bindingOverride) { - keyBinding = bindingOverride; - } - } - // add to the bindings table now - if (keyBinding) { - command = this._commandList[commandId]; - if (command) { - this._addBinding(command, "key", keyBinding, bindingOnly); //$NON-NLS-0$ - } else { - this._addPendingBinding(commandId, "key", keyBinding, bindingOnly); //$NON-NLS-0$ - } - } - - // add to the url key table - if (urlBinding) { - command = this._commandList[commandId]; - if (command) { - this._addBinding(command, "url", urlBinding, bindingOnly); //$NON-NLS-0$ - } else { - this._addPendingBinding(commandId, "url", urlBinding, bindingOnly); //$NON-NLS-0$ - } - } - // get rid of sort cache because we have a new contribution - parentTable.sortedContributions = null; - }, - - unregisterCommandContribution: function(scopeId, commandId, parentPath){ - if (!this._contributionsByScopeId[scopeId]) { - // scope does not exist - return; - } - delete this._commandList[commandId]; - delete this._activeBindings[commandId]; - delete this._urlBindings[commandId]; - delete this._pendingBindings[commandId]; - var parentTable = this._contributionsByScopeId[scopeId]; - if(parentPath){ - var segments = parentPath.split("/"); //$NON-NLS-0$ - segments.forEach(function(segment) { - if (segment.length > 1) { - if (!parentTable[segment]) { - // command does not exist in given path - return; - } - parentTable = parentTable[segment].children; - } - }); - } - delete parentTable[commandId]; - - parentTable.sortedContributions = null; - }, - - /** - * @param {String} type One of "key", "url". - */ - _addBinding: function(command, type, binding, bindingOnly) { - if (!command.id) { - throw new Error("No command id: " + command); //$NON-NLS-1$ - } - if (type === "key") { //$NON-NLS-0$ - this._activeBindings[command.id] = {command: command, keyBinding: binding, bindingOnly: bindingOnly}; - } else if (type === "url") { //$NON-NLS-0$ - this._urlBindings[command.id] = {command: command, urlBinding: binding, bindingOnly: bindingOnly}; - } - }, - - /** - * Remembers a key or url binding that has not yet been resolved to a command. - * @param {String} type One of "key", "url". - */ - _addPendingBinding: function(commandId, type, binding, bindingOnly) { - this._pendingBindings[commandId] = this._pendingBindings[commandId] || []; - this._pendingBindings[commandId].push({ - type: type, - binding: binding, - bindingOnly: bindingOnly - }); - }, - - _checkForTrailingSeparator: function(parent, style, autoRemove) { - var last; - if (style === "tool" || style === "button") { //$NON-NLS-1$ //$NON-NLS-0$ - last = parent.childNodes.length > 0 ? parent.childNodes[parent.childNodes.length-1] : null; - if (last && last.classList.contains("commandSeparator")) { //$NON-NLS-0$ - if (autoRemove) { - parent.removeChild(last); - return false; - } - return true; - } - } - if (style === "menu") { //$NON-NLS-0$ - var items = lib.$$array("li > *", parent); //$NON-NLS-0$ - if (items.length > 0 && items[items.length - 1].classList.contains("dropdownSeparator")) { //$NON-NLS-0$ - last = items[items.length - 1]; - if (autoRemove) { - // reachy reachy. Remove the anchor's li parent - last.parentNode.parentNode.removeChild(last.parentNode); - return false; - } else { - return true; - } - } - } - return false; - }, - - /** - * Render the commands that are appropriate for the given scope. - * @param {String} scopeId The id describing the scope for which we are rendering commands. Required. - * Only contributions made to this scope will be rendered. - * @param {DOMElement} parent The element in which commands should be rendered. If commands have been - * previously rendered into this element, it is up to the caller to empty any previously generated content. - * @param {Object} [items] An item or array of items to which the command applies. Optional. If no - * items are specified and a selection service was specified at creation time, then the selection - * service will be used to determine which items are involved. - * @param {Object} handler The object that should perform the command - * @param {String} renderType The style in which the command should be rendered. "tool" will render - * a tool image in the dom. "button" will render a text button. "menu" will render menu items. - * @param {Object} [userData] Optional user data that should be attached to generated command callbacks - * @param {Object[]} [domNodeWrapperList] Optional an array used to record any DOM nodes that are rendered during this call. - * If an array is provided, then as commands are rendered, an object will be created to represent the command's node. - * The object will always have the property "domNode" which contains the node created for the command. If the command is - * rendered using other means (toolkit widget) then the optional property "widget" should contain the toolkit - * object that represents the specified dom node. - */ - renderCommands: function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) { - if (typeof(scopeId) !== "string") { //$NON-NLS-0$ - throw "a scope id for rendering must be specified"; //$NON-NLS-0$ - } - parent = lib.node(parent); - if (!parent) { - throw "no parent"; //$NON-NLS-0$ - } - - var contributions = this._contributionsByScopeId[scopeId]; - - if (!items && contributions) { - var selectionService = contributions.localSelectionService || this._selectionService; - var self = this; - if (selectionService) { - selectionService.getSelections(function(selections) { - self.renderCommands(scopeId, parent, selections, handler, renderType, userData); - }); - } - return; - } - if (contributions) { - this._render(scopeId, contributions, parent, items, handler, renderType || "button", userData, domNodeWrapperList); //$NON-NLS-0$ - - // If the last thing we rendered was a group, it's possible there is an unnecessary trailing separator. - this._checkForTrailingSeparator(parent, renderType, true); - } - }, - - /** - * Destroy all DOM nodes and any other resources used by rendered commands. - * This call does not remove the commands from the command registry. Clients typically call this - * function to empty a command area when a client wants to render the commands again due to some - * change in state. - * @param {String|DOMElement} parent The id or DOM node that should be emptied. - */ - destroy: function(parent) { - parent = lib.node(parent); - if (!parent) { - throw "no parent"; //$NON-NLS-0$ - } - while (parent.hasChildNodes()) { - var node = parent.firstChild; - if (node.commandTooltip) { - node.commandTooltip.destroy(); - } - if (node.emptyGroupTooltip) { - node.emptyGroupTooltip.destroy(); - } - this.destroy(node); - parent.removeChild(node); - } - }, - - _render: function(scopeId, contributions, parent, items, handler, renderType, userData, domNodeWrapperList, extraClasses) { - // sort the items - var sortedByPosition = contributions.sortedContributions; - - if (!sortedByPosition) { - sortedByPosition = []; - var pushedItem = false; - for (var key in contributions) { - if (Object.prototype.hasOwnProperty.call(contributions, key)) { - var item = contributions[key]; - if (item && typeof(item.position) === "number") { //$NON-NLS-0$ - item.id = key; - sortedByPosition.push(item); - pushedItem = true; - } - } - } - if (pushedItem) { - sortedByPosition.sort(function(a,b) { - return a.position-b.position; - }); - contributions.sortedContributions = sortedByPosition; - } - } - // now traverse the sorted contributions and render as we go - var index = 0; - var self = this; - sortedByPosition.forEach(function(contribution) { - var id, invocation; - - if( !contribution.imageClass ){ - contribution.imageClass = null; - } - - if (contribution.children && Object.getOwnPropertyNames(contribution.children).length > 0) { - - var childContributions = contribution.children; - var created; - if (renderType === "tool" || renderType === "button") { //$NON-NLS-0$ //$NON-NLS-1$ - if (contribution.title) { - // We need a named menu button. We used to first render into the menu and only - // add a menu button in the dom when we knew items were actually rendered. - // For performance, though, we need to be asynchronous in traversing children, so we will - // add the menu button always and then remove it if we don't need it. - // If we wait until the end of asynch processing to add the menu button, the layout will have - // to be redone. The down side to always adding the menu button is that we may find out we didn't - // need it after all, which could cause layout to change. - var defaultInvocation; - if(contribution.defaultActionId){ - contribution.pretendDefaultActionId = contribution.defaultActionId === true; - var defaultChild = self._commandList[contribution.defaultActionId]; - if(defaultChild && (defaultChild.visibleWhen ? defaultChild.visibleWhen(items) : true)){ - defaultInvocation = new Commands.CommandInvocation(handler, items, userData, defaultChild, self); - defaultInvocation.domParent = parent; - } else { - contribution.pretendDefaultActionId = true; - } - } - - created = self._createDropdownMenu(parent, contribution.title, null /*nested*/, null /*populateFunc*/, contribution.imageClass, contribution.tooltip, contribution.selectionClass, null, defaultInvocation, contribution.pretendDefaultActionId, contribution.extraClasses); - if(domNodeWrapperList){ - mNavUtils.generateNavGrid(domNodeWrapperList, created.menuButton); - } - - // render the children asynchronously - if (created) { -// window.setTimeout(function() { - self._render(scopeId, contribution.children, created.menu, items, handler, "menu", userData, domNodeWrapperList); //$NON-NLS-0$ - // special post-processing when we've created a menu in an image bar. We want to get rid - // of a trailing separator in the menu first, and then decide if our menu is necessary - self._checkForTrailingSeparator(created.menu, "menu", true); //$NON-NLS-0$ - // now determine if we actually needed the menu or not - - if (created.menu.childNodes.length === 0) { - if (contribution.emptyGroupMessage) { - if (!created.menuButton.emptyGroupTooltip) { - created.menuButton.emptyGroupTooltip = new mTooltip.Tooltip({ - node: created.menuButton, - text: contribution.emptyGroupMessage, - trigger: "click", //$NON-NLS-0$ - position: ["below", "right", "above", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - }); - } - } else { - if(domNodeWrapperList){ - mNavUtils.removeNavGrid(domNodeWrapperList, created.menuButton); - } - function remove(child) { - if (child && child.parentNode) { - child.parentNode.removeChild(child); - } - } - remove(created.menu); - remove(created.menuButton); - remove(created.destroyButton); - } - } else { - created.menuButton.style.visibility = "visible"; //$NON-NLS-0$ - } -// }, 0); - } - } else { - // rendering a group using a separator on each end. We do it synchronously because order matters with - // non grouped items. - var sep; - // Only draw a separator if there is a non-separator preceding it. - if (parent.childNodes.length > 0 && !self._checkForTrailingSeparator(parent, renderType)) { - sep = self.generateSeparatorImage(parent); - } - self._render(scopeId, childContributions, parent, items, handler, renderType, userData, domNodeWrapperList); - - // make sure that more than just the separator got rendered before rendering a trailing separator - if (parent.childNodes.length > 0) { - var lastRendered = parent.childNodes[parent.childNodes.length - 1]; - if (lastRendered !== sep) { - sep = self.generateSeparatorImage(parent); - } - } - } - } else { - // group within a menu - if (contribution.title) { - var subMenu = self._createDropdownMenu(parent, contribution.title, true, null, null, contribution.imageClass); - if (subMenu) { - self._render(scopeId, childContributions, subMenu.menu, items, handler, "menu", userData, domNodeWrapperList); //$NON-NLS-0$ - // special post-processing when we've created a menu in an image bar. We want to get rid - // of a trailing separator in the menu first, and then decide if our menu is necessary - self._checkForTrailingSeparator(subMenu.menu, "menu", true); //$NON-NLS-0$ - // If no items rendered in the submenu, we don't need it. - if (subMenu.menu.childNodes.length === 0 && subMenu.destroyButton) { - parent.removeChild(subMenu.destroyButton); - } - } - } else { - // menu items with leading and trailing separators - // don't render a separator if there is nothing preceding - if (parent.childNodes.length > 0) { - self._generateMenuSeparator(parent); - } - // synchronously render the children since order matters - self._render(scopeId, childContributions, parent, items, handler, renderType, userData, domNodeWrapperList); - // Add a trailing separator if children rendered. - if (parent.childNodes.length > 0) { - self._generateMenuSeparator(parent); - } - } - } - } else { - // processing atomic commands - var command = self._commandList[contribution.id]; - var render = command ? true : false; - var keyBinding = null; - var urlBinding = null; - if (command) { - invocation = new Commands.CommandInvocation(contribution.handler || handler, items, userData, command, self); - invocation.domParent = parent; - var enabled = false; - try { - enabled = render && (command.visibleWhen ? command.visibleWhen(items, invocation) : true); - } catch (e) { - console.log(e); - throw e; - } - // ensure that keybindings are bound to the current handler, items, and user data - if (self._activeBindings[command.id] && self._activeBindings[command.id].keyBinding) { - keyBinding = self._activeBindings[command.id]; - if (enabled) { - keyBinding.invocation = invocation; - } else { - keyBinding.invocation = null; - } - // if it is a binding only, don't render the command. - if (keyBinding.bindingOnly) { - render = false; - } - } - - // same for url bindings - if (self._urlBindings[command.id] && self._urlBindings[command.id].urlBinding) { - urlBinding = self._urlBindings[command.id]; - if (enabled) { - urlBinding.invocation = invocation; - } else { - urlBinding.invocation = null; - } - if (urlBinding.bindingOnly) { - render = false; - } - } - render = render && enabled; - } - if (render) { - if (command.choiceCallback) { - // special case. The item wants to provide a set of choices - var menuParent; - var nested; - if (renderType === "tool" || renderType === "button") { //$NON-NLS-1$ //$NON-NLS-0$ - menuParent = parent; - nested = false; - if (parent.nodeName.toLowerCase() === "ul") { //$NON-NLS-0$ - menuParent = document.createElement("li"); //$NON-NLS-0$ - parent.appendChild(menuParent); - } - } else { - menuParent = parent; - nested = true; - } - // dropdown button - var populateFunction = function(menu) { - command.populateChoicesMenu(menu, items, handler, userData, self); - }; - self._createDropdownMenu(menuParent, command.name, nested, populateFunction.bind(command), command.imageClass, command.tooltip || command.title, command.selectionClass, command.positioningNode); - } else { - // Rendering atomic commands as buttons or menus - invocation.handler = invocation.handler || this; - invocation.domParent = parent; - var element; - var onClick = function(event) { - self._invoke(invocation); - }; - if (renderType === "menu") { - var bindingString = null; - if (keyBinding && keyBinding.keyBinding) { - bindingString = UIUtil.getUserKeyString(keyBinding.keyBinding); - } - element = Commands.createCommandMenuItem(parent, command, invocation, null, onClick, bindingString); - - // Register this command as being rendered (do we want to register all the commands ?) - invocation.onClick = onClick; // cache the handler - self._registerRenderedCommand(command.id, scopeId, invocation); - } else if (renderType === "quickfix") { - id = renderType + command.id + index; // using the index ensures unique ids within the DOM when a command repeats for each item - var commandDiv = document.createElement("div"); //$NON-NLS-0$ - parent.appendChild(commandDiv); - parent.classList.add('quickFixList'); - element = Commands.createQuickfixItem(commandDiv, command, invocation, onClick, self._prefService); - } else { - id = renderType + command.id + index; // // using the index ensures unique ids within the DOM when a command repeats for each item - element = Commands.createCommandItem(parent, command, invocation, id, null, renderType === "tool", onClick); - } - mNavUtils.generateNavGrid(domNodeWrapperList, element); - invocation.domNode = element; - index++; - } - } - } - }); - }, - - /* - * private. Parent must exist in the DOM. - */ - _createDropdownMenu: function(parent, name, nested, populateFunction, icon, tooltip, selectionClass, positioningNode, defaultInvocation, pretendDefaultActionId, extraClasses) { - parent = lib.node(parent); - // We create dropdowns asynchronously so it's possible that the parent has been removed from the document - // by the time we are called. If so, don't bother building a submenu for an orphaned menu. - if (!parent || !lib.contains(document.body, parent)) { - return null; - } - var menuButton, newMenu, dropdownArrow; - var destroyButton, menuParent = parent; - if (nested) { - var range = document.createRange(); - range.selectNode(parent); - var buttonFragment = range.createContextualFragment(SubMenuButtonFragment); - // bind name to fragment variable - lib.processTextNodes(buttonFragment, {ButtonText: name}); - parent.appendChild(buttonFragment); - destroyButton = parent.lastChild; - newMenu = destroyButton.lastChild; - menuButton = newMenu.previousSibling; - menuButton.dropdown = new mDropdown.Dropdown({dropdown: newMenu, populate: populateFunction, parentDropdown: parent.dropdown}); - newMenu.dropdown = menuButton.dropdown; - } else { - if (parent.nodeName.toLowerCase() === "ul") { //$NON-NLS-0$ - menuParent = document.createElement("li"); //$NON-NLS-0$ - parent.appendChild(menuParent); - destroyButton = menuParent; - } - var buttonCss = null; - if (icon) { - buttonCss = "dropdownButtonWithIcon"; //$NON-NLS-0$ // This class distinguishes dropdown buttons with an icon from those without - tooltip = tooltip || name; // No text and no tooltip => fallback to name - } - tooltip = icon ? (tooltip || name) : tooltip; - var created = Commands.createDropdownMenu(menuParent, name, populateFunction, buttonCss, icon, false, selectionClass, positioningNode, defaultInvocation || pretendDefaultActionId, extraClasses); - dropdownArrow = created.dropdownArrow; - menuButton = created.menuButton; - if (dropdownArrow) { - if (defaultInvocation) { - defaultInvocation.domNode = created.menuButton; - } - var self = this; - menuButton.onclick = function(evt){ - var bounds = lib.bounds(dropdownArrow); - if ((evt.clientX >= bounds.left || pretendDefaultActionId === true) && created.dropdown) { - created.dropdown.toggle(evt); - } else { - self._invoke(defaultInvocation); - } - }; - if (created.dropdown) { - menuButton.onkeydown = function(evt) { - if (lib.KEY.DOWN === evt.keyCode) { - created.dropdown.toggle(evt); - lib.stop(evt); - } - }; - } - } - newMenu = created.menu; - var tooltipText, hasDefault = defaultInvocation && defaultInvocation.command && (defaultInvocation.command.tooltip || defaultInvocation.command.name); - if (hasDefault) { - tooltipText = defaultInvocation.command.tooltip || defaultInvocation.command.name; - } else { - tooltipText = tooltip; - } - if (tooltipText) { - menuButton.commandTooltip = new mTooltip.Tooltip({ - node: menuButton, - text: tooltipText, - position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - }); - } - } - - return {menuButton: menuButton, menu: newMenu, dropdown: menuButton.dropdown, destroyButton: destroyButton, dropdownArrow: dropdownArrow}; - }, - - _generateMenuSeparator: function(dropdown) { - if (!this._checkForTrailingSeparator(dropdown, "menu")) { //$NON-NLS-0$ - var item = document.createElement("li"); //$NON-NLS-0$ - item.classList.add("dropdownSeparator"); //$NON-NLS-0$ - var sep = document.createElement("span"); //$NON-NLS-0$ - sep.classList.add("dropdownSeparator"); //$NON-NLS-0$ - item.appendChild(sep); - dropdown.appendChild(item); - } - }, - - - /** - * Add a dom node appropriate for using a separator between different groups - * of commands. This function is useful when a page is precisely arranging groups of commands - * (in a table or contiguous spans) and needs to use the same separator that the command registry - * would use when rendering different groups of commands. - * @param {DOMElement} parent - */ - generateSeparatorImage: function(parent) { - var sep; - if (parent.nodeName.toLowerCase() === "ul") { //$NON-NLS-0$ - sep = document.createElement("li"); //$NON-NLS-0$ - parent.appendChild(sep); - } else { - sep = document.createElement("span"); //$NON-NLS-0$ - parent.appendChild(sep); - } - sep.classList.add("core-sprite-sep"); // location in sprite //$NON-NLS-0$ - sep.classList.add("imageSprite"); // sets sprite background //$NON-NLS-0$ - sep.classList.add("commandSeparator"); //$NON-NLS-0$ - return sep; - } - - }; // end command registry prototype - CommandRegistry.prototype.constructor = CommandRegistry; - - /** - * A URL binding defines how a URL token is bound to a command, and what parameter - * is provided - * @param {String} token the token in a URL query parameter that identifies the command - * @param {String} parameterName the name of the parameter being specified in the value of the query - * - * @name orion.commands.URLBinding - * @class - */ - function URLBinding (token, parameterName) { - this.token = token; - this.parameterName = parameterName; - } - URLBinding.prototype = /** @lends orion.commands.URLBinding.prototype */ { - /** - * Returns whether this URL binding matches the given URL - * - * @param url the URL. - * @returns {Boolean} whether this URL binding matches - */ - match: function (url) { - //ensure this is only the hash portion - var params = PageUtil.matchResourceParameters(url); - if (typeof params[this.token] !== "undefined") { //$NON-NLS-0$ - this.parameterValue = params[this.token]; - return this; - } - return null; - } - }; - URLBinding.prototype.constructor = URLBinding; - - /** - * A CommandEventListener defines an (optional) UI event listener. - * - * @param {String} name the name of the event - * @param {Function} handler the event handler function. The handler is provided two parameters on invocation, i. e. - * the DOM event and the undergoing commandInvocation objects. - * @param {Boolean} [capture] the (optional) flag used to determine whether to capture the event or not - */ - function CommandEventListener (event, handler, capture) { - this.event = event; - this.handler = handler; - this.capture = capture || false; - } - CommandEventListener.prototype.constructor = CommandEventListener; - - - /** - * A CommandParameter defines a parameter that is required by a command. - * - * @param {String} name the name of the parameter - * @param {String} type the type of the parameter, one of the HTML5 input types, or "boolean" - * @param {String} [label] the (optional) label that should be used when showing the parameter - * @param {String} [value] the (optional) default value for the parameter - * @param {Number} [lines] the (optional) number of lines that should be shown when collecting the value. Valid for type "text" only. - * @param {Object|Array} [eventListeners] the (optional) array or single command event listener - * @param {Function} [validator] a (optional) validator function - * - * @name orion.commands.CommandParameter - * @class - */ - function CommandParameter (name, type, label, value, lines, eventListeners, validator) { - this.name = name; - this.type = type; - this.label = label; - this.value = value; - this.lines = lines || 1; - this.validator = validator; - - this.eventListeners = (Array.isArray(eventListeners)) ? - eventListeners : (eventListeners ? [eventListeners] : []); - } - CommandParameter.prototype = /** @lends orion.commands.CommandParameter.prototype */ { - /** - * Returns whether the user has requested to assign values to optional parameters - * - * @returns {Boolean} whether the user has requested optional parameters - */ - optionsRequested: function () { - return this.optionsRequested; - } - }; - CommandParameter.prototype.constructor = CommandParameter; - - /** - * A ParametersDescription defines the parameters required by a command, and whether there are additional - * optional parameters that can be specified. The command registry will attempt to collect required parameters - * before calling a command callback. The command is expected to provide UI for optional parameter, when the user has - * signaled a desire to provide optional information. - * - * @param {orion.commands.CommandParameter[]} parameters an array of CommandParameters that are required - * @param {Object} options The parameters description options object. - * @param {Boolean} options.hasOptionalParameters specifies whether there are additional optional parameters - * that could be collected. If true, then the collector will show an affordance for invoking an - * additional options collector and the client can use the optionsRequested flag to determine whether - * additional parameters should be shown. Default is false. - * @param {Boolean} options.clientCollect specifies whether the client will collect the parameters in its - * callback. Default is false, which means the callback will not be called until an attempt has - * been made to collect parameters. - * @param {Function} options.getParameterElement a function used to look up the DOM element for a given parameter. - * @param {Function} options.getSubmitName a function used to return a name to use for the Submit button. - * - * @param {Function} [getParameters] a function used to define the parameters just before the command is invoked. This is used - * when a particular invocation of the command will change the parameters. The function will be passed - * the CommandInvocation as a parameter. Any stored parameters will be ignored, and - * replaced with those returned by this function. If no parameters (empty array or null) are returned, - * then it is assumed that the command should not try to obtain parameters before invoking the command's callback - * (similar to options.clientCollect === true). - * @name orion.commands.ParametersDescription - * @class - */ - function ParametersDescription (parameters, options, getParameters) { - this._storeParameters(parameters); - this._hasOptionalParameters = options && options.hasOptionalParameters; - this._options = options; // saved for making a copy - this.optionsRequested = false; - this.getParameters = getParameters; - this.clientCollect = options && options.clientCollect; - this.getParameterElement = options && options.getParameterElement; - this.getSubmitName = options && options.getSubmitName; - this.getCancelName = options && options.getCancelName; - this.message = options && options.message; - } - ParametersDescription.prototype = /** @lends orion.commands.ParametersDescription.prototype */ { - - _storeParameters: function(parameterArray) { - this.parameterTable = null; - if (parameterArray) { - var table = this.parameterTable = {}; - parameterArray.forEach(function(parameter) { - table[parameter.name] = parameter; - }); - } - }, - - /** - * Update the stored parameters by running the stored function if one has been supplied. - */ - updateParameters: function(commandInvocation) { - if (typeof this.getParameters === "function") { //$NON-NLS-0$ - this._storeParameters(this.getParameters(commandInvocation)); - } - }, - - /** - * Returns a boolean indicating whether any parameters have been specified. - * - * @returns {Boolean} whether there are parameters to collect. - */ - hasParameters: function() { - return this.parameterTable !== null; - }, - - /** - * Returns a boolean indicating whether a collector should try to collect parameters. If there - * are no parameters specified, or the client is expecting to collect them, this will return - * false. - * - * @returns {Boolean} indicating whether the caller should attempt to collect the parameters. - */ - shouldCollectParameters: function() { - return !this.clientCollect && this.hasParameters(); - }, - - /** - * Returns the CommandParameter with the given name, or null if there is no parameter - * by that name. - * - * @param {String} name the name of the parameter - * @returns {orion.commands.CommandParameter} the parameter with the given name - */ - parameterNamed: function(name) { - return this.parameterTable[name]; - }, - - /** - * Returns the value of the parameter with the given name, or null if there is no parameter - * by that name, or no value for that parameter. - * - * @param {String} name the name of the parameter - * @returns {String} the value of the parameter with the given name - */ - valueFor: function(name) { - var parm = this.parameterTable[name]; - if (parm) { - return parm.value; - } - return null; - }, - - /** - * Sets the value of the parameter with the given name. - * - * @param {String} name the name of the parameter - * @param {String} value the value of the parameter with the given name - */ - setValue: function(name, value) { - var parm = this.parameterTable[name]; - if (parm) { - parm.value = value; - } - }, - - /** - * Evaluate the specified function for each parameter. - * - * @param {Function} func a function which operates on a provided command parameter - * - */ - forEach: function(func) { - for (var key in this.parameterTable) { - if (this.parameterTable[key].type && this.parameterTable[key].name) { - func(this.parameterTable[key]); - } - } - }, - - validate: function(name, value) { - var parm = this.parameterTable[name]; - if (parm && parm.validator) { - return parm.validator(value); - } - return true; - }, - - /** - * Make a copy of this description. Used for collecting values when a client doesn't want - * the values to be persisted across different objects. - * - */ - makeCopy: function() { - var parameters = []; - this.forEach(function(parm) { - var newParm = new CommandParameter(parm.name, parm.type, parm.label, parm.value, parm.lines, parm.eventListeners, parm.validator); - parameters.push(newParm); - }); - var copy = new ParametersDescription(parameters, this._options, this.getParameters); - // this value may have changed since the options - copy.clientCollect = this.clientCollect; - copy.message = this.message; - return copy; - - }, - /** - * Return a boolean indicating whether additional optional parameters are available. - */ - hasOptionalParameters: function() { - return this._hasOptionalParameters; - } - }; - ParametersDescription.prototype.constructor = ParametersDescription; - - //return the module exports - return { - CommandRegistry: CommandRegistry, - URLBinding: URLBinding, - ParametersDescription: ParametersDescription, - CommandParameter: CommandParameter, - CommandEventListener: CommandEventListener - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/navigate/nls/messages',{ - root:true -}); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/navigate/nls/root/messages',{//Default message bundle - "Navigator": "Navigator", - "Strings Xtrnalizr": "Strings Xtrnalizr", - "Externalize strings": "Externalize strings from JavaScript files in this folder.", - "NotSupportFileSystem":"${0} is not supported in this file system", - "SrcNotSupportBinRead":"Source file service does not support binary read", - "TargetNotSupportBinWrite":"Target file service does not support binary write", - "NoFileSrv": "No matching file service for location: ${0}", - "Choose a Folder": "Choose a Folder", - "Copy of ${0}": "Copy of ${0}", - "EnterName": "Enter a new name for '${0}'", - "ChooseFolder": "Choose folder...", - "Rename": "Rename", - "RenameFilesFolders": "Rename the selected files or folders", - "CompareEach": "Compare with each other", - "Compare 2 files": "Compare the selected 2 files with each other", - "Compare with...": "Compare With...", - "CompareFolders": "Compare the selected folder with a specified folder", - "Delete": "Delete", - "Unknown item": "Unknown item", - "delete item msg": "Are you sure you want to delete these ${0} items?", - "DeleteTrg": "Are you sure you want to delete '${0}'?", - "Zip": "Zip", - "ZipDL": "Create a zip file of the folder contents and download it", - "New File": "File", - "Create a new file": "Create a new file", - "FailedToCreateProject":"Failed to create project: ${0}", - "FailedToCreateFile": "Failed to create file: ${0}", - "CopyFailed": "Copy operation failed", - "MoveFailed": "Move operation failed", - "Name:": "Name:", - "New Folder": "Folder", - "Folder name:": "Folder name:", - "Create a new folder": "Create a new folder", - "Creating folder": "Creating folder", - "Folder": "Folder", - "Create an empty folder": "Create an empty folder", - "CreateEmptyMsg": "Create an empty folder on the Orion server. You can import, upload, or create content in the editor.", - "Sample HTML5 Site": "Sample HTML5 Site", - "Generate a sample": "Generate a sample", - "Generate an HTML5 \"Hello World\" website, including JavaScript, HTML, and CSS files.": "Generate an HTML5 \"Hello World\" website, including JavaScript, HTML, and CSS files.", - "Creating a folder for ${0}": "Creating a folder for ${0}", - "SFTP Import": "SFTP Import", - "Import content from SFTP": "Import content from SFTP", - "Imported Content": "Imported Content", - "Upload a Zip": "Upload a Zip", - "Upload content from a local zip file": "Upload content from a local zip file", - "Uploaded Content": "Uploaded Content", - "Clone Git Repository": "Clone Git Repository", - "Clone a git repository": "Clone a git repository", - "Link to Server": "Link to Server", - "LinkContent": "Link to existing content on the server", - "CreateLinkedFolder": "Create a folder that links to an existing folder on the server.", - "Server path:": "Server path:", - "NameLocationNotClear": "The name and server location were not specified.", - "Go Up": "Go Up", - "GoUpToParent": "Move up to the parent folder", - "Go Into": "Go Into", - "GoSelectedFolder": "Move into the selected folder", - "File or zip archive": "File or Zip Archive", - "ImportLcFile": "Import a file or zip archive from your local file system", - "SFTP from...": "SFTP", - "CpyFrmSftp": "Copy files and folders from a specified SFTP connection", - "Importing from ${0}": "Importing from ${0}", - "SFTP to...": "SFTP", - "CpyToSftp": "Copy files and folders to a specified SFTP location", - "Exporting": "Exporting to ${0}", - "Pasting ${0}": "Pasting ${0}", - "Copy to": "Copy to", - "Move to": "Move to", - "Copying ${0}": "Copying ${0}", - "Moving ${0}": "Moving ${0}", - "Renaming ${0}": "Renaming ${0}", - "Deleting ${0}": "Deleting ${0}", - "Creating ${0}": "Creating ${0}", - "Linking to ${0}": "Linking to ${0}", - "MvToLocation": "Move files and folders to a new location", - "Cut": "Cut", - "Copy": "Copy", - "Fetching children of ": "Fetching children of ", - "Paste": "Paste", - "Open With": "Open With", - "Loading ": "Loading ", - "New": "New", - "File": "File", - "Actions": "Actions", - "Orion Content": "Orion Content", - "File System": "File System", - "Create new content": "Create new content", - "Import from HTTP...": "HTTP", - "File URL:": "File URL:", - "ImportURL": "Import a file from a URL and optionally unzip it", - "Unzip *.zip files:": "Unzip *.zip files:", - "Extracted from:": "Extracted from:", - "FolderDropNotSupported": "Did not drop ${0}. Folder drop is not supported in this browser.", - "CreateFolderErr": "You cannot copy files directly into the workspace. Create a folder first.", - "Unzip ${0}?": "Unzip ${0}?", - "Upload progress: ": "Upload progress: ", - "Uploading ": "Uploading ", - "Cancel upload": "Cancel upload", - "UploadingFileErr": "Uploading the following file failed: ", - "Enter project name:": "Enter project name:", - "Create new project" : "Create new project", - "Creating project ${0}": "Creating project ${0}", - "NoFile": "Use the ${0} menu to create new files and folders. Click a file to start coding.", - "Download": "Download", - "Download_tooltips": "Download the file contents as the displayed name", - "Downloading...": "Reading file contents...", - "Download not supported": "Contents download is not supported in this browser.", - "gettingContentFrom": "Getting content from ", - "confirmLaunchDelete": "Delete Launch Configuration \"${0}\" ?", - "deletingLaunchConfiguration": "Deleting launch configuration...", - "deployTo": "Deploy to ", - "deploy": "Deploy ", - "connect": "Connect", - "fetchContent": "Fetch content", - "fetchContentOf": "Fetch content of ", - "disconnectFromProject": "Disconnect from project", - "doNotTreatThisFolder": "Do not treat this folder as a part of the project", - "checkStatus": "Check status", - "checkApplicationStatus": "Check application status", - "checkApplicationState": "Check application state", - "stop": "Stop", - "start": "Start", - "stopApplication": "Stop the App", - "startApplication": "Start the application", - "manage": "Manage", - "manageThisApplicationOnRemote": "Manage this application on remote server", - "deleteLaunchConfiguration": "Delete this launch configuration", - "editLaunchConfiguration": "Edit this launch configuration", - "deployThisApplication": "Deploy the App from the Workspace", - "associatedFolder": "Associated Folder", - "associateAFolderFromThe": "Associate a folder from the workspace with this project.", - "convertToProject": "Convert to project", - "convertThisFolderIntoA": "Convert this folder into a project", - "thisFolderIsAProject": "This folder is a project already.", - "basic": "Basic", - "createAnEmptyProject.": "Create an empty project.", - "sFTP": "SFTP", - "createAProjectFromAn": "Create a project from an SFTP site.", - 'readMeCommandName': 'Readme File', //$NON-NLS-0$ //$NON-NLS-1$ - 'readMeCommandTooltip': 'Create a README.md file in this project', //$NON-NLS-0$ //$NON-NLS-1$ - 'zipArchiveCommandName': 'Zip Archive', //$NON-NLS-0$ //$NON-NLS-1$ - 'zipArchiveCommandTooltip': 'Create a project from a local zip archive.', //$NON-NLS-0$ //$NON-NLS-1$ - 'Url:': 'Url:', //$NON-NLS-0$ //$NON-NLS-1$ - 'notZip' : 'The following files are not zip files: ${0}. Would you like to continue the import?', //$NON-NLS-0$ //$NON-NLS-1$ - 'notZipMultiple' : 'There are multiple non-zip files being uploaded. Would you like to continue the import?', //$NON-NLS-0$ //$NON-NLS-1$ - "Cancel": "Cancel", //$NON-NLS-0$ //$NON-NLS-1$ - "Ok": "Ok", //$NON-NLS-0$ //$NON-NLS-1$ - "missingCredentials": "Enter the ${0} authentication credentials associated with ${1} to check its status.", //$NON-NLS-0$ //$NON-NLS-1$ - "deploying": "deploying", //$NON-NLS-0$ //$NON-NLS-1$ - "starting": "restarting", //$NON-NLS-0$ //$NON-NLS-1$ - "stopping": "stopping", //$NON-NLS-0$ //$NON-NLS-1$ - "checkingStateShortMessage": "checking status" //$NON-NLS-0$ //$NON-NLS-1$ -}); - - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -/** @namespace The global container for eclipse APIs. */ -define('orion/fileClient',[ - 'i18n!orion/navigate/nls/messages', - "orion/Deferred", - "orion/i18nUtil", - 'orion/EventTarget' -], function(messages, Deferred, i18nUtil, EventTarget) { - /** - * This helper method implements invocation of the service call, - * with retry on authentication error if needed. - * @private - */ - function _doServiceCall(fileService, funcName, funcArgs) { - //if the function is not implemented in the file service, we throw an exception to the caller - if(!fileService[funcName]){ - throw new Error(i18nUtil.formatMessage(messages["NotSupportFileSystem"], funcName)); - } - return fileService[funcName].apply(fileService, funcArgs); - } - - /** - * @description Copy - * @private - * @param sourceService - * @param sourceLocation - * @param targetService - * @param targetLocation - * @returns returns - */ - function _copy(sourceService, sourceLocation, targetService, targetLocation) { - - if (!sourceService.readBlob) { - throw new Error(messages["SrcNotSupportBinRead"]); - } - - if (!targetService.writeBlob) { - throw new Error(messages["TargetNotSupportBinWrite"]); - } - - if (sourceLocation[sourceLocation.length -1] !== "/") { - return _doServiceCall(sourceService, "readBlob", [sourceLocation]).then(function(contents) { //$NON-NLS-1$ - return _doServiceCall(targetService, "writeBlob", [targetLocation, contents]); //$NON-NLS-1$ - }); - } - - var temp = targetLocation.substring(0, targetLocation.length - 1); - var targetName = decodeURIComponent(temp.substring(temp.lastIndexOf("/")+1)); - var parentLocation = temp.substring(0, temp.lastIndexOf("/")+1); - - return _doServiceCall(targetService, "createFolder", [parentLocation, targetName]).then(function() { //$NON-NLS-1$ - return; - }, function() { - return; - }).then(function() { - return _doServiceCall(sourceService, "fetchChildren", [sourceLocation]).then(function(children) { //$NON-NLS-1$ - var results = []; - for(var i = 0; i < children.length; ++i) { - var childSourceLocation = children[i].Location; - var childTemp = childSourceLocation; - if (children[i].Directory) { - childTemp = childSourceLocation.substring(0, childSourceLocation.length - 1); - } - var childName = decodeURIComponent(childTemp.substring(childTemp.lastIndexOf("/")+1)); - - var childTargetLocation = targetLocation + encodeURIComponent(childName); - if (children[i].Directory) { - childTargetLocation += "/"; - } - results[i] = _copy(sourceService, childSourceLocation, targetService, childTargetLocation); - } - return Deferred.all(results); - }); - }); - } - - - /** - * Creates a new file client. - * @class The file client provides a convenience API for interacting with file services - * provided by plugins. This class handles authorization, and authentication-related - * error handling. - * @name orion.fileClient.FileClient - */ - function FileClient(serviceRegistry, filter) { - var _patterns; - var _services; - var _names; - - EventTarget.attach(this); - /* @callback */ - function _noMatch(location) { - var d = new Deferred(); - d.reject(messages["No Matching FileService for location:"] + location); - return d; - } - - var _fileSystemsRoots = []; - var _allFileSystemsService = { - /* @callback */ - fetchChildren: function() { - var d = new Deferred(); - d.resolve(_fileSystemsRoots); - return d; - }, - /* @callback */ - createWorkspace: function() { - var d = new Deferred(); - d.reject(messages["no file service"]); - return d; - }, - /* @callback */ - loadWorkspaces: function() { - var d = new Deferred(); - d.reject(messages['no file service']); - return d; - }, - /* @callback */ - loadWorkspace: function(location) { - var d = new Deferred(); - window.setTimeout(function() { - d.resolve({ - Directory: true, - Length: 0, - LocalTimeStamp: 0, - Name: messages["File Servers"], - Location: "/", - Children: _fileSystemsRoots, - ChildrenLocation: "/" - }); - }, 100); - return d; - }, - search: _noMatch, - createProject: _noMatch, - createFolder: _noMatch, - createFile: _noMatch, - deleteFile: _noMatch, - moveFile: _noMatch, - copyFile: _noMatch, - read: _noMatch, - write: _noMatch - }; - - /** - * @description Initialize the service - * @private - */ - function init() { - if (_services) { return; } - _patterns = []; - _services = []; - _names = []; - - var allReferences = serviceRegistry.getServiceReferences("orion.core.file"); //$NON-NLS-1$ - var _references = allReferences; - if (filter) { - _references = []; - for(var i = 0; i < allReferences.length; ++i) { - if (filter(allReferences[i])) { - _references.push(allReferences[i]); - } - } - } - _references.sort(function (ref1, ref2) { - var ranking1 = ref1.getProperty("ranking") || 0; //$NON-NLS-1$ - var ranking2 = ref2.getProperty("ranking") || 0; //$NON-NLS-1$ - return ranking1 - ranking2; - }); - for(var j = 0; j < _references.length; ++j) { - _fileSystemsRoots[j] = { - Directory: true, - Length: 0, - LocalTimeStamp: 0, - Location: _references[j].getProperty("top"), //$NON-NLS-1$ - ChildrenLocation: _references[j].getProperty("top"), //$NON-NLS-1$ - Name: _references[j].getProperty("Name") || _references[j].getProperty("NameKey") //$NON-NLS-1$ //$NON-NLS-2$ - }; - - var filetop = _references[j].getProperty("top"); //$NON-NLS-1$ - var patternStringArray = _references[j].getProperty("pattern") || (filetop ? filetop.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1") : ""); //$NON-NLS-1$ //$NON-NLS-2$ - if (!Array.isArray(patternStringArray)) { - patternStringArray = [patternStringArray]; - } - var patterns = []; - for (var k = 0; k < patternStringArray.length; k++) { - var patternString = patternStringArray[k]; - if (patternString[0] !== "^") { - patternString = "^" + patternString; - } - patterns.push(new RegExp(patternString)); - } - _patterns[j] = patterns; - _services[j] = serviceRegistry.getService(_references[j]); - _names[j] = _references[j].getProperty("Name") || _references[j].getProperty("NameKey"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * @description Returns the index of the service for the given item location - * @function - * @private - * @param {String} itemLocation - * @returns returns - */ - this._getServiceIndex = function(itemLocation) { - init(); - // client must specify via "/" when a multi file service tree is truly wanted - if (itemLocation === "/") { - return -1; - } else if (!itemLocation || itemLocation.length && itemLocation.length === 0) { - // TODO we could make the default file service a preference but for now we use the first one - return _services[0] ? 0 : -1; - } - for(var i = 0; i < _patterns.length; ++i) { - for (var j = 0; j < _patterns[i].length; j++) { - if (_patterns[i][j].test(itemLocation)) { - return i; - } - } - } - throw new Error(i18nUtil.formatMessage(messages['NoFileSrv'], itemLocation)); - }; - /** - * Returns the file service managing this location - * @param {String} itemLocation The location of the item - * @private - * @returns {FileClient} The service for the given item - */ - this._getService = function(itemLocation) { - var i = this._getServiceIndex(itemLocation); - return i === -1 ? _allFileSystemsService : _services[i]; - }; - /** - * Returns the name of the file service managing this location - * @param {String} itemLocation The location of the item - * @private - * @return {String} The name of this file service - */ - this._getServiceName = function(itemLocation) { - var i = this._getServiceIndex(itemLocation); - return i === -1 ? _allFileSystemsService.Name : _names[i]; - }; - /** - * Returns the root url of the file service managing this location - * @param {String} itemLocation The location of the item - * @private - * @return {String} The root URL of the given item - */ - this._getServiceRootURL = function(itemLocation) { - var i = this._getServiceIndex(itemLocation); - return i === -1 ? _allFileSystemsService.Location : _fileSystemsRoots[i].Location; - }; - - this._frozenEvent = {type: "Changed"}; - this._eventFrozenMode = false; - - serviceRegistry.registerService("orion.core.file.client", this); //$NON-NLS-1$ - } - - FileClient.prototype = /**@lends orion.fileClient.FileClient.prototype */ { - freezeChangeEvents: function() { - this._frozenEvent = {type: "Changed"}; - this._eventFrozenMode = true; - }, - thawChangeEvents: function() { - this._eventFrozenMode = false; - this.dispatchEvent(this._frozenEvent); //$NON-NLS-0$ - }, - isEventFrozen: function() { - return this._eventFrozenMode; - }, - - /** - * Returns the file service managing this location - * @param {String} itemLocation The location of the item - * @public - * @returns {FileClient} The service for the given item - */ - getService: function(itemLocation) { - return this._getService(itemLocation); - }, - - /** - * Returns the name of the file service managing this location - * @param {String} itemLocation The location of the item - * @public - * @return {String} The name of this file service - */ - fileServiceName: function(itemLocation) { - return this._getServiceName(itemLocation); - }, - - /** - * Returns the root url of the file service managing this location - * @param {String} itemLocation The location of the item - * @public - * @return {String} The root URL of the given item - */ - fileServiceRootURL: function(itemLocation) { - return this._getServiceRootURL(itemLocation); - }, - - /** - * Obtains the children of a remote resource - * @param {string} parentLocation The location of the item to obtain children for - * @public - * @return {Deferred} A deferred that will provide the array of child objects when complete - */ - fetchChildren: function(parentLocation) { - return _doServiceCall(this._getService(parentLocation), "fetchChildren", arguments); //$NON-NLS-1$ - }, - - /** - * Creates a new workspace with the given name. The resulting workspace is - * passed as a parameter to the provided onCreate function. - * @param {String} workspaceName The name of the new workspace - * @public - * @return {Deferred} A deferred that will create a workspace with the given name - */ - createWorkspace: function(workspaceName) { - return _doServiceCall(this._getService(), "createWorkspace", arguments); //$NON-NLS-1$ - }, - - /** - * Loads all the user's workspaces. Returns a deferred that will provide the loaded - * workspaces when ready. - * @public - * @return {Deferred} A deferred that will load all workspaces - */ - loadWorkspaces: function() { - return _doServiceCall(this._getService(), "loadWorkspaces", arguments); //$NON-NLS-1$ - }, - - /** - * Loads the workspace with the given id and sets it to be the current - * workspace for the IDE. The workspace is created if none already exists. - * @param {String} workspaceLocation the location of the workspace to load - * @param {Function} onLoad the function to invoke when the workspace is loaded - * @public - * @return {Deferred} A deferred that will load the specified workspace - */ - loadWorkspace: function(workspaceLocation) { - return _doServiceCall(this._getService(workspaceLocation), "loadWorkspace", arguments); //$NON-NLS-1$ - }, - - changeWorkspace: function(workspaceLocation) { - return _doServiceCall(this._getService(), "changeWorkspace", arguments); //$NON-NLS-1$ - }, - - _createArtifact: function(parentLocation, funcName, eventData, funcArgs) { - return _doServiceCall(this._getService(parentLocation), funcName, funcArgs).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.created) { - this._frozenEvent.created = []; - } - this._frozenEvent.created.push({parent: parentLocation, result: result, eventData: eventData}); - } else { - this.dispatchEvent({ type: "Changed", created: [{parent: parentLocation, result: result, eventData: eventData}]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - }, - - /** - * Adds a project to a workspace. - * @param {String} url The workspace location - * @param {String} projectName the human-readable name of the project - * @param {String} serverPath The optional path of the project on the server. - * @param {Boolean} create If true, the project is created on the server file system if it doesn't already exist - * @public - * @return {Deferred} A deferred that will create a new project in the workspace - */ - createProject: function(url, projectName, serverPath, create) { - return _doServiceCall(this._getService(url), "createProject", arguments); //$NON-NLS-1$ - //return this._createArtifact(url, "createProject", arguments); - }, - /** - * Creates a folder. - * @param {String} parentLocation The location of the parent folder - * @param {String} folderName The name of the folder to create - * @param {Object} eventData The event data that will be sent back. - * @return {Object} JSON representation of the created folder - * @public - * @return {Deferred} A deferred that will create a new folder in the workspace - */ - createFolder: function(parentLocation, folderName, eventData) { - //return _doServiceCall(this._getService(parentLocation), "createFolder", arguments); //$NON-NLS-1$ - return this._createArtifact(parentLocation, "createFolder", eventData, arguments); - }, - /** - * Create a new file in a specified location. Returns a deferred that will provide - * The new file object when ready. - * @param {String} parentLocation The location of the parent folder - * @param {String} fileName The name of the file to create - * @param {Object} eventData The event data that will be sent back. - * @public - * @return {Deferred} A deferred that will provide the new file object - */ - createFile: function(parentLocation, fileName, eventData) { - //return _doServiceCall(this._getService(parentLocation), "createFile", arguments); //$NON-NLS-1$ - return this._createArtifact(parentLocation, "createFile", eventData, arguments); - }, - /** - * Deletes a file, directory, or project. - * @param {String} deleteLocation The location of the file or directory to delete. - * @param {Object} eventData The event data that will be sent back. - * @public - * @returns {Deferred} A deferred that will delete the given file - */ - deleteFile: function(deleteLocation, eventData) { - //return _doServiceCall(this._getService(deleteLocation), "deleteFile", arguments); //$NON-NLS-1$ - return _doServiceCall(this._getService(deleteLocation), "deleteFile", arguments).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.deleted) { - this._frozenEvent.deleted = []; - } - this._frozenEvent.deleted.push({deleteLocation: deleteLocation, eventData: eventData}); - } else { - this.dispatchEvent({ type: "Changed", deleted: [{deleteLocation: deleteLocation, eventData: eventData}]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - }, - - /** - * Moves a file or directory. - * @param {String} sourceLocation The location of the file or directory to move. - * @param {String} targetLocation The location of the target folder. - * @param {String} targetName The name of the destination file or directory in the case of a rename - * @public - * @returns {Deferred} A deferred that will move the given file to its new location - */ - moveFile: function(sourceLocation, targetLocation, targetName) { - var sourceService = this._getService(sourceLocation); - var targetService = this._getService(targetLocation); - - if (sourceService === targetService) { - //return _doServiceCall(sourceService, "moveFile", arguments); - return _doServiceCall(sourceService, "moveFile", arguments).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.moved) { - this._frozenEvent.moved = []; - } - this._frozenEvent.moved.push({source: sourceLocation, target: targetLocation, result: result}); - } else { - this.dispatchEvent({ type: "Changed", moved: [{source: sourceLocation, target: targetLocation, result: result}]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - } - - var isDirectory = sourceLocation[sourceLocation.length -1] === "/"; - var target = targetLocation; - - if (target[target.length -1] !== "/") { - target += "/"; - } - - if (targetName) { - target += encodeURIComponent(targetName); - } else { - var temp = sourceLocation; - if (isDirectory) { - temp = temp.substring(0, temp.length - 1); - } - target += temp.substring(temp.lastIndexOf("/")+1); - } - - if (isDirectory && target[target.length -1] !== "/") { - target += "/"; - } - - return _copy(sourceService, sourceLocation, targetService, target).then(function() { - return _doServiceCall(sourceService, "deleteFile", [sourceLocation]); //$NON-NLS-1$ - }); - - }, - - /** - * Copies a file or directory. - * @param {String} sourceLocation The location of the file or directory to copy. - * @param {String} targetLocation The location of the target folder. - * @param {String} targetName The name of the destination file or directory in the case of a rename - * @public - * @returns {Deferred} A deferred that will copy the given file to its new location - */ - copyFile: function(sourceLocation, targetLocation, targetName) { - var sourceService = this._getService(sourceLocation); - var targetService = this._getService(targetLocation); - - if (sourceService === targetService) { - //return _doServiceCall(sourceService, "copyFile", arguments); //$NON-NLS-1$ - return _doServiceCall(sourceService, "copyFile", arguments).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.copied) { - this._frozenEvent.copied = []; - } - this._frozenEvent.copied.push({source: sourceLocation, target: targetLocation, result: result}); - } else { - this.dispatchEvent({ type: "Changed", copied: [{source: sourceLocation, target: targetLocation, result: result}]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - } - - var isDirectory = sourceLocation[sourceLocation.length -1] === "/"; - var target = targetLocation; - - if (target[target.length -1] !== "/") { - target += "/"; - } - - if (targetName) { - target += encodeURIComponent(targetName); - } else { - var temp = sourceLocation; - if (isDirectory) { - temp = temp.substring(0, temp.length - 1); - } - target += temp.substring(temp.lastIndexOf("/")+1); - } - - if (isDirectory && target[target.length -1] !== "/") { - target += "/"; - } - - return _copy(sourceService, sourceLocation, targetService, target); - }, - - /** - * Returns the contents or metadata of the file at the given location. - * - * @param {String} readLocation The location of the file to get contents for - * @param {Boolean} [isMetadata] If defined and true, returns the file metadata, - * otherwise file contents are returned - * @public - * @return {Deferred} A deferred that will be provided with the contents or metadata when available - */ - read: function(readLocation, isMetadata) { - return _doServiceCall(this._getService(readLocation), "read", arguments); //$NON-NLS-1$ - }, - - /** - * Returns the blob contents of the file at the given location. - * - * @param {String} readLocation The location of the file to get contents for - * @public - * @return {Deferred} A deferred that will be provided with the blob contents when available - */ - readBlob: function(readLocation) { - return _doServiceCall(this._getService(readLocation), "readBlob", arguments); //$NON-NLS-1$ - }, - - /** - * Writes the contents or metadata of the file at the given location. - * - * @param {String} writeLocation The location of the file to set contents for - * @param {String|Object} contents The content string, or metadata object to write - * @param {String|Object} args Additional arguments used during write operation (i.e. ETag) - * @public - * @return {Deferred} A deferred for chaining events after the write completes with new metadata object - */ - write: function(writeLocation, contents, args) { - //return _doServiceCall(this._getService(writeLocation), "write", arguments); //$NON-NLS-1$ - return _doServiceCall(this._getService(writeLocation), "write", arguments).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.modified) { - this._frozenEvent.modified = []; - } - this._frozenEvent.modified.push(writeLocation); - } else { - this.dispatchEvent({ type: "Changed", modified: [writeLocation]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - }, - - /** - * Imports file and directory contents from another server - * - * @param {String} targetLocation The location of the folder to import into - * @param {Object} options An object specifying the import parameters - * @public - * @return {Deferred} A deferred for chaining events after the import completes - */ - remoteImport: function(targetLocation, options, parentLocation) { - //return _doServiceCall(this._getService(targetLocation), "remoteImport", arguments); //$NON-NLS-1$ - return _doServiceCall(this._getService(targetLocation), "remoteImport", arguments).then(function(result){ //$NON-NLS-0$ - if(this.isEventFrozen()) { - if(!this._frozenEvent.copied) { - this._frozenEvent.copied = []; - } - this._frozenEvent.copied.push({target: parentLocation}); - } else { - this.dispatchEvent({ type: "Changed", copied: [{target: parentLocation}]}); //$NON-NLS-0$ - } - return result; - }.bind(this)); - }, - - /** - * Exports file and directory contents to another server - * - * @param {String} sourceLocation The location of the folder to export from - * @param {Object} options An object specifying the export parameters - * @public - * @return {Deferred} A deferred for chaining events after the export completes - */ - remoteExport: function(sourceLocation, options) { - return _doServiceCall(this._getService(sourceLocation), "remoteExport", arguments); //$NON-NLS-1$ - }, - - /** - * Find a string inside a file - * - * @param {String} sourceLocation The location of the folder to export from - * @param {String} findStr The string to search - * @public - * @return {Deferred} A deferred for chaining events after the export completes - */ - find: function(sourceLocation, findStr, option) { - return _doServiceCall(this._getService(location), "find", arguments); //$NON-NLS-0$ - }, - - /** - * Performs a search with the given search parameters. - * @param {Object} searchParams The JSON object that describes all the search parameters. - * @param {String} searchParams.resource Required. The location where search is performed. Required. Normally a sub folder of the file system. Empty string means the root of the file system. - * @param {String} searchParams.keyword The search keyword. Required but can be empty string. If fileType is a specific type and the keyword is empty, then list up all the files of that type. If searchParams.regEx is true then the keyword has to be a valid regular expression. - * @param {String} searchParams.sort Required. Defines the order of the return results. Should be either "Path asc" or "Name asc". Extensions are possible but not currently supported. - * @param {boolean} searchParams.nameSearch Optional. If true, the search performs only file name search. - * @param {String} searchParams.fileType Optional. The file type. If specified, search will be performed under this file type. E.g. "*.*" means all file types. "html" means html files. - * @param {Boolean} searchParams.regEx Optional. The option of regular expression search. - * @param {integer} searchParams.start Optional. The zero based start number for the range of the returned hits. E.g if there are 1000 hits in total, then 5 means the 6th hit. - * @param {integer} searchParams.rows Optional. The number of hits of the range. E.g if there are 1000 hits in total and start=5 and rows=40, then the return range is 6th-45th. - * @public - */ - search: function(searchParams) { - return _doServiceCall(this._getService(searchParams.resource), "search", arguments); //$NON-NLS-1$ - } - }; - FileClient.prototype.constructor = FileClient; - - return { - FileClient: FileClient - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/serviceTracker',[], function() { - - var CLOSED = 0, OPENED = 1; - /** - * @name orion.ServiceTracker - * @class Simplifies the use of services within a service registry. - * @description Creates a ServiceTracker against the given service registry. - * The returned ServiceTracker will track services whose objectClass property contains the - * given objectClass parameter. - * - *

        After creating a ServiceTracker, it can then be {@link #open}ed to begin tracking services.

        - *

        The {@link #addingService} and {@link #removedService} methods can be overridden to customize the service objects - * being tracked.

        - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry The service registry to track services of. - * @param {String} objectClass The objectClass of services to be tracked. - */ - function ServiceTracker(serviceRegistry, objectClass) { - this.serviceRegistry = serviceRegistry; - var refs = {}; - var services = {}; - var state = CLOSED; - var addedListener, removedListener; - - function add(serviceRef) { - var id = serviceRef.getProperty('service.id'); - var serviceObject = this.addingService(serviceRef); - if (serviceObject) { - refs[id] = serviceRef; - services[id] = serviceObject; - } - } - function remove(serviceRef) { - var id = serviceRef.getProperty('service.id'); - var service = services[id]; - delete refs[id]; - delete services[id]; - this.removedService(serviceRef, service); - } - function isTrackable(serviceRef) { - return serviceRef.getProperty('objectClass').indexOf(objectClass) !== -1; //$NON-NLS-0$ - } - - /** - * Stops tracking services. - * @name orion.ServiceTracker#close - * @function - */ - this.close = function() { - if (state !== OPENED) { - throw new Error('Already closed'); //$NON-NLS-0$ - } - state = CLOSED; - serviceRegistry.removeEventListener('registered', addedListener); //$NON-NLS-0$ - serviceRegistry.removeEventListener('unregistering', removedListener); //$NON-NLS-0$ - addedListener = null; - removedListener = null; - var self = this; - this.getServiceReferences().forEach(function(serviceRef) { - remove.call(self, serviceRef); - }); - if (typeof this.onClose === 'function') { - this.onClose(); - } - }; - /** - * Returns service references to the services that are being tracked. - * @name orion.ServiceTracker#getServiceReferences - * @function - * @returns {orion.serviceregistry.ServiceReference[]} References to all services that are being tracked by this ServiceTracker. - */ - this.getServiceReferences = function() { - var keys = Object.keys(refs); - if (!keys.length) { - return null; - } - return keys.map(function(serviceId) { - return refs[serviceId]; - }); - }; - /** - * Begins tracking services. - * @name orion.ServiceTracker#open - * @function - * @param {Boolean} [all=true] When true, this ServiceTracker receives an initial block of serviceAdded - * calls for any services currently present in the registry, and then for any subsequent registrations. - * When false, this ServiceTracker is invoked only for subsequent serviceAdded events. - * - *

        Clients can use all === false when they wish to respond only to future events, and - * all === true when they wish to quickly "catch up" with trackable services that were - * registered prior to {@link #open} being called.

        - */ - this.open = function(all) { - if (typeof all === 'undefined') { //$NON-NLS-0$ - all = true; - } - if (state !== CLOSED) { - throw new Error('Already open'); //$NON-NLS-0$ - } - state = OPENED; - var self = this; - addedListener = /** @ignore */ function(event) { - if (isTrackable(event.serviceReference)) { - add.call(self, event.serviceReference); - if (typeof self.onServiceAdded === 'function') { //$NON-NLS-0$ - return self.onServiceAdded(event.serviceReference, self.serviceRegistry.getService(event.serviceReference)); - } - } - }; - removedListener = /** @ignore */ function(event) { - if (isTrackable(event.serviceReference)) { - remove.call(self, event.serviceReference); - } - }; - serviceRegistry.addEventListener('registered', addedListener); //$NON-NLS-0$ - serviceRegistry.addEventListener('unregistering', removedListener); //$NON-NLS-0$ - if (all) { - serviceRegistry.getServiceReferences(objectClass).forEach(function(serviceRef) { - add.call(self, serviceRef); - if (typeof self.onServiceAdded === 'function') { //$NON-NLS-0$ - return self.onServiceAdded(serviceRef, serviceRegistry.getService(serviceRef)); - } - }); - } - if (typeof this.onOpen === 'function') { - this.onOpen(); - } - }; - } - ServiceTracker.prototype = /** @lends orion.ServiceTracker.prototype */ { - /** - * Called to customize a service object being added to this ServiceTracker. Subclasses may override this method. - * The default implementation returns the result of calling {@link orion.serviceregistry.ServiceRegistry#getService} - * passing the service reference. - * @param {orion.serviceregistry.ServiceReference} serviceRef The reference to the service being added. - * @returns {Object} The service object to be tracked for the given service reference. If null - * is returned, the service reference will not be tracked. - */ - addingService: function(serviceRef) { - return this.serviceRegistry.getService(serviceRef); - }, - /** - * Called when this ServiceTracker has been opened. Subclasses can override this method. - * @function - */ - onOpen: null, - /** - * Called when this ServiceTracker has been closed. Subclasses can override this method. - * @function - */ - onClose: null, - /** - * Called when a service is being added to this ServiceTracker. Subclasses can override this method to take part - * in the service's 'serviceAdded' phase. - * @function - * @param {orion.serviceregistry.ServiceReference} serviceRef The service reference for the service that is being added. - * @param {Object} service The service implementation object that is being added. - * @returns {orion.Promise|undefined} This method can optionally return a deferred. If it does, the returned deferred - * will be added to the service's serviceAdded listener queue; in other words, the returned deferred - * must resolve before any calls to the service's methods can proceed. - */ - onServiceAdded: null, - /** - * Called when a service has been removed from this ServiceTracker. Subclasses may override this method. - * The default implementation does nothing. - * @function - * @param {orion.serviceregistry.ServiceReference} serviceRef The reference to the removed service. - * @param {Object} service The service implementation object for the removed service. - */ - removedService: function(serviceRef, service) { - } - }; - - return ServiceTracker; -}); -/******************************************************************************* - * @license - * Copyright (c) 2011, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/contentTypes',["orion/serviceTracker"], function(ServiceTracker) { - var SERVICE_ID = "orion.core.contentTypeRegistry"; //$NON-NLS-0$ - var EXTENSION_ID = "orion.core.contenttype"; //$NON-NLS-0$ - var OLD_EXTENSION_ID = "orion.file.contenttype"; // backwards compatibility //$NON-NLS-0$ - - /** - * @name orion.core.ContentType - * @class Represents a content type known to Orion. - * @property {String} id Unique identifier of this ContentType. - * @property {String} name User-readable name of this ContentType. - * @property {String} extends Optional; Gives the ID of another ContentType that is this one's parent. - * @property {String[]} extension Optional; List of file extensions characterizing this ContentType. Extensions are not case-sensitive. - * @property {String[]} filename Optional; List of filenames characterizing this ContentType. - */ - - function contains(array, item) { - return array.indexOf(item) !== -1; - } - - function isImage(contentType) { - switch (contentType && contentType.id) { - case "image/jpeg": //$NON-NLS-0$ - case "image/png": //$NON-NLS-0$ - case "image/gif": //$NON-NLS-0$ - case "image/ico": //$NON-NLS-0$ - case "image/tiff": //$NON-NLS-0$ - case "image/svg": //$NON-NLS-0$ - return true; - } - return false; - } - - function isBinary(cType) { - if(!cType) { - return false; - } - return (cType.id === "application/octet-stream" || cType['extends'] === "application/octet-stream"); //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * @name getFilenameContentType - * @description Return the best contentType match to the given filename or null if no match. Filename pattern checked first, then extension - * @param filename the filename to compare against contentTypes - * @param contentTypes the array of possible contentTypes to check - * @returns returns ContentType that is the best match or null - */ - function getFilenameContentType(/**String*/ filename, contentTypes) { - if (typeof filename !== "string") { //$NON-NLS-0$ - return null; - } - - var best = null; - var current; - - var extStart = filename.indexOf('.'); //$NON-NLS-0$ - extStart++; // leading period not included in extension - var extension = filename.substring(extStart).toLowerCase(); - - // Check the most common cases, exact filename match or full extension match - for (var i=0; i < contentTypes.length; i++) { - current = contentTypes[i]; - if (current.filename.indexOf(filename) >= 0){ - best = current; - break; - } - - if (contains(current.extension, extension)){ - // A filename match is considered better than a perfect extension match - best = current; - continue; - } - } - - // Check the less common case where the filename contains periods (foo.bar.a.b check 'bar.a.b' then 'a.b' then 'b') - if (!best){ - extStart = extension.indexOf('.'); //$NON-NLS-0$ - while (!best && extStart >= 0){ - extStart++; // leading period not included in extension - extension = extension.substring(extStart); - for (i=0; i < contentTypes.length; i++) { - current = contentTypes[i]; - if (contains(current.extension, extension)){ - best = current; - break; - } - } - extStart = extension.indexOf('.'); //$NON-NLS-0$ - } - } - - return best; - } - - function array(obj) { - if (obj === null || typeof obj === "undefined") { return []; } //$NON-NLS-0$ - return (Array.isArray(obj)) ? obj : [obj]; - } - - function arrayLowerCase(obj) { - return array(obj).map(function(str) { return String.prototype.toLowerCase.call(str); }); - } - - function process(contentTypeData) { - return { - id: contentTypeData.id, - name: contentTypeData.name, - image: contentTypeData.image, - imageClass: contentTypeData.imageClass, - "extends": contentTypeData["extends"], //$NON-NLS-1$ //$NON-NLS-0$ - extension: arrayLowerCase(contentTypeData.extension), - filename: array(contentTypeData.filename) - }; - } - - function add2Map(map, contentTypeDatas) { - contentTypeDatas.map(process).forEach(function(contentType) { - if (!Object.prototype.hasOwnProperty.call(map, contentType.id)) { - map[contentType.id] = contentType; - } - }); - } - - function deleteFromMap(map, contentTypeDatas) { - contentTypeDatas.map(process).forEach(function(contentType) { - if (Object.prototype.hasOwnProperty.call(map, contentType.id)) { - delete map[contentType.id]; - } - }); - } - - function add2TypeData(serviceRef, contentTypeDatas) { - var types = array(serviceRef.getProperty("contentTypes")); //$NON-NLS-0$ - for (var j=0; j < types.length; j++) { - contentTypeDatas.push(types[j]); - } - } - - function buildMap(contentTypeDatas) { - var map = Object.create(null); - add2Map(map, contentTypeDatas); - return map; - } - - function buildMapFromServiceRegistry(serviceRegistry) { - var serviceReferences = serviceRegistry.getServiceReferences(EXTENSION_ID).concat( - serviceRegistry.getServiceReferences(OLD_EXTENSION_ID)); - var contentTypeDatas = []; - for (var i=0; i < serviceReferences.length; i++) { - var serviceRef = serviceReferences[i]; - add2TypeData(serviceRef, contentTypeDatas); - } - return buildMap(contentTypeDatas); - } - - /** - * @name orion.core.ContentTypeRegistry - * @class A service for querying {@link orion.core.ContentType}s. - * @description A registry that provides information about {@link orion.core.ContentType}s. - * - *

        If a {@link orion.serviceregistry.ServiceRegistry} is available, clients should request the service with - * objectClass "orion.core.contentTypeRegistry" from the registry rather than instantiate this - * class directly. This constructor is intended for use only by page initialization code.

        - * - * @param {orion.serviceregistry.ServiceRegistry|orion.core.ContentType[]} dataSource The service registry - * to use for looking up available content types and for registering this ContentTypeRegistry. - * - *

        Alternatively, an array of ContentType data may be passed instead, which allows clients to use this - * ContentTypeRegistry without a service registry.

        - */ - function ContentTypeRegistry(dataSource) { - if (dataSource && dataSource.registerService) { - this.serviceRegistry = dataSource; - var tracker = new ServiceTracker(this.serviceRegistry, "orion.core.contenttype"); //$NON-NLS-0$ - var _self = this; - tracker.onServiceAdded = function(serviceRef) { - var contentTypeDatas = []; - add2TypeData(serviceRef, contentTypeDatas); - add2Map(_self.map, contentTypeDatas); - }; - tracker.removedService = function(serviceRef) { - var contentTypeDatas = []; - add2TypeData(serviceRef, contentTypeDatas); - deleteFromMap(_self.map, contentTypeDatas); - }; - tracker.open(false); - this.map = buildMapFromServiceRegistry(dataSource); - dataSource.registerService(SERVICE_ID, this); - } else if (Array.isArray(dataSource)) { - this.serviceRegistry = null; - this.map = buildMap(dataSource); - } else { - throw new Error("Invalid parameter"); //$NON-NLS-0$ - } - } - ContentTypeRegistry.prototype = /** @lends orion.core.ContentTypeRegistry.prototype */ { - /** - * Gets all the ContentTypes in the registry. - * @returns {orion.core.ContentType[]} An array of all registered ContentTypes. - */ - getContentTypes: function() { - var map = this.getContentTypesMap(); - var types = []; - for (var type in map) { - if (Object.prototype.hasOwnProperty.call(map, type)) { - types.push(map[type]); - } - } - return types; - }, - /** - * Gets a map of all ContentTypes. - * @return {Object} A map whose keys are ContentType IDs and values are the {@link orion.core.ContentType} having that ID. - */ - getContentTypesMap: function() { - return this.map; - }, - /** - * Looks up the ContentType for a file or search result, given the metadata. - * @param {Object} fileMetadata Metadata for a file or search result. - * @returns {orion.core.ContentType} The ContentType for the file, or null if none could be found. - */ - getFileContentType: function(fileMetadata) { - return getFilenameContentType(fileMetadata.Name, this.getContentTypes()); - }, - /** - * Looks up the ContentType, given a filename. - * @param {String} filename The filename. - * @returns {orion.core.ContentType} The ContentType for the file, or null if none could be found. - */ - getFilenameContentType: function(filename) { - return getFilenameContentType(filename, this.getContentTypes()); - }, - /** - * Gets a ContentType by ID. - * @param {String} id The ContentType ID. - * @returns {orion.core.ContentType} The ContentType having the given ID, or null. - */ - getContentType: function(id) { - return this.map[id] || null; - }, - /** - * Determines whether a ContentType is an extension of another. - * @param {orion.core.ContentType|String} contentTypeA ContentType or ContentType ID. - * @param {orion.core.ContentType|String} contentTypeB ContentType or ContentType ID. - * @returns {Boolean} Returns true if contentTypeA equals contentTypeB, - * or contentTypeA descends from contentTypeB. - */ - isExtensionOf: function(contentTypeA, contentTypeB) { - contentTypeA = (typeof contentTypeA === "string") ? this.getContentType(contentTypeA) : contentTypeA; //$NON-NLS-0$ - contentTypeB = (typeof contentTypeB === "string") ? this.getContentType(contentTypeB) : contentTypeB; //$NON-NLS-0$ - if (!contentTypeA || !contentTypeB) { return false; } - if (contentTypeA.id === contentTypeB.id) { return true; } - else { - var parent = contentTypeA, seen = {}; - while (parent && (parent = this.getContentType(parent['extends']))) { //$NON-NLS-0$ - if (parent.id === contentTypeB.id) { return true; } - if (seen[parent.id]) { throw new Error("Cycle: " + parent.id); } //$NON-NLS-0$ - seen[parent.id] = true; - } - } - return false; - }, - /** - * Similar to {@link #isExtensionOf}, but works on an array of contentTypes. - * @param {orion.core.ContentType|String} contentType ContentType or ContentType ID. - * @param {orion.core.ContentType[]|String[]} contentTypes Array of ContentTypes or ContentType IDs. - * @returns {Boolean} true if contentType equals or descends from any of the - * ContentTypes in contentTypes. - */ - isSomeExtensionOf: function(contentType, contentTypes) { - for (var i=0; i < contentTypes.length; i++) { - if (this.isExtensionOf(contentType, contentTypes[i])) { - return true; - } - } - return false; - } - }; - return { - ContentTypeRegistry: ContentTypeRegistry, - isImage: isImage, - isBinary: isBinary, - getFilenameContentType: getFilenameContentType - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/edit/nls/messages',{ - root:true -}); - -/******************************************************************************* - * @license - * Copyright (c) 2012, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/edit/nls/root/messages',{ - "Editor": "Editor", - "switchEditor": "Switch Editor", - "Fetching": "Fetching: ${0}", - "confirmUnsavedChanges": "There are unsaved changes. Do you still want to navigate away?", - "searchFilesCommand": "Quick Search...", - "searchFiles": "Quick Search in ${0}", - "searchTerm": "Enter search term:", - "unsavedChanges": "There are unsaved changes.", - "unsavedAutoSaveChanges": "Please stay on the page until Auto Save is complete.", - "Save": "Save", - "Saved": "Saved", - "Blame": "Blame", - "BlameTooltip":"Show blame annotations", - "Diff": "Diff", - "DiffTooltip":"Show diff annotations", - "saveOutOfSync": "Resource is out of sync with the server. Do you want to save it anyway?", - "loadOutOfSync": "Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.", - "ReadingMetadata": "Reading metadata of ${0}", - "ReadingMetadataError": "Cannot get metadata of ${0}", - "Reading": "Reading ${0}", - "ReloadWith": "Reload With", - "Convert Line Delimiters": "Convert Line Delimiters", - "Windows (CR/LF)": "Windows (CR/LF)", - "Unix (LF)": "Unix (LF)", - "ConversionCompleteCRLF": "Line delimiters have been converted to CR/LF", - "ConversionCompleteLF": "Line delimiters have been converted to LF", - "readonly": "Read Only.", - "saveFile": "Save this file", - "toggleZoomRuler": "Toggle Zoom Ruler", - "gotoLine": "Go to Line...", - "gotoLineTooltip": "Go to specified line number", - "gotoLinePrompt": "Go to line:", - "Undo": "Undo", - "Redo": "Redo", - "Cut": "Cut", - "Copy": "Copy", - "Paste": "Paste", - "Find": "Find...", - "noResponse": "No response from server. Check your internet connection and try again.", - "savingFile": "Saving file ${0}", - "running": "Running ${0}", - "Saving..." : "Saving...", - "View": "View", - "SplitSinglePage": "Single Page", - "SplitVertical": "Split Vertical", - "SplitHorizontal": "Split Horizontal", - "SplitPipInPip": "Picture in Picture", - "SplitModeTooltip": "Change split editor mode", - "SidePanel": "Side Panel", - "SidePanelTooltip": "Choose what to show in the side panel.", - "Slideout": "Slideout", - "Actions": "Actions", - "Navigator": "Navigator", - "FolderNavigator": "Folder Navigator", - "Project": "Project", - "New": "New", - "File": "File", - "Edit": "Edit", - "Tools": "Tools", - "Add": "Add", - "noActions": "There are no actions for the current selection.", - "NoFile": "Use the ${0} to create new files and folders. Click a file to start coding.", - "LocalEditorSettings": "Local Editor Settings", - "NoProject": "${0} is not a project. To convert it to a project use ${1}.", - "NoProjects": "There are no projects in your workspace. Use the ${0} menu to create projects.", - "Disconnected": "${0} (disconnected)", - "ChooseFS": "Choose Filesystem", - "ChooseFSTooltip": "Choose the filesystem you want to view.", - "FSTitle": "${0} (${1})", - "Deploy": "Deploy", - "Deploy As": "Deploy As", - "Import": "Import", - "Export": "Export", - "OpenWith": "Open With", - "OpenRelated": "Open Related", - "OpenFolder": "Open Folder", - "OpenRecent": "Open Recent", - "OpenFolderTip": "Change the root folder", - "Dependency": "Dependency", - "UnnamedCommand": "Unnamed", - "searchInFolder": "Folder Search...", - "Global Search": "Global Search...", - "ClickEditLabel": "Click to edit", - "ProjectInfo": "Project Information", - "Name": "Name", - "Description": "Description", - "Site": "Site", - 'projectsSectionTitle': 'Projects', - 'listingProjects': 'Listing projects...', - 'gettingWorkspaceInfo': 'Getting workspace information...', - "showProblems": "Show Problems...", - "showTooltip": "Show Tooltip", - "showTooltipTooltip": "Shows the tooltip immediately based on the caret position", - "emptyDeploymentInfoMessage": "Use the Launch Configurations dropdown to deploy this project" -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/objects',[], function() { - function mixin(target/*, source..*/) { - var hasOwnProperty = Object.prototype.hasOwnProperty; - for (var j = 1, len = arguments.length; j < len; j++) { - var source = arguments[j]; - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - } - - /** - * @name orion.objects - * @class Object-oriented helpers. - */ - return { - /** - * Creates a shallow clone of the given object. - * @name orion.objects.clone - * @function - * @static - * @param {Object|Array} object The object to clone. Must be a "normal" Object or Array. Other built-ins, - * host objects, primitives, etc, will not work. - * @returns {Object|Array} A clone of object. - */ - clone: function(object) { - if (Array.isArray(object)) { - return Array.prototype.slice.call(object); - } - var clone = Object.create(Object.getPrototypeOf(object)); - mixin(clone, object); - return clone; - }, - /** - * Mixes all source's own enumerable properties into target. Multiple source objects - * can be passed as varargs. - * @name orion.objects.mixin - * @function - * @static - * @param {Object} target - * @param {Object} source - */ - mixin: mixin, - /** - * Wraps an object into an Array if necessary. - * @name orion.objects.toArray - * @function - * @static - * @param {Object} obj An object. - * @returns {Array} Returns obj unchanged, if obj is an Array. Otherwise returns a 1-element Array - * whose sole element is obj. - */ - toArray: function(o) { - return Array.isArray(o) ? o : [o]; - } - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: Anton McConville - IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/widgets/input/DropDownMenu',['orion/objects', 'orion/webui/littlelib'], function(objects, lib) { - - /** - * Creates a dropdown menu for a node and its associated trigger node (button) - * @param {Object} parent The dom object or string id of the node that will contain the dropdown menu - * @param {Object} triggerNode The dom object or string id of the dom node that will trigger the dropdown menu appearance - * @param {Object} [options] options for the drop down menu. - * @param {String} [options.selectionClass] CSS class to be appended when the trigger node is selected. - * @param {String} [options.noClick] Do not add the click handler to the trigger node. - * @param {String} [options.onShow] Callback called when the menu is shown. - * @param {String} [options.onHide] Callback called when the menu is hidden. - */ - function DropDownMenu( parent, triggerNode, options ){ - var node = lib.node(parent); - if (node) { - this._parent = node; - } else { - throw new Error("Parent node of dropdown menu not found"); //$NON-NLS-0$ - } - - options = options || {}; - this.options = options; - - // Assign dynamic ids to the dropdown menu node to support multiple drop down menus in the same page - this.navDropDownId = this._parent.id + '_navdropdown'; //$NON-NLS-0$ - this.selectionClass = options.selectionClass; - - // Create dropdown container and append to parent dom - var dropDownContainer = document.createElement("div"); //$NON-NLS-0$ - dropDownContainer.classList.add("dropdownMenu"); //$NON-NLS-0$ - dropDownContainer.classList.add("dropdownMenuOpen"); //$NON-NLS-0$ - dropDownContainer.id = this.navDropDownId; - dropDownContainer.style.display = 'none'; //$NON-NLS-0$ - this._parent.appendChild(dropDownContainer); - this._dropdownMenu = dropDownContainer; - - // Display trigger node and bind on click event - triggerNode = lib.node(triggerNode); - if (triggerNode) { - this._triggerNode = triggerNode; - } else { - throw "Trigger node of dropdown menu not found"; //$NON-NLS-0$ - } - if (this._triggerNode.style.visibility === 'hidden') { //$NON-NLS-0$ - this._triggerNode.style.visibility = 'visible'; //$NON-NLS-0$ - } - - if (!options.noClick) { - this._triggerNode.onclick = this.click.bind(this); - } - this._dropdownMenu.addEventListener("keydown", function (e) { //$NON-NLS-0$ - if (e.keyCode === lib.KEY.ESCAPE) { - this.clearPanel(); - } - }.bind(this)); - } - - objects.mixin(DropDownMenu.prototype, { - click: function() { - if( this._dropdownMenu.style.display === 'none' ){ //$NON-NLS-0$ - this.updateContent ( this.getContentNode() , function () { - lib.setFramesEnabled(false); - this._dropdownMenu.style.display = ''; - this._positionDropdown(); - if (this.selectionClass) { - this._triggerNode.classList.add(this.selectionClass); - } - this.handle = lib.addAutoDismiss( [ this._triggerNode, this._dropdownMenu], this.clearPanel.bind(this) ); - if (this.options.onShow) { - this.options.onShow(); - } - }.bind(this)); - }else{ - this.clearPanel(); - } - }, - - clearPanel: function(){ - if (!this.isVisible()) { return; } - this._dropdownMenu.style.display = 'none'; //$NON-NLS-0$ - lib.setFramesEnabled(true); - if (this.selectionClass) { - this._triggerNode.classList.remove(this.selectionClass); - } - if (this.options.onHide) { - this.options.onHide(); - } - }, - - // Add content to the dropdown container - addContent: function( content ){ - this._dropdownMenu.innerHTML = content; - }, - - getContentNode: function(){ - return this._dropdownMenu; - }, - - updateContent: function( contentNode, callback ){ - // to be overridden to update the contents before showing - // the callback needs to be called once the content is up to date - callback(); - }, - - _positionDropdown: function() { - this._dropdownMenu.style.right = ""; - var bounds = lib.bounds(this._dropdownMenu); - var bodyBounds = lib.bounds(document.body); - if (bounds.left + bounds.width > (bodyBounds.left + bodyBounds.width)) { - var totalBounds = lib.bounds(this._boundingNode(this._triggerNode)); - var triggerBounds = lib.bounds(this._triggerNode); - this._dropdownMenu.style.right = (totalBounds.width - ((triggerBounds.left - totalBounds.left) + triggerBounds.width)) + "px"; //$NON-NLS-0$ - } - }, - - _boundingNode: function(node) { - var style = window.getComputedStyle(node, null); - if (style === null) { - return node; - } - var position = style.getPropertyValue("position"); //$NON-NLS-0$ - if (position === "absolute" || !node.parentNode || node === document.body) { //$NON-NLS-0$ - return node; - } - return this._boundingNode(node.parentNode); - }, - - isDestroyed: function() { - return !this._dropdownMenu.parentNode; - }, - - isVisible: function() { - return this._dropdownMenu.style.display !== "none" && !this.isDestroyed(); //$NON-NLS-0$ - }, - - focus: function() { - this._dropdownMenu.focus(); - }, - - destroy: function() { - if (this._parent) { - lib.setFramesEnabled(true); - lib.empty(this._parent); - this._parent = this.select = null; - } - } - }); - - return DropDownMenu; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/URITemplate',[],function(){ - - var OPERATOR = { - NUL: {first:"", sep:",", named: false, ifemp: "", allow: "U"}, //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - "+": {first:"", sep:",", named: false, ifemp: "", allow: "U+R"}, //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - ".": {first:".", sep:",", named: false, ifemp: "", allow: "U"}, //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - "/": {first:"/", sep:"/", named: false, ifemp: "", allow: "U"}, //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - ";": {first:";", sep:";", named: true, ifemp: "", allow: "U"}, //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - "?": {first:"?", sep:"&", named: true, ifemp: "=", allow: "U"}, //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - "&": {first:"&", sep:"&", named: true, ifemp: "=", allow: "U"}, //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - "#": {first:"#", sep:",", named: false, ifemp: "", allow: "U+R"}, //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - ",": {first:"", sep:",", named: false, ifemp: "", allow: "U+R-,"} //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - }; - - var VARSPEC_REGEXP = /^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/; - var PCT_ENCODED_G = /%25[0-9A-F][0-9A-F]/g; - - function Literal(text) { - this._text = text; - } - - Literal.prototype = { - expand: function(vars) { - return encodeURI(this._text); - } - }; - - function decodePercent(str) { - return str.replace("%25", "%"); - } - - function encodeString(value, encoding) { - if (encoding === "U") { //$NON-NLS-0$ - return encodeURIComponent(value).replace(/[!'()*]/g, function(str) { - return '%' + str.charCodeAt(0).toString(16).toUpperCase(); //$NON-NLS-0$ - }); - } - if (encoding === "U+R") { //$NON-NLS-0$ - return encodeURI(value).replace(/%5B/g, '[').replace(/%5D/g, ']').replace(PCT_ENCODED_G, decodePercent); //$NON-NLS-1$ //$NON-NLS-0$ - } - if (encoding === "U+R-,") { //$NON-NLS-0$ - return encodeURI(value).replace(/%5B/g, '[').replace(/%5D/g, ']').replace(/,/g, '%2C'); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - throw new Error("Unknown allowed character set: " + encoding); - } - - function encodeArray(value, encoding, separator) { - var result = []; - for (var i=0; i < value.length; i++) { - if (typeof(value[i]) !== "undefined") { //$NON-NLS-0$ - result.push(encodeString(value[i], encoding)); - } - } - return result.join(separator); - } - - function encodeObject(value, encoding, nameValueSeparator, pairSeparator ) { - var keys = Object.keys(value); - var result = []; - for (var i=0; i < keys.length; i++) { - if (typeof(value[keys[i]]) !== "undefined") { //$NON-NLS-0$ - result.push(encodeString(keys[i], encoding) + nameValueSeparator + encodeString(value[keys[i]], encoding)); - } - } - return result.join(pairSeparator); - } - - function parseVarSpecs(text) { - var result = []; - var rawSpecs = text.split(","); //$NON-NLS-0$ - for (var i=0; i < rawSpecs.length; i++) { - var match = rawSpecs[i].match(VARSPEC_REGEXP); - if (match === null) { - throw new Error("Bad VarSpec: " + text); //$NON-NLS-0$ - } - result.push({ - name: match[1], - explode: !!match[2], - prefix: match[3] ? parseInt(match[3], 10) : -1 - }); - } - return result; - } - - function Expression(text) { - if (text.length === 0) { - throw new Error("Invalid Expression: 0 length expression"); //$NON-NLS-0$ - } - - this._operator = OPERATOR[text[0]]; - if (this._operator) { - text = text.substring(1); - } else { - this._operator = OPERATOR.NUL; - } - - this._varSpecList = parseVarSpecs(text); - } - - Expression.prototype = { - expand: function(params) { - var result = []; - for (var i=0; i < this._varSpecList.length; i++) { - var varSpec = this._varSpecList[i]; - var name = varSpec.name; - var value = params[name]; - var valueType = typeof(value); - if (valueType !== "undefined" && value !== null) { //$NON-NLS-0$ - var resultText = result.length === 0 ? this._operator.first: this._operator.sep; - if (valueType === "string") { //$NON-NLS-0$ - if (this._operator.named) { - resultText += encodeString(name, "U+R"); //$NON-NLS-0$ - resultText += (value.length === 0) ? this._operator.ifemp : "="; //$NON-NLS-0$ - } - if (varSpec.prefix !== -1 && varSpec.prefix < value.length) { - value = value.substring(0, varSpec.prefix); - } - - resultText += encodeString(value, this._operator.allow); - } else if (Array.isArray(value)) { - if (value.length === 0) { - continue; // treated as undefined and skipped - } - if (!varSpec.explode) { - var encodedArray = encodeArray(value, this._operator.allow, ","); //$NON-NLS-0$ - if (this._operator.named) { - resultText += encodeString(name, "U+R"); //$NON-NLS-0$ - resultText += (encodedArray.length === 0) ? this._operator.ifemp : "="; //$NON-NLS-0$ - } - resultText += encodedArray; - } else { - resultText += encodeArray(value, this._operator.allow, this._operator.sep); - } - } else if (valueType === "object") { //$NON-NLS-0$ - if (Object.keys(value).length === 0) { - continue; // treated as undefined and skipped - } - if (!varSpec.explode) { - var encodedObject = encodeObject(value, this._operator.allow, ",", ","); //$NON-NLS-1$ //$NON-NLS-0$ - if (this._operator.named) { - resultText += encodeString(name, "U+R"); //$NON-NLS-0$ - resultText += (encodedObject.length === 0) ? this._operator.ifemp : "="; //$NON-NLS-0$ - } - resultText += encodedObject; //$NON-NLS-0$ - } else { - resultText += encodeObject(value, this._operator.allow, "=", this._operator.sep); //$NON-NLS-0$ - } - } else { - throw new Error("bad param type: " + name + " : " + valueType); //$NON-NLS-1$ //$NON-NLS-0$ - } - result.push(resultText); - } - } - return result.join(""); - } - }; - - function parseTemplate(text) { - var result = []; - var current = 0; - var curlyStartIndex = text.indexOf("{", current); //$NON-NLS-0$ - while (curlyStartIndex !== -1) { - result.push(new Literal(text.substring(current, curlyStartIndex))); - var curlyEndIndex = text.indexOf("}", curlyStartIndex + 1); //$NON-NLS-0$ - if (curlyEndIndex === -1) { - throw new Error("Invalid template: " + text); //$NON-NLS-0$ - } - result.push(new Expression(text.substring(curlyStartIndex + 1, curlyEndIndex))); - current = curlyEndIndex + 1; - curlyStartIndex = text.indexOf("{", current); //$NON-NLS-0$ - } - result.push(new Literal(text.substring(current))); - return result; - } - - /** - * @name orion.URITemplate - * @class A URITemplate describes a range of Uniform Resource Identifiers through variable expansion, and allows for particular URIs to - * be generated by expanding variables to actual values.

        - *

        Because the syntax and encoding rules of URIs can be complex, URITemplates are recommended over manual construction of URIs through - * string concatenation or other means.

        - *

        A URITemplate is created by invoking the constructor, passing a template string:

        - *

        new URITemplate(template)

        - *

        The template string is an expression following a well-defined syntax (see here - * for an introduction). Most notably, the template may include variables.

        - *

        Once created, a URITemplate's {@link #expand} method can be invoked to generate a URI. Arguments to {@link #expand} give the values to be - * substituted for the template variables.

        - * @description Creates a new URITemplate. - * @param {String} template The template string. Refer to RFC 6570 for details - * of the template syntax. - */ - function URITemplate(template) { - this._templateComponents = parseTemplate(template); - } - - URITemplate.prototype = /** @lends orion.URITemplate.prototype */ { - /** - * Expands this URITemplate to a URI. - * @param {Object} params The parameters to use for expansion. This object is a map of keys (variable names) to values (the variable's - * value in the expansion algorithm). - * @returns {String} The resulting URI. - */ - expand: function(params) { - var result = []; - for (var i = 0; i < this._templateComponents.length; i++) { - result.push(this._templateComponents[i].expand(params)); - } - return result.join(""); - } - }; - - return URITemplate; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -/*global StopIteration*/ -// URL Shim -- see http://url.spec.whatwg.org/ and http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html - -(function() { - try { - var testURL; - if (typeof self.URL === "function" && self.URL.length !== 0 && - (testURL = new self.URL("http://www.w3.org?q")).protocol === "http:" && testURL.query) { - return; - } - } catch (e) {} - - //[1]scheme, [2]authority, [3]path, [4]query, [5]fragment - var _URI_RE = /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/; - //[ userinfo "@" ] host [ ":" port ] - var _AUTHORITY_RE = /^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/; - - var _NO_WS_RE = /^\S*$/; - var _SCHEME_RE = /^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/; - var _PORT_RE = /^\d*$/; - var _HOST_RE = /^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/; - var _HOSTPORT_RE = /^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/; - var _PATH_RE = /^([^?#\s]*)$/; - var _QUERY_RE = /^([^\s]*)$/; - var _FRAGMENT_RE = _NO_WS_RE; - var _USERNAME_PASSWORD_RE = /([^:]*):?(.*)/; - - var STOP_ITERATION = typeof StopIteration !== "undefined" ? StopIteration : new Error("Stop Iteration"); - var DEFAULT_PORTS = { - "ftp:": "21", - "gopher:": "70", - "http:": "80", - "https:": "443", - "ws:": "80", - "wss:": "443" - }; - - function _checkString(txt) { - if (typeof txt !== "string") { - throw new TypeError(); - } - } - - function _parseQuery(query) { - return query ? query.split("&") : []; - } - - function _stringifyQuery(pairs) { - if (pairs.length === 0) { - return ""; - } - return pairs.join("&"); - } - - function _parsePair(pair) { - var parsed = /([^=]*)(?:=?)(.*)/.exec(pair); - var key = parsed[1] ? decodeURIComponent(parsed[1]) : ""; - var value = parsed[2] ? decodeURIComponent(parsed[2]) : ""; - return [key, value]; - } - - function _stringifyPair(entry) { - var pair = encodeURIComponent(entry[0]); - if (entry[1]) { - pair += "=" + encodeURIComponent(entry[1]); - } - return pair; - } - - function _createMapIterator(url, kind) { - var query = ""; - var pairs = []; - var index = 0; - return { - next: function() { - if (query !== url.query) { - query = url.query; - pairs = _parseQuery(query); - } - if (index < pairs.length) { - var entry = _parsePair(pairs[index++]); - switch (kind) { - case "keys": - return entry[0]; - case "values": - return entry[1]; - case "keys+values": - return [entry[0], entry[1]]; - default: - throw new TypeError(); - } - } - throw STOP_ITERATION; - } - }; - } - - // See http://url.spec.whatwg.org/#interface-urlquery - function URLQuery(url) { - Object.defineProperty(this, "_url", { - get: function() { - return url._url; - } - }); - } - - Object.defineProperties(URLQuery.prototype, { - get: { - value: function(key) { - _checkString(key); - var result; - var pairs = _parseQuery(this._url.query); - pairs.some(function(pair) { - var entry = _parsePair(pair); - if (entry[0] === key) { - result = entry[1]; - return true; - } - }); - return result; - }, - enumerable: true - }, - set: { - value: function(key, value) { - _checkString(key); - _checkString(value); - var pairs = _parseQuery(this._url.query); - var found = pairs.some(function(pair, i) { - var entry = _parsePair(pair); - if (entry[0] === key) { - entry[1] = value; - pairs[i] = _stringifyPair(entry); - return true; - } - }); - if (!found) { - pairs.push(_stringifyPair([key, value])); - } - this._url.query = _stringifyQuery(pairs); - }, - enumerable: true - }, - has: { - value: function(key) { - _checkString(key); - var pairs = _parseQuery(this._url.query); - return pairs.some(function(pair) { - var entry = _parsePair(pair); - if (entry[0] === key) { - return true; - } - }); - }, - enumerable: true - }, - "delete": { - value: function(key) { - _checkString(key); - var pairs = _parseQuery(this._url.query); - var filtered = pairs.filter(function(pair) { - var entry = _parsePair(pair); - return entry[0] !== key; - }); - if (filtered.length !== pairs.length) { - this._url.query = _stringifyQuery(filtered); - return true; - } - return false; - }, - enumerable: true - }, - clear: { - value: function() { - this._url.query = ""; - }, - enumerable: true - }, - forEach: { - value: function(callback, thisArg) { - if (typeof callback !== "function") { - throw new TypeError(); - } - var iterator = _createMapIterator(this._url, "keys+values"); - try { - while (true) { - var entry = iterator.next(); - callback.call(thisArg, entry[1], entry[0], this); - } - } catch (e) { - if (e !== STOP_ITERATION) { - throw e; - } - } - }, - enumerable: true - }, - keys: { - value: function() { - return _createMapIterator(this._url, "keys"); - }, - enumerable: true - }, - values: { - value: function() { - return _createMapIterator(this._url, "values"); - }, - enumerable: true - }, - items: { - value: function() { - return _createMapIterator(this._url, "keys+values"); - } - }, - size: { - get: function() { - return _parseQuery(this._url.query).length; - }, - enumerable: true - }, - getAll: { - value: function(key) { - _checkString(key); - var result = []; - var pairs = _parseQuery(this._url.query); - pairs.forEach(function(pair) { - var entry = _parsePair(pair); - if (entry[0] === key) { - result.push(entry[1]); - } - }); - return result; - }, - enumerable: true - }, - append: { - value: function(key, value) { - _checkString(key); - _checkString(value); - var pairs = _parseQuery(this._url.query); - pairs.push(_stringifyPair([key, value])); - this._url.query = _stringifyQuery(pairs); - }, - enumerable: true - } - }); - - function _makeAbsoluteURL(url, base) { - if (!url.scheme && base) { - url.scheme = base.scheme; - if (!url.host && base.host) { - url.userinfo = base.userinfo; - url.host = base.host; - url.port = base.port; - url.pathRelative = true; - } - } - if (url.pathRelative) { - if (!url.path) { - url.path = base.path; - } else if (url.path[0] !== "/") { - var basePath = /^(.*\/)[^\/]*$/.exec(base.path)[1] || "/"; - url.path = basePath + url.path; - } - } - } - - function _normalizeScheme(scheme) { - return scheme.toLowerCase(); - } - - function _normalizePort(port) { - return port ? (/[1-9]\d*$/).exec(port)[0] : ""; - } - - function _normalizePath(path) { - var result = []; - path.split("/").forEach(function(segment) { - if (segment === "..") { - if (result.length > 1) { - result.pop(); - } - } else if (segment !== ".") { - result.push(segment); - } - }); - return result.join("/"); - } - - - function _normalizeURL(url) { - if (url.scheme) { - url.scheme = _normalizeScheme(url.scheme); - } - if (url.port) { - url.port = _normalizePort(url.port); - } - if (url.host && url.path) { - url.path = _normalizePath(url.path); - } - } - - function _encodeWhitespace(text) { - return text.replace(/\s/g, function(c) { - return "%" + c.charCodeAt(0).toString(16); - }); - } - - function _parseURL(input, base) { - if (typeof input !== "string") { - throw new TypeError(); - } - - input = _encodeWhitespace(input); - - var parsedURI = _URI_RE.exec(input); - if (!parsedURI) { - return null; - } - var url = {}; - url.scheme = parsedURI[1] || ""; - if (url.scheme && !_SCHEME_RE.test(url.scheme)) { - return null; - } - var authority = parsedURI[2]; - if (authority) { - var parsedAuthority = _AUTHORITY_RE.exec(authority); - url.userinfo = parsedAuthority[1]; - url.host = parsedAuthority[2]; - url.port = parsedAuthority[3]; - if (url.port && !_PORT_RE.test(url.port)) { - return null; - } - } - url.path = parsedURI[3]; - url.query = parsedURI[4]; - url.fragment = parsedURI[5]; - - _makeAbsoluteURL(url, base); - _normalizeURL(url); - return url; - } - - function _serialize(url) { - var result = (url.scheme ? url.scheme + ":" : ""); - if (url.host) { - result += "//"; - if (url.userinfo) { - result += url.userinfo + "@"; - } - result += url.host; - if (url.port) { - result += ":" + url.port; - } - } - result += url.path; - if (url.query) { - result += "?" + url.query; - } - if (url.fragment) { - result += "#" + url.fragment; - } - return result; - } - - // See http://url.spec.whatwg.org/#api - function URL(input, base) { - var baseURL; - if (base) { - base = base.href || base; - baseURL = _parseURL(base); - if (!baseURL || !baseURL.scheme) { - throw new SyntaxError(); - } - Object.defineProperty(this, "_baseURL", { - value: baseURL - }); - } - - var url = _parseURL(input, baseURL); - if (!url) { - throw new SyntaxError(); - } - - Object.defineProperty(this, "_input", { - value: input, - writable: true - }); - - Object.defineProperty(this, "_url", { - value: url, - writable: true - }); - - var query = new URLQuery(this); - Object.defineProperty(this, "query", { - get: function() { - return this._url ? query : null; - }, - enumerable: true - }); - } - - Object.defineProperties(URL.prototype, { - toString: { - value: function() { - return this.href; - } - }, - href: { - get: function() { - return this._url ? _serialize(this._url) : this._input; - }, - set: function(value) { - _checkString(value); - this._input = value; - this._url = _parseURL(this._input, this._baseURL); - }, - enumerable: true - }, - origin: { - get: function() { - return (this._url && this._url.host ? this.protocol + "//" + this.host : ""); - }, - enumerable: true - }, - protocol: { - get: function() { - return this._url ? this._url.scheme + ":" : ":"; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var scheme = (value.slice(-1) === ":") ? value.substring(0, value.length - 1) : value; - if (scheme === "" || _SCHEME_RE.test(scheme)) { - this._url.scheme = _normalizeScheme(scheme); - } - - }, - enumerable: true - }, - _userinfo: { // note: not part of spec so not enumerable - get: function() { - return this._url ? this._url.userinfo : ""; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - this._url.userinfo = value; - } - }, - username: { - get: function() { - if (!this._url) { - return ""; - } - var parsed = _USERNAME_PASSWORD_RE.exec(this._userinfo); - var username = decodeURIComponent(parsed[1] || ""); - return username; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var parsed = _USERNAME_PASSWORD_RE.exec(this._userinfo); - var userpass = [encodeURIComponent(value || "")]; - if (parsed[2]) { - userpass.push(parsed[2]); - } - this._userinfo = userpass.join(":"); - }, - enumerable: true - }, - password: { - get: function() { - if (!this._url) { - return ""; - } - var parsed = _USERNAME_PASSWORD_RE.exec(this._userinfo); - var password = decodeURIComponent(parsed[2] || ""); - return password; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var parsed = _USERNAME_PASSWORD_RE.exec(this._userinfo); - var userpass = [parsed[1] || ""]; - if (value) { - userpass.push(encodeURIComponent(value)); - } - this._userinfo = userpass.join(":"); - }, - enumerable: true - }, - host: { - get: function() { - var result = ""; - if (this._url && this._url.host) { - result += this._url.host; - if (this._url.port) { - result += ":" + this._url.port; - } - } - return result; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var result = _HOSTPORT_RE.exec(value); - if (result) { - this._url.host = result[1]; - this._url.port = _normalizePort(result[2]); - } - }, - enumerable: true - }, - hostname: { - get: function() { - return this._url ? this._url.host : ""; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var result = _HOST_RE.exec(value); - if (result) { - this._url.host = value; - } - }, - enumerable: true - }, - port: { - get: function() { - var port = this._url ? this._url.port || "" : ""; - if (port && port === DEFAULT_PORTS[this.protocol]) { - port = ""; - } - return port; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var result = _PORT_RE.exec(value); - if (result) { - this._url.port = _normalizePort(value); - } - }, - enumerable: true - }, - pathname: { - get: function() { - return this._url ? this._url.path : ""; - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - var result = _PATH_RE.exec(value); - if (result) { - if (this._url.host && value && value[0] !== "/") { - value = "/" + value; - } - this._url.path = value ? _normalizePath(value) : ""; - } - }, - enumerable: true - }, - search: { - get: function() { - return (this._url && this._url.query ? "?" + this._url.query : ""); - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - if (value && value[0] === "?") { - value = value.substring(1); - } - var result = _QUERY_RE.exec(value); - if (result) { - this._url.query = value; - } - }, - enumerable: true - }, - hash: { - get: function() { - return (this._url && this._url.fragment ? "#" + this._url.fragment : ""); - }, - set: function(value) { - _checkString(value); - if (!this._url) { - return; - } - if (value && value[0] === "#") { - value = value.substring(1); - } - var result = _FRAGMENT_RE.exec(value); - if (result) { - this._url.fragment = value; - } - }, - enumerable: true - } - }); - - var _URL = self.URL || self.webkitURL; - if (_URL && _URL.createObjectURL) { - Object.defineProperty(URL, "createObjectURL", { - value: _URL.createObjectURL.bind(_URL), - enumerable: false - }); - - Object.defineProperty(URL, "revokeObjectURL", { - value: _URL.revokeObjectURL.bind(_URL), - enumerable: false - }); - } - self.URL = URL; -}()); -define("orion/URL-shim", function(){}); - -/******************************************************************************* - * @license - * Copyright (c) 2012, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ -/*eslint-env browser, amd*/ -/*global URL*/ -define('orion/PageLinks',[ - "require", - "orion/Deferred", - "orion/PageUtil", - "orion/URITemplate", - "orion/i18nUtil", - "orion/objects", - "orion/URL-shim" -], function(require, Deferred, PageUtil, URITemplate, i18nUtil, objects) { - - /** - * Returns the value of the {OrionHome} variable. - * @memberOf orion.PageLinks - * @function - * @returns {String} The value of the {OrionHome} variable. - */ - function getOrionHome() { - if(!require.toUrl){ - return new URL("/", self.location.href).href.slice(0, -1); - } else { - // The idea here is to find the path of `orion/*` modules from the loader, and go up one folder to - // the servlet context path. Finally, return a complete URL, slicing off the trailing `/`. - // RequireJS 2.1.15: - var orionSrcURL = new URL(require.toUrl("orion/"), self.location.href); //$NON-NLS-0$ - return new URL("../", orionSrcURL).href.slice(0, -1); //$NON-NLS-0$ - } - } - - /** - * Reads metadata from an orion.page.xxxxx service extension. - * @memberOf orion.PageLinks - * @function - * @param {orion.ServiceRegistry} serviceRegistry The service registry. - * @param {String} [serviceName="orion.page.link"] Service name to read extensions from. - * @return {orion.Promise} A promise that resolves to an {@link orion.PageLinks.PageLinksInfo} object. - */ - function getPageLinksInfo(serviceRegistry, serviceName) { - return _readPageLinksMetadata(serviceRegistry, serviceName).then(function(metadata) { - return new PageLinksInfo(metadata); - }); - } - - function _getPropertiesMap(serviceRef) { - var props = {}; - serviceRef.getPropertyKeys().forEach(function(key) { - if (key !== "objectClass" && key !== "service.names" && key !== "service.id" && key !== "__plugin__") //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - props[key] = serviceRef.getProperty(key); - }); - return props; - } - - function _readPageLinksMetadata(serviceRegistry, serviceName) { - serviceName = serviceName || "orion.page.link"; //$NON-NLS-0$ - - // Read page links. - // https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_Orion_pages - var navLinks= serviceRegistry.getServiceReferences(serviceName); - var params = PageUtil.matchResourceParameters(window.location.href); - // TODO: should not be necessary, see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=373450 - var orionHome = getOrionHome(); - var locationObject = {OrionHome: orionHome, Location: params.resource}; - var navLinkInfos = []; - navLinks.forEach(function(navLink) { - var info = _getPropertiesMap(navLink); - if (!info.uriTemplate || (!info.nls && !info.name)) { - return; // missing data, skip - } - - var uriTemplate = new URITemplate(info.uriTemplate); - var expandedHref = uriTemplate.expand(locationObject); - expandedHref = PageUtil.validateURLScheme(expandedHref); - info.href = expandedHref; - - info.textContent = info.name || info.nameKey; - navLinkInfos.push(new Deferred().resolve(info)); - }); - return Deferred.all(navLinkInfos); - } - - // Categories apply to all orion.page.link* serviceNames, so cache them. - var _cachedCategories; - /** - * Reads info about page link categories. - * @returns {orion.Promise} Resolving to {@link orion.PageLinks.CategoriesInfo} - */ - function getCategoriesInfo(serviceRegistry) { - // Read categories. - var categoryInfos; - if (!_cachedCategories) { - categoryInfos = []; - var navLinkCategories = serviceRegistry.getServiceReferences("orion.page.link.category"); //$NON-NLS-0$ - navLinkCategories.forEach(function(serviceRef) { - var info = _getPropertiesMap(serviceRef); - if (!info.id || (!info.name && !info.nameKey)) { - return; - } - info.service = serviceRegistry.getService(serviceRef); - info.textContent = info.name; - categoryInfos.push(new Deferred().resolve(info)); - }); - return Deferred.all(categoryInfos).then(function(infos) { - _cachedCategories = new CategoriesInfo(infos); - return _cachedCategories; - }); - } - return new Deferred().resolve(_cachedCategories); - } - - function CategoriesInfo(categoriesArray) { - var categories = this.categories = Object.create(null); // Maps category id {String} to category {Object} - - categoriesArray.forEach(function(category) { - categories[category.id] = category; - }); - } - objects.mixin(CategoriesInfo.prototype, /** @lends orion.CategoriesInfo.CategoriesInfo.prototype */ { - /** - * Returns the category IDs. - * @returns {String[]} The category IDs. - */ - getCategoryIDs: function() { - return Object.keys(this.categories); - }, - /** - * Returns the data for a given category. - * @param {String} id The category ID. - * @returns {Object} The category data. - */ - getCategory: function(id) { - return this.categories[id] || null; - } - }); - - /** - * @name orion.PageLinks.PageLinksInfo - * @class - * @description Provides access to info about page links read from an extension point. - */ - function PageLinksInfo(allPageLinks) { - this.allPageLinks = allPageLinks; - this.allPageLinks.sort(_comparePageLinks); - } - objects.mixin(PageLinksInfo.prototype, /** @lends orion.PageLinks.PageLinksInfo.prototype */ { - /** - * Builds DOM elements for links - * @returns {Element[]} The links. - */ - createLinkElements: function() { - return this.allPageLinks.map(function(info) { - return _createLink(info.href, "_self", info.textContent); //$NON-NLS-0$ - }); - }, - /** - * @returns {Object[]} The links. - */ - getAllLinks: function() { - return this.allPageLinks; - } - }); - - function _comparePageLinks(a, b) { - var n1 = a.textContent && a.textContent.toLowerCase(); - var n2 = b.textContent && b.textContent.toLowerCase(); - if (n1 < n2) { return -1; } - if (n1 > n2) { return 1; } - return 0; - } - - function _createLink(href, target, textContent) { - var a = document.createElement("a"); - a.href = href; - a.target = target; - a.classList.add("targetSelector"); - a.textContent = textContent; - return a; - } - - /** - * @name orion.PageLinks - * @class Utilities for reading orion.page.link services. - * @description Utilities for reading orion.page.link services. - */ - return { - getCategoriesInfo: getCategoriesInfo, - getPageLinksInfo: getPageLinksInfo, - getOrionHome: getOrionHome - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011,2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/extensionCommands',["orion/Deferred", "orion/commands", 'orion/PageUtil', "orion/contentTypes", "orion/URITemplate", "orion/i18nUtil", "orion/PageLinks", "i18n!orion/edit/nls/messages", "orion/URL-shim"], - function(Deferred, mCommands, PageUtil, mContentTypes, URITemplate, i18nUtil, PageLinks, messages){ - - /** - * Utility methods - * @class This class contains static utility methods for creating and managing commands from extension points - * related to file management. - * @name orion.extensionCommands - */ - var extensionCommandUtils = {}; - - // TODO working around https://bugs.eclipse.org/bugs/show_bug.cgi?id=373450 - var orionHome = PageLinks.getOrionHome(); - - extensionCommandUtils._cloneItemWithoutChildren = function clone(item){ - if (item === null || typeof(item) !== 'object') { //$NON-NLS-0$ - return item; - } - - var temp = item.constructor(); // changed - - for(var key in item){ - if(key!=="children" && key!=="Children" && key!=="parent" && key!=="Project") { //$NON-NLS-1$ //$NON-NLS-0$ - temp[key] = clone(item[key]); - } - } - return temp; - }; - - /* - * Helper function which returns an object containing all of the specified - * serviceReference's properties. - * @name _getServiceProperties - * @param {orion.serviceregistry.ServiceReference} serviceReference - * @returns {Object} All the properties of the given serviceReference. - */ - function _getServiceProperties(serviceReference){ - var info = {}; - var propertyNames = serviceReference.getPropertyKeys(); - propertyNames.forEach(function(propertyName) { - info[propertyName] = serviceReference.getProperty(propertyName); - }); - return info; - } - - /** - * Reads "orion.navigate.openWith" service contributions and returns corresponding orion.navigate.command extensions. - * @name orion.extensionCommands._getOpenWithNavCommandExtensions - * @function - * @returns {Object[]} The nav command extensions. - */ - extensionCommandUtils._getOpenWithNavCommandExtensions = function(serviceRegistry, contentTypes) { - function getEditors() { - var serviceReferences = serviceRegistry.getServiceReferences("orion.edit.editor"); //$NON-NLS-0$ - var editors = []; - for (var i=0; i < serviceReferences.length; i++) { - var serviceRef = serviceReferences[i], id = serviceRef.getProperty("id"); //$NON-NLS-0$ - editors.push({ - id: id, - "default": serviceRef.getProperty("default") || false, //$NON-NLS-1$ //$NON-NLS-0$ - name: serviceRef.getProperty("name"), //$NON-NLS-0$ - nameKey: serviceRef.getProperty("nameKey"), //$NON-NLS-0$ - nls: serviceRef.getProperty("nls"), //$NON-NLS-0$ - uriTemplate: serviceRef.getProperty("orionTemplate") || serviceRef.getProperty("uriTemplate"), //$NON-NLS-1$ //$NON-NLS-0$ - validationProperties: serviceRef.getProperty("validationProperties") || [] //$NON-NLS-0$ - }); - } - return editors; - } - - function getEditorOpenWith(serviceRegistry, editor) { - var openWithReferences = serviceRegistry.getServiceReferences("orion.navigate.openWith"); //$NON-NLS-0$ - var types = []; - var excludedTypes = []; - for (var i=0; i < openWithReferences.length; i++) { - var ref = openWithReferences[i]; - if (ref.getProperty("editor") === editor.id) { //$NON-NLS-0$ - var ct = ref.getProperty("contentType"); //$NON-NLS-0$ - if (ct instanceof Array) { - types = types.concat(ct); - } else { //$NON-NLS-0$ - types.push(ct || "*/*"); - } - - var excludes = ref.getProperty("excludedContentTypes"); //$NON-NLS-0$ - if (excludes instanceof Array) { - excludedTypes = excludedTypes.concat(excludes); - } else if ((excludes !== null) && (typeof excludes !== "undefined")) { //$NON-NLS-0$ - excludedTypes.push(excludes); - } - } - } - if (0 === types.length) { - types = null; - } - if (0 === excludedTypes.length) { - excludedTypes = null; - } - return {contentTypes: types, excludedContentTypes: excludedTypes}; - } - - var editors = getEditors(); - var fileCommands = []; - var genericEditorOpen; - var orionEditorId = "orion.editor"; - - for (var i=0; i < editors.length; i++) { - var editor = editors[i]; - var editorContentTypeInfo = getEditorOpenWith(serviceRegistry, editor); - var editorContentTypes = editorContentTypeInfo.contentTypes; - var excludedContentTypes = editorContentTypeInfo.excludedContentTypes; - var properties = { - name: editor.name || editor.id, - nameKey: editor.nameKey, - id: "eclipse.openWithCommand." + editor.id, //$NON-NLS-0$ - contentType: editorContentTypes, - excludedContentTypes: excludedContentTypes, - uriTemplate: editor.uriTemplate, - nls: editor.nls, - forceSingleItem: true, - isEditor: (editor["default"] ? "default": "editor"), // Distinguishes from a normal fileCommand //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - validationProperties: editor.validationProperties - }; - var command = {properties: properties, service: {}}; - if (editor.id === orionEditorId) { - genericEditorOpen = command; - } else { - fileCommands.push(command); - } - } - if (genericEditorOpen) { - fileCommands.push(genericEditorOpen); - } - return fileCommands; - }; - - /** - * Create a validator for a given set of service properties. The validator should be able to - * validate a given item using the "contentType" and "validationProperties" service properties. - * @name orion.extensionCommands._makeValidator - * @function - */ - extensionCommandUtils._makeValidator = function(info, serviceRegistry, contentTypes, validationItemConverter) { - function checkItem(item, key, match, validationProperty, validator) { - var valid = false; - var value; - // Match missing property - if (key.charAt(0) === "!") { //$NON-NLS-0$ - return (typeof item[key.substring(1)] === "undefined"); //$NON-NLS-0$ - } - // item has the specified property - if (typeof(item[key]) !== "undefined") { //$NON-NLS-0$ - if (typeof(match) === "undefined") { //$NON-NLS-0$ // value doesn't matter, just the presence of the property is enough if (!match) { // value doesn't matter, just the presence of the property is enough - value = item[key]; - valid = true; - } else if (typeof(match) === 'string') { // the value is a regular expression that should match some string //$NON-NLS-0$ - if (!typeof(item[key] === 'string')) { //$NON-NLS-0$ - // can't pattern match on a non-string - return false; - } - if (validationProperty.variableName) { - var patternMatch = new RegExp(match).exec(item[key]); - if (patternMatch) { - var firstMatch = patternMatch[0]; - if (validationProperty.variableMatchPosition === "before") { //$NON-NLS-0$ - value = item[key].substring(0, patternMatch.index); - } else if (validationProperty.variableMatchPosition === "after") { //$NON-NLS-0$ - value = item[key].substring(patternMatch.index + firstMatch.length); - } else if (validationProperty.variableMatchPosition === "only") { //$NON-NLS-0$ - value = firstMatch; - } else { // "all" - value = item[key]; - } - valid = true; - } - } else { - return new RegExp(match).test(item[key]); - } - } else { - if (item[key] === match) { - value = item[key]; - valid = true; - } - } - // now store any variable values and look for replacements - var variableName = validationProperty.variableName, replacements = validationProperty.replacements; - if (valid && variableName) { - // store the variable values in the validator, keyed by variable name. Also remember which item this value applies to. - validator[variableName] = value; - validator.itemCached = item; - if (replacements) { - if (typeof value !== "string") { - window.console.log("Cannot replace " + variableName + ", value is not a string: " + value); - return valid; - } - for (var i=0; i= 0) { //$NON-NLS-0$ - if((pos2 = propertyName.indexOf("]")) < 0){ //$NON-NLS-0$ - return false; - } - // The [] is used to drill into a numeric property of an array - var fieldName = propertyName.substring(0, pos1), array, arrayIndex; - if(!(array = item[fieldName]) || !Array.isArray(array)){ - return false; - } - key = propertyName.substring(pos1 + 1, pos2); - arrayIndex = parseInt(key, 10); - if (isNaN(arrayIndex)) - return false; - - // Index may be < 0 in which case it counts backwards from object.length - if (arrayIndex < 0) - arrayIndex += array.length; - - // Just rewrite the [] expression into a nested property access and fall down to the ":" case - keyLastSegments = propertyName.substring(pos2 + 1); - propertyName = fieldName + ":" + String(arrayIndex) + keyLastSegments; - } - - if (propertyName.indexOf("|") >= 0) { //$NON-NLS-0$ - // the pipe means that any one of the piped properties can match - key = propertyName.substring(0, propertyName.indexOf("|")); //$NON-NLS-0$ - keyLastSegments = propertyName.substring(propertyName.indexOf("|")+1); //$NON-NLS-0$ - // if key matches, we can stop. No match is not a failure, look in the next segments. - if (matchSinglePattern(item, key, validationProperty, validator)) { - return true; - } else { - return matchSinglePattern(item, keyLastSegments, validationProperty, validator); - } - } else if (propertyName.indexOf(":") >= 0) { //$NON-NLS-0$ - // the colon is used to drill into a property - key = propertyName.substring(0, propertyName.indexOf(":")); //$NON-NLS-0$ - keyLastSegments = propertyName.substring(propertyName.indexOf(":")+1); //$NON-NLS-0$ - // must have key and then check the next value - if (item[key]) { - return matchSinglePattern(item[key], keyLastSegments, validationProperty, validator); - } else { - return false; - } - } else { - // we are checking a single property - return checkItem(item, propertyName, value, validationProperty, validator); - } - } - - function validateSingleItem(item, contentTypes, validator){ - // first validation properties - if (validator.info.validationProperties) { - for (var i=0; i= 0){ - return true; - } - return false; - } - - var showCommand = true; - var contentType = contentTypes ? mContentTypes.getFilenameContentType(item.Name, contentTypes) : null; - contentType = contentType || { - id:"application/octet-stream" - }; - if (validator.info.excludedContentTypes && contentTypes) { - showCommand = validator.info.excludedContentTypes.every(function(excludedContentType){ - var filter = excludedContentType.replace(/([*?])/g, ".$1"); //$NON-NLS-0$ //convert user input * and ? to .* and .? - if (-1 !== contentType.id.search(filter)) { - // found a match, return false thereby hiding this command - return false; - } - return true; - }); - } - - if (showCommand && validator.info.contentType && contentTypes) { - // the presence of validator.info.contentType means that we only - // want to show the command if the contentType matches - showCommand = validator.info.contentType.some(function(includedContentType){ - var filter = includedContentType.replace(/([*?])/g, ".$1"); //$NON-NLS-0$ //convert user input * and ? to .* and .? - if (-1 !== contentType.id.search(filter)) { - // found a match, return true - return true; - } - return false; - }); - } - return showCommand; - } - - var validator = {info: info}; - validator.validationFunction = function(items){ - if (typeof validationItemConverter === "function") { //$NON-NLS-0$ - items = validationItemConverter.call(this, items); - } - if (items) { - if (Array.isArray(items)){ - if ((this.info.forceSingleItem || this.info.uriTemplate) && items.length !== 1) { - return false; - } - if (items.length < 1){ - return false; - } - } else { - items = [items]; - } - - for (var i=0; icommandRegistry for a given item. If {@link #createFileCommands}, has not been called, - * this returns null. - * @name orion.extensionCommands.getOpenWithCommand - * @function - * @param {orion.commandregistry.CommandRegistry} commandRegistry The command registry to consult. - * @param {Object} item The item to open. - * @param {orion.commands.Command[]} The optional list of commands to search for the appropriate command. If it is not provided, - * orion.extensionCommands.getOpenWithCommands() is used. - */ - extensionCommandUtils.getOpenWithCommand = function(commandRegistry, item, commands) { - var openWithCommand; - var openWithCommands = commands || extensionCommandUtils.getOpenWithCommands(commandRegistry); - for (var i=0; i < openWithCommands.length; i++) { - if (openWithCommands[i].visibleWhen(item)) { - var isDefault = openWithCommands[i].isEditor === "default"; //$NON-NLS-0$ - if (!openWithCommand || isDefault) { - openWithCommand = openWithCommands[i]; - if (isDefault) { - break; - } - } - } - } - return openWithCommand; - }; - - /** - * Gets any "open with" commands in the given commandRegistry. If {@link #createFileCommands}, has not been called, - * this returns an empty array. - * @name orion.extensionCommands.getOpenWithCommands - * @function - * @param {orion.commandregistry.CommandRegistry} commandRegistry The command registry to consult. - * @returns {orion.commands.Command[]} All the "open with" commands added to the given commandRegistry. - */ - extensionCommandUtils.getOpenWithCommands = function(commandRegistry) { - var openWithCommands = []; - for (var commandId in commandRegistry._commandList) { - var command = commandRegistry._commandList[commandId]; - if (command.isEditor) { - openWithCommands.push(command); - } - } - return openWithCommands; - }; - - var contentTypesCache; - - /** - * Collects file commands from extensions, turns them into {@link orion.commands.Command}s, and adds the commands with the given commandRegistry. - * @name orion.extensionCommands.createAndPlaceFileCommandsExtension - * @function - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {orion.commandregistry.CommandRegistry} commandRegistry - * @param {String} toolbarId - * @param {Number} position - * @param {String} commandGroup - * @param {Boolean} isNavigator - * @param {Function} visibleWhen - * @returns {orion.Promise} - */ - extensionCommandUtils.createAndPlaceFileCommandsExtension = function(serviceRegistry, commandRegistry, toolbarId, position, commandGroup, isNavigator) { - var navCommands = (isNavigator ? "all" : undefined); //$NON-NLS-0$ - var openWithCommands = !!isNavigator; - return extensionCommandUtils.createFileCommands(serviceRegistry, null, navCommands, openWithCommands, commandRegistry).then(function(fileCommands) { - if (commandGroup && (0 < fileCommands.length)) { - commandRegistry.addCommandGroup(toolbarId, "eclipse.openWith", 1000, messages["OpenWith"], commandGroup, null, null, null, "dropdownSelection"); ///$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.addCommandGroup(toolbarId, "eclipse.fileCommandExtensions", 1000, messages["OpenRelated"], commandGroup); //$NON-NLS-0$ - } - fileCommands.forEach(function(command) { - var group = null; - if (commandGroup) { - if (command.isEditor) { - group = commandGroup + "/eclipse.openWith"; //$NON-NLS-0$ - } else { - group = commandGroup + "/eclipse.fileCommandExtensions"; //$NON-NLS-0$ - } - } - - commandRegistry.registerCommandContribution(toolbarId, command.id, position, group); //$NON-NLS-0$ - }); - return {}; - }); - }; - - /** - * Reads file commands from extensions ("orion.navigate.command" and "orion.navigate.openWith"), and converts them into - * instances of {@link orion.commands.Command}. - * @name orion.extensionCommands.createFileCommands - * @function - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {orion.core.ContentTypeRegistry} [contentTypeRegistry] If not provided, will be obtained from the serviceRegistry. - * @param {String} [includeNavCommands="global"] What kinds of orion.navigate.command contributions to include in the list of returned file commands. - * Allowed values are: - *
        - *
        "all"
        Include all nav commands.
        - *
        "global"
        Include only nav commands having the forceSingleItem and showGlobally flags.
        - *
        "none"
        Include no nav commands.
        - *
        - * @param {Boolean} [includeOpenWithCommands=true] Whether to include commands derived from orion.navigate.openWith in the list of returned file commands. - * @param {orion.commandregistry.CommandRegistry} commandRegistry - * @returns {orion.Promise} A promise resolving to an {@link orion.commands.Command[]} giving an array of file commands. - */ - extensionCommandUtils.createFileCommands = function(serviceRegistry, contentTypeRegistry, includeFileCommands, includeOpenWithCommands, commandRegistry) { - includeFileCommands = (includeFileCommands === undefined) ? "global" : includeFileCommands; - includeOpenWithCommands = (includeOpenWithCommands === undefined) ? true : includeOpenWithCommands; - - // Note that the shape of the "orion.navigate.command" extension is not in any shape or form that could be considered final. - // We've included it to enable experimentation. Please provide feedback on IRC or bugzilla. - // - // The shape of the contributed commands is (for now): - // info - information about the command (object). - // required attribute: name - the name of the command - // required attribute: id - the id of the command - // optional attribute: tooltip - the tooltip to use for the command - // optional attribute: image - a URL to an image for the command - // optional attribute: uriTemplate - a URI template that can be expanded to generate a URI appropriate for the item. - // optional attribute: forceSingleItem - if true, then the service is only invoked when a single item is selected - // and the item parameter to the run method is guaranteed to be a single item vs. an array. When this is not true, - // the item parameter to the run method may be an array of items. - // optional attribute: contentType - an array of content types for which this command is valid - // optional attribute: validationProperties - an array of validation properties used to read the resource - // metadata to determine whether the command is valid for the given resource. Regular expression patterns are - // supported as values in addition to specific values. - // For example the validation property - // [{source: "Git"}, {source: "Directory", match:"true"}] - // specifies that the property "Git" must be present, and that the property "Directory" must be true. - // run - the implementation of the command (function). - // arguments passed to run: (itemOrItems) - // itemOrItems (object or array) - an array of items to which the item applies, or a single item if the info.forceSingleItem is true - // the run function is assumed to perform all necessary action and the return is not used. - var fileCommands = []; - - if (!extensionCommandUtils._cachedFileCommands) { - extensionCommandUtils._createCachedFileCommands(serviceRegistry); - } - - //we have already created the file commands, only select applicable ones based on function parameters - if (includeFileCommands === "all" || includeFileCommands === "global") { //$NON-NLS-1$ //$NON-NLS-0$ - extensionCommandUtils._cachedFileCommands.forEach(function(fileCommand) { - var properties = fileCommand.properties; - // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402447 - if ((includeFileCommands === "all") || (properties.forceSingleItem && properties.showGlobally)) { //$NON-NLS-0$ - fileCommands.push(fileCommand); - } - }); - } - - function getContentTypes() { - var contentTypes = serviceRegistry.getService("orion.core.contentTypeRegistry") || contentTypeRegistry; - return contentTypesCache || Deferred.when(contentTypes.getContentTypes(), function(ct) { //$NON-NLS-0$ - contentTypesCache = ct; - return contentTypesCache; - }); - } - - return Deferred.when(getContentTypes(), function() { - // If we are processing commands for the navigator, also include the open with command. If we are not in the navigator, we only want the - // commands we processed before. - // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=402447 - if (includeOpenWithCommands) { - if (!extensionCommandUtils._cachedOpenWithExtensions) { - extensionCommandUtils._cachedOpenWithExtensions = extensionCommandUtils._getOpenWithNavCommandExtensions(serviceRegistry, contentTypesCache); - } - //add _cachedOpenWithExtensions to fileCommands - fileCommands = fileCommands.concat(extensionCommandUtils._cachedOpenWithExtensions); - commandRegistry._addedOpenWithCommands = includeOpenWithCommands; - } - - var commandDeferreds = fileCommands.map(function(fileCommand) { - var commandInfo = fileCommand.properties; - var service = fileCommand.service; - var cachedCommand = commandRegistry.findCommand(getIdFromInfo(commandInfo)); - if (cachedCommand) { - return new Deferred().resolve(cachedCommand); - } else { - return extensionCommandUtils._createCommandOptions(commandInfo, service, serviceRegistry, contentTypesCache, true).then(function(commandOptions) { - var command = new mCommands.Command(commandOptions); - commandRegistry.addCommand(command); - return command; - }); - } - }); - return Deferred.all(commandDeferreds, function(error) { - return {_error: error}; - }).then(function(errorOrResultArray) { - return errorOrResultArray; - }); - }); - }; - - extensionCommandUtils._createCachedFileCommands = function(serviceRegistry) { - var commandsReferences = serviceRegistry.getServiceReferences("orion.navigate.command"); //$NON-NLS-0$ - extensionCommandUtils._cachedFileCommands = []; - - for (var i=0; i"orion.navigate.openWith"
        extensions, and converts them into instances of {@link orion.commands.Command}. - * @name orion.extensionCommands.createOpenWithCommands - * @function - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {orion.commandregistry.CommandRegistry} [commandRegistry] - * @param {orion.core.ContentTypeRegistry} [contentTypeRegistry] If not provided, will be obtained from the serviceRegistry. - * @returns {orion.Promise} A promise resolving to an {@link orion.commands.Command[]} giving an array of file commands. - */ - extensionCommandUtils.createOpenWithCommands = function(serviceRegistry, contentTypeService, commandRegistry) { - if (commandRegistry && commandRegistry._addedOpenWithCommands) { - // already processed by #createAndPlaceFileCommandsExtension - return new Deferred().resolve(extensionCommandUtils.getOpenWithCommands(commandRegistry)); - } - return extensionCommandUtils.createFileCommands(serviceRegistry, contentTypeService, "none", true, commandRegistry); - }; - - return extensionCommandUtils; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -/** - * @name orion.regex - * @class Utilities for dealing with regular expressions. - * @description Utilities for dealing with regular expressions. - */ -define("orion/regex", [], function() { //$NON-NLS-0$ - /** - * @memberOf orion.regex - * @function - * @static - * @description Escapes regex special characters in the input string. - * @param {String} str The string to escape. - * @returns {String} A copy of str with regex special characters escaped. - */ - function escape(str) { - return str.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g, "\\$&"); //$NON-NLS-0$ - } - - /** - * @memberOf orion.regex - * @function - * @static - * @description Parses a pattern and flags out of a regex literal string. - * @param {String} str The string to parse. Should look something like "/ab+c/" or "/ab+c/i". - * @returns {Object} If str looks like a regex literal, returns an object with properties - *
        - *
        pattern
        {String}
        - *
        flags
        {String}
        - *
        otherwise returns null. - */ - function parse(str) { - var regexp = /^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(str); - if (regexp) { - return { - pattern : regexp[1], - flags : regexp[2] - }; - } - return null; - } - - return { - escape: escape, - parse: parse - }; -}); - -/******************************************************************************* - * Copyright (c) 2010, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/eventTarget", [], function() { - /** - * Constructs a new EventTarget object. - * - * @class - * @name orion.editor.EventTarget - */ - function EventTarget() { - } - /** - * Adds in the event target interface into the specified object. - * - * @param {Object} object The object to add in the event target interface. - */ - EventTarget.addMixin = function(object) { - var proto = EventTarget.prototype; - for (var p in proto) { - if (proto.hasOwnProperty(p)) { - object[p] = proto[p]; - } - } - }; - EventTarget.prototype = /** @lends orion.editor.EventTarget.prototype */ { - /** - * Adds an event listener to this event target. - * - * @param {String} type The event type. - * @param {Function|EventListener} listener The function or the EventListener that will be executed when the event happens. - * @param {Boolean} [useCapture=false] true if the listener should be trigged in the capture phase. - * - * @see orion.editor.EventTarget#removeEventListener - */ - addEventListener: function(type, listener, useCapture) { - if (!this._eventTypes) { this._eventTypes = {}; } - var state = this._eventTypes[type]; - if (!state) { - state = this._eventTypes[type] = {level: 0, listeners: []}; - } - var listeners = state.listeners; - listeners.push({listener: listener, useCapture: useCapture}); - }, - /** - * Dispatches the given event to the listeners added to this event target. - * @param {Event} evt The event to dispatch. - */ - dispatchEvent: function(evt) { - var type = evt.type; - this._dispatchEvent("pre" + type, evt); //$NON-NLS-0$ - this._dispatchEvent(type, evt); - this._dispatchEvent("post" + type, evt); //$NON-NLS-0$ - }, - /** - * Dispatches the given event to the listeners added to this event target. - * @private - * @param {String} type The name of the event type to send - * @param {Event} evt The event to dispatch. - */ - _dispatchEvent: function(type, evt) { - var state = this._eventTypes ? this._eventTypes[type] : null; - if (state) { - var listeners = state.listeners; - try { - state.level++; - if (listeners) { - for (var i=0, len=listeners.length; i < len; i++) { - if (listeners[i]) { - var l = listeners[i].listener; - if (typeof l === "function") { - l.call(this, evt); - } else if (l.handleEvent && typeof l.handleEvent === "function") { - l.handleEvent(evt); - } - } - } - } - } finally { - state.level--; - if (state.compact && state.level === 0) { - for (var j=listeners.length - 1; j >= 0; j--) { - if (!listeners[j]) { - listeners.splice(j, 1); - } - } - if (listeners.length === 0) { - delete this._eventTypes[type]; - } - state.compact = false; - } - } - } - }, - /** - * Returns whether there is a listener for the specified event type. - * - * @param {String} type The event type - * - * @see orion.editor.EventTarget#addEventListener - * @see orion.editor.EventTarget#removeEventListener - */ - isListening: function(type) { - if (!this._eventTypes) { return false; } - return this._eventTypes[type] !== undefined; - }, - /** - * Removes an event listener from the event target. - *

        - * All the parameters must be the same ones used to add the listener. - *

        - * - * @param {String} type The event type - * @param {Function|EventListener} listener The function or the EventListener that will be executed when the event happens. - * @param {Boolean} [useCapture=false] true if the listener should be trigged in the capture phase. - * - * @see orion.editor.EventTarget#addEventListener - */ - removeEventListener: function(type, listener, useCapture){ - if (!this._eventTypes) { return; } - var state = this._eventTypes[type]; - if (state) { - var listeners = state.listeners; - for (var i=0, len=listeners.length; i < len; i++) { - var l = listeners[i]; - if (l && l.listener === listener && l.useCapture === useCapture) { - if (state.level !== 0) { - listeners[i] = null; - state.compact = true; - } else { - listeners.splice(i, 1); - } - break; - } - } - if (listeners.length === 0) { - delete this._eventTypes[type]; - } - } - } - }; - return {EventTarget: EventTarget}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textModel", ['orion/editor/eventTarget', 'orion/regex', 'orion/util'], function(mEventTarget, mRegex, util) { - - /** - * Constructs a new TextModel with the given text and default line delimiter. - * - * @param {String} [text=""] the text that the model will store - * @param {String} [lineDelimiter=platform delimiter] the line delimiter used when inserting new lines to the model. - * - * @name orion.editor.TextModel - * @class The TextModel is an interface that provides text for the view. Applications may - * implement the TextModel interface to provide a custom store for the view content. The - * view interacts with its text model in order to access and update the text that is being - * displayed and edited in the view. This is the default implementation. - *

        - * See:
        - * {@link orion.editor.TextView}
        - * {@link orion.editor.TextView#setModel} - *

        - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function TextModel(text, lineDelimiter) { - this._lastLineIndex = -1; - this._text = [""]; - this._lineOffsets = [0]; - this.setText(text); - this.setLineDelimiter(lineDelimiter); - } - - TextModel.prototype = /** @lends orion.editor.TextModel.prototype */ { - /** - * Destroys this text model. - */ - destroy: function() { - }, - /** - * @class This object describes the options to use while finding occurrences of a string in a text model. - * @name orion.editor.FindOptions - * - * @property {String} string the search string to be found. - * @property {Boolean} [regex=false] whether or not the search string is a regular expression. - * @property {Boolean} [wrap=false] whether or not to wrap search. - * @property {Boolean} [wholeWord=false] whether or not to search only whole words. - * @property {Boolean} [caseInsensitive=false] whether or not search is case insensitive. - * @property {Boolean} [reverse=false] whether or not to search backwards. - * @property {Number} [start=0] The start offset to start searching - * @property {Number} [end=charCount] The end offset of the search. Used to search in a given range. - */ - /** - * @class This object represents a find occurrences iterator. - *

        - * See:
        - * {@link orion.editor.TextModel#find}
        - *

        - * @name orion.editor.FindIterator - * - * @property {Function} hasNext Determines whether there are more occurrences in the iterator. - * @property {Function} next Returns the next matched range {start,end} in the iterator. - */ - /** - * Finds occurrences of a string in the text model. - * - * @param {orion.editor.FindOptions} options the search options - * @return {orion.editor.FindIterator} the find occurrences iterator. - */ - find: function(options) { - if (this._text.length > 1) { - this._text = [this._text.join("")]; - } - var string = options.string; - var regex = options.regex; - var pattern = string; - var flags = ""; - var caseInsensitive = options.caseInsensitive; - if (pattern) { - if (regex) { - var parsed = mRegex.parse(pattern); - if (parsed) { - pattern = parsed.pattern; - flags = parsed.flags; - } - } else { - pattern = string.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g, "\\$&"); //$NON-NLS-0$ - /* - * Bug in JS RegEx. In a Turkish locale, dotless i (u0131) capitalizes to I (u0049) and i (u0069) - * capitalizes to dot I (u0130). The JS RegEx does not match correctly the Turkish i's in case - * insensitive mode. The fix is to detect the presence of Turkish i's in the search pattern and - * to modify the pattern to search for both upper and lower case. - */ - if (caseInsensitive) { - pattern = pattern.replace(/[iI\u0130\u0131]/g, "[Ii\u0130\u0131]"); //$NON-NLS-0$ - } - } - } - var current = null, skip; - if (pattern) { - var reverse = options.reverse; - var wrap = options.wrap; - var wholeWord = options.wholeWord; - var start = options.start || 0; - var end = options.end; - var isRange = end !== null && end !== undefined; - if (flags.indexOf("g") === -1) { flags += "g"; } //$NON-NLS-1$ //$NON-NLS-2$ - if (flags.indexOf("m") === -1) { flags += "m"; } //$NON-NLS-1$ //$NON-NLS-2$ - if (caseInsensitive) { - if (flags.indexOf("i") === -1) { flags += "i"; } //$NON-NLS-1$ //$NON-NLS-2$ - } - if (wholeWord) { - pattern = "\\b" + pattern + "\\b"; //$NON-NLS-1$ //$NON-NLS-2$ - } - var text = this._text[0], result, lastIndex, offset = 0; - if (isRange) { - var s = start < end ? start : end; - var e = start < end ? end : start; - text = text.substring(s, e); - offset = s; - } - var re = new RegExp(pattern, flags); - if (reverse) { - skip = function() { - var match = null; - re.lastIndex = 0; - while (true) { - lastIndex = re.lastIndex; - result = re.exec(text); - if (lastIndex === re.lastIndex) { - return null; - } - if (result) { - if (result.index + offset < start) { - match = {start: result.index + offset, end: re.lastIndex + offset}; - } else { - if (!wrap || match) { - break; - } - start = text.length + offset; - match = {start: result.index + offset, end: re.lastIndex + offset}; - } - } else { - break; - } - } - if (match) { start = match.start; } - return match; - }; - } else { - if (!isRange) { - re.lastIndex = start; - } - skip = function() { - while (true) { - lastIndex = re.lastIndex; - result = re.exec(text); - if (lastIndex === re.lastIndex) { - return null; - } - if (result) { - return {start: result.index + offset, end: re.lastIndex + offset}; - } - if (lastIndex !== 0) { - if (wrap) { - continue; - } - } - break; - } - return null; - }; - } - current = skip(); - } - return { - /** - * @callback - */ - next: function() { - var result = current; - if (result) { current = skip(); } - return result; - }, - /** - * @callback - */ - hasNext: function() { - return current !== null; - } - }; - }, - /** - * Returns the number of characters in the model. - * - * @returns {Number} the number of characters in the model. - */ - getCharCount: function() { - var count = 0; - for (var i = 0; i - * The valid indices are 0 to line count exclusive. Returns null - * if the index is out of range. - *

        - * - * @param {Number} lineIndex the zero based index of the line. - * @param {Boolean} [includeDelimiter=false] whether or not to include the line delimiter. - * @returns {String} the line text or null if out of range. - * - * @see orion.editor.TextModel#getLineAtOffset - */ - getLine: function(lineIndex, includeDelimiter) { - var lineCount = this.getLineCount(); - if (!(0 <= lineIndex && lineIndex < lineCount)) { - return null; - } - var start = this._lineOffsets[lineIndex]; - if (lineIndex + 1 < lineCount) { - var text = this.getText(start, this._lineOffsets[lineIndex + 1]); - if (includeDelimiter) { - return text; - } - var end = text.length, c; - while (((c = text.charCodeAt(end - 1)) === 10) || (c === 13)) { - end--; - } - return text.substring(0, end); - } else { - return this.getText(start); - } - }, - /** - * Returns the line index at the given character offset. - *

        - * The valid offsets are 0 to char count inclusive. The line index for - * char count is line count - 1. Returns -1 if - * the offset is out of range. - *

        - * - * @param {Number} offset a character offset. - * @returns {Number} the zero based line index or -1 if out of range. - */ - getLineAtOffset: function(offset) { - var charCount = this.getCharCount(); - if (!(0 <= offset && offset <= charCount)) { - return -1; - } - var lineCount = this.getLineCount(); - if (offset === charCount) { - return lineCount - 1; - } - var lineStart, lineEnd; - var index = this._lastLineIndex; - if (0 <= index && index < lineCount) { - lineStart = this._lineOffsets[index]; - lineEnd = index + 1 < lineCount ? this._lineOffsets[index + 1] : charCount; - if (lineStart <= offset && offset < lineEnd) { - return index; - } - } - var high = lineCount; - var low = -1; - while (high - low > 1) { - index = Math.floor((high + low) / 2); - lineStart = this._lineOffsets[index]; - lineEnd = index + 1 < lineCount ? this._lineOffsets[index + 1] : charCount; - if (offset <= lineStart) { - high = index; - } else if (offset < lineEnd) { - high = index; - break; - } else { - low = index; - } - } - this._lastLineIndex = high; - return high; - }, - /** - * Returns the number of lines in the model. - *

        - * The model always has at least one line. - *

        - * - * @returns {Number} the number of lines. - */ - getLineCount: function() { - return this._lineOffsets.length; - }, - /** - * Returns the line delimiter that is used by the view - * when inserting new lines. New lines entered using key strokes - * and paste operations use this line delimiter. - * - * @return {String} the line delimiter that is used by the view when inserting new lines. - */ - getLineDelimiter: function() { - return this._lineDelimiter; - }, - /** - * Returns the end character offset for the given line. - *

        - * The end offset is not inclusive. This means that when the line delimiter is included, the - * offset is either the start offset of the next line or char count. When the line delimiter is - * not included, the offset is the offset of the line delimiter. - *

        - *

        - * The valid indices are 0 to line count exclusive. Returns -1 - * if the index is out of range. - *

        - * - * @param {Number} lineIndex the zero based index of the line. - * @param {Boolean} [includeDelimiter=false] whether or not to include the line delimiter. - * @return {Number} the line end offset or -1 if out of range. - * - * @see orion.editor.TextModel#getLineStart - */ - getLineEnd: function(lineIndex, includeDelimiter) { - var lineCount = this.getLineCount(); - if (!(0 <= lineIndex && lineIndex < lineCount)) { - return -1; - } - if (lineIndex + 1 < lineCount) { - var end = this._lineOffsets[lineIndex + 1]; - if (includeDelimiter) { - return end; - } - var text = this.getText(Math.max(this._lineOffsets[lineIndex], end - 2), end); - var i = text.length, c; - while (((c = text.charCodeAt(i - 1)) === 10) || (c === 13)) { - i--; - } - return end - (text.length - i); - } else { - return this.getCharCount(); - } - }, - /** - * Returns the start character offset for the given line. - *

        - * The valid indices are 0 to line count exclusive. Returns -1 - * if the index is out of range. - *

        - * - * @param {Number} lineIndex the zero based index of the line. - * @return {Number} the line start offset or -1 if out of range. - * - * @see orion.editor.TextModel#getLineEnd - */ - getLineStart: function(lineIndex) { - if (!(0 <= lineIndex && lineIndex < this.getLineCount())) { - return -1; - } - return this._lineOffsets[lineIndex]; - }, - /** - * Returns the text for the given range. - *

        - * The end offset is not inclusive. This means that character at the end offset - * is not included in the returned text. - *

        - * - * @param {Number} [start=0] the zero based start offset of text range. - * @param {Number} [end=char count] the zero based end offset of text range. - * - * @see orion.editor.TextModel#setText - */ - getText: function(start, end) { - if (start === undefined) { start = 0; } - if (end === undefined) { end = this.getCharCount(); } - if (start === end) { return ""; } - var offset = 0, chunk = 0, length; - while (chunk= this._text.length || lastChunk >= this._text.length || firstChunk > lastChunk) { - return ""; - } - - if (firstChunk === lastChunk) { - return this._text[firstChunk].substring(start - firstOffset, end - lastOffset); - } - var beforeText = this._text[firstChunk].substring(start - firstOffset); - var afterText = this._text[lastChunk].substring(0, end - lastOffset); - return beforeText + this._text.slice(firstChunk+1, lastChunk).join("") + afterText; - }, - /** - * Notifies all listeners that the text is about to change. - *

        - * This notification is intended to be used only by the view. Application clients should - * use {@link orion.editor.TextView#event:onModelChanging}. - *

        - *

        - * NOTE: This method is not meant to called directly by application code. It is called internally by the TextModel - * as part of the implementation of {@link #setText}. This method is included in the public API for documentation - * purposes and to allow integration with other toolkit frameworks. - *

        - * - * @param {orion.editor.ModelChangingEvent} modelChangingEvent the changing event - */ - onChanging: function(modelChangingEvent) { - return this.dispatchEvent(modelChangingEvent); - }, - /** - * Notifies all listeners that the text has changed. - *

        - * This notification is intended to be used only by the view. Application clients should - * use {@link orion.editor.TextView#event:onModelChanged}. - *

        - *

        - * NOTE: This method is not meant to called directly by application code. It is called internally by the TextModel - * as part of the implementation of {@link #setText}. This method is included in the public API for documentation - * purposes and to allow integration with other toolkit frameworks. - *

        - * - * @param {orion.editor.ModelChangedEvent} modelChangedEvent the changed event - */ - onChanged: function(modelChangedEvent) { - return this.dispatchEvent(modelChangedEvent); - }, - /** - * Sets the line delimiter that is used by the view - * when new lines are inserted in the model due to key - * strokes and paste operations. The line delimiter of - * existing lines are unchanged unless the to all - * argument is true. - *

        - * If lineDelimiter is "auto", the delimiter is computed to be - * the first delimiter found in the current text. If lineDelimiter - * is undefined or if there are no delimiters in the current text, the - * platform delimiter is used. - *

        - * - * @param {String} lineDelimiter the line delimiter that is used by the view when inserting new lines. - * @param {Boolean} [all=false] whether or not the delimiter of existing lines are changed. - */ - setLineDelimiter: function(lineDelimiter, all) { - if (lineDelimiter === "auto") { - lineDelimiter = undefined; - if (this.getLineCount() > 1) { - lineDelimiter = this.getText(this.getLineEnd(0), this.getLineEnd(0, true)); - } - } - this._lineDelimiter = lineDelimiter ? lineDelimiter : util.platformDelimiter; - if (all) { - var lineCount = this.getLineCount(); - if (lineCount > 1) { - var lines = new Array(lineCount); - for (var i=0; i - * The end offset is not inclusive. This means that the character at the - * end offset is not replaced. - *

        - *

        - * The text model must notify the listeners before and after the - * the text is changed by calling {@link #onChanging} and {@link #onChanged} - * respectively. - *

        - * - * @param {String} [text=""] the new text. - * @param {Number} [start=0] the zero based start offset of text range. - * @param {Number} [end=char count] the zero based end offset of text range. - * - * @see orion.editor.TextModel#getText - */ - setText: function(text, start, end) { - if (text === undefined) { text = ""; } - if (start === undefined) { start = 0; } - if (end === undefined) { end = this.getCharCount(); } - if (start === end && text === "") { return; } - var startLine = this.getLineAtOffset(start); - var endLine = this.getLineAtOffset(end); - var eventStart = start; - var removedCharCount = end - start; - var removedLineCount = endLine - startLine; - var addedCharCount = text.length; - var addedLineCount = 0; - var lineCount = this.getLineCount(); - - var cr = 0, lf = 0, index = 0; - var newLineOffsets = []; - while (true) { - if (cr !== -1 && cr <= index) { cr = text.indexOf("\r", index); } //$NON-NLS-0$ - if (lf !== -1 && lf <= index) { lf = text.indexOf("\n", index); } //$NON-NLS-0$ - if (lf === -1 && cr === -1) { break; } - if (cr !== -1 && lf !== -1) { - if (cr + 1 === lf) { - index = lf + 1; - } else { - index = (cr < lf ? cr : lf) + 1; - } - } else if (cr !== -1) { - index = cr + 1; - } else { - index = lf + 1; - } - newLineOffsets.push(start + index); - addedLineCount++; - } - - var modelChangingEvent = { - type: "Changing", //$NON-NLS-0$ - text: text, - start: eventStart, - removedCharCount: removedCharCount, - addedCharCount: addedCharCount, - removedLineCount: removedLineCount, - addedLineCount: addedLineCount - }; - this.onChanging(modelChangingEvent); - - //TODO this should be done the loops below to avoid getText() - if (newLineOffsets.length === 0) { - var startLineOffset = this.getLineStart(startLine), endLineOffset; - if (endLine + 1 < lineCount) { - endLineOffset = this.getLineStart(endLine + 1); - } else { - endLineOffset = this.getCharCount(); - } - if (start !== startLineOffset) { - text = this.getText(startLineOffset, start) + text; - start = startLineOffset; - } - if (end !== endLineOffset) { - text = text + this.getText(end, endLineOffset); - end = endLineOffset; - } - } - - var changeCount = addedCharCount - removedCharCount; - for (var j = startLine + removedLineCount + 1; j < lineCount; j++) { - this._lineOffsets[j] += changeCount; - } - - /* - * Feature in Chrome. Chrome exceeds the maximum call stack when calling splice - * around 62k arguments. The limit seems to be higher on IE (250K) and Firefox (450k). - * The fix is to break the splice in junks of 50k. - */ - var SPLICE_LIMIT = 50000; - var limit = SPLICE_LIMIT, args; - if (newLineOffsets.length < limit) { - args = [startLine + 1, removedLineCount].concat(newLineOffsets); - Array.prototype.splice.apply(this._lineOffsets, args); - } else { - index = startLine + 1; - this._lineOffsets.splice(index, removedLineCount); - for (var k = 0; k < newLineOffsets.length; k += limit) { - args = [index, 0].concat(newLineOffsets.slice(k, Math.min(newLineOffsets.length, k + limit))); - Array.prototype.splice.apply(this._lineOffsets, args); - index += limit; - } - } - - var offset = 0, chunk = 0, length; - while (chunk - *
      • {@link orion.searchUtils.SearchParams} params The search parameters.
      • - *
      • {@link Object} inFileQuery The query object for in file search.
      • - *
      • {@link String} displayedSearchTerm The search term display string.
      • - *
      - * @name orion.searchUtils.generateSearchHelper - * @function - */ -searchUtils.generateSearchHelper = function(searchParams, fromStart) { - var searchStr = searchParams.keyword; - var displayedSearchTerm = searchStr; - var inFileQuery = {}; - if(searchParams.fileType && searchParams.fileType !== searchUtils.ALL_FILE_TYPE && searchStr === ""){ - displayedSearchTerm = "*." + searchParams.fileType; //$NON-NLS-0$ - } - if(!searchParams.regEx){ - var hasStar = (searchStr.indexOf("*") > -1); //$NON-NLS-0$ - var hasQMark = (searchStr.indexOf("?") > -1); //$NON-NLS-0$ - if(hasStar){ - searchStr = searchStr.split("*").join(".*"); //$NON-NLS-1$ //$NON-NLS-0$ - } - if(hasQMark){ - searchStr = searchStr.split("?").join("."); //$NON-NLS-1$ //$NON-NLS-0$ - } - if(searchParams.wholeWord){ - //escape all meta characters in string literal search except for * and .(when * or ? present) - searchStr = hasStar || hasQMark ? searchStr.replace(/[-[\]{}()+,\\^$|#\s]/g, "\\$&") : searchStr.replace(/[-[\]{}()+.,\\^$|#\s]/g, "\\$&") ; - } - if(!hasStar && !hasQMark && !searchParams.nameSearch && !searchParams.wholeWord){ - inFileQuery.searchStr = searchParams.caseSensitive ? searchStr.split("\\").join("") : searchStr.split("\\").join("").toLowerCase(); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - inFileQuery.wildCard = false; - } else { - inFileQuery.searchStr = searchParams.caseSensitive ? searchStr : searchStr.toLowerCase(); - _generateSearchHelperRegEx(inFileQuery, searchParams, fromStart); - inFileQuery.wildCard = true; - } - } else { - inFileQuery.searchStr =searchStr; - _generateSearchHelperRegEx(inFileQuery, searchParams, fromStart); - } - inFileQuery.searchStrLength = inFileQuery.searchStr.length; - return {params: searchParams, inFileQuery: inFileQuery, displayedSearchTerm: displayedSearchTerm}; -}; - -searchUtils.convertSearchParams = function(searchParams) { - if(searchParams.rows !== undefined){ - searchParams.rows = parseInt(searchParams.rows, 10); - } - if(searchParams.start !== undefined){ - searchParams.start = parseInt(searchParams.start, 10); - } - if(typeof searchParams.regEx === "string"){ //$NON-NLS-0$ - searchParams.regEx = (searchParams.regEx.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(typeof searchParams.caseSensitive === "string"){ //$NON-NLS-0$ - searchParams.caseSensitive = (searchParams.caseSensitive.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(typeof searchParams.nameSearch === "string"){ //$NON-NLS-0$ - searchParams.nameSearch = (searchParams.nameSearch.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(searchParams.fileNamePatterns !== undefined){ - searchParams.fileNamePatterns = searchUtils.getFileNamePatternsArray(searchParams.fileNamePatterns); - } -}; - -searchUtils.getFileNamePatternsArray = function(patterns) { - var fileNamePatternArray = undefined; - - if (patterns) { - var fileNamePatterns = patterns.trim(); - - fileNamePatterns = fileNamePatterns.replace(/^(\s*,\s*)+/g, ""); //get rid of leading commas - - fileNamePatterns = fileNamePatterns.replace(/([^\\]),(\s*,\s*)*/g, "$1/"); //replace all unescaped commas with slashes (since slashes aren't legal in file names) - - fileNamePatterns = fileNamePatterns.replace(/(\s*\/\s*)/g, "/"); //get rid of spaces before and after delimiter - fileNamePatterns = fileNamePatterns.replace(/\/\/+/g, "/"); //get rid of empty patterns - fileNamePatterns = fileNamePatterns.replace(/\/+$/g, ""); //get rid of trailing delimiters - - fileNamePatternArray = fileNamePatterns.split("/"); - } - - return fileNamePatternArray; -}; - -searchUtils.copySearchParams = function(searchParams, copyReplace) { - var result = {}; - for (var prop in searchParams) { - if(searchParams[prop] !== undefined && searchParams[prop] !== null){ - if(!copyReplace && prop === "replace") { //$NON-NLS-0$ - continue; - } - result[prop] = searchParams[prop]; - } - } - return result; -}; - -searchUtils.generateFindURLBinding = function(searchParams, inFileQuery, lineNumber, replaceStr, paramOnly) { - var params = { - find: inFileQuery.searchStr, - regEx: inFileQuery.wildCard ? true : undefined, - caseSensitive: searchParams.caseSensitive ? true : undefined, - wholeWord: searchParams.wholeWord ? true : undefined, - replaceWith: typeof(replaceStr) === "string" ? replaceStr : undefined, //$NON-NLS-0$ - atLine: typeof(lineNumber) === "number" ? lineNumber : undefined //$NON-NLS-0$ - }; - if(paramOnly){ - return params; - } - var binding = new URITemplate("{,params*}").expand({ //$NON-NLS-0$ - params: params - }); - return "," + binding; //$NON-NLS-0$ -}; - -searchUtils.convertFindURLBinding = function(findParams) { - if(typeof findParams.regEx === "string"){ //$NON-NLS-0$ - findParams.regEx = (findParams.regEx.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(typeof findParams.caseSensitive === "string"){ //$NON-NLS-0$ - findParams.caseSensitive = (findParams.caseSensitive.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(typeof findParams.wholeWord === "string"){ //$NON-NLS-0$ - findParams.wholeWord = (findParams.wholeWord.toLowerCase() === "true"); //$NON-NLS-0$ - } - if(typeof findParams.atLine === "string"){ //$NON-NLS-0$ - findParams.atLine = parseInt(findParams.atLine, 10); - } -}; - -searchUtils.replaceRegEx = function(text, regEx, replacingStr){ - var regexp = new RegExp(regEx.pattern, regEx.flags); - return text.replace(regexp, replacingStr); - -}; - -searchUtils.replaceStringLiteral = function(text, keyword, replacingStr){ - var regexp = mRegex.parse("/" + keyword + "/gim"); //$NON-NLS-1$ //$NON-NLS-0$ - return searchUtils.replaceRegEx(text,regexp, replacingStr); -}; - -searchUtils.searchOnelineLiteral = function(inFileQuery, lineString, onlyOnce, textModel, lineIndex){ - var i,startIndex = 0; - var found = false; - var result = []; - while(true){ - i = lineString.indexOf(inFileQuery.searchStr, startIndex); - if (i < 0) { - break; - } else { - if(textModel) { - var start = textModel.getLineStart(lineIndex) + i; - result.push({startIndex: i, length: inFileQuery.searchStrLength, start: start, end: start + inFileQuery.searchStrLength}); - } else { - result.push({startIndex: i, length: inFileQuery.searchStrLength}); - } - found = true; - if(onlyOnce){ - break; - } - startIndex = i + inFileQuery.searchStrLength; - } - } - if(found) { - return result; - } - return null; - -}; - -/** - * Helper for finding regex matches in text contents. - * - * @param {String} - * text Text to search in. - * @param {String} - * pattern A valid regexp pattern. - * @param {String} - * flags Valid regexp flags. Allowed flags are: "i", "s", and any combination thereof. - * @param {Number} - * [startIndex] Index to begin searching from. - * @return {Object} An object giving the match details, or - * null if no match found. The - * returned object will have the properties:
      - * {Number} index
      - * {Number} length - * @name orion.searchUtils.findRegExp - * @function - */ -searchUtils.findRegExp = function(text, pattern, flags, startIndex) { - if (!pattern) { - return null; - } - flags = flags || ""; - // 'g' makes exec() iterate all matches, 'm' makes ^$ - // work linewise - flags += (flags.indexOf("g") === -1 ? "g" : "") + //$NON-NLS-1$ //$NON-NLS-0$ - (flags.indexOf("m") === -1 ? "m" : ""); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - var regexp = new RegExp(pattern, flags); - var result = null; - result = regexp.exec(text.substring(startIndex)); - return result && { - startIndex: result.index + startIndex, - length: result[0].length - }; -}; - -searchUtils.searchOnelineRegEx = function(inFileQuery, lineString, onlyOnce, textModel, lineIndex){ - var startIndex = 0; - var found = false; - var result = []; - while(true){ - var regExResult = searchUtils.findRegExp(lineString, inFileQuery.regExp.pattern, inFileQuery.regExp.flags, startIndex); - if(regExResult){ - if(textModel) { - var start = textModel.getLineStart(lineIndex) + regExResult.startIndex; - regExResult.start = start; - regExResult.end = start + regExResult.length; - } - result.push(regExResult); - found = true; - if(onlyOnce){ - break; - } - startIndex = regExResult.startIndex + regExResult.length; - } else { - break; - } - } - if(found) { - return result; - } - return null; -}; - -searchUtils.generateNewContents = function( updating, oldContents, newContents, fileModelNode, replaceStr, searchStrLength){ - if(fileModelNode && oldContents){ - if(!updating){ - newContents.contents = []; - } - for(var i = 0; i < oldContents.length ; i++){ - var lineStringOrigin = oldContents[i]; - var changingLine = false; - var checked = false; - var checkedMatches = []; - var originalMatches; - var k, startNumber = 0; - for(var j = 0; j < fileModelNode.children.length; j++){ - var lnumber = fileModelNode.children[j].lineNumber - 1; - if(lnumber === i){ - startNumber = j; - for(k = 0; k < fileModelNode.children[j].matches.length; k++ ){ - if(fileModelNode.children[j+k].checked !== false){ - checkedMatches.push(k); - } - } - checked = (checkedMatches.length > 0); - originalMatches = fileModelNode.children[j].matches; - changingLine = true; - break; - } - } - if(changingLine){ - var newStr; - if(!checked){ - newStr = lineStringOrigin; - for(k = 0; k < fileModelNode.children[startNumber].matches.length; k++ ){ - fileModelNode.children[startNumber+k].newMatches = fileModelNode.children[startNumber+k].matches; - } - } else{ - var result = searchUtils.replaceCheckedMatches(lineStringOrigin, replaceStr, originalMatches, checkedMatches, searchStrLength); - newStr = result.replacedStr; - for(k = 0; k < fileModelNode.children[startNumber].matches.length; k++ ){ - fileModelNode.children[startNumber+k].newMatches = result.newMatches; - } - } - if(updating){ - newContents.contents[i] = newStr; - } else { - newContents.contents.push(newStr); - } - } else if(!updating){ - newContents.contents.push(lineStringOrigin); - } - } - } -}; - -searchUtils.generateMatchContext = function(contextAroundLength, fileContents, lineNumber/*zero based*/){ - var context = []; - var totalContextLength = contextAroundLength*2 + 1; - var startFrom, endTo; - if(fileContents.length <= totalContextLength){ - startFrom = 0; - endTo = fileContents.length -1; - } else { - startFrom = lineNumber - contextAroundLength; - if(startFrom < 0){ - startFrom = 0; - endTo = startFrom + totalContextLength - 1; - } else { - endTo = lineNumber + contextAroundLength; - if(endTo > (fileContents.length -1)){ - endTo = fileContents.length -1; - startFrom = endTo - totalContextLength + 1; - } - - } - } - for(var i = startFrom; i <= endTo; i++){ - context.push({context: fileContents[i], current: (i === lineNumber)}); - } - return context; -}; - -/** - * Split file contents into lines. It also handles the mixed line endings with "\n", "\r" and "\r\n". - * - * @param {String} text The file contents. - * @returns {String[]} Split file lines. - * @name orion.searchUtils.splitFile - * @function - */ -searchUtils.splitFile = function(text) { - var cr = 0, lf = 0, index = 0, start = 0; - var splitLines = []; - while (true) { - if (cr !== -1 && cr <= index) { - cr = text.indexOf("\r", index); //$NON-NLS-0$ - } - if (lf !== -1 && lf <= index) { - lf = text.indexOf("\n", index); //$NON-NLS-0$ - } - if (lf === -1 && cr === -1) { - splitLines.push(text.substring(start)); - break; - } - var offset = 1; - if (cr !== -1 && lf !== -1) { - if (cr + 1 === lf) { - offset = 2; - index = lf + 1; - } else { - index = (cr < lf ? cr : lf) + 1; - } - } else if (cr !== -1) { - index = cr + 1; - } else { - index = lf + 1; - } - splitLines.push(text.substring(start, index)); - start = index; - } - return splitLines; -}; - -searchUtils.searchWithinFile = function( inFileQuery, fileModelNode, fileContentText, replacing, caseSensitive, noContext, useTextModel){ - var textModel; - if(noContext || useTextModel) { - textModel = new mTextModel.TextModel(fileContentText); - } - var fileContents = searchUtils.splitFile(fileContentText); - if(replacing || noContext){ - fileModelNode.contents = fileContents; - } - if(fileModelNode){ - fileModelNode.children = []; - var totalMatches = 0; - for(var i = 0; i < fileContents.length ; i++){ - var lineStringOrigin = fileContents[i]; - if(lineStringOrigin && lineStringOrigin.length > 0){ - var lineString = caseSensitive ? lineStringOrigin : lineStringOrigin.toLowerCase(); - var result; - if(inFileQuery.wildCard){ - result = searchUtils.searchOnelineRegEx(inFileQuery, lineString, false, textModel, i); - } else { - result = searchUtils.searchOnelineLiteral(inFileQuery, lineString, false, textModel, i); - } - if(result){ - var detailNode, lineNumber = i+1; - if(!replacing){ - if(noContext) { - detailNode = {lineNumber: lineNumber, matches: result, name: lineStringOrigin}; - } else { - detailNode = {parent: fileModelNode, context: searchUtils.generateMatchContext(2, fileContents, i), checked: fileModelNode.checked, - type: "detail", matches: result, lineNumber: lineNumber, name: lineStringOrigin, //$NON-NLS-0$ - location: fileModelNode.location}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - fileModelNode.children.push(detailNode); - } else { - for(var j = 0; j < result.length; j++){ - var matchNumber = j+1; - detailNode = {parent: fileModelNode, checked: fileModelNode.checked, type: "detail", matches: result, lineNumber: lineNumber, matchNumber: matchNumber, name: lineStringOrigin, location: fileModelNode.location}; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - fileModelNode.children.push(detailNode); - } - } - totalMatches += result.length; - } - } - } - fileModelNode.totalMatches = totalMatches; - } -}; - -searchUtils.replaceCheckedMatches = function(text, replacingStr, originalMatches, checkedMatches, defaultMatchLength){ - var gap = defaultMatchLength; - var startIndex = 0; - var replacedStr = ""; - var newMatches = []; - for(var i = 0; i < originalMatches.length; i++){ - if(startIndex !== originalMatches[i].startIndex){ - replacedStr = replacedStr + text.substring(startIndex, originalMatches[i].startIndex); - } - if(originalMatches[i].length){ - gap = originalMatches[i].length; - } - var needReplace = false; - for (var j = 0; j < checkedMatches.length; j++){ - if(checkedMatches[j] === i){ - needReplace = true; - break; - } - } - if(needReplace){ - newMatches.push({startIndex: replacedStr.length, length: replacingStr.length}); - replacedStr = replacedStr + replacingStr; - } else { - newMatches.push({startIndex: replacedStr.length, length: gap}); - replacedStr = replacedStr + text.substring(originalMatches[i].startIndex, originalMatches[i].startIndex + gap); - } - startIndex = originalMatches[i].startIndex + gap; - } - if(startIndex < text.length){ - replacedStr = replacedStr + text.substring(startIndex); - } - return {replacedStr: replacedStr, newMatches: newMatches}; -}; - -searchUtils.fullPathNameByMeta = function(parents){ - var parentIndex = parents.length; - var fullPath = ""; - //add parents chain top down if needed - if(parentIndex > 0){ - for(var j = parentIndex - 1; j > -1; j--){ - var separator = (fullPath === "") ? "" : "/"; //$NON-NLS-1$ //$NON-NLS-0$ - fullPath = fullPath + separator + parents[j].Name; - } - } - return fullPath; -}; - -return searchUtils; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/editor/nls/messages',{ - root:true -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/editor/nls/root/messages',{//Default message bundle - "multipleAnnotations": "Multiple annotations:", //$NON-NLS-1$ //$NON-NLS-0$ - "line": "Line: ${0}", //$NON-NLS-1$ //$NON-NLS-0$ - "breakpoint": "Breakpoint", //$NON-NLS-1$ //$NON-NLS-0$ - "bookmark": "Bookmark", //$NON-NLS-1$ //$NON-NLS-0$ - "task": "Task", //$NON-NLS-1$ //$NON-NLS-0$ - "error": "Error", //$NON-NLS-1$ //$NON-NLS-0$ - "warning": "Warning", //$NON-NLS-1$ //$NON-NLS-0$ - "currentSearch": "Current Search", //$NON-NLS-1$ //$NON-NLS-0$ - "currentLine": "Current Line", //$NON-NLS-1$ //$NON-NLS-0$ - "matchingBracket": "Matching Bracket", //$NON-NLS-1$ //$NON-NLS-0$ - "currentBracket": "Current Bracket", //$NON-NLS-1$ //$NON-NLS-0$ - "diffAdded": "Diff Added Lines", //$NON-NLS-1$ //$NON-NLS-0$ - "diffDeleted": "Diff Deleted Lines", //$NON-NLS-1$ //$NON-NLS-0$ - "diffModified": "Diff Modified Lines", //$NON-NLS-1$ //$NON-NLS-0$ - - "lineUp": "Line Up", //$NON-NLS-1$ //$NON-NLS-0$ - "lineDown": "Line Down", //$NON-NLS-1$ //$NON-NLS-0$ - "lineStart": "Line Start", //$NON-NLS-1$ //$NON-NLS-0$ - "lineEnd": "Line End", //$NON-NLS-1$ //$NON-NLS-0$ - "charPrevious": "Previous Character", //$NON-NLS-1$ //$NON-NLS-0$ - "charNext": "Next Character", //$NON-NLS-1$ //$NON-NLS-0$ - "pageUp": "Page Up", //$NON-NLS-1$ //$NON-NLS-0$ - "pageDown": "Page Down", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollPageUp": "Scroll Page Up", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollPageDown": "Scroll Page Down", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollLineUp": "Scroll Line Up", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollLineDown": "Scroll Line Down", //$NON-NLS-1$ //$NON-NLS-0$ - "wordPrevious": "Previous Word", //$NON-NLS-1$ //$NON-NLS-0$ - "wordNext": "Next Word", //$NON-NLS-1$ //$NON-NLS-0$ - "textStart": "Document Start", //$NON-NLS-1$ //$NON-NLS-0$ - "textEnd": "Document End", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollTextStart": "Scroll Document Start", //$NON-NLS-1$ //$NON-NLS-0$ - "scrollTextEnd": "Scroll Document End", //$NON-NLS-1$ //$NON-NLS-0$ - "centerLine": "Center Line", //$NON-NLS-1$ //$NON-NLS-0$ - - "selectLineUp": "Select Line Up", //$NON-NLS-1$ //$NON-NLS-0$ - "selectLineDown": "Select Line Down", //$NON-NLS-1$ //$NON-NLS-0$ - "selectWholeLineUp": " Select Whole Line Up", //$NON-NLS-1$ //$NON-NLS-0$ - "selectWholeLineDown": "Select Whole Line Down", //$NON-NLS-1$ //$NON-NLS-0$ - "selectLineStart": "Select Line Start", //$NON-NLS-1$ //$NON-NLS-0$ - "selectLineEnd": "Select Line End", //$NON-NLS-1$ //$NON-NLS-0$ - "selectCharPrevious": "Select Previous Character", //$NON-NLS-1$ //$NON-NLS-0$ - "selectCharNext": "Select Next Character", //$NON-NLS-1$ //$NON-NLS-0$ - "selectPageUp": "Select Page Up", //$NON-NLS-1$ //$NON-NLS-0$ - "selectPageDown": "Select Page Down", //$NON-NLS-1$ //$NON-NLS-0$ - "selectWordPrevious": "Select Previous Word", //$NON-NLS-1$ //$NON-NLS-0$ - "selectWordNext": "Select Next Word", //$NON-NLS-1$ //$NON-NLS-0$ - "selectTextStart": "Select Document Start", //$NON-NLS-1$ //$NON-NLS-0$ - "selectTextEnd": "Select Document End", //$NON-NLS-1$ //$NON-NLS-0$ - - "deletePrevious": "Delete Previous Character", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteNext": "Delete Next Character", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteWordPrevious": "Delete Previous Word", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteWordNext": "Delete Next Word", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteLineStart": "Delete Line Start", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteLineEnd": "Delete Line End", //$NON-NLS-1$ //$NON-NLS-0$ - "tab": "Insert Tab", //$NON-NLS-1$ //$NON-NLS-0$ - "enter": "Insert Line Delimiter", //$NON-NLS-1$ //$NON-NLS-0$ - "enterNoCursor": "Insert Line Delimiter", //$NON-NLS-1$ //$NON-NLS-0$ - "escape": "Escape", //$NON-NLS-1$ //$NON-NLS-0$ - "selectAll": "Select All", //$NON-NLS-1$ //$NON-NLS-0$ - "copy": "Copy", //$NON-NLS-1$ //$NON-NLS-0$ - "cut": "Cut", //$NON-NLS-1$ //$NON-NLS-0$ - "paste": "Paste", //$NON-NLS-1$ //$NON-NLS-0$ - - "uppercase": "To Upper Case", //$NON-NLS-1$ //$NON-NLS-0$ - "lowercase": "To Lower Case", //$NON-NLS-1$ //$NON-NLS-0$ - "capitalize": "Capitalize", //$NON-NLS-1$ //$NON-NLS-0$ - "reversecase" : "Reverse Case", //$NON-NLS-1$ //$NON-NLS-0$ - - "toggleWrapMode": "Toggle Wrap Mode", //$NON-NLS-1$ //$NON-NLS-0$ - "toggleTabMode": "Toggle Tab Mode", //$NON-NLS-1$ //$NON-NLS-0$ - "toggleOverwriteMode": "Toggle Overwrite Mode", //$NON-NLS-1$ //$NON-NLS-0$ - - "committerOnTime": "${0} on ${1}", //$NON-NLS-1$ //$NON-NLS-0$ - - //Emacs - "emacs": "Emacs", //$NON-NLS-1$ //$NON-NLS-0$ - "exchangeMarkPoint": "Exchange Mark and Point", //$NON-NLS-1$ //$NON-NLS-0$ - "setMarkCommand": "Set Mark", //$NON-NLS-1$ //$NON-NLS-0$ - "clearMark": "Clear Mark", //$NON-NLS-1$ //$NON-NLS-0$ - "digitArgument": "Digit Argument ${0}", //$NON-NLS-1$ //$NON-NLS-0$ - "negativeArgument": "Negative Argument", //$NON-NLS-1$ //$NON-NLS-0$ - - "Comment": "Comment", //$NON-NLS-1$ //$NON-NLS-0$ - "Flat outline": "Flat outline", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFindStr": "Incremental find: ${0}", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFindStrNotFound": "Incremental find: ${0} (not found)", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFindReverseStr": "Reverse Incremental find: ${0}", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFindReverseStrNotFound": "Reverse Incremental find: ${0} (not found)", //$NON-NLS-1$ //$NON-NLS-0$ - "findReplace": "Find/Replace", //$NON-NLS-1$ //$NON-NLS-0$ - "find": "Find...", //$NON-NLS-1$ //$NON-NLS-0$ - "undo": "Undo", //$NON-NLS-1$ //$NON-NLS-0$ - "redo": "Redo", //$NON-NLS-1$ //$NON-NLS-0$ - "cancelMode": "Cancel Current Mode", //$NON-NLS-1$ //$NON-NLS-0$ - "findNext": "Find Next Occurrence", //$NON-NLS-1$ //$NON-NLS-0$ - "findPrevious": "Find Previous Occurrence", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFind": "Incremental Find", //$NON-NLS-1$ //$NON-NLS-0$ - "incrementalFindReverse": "Incremental Find Reverse", //$NON-NLS-1$ //$NON-NLS-0$ - "indentLines": "Indent Lines", //$NON-NLS-1$ //$NON-NLS-0$ - "unindentLines": "Unindent Lines", //$NON-NLS-1$ //$NON-NLS-0$ - "moveLinesUp": "Move Lines Up", //$NON-NLS-1$ //$NON-NLS-0$ - "moveLinesDown": "Move Lines Down", //$NON-NLS-1$ //$NON-NLS-0$ - "copyLinesUp": "Copy Lines Up", //$NON-NLS-1$ //$NON-NLS-0$ - "copyLinesDown": "Copy Lines Down", //$NON-NLS-1$ //$NON-NLS-0$ - "deleteLines": "Delete Lines", //$NON-NLS-1$ //$NON-NLS-0$ - "gotoLine": "Goto Line...", //$NON-NLS-1$ //$NON-NLS-0$ - "gotoLinePrompty": "Goto Line:", //$NON-NLS-1$ //$NON-NLS-0$ - "nextAnnotation": "Next Annotation", //$NON-NLS-1$ //$NON-NLS-0$ - "prevAnnotation": "Previous Annotation", //$NON-NLS-1$ //$NON-NLS-0$ - "expand": "Expand", //$NON-NLS-1$ //$NON-NLS-0$ - "collapse": "Collapse", //$NON-NLS-1$ //$NON-NLS-0$ - "expandAll": "Expand All", //$NON-NLS-1$ //$NON-NLS-0$ - "collapseAll": "Collapse All", //$NON-NLS-1$ //$NON-NLS-0$ - "lastEdit": "Last Edit Location", //$NON-NLS-1$ //$NON-NLS-0$ - "trimTrailingWhitespaces": "Trim Trailing Whitespaces", //$NON-NLS-1$ //$NON-NLS-0$ - "toggleLineComment": "Toggle Line Comment", //$NON-NLS-1$ //$NON-NLS-0$ - "addBlockComment": "Add Block Comment", //$NON-NLS-1$ //$NON-NLS-0$ - "removeBlockComment": "Remove Block Comment", //$NON-NLS-1$ //$NON-NLS-0$ - "linkedModeEntered": "Linked Mode: Enter or ESC to exit", //$NON-NLS-1$ //$NON-NLS-0$ - "linkedModeExited": "Linked Mode exited", //$NON-NLS-1$ //$NON-NLS-0$ - "syntaxError": "Syntax Error", //$NON-NLS-1$ //$NON-NLS-0$ - "contentAssist": "Content Assist", //$NON-NLS-1$ //$NON-NLS-0$ - "noProposals": "No proposals found", - "computingProposals": "Computing content assist proposals...", - "lineColumn": "Line ${0} : Column ${1}", //$NON-NLS-1$ //$NON-NLS-0$ - "lineColumnOffset": "Line ${0} : Column ${1} : Offset ${2}", - "multiSelections": "${0} selection regions", //$NON-NLS-1$ //$NON-NLS-0$ - - //vi - "vi": "vi", //$NON-NLS-1$ //$NON-NLS-0$ - "vimove": "(Move)", //$NON-NLS-1$ //$NON-NLS-0$ - "viyank": "(Yank)", //$NON-NLS-1$ //$NON-NLS-0$ - "videlete": "(Delete)", //$NON-NLS-1$ //$NON-NLS-0$ - "vichange": "(Change)", //$NON-NLS-1$ //$NON-NLS-0$ - "viLeft": "${0} Left", //$NON-NLS-1$ //$NON-NLS-0$ - "viRight": "${0} Right", //$NON-NLS-1$ //$NON-NLS-0$ - "viUp": "${0} Up", //$NON-NLS-1$ //$NON-NLS-0$ - "viDown": "${0} Down", //$NON-NLS-1$ //$NON-NLS-0$ - "viw": "${0} Next Word", //$NON-NLS-1$ //$NON-NLS-0$ - "vib": "${0} Beginning of Word", //$NON-NLS-1$ //$NON-NLS-0$ - "viW": "${0} Next Word (ws stop)", //$NON-NLS-1$ //$NON-NLS-0$ - "viB": "${0} Beginning of Word (ws stop)", //$NON-NLS-1$ //$NON-NLS-0$ - "vie": "${0} End of Word", //$NON-NLS-1$ //$NON-NLS-0$ - "viE": "${0} End of Word (ws stop)", //$NON-NLS-1$ //$NON-NLS-0$ - "vi$": "${0} End of the line", //$NON-NLS-1$ //$NON-NLS-0$ - "vi^_": "${0} First non-blank Char Current Line", //$NON-NLS-1$ //$NON-NLS-0$ - "vi+": "${0} First Char Next Line", //$NON-NLS-1$ //$NON-NLS-0$ - "vi-": "${0} First Char Previous Line", //$NON-NLS-1$ //$NON-NLS-0$ - "vi|": "${0} nth Column in Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viH": "${0} Top of Page", //$NON-NLS-1$ //$NON-NLS-0$ - "viM": "${0} Middle of Page", //$NON-NLS-1$ //$NON-NLS-0$ - "viL": "${0} Bottom of Page", //$NON-NLS-1$ //$NON-NLS-0$ - "vi/": "${0} Search Forward", //$NON-NLS-1$ //$NON-NLS-0$ - "vi?": "${0} Search Backward", //$NON-NLS-1$ //$NON-NLS-0$ - "vin": "${0} Next Search", //$NON-NLS-1$ //$NON-NLS-0$ - "viN": "${0} Previous Search", //$NON-NLS-1$ //$NON-NLS-0$ - "vif": "${0} Search Char Fwd", //$NON-NLS-1$ //$NON-NLS-0$ - "viF": "${0} Search Char Bckwd", //$NON-NLS-1$ //$NON-NLS-0$ - "vit": "${0} Search Before Char Fwd", //$NON-NLS-1$ //$NON-NLS-0$ - "viT": "${0} Search Before Char Bckwd", //$NON-NLS-1$ //$NON-NLS-0$ - "vi,": "${0} Repeat Reverse Char Search", //$NON-NLS-1$ //$NON-NLS-0$ - "vi;": "${0} Repeat Char Search", //$NON-NLS-1$ //$NON-NLS-0$ - "viG": "${0} Go to Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viycd": "${0} Current Line", //$NON-NLS-1$ //$NON-NLS-0$ - "via": "Append After Cursor", //$NON-NLS-1$ //$NON-NLS-0$ - "viA": "Append to End of Line", //$NON-NLS-1$ //$NON-NLS-0$ - "vii": "Insert Before Cursor", //$NON-NLS-1$ //$NON-NLS-0$ - "viI": "Insert at Beginning of Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viO": "Insert Line Above", //$NON-NLS-1$ //$NON-NLS-0$ - "vio": "Insert Line Below", //$NON-NLS-1$ //$NON-NLS-0$ - "viR": "Begin Overwriting Text", //$NON-NLS-1$ //$NON-NLS-0$ - "vis": "Substitute a Character", //$NON-NLS-1$ //$NON-NLS-0$ - "viS": "Substitute Entire Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viC": "Change Text Until Line End", //$NON-NLS-1$ //$NON-NLS-0$ - "vip": "Paste After Char or Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viP": "Paste Before Char or Line", //$NON-NLS-1$ //$NON-NLS-0$ - "viStar": "Search Word Under Cursor", //$NON-NLS-1$ //$NON-NLS-0$ - - "next": "Next", //$NON-NLS-1$ //$NON-NLS-0$ - "previous": "Previous", //$NON-NLS-1$ //$NON-NLS-0$ - "replace": "Replace", //$NON-NLS-1$ //$NON-NLS-0$ - "replaceAll": "Replace All", //$NON-NLS-1$ //$NON-NLS-0$ - "findWith": "Find With", //$NON-NLS-1$ //$NON-NLS-0$ - "replaceWith": "Replace With", //$NON-NLS-1$ //$NON-NLS-0$ - "caseInsensitive": "Aa", //$NON-NLS-1$ //$NON-NLS-0$ - "regex": "/.*/", //$NON-NLS-1$ //$NON-NLS-0$ - "wholeWord": "\\b", //$NON-NLS-1$ //$NON-NLS-0$ - "caseInsensitiveTooltip": "Toggle Case Insensitive", //$NON-NLS-1$ //$NON-NLS-0$ - "regexTooltip": "Toggle Regular Expression", //$NON-NLS-1$ //$NON-NLS-0$ - "wholeWordTooltip": "Toggle Whole Word", //$NON-NLS-1$ //$NON-NLS-0$ - "closeTooltip": "Close", //$NON-NLS-1$ //$NON-NLS-0$ - - "replacingAll": "Replacing all...", //$NON-NLS-1$ //$NON-NLS-0$ - "replacedMatches": "Replaced ${0} matches", //$NON-NLS-1$ //$NON-NLS-0$ - "nothingReplaced": "Nothing replaced", //$NON-NLS-1$ //$NON-NLS-0$ - "notFound": "Not found" //$NON-NLS-1$ //$NON-NLS-0$ -}); - - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/annotations", ['i18n!orion/editor/nls/messages', 'orion/editor/eventTarget'], function(messages, mEventTarget) { //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - /** - * @class This object represents a regitry of annotation types. - * @name orion.editor.AnnotationType - */ - function AnnotationType() { - } - - /** - * @class This object represents a decoration attached to a range of text. Annotations are added to a - * AnnotationModel which is attached to a TextModel. - *

      - * See:
      - * {@link orion.editor.AnnotationModel}
      - * {@link orion.editor.Ruler}
      - *

      - * @name orion.editor.Annotation - * - * @property {String} type The annotation type (for example, orion.annotation.error). - * @property {Number} start The start offset of the annotation in the text model. - * @property {Number} end The end offset of the annotation in the text model. - * @property {String} html The HTML displayed for the annotation. - * @property {String} title The text description for the annotation. - * @property {orion.editor.Style} style The style information for the annotation used in the annotations ruler and tooltips. - * @property {orion.editor.Style} overviewStyle The style information for the annotation used in the overview ruler. - * @property {orion.editor.Style} rangeStyle The style information for the annotation used in the text view to decorate a range of text. - * @property {orion.editor.Style} lineStyle The style information for the annotation used in the text view to decorate a line of text. - */ - /** - * Constructs a new folding annotation. - * - * @param {Number} start The start offset of the annotation in the text model. - * @param {Number} end The end offset of the annotation in the text model. - * @param {orion.editor.ProjectionTextModel} projectionModel The projection text model. - * - * @class This object represents a folding annotation. - * @name orion.editor.FoldingAnnotation - */ - function FoldingAnnotation (start, end, projectionModel) { - this.start = start; - this.end = end; - this._projectionModel = projectionModel; - this.html = this._expandedHTML; - this.style = this._expandedStyle; - this.expanded = true; - } - - FoldingAnnotation.prototype = /** @lends orion.editor.FoldingAnnotation.prototype */ { - _expandedHTML: "
      ", //$NON-NLS-0$ - _expandedStyle: {styleClass: "annotation expanded"}, //$NON-NLS-0$ - _collapsedHTML: "", //$NON-NLS-0$ - _collapsedStyle: {styleClass: "annotation collapsed"}, //$NON-NLS-0$ - _collapse: function() { - if (!this.expanded) { return false; } - this.expanded = false; - this.html = this._collapsedHTML; - this.style = this._collapsedStyle; - if (this._annotationModel) { - this._annotationModel.modifyAnnotation(this); - } - return true; - }, - _expand: function() { - if (this.expanded) { return false; } - this.expanded = true; - this.html = this._expandedHTML; - this.style = this._expandedStyle; - if (this._annotationModel) { - this._annotationModel.modifyAnnotation(this); - } - return true; - }, - _collapseImpl: function (checkOverlaping) { - if (this._collapse()) { - if (checkOverlaping) { - this._forEachOverlaping(function(annotation) { - if (!annotation.expanded) { - annotation._expandImpl(false); - annotation._recollapse = true; - } - }); - } - var projectionModel = this._projectionModel; - var baseModel = projectionModel.getBaseModel(); - this._projection = { - annotation: this, - start: baseModel.getLineStart(baseModel.getLineAtOffset(this.start) + 1), - end: baseModel.getLineEnd(baseModel.getLineAtOffset(this.end), true) - }; - projectionModel.addProjection(this._projection); - } - }, - _expandImpl: function(checkOverlaping) { - if (this._expand()) { - this._projectionModel._removeProjection(this._projection, !this._annotationModel); - if (checkOverlaping) { - this._forEachOverlaping(function(annotation) { - if (annotation._recollapse) { - annotation._collapseImpl(false); - annotation._recollapse = false; - } - }); - } - } - }, - _forEachOverlaping: function(callback) { - if (!this._annotationModel) { return; } - var annotations = this._annotationModel.getAnnotations(this.start, this.end); - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (annotation !== this && annotation.type === AnnotationType.ANNOTATION_FOLDING) { - callback.call(this, annotation); - } - } - }, - /** - * Collapses the annotation. - */ - collapse: function () { - this._recollapse = false; - this._collapseImpl(true); - }, - /** - * Expands the annotation. - */ - expand: function () { - this._recollapse = false; - this._expandImpl(true); - } - }; - - /** - * Error annotation type. - */ - AnnotationType.ANNOTATION_ERROR = "orion.annotation.error"; //$NON-NLS-0$ - /** - * Warning annotation type. - */ - AnnotationType.ANNOTATION_WARNING = "orion.annotation.warning"; //$NON-NLS-0$ - /** - * Task annotation type. - */ - AnnotationType.ANNOTATION_TASK = "orion.annotation.task"; //$NON-NLS-0$ - /** - * Breakpoint annotation type. - */ - AnnotationType.ANNOTATION_BREAKPOINT = "orion.annotation.breakpoint"; //$NON-NLS-0$ - /** - * Bookmark annotation type. - */ - AnnotationType.ANNOTATION_BOOKMARK = "orion.annotation.bookmark"; //$NON-NLS-0$ - /** - * Folding annotation type. - */ - AnnotationType.ANNOTATION_FOLDING = "orion.annotation.folding"; //$NON-NLS-0$ - /** - * Curent bracket annotation type. - */ - AnnotationType.ANNOTATION_CURRENT_BRACKET = "orion.annotation.currentBracket"; //$NON-NLS-0$ - /** - * Matching bracket annotation type. - */ - AnnotationType.ANNOTATION_MATCHING_BRACKET = "orion.annotation.matchingBracket"; //$NON-NLS-0$ - /** - * Current line annotation type. - */ - AnnotationType.ANNOTATION_CURRENT_LINE = "orion.annotation.currentLine"; //$NON-NLS-0$ - /** - * Current search annotation type. - */ - AnnotationType.ANNOTATION_CURRENT_SEARCH = "orion.annotation.currentSearch"; //$NON-NLS-0$ - /** - * Matching search annotation type. - */ - AnnotationType.ANNOTATION_MATCHING_SEARCH = "orion.annotation.matchingSearch"; //$NON-NLS-0$ - /** - * Read Occurrence annotation type. - */ - AnnotationType.ANNOTATION_READ_OCCURRENCE = "orion.annotation.readOccurrence"; //$NON-NLS-0$ - /** - * Write Occurrence annotation type. - */ - AnnotationType.ANNOTATION_WRITE_OCCURRENCE = "orion.annotation.writeOccurrence"; //$NON-NLS-0$ - /** - * Selected linked group annotation type. - */ - AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP = "orion.annotation.selectedLinkedGroup"; //$NON-NLS-0$ - /** - * Current linked group annotation type. - */ - AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP = "orion.annotation.currentLinkedGroup"; //$NON-NLS-0$ - /** - * Linked group annotation type. - */ - AnnotationType.ANNOTATION_LINKED_GROUP = "orion.annotation.linkedGroup"; //$NON-NLS-0$ - /** - * Blame annotation type. - */ - AnnotationType.ANNOTATION_BLAME = "orion.annotation.blame"; //$NON-NLS-0$ - /** - * Current Blame annotation type. - */ - AnnotationType.ANNOTATION_CURRENT_BLAME = "orion.annotation.currentBlame"; //$NON-NLS-0$ - /** - * Diff Added annotation type. - */ - AnnotationType.ANNOTATION_DIFF_ADDED = "orion.annotation.diffAdded"; //$NON-NLS-0$ - /** - * Diff Deleted annotation type. - */ - AnnotationType.ANNOTATION_DIFF_DELETED = "orion.annotation.diffDeleted"; //$NON-NLS-0$ - /** - * Diff Modification annotation type. - */ - AnnotationType.ANNOTATION_DIFF_MODIFIED = "orion.annotation.diffModified"; //$NON-NLS-0$ - - /** @private */ - var annotationTypes = {}; - - /** - * Register an annotation type. - * - * @param {String} type The annotation type (for example, orion.annotation.error). - * @param {Object|Function} properties The common annotation properties of the registered - * annotation type. All annotations create with this annotation type will expose these - * properties. - */ - AnnotationType.registerType = function(type, properties) { - var constructor = properties; - if (typeof constructor !== "function") { //$NON-NLS-0$ - constructor = function(start, end, title) { - this.start = start; - this.end = end; - if (title !== undefined) { this.title = title; } - }; - constructor.prototype = properties; - } - constructor.prototype.type = type; - annotationTypes[type] = constructor; - return type; - }; - - /** - * Creates an annotation of a given type with the specified start end end offsets. - * - * @param {String} type The annotation type (for example, orion.annotation.error). - * @param {Number} start The start offset of the annotation in the text model. - * @param {Number} end The end offset of the annotation in the text model. - * @param {String} [title] The text description for the annotation if different then the type description. - * @return {orion.editor.Annotation} the new annotation - */ - AnnotationType.createAnnotation = function(type, start, end, title) { - return new (this.getType(type))(start, end, title); - }; - - /** - * Gets the registered annotation type with specified type. The returned - * value is a constructor that can be used to create annotations of the - * speficied type. The constructor takes the start and end offsets of - * the annotation. - * - * @param {String} type The annotation type (for example, orion.annotation.error). - * @return {Function} The annotation type constructor ( i.e function(start, end, title) ). - */ - AnnotationType.getType = function(type) { - return annotationTypes[type]; - }; - - /** @private */ - function registerType(type, lineStyling) { - var index = type.lastIndexOf('.'); //$NON-NLS-0$ - var suffix = type.substring(index + 1); - var properties = { - title: messages[suffix], - style: {styleClass: "annotation " + suffix}, //$NON-NLS-0$ - html: "
      ", //$NON-NLS-1$ //$NON-NLS-0$ - overviewStyle: {styleClass: "annotationOverview " + suffix} //$NON-NLS-0$ - }; - if (lineStyling) { - properties.lineStyle = {styleClass: "annotationLine " + suffix}; //$NON-NLS-0$ - } else { - properties.rangeStyle = {styleClass: "annotationRange " + suffix}; //$NON-NLS-0$ - } - AnnotationType.registerType(type, properties); - } - registerType(AnnotationType.ANNOTATION_ERROR); - registerType(AnnotationType.ANNOTATION_WARNING); - registerType(AnnotationType.ANNOTATION_TASK); - registerType(AnnotationType.ANNOTATION_BREAKPOINT); - registerType(AnnotationType.ANNOTATION_BOOKMARK); - registerType(AnnotationType.ANNOTATION_CURRENT_BRACKET); - registerType(AnnotationType.ANNOTATION_MATCHING_BRACKET); - registerType(AnnotationType.ANNOTATION_CURRENT_SEARCH); - registerType(AnnotationType.ANNOTATION_MATCHING_SEARCH); - registerType(AnnotationType.ANNOTATION_READ_OCCURRENCE); - registerType(AnnotationType.ANNOTATION_WRITE_OCCURRENCE); - registerType(AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP); - registerType(AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP); - registerType(AnnotationType.ANNOTATION_LINKED_GROUP); - registerType(AnnotationType.ANNOTATION_CURRENT_LINE, true); - registerType(AnnotationType.ANNOTATION_BLAME, true); - registerType(AnnotationType.ANNOTATION_CURRENT_BLAME, true); - registerType(AnnotationType.ANNOTATION_DIFF_ADDED); - registerType(AnnotationType.ANNOTATION_DIFF_DELETED); - registerType(AnnotationType.ANNOTATION_DIFF_MODIFIED); - - AnnotationType.registerType(AnnotationType.ANNOTATION_FOLDING, FoldingAnnotation); - - /** - * Constructs a new AnnotationTypeList object. - * - * @class This represents an interface of prioritized annotation types. - * @name orion.editor.AnnotationTypeList - */ - function AnnotationTypeList () { - } - /** - * Adds in the annotation type interface into the specified object. - * - * @param {Object} object The object to add in the annotation type interface. - */ - AnnotationTypeList.addMixin = function(object) { - var proto = AnnotationTypeList.prototype; - for (var p in proto) { - if (proto.hasOwnProperty(p)) { - object[p] = proto[p]; - } - } - }; - AnnotationTypeList.prototype = /** @lends orion.editor.AnnotationTypeList.prototype */ { - /** - * Adds an annotation type to the receiver. - *

      - * Only annotations of the specified types will be shown by - * the receiver. - *

      - *

      - * If the priority is not specified, the annotation type will be added - * to the end of the receiver's list (lowest pririoty). - *

      - * - * @param {Object} type the annotation type to be shown - * @param {Number} priority the priority for the annotation type - * - * @see orion.editor.AnnotationTypeList#removeAnnotationType - * @see orion.editor.AnnotationTypeList#isAnnotationTypeVisible - * @see orion.editor.AnnotationTypeList#getAnnotationTypePriority - */ - addAnnotationType: function(type, priority) { - if (!this._annotationTypes) { this._annotationTypes = []; } - var index = priority - 1; - if (priority == undefined || !(0 <= index && index < this._annotationTypes.length)) { - this._annotationTypes.push(type); - } else { - this._annotationTypes.splice(index, 0, type); - } - }, - /** - * Gets the annotation type priority. The priority is determined by the - * order the annotation type is added to the receiver. Annotation types - * added first have higher priority. - *

      - * Returns 0 if the annotation type is not added. - *

      - * - * @param {Object} type the annotation type - * - * @see orion.editor.AnnotationTypeList#addAnnotationType - * @see orion.editor.AnnotationTypeList#removeAnnotationType - * @see orion.editor.AnnotationTypeList#isAnnotationTypeVisible - */ - getAnnotationTypePriority: function(type) { - if (this._annotationTypes) { - for (var i = 0; i < this._annotationTypes.length; i++) { - if (this._annotationTypes[i] === type) { - return i + 1; - } - } - } - return 0; - }, - /** - * Returns an array of annotations in the specified annotation model for the given range of text sorted by type. - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model. - * @param {Number} start the start offset of the range. - * @param {Number} end the end offset of the range. - * @return {orion.editor.Annotation[]} an annotation array. - */ - getAnnotationsByType: function(annotationModel, start, end) { - var iter = annotationModel.getAnnotations(start, end); - var annotation, annotations = []; - while (iter.hasNext()) { - annotation = iter.next(); - var priority = this.getAnnotationTypePriority(annotation.type); - if (priority === 0) { continue; } - annotations.push(annotation); - } - var self = this; - annotations.sort(function(a, b) { - return self.getAnnotationTypePriority(a.type) - self.getAnnotationTypePriority(b.type); - }); - return annotations; - }, - /** - * Returns whether the receiver shows annotations of the specified type. - * - * @param {Object} type the annotation type - * @returns {Boolean} whether the specified annotation type is shown - * - * @see orion.editor.AnnotationTypeList#addAnnotationType - * @see orion.editor.AnnotationTypeList#removeAnnotationType - */ - isAnnotationTypeVisible: function(type) { - return this.getAnnotationTypePriority(type) !== 0; - }, - /** - * Removes an annotation type from the receiver. - * - * @param {Object} type the annotation type to be removed - * - * @see orion.editor.AnnotationTypeList#addAnnotationType - * @see orion.editor.AnnotationTypeList#isAnnotationTypeVisible - */ - removeAnnotationType: function(type) { - if (!this._annotationTypes) { return; } - for (var i = 0; i < this._annotationTypes.length; i++) { - if (this._annotationTypes[i] === type) { - this._annotationTypes.splice(i, 1); - break; - } - } - } - }; - - /** @private */ - function binarySearch(array, offset, inclusive, low, high) { - var index; - if (low === undefined) { low = -1; } - if (high === undefined) { high = array.length; } - while (high - low > 1) { - index = Math.floor((high + low) / 2); - if (offset <= array[index].start) { - high = index; - } else if (inclusive && offset < array[index].end) { - high = index; - break; - } else { - low = index; - } - } - return high; - } - - /** - * Constructs an annotation model. - * - * @param {orion.editor.TextModel} textModel The text model. - * - * @class This object manages annotations for a TextModel. - *

      - * See:
      - * {@link orion.editor.Annotation}
      - * {@link orion.editor.TextModel}
      - *

      - * @name orion.editor.AnnotationModel - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function AnnotationModel(textModel) { - this._annotations = []; - var self = this; - this._listener = { - onChanged: function(modelChangedEvent) { - self._onChanged(modelChangedEvent); - } - }; - this.setTextModel(textModel); - } - - AnnotationModel.prototype = /** @lends orion.editor.AnnotationModel.prototype */ { - /** - * Adds an annotation to the annotation model. - *

      The annotation model listeners are notified of this change.

      - * - * @param {orion.editor.Annotation} annotation the annotation to be added. - * - * @see orion.editor.AnnotationModel#removeAnnotation - */ - addAnnotation: function(annotation) { - if (!annotation) { return; } - var annotations = this._annotations; - var index = binarySearch(annotations, annotation.start); - annotations.splice(index, 0, annotation); - annotation._annotationModel = this; - var e = { - type: "Changed", //$NON-NLS-0$ - added: [annotation], - removed: [], - changed: [] - }; - this.onChanged(e); - }, - /** - * Returns the text model. - * - * @return {orion.editor.TextModel} The text model. - * - * @see orion.editor.AnnotationModel#setTextModel - */ - getTextModel: function() { - return this._model; - }, - /** - * @class This object represents an annotation iterator. - *

      - * See:
      - * {@link orion.editor.AnnotationModel#getAnnotations}
      - *

      - * @name orion.editor.AnnotationIterator - * - * @property {Function} hasNext Determines whether there are more annotations in the iterator. - * @property {Function} next Returns the next annotation in the iterator. - */ - /** - * Returns an iterator of annotations for the given range of text. If called with no parameters, - * returns all annotations in the model. - * - * @param {Number} start the start offset of the range. - * @param {Number} end the end offset of the range. - * @return {orion.editor.AnnotationIterator} an annotation iterartor. - */ - getAnnotations: function(start, end) { - var annotations = this._annotations, current; - var i = 0, skip; - if (start === undefined && end === undefined) { - skip = function() { - return (i < annotations.length) ? annotations[i++] : null; - }; - } else { - //TODO binary search does not work for range intersection when there are overlaping ranges, need interval search tree for this - skip = function() { - while (i < annotations.length) { - var a = annotations[i++]; - if ((start === a.start) || (start > a.start ? start < a.end : a.start < end)) { - return a; - } - if (a.start >= end) { - break; - } - } - return null; - }; - } - current = skip(); - return { - next: function() { - var result = current; - if (result) { current = skip(); } - return result; - }, - hasNext: function() { - return current !== null; - } - }; - }, - /** - * Notifies the annotation model that the given annotation has been modified. - *

      The annotation model listeners are notified of this change.

      - * - * @param {orion.editor.Annotation} annotation the modified annotation. - * - * @see orion.editor.AnnotationModel#addAnnotation - */ - modifyAnnotation: function(annotation) { - if (!annotation) { return; } - var index = this._getAnnotationIndex(annotation); - if (index < 0) { return; } - var e = { - type: "Changed", //$NON-NLS-0$ - added: [], - removed: [], - changed: [annotation] - }; - this.onChanged(e); - }, - /** - * Notifies all listeners that the annotation model has changed. - * - * @param {orion.editor.Annotation[]} added The list of annotation being added to the model. - * @param {orion.editor.Annotation[]} changed The list of annotation modified in the model. - * @param {orion.editor.Annotation[]} removed The list of annotation being removed from the model. - * @param {ModelChangedEvent} textModelChangedEvent the text model changed event that trigger this change, can be null if the change was trigger by a method call (for example, {@link #addAnnotation}). - */ - onChanged: function(e) { - return this.dispatchEvent(e); - }, - /** - * Removes all annotations of the given type. All annotations - * are removed if the type is not specified. - *

      The annotation model listeners are notified of this change. Only one changed event is generated.

      - * - * @param {Object} type the type of annotations to be removed. - * - * @see orion.editor.AnnotationModel#removeAnnotation - */ - removeAnnotations: function(type) { - var annotations = this._annotations; - var removed, i; - if (type) { - removed = []; - for (i = annotations.length - 1; i >= 0; i--) { - var annotation = annotations[i]; - if (annotation.type === type) { - annotations.splice(i, 1); - removed.splice(0, 0, annotation); - annotation._annotationModel = null; - } - } - } else { - removed = annotations; - annotations = []; - } - var e = { - type: "Changed", //$NON-NLS-0$ - removed: removed, - added: [], - changed: [] - }; - this.onChanged(e); - }, - /** - * Removes an annotation from the annotation model. - *

      The annotation model listeners are notified of this change.

      - * - * @param {orion.editor.Annotation} annotation the annotation to be removed. - * - * @see orion.editor.AnnotationModel#addAnnotation - */ - removeAnnotation: function(annotation) { - if (!annotation) { return; } - var index = this._getAnnotationIndex(annotation); - if (index < 0) { return; } - annotation._annotationModel = null; - var e = { - type: "Changed", //$NON-NLS-0$ - removed: this._annotations.splice(index, 1), - added: [], - changed: [] - }; - this.onChanged(e); - }, - /** - * Removes and adds the specifed annotations to the annotation model. - *

      The annotation model listeners are notified of this change. Only one changed event is generated.

      - * - * @param {orion.editor.Annotation} remove the annotations to be removed. - * @param {orion.editor.Annotation} add the annotations to be added. - * - * @see orion.editor.AnnotationModel#addAnnotation - * @see orion.editor.AnnotationModel#removeAnnotation - */ - replaceAnnotations: function(remove, add) { - var annotations = this._annotations, i, index, annotation, removed = []; - if (remove) { - for (i = remove.length - 1; i >= 0; i--) { - annotation = remove[i]; - index = this._getAnnotationIndex(annotation); - if (index < 0) { continue; } - annotation._annotationModel = null; - annotations.splice(index, 1); - removed.splice(0, 0, annotation); - } - } - if (!add) { add = []; } - for (i = 0; i < add.length; i++) { - annotation = add[i]; - index = binarySearch(annotations, annotation.start); - annotation._annotationModel = this; - annotations.splice(index, 0, annotation); - } - var e = { - type: "Changed", //$NON-NLS-0$ - removed: removed, - added: add, - changed: [] - }; - - this.onChanged(e); - }, - /** - * Sets the text model of the annotation model. The annotation - * model listens for changes in the text model to update and remove - * annotations that are affected by the change. - * - * @param {orion.editor.TextModel} textModel the text model. - * - * @see orion.editor.AnnotationModel#getTextModel - */ - setTextModel: function(textModel) { - if (this._model) { - this._model.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - } - this._model = textModel; - if (this._model) { - this._model.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - } - }, - /** @ignore */ - _getAnnotationIndex: function(annotation) { - var annotations = this._annotations; - var index = binarySearch(annotations, annotation.start); - while (index < annotations.length && annotations[index].start === annotation.start) { - if (annotations[index] === annotation) { - return index; - } - index++; - } - return -1; - }, - /** @ignore */ - _onChanged: function(modelChangedEvent) { - var start = modelChangedEvent.start; - var addedCharCount = modelChangedEvent.addedCharCount; - var removedCharCount = modelChangedEvent.removedCharCount; - var annotations = this._annotations, end = start + removedCharCount; - //TODO binary search does not work for range intersection when there are overlaping ranges, need interval search tree for this - var startIndex = 0; - if (!(0 <= startIndex && startIndex < annotations.length)) { return; } - var e = { - type: "Changed", //$NON-NLS-0$ - added: [], - removed: [], - changed: [], - textModelChangedEvent: modelChangedEvent - }; - var changeCount = addedCharCount - removedCharCount, i; - for (i = startIndex; i < annotations.length; i++) { - var annotation = annotations[i]; - if (annotation.start >= end) { - annotation._oldStart = annotation.start; - annotation._oldEnd = annotation.end; - annotation.start += changeCount; - annotation.end += changeCount; - e.changed.push(annotation); - } else if (annotation.end <= start) { - //nothing - } else if (annotation.start < start && end < annotation.end) { - annotation._oldStart = annotation.start; - annotation._oldEnd = annotation.end; - annotation.end += changeCount; - e.changed.push(annotation); - } else { - annotations.splice(i, 1); - e.removed.push(annotation); - annotation._annotationModel = null; - if (annotation.expand) { - annotation.expand(); - } - i--; - } - } - if (e.added.length > 0 || e.removed.length > 0 || e.changed.length > 0) { - this.onChanged(e); - } - } - }; - mEventTarget.EventTarget.addMixin(AnnotationModel.prototype); - - /** - * Constructs a new styler for annotations. - * - * @param {orion.editor.TextView} view The styler view. - * @param {orion.editor.AnnotationModel} view The styler annotation model. - * - * @class This object represents a styler for annotation attached to a text view. - * @name orion.editor.AnnotationStyler - * @borrows orion.editor.AnnotationTypeList#addAnnotationType as #addAnnotationType - * @borrows orion.editor.AnnotationTypeList#getAnnotationTypePriority as #getAnnotationTypePriority - * @borrows orion.editor.AnnotationTypeList#getAnnotationsByType as #getAnnotationsByType - * @borrows orion.editor.AnnotationTypeList#isAnnotationTypeVisible as #isAnnotationTypeVisible - * @borrows orion.editor.AnnotationTypeList#removeAnnotationType as #removeAnnotationType - */ - function AnnotationStyler (view, annotationModel) { - this._view = view; - this._annotationModel = annotationModel; - var self = this; - this._listener = { - onDestroy: function(e) { - self._onDestroy(e); - }, - onLineStyle: function(e) { - self._onLineStyle(e); - }, - onChanged: function(e) { - self._onAnnotationModelChanged(e); - } - }; - view.addEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - view.addEventListener("postLineStyle", this._listener.onLineStyle); //$NON-NLS-0$ - annotationModel.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - } - AnnotationStyler.prototype = /** @lends orion.editor.AnnotationStyler.prototype */ { - /** - * Destroys the styler. - *

      - * Removes all listeners added by this styler. - *

      - */ - destroy: function() { - var view = this._view; - if (view) { - view.removeEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - view.removeEventListener("LineStyle", this._listener.onLineStyle); //$NON-NLS-0$ - this.view = null; - } - var annotationModel = this._annotationModel; - if (annotationModel) { - annotationModel.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - annotationModel = null; - } - }, - _mergeStyle: function(result, style) { - if (style) { - if (!result) { result = {}; } - if (result.styleClass && style.styleClass && result.styleClass !== style.styleClass) { - result.styleClass += " " + style.styleClass; //$NON-NLS-0$ - } else { - result.styleClass = style.styleClass; - } - var prop; - if (style.tagName) { - if (!result.tagName) { - result.tagName = style.tagName; - } - } - if (style.style) { - if (!result.style) { result.style = {}; } - for (prop in style.style) { - if (!result.style[prop]) { - result.style[prop] = style.style[prop]; - } - } - } - if (style.attributes) { - if (!result.attributes) { result.attributes = {}; } - for (prop in style.attributes) { - if (!result.attributes[prop]) { - result.attributes[prop] = style.attributes[prop]; - } - } - } - } - return result; - }, - _mergeStyleRanges: function(ranges, styleRange) { - if (!ranges) { - ranges = []; - } - var mergedStyle, i = binarySearch(ranges, styleRange.start, true); - for (; i= range.end) { continue; } - mergedStyle = this._mergeStyle({}, range.style); - mergedStyle = this._mergeStyle(mergedStyle, styleRange.style); - var args = []; - args.push(i, 1); - if (styleRange.start < range.start) { - args.push({start: styleRange.start, end: range.start, style: styleRange.style}); - } - if (styleRange.start > range.start) { - args.push({start: range.start, end: styleRange.start, style: range.style}); - } - args.push({start: Math.max(range.start, styleRange.start), end: Math.min(range.end, styleRange.end), style: mergedStyle}); - if (styleRange.end < range.end) { - args.push({start: styleRange.end, end: range.end, style: range.style}); - } - if (styleRange.end > range.end) { - styleRange = {start: range.end, end: styleRange.end, style: styleRange.style}; - } else { - styleRange = null; - } - Array.prototype.splice.apply(ranges, args); - } - if (styleRange) { - mergedStyle = this._mergeStyle({}, styleRange.style); - ranges.splice(i, 0, {start: styleRange.start, end: styleRange.end, style: mergedStyle}); - } - return ranges; - }, - _onAnnotationModelChanged: function(e) { - var view = this._view; - if (!view) { return; } - var self = this; - var model = view.getModel(); - function redrawRange(start, end) { - if (model.getBaseModel) { - start = model.mapOffset(start, true); - end = model.mapOffset(end, true); - } - if (start !== -1 && end !== -1) { - view.redrawRange(start, end); - } - } - function redraw(changes, changed) { - for (var i = 0; i < changes.length; i++) { - if (!self.isAnnotationTypeVisible(changes[i].type)) { continue; } - var change = changes[i]; - redrawRange(change.start, change.end); - if (changed && change._oldStart !== undefined && change._oldEnd) { - redrawRange(change._oldStart, change._oldEnd); - } - } - } - redraw(e.added); - redraw(e.removed); - redraw(e.changed, true); - }, - _onDestroy: function(e) { - this.destroy(); - }, - _onLineStyle: function (e) { - var annotationModel = this._annotationModel; - var viewModel = e.textView.getModel(); - var baseModel = annotationModel.getTextModel(); - var start = e.lineStart; - var end = e.lineStart + e.lineText.length; - if (baseModel !== viewModel) { - start = viewModel.mapOffset(start); - end = viewModel.mapOffset(end); - } - var annotations = annotationModel.getAnnotations(start, end); - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (!this.isAnnotationTypeVisible(annotation.type)) { continue; } - if (annotation.rangeStyle) { - var annotationStart = annotation.start; - var annotationEnd = annotation.end; - if (baseModel !== viewModel) { - annotationStart = viewModel.mapOffset(annotationStart, true); - annotationEnd = viewModel.mapOffset(annotationEnd, true); - } - e.ranges = this._mergeStyleRanges(e.ranges, {start: annotationStart, end: annotationEnd, style: annotation.rangeStyle}); - } - if (annotation.lineStyle) { - e.style = this._mergeStyle({}, e.style); - e.style = this._mergeStyle(e.style, annotation.lineStyle); - } - } - } - }; - AnnotationTypeList.addMixin(AnnotationStyler.prototype); - - return { - FoldingAnnotation: FoldingAnnotation, - AnnotationType: AnnotationType, - AnnotationTypeList: AnnotationTypeList, - AnnotationModel: AnnotationModel, - AnnotationStyler: AnnotationStyler - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -/*global console prompt */ - -define('orion/editorCommands',[ - 'i18n!orion/edit/nls/messages', - 'orion/i18nUtil', - 'orion/webui/littlelib', - 'orion/widgets/input/DropDownMenu', - 'orion/Deferred', - 'orion/URITemplate', - 'orion/commands', - 'orion/keyBinding', - 'orion/commandRegistry', - 'orion/extensionCommands', - 'orion/contentTypes', - 'orion/searchUtils', - 'orion/objects', - 'orion/PageUtil', - 'orion/PageLinks', - 'orion/editor/annotations', - 'orion/regex', - 'orion/PageUtil', - 'orion/uiUtils', - 'orion/util' -], function(messages, i18nUtil, lib, DropDownMenu, Deferred, URITemplate, mCommands, mKeyBinding, mCommandRegistry, mExtensionCommands, mContentTypes, mSearchUtils, objects, mPageUtil, PageLinks, mAnnotations, regex, PageUtil, mUIUtils, util) { - - var exports = {}; - - var contentTypesCache = null; - - function createDelegatedUI(options) { - var uriTemplate = new URITemplate(options.uriTemplate); - var params = options.params || {}; - params.OrionHome = params.OrionHome || PageLinks.getOrionHome(); - var href = uriTemplate.expand(params); - var delegatedParent = document.createElement("div"); //$NON-NLS-0$ - var iframe = document.createElement("iframe"); //$NON-NLS-0$ - iframe.id = options.id; - iframe.name = options.id; - iframe.type = "text/html"; //$NON-NLS-0$ - iframe.sandbox = "allow-scripts allow-same-origin allow-forms allow-popups"; //$NON-NLS-0$ - iframe.frameborder = options.border !== undefined ? options.border : 1; - iframe.src = href; - iframe.className = "delegatedUI"; //$NON-NLS-0$ - if (options.width) { - delegatedParent.style.width = options.width; - iframe.style.width = options.width; - } - if (options.height) { - delegatedParent.style.height = options.height; - iframe.style.height = options.height; - } - iframe.style.visibility = 'hidden'; //$NON-NLS-0$ - if (options.parent !== null) { - (options.parent || window.document.body).appendChild(delegatedParent); - } - delegatedParent.appendChild(iframe); - iframe.style.left = options.left || (window.innerWidth - parseInt(iframe.clientWidth, 10))/2 + "px"; //$NON-NLS-0$ - iframe.style.top = options.top || (window.innerHeight - parseInt(iframe.clientHeight, 10))/2 + "px"; //$NON-NLS-0$ - iframe.style.visibility = ''; - // Listen for notification from the iframe. We expect either a "result" or a "cancelled" property. - window.addEventListener("message", function _messageHandler(event) { //$NON-NLS-0$ - if (event.source !== iframe.contentWindow) { - return; - } - if (typeof event.data === "string") { //$NON-NLS-0$ - var data = JSON.parse(event.data); - if (data.pageService === "orion.page.delegatedUI" && data.source === options.id) { //$NON-NLS-0$ - if (data.cancelled) { - // console.log("Delegated UI Cancelled"); - if (options.cancelled) { - options.cancelled(); - } - } else if (data.result) { - if (options.done) { - options.done(data.result); - } - } else if (data.Status || data.status) { - if (options.status) { - options.status(data.Status || data.status); - } - } - window.removeEventListener("message", _messageHandler, false); //$NON-NLS-0$ - if (delegatedParent.parentNode) { - delegatedParent.parentNode.removeChild(delegatedParent); - } - } - } - }, false); - - return delegatedParent; - } - exports.createDelegatedUI = createDelegatedUI; - - /** - * Handles a status message from a service by forwarding to the orion.page.message service - * and stripping HTML. - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {Object|string} status - * @returns {orion.Promise} - */ - function handleStatusMessage(serviceRegistry, status) { - if (status && typeof status.HTML !== "undefined") { //$NON-NLS-0$ - delete status.HTML; - } - var statusService = serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$ - if (statusService) { - return statusService.setProgressResult(status).then(null, function(e) { - console.log(e); - throw e; // reject - }); - } else { - console.log(status); - return new Deferred().resolve(status); - } - } - - function errorTransformer(error) { - return {_error: error}; - } - - function EditorCommandFactory (options) { - this.serviceRegistry = options.serviceRegistry; - this.commandService = options.commandRegistry; - this.fileClient = options.fileClient; - this.preferences = options.preferences; - this.inputManager = options.inputManager; - this.renderToolbars = options.renderToolbars; - this.toolbarId = options.toolbarId; - this.saveToolbarId = options.saveToolbarId; - this.editToolbarId = options.editToolbarId; - this.pageNavId = options.navToolbarId; - this.editorContextMenuId = options.editorContextMenuId; - this.isReadOnly = options.readonly; - this.textSearcher = options.textSearcher; - this.searcher = options.searcher; - this.localSettings = options.localSettings; - this.editorPreferences = options.editorPreferences; - this.differ = options.differ; - this.blamer = options.blamer; - var that = this; - this.listener = { - onServiceAdded: function(event) { - that._onServiceAdded(event.serviceReference); - }, - onServiceRemoved: function(event) { - that._onServiceRemoved(event.serviceReference); - } - }; - this.serviceRegistry.addEventListener("registered", this.listener.onServiceAdded); //$NON-NLS-0$ - this.serviceRegistry.addEventListener("unregistering", this.listener.onServiceRemoved); //$NON-NLS-0$ - } - EditorCommandFactory.prototype = { - /** - * Creates the common text editing commands. Also generates commands for any installed plug-ins that - * contribute editor actions. - */ - createCommands: function() { - this._createSettingsCommand(); - this._createGotoLineCommnand(); - this._createFindCommnand(); - this._createBlameCommand(); - this._createDiffCommand(); - this._createShowTooltipCommand(); - this._createUndoStackCommands(); - this._createClipboardCommands(); - this._createDelimiterCommands(); - this._createEncodingCommand(); - this._createSaveCommand(); - this._createOpenFolderCommand(); - this._createOpenRecentCommand(); - return this._createEditCommands(); - }, - updateWorkspacePrefs:function(workspaceAddress){ - var that = this; - return this.preferences.get("/workspace").then(function(prefs) { - return prefs.recentWorkspaces ? prefs.recentWorkspaces : []; - }).then(function(recentworkspaces){ - var RECENT_ARRAY_LENGTH = 10; - var oldIndex = recentworkspaces.indexOf(workspaceAddress); - if(oldIndex !== -1){ - recentworkspaces.splice(oldIndex,1); - } - if(recentworkspaces.length < RECENT_ARRAY_LENGTH){ - recentworkspaces.unshift(workspaceAddress); - }else if(recentworkspaces.length === RECENT_ARRAY_LENGTH){ - recentworkspaces.pop(); - recentworkspaces.unshift(workspaceAddress); - } - return that.preferences.put("/workspace",{recentWorkspaces: recentworkspaces, currentWorkspace: workspaceAddress}); - }) - }, - //TODO: We need a better way invoke side bar action - setSideBar: function(sideBar) { - this.sideBar = sideBar; - }, - getEditCommands: function() { - var commands = []; - var commandRegistry = this.commandService; - for (var commandId in commandRegistry._commandList) { - var command = commandRegistry._commandList[commandId]; - if (command.editInfo) { - commands.push(command); - } - } - return commands; - }, - updateCommands: function(target) { - target = target || {}; - this.editor = target.editor; - this.inputManager = target.inputManager; - this.localSettings = target.localSettings; - this.differ = target.differ; - this.blamer = target.blamer; - this.textSearcher = target.textSearcher; - - if (this._recreateEditCommands) { - this._createEditCommands().then(function() { - this.registerCommands(); - this.registerContextMenuCommands(); - if (this.renderToolbars) { - this.renderToolbars(); - } - }.bind(this)); - } - }, - _registerCommandGroups: function(scopeId, rootPath) { - var commandRegistry = this.commandService; - var serviceRegistry = this.serviceRegistry, parentPath; - var groupReferences = serviceRegistry.getServiceReferences("orion.edit.command.category"); //$NON-NLS-0$ - groupReferences.forEach(function(serviceReference) { - var groupInfo = {}; - var propertyNames = serviceReference.getPropertyKeys(); - for (var j = 0; j < propertyNames.length; j++) { - groupInfo[propertyNames[j]] = serviceReference.getProperty(propertyNames[j]); - } - parentPath = rootPath; - if (groupInfo.parentPath) { - parentPath += "/" + groupInfo.parentPath; - } - commandRegistry.addCommandGroup(scopeId, groupInfo.id, groupInfo.position || 101, groupInfo.name, parentPath, null, groupInfo.imageClass); - }.bind(this)); - }, - registerCommands: function() { - var commandRegistry = this.commandService; - - commandRegistry.registerCommandContribution("settingsActions", "orion.edit.settings", 1, null, false, new mKeyBinding.KeyBinding("s", true, true), null, this); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.editToolbarId || this.toolbarId, "orion.edit.undo", 400, this.editToolbarId ? "orion.menuBarEditGroup/orion.edit.undoGroup" : null, !this.editToolbarId, new mKeyBinding.KeyBinding('z', true), null, this); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ - commandRegistry.registerCommandContribution(this.editToolbarId || this.toolbarId, "orion.edit.redo", 401, this.editToolbarId ? "orion.menuBarEditGroup/orion.edit.undoGroup" : null, !this.editToolbarId, util.isMac ? new mKeyBinding.KeyBinding('z', true, true) : new mKeyBinding.KeyBinding('y', true), null, this); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - commandRegistry.registerCommandContribution(this.saveToolbarId || this.toolbarId, "orion.edit.openFolder", 1, this.saveToolbarId ? "orion.menuBarFileGroup/orion.edit.saveGroup" : null, false, new mKeyBinding.KeyBinding('o', true)); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.saveToolbarId || this.toolbarId, "orion.edit.openRecent", 3, this.saveToolbarId ? "orion.menuBarFileGroup/orion.edit.saveGroup" : null, false, new mKeyBinding.KeyBinding('r', true)); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.saveToolbarId || this.toolbarId, "orion.openResource", 1, this.saveToolbarId ? "orion.menuBarFileGroup/orion.edit.saveGroup" : null, false, new mKeyBinding.KeyBinding('f', true, true)); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.saveToolbarId || this.toolbarId, "orion.edit.save", 2, this.saveToolbarId ? "orion.menuBarFileGroup/orion.edit.saveGroup" : null, false, new mKeyBinding.KeyBinding('s', true), null, this); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ - commandRegistry.registerCommandContribution(this.editToolbarId || this.pageNavId, "orion.edit.gotoLine", 3, this.editToolbarId ? "orion.menuBarEditGroup/orion.findGroup" : null, !this.editToolbarId, new mKeyBinding.KeyBinding('l', !util.isMac, false, false, util.isMac), new mCommandRegistry.URLBinding("gotoLine", "line"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$ - commandRegistry.registerCommandContribution(this.editToolbarId || this.pageNavId, "orion.edit.find", 0, this.editToolbarId ? "orion.menuBarEditGroup/orion.findGroup" : null, !this.editToolbarId, new mKeyBinding.KeyBinding('f', true), new mCommandRegistry.URLBinding("find", "find"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$ - commandRegistry.registerCommandContribution(this.toolbarId, "orion.keyAssist", 0, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding(191, false, true, true)); //$NON-NLS-1$ //$NON-NLS-0$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.showTooltip", 1, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding(113), null, this);//$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.blame", 2, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding('b', true, true), new mCommandRegistry.URLBinding("blame", "blame"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$ - commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.diff", 3, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding('d', true, true), new mCommandRegistry.URLBinding("diff", "diff"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$ - - // 'Delimiters' cascade - var index = 0; - commandRegistry.addCommandGroup(this.toolbarId, "orion.editorMenuBarMenuDelimitersGroup", 999, messages["Convert Line Delimiters"], "orion.menuBarToolsGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.toolbarId, "orion.edit.convert.crlf", index++, "orion.menuBarToolsGroup/orion.editorMenuBarMenuDelimitersGroup", false, null, null, this); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.toolbarId, "orion.edit.convert.lf", index++, "orion.menuBarToolsGroup/orion.editorMenuBarMenuDelimitersGroup", false, null, null, this); //$NON-NLS-1$ //$NON-NLS-2$ - - commandRegistry.registerCommandContribution(this.toolbarId, "orion.edit.reloadWithEncoding", 1000, "orion.menuBarToolsGroup"); //$NON-NLS-1$ //$NON-NLS-2$ - - this._registerCommandGroups(this.toolbarId, "orion.menuBarToolsGroup"); //$NON-NLS-1$ - - // KB exists so that we can pass an array (from info.key) rather than actual arguments - function createKeyBinding(args) { - if (!args) { return null; } - var keyBinding = new mKeyBinding.KeyBinding(); - mKeyBinding.KeyBinding.apply(keyBinding, args); - return keyBinding; - } - var commands = this.getEditCommands(); - for (var i = 0, position = 100; i < commands.length; i++, position++) { - var command = commands[i], info = command.editInfo; - - // Handle quick fixes - if (info.scopeId) { - commandRegistry.registerCommandContribution(info.scopeId, command.id, position, info.scopeId + "Group", info.bindingOnly, createKeyBinding(info.key), null, this); //$NON-NLS-0$ - } else { - var parentPath = "orion.menuBarToolsGroup"; //$NON-NLS-1$ - if (info.parentPath) { - parentPath += "/" + info.parentPath; - } - commandRegistry.registerCommandContribution(this.toolbarId, command.id, position, parentPath, info.bindingOnly, createKeyBinding(info.key), null, this); - } - } - }, - registerContextMenuCommands: function() { - var commandRegistry = this.commandService; - // main context menu - commandRegistry.addCommandGroup(this.editorContextMenuId, "orion.editorContextMenuGroup", 100, null, null, null, null, null, "dropdownSelection"); //$NON-NLS-1$ //$NON-NLS-2$ - - var index = 1; - //TODO - non-nls is wrong, check accelerator conflicts etc. - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.copy", index++, "orion.editorContextMenuGroup/orion.edit.copyGroup", false, new mKeyBinding.KeyBinding('c', true)); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.cut", index++, "orion.editorContextMenuGroup/orion.edit.copyGroup", false, new mKeyBinding.KeyBinding('x', true)); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.paste", index++, "orion.editorContextMenuGroup/orion.edit.copyGroup", false, new mKeyBinding.KeyBinding('v', true)); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.undo", index++, "orion.editorContextMenuGroup/orion.edit.undoGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.redo", index++, "orion.editorContextMenuGroup/orion.edit.undoGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.find", index++,"orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.gotoLine", index++, "orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.quickSearch", index++, "orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.openSearch", index++, "orion.editorContextMenuGroup/orion.findGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - - // 'Tools' cascade - commandRegistry.addCommandGroup(this.editorContextMenuId, "orion.editorContextMenuToolsGroup", 400, messages["Tools"], "orion.editorContextMenuGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.reloadWithEncoding", 1000, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup"); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.blame", 1, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId , "orion.edit.diff", 2, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup", false); //$NON-NLS-1$ //$NON-NLS-2$ - - // 'Delimiters' cascade - commandRegistry.addCommandGroup(this.editorContextMenuId, "orion.editorContextMenuDelimitersGroup", 999, messages["Convert Line Delimiters"], "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.convert.crlf", index++, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup/orion.editorContextMenuDelimitersGroup"); //$NON-NLS-1$ //$NON-NLS-2$ - commandRegistry.registerCommandContribution(this.editorContextMenuId, "orion.edit.convert.lf", index++, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup/orion.editorContextMenuDelimitersGroup"); //$NON-NLS-1$ //$NON-NLS-2$ - - this._registerCommandGroups(this.editorContextMenuId, "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup"); //$NON-NLS-1$ - - // Register extra tools commands - var commands = this.getEditCommands(); - for (var i = 0, position = 100; i < commands.length; i++, position++) { - var command = commands[i], info = command.editInfo; - var parentPath = "orion.editorContextMenuGroup/orion.editorContextMenuToolsGroup"; //$NON-NLS-1$ - if (info.parentPath) { - parentPath += "/" + info.parentPath; - } - this.commandService.registerCommandContribution(this.editorContextMenuId, command.id, position, parentPath); - } - }, - overwriteKeyBindings: function(editor) { - var that = this; - this.editor = editor; - if (editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - textView.setKeyBinding(new mKeyBinding.KeyBinding('s', true), "save"); //$NON-NLS-1$ //$NON-NLS-2$ - var saveCommand = that.commandService.findCommand("orion.edit.save"); //$NON-NLS-0$ - if (saveCommand) { - textView.setAction("save", function() { //$NON-NLS-0$ - saveCommand.callback.call({inputManager: that.inputManager}); - return true; - }, saveCommand); //$NON-NLS-0$ - } - - textView.setAction("gotoLine", function (data) { //$NON-NLS-0$ - if (data) { - editor.onGotoLine(data.line - 1, 0, undefined, data.callback); - return true; - } - that.commandService.runCommand("orion.edit.gotoLine"); //$NON-NLS-0$ - return true; - }, that.commandService.findCommand("orion.edit.gotoLine")); //$NON-NLS-0$ - - if(this.textSearcher) { - textView.setAction("find", function (data) { //$NON-NLS-0$ - if (data) { - that.textSearcher.show(data); - return true; - } - that.commandService.runCommand("orion.edit.find"); //$NON-NLS-0$ - return true; - }, that.commandService.findCommand("orion.edit.find")); //$NON-NLS-0$ - } - - var keyAssistCommand = that.commandService.findCommand("orion.keyAssist"); //$NON-NLS-0$ - if (keyAssistCommand) { - textView.setKeyBinding(new mKeyBinding.KeyStroke(191, false, true, !util.isMac, util.isMac), keyAssistCommand.id); - textView.setAction(keyAssistCommand.id, keyAssistCommand.callback, keyAssistCommand); - } - - // Support future key binding changes - this.bindingChangeListener = function(args) { - this._handleBindingChanges(textView, args); - }.bind(this); - this.commandService.addEventListener("bindingChanged", this.bindingChangeListener); - } - }, - _handleBindingChanges: function(textView, args) { - // Only execute if this is a textView action - var actions = textView.getActions(true); - if (actions.indexOf(args.id) !== -1) { - if (args.prevBinding) { - textView.setKeyBinding(args.prevBinding, null); - } - textView.setKeyBinding(args.newBinding, args.id); - } - }, - showKeyBindings: function(keyAssist) { - var editor = this.editor; - if (editor && editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - // Remove actions without descriptions - var editorActions = textView.getActions(true).filter(function (element) { - var desc = textView.getActionDescription(element); - return desc && desc.name; - }); - editorActions.sort(function (a, b) { - return textView.getActionDescription(a).name.localeCompare(textView.getActionDescription(b).name); - }); - keyAssist.createHeader(messages["Editor"]); - var execute = function (actionID) { - return function () { - textView.focus(); - return textView.invokeAction(actionID); - }; - }; - var scopes = {}, binding; - for (var i = 0; i < editorActions.length; i++) { - var actionID = editorActions[i]; - var actionDescription = textView.getActionDescription(actionID); - var bindings = textView.getKeyBindings(actionID); - if (bindings.length > 0) { - for (var j = 0; j < bindings.length; j++) { - binding = bindings[j]; - var bindingString = mUIUtils.getUserKeyString(binding); - if (binding.scopeName) { - if (!scopes[binding.scopeName]) { - scopes[binding.scopeName] = []; - } - scopes[binding.scopeName].push({bindingString: bindingString, name: actionDescription.name, execute: execute(actionID)}); - } else { - keyAssist.createItem(binding, actionDescription.name, actionID, execute(actionID)); - } - } - } else { - keyAssist.createItem(null, actionDescription.name, actionID, execute(actionID)); //$NON-NLS-1$ - } - } - for (var scopedBinding in scopes) { - if (scopes[scopedBinding].length) { - keyAssist.createHeader(scopedBinding); - for (var k = 0; k < scopes[scopedBinding].length; k++) { - binding = scopes[scopedBinding][k]; - keyAssist.createItem(binding, binding.name, binding.name, binding.execute); - } - } - } - } - }, - _createSettingsCommand: function() { - var that = this; - var settingsCommand = new mCommands.Command({ - imageClass: "core-sprite-wrench", //$NON-NLS-0$ - tooltip: messages.LocalEditorSettings, - id: "orion.edit.settings", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed && data.handler.localSettings; - }, - callback: function(data) { - var localSettings = this.localSettings || that.localSettings; - var dropDown = settingsCommand.settingsDropDown; - if (!dropDown || dropDown.isDestroyed()) { - dropDown = settingsCommand.settingsDropDown = new DropDownMenu(data.domNode.parentNode, data.domNode, { - noClick: true, - selectionClass: 'dropdownSelection', //$NON-NLS-0$ - onShow: function() { - dropDown.focus(); - }, - onHide: function() { - that.editor.focus(); - } - }); - dropDown.updateContent = localSettings.show.bind(localSettings); - var menu = dropDown.getContentNode(); - menu.tabIndex = menu.style.marginTop = 0; - } - dropDown.click(); - } - }); - this.commandService.addCommand(settingsCommand); - }, - - _createDelimiterCommands: function() { - - var that = this; - var convert = function (delimiter) { - var editor = that.editor; - if (editor && editor.getModel()) { - var textModel = editor.getModel(); - textModel.setLineDelimiter(delimiter, true); - var progress = that.serviceRegistry.getService("orion.page.progress"); //$NON-NLS-0$ - if (progress) { - var message = messages [delimiter === "\r\n" ? "ConversionCompleteCRLF" : "ConversionCompleteLF"]; - progress.setProgressResult( {Message: message}); - } - editor.focus(); - } - }; - - var convertToCrLfCommand = new mCommands.Command({ - name: messages["Windows (CR/LF)"], - id: "orion.edit.convert.crlf", //$NON-NLS-1$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - convert ("\r\n"); //$NON-NLS-1$ - } - }); - this.commandService.addCommand(convertToCrLfCommand); - - var convertToLfCommand = new mCommands.Command({ - name: messages["Unix (LF)"], - id: "orion.edit.convert.lf", //$NON-NLS-1$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - convert ("\n"); //$NON-NLS-1$ - } - }); - this.commandService.addCommand(convertToLfCommand); - }, - - _createClipboardCommands: function() { - - //TODO - test to see whether copy/cut/paste is supported instead of IE - if (util.isIE || util.isElectron) { - var that = this; - - var copyCommand = new mCommands.Command({ - name: messages.Copy, - id: "orion.edit.copy", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - if (editor && editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - textView.copy(); - editor.focus(); - } - } - }); - this.commandService.addCommand(copyCommand); - - var cutCommand = new mCommands.Command({ - name: messages.Cut, - id: "orion.edit.cut", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - if (editor && editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - textView.cut(); - editor.focus(); - } - } - }); - this.commandService.addCommand(cutCommand); - - var pasteCommand = new mCommands.Command({ - name: messages.Paste, - id: "orion.edit.paste", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - if (editor && editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - textView.paste(); - editor.focus(); - } - } - }); - this.commandService.addCommand(pasteCommand); - } - }, - _createUndoStackCommands: function() { - var that = this; - var undoCommand = new mCommands.Command({ - name: messages.Undo, - id: "orion.edit.undo", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - editor.getUndoStack().undo(); - } - }); - this.commandService.addCommand(undoCommand); - - var redoCommand = new mCommands.Command({ - name: messages.Redo, - id: "orion.edit.redo", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - editor.getUndoStack().redo(); - } - }); - this.commandService.addCommand(redoCommand); - }, - _createSaveCommand: function() { - var that = this; - var saveCommand = new mCommands.Command({ - name: messages.Save, - tooltip: messages.saveFile, - imageClass : "core-sprite-save", //$NON-NLS-0$ - id: "orion.edit.save", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var inputManager = data.handler.inputManager || that.inputManager; - var editor = data.handler.editor || that.editor || (inputManager && inputManager.getEditor()); - if (!editor || !editor.installed || !inputManager || !inputManager.isSaveEnabled()) { - return false; - } - return true; - }, - callback: function() { - var inputManager = this.inputManager || that.inputManager; - inputManager.save(); - } - }); - this.commandService.addCommand(saveCommand); - }, - _createOpenFolderCommand: function() { - var that = this; - var openFolderCommand = new mCommands.Command({ - name: messages.OpenFolder, - tooltip: messages.OpenFolderTip, - id: "orion.edit.openFolder", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - return !!window.__dialogModule; - }, - callback: function() { - window.__dialogModule.showOpenDialog({properties: ['openDirectory']}, function(result) { - if (!result) return; - that.fileClient.changeWorkspace(result[0]).then(function() { - return that.updateWorkspacePrefs(result[0]); - }).then(function(){ - delete sessionStorage.lastFile; - window.location.hash = ""; - window.location.reload(); - }) - }); - } - }); - this.commandService.addCommand(openFolderCommand); - }, - _createOpenRecentCommand: function() { - var that = this; - if(this.preferences){ - this.preferences.get("/workspace").then(function(prefs) { - return prefs.recentWorkspaces; - }).then(function(recentworkspaces){ - var openRecentCommand = new mCommands.Command({ - name: messages.OpenRecent, - selectionClass: "dropdownSelection", //$NON-NLS-0$ - id: "orion.edit.openRecent", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - return !!window.__dialogModule && !!recentworkspaces; - }, - choiceCallback: function() { - return recentworkspaces.map(function(folderLocation) { - return { - name: folderLocation, - callback: function() { - that.fileClient.changeWorkspace(folderLocation).then(function() { - return that.updateWorkspacePrefs(folderLocation); - }).then(function(){ - delete sessionStorage.lastFile; - window.location.hash = ""; - window.location.reload(); - }) - } - }; - }); - } - }); - that.commandService.addCommand(openRecentCommand); - }); - } - }, - _createEncodingCommand: function() { - var that = this; - var ENCODING_LIST = [ - "UTF-8", "UTF-16LE", //$NON-NLS-1$ //$NON-NLS-2$ - - "iso-8859-1", "iso-8859-2", "iso-8859-3", "iso-8859-4", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "iso-8859-5", "iso-8859-6", "iso-8859-7", "iso-8859-8", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "iso-8859-9", "iso-8859-10", "iso-8859-11", "iso-8859-12", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "iso-8859-13", "iso-8859-14", "iso-8859-15", "iso-8859-16", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - - "windows-1250", "windows-1251", "windows-1252", "windows-1253", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "windows-1254", "windows-1255", "windows-1256", "windows-1258", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - - "gb18030", "gb2312", "gbk", "Big5", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "Big5-HKSCS", "koi8-r", "koi8-u", "euc-jp", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "euc-tw", "shift-jis", "iso-2022-jp", "iso-2022-kr", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - "iso-2022-cn", "hz", "MacRoman", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - ]; - var uriTemplate = new URITemplate("#{,resource,params*}"); //$NON-NLS-0$ - var changeEncodingCommand = new mCommands.Command({ - name: messages["ReloadWith"], - selectionClass: "dropdownSelection", //$NON-NLS-0$ - id: "orion.edit.reloadWithEncoding", //$NON-NLS-0$ - visibleWhen: function() { - var editor = that.editor; - return editor && editor.installed; - }, - choiceCallback: function() { - return ENCODING_LIST.map(function(encoding) { - return { - name: encoding, - callback: function() { - var input = PageUtil.matchResourceParameters(); - var resource = input.resource; - delete input.resource; - delete input.encoding; - if (this.name !== "UTF-8") { - input.encoding = this.name; - } - window.location.href = uriTemplate.expand({resource: resource, params: input}); - } - }; - }); - } - }); - this.commandService.addCommand(changeEncodingCommand); - }, - _createGotoLineCommnand: function() { - var that = this; - - // page navigation commands (go to line) - var lineParameter = new mCommandRegistry.ParametersDescription( - [new mCommandRegistry.CommandParameter('line', 'number', messages.gotoLinePrompt)], //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - {hasOptionalParameters: false}, - function(data) { - var editor = data.handler.editor || that.editor; - var line = editor.getModel().getLineAtOffset(editor.getCaretOffset()) + 1; - return [new mCommandRegistry.CommandParameter('line', 'number', messages.gotoLinePrompt, line.toString())]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - ); - - var gotoLineCommand = new mCommands.Command({ - name: messages.gotoLine, - tooltip: messages.gotoLineTooltip, - id: "orion.edit.gotoLine", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - parameters: lineParameter, - callback: function(data) { - var line; - var editor = this.editor || that.editor; - var model = editor.getModel(); - if (data.parameters && data.parameters.valueFor('line')) { //$NON-NLS-0$ - line = data.parameters.valueFor('line'); //$NON-NLS-0$ - } else { - line = model.getLineAtOffset(editor.getCaretOffset()); - line = prompt(messages.gotoLinePrompt, line + 1); - if (line) { - line = parseInt(line, 10); - } - } - if (line) { - editor.onGotoLine(line - 1, 0); - } - } - }); - this.commandService.addCommand(gotoLineCommand); - }, - _createFindCommnand: function() { - var that = this; - - // find&&replace commands (find) - var findParameter = new mCommandRegistry.ParametersDescription( - [new mCommandRegistry.CommandParameter('find', 'text', 'Find:')], //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - {clientCollect: true}, - function(data) { - var editor = data.handler.editor || that.editor; - var textSearcher = data.handler.textSearcher || that.textSearcher; - var selection = editor.getSelection(); - var searchString = ""; - if (selection.end > selection.start) { - var model = editor.getModel(); - searchString = model.getText(selection.start, selection.end); - if (textSearcher && textSearcher.getOptions().regex) { - searchString = regex.escape(searchString); - } - } - return [new mCommandRegistry.CommandParameter('find', 'text', 'Find:', searchString)]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - ); - var findCommand = new mCommands.Command({ - name: messages.Find, - tooltip: messages.Find, - id: "orion.edit.find", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - var textSearcher = data.handler.textSearcher || that.textSearcher; - return editor && editor.installed && textSearcher; - }, - parameters: findParameter, - callback: function(data) { - var node = lib.node("replaceCompareDiv"); //$NON-NLS-0$ - if (node && node.classList.contains("replaceCompareDivVisible")) { //$NON-NLS-0$ - return false; //TODO is there a better way of preventing the command from being executed? - } - var editor = this.editor || that.editor; - var textSearcher = this.textSearcher || that.textSearcher; - if (findCommand.textSearcher && findCommand.textSearcher !== textSearcher) { - findCommand.textSearcher.hide(); - } - findCommand.textSearcher = textSearcher; - var searchString = ""; - var parsedParam = null; - var selection = editor.getSelection(); - if (data.parameters && data.parameters.valueFor('find')) { //$NON-NLS-0$ - searchString = data.parameters.valueFor('find'); //$NON-NLS-0$ - parsedParam = mPageUtil.matchResourceParameters(); - mSearchUtils.convertFindURLBinding(parsedParam); - } else if (selection.end > selection.start) {//$NON-NLS-0$ If there is selection from editor, we want to use it as the default keyword - var model = editor.getModel(); - searchString = model.getText(selection.start, selection.end); - if (textSearcher.getOptions().regex) { - searchString = regex.escape(searchString); - } - } - if(parsedParam){ - //If the incoming resource does not match the current inputManager's, we should ignore it. - //This could happen when clicking on a file and then clicking on another in the global search result page. - var fileMetadata = (this.inputManager || that.inputManager).getFileMetadata(); - if(!fileMetadata || parsedParam.resource !== fileMetadata.Location) { - return; - } - textSearcher.setOptions({regex: parsedParam.regEx, caseInsensitive: !parsedParam.caseSensitive, wholeWord: parsedParam.wholeWord}); - var tempOptions = {}; - if(parsedParam.atLine){ - tempOptions.start = editor.getModel().getLineStart(parsedParam.atLine-1); - } - textSearcher.show({findString: searchString, replaceString: parsedParam.replaceWith}); - textSearcher.find(true, tempOptions); - that.commandService.closeParameterCollector(); //TODO is there a better way of hiding the parameter collector? - } else { - textSearcher.show({findString: searchString}); - } - } - }); - this.commandService.addCommand(findCommand); - }, - - _createBlameCommand: function(){ - var that = this; - var blameCommand = new mCommands.Command({ - name: messages.Blame, - tooltip: messages.BlameTooltip, - id: "orion.edit.blame", //$NON-NLS-0$ - parameters: new mCommandRegistry.ParametersDescription([new mCommandRegistry.CommandParameter('blame', 'boolean')], {clientCollect: true}), //$NON-NLS-1$ //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - var blamer = data.handler.blamer || that.blamer; - return editor && editor.installed && blamer && blamer.isVisible(); - }, - callback: function(data) { - var visible = false; - var editor = this.editor || that.editor; - var blamer = this.blamer || that.blamer; - var annotations = editor.getAnnotationModel().getAnnotations(); - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (annotation.type === mAnnotations.AnnotationType.ANNOTATION_BLAME) { - visible = true; - break; - } - } - visible = !visible; - if (data.parameters && data.parameters.valueFor('blame')) { //$NON-NLS-0$ - visible = data.parameters.valueFor('blame') === "true"; //$NON-NLS-1$ //$NON-NLS-0$ - } - if (visible) { - blamer.doBlame(); - } else{ - editor.showBlame([]); - } - editor.focus(); - } - }); - this.commandService.addCommand(blameCommand); - }, - - _createDiffCommand: function(){ - var that = this; - var diffCommand = new mCommands.Command({ - name: messages.Diff, - tooltip: messages.DiffTooltip, - id: "orion.edit.diff", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - var differ = data.handler.differ || that.differ; - return editor && editor.installed && differ && differ.isVisible(); - }, - callback: function() { - var editor = this.editor || that.editor; - var differ = this.differ || that.differ; - differ.toggleEnabled(); - var editorPreferences = this.editorPreferences; - editorPreferences.getPrefs(function(pref){ - pref.diffService = differ.isEnabled(); - editorPreferences.setPrefs(pref); - }); - editor.focus(); - } - }); - this.commandService.addCommand(diffCommand); - }, - - _createShowTooltipCommand: function(){ - var that = this; - var showTooltipCommand = new mCommands.Command({ - name: messages.showTooltip, - tooltip: messages.showTooltipTooltip, - id: "orion.edit.showTooltip", //$NON-NLS-0$ - visibleWhen: /** @callback */ function(items, data) { - var editor = data.handler.editor || that.editor; - return editor && editor.installed; - }, - callback: function() { - var editor = this.editor || that.editor; - var tooltip = editor.getTooltip(); - var tv = editor.getTextView(); - var offset = tv.getCaretOffset(); - var pos = tv.getLocationAtOffset(offset); - tooltip.show({ - x: pos.x, - y: pos.y, - getTooltipInfo: function() { - return editor._getTooltipInfo(this.x, this.y); - } - }, false, true); - } - }); - this.commandService.addCommand(showTooltipCommand); - }, - _onServiceRemoved: function(serviceReference) { - if (serviceReference.getProperty("objectClass").indexOf("orion.edit.command") !== -1) { //$NON-NLS-1$ //$NON-NLS-2$ - this._recreateEditCommands = true; - } - }, - _onServiceAdded: function(serviceReference) { - if (serviceReference.getProperty("objectClass").indexOf("orion.edit.command") !== -1) { //$NON-NLS-1$ //$NON-NLS-2$ - this._recreateEditCommands = true; - } - if (serviceReference.getProperty("objectClass").indexOf("orion.core.contenttype") !== -1) { //$NON-NLS-1$ //$NON-NLS-2$ - contentTypesCache = null; - } - }, - _createEditCommands: function() { - var that = this; - this._recreateEditCommands = false; - - function getContentTypes(serviceRegistry) { - if (contentTypesCache) { - return contentTypesCache; - } - var contentTypeService = serviceRegistry.getService("orion.core.contentTypeRegistry"); //$NON-NLS-0$ - //TODO Shouldn't really be making service selection decisions at this level. See bug 337740 - if (!contentTypeService) { - contentTypeService = new mContentTypes.ContentTypeRegistry(serviceRegistry); - contentTypeService = serviceRegistry.getService("orion.core.contentTypeRegistry"); //$NON-NLS-0$ - } - return contentTypeService.getContentTypes().then(function(ct) { - contentTypesCache = ct; - return contentTypesCache; - }); - } - - // add the commands generated by plug-ins who implement the "orion.edit.command" extension. - // - // Note that the shape of the "orion.edit.command" extension is not in any shape or form that could be considered final. - // We've included it to enable experimentation. Please provide feedback in the following bug: - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337766 - // - // iterate through the extension points and generate commands for each one. - var serviceRegistry = this.serviceRegistry; - var commandRegistry = this.commandService; - var actionReferences = serviceRegistry.getServiceReferences("orion.edit.command"); //$NON-NLS-0$ - var progress = serviceRegistry.getService("orion.page.progress"); //$NON-NLS-0$ - var statusService = serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$ - var handleStatus = handleStatusMessage.bind(null, serviceRegistry); - var makeCommand = function(info, service, options) { - var commandVisibleWhen = options.visibleWhen; - options.visibleWhen = function(items, data) { - var editor = data.handler.editor || that.editor; - var inputManager = data.handler.inputManager || that.inputManager; - if (!editor || !editor.installed || !inputManager) { - return false; - } - if (info.editor && editor.id && info.editor !== editor.id) { - return false; - } - if (that.inputManager.getReadOnly()) { - return false; - } - return !commandVisibleWhen || commandVisibleWhen(items); - }; - options.callback = function(data) { - var editor = this.editor || that.editor; - var inputManager = this.inputManager || that.inputManager; - //TODO should all text editors have selection? - var selection = editor.getSelection ? editor.getSelection() : {start: 0, end: 0}; - var model = editor.getModel(); - - /* - * Processes the result object from old run() API. - * @deprecated: command services should implement execute() instead. - */ - var processEditorResult = function(result) { - if (typeof result === "object" && result) { //$NON-NLS-0$ - if (result.text) { - editor.setText(result.text); - } - if (result.selection) { - if (editor.setSelection) { - editor.setSelection(result.selection.start, result.selection.end, true /*scroll to*/); - } - editor.focus(); - } - } else if (typeof result === 'string') { //$NON-NLS-0$ - editor.setText(result, selection.start, selection.end, true /*scroll to*/); - if (editor.setSelection) { - editor.setSelection(selection.start, selection.start + result.length); - } - editor.focus(); - } - }; - - var serviceCall, handleResult; - if (service.execute) { - var context = { - contentType: inputManager.getContentType(), - input: inputManager.getInput(), - offset: editor.getCaretOffset() - }; - - // Provide the quick fix command with the selected annotation - if (info.scopeId === "orion.edit.quickfix") { - context.annotation = { - start: data.userData.start, - end: data.userData.end, - title: data.userData.title, - id: data.userData.id, - data: data.userData.data - }; - // Also include other annotations with the same id - // TODO: We are using the internals of the annotation model here - // TODO We also check the model existence in commands.js - if (data.userData.doFixAll && data.userData._annotationModel){ - context.doFixAll = true; - context.annotations = []; - var allAnnotations = data.userData._annotationModel._annotations; - for (var i=0; i= min && value <= max; - } - - function TextDecoder(label, options) { - var encoding = label || "utf-8"; - if (encoding !== "utf-8" && encoding !== "utf8" && encoding !== "unicode-1-1-utf-8") { - throw new TypeError("only utf-8 supported"); - } - Object.defineProperties(this, { - encoding: { - value: encoding, - enumerable: true - }, - _fatal: { - value: options && options.fatal - }, - _saved: { - value: [], - writable: true - }, - _checkBOM: { - value: true, - writable: true - } - }); - } - TextDecoder.prototype.decode = function(input, options) { - input = (input instanceof Uint8Array) ? input : new Uint8Array(input); - var first, second, third, fourth, point; - var stream = options && options.stream; - var savedlen = this._saved.length; - var inputlen = input.length; - var offset = 0; - var used = 0; - var charCodes = new Uint16Array(inputlen + savedlen); - var written = 0; - - function onError() { - if (this._fatal) { - this._saved.length = savedlen = 0; - used = offset; - this._checkBOM = this._checkBOM || !stream; - throw new EncodingError(); - } - charCodes[written++] = 0xFFFD; - } - - if (this._checkBOM && inputlen) { - if ((savedlen + inputlen) > 2) { - for (var i = savedlen; i < 3; i++) { - this._saved.push(input[offset++]); - } - if (this._saved[0] !== 0xEF || this._saved[1] !== 0xBB || this._saved[2] !== 0xBF) { - offset = 0; - this._saved.length = savedlen; - } else { - savedlen = this._saved.length -= 3; - } - this._checkBOM = false; - } else if (stream) { - while (offset < inputlen) { - this._saved.push(input[offset++]); - } - } - } - while (offset < inputlen) { - first = savedlen > 0 ? this._saved[0] : input[offset++]; - if (first < 0x80) { - charCodes[written++] = first; - } else if (between(first, 0xC2, 0xDF)) { - if (offset === inputlen) break; - second = savedlen > 1 ? this._saved[1] : input[offset++]; - if (!between(second, 0x80, 0xBF)) { - onError(); - continue; - } - charCodes[written++] = ((first & 0x1F) << 6) | (second & 0x3F); - } else if (between(first, 0xE0, 0xEF)) { - if (offset === inputlen) break; - second = savedlen > 1 ? this._saved[1] : input[offset++]; - if ((first === 0xE0 && !between(second, 0xA0, 0xBF)) || (first === 0xED && !between(second, 0x80, 0x9F)) || !between(second, 0x80, 0xBF)) { - onError(); - continue; - } - if (offset === inputlen) break; - third = savedlen > 2 ? this._saved[2] : input[offset++]; - if (!between(third, 0x80, 0xBF)) { - onError(); - continue; - } - charCodes[written++] = ((first & 0x0F) << 12) | ((second & 0x3F) << 6) | (third & 0x3F); - } else if (between(first, 0xF0, 0xF4)) { - if (offset === inputlen) break; - second = savedlen > 1 ? this._saved[1] : input[offset++]; - if ((first === 0xF0 && !between(second, 0x90, 0xBF)) || (first === 0xF4 && !between(second, 0x80, 0x8F)) || !between(second, 0x80, 0xBF)) { - onError(); - continue; - } - if (offset === inputlen) break; - third = savedlen > 2 ? this._saved[2] : input[offset++]; - if (!between(third, 0x80, 0xBF)) { - onError(); - continue; - } - if (offset === inputlen) break; - fourth = input[offset++]; - if (!between(fourth, 0x80, 0xBF)) { - onError(); - continue; - } - point = (((first & 0x07) << 18) | ((second & 0x3F) << 12) | ((third & 0x3F) << 6) | (fourth & 0x3F)) & 0xFFFF; - charCodes[written++] = (point >> 10) | 0xD800; - charCodes[written++] = (point & 0x3FF) | 0xDC00; - } else onError(); - used = offset; - if (savedlen) { - this._saved.length = savedlen = 0; - } - } - while (used !== offset) { - this._saved.push(input[used++]); - } - this._checkBOM = this._checkBOM || !stream; - if (!stream && this._saved.length !== 0) { - throw new EncodingError(); - } - var result = []; - for (var begin = 0; begin < written; begin += 0x10000) { - result.push(String.fromCharCode.apply(null, charCodes.subarray(begin, Math.min(written, begin + 0x10000)))); - } - return result.join(""); - }; - - function TextEncoder(utfLabel) { - var encoding = utfLabel || "utf-8"; - if (encoding !== "utf-8" && encoding !== "utf8" && encoding !== "unicode-1-1-utf-8") { - throw new TypeError("only utf-8 supported"); - } - Object.defineProperties(this, { - encoding: { - value: encoding, - enumerable: true - }, - _saved: { - value: null, - writable: true - } - }); - } - TextEncoder.prototype.encode = function(input, options) { - input = String(input !== undefined ? input : ""); - var first, second, point; - var stream = options && options.stream; - var inputlen = input.length; - var offset = 0; - var utf8 = new Uint8Array(3 * (inputlen + (this._saved === null ? 0 : 1))); - var written = 0; - - while (offset < inputlen) { - if (this._saved === null) { - first = input.charCodeAt(offset++); - } else { - first = this._saved; - this._saved = null; - } - if (first < 0x80) { - utf8[written++] = first; - } else if (first < 0x800) { - utf8[written++] = 0xC0 | (first >> 6); - utf8[written++] = 0x80 | (first & 0x3F); - } else if (first < 0xD800 || first > 0xDBFF) { - utf8[written++] = 0xE0 | (first >> 12); - utf8[written++] = 0x80 | ((first >> 6) & 0x3F); - utf8[written++] = 0x80 | (first & 0x3F); - } else { - if (offset < inputlen) { - second = input.charCodeAt(offset++); - } else if (stream) { - this._saved = first; - break; - } else throw new EncodingError(); - if (!between(second, 0xDC00, 0xDFFF)) { - throw new EncodingError(); - } - point = 0x10000 | ((first & 0x03FF) << 10) | (second & 0x03FF); - utf8[written++] = 0xF0 | (point >> 18); - utf8[written++] = 0x80 | ((point >> 12) & 0x3F); - utf8[written++] = 0x80 | ((point >> 6) & 0x3F); - utf8[written++] = 0x80 | (point & 0x3F); - } - } - if (!stream && this._saved !== null) { - throw new EncodingError(); - } - return utf8.buffer.slice ? new Uint8Array(utf8.buffer.slice(0, written)) : utf8.subarray(0, written); - }; - - global.TextDecoder = global.TextDecoder || TextDecoder; - global.TextEncoder = global.TextEncoder || TextEncoder; -}((typeof global === "undefined") ? this || self : global)); -define("orion/encoding-shim", function(){}); - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -/*global URL*/ -define('embeddedEditor/helper/embeddedFileImpl',["orion/Deferred", 'embeddedEditor/helper/memoryFileSysConst', "orion/encoding-shim", "orion/URL-shim"], function(Deferred, memoryFileSysConst) { - function EmbeddedFileImpl(fileBase) { - this.fileBase = fileBase; - this.fileRoot = {}; - this.fileRoot[memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN] = {Location: memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN, Directory: true}; - } - - EmbeddedFileImpl.prototype = { - fetchChildren: function(/*fLocation*/) { - return new Deferred().resolve([]); - }, - loadWorkspaces: function() { - return new Deferred().resolve([]); - }, - loadWorkspace: function(/*fLocation*/) { - return new Deferred().resolve([]); - }, - createProject: function(/*url, projectName, serverPath, create*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - createFolder: function(/*parentLocation, folderName*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - createFile: function(parentLocation, fileName) { - var fileLocation = parentLocation + fileName; - this._getFile(fileLocation, true); - return this.read(fileLocation, true); - }, - moveFile: function(/*sourceLocation, targetLocation, name*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - copyFile: function(/*sourceLocation, targetLocation, name*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - remoteImport: function(/*targetLocation, options*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - remoteExport: function(/*sourceLocation, options) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - readBlob: function(/*fLocation*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - writeBlob: function(/*fLocation, contents, args*/) { - throw new Error("Not supported"); //$NON-NLS-0$ - }, - _getFile: function(fLocation, create) { - var locationURL = new URL(fLocation); - var filePath = locationURL.pathname; - if (this.fileRoot[filePath] === undefined && create) { - this.fileRoot[filePath] = { - Name: locationURL.pathname.split("/").pop(), - Location: filePath, - LocalTimeStamp: Date.now(), - ETag: 0 - }; - } - return this.fileRoot[filePath]; - }, - /** - * Returns the contents or metadata of the file at the given location. - * - * @param {String} location The location of the file to get contents for - * @param {Boolean} [isMetadata] If defined and true, returns the file metadata, - * otherwise file contents are returned - * @return A deferred that will be provided with the contents or metadata when available - */ - read: function(fLocation, isMetadata) { - var file = this._getFile(fLocation); - if (file === undefined) { - return new Deferred().resolve(isMetadata ? {} : ""); - } - if(isMetadata){ - var parents = fLocation === memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN ? [] : [this.fileRoot[memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN]]; - var meta = { - Length: file.length, - Directory: !!file.Directory, - LocalTimeStamp: file.LocalTimeStamp, - ETag: file.ETag, - Location: file.Location, - Name: file.Name, - Parents: parents - }; - return new Deferred().resolve(meta); - } - return new Deferred().resolve(file.contents); - }, - /** - * Writes the contents or metadata of the file at the given location. - * - * @param {String} location The location of the file to set contents for - * @param {String|Object} contents The content string, object describing the location of content, or a metadata object to write - * @param {String|Object} args Additional arguments used during write operation (i.e. ETag) - * @return A deferred for chaining events after the write completes with new metadata object - */ - write: function(fLocation, contents, args) { - var file = this._getFile(fLocation, true); - if (typeof contents === "string") { - file.ETag++; - file.LocalTimeStamp = Date.now(); - file.contents = contents; - } - return this.read(fLocation, true); - }, - /** - * Deletes a file, directory, or project. - * @param {String} location The location of the file or directory to delete. - */ - deleteFile: function(fLocation) { - var locationURL = new URL(fLocation); - var filePath = locationURL.pathname; - delete this.fileRoot[filePath]; - return new Deferred().resolve(); - } - }; - EmbeddedFileImpl.prototype.constructor = EmbeddedFileImpl; - - return EmbeddedFileImpl; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* eslint-disable missing-nls */ -/*eslint-env browser, amd*/ -/*global URL*/ -define('orion/pluginregistry',["orion/Deferred", "orion/EventTarget", "orion/URL-shim"], function(Deferred, EventTarget) { - - function _equal(obj1, obj2) { - var keys1 = Object.keys(obj1); - var keys2 = Object.keys(obj2); - if (keys1.length !== keys2.length) { - return false; - } - keys1.sort(); - keys2.sort(); - for (var i = 0, len = keys1.length; i < len; i++) { - var key = keys1[i]; - if (key !== keys2[i]) { - return false; - } - var value1 = obj1[key], - value2 = obj2[key]; - if (value1 === value2) { - continue; - } - if (JSON.stringify(value1) !== JSON.stringify(value2)) { - return false; - } - } - return true; - } - - function _mixin(target/*, source..*/) { - var hasOwnProperty = Object.prototype.hasOwnProperty; - for (var j = 1, len = arguments.length; j < len; j++) { - var source = arguments[j]; - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - } - - var httpOrHttps = new RegExp("^http[s]?", "i"); - - function _normalizeURL(url) { - if (url.indexOf("://") === -1) { //$NON-NLS-0$ - try { - return new URL(url, location.href).href; - } catch (e) { - // URL SyntaxError, etc. - } - } - return url; - } - - function _asStorage(obj) { - var _keys = null; - - function _getKeys() { - return (_keys = _keys || Object.keys(obj)); - } - - var result = { - key: function(index) { - return _getKeys()[index]; - }, - getItem: function(key) { - return obj[key]; - }, - setItem: function(key, value) { - obj[key] = value; - _keys = null; - }, - removeItem: function(key) { - delete obj[key]; - _keys = null; - }, - clear: function() { - _getKeys().forEach(function(key) { - delete obj[key]; - }.bind(this)); - _keys = null; - } - }; - Object.defineProperty(result, "length", { - get: function() { - return _getKeys().length; - } - }); - return result; - } - - function _jsonXMLHttpRequestReplacer(name, value) { - if (value && value instanceof XMLHttpRequest) { - var status, statusText; - try { - status = value.status; - statusText = value.statusText; - } catch (e) { - // https://bugs.webkit.org/show_bug.cgi?id=45994 - status = 0; - statusText = ""; //$NON-NLS-0 - } - return { - status: status || 0, - statusText: statusText - }; - } - return value; - } - - function _serializeError(error) { - var result = error ? JSON.parse(JSON.stringify(error, _jsonXMLHttpRequestReplacer)) : error; // sanitizing Error object - if (error instanceof Error) { - result.__isError = true; - result.message = result.message || error.message; - result.name = result.name || error.name; - } - return result; - } - - function PluginEvent(type, plugin) { - this.type = type; - this.plugin = plugin; - } - - function ObjectReference(objectId, methods) { - this.__objectId = objectId; - this.__methods = methods; - } - - /** - * Creates a new plugin. This constructor is private and should only be called by the plugin registry. - * @class Represents a single plugin in the plugin registry. - * @description - *

      At any given time, a plugin is in exactly one of the following six states:

      - * - *
      - * - *
      "uninstalled"
      - *
      The plugin has been uninstalled and may not be used. - *

      The uninstalled state is only visible after a plugin has been uninstalled; the plugin is unusable, but - * references to its Plugin object may still be available and used for introspection. - *

      - * - *
      "installed"
      - *
      The plugin is installed, but not yet resolved. - *

      - *
      - * - *
      "resolved"
      - *
      The plugin is resolved and is able to be started. - *

      Note that the plugin is not active yet. A plugin must be in the resolved state before it can be started.

      - *

      The resolved state is reserved for future use. Future versions of the framework may require successful - * dependency resolution before moving a plugin to the resolved state.

      - *
      - * - *
      "starting"
      - *
      The plugin is in the process of starting. - *

      A plugin is in the starting state when its {@link #start} method has been called but has not yet resolved. - * Once the start call resolves, the plugin has successfully started and moves to the active state.

      - *

      If the plugin has a lazy activation policy, it may remain in the starting state for some time until the - * activation is triggered.

      - *
      - * - *
      "stopping"
      - *
      The plugin is in the process of stopping. - *

      A plugin is in the stopping state when its {@link #stop} method has been called but not yet resolved. - * Once the stop call resolves, the plugin moves to the resolved state.

      - * - *
      "active"
      - *
      The plugin is running. It has been successfully started and activated. - *

      In the active state, any services the plugin provides are available for use.

      - * - *
      - * - * @name orion.pluginregistry.Plugin - */ - function Plugin(_url, _manifest, _internalRegistry) { - var _this = this; - _manifest = _manifest || {}; - var _created = _manifest.created || new Date().getTime(); - var _headers = _manifest.headers || {}; - var _services = _manifest.services || []; - var _autostart = _manifest.autostart; - var _lastModified = _manifest.lastModified || 0; - - var _state = "installed"; - - var _deferredStateChange; - var _deferredLoad; - - var _channel; - var _parent; - var _remoteServices = {}; - - var _currentMessageId = 0; - var _currentObjectId = 0; - - var _requestReferences = {}; - var _responseReferences = {}; - var _objectReferences = {}; - var _serviceReferences; - - - function _notify(message) { - if (!_channel) { - return; - } - _internalRegistry.postMessage(message, _channel); - } - - function _request(message) { - if (!_channel) { - return new Deferred().reject(new Error("plugin not connected")); - } - - message.id = String(_currentMessageId++); - var d = new Deferred(); - _responseReferences[message.id] = d; - d.then(null, function(error) { - if (_state === "active" && error instanceof Error && error.name === "Cancel") { - _notify({ - requestId: message.id, - method: "cancel", - params: error.message ? [error.message] : [] - }); - } - }); - - var toStr = Object.prototype.toString; - message.params.forEach(function(param, i) { - if (toStr.call(param) === "[object Object]" && !(param instanceof ObjectReference)) { - var candidate, methods; - for (candidate in param) { - if (toStr.call(param[candidate]) === "[object Function]") { - methods = methods || []; - methods.push(candidate); - } - } - if (methods) { - var objectId = _currentObjectId++; - _objectReferences[objectId] = param; - var removeReference = function() { - delete _objectReferences[objectId]; - }; - d.then(removeReference, removeReference); - message.params[i] = new ObjectReference(objectId, methods); - } - } - }); - _internalRegistry.postMessage(message, _channel); - return d.promise; - } - - function _throwError(messageId, error) { - if (messageId || messageId === 0) { - _notify({ - id: messageId, - result: null, - error: error - }); - } else { - console.log(error); - } - } - - function _callMethod(messageId, implementation, method, params) { - params.forEach(function(param, i) { - if (param && typeof param.__objectId !== "undefined") { - var obj = {}; - param.__methods.forEach(function(method) { - obj[method] = function() { - return _request({ - objectId: param.__objectId, - method: method, - params: Array.prototype.slice.call(arguments) - }); - }; - }); - params[i] = obj; - } - }); - - var response = typeof messageId === "undefined" ? null : { - id: messageId, - result: null, - error: null - }; - try { - var promiseOrResult = method.apply(implementation, params); - if (!response) { - return; - } - - if (promiseOrResult && typeof promiseOrResult.then === "function") { //$NON-NLS-0$ - _requestReferences[messageId] = promiseOrResult; - promiseOrResult.then(function(result) { - delete _requestReferences[messageId]; - response.result = result; - _notify(response); - }, function(error) { - if (_requestReferences[messageId]) { - delete _requestReferences[messageId]; - response.error = _serializeError(error); - _notify(response); - } - }, function() { - _notify({ - responseId: messageId, - method: "progress", - params: Array.prototype.slice.call(arguments) - }); //$NON-NLS-0$ - }); - } else { - response.result = promiseOrResult; - _notify(response); - } - } catch (error) { - if (response) { - response.error = _serializeError(error); - _notify(response); - } - } - } - - - var _update; // this is a forward reference to a function declared above this.update - - function _messageHandler(message) { - try { - if (message.method) { // request - var method = message.method, - params = message.params || []; - if ("serviceId" in message) { - var service = _serviceReferences[message.serviceId]; - if (!service) { - _throwError(message.id, "service not found"); - } else if (_isTrusted(service)) { - var serviceRegistry = _internalRegistry.serviceRegistry; - service = serviceRegistry.getService(service); - if (method in service) { - _callMethod(message.id, service, service[method], params); - } else { - _throwError(message.id, "method not found"); - } - } else { - _throwError(message.id, "not trusted"); - } - } else if ("objectId" in message) { - var object = _objectReferences[message.objectId]; - if (!object) { - _throwError(message.id, "object not found"); - } else if (method in object) { - _callMethod(message.id, object, object[method], params); - } else { - _throwError(message.id, "method not found"); - } - } else if ("requestId" in message) { - var request = _requestReferences[message.requestId]; - if (request && method === "cancel" && request.cancel) { - request.cancel.apply(request, params); - } - } else if ("responseId" in message) { - var response = _responseReferences[message.responseId]; - if (response && method === "progress" && response.progress) { - response.progress.apply(response, params); - } - } else if ("loading" === message.method) { - _channel.loading(); - } else { - if ("plugin" === message.method) { //$NON-NLS-0$ - _channel.connected(); - var manifest = message.params[0]; - _update({ - headers: manifest.headers, - services: manifest.services - }).then(function() { - if (_deferredLoad) { - _deferredLoad.resolve(_this); - } - }); - if (manifest.updateRegistry) { - _updateRemoteRegistry(); - } - } else if ("timeout" === message.method || "error" === message.method) { - if (_deferredLoad) { - _deferredLoad.reject(message.error); - } - } else { - throw new Error("Bad method: " + message.method); - } - } - } else if (message.id) { - var deferred = _responseReferences[String(message.id)]; - if (deferred) { - delete _responseReferences[String(message.id)]; - if (message.error) { - var error = _internalRegistry.handleServiceError(_this, message.error); - deferred.reject(error); - } else { - deferred.resolve(message.result); - } - } - } - } catch (e) { - console.log("Plugin._messageHandler " + e); - } - } - - function _createServiceProxy(service) { - var serviceProxy = {}; - if (service.methods) { - service.methods.forEach(function(method) { - serviceProxy[method] = function() { - var message = { - serviceId: service.serviceId, - method: method, - params: Array.prototype.slice.call(arguments) - }; - if (_state === "active") { - return _request(message); - } else { - return _this.start({ - "transient": true - }).then(function() { - return _request(message); - }); - } - }; - }); - - if (serviceProxy.addEventListener && serviceProxy.removeEventListener) { - var eventTarget = new EventTarget(); - var objectId = _currentObjectId++; - _objectReferences[objectId] = { - handleEvent: eventTarget.dispatchEvent.bind(eventTarget) - }; - var listenerReference = new ObjectReference(objectId, ["handleEvent"]); - - var _addEventListener = serviceProxy.addEventListener; - serviceProxy.addEventListener = function(type, listener) { - if (!eventTarget._namedListeners[type]) { - _addEventListener(type, listenerReference); - } - eventTarget.addEventListener(type, listener); - }; - var _removeEventListener = serviceProxy.removeEventListener; - serviceProxy.removeEventListener = function(type, listener) { - eventTarget.removeEventListener(type, listener); - if (!eventTarget._namedListeners[type]) { - _removeEventListener(type, listenerReference); - } - }; - } - } - return serviceProxy; - } - - function _createServiceProperties(service) { - var properties = JSON.parse(JSON.stringify(service.properties)); - properties.__plugin__ = _url; //TODO: eliminate - var objectClass = service.names || service.type || []; - if (!Array.isArray(objectClass)) { - objectClass = [objectClass]; - } - properties.objectClass = objectClass; - return properties; - } - - function _registerService(service) { - var serviceProxy = _createServiceProxy(service); - var properties = _createServiceProperties(service); - var registration = _internalRegistry.registerService(service.names || service.type, serviceProxy, properties); - _remoteServices[service.serviceId] = { - registration: registration, - proxy: serviceProxy - }; - } - - function _getPluginData() { - var services = []; - Object.keys(_serviceReferences).forEach(function(serviceId) { - var serviceReference = _serviceReferences[serviceId]; - var properties = {}; - serviceReference.getPropertyKeys().forEach(function(key) { - properties[key] = serviceReference.getProperty(key); - }); - ["service.id", "service.names", "objectClass", "__plugin__"].forEach(function(key) { - delete properties[key]; - }); - var methods = []; - var serviceRegistry = _internalRegistry.serviceRegistry; - var implementation = serviceRegistry.getService(serviceReference); - for (var method in implementation) { - if (typeof implementation[method] === 'function') { - methods.push(method); - } - } - services.push({ - serviceId: String(serviceReference.getProperty('service.id')), - names: serviceReference.getProperty('service.names'), - methods: methods, - properties: properties - }); - }); - return { - services: services - }; - } - - function _isTrusted(serviceReference) { - var pluginUrl = new URL(_url); - // if plugin is from same origin of host page, it has access to all references - if (pluginUrl.origin === location.origin) return true; - var refUrl = serviceReference.getProperty("__plugin__"); - // if plugin is from same origin of reference, it has access to this reference - return pluginUrl.origin === (refUrl ? new URL(refUrl) : location).origin; - } - - var _registerListener, _unregisterListener, _modifiedListerner; - function _updateRemoteRegistry() { - if (!_serviceReferences) { - _serviceReferences = {}; - var serviceRegistry = _internalRegistry.serviceRegistry; - serviceRegistry.getServiceReferences().forEach(function(serviceReference) { - if (_isTrusted(serviceReference)) { - _serviceReferences[serviceReference.getProperty('service.id')] = serviceReference; - } - }); - function updateReference(add, remove, evt) { - var serviceReference = evt.serviceReference; - var id = serviceReference.getProperty('service.id'); - if (!_serviceReferences[id] && _isTrusted(serviceReference)) { - if (add) _serviceReferences[id] = serviceReference; - if (remove) delete _serviceReferences[id]; - _updateRemoteRegistry(); - } - } - serviceRegistry.addEventListener("registered", _registerListener = updateReference.bind(null, true, false)); - serviceRegistry.addEventListener("unregistered", _unregisterListener = updateReference.bind(null, false, true)); - serviceRegistry.addEventListener("modified", _modifiedListerner = updateReference.bind(null, false, false)); - } - _request({ - method: "plugin", - params: [_getPluginData()] - }); - } - - function _removeListeners() { - var serviceRegistry = _internalRegistry.serviceRegistry; - if (_registerListener) serviceRegistry.removeEventListener("registered", _registerListener); - if (_unregisterListener) serviceRegistry.removeEventListener("unregistered", _unregisterListener); - if (_modifiedListerner) serviceRegistry.removeEventListener("modified", _modifiedListerner); - _registerListener = _unregisterListener = _modifiedListerner = null; - } - - function _persist() { - _internalRegistry.persist(_url, { - created: _created, - headers: _headers, - services: _services, - autostart: _autostart, - lastModified: _lastModified - }); - } - - this._default = false; // used to determine if a plugin is part of the configuration - - this._persist = _persist; - - this._resolve = function() { - // check manifest dependencies when we support them - _state = "resolved"; - _internalRegistry.dispatchEvent(new PluginEvent("resolved", _this)); - }; - - this._getAutostart = function() { - return _autostart; - }; - - this._getCreated = function() { - return _created; - }; - - /** - * Returns the URL location of this plugin. - * @name orion.pluginregistry.Plugin#getLocation - * @return {String} The URL of this plugin. - * @function - */ - this.getLocation = function() { - return _url; - }; - - /** - * Returns the headers of this plugin. - * @name orion.pluginregistry.Plugin#getHeaders - * @return {Object} The plugin headers. - * @function - */ - this.getHeaders = function() { - return JSON.parse(JSON.stringify(_headers)); - }; - - this.getName = function() { - var headers = this.getHeaders(); - if (headers) { - return headers.name || ""; - } - return null; - }; - - this.getVersion = function() { - var headers = this.getHeaders(); - if (headers) { - return headers.version || "0.0.0"; - } - return null; - }; - - this.getLastModified = function() { - return _lastModified; - }; - - /** - * Returns the service references provided by this plugin. - * @name orion.pluginregistry.Plugin#getServiceReferences - * @return {orion.serviceregistry.ServiceReference[]} The service references provided by this plugin. - * @function - */ - this.getServiceReferences = function() { - var result = []; - Object.keys(_remoteServices).forEach(function(serviceId) { - result.push(_remoteServices[serviceId].registration.getReference()); - }); - return result; - }; - - /** - * Sets the parent of this plugin. - * @name orion.pluginregistry.Plugin#setParent - * @param {DOMElement} [parent=null] the plugin parent. null puts the plugin in the default parent of the plugin registry - * @return {orion.Promise} A promise that will resolve when the plugin parent has been set. - * @function - */ - this.setParent = function(parent) { - if (_parent !== parent) { - _parent = parent; - return _this.stop({ - "transient": true - }).then(function() { - if ("started" === _autostart) { - return _this.start({ - "transient": true - }); - } else if ("lazy" === _autostart) { - return _this.start({ - "lazy": true, - "transient": true - }); - } - }); - } - return new Deferred().resolve(); - }; - - /** - * Returns this plugin's current state. - * @name orion.pluginregistry.Plugin#getState - * @returns {String} This plugin's state. - * @function - */ - this.getState = function() { - return _state; - }; - - /** - * @name orion.pluginregistry.Plugin#getProblemLoading - * @description Returns true if there was a problem loading this plug-in, false otherwise. This function is not API and may change in future releases. - * @private - * @function - * @returns {String} Return an true if there was a problem loading this plug-in. - */ - this.getProblemLoading = function() { - if (_this._problemLoading){ - return true; - } - return false; - }; - - this.start = function(optOptions) { - if (_state === "uninstalled") { - return new Deferred().reject(new Error("Plugin is uninstalled")); - } - - if (_deferredStateChange) { - return _deferredStateChange.promise.then(this.start.bind(this, optOptions)); - } - - if (_state === "active") { - return new Deferred().resolve(); - } - - if (!optOptions || !optOptions.transient) { - var autostart = optOptions && optOptions.lazy ? "lazy" : "started"; - if (autostart !== _autostart) { - _autostart = autostart; - _persist(); - } - } - - var frameworkState = _internalRegistry.getState(); - if (frameworkState !== "starting" && frameworkState !== "active") { - if (optOptions.transient) { - return new Deferred().reject(new Error("start transient error")); - } - return new Deferred().resolve(); - } - - if (_state === "installed") { - try { - this._resolve(); - } catch (e) { - return new Deferred().reject(e); - } - } - - if (_state === "resolved") { - _services.forEach(function(service) { - _registerService(service); - }); - } - - if (optOptions && optOptions.lazy) { - if (_state !== "starting") { - _state = "starting"; - _internalRegistry.dispatchEvent(new PluginEvent("lazy activation", _this)); - } - var now = new Date().getTime(); - if (!this.getLastModified() || now > this.getLastModified() + 86400000) { // 24 hours - return this.update(); - } - return new Deferred().resolve(); - } - - var deferredStateChange = new Deferred(); - _deferredStateChange = deferredStateChange; - _state = "starting"; - _this._problemLoading = null; - _internalRegistry.dispatchEvent(new PluginEvent("starting", _this)); - _deferredLoad = new Deferred(); - _channel = _internalRegistry.connect(_url, _messageHandler, _parent); - _deferredLoad.then(function() { - _deferredLoad = null; - _state = "active"; - _internalRegistry.dispatchEvent(new PluginEvent("started", _this)); - _deferredStateChange = null; - deferredStateChange.resolve(); - }, function(error) { - _deferredLoad = null; - _state = "stopping"; - _internalRegistry.dispatchEvent(new PluginEvent("stopping", _this)); - Object.keys(_remoteServices).forEach(function(serviceId) { - _remoteServices[serviceId].registration.unregister(); - delete _remoteServices[serviceId]; - }); - _internalRegistry.disconnect(_channel); - _channel = null; - _state = "resolved"; - _deferredStateChange = null; - _internalRegistry.dispatchEvent(new PluginEvent("stopped", _this)); - _this._problemLoading = true; - deferredStateChange.reject(new Error("Failed to load plugin: " + _url + (error && error.message ? "\n Reason: " + error.message : ""))); - if (_this._default) { - _lastModified = 0; - _persist(); - } - }); - return deferredStateChange.promise; - }; - - this.stop = function(optOptions) { - if (_state === "uninstalled") { - return new Deferred().reject(new Error("Plugin is uninstalled")); - } - - if (_deferredStateChange) { - return _deferredStateChange.promise.then(this.stop.bind(this, optOptions)); - } - - if (!optOptions || !optOptions.transient) { - if ("stopped" !== _autostart) { - _autostart = "stopped"; - _persist(); - } - } - - if (_state !== "active" && _state !== "starting") { - return new Deferred().resolve(); - } - - var deferredStateChange = new Deferred(); - _deferredStateChange = deferredStateChange; - - _state = "stopping"; - _internalRegistry.dispatchEvent(new PluginEvent("stopping", _this)); - Object.keys(_remoteServices).forEach(function(serviceId) { - _remoteServices[serviceId].registration.unregister(); - delete _remoteServices[serviceId]; - }); - if (_channel) { - _internalRegistry.disconnect(_channel); - _channel = null; - _removeListeners(); - } - _state = "resolved"; - _deferredStateChange = null; - _internalRegistry.dispatchEvent(new PluginEvent("stopped", _this)); - deferredStateChange.resolve(); - - return deferredStateChange.promise; - }; - - _update = function(input) { - _this.problemLoading = null; - - if (_state === "uninstalled") { - return new Deferred().reject(new Error("Plugin is uninstalled")); - } - - if (!input) { - if (_lastModified === 0) { - _lastModified = new Date().getTime(); - _persist(); - } - return _internalRegistry.loadManifest(_url).then(_update, function() { - _this._problemLoading = true; - if (_this._default) { - _lastModified = 0; - _persist(); - } - console.log("Failed to load plugin: " + _url); - }); - } - - var oldHeaders = _headers; - var oldServices = _services; - var oldAutostart = _autostart; - _headers = input.headers || {}; - _services = input.services || []; - _autostart = input.autostart || _autostart; - - if (input.lastModified) { - _lastModified = input.lastModified; - } else { - _lastModified = new Date().getTime(); - _persist(); - } - - if (_equal(_headers, oldHeaders) && _equal(_services, oldServices) && _autostart === oldAutostart) { - return new Deferred().resolve(); - } - - if (_state === "active" || _state === "starting") { - var serviceIds = []; - Object.keys(_services).forEach(function(serviceId) { - var service = _services[serviceId]; - serviceIds.push(serviceId); - var remoteService = _remoteServices[serviceId]; - if (remoteService) { - if (_equal(service.methods, Object.keys(remoteService.proxy))) { - var properties = _createServiceProperties(service); - var reference = remoteService.registration.getReference(); - var currentProperties = {}; - reference.getPropertyKeys().forEach(function(name) { - currentProperties[name] = reference.getProperty(name); - }); - if (!_equal(properties, currentProperties)) { - remoteService.registration.setProperties(properties); - } - return; - } - remoteService.registration.unregister(); - delete _remoteServices[serviceId]; - } - _registerService(service); - }); - Object.keys(_remoteServices).forEach(function(serviceId) { - if (serviceIds.indexOf(serviceId) === -1) { - _remoteServices[serviceId].registration.unregister(); - delete _remoteServices[serviceId]; - } - }); - } - - if (_state === "active") { - _internalRegistry.disconnect(_channel); - _deferredLoad = new Deferred(); - _channel = _internalRegistry.connect(_url, _messageHandler, _parent); - _deferredLoad.then(function() { - _deferredLoad = null; - }, function() { - _deferredLoad = null; - _state = "stopping"; - _internalRegistry.dispatchEvent(new PluginEvent("stopping"), _this); - Object.keys(_remoteServices).forEach(function(serviceId) { - _remoteServices[serviceId].registration.unregister(); - delete _remoteServices[serviceId]; - }); - _internalRegistry.disconnect(_channel); - _channel = null; - _state = "resolved"; - _internalRegistry.dispatchEvent(new PluginEvent("stopped", _this)); - }); - } - return new Deferred().resolve(); - }; - - this.update = function(input) { - return _update(input).then(function() { - _internalRegistry.dispatchEvent(new PluginEvent("updated", _this)); - }); - }; - - /** - * Uninstalls this plugin. - * @name orion.pluginregistry.Plugin#uninstall - * @return {orion.Promise} A promise that will resolve when the plugin has been uninstalled. - * @function - */ - this.uninstall = function() { - if (_state === "uninstalled") { - return new Deferred().reject(new Error("Plugin is uninstalled")); - } - - if (_state === "active" || _state === "starting" || _state === "stopping") { - return this.stop().then(this.uninstall.bind(this), this.uninstall.bind(this)); - } - - _internalRegistry.removePlugin(this); - _state = "uninstalled"; - _internalRegistry.dispatchEvent(new PluginEvent("uninstalled", _this)); - return new Deferred().resolve(); - }; - } - - var workerRegex = /Worker\.js$/; - var sharedWorkerRegex = /SharedWorker\.js$/; - var pluginHtml = "Plugin.html"; //$NON-NLS-0$ - var workerJS = "Worker.js"; //$NON-NLS-0$ - - /** - * Dispatched when a plugin has been installed. The type of this event is "installed". - * @name orion.pluginregistry.PluginRegistry#installed - * @event - */ - /** - * Dispatched when a plugin has been resolved. The type of this event is "resolved". - * @name orion.pluginregistry.PluginRegistry#resolved - * @event - */ - /** - * Dispatched when a plugin is starting due to a lazy activation. The type of this event is "lazy activation". - * @name orion.pluginregistry.PluginRegistry#lazy_activation - * @event - */ - /** - * Dispatched when a plugin is starting. The type of this event is "starting". - * @name orion.pluginregistry.PluginRegistry#starting - * @event - */ - /** - * Dispatched when a plugin is started. The type of this event is "started". - * @name orion.pluginregistry.PluginRegistry#started - * @event - */ - /** - * Dispatched when a plugin is stopping. The type of this event is "stopping". - * @name orion.pluginregistry.PluginRegistry#stopping - * @event - */ - /** - * Dispatched when a plugin is stopped. The type of this event is "stopped". - * @name orion.pluginregistry.PluginRegistry#stopped - * @event - */ - /** - * Dispatched when a plugin has been updated. The type of this event is "updated". - * @name orion.pluginregistry.PluginRegistry#updated - * @event - */ - /** - * Dispatched when a plugin has been uninstalled. The type of this event is "uninstalled". - * @name orion.pluginregistry.PluginRegistry#uninstalled - * @event - */ - - /** - * Creates a new plugin registry. - * @class The Orion plugin registry - * @name orion.pluginregistry.PluginRegistry - * @description The plugin registry maintains a list of {@link orion.pluginregistry.Plugin}s, which can provide services - * to the given serviceRegistry. - * - *

      The plugin registry dispatches plugin events when one of its plugins changes state. Each such event contains a - * plugin field giving the affected {@link orion.pluginregistry.Plugin}. - *

      - * - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry The service registry to register plugin-provided services with. - * @param {Object} [opt_storage=localStorage] Target object to read and write plugin metadata from. - * @param {Boolean} [opt_visible=false] Whether a loaded plugin's iframe will be displayed. By default it is not displayed. - * @borrows orion.serviceregistry.EventTarget#addEventListener as #addEventListener - * @borrows orion.serviceregistry.EventTarget#removeEventListener as #removeEventListener - */ - function PluginRegistry(serviceRegistry, configuration) { - configuration = configuration || {}; - var _storage = configuration.storage || localStorage; - if (!_storage.getItem) { - _storage = _asStorage(_storage); - } - var _defaultTimeout = parseInt(_storage.getItem("pluginregistry.default.timeout"), 10) || undefined; - var _state = "installed"; - var _parent; - var _plugins = []; - var _channels = []; - var _pluginEventTarget = new EventTarget(); - var _installing = {}; - - var internalRegistry = { - serviceRegistry: serviceRegistry, - registerService: serviceRegistry.registerService.bind(serviceRegistry), - connect: function(url, handler, parent, timeout) { - var channel = { - handler: handler, - url: url - }; - - function log(state) { - if (localStorage.pluginLogging) console.log(state + "(" + (new Date().getTime() - channel._startTime) + "ms)=" + url); //$NON-NLS-1$ //$NON-NLS-0$ - } - - function sendTimeout(message) { - log("timeout"); //$NON-NLS-0$ - var error = new Error(message); - error.name = "timeout"; - handler({ - method: "timeout", - error: error - }); - } - - timeout = timeout || _defaultTimeout; - - channel._updateTimeout = function() { - var message, newTimeout; - if (!this._connected && !this._closed) { - if (this._handshake) { - // For each plugin being loaded add 1000 ms extra time to the handshake timeout - var extraTimeout = 0; - _channels.forEach(function(c) { - if (!c._connected && !c._closed) { - extraTimeout += 1000; - } - }); - message = "Plugin handshake timeout for: " + url; - newTimeout = this._loading ? 5000 : (timeout || 60000) + extraTimeout; - } else { - message = "Plugin load timeout for: " + url; - newTimeout = timeout || 15000; - } - } - if (this._loadTimeout) clearTimeout(this._loadTimeout); - this._loadTimeout = 0; - if (newTimeout) this._loadTimeout = setTimeout(sendTimeout.bind(null, message), newTimeout); - }; - - var isWorker = !!(url.match(workerRegex) && typeof(Worker) !== "undefined"); - var isSharedWorker = !!(url.match(sharedWorkerRegex) && typeof(SharedWorker) !== "undefined"); - if ((!localStorage.useSharedWorkers || !isSharedWorker) && url.match(sharedWorkerRegex)) { - url = url.replace(sharedWorkerRegex, workerJS); - isSharedWorker = false; - } - if ((!localStorage.useWorkers || !isWorker) && url.match(workerRegex)) { - url = url.replace(workerRegex, pluginHtml); - isWorker = isSharedWorker = false; - } - - channel.url = url; - channel._updateTimeout(); - channel._startTime = new Date().getTime(); - if (isWorker) { - var worker; - if (isSharedWorker) { - worker = new SharedWorker(url); - channel.target = worker.port; - worker.port.start(); - channel._close = function() { - worker.port.close(); - }; - } else { - worker = new Worker(url); - channel.target = worker; - channel._close = function() { - worker.terminate(); - }; - } - channel.postMessage = function(message) { - this.target.postMessage((this.useStructuredClone ? message : JSON.stringify(message)), []); - }; - channel.target.addEventListener("message", function(evt) { - _channelHandler(channel, evt); - }); - } else { - var iframe = document.createElement("iframe"); //$NON-NLS-0$ - iframe.name = url + "_" + channel._startTime; - iframe.src = url; - iframe.onload = function() { - log("handshake"); //$NON-NLS-0$ - channel._handshake = true; - channel._updateTimeout(); - }; - iframe.sandbox = "allow-scripts allow-same-origin allow-forms allow-popups"; //$NON-NLS-0$ - iframe.style.width = iframe.style.height = "100%"; //$NON-NLS-0$ - iframe.frameBorder = 0; - (parent || _parent).appendChild(iframe); - channel.target = iframe.contentWindow; - channel.postMessage = function(message) { - this.target.postMessage((this.useStructuredClone ? message : JSON.stringify(message)), this.url); - }; - channel._close = function() { - if (iframe) { - var frameParent = iframe.parentNode; - if (frameParent) { - frameParent.removeChild(iframe); - } - iframe = null; - } - }; - } - channel.connected = function() { - log("connected"); //$NON-NLS-0$ - this._connected = true; - this._updateTimeout(); - - }; - channel.loading = function() { - log("loading"); //$NON-NLS-0$ - this._loading = true; - this._updateTimeout(); - }; - channel.close = function() { - log("closed"); //$NON-NLS-0$ - this._closed = true; - this._updateTimeout(); - this._close(); - }; - _channels.push(channel); - return channel; - }, - disconnect: function(channel) { - for (var i = 0; i < _channels.length; i++) { - if (channel === _channels[i]) { - _channels.splice(i, 1); - try { - channel.close(); - } catch (e) { - // best effort - } - break; - } - } - }, - removePlugin: function(plugin) { - for (var i = 0; i < _plugins.length; i++) { - if (plugin === _plugins[i]) { - _plugins.splice(i, 1); - break; - } - } - _storage.removeItem("plugin." + plugin.getLocation()); - }, - getPersisted: function(url) { - var key = "plugin." + url; - var manifest = _storage.getItem(key); - if (manifest) { - manifest = JSON.parse(manifest); - if (manifest.created) { - return manifest; - } - } - return null; - }, - persist: function(url, manifest) { - _storage.setItem("plugin." + url, JSON.stringify(manifest)); //$NON-NLS-0$ - }, - postMessage: function(message, channel) { - channel.postMessage(message); - }, - dispatchEvent: function(event) { - try { - _pluginEventTarget.dispatchEvent(event); - } catch (e) { - if (console) { - console.log("PluginRegistry.dispatchEvent " + e); - } - } - }, - loadManifest: function(url) { - var d = new Deferred(); - var channel = internalRegistry.connect(url, function(message) { - if (!channel || !message.method) { - return; - } - if ("manifest" === message.method || "plugin" === message.method) { //$NON-NLS-0$ - var manifest = message.params[0]; - internalRegistry.disconnect(channel); - channel = null; - d.resolve(manifest); - } else if ("timeout" === message.method || "error" === message.method) { - internalRegistry.disconnect(channel); - channel = null; - d.reject(message.error); - } else if ("loading" === message.method) { - channel.loading(); - } - }); - return d.promise; - }, - getState: function() { - return _state; - }, - handleServiceError: function(plugin, error) { - if (error && error.status === 401) { - var headers = plugin.getHeaders(); - var name = plugin.getName() || plugin.getLocation(); - var span = document.createElement("span"); - span.appendChild(document.createTextNode("Authentication required for: " + name + ".")); - if (headers.login) { - span.appendChild(document.createTextNode(" ")); - var anchor = document.createElement("a"); - anchor.target = "_blank"; - anchor.textContent = "Login"; - anchor.href = headers.login; - if (!httpOrHttps.test(anchor.href)) { - console.log("Illegal Login URL: " + headers.login); - } else { - span.appendChild(anchor); - span.appendChild(document.createTextNode(" and re-try the request.")); - } - } - var serializer = new XMLSerializer(); - return { - Severity: "Error", - HTML: true, - Message: serializer.serializeToString(span) - }; - } - if (error.__isError) { - var original = error; - error = new Error(original.message); - Object.keys(original).forEach(function(key) { - error[key] = original[key]; - }); - delete error.__isError; - } - return error; - } - }; - - this.getLocation = function() { - return "System"; - }; - - this.getHeaders = function() { - return {}; - }; - - this.getName = function() { - return "System"; - }; - - this.getVersion = function() { - return "0.0.0"; - }; - - this.getLastModified = function() { - return 0; - }; - - this.getState = internalRegistry.getState; - - function _channelHandler(channel, event) { - try { - var message; - if (typeof channel.useStructuredClone === "undefined") { - var useStructuredClone = typeof event.data !== "string"; //$NON-NLS-0$ - message = useStructuredClone ? event.data : JSON.parse(event.data); - channel.useStructuredClone = useStructuredClone; - } else { - message = channel.useStructuredClone ? event.data : JSON.parse(event.data); - } - channel.handler(message); - } catch (e) { - // not a valid message -- ignore it - } - } - - function _messageHandler(event) { - var source = event.source; - _channels.some(function(channel) { - if (source === channel.target) { - _channelHandler(channel, event); - return true; // e.g. break - } - }); - } - - - this.init = function() { - if (_state === "starting" || _state === "active" || _state === "stopping") { - return; - } - addEventListener("message", _messageHandler, false); - - if (configuration.parent) { - _parent = configuration.parent; - } else { - _parent = document.createElement("div"); //$NON-NLS-0$ - if (!configuration.visible) { - _parent.style.display = "none"; //$NON-NLS-0$ - _parent.style.visibility = "hidden"; //$NON-NLS-0$ - } - document.body.appendChild(_parent); - } - - if (configuration.plugins) { - Object.keys(configuration.plugins).forEach(function(url) { - url = _normalizeURL(url); - // if (!httpOrHttps.test(url)) { - // console.log("Illegal Plugin URL: " + url); - // return; - // } - var plugin = this.getPlugin(url); - if (!plugin) { - var manifest = configuration.plugins[url]; - if (typeof manifest !== "object") { - manifest = internalRegistry.getPersisted(url) || {}; - } - manifest.autostart = manifest.autostart || configuration.defaultAutostart || "lazy"; - plugin = new Plugin(url, manifest, internalRegistry); - plugin._default = true; - _plugins.push(plugin); - } else { - plugin._default = true; - } - }.bind(this)); - } - _plugins.sort(function(a, b) { - return a._getCreated() < b._getCreated() ? -1 : 1; - }); - _state = "starting"; - }; - - /** - * Starts the plugin registry. - * @name orion.pluginregistry.PluginRegistry#start - * @return {orion.Promise} A promise that will resolve when the registry has been fully started. - * @function - */ - this.start = function() { - if (_state !== "starting") { - this.init(); - } - if (_state !== "starting") { - return new Deferred().reject("Cannot start framework. Framework is already " + _state + "."); - } - var deferreds = []; - _plugins.forEach(function(plugin) { - var autostart = plugin._getAutostart(); - if ("started" === autostart) { - deferreds.push(plugin.start({ - "transient": true - })); - } else if ("lazy" === autostart) { - deferreds.push(plugin.start({ - "lazy": true, - "transient": true - })); - } else { - plugin._resolve(); - } - }); - return Deferred.all(deferreds, function(e) { - console.log("PluginRegistry.stop " + e); - }).then(function() { - _state = "active"; - }); - }; - - /** - * Shuts down the plugin registry. - * @name orion.pluginregistry.PluginRegistry#stop - * @function - * @returns {orion.Promise} A promise that will resolve when the registry has been stopped. - */ - this.stop = function() { - if (_state !== "starting" && _state !== "active") { - return new Deferred().reject("Cannot stop registry. Registry is already " + _state + "."); - } - _state = "stopping"; - var deferreds = []; - _plugins.forEach(function(plugin) { - deferreds.push(plugin.stop({ - "transient": true - })); - }); - return Deferred.all(deferreds, function(e) { - console.log("PluginRegistry.stop " + e); - }).then(function() { - if (!configuration.parent) { - var parentNode = _parent.parentNode; - if (parentNode) { - parentNode.removeChild(_parent); - } - } - _parent = null; - removeEventListener("message", _messageHandler); - _state = "resolved"; - }); - }; - - this.update = function() { - this.stop().then(this.start.bind(this)); - }; - - this.uninstall = function() { - return new Deferred().reject("Cannot uninstall registry"); - }; - - - /** - * Installs the plugin at the given location into the plugin registry. - * @name orion.pluginregistry.PluginRegistry#installPlugin - * @param {String} url The location of the plugin. - * @param {Object} [optManifest] The plugin metadata. - * @returns {orion.Promise} A promise that will resolve when the plugin has been installed. - * @function - */ - this.installPlugin = function(url, optManifest) { - url = _normalizeURL(url); - // if (!httpOrHttps.test(url)) { - // return new Deferred().reject("Illegal Plugin URL: " + url); - // } - var plugin = this.getPlugin(url); - if (plugin) { - return new Deferred().resolve(plugin); - } - - if (_installing[url]) { - return _installing[url]; - } - - if (optManifest) { - if (optManifest.autostart === "lazy") { - optManifest = _mixin({}, internalRegistry.getPersisted(url), optManifest); - } - plugin = new Plugin(url, optManifest, internalRegistry); - _plugins.push(plugin); - plugin._persist(); - internalRegistry.dispatchEvent(new PluginEvent("installed", plugin)); - return new Deferred().resolve(plugin); - } - - var promise = internalRegistry.loadManifest(url).then(function(manifest) { - plugin = new Plugin(url, manifest, internalRegistry); - _plugins.push(plugin); - plugin._persist(); - delete _installing[url]; - internalRegistry.dispatchEvent(new PluginEvent("installed", plugin)); - return plugin; - }, function(error) { - delete _installing[url]; - throw error; - }); - _installing[url] = promise; - return promise; - }; - - /** - * Returns all installed plugins. - * @name orion.pluginregistry.PluginRegistry#getPlugins - * @return {orion.pluginregistry.Plugin[]} An array of all installed plugins. - * @function - */ - this.getPlugins = function() { - return _plugins.slice(); - }; - - /** - * Returns the installed plugin with the given URL. - * @name orion.pluginregistry.PluginRegistry#getPlugin - * @return {orion.pluginregistry.Plugin} The installed plugin matching the given URL, or null - * if no such plugin is installed. - * @function - */ - this.getPlugin = function(url) { - var result = null; - url = _normalizeURL(url); - _plugins.some(function(plugin) { - if (url === plugin.getLocation()) { - result = plugin; - return true; - } - }); - return result; - }; - - this.addEventListener = _pluginEventTarget.addEventListener.bind(_pluginEventTarget); - - this.removeEventListener = _pluginEventTarget.removeEventListener.bind(_pluginEventTarget); - - this.resolvePlugins = function() { - var allResolved = true; - _plugins.forEach(function(plugin) { - allResolved = allResolved && plugin._resolve(); - }); - return allResolved; - }; - } - return { - Plugin: Plugin, - PluginRegistry: PluginRegistry - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -/*global URL*/ -var _code_edit_script_source = null; //We need to know where the editor script lives -var _all_script = document.getElementsByTagName('script'); -if (_all_script && _all_script.length && _all_script.length > 0) { - for (var j = 0; j < 2; j++) { // try twice in all the script tags - for (var i = 0; i < _all_script.length; i++) { - if (j === 0) { //First try: if the script id is ""orion.browse.browser"" - if (_all_script[i].id === "orion.codeEdit") { - _code_edit_script_source = _all_script[i].src; - break; - } - } else { - var regex = /.*built-codeEdit.*.js/; - if (_all_script[i].src && regex.exec(_all_script[i].src)) { - _code_edit_script_source = _all_script[i].src; - break; - } - } - } - if (_code_edit_script_source) { - break; - } - } - if (!_code_edit_script_source) { - _code_edit_script_source = _all_script[_all_script.length - 1].src; - } -} -define('embeddedEditor/helper/bootstrap',[ - 'embeddedEditor/helper/embeddedFileImpl', - 'embeddedEditor/helper/memoryFileSysConst', - 'orion/pluginregistry', - 'orion/Deferred', - 'orion/URL-shim' -], function( - EmbeddedFileImpl, - memoryFileSysConst, - mPluginRegistry, - Deferred -) { - - var once; // Deferred - var inMemoryFilePattern = memoryFileSysConst.MEMORY_FILE_PATTERN; - var defaultPluginURLs = [ - "../javascript/plugins/javascriptPlugin.html", - "../webtools/plugins/webToolsPlugin.html", - "../plugins/embeddedToolingPlugin.html" - ]; - - function startup(serviceRegistry, cTypeRegistry, options) { - if (once) { - return once; - } - //options._defaultPlugins is for internal use to load plugins in dev mode - var pluginsToLoad; - if(options && options._defaultPlugins) { - pluginsToLoad = options._defaultPlugins; - } else { - pluginsToLoad = defaultPluginURLs; - } - if(options && options.defaultPlugins) { - var newArray = []; - options.defaultPlugins.forEach(function(pl) { - var splitPl = pl.split("/").pop(); - var hasOne = null; - pluginsToLoad.some(function(item) { - if(item.indexOf(splitPl) !== -1) { - newArray.push(item); - return true; - } - return false; - }); - }); - pluginsToLoad = newArray; - } - - once = new Deferred(); - var fService = new EmbeddedFileImpl(inMemoryFilePattern); - serviceRegistry.registerService("orion.core.file", fService, { - Name: 'Embedded File System', - top: inMemoryFilePattern, - pattern: inMemoryFilePattern - }); - var plugins = {}; - pluginsToLoad.forEach(function(pluginURLString){ - var pluginURL = new URL(pluginURLString, _code_edit_script_source); - plugins[pluginURL.href] = {autostart: "lazy"}; - }); - - pluginsToLoad = (options && options.userPlugins) ? options.userPlugins : []; - pluginsToLoad.forEach(function(pluginURLString){ - plugins[pluginURLString] = {autostart: "lazy"}; - }); - - var pluginRegistry = new mPluginRegistry.PluginRegistry(serviceRegistry, { - storage: {}, - plugins: plugins - }); - return pluginRegistry.start().then(function() { - var result = { - serviceRegistry: serviceRegistry, - pluginRegistry: pluginRegistry - }; - //We need to register the parent contentType for text type if user just use the widget as bare-bone without registering any default plugins - if(!cTypeRegistry.getContentType("text/plain")) { - serviceRegistry.registerService('orion.core.contenttype', {}, {contentTypes: [{ id: "text/plain", name: "Text", extension: ["txt"]}]}); - } - once.resolve(result); - return result; - }); - } - return {startup: startup}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/undoStack", [], function() { //$NON-NLS-0$ - - /** - * Constructs a new Change object. - * - * @class - * @name orion.editor.Change - * @private - */ - function Change(model, offset, text, previousText, type) { - this.model = model; - this.offset = offset; - this.text = text; - this.previousText = previousText; - this.type = type; - } - Change.prototype = { - /** @ignore */ - getRedoChanges: function() { - return [{start: this.offset, end: this.offset + this.previousText.length, text: this.text}]; - }, - /** @ignore */ - getUndoChanges: function() { - return [{start: this.offset, end: this.offset + this.text.length, text: this.previousText}]; - }, - /** @ignore */ - undo: function (view, select) { - this._doUndoRedo(this.offset, this.previousText, this.text, view, select); - return true; - }, - /** @ignore */ - redo: function (view, select) { - this._doUndoRedo(this.offset, this.text, this.previousText, view, select); - return true; - }, - merge: function(start, text, previousText, type, end) { - if (type === this.type) { - if (type === 1 && start === this.offset + this.text.length) { - this.text += text; - return true; - } else if (type === -1 && end === this.offset) { - this.offset = start; - this.previousText = previousText + this.previousText; - return true; - } else if (type === -1 && start === this.offset) { - this.previousText = this.previousText + previousText; - return true; - } - } - return false; - }, - _doUndoRedo: function(offset, text, previousText, view, select) { - this.model.setText(text, offset, offset + previousText.length); - if (select && view) { - var model = view.getModel(); - if (model !== this.model) { - offset = model.mapOffset(offset, true); - } - view.setSelection(offset, offset + text.length); - } - } - }; - - /** - * Constructs a new CompoundChange object. - * - * @param owner the owner of the compound change - * - * @class - * @name orion.editor.CompoundChange - * @private - */ - function CompoundChange (owner) { - this.owner = owner; - this.changes = []; - } - CompoundChange.prototype = { - /** @ignore */ - getRedoChanges: function() { - var changes = []; - for (var i=0; i= 0; i--) { - changes = changes.concat(this.changes[i].getUndoChanges()); - } - return changes; - }, - /** @ignore */ - add: function (change) { - this.changes.push(change); - }, - /** @ignore */ - end: function (view) { - if (view) { - this.endSelection = view.getSelections(); - } - var owner = this.owner; - if (owner && owner.end) { - owner.end(); - } - }, - /** @ignore */ - undo: function (view, select) { - if (this.changes.length > 1 && view) { - view.setRedraw(false); - } - for (var i=this.changes.length - 1; i >= 0; i--) { - this.changes[i].undo(view, false); - } - if (select && view) { - view.setSelections(this.startSelection); - } - if (this.changes.length > 1 && view) { - view.setRedraw(true); - } - var owner = this.owner; - if (owner && owner.undo) { - owner.undo(); - } - return this.changes.length > 0; - }, - /** @ignore */ - redo: function (view, select) { - if (this.changes.length > 1 && view) { - view.setRedraw(false); - } - for (var i = 0; i < this.changes.length; i++) { - this.changes[i].redo(view, false); - } - if (select && view) { - view.setSelections(this.endSelection); - } - if (this.changes.length > 1, view) { - view.setRedraw(true); - } - var owner = this.owner; - if (owner && owner.redo) { - owner.redo(); - } - return this.changes.length > 0; - }, - merge: function(start, text, previousText, type, end, compoundChange) { - var length = this.changes.length; - if (length > 0 && this === compoundChange) { - return this.changes[length - 1].merge(start, text, previousText, type, end); - } - return false; - }, - /** @ignore */ - start: function (view) { - if (view) { - this.startSelection = view.getSelections(); - } - var owner = this.owner; - if (owner && owner.start) { - owner.start(); - } - } - }; - - /** - * Constructs a new UndoStack on a text view. - * - * @param {orion.editor.TextView} view the text view for the undo stack. - * @param {Number} [size=100] the size for the undo stack. - * - * @name orion.editor.UndoStack - * @class The UndoStack is used to record the history of a text model associated to an view. Every - * change to the model is added to stack, allowing the application to undo and redo these changes. - * - *

      - * See:
      - * {@link orion.editor.TextView}
      - *

      - */ - function UndoStack (view, size) { - this.size = size !== undefined ? size : 100; - this.reset(); - var self = this; - this._listener = { - onChanging: function(e) { - self._onChanging(e); - }, - onDestroy: function(e) { - self._onDestroy(e); - } - }; - if (view.getModel) { - var model = view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - this.model = model; - this.setView(view); - } else { - this.shared = true; - this.model = view; - } - this.model.addEventListener("Changing", this._listener.onChanging); //$NON-NLS-0$ - } - UndoStack.prototype = /** @lends orion.editor.UndoStack.prototype */ { - /** - * Destroy the undo stack. - */ - destroy: function() { - this._onDestroy(); - }, - /** - * Adds a change to the stack. - * - * @param change the change to add. - */ - add: function (change) { - if (this.compoundChange) { - this.compoundChange.add(change); - } else { - var length = this.stack.length; - this.stack.splice(this.index, length-this.index, change); - this.index++; - if (this.stack.length > this.size) { - this.stack.shift(); - this.index--; - } - } - }, - /** - * Marks the current state of the stack as clean. - * - *

      - * This function is typically called when the content of view associated with the stack is saved. - *

      - * - * @see orion.editor.UndoStack#isClean - */ - markClean: function() { - this._commitUndo(); - this.cleanChange = this.stack[this.index - 1]; - if (this.cleanChange) { - this.cleanChange.type = 2; - } - }, - /** - * Returns true if current state of stack is the same - * as the state when markClean() was called. - * - *

      - * For example, the application calls markClean(), then calls undo() four times and redo() four times. - * At this point isClean() returns true. - *

      - *

      - * This function is typically called to determine if the content of the view associated with the stack - * has changed since the last time it was saved. - *

      - * - * @return {Boolean} returns if the state is the same as the state when markClean() was called. - * - * @see orion.editor.UndoStack#markClean - */ - isClean: function() { - return this.cleanChange === this.stack[this.index - 1]; - }, - /** - * Returns true if there is at least one change to undo. - * - * @return {Boolean} returns true if there is at least one change to undo. - * - * @see orion.editor.UndoStack#canRedo - * @see orion.editor.UndoStack#undo - */ - canUndo: function() { - return this.index > 0; - }, - /** - * Returns true if there is at least one change to redo. - * - * @return {Boolean} returns true if there is at least one change to redo. - * - * @see orion.editor.UndoStack#canUndo - * @see orion.editor.UndoStack#redo - */ - canRedo: function() { - return (this.stack.length - this.index) > 0; - }, - /** - * Finishes a compound change. - * - * @see orion.editor.UndoStack#startCompoundChange - */ - endCompoundChange: function() { - if (this.compoundChange) { - this.compoundChange.end(this.view); - } - this.compoundChange = undefined; - }, - /** - * Returns the sizes of the stack. - * - * @return {object} a object where object.undo is the number of changes that can be un-done, - * and object.redo is the number of changes that can be re-done. - * - * @see orion.editor.UndoStack#canUndo - * @see orion.editor.UndoStack#canRedo - */ - getSize: function() { - return { - undo: this.index, - redo: this.stack.length - this.index - }; - }, - /** - * @class This object represents a text change. - *

      - * See:
      - * {@link orion.editor.UndoStack}
      - * {@link orion.editor.UndoStack#getUndoChanges}
      - * {@link orion.editor.UndoStack#getRedoChanges}
      - *

      - * @name orion.editor.TextChange - * - * @property {Number} start The start offset in the model of the range to be replaced. - * @property {Number} end The end offset in the model of the range to be replaced - * @property {String} text the text to be inserted - */ - /** - * Returns the redo changes. - * - * @return {orion.editor.TextChange[]} an array of TextChanges that are returned in the order - * that they occurred (most recent change last). - * - * @see orion.editor.UndoStack#getUndoChanges - */ - getRedoChanges: function() { - this._commitUndo(); - var changes = []; - for (var i=this.index; i= 0; i--) { - changes = changes.concat(this.stack[i].getUndoChanges()); - } - return changes; - }, - /** - * Undo the last change in the stack. - * - * @return {Boolean} returns true if a change was un-done. - * - * @see orion.editor.UndoStack#redo - * @see orion.editor.UndoStack#canUndo - */ - undo: function() { - this._commitUndo(); - var change, result = false; - this._ignoreUndo = true; - do { - if (this.index <= 0) { - break; - } - change = this.stack[--this.index]; - } while (!(result = change.undo(this.view, true))); - this._ignoreUndo = false; - return result; - }, - /** - * Redo the last change in the stack. - * - * @return {Boolean} returns true if a change was re-done. - * - * @see orion.editor.UndoStack#undo - * @see orion.editor.UndoStack#canRedo - */ - redo: function() { - this._commitUndo(); - var change, result = false; - this._ignoreUndo = true; - do { - if (this.index >= this.stack.length) { - break; - } - change = this.stack[this.index++]; - } while (!(result = change.redo(this.view, true))); - this._ignoreUndo = false; - return result; - }, - /** - * Reset the stack to its original state. All changes in the stack are thrown away. - */ - reset: function() { - this.index = 0; - this.cleanChange = undefined; - this.stack = []; - this._ignoreUndo = false; - this._compoundChange = undefined; - }, - setView: function(view) { - if (this.view === view) { return; } - if (this.view) { - view.removeEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - } - this.view = view; - if (this.view) { - view.addEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - } - }, - /** - * Starts a compound change. - *

      - * All changes added to stack from the time startCompoundChange() is called - * to the time that endCompoundChange() is called are compound on one change that can be un-done or re-done - * with one single call to undo() or redo(). - *

      - * - * @param owner the owner of the compound change which is called for start, end, undo and redo. - * - * @return the compound change - * - * @see orion.editor.UndoStack#endCompoundChange - */ - startCompoundChange: function(owner) { - this._commitUndo(); - var change = new CompoundChange(owner); - this.add(change); - this.compoundChange = change; - this.compoundChange.start(this.view); - return this.compoundChange; - }, - _commitUndo: function () { - this.endCompoundChange(); - }, - _onDestroy: function(evt) { - if (!evt /* undo stack destroyed */ || !this.shared) { - this.model.removeEventListener("Changing", this._listener.onChanging); //$NON-NLS-0$ - } - if (this.view) { - this.view.removeEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - this.view = null; - } - }, - _trackUnsavedChanges: function(e) { - if (!this._unsavedChanges) return; - var length = this._unsavedChanges.length; - var addedCharCount = e.addedCharCount; - var removedCharCount = e.removedCharCount; - var start = e.start; - var end = e.start + removedCharCount; - var type = 0; - if (addedCharCount === 0) { - type = -1; - } else if (removedCharCount === 0) { - type = 1; - } - if (length > 0) { - if (type === this._previousChangeType) { - var previousChange = this._unsavedChanges[length-1]; - if (removedCharCount === 0 && start === previousChange.end + previousChange.text.length) { - previousChange.text += e.text; - return; - } - if (e.addedCharCount === 0 && end === previousChange.start) { - previousChange.start = start; - return; - } - } - } - this._previousChangeType = type; - this._unsavedChanges.push({start:start, end:end, text:e.text}); - }, - _onChanging: function(e) { - this._trackUnsavedChanges(e); - if (this._ignoreUndo) { - return; - } - var text = e.text; - var start = e.start; - var addedCharCount = e.addedCharCount; - var removedCharCount = e.removedCharCount; - var end = start + removedCharCount; - var type = 0; - if (addedCharCount === 0 && removedCharCount === 1) { - type = -1; - } else if (addedCharCount === 1 && removedCharCount === 0) { - type = 1; - } - var length = this.stack.length; - var previousText = this.model.getText(start, end); - if (length > 0 && this.index === length) { - var change = this.stack[length - 1]; - if (change.merge(start, text, previousText, type, end, this.compoundChange)) { - return; - } - } - this.add(new Change(this.model, start, text, previousText, type)); - } - }; - - return { - UndoStack: UndoStack - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), - * and the Eclipse Distribution License v1.0 - * (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/explorers/navigatorRenderer',[], function() { - return { - getClickedItem: function() { - return null; - } - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/projectionTextModel", ['orion/editor/textModel', 'orion/editor/eventTarget'], function(mTextModel, mEventTarget) { //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - /** - * @class This object represents a projection range. A projection specifies a - * range of text and the replacement text. The range of text is relative to the - * base text model associated to a projection model. - *

      - * See:
      - * {@link orion.editor.ProjectionTextModel}
      - * {@link orion.editor.ProjectionTextModel#addProjection}
      - *

      - * @name orion.editor.Projection - * - * @property {Number} start The start offset of the projection range. - * @property {Number} end The end offset of the projection range. This offset is exclusive. - * @property {String|orion.editor.TextModel} [text=""] The projection text to be inserted - */ - /** - * Constructs a new ProjectionTextModel based on the specified TextModel. - * - * @param {orion.editor.TextModel} baseModel The base text model. - * - * @name orion.editor.ProjectionTextModel - * @class The ProjectionTextModel represents a projection of its base text - * model. Projection ranges can be added to the projection text model to hide and/or insert - * ranges to the base text model. - *

      - * The contents of the projection text model is modified when changes occur in the base model, - * projection model or by calls to {@link #addProjection} and {@link #removeProjection}. - *

      - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextModel} - * {@link orion.editor.TextView#setModel} - *

      - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function ProjectionTextModel(baseModel) { - this._model = baseModel; - this._projections = []; - var self = this; - this._listener = { - onChanged: function(e) { - self._onChanged(e); - }, - onChanging: function(e) { - self._onChanging(e); - } - }; - baseModel.addEventListener("postChanged", this._listener.onChanged); //$NON-NLS-0$ - baseModel.addEventListener("preChanging", this._listener.onChanging); //$NON-NLS-0$ - } - - ProjectionTextModel.prototype = /** @lends orion.editor.ProjectionTextModel.prototype */ { - /** - * Destroys this projection text model. - */ - destroy: function() { - if (this._model) { - this._model.removeEventListener("postChanged", this._listener.onChanged); //$NON-NLS-0$ - this._model.removeEventListener("preChanging", this._listener.onChanging); //$NON-NLS-0$ - this._model = null; - } - }, - /** - * Adds a projection range to the model. - *

      - * The model must notify the listeners before and after the the text is - * changed by calling {@link #onChanging} and {@link #onChanged} respectively. - *

      - * @param {orion.editor.Projection} projection The projection range to be added. - * - * @see orion.editor.ProjectionTextModel#removeProjection - */ - addProjection: function(projection) { - if (!projection) {return;} - //start and end can't overlap any exist projection - var model = this._model, projections = this._projections; - projection._lineIndex = model.getLineAtOffset(projection.start); - projection._lineCount = model.getLineAtOffset(projection.end) - projection._lineIndex; - var text = projection.text; - if (!text) { text = ""; } - if (typeof text === "string") { //$NON-NLS-0$ - projection._model = new mTextModel.TextModel(text, model.getLineDelimiter()); - } else { - projection._model = text; - } - var eventStart = this.mapOffset(projection.start, true); - var removedCharCount = projection.end - projection.start; - var removedLineCount = projection._lineCount; - var addedCharCount = projection._model.getCharCount(); - var addedLineCount = projection._model.getLineCount() - 1; - var modelChangingEvent = { - type: "Changing", //$NON-NLS-0$ - text: projection._model.getText(), - start: eventStart, - removedCharCount: removedCharCount, - addedCharCount: addedCharCount, - removedLineCount: removedLineCount, - addedLineCount: addedLineCount - }; - this.onChanging(modelChangingEvent); - var index = this._binarySearch(projections, projection.start); - projections.splice(index, 0, projection); - var modelChangedEvent = { - type: "Changed", //$NON-NLS-0$ - start: eventStart, - removedCharCount: removedCharCount, - addedCharCount: addedCharCount, - removedLineCount: removedLineCount, - addedLineCount: addedLineCount - }; - this.onChanged(modelChangedEvent); - }, - /** - * Returns all projection ranges of this model. - * - * @return {orion.editor.Projection[]} The projection ranges. - * - * @see orion.editor.ProjectionTextModel#addProjection - */ - getProjections: function() { - return this._projections.slice(0); - }, - /** - * Gets the base text model. - * - * @return {orion.editor.TextModel} The base text model. - */ - getBaseModel: function() { - return this._model; - }, - /** - * Maps offsets between the projection model and its base model. - * - * @param {Number} offset The offset to be mapped. - * @param {Boolean} [baseOffset=false] true if offset is in base model and - * should be mapped to the projection model. - * @return {Number} The mapped offset - */ - mapOffset: function(offset, baseOffset) { - var projections = this._projections, delta = 0, i, projection; - if (baseOffset) { - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > offset) { break; } - if (projection.end > offset) { return -1; } - delta += projection._model.getCharCount() - (projection.end - projection.start); - } - return offset + delta; - } - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > offset - delta) { break; } - var charCount = projection._model.getCharCount(); - if (projection.start + charCount > offset - delta) { - return -1; - } - delta += charCount - (projection.end - projection.start); - } - return offset - delta; - }, - /** - * Removes a projection range from the model. - *

      - * The model must notify the listeners before and after the the text is - * changed by calling {@link #onChanging} and {@link #onChanged} respectively. - *

      - * - * @param {orion.editor.Projection} projection The projection range to be removed. - * - * @see orion.editor.ProjectionTextModel#addProjection - */ - removeProjection: function(projection) { - this._removeProjection(projection); - }, - _removeProjection: function(projection, noEvents) { - var i, delta = 0; - for (i = 0; i < this._projections.length; i++) { - var p = this._projections[i]; - if (p === projection) { - projection = p; - break; - } - delta += p._model.getCharCount() - (p.end - p.start); - } - if (i < this._projections.length) { - var model = this._model; - var eventStart = projection.start + delta; - var addedCharCount = projection.end - projection.start; - var addedLineCount = projection._lineCount; - var removedCharCount = projection._model.getCharCount(); - var removedLineCount = projection._model.getLineCount() - 1; - if (!noEvents) { - var modelChangingEvent = { - type: "Changing", //$NON-NLS-0$ - text: model.getText(projection.start, projection.end), - start: eventStart, - removedCharCount: removedCharCount, - addedCharCount: addedCharCount, - removedLineCount: removedLineCount, - addedLineCount: addedLineCount - }; - this.onChanging(modelChangingEvent); - } - this._projections.splice(i, 1); - if (!noEvents) { - var modelChangedEvent = { - type: "Changed", //$NON-NLS-0$ - start: eventStart, - removedCharCount: removedCharCount, - addedCharCount: addedCharCount, - removedLineCount: removedLineCount, - addedLineCount: addedLineCount - }; - this.onChanged(modelChangedEvent); - } - } - }, - /** @ignore */ - _binarySearch: function (array, offset) { - var high = array.length, low = -1, index; - while (high - low > 1) { - index = Math.floor((high + low) / 2); - if (offset <= array[index].start) { - high = index; - } else { - low = index; - } - } - return high; - }, - /** - * @see orion.editor.TextModel#getCharCount - */ - getCharCount: function() { - var count = this._model.getCharCount(), projections = this._projections; - for (var i = 0; i < projections.length; i++) { - var projection = projections[i]; - count += projection._model.getCharCount() - (projection.end - projection.start); - } - return count; - }, - /** - * @see orion.editor.TextModel#getLine - */ - getLine: function(lineIndex, includeDelimiter) { - if (lineIndex < 0) { return null; } - var model = this._model, projections = this._projections; - var delta = 0, result = [], offset = 0, i, lineCount, projection; - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection._lineIndex >= lineIndex - delta) { break; } - lineCount = projection._model.getLineCount() - 1; - if (projection._lineIndex + lineCount >= lineIndex - delta) { - var projectionLineIndex = lineIndex - (projection._lineIndex + delta); - if (projectionLineIndex < lineCount) { - return projection._model.getLine(projectionLineIndex, includeDelimiter); - } else { - result.push(projection._model.getLine(lineCount)); - } - } - offset = projection.end; - delta += lineCount - projection._lineCount; - } - offset = Math.max(offset, model.getLineStart(lineIndex - delta)); - for (; i < projections.length; i++) { - projection = projections[i]; - if (projection._lineIndex > lineIndex - delta) { break; } - result.push(model.getText(offset, projection.start)); - lineCount = projection._model.getLineCount() - 1; - if (projection._lineIndex + lineCount > lineIndex - delta) { - result.push(projection._model.getLine(0, includeDelimiter)); - return result.join(""); - } - result.push(projection._model.getText()); - offset = projection.end; - delta += lineCount - projection._lineCount; - } - var end = model.getLineEnd(lineIndex - delta, includeDelimiter); - if (offset < end) { - result.push(model.getText(offset, end)); - } - return result.join(""); - }, - /** - * @see orion.editor.TextModel#getLineAtOffset - */ - getLineAtOffset: function(offset) { - var model = this._model, projections = this._projections; - var delta = 0, lineDelta = 0; - for (var i = 0; i < projections.length; i++) { - var projection = projections[i]; - if (projection.start > offset - delta) { break; } - var charCount = projection._model.getCharCount(); - if (projection.start + charCount > offset - delta) { - var projectionOffset = offset - (projection.start + delta); - lineDelta += projection._model.getLineAtOffset(projectionOffset); - delta += projectionOffset; - break; - } - lineDelta += projection._model.getLineCount() - 1 - projection._lineCount; - delta += charCount - (projection.end - projection.start); - } - return model.getLineAtOffset(offset - delta) + lineDelta; - }, - /** - * @see orion.editor.TextModel#getLineCount - */ - getLineCount: function() { - var model = this._model, projections = this._projections; - var count = model.getLineCount(); - for (var i = 0; i < projections.length; i++) { - var projection = projections[i]; - count += projection._model.getLineCount() - 1 - projection._lineCount; - } - return count; - }, - /** - * @see orion.editor.TextModel#getLineDelimiter - */ - getLineDelimiter: function() { - return this._model.getLineDelimiter(); - }, - /** - * @see orion.editor.TextModel#getLineEnd - */ - getLineEnd: function(lineIndex, includeDelimiter) { - if (lineIndex < 0) { return -1; } - var model = this._model, projections = this._projections; - var delta = 0, offsetDelta = 0; - for (var i = 0; i < projections.length; i++) { - var projection = projections[i]; - if (projection._lineIndex > lineIndex - delta) { break; } - var lineCount = projection._model.getLineCount() - 1; - if (projection._lineIndex + lineCount > lineIndex - delta) { - var projectionLineIndex = lineIndex - (projection._lineIndex + delta); - return projection._model.getLineEnd (projectionLineIndex, includeDelimiter) + projection.start + offsetDelta; - } - offsetDelta += projection._model.getCharCount() - (projection.end - projection.start); - delta += lineCount - projection._lineCount; - } - return model.getLineEnd(lineIndex - delta, includeDelimiter) + offsetDelta; - }, - /** - * @see orion.editor.TextModel#getLineStart - */ - getLineStart: function(lineIndex) { - if (lineIndex < 0) { return -1; } - var model = this._model, projections = this._projections; - var delta = 0, offsetDelta = 0; - for (var i = 0; i < projections.length; i++) { - var projection = projections[i]; - if (projection._lineIndex >= lineIndex - delta) { break; } - var lineCount = projection._model.getLineCount() - 1; - if (projection._lineIndex + lineCount >= lineIndex - delta) { - var projectionLineIndex = lineIndex - (projection._lineIndex + delta); - return projection._model.getLineStart (projectionLineIndex) + projection.start + offsetDelta; - } - offsetDelta += projection._model.getCharCount() - (projection.end - projection.start); - delta += lineCount - projection._lineCount; - } - return model.getLineStart(lineIndex - delta) + offsetDelta; - }, - /** - * @see orion.editor.TextModel#getText - */ - getText: function(start, end) { - if (start === undefined) { start = 0; } - var model = this._model, projections = this._projections; - var delta = 0, result = [], i, projection, charCount; - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > start - delta) { break; } - charCount = projection._model.getCharCount(); - if (projection.start + charCount > start - delta) { - if (end !== undefined && projection.start + charCount > end - delta) { - return projection._model.getText(start - (projection.start + delta), end - (projection.start + delta)); - } else { - result.push(projection._model.getText(start - (projection.start + delta))); - start = projection.end + delta + charCount - (projection.end - projection.start); - } - } - delta += charCount - (projection.end - projection.start); - } - var offset = start - delta; - if (end !== undefined) { - for (; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > end - delta) { break; } - result.push(model.getText(offset, projection.start)); - charCount = projection._model.getCharCount(); - if (projection.start + charCount > end - delta) { - result.push(projection._model.getText(0, end - (projection.start + delta))); - return result.join(""); - } - result.push(projection._model.getText()); - offset = projection.end; - delta += charCount - (projection.end - projection.start); - } - result.push(model.getText(offset, end - delta)); - } else { - for (; i < projections.length; i++) { - projection = projections[i]; - result.push(model.getText(offset, projection.start)); - result.push(projection._model.getText()); - offset = projection.end; - } - result.push(model.getText(offset)); - } - return result.join(""); - }, - /** @ignore */ - _onChanged: function(modelChangedEvent) { - var change = this._change; - var start = change.baseStart, end = change.baseEnd, i; - var projection, projections = this._projections; - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.end > start) { break; } - } - var rangeStart = i; - for (i = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start >= end) { break; } - } - var rangeEnd = i; - var model = this._model; - var changeCount = change.baseText.length - (end - start); - for (i = rangeEnd; i < projections.length; i++) { - projection = projections[i]; - projection.start += changeCount; - projection.end += changeCount; - projection._lineIndex = model.getLineAtOffset(projection.start); - } - var removed = projections.splice(rangeStart, rangeEnd - rangeStart); - for (i = 0; i < removed.length; i++) { - if (removed[i].annotation) { - removed[i].annotation._expand(); - } - } - var modelChangedEvent1 = { - type: "Changed", //$NON-NLS-0$ - start: change.start, - removedCharCount: change.removedCharCount, - addedCharCount: change.addedCharCount, - removedLineCount: change.removedLineCount, - addedLineCount: change.addedLineCount - }; - this.onChanged(modelChangedEvent1); - this._change = undefined; - }, - _onChanging: function(modelChangingEvent) { - var hasChange = !!this._change; - var change = this._change || {}; - var start = modelChangingEvent.start, end = start + modelChangingEvent.removedCharCount; - change.baseStart = start; - change.baseEnd = end; - change.baseText = modelChangingEvent.text; - change.addedLineCount = modelChangingEvent.addedLineCount; - if (!hasChange) { - this._change = change; - change.text = modelChangingEvent.text; - var projections = this._projections, delta, i, projection; - function mapOffset(offset) { - for (i = 0, delta = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > offset) { break; } - if (projection.end > offset) { return -1; } - delta += projection._model.getCharCount() - (projection.end - projection.start); - } - return offset + delta; - } - change.start = mapOffset(start); - if (change.start === -1) { - change.text = this._model.getText(projection.start, start) + change.text; - change.addedLineCount += this._model.getLineAtOffset(start) - this._model.getLineAtOffset(projection.start); - change.start = projection.start + delta; - } - change.end = mapOffset(end); - if (change.end === -1) { - change.text += this._model.getText(end, projection.end); - change.addedLineCount += this._model.getLineAtOffset(projection.end) - this._model.getLineAtOffset(end); - change.end = projection.start + delta; - } - } - change.addedCharCount = change.text.length; - change.removedCharCount = change.end - change.start; - change.removedLineCount = this.getLineAtOffset(change.end) - this.getLineAtOffset(change.start); - var modelChangingEvent1 = { - type: "Changing", //$NON-NLS-0$ - text: change.text, - start: change.start, - removedCharCount: change.removedCharCount, - addedCharCount: change.addedCharCount, - removedLineCount: change.removedLineCount, - addedLineCount: change.addedLineCount - }; - this.onChanging(modelChangingEvent1); - }, - /** - * @see orion.editor.TextModel#onChanging - */ - onChanging: function(modelChangingEvent) { - return this.dispatchEvent(modelChangingEvent); - }, - /** - * @see orion.editor.TextModel#onChanged - */ - onChanged: function(modelChangedEvent) { - return this.dispatchEvent(modelChangedEvent); - }, - /** - * @see orion.editor.TextModel#setLineDelimiter - */ - setLineDelimiter: function(lineDelimiter) { - this._model.setLineDelimiter(lineDelimiter); - }, - /** - * @see orion.editor.TextModel#setText - */ - setText: function(text, start, end) { - this._change = { - text: text || "", - start: start || 0, - end: end === undefined ? this.getCharCount() : end - }; - var projections = this._projections, delta, i, projection; - function mapOffset(offset) { - for (i = 0, delta = 0; i < projections.length; i++) { - projection = projections[i]; - if (projection.start > offset - delta) { break; } - var charCount = projection._model.getCharCount(); - if (projection.start + charCount > offset - delta) { - return -1; - } - delta += charCount - (projection.end - projection.start); - } - return offset - delta; - } - var startProjection, endProjection; - var mapStart = mapOffset(this._change.start); - if (mapStart === -1) { - startProjection = { - projection: projection, - start: this._change.start - (projection.start + delta) - }; - mapStart = projection.end; - } - var mapEnd = mapOffset(this._change.end); - if (mapEnd === -1) { - endProjection = { - projection: projection, - end: this._change.end - (projection.start + delta) - }; - mapEnd = projection.start; - } - if (startProjection && endProjection && startProjection.projection === endProjection.projection) { - //TODO events - special case - change is completely inside of a projection - projection._model.setText(this._change.text, startProjection.start, endProjection.end); - } else { - this._model.setText(this._change.text, mapStart, mapEnd); - if (startProjection) { - projection = startProjection.projection; - projection._model.setText("", startProjection.start); - } - if (endProjection) { - projection = endProjection.projection; - projection._model.setText("", 0, endProjection.end); - projection.start = projection.end; - projection._lineCount = 0; - } - } - this._change = undefined; - } - }; - mEventTarget.EventTarget.addMixin(ProjectionTextModel.prototype); - - return {ProjectionTextModel: ProjectionTextModel}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/editor/textModelFactory',[ - 'orion/editor/textModel', - 'orion/editor/projectionTextModel' -], function(mTextModel, mProjectionTextModel) { - - /** - * TextModelFactory generates all the base text model and projection model for the editors - */ - function TextModelFactory() { - } - TextModelFactory.prototype = { - /** - * Create a text model instance for editor. A customized TextModelFactory can return a sub class of mTextModel.TextModel. - */ - createTextModel: function(/*options*/) { - return new mTextModel.TextModel(); - }, - /** - * Create a projection text model instance for editor. A customized TextModelFactory can create a sub class of mTextModel.TextModel - * or a sub class of mProjectionTextModel.ProjectionTextModel. - */ - createProjectionTextModel: function(baseModel, options) { - return new mProjectionTextModel.ProjectionTextModel(baseModel ? baseModel: this.createTextModel(options)); - } - }; - return { - TextModelFactory: TextModelFactory - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/inputManager',[ - 'i18n!orion/edit/nls/messages', - 'orion/explorers/navigatorRenderer', - 'orion/i18nUtil', - 'orion/Deferred', - 'orion/EventTarget', - 'orion/objects', - 'orion/PageUtil', - 'orion/editor/textModelFactory', - 'orion/metrics' -], function(messages, mNavigatorRenderer, i18nUtil, Deferred, EventTarget, objects, PageUtil, mTextModelFactory, mMetrics) { - - function Idle(options){ - this._document = options.document || document; - this._timeout = options.timeout; - //TODO: remove listeners if there are no clients - //TODO: add support for multiple clients with different timeouts - var events = ["mousedown", "keypress","keydown","keyup"]; //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - var reset = function () { this._resetTimer(); }.bind(this); - for (var i = 0; i < events.length; i++) { - var evt = events[i]; - this._document.addEventListener(evt, reset, true); - } - EventTarget.attach(this); - } - - Idle.prototype = { - _resetTimer: function() { - var win = this._document.defaultView || this._document.parentWindow; - if (this._timer) { - win.clearTimeout(this._timer); - this._timer = null; - } - if (this._timeout !== -1) { - this._timer = win.setTimeout(function() { - this.onIdle({type:"Idle"}); //$NON-NLS-0$ - this._timer = null; - this._resetTimer(); - }.bind(this), this._timeout); - } - }, - onIdle: function (idleEvent) { - return this.dispatchEvent(idleEvent); - }, - setTimeout: function(timeout) { - this._timeout = timeout; - this._resetTimer(); - } - }; - - function _makeError(error) { - var newError = { - Severity: "Error", //$NON-NLS-0$ - Message: messages.noResponse - }; - if(error.name === "Cancel") { - return {Severity: "Warning", Message: error.name, Cancel: true}; - } else if (error.status === 0) { - newError.Cancel = true; - return newError; // might do better here - } else if (error.responseText) { - var responseText = error.responseText; - try { - var parsedError = JSON.parse(responseText); - newError.Severity = parsedError.Severity || newError.Severity; - newError.Message = parsedError.Message || newError.Message; - } catch (e) { - newError.Message = responseText; - } - } else { - try { - newError.Message = JSON.stringify(error); - } catch (e) { - // best effort - fallthrough - } - } - return newError; - } - - function handleError(statusService, error) { - if (!statusService) { - window.console.log(error); - return; - } - if (!error.Severity) { - error = _makeError(error); - } - statusService.setProgressResult(error); - return error; - } - - function decode(contents, charset, done, errorHandler) { - if (window.TextDecoder) { - done(new TextDecoder(charset).decode(contents)); - } else { - var mimeType = 'text/plain; charset=' + charset; //$NON-NLS-0$ - var blob = new Blob([contents], { type: mimeType }); - var reader = new FileReader(); - reader.onload = function() { - done(reader.result); - }.bind(this); - reader.onerror = errorHandler; - reader.readAsText(blob, charset); - } - } - - var UTF8 = "UTF-8"; //$NON-NLS-0$ - function isUTF8(charset) { - return !charset || charset === UTF8; //$NON-NLS-0$ - } - - /** - * @name orion.editor.InputManager - * @class - */ - function InputManager(options) { - EventTarget.attach(this); - this.serviceRegistry = options.serviceRegistry; - this.statusService = options.statusService; - this.fileClient = options.fileClient; - this.progressService = options.progressService; - this.contentTypeRegistry = options.contentTypeRegistry; - this.selection = options.selection; - this._input = this._title = ""; - if (this.fileClient) { - this.fileClient.addEventListener("Changed", function(evt) { //$NON-NLS-0$ - if (this._fileMetadata && this._fileMetadata._saving) { - return; - } - if(evt && evt.modified) { - var metadata = this.getFileMetadata(); - if(metadata && metadata.Location) { - if(evt.modified.some(function(loc){ - return metadata.Location === loc; - })) { - //We do not want to set focus on this editor. - //E.g., If a user works on editor A but quick fix could have modified editor B. We should update B's contents but user still want to work on A. - this.load(null, true); - } - } - } - }.bind(this)); - } - } - objects.mixin(InputManager.prototype, /** @lends orion.editor.InputManager.prototype */ { - /** - * @returns {orion.Promise} Promise resolving to the new Location we should use - */ - _maybeLoadWorkspace: function(resource) { - var fileClient = this.fileClient; - // If it appears to be a workspaceRootURL we cannot load it directly, have to get the workspace first - var root = resource; - if (root.indexOf("?")) root = root.split("?")[0]; - if (root === fileClient.fileServiceRootURL(root)) { - return fileClient.loadWorkspace(root).then(function(workspace) { - return workspace.Location; - }); - } - return new Deferred().resolve(resource); - }, - /** - * Wrapper for fileClient.read() that tolerates a filesystem root URL passed as location. If location is indeed - * a filesystem root URL, the original read() operation is instead performed on the workspace. - */ - _read: function(loc /**, readArgs*/) { - var cachedMetadata = this.cachedMetadata || mNavigatorRenderer.getClickedItem(); - if (cachedMetadata && cachedMetadata.Location === loc && - cachedMetadata.Parents && cachedMetadata.Attributes && - cachedMetadata.ETag - ) { - return new Deferred().resolve(cachedMetadata); - } - var fileClient = this.fileClient; - var readArgs = Array.prototype.slice.call(arguments, 1); - return this._maybeLoadWorkspace(loc).then(function(newLocation) { - return fileClient.read.apply(fileClient, [newLocation].concat(readArgs)); - }); - }, - _isSameParent: function(loc) { - if (this._lastMetadata && this._lastMetadata.Parents && this._lastMetadata.Parents.length > 0) { - var parentLocation = loc.substring(0, loc.lastIndexOf("/", loc.length - (loc[loc.length - 1] === "/" ? 2 : 1)) + 1); - return this._lastMetadata.Parents[0].Location === parentLocation; - } - return false; - }, - load: function(charset, nofocus) { - var fileURI = this.getInput(); - if (!fileURI) { return; } - var fileClient = this.fileClient; - var resource = this._parsedLocation.resource; - var progressService = this.progressService; - var progress = function(deferred, msgKey, uri) { - if (!progressService) { return deferred; } - return progressService.progress(deferred, i18nUtil.formatMessage(msgKey, uri)); - }; - var editor = this.getEditor(); - if (this._fileMetadata) { - //Reload if out of sync, unless we are already in the process of saving - if (!this._fileMetadata._saving && !this._fileMetadata.Directory && !this.getReadOnly()) { - progress(fileClient.read(resource, true), messages.ReadingMetadata, fileURI).then(function(data) { - if (this._fileMetadata && !this._fileMetadata._saving && this._fileMetadata.Location === data.Location && this._fileMetadata.ETag !== data.ETag) { - this._fileMetadata = objects.mixin(this._fileMetadata, data); - if (!editor.isDirty() || window.confirm(messages.loadOutOfSync)) { - progress(fileClient.read(resource), messages.Reading, fileURI).then(function(contents) { - editor.setInput(fileURI, null, contents, null, nofocus); - this._clearUnsavedChanges(); - }.bind(this)); - } - } - }.bind(this)); - } - } else { - var progressTimeout = window.setTimeout(function() { - progressTimeout = null; - this.reportStatus(i18nUtil.formatMessage(messages.Fetching, fileURI)); - }.bind(this), 800); - var clearProgressTimeout = function() { - this.reportStatus(""); - if (progressTimeout) { - window.clearTimeout(progressTimeout); - } - }.bind(this); - var errorHandler = function(error) { - clearProgressTimeout(); - var statusService = null; - if(this.serviceRegistry) { - statusService = this.serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$ - } else if(this.statusService) { - statusService = this.statusService; - } - handleError(statusService, error); - this._setNoInput(true); - }.bind(this); - this._acceptPatch = null; - // Read metadata - var metadataURI = resource; - if (!this._isSameParent(metadataURI)) { - var uri = new URL(metadataURI); - uri.query.set("tree", localStorage.useCompressedTree ? "compressed" : "decorated"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ - metadataURI = uri.href; - } - progress(this._read(metadataURI, true), messages.ReadingMetadata, resource).then(function(metadata) { - if(!metadata) { - errorHandler({responseText: i18nUtil.formatMessage(messages.ReadingMetadataError, resource)}); - } else if (metadata.Directory) { - // Fetch children - Deferred.when(metadata.Children || progress(fileClient.fetchChildren(metadata.ChildrenLocation), messages.Reading, fileURI), function(contents) { - clearProgressTimeout(); - metadata.Children = contents; - this._setInputContents(this._parsedLocation, fileURI, contents, metadata); - }.bind(this), errorHandler); - } else { - charset = charset || this._charset; - // Read contents if this is a text file and encoding is UTF-8 - var isText = this._isText(metadata); - if (isUTF8(charset) && isText) { - // Read text contents - var defaultReadOptions, textModelFactory = new mTextModelFactory.TextModelFactory(); - //If textModelFactory support additional options for reading text contents, we need to use it. - //An example is to support large file, whose contents is read by segments - if(typeof textModelFactory.getDefaultReadOptions === "function") { - defaultReadOptions = textModelFactory.getDefaultReadOptions(); - } - progress(fileClient.read(resource, false, true, defaultReadOptions), messages.Reading, fileURI).then(function(contents) { - clearProgressTimeout(); - if (typeof contents !== "string") { //$NON-NLS-0$ - this._acceptPatch = contents.acceptPatch; - contents = contents.result; - } - this._setInputContents(this._parsedLocation, fileURI, contents, metadata); - }.bind(this), errorHandler); - } else { - progress(fileClient._getService(resource).readBlob(resource), messages.Reading, fileURI).then(function(contents) { - clearProgressTimeout(); - if (isText) { - decode(contents, charset, function(result) { - this._setInputContents(this._parsedLocation, fileURI, result, metadata); - }.bind(this), errorHandler); - return; - } - this._setInputContents(this._parsedLocation, fileURI, contents, metadata); - }.bind(this), errorHandler); - } - } - }.bind(this), errorHandler); - } - }, - processParameters: function(input) { - var editor = this.getEditor(); - if (editor && editor.processParameters) { - return editor.processParameters(input); - } - return false; - }, - getAutoLoadEnabled: function() { - return this._autoLoadEnabled; - }, - getAutoSaveEnabled: function() { - return this._autoSaveEnabled; - }, - getEditor: function() { - return this.editor; - }, - getEncodingCharset: function() { - return this._charset || UTF8; - }, - getInput: function() { - return this._input; - }, - getLocation: function() { - return this._location; - }, - getTitle: function() { - return this._title; - }, - getFileMetadata: function() { - return this._fileMetadata; - }, - isSaveEnabled: function() { - return !this.getReadOnly(); - }, - getReadOnly: function() { - var data = this._fileMetadata; - return this._readonly || !data || (data.Attributes && data.Attributes.ReadOnly); - }, - getContentType: function() { - return this._contentType; - }, - onFocus: function() { - // If there was an error while auto saving, auto save is temporarily disabled and - // we retry saving every time the editor gets focus - if (this._autoSaveEnabled && this._errorSaving) { - this.save(); - return; - } - if (this._autoLoadEnabled && this._fileMetadata) { - this.load(); - } - }, - reportStatus: function(msg) { - if (this.statusReporter) { - this.statusReporter(msg); - } else if (this.editor) { - this.editor.reportStatus(msg); - } - }, - save: function(closing) { - var metadata = this.getFileMetadata(); - if (!metadata) return new Deferred().reject(); - if (metadata._saving) { return metadata._savingDeferred; } - var that = this; - metadata._savingDeferred = new Deferred(); - metadata._saving = true; - function done(result) { - var deferred = metadata._savingDeferred; - deferred.resolve(result); - metadata._savingDeferred = null; - metadata._saving = false; - return deferred; - } - var editor = this.getEditor(); - if (!editor || !editor.isDirty() || this.getReadOnly()) { return done(); } - var failedSaving = this._errorSaving; - var input = this.getInput(); - this.reportStatus(messages['Saving...']); - - if (!this._saveEventLogged) { - this._logMetrics("save"); //$NON-NLS-0$ - this._saveEventLogged = true; - } - - this.dispatchEvent({ type: "Saving", inputManager: this}); //$NON-NLS-0$ - - editor.markClean(); - var contents = editor.getText(); - var data = contents; - if (this._getSaveDiffsEnabled() && !this._errorSaving) { - var changes = this._getUnsavedChanges(); - if (changes) { - var len = 0; - for (var i = 0; i < changes.length; i++) { - len += changes[i].text.length; - } - if (contents.length > len) { - data = { - diff: changes - }; - } - } - } - this._clearUnsavedChanges(); - this._errorSaving = false; - - var etag = metadata.ETag; - var args = { "ETag" : etag }; //$NON-NLS-0$ - var resource = this._parsedLocation.resource; - var def = this.fileClient.write(resource, data, args); - var progress = this.progressService; - var statusService = null; - if(this.serviceRegistry){ - statusService = this.serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$ - } - if (progress) { - def = progress.progress(def, i18nUtil.formatMessage(messages.savingFile, input)); - } - function successHandler(result) { - if (input === that.getInput()) { - metadata.ETag = result.ETag; - editor.setInput(input, null, contents, true); - } - that.reportStatus(""); - if (failedSaving && statusService) { - statusService.setProgressResult({Message:messages.Saved, Severity:"Normal"}); //$NON-NLS-0$ - } - if (that.postSave) { - that.postSave(closing); - } - return done(result); - } - function errorHandler(error) { - that.reportStatus(""); - var errorMsg = handleError(statusService, error); - mMetrics.logEvent("status", "exception", (that._autoSaveActive ? "Auto-save: " : "Save: ") + errorMsg.Message); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - that._errorSaving = true; - return done(); - } - def.then(successHandler, function(error) { - // expected error - HTTP 412 Precondition Failed - // occurs when file is out of sync with the server - if (error.status === 412) { - var forceSave = window.confirm(messages.saveOutOfSync); - if (forceSave) { - // repeat save operation, but without ETag - var redef = that.fileClient.write(resource, contents); - if (progress) { - redef = progress.progress(redef, i18nUtil.formatMessage(messages.savingFile, input)); - } - redef.then(successHandler, errorHandler); - } else { - return done(); - } - } else { - // unknown error - errorHandler(error); - } - }); - return metadata._savingDeferred; - }, - setAutoLoadEnabled: function(enabled) { - this._autoLoadEnabled = enabled; - }, - /** - * Set the autosave timeout. If the timeout is -1, autosave is - * disabled. - * @param {Number} timeout - the autosave timeout in milliseconds - */ - setAutoSaveTimeout: function(timeout) { - this._autoSaveEnabled = timeout !== -1; - this._autoSaveActive = false; - if (!this._idle) { - var options = { - document: document, - timeout: timeout - }; - this._idle = new Idle(options); - this._idle.addEventListener("Idle", function () { //$NON-NLS-0$ - if (!this._errorSaving) { - this._autoSaveActive = true; - this.save().then(function() { - this._autoSaveActive = false; - }); - } - }.bind(this)); - } else { - this._idle.setTimeout(timeout); - } - }, - setContentType: function(contentType) { - this._contentType = contentType; - }, - setEncodingCharset: function(charset) { - this._charset = charset; - }, - setInput: function(loc) { - if (this._ignoreInput) { return; } - if (!loc) { - loc = PageUtil.hash(); - } - if (typeof loc !== "string") { //$NON-NLS-0$ - return; - } - var editor = this.getEditor(); - if (loc && loc[0] !== "#") { //$NON-NLS-0$ - loc = "#" + loc; //$NON-NLS-0$ - } - var input = PageUtil.matchResourceParameters(loc), oldInput = this._parsedLocation || {}; - var encodingChanged = oldInput.encoding !== input.encoding; - if (editor && editor.isDirty()) { - var oldLocation = this._location; - var oldResource = oldInput.resource; - var newResource = input.resource; - if (oldResource !== newResource || encodingChanged) { - if (this._autoSaveEnabled) { - this.save(); - } else if (!window.confirm(messages.confirmUnsavedChanges)) { - window.location.hash = oldLocation; - return; - } - } - } - var editorChanged = editor && oldInput.editor !== input.editor; - this._location = loc; - this._parsedLocation = input; - this._ignoreInput = true; - if(this.selection) { - this.selection.setSelections(loc); - } - this._ignoreInput = false; - var evt = { - type: "InputChanging", //$NON-NLS-0$ - input: input - }; - this.dispatchEvent(evt); - function saveSession() { - if (evt.session) { - evt.session.save(); - } - } - var fileURI = input.resource; - if (evt.metadata) { - saveSession(); - this.reportStatus(""); - this._input = fileURI; - var metadata = evt.metadata; - this._setInputContents(input, fileURI, null, metadata); - return; - } - if (fileURI) { - if (fileURI === this._input && !encodingChanged) { - if (editorChanged) { - this.reportStatus(""); - this._setInputContents(input, fileURI, null, this._fileMetadata, this._isText(this._fileMetadata)); - } else { - if (!this.processParameters(input)) { - if (evt.session) { - evt.session.apply(true); - } - } - } - } else { - saveSession(); - this._input = fileURI; - this._readonly = false; - this._lastMetadata = this._fileMetadata; - this._fileMetadata = null; - this.load(input.encoding); - } - } else { - saveSession(); - this._setNoInput(true); - } - }, - setTitle: function(title) { - var indexOfSlash = title.lastIndexOf("/"); //$NON-NLS-0$ - var shortTitle = title; - if (indexOfSlash !== -1) { - shortTitle = shortTitle.substring(indexOfSlash + 1); - } - this._title = shortTitle; - }, - setSaveDiffsEnabled: function(enabled) { - this._saveDiffsEnabled = enabled; - var editor = this.editor; - if (editor && !editor.isDirty()) { - this._clearUnsavedChanges(); - } - }, - _getSaveDiffsEnabled: function() { - return this._saveDiffsEnabled && this._acceptPatch && this._acceptPatch.indexOf("application/json-patch") !== -1; //$NON-NLS-0$ - }, - _logMetrics: function(type) { - var label = "(none)"; //$NON-NLS-0$ - var contentType = this.getContentType(); - var metadata = this.getFileMetadata(); - if (contentType) { - label = contentType.id; - } else if (metadata) { - var _name = metadata.Name; - var index = _name.lastIndexOf("."); //$NON-NLS-0$ - if (index >= 0) { - label = "unregistered: " + _name.substring(index); //$NON-NLS-0$ - } else { - switch (_name) { - case "AUTHORS": //$NON-NLS-0$ - case "config": //$NON-NLS-0$ - case "LICENSE": //$NON-NLS-0$ - case "make": //$NON-NLS-0$ - case "Makefile": { //$NON-NLS-0$ - label = "unregistered: " + _name; //$NON-NLS-0$ - break; - } - } - } - } - mMetrics.logEvent("editor", type, label, null, {path: metadata.Location}); //$NON-NLS-0$ - }, - _unknownContentTypeAsText: function() {// Return true if we think unknown content type is text type - return true; - }, - _isText: function(metadata) { - var contentType = this.contentTypeRegistry.getFileContentType(metadata); - // Allow unkownn content types to be loaded as text files - if (!contentType) { return this._unknownContentTypeAsText(); } - var textPlain = this.contentTypeRegistry.getContentType("text/plain"); //$NON-NLS-0$ - return this.contentTypeRegistry.isExtensionOf(contentType, textPlain); - }, - _setNoInput: function(loadRoot) { - if (loadRoot) { - this.fileClient.loadWorkspace("").then(function(root) { - this._input = root.ChildrenLocation; - this._setInputContents(root.ChildrenLocation, null, root, root); - }.bind(this)); - return; - } - // No input, no editor. - this._input = this._title = this._fileMetadata = null; - this.setContentType(null); - this.dispatchEvent({ type: "InputChanged", input: null }); //$NON-NLS-0$ - }, - _setInputContents: function(input, title, contents, metadata, noSetInput) { - var _name, isDir = false; - if (metadata) { - this._fileMetadata = metadata; - this.setTitle(metadata.Location || String(metadata)); - this.setContentType(this.contentTypeRegistry.getFileContentType(metadata)); - _name = metadata.Name; - isDir = metadata.Directory; - } else { - // No metadata - this._fileMetadata = null; - this.setTitle(title); - this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())); - _name = this.getTitle(); - } - var editor = this.getEditor(); - if (this._focusListener) { - if (editor && editor.getTextView && editor.getTextView()) { - editor.getTextView().removeEventListener("Focus", this._focusListener); //$NON-NLS-0$ - } - this._focusListener = null; - } - var evt = { - type: "InputChanged", //$NON-NLS-0$ - input: input, - name: _name, - title: title, - contentType: this.getContentType(), - metadata: metadata, - location: window.location, - contents: contents - }; - this._logMetrics("open"); //$NON-NLS-0$ - this.dispatchEvent(evt); - this.editor = editor = evt.editor; - if (!isDir) { - if (!noSetInput) { - editor.setInput(title, null, contents); - } - if (editor && editor.getTextView && editor.getTextView()) { - var textView = editor.getTextView(); - textView.addEventListener("Focus", this._focusListener = this.onFocus.bind(this)); //$NON-NLS-0$ - if(editor.getModel() && typeof editor.getModel().setModelData === "function") { - editor.getModel().setModelData({ metadata: metadata}); - } - } - this._clearUnsavedChanges(); - if (!this.processParameters(input)) { - if (evt.session) { - evt.session.apply(); - } - } - } - - this._saveEventLogged = false; - mMetrics.logPageLoadTiming("interactive", window.location.pathname); //$NON-NLS-0$ - }, - _getUnsavedChanges: function() { - var editor = this.editor; - if (editor && editor.getUndoStack && editor.getUndoStack()) { - return editor.getUndoStack()._unsavedChanges; - } - return null; - }, - _clearUnsavedChanges: function() { - var editor = this.editor; - if (editor && editor.getUndoStack && editor.getUndoStack()) { - editor.getUndoStack()._unsavedChanges = this._getSaveDiffsEnabled() ? [] : null; - } - } - }); - return { - handleError: handleError, - InputManager: InputManager - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/keyModes", [ //$NON-NLS-0$ - "orion/keyBinding", //$NON-NLS-0$ - "orion/util" //$NON-NLS-0$ -], function(mKeyBinding, util) { - - function KeyMode(view) { - if (!view) { - return; - } - this._view = view; - this._keyBindings = this.createKeyBindings(); - this._keyBindingIndex = 0; - } - KeyMode.prototype = /** @lends orion.editor.KeyMode.prototype */ { - createKeyBindings: function () { - return []; - }, - /** - * Returns all the key bindings associated to the given action ID. - * - * @param {String} actionID the action ID. - * @returns {orion.KeyBinding[]} the array of key bindings associated to the given action ID. - * - * @see orion.editor.KeyModesetKeyBinding - * @see orion.editor.KeyModesetAction - */ - getKeyBindings: function (actionID) { - var result = []; - var keyBindings = this._keyBindings; - for (var i = 0; i < keyBindings.length; i++) { - if (keyBindings[i].actionID === actionID) { - result.push(keyBindings[i].keyBinding); - } - } - return result; - }, - getView: function() { - return this._view; - }, - isActive: function () { - return this._view.getKeyModes().indexOf(this) !== -1; - }, - match: function(e) { - if (e.type === "keydown") { //$NON-NLS-0$ - switch (e.keyCode) { - case 16: /* Shift */ - case 17: /* Control */ - case 18: /* Alt */ - case 91: /* Command */ - return undefined; - } - } - var keyBindingIndex = this._keyBindingIndex; - var keyBindings = this._matchingKeyBindings || this._keyBindings; - var matchingKeyBindings = []; - for (var i = 0; i < keyBindings.length; i++) { - var kb = keyBindings[i]; - var keyBinding = kb.keyBinding; - var match = keyBinding.match(e, keyBindingIndex); - if (match === true) { - this._keyBindingIndex = 0; - this._matchingKeyBindings = null; - return kb.actionID; - } else if (typeof match === "number") { //$NON-NLS-0$ - matchingKeyBindings.push(kb); - } - } - if (matchingKeyBindings.length === 0) { - this._keyBindingIndex = 0; - this._matchingKeyBindings = null; - } else { - this._keyBindingIndex++; - this._matchingKeyBindings = matchingKeyBindings; - return "noop"; //$NON-NLS-0$ - } - return undefined; - }, - /** - * Associates a key binding with the given action ID. Any previous - * association with the specified key binding is overwriten. If the - * action ID is null, the association is removed. - * - * @param {orion.KeyBinding} keyBinding the key binding - * @param {String} actionID the action ID - */ - setKeyBinding: function(keyBinding, actionID) { - var keyBindings = this._keyBindings; - for (var i = 0; i < keyBindings.length; i++) { - var kb = keyBindings[i]; - if (kb.keyBinding.equals(keyBinding)) { - if (actionID) { - kb.actionID = actionID; - } else { - if (kb.predefined) { - kb.actionID = "noop"; //$NON-NLS-0$ - } else { - keyBindings.splice(i, 1); - } - } - return; - } - } - if (actionID) { - keyBindings.push({keyBinding: keyBinding, actionID: actionID}); - } - }, - setView: function(view) { - this._view = view; - } - }; - - function DefaultKeyMode(view) { - KeyMode.call(this, view); - } - DefaultKeyMode.prototype = new KeyMode(); - DefaultKeyMode.prototype.createKeyBindings = function () { - var KeyBinding = mKeyBinding.KeyBinding; - //no duplicate keybindings - var bindings = []; - - // Cursor Navigation - bindings.push({actionID: "lineUp", keyBinding: new KeyBinding(38), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineDown", keyBinding: new KeyBinding(40), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "charPrevious", keyBinding: new KeyBinding(37), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "charNext", keyBinding: new KeyBinding(39), predefined: true}); //$NON-NLS-0$ - if (util.isMac) { - bindings.push({actionID: "scrollPageUp", keyBinding: new KeyBinding(33), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollPageDown", keyBinding: new KeyBinding(34), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "pageUp", keyBinding: new KeyBinding(33, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "pageDown", keyBinding: new KeyBinding(34, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineStart", keyBinding: new KeyBinding(37, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineEnd", keyBinding: new KeyBinding(39, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "wordPrevious", keyBinding: new KeyBinding(37, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "wordNext", keyBinding: new KeyBinding(39, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollTextStart", keyBinding: new KeyBinding(36), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollTextEnd", keyBinding: new KeyBinding(35), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "textStart", keyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "textEnd", keyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollPageUp", keyBinding: new KeyBinding(38, null, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollPageDown", keyBinding: new KeyBinding(40, null, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineStart", keyBinding: new KeyBinding(37, null, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineEnd", keyBinding: new KeyBinding(39, null, null, null, true), predefined: true}); //$NON-NLS-0$ - //TODO These two actions should be changed to paragraph start and paragraph end when word wrap is implemented - bindings.push({actionID: "lineStart", keyBinding: new KeyBinding(38, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineEnd", keyBinding: new KeyBinding(40, null, null, true), predefined: true}); //$NON-NLS-0$ - } else { - bindings.push({actionID: "pageUp", keyBinding: new KeyBinding(33), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "pageDown", keyBinding: new KeyBinding(34), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineStart", keyBinding: new KeyBinding(36), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineEnd", keyBinding: new KeyBinding(35), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "wordPrevious", keyBinding: new KeyBinding(37, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "wordNext", keyBinding: new KeyBinding(39, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "textStart", keyBinding: new KeyBinding(36, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "textEnd", keyBinding: new KeyBinding(35, true), predefined: true}); //$NON-NLS-0$ - } - if (util.isFirefox && util.isLinux) { - bindings.push({actionID: "lineUp", keyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "lineDown", keyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$ - } - if (util.isWindows) { - bindings.push({actionID: "scrollLineUp", keyBinding: new KeyBinding(38, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "scrollLineDown", keyBinding: new KeyBinding(40, true), predefined: true}); //$NON-NLS-0$ - } - - // Select Cursor Navigation - bindings.push({actionID: "selectLineUp", keyBinding: new KeyBinding(38, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineDown", keyBinding: new KeyBinding(40, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectCharPrevious", keyBinding: new KeyBinding(37, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectCharNext", keyBinding: new KeyBinding(39, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectPageUp", keyBinding: new KeyBinding(33, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectPageDown", keyBinding: new KeyBinding(34, null, true), predefined: true}); //$NON-NLS-0$ - if (util.isMac) { - bindings.push({actionID: "selectLineStart", keyBinding: new KeyBinding(37, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineEnd", keyBinding: new KeyBinding(39, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectWordPrevious", keyBinding: new KeyBinding(37, null, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectWordNext", keyBinding: new KeyBinding(39, null, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextStart", keyBinding: new KeyBinding(36, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextEnd", keyBinding: new KeyBinding(35, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextStart", keyBinding: new KeyBinding(38, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextEnd", keyBinding: new KeyBinding(40, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineStart", keyBinding: new KeyBinding(37, null, true, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineEnd", keyBinding: new KeyBinding(39, null, true, null, true), predefined: true}); //$NON-NLS-0$ - //TODO These two actions should be changed to select paragraph start and select paragraph end when word wrap is implemented - bindings.push({actionID: "selectLineStart", keyBinding: new KeyBinding(38, null, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineEnd", keyBinding: new KeyBinding(40, null, true, true), predefined: true}); //$NON-NLS-0$ - } else { - if (util.isLinux) { - bindings.push({actionID: "selectWholeLineUp", keyBinding: new KeyBinding(38, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectWholeLineDown", keyBinding: new KeyBinding(40, true, true), predefined: true}); //$NON-NLS-0$ - } - bindings.push({actionID: "selectLineStart", keyBinding: new KeyBinding(36, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectLineEnd", keyBinding: new KeyBinding(35, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectWordPrevious", keyBinding: new KeyBinding(37, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectWordNext", keyBinding: new KeyBinding(39, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextStart", keyBinding: new KeyBinding(36, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectTextEnd", keyBinding: new KeyBinding(35, true, true), predefined: true}); //$NON-NLS-0$ - } - - //Undo stack - bindings.push({actionID: "undo", keyBinding: new mKeyBinding.KeyBinding('z', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - if (util.isMac) { - bindings.push({actionID: "redo", keyBinding: new mKeyBinding.KeyBinding('z', true, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - } else { - bindings.push({actionID: "redo", keyBinding: new mKeyBinding.KeyBinding('y', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - } - - //Misc - bindings.push({actionID: "deletePrevious", keyBinding: new KeyBinding(8), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deletePrevious", keyBinding: new KeyBinding(8, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteNext", keyBinding: new KeyBinding(46), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteWordPrevious", keyBinding: new KeyBinding(8, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteWordPrevious", keyBinding: new KeyBinding(8, true, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteWordNext", keyBinding: new KeyBinding(46, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "tab", keyBinding: new KeyBinding(9), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "shiftTab", keyBinding: new KeyBinding(9, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "enter", keyBinding: new KeyBinding(13), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "enter", keyBinding: new KeyBinding(13, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "escape", keyBinding: new KeyBinding(27), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "selectAll", keyBinding: new KeyBinding('a', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "toggleTabMode", keyBinding: new KeyBinding('m', true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - if (util.isMac) { - bindings.push({actionID: "deleteNext", keyBinding: new KeyBinding(46, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteWordPrevious", keyBinding: new KeyBinding(8, null, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "deleteWordNext", keyBinding: new KeyBinding(46, null, null, true), predefined: true}); //$NON-NLS-0$ - } - - bindings.push({actionID: "toggleWrapMode", keyBinding: new mKeyBinding.KeyBinding('w', true, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "toggleOverwriteMode", keyBinding: new mKeyBinding.KeyBinding(45)}); //$NON-NLS-0$ - - /* - * Feature in IE/Chrome: prevent ctrl+'u', ctrl+'i', and ctrl+'b' from applying styles to the text. - * - * Note that Chrome applies the styles on the Mac with Ctrl instead of Cmd. - */ - if (!util.isFirefox) { - var isMacChrome = util.isMac && util.isChrome; - bindings.push({actionID: "noop", keyBinding: new KeyBinding('u', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "noop", keyBinding: new KeyBinding('i', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "noop", keyBinding: new KeyBinding('b', !isMacChrome, false, false, isMacChrome), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - } - - if (util.isFirefox) { - bindings.push({actionID: "copy", keyBinding: new KeyBinding(45, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "paste", keyBinding: new KeyBinding(45, null, true), predefined: true}); //$NON-NLS-0$ - bindings.push({actionID: "cut", keyBinding: new KeyBinding(46, null, true), predefined: true}); //$NON-NLS-0$ - } - - // Add the emacs Control+ ... key bindings. - if (util.isMac) { - bindings.push({actionID: "lineStart", keyBinding: new KeyBinding("a", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "lineEnd", keyBinding: new KeyBinding("e", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "lineUp", keyBinding: new KeyBinding("p", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "lineDown", keyBinding: new KeyBinding("n", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "charPrevious", keyBinding: new KeyBinding("b", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "charNext", keyBinding: new KeyBinding("f", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "deletePrevious", keyBinding: new KeyBinding("h", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "deleteNext", keyBinding: new KeyBinding("d", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "deleteLineEnd", keyBinding: new KeyBinding("k", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - if (util.isFirefox) { - bindings.push({actionID: "scrollPageDown", keyBinding: new KeyBinding("v", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "deleteLineStart", keyBinding: new KeyBinding("u", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "deleteWordPrevious", keyBinding: new KeyBinding("w", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - } else { - bindings.push({actionID: "pageDown", keyBinding: new KeyBinding("v", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "centerLine", keyBinding: new KeyBinding("l", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "enterNoCursor", keyBinding: new KeyBinding("o", false, false, false, true), predefined: true}); //$NON-NLS-1$ //$NON-NLS-0$ - //TODO implement: y (yank), t (transpose) - } - } - return bindings; - }; - - return { - KeyMode: KeyMode, - DefaultKeyMode: DefaultKeyMode - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2013,2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textTheme", //$NON-NLS-0$ -[ - 'require', //$NON-NLS-0$ - 'orion/editor/eventTarget', //$NON-NLS-0$ - 'orion/util' //$NON-NLS-0$ -], function(require, mEventTarget, util) { - var THEME_PREFIX = "orion-theme-"; //$NON-NLS-0$ - - var Themes = {}; - - /** - * Constructs a new text theme. - * - * @class A TextTheme is a class used to specify an editor theme. - * @name orion.editor.TextTheme - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function TextTheme(options) { - options = options || {}; - this._document = options.document || document; - } - - /** - * Gets an instance of orion.editor.TextTheme by name. If the name - * paramenter is not speficed the default text theme instance is returned. - * Subsequent calls of getTheme with the same name will return - * the same instance. - */ - TextTheme.getTheme = function(name) { - name = name || "default"; //$NON-NLS-0$ - var theme = Themes[name]; - if (!theme) { - theme = Themes[name] = new TextTheme(); - } - return theme; - }; - - TextTheme.prototype = /** @lends orion.editor.TextTheme.prototype */ { - /** - * Returns the theme className. - * - * @see orion.editor.TextTheme#setThemeClass - */ - getThemeClass: function() { - return this._themeClass; - }, - /** - * @class This object represents a style sheet for a theme manager. - *

      - * See:
      - * {@link orion.editor.TextTheme#setThemeClass} - *

      - * @name orion.editor.ThemeStyleSheet - * - * @property {String} href The href of the stylesheet - */ - /** - * Sets the theme className and style sheet. - *

      - * If the stylesheet parameter is a string, it represents an inline - * CSS and it will be added to the document as a STYLE tag element. If the - * stylesheet parameter is a orion.editor.ThemeStyleSheet, - * its href property is loaded as either a STYLE tag element or as a LINK - * tag element. - *

      - *

      - * Listeners of the ThemeChanged event are notify once the styled sheet is loaded - * into the document. - *

      - * - * @param {String} className the new theme className. - * @param {String|orion.editor.ThemeStyleSheet} styleSheet the CSS stylesheet for the new theme className. - * - * @see orion.editor.TextTheme#getThemeClass - * @see orion.editor.TextTheme#onThemeChanged - */ - setThemeClass: function(className, styleSheet) { - var self = this; - var oldThemeClass = self._themeClass; - self._themeClass = className; - this._load(className, styleSheet, function() { - self.onThemeChanged({ - type: "ThemeChanged", //$NON-NLS-0$ - oldValue: oldThemeClass, - newValue: self.getThemeClass() - }); - }); - }, - /** - * @class This is the event sent when the theme className or style sheet has changed. - *

      - * See:
      - * {@link orion.editor.TextTheme}
      - * {@link orion.editor.TextTheme#event:onThemeChanged} - *

      - * @name orion.editor.ThemeChangedEvent - * - * @property {String} oldValue The old theme clasName. - * @property {String} newValue The new theme className. - */ - /** - * This event is sent when the theme clasName has changed and its style sheet has been loaded in the document. - * - * @event - * @param {orion.editor.ThemeChangedEvent} themeChangedEvent the event - */ - onThemeChanged: function(themeChangedEvent) { - return this.dispatchEvent(themeChangedEvent); - }, - buildStyleSheet: function(themeClass, settings) { - var convertCSSname = function(name) { - return name.replace(this._capitalRegEx, function(match) { - return "-" + match; //$NON-NLS-0$ - }.bind(this)).toLowerCase(); - }.bind(this); - - var parseStyles = function(object, ancestors, className, isTopLevel, result) { - var localResult = []; - var keys = Object.keys(object); - keys.forEach(function(key) { - var value = object[key]; - if (typeof(value) === "string") { //$NON-NLS-0$ - localResult.push("\t" + convertCSSname(key) + ": " + value + ";"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } else { - parseStyles( - value, - className === key ? ancestors : ancestors + (isTopLevel ? " ." : ".") + key, //$NON-NLS-1$ //$NON-NLS-0$ - className, - false, - result); - } - }); - if (localResult.length) { - result.push(ancestors + (isTopLevel ? ".textview" : "") + " {"); //$NON-NLS-0$ - result.push.apply(result, localResult); - result.push("}"); //$NON-NLS-0$ - } - }; - - var result = [""]; - parseStyles(settings.styles, "." + themeClass, settings.className, true, result); //$NON-NLS-0$ - return result.join("\n"); //$NON-NLS-0$ - }, - - /** - * @private - */ - _createStyle: function(className, styleSheet, callback, link) { - var document = this._document; - var id = THEME_PREFIX + className; - var node = document.getElementById(id); - if (node) { - if (link || node.firstChild.data === styleSheet) { - return; - } - node.removeChild(node.firstChild); - node.appendChild(document.createTextNode(styleSheet)); - } else { - if (link) { - node = util.createElement(document, "link"); //$NON-NLS-0$ - node.rel = "stylesheet"; //$NON-NLS-0$ - node.type = "text/css"; //$NON-NLS-0$ - node.href = styleSheet; - node.addEventListener("load", function() { //$NON-NLS-0$ - callback(); - }); - } else { - node = util.createElement(document, "style"); //$NON-NLS-0$ - node.appendChild(document.createTextNode(styleSheet)); - } - node.id = id; - var head = document.getElementsByTagName("head")[0] || document.documentElement; //$NON-NLS-0$ - head.appendChild(node); - } - if (!link) { - callback(); - } - }, - /** - * @private - */ - _load: function (className, styleSheet, callback) { - if (!className) { - callback(); - return; - } - if (typeof styleSheet === "string") { //$NON-NLS-0$ - this._createStyle(className, styleSheet, callback); - return; - } - var href = styleSheet.href; - var extension = ".css"; //$NON-NLS-0$ - if (href.substring(href.length - extension.length) !== extension) { - href += extension; - } - if (/^\//.test(href) || /[a-zA-Z0-9]+:\/\//i.test(href) || !require.toUrl /* almond cannot load dynamically */) { - this._createStyle(className, href, callback, true); - } else { - var self = this; - require(["text!" + href], function(cssText) { //$NON-NLS-0$ - self._createStyle(className, cssText, callback, false); - }); - } - }, - _capitalRegEx: /[A-Z]/g - }; - mEventTarget.EventTarget.addMixin(TextTheme.prototype); - - return { - TextTheme: TextTheme - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/util", [], function() { //$NON-NLS-0$ - - /** @private */ - function addEventListener(node, type, handler, capture) { - if (typeof node.addEventListener === "function") { //$NON-NLS-0$ - node.addEventListener(type, handler, capture === true); - } else { - node.attachEvent("on" + type, handler); //$NON-NLS-0$ - } - } - /** @private */ - function removeEventListener(node, type, handler, capture) { - if (typeof node.removeEventListener === "function") { //$NON-NLS-0$ - node.removeEventListener(type, handler, capture === true); - } else { - node.detachEvent("on" + type, handler); //$NON-NLS-0$ - } - } - /** @private */ - function contains(topNode, node) { - if (!node) { return false; } - if (!topNode.compareDocumentPosition) { - var temp = node; - while (temp) { - if (topNode === temp) { - return true; - } - temp = temp.parentNode; - } - return false; - } - return topNode === node || (topNode.compareDocumentPosition(node) & 16) !== 0; - } - /** @private */ - function getNodeStyle(node, prop, defaultValue) { - var value; - if (node) { - value = node.style[prop]; - if (!value) { - if (node.currentStyle) { - var index = 0, p = prop; - while ((index = p.indexOf("-", index)) !== -1) { //$NON-NLS-0$ - p = p.substring(0, index) + p.substring(index + 1, index + 2).toUpperCase() + p.substring(index + 2); - } - value = node.currentStyle[p]; - } else { - var css = node.ownerDocument.defaultView.getComputedStyle(node, null); - value = css ? css.getPropertyValue(prop) : null; - } - } - } - return value || defaultValue; - } - - /** - * @class - * @private - * @name orion.editor.Animation - * @description Creates an animation. - * @param {Object} options Options controlling the animation. - * @param {Array} options.curve Array of 2 values giving the start and end points for the animation. - * @param {Number} [options.duration=350] Duration of the animation, in milliseconds. - * @param {Function} [options.easing] - * @param {Function} [options.onAnimate] - * @param {Function} [options.onEnd] - * @param {Number} [options.rate=20] The time between frames, in milliseconds. - */ - var Animation = /** @ignore */ (function() { - function Animation(options) { - this.options = options; - } - /** - * Plays this animation. - * @function - * @memberOf orion.editor.Animation.prototype - * @name play - */ - Animation.prototype.play = function() { - var duration = (typeof this.options.duration === "number") ? this.options.duration : 350, //$NON-NLS-0$ - rate = (typeof this.options.rate === "number") ? this.options.rate : 20, //$NON-NLS-0$ - easing = this.options.easing || this.defaultEasing, - onAnimate = this.options.onAnimate || function() {}, - start = this.options.curve[0], - end = this.options.curve[1], - range = (end - start), - startedAt = -1, - propertyValue, - self = this; - - function onFrame() { - startedAt = (startedAt === -1) ? new Date().getTime() : startedAt; - var now = new Date().getTime(), - percentDone = (now - startedAt) / duration; - if (percentDone < 1) { - var eased = easing(percentDone); - propertyValue = start + (eased * range); - onAnimate(propertyValue); - } else { - onAnimate(end); - self.stop(); - } - } - this.interval = this.options.window.setInterval(onFrame, rate); - }; - /** - * Stops this animation. - * @function - * @memberOf orion.editor.Animation.prototype - */ - Animation.prototype.stop = function() { - this.options.window.clearInterval(this.interval); - var onEnd = this.options.onEnd || function () {}; - onEnd(); - }; - Animation.prototype.defaultEasing = function(x) { - return Math.sin(x * (Math.PI / 2)); - }; - return Animation; - }()); - - return { - contains: contains, - getNodeStyle: getNodeStyle, - addEventListener: addEventListener, - removeEventListener: removeEventListener, - Animation: Animation - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2011, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - *******************************************************************************/ -define ('orion/bidiUtils',[ - 'orion/util' - ], - function(util) { /* BDL */ - - function setBrowserLangDirection() { - - var lang; - if (window.dojoConfig) { - lang = window.dojoConfig.locale; - } - if (!lang) { - lang = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage); - } - var isBidi = lang && 'ar iw he'.indexOf((lang).substring(0, 2)) != - 1; - - if (isBidi) - { - var htmlElement = document.getElementsByTagName('html')[0]; - if (htmlElement){ //should be always true - htmlElement.setAttribute ("dir", "rtl"); - } - } - }; - - setBrowserLangDirection(); - - var bidiEnabledStorgae = '/orion/preferences/bidi/bidiEnabled'; //$NON-NLS-0$ - var bidiLayoutStorage = '/orion/preferences/bidi/bidiLayout'; //$NON-NLS-0$ - var LRE = '\u202A'; //$NON-NLS-0$ - var PDF = '\u202C'; //$NON-NLS-0$ - var RLE = '\u202B'; //$NON-NLS-0$ - - var isBidiEnabled = bidiEnabled(); - var bidiLayout = getBidiLayout(); - - /** - * checks if directionality should be applied in Orion. - * @returns {Boolean} true if globalization settings exist and bidi is enabled. - */ - function bidiEnabled() { - var bidiEnabled = localStorage.getItem(bidiEnabledStorgae); - if (bidiEnabled && bidiEnabled == 'true') { //$NON-NLS-0$ - return true; - } - else { - return false; - } - }; - - /** - * returns bidiLayout value set in globalization settings. - * @returns {String} text direction. - */ - function getBidiLayout() { - var bidiLayout = localStorage.getItem(bidiLayoutStorage); - if (bidiLayout && (bidiLayout == 'rtl' || bidiLayout == 'ltr' || bidiLayout == 'auto')) { //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - return bidiLayout; - } - else { - return 'ltr'; //$NON-NLS-0$ - } - }; - - /** - * returns text direction. - * this method is used for handling direction by adding a dir attribute in an HTML element. - * if bidiLayout is set to ltr > return ltr - * if bidiLayout is set to rtl > return rtl - * if bidiLayout is set to auto > check for first strong character in text and return ltr or rtl accordingly. - * @param {String} the text on which to set directionality - * @returns {String} text direction. rtl or ltr. - */ - function getTextDirection(text) { - bidiLayout = getBidiLayout(); - if (!bidiEnabled()) { - return ""; - } - if (bidiLayout == 'auto' && util.isIE) { //$NON-NLS-0$ - return checkContextual(text); - } - else { - return bidiLayout; - } - }; - - /** - * Wraps text by UCC (Unicode control characters) according to text direction - * In some cases defining the dir attribute in a different direction than the GUI orientation, - * changes the alignment of the text and/or adjacent elements such as icons. - * This doesn't follow the bidi standards (static text should be aligned following GUI direction). - * Therefore the only solution is to use UCC (Unicode control characters) to display the text in a correct orientation. - * (the text is changed for display purposes only. The original text in the repository remains unchanged) - * @param {String} the text to be wrapped - * @returns {String} text after adding ucc characters. - */ - function enforceTextDirWithUcc ( text ) { - if (bidiEnabled() && text.trim()) { - bidiLayout = getBidiLayout(); - var dir = bidiLayout == 'auto' ? checkContextual( text ) : bidiLayout; //$NON-NLS-0$ - return ( dir == 'ltr' ? LRE : RLE ) + text + PDF; //$NON-NLS-0$ - } - else { - return text; - } - }; - - /** - * Finds the first strong (directional) character. - * If it is Latin, return ltr. If it is bidi, return rtl. Otherwise, return ltr as default. - * @param {String} the text to be examined - * @returns {String} text direction. rtl or ltr. - */ - function checkContextual ( text ) { - // look for strong (directional) characters - var fdc = /[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec( text ); - // if found, return the direction that defined by the character, else return ltr as defult. - return fdc ? ( fdc[0] <= 'z' ? 'ltr' : 'rtl' ) : 'ltr'; //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - }; - - function addBidiEventListeners ( input ) { - if (!input._hasBidiEventListeners) { - input._hasBidiEventListeners = true; - - var eventTypes = ['keyup', 'cut', 'paste']; - for (var i = 0; i < eventTypes.length; ++i) { - input.addEventListener(eventTypes[i], handleInputEvent.bind(this), - false); - } - } - }; - - function handleInputEvent ( event ) { - var input = event.target; - if (input) { - input.dir = getTextDirection(input.value || input.textContent); // resolve dir attribute of the element - } - }; - - function initInputField ( input ) { - if (bidiEnabled() && input) { - input.dir = getTextDirection(input.value || input.textContent); // resolve dir attribute of the element - - if (util.isIE) { - addBidiEventListeners(input); - } - } - }; - - return { - bidiEnabled: bidiEnabled, - getTextDirection: getTextDirection, - enforceTextDirWithUcc: enforceTextDirWithUcc, - initInputField: initInputField - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - * Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584 - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textView", [ //$NON-NLS-1$ - 'i18n!orion/editor/nls/messages', //$NON-NLS-1$ - 'orion/editor/textModel', //$NON-NLS-1$ - 'orion/editor/keyModes', //$NON-NLS-1$ - 'orion/editor/eventTarget', //$NON-NLS-1$ - 'orion/editor/textTheme', //$NON-NLS-1$ - 'orion/editor/util', //$NON-NLS-1$ - 'orion/util', //$NON-NLS-1$ - 'orion/bidiUtils', //$NON-NLS-1$ - 'orion/metrics' //$NON-NLS-1$ -], function(messages, mTextModel, mKeyModes, mEventTarget, mTextTheme, textUtil, util, bidiUtils, mMetrics) { - - /** @private */ - function getWindow(doc) { - return doc.defaultView || doc.parentWindow; - } - function newArray(len) { - return new Array(len); - } - var addHandler = textUtil.addEventListener; - var removeHandler = textUtil.removeEventListener; - /** @private */ - function applyStyle(style, node, reset) { - if (reset) { - node.className = ""; - var attrs = node.attributes; - for (var i= attrs.length; i-->0;) { - if (!util.isIE || util.isIE >= 9 || (util.isIE < 9 && attrs[i].specified)) { - node.removeAttribute(attrs[i].name); - } - } - } - if (!style) { - return; - } - if (style.styleClass) { - node.className = style.styleClass; - } - var properties = style.style; - if (properties) { - for (var s in properties) { - if (properties.hasOwnProperty(s)) { - node.style[s] = properties[s]; - } - } - } - var attributes = style.attributes; - if (attributes) { - for (var a in attributes) { - if (attributes.hasOwnProperty(a)) { - node.setAttribute(a, attributes[a]); - } - } - } - } - /** @private */ - function clone(obj) { - /*Note that this code only works because of the limited types used in TextViewOptions */ - if (obj instanceof Array) { - return obj.slice(0); - } - return obj; - } - /** @private */ - function merge(obj1, obj2) { - if (!obj1) { - return obj2; - } - if (!obj2) { - return obj1; - } - for (var p in obj2) { - if (obj2.hasOwnProperty(p)) { - if (!obj1.hasOwnProperty(p)) { - obj1[p] = obj2[p]; - } - } - } - return obj1; - } - /** @private */ - function compare(s1, s2) { - if (s1 === s2) { return true; } - if (s1 && !s2 || !s1 && s2) { return false; } - if ((s1 && s1.constructor === String) || (s2 && s2.constructor === String)) { return false; } - if (s1 instanceof Array || s2 instanceof Array) { - if (!(s1 instanceof Array && s2 instanceof Array)) { return false; } - if (s1.length !== s2.length) { return false; } - for (var i = 0; i < s1.length; i++) { - if (!compare(s1[i], s2[i])) { - return false; - } - } - return true; - } - if (!(s1 instanceof Object) || !(s2 instanceof Object)) { return false; } - var p; - for (p in s1) { - if (s1.hasOwnProperty(p)) { - if (!s2.hasOwnProperty(p)) { return false; } - if (!compare(s1[p], s2[p])) {return false; } - } - } - for (p in s2) { - if (!s1.hasOwnProperty(p)) { return false; } - } - return true; - } - /** @private */ - function convertDelimiter(text, addTextFunc, addDelimiterFunc) { - var cr = 0, lf = 0, index = 0, len = text.length; - while (index < len) { - if (cr !== -1 && cr <= index) { cr = text.indexOf("\r", index); } //$NON-NLS-1$ - if (lf !== -1 && lf <= index) { lf = text.indexOf("\n", index); } //$NON-NLS-1$ - var start = index, end; - if (lf === -1 && cr === -1) { - addTextFunc(text.substring(index)); - break; - } - if (cr !== -1 && lf !== -1) { - if (cr + 1 === lf) { - end = cr; - index = lf + 1; - } else { - end = cr < lf ? cr : lf; - index = (cr < lf ? cr : lf) + 1; - } - } else if (cr !== -1) { - end = cr; - index = cr + 1; - } else { - end = lf; - index = lf + 1; - } - addTextFunc(text.substring(start, end)); - if (addDelimiterFunc) { - addDelimiterFunc(); - } else { - if (index === len) addTextFunc(""); - } - } - } - /** @private */ - function getBorder(node) { - var left,_top,right,bottom; - var win = getWindow(node.ownerDocument); - if (win.getComputedStyle) { - var style = win.getComputedStyle(node, null); - left = style.getPropertyValue("border-left-width"); //$NON-NLS-1$ - _top = style.getPropertyValue("border-top-width"); //$NON-NLS-1$ - right = style.getPropertyValue("border-right-width"); //$NON-NLS-1$ - bottom = style.getPropertyValue("border-bottom-width"); //$NON-NLS-1$ - } else if (node.currentStyle) { - left = node.currentStyle.borderLeftWidth; - _top = node.currentStyle.borderTopWidth; - right = node.currentStyle.borderRightWidth; - bottom = node.currentStyle.borderBottomWidth; - } - return { - left: parseInt(left, 10) || 0, - top: parseInt(_top, 10) || 0, - right: parseInt(right, 10) || 0, - bottom: parseInt(bottom, 10) || 0 - }; - } - /** @private */ - function getPadding(node) { - var left,_top,right,bottom; - var win = getWindow(node.ownerDocument); - if (win.getComputedStyle) { - var style = win.getComputedStyle(node, null); - left = style.getPropertyValue("padding-left"); //$NON-NLS-1$ - _top = style.getPropertyValue("padding-top"); //$NON-NLS-1$ - right = style.getPropertyValue("padding-right"); //$NON-NLS-1$ - bottom = style.getPropertyValue("padding-bottom"); //$NON-NLS-1$ - } else if (node.currentStyle) { - left = node.currentStyle.paddingLeft; - _top = node.currentStyle.paddingTop; - right = node.currentStyle.paddingRight; - bottom = node.currentStyle.paddingBottom; - } - return { - left: parseInt(left, 10) || 0, - top: parseInt(_top, 10) || 0, - right: parseInt(right, 10) || 0, - bottom: parseInt(bottom, 10) || 0 - }; - } - /** @private */ - function getLineTrim(line) { - var trim = line._trim; - if (!trim) { - trim = getPadding(line); - var border = getBorder(line); - trim.left += border.left; - trim.top += border.top; - trim.right += border.right; - trim.bottom += border.bottom; - line._trim = trim; - } - return trim; - } - /** @private */ - function DOMReady(doc, _parent, className, callback) { - className = "_" + className + "DOMReady"; //$NON-NLS-1$ //$NON-NLS-1$ - _parent.className = _parent.className ? _parent.className + " " + className : className; //$NON-NLS-1$ - _parent.__DOMReady = callback; - var id = className + "Style"; //$NON-NLS-1$ - if (doc.getElementById(id)) { return; } - var animationName = className + "Animation"; //$NON-NLS-1$ - function insertListener(evt) { - if (evt.animationName === animationName) { - var target = evt.target; - if (typeof target.__DOMReady === "function") { //$NON-NLS-1$ - getWindow(doc).setTimeout(function() { - target.__DOMReady(); - }, 0); - } - } - } - function template(className, animationName) { - var props = ["", "-webkit-", "-moz-", "-ms-", "-o-"]; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - var _frames = "", classRule = "body ." + className + " {\n"; //$NON-NLS-1$ //$NON-NLS-2$ - for (var i=0; i= 0; i--) { - if (selections[i]._editing) return selections[i]; - } - return selections[selections.length - 1]; - } - for (i = 0; i < selections.length; i++) { - if (selections[i]._editing) return selections[i]; - } - return selections[0]; - }; - /** @private */ - Selection.convert = function(selections) { - if (selections.length === 1) return selections[0]; - return selections; - }; - /** @private */ - Selection.contains = function(selections, offset) { - return selections.some(function(selection) { - return selection.contains(offset); - }); - }; - /** @private */ - Selection.merge = function(selections) { - if (selections.length <= 1) return selections; - selections.sort(function(a, b) { - return a.start - b.start; - }); - var result = []; - var current = selections[0]; - for (var i = 1; i < selections.length; i++) { - if (selections[i].start >= current.end || current._editing || selections[i]._editing) { - result.push(current); - current = selections[i]; - } else { - current.end = Math.max(current.end, selections[i].end); - } - } - result.push(current); - return result; - }; - Selection.prototype = /** @lends orion.editor.Selection.prototype */ { - /** @private */ - clone: function() { - var result = new Selection(this.start, this.end, this.caret); - result._columnX = this._columnX; - result._editing = this._editing; - result._docX = this._docX; - return result; - }, - /** @private */ - contains: function(offset) { - if (this.start <= offset && offset < this.end) { - return true; - } - return false; - }, - /** @private */ - collapse: function() { - if (this.caret) { - this.end = this.start; - } else { - this.start = this.end; - } - }, - /** @private */ - extend: function (offset) { - if (this.caret) { - this.start = offset; - } else { - this.end = offset; - } - if (this.start > this.end) { - var tmp = this.start; - this.start = this.end; - this.end = tmp; - this.caret = !this.caret; - } - }, - /** @private */ - setCaret: function(offset) { - this.start = offset; - this.end = offset; - this.caret = false; - }, - /** @private */ - getCaret: function() { - return this.caret ? this.start : this.end; - }, - /** @private */ - getAnchor: function() { - return this.caret ? this.end : this.start; - }, - /** @private */ - getOrientedSelection: function() { - return {start: this.getAnchor(), end: this.getCaret()}; - }, - /** @private */ - toString: function() { - return "start=" + this.start + " end=" + this.end + (this.caret ? " caret is at start" : " caret is at end"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-4$ - }, - /** @private */ - isEmpty: function() { - return this.start === this.end; - }, - /** @private */ - equals: function(object) { - return this.caret === object.caret && this.start === object.start && this.end === object.end && this._editing === object._editing; - } - }; - /** @private */ - function DOMSelection (view) { - this._view = view; - this._divs = []; - var _parent = view._clipDiv || view._rootDiv; - for (var i=0; i<3; i++) { - var div = view._createSelectionDiv(); - _parent.appendChild(div); - this._divs.push(div); - } - } - DOMSelection.prototype = /** @lends orion.editor.DOMSelection.prototype */ { - /** @private */ - destroy: function() { - if (!this._divs) return; - this._divs.forEach(function(div) { - div.parentNode.removeChild(div); - }); - this._divs = null; - }, - /** @private */ - setPrimary: function(enabled) { - this.primary = enabled; - }, - /** @private */ - update: function() { - var view = this._view; - var primary = this.primary; - var focused = view._hasFocus; - var visible = view._cursorVisible; - var cursor = !this.primary && this._selection && this._selection.isEmpty(); - var className; - if (cursor) { - className = "textviewSelectionCaret"; //$NON-NLS-1$ - } else { - className = focused ? "textviewSelection" : "textviewSelectionUnfocused"; //$NON-NLS-1$ //$NON-NLS-2$ - } - this._divs[0].style.visibility = (cursor && visible && focused) || !cursor ? "visible" : "hidden"; //$NON-NLS-1$ //$NON-NLS-2$ - this._divs[0].style.zIndex = visible && cursor ? "2" : "0"; //$NON-NLS-1$ //$NON-NLS-2$ - this._divs.forEach(function(div) { - div.className = className; - if (util.isWebkit < 537.36 && primary) { - div.style.background = focused ? "transparent" : ""; //$NON-NLS-1$ - } - }); - }, - /** @private */ - setSelection: function (selection) { - this._selection = selection; - this.update(); - var view = this._view; - var model = view._model; - var startLine = model.getLineAtOffset(selection.start); - var endLine = model.getLineAtOffset(selection.end); - var firstNode = view._getLineNext(); - /* - * Bug in Firefox. For some reason, after a update page sometimes the - * firstChild returns null incorrectly. The fix is to ignore show selection. - */ - if (!firstNode) { return; } - var lastNode = view._getLinePrevious(); - - var topNode, bottomNode, topOffset, bottomOffset; - if (startLine < firstNode.lineIndex) { - topNode = firstNode; - topOffset = model.getLineStart(firstNode.lineIndex); - } else if (startLine > lastNode.lineIndex) { - topNode = lastNode; - topOffset = model.getLineStart(lastNode.lineIndex); - } else { - topNode = view._getLineNode(startLine); - topOffset = selection.start; - } - - if (endLine < firstNode.lineIndex) { - bottomNode = firstNode; - bottomOffset = model.getLineStart(firstNode.lineIndex); - } else if (endLine > lastNode.lineIndex) { - bottomNode = lastNode; - bottomOffset = model.getLineStart(lastNode.lineIndex); - } else { - bottomNode = view._getLineNode(endLine); - bottomOffset = selection.end; - } - this._setDOMSelection(topNode, topOffset, bottomNode, bottomOffset, selection.caret); - }, - /** @private */ - _setDOMSelection: function (startNode, startOffset, endNode, endOffset, startCaret) { - this._setDOMFullSelection(startNode, startOffset, endNode, endOffset); - if (!this.primary) { return; } - var view = this._view; - var start = startNode._line.getNodeOffset(startOffset); - var end = endNode._line.getNodeOffset(endOffset); - if (!start.node || !end.node) return; - var range; - var win = view._getWindow(); - var doc = view._parent.ownerDocument; - if (win.getSelection) { - //W3C - var sel = win.getSelection(); - range = doc.createRange(); - range.setStart(start.node, start.offset); - range.setEnd(end.node, end.offset); - if (view._hasFocus && ( - sel.anchorNode !== start.node || sel.anchorOffset !== start.offset || - sel.focusNode !== end.node || sel.focusOffset !== end.offset || - sel.anchorNode !== end.node || sel.anchorOffset !== end.offset || - sel.focusNode !== start.node || sel.focusOffset !== start.offset)) - { - view._anchorNode = start.node; - view._anchorOffset = start.offset; - view._focusNode = end.node; - view._focusOffset = end.offset; - view._ignoreSelect = false; - if (sel.rangeCount > 0) { sel.removeAllRanges(); } - sel.addRange(range); - view._ignoreSelect = true; - } - if (view._cursorDiv) { - range = doc.createRange(); - if (startCaret) { - range.setStart(start.node, start.offset); - range.setEnd(start.node, start.offset); - } else { - range.setStart(end.node, end.offset); - range.setEnd(end.node, end.offset); - } - var rect = range.getClientRects()[0]; - var cursorParent = view._cursorDiv.parentNode; - var clientRect = cursorParent.getBoundingClientRect(); - if (rect && clientRect) { - view._cursorDiv.style.top = (rect.top - clientRect.top + cursorParent.scrollTop) + "px"; //$NON-NLS-1$ - view._cursorDiv.style.left = (rect.left - clientRect.left + cursorParent.scrollLeft) + "px"; //$NON-NLS-1$ - } - } - } else if (doc.selection) { - if (!view._hasFocus) { return; } - //IE < 9 - var body = doc.body; - - /* - * Bug in IE. For some reason when text is deselected the overflow - * selection at the end of some lines does not get redrawn. The - * fix is to create a DOM element in the body to force a redraw. - */ - var child = util.createElement(doc, "div"); //$NON-NLS-1$ - body.appendChild(child); - body.removeChild(child); - - range = body.createTextRange(); - range.moveToElementText(start.node.parentNode); - range.moveStart("character", start.offset); //$NON-NLS-1$ - var endRange = body.createTextRange(); - endRange.moveToElementText(end.node.parentNode); - endRange.moveStart("character", end.offset); //$NON-NLS-1$ - range.setEndPoint("EndToStart", endRange); //$NON-NLS-1$ - view._ignoreSelect = false; - range.select(); - view._ignoreSelect = true; - } - }, - /** @private */ - _setDOMFullSelection: function(startNode, startOffset, endNode, endOffset) { - this._divs.forEach(function(div) { - div.style.width = div.style.height = "0px"; //$NON-NLS-1$ - }); - var view = this._view; - if (!view._fullSelection) { return; } - if (util.isIOS) { return; } - if (startNode === endNode && startOffset === endOffset && this.primary) { return; } - var viewPad = view._getViewPadding(); - var clientRect = view._clientDiv.getBoundingClientRect(); - var viewRect = view._viewDiv.getBoundingClientRect(); - var left = viewRect.left + viewPad.left; - var right = clientRect.right; - var _top = viewRect.top + viewPad.top; - var bottom = clientRect.bottom; - var hd = 0, vd = 0; - if (view._clipDiv) { - var clipRect = view._clipDiv.getBoundingClientRect(); - hd = clipRect.left - view._clipDiv.scrollLeft; - vd = clipRect.top; - } else { - var rootpRect = view._rootDiv.getBoundingClientRect(); - hd = rootpRect.left; - vd = rootpRect.top; - } - view._ignoreDOMSelection = true; - var startLine = new TextLine(view, startNode.lineIndex, startNode); - var startRect = startLine.getBoundingClientRect(startOffset, false); - var l = startRect.left, endLine, endRect; - if (startNode === endNode && startOffset === endOffset) { - endLine = startLine; - endRect = startRect; - } else { - endLine = new TextLine(view, endNode.lineIndex, endNode); - endRect = endLine.getBoundingClientRect(endOffset, false); - } - var r = endRect.left; - view._ignoreDOMSelection = false; - var sel1Div = this._divs[0]; - var sel1Left = Math.min(right, Math.max(left, l)); - var sel1Top = Math.min(bottom, Math.max(_top, startRect.top)); - var sel1Right = right; - var sel1Bottom = Math.min(bottom, Math.max(_top, startRect.bottom)); - sel1Div.style.left = (sel1Left - hd) + "px"; //$NON-NLS-1$ - sel1Div.style.top = (sel1Top - vd) + "px"; //$NON-NLS-1$ - sel1Div.style.width = Math.max(0, sel1Right - sel1Left) + "px"; //$NON-NLS-1$ - sel1Div.style.height = Math.max(0, sel1Bottom - sel1Top) + "px"; //$NON-NLS-1$ - if (startNode.lineIndex === endNode.lineIndex) { - sel1Right = Math.min(r, right); - sel1Div.style.width = Math.max(this.primary ? 0 : 1, sel1Right - sel1Left) + "px"; //$NON-NLS-1$ - } else { - var sel3Left = left; - var sel3Top = Math.min(bottom, Math.max(_top, endRect.top)); - var sel3Right = Math.min(right, Math.max(left, r)); - var sel3Bottom = Math.min(bottom, Math.max(_top, endRect.bottom)); - var sel3Div = this._divs[2]; - sel3Div.style.left = (sel3Left - hd) + "px"; //$NON-NLS-1$ - sel3Div.style.top = (sel3Top - vd) + "px"; //$NON-NLS-1$ - sel3Div.style.width = Math.max(0, sel3Right - sel3Left) + "px"; //$NON-NLS-1$ - sel3Div.style.height = Math.max(0, sel3Bottom - sel3Top) + "px"; //$NON-NLS-1$ - if (Math.abs(startNode.lineIndex - endNode.lineIndex) > 1) { - var sel2Div = this._divs[1]; - sel2Div.style.left = (left - hd) + "px"; //$NON-NLS-1$ - sel2Div.style.top = (sel1Bottom - vd) + "px"; //$NON-NLS-1$ - sel2Div.style.width = Math.max(0, right - left) + "px"; //$NON-NLS-1$ - sel2Div.style.height = Math.max(0, sel3Top - sel1Bottom) + "px"; //$NON-NLS-1$ - } - } - } - }; - /** @private */ - function TextRect (rect) { - this.left = rect.left; - this.top = rect.top; - this.right = rect.right; - this.bottom = rect.bottom; - } - TextRect.prototype = /** @lends orion.editor.TextRect.prototype */ { - /** @private */ - toString: function() { - return "{l=" + this.left + ", t=" + this.top + ", r=" + this.right + ", b=" + this.bottom + "}"; //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$ - } - }; - /** - * Constructs a new TextLine object. - * - * @class A TextLine represents a line of text in the view. - * @name orion.editor.TextLine - * @private - */ - function TextLine (view, lineIndex, lineDiv) { - /** - * The view. - * - * @name orion.editor.TextLine#view - * @private - */ - this.view = view; - /** - * The line index. - * - * @name orion.editor.TextLine#lineIndex - * @private - */ - this.lineIndex = lineIndex; - - this._lineDiv = lineDiv; - } - TextLine.prototype = /** @lends orion.editor.TextLine.prototype */ { - /** @private */ - create: function(_parent, div) { - if (this._lineDiv) { return; } - var child = this._lineDiv = this._createLine(_parent, div, this.lineIndex); - child._line = this; - return child; - }, - _createLine: function(_parent, div, lineIndex) { - var view = this.view; - var model = view._model; - var lineText = model.getLine(lineIndex); - var lineStart = model.getLineStart(lineIndex); - var e = {type:"LineStyle", textView: view, lineIndex: lineIndex, lineText: lineText, lineStart: lineStart}; //$NON-NLS-1$ - view.onLineStyle(e); - var doc = _parent.ownerDocument; - var lineDiv = div || util.createElement(doc, "div"); //$NON-NLS-1$ - if (!div || !compare(div.viewStyle, e.style)) { - applyStyle(e.style, lineDiv, div); - if (div) { div._trim = null; } - lineDiv.viewStyle = e.style; - } - lineDiv.lineIndex = lineIndex; - - if (div && lineDiv.viewLineText === lineText && compare(e.ranges, lineDiv.viewRanges)) { - return lineDiv; - } - lineDiv.viewRanges = e.ranges; - lineDiv.viewLineText = lineText; - - var ranges = []; - var data = {tabOffset: 0, ranges: ranges}; - this._createRanges(e.ranges, lineText, 0, lineText.length, lineStart, data); - - /* - * A trailing span with a whitespace is added for three different reasons: - * 1. Make sure the height of each line is the largest of the default font - * in normal, italic, bold, and italic-bold. - * 2. When full selection is off, Firefox, Opera and IE9 do not extend the - * selection at the end of the line when the line is fully selected. - * 3. The height of a div with only an empty span is zero. - */ - var c = " "; //$NON-NLS-1$ - if (!view._fullSelection && util.isIE < 9) { - /* - * IE8 already selects extra space at end of a line fully selected, - * adding another space at the end of the line causes the selection - * to look too big. The fix is to use a zero-width space (\uFEFF) instead. - */ - c = "\uFEFF"; //$NON-NLS-1$ - } - var range = {text: c, style: view._metrics.largestFontStyle, ignoreChars: 1}; - if (ranges.length === 0 || !ranges[ranges.length - 1].style || ranges[ranges.length - 1].style.tagName !== "div") { //$NON-NLS-1$ - ranges.push(range); - } else { - ranges.splice(ranges.length - 1, 0, range); - } - - var span, style, oldSpan, oldStyle, text, oldText, end = 0, oldEnd = 0, next, i; - if (util.isFirefox && lineText.length > 2000) { - if (div) { - lineDiv.innerHTML = ""; - div.lineWidth = undefined; - } - var frag = doc.createDocumentFragment(); - for (i = 0; i < ranges.length; i++) { - range = ranges[i]; - text = range.text; - style = range.style; - span = this._createSpan(lineDiv, text, style, range.ignoreChars); - frag.appendChild(span); - } - lineDiv.appendChild(frag); - } else { - var changeCount, changeStart; - if (div) { - var modelChangedEvent = div.modelChangedEvent; - if (modelChangedEvent) { - if (modelChangedEvent.removedLineCount === 0 && modelChangedEvent.addedLineCount === 0) { - changeStart = modelChangedEvent.start - lineStart; - changeCount = modelChangedEvent.addedCharCount - modelChangedEvent.removedCharCount; - } else { - changeStart = -1; - } - div.modelChangedEvent = undefined; - } - oldSpan = div.firstChild; - } - for (i = 0; i < ranges.length; i++) { - range = ranges[i]; - text = range.text; - end += text.length; - style = range.style; - if (oldSpan) { - oldText = oldSpan.firstChild.data; - oldStyle = oldSpan.viewStyle; - if (oldText === text && compare(style, oldStyle)) { - oldEnd += oldText.length; - oldSpan._rectsCache = undefined; - span = oldSpan = oldSpan.nextSibling; - continue; - } else { - while (oldSpan) { - if (changeStart !== -1) { - var spanEnd = end; - if (spanEnd >= changeStart) { - spanEnd -= changeCount; - } - var t = oldSpan.firstChild.data; - var len = t ? t.length : 0; - if (oldEnd + len > spanEnd) { break; } - oldEnd += len; - } - next = oldSpan.nextSibling; - lineDiv.removeChild(oldSpan); - oldSpan = next; - } - } - } - span = this._createSpan(lineDiv, text, style, range.ignoreChars); - if (oldSpan) { - lineDiv.insertBefore(span, oldSpan); - } else { - lineDiv.appendChild(span); - } - if (div) { - div.lineWidth = undefined; - } - } - if (div) { - var tmp = span ? span.nextSibling : null; - while (tmp) { - next = tmp.nextSibling; - div.removeChild(tmp); - tmp = next; - } - } - } - if (!lineDiv.parentNode) { - _parent.appendChild(lineDiv); - } - return lineDiv; - }, - _createRanges: function(ranges, text, start, end, lineStart, data) { - if (start > end) { return; } - if (ranges) { - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.end < lineStart + start) { continue; } - var styleStart = Math.max(lineStart + start, range.start) - lineStart; - if (styleStart > end) { break; } - var styleEnd = Math.min(lineStart + end, range.end) - lineStart; - if (styleStart <= styleEnd) { - styleStart = Math.max(start, styleStart); - styleEnd = Math.min(end, styleEnd); - if (start < styleStart) { - this._createRange(text, start, styleStart, null, data); - } - if (!range.style || !range.style.unmergeable) { - while (i + 1 < ranges.length && ranges[i + 1].start - lineStart === styleEnd && compare(range.style, ranges[i + 1].style)) { - range = ranges[i + 1]; - styleEnd = Math.min(lineStart + end, range.end) - lineStart; - i++; - } - } - this._createRange(text, styleStart, styleEnd, range.style, data); - start = styleEnd; - } - } - } - if (start < end) { - this._createRange(text, start, end, null, data); - } - }, - _createRange: function(text, start, end, style, data) { - if (start > end) { return; } - var tabSize = this.view._customTabSize, range; - var bidiStyle = {tagName:"span", bidi:true, style:{unicodeBidi:"embed", direction:"ltr"}}; - var bidiRange = {text: "\u200E", style: bidiStyle}; // We ensure segments flow from left to right by adding a LRM marker \u200E - if (tabSize && tabSize !== 8) { - var tabIndex = text.indexOf("\t", start); //$NON-NLS-1$ - while (tabIndex !== -1 && tabIndex < end) { - if (start < tabIndex) { - range = {text: text.substring(start, tabIndex), style: style}; - data.ranges.push(range); - if (bidiUtils.isBidiEnabled) { - data.ranges.push(bidiRange); - } - data.tabOffset += range.text.length; - } - var spacesCount = tabSize - (data.tabOffset % tabSize); - if (spacesCount > 0) { - //TODO hack to preserve tabs in getDOMText() - var spaces = "\u00A0"; //$NON-NLS-1$ - for (var i = 1; i < spacesCount; i++) { - spaces += " "; //$NON-NLS-1$ - } - range = {text: spaces, style: style, ignoreChars: spacesCount - 1}; - data.ranges.push(range); - if (bidiUtils.isBidiEnabled) { - data.ranges.push(bidiRange); - } - data.tabOffset += range.text.length; - } - start = tabIndex + 1; - if (start === end) { - return; - } - tabIndex = text.indexOf("\t", start); //$NON-NLS-1$ - } - } - if (start <= end) { - range = {text: text.substring(start, end), style: style}; - data.ranges.push(range); - if (bidiUtils.isBidiEnabled) { - data.ranges.push(bidiRange); - } - data.tabOffset += range.text.length; - } - }, - _createSpan: function(_parent, text, style, ignoreChars) { - var view = this.view; - var tagName = "span"; //$NON-NLS-1$ - if (style && style.tagName) { - tagName = style.tagName.toLowerCase(); - } - var isLink = tagName === "a"; //$NON-NLS-1$ - if (isLink) { this.hasLink = true; } - if (isLink && !view._linksVisible) { - tagName = "span"; //$NON-NLS-1$ - } - var doc = _parent.ownerDocument; - var child = util.createElement(_parent.ownerDocument, tagName); - child.appendChild(doc.createTextNode(style && style.text ? style.text : text)); - if (style && style.html) { - child.innerHTML = style.html; - child.ignore = true; - } else if (style && style.node) { - child.appendChild(style.node); - child.ignore = true; - } else if (style && style.bidi) { - child.ignore = true; - } - applyStyle(style, child); - if (tagName === "a") { //$NON-NLS-1$ - var win = view._getWindow(); - addHandler(child, "click", function(e) { return view._handleLinkClick(e ? e : win.event); }, false); //$NON-NLS-1$ - } - child.viewStyle = style; - if (ignoreChars) { - child.ignoreChars = ignoreChars; - } - return child; - }, - _ensureCreated: function() { - if (this._lineDiv) { return this._lineDiv; } - return (this._createdDiv = this.create(this.view._clientDiv, null)); - }, - /** @private */ - getBoundingClientRect: function(offset, absolute) { - var child = this._ensureCreated(); - var view = this.view; - if (offset === undefined) { - return this._getLineBoundingClientRect(child, true); - } - var model = view._model; - var doc = child.ownerDocument; - var lineIndex = this.lineIndex; - var result = null; - if (offset < model.getLineEnd(lineIndex)) { - var lineOffset = model.getLineStart(lineIndex); - this.forEach(function(lineChild) { - var textNode = lineChild.firstChild; - var nodeLength = this._nodeLength(lineChild); - if (lineOffset + nodeLength > offset) { - var index = offset - lineOffset; - var range; - if (textNode.length === 1) { - result = new TextRect(lineChild.getBoundingClientRect()); - } else if (view._isRangeRects) { - range = doc.createRange(); - range.setStart(textNode, index); - range.setEnd(textNode, index + 1); - result = new TextRect(range.getBoundingClientRect()); - } else if (util.isIE) { - range = doc.body.createTextRange(); - range.moveToElementText(lineChild); - range.collapse(); - /* - * Bug in IE8. TextRange.getClientRects() and TextRange.getBoundingClientRect() fails - * if the line child is not the first element in the line and if the start offset is 0. - * The fix is to use Node.getClientRects() left edge instead. - */ - var fixIE8 = index === 0 && util.isIE === 8; - if (fixIE8) { index = 1; } - range.moveEnd("character", index + 1); //$NON-NLS-1$ - range.moveStart("character", index); //$NON-NLS-1$ - result = new TextRect(range.getBoundingClientRect()); - if (fixIE8) { - result.left = lineChild.getClientRects()[0].left; - } - } else { - var text = textNode.data; - lineChild.removeChild(textNode); - lineChild.appendChild(doc.createTextNode(text.substring(0, index))); - var span = util.createElement(doc, "span"); //$NON-NLS-1$ - span.appendChild(doc.createTextNode(text.substring(index, index + 1))); - lineChild.appendChild(span); - lineChild.appendChild(doc.createTextNode(text.substring(index + 1))); - result = new TextRect(span.getBoundingClientRect()); - lineChild.innerHTML = ""; - lineChild.appendChild(textNode); - if (!this._createdDiv) { - /* - * Removing the element node that holds the selection start or end - * causes the selection to be lost. The fix is to detect this case - * and restore the selection. - */ - var s = view._getSelections()[0]; - if ((lineOffset <= s.start && s.start < lineOffset + nodeLength) || (lineOffset <= s.end && s.end < lineOffset + nodeLength)) { - view._updateDOMSelection(); - } - } - } - if (util.isIE < 11) { - var win = getWindow(child.ownerDocument); - var xFactor = win.screen.logicalXDPI / win.screen.deviceXDPI; - var yFactor = win.screen.logicalYDPI / win.screen.deviceYDPI; - result.left = result.left * xFactor; - result.right = result.right * xFactor; - result.top = result.top * yFactor; - result.bottom = result.bottom * yFactor; - } - return false; - } - lineOffset += nodeLength; - return true; - }); - } - var rect = this.getBoundingClientRect(); - if (!result) { - if (view._wrapMode) { - var rects = this.getClientRects(); - result = rects[rects.length - 1]; - result.left = result.right; - result.left += rect.left; - result.top += rect.top; - result.right += rect.left; - result.bottom += rect.top; - } else { - result = new TextRect(rect); - result.left = result.right; - } - } - if (absolute || absolute === undefined) { - result.left -= rect.left; - result.top -= rect.top; - result.right -= rect.left; - result.bottom -= rect.top; - } - return result; - }, - forEach: function(callback) { - var child = this._ensureCreated(); - var lineChild = child.firstChild; - while (lineChild) { - var next = lineChild.nextSibling; - if (!lineChild.ignore) { - if (!callback.call(this, lineChild)) { - break; - } - } - lineChild = next; - } - }, - /** @private */ - _getClientRects: function(element, parentRect) { - var rects, newRects, rect, i; - if (!element._rectsCache) { - rects = element.getClientRects(); - newRects = newArray(rects.length); - for (i = 0; i r.right) { r.right = rect.right; } - if (rect.bottom > r.bottom) { r.bottom = rect.bottom; } - } - } - return true; - }); - if (lineIndex !== undefined) { - return result[lineIndex]; - } - return result; - }, - /** @private */ - _getLineBoundingClientRect: function (child, noTrim) { - var rect = new TextRect(child.getBoundingClientRect()); - if (this.view._wrapMode) { - } else { - rect.right = rect.left; - var lastChild = child.lastChild; - //Remove any artificial trailing whitespace in the line - while (lastChild && lastChild.ignoreChars === lastChild.firstChild.length) { - lastChild = lastChild.previousSibling; - } - if (lastChild) { - var lastRect = lastChild.getBoundingClientRect(); - rect.right = lastRect.right + getLineTrim(child).right; - } - } - if (noTrim) { - var padding = getLineTrim(child); - rect.left = rect.left + padding.left; - rect.right = rect.right - padding.right; - } - return rect; - }, - /** @private */ - getLineCount: function () { - if (!this.view._wrapMode) { return 1; } - return this.getClientRects().length; - }, - /** @private */ - getLineIndex: function(offset) { - if (!this.view._wrapMode) { return 0; } - var rects = this.getClientRects(); - var rect = this.getBoundingClientRect(offset); - var center = rect.top + ((rect.bottom - rect.top) / 2); - for (var i = 0; i < rects.length; i++) { - if (rects[i].top <= center && center < rects[i].bottom) { - return i; - } - } - return rects.length - 1; - }, - /** @private */ - getLineStart: function (lineIndex) { - if (!this.view._wrapMode || lineIndex === 0) { - return this.view._model.getLineStart(this.lineIndex); - } - var rects = this.getClientRects(); - return this.getOffset(rects[lineIndex].left + 1, rects[lineIndex].top + 1); - }, - _nodeLength: function(lineChild) { - if (!lineChild || lineChild.ignore) return 0; - var len = lineChild.firstChild.length; - if (lineChild.ignoreChars) { - len -= lineChild.ignoreChars; - } - return len; - }, - getModelOffset: function(node, offset) { - if (!node) { return 0; } - var lineOffset = 0; - this.forEach(function(lineChild) { - var textNode = lineChild.firstChild; - if (textNode === node) { - if (lineChild.ignoreChars) { lineOffset -= lineChild.ignoreChars; } - lineOffset += offset; - return false; - } - if (lineChild.ignoreChars) { lineOffset -= lineChild.ignoreChars; } - lineOffset += textNode.data.length; - return true; - }); - return Math.max(0, lineOffset) + this.view._model.getLineStart(this.lineIndex); - }, - getNodeOffset: function(modelOffset) { - var offset = 0; - var lineNode, lineNodeOffset; - var model = this.view._model; - var lineStart = model.getLineStart(this.lineIndex); - var lineOffset = modelOffset - lineStart; - var end = model.getLineEnd(this.lineIndex) - lineStart; - this.forEach(function(lineChild) { - var node = lineChild.firstChild; - var nodeLength = this._nodeLength(lineChild); - if (nodeLength + offset > lineOffset || offset + nodeLength >= end) { - lineNode = node; - lineNodeOffset = lineOffset - offset; - if (lineChild.ignoreChars && nodeLength > 0 && lineNodeOffset === nodeLength) { - lineNodeOffset += lineChild.ignoreChars; - } - return false; - } - offset += nodeLength; - return true; - }); - return {node: lineNode, offset: lineNodeOffset}; - }, - getText: function(offsetNode) { - var text = "", offset = 0; - this.forEach(function(lineChild) { - var textNode; - if (lineChild.ignoreChars) { - textNode = lineChild.lastChild; - var ignored = 0, childText = [], childOffset = -1; - while (textNode) { - var data = textNode.data; - if (data) { - for (var i = data.length - 1; i >= 0; i--) { - var ch = data.substring(i, i + 1); - if (ignored < lineChild.ignoreChars && (ch === " " || ch === "\uFEFF")) { //$NON-NLS-1$ //$NON-NLS-1$ - ignored++; - } else { - childText.push(ch === "\u00A0" ? "\t" : ch); //$NON-NLS-1$ //$NON-NLS-1$ - } - } - } - if (offsetNode === textNode) { - childOffset = childText.length; - } - textNode = textNode.previousSibling; - } - childText = childText.reverse().join(""); - if (childOffset !== -1) { - offset = text.length + childText.length - childOffset; - } - text += childText; - } else { - textNode = lineChild.firstChild; - while (textNode) { - if (offsetNode === textNode) { - offset = text.length; - } - text += textNode.data; - textNode = textNode.nextSibling; - } - } - return true; - }); - return {text: text, offset: offset}; - }, - /** @private */ - getOffset: function(x, y) { - var view = this.view; - var model = view._model; - var lineIndex = this.lineIndex; - var lineStart = model.getLineStart(lineIndex); - var lineEnd = model.getLineEnd(lineIndex); - if (lineStart === lineEnd) { - return lineStart; - } - var child = this._ensureCreated(); - var lineRect = this.getBoundingClientRect(); - - var that = this; - function hitChild(lineChild, offset, rect) { - var textNode = lineChild.firstChild; - var nodeLength = that._nodeLength(lineChild); - var doc = child.ownerDocument; - var win = getWindow(doc); - var xFactor = util.isIE < 11 ? win.screen.logicalXDPI / win.screen.deviceXDPI : 1; - var yFactor = util.isIE < 11 ? win.screen.logicalYDPI / win.screen.deviceYDPI : 1; - var rangeLeft, rangeTop, rangeRight, rangeBottom; - var range, start, end; - var rl = rect.left + lineRect.left, fixIE8, rects1; - if (util.isIE || view._isRangeRects) { - range = view._isRangeRects ? doc.createRange() : doc.body.createTextRange(); - var high = nodeLength; - var low = -1; - while ((high - low) > 1) { - var mid = Math.floor((high + low) / 2); - start = low + 1; - end = mid === nodeLength - 1 && lineChild.ignoreChars ? textNode.length : mid + 1; - /* - * Bug in IE8. TextRange.getClientRects() and TextRange.getBoundingClientRect() fails - * if the line child is not the first element in the line and if the start offset is 0. - * The fix is to use Node.getClientRects() left edge instead. - */ - fixIE8 = start === 0 && util.isIE === 8; - if (view._isRangeRects) { - range.setStart(textNode, start); - range.setEnd(textNode, end); - } else { - if (fixIE8) { start = 1; } - range.moveToElementText(lineChild); - range.move("character", start); //$NON-NLS-1$ - range.moveEnd("character", end - start); //$NON-NLS-1$ - } - rects1 = range.getClientRects(); - var found = false; - for (var k = 0; k < rects1.length; k++) { - rect = rects1[k]; - rangeLeft = (fixIE8 ? rl : rect.left) * xFactor - lineRect.left; - rangeRight = rect.right * xFactor - lineRect.left; - rangeTop = rect.top * yFactor - lineRect.top; - rangeBottom = rect.bottom * yFactor - lineRect.top; - if (rangeLeft <= x && x < rangeRight && (!view._wrapMode || (rangeTop <= y && y <= rangeBottom))) { - found = true; - break; - } - } - if (found) { - high = mid; - } else { - low = mid; - } - } - offset += high; - start = high; - end = high === nodeLength - 1 && lineChild.ignoreChars ? textNode.length : Math.min(high + 1, textNode.length); - if (view._isRangeRects) { - range.setStart(textNode, start); - range.setEnd(textNode, end); - } else { - range.moveToElementText(lineChild); - range.move("character", start); //$NON-NLS-1$ - range.moveEnd("character", end - start); //$NON-NLS-1$ - } - rects1 = range.getClientRects(); - var trailing = false; - if (rects1.length > 0) { - rect = rects1[0]; - rangeLeft = (fixIE8 ? rl : rect.left) * xFactor - lineRect.left; - rangeRight = rect.right * xFactor - lineRect.left; - //TODO test for character trailing (wrong for bidi) - trailing = x > (rangeLeft + (rangeRight - rangeLeft) / 2); - } - // Handle Unicode surrogates - var offsetInLine = offset - lineStart; - var lineText = model.getLine(lineIndex); - var c = lineText.charCodeAt(offsetInLine); - if (0xD800 <= c && c <= 0xDBFF && trailing) { - if (offsetInLine < lineText.length) { - c = lineText.charCodeAt(offsetInLine + 1); - if (0xDC00 <= c && c <= 0xDFFF) { - offset += 1; - } - } - } else if (0xDC00 <= c && c <= 0xDFFF && !trailing) { - if (offsetInLine > 0) { - c = lineText.charCodeAt(offsetInLine - 1); - if (0xD800 <= c && c <= 0xDBFF) { - offset -= 1; - } - } - } - if (trailing) { - offset++; - } - } else { - var newText = []; - for (var q = 0; q < nodeLength; q++) { - newText.push(""); //$NON-NLS-1$ - if (q === nodeLength - 1) { - newText.push(textNode.data.substring(q)); - } else { - newText.push(textNode.data.substring(q, q + 1)); - } - newText.push(""); //$NON-NLS-1$ - } - lineChild.innerHTML = newText.join(""); - var rangeChild = lineChild.firstChild; - while (rangeChild) { - rect = rangeChild.getBoundingClientRect(); - rangeLeft = rect.left - lineRect.left; - rangeRight = rect.right - lineRect.left; - if (rangeLeft <= x && x < rangeRight) { - //TODO test for character trailing (wrong for bidi) - if (x > rangeLeft + (rangeRight - rangeLeft) / 2) { - offset++; - } - break; - } - offset++; - rangeChild = rangeChild.nextSibling; - } - if (!that._createdDiv) { - lineChild.innerHTML = ""; - lineChild.appendChild(textNode); - /* - * Removing the element node that holds the selection start or end - * causes the selection to be lost. The fix is to detect this case - * and restore the selection. - */ - var s = view._getSelections()[0]; - if ((offset <= s.start && s.start < offset + nodeLength) || (offset <= s.end && s.end < offset + nodeLength)) { - view._updateDOMSelection(); - } - } - } - return offset; - } - - var rects, rect; - if (view._wrapMode) { - rects = this.getClientRects(); - if (y < rects[0].top) { - y = rects[0].top; - } - for (var i = 0; i < rects.length; i++) { - rect = rects[i]; - if (rect.top <= y && y < rect.bottom) { - break; - } - } - if (x < rect.left) { x = rect.left; } - if (x > rect.right) { x = rect.right - 1; } - } else { - if (x < 0) { x = 0; } - if (x > (lineRect.right - lineRect.left)) { x = lineRect.right - lineRect.left; } - } - - function hitRects(child) { - if (child.ignore) return null; - var rects1 = that._getClientRects(child, lineRect); - for (var j = 0; j < rects1.length; j++) { - var rect1 = rects1[j]; - if (rect1.left <= x && x < rect1.right && (!view._wrapMode || (rect1.top <= y && y <= rect1.bottom))) { - return rect1; - } - } - return null; - } - - var offset, lineChild; - if (this._lastHitChild && this._lastHitChild.parentNode) { - // Search last hit child first, then search around the last hit child - offset = this._lastHitOffset; - lineChild = this._lastHitChild; - rect = hitRects(lineChild); - if (!rect ) { - var previousOffset = offset, nextOffset = offset + this._nodeLength(lineChild); - var previousChild = lineChild.previousSibling, nextChild = lineChild.nextSibling; - while (previousChild || nextChild) { - if (previousChild) { - previousOffset -= this._nodeLength(previousChild); - if ((rect = hitRects(previousChild))) { - lineChild = previousChild; - offset = previousOffset; - break; - } - previousChild = previousChild.previousSibling; - } - if (nextChild) { - if ((rect = hitRects(nextChild))) { - lineChild = nextChild; - offset = nextOffset; - break; - } - nextOffset += this._nodeLength(nextChild); - nextChild = nextChild.nextSibling; - } - } - } - } else { - // Start searching from the beginning of the line - offset = lineStart; - this.forEach(function(c) { - lineChild = c; - if ((rect = hitRects(lineChild))) { - return false; - } - offset += this._nodeLength(lineChild); - return true; - }); - } - - if (lineChild && rect) { - // Cache the last hit child - this._lastHitChild = lineChild; - this._lastHitOffset = offset; - - offset = hitChild(lineChild, offset, rect); - } - - return Math.min(lineEnd, Math.max(lineStart, offset)); - }, - /** @private */ - getNextOffset: function (offset, data) { - if (data.unit === "line") { //$NON-NLS-1$ - var view = this.view; - var model = view._model; - var lineIndex = model.getLineAtOffset(offset); - if (data.count > 0) { - data.count--; - return model.getLineEnd(lineIndex); - } - data.count++; - return model.getLineStart(lineIndex); - } - if (data.unit === "wordend" || data.unit === "wordWS" || data.unit === "wordendWS") { //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$ - return this._getNextOffset_W3C(offset, data); - } - return util.isIE ? this._getNextOffset_IE(offset, data) : this._getNextOffset_W3C(offset, data); - }, - /** @private */ - _getNextOffset_W3C: function (offset, data) { - function _isPunctuation(c) { - return (33 <= c && c <= 47) || (58 <= c && c <= 64) || (91 <= c && c <= 94) || c === 96 || (123 <= c && c <= 126); - } - function _isWhitespace(c) { - return c === 32 || c === 9; - } - var view = this.view; - var model = view._model; - var lineIndex = model.getLineAtOffset(offset); - var lineText = model.getLine(lineIndex); - var lineStart = model.getLineStart(lineIndex); - var lineEnd = model.getLineEnd(lineIndex); - var lineLength = lineText.length; - var offsetInLine = offset - lineStart; - var c; - var step = data.count < 0 ? -1 : 1; - if (data.unit === "word" || data.unit === "wordend" || data.unit === "wordWS" || data.unit === "wordendWS") { //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$ - var previousPunctuation, previousLetterOrDigit, punctuation, letterOrDigit; - while (data.count !== 0) { - if (data.count > 0) { - if (offsetInLine === lineLength) { return lineEnd; } - c = lineText.charCodeAt(offsetInLine); - previousPunctuation = _isPunctuation(c); - previousLetterOrDigit = !previousPunctuation && !_isWhitespace(c); - offsetInLine++; - while (offsetInLine < lineLength) { - c = lineText.charCodeAt(offsetInLine); - if (data.unit !== "wordWS" && data.unit !== "wordendWS") { //$NON-NLS-1$ //$NON-NLS-1$ - punctuation = _isPunctuation(c); - if (data.unit === "wordend") { //$NON-NLS-1$ - if (!punctuation && previousPunctuation) { break; } - } else { - if (punctuation && !previousPunctuation) { break; } - } - letterOrDigit = !punctuation && !_isWhitespace(c); - } else { - letterOrDigit = !_isWhitespace(c); - } - if (data.unit === "wordend" || data.unit === "wordendWS") { //$NON-NLS-1$ //$NON-NLS-1$ - if (!letterOrDigit && previousLetterOrDigit) { break; } - } else { - if (letterOrDigit && !previousLetterOrDigit) { break; } - } - previousLetterOrDigit = letterOrDigit; - previousPunctuation = punctuation; - offsetInLine++; - } - } else { - if (offsetInLine === 0) { return lineStart; } - offsetInLine--; - c = lineText.charCodeAt(offsetInLine); - previousPunctuation = _isPunctuation(c); - previousLetterOrDigit = !previousPunctuation && !_isWhitespace(c); - while (0 < offsetInLine) { - c = lineText.charCodeAt(offsetInLine - 1); - if (data.unit !== "wordWS" && data.unit !== "wordendWS") { //$NON-NLS-1$ //$NON-NLS-1$ - punctuation = _isPunctuation(c); - if (data.unit === "wordend") { //$NON-NLS-1$ - if (punctuation && !previousPunctuation) { break; } - } else { - if (!punctuation && previousPunctuation) { break; } - } - letterOrDigit = !punctuation && !_isWhitespace(c); - } else { - letterOrDigit = !_isWhitespace(c); - } - if (data.unit === "wordend" || data.unit === "wordendWS") { //$NON-NLS-1$ //$NON-NLS-1$ - if (letterOrDigit && !previousLetterOrDigit) { break; } - } else { - if (!letterOrDigit && previousLetterOrDigit) { break; } - } - previousLetterOrDigit = letterOrDigit; - previousPunctuation = punctuation; - offsetInLine--; - } - if (offsetInLine === 0) { - //get previous line - } - } - data.count -= step; - } - } else { - while (data.count !== 0 && (0 <= offsetInLine + step && offsetInLine + step <= lineLength)) { - offsetInLine += step; - c = lineText.charCodeAt(offsetInLine); - // Handle Unicode surrogates - if (0xDC00 <= c && c <= 0xDFFF) { - if (offsetInLine > 0) { - c = lineText.charCodeAt(offsetInLine - 1); - if (0xD800 <= c && c <= 0xDBFF) { - offsetInLine += step; - } - } - } - data.count -= step; - } - } - return lineStart + offsetInLine; - }, - /** @private */ - _getNextOffset_IE: function (offset, data) { - var child = this._ensureCreated(); - var view = this.view; - var model = view._model; - var lineIndex = this.lineIndex; - var result = 0, range, len; - var lineOffset = model.getLineStart(lineIndex); - var lineText = model.getLine(lineIndex); - var lineStart = model.getLineStart(lineIndex); - var doc = child.ownerDocument; - var lineChild; - var step = data.count < 0 ? -1 : 1; - if (offset === model.getLineEnd(lineIndex)) { - lineChild = child.lastChild; - while (lineChild && lineChild.ignoreChars === lineChild.firstChild.length) { - lineChild = lineChild.previousSibling; - } - if (!lineChild) { - return lineOffset; - } - range = doc.body.createTextRange(); - range.moveToElementText(lineChild); - len = range.text.length; - range.moveEnd(data.unit, step); - result = offset + range.text.length - len; - } else if (offset === lineOffset && data.count < 0) { - result = lineOffset; - } else { - lineChild = child.firstChild; - while (lineChild) { - var nodeLength = this._nodeLength(lineChild); - if (lineOffset + nodeLength > offset) { - range = doc.body.createTextRange(); - if (offset === lineOffset && data.count < 0) { - var temp = lineChild.previousSibling; - // skip empty nodes - while (temp) { - if (temp.firstChild && temp.firstChild.length) { - break; - } - temp = temp.previousSibling; - } - range.moveToElementText(temp ? temp : lineChild.previousSibling); - } else { - range.moveToElementText(lineChild); - range.collapse(); - range.moveEnd("character", offset - lineOffset); //$NON-NLS-1$ - } - len = range.text.length; - range.moveEnd(data.unit, step); - result = offset + range.text.length - len; - break; - } - lineOffset = nodeLength + lineOffset; - lineChild = lineChild.nextSibling; - } - } - var offsetInLine = result - lineStart; - var c = lineText.charCodeAt(offsetInLine); - // Handle Unicode surrogates - if (0xDC00 <= c && c <= 0xDFFF) { - if (offsetInLine > 0) { - c = lineText.charCodeAt(offsetInLine - 1); - if (0xD800 <= c && c <= 0xDBFF) { - offsetInLine += step; - } - } - } - result = offsetInLine + lineStart; - data.count -= step; - return result; - }, - updateLinks: function() { - var child = this._ensureCreated(); - if (!this.hasLink) { return; } - var that = this; - this.forEach(function(span) { - var style = span.viewStyle; - if (style && style.tagName && style.tagName.toLowerCase() === "a") { //$NON-NLS-1$ - child.replaceChild(that._createSpan(child, span.firstChild.data, style), span); - } - return true; - }); - }, - /** @private */ - destroy: function() { - var div = this._createdDiv; - if (div) { - div.parentNode.removeChild(div); - this._createdDiv = null; - } - } - }; - - /** - * @class This object describes the options for the text view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#setOptions} - * {@link orion.editor.TextView#getOptions} - *

      - * @name orion.editor.TextViewOptions - * - * @property {String|DOMElement} parent the parent element for the view, it can be either a DOM element or an ID for a DOM element. - * @property {orion.editor.TextModel} [model] the text model for the view. If it is not set the view creates an empty {@link orion.editor.TextModel}. - * @property {Boolean} [readonly=false] whether or not the view is read-only. - * @property {Boolean} [fullSelection=true] whether or not the view is in full selection mode. - * @property {Boolean} [tabMode=true] whether or not the tab keypress is consumed by the view or is used for focus traversal. - * @property {Boolean} [expandTab=false] whether or not the tab key inserts white spaces. - * @property {orion.editor.TextTheme} [theme=orion.editor.TextTheme.getTheme()] the TextTheme manager. TODO more info on this - * @property {orion.editor.UndoStack} [undoStack] the Undo Stack. - * @property {String} [themeClass] the CSS class for the view theming. - * @property {Number} [tabSize=8] The number of spaces in a tab. - * @property {Boolean} [overwriteMode=false] whether or not the view is in insert/overwrite mode. - * @property {Boolean} [singleMode=false] whether or not the editor is in single line mode. - * @property {Number} [marginOffset=0] the offset in a line where the print margin should be displayed. 0 means no print margin. - * @property {Number} [wrapOffset=0] the offset in a line where text should wrap. 0 means wrap at the client area right edge. - * @property {Boolean} [wrapMode=false] whether or not the view wraps lines. - * @property {Boolean} [wrapable=false] whether or not the view is wrappable. - * @property {Number} [scrollAnimation=0] the time duration in miliseconds for scrolling animation. 0 means no animation. - * @property {Boolean} [blockCursorVisible=false] whether or not to show the block cursor. - */ - /** - * Constructs a new text view. - * - * @param {orion.editor.TextViewOptions} options the view options. - * - * @class A TextView is a user interface for editing text. - * @name orion.editor.TextView - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function TextView (options) { - this._init(options || {}); - } - - TextView.prototype = /** @lends orion.editor.TextView.prototype */ { - /** - * Adds a keyMode to the text view at the specified position. - * - * @param {orion.editor.KeyMode} mode the editor keyMode. - * @param {Number} [index=length] the index. - */ - addKeyMode: function(mode, index) { - var keyModes = this._keyModes; - if (index !== undefined) { - keyModes.splice(index, 0, mode); - } else { - keyModes.push(mode); - } - //TODO: API needed for this - if (mode._modeAdded) { - mode._modeAdded(); - } - }, - /** - * Adds a ruler to the text view at the specified position. - *

      - * The position is relative to the ruler location. - *

      - * - * @param {orion.editor.Ruler} ruler the ruler. - * @param {Number} [index=length] the ruler index. - */ - addRuler: function (ruler, index) { - var rulers = this._rulers; - if (index !== undefined) { - var i, sideIndex; - for (i = 0, sideIndex=0; i < rulers.length && sideIndex < index; i++) { - if (ruler.getLocation() === rulers[i].getLocation()) { - sideIndex++; - } - } - rulers.splice(sideIndex, 0, ruler); - index = sideIndex; - } else { - rulers.push(ruler); - } - this._createRuler(ruler, index); - ruler.setView(this); - this._update(); - }, - computeSize: function() { - var w = 0, h = 0; - var model = this._model, clientDiv = this._clientDiv; - if (!clientDiv) { return {width: w, height: h}; } - var clientWidth = clientDiv.style.width; - /* - * Feature in WekKit. Webkit limits the width of the lines - * computed below to the width of the client div. This causes - * the lines to be wrapped even though "pre" is set. The fix - * is to set the width of the client div to a "0x7fffffffpx" - * before computing the lines width. Note that this value is - * reset to the appropriate value further down. - */ - if (util.isWebkit) { - clientDiv.style.width = "0x7fffffffpx"; //$NON-NLS-1$ - } - var lineCount = model.getLineCount(); - for (var lineIndex=0; lineIndexThe supported coordinate spaces are: - *
        - *
      • "document" - relative to document, the origin is the top-left corner of first line
      • - *
      • "page" - relative to html page that contains the text view
      • - *
      - *

      - *

      All methods in the view that take or return a position are in the document coordinate space.

      - * - * @param rect the rectangle to convert. - * @param rect.x the x of the rectangle. - * @param rect.y the y of the rectangle. - * @param rect.width the width of the rectangle. - * @param rect.height the height of the rectangle. - * @param {String} from the source coordinate space. - * @param {String} to the destination coordinate space. - * - * @see orion.editor.TextView#getLocationAtOffset - * @see orion.editor.TextView#getOffsetAtLocation - * @see orion.editor.TextView#getTopPixel - * @see orion.editor.TextView#setTopPixel - */ - convert: function(rect, from, to) { - if (!this._clientDiv) { return rect; } - var _scroll = this._getScroll(); - var viewPad = this._getViewPadding(); - var viewRect = this._viewDiv.getBoundingClientRect(); - if (from === "document") { //$NON-NLS-1$ - if (rect.x !== undefined) { - rect.x += - _scroll.x + viewRect.left + viewPad.left; - } - if (rect.y !== undefined) { - rect.y += - _scroll.y + viewRect.top + viewPad.top; - } - } - //At this point rect is in the widget coordinate space - if (to === "document") { //$NON-NLS-1$ - if (rect.x !== undefined) { - rect.x += _scroll.x - viewRect.left - viewPad.left; - } - if (rect.y !== undefined) { - rect.y += _scroll.y - viewRect.top - viewPad.top; - } - } - return rect; - }, - /** - * Copies the selected text to the clipboard in plain text format. - * @returns {Boolean} true if the operation succeded. - * @since 10.0 - */ - copy: function() { - if (!this._clientDiv) { return false; } - return this._doCopy(); - }, - /** - * Moves the selected text to the clipboard in plain text format. - * @returns {Boolean} true if the operation succeded. - * @since 10.0 - */ - cut: function() { - if (!this._clientDiv) { return false; } - return this._doCut(); - }, - /** - * Destroys the text view. - *

      - * Removes the view from the page and frees all resources created by the view. - * Calling this function causes the "Destroy" event to be fire so that all components - * attached to view can release their references. - *

      - * - * @see orion.editor.TextView#onDestroy - */ - destroy: function() { - /* Destroy rulers*/ - for (var i=0; i< this._rulers.length; i++) { - this._rulers[i].setView(null); - } - this.rulers = null; - - this._destroyView(); - - var e = {type: "Destroy"}; //$NON-NLS-1$ - this.onDestroy(e); - - this._parent = null; - if (this._model && this._model.destroy) { - this._model.destroy(); - } - this._model = null; - this._theme = null; - this._selection = null; - this._doubleClickSelection = null; - this._keyModes = null; - this._actions = null; - }, - /** - * Gives focus to the text view. - */ - focus: function() { - if (!this._clientDiv) { return; } - /* - * Feature in Chrome. When focus is called in the clientDiv without - * setting selection the browser will set the selection to the first dom - * element, which can be above the client area. When this happen the - * browser also scrolls the window to show that element. - * The fix is to call _updateDOMSelection() before calling focus(). - */ - this._updateDOMSelection(); - this._clientDiv.focus(); - /* - * Feature in Safari. When focus is called the browser selects the clientDiv - * itself. The fix is to call _updateDOMSelection() after calling focus(). - */ - this._updateDOMSelection(); - }, - /** - * Check if the text view has focus. - * - * @returns {Boolean} true if the text view has focus, otherwise false. - */ - hasFocus: function() { - return this._hasFocus; - }, - /** - * Returns the action description for a given action ID. - * - * @returns {orion.editor.ActionDescrition} the action description - */ - getActionDescription: function(actionID) { - var action = this._actions[actionID]; - if (action) { - return action.actionDescription; - } - return undefined; - }, - /** - * Returns all action IDs defined in the text view. - *

      - * There are two types of actions, the predefined actions of the view - * and the actions added by application code. - *

      - *

      - * The predefined actions are: - *

        - *
      • Navigation actions. These actions move the caret collapsing the selection.
      • - *
          - *
        • "lineUp" - moves the caret up by one line
        • - *
        • "lineDown" - moves the caret down by one line
        • - *
        • "lineStart" - moves the caret to beginning of the current line
        • - *
        • "lineEnd" - moves the caret to end of the current line
        • - *
        • "charPrevious" - moves the caret to the previous character
        • - *
        • "charNext" - moves the caret to the next character
        • - *
        • "pageUp" - moves the caret up by one page
        • - *
        • "pageDown" - moves the caret down by one page
        • - *
        • "wordPrevious" - moves the caret to the previous word
        • - *
        • "wordNext" - moves the caret to the next word
        • - *
        • "textStart" - moves the caret to the beginning of the document
        • - *
        • "textEnd" - moves the caret to the end of the document
        • - *
        - *
      • Selection actions. These actions move the caret extending the selection.
      • - *
          - *
        • "selectLineUp" - moves the caret up by one line
        • - *
        • "selectLineDown" - moves the caret down by one line
        • - *
        • "selectLineStart" - moves the caret to beginning of the current line
        • - *
        • "selectLineEnd" - moves the caret to end of the current line
        • - *
        • "selectCharPrevious" - moves the caret to the previous character
        • - *
        • "selectCharNext" - moves the caret to the next character
        • - *
        • "selectPageUp" - moves the caret up by one page
        • - *
        • "selectPageDown" - moves the caret down by one page
        • - *
        • "selectWordPrevious" - moves the caret to the previous word
        • - *
        • "selectWordNext" - moves the caret to the next word
        • - *
        • "selectTextStart" - moves the caret to the beginning of the document
        • - *
        • "selectTextEnd" - moves the caret to the end of the document
        • - *
        • "selectAll" - selects the entire document
        • - *
        - *
      • Edit actions. These actions modify the text view text
      • - *
          - *
        • "deletePrevious" - deletes the character preceding the caret
        • - *
        • "deleteNext" - deletes the charecter following the caret
        • - *
        • "deleteWordPrevious" - deletes the word preceding the caret
        • - *
        • "deleteWordNext" - deletes the word following the caret
        • - *
        • "deleteLineStart" - deletes characteres to the beginning of the line
        • - *
        • "deleteLineEnd" - deletes characteres to the end of the line
        • - *
        • "tab" - inserts a tab character at the caret
        • - *
        • "shiftTab" - noop
        • - *
        • "enter" - inserts a line delimiter at the caret
        • - *
        • "uppercase" - upper case the text at the caret
        • - *
        • "lowercase" - lower case the text at the caret
        • - *
        • "capitalize" - capitilize case the text at the caret
        • - *
        • "reversecase" - reverse the case the text at the caret
        • - *
        - *
      • Clipboard actions. These actions modify the view text as well
      • - *
          - *
        • "copy" - copies the selected text to the clipboard
        • - *
        • "cut" - copies the selected text to the clipboard and deletes the selection
        • - *
        • "paste" - replaces the selected text with the clipboard contents
        • - *
        - *
      • Scrolling actions.
      • - *
          - *
        • "scrollLineUp" - scrolls the view up by one line
        • - *
        • "scrollLineDown" - scrolls the view down by one line
        • - *
        • "scrollPageUp" - scrolls the view up by one page
        • - *
        • "scrollPageDown" - scrolls the view down by one page
        • - *
        • "scrollTextStart" - scrolls the view to the beginning of the document
        • - *
        • "scrollTextEnd" - scrolls the view to the end of the document
        • - *
        - *
      • Mode actions.
      • - *
          - *
        • "toggleTabMode" - toggles tab mode.
        • - *
        • "toggleWrapMode" - toggles wrap mode.
        • - *
        • "toggleOverwriteMode" - toggles overwrite mode.
        • - *
        - *
      - *

      - * - * @param {Boolean} [defaultAction=false] whether or not the predefined actions are included. - * @returns {String[]} an array of action IDs defined in the text view. - * - * @see orion.editor.TextView#invokeAction - * @see orion.editor.TextView#setAction - * @see orion.editor.TextView#setKeyBinding - * @see orion.editor.TextView#getKeyBindings - */ - getActions: function (defaultAction) { - var result = []; - var actions = this._actions; - for (var i in actions) { - if (actions.hasOwnProperty(i)) { - if (!defaultAction && actions[i].defaultHandler) { continue; } - result.push(i); - } - } - return result; - }, - /** - * Returns the bottom index. - *

      - * The bottom index is the line that is currently at the bottom of the view. This - * line may be partially visible depending on the vertical scroll of the view. The parameter - * fullyVisible determines whether to return only fully visible lines. - *

      - * - * @param {Boolean} [fullyVisible=false] if true, returns the index of the last fully visible line. This - * parameter is ignored if the view is not big enough to show one line. - * @returns {Number} the index of the bottom line. - * - * @see orion.editor.TextView#getTopIndex - * @see orion.editor.TextView#setTopIndex - */ - getBottomIndex: function(fullyVisible) { - if (!this._clientDiv) { return 0; } - return this._getBottomIndex(fullyVisible); - }, - /** - * Returns the bottom pixel. - *

      - * The bottom pixel is the pixel position that is currently at - * the bottom edge of the view. This position is relative to the - * beginning of the document. - *

      - * - * @returns {Number} the bottom pixel. - * - * @see orion.editor.TextView#getTopPixel - * @see orion.editor.TextView#setTopPixel - * @see orion.editor.TextView#convert - */ - getBottomPixel: function() { - if (!this._clientDiv) { return 0; } - return this._getScroll().y + this._getClientHeight(); - }, - /** - * Returns the caret offset relative to the start of the document. - * - * @returns {Number} the caret offset relative to the start of the document. - * - * @see orion.editor.TextView#setCaretOffset - * @see orion.editor.TextView#setSelection - * @see orion.editor.TextView#getSelection - */ - getCaretOffset: function () { - var s = this._getSelection(); - return s.getCaret(); - }, - /** - * Returns the client area. - *

      - * The client area is the portion in pixels of the document that is visible. The - * client area position is relative to the beginning of the document. - *

      - * - * @returns {Object} the client area rectangle {x, y, width, height}. - * - * @see orion.editor.TextView#getTopPixel - * @see orion.editor.TextView#getBottomPixel - * @see orion.editor.TextView#getHorizontalPixel - * @see orion.editor.TextView#convert - */ - getClientArea: function() { - if (!this._clientDiv) { return {x: 0, y: 0, width: 0, height: 0}; } - var _scroll = this._getScroll(); - return {x: _scroll.x, y: _scroll.y, width: this._getClientWidth(), height: this._getClientHeight()}; - }, - /** - * Returns the horizontal pixel. - *

      - * The horizontal pixel is the pixel position that is currently at - * the left edge of the view. This position is relative to the - * beginning of the document. - *

      - * - * @returns {Number} the horizontal pixel. - * - * @see orion.editor.TextView#setHorizontalPixel - * @see orion.editor.TextView#convert - */ - getHorizontalPixel: function() { - if (!this._clientDiv) { return 0; } - return this._getScroll().x; - }, - /** - * Returns all the key bindings associated to the given action ID. - * - * @param {String} actionID the action ID. - * @returns {orion.KeyBinding[]} the array of key bindings associated to the given action ID. - * - * @see orion.editor.TextView#setKeyBinding - * @see orion.editor.TextView#setAction - */ - getKeyBindings: function (actionID) { - var result = []; - var keyModes = this._keyModes; - for (var i = 0; i < keyModes.length; i++) { - result = result.concat(keyModes[i].getKeyBindings(actionID)); - } - return result; - }, - /** - * Returns all the key modes added to text view. - * - * @returns {orion.editor.KeyMode[]} the array of key modes. - * - * @see orion.editor.TextView#addKeyMode - * @see orion.editor.TextView#removeKeyMode - */ - getKeyModes: function() { - return this._keyModes.slice(0); - }, - /** - * Returns the line height for a given line index. Returns the default line - * height if the line index is not specified. - * - * @param {Number} [lineIndex] the line index. - * @returns {Number} the height of the line in pixels. - * - * @see orion.editor.TextView#getLinePixel - */ - getLineHeight: function(lineIndex) { - if (!this._clientDiv) { return 0; } - return this._getLineHeight(lineIndex); - }, - /** - * Returns the line index for a given line pixel position relative to the document. - * - * @param {Number} [y] the line pixel. - * @returns {Number} the line index for the specified pixel position. - * - * @see orion.editor.TextView#getLinePixel - */ - getLineIndex: function(y) { - if (!this._clientDiv) { return 0; } - return this._getLineIndex(y); - }, - /** - * @name isValidTextPosition - * @description Return whether the given x/y pixel position, relative to the document, is inside of document text. - * This tests both whether the y position is below the text lines of the document as we as whether the - * x position is within the text of the line. - * @function - * @param x {Number} [x] the x pixel position - * @param y {Number} [y] the line pixel position - * @returns returns {Boolean} true if the pixel position is over text content - */ - isValidTextPosition: function(x, y){ - if (!this._clientDiv) { return false; } - // Check if we are within a valid line - var lineIndex = this._getLineIndex(y, true); - if (lineIndex < 0){ - return false; - } - // Get the closest offset to the position - var line = this._getLine(lineIndex); - var offset = this.getOffsetAtLocation(x, y); - // If the closest offset is to the left of the character's bounds then position is outside the text on the line - var bounds = line.getBoundingClientRect(offset); - line.destroy(); - if (x > bounds.right){ - return false; - } - return true; - }, - /** - * Returns the top pixel position of a given line index relative to the beginning - * of the document. - *

      - * Clamps out of range indices. - *

      - * - * @param {Number} lineIndex the line index. - * @returns {Number} the pixel position of the line. - * - * @see orion.editor.TextView#setTopPixel - * @see orion.editor.TextView#getLineIndex - * @see orion.editor.TextView#convert - */ - getLinePixel: function(lineIndex) { - if (!this._clientDiv) { return 0; } - return this._getLinePixel(lineIndex); - }, - /** - * Returns the {x, y} pixel location of the top-left corner of the character - * bounding box at the specified offset in the document. The pixel location - * is relative to the document. - *

      - * Clamps out of range offsets. - *

      - * - * @param {Number} offset the character offset - * @returns {Object} the {x, y} pixel location of the given offset. - * - * @see orion.editor.TextView#getOffsetAtLocation - * @see orion.editor.TextView#convert - */ - getLocationAtOffset: function(offset) { - if (!this._clientDiv) { return {x: 0, y: 0}; } - var model = this._model; - offset = Math.min(Math.max(0, offset), model.getCharCount()); - var lineIndex = model.getLineAtOffset(offset); - var line = this._getLine(lineIndex); - var rect = line.getBoundingClientRect(offset); - line.destroy(); - var x = rect.left; - var y = this._getLinePixel(lineIndex) + rect.top; - return {x: x, y: y}; - }, - /** - * Returns the next character offset after the given offset and options - * - * @param {Number} offset the offset to start from - * @param {Object} options - * { unit: the type of unit to advance to (eg "character", "word", "wordend", "wordWS", "wordendWS"), - * count: the number of units to advance (negative to advance backwards) } - * @returns {Number} the next character offset - */ - getNextOffset: function(offset, options) { - var selection = new Selection(offset, offset, false); - this._doMove(options, selection); - return selection.getCaret(); - }, - /** - * Returns the specified view options. - *

      - * The returned value is either a orion.editor.TextViewOptions or an option value. An option value is returned when only one string parameter - * is specified. A orion.editor.TextViewOptions is returned when there are no paremeters, or the parameters are a list of options names or a - * orion.editor.TextViewOptions. All view options are returned when there no paremeters. - *

      - * - * @param {String|orion.editor.TextViewOptions} [options] The options to return. - * @return {Object|orion.editor.TextViewOptions} The requested options or an option value. - * - * @see orion.editor.TextView#setOptions - */ - getOptions: function() { - var options; - if (arguments.length === 0) { - options = this._defaultOptions(); - } else if (arguments.length === 1) { - var arg = arguments[0]; - if (typeof arg === "string") { //$NON-NLS-1$ - return clone(this["_" + arg]); //$NON-NLS-1$ - } - options = arg; - } else { - options = {}; - for (var index in arguments) { - if (arguments.hasOwnProperty(index)) { - options[arguments[index]] = undefined; - } - } - } - for (var option in options) { - if (options.hasOwnProperty(option)) { - options[option] = clone(this["_" + option]); //$NON-NLS-1$ - } - } - return options; - }, - /** - * Returns the text model of the text view. - * - * @returns {orion.editor.TextModel} the text model of the view. - */ - getModel: function() { - return this._model; - }, - /** - * Returns the character offset nearest to the given pixel location. The - * pixel location is relative to the document. - * - * @param x the x of the location - * @param y the y of the location - * @returns {Number} the character offset at the given location. - * - * @see orion.editor.TextView#getLocationAtOffset - */ - getOffsetAtLocation: function(x, y) { - if (!this._clientDiv) { return 0; } - var lineIndex = this._getLineIndex(y); - var line = this._getLine(lineIndex); - var offset = line.getOffset(x, y - this._getLinePixel(lineIndex)); - line.destroy(); - return offset; - }, - /** - * @name getLineAtOffset - * @description Compute the editor line number for the given offset - * @function - * @public - * @memberof orion.editor.TextView - * @param {Number} offset The offset into the editor - * @returns {Number} Returns the line number in the editor corresponding to the given offset or -1 if the offset is - * out of range - * @since 5.0 - */ - getLineAtOffset: function(offset) { - return this.getModel().getLineAtOffset(offset); - }, - /** - * @name getLineStart - * @description Compute the editor start offset of the given line number - * @function - * @public - * @memberof orion.editor.TextView - * @param {Number} line The line number in the editor - * @returns {Number} Returns the start offset of the given line number in the editor. - * @since 5.0 - */ - getLineStart: function(line) { - return this.getModel().getLineStart(line); - }, - /** - * Get the view rulers. - * - * @returns {orion.editor.Ruler[]} the view rulers - * - * @see orion.editor.TextView#addRuler - */ - getRulers: function() { - return this._rulers.slice(0); - }, - /** - * Returns the text view selection. - *

      - * The selection is defined by a start and end character offset relative to the - * document. The character at end offset is not included in the selection. - *

      - * - * @returns {orion.editor.Selection} the view selection - * - * @see orion.editor.TextView#setSelection - */ - getSelection: function () { - return this._getSelection(); - }, - getSelections: function () { - return this._getSelections(); - }, - /** - * Returns the text view selection text. - *

      - * If there are multiple selection ranges, the result is concatenated with the specified delimiter. - *

      - * - * @param {String} delimiter The offset into the editor - * @returns {String} the view selection text - * @since 10.0 - * @see orion.editor.TextView#setSelection - */ - getSelectionText: function(delimiter) { - var text = []; - var that = this; - var selections = this._getSelections(); - selections.forEach(function(selection) { - if (!selection.isEmpty()) { - text.push(that._getBaseText(selection.start, selection.end)); - } - }); - return text.join(delimiter !== undefined ? delimiter : this._model.getLineDelimiter()); - }, - /** - * Returns the text for the given range. - *

      - * The text does not include the character at the end offset. - *

      - * - * @param {Number} [start=0] the start offset of text range. - * @param {Number} [end=char count] the end offset of text range. - * - * @see orion.editor.TextView#setText - */ - getText: function(start, end) { - var model = this._model; - return model.getText(start, end); - }, - /** - * Returns the top index. - *

      - * The top index is the line that is currently at the top of the view. This - * line may be partially visible depending on the vertical scroll of the view. The parameter - * fullyVisible determines whether to return only fully visible lines. - *

      - * - * @param {Boolean} [fullyVisible=false] if true, returns the index of the first fully visible line. This - * parameter is ignored if the view is not big enough to show one line. - * @returns {Number} the index of the top line. - * - * @see orion.editor.TextView#getBottomIndex - * @see orion.editor.TextView#setTopIndex - */ - getTopIndex: function(fullyVisible) { - if (!this._clientDiv) { return 0; } - return this._getTopIndex(fullyVisible); - }, - /** - * Returns the top pixel. - *

      - * The top pixel is the pixel position that is currently at - * the top edge of the view. This position is relative to the - * beginning of the document. - *

      - * - * @returns {Number} the top pixel. - * - * @see orion.editor.TextView#getBottomPixel - * @see orion.editor.TextView#setTopPixel - * @see orion.editor.TextView#convert - */ - getTopPixel: function() { - if (!this._clientDiv) { return 0; } - return this._getScroll().y; - }, - /** - * Executes the action handler associated with the given action ID. - *

      - * The application defined action takes precedence over predefined actions unless - * the defaultAction paramater is true. - *

      - *

      - * If the application defined action returns false, the text view predefined - * action is executed if present. - *

      - * - * @param {String} actionID the action ID. - * @param {Boolean} [defaultAction] whether to always execute the predefined action only. - * @param {Object} [actionOptions] action specific options to be passed to the action handlers. - * @returns {Boolean} true if the action was executed. - * - * @see orion.editor.TextView#setAction - * @see orion.editor.TextView#getActions - */ - invokeAction: function (actionID, defaultAction, actionOptions) { - if (!this._clientDiv) { return; } - var action = this._actions[actionID]; - if (action) { - if (action.actionDescription && action.actionDescription.id) { - mMetrics.logEvent("editor", "action", action.actionDescription.id); //$NON-NLS-1$ //$NON-NLS-2$ - } - if (!defaultAction && action.handler) { - if (action.handler(actionOptions)) { - return true; - } - } - if (action.defaultHandler) { - return typeof action.defaultHandler(actionOptions) === "boolean"; //$NON-NLS-1$ - } - } - return false; - }, - /** - * Returns if the view is destroyed. - * @returns {Boolean} true if the view is destroyed. - */ - isDestroyed: function () { - return !this._clientDiv; - }, - /** - * @class This is the event sent when the user right clicks or otherwise invokes the context menu of the view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onContextMenu} - *

      - * - * @name orion.editor.ContextMenuEvent - * - * @property {Number} x The pointer location on the x axis, relative to the document the user is editing. - * @property {Number} y The pointer location on the y axis, relative to the document the user is editing. - * @property {Number} screenX The pointer location on the x axis, relative to the screen. This is copied from the DOM contextmenu event.screenX property. - * @property {Number} screenY The pointer location on the y axis, relative to the screen. This is copied from the DOM contextmenu event.screenY property. - * @property {Boolean} defaultPrevented Determines whether the user agent context menu should be shown. It is shown by default. - * @property {Function} preventDefault If called prevents the user agent context menu from showing. - */ - /** - * This event is sent when the user invokes the view context menu. - * - * @event - * @param {orion.editor.ContextMenuEvent} contextMenuEvent the event - */ - onContextMenu: function(contextMenuEvent) { - return this.dispatchEvent(contextMenuEvent); - }, - onDragStart: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDrag: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDragEnd: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDragEnter: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDragOver: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDragLeave: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - onDrop: function(dragEvent) { - return this.dispatchEvent(dragEvent); - }, - /** - * @class This is the event sent when the text view is destroyed. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onDestroy} - *

      - * @name orion.editor.DestroyEvent - */ - /** - * This event is sent when the text view has been destroyed. - * - * @event - * @param {orion.editor.DestroyEvent} destroyEvent the event - * - * @see orion.editor.TextView#destroy - */ - onDestroy: function(destroyEvent) { - return this.dispatchEvent(destroyEvent); - }, - /** - * @description This event is sent when the file is being saved - * @function - * @param {Object} savingEvent the event - * @since 8.0 - */ - onSaving: function onSaving(savingEvent) { - return this.dispatchEvent(savingEvent); - }, - /** - * @description This event is sent when the file has been saved - * @function - * @param {Object} inputChangedEvent the event - * @since 8.0 - */ - onInputChanged: function onInputChanged(inputChangedEvent) { - return this.dispatchEvent(inputChangedEvent); - }, - /** - * @class This object is used to define style information for the text view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onLineStyle} - *

      - * @name orion.editor.Style - * - * @property {String} styleClass A CSS class name. - * @property {Object} style An object with CSS properties. - * @property {String} tagName A DOM tag name. - * @property {Object} attributes An object with DOM attributes. - */ - /** - * @class This object is used to style range. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onLineStyle} - *

      - * @name orion.editor.StyleRange - * - * @property {Number} start The start character offset, relative to the document, where the style should be applied. - * @property {Number} end The end character offset (exclusive), relative to the document, where the style should be applied. - * @property {orion.editor.Style} style The style for the range. - */ - /** - * @class This is the event sent when the text view needs the style information for a line. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onLineStyle} - *

      - * @name orion.editor.LineStyleEvent - * - * @property {orion.editor.TextView} textView The text view. - * @property {Number} lineIndex The line index. - * @property {String} lineText The line text. - * @property {Number} lineStart The character offset, relative to document, of the first character in the line. - * @property {orion.editor.Style} style The style for the entire line (output argument). - * @property {orion.editor.StyleRange[]} ranges An array of style ranges for the line (output argument). - */ - /** - * This event is sent when the text view needs the style information for a line. - * - * @event - * @param {orion.editor.LineStyleEvent} lineStyleEvent the event - */ - onLineStyle: function(lineStyleEvent) { - return this.dispatchEvent(lineStyleEvent); - }, - /** - * @class This is the event sent for all keyboard events. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onKeyDown}
      - * {@link orion.editor.TextView#event:onKeyPress}
      - * {@link orion.editor.TextView#event:onKeyUp}
      - *

      - * @name orion.editor.KeyEvent - * - * @property {String} type The type of event. - * @property {DOMEvent} event The key DOM event. - * @property {Boolean} defaultPrevented Determines whether the user agent context menu should be shown. It is shown by default. - * @property {Function} preventDefault If called prevents the user agent context menu from showing. - */ - /** - * This event is sent for key down events. - * - * @event - * @param {orion.editor.KeyEvent} keyEvent the event - */ - onKeyDown: function(keyEvent) { - return this.dispatchEvent(keyEvent); - }, - /** - * This event is sent for key press events. Key press events are only sent - * for printable characters. - * - * @event - * @param {orion.editor.KeyEvent} keyEvent the event - */ - onKeyPress: function(keyEvent) { - return this.dispatchEvent(keyEvent); - }, - /** - * This event is sent for key up events. - * - * @event - * @param {orion.editor.KeyEvent} keyEvent the event - */ - onKeyUp: function(keyEvent) { - return this.dispatchEvent(keyEvent); - }, - /** - * @class This is the event sent when the text in the model has changed. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onModelChanged}
      - * {@link orion.editor.TextModel#onChanged} - *

      - * @name orion.editor.ModelChangedEvent - * - * @property {Number} start The character offset in the model where the change has occurred. - * @property {Number} removedCharCount The number of characters removed from the model. - * @property {Number} addedCharCount The number of characters added to the model. - * @property {Number} removedLineCount The number of lines removed from the model. - * @property {Number} addedLineCount The number of lines added to the model. - */ - /** - * This event is sent when the text in the model has changed. - * - * @event - * @param {orion.editor.ModelChangedEvent} modelChangedEvent the event - */ - onModelChanged: function(modelChangedEvent) { - return this.dispatchEvent(modelChangedEvent); - }, - /** - * @class This is the event sent when the text in the model is about to change. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onModelChanging}
      - * {@link orion.editor.TextModel#onChanging} - *

      - * @name orion.editor.ModelChangingEvent - * - * @property {String} text The text that is about to be inserted in the model. - * @property {Number} start The character offset in the model where the change will occur. - * @property {Number} removedCharCount The number of characters being removed from the model. - * @property {Number} addedCharCount The number of characters being added to the model. - * @property {Number} removedLineCount The number of lines being removed from the model. - * @property {Number} addedLineCount The number of lines being added to the model. - */ - /** - * This event is sent when the text in the model is about to change. - * - * @event - * @param {orion.editor.ModelChangingEvent} modelChangingEvent the event - */ - onModelChanging: function(modelChangingEvent) { - return this.dispatchEvent(modelChangingEvent); - }, - /** - * @class This is the event sent when the text is modified by the text view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onModify} - *

      - * @name orion.editor.ModifyEvent - */ - /** - * This event is sent when the text view has changed text in the model. - *

      - * If the text is changed directly through the model API, this event - * is not sent. - *

      - * - * @event - * @param {orion.editor.ModifyEvent} modifyEvent the event - */ - onModify: function(modifyEvent) { - return this.dispatchEvent(modifyEvent); - }, - onMouseDown: function(mouseEvent) { - return this.dispatchEvent(mouseEvent); - }, - onMouseUp: function(mouseEvent) { - return this.dispatchEvent(mouseEvent); - }, - onMouseMove: function(mouseEvent) { - return this.dispatchEvent(mouseEvent); - }, - onMouseOver: function(mouseEvent) { - return this.dispatchEvent(mouseEvent); - }, - onMouseOut: function(mouseEvent) { - return this.dispatchEvent(mouseEvent); - }, - onTouchStart: function(touchEvent) { - return this.dispatchEvent(touchEvent); - }, - onTouchMove: function(touchEvent) { - return this.dispatchEvent(touchEvent); - }, - onTouchEnd: function(touchEvent) { - return this.dispatchEvent(touchEvent); - }, - onOptions: function(optionsEvent) { - return this.dispatchEvent(optionsEvent); - }, - /** - * @class This is the event sent when the selection changes in the text view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onSelection} - *

      - * @name orion.editor.SelectionEvent - * - * @property {orion.editor.Selection} oldValue The old selection. - * @property {orion.editor.Selection} newValue The new selection. - */ - /** - * This event is sent when the text view selection has changed. - * - * @event - * @param {orion.editor.SelectionEvent} selectionEvent the event - */ - onSelection: function(selectionEvent) { - return this.dispatchEvent(selectionEvent); - }, - /** - * @class This is the event sent when the text view scrolls. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onScroll} - *

      - * @name orion.editor.ScrollEvent - * - * @property {Object} oldValue The old scroll {x,y}. - * @property {Object} newValue The new scroll {x,y}. - */ - /** - * This event is sent when the text view scrolls vertically or horizontally. - * - * @event - * @param {orion.editor.ScrollEvent} scrollEvent the event - */ - onScroll: function(scrollEvent) { - return this.dispatchEvent(scrollEvent); - }, - /** - * @class This is the event sent when the text is about to be modified by the text view. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onVerify} - *

      - * @name orion.editor.VerifyEvent - * - * @property {String} text The text being inserted. - * @property {Number} start The start offset of the text range to be replaced. - * @property {Number} end The end offset (exclusive) of the text range to be replaced. - */ - /** - * This event is sent when the text view is about to change text in the model. - *

      - * If the text is changed directly through the model API, this event - * is not sent. - *

      - *

      - * Listeners are allowed to change these parameters. Setting text to null - * or undefined stops the change. - *

      - * - * @event - * @param {orion.editor.VerifyEvent} verifyEvent the event - */ - onVerify: function(verifyEvent) { - return this.dispatchEvent(verifyEvent); - }, - /** - * @class This is the event sent when the text view is focused. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onFocus}
      - *

      - * @name orion.editor.FocusEvent - */ - /** - * This event is sent when the text view is focused. - * - * @event - * @param {orion.editor.FocusEvent} focusEvent the event - */ - onFocus: function(focusEvent) { - return this.dispatchEvent(focusEvent); - }, - /** - * @class This is the event sent when the text view goes out of focus. - *

      - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#event:onBlur}
      - *

      - * @name orion.editor.BlurEvent - */ - /** - * This event is sent when the text view goes out of focus. - * - * @event - * @param {orion.editor.BlurEvent} blurEvent the event - */ - onBlur: function(blurEvent) { - return this.dispatchEvent(blurEvent); - }, - /** - * Replaces the selection with the text on the clipboard or, if there is no selection, inserts the text at the current caret offset. - *

      - * If the single mode is on and the clipboard text contains more than one line, all lines will be concatenated. - *

      - * @returns {Boolean} true if the operation succeded. - * @since 10.0 - */ - paste: function() { - if (!this._clientDiv) { return false; } - return this._doPaste(); - }, - /** - * Redraws the entire view, including rulers. - * - * @see orion.editor.TextView#redrawLines - * @see orion.editor.TextView#redrawRange - * @see orion.editor.TextView#setRedraw - */ - redraw: function() { - if (this._redrawCount > 0) { return; } - var lineCount = this._model.getLineCount(); - this.redrawRulers(0, lineCount); - this.redrawLines(0, lineCount); - }, - redrawRulers: function(startLine, endLine) { - if (this._redrawCount > 0) { return; } - var rulers = this.getRulers(); - for (var i = 0; i < rulers.length; i++) { - this.redrawLines(startLine, endLine, rulers[i]); - } - }, - /** - * Redraws the text in the given line range. - *

      - * The line at the end index is not redrawn. - *

      - * - * @param {Number} [startLine=0] the start line - * @param {Number} [endLine=line count] the end line - * - * @see orion.editor.TextView#redraw - * @see orion.editor.TextView#redrawRange - * @see orion.editor.TextView#setRedraw - */ - redrawLines: function(startLine, endLine, ruler) { - if (this._redrawCount > 0) { return; } - if (startLine === undefined) { startLine = 0; } - if (endLine === undefined) { endLine = this._model.getLineCount(); } - if (startLine === endLine) { return; } - var div = this._clientDiv; - if (!div) { return; } - if (ruler) { - var divRuler = this._getRulerParent(ruler); - div = divRuler.firstChild; - while (div) { - if (div._ruler === ruler) { - break; - } - div = div.nextSibling; - } - } - if (ruler) { - div.rulerChanged = true; - } else { - if (this._lineHeight) { - this._resetLineHeight(startLine, endLine); - } - } - var imeLineIndex = -1; - if (!ruler && this._imeOffset !== -1) { - imeLineIndex = this._model.getLineAtOffset(this._imeOffset); - } - if (!ruler || ruler.getOverview() === "page") { //$NON-NLS-1$ - var child = div.firstChild; - while (child) { - var lineIndex = child.lineIndex; - if (startLine <= lineIndex && lineIndex < endLine && lineIndex !== imeLineIndex) { - child.lineChanged = true; - } - child = child.nextSibling; - } - } - if (!ruler) { - if (!this._wrapMode) { - if (startLine <= this._maxLineIndex && this._maxLineIndex < endLine) { - this._checkMaxLineIndex = this._maxLineIndex; - this._maxLineIndex = -1; - this._maxLineWidth = 0; - } - } - } - this.dispatchEvent({type: "Redraw", startLine: startLine, endLine: endLine, ruler: ruler}); //$NON-NLS-1$ - this._queueUpdate(); - }, - /** - * Redraws the text in the given range. - *

      - * The character at the end offset is not redrawn. - *

      - * - * @param {Number} [start=0] the start offset of text range - * @param {Number} [end=char count] the end offset of text range - * - * @see orion.editor.TextView#redraw - * @see orion.editor.TextView#redrawLines - * @see orion.editor.TextView#setRedraw - */ - redrawRange: function(start, end) { - if (this._redrawCount > 0) { return; } - var model = this._model; - if (start === undefined) { start = 0; } - if (end === undefined) { end = model.getCharCount(); } - var startLine = model.getLineAtOffset(start); - var endLine = model.getLineAtOffset(Math.max(start, end - 1)) + 1; - this.redrawLines(startLine, endLine); - }, - /** - * Removes a key mode from the text view. - * - * @param {orion.editor.KeyMode} mode the key mode. - */ - removeKeyMode: function (mode) { - var keyModes = this._keyModes; - for (var i=0; i - * See:
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#setAction} - *

      - * @name orion.editor.ActionDescription - * - * @property {String} [name] the name to be used when showing the action as text. - */ - /** - * Associates an application defined handler to an action ID. - *

      - * If the action ID is a predefined action, the given handler executes before - * the default action handler. If the given handler returns true, the - * default action handler is not called. - *

      - * - * @param {String} actionID the action ID. - * @param {Function} handler the action handler. - * @param {orion.editor.ActionDescription} [actionDescription=undefined] the action description. - * - * @see orion.editor.TextView#getActions - * @see orion.editor.TextView#invokeAction - */ - setAction: function(actionID, handler, actionDescription) { - if (!actionID) { return; } - var actions = this._actions; - var action = actions[actionID]; - if (!action) { - action = actions[actionID] = {}; - } - action.handler = handler; - if (actionDescription !== undefined) { - action.actionDescription = actionDescription; - } - }, - /** - * Associates a key binding with the given action ID. Any previous - * association with the specified key binding is overwriten. If the - * action ID is null, the association is removed. - * - * @param {orion.KeyBinding} keyBinding the key binding - * @param {String} actionID the action ID - */ - setKeyBinding: function(keyBinding, actionID) { - this._keyModes[0].setKeyBinding(keyBinding, actionID); - }, - /** - * Sets the caret offset relative to the start of the document. - * - * @param {Number} caret the caret offset relative to the start of the document. - * @param {Boolean|Number|orion.editor.TextViewShowOptions} [show=true] - * if true, the view will scroll the minimum amount necessary to show the caret location. If - * show is a Number, the view will scroll the minimum amount necessary to show the caret location plus a - * percentage of the client area height. The parameter is clamped to the [0,1] range. In either case, the view will only scroll - * if the new caret location is not visible already. The show parameter can also be a orion.editor.TextViewShowOptions object. See - * {@link orion.editor.TextViewShowOptions} for further information in how the options can be used to control the scrolling behavior. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @see orion.editor.TextView#getCaretOffset - * @see orion.editor.TextView#setSelection - * @see orion.editor.TextView#getSelection - */ - setCaretOffset: function(offset, show, callback) { - var charCount = this._model.getCharCount(); - offset = Math.max(0, Math.min (offset, charCount)); - var selection = new Selection(offset, offset, false); - this._setSelection (selection, show === undefined || show, true, callback); - }, - /** - * Sets the horizontal pixel. - *

      - * The horizontal pixel is the pixel position that is currently at - * the left edge of the view. This position is relative to the - * beginning of the document. - *

      - * - * @param {Number} pixel the horizontal pixel. - * - * @see orion.editor.TextView#getHorizontalPixel - * @see orion.editor.TextView#convert - */ - setHorizontalPixel: function(pixel) { - if (!this._clientDiv) { return; } - pixel = Math.max(0, pixel); - this._scrollView(pixel - this._getScroll().x, 0); - }, - /** - * Sets whether the view should update the DOM. - *

      - * This can be used to improve the performance. - *

      - * When the flag is set to true, - * the entire view is marked as needing to be redrawn. - * Nested calls to this method are stacked. - *

      - * - * @param {Boolean} redraw the new redraw state - * - * @see orion.editor.TextView#redraw - */ - setRedraw: function(redraw) { - if (redraw) { - if (--this._redrawCount === 0) { - this.redraw(); - } - } else { - this._redrawCount++; - } - }, - /** - * Sets the text model of the text view. - * - * @param {orion.editor.TextModel} model the text model of the view. - */ - setModel: function(model) { - if (model === this._model) { return; } - model = model || new mTextModel.TextModel(); - this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$ - this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$ - var oldLineCount = this._model.getLineCount(); - var oldCharCount = this._model.getCharCount(); - var newLineCount = model.getLineCount(); - var newCharCount = model.getCharCount(); - var newText = model.getText(); - var e = { - type: "ModelChanging", //$NON-NLS-1$ - text: newText, - start: 0, - removedCharCount: oldCharCount, - addedCharCount: newCharCount, - removedLineCount: oldLineCount, - addedLineCount: newLineCount - }; - this.onModelChanging(e); - this._model = model; - e = { - type: "ModelChanged", //$NON-NLS-1$ - start: 0, - removedCharCount: oldCharCount, - addedCharCount: newCharCount, - removedLineCount: oldLineCount, - addedLineCount: newLineCount - }; - this.onModelChanged(e); - this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$ - this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$ - this._reset(); - this._update(); - }, - /** - * Sets the view options for the view. - * - * @param {orion.editor.TextViewOptions} options the view options. - * - * @see orion.editor.TextView#getOptions - */ - setOptions: function (options) { - var defaultOptions = this._defaultOptions(); - for (var option in options) { - if (options.hasOwnProperty(option)) { - var newValue = options[option], oldValue = this["_" + option]; //$NON-NLS-1$ - if (compare(oldValue, newValue)) { continue; } - var update = defaultOptions[option] ? defaultOptions[option].update : null; - if (update) { - update.call(this, newValue); - continue; - } - this["_" + option] = clone(newValue); //$NON-NLS-1$ - } - } - this.onOptions({type: "Options", options: options}); //$NON-NLS-1$ - }, - /** - * @class This object describes the selection show options. - *

      - * See:
      - * {@link orion.editor.TextView#setSelection} - * {@link orion.editor.TextView#setCaretOffset} - * {@link orion.editor.TextView#showSelection} - *

      - * @name orion.editor.TextViewShowOptions - * - * @property {String} viewAnchor the view anchor. The view anchor can be one of these values: - *

      - *

        - *
      • "top" - align the selection to the top of the view client area.
      • - *
      • "bottom" - align the selection to the bottom of the view client area.
      • - *
      • "center" - align the selection to the center of the view client area.
      • - *
      • by default - align the selection to the top or bottom of the client area depending on whether the caret is above or below the client area respectively.
      • - *
      - *

      - * @property {Number} [viewAnchorOffset=0] an offset from the view anchor. The offset is a percentage of the client area height and it is clamped to [0-1] range. - * @property {String} [selectionAnchor=caret] the selection anchor. The seleciton anchor can be one of these values: - *

      - *

        - *
      • "top" - align the top of the selection to the view anchor.
      • - *
      • "bottom" - align the bottom of the selection to the view anchor.
      • - *
      • "center" - align the center of the selection to the view anchor.
      • - *
      • by default - align the top or bottom of the selection to the view anchor depending on whether the caret is at the start or end of the selection.
      • - *
      - *

      - * @property {String} [scrollPolicy] the scroll policy. The scroll policy can be one of these values: - *

      - *

        - *
      • "always" - always scroll vertically to the desired pixel offset even if the caret is already visible.
      • - *
      • by default - only scroll if the caret is not visible.
      • - *
      - *

      - */ - /** - * Sets the text view selection. - *

      - * The selection is defined by a start and end character offset relative to the - * document. The character at end offset is not included in the selection. - *

      - *

      - * The caret is always placed at the end offset. The start offset can be - * greater than the end offset to place the caret at the beginning of the - * selection. - *

      - *

      - * Clamps out of range offsets. - *

      - * - * @param {Number} start the start offset of the selection - * @param {Number} end the end offset of the selection - * @param {Boolean|Number|orion.editor.TextViewShowOptions} [show=true] - * if true, the view will scroll the minimum amount necessary to show the caret location. If - * show is a Number, the view will scroll the minimum amount necessary to show the caret location plus a - * percentage of the client area height. The parameter is clamped to the [0,1] range. In either case, the view will only scroll - * if the new caret location is not visible already. The show parameter can also be a orion.editor.TextViewShowOptions object. See - * {@link orion.editor.TextViewShowOptions} for further information in how the options can be used to control the scrolling behavior. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @see orion.editor.TextView#getSelection - */ - setSelection: function (start, end, show, callback) { - var caret = start > end; - if (caret) { - var tmp = start; - start = end; - end = tmp; - } - var charCount = this._model.getCharCount(); - start = Math.max(0, Math.min (start, charCount)); - end = Math.max(0, Math.min (end, charCount)); - var selection = new Selection(start, end, caret); - this._setSelection(selection, show === undefined || show, true, callback); - }, - setSelections: function (ranges, show, callback) { - var selections = this._rangesToSelections(ranges); - this._setSelection(selections, show === undefined || show, true, callback); - }, - /** - * Replaces the text in the given range with the given text. - *

      - * The character at the end offset is not replaced. - *

      - *

      - * When both start and end parameters - * are not specified, the text view places the caret at the beginning - * of the document and scrolls to make it visible. - *

      - * - * @param {String} text the new text. - * @param {Number} [start=0] the start offset of text range. - * @param {Number} [end=char count] the end offset of text range. - * @param {Boolean|Number|orion.editor.TextViewShowOptions} [show=true] - * if true, the view will scroll the minimum amount necessary to show the caret location. If - * show is a Number, the view will scroll the minimum amount necessary to show the caret location plus a - * percentage of the client area height. The parameter is clamped to the [0,1] range. In either case, the view will only scroll - * if the new caret location is not visible already. The show parameter can also be a orion.editor.TextViewShowOptions object. See - * {@link orion.editor.TextViewShowOptions} for further information in how the options can be used to control the scrolling behavior. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @see orion.editor.TextView#getText - */ - setText: function (text, start, end, show, callback) { - var isSingle = typeof text === "string"; //$NON-NLS-1$ - var reset = start === undefined && end === undefined && isSingle; - var edit; - if (isSingle) { - if (start === undefined) { start = 0; } - if (end === undefined) { end = this._model.getCharCount(); } - edit = {text: text, selection: [new Selection(start, end, false)]}; - } else { - edit = text; - edit.selection = this._rangesToSelections(edit.selection); - } - edit._code = true; - if (reset) { - this._variableLineHeight = false; - } - this._modifyContent(edit, !reset, show === undefined || show, callback); - if (reset) { - /* - * Bug in Firefox. For some reason, the caret does not show after the - * view is refreshed. The fix is to toggle the contentEditable state and - * force the clientDiv to loose and receive focus if it is focused. - */ - if (util.isFirefox < 13) { - this._fixCaret(); - } - } - }, - /** - * Sets the top index. - *

      - * The top index is the line that is currently at the top of the text view. This - * line may be partially visible depending on the vertical scroll of the view. - *

      - * - * @param {Number} topIndex the index of the top line. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @see orion.editor.TextView#getBottomIndex - * @see orion.editor.TextView#getTopIndex - */ - setTopIndex: function(topIndex, callback) { - if (!this._clientDiv) { return; } - this._scrollViewAnimated(0, this._getLinePixel(Math.max(0, topIndex)) - this._getScroll().y, callback); - }, - /** - * Sets the top pixel. - *

      - * The top pixel is the pixel position that is currently at - * the top edge of the view. This position is relative to the - * beginning of the document. - *

      - * - * @param {Number} pixel the top pixel. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @see orion.editor.TextView#getBottomPixel - * @see orion.editor.TextView#getTopPixel - * @see orion.editor.TextView#convert - */ - setTopPixel: function(pixel, callback) { - if (!this._clientDiv) { return; } - this._scrollViewAnimated(0, Math.max(0, pixel) - this._getScroll().y, callback); - }, - /** - * Scrolls the selection into view if needed. - * - * @param {Number|orion.editor.TextViewShowOptions} [show=0] - * If show is a Number, the view will scroll the minimum amount necessary to show the caret location plus a - * percentage of the client area height. The parameter is clamped to the [0,1] range. The view will only scroll - * if the new caret location is not visible already. The show parameter can also be a orion.editor.TextViewShowOptions object. See - * {@link orion.editor.TextViewShowOptions} for further information in how the options can be used to control the scrolling behavior. - * @param {Function} [callback] if callback is specified and scrollAnimation is not zero, view scrolling is animated and - * the callback is called when the animation is done. Otherwise, callback is callback right away. - * - * @returns {Boolean} true if the view was scrolled. - * - * @see orion.editor.TextView#getSelection - * @see orion.editor.TextView#setSelection - * @see orion.editor.TextView#setCaretOffset - */ - showSelection: function(show, callback) { - return this._showCaret(show ? false : true, callback, show); - }, - update: function(styleChanged, sync) { - if (!this._clientDiv) { return; } - if (styleChanged || this._metrics.invalid) { - this._updateStyle(); - } - if (sync === undefined || sync) { - this._update(); - } else { - this._queueUpdate(); - } - }, - - /**************************************** Event handlers *********************************/ - _handleRootMouseDown: function (e) { - this._cancelCheckSelection(); - if (this._ignoreEvent(e)) { return; } - if (util.isFirefox < 13 && e.which === 1) { - this._clientDiv.contentEditable = false; - (this._overlayDiv || this._clientDiv).draggable = true; - this._ignoreBlur = true; - } - - /* Prevent clicks outside of the client div from taking focus away. */ - var topNode = this._overlayDiv || this._clientDiv; - /* Use view div on IE 8 otherwise it is not possible to scroll. */ - if (util.isIE < 9) { topNode = this._viewDiv; } - var temp = e.target ? e.target : e.srcElement; - while (temp) { - if (topNode === temp) { - return; - } - if (temp.className && temp.className.indexOf("textViewFind") !== -1) { //$NON-NLS-1$ - return; - } - temp = temp.parentNode; - } - if (e.preventDefault) { e.preventDefault(); } - if (e.stopPropagation){ e.stopPropagation(); } - if (!this._isW3CEvents) { - /* - * In IE 8 is not possible to prevent the default handler from running - * during mouse down event using usual API. The workaround is to give - * focus back to the client div. - */ - var that = this; - var win = this._getWindow(); - win.setTimeout(function() { - that._clientDiv.focus(); - }, 0); - } - }, - _handleRootMouseUp: function (e) { - if (this._ignoreEvent(e)) { return; } - if (util.isFirefox < 13 && e.which === 1) { - this._clientDiv.contentEditable = true; - (this._overlayDiv || this._clientDiv).draggable = false; - } - if (util.isFirefox && e.which === 1) { - - /* - * Bug in Firefox. For some reason, Firefox stops showing the caret - * in some cases. For example when the user cancels a drag operation - * by pressing ESC. The fix is to detect that the drag operation was - * cancelled, toggle the contentEditable state and force the clientDiv - * to loose and receive focus if it is focused. - */ - this._fixCaret(); - this._ignoreBlur = false; - } - }, - _handleBlur: function () { - this._cancelCheckSelection(); - if (this._ignoreBlur) { return; } - this._commitIME(); - this._hasFocus = false; - /* - * Bug in IE 8 and earlier. For some reason when text is deselected - * the overflow selection at the end of some lines does not get redrawn. - * The fix is to create a DOM element in the body to force a redraw. - */ - if (util.isIE < 9) { - if (!this._getSelections()[0].isEmpty()) { - var rootDiv = this._rootDiv; - var child = util.createElement(rootDiv.ownerDocument, "div"); //$NON-NLS-1$ - rootDiv.appendChild(child); - rootDiv.removeChild(child); - } - } - if (this._cursorDiv) { - this._cursorDiv.style.display = "none"; //$NON-NLS-1$ - } - if (this._domSelection) { - this._domSelection.forEach(function(domSelection) { domSelection.update(); }); - /* Clear browser selection if selection is within clientDiv */ - var temp; - var win = this._getWindow(); - var doc = this._parent.ownerDocument; - if (win.getSelection) { - var sel = win.getSelection(); - temp = sel.anchorNode; - while (temp) { - if (temp === this._clientDiv) { - if (sel.rangeCount > 0) { sel.removeAllRanges(); } - break; - } - temp = temp.parentNode; - } - } else if (doc.selection) { - this._ignoreSelect = false; - temp = doc.selection.createRange().parentElement(); - while (temp) { - if (temp === this._clientDiv) { - doc.selection.empty(); - break; - } - temp = temp.parentNode; - } - this._ignoreSelect = true; - } - } - if (!this._ignoreFocus) { - this.onBlur({type: "Blur"}); //$NON-NLS-1$ - } - }, - _handleCompositionStart: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this._imeTimeout) { - var win = this._getWindow(); - win.clearTimeout(this._imeTimeout); - this._imeTimeout = null; - } - if (this._imeText) { - this._commitIME(this._imeText); - this._imeText = null; - } - this._startIME(); - if (this._mutationObserver) { - this._mutationObserver.disconnect(); - this._mutationObserver = null; - } - }, - _handleCompositionUpdate: function(e) { - if (this._ignoreEvent(e)) { return; } - this._imeText = e.data; - }, - _handleCompositionEnd: function (e) { - if (this._ignoreEvent(e)) { return; } - this._imeText = e.data; - var win = this._getWindow(); - this._imeTimeout = win.setTimeout(function() { - this._commitIME(this._imeText); - this._imeText = this._imeTimeout = null; - }.bind(this), 0); - }, - _handleContextMenu: function (e) { - if (this._ignoreEvent(e)) { return; } - if (util.isIE && this._lastMouseButton === 3) { - // We need to update the DOM selection, because on - // right-click the caret moves to the mouse location. - // See bug 366312 and 376508. - this._updateDOMSelection(); - } - var preventDefault = false; - if (this.isListening("ContextMenu")) { //$NON-NLS-1$ - var evt = this._createMouseEvent("ContextMenu", e); //$NON-NLS-1$ - evt.screenX = e.screenX; - evt.screenY = e.screenY; - this.onContextMenu(evt); - preventDefault = evt.defaultPrevented; - } else if (util.isMac && util.isFirefox && e.button === 0) { - // hack to prevent CTRL+Space from showing the browser context menu - preventDefault = true; - } - if (preventDefault) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } else { - this._contextMenuOpen = true; - if (util.isFirefox) { - this._checkSelectionChange = true; - this._pollSelectionChange(true); - } - } - }, - _handleCopy: function (e) { - this._cancelCheckSelection(); - if (this._ignoreEvent(e)) { return; } - if (this._ignoreCopy) { return; } - if (this._doCopy(e)) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleCut: function (e) { - this._cancelCheckSelection(); - if (this._ignoreEvent(e)) { return; } - if (this._doCut(e)) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleDataModified: function(e) { - if (this._ignoreEvent(e)) { return; } - this._startIME(); - }, - _handleDblclick: function (e) { - if (this._ignoreEvent(e)) { return; } - var time = e.timeStamp ? e.timeStamp : new Date().getTime(); - this._lastMouseTime = time; - if (this._clickCount !== 2) { - this._clickCount = 2; - this._handleMouse(e); - } - }, - _handleDragStart: function (e) { - if (this._ignoreEvent(e)) { return; } - if (util.isFirefox < 13) { - var that = this; - var win = this._getWindow(); - win.setTimeout(function() { - that._clientDiv.contentEditable = true; - that._clientDiv.draggable = false; - that._ignoreBlur = false; - }, 0); - } - if (this.isListening("DragStart") && this._dragOffset !== -1) { //$NON-NLS-1$ - this._isMouseDown = false; - this.onDragStart(this._createMouseEvent("DragStart", e)); //$NON-NLS-1$ - this._dragOffset = -1; - } else { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleDrag: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this.isListening("Drag")) { //$NON-NLS-1$ - this.onDrag(this._createMouseEvent("Drag", e)); //$NON-NLS-1$ - } - }, - _handleDragEnd: function (e) { - if (this._ignoreEvent(e)) { return; } - this._dropTarget = false; - this._dragOffset = -1; - if (this.isListening("DragEnd")) { //$NON-NLS-1$ - this.onDragEnd(this._createMouseEvent("DragEnd", e)); //$NON-NLS-1$ - } - if (util.isFirefox < 13) { - this._fixCaret(); - /* - * Bug in Firefox. For some reason, Firefox stops showing the caret when the - * selection is dropped onto itself. The fix is to detected the case and - * call fixCaret() a second time. - */ - if (e.dataTransfer.dropEffect === "none" && !e.dataTransfer.mozUserCancelled) { //$NON-NLS-1$ - this._fixCaret(); - } - } - }, - _handleDragEnter: function (e) { - if (this._ignoreEvent(e)) { return; } - var prevent = true; - this._dropTarget = true; - if (this.isListening("DragEnter")) { //$NON-NLS-1$ - prevent = false; - this.onDragEnter(this._createMouseEvent("DragEnter", e)); //$NON-NLS-1$ - } - /* - * Webkit will not send drop events if this event is not prevented, as spec in HTML5. - * Firefox and IE do not follow this spec for contentEditable. Note that preventing this - * event will result is loss of functionality (insertion mark, etc). - */ - if (util.isWebkit || prevent) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleDragOver: function (e) { - if (this._ignoreEvent(e)) { return; } - var prevent = true; - if (this.isListening("DragOver")) { //$NON-NLS-1$ - prevent = false; - this.onDragOver(this._createMouseEvent("DragOver", e)); //$NON-NLS-1$ - } - /* - * Webkit will not send drop events if this event is not prevented, as spec in HTML5. - * Firefox and IE do not follow this spec for contentEditable. Note that preventing this - * event will result is loss of functionality (insertion mark, etc). - */ - if (util.isWebkit || prevent) { - if (prevent) { e.dataTransfer.dropEffect = "none"; } //$NON-NLS-1$ - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleDragLeave: function (e) { - if (this._ignoreEvent(e)) { return; } - this._dropTarget = false; - if (this.isListening("DragLeave")) { //$NON-NLS-1$ - this.onDragLeave(this._createMouseEvent("DragLeave", e)); //$NON-NLS-1$ - } - }, - _handleDrop: function (e) { - if (this._ignoreEvent(e)) { return; } - this._dropTarget = false; - if (this.isListening("Drop")) { //$NON-NLS-1$ - this.onDrop(this._createMouseEvent("Drop", e)); //$NON-NLS-1$ - } - /* - * This event must be prevented otherwise the user agent will modify - * the DOM. Note that preventing the event on some user agents (i.e. IE) - * indicates that the operation is cancelled. This causes the dropEffect to - * be set to none in the dragend event causing the implementor to not execute - * the code responsible by the move effect. - */ - if (e.preventDefault) { e.preventDefault(); } - return false; - }, - _handleFocus: function () { - this._hasFocus = true; - if (util.isIOS && this._lastTouchOffset !== undefined) { - this.setCaretOffset(this._lastTouchOffset, true); - this._lastTouchOffset = undefined; - } else { - this._updateDOMSelection(); - } - if (this._cursorDiv) { - this._cursorDiv.style.display = "block"; //$NON-NLS-1$ - } - if (this._domSelection) { - this._domSelection.forEach(function(domSelection) { domSelection.update(); }); - } - if (!this._ignoreFocus) { - this.onFocus({type: "Focus"}); //$NON-NLS-1$ - } - }, - _handleKeyDown: function (e) { - this._cancelCheckSelection(); - if (this._ignoreEvent(e)) { return; } - if (this.isListening("KeyDown")) { //$NON-NLS-1$ - var keyEvent = this._createKeyEvent("KeyDown", e); //$NON-NLS-1$ - this.onKeyDown(keyEvent); //$NON-NLS-1$ - if (keyEvent.defaultPrevented) { - /* - * Feature in Firefox. Keypress events still happen even if the keydown event - * was prevented. The fix is to remember that keydown was prevented and prevent - * the keypress ourselves. - */ - if (util.isFirefox) { - this._keyDownPrevented = true; - } - e.preventDefault(); - return; - } - } - var modifier = false; - switch (e.keyCode) { - case 16: /* Shift */ - case 17: /* Control */ - case 18: /* Alt */ - case 91: /* Command */ - modifier = true; - break; - default: - this._setLinksVisible(false); - } - if (e.keyCode === 229) { - if (this._readonly) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - var startIME = true; - - /* - * Bug in Safari. Some Control+key combinations send key events - * with keyCode equals to 229. This is unexpected and causes the - * view to start an IME composition. The fix is to ignore these - * events. - */ - if (util.isSafari && util.isMac) { - if (e.ctrlKey) { - startIME = false; - e.keyCode = 0x81; - } - } - if (startIME) { - this._startIME(); - } - } else { - if (!modifier) { - this._commitIME(); - } - } - /* - * Feature in Firefox. When a key is held down the browser sends - * right number of keypress events but only one keydown. This is - * unexpected and causes the view to only execute an action - * just one time. The fix is to ignore the keydown event and - * execute the actions from the keypress handler. - * Note: This only happens on the Mac and Linux (Firefox 3.6). - * - * Feature in Opera < 12.16. Opera sends keypress events even for non-printable - * keys. The fix is to handle actions in keypress instead of keydown. - */ - if (((util.isMac || util.isLinux) && util.isFirefox < 4) || util.isOpera < 12.16) { - this._keyDownEvent = e; - return true; - } - - if (this._doAction(e)) { - if (e.preventDefault) { - e.preventDefault(); - e.stopPropagation(); - } else { - e.cancelBubble = true; - e.returnValue = false; - e.keyCode = 0; - } - return false; - } - }, - _handleKeyPress: function (e) { - if (this._ignoreEvent(e)) { return; } - /* - * Feature in Firefox. Keypress events still happen even if the keydown event - * was prevented. The fix is to remember that keydown was prevented and prevent - * the keypress ourselves. - */ - if (this._keyDownPrevented) { - if (e.preventDefault) { - e.preventDefault(); - e.stopPropagation(); - } - this._keyDownPrevented = undefined; - return; - } - /* - * Feature in Embedded WebKit. Embedded WekKit on Mac runs in compatibility mode and - * generates key press events for these Unicode values (Function keys). This does not - * happen in Safari or Chrome. The fix is to ignore these key events. - */ - if (util.isMac && util.isWebkit) { - if ((0xF700 <= e.keyCode && e.keyCode <= 0xF7FF) || e.keyCode === 13 || e.keyCode === 8) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - } - if (((util.isMac || util.isLinux) && util.isFirefox < 4) || util.isOpera < 12.16) { - if (this._doAction(this._keyDownEvent)) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - } - var ctrlKey = util.isMac ? e.metaKey : e.ctrlKey; - if (e.charCode !== undefined) { - if (ctrlKey) { - switch (e.charCode) { - /* - * In Firefox and Safari if ctrl+v, ctrl+c ctrl+x is canceled - * the clipboard events are not sent. The fix to allow - * the browser to handles these key events. - */ - case 99://c - case 118://v - case 120://x - return true; - } - } - } - if (this.isListening("KeyPress")) { //$NON-NLS-1$ - var keyEvent = this._createKeyEvent("KeyPress", e); //$NON-NLS-1$ - this.onKeyPress(keyEvent); //$NON-NLS-1$ - if (keyEvent.defaultPrevented) { - e.preventDefault(); - return; - } - } - if (this._doAction(e)) { - if (e.preventDefault) { - e.preventDefault(); - e.stopPropagation(); - } else { - e.cancelBubble = true; - e.returnValue = false; - e.keyCode = 0; - } - return false; - } - var ignore = false; - if (util.isMac) { - if (e.ctrlKey || e.metaKey) { ignore = true; } - } else { - if (util.isFirefox) { - //Firefox clears the state mask when ALT GR generates input - if (e.ctrlKey || e.altKey) { ignore = true; } - } else { - //IE and Chrome only send ALT GR when input is generated - if (e.ctrlKey ^ e.altKey) { ignore = true; } - } - } - if (!ignore) { - var key = util.isOpera ? e.which : (e.charCode !== undefined ? e.charCode : e.keyCode); - if (key > 31) { - this._doContent(String.fromCharCode (key)); - if (e.preventDefault) { e.preventDefault(); } - return false; - } - } - }, - _handleDocKeyUp: function (e) { - var ctrlKey = util.isMac ? e.metaKey : e.ctrlKey; - if (!ctrlKey) { - this._setLinksVisible(false); - } - }, - _handleKeyUp: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this.isListening("KeyUp")) { //$NON-NLS-1$ - var keyEvent = this._createKeyEvent("KeyUp", e); //$NON-NLS-1$ - this.onKeyUp(keyEvent); //$NON-NLS-1$ - if (keyEvent.defaultPrevented) { - e.preventDefault(); - return; - } - } - this._handleDocKeyUp(e); - // don't commit for space (it happens during JP composition) - if (e.keyCode === 13) { - this._commitIME(); - } - }, - _handleLinkClick: function (e) { - var ctrlKey = util.isMac ? e.metaKey : e.ctrlKey; - if (!ctrlKey) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleMouse: function (e) { - var win = this._getWindow(); - var result = true; - var target = win; - if (util.isIE || (util.isFirefox && !this._overlayDiv)) { target = this._clientDiv; } - if (this._overlayDiv) { - if (this._hasFocus) { - this._ignoreFocus = true; - } - var that = this; - win.setTimeout(function () { - that.focus(); - that._ignoreFocus = false; - }, 0); - } - var extend = e.shiftKey; - var block = e.altKey; - var add = util.isMac ? e.metaKey : e.ctrlKey; - this._blockSelection = this._doubleClickSelection = null; - if (this._clickCount === 1) { - var drag = (!util.isOpera || util.isOpera >= 12.16) && this._hasFocus && this.isListening("DragStart"); //$NON-NLS-1$ - result = this._setSelectionTo(e.clientX, e.clientY, true, extend, add, drag); - if (result) { this._setGrab(target); } - } else { - /* - * Feature in IE8 and older, the sequence of events in the IE8 event model - * for a doule-click is: - * - * down - * up - * up - * dblclick - * - * Given that the mouse down/up events are not balanced, it is not possible to - * grab on mouse down and ungrab on mouse up. The fix is to grab on the first - * mouse down and ungrab on mouse move when the button 1 is not set. - */ - if (this._isW3CEvents) { this._setGrab(target); } - - this._setSelectionTo(e.clientX, e.clientY, true, extend, add, false); - this._doubleClickSelection = Selection.editing(this._getSelections()); - } - if (block) { - this._blockSelection = Selection.editing(this._getSelections()); - } - return result; - }, - _handleMouseDown: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this._linksVisible) { - var target = e.target || e.srcElement; - if (target.tagName !== "A") { //$NON-NLS-1$ - this._setLinksVisible(false); - } else { - return; - } - } - this._commitIME(); - - var button = e.which; // 1 - left, 2 - middle, 3 - right - if (!button) { - // if IE 8 or older - if (e.button === 4) { button = 2; } - if (e.button === 2) { button = 3; } - if (e.button === 1) { button = 1; } - } - - // For middle click we always need getTime(). See _getClipboardText(). - var time = button !== 2 && e.timeStamp ? e.timeStamp : new Date().getTime(); - var timeDiff = time - this._lastMouseTime; - var deltaX = Math.abs(this._lastMouseX - e.clientX); - var deltaY = Math.abs(this._lastMouseY - e.clientY); - var sameButton = this._lastMouseButton === button; - this._lastMouseX = e.clientX; - this._lastMouseY = e.clientY; - this._lastMouseTime = time; - this._lastMouseButton = button; - - if (button === 1) { - this._isMouseDown = true; - if (sameButton && timeDiff <= this._clickTime && deltaX <= this._clickDist && deltaY <= this._clickDist) { - this._clickCount++; - } else { - this._clickCount = 1; - } - } - if (this.isListening("MouseDown")) { //$NON-NLS-1$ - var mouseEvent = this._createMouseEvent("MouseDown", e); //$NON-NLS-1$ - this.onMouseDown(mouseEvent); - if (mouseEvent.defaultPrevented) { - e.preventDefault(); - return; - } - } - if (button === 1) { - if (this._handleMouse(e) && (util.isIE >= 9 || util.isOpera || util.isChrome || util.isSafari || (util.isFirefox && !this._overlayDiv))) { - if (!this._hasFocus) { - this.focus(); - } - e.preventDefault(); - } - } - if (util.isFirefox && this._lastMouseButton === 3) { - // We need to update the DOM selection, because on - // right-click the caret moves to the mouse location. - // See bug 366312 and 376508. - this._updateDOMSelection(); - } - }, - _handleMouseOver: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this._animation) { return; } - if (this.isListening("MouseOver")) { //$NON-NLS-1$ - this.onMouseOver(this._createMouseEvent("MouseOver", e)); //$NON-NLS-1$ - } - }, - _handleMouseOut: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this._animation) { return; } - if (this.isListening("MouseOut")) { //$NON-NLS-1$ - this.onMouseOut(this._createMouseEvent("MouseOut", e)); //$NON-NLS-1$ - } - }, - _handleMouseMove: function (e) { - if (this._animation) { return; } - var inClient = this._isClientDiv(e); - if (this.isListening("MouseMove")) { //$NON-NLS-1$ - if (inClient || this._isMouseDown){ - var mouseEvent = this._createMouseEvent("MouseMove", e); //$NON-NLS-1$ - this.onMouseMove(mouseEvent); - if (mouseEvent.defaultPrevented) { - e.preventDefault(); - return; - } - } - } - if (this._dropTarget) { - return; - } - /* - * Bug in IE9. IE sends one mouse event when the user changes the text by - * pasting or undo. These operations usually happen with the Ctrl key - * down which causes the view to enter link mode. Link mode does not end - * because there are no further events. The fix is to only enter link - * mode when the coordinates of the mouse move event have changed. - */ - var changed = this._linksVisible || this._lastMouseMoveX !== e.clientX || this._lastMouseMoveY !== e.clientY; - this._lastMouseMoveX = e.clientX; - this._lastMouseMoveY = e.clientY; - this._setLinksVisible(changed && !this._isMouseDown && e.altKey && (util.isMac ? e.metaKey : e.ctrlKey)); - - this._checkOverlayScroll(); - - /* - * Feature in IE8 and older, the sequence of events in the IE8 event model - * for a doule-click is: - * - * down - * up - * up - * dblclick - * - * Given that the mouse down/up events are not balanced, it is not possible to - * grab on mouse down and ungrab on mouse up. The fix is to grab on the first - * mouse down and ungrab on mouse move when the button 1 is not set. - * - * In order to detect double-click and drag gestures, it is necessary to send - * a mouse down event from mouse move when the button is still down and isMouseDown - * flag is not set. - */ - if (!this._isW3CEvents) { - if (e.button === 0) { - this._setGrab(null); - return true; - } - if (!this._isMouseDown && e.button === 1 && (this._clickCount & 1) !== 0 && inClient) { - this._clickCount = 2; - return this._handleMouse(e, this._clickCount); - } - } - if (!this._isMouseDown || this._dragOffset !== -1) { - return; - } - - var x = e.clientX; - var y = e.clientY; - var viewPad = this._getViewPadding(); - var viewRect = this._viewDiv.getBoundingClientRect(); - var width = this._getClientWidth (), height = this._getClientHeight(); - var leftEdge = viewRect.left + viewPad.left; - var topEdge = viewRect.top + viewPad.top; - var rightEdge = viewRect.left + viewPad.left + width; - var bottomEdge = viewRect.top + viewPad.top + height; - if (y < topEdge) { - this._doAutoScroll("up", x, y - topEdge); //$NON-NLS-1$ - } else if (y > bottomEdge) { - this._doAutoScroll("down", x, y - bottomEdge); //$NON-NLS-1$ - } else if (x < leftEdge && !this._wrapMode) { - this._doAutoScroll("left", x - leftEdge, y); //$NON-NLS-1$ - } else if (x > rightEdge && !this._wrapMode) { - this._doAutoScroll("right", x - rightEdge, y); //$NON-NLS-1$ - } else { - this._endAutoScroll(); - this._setSelectionTo(x, y, false, true); - } - }, - _isClientDiv: function(e) { - var topNode = this._overlayDiv || this._clientDiv; - var temp = e.target ? e.target : e.srcElement; - while (temp) { - if (topNode === temp) { - return true; - } - temp = temp.parentNode; - } - return false; - }, - _createKeyEvent: function(type, e) { - return { - type: type, - event: e, - preventDefault: function() { - this.defaultPrevented = true; - } - }; - }, - _createMouseEvent: function(type, e) { - var pt = this.convert({x: e.clientX, y: e.clientY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$ - return { - type: type, - event: e, - clickCount: this._clickCount, - x: pt.x, - y: pt.y, - preventDefault: function() { - this.defaultPrevented = true; - } - }; - }, - _createTouchEvent: function(type, e) { - var pt = e.touches.length ? this.convert({x: e.touches[0].clientX, y: e.touches[0].clientY}, "page", "document") : {}; //$NON-NLS-1$ //$NON-NLS-2$ - return { - type: type, - event: e, - touchCount: e.touches.length, - x: pt.x, - y: pt.y, - preventDefault: function() { - this.defaultPrevented = true; - } - }; - }, - _handleMouseUp: function (e) { - var left = e.which ? e.button === 0 : e.button === 1; - if (this.isListening("MouseUp")) { //$NON-NLS-1$ - if (this._isClientDiv(e) || (left && this._isMouseDown)) { - var mouseEvent = this._createMouseEvent("MouseUp", e); //$NON-NLS-1$ - this.onMouseUp(mouseEvent); - if (mouseEvent.defaultPrevented) { - e.preventDefault(); - this._isMouseDown = false; - return; - } - } - } - if (this._linksVisible) { - return; - } - if (left && this._isMouseDown) { - var selections = this._getSelections(); - var selection = Selection.editing(selections); - selections.forEach(function(sel) { - sel._editing = false; - }); - if (this._dragOffset !== -1) { - selection.extend(this._dragOffset); - selection.collapse(); - selections = selection; - this._dragOffset = -1; - } - this._setSelection(selections, false); - this._isMouseDown = false; - this._endAutoScroll(); - - /* - * Feature in IE8 and older, the sequence of events in the IE8 event model - * for a doule-click is: - * - * down - * up - * up - * dblclick - * - * Given that the mouse down/up events are not balanced, it is not possible to - * grab on mouse down and ungrab on mouse up. The fix is to grab on the first - * mouse down and ungrab on mouse move when the button 1 is not set. - */ - if (this._isW3CEvents) { this._setGrab(null); } - } - /* - * Note that there cases when Firefox sets the DOM selection in mouse up. - * This happens for example after a cancelled drag operation. - * - * Note that on Chrome and IE, the caret stops blicking if mouse up is - * prevented. - */ - if (left && this._isMouseDown && util.isFirefox) { - this._updateDOMSelection(); - e.preventDefault(); - } - }, - _handleMouseWheel: function (e) { - if (this._noScroll) return; - var lineHeight = this._getLineHeight(); - var pixelX = 0, pixelY = 0; - // Note: On the Mac the correct behaviour is to scroll by pixel. - if (util.isIE || util.isOpera) { - pixelY = (-e.wheelDelta / 40) * lineHeight; - } else if (util.isFirefox) { - var limit = 256; - if (e.type === "wheel") { //$NON-NLS-1$ - if (e.deltaMode) { // page or line - pixelX = Math.max(-limit, Math.min(limit, e.deltaX)) * lineHeight; - pixelY = Math.max(-limit, Math.min(limit, e.deltaY)) * lineHeight; - } else { - pixelX = e.deltaX; - pixelY = e.deltaY; - } - } else { - var pixel; - if (util.isMac) { - pixel = e.detail * 3; - } else { - pixel = Math.max(-limit, Math.min(limit, e.detail)) * lineHeight; - } - if (e.axis === e.HORIZONTAL_AXIS) { - pixelX = pixel; - } else { - pixelY = pixel; - } - } - } else { - //Webkit - if (util.isMac) { - /* - * In Safari, the wheel delta is a multiple of 120. In order to - * convert delta to pixel values, it is necessary to divide delta - * by 40. - * - * In Chrome and Safari 5, the wheel delta depends on the type of the - * mouse. In general, it is the pixel value for Mac mice and track pads, - * but it is a multiple of 120 for other mice. There is no presise - * way to determine if it is pixel value or a multiple of 120. - * - * Note that the current approach does not calculate the correct - * pixel value for Mac mice when the delta is a multiple of 120. - * - * For values that are multiples of 120, the denominator varies on - * the time between events. - */ - var denominatorX, denominatorY; - var deltaTime = e.timeStamp - this._wheelTimeStamp; - this._wheelTimeStamp = e.timeStamp; - if (e.wheelDeltaX % 120 !== 0) { - denominatorX = 1; - } else { - denominatorX = deltaTime < 40 ? 40/(40-deltaTime) : 40; - } - if (e.wheelDeltaY % 120 !== 0) { - denominatorY = 1; - } else { - denominatorY = deltaTime < 40 ? 40/(40-deltaTime) : 40; - } - pixelX = Math.ceil(-e.wheelDeltaX / denominatorX); - if (-1 < pixelX && pixelX < 0) { pixelX = -1; } - if (0 < pixelX && pixelX < 1) { pixelX = 1; } - pixelY = Math.ceil(-e.wheelDeltaY / denominatorY); - if (-1 < pixelY && pixelY < 0) { pixelY = -1; } - if (0 < pixelY && pixelY < 1) { pixelY = 1; } - } else { - pixelX = -e.wheelDeltaX; - var linesToScroll = 8; - pixelY = (-e.wheelDeltaY / 120 * linesToScroll) * lineHeight; - } - } - /* - * Feature in Safari. If the event target is removed from the DOM - * safari stops smooth scrolling. The fix is keep the element target - * in the DOM and remove it on a later time. - * - * Note: Using a timer is not a solution, because the timeout needs to - * be at least as long as the gesture (which is too long). - */ - if (util.isSafari || (util.isChrome && util.isMac)) { - var lineDiv = e.target; - while (lineDiv && lineDiv.lineIndex === undefined) { - lineDiv = lineDiv.parentNode; - } - this._mouseWheelLine = lineDiv; - } - var oldScroll = this._getScroll(); - this._scrollView(pixelX, pixelY); - var newScroll = this._getScroll(); - if (oldScroll.x !== newScroll.x || oldScroll.y !== newScroll.y) { - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handlePaste: function (e) { - this._cancelCheckSelection(); - if (this._ignoreEvent(e)) { return; } - if (this._ignorePaste) { return; } - if (this._doPaste(e)) { - if (util.isIE) { - /* - * Bug in IE, - */ - var that = this; - this._ignoreFocus = true; - var win = this._getWindow(); - win.setTimeout(function() { - that._updateDOMSelection(); - that._ignoreFocus = false; - }, 0); - } - if (e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _handleResize: function () { - var newWidth = this._rootDiv.clientWidth; - var newHeight = this._rootDiv.clientHeight; - if (this._rootWidth !== newWidth || this._rootHeight !== newHeight) { - if (this._rootWidth !== newWidth && this._wrapMode) { - this._resetLineHeight(); - } - this._rootWidth = newWidth; - this._rootHeight = newHeight; - /* - * Feature in IE7. For some reason, sometimes Internet Explorer 7 - * returns incorrect values for element.getBoundingClientRect() when - * inside a resize handler. The fix is to queue the work. - */ - var queue = util.isIE < 9; - - /* - * The calculated metrics may be out of date when the zoom level changes. - */ - var metrics = this._calculateMetrics(); - if (!compare(metrics, this._metrics)) { - if (this._metrics.invalid && !metrics.invalid) { - this._updateStyle(false, metrics); - } else { - if (this._variableLineHeight) { - this._variableLineHeight = false; - this._resetLineHeight(); - } - this._metrics = metrics; - } - queue = true; - } - - if (queue) { - this._queueUpdate(); - } else { - this._update(); - } - this.dispatchEvent({type: "Resize"}); //$NON-NLS-1$ - } - }, - _handleRulerEvent: function (e) { - var target = e.target ? e.target : e.srcElement; - var lineIndex = target.lineIndex; - var element = target; - while (element && !element._ruler) { - if (lineIndex === undefined && element.lineIndex !== undefined) { - lineIndex = element.lineIndex; - } - element = element.parentNode; - } - var ruler = element ? element._ruler : null; - if (lineIndex === undefined && ruler && ruler.getOverview() === "document") { //$NON-NLS-1$ - var clientHeight = this._getClientHeight (); - var lineCount = this._model.getLineCount (); - var viewPad = this._getViewPadding(); - var viewRect = this._viewDiv.getBoundingClientRect(); - var lineHeight = this._getLineHeight(); - var contentHeight = lineHeight * lineCount; - var trackHeight = clientHeight + viewPad.top + viewPad.bottom - 2 * this._metrics.scrollWidth; - var divHeight, arrowWidth; - if (contentHeight < trackHeight) { - divHeight = lineHeight; - arrowWidth = viewPad.top; - } else { - divHeight = trackHeight / lineCount; - arrowWidth = this._metrics.scrollWidth; - } - lineIndex = Math.floor(((e.clientY - viewRect.top) - arrowWidth) / divHeight); - if (!(0 <= lineIndex && lineIndex < lineCount)) { - lineIndex = undefined; - } - } - if (ruler) { - switch (e.type) { - case "click": //$NON-NLS-1$ - if (ruler.onClick) { ruler.onClick(lineIndex, e); } - break; - case "dblclick": //$NON-NLS-1$ - if (ruler.onDblClick) { ruler.onDblClick(lineIndex, e); } - break; - case "mousemove": //$NON-NLS-1$ - if (ruler.onMouseMove) { ruler.onMouseMove(lineIndex, e); } - break; - case "mouseover": //$NON-NLS-1$ - if (ruler.onMouseOver) { ruler.onMouseOver(lineIndex, e); } - break; - case "mouseout": //$NON-NLS-1$ - if (ruler.onMouseOut) { - var tmp = e.relatedTarget; - while (tmp && tmp !== this._rootDiv) { - if (tmp === element) { - return; - } - tmp = tmp.parentNode; - } - ruler.onMouseOut(lineIndex, e); - } - break; - } - } - }, - _handleScroll: function () { - this._lastScrollTime = new Date().getTime(); - var _scroll = this._getScroll(false); - var oldX = this._hScroll; - var oldY = this._vScroll; - if (oldX !== _scroll.x || oldY !== _scroll.y) { - this._hScroll = _scroll.x; - this._vScroll = _scroll.y; - this._commitIME(); - this._update(oldY === _scroll.y); - var e = { - type: "Scroll", //$NON-NLS-1$ - oldValue: {x: oldX, y: oldY}, - newValue: _scroll - }; - this.onScroll(e); - } - }, - _handleSelectStart: function (e) { - var menuOpen = this._contextMenuOpen; - this._contextMenuOpen = false; - if (menuOpen) { - this._checkSelectionChange = true; - return; - } - if (this._ignoreSelect) { - if (e && e.preventDefault) { e.preventDefault(); } - return false; - } - }, - _getModelOffset: function(node, offset) { - if (!node) { return; } - var lineNode; - if (node.tagName === "DIV") { //$NON-NLS-1$ - lineNode = node; - } else { - lineNode = node.parentNode.parentNode; - } - if (!lineNode._line) { - return 0; - } - return lineNode._line.getModelOffset (node, offset); - }, - _updateSelectionFromDOM: function() { - if (!(util.isIOS || util.isAndroid || this._checkSelectionChange)) { - return false; - } - var win = this._getWindow(); - var selection = win.getSelection(); - var start = this._getModelOffset(selection.anchorNode, selection.anchorOffset); - var end = this._getModelOffset(selection.focusNode, selection.focusOffset); - var sel = this._getSelections()[0]; - if (start === undefined || end === undefined || (sel.start === start && sel.end === end)) { - return false; - } - - if (this._checkSelectionChange) { - var firstLine = this._getLineNext(); - var lastLine = this._getLinePrevious(); - - // Selection is unchanged and bigger than the visible buffer region - if (selection.anchorNode === firstLine.firstChild.firstChild && selection.anchorOffset === 0 && - selection.focusNode === lastLine.firstChild.firstChild && selection.focusOffset === 0) - { - return false; - } - - // Detect select all - if ( - (selection.anchorNode === firstLine.firstChild.firstChild && selection.anchorOffset === 0 && selection.focusNode === lastLine.lastChild.firstChild) - || (selection.anchorNode === this._clientDiv && selection.focusNode === this._clientDiv) - ) { - start = 0; - end = this.getModel().getCharCount(); - } - } - - this._setSelection(new Selection(start, end), false, false); - this._checkSelectionChange = false; - return true; - }, - _cancelCheckSelection: function() { - if (this._checkSelectionChange) { - this._checkSelectionChange = false; - this._cancelPollSelectionChange(); - } - }, - _cancelPollSelectionChange: function() { - if (this._selPollTimer) { - var win = this._getWindow(); - win.clearTimeout(this._selPollTimer); - this._selPollTimer = null; - } - }, - _pollSelectionChange: function(retryPoll) { - var that = this; - var win = this._getWindow(); - this._cancelPollSelectionChange(); - this._selPollTimer = win.setTimeout(function() { - that._selPollTimer = null; - if (!that._clientDiv) { return; } - var changed = that._updateSelectionFromDOM(); - if (!changed && retryPoll) { - that._pollSelectionChange(retryPoll); - } - }, 100); - }, - _handleSelectionChange: function () { - if (this._imeOffset !== -1) { - return; - } - /* - * Feature in Android. The selection handles are hidden when the DOM changes. Sending - * selection events to the application while the user is moving the selection handles - * may hide the handles unexpectedly. The fix is to delay updating the selection and - * sending the event to the application. - */ - if (util.isAndroid) { - this._pollSelectionChange(); - } else { - this._updateSelectionFromDOM(); - } - }, - _handleTextInput: function (e) { - if (this._ignoreEvent(e)) { return; } - if (this._imeOffset !== -1) { - return; - } - var selection = this._getWindow().getSelection(); - if ( - selection.anchorNode !== this._anchorNode || selection.focusNode !== this._focusNode || - selection.anchorOffset !== this._anchorOffset || selection.focusOffset !== this._focusOffset - ) { - var temp = selection.anchorNode; - while (temp) { - if (temp.lineIndex !== undefined) { - break; - } - temp = temp.parentNode; - } - if (temp) { - var model = this._model; - var lineIndex = temp.lineIndex; - var oldText = model.getLine(lineIndex), text = oldText; - var offset = 0; - var lineStart = model.getLineStart(lineIndex); - if (selection.rangeCount > 0) { - selection.getRangeAt(0).deleteContents(); - var node = temp.ownerDocument.createTextNode(e.data); - selection.getRangeAt(0).insertNode(node); - var nodeText = this._getDOMText(temp, node); - text = nodeText.text; - offset = nodeText.offset; - node.parentNode.removeChild(node); - } - temp.lineRemoved = true; - - var start = 0; - while (oldText.charCodeAt(start) === text.charCodeAt(start) && start < offset) { - start++; - } - - var end = oldText.length - 1, delta = text.length - oldText.length; - while (oldText.charCodeAt(end) === text.charCodeAt(end + delta) && end + delta >= offset + e.data.length) { - end--; - } - end++; - - var deltaText = text.substring(start, end + delta); - start += lineStart; - end += lineStart; - - var selections = this._getSelections(); - var deltaStart = selections[0].start - start; - var deltaEnd = selections[0].end - end; - selections[0].start = start; - selections[0].end = end; - for (var i=1; i= 0; i--) { - mode = keyModes[i]; - if (typeof mode.match === "function") { //$NON-NLS-1$ - var actionID = mode.match(e); - if (actionID !== undefined) { - return this.invokeAction(actionID); - } - } - } - return false; - }, - _doMove: function(args, selection) { - var model = this._model; - var caret = selection.getCaret(); - var lineIndex = model.getLineAtOffset(caret); - if (!args.count) { - args.count = 1; - } - while (args.count !== 0) { - var lineStart = model.getLineStart(lineIndex); - if (args.count < 0 && caret === lineStart) { - if (lineIndex > 0) { - if (args.unit === "character") { //$NON-NLS-1$ - args.count++; - } - lineIndex--; - selection.extend(model.getLineEnd(lineIndex)); - } else { - break; - } - } else if (args.count > 0 && caret === model.getLineEnd(lineIndex)) { - if (lineIndex + 1 < model.getLineCount()) { - if (args.unit === "character") { //$NON-NLS-1$ - args.count--; - } - lineIndex++; - selection.extend(model.getLineStart(lineIndex)); - } else { - break; - } - } else { - var removeTab = false; - if (args.expandTab && args.unit === "character" && (caret - lineStart) % this._tabSize === 0) { //$NON-NLS-1$ - var lineText = model.getText(lineStart, caret); - removeTab = !/[^ ]/.test(lineText); // Only spaces between line start and caret. - } - if (removeTab) { - selection.extend(caret - this._tabSize); - args.count += args.count < 0 ? 1 : -1; - } else { - var line = this._getLine(lineIndex); - selection.extend(line.getNextOffset(caret, args)); - line.destroy(); - } - } - caret = selection.getCaret(); - } - return selection; - }, - _doBackspace: function (args) { - var that = this; - var selections = this._getSelections(); - selections.forEach(function(selection) { - if (selection.isEmpty()) { - if (!args.count) { - args.count = 1; - } - args.count *= -1; - args.expandTab = that._expandTab; - that._doMove(args, selection); - } - }); - this._modifyContent({text: "", selection: selections}, true); - return true; - }, - _doCase: function (args) { - var that = this; - var selections = this._getSelections(); - var changes = []; - selections.forEach(function(selection) { - that._doMove(args, selection); - var text = that.getText(selection.start, selection.end); - switch (args.type) { - case "lower": text = text.toLowerCase(); break; //$NON-NLS-1$ - case "capitalize": text = text.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); break; //$NON-NLS-1$ - case "reverse": //$NON-NLS-1$ - var newText = ""; - for (var i=0; i 0) { - lineIndex = Math.min (lineIndex + args.count - 1, model.getLineCount() - 1); - } - offset = model.getLineEnd(lineIndex); - } - selection.extend(offset); - } - if (!args.select) { selection.collapse(); } - }); - this._setSelection(selections, true, true, args.ctrl ? function() {} : null); - return true; - }, - _doEnter: function (args) { - if (this._singleMode) return true; - var model = this._model; - var selections = this._getSelections(); - this._doContent(model.getLineDelimiter()); - if (args && args.noCursor) { - selections.forEach(function(selection) { - selection.end = selection.start; - }); - this._setSelection(selections, true); - } - return true; - }, - _doEscape: function () { - var selections = this._getSelections(); - if (selections.length > 1) { - this._setSelection(selections[0], true); - } - return true; - }, - _doHome: function (args) { - var model = this._model; - var that = this; - var selections = this._getSelections(); - selections.forEach(function(selection) { - if (args.ctrl) { - selection.extend(0); - } else { - var offset = selection.getCaret(); - var lineIndex = model.getLineAtOffset(offset); - if (that._wrapMode) { - var line = that._getLine(lineIndex); - var visualIndex = line.getLineIndex(offset); - offset = line.getLineStart(visualIndex); - line.destroy(); - } else { - offset = model.getLineStart(lineIndex); - } - selection.extend(offset); - } - if (!args.select) { selection.collapse(); } - }); - this._setSelection(selections, true, true, args.ctrl ? function() {} : null); - return true; - }, - _doLineDown: function (args) { - var model = this._model; - var that = this; - var selections = this._getSelections(); - selections.forEach(function(selection) { - var caret = selection.getCaret(); - var lineIndex = model.getLineAtOffset(caret), visualIndex; - var line = that._getLine(lineIndex); - var x = selection._columnX, y = 1, lastLine = false; - if (x === -1 || args.wholeLine || (args.select && util.isIE)) { - var offset = args.wholeLine ? model.getLineEnd(lineIndex + 1) : caret; - x = selection._columnX = line.getBoundingClientRect(offset).left; - } - if ((visualIndex = line.getLineIndex(caret)) < line.getLineCount() - 1) { - y = line.getClientRects(visualIndex + 1).top + 1; - } else { - var lastLineCount = model.getLineCount() - 1; - lastLine = lineIndex === lastLineCount; - if (args.count && args.count > 0) { - lineIndex = Math.min (lineIndex + args.count, lastLineCount); - } else { - lineIndex++; - } - } - var select = false; - if (lastLine) { - if (args.select || (util.isMac || util.isLinux)) { - selection.extend(model.getCharCount()); - select = true; - } - } else { - if (line.lineIndex !== lineIndex) { - line.destroy(); - line = that._getLine(lineIndex); - } - selection.extend(line.getOffset(x, y)); - select = true; - } - if (select) { - if (!args.select) { selection.collapse(); } - } - line.destroy(); - }); - that._setSelection(selections, true, true, null, 0, false, true); - return true; - }, - _doLineUp: function (args) { - var model = this._model; - var that = this; - var selections = this._getSelections(); - selections.forEach(function(selection) { - var caret = selection.getCaret(); - var lineIndex = model.getLineAtOffset(caret), visualIndex; - var line = that._getLine(lineIndex); - var x = selection._columnX, firstLine = false, y; - if (x === -1 || args.wholeLine || (args.select && util.isIE)) { - var offset = args.wholeLine ? model.getLineStart(lineIndex - 1) : caret; - x = selection._columnX = line.getBoundingClientRect(offset).left; - } - if ((visualIndex = line.getLineIndex(caret)) > 0) { - y = line.getClientRects(visualIndex - 1).top + 1; - } else { - firstLine = lineIndex === 0; - if (!firstLine) { - if (args.count && args.count > 0) { - lineIndex = Math.max (lineIndex - args.count, 0); - } else { - lineIndex--; - } - y = that._getLineHeight(lineIndex) - 1; - } - } - var select = false; - if (firstLine) { - if (args.select || (util.isMac || util.isLinux)) { - selection.extend(0); - select = true; - } - } else { - if (line.lineIndex !== lineIndex) { - line.destroy(); - line = that._getLine(lineIndex); - } - selection.extend(line.getOffset(x, y)); - select = true; - } - if (select) { - if (!args.select) { selection.collapse(); } - } - line.destroy(); - }); - that._setSelection(selections, true, true, null, 0, false, true); - return true; - }, - _doNoop: function () { - return true; - }, - _doPageDown: function (args) { - var that = this; - var model = this._model; - var selections = this._getSelections(); - var lineCount = model.getLineCount(); - var _scroll = this._getScroll(); - var clientHeight = this._getClientHeight(); - var lineHeight = this._getLineHeight(); - var lines = Math.floor(clientHeight / lineHeight); - var x, line, pageScroll; - selections.forEach(function(selection) { - var caret = selection.getCaret(); - var caretLine = model.getLineAtOffset(caret); - if (that._lineHeight) { - x = selection._columnX; - var caretRect = that._getBoundsAtOffset(caret); - if (x === -1 || (args.select && util.isIE)) { - x = selection._columnX = caretRect.left; - } - var lineIndex = that._getLineIndex(caretRect.top + clientHeight); - line = that._getLine(lineIndex); - var linePixel = that._getLinePixel(lineIndex); - var y = caretRect.top + clientHeight - linePixel; - caret = line.getOffset(x, y); - var rect = line.getBoundingClientRect(caret); - line.destroy(); - selection.extend(caret); - if (!args.select) { selection.collapse(); } - pageScroll = pageScroll !== undefined ? Math.min(pageScroll, rect.top + linePixel - caretRect.top) : rect.top + linePixel - caretRect.top; - } else { - if (caretLine < lineCount - 1) { - var scrollLines = Math.min(lineCount - caretLine - 1, lines); - scrollLines = Math.max(1, scrollLines); - x = selection._columnX; - if (x === -1 || (args.select && util.isIE)) { - line = that._getLine(caretLine); - x = selection._columnX = line.getBoundingClientRect(caret).left; - line.destroy(); - } - line = that._getLine(caretLine + scrollLines); - selection.extend(line.getOffset(x, 0)); - line.destroy(); - if (!args.select) { selection.collapse(); } - var verticalMaximum = lineCount * lineHeight; - var scrollOffset = _scroll.y + scrollLines * lineHeight; - if (scrollOffset + clientHeight > verticalMaximum) { - scrollOffset = verticalMaximum - clientHeight; - } - pageScroll = pageScroll !== undefined ? Math.min(pageScroll, scrollOffset - _scroll.y) : scrollOffset - _scroll.y; - } - } - }); - this._setSelection(selections, true, true, function() {}, pageScroll, false, true); - return true; - }, - _doPageUp: function (args) { - var that = this; - var model = this._model; - var selections = this._getSelections(); - var _scroll = this._getScroll(); - var clientHeight = this._getClientHeight(); - var lineHeight = this._getLineHeight(); - var lines = Math.floor(clientHeight / lineHeight); - var x, line, pageScroll; - selections.forEach(function(selection) { - var caret = selection.getCaret(); - var caretLine = model.getLineAtOffset(caret); - if (that._lineHeight) { - x = selection._columnX; - var caretRect = that._getBoundsAtOffset(caret); - if (x === -1 || (args.select && util.isIE)) { - x = selection._columnX = caretRect.left; - } - var lineIndex = that._getLineIndex(caretRect.bottom - clientHeight); - line = that._getLine(lineIndex); - var linePixel = that._getLinePixel(lineIndex); - var y = (caretRect.bottom - clientHeight) - linePixel; - caret = line.getOffset(x, y); - var rect = line.getBoundingClientRect(caret); - line.destroy(); - selection.extend(caret); - if (!args.select) { selection.collapse(); } - pageScroll = pageScroll !== undefined ? Math.max(pageScroll, rect.top + linePixel - caretRect.top) : rect.top + linePixel - caretRect.top; - } else { - if (caretLine > 0) { - var scrollLines = Math.max(1, Math.min(caretLine, lines)); - x = selection._columnX; - if (x === -1 || (args.select && util.isIE)) { - line = that._getLine(caretLine); - x = selection._columnX = line.getBoundingClientRect(caret).left; - line.destroy(); - } - line = that._getLine(caretLine - scrollLines); - selection.extend(line.getOffset(x, that._getLineHeight(caretLine - scrollLines) - 1)); - line.destroy(); - if (!args.select) { selection.collapse(); } - var scrollOffset = Math.max(0, _scroll.y - scrollLines * lineHeight); - pageScroll = pageScroll !== undefined ? Math.max(pageScroll, scrollOffset - _scroll.y) : scrollOffset - _scroll.y; - } - } - }); - this._setSelection(selections, true, true, function() {}, pageScroll, false, true); - return true; - }, - _doPaste: function(e) { - var that = this; - var result = this._getClipboardText(e, function(text) { - if (text.length) { - if (util.isLinux && that._lastMouseButton === 2) { - var timeDiff = new Date().getTime() - that._lastMouseTime; - if (timeDiff <= that._clickTime) { - that._setSelectionTo(that._lastMouseX, that._lastMouseY, true); - } - } - var selections = that._getSelections(); - var delimiter = that._singleMode ? "" : that._model.getLineDelimiter(); - that._doContent(selections.length > 1 && selections.length === text.length ? text : text.join(delimiter)); - } - }); - return result !== null; - }, - _doScroll: function (args) { - var type = args.type; - var model = this._model; - var lineCount = model.getLineCount(); - var clientHeight = this._getClientHeight(); - var lineHeight = this._getLineHeight(); - var verticalMaximum = this._lineHeight ? this._scrollHeight : lineCount * lineHeight; - var verticalScrollOffset = this._getScroll().y; - var pixel; - switch (type) { - case "textStart": pixel = 0; break; //$NON-NLS-1$ - case "textEnd": pixel = verticalMaximum - clientHeight; break; //$NON-NLS-1$ - case "pageDown": pixel = verticalScrollOffset + clientHeight; break; //$NON-NLS-1$ - case "pageUp": pixel = verticalScrollOffset - clientHeight; break; //$NON-NLS-1$ - case "lineDown": pixel = verticalScrollOffset + lineHeight; break; //$NON-NLS-1$ - case "lineUp": pixel = verticalScrollOffset - lineHeight; break; //$NON-NLS-1$ - case "centerLine": //$NON-NLS-1$ - var selection = this._getSelections()[0]; - var lineStart = model.getLineAtOffset(selection.start); - var lineEnd = model.getLineAtOffset(selection.end); - var selectionHeight = (lineEnd - lineStart + 1) * lineHeight; - pixel = (lineStart * lineHeight) - (clientHeight / 2) + (selectionHeight / 2); - break; - } - if (pixel !== undefined) { - pixel = Math.min(Math.max(0, pixel), verticalMaximum - clientHeight); - this._scrollViewAnimated(0, pixel - verticalScrollOffset, function() {}); - } - return true; - }, - _doSelectAll: function () { - var model = this._model; - this._setSelection(new Selection(0, model.getCharCount()), false); - return true; - }, - _doTab: function () { - if (!this._tabMode || this._readonly) { return; } - var text = "\t"; //$NON-NLS-1$ - var selections = this._getSelections(); - if (this._expandTab) { - text = []; - var model = this._model; - var tabSize = this._tabSize; - selections.forEach(function(selection) { - var caret = selection.getCaret(); - var lineIndex = model.getLineAtOffset(caret); - var lineStart = model.getLineStart(lineIndex); - var spaces = tabSize - ((caret - lineStart) % tabSize); - text.push((newArray(spaces + 1)).join(" ")); //$NON-NLS-1$ - }); - } - return this._modifyContent({text: text, selection: selections, _ignoreDOMSelection: true}, true); - }, - _doShiftTab: function () { - if (!this._tabMode || this._readonly) { return; } - return true; - }, - _doOverwriteMode: function () { - if (this._readonly) { return; } - this.setOptions({overwriteMode: !this.getOptions("overwriteMode")}); //$NON-NLS-1$ - return true; - }, - _doTabMode: function () { - this.setOptions({tabMode: !this.getOptions("tabMode")}); //$NON-NLS-1$ - return true; - }, - _doWrapMode: function () { - this.setOptions({wrapMode: !this.getOptions("wrapMode")}); //$NON-NLS-1$ - return true; - }, - - /************************************ Internals ******************************************/ - _autoScroll: function () { - var model = this._model; - var selections = this._getSelections(); - var selection = Selection.editing(selections, this._autoScrollDir === "down"); //$NON-NLS-1$ - var pt = this.convert({x: this._autoScrollX, y: this._autoScrollY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$ - var caret = selection.getCaret(); - var lineCount = model.getLineCount(); - var caretLine = model.getLineAtOffset(caret), lineIndex, line; - if (this._autoScrollDir === "up" || this._autoScrollDir === "down") { //$NON-NLS-1$ //$NON-NLS-1$ - var _scroll = this._autoScrollY / this._getLineHeight(); - _scroll = _scroll < 0 ? Math.floor(_scroll) : Math.ceil(_scroll); - lineIndex = caretLine; - lineIndex = Math.max(0, Math.min(lineCount - 1, lineIndex + _scroll)); - } else if (this._autoScrollDir === "left" || this._autoScrollDir === "right") { //$NON-NLS-1$ //$NON-NLS-1$ - lineIndex = this._getLineIndex(pt.y); - line = this._getLine(caretLine); - pt.x += line.getBoundingClientRect(caret, false).left; - line.destroy(); - } - if (this._blockSelection) { - selections = this._getBlockSelections(selections, lineIndex, pt); - } else if (lineIndex === 0 && (util.isMac || util.isLinux)) { - selection.extend(0); - } else if (lineIndex === lineCount - 1 && (util.isMac || util.isLinux)) { - selection.extend(model.getCharCount()); - } else { - line = this._getLine(lineIndex); - selection.extend(line.getOffset(pt.x, pt.y - this._getLinePixel(lineIndex))); - line.destroy(); - } - this._setSelection(selections, true); - }, - _autoScrollTimer: function () { - this._autoScroll(); - var that = this; - var win = this._getWindow(); - this._autoScrollTimerID = win.setTimeout(function () {that._autoScrollTimer();}, this._AUTO_SCROLL_RATE); - }, - _calculateLineHeightTimer: function(calculate) { - if (!this._lineHeight) { return; } - if (this._calculateLHTimer) { return; } - var lineCount = this._model.getLineCount(), i = 0; - if (calculate) { - var c = 0; - var MAX_TIME = 100; - var start = new Date().getTime(), firstLine = 0; - while (i < lineCount) { - if (!this._lineHeight[i]) { - c++; - if (!firstLine) { firstLine = i; } - this._lineHeight[i] = this._calculateLineHeight(i); - } - i++; - if ((new Date().getTime() - start) > MAX_TIME) { - break; - } - } - this.redrawRulers(0, lineCount); - this._queueUpdate(); - } - var win = this._getWindow(); - if (i !== lineCount) { - var that = this; - this._calculateLHTimer = win.setTimeout(function() { - that._calculateLHTimer = null; - that._calculateLineHeightTimer(true); - }, 0); - return; - } - if (this._calculateLHTimer) { - win.clearTimeout(this._calculateLHTimer); - this._calculateLHTimer = undefined; - } - }, - _calculateLineHeight: function(lineIndex) { - var line = this._getLine(lineIndex); - var rect = line.getBoundingClientRect(); - line.destroy(); - return Math.max(1, rect.bottom - rect.top); - }, - _calculateMetrics: function() { - var _parent = this._clientDiv; - var doc = _parent.ownerDocument; - var c = " "; //$NON-NLS-1$ - var line = util.createElement(doc, "div"); //$NON-NLS-1$ - line.style.lineHeight = "normal"; //$NON-NLS-1$ - var model = this._model; - var lineText = model.getLine(0); - var e = {type:"LineStyle", textView: this, 0: 0, lineText: lineText, lineStart: 0}; //$NON-NLS-1$ - this.onLineStyle(e); - applyStyle(e.style, line); - line.style.position = "fixed"; //$NON-NLS-1$ - line.style.left = "-1000px"; //$NON-NLS-1$ - var span1 = util.createElement(doc, "span"); //$NON-NLS-1$ - span1.appendChild(doc.createTextNode(c)); - line.appendChild(span1); - var span2 = util.createElement(doc, "span"); //$NON-NLS-1$ - span2.style.fontStyle = "italic"; //$NON-NLS-1$ - span2.appendChild(doc.createTextNode(c)); - line.appendChild(span2); - var span3 = util.createElement(doc, "span"); //$NON-NLS-1$ - span3.style.fontWeight = "bold"; //$NON-NLS-1$ - span3.appendChild(doc.createTextNode(c)); - line.appendChild(span3); - var span4 = util.createElement(doc, "span"); //$NON-NLS-1$ - span4.style.fontWeight = "bold"; //$NON-NLS-1$ - span4.style.fontStyle = "italic"; //$NON-NLS-1$ - span4.appendChild(doc.createTextNode(c)); - line.appendChild(span4); - _parent.appendChild(line); - var lineRect = line.getBoundingClientRect(); - var spanRect1 = span1.getBoundingClientRect(); - var spanRect2 = span2.getBoundingClientRect(); - var spanRect3 = span3.getBoundingClientRect(); - var spanRect4 = span4.getBoundingClientRect(); - var h1 = spanRect1.bottom - spanRect1.top; - var h2 = spanRect2.bottom - spanRect2.top; - var h3 = spanRect3.bottom - spanRect3.top; - var h4 = spanRect4.bottom - spanRect4.top; - var fontStyle = 0; - var invalid = (lineRect.bottom - lineRect.top) <= 0; - var lineHeight = Math.max(1, lineRect.bottom - lineRect.top); - if (h2 > h1) { - fontStyle = 1; - } - if (h3 > h2) { - fontStyle = 2; - } - if (h4 > h3) { - fontStyle = 3; - } - var style; - if (fontStyle !== 0) { - style = {style: {}}; - if ((fontStyle & 1) !== 0) { - style.style.fontStyle = "italic"; //$NON-NLS-1$ - } - if ((fontStyle & 2) !== 0) { - style.style.fontWeight = "bold"; //$NON-NLS-1$ - } - } - var trim = getLineTrim(line); - _parent.removeChild(line); - - // calculate pad and scroll width - var pad = getPadding(this._viewDiv); - var div1 = util.createElement(doc, "div"); //$NON-NLS-1$ - div1.style.position = "fixed"; //$NON-NLS-1$ - div1.style.left = "-1000px"; //$NON-NLS-1$ - div1.style.paddingLeft = pad.left + "px"; //$NON-NLS-1$ - div1.style.paddingTop = pad.top + "px"; //$NON-NLS-1$ - div1.style.paddingRight = pad.right + "px"; //$NON-NLS-1$ - div1.style.paddingBottom = pad.bottom + "px"; //$NON-NLS-1$ - div1.style.width = "100px"; //$NON-NLS-1$ - div1.style.height = "100px"; //$NON-NLS-1$ - var div2 = util.createElement(doc, "div"); //$NON-NLS-1$ - div2.style.width = "100%"; //$NON-NLS-1$ - div2.style.height = "100%"; //$NON-NLS-1$ - div1.appendChild(div2); - _parent.appendChild(div1); - var rect1 = div1.getBoundingClientRect(); - var rect2 = div2.getBoundingClientRect(); - var scrollWidth = 0; - if (!this._singleMode && !this._noScroll) { - div1.style.overflow = 'hidden'; //$NON-NLS-1$ - div2.style.height = "200px"; //$NON-NLS-1$ - var w1 = div1.clientWidth; - div1.style.overflow = 'scroll'; //$NON-NLS-1$ - var w2 = div1.clientWidth; - scrollWidth = w1 - w2; - } - _parent.removeChild(div1); - pad = { - left: rect2.left - rect1.left, - top: rect2.top - rect1.top, - right: rect1.right - rect2.right, - bottom: rect1.bottom - rect2.bottom - }; - var wrapWidth = 0, marginWidth = 0, charWidth = 0; - if (!invalid) { - div1 = util.createElement(doc, "div"); //$NON-NLS-1$ - div1.style.position = "fixed"; //$NON-NLS-1$ - div1.style.left = "-1000px"; //$NON-NLS-1$ - _parent.appendChild(div1); - div1.innerHTML = newArray(2).join("a"); //$NON-NLS-1$ - rect1 = div1.getBoundingClientRect(); - charWidth = Math.ceil(rect1.right - rect1.left); - if (this._wrapOffset || this._marginOffset) { - div1.innerHTML = newArray(this._wrapOffset + 1 + (util.isWebkit ? 0 : 1)).join(" "); //$NON-NLS-1$ - rect1 = div1.getBoundingClientRect(); - wrapWidth = Math.ceil(rect1.right - rect1.left); - div1.innerHTML = newArray(this._marginOffset + 1).join(" "); //$NON-NLS-1$ - rect2 = div1.getBoundingClientRect(); - marginWidth = Math.ceil(rect2.right - rect2.left); - } - _parent.removeChild(div1); - } - return { - lineHeight: lineHeight, - largestFontStyle: style, - lineTrim: trim, - viewPadding: pad, - scrollWidth: scrollWidth, - wrapWidth: wrapWidth, - marginWidth: marginWidth, - charWidth: charWidth, - invalid: invalid - }; - }, - _cancelAnimation: function() { - if (this._animation) { - this._animation.stop(); - this._animation = null; - } - }, - _clearSelection: function (direction) { - var selections = this._getSelections(); - selections.forEach(function(selection) { - if (direction === "next") { //$NON-NLS-1$ - selection.start = selection.end; - } else { - selection.end = selection.start; - } - }); - this._setSelection(selections, true); - return true; - }, - _commitIME: function (insertText) { - if (this._imeOffset === -1) { return; } - var model = this._model; - var lineIndex = model.getLineAtOffset(this._imeOffset); - var lineStart = model.getLineStart(lineIndex); - var line = this._getLineNode(lineIndex); - if (!insertText) { - // make the state of the IME match the state the view expects it be in - // when the view commits the text and IME also need to be committed - // this can be accomplished by changing the focus around - this._scrollDiv.focus(); - this._clientDiv.focus(); - - var newText = this._getDOMText(line).text; - var oldText = model.getLine(lineIndex); - var start = this._imeOffset - lineStart; - var end = start + newText.length - oldText.length; - if (start !== end) { - insertText = newText.substring(start, end); - } - } - this._imeOffset = -1; - if (insertText) { - if (!this._doContent(insertText) && !util.isWebkit) { - line.lineRemoved = true; - this._queueUpdate(); - } - } - }, - _createActions: function () { - this.addKeyMode(new mKeyModes.DefaultKeyMode(this)); - //1 to 1, no duplicates - var that = this; - this._actions = { - "noop": {defaultHandler: function() {return that._doNoop();}}, //$NON-NLS-1$ - - "lineUp": {defaultHandler: function(data) {return that._doLineUp(merge(data,{select: false}));}, actionDescription: {name: messages.lineUp}}, //$NON-NLS-1$ - "lineDown": {defaultHandler: function(data) {return that._doLineDown(merge(data,{select: false}));}, actionDescription: {name: messages.lineDown}}, //$NON-NLS-1$ - "lineStart": {defaultHandler: function(data) {return that._doHome(merge(data,{select: false, ctrl:false}));}, actionDescription: {name: messages.lineStart}}, //$NON-NLS-1$ - "lineEnd": {defaultHandler: function(data) {return that._doEnd(merge(data,{select: false, ctrl:false}));}, actionDescription: {name: messages.lineEnd}}, //$NON-NLS-1$ - "charPrevious": {defaultHandler: function(data) {return that._doCursorPrevious(merge(data,{select: false, unit:"character"}));}, actionDescription: {name: messages.charPrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "charNext": {defaultHandler: function(data) {return that._doCursorNext(merge(data,{select: false, unit:"character"}));}, actionDescription: {name: messages.charNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "pageUp": {defaultHandler: function(data) {return that._doPageUp(merge(data,{select: false}));}, actionDescription: {name: messages.pageUp}}, //$NON-NLS-1$ - "pageDown": {defaultHandler: function(data) {return that._doPageDown(merge(data,{select: false}));}, actionDescription: {name: messages.pageDown}}, //$NON-NLS-1$ - "scrollPageUp": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "pageUp"}));}, actionDescription: {name: messages.scrollPageUp}}, //$NON-NLS-1$ //$NON-NLS-1$ - "scrollPageDown": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "pageDown"}));}, actionDescription: {name: messages.scrollPageDown}}, //$NON-NLS-1$ //$NON-NLS-1$ - "scrollLineUp": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "lineUp"}));}, actionDescription: {name: messages.scrollLineUp}}, //$NON-NLS-1$ //$NON-NLS-1$ - "scrollLineDown": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "lineDown"}));}, actionDescription: {name: messages.scrollLineDown}}, //$NON-NLS-1$ //$NON-NLS-1$ - "wordPrevious": {defaultHandler: function(data) {return that._doCursorPrevious(merge(data,{select: false, unit:"word"}));}, actionDescription: {name: messages.wordPrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "wordNext": {defaultHandler: function(data) {return that._doCursorNext(merge(data,{select: false, unit:"word"}));}, actionDescription: {name: messages.wordNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "textStart": {defaultHandler: function(data) {return that._doHome(merge(data,{select: false, ctrl:true}));}, actionDescription: {name: messages.textStart}}, //$NON-NLS-1$ - "textEnd": {defaultHandler: function(data) {return that._doEnd(merge(data,{select: false, ctrl:true}));}, actionDescription: {name: messages.textEnd}}, //$NON-NLS-1$ - "scrollTextStart": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "textStart"}));}, actionDescription: {name: messages.scrollTextStart}}, //$NON-NLS-1$ //$NON-NLS-1$ - "scrollTextEnd": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "textEnd"}));}, actionDescription: {name: messages.scrollTextEnd}}, //$NON-NLS-1$ //$NON-NLS-1$ - "centerLine": {defaultHandler: function(data) {return that._doScroll(merge(data,{type: "centerLine"}));}, actionDescription: {name: messages.centerLine}}, //$NON-NLS-1$ //$NON-NLS-1$ - - "selectLineUp": {defaultHandler: function(data) {return that._doLineUp(merge(data,{select: true}));}, actionDescription: {name: messages.selectLineUp}}, //$NON-NLS-1$ - "selectLineDown": {defaultHandler: function(data) {return that._doLineDown(merge(data,{select: true}));}, actionDescription: {name: messages.selectLineDown}}, //$NON-NLS-1$ - "selectWholeLineUp": {defaultHandler: function(data) {return that._doLineUp(merge(data,{select: true, wholeLine: true}));}, actionDescription: {name: messages.selectWholeLineUp}}, //$NON-NLS-1$ - "selectWholeLineDown": {defaultHandler: function(data) {return that._doLineDown(merge(data,{select: true, wholeLine: true}));}, actionDescription: {name: messages.selectWholeLineDown}}, //$NON-NLS-1$ - "selectLineStart": {defaultHandler: function(data) {return that._doHome(merge(data,{select: true, ctrl:false}));}, actionDescription: {name: messages.selectLineStart}}, //$NON-NLS-1$ - "selectLineEnd": {defaultHandler: function(data) {return that._doEnd(merge(data,{select: true, ctrl:false}));}, actionDescription: {name: messages.selectLineEnd}}, //$NON-NLS-1$ - "selectCharPrevious": {defaultHandler: function(data) {return that._doCursorPrevious(merge(data,{select: true, unit:"character"}));}, actionDescription: {name: messages.selectCharPrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "selectCharNext": {defaultHandler: function(data) {return that._doCursorNext(merge(data,{select: true, unit:"character"}));}, actionDescription: {name: messages.selectCharNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "selectPageUp": {defaultHandler: function(data) {return that._doPageUp(merge(data,{select: true}));}, actionDescription: {name: messages.selectPageUp}}, //$NON-NLS-1$ - "selectPageDown": {defaultHandler: function(data) {return that._doPageDown(merge(data,{select: true}));}, actionDescription: {name: messages.selectPageDown}}, //$NON-NLS-1$ - "selectWordPrevious": {defaultHandler: function(data) {return that._doCursorPrevious(merge(data,{select: true, unit:"word"}));}, actionDescription: {name: messages.selectWordPrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "selectWordNext": {defaultHandler: function(data) {return that._doCursorNext(merge(data,{select: true, unit:"word"}));}, actionDescription: {name: messages.selectWordNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "selectTextStart": {defaultHandler: function(data) {return that._doHome(merge(data,{select: true, ctrl:true}));}, actionDescription: {name: messages.selectTextStart}}, //$NON-NLS-1$ - "selectTextEnd": {defaultHandler: function(data) {return that._doEnd(merge(data,{select: true, ctrl:true}));}, actionDescription: {name: messages.selectTextEnd}}, //$NON-NLS-1$ - - "deletePrevious": {defaultHandler: function(data) {return that._doBackspace(merge(data,{unit:"character"}));}, actionDescription: {name: messages.deletePrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "deleteNext": {defaultHandler: function(data) {return that._doDelete(merge(data,{unit:"character"}));}, actionDescription: {name: messages.deleteNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "deleteWordPrevious": {defaultHandler: function(data) {return that._doBackspace(merge(data,{unit:"word"}));}, actionDescription: {name: messages.deleteWordPrevious}}, //$NON-NLS-1$ //$NON-NLS-1$ - "deleteWordNext": {defaultHandler: function(data) {return that._doDelete(merge(data,{unit:"word"}));}, actionDescription: {name: messages.deleteWordNext}}, //$NON-NLS-1$ //$NON-NLS-1$ - "deleteLineStart": {defaultHandler: function(data) {return that._doBackspace(merge(data,{unit: "line"}));}, actionDescription: {name: messages.deleteLineStart}}, //$NON-NLS-1$ //$NON-NLS-1$ - "deleteLineEnd": {defaultHandler: function(data) {return that._doDelete(merge(data,{unit: "line"}));}, actionDescription: {name: messages.deleteLineEnd}}, //$NON-NLS-1$ //$NON-NLS-1$ - "tab": {defaultHandler: function(data) {return that._doTab(merge(data,{}));}, actionDescription: {name: messages.tab}}, //$NON-NLS-1$ - "shiftTab": {defaultHandler: function(data) {return that._doShiftTab(merge(data,{}));}, actionDescription: {name: messages.shiftTab}}, //$NON-NLS-1$ - "enter": {defaultHandler: function(data) {return that._doEnter(merge(data,{}));}, actionDescription: {name: messages.enter}}, //$NON-NLS-1$ - "enterNoCursor": {defaultHandler: function(data) {return that._doEnter(merge(data,{noCursor:true}));}, actionDescription: {name: messages.enterNoCursor}}, //$NON-NLS-1$ - "escape": {defaultHandler: function(data) {return that._doEscape(merge(data,{}));}, actionDescription: {name: messages.escape}}, //$NON-NLS-1$ - "selectAll": {defaultHandler: function(data) {return that._doSelectAll(merge(data,{}));}, actionDescription: {name: messages.selectAll}}, //$NON-NLS-1$ - "copy": {defaultHandler: function(data) {return that._doCopy(merge(data,{}));}, actionDescription: {name: messages.copy}}, //$NON-NLS-1$ - "cut": {defaultHandler: function(data) {return that._doCut(merge(data,{}));}, actionDescription: {name: messages.cut}}, //$NON-NLS-1$ - "paste": {defaultHandler: function(data) {return that._doPaste(merge(data,{}));}, actionDescription: {name: messages.paste}}, //$NON-NLS-1$ - - "uppercase": {defaultHandler: function(data) {return that._doCase(merge(data,{type: "upper"}));}, actionDescription: {name: messages.uppercase}}, //$NON-NLS-1$ //$NON-NLS-1$ - "lowercase": {defaultHandler: function(data) {return that._doCase(merge(data,{type: "lower"}));}, actionDescription: {name: messages.lowercase}}, //$NON-NLS-1$ //$NON-NLS-1$ - "capitalize": {defaultHandler: function(data) {return that._doCase(merge(data,{unit: "word", type: "capitalize"}));}, actionDescription: {name: messages.capitalize}}, //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$ - "reversecase": {defaultHandler: function(data) {return that._doCase(merge(data,{type: "reverse"}));}, actionDescription: {name: messages.reversecase}}, //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$ - - "toggleOverwriteMode": {defaultHandler: function(data) {return that._doOverwriteMode(merge(data,{}));}, actionDescription: {name: messages.toggleOverwriteMode}}, //$NON-NLS-1$ - "toggleTabMode": {defaultHandler: function(data) {return that._doTabMode(merge(data,{}));}, actionDescription: {name: messages.toggleTabMode}}, //$NON-NLS-1$ - "toggleWrapMode": {defaultHandler: function(data) {return that._doWrapMode(merge(data,{}));}, actionDescription: {name: messages.toggleWrapMode}} //$NON-NLS-1$ - }; - }, - _createRulerParent: function(doc, className) { - var div = util.createElement(doc, "div"); //$NON-NLS-1$ - div.className = className; - div.tabIndex = -1; - div.style.overflow = "hidden"; //$NON-NLS-1$ - div.style.MozUserSelect = "none"; //$NON-NLS-1$ - div.style.WebkitUserSelect = "none"; //$NON-NLS-1$ - div.style.position = "absolute"; //$NON-NLS-1$ - div.style.top = "0px"; //$NON-NLS-1$ - div.style.bottom = "0px"; //$NON-NLS-1$ - div.style.cursor = "default"; //$NON-NLS-1$ - div.style.display = "none"; //$NON-NLS-1$ - div.setAttribute("aria-hidden", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - this._rootDiv.appendChild(div); - return div; - }, - _createRuler: function(ruler, index) { - if (!this._clientDiv) { return; } - var rulerParent = this._getRulerParent(ruler); - if (!rulerParent) { return; } - if (rulerParent !== this._marginDiv || this._marginOffset) { - rulerParent.style.display = "block"; //$NON-NLS-1$ - } - rulerParent.rulerWidth = undefined; - var div = util.createElement(rulerParent.ownerDocument, "div"); //$NON-NLS-1$ - div._ruler = ruler; - ruler.node = div; - div.rulerChanged = true; - div.style.position = "relative"; //$NON-NLS-1$ - div.style.cssFloat = "left"; //$NON-NLS-1$ - div.style.styleFloat = "left"; //$NON-NLS-1$ - div.style.outline = "none"; //$NON-NLS-1$ - if (index === undefined || index < 0 || index >= rulerParent.children.length) { - rulerParent.appendChild(div); - } else { - var sibling = rulerParent.firstChild; - while (sibling && index-- > 0) { - sibling = sibling.nextSibling; - } - rulerParent.insertBefore(div, sibling); - } - }, - _createSelectionDiv: function() { - var div = util.createElement(this._parent.ownerDocument, "div"); //$NON-NLS-1$ - div.className = "textviewSelection"; //$NON-NLS-1$ - div.style.position = "absolute"; //$NON-NLS-1$ - div.style.borderWidth = "0px"; //$NON-NLS-1$ - div.style.margin = "0px"; //$NON-NLS-1$ - div.style.padding = "0px"; //$NON-NLS-1$ - div.style.outline = "none"; //$NON-NLS-1$ - div.style.width = "0px"; //$NON-NLS-1$ - div.style.height = "0px"; //$NON-NLS-1$ - div.style.zIndex = "0"; //$NON-NLS-1$ - return div; - }, - _createView: function() { - if (this._clientDiv) { return; } - var _parent = this._parent; - while (_parent.hasChildNodes()) { _parent.removeChild(_parent.lastChild); } - - var doc = _parent.ownerDocument; - var rootDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._rootDiv = rootDiv; - rootDiv.tabIndex = -1; - rootDiv.style.position = "relative"; //$NON-NLS-1$ - rootDiv.style.overflow = "hidden"; //$NON-NLS-1$ - rootDiv.style.width = "100%"; //$NON-NLS-1$ - rootDiv.style.height = "100%"; //$NON-NLS-1$ - rootDiv.style.overflow = "hidden"; //$NON-NLS-1$ - rootDiv.style.WebkitTextSizeAdjust = "100%"; //$NON-NLS-1$ - rootDiv.setAttribute("role", "application"); //$NON-NLS-1$ //$NON-NLS-2$ - _parent.appendChild(rootDiv); - - var leftDiv = this._createRulerParent(doc, "textviewLeftRuler"); //$NON-NLS-1$ - this._leftDiv = leftDiv; - - var viewDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - viewDiv.className = "textviewScroll"; //$NON-NLS-1$ - this._viewDiv = viewDiv; - viewDiv.tabIndex = -1; - viewDiv.style.position = "absolute"; //$NON-NLS-1$ - viewDiv.style.top = "0px"; //$NON-NLS-1$ - viewDiv.style.bottom = "0px"; //$NON-NLS-1$ - viewDiv.style.borderWidth = "0px"; //$NON-NLS-1$ - viewDiv.style.margin = "0px"; //$NON-NLS-1$ - viewDiv.style.outline = "none"; //$NON-NLS-1$ - viewDiv.style.background = "transparent"; //$NON-NLS-1$ - rootDiv.appendChild(viewDiv); - - var rightDiv = this._createRulerParent(doc, "textviewRightRuler"); //$NON-NLS-1$ - this._rightDiv = rightDiv; - if (document.dir == "rtl") { /* ACGC */ - rightDiv.style.left = "0px"; //$NON-NLS-1$ - }else{ - rightDiv.style.right = "0px"; //$NON-NLS-1$ - } - - var innerRightDiv = this._createRulerParent(doc, "textviewInnerRightRuler"); //$NON-NLS-1$ - this._innerRightDiv = innerRightDiv; - innerRightDiv.style.zIndex = "1"; //$NON-NLS-1$ - - var scrollDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._scrollDiv = scrollDiv; - scrollDiv.style.margin = "0px"; //$NON-NLS-1$ - scrollDiv.style.borderWidth = "0px"; //$NON-NLS-1$ - scrollDiv.style.padding = "0px"; //$NON-NLS-1$ - viewDiv.appendChild(scrollDiv); - - var marginDiv = this._marginDiv = this._createRulerParent(doc, "textviewMarginRuler"); //$NON-NLS-1$ - marginDiv.style.zIndex = "4"; //$NON-NLS-1$ - - if (!util.isIE && !util.isIOS) { - var clipDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._clipDiv = clipDiv; - clipDiv.style.position = "absolute"; //$NON-NLS-1$ - clipDiv.style.overflow = "hidden"; //$NON-NLS-1$ - clipDiv.style.margin = "0px"; //$NON-NLS-1$ - clipDiv.style.borderWidth = "0px"; //$NON-NLS-1$ - clipDiv.style.padding = "0px"; //$NON-NLS-1$ - clipDiv.style.background = "transparent"; //$NON-NLS-1$ - rootDiv.appendChild(clipDiv); - - var clipScrollDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._clipScrollDiv = clipScrollDiv; - clipScrollDiv.style.position = "absolute"; //$NON-NLS-1$ - clipScrollDiv.style.height = "1px"; //$NON-NLS-1$ - clipScrollDiv.style.top = "-1000px"; //$NON-NLS-1$ - clipScrollDiv.style.background = "transparent"; //$NON-NLS-1$ - clipDiv.appendChild(clipScrollDiv); - } - - var clientDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - clientDiv.className = "textviewContent"; //$NON-NLS-1$ - this._clientDiv = clientDiv; - clientDiv.tabIndex = 0; - clientDiv.style.position = "absolute"; //$NON-NLS-1$ - clientDiv.style.borderWidth = "0px"; //$NON-NLS-1$ - clientDiv.style.margin = "0px"; //$NON-NLS-1$ - clientDiv.style.padding = "0px"; //$NON-NLS-1$ - clientDiv.style.outline = "none"; //$NON-NLS-1$ - clientDiv.style.zIndex = "1"; //$NON-NLS-1$ - clientDiv.style.WebkitUserSelect = "text"; //$NON-NLS-1$ - clientDiv.setAttribute("spellcheck", "false"); //$NON-NLS-1$ //$NON-NLS-2$ - if (util.isIOS || util.isAndroid) { - clientDiv.style.WebkitTapHighlightColor = "transparent"; //$NON-NLS-1$ - } - (this._clipDiv || rootDiv).appendChild(clientDiv); - - this._setFullSelection(this._fullSelection, true); - - if (util.isIOS || util.isAndroid) { - var vScrollDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._vScrollDiv = vScrollDiv; - vScrollDiv.style.position = "absolute"; //$NON-NLS-1$ - vScrollDiv.style.borderWidth = "1px"; //$NON-NLS-1$ - vScrollDiv.style.borderColor = "white"; //$NON-NLS-1$ - vScrollDiv.style.borderStyle = "solid"; //$NON-NLS-1$ - vScrollDiv.style.borderRadius = "4px"; //$NON-NLS-1$ - vScrollDiv.style.backgroundColor = "black"; //$NON-NLS-1$ - vScrollDiv.style.opacity = "0.5"; //$NON-NLS-1$ - vScrollDiv.style.margin = "0px"; //$NON-NLS-1$ - vScrollDiv.style.padding = "0px"; //$NON-NLS-1$ - vScrollDiv.style.outline = "none"; //$NON-NLS-1$ - vScrollDiv.style.zIndex = "3"; //$NON-NLS-1$ - vScrollDiv.style.width = "8px"; //$NON-NLS-1$ - vScrollDiv.style.display = "none"; //$NON-NLS-1$ - rootDiv.appendChild(vScrollDiv); - var hScrollDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._hScrollDiv = hScrollDiv; - hScrollDiv.style.position = "absolute"; //$NON-NLS-1$ - hScrollDiv.style.borderWidth = "1px"; //$NON-NLS-1$ - hScrollDiv.style.borderColor = "white"; //$NON-NLS-1$ - hScrollDiv.style.borderStyle = "solid"; //$NON-NLS-1$ - hScrollDiv.style.borderRadius = "4px"; //$NON-NLS-1$ - hScrollDiv.style.backgroundColor = "black"; //$NON-NLS-1$ - hScrollDiv.style.opacity = "0.5"; //$NON-NLS-1$ - hScrollDiv.style.margin = "0px"; //$NON-NLS-1$ - hScrollDiv.style.padding = "0px"; //$NON-NLS-1$ - hScrollDiv.style.outline = "none"; //$NON-NLS-1$ - hScrollDiv.style.zIndex = "3"; //$NON-NLS-1$ - hScrollDiv.style.height = "8px"; //$NON-NLS-1$ - hScrollDiv.style.display = "none"; //$NON-NLS-1$ - rootDiv.appendChild(hScrollDiv); - } - - if (util.isFirefox && !clientDiv.setCapture) { - var overlayDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._overlayDiv = overlayDiv; - overlayDiv.style.position = clientDiv.style.position; - overlayDiv.style.borderWidth = clientDiv.style.borderWidth; - overlayDiv.style.margin = clientDiv.style.margin; - overlayDiv.style.padding = clientDiv.style.padding; - overlayDiv.style.cursor = "text"; //$NON-NLS-1$ - overlayDiv.style.zIndex = "2"; //$NON-NLS-1$ - (this._clipDiv || rootDiv).appendChild(overlayDiv); - } - clientDiv.contentEditable = "true"; //$NON-NLS-1$ - this._setWrapMode(this._wrapMode, true); - this._setReadOnly(this._readonly); - this._setThemeClass(this._themeClass, true); - this._setTabSize(this._tabSize, true); - this._setMarginOffset(this._marginOffset, true); - this._hookEvents(); - bidiUtils.initInputField(clientDiv); - var rulers = this._rulers; - for (var i=0; i this._getLineHeight()) { - var rect = child.getBoundingClientRect(); - var clientRect = this._clientDiv.getBoundingClientRect(); - if (rect.bottom > clientRect.bottom) { - child = this._getLinePrevious(child) || child; - } - } - return child.lineIndex; - }, - _getBlockSelections: function(selections, lineIndex, pt) { - var model = this._model; - selections = selections.filter(function(sel) { return !sel._editing; }); - var firstLine = model.getLineAtOffset(this._blockSelection.getAnchor()), lastLine; - if (lineIndex > firstLine) { - lastLine = lineIndex; - } else { - lastLine = firstLine; - firstLine = lineIndex; - } - for (var l = firstLine; l <= lastLine; l++) { - var line = this._getLine(l); - var o1 = line.getOffset(pt.x, 1); - var o2 = line.getOffset(this._blockSelection._docX, 1); - line.destroy(); - if (o1 === o2 && o1 === model.getLineEnd(l)) continue; - var caret = o1 < o2; - var sel = new Selection(caret ? o1 : o2, caret ? o2 : o1, caret); - sel._editing = true; - selections.push(sel); - } - return selections; - }, - _getBoundsAtOffset: function(offset) { - var model = this._model; - var line = this._getLine(model.getLineAtOffset(offset)); - var result = line.getBoundingClientRect(offset); - var linePixel = this._getLinePixel(line.lineIndex); - result.top += linePixel; - result.bottom += linePixel; - line.destroy(); - return result; - }, - _getClientHeight: function() { - var viewPad = this._getViewPadding(); - return Math.max(0, this._viewDiv.clientHeight - viewPad.top - viewPad.bottom); - }, - _getInnerRightWidth: function() { - var innerRightWidth = this._innerRightDiv.rulerWidth; - if (innerRightWidth === undefined) { - var innerRightRect = this._innerRightDiv.getBoundingClientRect(); - this._innerRightDiv.rulerWidth = innerRightWidth = innerRightRect.right - innerRightRect.left; - } - return innerRightWidth; - }, - _getClientWidth: function() { - var viewPad = this._getViewPadding(); - var innerRightWidth = this._getInnerRightWidth(); - return Math.max(0, this._viewDiv.clientWidth - viewPad.left - viewPad.right - innerRightWidth); - }, - _getClipboardText: function (evt, handler) { - // IE - var win = this._getWindow(); - var clipboardData = win.clipboardData; - // WebKit and Firefox > 21 - if (!clipboardData && evt) { - clipboardData = evt.clipboardData; - } - function convert(wholeText) { - var clipboardText = []; - convertDelimiter(wholeText, function(t) {clipboardText.push(t);}, null); - if (handler) { handler(clipboardText); } - return clipboardText; - } - if (clipboardData) { - return convert(clipboardData.getData(util.isIE ? "Text" : "text/plain")); //$NON-NLS-1$"//$NON-NLS-2$ - } - if (util.isElectron && !evt) { - return convert(window.__clipboardModule.readText()); - } - if (util.isFirefox) { - this._ignoreFocus = true; - var clipboardDiv = this._clipboardDiv; - var doc = this._rootDiv.ownerDocument; - if (!clipboardDiv) { - clipboardDiv = util.createElement(doc, "div"); //$NON-NLS-1$ - this._clipboardDiv = clipboardDiv; - clipboardDiv.style.position = "fixed"; //$NON-NLS-1$ - clipboardDiv.style.whiteSpace = "pre"; //$NON-NLS-1$ - clipboardDiv.style.left = "-1000px"; //$NON-NLS-1$ - this._rootDiv.appendChild(clipboardDiv); - } - clipboardDiv.innerHTML = "
      "; //$NON-NLS-1$
      -				clipboardDiv.firstChild.focus();
      -				var that = this;
      -				var _getText = function() {
      -					var noteText = that._getTextFromElement(clipboardDiv);
      -					clipboardDiv.innerHTML = "";
      -					return convert(noteText);
      -				};
      -				
      -				/* Try execCommand first. Works on firefox with clipboard permission. */
      -				var result = false;
      -				this._ignorePaste = true;
      -
      -				/* Do not try execCommand if middle-click is used, because if we do, we get the clipboard text, not the primary selection text. */
      -				if (!util.isLinux || this._lastMouseButton !== 2) {
      -					try {
      -						result = doc.execCommand("paste", false, null); //$NON-NLS-1$
      -					} catch (ex) {
      -						/* Firefox can throw even when execCommand() works, see bug 362835. */
      -						result = clipboardDiv.childNodes.length > 1 || clipboardDiv.firstChild && clipboardDiv.firstChild.childNodes.length > 0;
      -					}
      -				}
      -				this._ignorePaste = false;
      -				if (!result) {
      -					/* Try native paste in DOM, works for firefox during the paste event. */
      -					if (evt) {
      -						win.setTimeout(function() {
      -							that.focus();
      -							_getText();
      -							that._ignoreFocus = false;
      -						}, 0);
      -						return null;
      -					} else {
      -						/* no event and no clipboard permission, paste can't be performed */
      -						this.focus();
      -						this._ignoreFocus = false;
      -						return "";
      -					}
      -				}
      -				this.focus();
      -				this._ignoreFocus = false;
      -				return _getText();
      -			}
      -			return "";
      -		},
      -		_getDOMText: function(child, offsetNode) {
      -			return child._line.getText(offsetNode);
      -		},
      -		_getTextFromElement: function(element) {
      -			var doc = element.ownerDocument;
      -			var win = doc.defaultView;
      -			if (!win.getSelection) {
      -				return element.innerText || element.textContent;
      -			}
      -
      -			var newRange = doc.createRange();
      -			newRange.selectNode(element);
      -
      -			var selection = win.getSelection();
      -			var oldRanges = [], i;
      -			for (i = 0; i < selection.rangeCount; i++) {
      -				oldRanges.push(selection.getRangeAt(i));
      -			}
      -
      -			this._ignoreSelect = true;
      -			selection.removeAllRanges();
      -			selection.addRange(newRange);
      -
      -			var text = selection.toString();
      -
      -			selection.removeAllRanges();
      -			for (i = 0; i < oldRanges.length; i++) {
      -				selection.addRange(oldRanges[i]);
      -			}
      -
      -			this._ignoreSelect = false;
      -			return text;
      -		},
      -		_getViewPadding: function() {
      -			return this._metrics.viewPadding;
      -		},
      -		_getLine: function(lineIndex) {
      -			var child = this._getLineNode(lineIndex);
      -			if (child && !child.lineChanged && !child.lineRemoved) {
      -				return child._line;
      -			}
      -			return new TextLine(this, lineIndex);
      -		},
      -		_getLineHeight: function(lineIndex, calculate) {
      -			if (lineIndex !== undefined && this._lineHeight) {
      -				var lineHeight = this._lineHeight[lineIndex];
      -				if (lineHeight) { return lineHeight; }
      -				if (calculate || calculate === undefined) {
      -					var height = this._lineHeight[lineIndex] = this._calculateLineHeight(lineIndex);
      -					return height;
      -				}
      -			}
      -			return this._metrics.lineHeight;
      -		},
      -		_getLineNode: function (lineIndex) {
      -			var clientDiv = this._clientDiv;
      -			var child = clientDiv.firstChild;
      -			while (child) {
      -				if (lineIndex === child.lineIndex) {
      -					return child;
      -				}
      -				child = child.nextSibling;
      -			}
      -			return undefined;
      -		},
      -		_getLineNext: function (lineNode) {
      -			var node = lineNode ? lineNode.nextSibling : this._clientDiv.firstChild;
      -			while (node && (node.lineIndex === -1 || !node._line)) {
      -				node = node.nextSibling;
      -			}
      -			return node;
      -		},
      -		_getLinePrevious: function (lineNode) {
      -			var node = lineNode ? lineNode.previousSibling : this._clientDiv.lastChild;
      -			while (node && (node.lineIndex === -1 || !node._line)) {
      -				node = node.previousSibling;
      -			}
      -			return node;
      -		},
      -		_getLinePixel: function(lineIndex) {
      -			lineIndex = Math.min(Math.max(0, lineIndex), this._model.getLineCount());
      -			if (this._lineHeight) {
      -				var topIndex = this._getTopIndex();
      -				var pixel = -this._topIndexY + this._getScroll().y, i;
      -				if (lineIndex > topIndex) {
      -					for (i = topIndex; i < lineIndex; i++) {
      -						pixel += this._getLineHeight(i);
      -					}
      -				} else {
      -					for (i = topIndex - 1; i >= lineIndex; i--) {
      -						pixel -= this._getLineHeight(i);
      -					}
      -				}
      -				return pixel;
      -			}
      -			var lineHeight = this._getLineHeight();
      -			return lineHeight * lineIndex;
      -		},
      -		/**
      -		 * @name _getLineIndex
      -		 * @description Returns the line index closest to the given text view relative location.  Will return -1
      -		 * 				if restrictToValidLines is true and y location is outside of text lines.
      -		 * @function
      -		 * @private
      -		 * @param y location to search
      -		 * @param restrictToValidLines whether to return -1 if the location is outside a valid line, otherwise return the closest valid line index
      -		 * @returns returns The line index closest to the location or -1 if restrictToValidLines is true and location is outside text area
      -		 */
      -		_getLineIndex: function(y, restrictToValidLines) {
      -			var lineHeight, lineIndex = 0;
      -			var lineCount = this._model.getLineCount();
      -			if (this._lineHeight) {
      -				lineIndex = this._getTopIndex();
      -				var pixel = -this._topIndexY + this._getScroll().y;
      -				if (y !== pixel) {
      -					if (y < pixel) {
      -						while (y < pixel && lineIndex > 0) {
      -							y += this._getLineHeight(--lineIndex);
      -						}
      -					} else {
      -						lineHeight = this._getLineHeight(lineIndex);
      -						while (y - lineHeight >= pixel && lineIndex < lineCount - 1) {
      -							y -= lineHeight;
      -							lineHeight = this._getLineHeight(++lineIndex);
      -						}
      -					}
      -				}
      -			} else {
      -				lineHeight = this._getLineHeight();
      -				lineIndex = Math.floor(y / lineHeight);
      -			}
      -			if (restrictToValidLines){
      -				if (lineCount === 0 || lineIndex < 0 || lineIndex > (lineCount-1)){
      -					return -1;
      -				}
      -			}
      -			return Math.max(0, Math.min(lineCount - 1, lineIndex));
      -		},
      -		_getRulerParent: function(ruler) {
      -			switch (ruler.getLocation()) {
      -				case "left": return this._leftDiv; //$NON-NLS-1$
      -				case "right": return this._rightDiv; //$NON-NLS-1$
      -				case "innerRight": return this._innerRightDiv; //$NON-NLS-1$
      -				case "margin": return this._marginDiv; //$NON-NLS-1$
      -			}
      -			return null;
      -		},
      -		_getScroll: function(cancelAnimation) {
      -			if (cancelAnimation === undefined || cancelAnimation) {
      -				this._cancelAnimation();
      -			}
      -			var viewDiv = this._viewDiv;
      -			return {x: viewDiv.scrollLeft, y: viewDiv.scrollTop};
      -		},
      -		_getSelection: function () {
      -			return (Array.isArray(this._selection) ? this._selection[0] : this._selection).clone();
      -		},
      -		_getSelections: function () {
      -			return (Array.isArray(this._selection) ? this._selection : [this._selection]).map(function(s) {
      -				return s.clone();
      -			});
      -		},
      -		_getTopIndex: function (fullyVisible) {
      -			var child = this._topChild;
      -			if (fullyVisible && this._getClientHeight() > this._getLineHeight()) {
      -				var rect = child.getBoundingClientRect();
      -				var viewPad = this._getViewPadding();
      -				var viewRect = this._viewDiv.getBoundingClientRect();
      -				if (rect.top < viewRect.top + viewPad.top) {
      -					child = this._getLineNext(child) || child;
      -				}
      -			}
      -			return child.lineIndex;
      -		},
      -		_hookEvents: function() {
      -			var that = this;
      -			this._modelListener = {
      -				/** @private */
      -				onChanging: function(modelChangingEvent) {
      -					that._onModelChanging(modelChangingEvent);
      -				},
      -				/** @private */
      -				onChanged: function(modelChangedEvent) {
      -					that._onModelChanged(modelChangedEvent);
      -				}
      -			};
      -			this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
      -			this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
      -			
      -			this._themeListener = {
      -				onChanged: function() {
      -					that._setThemeClass(that._themeClass);
      -				}
      -			};
      -			this._theme.addEventListener("ThemeChanged", this._themeListener.onChanged); //$NON-NLS-1$
      -			
      -			var handlers = this._handlers = [];
      -			var clientDiv = this._clientDiv, viewDiv = this._viewDiv, rootDiv = this._rootDiv;
      -			var topNode = this._overlayDiv || clientDiv;
      -			var doc = clientDiv.ownerDocument;
      -			var win = this._getWindow();
      -			var grabNode = util.isIE ? doc : win;
      -			handlers.push({target: win, type: "resize", handler: function(e) { return that._handleResize(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "blur", handler: function(e) { return that._handleBlur(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "focus", handler: function(e) { return that._handleFocus(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: viewDiv, type: "focus", handler: function() { clientDiv.focus(); }}); //$NON-NLS-1$
      -			var textModel = that.getModel();
      -			if(textModel && typeof textModel.deferScroll === "function") {//If textModel is extended to defer the scroll handler for segmental contents
      -				var deferredHandler = textModel.deferScroll(that, that._handleScroll.bind(that));
      -				handlers.push({target: viewDiv, type: "scroll", handler: function(e) { return deferredHandler(e ? e : win.event);}}); //$NON-NLS-0$
      -			} else {
      -				handlers.push({target: viewDiv, type: "scroll", handler: function(e) { return that._handleScroll(e ? e : win.event);}}); //$NON-NLS-1$
      -			}
      -			handlers.push({target: clientDiv, type: "textInput", handler: function(e) { return that._handleTextInput(e ? e : win.event); }}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "keydown", handler: function(e) { return that._handleKeyDown(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "keypress", handler: function(e) { return that._handleKeyPress(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "keyup", handler: function(e) { return that._handleKeyUp(e ? e : win.event);}}); //$NON-NLS-1$
      -			if (util.isIE) {
      -				handlers.push({target: doc, type: "keyup", handler: function(e) { return that._handleDocKeyUp(e ? e : win.event);}}); //$NON-NLS-1$
      -			}
      -			handlers.push({target: clientDiv, type: "contextmenu", handler: function(e) { return that._handleContextMenu(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "copy", handler: function(e) { return that._handleCopy(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "cut", handler: function(e) { return that._handleCut(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: clientDiv, type: "paste", handler: function(e) { return that._handlePaste(e ? e : win.event);}}); //$NON-NLS-1$
      -			handlers.push({target: doc, type: "selectionchange", handler: function(e) { return that._handleSelectionChange(e ? e : win.event); }}); //$NON-NLS-1$
      -			if (util.isIOS || util.isAndroid) {
      -				handlers.push({target: clientDiv, type: "touchstart", handler: function(e) { return that._handleTouchStart(e ? e : win.event); }}); //$NON-NLS-1$
      -				handlers.push({target: clientDiv, type: "touchmove", handler: function(e) { return that._handleTouchMove(e ? e : win.event); }}); //$NON-NLS-1$
      -				handlers.push({target: clientDiv, type: "touchend", handler: function(e) { return that._handleTouchEnd(e ? e : win.event); }}); //$NON-NLS-1$
      -			} else {
      -				handlers.push({target: clientDiv, type: "selectstart", handler: function(e) { return that._handleSelectStart(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: clientDiv, type: "mousedown", handler: function(e) { return that._handleMouseDown(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: clientDiv, type: "mouseover", handler: function(e) { return that._handleMouseOver(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: clientDiv, type: "mouseout", handler: function(e) { return that._handleMouseOut(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: grabNode, type: "mouseup", handler: function(e) { return that._handleMouseUp(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: grabNode, type: "mousemove", handler: function(e) { return that._handleMouseMove(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: rootDiv, type: "mousedown", handler: function(e) { return that._handleRootMouseDown(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: rootDiv, type: "mouseup", handler: function(e) { return that._handleRootMouseUp(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "dragstart", handler: function(e) { return that._handleDragStart(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "drag", handler: function(e) { return that._handleDrag(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "dragend", handler: function(e) { return that._handleDragEnd(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "dragenter", handler: function(e) { return that._handleDragEnter(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "dragover", handler: function(e) { return that._handleDragOver(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "dragleave", handler: function(e) { return that._handleDragLeave(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: topNode, type: "drop", handler: function(e) { return that._handleDrop(e ? e : win.event);}}); //$NON-NLS-1$
      -				handlers.push({target: this._clientDiv, type: util.isFirefox > 26 ? "wheel" : util.isFirefox ? "DOMMouseScroll" : "mousewheel", handler: function(e) { return that._handleMouseWheel(e ? e : win.event); }}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$
      -				if (this._clipDiv) {
      -					handlers.push({target: this._clipDiv, type: util.isFirefox > 26 ? "wheel" : util.isFirefox ? "DOMMouseScroll" : "mousewheel", handler: function(e) { return that._handleMouseWheel(e ? e : win.event); }}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$
      -				}
      -				if (util.isFirefox && (!util.isWindows || util.isFirefox >= 15)) {
      -					var MO = win.MutationObserver || win.MozMutationObserver;
      -					if (MO) {
      -						this._mutationObserver = new MO(function(mutations) { that._handleDataModified(mutations); });
      -						this._mutationObserver.observe(clientDiv, {subtree: true, characterData: true});
      -					} else {
      -						handlers.push({target: this._clientDiv, type: "DOMCharacterDataModified", handler: function (e) { return that._handleDataModified(e ? e : win.event); }}); //$NON-NLS-1$
      -					}
      -				}
      -				if ((util.isFirefox && (!util.isWindows || util.isFirefox >= 15)) || util.isIE || util.isWebkit) {
      -					handlers.push({target: this._clientDiv, type: "compositionstart", handler: function (e) { return that._handleCompositionStart(e ? e : win.event); }}); //$NON-NLS-1$
      -					handlers.push({target: this._clientDiv, type: "compositionend", handler: function (e) { return that._handleCompositionEnd(e ? e : win.event); }}); //$NON-NLS-1$
      -					handlers.push({target: this._clientDiv, type: "compositionupdate", handler: function (e) { return that._handleCompositionUpdate(e ? e : win.event); }}); //$NON-NLS-1$
      -				}
      -				if (this._overlayDiv) {
      -					handlers.push({target: this._overlayDiv, type: "mousedown", handler: function(e) { return that._handleMouseDown(e ? e : win.event);}}); //$NON-NLS-1$
      -					handlers.push({target: this._overlayDiv, type: "mouseover", handler: function(e) { return that._handleMouseOver(e ? e : win.event);}}); //$NON-NLS-1$
      -					handlers.push({target: this._overlayDiv, type: "mouseout", handler: function(e) { return that._handleMouseOut(e ? e : win.event);}}); //$NON-NLS-1$
      -					handlers.push({target: this._overlayDiv, type: "contextmenu", handler: function(e) { return that._handleContextMenu(e ? e : win.event); }}); //$NON-NLS-1$
      -				}
      -				if (!this._isW3CEvents) {
      -					handlers.push({target: this._clientDiv, type: "dblclick", handler: function(e) { return that._handleDblclick(e ? e : win.event); }}); //$NON-NLS-1$
      -				}
      -			}
      -
      -			this._hookRulerEvents(this._leftDiv, handlers);
      -			this._hookRulerEvents(this._rightDiv, handlers);
      -			this._hookRulerEvents(this._innerRightDiv, handlers);
      -			this._hookRulerEvents(this._marginDiv, handlers);
      -			
      -			for (var i=0; i 26 ? "wheel" : util.isFirefox ? "DOMMouseScroll" : "mousewheel", handler: function(e) { return that._handleMouseWheel(e ? e : win.event); }}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$
      -			handlers.push({target: div, type: "click", handler: function(e) { that._handleRulerEvent(e ? e : win.event); }}); //$NON-NLS-1$
      -			handlers.push({target: div, type: "dblclick", handler: function(e) { that._handleRulerEvent(e ? e : win.event); }}); //$NON-NLS-1$
      -			handlers.push({target: div, type: "mousemove", handler: function(e) { that._handleRulerEvent(e ? e : win.event); }}); //$NON-NLS-1$
      -			handlers.push({target: div, type: "mouseover", handler: function(e) { that._handleRulerEvent(e ? e : win.event); }}); //$NON-NLS-1$
      -			handlers.push({target: div, type: "mouseout", handler: function(e) { that._handleRulerEvent(e ? e : win.event); }}); //$NON-NLS-1$
      -		},
      -		_getWindow: function() {
      -			return getWindow(this._parent.ownerDocument);
      -		},
      -		_ignoreEvent: function(e) {
      -			var node = e.target;
      -			while (node && node !== this._clientDiv) {
      -				if (node.ignore) { return true; }
      -				node = node.parentNode;
      -			}
      -			return false;
      -		},
      -		_init: function(options) {
      -			var _parent = options.parent;
      -			if (typeof(_parent) === "string") { //$NON-NLS-1$
      -				_parent = (options.document || document).getElementById(_parent);
      -			}
      -			if (!_parent) { throw new Error("no parent"); } //$NON-NLS-1$
      -			options.parent = _parent;
      -			options.model = options.model || new mTextModel.TextModel();
      -			var defaultOptions = this._defaultOptions();
      -			for (var option in defaultOptions) {
      -				if (defaultOptions.hasOwnProperty(option)) {
      -					var value;
      -					if (options[option] !== undefined) {
      -						value = options[option];
      -					} else {
      -						value = defaultOptions[option].value;
      -					}
      -					this["_" + option] = value; //$NON-NLS-1$
      -				}
      -			}
      -			this._keyModes = [];
      -			this._rulers = [];
      -			this._selection = [new Selection(0, 0, false)];
      -			this._linksVisible = false;
      -			this._redrawCount = 0;
      -			this._maxLineWidth = 0;
      -			this._maxLineIndex = -1;
      -			this._ignoreSelect = true;
      -			this._ignoreFocus = false;
      -			this._hasFocus = false;
      -			this._dragOffset = -1;
      -			this._isRangeRects = (!util.isIE || util.isIE >= 9) && typeof _parent.ownerDocument.createRange().getBoundingClientRect === "function"; //$NON-NLS-1$
      -			this._isW3CEvents = _parent.addEventListener;
      -
      -			/* Auto scroll */
      -			this._autoScrollX = null;
      -			this._autoScrollY = null;
      -			this._autoScrollTimerID = null;
      -			this._AUTO_SCROLL_RATE = 50;
      -			this._grabControl = null;
      -			this._moseMoveClosure  = null;
      -			this._mouseUpClosure = null;
      -			
      -			/* Double click */
      -			this._lastMouseX = 0;
      -			this._lastMouseY = 0;
      -			this._lastMouseTime = 0;
      -			this._clickCount = 0;
      -			this._clickTime = 250;
      -			this._clickDist = 5;
      -			this._isMouseDown = false;
      -			this._doubleClickSelection = null;
      -			
      -			/* Scroll */
      -			this._hScroll = 0;
      -			this._vScroll = 0;
      -
      -			/* IME */
      -			this._imeOffset = -1;
      -			
      -			/* Create elements */
      -			this._createActions();
      -			this._createView();
      -		},
      -		_checkOverlayScroll: function() {
      -			if (util.isMac && util.isWebkit) {
      -				if (!this._metrics.invalid && this._metrics.scrollWidth === 0) {
      -					var viewDiv = this._viewDiv;
      -					var overlay = this._isOverOverlayScroll();
      -					if (overlay.vertical || overlay.horizontal) {
      -						viewDiv.style.pointerEvents = ""; //$NON-NLS-1$
      -					} else {
      -						viewDiv.style.pointerEvents = "none"; //$NON-NLS-1$
      -					}
      -				}
      -			}	
      -		},
      -		_isOverOverlayScroll: function() {
      -			var scrollShowing = new Date().getTime() - this._lastScrollTime < 200;
      -			if (!scrollShowing) {
      -				return {};
      -			}
      -			var rect = this._viewDiv.getBoundingClientRect();
      -			var x = this._lastMouseMoveX;
      -			var y = this._lastMouseMoveY;
      -			var overlayScrollWidth = 15;
      -			return {
      -				vertical: rect.top <= y && y < rect.bottom && rect.right - overlayScrollWidth <= x && x < rect.right,
      -				horizontal: rect.bottom - overlayScrollWidth <= y && y < rect.bottom && rect.left <= x && x < rect.right
      -			};
      -		},
      -		_startUndo: function() {
      -			if (this._undoStack) {
      -				var that = this;
      -				this._compoundChange = this._undoStack.startCompoundChange({
      -					end: function() {
      -						that._compoundChange = null;
      -					}
      -				});
      -			}
      -		},
      -		_endUndo: function() {
      -			if (this._undoStack) {
      -				this._undoStack.endCompoundChange();
      -			}
      -		},
      -		_modifyContent: function(e, caretAtEnd, show, callback) {
      -			if (this._readonly && !e._code) {
      -				return false;
      -			}
      -			e.type = "Verify"; //$NON-NLS-1$
      -			var oldStart = e.start = e.selection[0].start;
      -			var oldEnd = e.end = e.selection[0].end;
      -			this.onVerify(e);
      -			if (oldStart !== e.start) e.selection[0].start = e.start;
      -			if (oldEnd !== e.end) e.selection[0].end = e.end;
      -
      -			if (e.text === null || e.text === undefined) { return false; }
      -			
      -			if (e.selection.length > 1) this.setRedraw(false);
      -			
      -			var undo = this._compoundChange;
      -			if (undo) {
      -				if (!Selection.compare(this._getSelections(), undo.owner.selection)) {
      -					this._endUndo();
      -					if (e.selection.length > 1) this._startUndo();
      -				}
      -			} else {
      -				if (e.selection.length > 1) this._startUndo();
      -			}
      -			
      -			var model = this._model;
      -			try {
      -				if (e._ignoreDOMSelection) { this._ignoreDOMSelection = true; }
      -				var offset = 0, i = 0;
      -				e.selection.forEach(function(selection) {
      -					selection.start += offset;
      -					selection.end += offset;
      -					var text = Array.isArray(e.text) ? e.text[i] : e.text;
      -					model.setText(text, selection.start, selection.end);
      -					offset += (selection.start - selection.end) + text.length;
      -					selection.setCaret(caretAtEnd ? selection.start + text.length : selection.start);
      -					i++;
      -				});
      -			} finally {
      -				if (e._ignoreDOMSelection) { this._ignoreDOMSelection = false; }
      -			}
      -			this._setSelection(e.selection, show, true, callback);
      -			
      -			undo = this._compoundChange;
      -			if (undo) undo.owner.selection = e.selection;
      -			
      -			if (e.selection.length > 1) this.setRedraw(true);
      -
      -			this.onModify({type: "Modify"}); //$NON-NLS-1$
      -			return true;
      -		},
      -		_onModelChanged: function(modelChangedEvent) {
      -			modelChangedEvent.type = "ModelChanged"; //$NON-NLS-1$
      -			this.onModelChanged(modelChangedEvent);
      -			modelChangedEvent.type = "Changed"; //$NON-NLS-1$
      -			var start = modelChangedEvent.start;
      -			var addedCharCount = modelChangedEvent.addedCharCount;
      -			var removedCharCount = modelChangedEvent.removedCharCount;
      -			var addedLineCount = modelChangedEvent.addedLineCount;
      -			var removedLineCount = modelChangedEvent.removedLineCount;
      -			
      -			var selections = this._getSelections();
      -			selections.forEach(function(selection) {
      -				if (selection.end > start) {
      -					if (selection.end > start && selection.start < start + removedCharCount) {
      -						// selection intersects replaced text. set caret behind text change
      -						selection.setCaret(start + addedCharCount);
      -					} else {
      -						// move selection to keep same text selected
      -						selection.start +=  addedCharCount - removedCharCount;
      -						selection.end +=  addedCharCount - removedCharCount;
      -					}
      -				}
      -			});
      -			this._setSelection(selections, false, false);
      -			
      -			var model = this._model;
      -			var startLine = model.getLineAtOffset(start);
      -			var child = this._getLineNext();
      -			while (child) {
      -				var lineIndex = child.lineIndex;
      -				if (startLine <= lineIndex && lineIndex <= startLine + removedLineCount) {
      -					if (startLine === lineIndex && !child.modelChangedEvent && !child.lineRemoved) {
      -						child.modelChangedEvent = modelChangedEvent;
      -						child.lineChanged = true;
      -					} else {
      -						child.lineRemoved = true;
      -						child.lineChanged = false;
      -						child.modelChangedEvent = null;
      -					}
      -				}
      -				if (lineIndex > startLine + removedLineCount) {
      -					child.lineIndex = lineIndex + addedLineCount - removedLineCount;
      -					child._line.lineIndex = child.lineIndex;
      -				}
      -				child = this._getLineNext(child);
      -			}
      -			if (this._lineHeight) {
      -				var args = [startLine, removedLineCount].concat(newArray(addedLineCount));
      -				Array.prototype.splice.apply(this._lineHeight, args);
      -			}
      -			if (!this._wrapMode) {
      -				if (startLine <= this._maxLineIndex && this._maxLineIndex <= startLine + removedLineCount) {
      -					this._checkMaxLineIndex = this._maxLineIndex;
      -					this._maxLineIndex = -1;
      -					this._maxLineWidth = 0;
      -				}
      -			}
      -			this._update();
      -		},
      -		_onModelChanging: function(modelChangingEvent) {
      -			modelChangingEvent.type = "ModelChanging"; //$NON-NLS-1$
      -			this.onModelChanging(modelChangingEvent);
      -			modelChangingEvent.type = "Changing"; //$NON-NLS-1$
      -		},
      -		_queueUpdate: function() {
      -			if (this._updateTimer || this._ignoreQueueUpdate) { return; }
      -			var that = this;
      -			var win = this._getWindow();
      -			this._updateTimer = win.setTimeout(function() { 
      -				that._updateTimer = null;
      -				that._update();
      -			}, 0);
      -		},
      -		_rangesToSelections: function(ranges) {
      -			var selections = [];
      -			var charCount = this._model.getCharCount();
      -			ranges.forEach(function(range) {
      -				var selection;
      -				if (range instanceof Selection) {
      -					selection = range.clone();
      -				} else {
      -					var start = range.start;
      -					var end = range.end;
      -					var caret = start > end;
      -					if (caret) {
      -						var tmp = start;
      -						start = end;
      -						end = tmp;
      -					}
      -					start = Math.max(0, Math.min (start, charCount));
      -					end = Math.max(0, Math.min (end, charCount));
      -					selection = new Selection(start, end, caret);
      -				}
      -				selections.push(selection);
      -			});
      -			return selections;
      -		},
      -		_resetLineHeight: function(startLine, endLine) {
      -			if (this._wrapMode || this._variableLineHeight) {
      -				if (startLine !== undefined && endLine !== undefined) {
      -					for (var i = startLine; i < endLine; i++) {
      -						this._lineHeight[i] = undefined;
      -					}
      -				} else {
      -					this._lineHeight = newArray(this._model.getLineCount());
      -				}
      -				this._calculateLineHeightTimer();
      -			} else {
      -				this._lineHeight = null;
      -			}
      -		},
      -		_resetLineWidth: function() {
      -			var clientDiv = this._clientDiv;
      -			if (clientDiv) {
      -				var child = clientDiv.firstChild;
      -				while (child) {
      -					child.lineWidth = undefined;
      -					child = child.nextSibling;
      -				}
      -			}
      -		},
      -		_reset: function() {
      -			this._maxLineIndex = -1;
      -			this._maxLineWidth = 0;
      -			this._topChild = null;
      -			this._bottomChild = null;
      -			this._topIndexY = 0;
      -			this._variableLineHeight = false;
      -			this._resetLineHeight();
      -			this._setSelection(new Selection(0, 0, false), false, false);
      -			if (this._viewDiv) {
      -				this._viewDiv.scrollLeft = 0;
      -				this._viewDiv.scrollTop = 0;
      -			}
      -			var clientDiv = this._clientDiv;
      -			if (clientDiv) {
      -				var child = clientDiv.firstChild;
      -				while (child) {
      -					child.lineRemoved = true;
      -					child = child.nextSibling;
      -				}
      -				/*
      -				* Bug in Firefox.  For some reason, the caret does not show after the
      -				* view is refreshed.  The fix is to toggle the contentEditable state and
      -				* force the clientDiv to loose and receive focus if it is focused.
      -				*/
      -				if (util.isFirefox < 13) {
      -					this._fixCaret ();
      -				}
      -			}
      -		},
      -		_scrollViewAnimated: function (pixelX, pixelY, callback) {
      -			var win = this._getWindow();
      -			if (callback && this._scrollAnimation) {
      -				var that = this;
      -				this._animation = new Animation({
      -					window: win,
      -					duration: this._scrollAnimation,
      -					curve: [pixelY, 0],
      -					onAnimate: function(x) {
      -						var deltaY = pixelY - Math.floor(x);
      -						that._scrollView (0, deltaY);
      -						pixelY -= deltaY;
      -					},
      -					onEnd: function() {
      -						that._animation = null;
      -						that._scrollView (pixelX, pixelY);
      -						if (callback) {
      -							win.setTimeout(callback, 0);
      -						}
      -					}
      -				});
      -				this._animation.play();
      -			} else {
      -				this._scrollView (pixelX, pixelY);
      -				if (callback) {
      -					win.setTimeout(callback, 0);
      -				}
      -			}
      -		}, 
      -		_scrollView: function (pixelX, pixelY) {
      -			/*
      -			* Always set _ensureCaretVisible to false so that the view does not scroll
      -			* to show the caret when scrollView is not called from showCaret().
      -			*/
      -			this._ensureCaretVisible = false;
      -			
      -			/*
      -			* Scrolling is done only by setting the scrollLeft and scrollTop fields in the
      -			* view div. This causes an update from the scroll event. In some browsers 
      -			* this event is asynchronous and forcing update page to run synchronously
      -			* leads to redraw problems. 
      -			* On Chrome 11, the view redrawing at times when holding PageDown/PageUp key.
      -			* On Firefox 4 for Linux, the view redraws the first page when holding 
      -			* PageDown/PageUp key, but it will not redraw again until the key is released.
      -			*/
      -			var viewDiv = this._viewDiv;
      -			if (pixelX) { viewDiv.scrollLeft += pixelX; }
      -			if (pixelY) { viewDiv.scrollTop += pixelY; }
      -		},
      -		_setClipboardText: function (text, evt) {
      -			if (util.isElectron && !evt) {
      -				window.__clipboardModule.writeText(text);
      -				return true;
      -			}
      -			var clipboardText;
      -			// IE
      -			var win = this._getWindow();
      -			var clipboardData = win.clipboardData;
      -			// WebKit and Firefox > 21
      -			if (!clipboardData && evt) {
      -				clipboardData = evt.clipboardData;
      -			}
      -			if (clipboardData) {
      -				clipboardText = [];
      -				convertDelimiter(text, function(t) {clipboardText.push(t);}, function() {clipboardText.push(util.platformDelimiter);});
      -				/*
      -				* Note that setData() succeeds on Firefox > 21 and WebKit, but the return value is not a boolean like IE.
      -				*/
      -				var success = clipboardData.setData(util.isIE ? "Text" : "text/plain", clipboardText.join("")); //$NON-NLS-1$ //$NON-NLS-2$
      -				if (success || (evt && (util.isFirefox > 21 || util.isWebkit))) {
      -					return true;
      -				}
      -				if (!evt) return false;
      -			}
      -			var doc = this._parent.ownerDocument;
      -			var child = util.createElement(doc, "pre"); //$NON-NLS-1$
      -			child.style.position = "fixed"; //$NON-NLS-1$
      -			child.style.left = "-1000px"; //$NON-NLS-1$
      -			convertDelimiter(text, 
      -				function(t) {
      -					child.appendChild(doc.createTextNode(t));
      -				}, 
      -				function() {
      -					child.appendChild(util.createElement(doc, "br")); //$NON-NLS-1$
      -				}
      -			);
      -			child.appendChild(doc.createTextNode(" ")); //$NON-NLS-1$
      -			this._clientDiv.appendChild(child);
      -			var range = doc.createRange();
      -			range.setStart(child.firstChild, 0);
      -			range.setEndBefore(child.lastChild);
      -			var sel = win.getSelection();
      -			if (sel.rangeCount > 0) { sel.removeAllRanges(); }
      -			sel.addRange(range);
      -			var that = this;
      -			/** @ignore */
      -			var cleanup = function() {
      -				if (child && child.parentNode === that._clientDiv) {
      -					that._clientDiv.removeChild(child);
      -				}
      -				that._updateDOMSelection();
      -			};
      -			var result = false;
      -			/* 
      -			* Try execCommand first, it works on firefox with clipboard permission,
      -			* chrome 5, safari 4.
      -			*/
      -			this._ignoreCopy = true;
      -			try {
      -				result = doc.execCommand("copy", false, null); //$NON-NLS-1$
      -			} catch (e) {}
      -			this._ignoreCopy = false;
      -			if (!result) {
      -				if (evt) {
      -					win.setTimeout(cleanup, 0);
      -					return false;
      -				}
      -			}
      -			/* no event and no permission, copy cannot be done */
      -			cleanup();
      -			return true;
      -		},
      -		_setGrab: function (target) {
      -			if (target === this._grabControl) { return; }
      -			if (target) {
      -				if (target.setCapture) { target.setCapture(); }
      -				this._grabControl = target;
      -			} else {
      -				if (this._grabControl.releaseCapture) { this._grabControl.releaseCapture(); }
      -				this._grabControl = null;
      -			}
      -		},
      -		_setLinksVisible: function(visible) {
      -			if (this._linksVisible === visible) { return; }
      -			this._linksVisible = visible;
      -			/*
      -			* Feature in IE.  The client div looses focus and does not regain it back
      -			* when the content editable flag is reset. The fix is to remember that it
      -			* had focus when the flag is cleared and give focus back to the div when
      -			* the flag is set.
      -			*/
      -			if (util.isIE && visible) {
      -				this._hadFocus = this._hasFocus;
      -			}
      -			var clientDiv = this._clientDiv;
      -			clientDiv.contentEditable = !visible;
      -			if (this._hadFocus && !visible) {
      -				clientDiv.focus();
      -			}
      -			if (this._overlayDiv) {
      -				this._overlayDiv.style.zIndex = visible ? "-1" : "1"; //$NON-NLS-1$ //$NON-NLS-2$
      -			}
      -			var line = this._getLineNext();
      -			while (line) {
      -				line._line.updateLinks();
      -				line = this._getLineNext(line);
      -			}
      -			this._updateDOMSelection();
      -		},
      -		_setSelection: function (selection, _scroll, update, callback, pageScroll, add, preserveCursorX) {
      -			if (selection) {
      -				if (update === undefined) { update = true; }
      -				var oldSelection = this._getSelections(), newSelection;
      -				if (Array.isArray(selection)) {
      -					newSelection = selection;
      -				} else if (add) {
      -					newSelection = oldSelection.concat([selection]);
      -				} else {
      -					newSelection = [selection];
      -				}
      -				this._selection = Selection.merge(newSelection);
      -				
      -				if (!preserveCursorX) {
      -					newSelection.forEach(function(sel) {
      -						sel._columnX = -1;
      -					});
      -				}
      -
      -				/* 
      -				* Always showCaret(), even when the selection is not changing, to ensure the
      -				* caret is visible. Note that some views do not scroll to show the caret during
      -				* keyboard navigation when the selection does not chanage. For example, line down
      -				* when the caret is already at the last line.
      -				*/
      -				if (_scroll !== false) { /*update = !*/this._showCaret(false, callback, _scroll, pageScroll); }
      -				
      -				/* 
      -				* Sometimes the browser changes the selection 
      -				* as result of method calls or "leaked" events. 
      -				* The fix is to set the visual selection even
      -				* when the logical selection is not changed.
      -				*/
      -				if (update) { this._updateDOMSelection(); }
      -				
      -				if (!Selection.compare(oldSelection, newSelection)) {
      -					var e = {
      -						type: "Selection", //$NON-NLS-1$
      -						oldValue: Selection.convert(oldSelection),
      -						newValue: Selection.convert(newSelection)
      -					};
      -					this.onSelection(e);
      -				}
      -			}
      -		},
      -		_setSelectionTo: function (x, y, down, extent, add, drag) {
      -			var model = this._model;
      -			var selections = this._getSelections();
      -			var pt = this.convert({x: x, y: y}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$
      -			var lineIndex = this._getLineIndex(pt.y);
      -			var line = this._getLine(lineIndex);
      -			var offset = line.getOffset(pt.x, pt.y - this._getLinePixel(lineIndex));
      -			if (drag && !extent) {
      -				if (Selection.contains(selections, offset)) {
      -					this._dragOffset = offset;
      -					line.destroy();
      -					return false;
      -				}
      -			}
      -			if (this._blockSelection) {
      -				selections = this._getBlockSelections(selections, lineIndex, pt);
      -			} else {
      -				var selection;
      -				if (!down) {
      -					selection = Selection.editing(selections);
      -				} else if (extent) {
      -					selection = selections[selections.length - 1];
      -					selection._editing = true;
      -				} else {
      -					selection = new Selection(0, 0);
      -					selection._editing = true;
      -					if (add) {
      -						selections.push(selection);
      -					} else {
      -						selections = [selection];
      -					}
      -					selection._docX = pt.x;
      -				}
      -				if (this._clickCount === 1) {
      -					selection.extend(offset);
      -					if (!extent) { selection.collapse(); }
      -				} else {
      -					var word = (this._clickCount & 1) === 0;
      -					var start, end;
      -					if (word) {
      -						if (this._doubleClickSelection) {
      -							if (offset >= this._doubleClickSelection.start) {
      -								start = this._doubleClickSelection.start;
      -								end = line.getNextOffset(offset, {unit:"wordend", count:1}); //$NON-NLS-1$
      -							} else {
      -								start = line.getNextOffset(offset, {unit:"word", count:-1}); //$NON-NLS-1$
      -								end = this._doubleClickSelection.end;
      -							}
      -						} else {
      -							start = line.getNextOffset(offset, {unit:"word", count:-1}); //$NON-NLS-1$
      -							end = line.getNextOffset(start, {unit:"wordend", count:1}); //$NON-NLS-1$
      -						}
      -					} else {
      -						if (this._doubleClickSelection) {
      -							var doubleClickLine = model.getLineAtOffset(this._doubleClickSelection.start);
      -							if (lineIndex >= doubleClickLine) {
      -								start = model.getLineStart(doubleClickLine);
      -								end = model.getLineEnd(lineIndex);
      -							} else {
      -								start = model.getLineStart(lineIndex);
      -								end = model.getLineEnd(doubleClickLine);
      -							}
      -						} else {
      -							start = model.getLineStart(lineIndex);
      -							end = model.getLineEnd(lineIndex);
      -						}
      -					}
      -					selection.setCaret(start);
      -					selection.extend(end);
      -				}
      -			}
      -			this._setSelection(selections, true, true, null, false);
      -			line.destroy();
      -			return true;
      -		},
      -		_setFullSelection: function(fullSelection, init) {
      -			this._fullSelection = fullSelection;
      -			if (util.isWebkit < 537.36) {
      -				this._fullSelection = fullSelection = true;
      -			}
      -			if (!this._domSelection) {
      -				this._domSelection = [];
      -				this._cursorVisible = true;
      -			}
      -			if (!init) {
      -				this._updateDOMSelection();
      -			}
      -		},
      -		_setBlockCursor: function (visible) {
      -			this._blockCursorVisible = visible;
      -			this._updateBlockCursorVisible();
      -		},
      -		_setOverwriteMode: function (overwrite) {
      -			this._overwriteMode = overwrite;
      -			this._updateBlockCursorVisible();
      -		},
      -		_updateBlockCursorVisible: function () {
      -			if (this._blockCursorVisible || this._overwriteMode) {
      -				if (!this._cursorDiv) {
      -					var viewDiv = this._viewDiv;
      -					var cursorDiv = util.createElement(viewDiv.ownerDocument, "div"); //$NON-NLS-1$
      -					cursorDiv.className = "textviewBlockCursor"; //$NON-NLS-1$
      -					this._cursorDiv = cursorDiv;
      -					cursorDiv.tabIndex = -1;
      -					cursorDiv.style.zIndex = "2"; //$NON-NLS-1$
      -					cursorDiv.style.color = "transparent"; //$NON-NLS-1$
      -					cursorDiv.style.position = "absolute"; //$NON-NLS-1$
      -					cursorDiv.style.pointerEvents = "none"; //$NON-NLS-1$
      -					cursorDiv.innerHTML = " "; //$NON-NLS-1$
      -					viewDiv.appendChild(cursorDiv);
      -					this._updateDOMSelection();
      -				}
      -			} else {
      -				if (this._cursorDiv) {
      -					this._cursorDiv.parentNode.removeChild(this._cursorDiv);
      -					this._cursorDiv = null;
      -				}
      -			}
      -		},
      -		_setMarginOffset: function(marginOffset, init) {
      -			this._marginOffset = marginOffset;
      -			this._marginDiv.style.display = marginOffset ? "block" : "none"; //$NON-NLS-1$ //$NON-NLS-2$
      -			if (!init) {
      -				this._metrics = this._calculateMetrics();
      -				this._queueUpdate();
      -			}
      -		},
      -		_setWrapOffset: function(wrapOffset, init) {
      -			this._wrapOffset = wrapOffset;
      -			if (!init) {
      -				this._metrics = this._calculateMetrics();
      -				this._queueUpdate();
      -			}
      -		},
      -		_setReadOnly: function (readOnly) {
      -			this._readonly = readOnly;
      -		},
      -		_setSingleMode: function (singleMode, init) {
      -			this._singleMode = singleMode;
      -			this._updateOverflow();
      -			this._updateStyle(init);
      -		},
      -		_setNoScroll: function (noScroll, init) {
      -			this._noScroll = noScroll;
      -			this._updateOverflow();
      -			this._updateStyle(init);
      -		},
      -		_setTabSize: function (tabSize, init) {
      -			this._tabSize = tabSize;
      -			this._customTabSize = undefined;
      -			var clientDiv = this._clientDiv;
      -			if (util.isOpera) {
      -				if (clientDiv) { clientDiv.style.OTabSize = this._tabSize+""; }
      -			} else if (util.isWebkit >= 537.1) {
      -				if (clientDiv) { clientDiv.style.tabSize = this._tabSize+""; }
      -			} else if (util.isFirefox >= 4) {
      -				if (clientDiv) {  clientDiv.style.MozTabSize = this._tabSize+""; }
      -			} else if (this._tabSize !== 8) {
      -				this._customTabSize = this._tabSize;
      -			}
      -			if (!init) {
      -				this.redrawLines();
      -				this._resetLineWidth();
      -			}
      -		},
      -		_setTheme: function(theme) {
      -			if (this._theme) {
      -				this._theme.removeEventListener("ThemeChanged", this._themeListener.onChanged); //$NON-NLS-1$
      -			}
      -			this._theme = theme;
      -			if (this._theme) {
      -				this._theme.addEventListener("ThemeChanged", this._themeListener.onChanged); //$NON-NLS-1$
      -			}
      -			this._setThemeClass(this._themeClass);
      -		},
      -		_setThemeClass: function (themeClass, init) {
      -			this._themeClass = themeClass;
      -			var viewContainerClass = "textview"; //$NON-NLS-1$
      -			var globalThemeClass = this._theme.getThemeClass();
      -			if (globalThemeClass) { viewContainerClass += " " + globalThemeClass; } //$NON-NLS-1$
      -			if (this._themeClass && globalThemeClass !== this._themeClass) { viewContainerClass += " " + this._themeClass; } //$NON-NLS-1$
      -			this._rootDiv.className = viewContainerClass;
      -			this._updateStyle(init);
      -		},
      -		_setUndoStack: function (undoStack) {
      -			this._undoStack = undoStack;
      -		},
      -		_setWrapMode: function (wrapMode, init) {
      -			this._wrapMode = wrapMode && this._wrappable;
      -			var clientDiv = this._clientDiv;
      -			if (this._wrapMode) {
      -				clientDiv.style.whiteSpace = "pre-wrap"; //$NON-NLS-1$
      -				clientDiv.style.wordWrap = "break-word"; //$NON-NLS-1$
      -			} else {
      -				clientDiv.style.whiteSpace = "pre"; //$NON-NLS-1$
      -				clientDiv.style.wordWrap = "normal"; //$NON-NLS-1$
      -			}
      -			this._updateOverflow();
      -			if (!init) {
      -				this.redraw();
      -				this._resetLineWidth();
      -			}
      -			this._resetLineHeight();
      -		},
      -		_showCaret: function (allSelection, callback, showOptions, pageScroll) {
      -			if (!this._clientDiv) { return; }
      -			if (this._redrawCount > 0) { return; }
      -			if (this._ignoreDOMSelection) { return; }
      -			if (this._imeOffset !== -1) return;
      -			var model = this._model;
      -			var selections = this._getSelections();
      -			var selection = Selection.editing(selections, this._autoScrollDir === "down"); //$NON-NLS-1$
      -			var _scroll = this._getScroll();
      -			var caret = selection.getCaret();
      -			var start = selection.start;
      -			var end = selection.end;
      -			var startLine = model.getLineAtOffset(start);
      -			var endLine = model.getLineAtOffset(end);
      -			var endInclusive = Math.max(Math.max(start, model.getLineStart(endLine)), end - 1);
      -			var clientWidth = this._getClientWidth();
      -			var clientHeight = this._getClientHeight();
      -			var minScroll = clientWidth / 4;
      -			var bounds = this._getBoundsAtOffset(caret === start ? start : endInclusive);
      -			var left = bounds.left;
      -			var right = bounds.right;
      -			var _top = bounds.top;
      -			var bottom = bounds.bottom;
      -			var selectionHeight = 0;
      -			var hasShowOptions = typeof showOptions === "object"; //$NON-NLS-1$
      -			if ((allSelection || hasShowOptions) && !selection.isEmpty()) {
      -				bounds = this._getBoundsAtOffset(caret === end ? start : endInclusive);
      -				selectionHeight = (bounds.bottom > bottom ? bounds.bottom : bottom) - (bounds.top < _top ? bounds.top : _top);
      -				if (allSelection) {
      -					if (bounds.top === _top) {
      -						if (caret === start) {
      -							right = left + Math.min(bounds.right - left, clientWidth);
      -						} else {
      -							left = right - Math.min(right - bounds.left, clientWidth);
      -						}
      -					} else {
      -						if (caret === start) {
      -							bottom = _top + Math.min(bounds.bottom - _top, clientHeight);
      -						} else {
      -							_top = bottom - Math.min(bottom - bounds.top, clientHeight);
      -						}
      -					}
      -				}
      -			}
      -			var pixelX = 0;
      -			if (left < _scroll.x) {
      -				pixelX = Math.min(left - _scroll.x, -minScroll);
      -			}
      -			if (right > _scroll.x + clientWidth) {
      -				pixelX = Math.max(right - _scroll.x - clientWidth, minScroll);
      -			}
      -			var pixelY = 0;
      -			if (_top < _scroll.y) {
      -				pixelY = _top - _scroll.y;
      -			} else if (bottom > _scroll.y + clientHeight) {
      -				pixelY = bottom - _scroll.y - clientHeight;
      -			}
      -			if (pageScroll) {
      -				if (pageScroll > 0) {
      -					if (pixelY > 0) {
      -						pixelY = Math.max(pixelY, pageScroll);
      -					}
      -				} else {
      -					if (pixelY < 0) {
      -						pixelY = Math.min(pixelY, pageScroll);
      -					}
      -				}
      -			}
      -			var alwaysScroll = hasShowOptions && showOptions.scrollPolicy === "always"; //$NON-NLS-1$
      -			if (pixelX !== 0 || pixelY !== 0 || alwaysScroll) {
      -				if (hasShowOptions) {
      -					var flag = pixelY > 0;
      -					if (pixelY === 0) {
      -						pixelY = _top - _scroll.y;
      -					}
      -					var viewAnchor = showOptions.viewAnchor;
      -					var selectionAnchor = showOptions.selectionAnchor;
      -					var viewAnchorOffset = Math.min(Math.max(0, showOptions.viewAnchorOffset || 0));
      -//					var selectionAnchorOffset = Math.min(Math.max(0, showOptions.selectionAnchorOffset || 0));
      -					if (viewAnchor === "top") { //$NON-NLS-1$
      -						pixelY += Math.floor(flag ? (1 - viewAnchorOffset) * clientHeight : -viewAnchorOffset * clientHeight);
      -					} else if (viewAnchor === "bottom") { //$NON-NLS-1$
      -						pixelY += Math.floor(flag ? viewAnchorOffset * clientHeight : -(1 - viewAnchorOffset) * clientHeight);
      -					} else if (viewAnchor === "center") { //$NON-NLS-1$
      -						pixelY += Math.floor(flag ? clientHeight / 2 + viewAnchorOffset * clientHeight : clientHeight / 2  - (1 - viewAnchorOffset) * clientHeight);
      -					} else { // caret is the default
      -						pixelY += Math.floor(flag ? viewAnchorOffset * clientHeight : -viewAnchorOffset * clientHeight);
      -					}
      -					if (startLine !== endLine) {
      -						if (selectionAnchor === "top" && caret !== start) { //$NON-NLS-1$
      -							pixelY += Math.floor(-selectionHeight);
      -						} else if (selectionAnchor === "bottom" && caret !== end) { //$NON-NLS-1$
      -							pixelY += Math.floor(selectionHeight);
      -						} else if (selectionAnchor === "center") { //$NON-NLS-1$
      -							pixelY += Math.floor(selectionHeight / 2);
      -						} else {
      -							// caret is the default
      -						}
      -					}
      -				} else if (pixelY !== 0 && typeof showOptions === "number") { //$NON-NLS-1$
      -					if (showOptions < 0) { showOptions = 0; }
      -					if (showOptions > 1) { showOptions = 1; }
      -					pixelY += Math.floor(pixelY > 0 ? showOptions * clientHeight : -showOptions * clientHeight);
      -				}
      -				this._scrollViewAnimated(pixelX, pixelY, callback);
      -				/*
      -				* When the view scrolls it is possible that one of the scrollbars can show over the caret.
      -				* Depending on the browser scrolling can be synchronous (Safari), in which case the change 
      -				* can be detected before showCaret() returns. When scrolling is asynchronous (most browsers), 
      -				* the detection is done during the next update page.
      -				*/
      -				if (clientHeight !== this._getClientHeight() || clientWidth !== this._getClientWidth()) {
      -					this._showCaret();
      -				} else {
      -					this._ensureCaretVisible = true;
      -				}
      -				return true;
      -			} else {
      -				if (callback) {
      -					callback();
      -				}
      -			}
      -			return false;
      -		},
      -		_startIME: function () {
      -			if (this._imeOffset !== -1) { return; }
      -			var selected = false;
      -			var selections = this._getSelections();
      -			for (var i=0; i 0) { return; }
      -			if (this._ignoreDOMSelection) { return; }
      -			if (this._imeOffset !== -1) return;
      -			if (!this._clientDiv) { return; }
      -			var selection = this._getSelections();
      -			var domSelection = this._domSelection, i;
      -			if (domSelection.length < selection.length) {
      -				for (i=domSelection.length; i selection.length) {
      -				domSelection.splice(selection.length).forEach(function(s) {
      -					s.destroy();
      -				});
      -			}
      -			for (i=0; i 1) {
      -				if (!this._cursorTimer) {
      -					this._cursorTimer = win.setInterval(function() {
      -						that._cursorVisible = !that._cursorVisible;
      -						that._domSelection.forEach(function(domSelection) { domSelection.update(); });
      -					}, 500);
      -				}
      -			} else {
      -				if (this._cursorTimer) {
      -					win.clearInterval(this._cursorTimer);
      -					this._cursorTimer = null;
      -				}
      -			}
      -		},
      -		_update: function(hScrollOnly) {
      -			if (this._redrawCount > 0) { return; }
      -			if (this._updateTimer) {
      -				var win = this._getWindow();
      -				win.clearTimeout(this._updateTimer);
      -				this._updateTimer = null;
      -				hScrollOnly = false;
      -			}
      -			var clientDiv = this._clientDiv;
      -			var viewDiv = this._viewDiv;
      -			if (!clientDiv) { return; }
      -			if (this._metrics.invalid) {
      -				this._ignoreQueueUpdate = true;
      -				this._updateStyle();
      -				this._ignoreQueueUpdate = false;
      -			}
      -			var model = this._model;
      -			var _scroll = this._getScroll(false);
      -			var viewPad = this._getViewPadding();
      -			var lineCount = model.getLineCount();
      -			var lineHeight = this._getLineHeight();
      -			var needUpdate = false;
      -			var hScroll = false, vScroll = false;
      -			var scrollbarWidth = this._metrics.scrollWidth;
      -			
      -			if (this._wrapMode) {
      -				clientDiv.style.width = (this._metrics.wrapWidth || this._getClientWidth()) + "px"; //$NON-NLS-1$
      -			}
      -			
      -			/*
      -			* topIndex - top line index of the view (maybe be particialy visible)
      -			* lineStart - top line minus one line (if any)
      -			* topIndexY - portion of the top line that is NOT visible.
      -			* top - topIndexY plus height of the line before top line (if any)
      -			*/
      -			var topIndex, lineStart, _top, topIndexY,
      -				leftWidth, leftRect,
      -				clientWidth, clientHeight, scrollWidth, scrollHeight,
      -				totalHeight = 0, totalLineIndex = 0, tempLineHeight;
      -			if (this._lineHeight) {
      -				while (totalLineIndex < lineCount) {
      -					tempLineHeight = this._getLineHeight(totalLineIndex);
      -					if (totalHeight + tempLineHeight > _scroll.y) {
      -						break;
      -					}
      -					totalHeight += tempLineHeight;
      -					totalLineIndex++;
      -				}
      -				topIndex = totalLineIndex;
      -				lineStart = Math.max(0, topIndex - 1);
      -				topIndexY = _top = _scroll.y - totalHeight;
      -				if (topIndex > 0) {
      -					_top += this._getLineHeight(topIndex - 1);
      -				}
      -			} else {
      -				var firstLine = Math.max(0, _scroll.y) / lineHeight;
      -				topIndex = Math.floor(firstLine);
      -				lineStart = Math.max(0, topIndex - 1);
      -				_top = Math.round((firstLine - lineStart) * lineHeight);
      -				topIndexY = Math.round((firstLine - topIndex) * lineHeight);
      -				scrollHeight = lineCount * lineHeight;
      -			}
      -			this._topIndexY = topIndexY;
      -			var rootDiv = this._rootDiv;
      -			var rootWidth = rootDiv.clientWidth;
      -			var rootHeight = rootDiv.clientHeight;
      -			if (hScrollOnly) {
      -				leftWidth = 0;
      -				if (this._leftDiv) {
      -					leftRect = this._leftDiv.getBoundingClientRect();
      -					leftWidth = leftRect.right - leftRect.left;
      -				}
      -				clientWidth = this._getClientWidth();
      -				clientHeight = this._getClientHeight();
      -				scrollWidth = clientWidth;
      -				if (this._wrapMode) {
      -					if (this._metrics.wrapWidth) {
      -						scrollWidth = this._metrics.wrapWidth;
      -					}
      -				} else {
      -					scrollWidth = Math.max(this._maxLineWidth, scrollWidth);
      -				}
      -				while (totalLineIndex < lineCount) {
      -					tempLineHeight = this._getLineHeight(totalLineIndex, false);
      -					totalHeight += tempLineHeight;
      -					totalLineIndex++;
      -				}
      -				scrollHeight = totalHeight;
      -			} else {
      -				clientHeight = this._getClientHeight();
      -
      -				var linesPerPage = Math.floor((clientHeight + topIndexY) / lineHeight);
      -				var bottomIndex = Math.min(topIndex + linesPerPage, lineCount - 1);
      -				var lineEnd = Math.min(bottomIndex + 1, lineCount - 1);
      -				
      -				var lineIndex, lineWidth;
      -				var child = clientDiv.firstChild;
      -				while (child) {
      -					lineIndex = child.lineIndex;
      -					var nextChild = child.nextSibling;
      -					if (!(lineStart <= lineIndex && lineIndex <= lineEnd) || child.lineRemoved || child.lineIndex === -1) {
      -						if (this._mouseWheelLine === child) {
      -							child.style.display = "none"; //$NON-NLS-1$
      -							child.lineIndex = -1;
      -						} else {
      -							clientDiv.removeChild(child);
      -						}
      -					}
      -					child = nextChild;
      -				}
      -	
      -				child = this._getLineNext();
      -				var doc = viewDiv.ownerDocument;
      -				var frag = doc.createDocumentFragment();
      -				for (lineIndex=lineStart; lineIndex<=lineEnd; lineIndex++) {
      -					if (!child || child.lineIndex > lineIndex) {
      -						new TextLine(this, lineIndex).create(frag, null);
      -					} else {
      -						if (frag.firstChild) {
      -							clientDiv.insertBefore(frag, child);
      -							frag = doc.createDocumentFragment();
      -						}
      -						if (child && child.lineChanged) {
      -							child = new TextLine(this, lineIndex).create(frag, child);
      -							child.lineChanged = false;
      -						}
      -						child = this._getLineNext(child);
      -					}
      -				}
      -				if (frag.firstChild) { clientDiv.insertBefore(frag, child); }
      -	
      -				/*
      -				* Feature in WekKit. Webkit limits the width of the lines
      -				* computed below to the width of the client div.  This causes
      -				* the lines to be wrapped even though "pre" is set.  The fix
      -				* is to set the width of the client div to "0x7fffffffpx"
      -				* before computing the lines width.  Note that this value is
      -				* reset to the appropriate value further down.
      -				*/ 
      -				if (util.isWebkit && !this._wrapMode) {
      -					clientDiv.style.width = "0x7fffffffpx"; //$NON-NLS-1$
      -				}
      -	
      -				var rect;
      -				child = this._getLineNext();
      -				var bottomHeight = clientHeight + _top;
      -				var foundBottomIndex = false;
      -				while (child) {
      -					lineWidth = child.lineWidth;
      -					if (lineWidth === undefined) {
      -						rect = child._line.getBoundingClientRect();
      -						lineWidth = child.lineWidth = Math.ceil(rect.right - rect.left);
      -						var lh = rect.bottom - rect.top;
      -						if (this._lineHeight) {
      -							this._lineHeight[child.lineIndex] = lh;
      -						} else if (lineHeight !== 0 && lh !== 0 && Math.ceil(lineHeight) !== Math.ceil(lh)) {
      -							this._variableLineHeight = true;
      -							this._lineHeight = [];
      -							this._lineHeight[child.lineIndex] = lh;
      -						}
      -					}
      -					if (this._lineHeight && !foundBottomIndex) {
      -						bottomHeight -= this._lineHeight[child.lineIndex];
      -						if (bottomHeight < 0) {
      -							bottomIndex = child.lineIndex;
      -							foundBottomIndex = true;
      -						}
      -					}
      -					if (!this._wrapMode) {
      -						if (lineWidth >= this._maxLineWidth) {
      -							this._maxLineWidth = lineWidth;
      -							this._maxLineIndex = child.lineIndex;
      -						}
      -						if (this._checkMaxLineIndex === child.lineIndex) { this._checkMaxLineIndex = -1; }
      -					}
      -					if (child.lineIndex === topIndex) { this._topChild = child; }
      -					if (child.lineIndex === bottomIndex) { this._bottomChild = child; }
      -					child = this._getLineNext(child);
      -				}
      -				if (this._checkMaxLineIndex !== -1) {
      -					lineIndex = this._checkMaxLineIndex;
      -					this._checkMaxLineIndex = -1;
      -					if (0 <= lineIndex && lineIndex < lineCount) {
      -						var line = new TextLine(this, lineIndex);
      -						rect = line.getBoundingClientRect();
      -						lineWidth = rect.right - rect.left;
      -						if (lineWidth >= this._maxLineWidth) {
      -							this._maxLineWidth = lineWidth;
      -							this._maxLineIndex = lineIndex;
      -						}
      -						line.destroy();
      -					}
      -				}
      -				
      -				while (totalLineIndex < lineCount) {
      -					tempLineHeight = this._getLineHeight(totalLineIndex, totalLineIndex <= bottomIndex);
      -					totalHeight += tempLineHeight;
      -					totalLineIndex++;
      -				}
      -				scrollHeight = totalHeight;
      -	
      -				// Update rulers
      -				this._updateRuler(this._leftDiv, topIndex, lineEnd, rootHeight);
      -				this._updateRuler(this._rightDiv, topIndex, lineEnd, rootHeight);
      -				this._updateRuler(this._innerRightDiv, topIndex, lineEnd, rootHeight);
      -				this._updateRuler(this._marginDiv, topIndex, lineEnd, rootHeight);
      -				
      -				leftWidth = 0;
      -				if (this._leftDiv) {
      -					leftRect = this._leftDiv.getBoundingClientRect();
      -					leftWidth = leftRect.right - leftRect.left;
      -				}
      -				var rightWidth = 0;
      -				if (this._rightDiv) {
      -					var rightRect = this._rightDiv.getBoundingClientRect();
      -					rightWidth = rightRect.right - rightRect.left;
      -				}
      -				viewDiv.style.left = leftWidth + "px"; //$NON-NLS-1$
      -				viewDiv.style.right = rightWidth + "px"; //$NON-NLS-1$
      -
      -				/* Need to set the height first in order for the width to consider the vertical scrollbar */
      -				var scrollDiv = this._scrollDiv;
      -				scrollDiv.style.height = (scrollHeight + (util.isWebkit ? 0 : viewPad.bottom)) + "px"; //$NON-NLS-1$
      -				
      -				clientWidth = this._getClientWidth();
      -				if (!this._singleMode && !this._wrapMode && !this._noScroll) {
      -					var clientHeightNoScroll = clientHeight, clientHeightScroll = clientHeight;
      -					var oldHScroll = viewDiv.style.overflowX === "scroll"; //$NON-NLS-1$
      -					if (oldHScroll) {
      -						clientHeightNoScroll += scrollbarWidth;
      -					} else {
      -						clientHeightScroll -= scrollbarWidth;
      -					}
      -					var clientWidthNoScroll = clientWidth, clientWidthScroll = clientWidth;
      -					var oldVScroll = viewDiv.style.overflowY === "scroll"; //$NON-NLS-1$
      -					if (oldVScroll) {
      -						clientWidthNoScroll += scrollbarWidth;
      -					} else {
      -						clientWidthScroll -= scrollbarWidth;
      -					}
      -					clientHeight = clientHeightNoScroll;
      -					clientWidth = clientWidthNoScroll;
      -					if (scrollHeight > clientHeight) {
      -						vScroll = true;
      -						clientWidth = clientWidthScroll;
      -					}
      -					if (this._maxLineWidth > clientWidth) {
      -						hScroll = true;
      -						clientHeight = clientHeightScroll;
      -						if (scrollHeight > clientHeight) {
      -							vScroll = true;
      -							clientWidth = clientWidthScroll;
      -						}
      -					}
      -					if (oldHScroll !== hScroll) {
      -						viewDiv.style.overflowX = hScroll ? "scroll" : "hidden"; //$NON-NLS-1$ //$NON-NLS-2$
      -					}
      -					if (oldVScroll !== vScroll) {
      -						viewDiv.style.overflowY = vScroll ? "scroll" : "hidden"; //$NON-NLS-1$ //$NON-NLS-2$
      -					}
      -					needUpdate = oldHScroll !== hScroll || oldVScroll !== vScroll;
      -				}
      -				
      -				var width = clientWidth;
      -				if (this._wrapMode) {
      -					if (this._metrics.wrapWidth) {
      -						width = this._metrics.wrapWidth;
      -					}
      -				} else {
      -					width = Math.max(this._maxLineWidth + this._getInnerRightWidth(), width);
      -				}
      -				/*
      -				* Except by IE 8 and earlier, all other browsers are not allocating enough space for the right padding 
      -				* in the scrollbar. It is possible this a bug since all other paddings are considered.
      -				*/
      -				scrollWidth = width;
      -				if ((!util.isIE || util.isIE >= 9) && this._maxLineWidth > clientWidth) { width += viewPad.right + viewPad.left; }
      -				scrollDiv.style.width = width + "px"; //$NON-NLS-1$
      -				if (this._clipScrollDiv) {
      -					this._clipScrollDiv.style.width = width + "px"; //$NON-NLS-1$
      -				}
      -				/* Get the left scroll after setting the width of the scrollDiv as this can change the horizontal scroll offset. */
      -				_scroll = this._getScroll(false);
      -
      -				var innerRightDiv = this._innerRightDiv;
      -				if (innerRightDiv) {
      -					innerRightDiv.style.right = rightWidth + (viewDiv.style.overflowY === "scroll" ? this._metrics.scrollWidth : 0) + "px"; //$NON-NLS-1$ //$NON-NLS-1$
      -					innerRightDiv.style.bottom = (viewDiv.style.overflowX === "scroll" ? scrollbarWidth : 0) + "px"; //$NON-NLS-1$ //$NON-NLS-1$
      -				}
      -			}
      -			this._scrollHeight = scrollHeight;
      -			if (this._vScrollDiv) {
      -				var trackHeight = clientHeight - 8;
      -				var thumbHeight = Math.max(15, Math.ceil(Math.min(1, trackHeight / (scrollHeight + viewPad.top + viewPad.bottom)) * trackHeight));
      -				this._vScrollDiv.style.left = (leftWidth + clientWidth - 8) + "px"; //$NON-NLS-1$
      -				this._vScrollDiv.style.top = Math.floor(Math.max(0, (_scroll.y * trackHeight / scrollHeight))) + "px"; //$NON-NLS-1$
      -				this._vScrollDiv.style.height = thumbHeight + "px"; //$NON-NLS-1$
      -			}
      -			if (!this._wrapMode && this._hScrollDiv) {
      -				var trackWidth = clientWidth - 8;
      -				var thumbWidth = Math.max(15, Math.ceil(Math.min(1, trackWidth / (this._maxLineWidth + viewPad.left + viewPad.right)) * trackWidth));
      -				this._hScrollDiv.style.left = leftWidth + Math.floor(Math.max(0, Math.floor(_scroll.x * trackWidth / this._maxLineWidth))) + "px"; //$NON-NLS-1$
      -				this._hScrollDiv.style.top = (clientHeight - 9) + "px"; //$NON-NLS-1$
      -				this._hScrollDiv.style.width = thumbWidth + "px"; //$NON-NLS-1$
      -			}
      -			var left = _scroll.x;	
      -			var clipDiv = this._clipDiv;
      -			var overlayDiv = this._overlayDiv;
      -			var marginDiv = this._marginDiv;
      -			var clipLeft, clipTop;
      -			if (marginDiv) {
      -				marginDiv.style.left = (-left + leftWidth + this._metrics.marginWidth + viewPad.left) + "px"; //$NON-NLS-1$
      -				marginDiv.style.bottom = (viewDiv.style.overflowX === "scroll" ? scrollbarWidth : 0) + "px"; //$NON-NLS-1$ //$NON-NLS-1$
      -			}
      -			if (clipDiv) {
      -				clipDiv.scrollLeft = left;
      -				clipDiv.scrollTop = 0;
      -				clipLeft = leftWidth + viewPad.left;
      -				clipTop = viewPad.top;
      -				var clipWidth = clientWidth;
      -				var clipHeight = clientHeight;
      -				var clientLeft = 0, clientTop = -_top;
      -				if (_scroll.x === 0) {
      -					clipLeft -= viewPad.left;
      -					clipWidth += viewPad.left;
      -					clientLeft = viewPad.left;
      -				} 
      -				if (_scroll.x + clientWidth === scrollWidth) {
      -					clipWidth += viewPad.right;
      -				}
      -				if (_scroll.y === 0) {
      -					clipTop -= viewPad.top;
      -					clipHeight += viewPad.top;
      -					clientTop += viewPad.top;
      -				}
      -				if (_scroll.y + clientHeight === scrollHeight) { 
      -					clipHeight += viewPad.bottom; 
      -				}
      -				clipDiv.style.left = clipLeft + "px"; //$NON-NLS-1$
      -				clipDiv.style.top = clipTop + "px"; //$NON-NLS-1$
      -				clipDiv.style.right = (rootWidth - clipWidth - clipLeft) + "px"; //$NON-NLS-1$
      -				clipDiv.style.bottom = (rootHeight - clipHeight - clipTop) + "px"; //$NON-NLS-1$
      -				clientDiv.style.left = clientLeft + "px"; //$NON-NLS-1$
      -				clientDiv.style.top = clientTop + "px"; //$NON-NLS-1$
      -				clientDiv.style.width = scrollWidth + "px"; //$NON-NLS-1$
      -				clientDiv.style.height = (clientHeight + _top) + "px"; //$NON-NLS-1$
      -				if (overlayDiv) {
      -					overlayDiv.style.left = clientDiv.style.left;
      -					overlayDiv.style.top = clientDiv.style.top;
      -					overlayDiv.style.width = clientDiv.style.width;
      -					overlayDiv.style.height = clientDiv.style.height;
      -				}
      -			} else {
      -				clipLeft = left;
      -				clipTop = _top;
      -				var clipRight = left + clientWidth;
      -				var clipBottom = _top + clientHeight;
      -				if (clipLeft === 0) { clipLeft -= viewPad.left; }
      -				if (clipTop === 0) { clipTop -= viewPad.top; }
      -				if (clipRight === scrollWidth) { clipRight += viewPad.right; }
      -				if (_scroll.y + clientHeight === scrollHeight) { clipBottom += viewPad.bottom; }
      -				clientDiv.style.clip = "rect(" + clipTop + "px," + clipRight + "px," + clipBottom + "px," + clipLeft + "px)"; //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$
      -				if (document.dir == "rtl") { /* ACGC */
      -					clientDiv.style.right = (-left + leftWidth + viewPad.left) + "px"; //$NON-NLS-1$
      -				}else{
      -					clientDiv.style.left = (-left + leftWidth + viewPad.left) + "px"; //$NON-NLS-1$	  
      -				}
      -				clientDiv.style.width = (this._wrapMode || util.isWebkit ? scrollWidth : clientWidth + left) + "px"; //$NON-NLS-1$
      -				if (!hScrollOnly) {
      -					clientDiv.style.top = (-_top + viewPad.top) + "px"; //$NON-NLS-1$
      -					clientDiv.style.height = (clientHeight + _top) + "px"; //$NON-NLS-1$
      -				}
      -				if (overlayDiv) {
      -					overlayDiv.style.clip = clientDiv.style.clip;
      -					overlayDiv.style.left = clientDiv.style.left;
      -					overlayDiv.style.width = clientDiv.style.width;
      -					if (!hScrollOnly) {
      -						overlayDiv.style.top = clientDiv.style.top;
      -						overlayDiv.style.height = clientDiv.style.height;
      -					}
      -				}
      -			}
      -			this._updateDOMSelection();
      -
      -			if (needUpdate) {
      -				var ensureCaretVisible = this._ensureCaretVisible;
      -				this._ensureCaretVisible = false;
      -				if (ensureCaretVisible) {
      -					this._showCaret();
      -				}
      -				this._queueUpdate();
      -			}
      -		},
      -		_updateOverflow: function() {
      -			var viewDiv = this._viewDiv;
      -			if (this._noScroll) {
      -				viewDiv.style.overflow = "hidden"; //$NON-NLS-1$
      -			} else if (this._wrapMode) {
      -				viewDiv.style.overflowX = "hidden"; //$NON-NLS-1$
      -				viewDiv.style.overflowY = "scroll"; //$NON-NLS-1$
      -			} else {
      -				viewDiv.style.overflow = "hidden"; //$NON-NLS-1$
      -			}
      -		},
      -		_updateRuler: function (divRuler, topIndex, bottomIndex, rootHeight) {
      -			if (!divRuler) { return; }
      -			var doc = this._parent.ownerDocument;
      -			var lineHeight = this._getLineHeight();
      -			var viewPad = this._getViewPadding();
      -			var div = divRuler.firstChild;
      -			while (div) {
      -				var ruler = div._ruler;
      -				var overview = ruler.getOverview();
      -				if (div.rulerChanged) {
      -					applyStyle(ruler.getRulerStyle(), div);
      -					divRuler.rulerWidth = undefined;
      -				}
      -				if (overview === "fixed") { //$NON-NLS-1$
      -					div.rulerChanged = false;
      -					div = div.nextSibling;
      -					continue;
      -				}
      -				var offset = lineHeight;
      -				if (overview === "page") { offset += this._topIndexY; } //$NON-NLS-1$
      -				div.style.top = -offset + "px"; //$NON-NLS-1$
      -				div.style.height = (rootHeight + offset) + "px"; //$NON-NLS-1$
      -				
      -				
      -				var widthDiv;
      -				var child = div.firstChild;
      -				if (child) {
      -					widthDiv = child;
      -					child = child.nextSibling;
      -				} else {
      -					widthDiv = util.createElement(doc, "div"); //$NON-NLS-1$
      -					widthDiv.style.visibility = "hidden"; //$NON-NLS-1$
      -					div.appendChild(widthDiv);
      -				}
      -				var lineIndex, annotation;
      -				if (div.rulerChanged) {
      -					if (widthDiv) {
      -						lineIndex = -1;
      -						annotation = ruler.getWidestAnnotation();
      -						if (annotation) {
      -							applyStyle(annotation.style, widthDiv);
      -							if (annotation.html) {
      -								widthDiv.innerHTML = annotation.html;
      -							}
      -						}
      -						widthDiv.lineIndex = lineIndex;
      -						widthDiv.style.height = (lineHeight + viewPad.top) + "px"; //$NON-NLS-1$
      -					}
      -				}
      -
      -				var lineDiv, frag, annotations;
      -				if (overview === "page") { //$NON-NLS-1$
      -					annotations = ruler.getAnnotations(topIndex, bottomIndex + 1);
      -					while (child) {
      -						lineIndex = child.lineIndex;
      -						var nextChild = child.nextSibling;
      -						if (!(topIndex <= lineIndex && lineIndex <= bottomIndex) || child.lineChanged) {
      -							div.removeChild(child);
      -						}
      -						child = nextChild;
      -					}
      -					child = div.firstChild.nextSibling;
      -					frag = doc.createDocumentFragment();
      -					for (lineIndex=topIndex; lineIndex<=bottomIndex; lineIndex++) {
      -						if (!child || child.lineIndex > lineIndex) {
      -							lineDiv = util.createElement(doc, "div"); //$NON-NLS-1$
      -							annotation = annotations[lineIndex];
      -							if (annotation) {
      -								applyStyle(annotation.style, lineDiv);
      -								if (annotation.html) {
      -									lineDiv.innerHTML = annotation.html;
      -								}
      -								lineDiv.annotation = annotation;
      -							}
      -							lineDiv.lineIndex = lineIndex;
      -							lineDiv.style.height = this._getLineHeight(lineIndex) + "px"; //$NON-NLS-1$
      -							frag.appendChild(lineDiv);
      -						} else {
      -							if (frag.firstChild) {
      -								div.insertBefore(frag, child);
      -								frag = doc.createDocumentFragment();
      -							}
      -							if (child) {
      -								child = child.nextSibling;
      -							}
      -						}
      -					}
      -					if (frag.firstChild) { div.insertBefore(frag, child); }
      -				} else {
      -					var clientHeight = this._getClientHeight ();
      -					var lineCount = this._model.getLineCount ();
      -					var contentHeight = lineHeight * lineCount;
      -					var trackHeight = clientHeight + viewPad.top + viewPad.bottom - 2 * this._metrics.scrollWidth;
      -					var divHeight, arrowWidth;
      -					if (contentHeight < trackHeight) {
      -						divHeight = lineHeight;
      -						arrowWidth = viewPad.top;
      -					} else {
      -						divHeight = trackHeight / lineCount;
      -						arrowWidth = this._metrics.scrollWidth;
      -					}
      -					if (div.rulerChanged) {
      -						var count = div.childNodes.length;
      -						while (count > 1) {
      -							div.removeChild(div.lastChild);
      -							count--;
      -						}
      -						annotations = ruler.getAnnotations(0, lineCount);
      -						frag = doc.createDocumentFragment();
      -						for (var prop in annotations) {
      -							lineIndex = prop >>> 0;
      -							if (lineIndex < 0) { continue; }
      -							lineDiv = util.createElement(doc, "div"); //$NON-NLS-1$
      -							annotation = annotations[prop];
      -							applyStyle(annotation.style, lineDiv);
      -							lineDiv.style.position = "absolute"; //$NON-NLS-1$
      -							lineDiv.style.top = arrowWidth + lineHeight + Math.floor(lineIndex * divHeight) + "px"; //$NON-NLS-1$
      -							if (annotation.html) {
      -								lineDiv.innerHTML = annotation.html;
      -							}
      -							lineDiv.annotation = annotation;
      -							lineDiv.lineIndex = lineIndex;
      -							frag.appendChild(lineDiv);
      -						}
      -						div.appendChild(frag);
      -					} else if (div._oldTrackHeight !== trackHeight) {
      -						lineDiv = div.firstChild ? div.firstChild.nextSibling : null;
      -						while (lineDiv) {
      -							lineDiv.style.top = this._metrics.scrollWidth + lineHeight + Math.floor(lineDiv.lineIndex * divHeight) + "px"; //$NON-NLS-1$
      -							lineDiv = lineDiv.nextSibling;
      -						}
      -					}
      -					div._oldTrackHeight = trackHeight;
      -				}
      -				div.rulerChanged = false;
      -				div = div.nextSibling;
      -			}
      -		},
      -		_updateStyleSheet: function() {
      -			var styleText = "";
      -			if (util.isWebkit && this._metrics.scrollWidth > 0) {
      -				styleText += "\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}"; //$NON-NLS-1$
      -			}
      -			if (styleText) {
      -				var doc = this._clientDiv.ownerDocument;
      -				var node = doc.getElementById("_textviewStyle"); //$NON-NLS-1$
      -				if (!node) {
      -					node = util.createElement(doc, "style"); //$NON-NLS-1$
      -					node.id = "_textviewStyle"; //$NON-NLS-1$
      -					var head = doc.getElementsByTagName("head")[0] || doc.documentElement; //$NON-NLS-1$
      -					node.appendChild(doc.createTextNode(styleText));
      -					head.insertBefore(node, head.firstChild);
      -				} else {
      -					node.removeChild(node.firstChild);
      -					node.appendChild(doc.createTextNode(styleText));
      -				}
      -			}
      -		},
      -		_updateStyle: function (init, metrics) {
      -			if (!init && util.isIE) {
      -				this._rootDiv.style.lineHeight = "normal"; //$NON-NLS-1$
      -			}
      -			metrics = this._metrics = metrics || this._calculateMetrics();
      -			if (this._variableLineHeight) {
      -				this._variableLineHeight = false;
      -				this._resetLineHeight();
      -			}
      -			if (util.isIE) {
      -				this._rootDiv.style.lineHeight = (metrics.lineHeight - (metrics.lineTrim.top + metrics.lineTrim.bottom)) + "px"; //$NON-NLS-1$
      -			} else {
      -				this._rootDiv.style.lineHeight = "normal"; //$NON-NLS-1$
      -			}
      -			this._updateStyleSheet();
      -			if (util.isMac && util.isWebkit) {
      -				var viewDiv = this._viewDiv;
      -				if (!metrics.invalid && metrics.scrollWidth === 0) {
      -					viewDiv.style.pointerEvents = "none"; //$NON-NLS-1$
      -					viewDiv.style.zIndex = "2"; //$NON-NLS-1$
      -				} else {
      -					viewDiv.style.pointerEvents = ""; //$NON-NLS-1$
      -					viewDiv.style.zIndex = ""; //$NON-NLS-1$
      -				}
      -			}
      -			if (!init) {
      -				this.redraw();
      -				this._resetLineWidth();
      -			}
      -		}
      -	};//end prototype
      -	mEventTarget.EventTarget.addMixin(TextView.prototype);
      -	
      -	return {TextView: TextView};
      -});
      -
      -
      -/*******************************************************************************
      - * @license
      - * Copyright (c) 2010, 2015 IBM Corporation and others.
      - * All rights reserved. This program and the accompanying materials are made 
      - * available under the terms of the Eclipse Public License v1.0 
      - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
      - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
      - * 
      - * Contributors: IBM Corporation - initial API and implementation
      - ******************************************************************************/
      -
      -/*eslint-env browser, amd, node*/
      -define("orion/editor/tooltip", [
      -	'i18n!orion/editor/nls/messages',
      -	'orion/editor/textView',
      -	'orion/editor/projectionTextModel',
      -	'orion/Deferred',
      -	'orion/editor/util',
      -	'orion/webui/littlelib',
      -	'orion/util'
      -], function(messages, mTextView, mProjectionTextModel, Deferred, textUtil, lib, util) {
      -
      -/**
      - * @name Tooltip
      - * @description Tooltip support for text views
      - * 
      - * show() - Opens the tooltip
      - * update() - Updates the content of the open tooltip
      - * onHover() - Checks if the x,y coordinates are outside the current tooltip area and updates the tooltip if necessary
      - * hide() - Closes the tooltip
      - * isVisible() - Returns whether the tooltip is currently showing
      - * 
      - * The methods above ask for a tooltipInfo object, which must contain a callback function getTooltipInfo()
      - * This function must return an info object with the following contents:
      - * 
      - * Info {
      - * 	Contents {string, html element, annotation array, etc.} Contents to display, if undefined, the hover service will be asked for content
      - * 	Context {source, offset, offsetStart, offsetEnd}} Information used to modify the tooltip position or contents
      - * 	Position {String} One of left, right, top, bottom used to position the tooltip relative to the anchor area
      - * 	AnchorArea {top, left, width, height} rectangle defining the source of the tooltip and where to position relative to
      - * 	TooltipArea {top, left, width, height} rectangle to define the tooltip's exact placement rather than a relative position to the anchor
      - * 	TooltipOffsetX {Number} Hint to move the tooltip position horizontally
      - * 	TooltipOffsetY {Number} Hint to move the tooltip position vertically
      - * 
      - * @param view
      - */
      -function Tooltip (view, editor) {
      -		this._view = view;
      -		this._editor = editor;
      -		var parent = view.getOptions("parent"); //$NON-NLS-0$
      -		this._create(parent ? parent.ownerDocument : document);
      -	}
      -	/**
      -	 * Creates a new tooltip for the given text view.
      -	 * @param view {TextView} the text view the tooltip belongs to
      -	 * @param editor {Editor} the editor the tooltip belongs to, optional, allows quick fixes in tooltip to run on all annotations in the editor
      -	 */
      -	Tooltip.getTooltip = function(view, editor) {
      -		if (!view._tooltip) {
      -			 view._tooltip = new Tooltip(view, editor);
      -		}
      -		return view._tooltip;
      -	};
      -	Tooltip.prototype = /** @lends orion.editor.Tooltip.prototype */ {
      -		_create: function(document) {
      -			if (this._tooltipDiv) { return; }
      -			var tooltipDiv = this._tooltipDiv = util.createElement(document, "div"); //$NON-NLS-0$
      -			tooltipDiv.tabIndex = 0;
      -			tooltipDiv.className = "textviewTooltip"; //$NON-NLS-0$
      -			tooltipDiv.setAttribute("aria-live", "assertive"); //$NON-NLS-1$ //$NON-NLS-2$
      -			tooltipDiv.setAttribute("aria-atomic", "true"); //$NON-NLS-1$ //$NON-NLS-2$
      -			this._tooltipDiv.style.visibility = "hidden"; //$NON-NLS-0$
      -			this._tipShowing = false;
      -			document.body.appendChild(tooltipDiv);
      -			var self = this;
      -			textUtil.addEventListener(document, "mousedown", this._mouseDownHandler = function(event) {
      -				if (!self.isVisible()) { return; }
      -				if (textUtil.contains(tooltipDiv, event.target || event.srcElement)) { return; }
      -				if (!self._locked){
      -					self.hide();
      -				}
      -			}, true);
      -			textUtil.addEventListener(document, "scroll", this._scrollHandler = function(event) {
      -				if (!self.isVisible()){
      -					return;	
      -				} 
      -
      -				// Make sure the scroll isn't *inside* the tooltip...
      -				if (textUtil.contains(tooltipDiv, event.target || event.srcElement)) { return; }
      -
      -				if (self._topPixel !== self._view.getTopPixel() || self._leftPixel !== self._view.getHorizontalPixel()) {
      -					self.hide();
      -				}
      -			}, true);
      -			textUtil.addEventListener(document, "mousemove", this._mouseMoveHandler = function(event) {
      -				// Ignore spurious mousemove events
      -				if (self._prevX && self._prevX === event.clientX && self._prevY && self._prevY === event.clientY) {
      -					return;
      -				}
      -				self._prevX = event.clientX;
      -				self._prevY = event.clientY;
      -				
      -				if (!self.isVisible() || self._locked || self._hasFocus()) { return; }
      -				if (self._isInRect(self._outerArea, event.clientX, event.clientY)){ return; }
      -				self.hide();
      -			}, true);
      -			textUtil.addEventListener(tooltipDiv, "focus", /* @callback */ function(event) {
      -				if (!self._locked){
      -					self._tooltipDiv.classList.add('textViewTooltipOnFocus'); //$NON-NLS-0$
      -				}
      -			}, false);
      -			textUtil.addEventListener(tooltipDiv, "blur", /* @callback */ function(event) {
      -				self._tooltipDiv.classList.remove('textViewTooltipOnFocus'); //$NON-NLS-0$
      -			}, false);
      -			textUtil.addEventListener(tooltipDiv, "mouseenter", /* @callback */ function(event) {
      -				if (!self._locked){
      -					self._tooltipDiv.classList.add('textViewTooltipOnHover'); //$NON-NLS-0$
      -				}
      -			}, false);
      -			textUtil.addEventListener(tooltipDiv, "mouseleave", /* @callback */ function(event) {
      -				if (!self._hasFocus()){
      -					self._tooltipDiv.classList.remove('textViewTooltipOnHover'); //$NON-NLS-0$
      -				}
      -			}, false);
      -			textUtil.addEventListener(tooltipDiv, "keydown", function(event) {
      -				if (event.keyCode === 27) {
      -					if (!self._locked){
      -						self.hide();
      -					}
      -				}
      -			}, false);
      -			this._view.addEventListener("Destroy", function() {
      -				self.destroy();
      -			});
      -		},
      -		destroy: function() {
      -			if (!this._tooltipDiv) { return; }
      -			this.hide();
      -			var parent = this._tooltipDiv.parentNode;
      -			if (parent) { parent.removeChild(this._tooltipDiv); }
      -			var doc = this._tooltipDiv.ownerDocument;
      -			textUtil.removeEventListener(doc, "mousedown", this._mouseDownHandler, true);
      -			textUtil.removeEventListener(doc, "scroll", this._scrollHandler, true);
      -			textUtil.removeEventListener(doc, "mousemove", this._mouseMoveHandler, true);
      -			this._tooltipDiv = null;
      -		},
      -		
      -		/**
      -		 * @name show
      -		 * @description Show the tooltip using the given target information
      -		 * @function
      -		 * @param tooltipInfo a function that will return the tooltip contents (see _processInfo())
      -		 * @param target The target through which the info is obtained
      -		 * @param locked If true locks the tooltip (never hides unless 'hide' is called)
      -		 * @param giveFocus If true forces the focus onto the tooltip (used for F2 processing)
      -		 */
      -		show: function(tooltipInfo, locked, giveFocus) {
      -			this._locked = locked;
      -			this._giveFocus = giveFocus;
      -			this._topPixel = this._view.getTopPixel();
      -			this._leftPixel = this._view.getHorizontalPixel();
      -			this._processInfo(tooltipInfo.getTooltipInfo());
      -		},
      -		
      -		/**
      -		 * @name update
      -		 * @description Updates the information in an already visible tooltip
      -		 * @function
      -		 * @param tooltipInfo a function that will return the parameters need to update the information (see _processInfo())
      -		 * @param noContent If true makes no attempt to gather new info and just updates the tooltip's position
      -		 */
      -		update: function(tooltipInfo, noContent) {
      -			if (!tooltipInfo){
      -				return;
      -			}
      -			if (noContent) {
      -				this._showContents(null, tooltipInfo.getTooltipInfo(), true);
      -			} else {
      -				this._processInfo(tooltipInfo.getTooltipInfo(), true);
      -			}
      -		},
      -		
      -		/**
      -		 * @name onHover
      -		 * @description Checks the x,y location and updates the tooltip contents or hides the tooltip as appropriate
      -		 * @function
      -		 * @param tooltipInfo a function that will return the parameters need to update the information (see _processInfo())
      -		 * @param x coordinates of the mouse event
      -		 * @param y coordinates of the mouse event
      -		 */
      -		onHover: function(tooltipInfo, x, y) {
      -			if (!tooltipInfo) {
      -				return;
      -			}
      -			
      -			// Don't process if we're in the anchor or tooltip
      -			if (this._isInRect(this._anchorArea, x, y)
      -					|| this._isInRect(this._tooltipArea, x, y)
      -					|| this._locked
      -					|| this._hasFocus()) {
      -				return;
      -			}
      -			
      -			this._processInfo(tooltipInfo.getTooltipInfo());
      -		},		
      -	
      -		/**
      -		 * @name hide
      -		 * @description Hides the current tooltip (if it's showing)
      -		 * @function
      -		 * @public
      -		*/
      -		hide: function(clearLock) {
      -			if (clearLock) {
      -				this._locked = undefined;
      -			}
      -			
      -			if (this._locked || !this.isVisible()){
      -				return;
      -			}
      -				
      -			if (this.hover) {
      -				this.hover.clearQuickFixes();
      -			}
      -
      -			if (this._hasFocus()) {
      -				this._view.focus();
      -			}
      -			if (this._tooltipContents) {
      -				this._tooltipDiv.removeChild(this._tooltipContents);
      -				this._tooltipContents = null;
      -			}
      -			
      -			// Code projections are displayed using the editor theme colors
      -			this._tooltipDiv.classList.remove("textviewTooltipCodeProjection"); //$NON-NLS-0$
      -			this._tooltipDiv.classList.remove("textviewTooltipOnHover"); //$NON-NLS-0$
      -			this._tooltipDiv.classList.remove("textviewTooltipOnFocus"); //$NON-NLS-0$
      -			
      -			this._tooltipDiv.style.visibility = "hidden"; //$NON-NLS-0$
      -			this._tipShowing = false;
      -			this._tooltipDiv.style.left = "";
      -			this._tooltipDiv.style.right = "";
      -			this._tooltipDiv.style.top = "";
      -			this._tooltipDiv.style.bottom = "";
      -			this._tooltipDiv.style.width = "auto";		 //$NON-NLS-0$
      -			this._tooltipDiv.style.maxWidth = "";
      -			this._tooltipDiv.style.height = "auto";		 //$NON-NLS-0$	
      -			this._tooltipDiv.style.maxHeight = "";
      -			this._tooltipDiv.style.overflowX = "";
      -			this._tooltipDiv.style.overflowY = "";
      -			
      -			this._giveFocus = undefined;
      -			
      -			this._anchorArea = undefined;  // Area of text/ruler/etc. we are showing a tooltip for
      -			this._tooltipArea = undefined;  // The area the tooltip covers
      -			this._outerArea = undefined; // The rectangle encapsulating both anchor and tooltip areas where we want to keep the tooltip open
      -			
      -			// cancel any outstanding defers
      -			if (this._hoverPromises) {
      -				this._hoverPromises.forEach(function(info) {
      -					if (!info.resolved) {
      -						info.cancel();
      -					}
      -				});
      -			}
      -			this._hoverPromises = undefined;
      -			
      -			// values that are calculated
      -			this._tipRect = undefined;
      -		},
      -		
      -		/**
      -		 * @name isVisible
      -		 * @description Returns a boolean indicating whether the tooltip is currently visible
      -		 * @function
      -		 * @public
      -		 * @returns {boolean} 'true' iff the tooltip is currently visible
      -		*/
      -		isVisible: function() {
      -			return this._tipShowing;
      -		},
      -		
      -		/**
      -		 * @name _processInfo
      -		 * @description Renders the content, positions the tooltip then makes the tooltip visible
      -		 * @function
      -		 * @private
      -		 * @param info {Object} The info object passed by the caller
      -		 * 
      -		 * Info:
      -		 * 1) Contents
      -		 * 2) Context
      -		 * 3) Position string left, right, top, bottom
      -		 * 4) AnchorArea x, y, width, height
      -		 * 5) TooltipArea x, y, width, height
      -		 * 6) TooltipOffsetX
      -		 * 7) TooltipOffsetY
      -		 * 8) AllowFullWidth
      -		 * 
      -		 * @param update Whether to update the existing tooltip contents or open a new tooltip
      -		 */
      -		_processInfo: function(info, update) {
      -			if (!this._tooltipDiv){
      -				return;
      -			}
      -			
      -			var newTooltipContents;
      -			if (update && this._tooltipContents) {
      -				this._tooltipContents.innerHTML = "";
      -				newTooltipContents = this._tooltipContents;
      -			} else {
      - 				newTooltipContents = util.createElement(this._tooltipDiv.ownerDocument, "div"); //$NON-NLS-0$
      - 			}
      - 			
      -			if (info) {
      -				// Render provided content
      -				if (info.contents) {
      -					if (this._renderImmediateInfo(newTooltipContents, info.contents, info.context)) {
      -						this._showContents(newTooltipContents, info, update);
      -						return true;
      -					}
      -				}
      -				
      -				// If no immediate content, check if hover service plug-ins have content
      -				if (this.hover && info.context){
      -					this._hoverPromises = this.hover.computeHoverInfo(info.context);
      -					if (this._hoverPromises) {
      -						var self = this;
      -						var promises = this._hoverPromises.slice(0);
      -						promises.forEach(function(hoverPromise) {
      -							Deferred.when(hoverPromise, function (data) {
      -								// Remove this promise from the list so we don't try cancelling it while processing (see hide())
      -								if (self._hoverPromises){
      -									var index = self._hoverPromises.indexOf(hoverPromise);
      -									if (index >= 0){
      -										self._hoverPromises.splice(index, 1);
      -									}
      -								}
      -								if (data) {
      -									if (self._renderPluginContent(newTooltipContents, data)) {
      -										if (data.offsetStart){
      -											info.context.offsetStart = data.offsetStart;
      -										}
      -										if (data.offsetEnd){
      -											info.context.offsetEnd = data.offsetEnd;
      -										}
      -										if (data.allowFullWidth){
      -											info.allowFullWidth = data.allowFullWidth;
      -										}
      -										self._showContents(newTooltipContents, info, update);
      -									}
      -								}
      -							}, function(error) {
      -								if (console && error && error.name !== 'Cancel') {
      -									console.log("Error computing hover tooltip"); //$NON-NLS-0$
      -									console.log(error && error.stack);
      -								}
      -							});
      -						});
      -						return true;
      -					}
      -				}
      -			}
      -		},
      -		/**
      -		 * @name _showContents
      -		 * @description Takes the rendered contents, positions the tooltip, opens the tooltip
      -		 * @function
      -		 * @private
      -		 * @param newContentsDiv
      -		 * @param info
      -		 * @param update
      -		 */
      -		_showContents: function _showContents(newContentsDiv, info, update) {
      -			if (!update){
      -				this.hide();
      -			} else {
      -				// If update is called but the set tooltip area is different, recreate the tooltip with the new sizing (ex: content assist resizing)
      -				// We could also check if the set anchor area is different, but no one would be using it
      -				if (this._tooltipArea && info.tooltipArea){
      -					if (this._tooltipArea.left !== info.tooltipArea.left || this._tooltipArea.top !== info.tooltipArea.top || this._tooltipArea.width !== info.tooltipArea.width || this._tooltipArea.height !== info.tooltipArea.height){
      -						this._anchorArea = null;
      -						this._tooltipArea = null;
      -						this._outerArea = null;
      -					}
      -				}
      -			}
      -			
      -			if (newContentsDiv) {
      -				if (this._tooltipContents) {
      -					this._tooltipDiv.removeChild(this._tooltipContents);
      -				}
      -				this._tooltipContents = newContentsDiv;
      -				this._tooltipDiv.appendChild(newContentsDiv);				
      -			}
      -			
      -			if (!this._anchorArea){
      -				this._anchorArea = this._computeAnchorArea(info);
      -			}
      -			if (!this._tooltipArea){
      -				// This function performs two tasks, computing the rectangle and setting all the style properties
      -				this._tooltipArea = this._computeTooltipArea(info, this._anchorArea, this._tooltipDiv);
      -			}
      -			if (!this._outerArea){
      -				this._outerArea = this._computeOuterArea(this._anchorArea, this._tooltipArea);
      -			}
      -
      -			this._tooltipDiv.style.visibility = "visible"; //$NON-NLS-0$
      -			this._tipShowing = true;
      -			
      -			if (this._giveFocus) {
      -				this._setInitialFocus(this._tooltipDiv);
      -				this._giveFocus = undefined;
      -			}
      -		},
      -		
      -		/**
      -		 * @name _computeAnchorArea
      -		 * @description Computes and returns the rectangle that the tooltip is anchored to.  For example the anchor for an annotation 
      -		 * 				may be its text range.
      -		 * @function
      -		 * @private
      -		 * @param info {Object} the info object passed by the caller.
      -		 * @returns returns the computed rectangle anchor area
      -		 */
      -		_computeAnchorArea: function _computeAnchorArea(info){
      -			if (info.anchorArea){
      -				if (info.anchorArea.top && info.anchorArea.left && info.anchorArea.height && info.anchorArea.width){
      -					return info.anchorArea;
      -				}
      -			}
      -			
      -			if (info.context){
      -				if (info.context.offsetStart && info.context.offsetEnd){
      -					// The full text content of the editor is given to the plug-in hover service, so we must adjust the offsets
      -					// for the projection model as folded comments will change the offsets/coordinates in the displayed editor
      -					var mappedStart = this.mapOffset(info.context.offsetStart, false);
      -					var mappedEnd = this.mapOffset(info.context.offsetEnd, false);
      -					return this._computeRectangleFromOffset(mappedStart, mappedEnd);
      -				}
      -				
      -				if (info.context.offset >= 0){
      -					// The provided offset is based on the full text content, not the projection model
      -					// Adjust the offset before finding the closest enclosing word
      -					var mappedOffset = this.mapOffset(info.context.offset, false);
      -					var end = this._view.getNextOffset(mappedOffset, { unit: "wordend", count: 0}); //$NON-NLS-0$
      -					var start = this._view.getNextOffset(end, { unit: "word", count: -1}); //$NON-NLS-0$
      -					return this._computeRectangleFromOffset(start, end);
      -				}
      -			}
      -			
      -			return {top: 0, left: 0, height: 0, width: 0};
      -		},
      -		
      -		/**
      -		 * @name _computeTooltipPosition
      -		 * @description Defines the tooltip area and placement.  Returns the rectangle defining the tooltip area and sets the tooltipDiv
      -		 * 				style to match the rectangles values.
      -		 * @param info the tooltip info object passed by the caller
      -		 * @param anchorArea the computed tooltip anchor area to which the tooltip will be positioned
      -		 * @param tooltipDiv the div for the tooltip, this function will modify its style to match the computed position/size
      -		 * @returns returns the computed tooltip area rectangle
      -		 * @function
      -		 * @private
      -		 */
      -		_computeTooltipArea: function _computeTooltipArea(info, anchorArea, tooltipDiv){
      -			var documentElement = tooltipDiv.ownerDocument.documentElement;
      -			
      -			// TODO This padding must match what is in tooltip.css
      -			var padding = 16;
      -			
      -			// Callers can specify the exact placement of the tooltip
      -			if (info.tooltipArea && info.tooltipArea.top && info.tooltipArea.left && info.tooltipArea.height && info.tooltipArea.width){										 
      -				tooltipDiv.style.overflowY = "auto"; //$NON-NLS-0$ // If caller specifies a height, allow scrolling
      -				tooltipDiv.style.resize = "none"; //$NON-NLS-0$
      -				tooltipDiv.style.top = (info.tooltipArea.top) + "px"; //$NON-NLS-0$
      -				tooltipDiv.style.left = (info.tooltipArea.left) + "px"; //$NON-NLS-0$
      -				tooltipDiv.style.height = (info.tooltipArea.height - padding) + "px"; //$NON-NLS-0$
      -				tooltipDiv.style.width = (info.tooltipArea.width - padding) + "px"; //$NON-NLS-0$
      -				return info.tooltipArea;
      -			}
      -			
      -			var divBounds = tooltipDiv.getBoundingClientRect();
      -			var tipRect = {
      -				width: divBounds.width,
      -				height: divBounds.height
      -			};
      -			
      -			// If there is an unloaded image its width will not be included in the calculated size, add some buffer space so tooltip doesn't wrap (See bug 478357)
      -			var image = tooltipDiv.getElementsByTagName('img')[0]; //$NON-NLS-1$
      -			if (image && !image.complete && image.width === 0){
      -				tipRect.width += 30;
      -			}
      -			
      -			var position = info.position ? info.position : "below"; //$NON-NLS-0$
      -			
      -			var viewBounds = (this._view._rootDiv ? this._view._rootDiv : documentElement).getBoundingClientRect();
      -			var viewportLeft = viewBounds.left;
      -			var viewportTop = viewBounds.top;
      -			var viewportWidth = viewBounds.width;
      -			var viewportHeight = viewBounds.height;
      -			
      -			// Set a default size for the tooltip
      -			var defWidth = viewportWidth;
      -			var defHeight = viewportHeight;
      -			if (!info.allowFullWidth){
      -				defWidth = Math.min(viewportWidth/2, 600);
      -				defHeight = Math.min(viewportHeight/2, 400);
      -				tipRect.width = Math.min(tipRect.width, defWidth);
      -				tipRect.height = Math.min(tipRect.height, defHeight);
      -			} else if (tipRect.width > viewportWidth){
      -				tipRect.width = viewportWidth;
      -			}
      -			
      -			// Now that we have our width recalculate the desired height...
      -			tooltipDiv.style.width = (tipRect.width - padding) + "px"; //$NON-NLS-1$
      -			tipRect.height = Math.min(tooltipDiv.getBoundingClientRect().height, defHeight);
      -			
      -			// Hack for single line tooltips that wrap, set a minimum height to make them show 2 lines without scrolling
      -			// The largest line height was MacOS Chrome with 20px+padding.  So 25 is the minimum height we are sure we are one two lines
      -			// Similarly, the minimum height for the tooltip is two lines (20px x 2 + padding) (this will actually show three lines on Win7 Chrome)
      -			if ((25+padding) > tipRect.height && tipRect.width > (defWidth-padding)){
      -				tipRect.height = 40+padding;
      -			}
      -
      -			var spaceBelow = viewportHeight - (anchorArea.top + anchorArea.height - viewportTop);
      -			var spaceAbove = anchorArea.top - viewportTop;
      -			var spaceRight = viewportWidth - (anchorArea.left + anchorArea.width - viewportLeft);
      -			
      -			// If there is not enough space above or below, swap the position.  Can't do the same for right/left because rulers are at client bounds
      -			if (position === "above" && tipRect.height > spaceAbove && tipRect.height <= spaceBelow){
      -				position = "below"; //$NON-NLS-0$
      -			} else if (position === "below" && tipRect.height > spaceBelow && tipRect.height <= spaceAbove){
      -				position = "above"; //$NON-NLS-0$
      -			}
      -			
      -			var offsetX = info.tooltipOffsetX ? info.tooltipOffsetX : 0;
      -			var offsetY = info.tooltipOffsetY ? info.tooltipOffsetY : 0;
      -			
      -			// Attempt to line up tooltip with the anchor area
      -			// If not enough space, shift the tooltip horiz (above/below) or vert (left/right) until it fits
      -			// Force the tooltip to start within the viewport area
      -			// Set maximum sizes for remaining area in the viewport area
      -			switch (position){
      -				case "left":
      -					if ((tipRect.height + offsetY) > (spaceBelow + anchorArea.height)){
      -						// Shift the top of the tooltip upwards to fit, ignore the offset value
      -						tipRect.top = viewportHeight + viewportTop - tipRect.height;
      -					} else {
      -						tipRect.top = anchorArea.top + offsetY;
      -					}
      -					tipRect.top = Math.max(tipRect.top, viewportTop);
      -					tipRect.left = Math.max(anchorArea.left - tipRect.width + offsetX, viewportLeft);
      -				break;
      -				case "right":
      -					if ((tipRect.height + offsetY) > (spaceBelow + anchorArea.height)){
      -						// Shift the top of the tooltip upwards to fit, ignore the offset value
      -						tipRect.top = viewportHeight + viewportTop - tipRect.height;
      -					} else {
      -						tipRect.top = anchorArea.top + offsetY;
      -					}
      -					tipRect.top = Math.max(tipRect.top, viewportTop);
      -					tipRect.left = Math.max(anchorArea.left + anchorArea.width + offsetX, viewportLeft);
      -				break;
      -				case "above":
      -					if ((tipRect.width + offsetX) > (spaceRight + anchorArea.width)){
      -						// Shift the left side of the tooltip to the left, ignore the offset value
      -						tipRect.left = viewportWidth + viewportLeft - tipRect.width;
      -					} else {
      -						tipRect.left = anchorArea.left + offsetX;
      -					}
      -					tipRect.left = Math.max(tipRect.left, viewportLeft);
      -					tipRect.top = Math.max(anchorArea.top - tipRect.height + offsetY, viewportTop);
      -				break;
      -				case "below":
      -					if ((tipRect.width + offsetX) > (spaceRight + anchorArea.width)){
      -						// Shift the left side of the tooltip to the left, ignore the offset value
      -						tipRect.left = viewportWidth + viewportLeft - tipRect.width;
      -					} else {
      -						tipRect.left = anchorArea.left + offsetX;
      -					}
      -					tipRect.left = Math.max(tipRect.left, viewportLeft);
      -					tipRect.top = Math.max(anchorArea.top + anchorArea.height + offsetY, viewportTop);
      -				break;
      -			}
      -			
      -			tipRect.maxWidth = Math.min(viewportWidth + viewportLeft - tipRect.left, viewportWidth);
      -			tipRect.maxHeight = Math.min(viewportHeight + viewportTop - tipRect.top, viewportHeight);
      -			
      -			// Adjust sizes for div padding, but not the actual tooltip box.
      -			tooltipDiv.style.maxWidth = (tipRect.maxWidth - padding) + "px"; //$NON-NLS-0$
      -			tooltipDiv.style.maxHeight = (tipRect.maxHeight - padding) + "px"; //$NON-NLS-0$
      -			tooltipDiv.style.width = (tipRect.width - padding) + "px"; //$NON-NLS-1$
      -			tooltipDiv.style.height = (tipRect.height - padding) + "px"; //$NON-NLS-1$
      -			tooltipDiv.style.left = tipRect.left + "px"; //$NON-NLS-0$
      -			tooltipDiv.style.top = tipRect.top + "px"; //$NON-NLS-0$
      -			return tipRect;
      -		},
      -		
      -		_computeOuterArea: function _computeOuterArea(anchorArea, tooltipArea){
      -			var left = Math.min(anchorArea.left, tooltipArea.left);
      -			var top = Math.min(anchorArea.top, tooltipArea.top);
      -			var positionRight = anchorArea.left + anchorArea.width;
      -			var tipRight = tooltipArea.left + tooltipArea.width;
      -			var right = Math.max(positionRight, tipRight);
      -			var positionBottom = anchorArea.top + anchorArea.height;
      -			var tipBottom = tooltipArea.top + tooltipArea.height;
      -			var bottom = Math.max(positionBottom, tipBottom);
      -				
      -			return {
      -					left: left,
      -					top : top,
      -					width: right - left,
      -					height: bottom - top
      -				};
      -		},
      -		
      -		/*
      -		 ******************************************************************************************************************* 
      -		 * Utility: This section contains various utility methods
      -		 ******************************************************************************************************************* 
      -		 */
      -		_hasFocus: function() {
      -			var tooltipDiv = this._tooltipDiv;
      -			if (!tooltipDiv) { return false; }
      -			return textUtil.contains(tooltipDiv, tooltipDiv.ownerDocument.activeElement);
      -		},
      -		_isNode: function (obj) {
      -			return typeof Node === "object" ? obj instanceof Node : //$NON-NLS-0$
      -				obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
      -		},
      -		_setInitialFocus: function(tooltipDiv) {
      -			// Any buttons ?
      -			var button = lib.$("button", tooltipDiv); //$NON-NLS-0$
      -			if (button) {
      -				button.focus();
      -				return;
      -			}
      -			// Any links ?
      -			var link = lib.$("a", tooltipDiv); //$NON-NLS-0$
      -			if (link) {
      -				link.focus();
      -				var self = this;
      -				link.addEventListener("click", function() { //$NON-NLS-0$
      -					self.hide();
      -				});
      -				return;
      -			}
      -			// Give up and focus on the first tabbable
      -			var toFocus = lib.firstTabbable(tooltipDiv);
      -			if (toFocus) {
      -				toFocus.focus();
      -			}
      -		},
      -		_isInRect: function(rect, x, y) {
      -			if (!rect){
      -				return false;
      -			}
      -			var xOK = x >= rect.left && x <= (rect.left + rect.width);
      -			var yOK = y >= rect.top && y <= (rect.top + rect.height);
      -			return xOK && yOK;
      -		},
      -		mapOffset: function(offset) {
      -			var textView = this._view;
      -			var model = textView.getModel();
      -			if (model.getBaseModel) {
      -				offset = model.mapOffset(offset, true);
      -			}
      -			return offset;
      -		},
      -		/**
      -		 * Note that the offsets passed here must already be mapped to the base model being displayed (i.e. reduced by collapsed comments)
      -		 */
      -		_computeRectangleFromOffset: function(start, end) {
      -			var tv = this._view;
      -			var curLine = tv.getLineAtOffset(start);
      -			var endLine = tv.getLineAtOffset(end);
      -			
      -			var height, viewRect;
      -			
      -			if (curLine !== endLine) {
      -				var y = tv.getLocationAtOffset(start).y;
      -				height = 0;
      -				var maxX = 0;
      -				while (curLine <= endLine){
      -					height += tv.getLineHeight(curLine);
      -					var lineEnd = tv.getModel().getLineEnd(curLine);
      -					var possibleEnd = tv.getLocationAtOffset(lineEnd).x;
      -					if (possibleEnd > end){
      -						maxX = possibleEnd;
      -					}
      -					curLine++;
      -				}
      -				var lineStart = tv.getModel().getLineStart(endLine);
      -				var x = tv.getLocationAtOffset(lineStart).x;
      -				
      -				viewRect = { x: x, y: y, width: maxX - x, height: height};
      -				
      -			} else {
      -				var startPos = tv.getLocationAtOffset(start);
      -				var endPos = tv.getLocationAtOffset(end);
      -				height = tv.getLineHeight(curLine);
      -				viewRect = { x: startPos.x, y: startPos.y, 
      -							width: endPos.x - startPos.x, height: height};
      -			}
      -								
      -			viewRect = this._view.convert(viewRect, "document", "page"); //$NON-NLS-1$ //$NON-NLS-2$
      -			return {left: viewRect.x, top: viewRect.y, width: viewRect.width, height: viewRect.height};
      -		},
      -		/*
      -		 ******************************************************************************************************************* 
      -		 * Rendering: This section deals with rendering supplied data into HTML for inclusion into the Info Popup.
      -		 ******************************************************************************************************************* 
      -		 */
      -		_renderPluginContent: function(contentsDiv, data) {
      -			var document = this._tooltipDiv.ownerDocument;
      -			// data object should be an object containing the type and content.  If no type or unknown type, default to string.
      -			if (typeof data !== 'string' && typeof data.content === 'undefined') { //$NON-NLS-0$ //$NON-NLS-1$
      -			    return false;
      -			}
      -			
      -			var sectionDiv = util.createElement(document, "div"); //$NON-NLS-0$;
      -			// render the title, if any
      -			if (data.title) {
      -				var titleDiv = util.createElement(document, "div"); //$NON-NLS-0$;
      -				if (this.hover.renderMarkDown) {
      -					titleDiv.innerHTML = this.hover.renderMarkDown(data.title);
      -				} else {
      -					titleDiv.textContent = data.title;
      -				}
      -				titleDiv.classList.add("hoverTooltipTitle"); //$NON-NLS-0$
      -				sectionDiv.appendChild(titleDiv);
      -			}
      -			var contentDiv = util.createElement(document, "div"); //$NON-NLS-0$
      -			
      -			if (typeof data === 'string'){ //$NON-NLS-0$
      -				contentDiv.appendChild(document.createTextNode(data));
      -			} else {
      -				switch(data.type) { //$NON-NLS-0$
      -					case 'delegatedUI': { //$NON-NLS-0$
      -						// The delegated UI is not included in the 8.0 release, see Bug 449240.
      -					}
      -					case 'html': { //$NON-NLS-0$
      -						if (data.content){
      -							var iframe = document.createElement("iframe"); //$NON-NLS-0$
      -							iframe.id = 'HtmlHover'; //$NON-NLS-0$
      -							iframe.name = 'HTML Hover'; //$NON-NLS-0$
      -							iframe.type = "text/html"; //$NON-NLS-0$
      -							iframe.sandbox = "allow-scripts allow-same-origin allow-forms"; //$NON-NLS-0$
      -							iframe.style.border = "none"; //$NON-NLS-0$
      -							iframe.style.width = "100%"; //$NON-NLS-0$
      -							iframe.style.height = "100%"; //$NON-NLS-0$
      -							// TODO The iframe computed height is always 3px smaller than the tooltip, giving the impression of inconsistent padding
      -							this._tooltipDiv.style.paddingBottom = "5px";  //$NON-NLS-0$
      -							iframe.srcdoc = data.content;
      -							if (data.width) {
      -								iframe.style.width = data.width;
      -							}
      -							if (data.height) {
      -								iframe.style.height = data.height;
      -							}
      -							sectionDiv.style.height = '100%';  //$NON-NLS-0$ // Height should grow on resize
      -							contentsDiv.style.height = '100%';  //$NON-NLS-0$
      -							sectionDiv.appendChild(iframe);
      -						}
      -						break;
      -					}
      -					case 'markdown': { //$NON-NLS-0$
      -						if (this.hover.renderMarkDown) {
      -							contentDiv.innerHTML = this.hover.renderMarkDown(data.content);
      -						}
      -						break;
      -					}
      -					default: {
      -						contentDiv.appendChild(document.createTextNode(data.content));
      -					}
      -				}
      -			}
      -			sectionDiv.appendChild(contentDiv);
      -			contentsDiv.appendChild(sectionDiv);
      -			return true;
      -		},
      -		/*
      -		 * Empty or empty array = call hover service for dynamic content
      -		 * Array = annotations
      -		 * String = HTML text
      -		 * Node = HTML node
      -		 * ProjectionTextModel = code projection
      -		 */
      -		_renderImmediateInfo: function _renderImmediateInfo(contentsDiv, contents, context) {						
      -			// If it's an annotation then process the annotation(s) to get the actual data
      -			if (contents instanceof Array) {
      -				contents = this._getAnnotationContents(contents, context);			
      -				if (!contents) {
      -					return false;
      -				}
      -			}
      -			
      -			if (typeof contents === "string") { //$NON-NLS-0$
      -				contentsDiv.textContent = contents;
      -				return true;
      -			} else if (this._isNode(contents)) {
      -				contentsDiv.appendChild(contents);
      -				return true;
      -			} else if (contents instanceof mProjectionTextModel.ProjectionTextModel) {
      -				var view = this._view;
      -				var options = view.getOptions();
      -				options.wrapMode = false;
      -				options.parent = contentsDiv;
      -				var tooltipTheme = "tooltipTheme"; //$NON-NLS-0$
      -				var theme = options.themeClass;
      -				if (theme) {
      -					theme = theme.replace(tooltipTheme, "");
      -					if (theme) { theme = " " + theme; } //$NON-NLS-0$
      -					theme = tooltipTheme + theme;
      -				} else {
      -					theme = tooltipTheme;
      -				}
      -				options.themeClass = theme;
      -				var contentsView = this._contentsView = new mTextView.TextView(options);
      -				//TODO need to find a better way of sharing the styler for multiple views
      -				var listener = {
      -					onLineStyle: function(e) {
      -						view.onLineStyle(e);
      -					}
      -				};
      -				contentsView.addEventListener("LineStyle", listener.onLineStyle); //$NON-NLS-0$
      -				contentsView.setModel(contents);
      -				
      -				// TODO This is a hack to compute the projection size we will have in the tooltip, we remove the child after computing
      -				this._tooltipDiv.appendChild(contentsDiv);
      -				// Use the editor colors with a simple border
      -				this._tooltipDiv.classList.add("textviewTooltipCodeProjection"); //$NON-NLS-0$
      -				var size = contentsView.computeSize();
      -				// Adjust the size for the padding
      -				contentsDiv.style.width = (size.width+8) + "px"; //$NON-NLS-0$
      -				contentsDiv.style.height = (size.height+8) + "px"; //$NON-NLS-0$
      -				contentsView.resize();
      -				this._tooltipDiv.removeChild(contentsDiv);
      -				return true;
      -			}
      -			return false;
      -		},
      -		
      -		/**
      -		 * @name _getAnnotationContents
      -		 * @description Takes a list of annotation and renders them in the tooltip
      -		 * @function
      -		 * @private
      -		 * @param annotations the list of annotations to render
      -		 * @param context optional object containing where the annotations are displayed (ruler, editor, etc.)
      -		 * @returns returns document node containing rendered tooltip content
      -		 */
      -		_getAnnotationContents: function(annotations, context) {
      -			var self = this;
      -			var inEditor = self.hover ? true : false;
      -			if (inEditor && context && context.source && context.source.indexOf('ruler') >= 0 && annotations.length > 1){ //$NON-NLS-0$
      -				inEditor = false;
      -			}
      -			
      -			var annotation;
      -			var newAnnotations = [];
      -			for (var j = 0; j < annotations.length; j++) {
      -				annotation = annotations[j];
      -				if (annotation.title !== "" && !annotation.groupAnnotation) {
      -					// Don't display untitled annotations in the editor such as occurrences as the code is already visible
      -					if (!inEditor || annotation.title || annotation.type === "orion.annotation.folding"){
      -						newAnnotations.push(annotation); 
      -					}
      -				}
      -			}
      -			annotations = newAnnotations;
      -			if (annotations.length === 0) {
      -				return null;
      -			}
      -			
      -			
      -			var html;
      -			var document = this._tooltipDiv.ownerDocument;
      -			var view = this._view;
      -			var model = view.getModel();
      -			var baseModel = model.getBaseModel ? model.getBaseModel() : model;
      -			
      -			// If this is a code folding annotation, display code projection
      -			if (annotations.length === 1 && annotations[0].type === "orion.annotation.folding") {
      -				var newModel = new mProjectionTextModel.ProjectionTextModel(baseModel);
      -				var lineStart = baseModel.getLineStart(baseModel.getLineAtOffset(annotations[0].start));
      -				var charCount = baseModel.getCharCount();
      -				if (annotations[0].end !== charCount) {
      -					newModel.addProjection({start: annotations[0].end, end: charCount});
      -				}
      -				if (lineStart > 0) {
      -					newModel.addProjection({start: 0, end: lineStart});
      -				}
      -				return newModel;
      -			}
      -			
      -			var allAnnotations;
      -			if (annotations.length > 0 && this._editor){
      -				allAnnotations = this._editor.getAnnotationModel().getAnnotations();
      -			}
      -			if (annotations.length === 1) {
      -				html = getAnnotationHTML(annotations[0], allAnnotations, inEditor);
      -				if (html && html.firstChild) {
      -					var className = html.firstChild.className;
      -					if (className) { className += " "; } //$NON-NLS-0$
      -					className += "single"; //$NON-NLS-0$
      -					html.firstChild.className = className;
      -				}
      -				return html;
      -			} else {
      -				var tooltipHTML = util.createElement(document, "div"); //$NON-NLS-0$
      -				var em = util.createElement(document, "multi_anno"); //$NON-NLS-0$
      -				em.appendChild(document.createTextNode(messages.multipleAnnotations));
      -				tooltipHTML.appendChild(em);
      -				for (var i = 0; i < annotations.length; i++) {
      -					html = getAnnotationHTML(annotations[i], allAnnotations, inEditor);
      -					if (html) {
      -						tooltipHTML.appendChild(html);
      -					}
      -				}
      -				return tooltipHTML;
      -			}
      -			
      -			function getAnnotationHTML(annotation, allAnnotations, inEditor) {
      -				var title = annotation.title;
      -				var result = util.createElement(document, "div"); //$NON-NLS-0$
      -				result.className = "tooltipRow"; //$NON-NLS-0$
      -				if (annotation.html) {
      -					var htmlHolder = util.createElement(document, "div"); //$NON-NLS-0$
      -					htmlHolder.className = "tooltipImage"; //$NON-NLS-0$
      -					htmlHolder.innerHTML = annotation.html;
      -					if (htmlHolder.lastChild) {
      -						textUtil.addEventListener(htmlHolder.lastChild, "click", function() { //$NON-NLS-0$
      -							var start = annotation.start, end = annotation.end;
      -							if (model.getBaseModel) {
      -								start = model.mapOffset(start, true);
      -								end = model.mapOffset(end, true);
      -							}
      -							view.setSelection(start, end, 1 / 3, function() { self.hide(); });
      -						}, false);
      -					}
      -					result.appendChild(htmlHolder); //$NON-NLS-0$
      -				}
      -				if (!title) {
      -					var textStart = baseModel.getLineStart(baseModel.getLineAtOffset(annotation.start));
      -					var textEnd = baseModel.getLineEnd(baseModel.getLineAtOffset(annotation.end), true);
      -					title = baseModel.getText(textStart, textEnd);
      -				}
      -				if (typeof title === "function") { //$NON-NLS-0$
      -					title = annotation.title();
      -				}
      -				if (typeof title === "string") { //$NON-NLS-0$
      -					var span = util.createElement(document, "span"); //$NON-NLS-0$
      -					span.className = "tooltipTitle"; //$NON-NLS-0$
      -					span.appendChild(document.createTextNode(title));
      -					title = span;
      -				}
      -				result.appendChild(title);
      -				
      -				// Handle quick fixes
      -				if (inEditor) {
      -					self.hover.renderQuickFixes(annotation, allAnnotations, result);
      -				}
      -				if (context){	
      -					// Set the hover area to the annotation if it's not already set
      -					context.offsetStart = annotation.start;
      -					context.offsetEnd = annotation.end;
      -				}
      -				return result;
      -			}
      -		}
      -		
      -	};
      -	return {Tooltip: Tooltip};
      -});
      -
      -/*******************************************************************************
      - * @license
      - * Copyright (c) 2009, 2015 IBM Corporation and others.
      - * All rights reserved. This program and the accompanying materials are made
      - * available under the terms of the Eclipse Public License v1.0
      - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
      - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
      - *
      - * Contributors: IBM Corporation - initial API and implementation
      - ******************************************************************************/
      -
      -/*eslint-env browser, amd*/
      -define("orion/editor/editor", [ //$NON-NLS-0$
      -	'i18n!orion/editor/nls/messages', //$NON-NLS-0$
      -	'orion/editor/eventTarget', //$NON-NLS-0$
      -	'orion/editor/tooltip', //$NON-NLS-0$
      -	'orion/editor/annotations', //$NON-NLS-0$
      -	'orion/objects', //$NON-NLS-0$
      -	'orion/util' //$NON-NLS-0$
      -], function(messages, mEventTarget, mTooltip, mAnnotations, objects, util) {
      -	
      -	var AT = mAnnotations.AnnotationType;
      -
      -	var HIGHLIGHT_ERROR_ANNOTATION = "orion.annotation.highlightError"; //$NON-NLS-0$
      -
      -	/**
      -	 * @name orion.editor.BaseEditor
      -	 * @class This is the base interface for text and visual editors based on a text buffer.
      -	 *
      -	 * @description Creates a new Base Editor with the given options.
      -	 * @param {Object} options Creation options for this editor.
      -	 * @param {Object} options.domNode
      -	 * @param {Object} options.statusReporter
      -	 *
      -	 * @borrows orion.editor.EventTarget#addEventListener as #addEventListener
      -	 * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener
      -	 * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent
      -	 */
      -	function BaseEditor(options) {
      -		options = options || {};
      -		this._domNode = options.domNode;
      -		this._model = options.model;
      -		this._undoStack = options.undoStack;
      -		this._statusReporter = options.statusReporter;
      -		this._title = null;
      -		var that = this;
      -		this._listener = {
      -			onChanged: function(e) {
      -				that.onChanged(e);
      -			}
      -		};
      -		if (this._model) {
      -			this._model.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$
      -		}
      -		this.checkDirty();
      -	}
      -	BaseEditor.prototype = /** @lends orion.editor.BaseEditor.prototype */ {
      -		/**
      -		 * Destroys the editor. Uninstall the editor view.
      -		 */
      -		destroy: function() {
      -			this.uninstall();
      -			this._statusReporter = this._domNode = null;
      -			if (this._model) {
      -				this._model.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$
      -			}
      -		},
      -
      -		/** @private */
      -		checkDirty : function() {
      -			this.setDirty(this._undoStack && !this._undoStack.isClean());
      -		},
      -		/**
      -		 * Focus the the editor view. The default implementation does nothing.
      -		 */
      -		focus: function() {
      -		},
      -		/**
      -		 * Returns the text model of the editor.
      -		 *
      -		 * @returns {orion.editor.TextModel} the text model of the view.
      -		 */
      -		getModel: function() {
      -			return this._model;
      -		},
      -		/**
      -		 * Returns the text for the given range.
      -		 * 

      - * The text does not include the character at the end offset. - *

      - * - * @param {Number} [start=0] the start offset of text range. - * @param {Number} [end=char count] the end offset of text range. - * - * @see orion.editor.TextView#setText - */ - getText: function(start, end) { - return this.getModel().getText(start, end); - }, - /** - * Returns the editor title. - * - * @returns {String} the editor title. - */ - getTitle: function() { - return this._title; - }, - /** - * Returns the editor undo stack. - * - * @returns {orion.editor.UndoStack} the editor undo stack. - */ - getUndoStack: function() { - return this._undoStack; - }, - /** - * Creates the DOM hierarchy of the editor and add it to the document. - */ - install: function() { - this.installed = true; - }, - /** - * Returns true if the editor is dirty; false otherwise. - * @returns {Boolean} whether the editor is dirty - */ - isDirty: function() { - if (this._undoStack) return !this._undoStack.isClean(); - return this._dirty; - }, - /** - * Marks the current state of the editor as clean. Meaning there are no unsaved modifications. - */ - markClean: function() { - this.getUndoStack().markClean(); - this.setDirty(false); - }, - /** - * Called when the dirty state of the editor changes. - * @param {Event} dirtyChangedEvent - */ - onDirtyChanged: function(dirtyChangedEvent) { - return this.dispatchEvent(dirtyChangedEvent); - }, - /** - * Called when the editor's contents have been changed or saved. - * @param {Event} inputChangedEvent - */ - onInputChanged: function (inputChangedEvent) { - return this.dispatchEvent(inputChangedEvent); - }, - /** - * Called when the editor's text model has been changed. - * @param {Event} inputChangedEvent - * @callback - */ - onChanged: function (modelChangedEvent) { - this.checkDirty(); - }, - /** - * Report the message to the user. - * - * @param {String} message the message to show - * @param {String} [type] the message type. Either normal or "progress" or "error"; - * @param {Boolean} [isAccessible] If true, a screen reader will read this message. - * Otherwise defaults to the domNode default. - */ - reportStatus: function(message, type, isAccessible) { - if (this._statusReporter) { - this._statusReporter(message, type, isAccessible); - } - }, - /** - * Resizes the editor view. The default implementation does nothing. - */ - resize: function() { - }, - /** - * Sets whether the editor is dirty. - * - * @param {Boolean} dirty - */ - setDirty: function(dirty) { - if (this._dirty === dirty) { return; } - this._dirty = dirty; - this.onDirtyChanged({type: "DirtyChanged"}); //$NON-NLS-0$ - }, - /** - * @private - */ - _setModelText: function(contents) { - if (this._model) { - this._model.setText(contents); - } - }, - /** - * Sets the editor's contents. - * - * @param {String} title the editor title - * @param {String} message an error message - * @param {String} contents the editor contents - * @param {Boolean} contentsSaved whether the editor contents was saved. - */ - setInput: function(title, message, contents, contentsSaved) { - this._title = title; - if (!contentsSaved) { - if (message) { - this.reportStatus(message, "error"); //$NON-NLS-0$ - } else { - if (contents !== null && contents !== undefined) { - if (typeof contents === "string") { //$NON-NLS-0$ - this._setModelText(contents); - } - if (this._undoStack) { - this._undoStack.reset(); - } - } - } - } - this.checkDirty(); - this.onInputChanged({ - type: "InputChanged", //$NON-NLS-0$ - title: title, - message: message, - contents: contents, - contentsSaved: contentsSaved - }); - }, - /** - * Replaces the text in the given range with the given text. - *

      - * The character at the end offset is not replaced. - *

      - * - * @param {String} text the new text. - * @param {Number} [start=0] the start offset of text range. - * @param {Number} [end=char count] the end offset of text range. - */ - setText: function(text, start, end) { - this.getModel().setText(text, start, end); - }, - /** - * Removes the DOM hierarchy of the editor from the document. - */ - uninstall: function() { - this.installed = false; - } - }; - mEventTarget.EventTarget.addMixin(BaseEditor.prototype); - - /** - * @name orion.editor.Editor - * @augments orion.editor.BaseEditor - * @class An Editor is a user interface for editing text that provides additional features over the basic {@link orion.editor.TextView}. - * Some of Editor's features include: - *
        - *
      • Additional actions and key bindings for editing text
      • - *
      • Content assist
      • - *
      • Find and Incremental Find
      • - *
      • Rulers for displaying line numbers and annotations
      • - *
      • Status reporting
      • - *
      - * - * @description Creates a new Editor with the given options. - * @param {Object} options Options controlling the features of this Editor. - * @param {Object} options.annotationFactory - * @param {Object} options.contentAssistFactory - * @param {Object} options.domNode - * @param {Object} options.keyBindingFactory - * @param {Object} options.lineNumberRulerFactory - * @param {Object} options.zoomRulerFactory - * @param {Object} options.foldingRulerFactory - * @param {Object} options.statusReporter - * @param {Object} options.textViewFactory - * @param {Object} options.undoStackFactory - * @param {Object} options.textDNDFactory - * @param {Object} options.hoverFactory - */ - function Editor(options) { - options = options || {}; - BaseEditor.call(this, options); - this._textViewFactory = options.textViewFactory; - this._undoStackFactory = options.undoStackFactory; - this._textDNDFactory = options.textDNDFactory; - this._annotationFactory = options.annotationFactory; - this._zoomRulerFactory = options.zoomRulerFactory; - this._foldingRulerFactory = options.foldingRulerFactory; - this._lineNumberRulerFactory = options.lineNumberRulerFactory; - this._contentAssistFactory = options.contentAssistFactory; - this._keyBindingFactory = options.keyBindingFactory; - this._hoverFactory = options.hoverFactory; - this._syntaxHighlighter = options.syntaxHighlighter; - this._annotationStyler = null; - this._annotationModel = null; - this._annotationRuler = null; - this._lineNumberRuler = null; - this._overviewRuler = null; - this._zoomRuler = null; - this._foldingRuler = null; - this._contentAssist = null; - } - Editor.prototype = new BaseEditor(); - objects.mixin(Editor.prototype, /** @lends orion.editor.Editor.prototype */ { - /** - * Destroys the editor. - */ - destroy: function() { - BaseEditor.prototype.destroy.call(this); - this._textViewFactory = this._undoStackFactory = this._textDNDFactory = - this._annotationFactory = this._foldingRulerFactory = this._lineNumberRulerFactory = - this._contentAssistFactory = this._keyBindingFactory = this._hoverFactory = this._zoomRulerFactory = null; - }, - /** - * Returns the annotation model of the editor. - * - * @returns {orion.editor.AnnotationModel} - */ - getAnnotationModel: function() { - return this._annotationModel; - }, - /** - * Returns the annotation ruler of the editor. - * - * @returns {orion.editor.AnnotationRuler} - */ - getAnnotationRuler: function() { - return this._annotationRuler; - }, - /** - * Returns the whether annotation ruler of the editor is showning. - * - * @returns {Boolean} - * @since 12 - */ - getAnnotationRulerVisible: function() { - return this._annotationRulerVisible; - }, - /** - * Returns the annotation styler of the editor. - * - * @returns {orion.editor.AnnotationStyler} - */ - getAnnotationStyler: function() { - return this._annotationStyler; - }, - /** - * Returns the content assist of the editor. - * - * @returns {orion.editor.LineNumberRuler} - */ - getContentAssist: function() { - return this._contentAssist; - }, - /** - * Returns the folding ruler of the editor. - * - * @returns {orion.editor.FoldingRuler} - */ - getFoldingRuler: function() { - return this._foldingRuler; - }, - /** - * Returns the whether folding ruler of the editor is showning. - * - * @returns {Boolean} - * @since 12 - */ - getFoldingRulerVisible: function() { - return this._foldingRulerVisible; - }, - /** - * Returns the line number ruler of the editor. - * - * @returns {orion.editor.LineNumberRuler} - */ - getLineNumberRuler: function() { - return this._lineNumberRuler; - }, - /** - * Returns the whether lines ruler of the editor is showning. - * - * @returns {Boolean} - * @since 12 - */ - getLineNumberRulerVisible: function() { - return this._lineNumberRulerVisible; - }, - /** - * Returns the Tooltip instance for this editor - * - * @returns {orion.editor.Tooltip} - */ - getTooltip: function() { - return mTooltip.Tooltip.getTooltip(this._textView, this); - }, - /** - * Returns the zoom ruler of the editor. - * - * @returns {orion.editor.LineNumberRuler} - */ - getZoomRuler: function() { - return this._zoomRuler; - }, - /** - * Returns the whether zoom ruler of the editor is showning. - * - * @returns {Boolean} - * @since 12 - */ - getZoomRulerVisible: function() { - return this._zoomRulerVisible; - }, - /** - * Returns the base text model of this editor. - * - * @returns {orion.editor.TextModel} - */ - getModel: function() { - if (!this._textView) { - return null; - } - var model = this._textView.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - return model; - }, - /** - * Returns the overview ruler of the editor. - * - * @returns {orion.editor.OverviewRuler} - */ - getOverviewRuler: function() { - return this._overviewRuler; - }, - /** - * Returns the underlying TextView used by this editor. - * @returns {orion.editor.TextView} the editor text view. - */ - getTextView: function() { - return this._textView; - }, - /** - * Returns the editor's key modes. - * - * @returns {Array} the editor key modes. - */ - getKeyModes: function() { - return this._textView.getKeyModes(); - }, - /** - * Returns the editor source code actions. - * - * @returns {orion.editor.sourceCodeActions} - */ - getSourceCodeActions: function() { - return this._sourceCodeActions; - }, - /** - * Returns the editor linked mode. - * - * @returns {orion.editor.LinkedMode} - */ - getLinkedMode: function() { - return this._linkedMode; - }, - /** - * Returns the editor text actions. - * - * @returns {orion.editor.textActions} - */ - getTextActions: function() { - return this._textActions; - }, - /** - * Gives focus to the text view. - */ - focus: function() { - if (this._textView) { - this._textView.focus(); - } - }, - /** - * Resizes the text view. - */ - resize: function() { - if (this._textView) { - this._textView.resize(); - } - }, - /** - * Sets whether the annotation ruler is visible. - * - * @param {Boolean} visible true to show ruler, false otherwise - */ - setAnnotationRulerVisible: function(visible, force) { - if (this._annotationRulerVisible === visible && !force) { return; } - this._annotationRulerVisible = visible; - if (!this._annotationRuler) { return; } - var textView = this._textView; - if (visible) { - textView.addRuler(this._annotationRuler, 0); - } else { - textView.removeRuler(this._annotationRuler); - } - }, - /** - * Sets whether the folding ruler is visible. - * - * @param {Boolean} visible true to show ruler, false otherwise - */ - setFoldingRulerVisible: function(visible, force) { - if (this._foldingRulerVisible === visible && !force) { return; } - if (!visible) { - var textActions = this.getTextActions(); - if (textActions) { - textActions.expandAnnotations(true); - } - } - this._foldingRulerVisible = visible; - if (!this._foldingRuler) { return; } - var textView = this._textView; - if (!textView.getModel().getBaseModel) { return; } - if (visible) { - textView.addRuler(this._foldingRuler); - } else { - textView.removeRuler(this._foldingRuler); - } - }, - /** - * Sets whether the line numbering ruler is visible. - * - * @param {Boolean} visible true to show ruler, false otherwise - */ - setLineNumberRulerVisible: function(visible, force) { - if (this._lineNumberRulerVisible === visible && !force) { return; } - this._lineNumberRulerVisible = visible; - if (!this._lineNumberRuler) { return; } - var textView = this._textView; - if (visible) { - textView.addRuler(this._lineNumberRuler, !this._annotationRulerVisible ? 0 : 1); - } else { - textView.removeRuler(this._lineNumberRuler); - } - }, - /** - * Sets whether the overview ruler is visible. - * - * @param {Boolean} visible true to show ruler, false otherwise - */ - setOverviewRulerVisible: function(visible, force) { - if (this._overviewRulerVisible === visible && !force) { return; } - this._overviewRulerVisible = visible; - if (!this._overviewRuler) { return; } - var textView = this._textView; - if (visible) { - textView.addRuler(this._overviewRuler); - } else { - textView.removeRuler(this._overviewRuler); - } - }, - /** - * Sets whether the zoom ruler is visible. - * - * @param {Boolean} visible true to show ruler, false otherwise - */ - setZoomRulerVisible: function(visible, force) { - if (this._zoomRulerVisible === visible && !force) { return; } - this._zoomRulerVisible = visible; - if (!this._zoomRuler) { return; } - var textView = this._textView; - if (visible) { - textView.addRuler(this._zoomRuler); - } else { - textView.removeRuler(this._zoomRuler); - } - }, - - mapOffset: function(offset, _parent) { - var textView = this._textView; - var model = textView.getModel(); - if (model.getBaseModel) { - offset = model.mapOffset(offset, _parent); - } - return offset; - }, - /** - * @name getLineAtOffset - * @description Returns the line number corresponding to the given offset in the source - * @function - * @public - * @memberof orion.editor.Editor - * @param {Number} offset The offset into the source - * @returns {Number} The line number corresponding to the given offset or -1 if out of range - * @since 5.0 - */ - getLineAtOffset: function(offset) { - return this.getModel().getLineAtOffset(this.mapOffset(offset)); - }, - /** - * @name getLineStart - * @description Compute the editor start offset of the given line number - * @function - * @public - * @memberof orion.editor.TextView - * @param {Number} line The line number in the editor - * @returns {Number} Returns the start offset of the given line number in the editor. - * @since 5.0 - */ - getLineStart: function(line) { - return this.getModel().getLineStart(line); - }, - getCaretOffset: function() { - return this.mapOffset(this._textView.getCaretOffset()); - }, - - /** - * Returns the text view selection text. - *

      - * If there are multiple selection ranges, the result is concatenated with the specified delimiter. - *

      - * - * @param {String} delimiter The offset into the editor - * @returns {String} the view selection text - * @since 10.0 - * @see orion.editor.TextView#setSelection - */ - getSelectionText: function(delimiter) { - var textView = this._textView; - return textView.getSelectionText(delimiter); - }, - - getSelection: function() { - var textView = this._textView; - var selection = textView.getSelection(); - var model = textView.getModel(); - if (model.getBaseModel) { - selection.start = model.mapOffset(selection.start); - selection.end = model.mapOffset(selection.end); - } - return selection; - }, - - getSelections: function() { - var textView = this._textView; - var model = textView.getModel(); - var selections = textView.getSelections(); - selections.forEach(function(selection) { - if (model.getBaseModel) { - selection.start = model.mapOffset(selection.start); - selection.end = model.mapOffset(selection.end); - } - }); - return selections; - }, - - getStyleAccessor: function() { - var styleAccessor = null; - if (this._syntaxHighlighter) { - var styler = this._syntaxHighlighter.getStyler(); - if (styler && styler.getStyleAccessor) { - styleAccessor = styler.getStyleAccessor(); - } - } - return styleAccessor; - }, - - _expandOffset: function(offset) { - var model = this._textView.getModel(); - var annotationModel = this._annotationModel; - if (!annotationModel || !model.getBaseModel) { return; } - var annotations = annotationModel.getAnnotations(offset, offset + 1); - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (annotation.type === AT.ANNOTATION_FOLDING) { - if (annotation.expand) { - annotation.expand(); - } - } - } - }, - - setCaretOffset: function(caretOffset, show, callback) { - var textView = this._textView; - var model = textView.getModel(); - if (model.getBaseModel) { - this._expandOffset(caretOffset); - caretOffset = model.mapOffset(caretOffset, true); - } - textView.setCaretOffset(caretOffset, show, callback); - }, - - setText: function(text, start, end, show, callback) { - var textView = this._textView; - var model = textView.getModel(); - if (model.getBaseModel) { - if (start !== undefined) { - this._expandOffset(start); - start = model.mapOffset(start, true); - } - if (end !== undefined) { - this._expandOffset(end); - end = model.mapOffset(end, true); - } - } - textView.setText(text, start, end, show, callback); - }, - - setSelection: function(start, end, show, callback) { - var textView = this._textView; - var model = textView.getModel(); - if (model.getBaseModel) { - this._expandOffset(start); - this._expandOffset(end); - start = model.mapOffset(start, true); - end = model.mapOffset(end, true); - } - textView.setSelection(start, end, show, callback); - }, - setSelections: function(ranges, show, callback) { - var that = this; - var textView = this._textView; - var model = textView.getModel(); - ranges.forEach(function(range) { - var start = range.start; - var end = range.end; - if (model.getBaseModel) { - that._expandOffset(start); - that._expandOffset(end); - start = model.mapOffset(start, true); - end = model.mapOffset(end, true); - } - range.start = start; - range.end = end; - }); - textView.setSelections(ranges, show, callback); - }, - - /** - * @param {Number} start - * @param {Number} [end] - * @param {function} [callback] if callback is specified, scrolling to show the selection is animated and callback is called when the animation is done. - * @param {Boolean} [focused=true] whether the text view should be focused when the selection is done. - * @private - * @deprecated use #setSelection instead - */ - moveSelection: function(start, end, callback, focused) { - end = end || start; - var textView = this._textView; - this.setSelection(start, end, 1 / 3, function() { - if (focused === undefined || focused) { - textView.focus(); - } - if (callback) { - callback(); - } - }); - }, - - /** @private */ - _getTooltipInfo: function(x, y) { - var textView = this._textView; - var annotationModel = this.getAnnotationModel(); - if (!annotationModel) { return null; } - var annotationStyler = this._annotationStyler; - if (!annotationStyler) { return null; } - if (!textView.isValidTextPosition(x, y)) { return null; } - var offset = textView.getOffsetAtLocation(x, y); - if (offset === -1) { return null; } - offset = this.mapOffset(offset); - var annotations = annotationStyler.getAnnotationsByType(annotationModel, offset, offset + 1); - var rangeAnnotations = []; - for (var i = 0; i < annotations.length; i++) { - if (annotations[i].rangeStyle) { - rangeAnnotations.push(annotations[i]); - } - } - var info = { - contents: rangeAnnotations, - position: "below", //$NON-NLS-0$ - context: {source: "editor", offset: offset} //$NON-NLS-0$ - }; - return info; - }, - - /** @private */ - _highlightCurrentLine: function(newSelections, oldSelections) { - var annotationModel = this._annotationModel; - if (!annotationModel) { return; } - var textView = this._textView; - if (textView.getOptions("singleMode")) { return; } //$NON-NLS-0$ - oldSelections = Array.isArray(oldSelections) ? oldSelections : [oldSelections]; - newSelections = Array.isArray(newSelections) ? newSelections : [newSelections]; - var model = textView.getModel(); - function getHighlightLines(selections) { - var lines = {}; - if (selections && selections.some(function(selection) { - if (selection && selection.isEmpty()) { - lines[model.getLineAtOffset(selection.start).toString()] = true; - } else { - return true; - } - return false; - })) return {}; - return lines; - } - var oldLines = getHighlightLines(oldSelections); - var newLines = getHighlightLines(newSelections); - function compare(o, n) { - for (var p1 in o) { - if (!n[p1]) { - return true; - } - } - return false; - } - if (!(compare(oldLines, newLines) || compare(newLines, oldLines))) return; - var remove = this._currentLineAnnotations; - var add = []; - for (var p in newLines) { - var lineIndex = p >> 0; - var start = model.getLineStart(lineIndex); - var end = model.getLineEnd(lineIndex); - if (model.getBaseModel) { - start = model.mapOffset(start); - end = model.mapOffset(end); - } - var type = AT.ANNOTATION_CURRENT_LINE; - var annotation = AT.createAnnotation(type, start, end); - add.push(annotation); - } - this._currentLineAnnotations = add; - annotationModel.replaceAnnotations(remove, add); - }, - - /** - * Creates the underlying TextView and installs the editor's features. - */ - installTextView: function() { - this.install(); - }, - - install : function() { - if (this._textView) { return; } - - // Create textView and install optional features - this._textView = this._textViewFactory(); - if (this._undoStackFactory) { - this._undoStack = this._undoStackFactory.createUndoStack(this); - this._textView.setOptions({undoStack: this._undoStack}); - this.checkDirty(); - } - if (this._textDNDFactory) { - this._textDND = this._textDNDFactory.createTextDND(this, this._undoStack); - } - if (this._contentAssistFactory) { - var contentAssistMode = this._contentAssistFactory.createContentAssistMode(this); - this._contentAssist = contentAssistMode.getContentAssist(); - } - - var tooltip = mTooltip.Tooltip.getTooltip(this._textView, this); - if (this._hoverFactory) { - this._hover = this._hoverFactory.createHover(this); - tooltip.hover = this._hover; - } - - var editor = this, textView = this._textView; - - var that = this; - this._listener = { - onModelChanged: /* @callback */ function(e) { - that.checkDirty(); - }, - onMouseOver: function(e) { - that._listener.onMouseMove(e); - }, - onMouseDown: /* @callback */ function(e) { - that._listener.mouseDown = true; - }, - onMouseUp: /* @callback */ function(e) { - that._listener.mouseDown = false; - }, - onMouseMove: function(e) { - if (!tooltip || that._listener.mouseDown) { return; } - - // Prevent spurious mouse event (e.g. on a scroll) - if (e.event.clientX === that._listener.lastMouseX - && e.event.clientY === that._listener.lastMouseY) { - return; - } - - that._listener.lastMouseX = e.event.clientX; - that._listener.lastMouseY = e.event.clientY; - - if (that._hoverTimeout) { - window.clearTimeout(that._hoverTimeout); - that._hoverTimeout = null; - } - that._hoverTimeout = window.setTimeout(function() { - that._hoverTimeout = null; - - // Re-check incase editor closed... - if (!that._listener){ - return; - } - - tooltip.onHover({ - y: e.y, - x: e.x, - getTooltipInfo: function() { - return that._getTooltipInfo(this.x, this.y); - } - }, e.x, e.y); - }, 175); - }, - onMouseOut: /* @callback */ function(e) { - // When mouse leaves the editor, ignore any pending onMouseMove events - if (that._hoverTimeout) { - window.clearTimeout(that._hoverTimeout); - that._hoverTimeout = null; - } - }, - onSelection: function(e) { - if (tooltip) { tooltip.hide(); } - that._updateCursorStatus(); - that._highlightCurrentLine(e.newValue, e.oldValue); - } - }; - textView.addEventListener("ModelChanged", this._listener.onModelChanged); //$NON-NLS-0$ - textView.addEventListener("Selection", this._listener.onSelection); //$NON-NLS-0$ - textView.addEventListener("MouseOver", this._listener.onMouseOver); //$NON-NLS-0$ - textView.addEventListener("MouseOut", this._listener.onMouseOut); //$NON-NLS-0$ - textView.addEventListener("MouseDown", this._listener.onMouseDown); //$NON-NLS-0$ - textView.addEventListener("MouseUp", this._listener.onMouseUp); //$NON-NLS-0$ - textView.addEventListener("MouseMove", this._listener.onMouseMove); //$NON-NLS-0$ - - // Set up keybindings - if (this._keyBindingFactory) { - var keyBindings; - if (typeof this._keyBindingFactory === "function") { //$NON-NLS-0$ - keyBindings = this._keyBindingFactory(this, this.getKeyModes(), this._undoStack, this._contentAssist); - } else { - keyBindings = this._keyBindingFactory.createKeyBindings(editor, this._undoStack, this._contentAssist); - } - if (keyBindings) { - this._textActions = keyBindings.textActions; - this._linkedMode = keyBindings.linkedMode; - this._sourceCodeActions = keyBindings.sourceCodeActions; - } - } - - var addRemoveBookmark = /* @callback */ function(lineIndex, e) { - if (lineIndex === undefined) { return; } - if (lineIndex === -1) { return; } - var view = this.getView(); - var viewModel = view.getModel(); - var annotationModel = this.getAnnotationModel(); - var lineStart = editor.mapOffset(viewModel.getLineStart(lineIndex)); - var lineEnd = editor.mapOffset(viewModel.getLineEnd(lineIndex)); - var annotations = annotationModel.getAnnotations(lineStart, lineEnd); - var bookmark = null; - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (annotation.type === AT.ANNOTATION_BOOKMARK) { - bookmark = annotation; - break; - } - } - if (bookmark) { - annotationModel.removeAnnotation(bookmark); - } else { - bookmark = AT.createAnnotation(AT.ANNOTATION_BOOKMARK, lineStart, lineEnd, editor.getText(lineStart, lineEnd)); - annotationModel.addAnnotation(bookmark); - } - }; - - // Create rulers, annotation model and styler - if (this._annotationFactory) { - var textModel = textView.getModel(); - if (textModel.getBaseModel) { textModel = textModel.getBaseModel(); } - this._annotationModel = this._annotationFactory.createAnnotationModel(textModel); - if (this._annotationModel) { - var styler = this._annotationStyler = this._annotationFactory.createAnnotationStyler(textView, this._annotationModel); - if (styler) { - styler.addAnnotationType(AT.ANNOTATION_CURRENT_SEARCH); - styler.addAnnotationType(AT.ANNOTATION_MATCHING_SEARCH); - styler.addAnnotationType(AT.ANNOTATION_ERROR); - styler.addAnnotationType(AT.ANNOTATION_WARNING); - styler.addAnnotationType(AT.ANNOTATION_MATCHING_BRACKET); - styler.addAnnotationType(AT.ANNOTATION_CURRENT_BRACKET); - styler.addAnnotationType(AT.ANNOTATION_CURRENT_LINE); - styler.addAnnotationType(AT.ANNOTATION_READ_OCCURRENCE); - styler.addAnnotationType(AT.ANNOTATION_WRITE_OCCURRENCE); - styler.addAnnotationType(AT.ANNOTATION_SELECTED_LINKED_GROUP); - styler.addAnnotationType(AT.ANNOTATION_CURRENT_LINKED_GROUP); - styler.addAnnotationType(AT.ANNOTATION_LINKED_GROUP); - styler.addAnnotationType(HIGHLIGHT_ERROR_ANNOTATION); - } - } - - var rulers = this._annotationFactory.createAnnotationRulers(this._annotationModel); - var ruler = this._annotationRuler = rulers.annotationRuler; - if (ruler) { - ruler.onDblClick = addRemoveBookmark; - ruler.setMultiAnnotationOverlay({html: "
      "}); //$NON-NLS-0$ - ruler.addAnnotationType(AT.ANNOTATION_ERROR); - ruler.addAnnotationType(AT.ANNOTATION_WARNING); - ruler.addAnnotationType(AT.ANNOTATION_TASK); - ruler.addAnnotationType(AT.ANNOTATION_BOOKMARK); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_ADDED); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_DELETED); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_MODIFIED); - } - this.setAnnotationRulerVisible(this._annotationRulerVisible || this._annotationRulerVisible === undefined, true); - - // Overview Ruler Annotation Type - ruler = this._overviewRuler = rulers.overviewRuler; - if (ruler) { - ruler.addAnnotationType(AT.ANNOTATION_CURRENT_SEARCH); - ruler.addAnnotationType(AT.ANNOTATION_MATCHING_SEARCH); - ruler.addAnnotationType(AT.ANNOTATION_READ_OCCURRENCE); - ruler.addAnnotationType(AT.ANNOTATION_WRITE_OCCURRENCE); - ruler.addAnnotationType(AT.ANNOTATION_CURRENT_BLAME); - ruler.addAnnotationType(AT.ANNOTATION_ERROR); - ruler.addAnnotationType(AT.ANNOTATION_WARNING); - ruler.addAnnotationType(AT.ANNOTATION_TASK); - ruler.addAnnotationType(AT.ANNOTATION_BOOKMARK); - ruler.addAnnotationType(AT.ANNOTATION_MATCHING_BRACKET); - ruler.addAnnotationType(AT.ANNOTATION_CURRENT_BRACKET); - ruler.addAnnotationType(AT.ANNOTATION_CURRENT_LINE); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_ADDED); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_DELETED); - ruler.addAnnotationType(AT.ANNOTATION_DIFF_MODIFIED); - - } - this.setOverviewRulerVisible(this._overviewRulerVisible || this._overviewRulerVisible === undefined, true); - } - - if (this._zoomRulerFactory) { - this._zoomRuler = this._zoomRulerFactory.createZoomRuler(this._annotationModel); - this.setZoomRulerVisible(this._zoomRulerVisible, true); - } - - if (this._lineNumberRulerFactory) { - this._lineNumberRuler = this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel); - this._lineNumberRuler.addAnnotationType(AT.ANNOTATION_CURRENT_BLAME); - this._lineNumberRuler.addAnnotationType(AT.ANNOTATION_BLAME); - this._lineNumberRuler.addAnnotationType(AT.ANNOTATION_DIFF_ADDED); - this._lineNumberRuler.addAnnotationType(AT.ANNOTATION_DIFF_MODIFIED); - this._lineNumberRuler.addAnnotationType(AT.ANNOTATION_DIFF_DELETED); - this._lineNumberRuler.onDblClick = addRemoveBookmark; - this.setLineNumberRulerVisible(this._lineNumberRulerVisible || this._lineNumberRulerVisible === undefined, true); - } - - if (this._foldingRulerFactory) { - this._foldingRuler = this._foldingRulerFactory.createFoldingRuler(this._annotationModel); - this._foldingRuler.addAnnotationType(AT.ANNOTATION_FOLDING); - this.setFoldingRulerVisible(this._foldingRulerVisible || this._foldingRulerVisible === undefined, true); - } - - var textViewInstalledEvent = { - type: "TextViewInstalled", //$NON-NLS-0$ - textView: textView - }; - this.dispatchEvent(textViewInstalledEvent); - BaseEditor.prototype.install.call(this); - }, - - /** - * Destroys the underlying TextView. - */ - uninstallTextView: function() { - this.uninstall(); - }, - - uninstall: function() { - var textView = this._textView; - if (!textView) { return; } - - textView.destroy(); - - if (this._annotationModel) { - this._annotationModel.setTextModel(null); - } - this._textView = this._undoStack = this._textDND = this._contentAssist = - this._listener = this._annotationModel = this._annotationStyler = - this._annotationRuler = this._overviewRuler = this._zoomRuler = this._lineNumberRuler = - this._foldingRuler = this._currentLineAnnotations = this._title = null; - this._dirty = false; - this._foldingRulerVisible = this._overviewRulerVisible = this._zoomRulerVisible = - this._lineNumberRulerVisible = this._annotationRulerVisible = undefined; - - var textViewUninstalledEvent = { - type: "TextViewUninstalled", //$NON-NLS-0$ - textView: textView - }; - this.dispatchEvent(textViewUninstalledEvent); - BaseEditor.prototype.uninstall.call(this); - }, - - _updateCursorStatus: function() { - // If we are in a mode and it owns status reporting, we bail out from reporting the cursor position. - var keyModes = this.getKeyModes(); - for (var i=0; i 1) { - _status = util.formatMessage(messages.multiSelections, selections.length); - } else { - var caretOffset = selections[0].getCaret(); - var lineIndex = model.getLineAtOffset(caretOffset); - var lineStart = model.getLineStart(lineIndex); - var offsetInLine = caretOffset - lineStart; - if (localStorage.languageTools){ - _status = util.formatMessage(messages.lineColumnOffset, lineIndex + 1, offsetInLine + 1, caretOffset); - } else { - _status = util.formatMessage(messages.lineColumn, lineIndex + 1, offsetInLine + 1); - } - } - this.reportStatus(_status); - }, - - showAnnotations: function(annotations, types, createAnnotation, getType) { - var annotationModel = this._annotationModel; - if (!annotationModel) { - return; - } - var remove = [], add = []; - var model = annotationModel.getTextModel(); - var iter = annotationModel.getAnnotations(), annotation; - while (iter.hasNext()) { - annotation = iter.next(); - if (types.indexOf(annotation.type) !== -1) { - if (annotation.creatorID === this) { - remove.push(annotation); - } - } - } - if (annotations) { - for (var i = 0; i < annotations.length; i++) { - annotation = annotations[i]; - if (!annotation) { continue; } - if (createAnnotation) { - annotation = createAnnotation(annotation); - } else { - var start, end; - if (annotation.lineStart && annotation.lineEnd){ - start = model.getLineStart(annotation.lineStart); - // If the closing line number of the modified range is on the last line, - // get the line ending offset of the previous line - end = model.getLineCount() === annotation.lineEnd - ? model.getLineEnd(annotation.lineEnd - 1) - : model.getLineStart(annotation.lineEnd); - } - else if (typeof annotation.line === "number") { //$NON-NLS-0$ - // line/column - var lineIndex = annotation.line - 1; - var lineStart = model.getLineStart(lineIndex); - start = lineStart + annotation.start - 1; - end = lineStart + annotation.end - 1; - } else { - // document offsets - start = annotation.start; - end = annotation.end; - } - var type = getType(annotation); - if (!type) { continue; } - annotation = AT.createAnnotation(type, start, end, annotation.description); - } - annotation.id = annotations[i].id; //allow consumers to tag the annotation with their own identifier - if(annotations[i].data) { - annotation.data = annotations[i].data; - } - annotation.creatorID = this; - add.push(annotation); - - } - } - annotationModel.replaceAnnotations(remove, add); - }, - - showProblems: function(problems) { - this.showAnnotations(problems, [ - AT.ANNOTATION_ERROR, - AT.ANNOTATION_WARNING, - AT.ANNOTATION_TASK - ], null, function(annotation) { - switch (annotation.severity) { - case "error": return AT.ANNOTATION_ERROR; //$NON-NLS-0$ - case "warning": return AT.ANNOTATION_WARNING; //$NON-NLS-0$ - case "task": return AT.ANNOTATION_TASK; //$NON-NLS-0$ - } - return null; - }); - }, - - showOccurrences: function(occurrences) { - this.showAnnotations(occurrences, [ - AT.ANNOTATION_READ_OCCURRENCE, - AT.ANNOTATION_WRITE_OCCURRENCE - ], null, function(annotation) { - return annotation.readAccess ? AT.ANNOTATION_READ_OCCURRENCE : AT.ANNOTATION_WRITE_OCCURRENCE; - }); - }, - - showBlame : function(blameMarkers) { - var blameRGB = this._blameRGB; - var doc = this.getTextView().getOptions("parent").ownerDocument; //$NON-NLS-0$ - if (!blameRGB) { - var div = util.createElement(doc, "div"); //$NON-NLS-0$ - div.className = "annotation blame"; //$NON-NLS-0$ - doc.body.appendChild(div); - var win = doc.defaultView || doc.parentWindow; - var blameStyle = win.getComputedStyle(div); - var color = blameStyle.getPropertyValue("background-color"); //$NON-NLS-0$ - div.parentNode.removeChild(div); - var i1 = color.indexOf("("); //$NON-NLS-0$ - var i2 = color.indexOf(")"); //$NON-NLS-0$ - color = color.substring(i1 + 1, i2); - this._blameRGB = blameRGB = color.split(",").slice(0,3); //$NON-NLS-0$ - } - var createGroup = function() { - var annotation = mAnnotations.AnnotationType.createAnnotation(this.groupType, this.start, this.end, this.title); - annotation.style = objects.mixin({}, annotation.style); - annotation.style.style = objects.mixin({}, annotation.style.style); - annotation.style.style.backgroundColor = ""; - this.groupAnnotation = annotation; - annotation.blame = this.blame; - annotation.html = this.html; - annotation.creatorID = this.creatorID; - return annotation; - }; - var title = function() { - var titleDiv = util.createElement(doc, "div"); //$NON-NLS-0$ - titleDiv.className = "tooltipTitle"; //$NON-NLS-0$ - var index = this.blame.Message.indexOf("\n"); //$NON-NLS-0$ - if (index === -1) { index = this.blame.Message.length; } - var commitLink = util.createElement(doc, "a"); //$NON-NLS-0$ - commitLink.href = this.blame.CommitLink; - commitLink.appendChild(doc.createTextNode(this.blame.Message.substring(0, index))); - titleDiv.appendChild(commitLink); - titleDiv.appendChild(util.createElement(doc, "br")); //$NON-NLS-0$ - titleDiv.appendChild(doc.createTextNode(util.formatMessage(messages.committerOnTime, this.blame.AuthorName, this.blame.Time))); - return titleDiv; - }; - var model = this.getModel(); - this.showAnnotations(blameMarkers, [ - AT.ANNOTATION_BLAME, - AT.ANNOTATION_CURRENT_BLAME - ], function (blameMarker) { - var start = model.getLineStart(blameMarker.Start - 1); - var end = model.getLineEnd(blameMarker.End - 1, true); - var annotation = mAnnotations.AnnotationType.createAnnotation(AT.ANNOTATION_BLAME, start, end, title); - var blameColor = blameRGB.slice(0); - blameColor.push(blameMarker.Shade); - annotation.style = objects.mixin({}, annotation.style); - annotation.style.style = objects.mixin({}, annotation.style.style); - annotation.style.style.backgroundColor = "rgba(" + blameColor.join() + ")"; //$NON-NLS-0$ //$NON-NLS-1$ - annotation.groupId = blameMarker.Name; - annotation.groupType = AT.ANNOTATION_CURRENT_BLAME; - annotation.createGroupAnnotation = createGroup; - annotation.html = ''; //$NON-NLS-0$ //$NON-NLS-1$ - annotation.blame = blameMarker; - return annotation; - }); - }, - - /** - * Display git diff annotation on the editor's annotation ruler and overview ruler. - * - * @param diffs [] with types "added", "modified", "deleted" - * Each property in diffs contains an array of objects { lineStart, lineEnd } that - * provides the starting and ending line index for the specified property. - */ - showDiffAnnotations: function(diffs) { - this.showAnnotations(diffs, [ - AT.ANNOTATION_DIFF_ADDED, - AT.ANNOTATION_DIFF_MODIFIED, - AT.ANNOTATION_DIFF_DELETED - ], null, function(annotation) { - if(annotation.type === "added")//$NON-NLS-0$ - return AT.ANNOTATION_DIFF_ADDED; - else if (annotation.type === "modified")//$NON-NLS-0$ - return AT.ANNOTATION_DIFF_MODIFIED; - return AT.ANNOTATION_DIFF_DELETED; // assume deleted if not added or modified - }); - }, - - /** - * Reveals and selects a portion of text. - * @param {Number} start - * @param {Number} end - * @param {Number} line - * @param {Number} offset - * @param {Number} length - */ - showSelection: function(start, end, line, offset, len) { - // We use typeof because we need to distinguish the number 0 from an undefined or null parameter - if (typeof(start) === "number") { //$NON-NLS-0$ - if (typeof(end) !== "number") { //$NON-NLS-0$ - end = start; - } - this.moveSelection(start, end); - return true; - } else if (typeof(line) === "number") { //$NON-NLS-0$ - var model = this.getModel(); - var pos = model.getLineStart(line-1); - if (typeof(offset) === "number") { //$NON-NLS-0$ - pos = pos + offset; - } - if (typeof(len) !== "number") { //$NON-NLS-0$ - len = 0; - } - this.moveSelection(pos, pos+len); - return true; - } - return false; - }, - - /** - * @private - */ - _setModelText: function(contents) { - if (this._textView) { - this._textView.setText(contents); - this._textView.getModel().setLineDelimiter("auto"); //$NON-NLS-0$ - this._highlightCurrentLine(this._textView.getSelections()); - } - }, - - /** - * Sets the editor's contents. - * - * @param {String} title - * @param {String} message - * @param {String} contents - * @param {Boolean} contentsSaved - * @param {Boolean} noFocus - */ - setInput: function(title, message, contents, contentsSaved, noFocus) { - BaseEditor.prototype.setInput.call(this, title, message, contents, contentsSaved); - if (this._textView && !contentsSaved && !noFocus) { - this._textView.focus(); - } - }, - /** - * Reveals a line in the editor, and optionally selects a portion of the line. - * @param {Number} line - document base line index - * @param {Number|String} column - * @param {Number} [end] - */ - onGotoLine: function(line, column, end, callback) { - if (this._textView) { - var model = this.getModel(); - line = Math.max(0, Math.min(line, model.getLineCount() - 1)); - var lineStart = model.getLineStart(line); - var start = 0; - if (end === undefined) { - end = 0; - } - if (typeof column === "string") { //$NON-NLS-0$ - var index = model.getLine(line).indexOf(column); - if (index !== -1) { - start = index; - end = start + column.length; - } - } else { - start = column; - var lineLength = model.getLineEnd(line) - lineStart; - start = Math.min(start, lineLength); - end = Math.min(end, lineLength); - } - this.moveSelection(lineStart + start, lineStart + end, callback); - } - } - }); - - return { - BaseEditor: BaseEditor, - Editor: Editor - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/find", [ //$NON-NLS-0$ - 'i18n!orion/editor/nls/messages', //$NON-NLS-0$ - 'orion/keyBinding', //$NON-NLS-0$ - 'orion/editor/keyModes', //$NON-NLS-0$ - 'orion/editor/annotations', //$NON-NLS-0$ - 'orion/regex', //$NON-NLS-0$ - 'orion/objects', //$NON-NLS-0$ - 'orion/Deferred', //$NON-NLS-0$ - 'orion/util' //$NON-NLS-0$ -], function(messages, mKeyBinding, mKeyModes, mAnnotations, mRegex, objects, Deferred, util) { - - var exports = {}; - - function IncrementalFind(editor) { - var textView = editor.getTextView(); - mKeyModes.KeyMode.call(this, textView); - this.editor = editor; - this._active = false; - this._success = true; - this._ignoreSelection = false; - this._prefix = ""; - - textView.setAction("incrementalFindCancel", function() { //$NON-NLS-0$ - this.setActive(false); - return true; - }.bind(this)); - textView.setAction("incrementalFindBackspace", function() { //$NON-NLS-0$ - return this._backspace(); - }.bind(this)); - - var self = this; - this._listener = { - onVerify: function(e){ - var editor = self.editor; - var model = editor.getModel(); - var start = editor.mapOffset(e.start), end = editor.mapOffset(e.end); - var txt = model.getText(start, end); - var prefix = self._prefix; - // TODO: mRegex is pulled in just for this one call so we can get case-insensitive search - // is it really necessary - var match = prefix.match(new RegExp("^" + mRegex.escape(txt), "i")); //$NON-NLS-1$ //$NON-NLS-0$ - if (match && match.length > 0) { - prefix = self._prefix += e.text; - self._success = true; - self._status(); - self.find(self._forward, true); - e.text = null; - } - }, - onSelection: function() { - if (!self._ignoreSelection) { - self.setActive(false); - } - } - }; - } - IncrementalFind.prototype = new mKeyModes.KeyMode(); - objects.mixin(IncrementalFind.prototype, { - createKeyBindings: function() { - var KeyBinding = mKeyBinding.KeyBinding; - var bindings = []; - bindings.push({actionID: "incrementalFindBackspace", keyBinding: new KeyBinding(8)}); //$NON-NLS-0$ - bindings.push({actionID: "incrementalFindCancel", keyBinding: new KeyBinding(13)}); //$NON-NLS-0$ - bindings.push({actionID: "incrementalFindCancel", keyBinding: new KeyBinding(27)}); //$NON-NLS-0$ - bindings.push({actionID: "incrementalFindReverse", keyBinding: new KeyBinding(38)}); //$NON-NLS-0$ - bindings.push({actionID: "incrementalFind", keyBinding: new KeyBinding(40)}); //$NON-NLS-0$ - bindings.push({actionID: "incrementalFindReverse", keyBinding: new KeyBinding('k', true, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "incrementalFind", keyBinding: new KeyBinding('k', true)}); //$NON-NLS-1$ //$NON-NLS-0$ - return bindings; - }, - find: function(forward, incremental) { - this._forward = forward; - if (!this.isActive()) { - this.setActive(true); - return false; - } - var prefix = this._prefix; - if (prefix.length === 0) { - return false; - } - var editor = this.editor; - var model = editor.getModel(); - var start; - if (forward) { - if (this._success) { - start = incremental ? this._start : editor.getCaretOffset() + 1; - } else { - start = 0; - } - } else { - if (this._success) { - start = incremental ? this._start : editor.getCaretOffset(); - } else { - start = model.getCharCount() - 1; - } - } - Deferred.when(editor.getModel().find({ - string: prefix, - start: start, - reverse: !forward, - caseInsensitive: prefix.toLowerCase() === prefix}), - function(iterator) { - var findResult = iterator.next(); - if (findResult) { - if (!incremental) { - this._start = start; - } - this._success = true; - this._ignoreSelection = true; - editor.moveSelection(forward ? findResult.start : findResult.end, forward ? findResult.end : findResult.start); - this._ignoreSelection = false; - } else { - this._success = false; - } - this._status(); - }.bind(this)); - return true; - }, - isActive: function() { - return this._active; - }, - isStatusActive: function() { - return this.isActive(); - }, - setActive: function(active) { - if (this._active === active) { - return; - } - this._active = active; - this._prefix = ""; - this._success = true; - var editor = this.editor; - var textView = editor.getTextView(); - this._start = this.editor.getCaretOffset(); - this.editor.setCaretOffset(this._start); - if (this._active) { - textView.addEventListener("Verify", this._listener.onVerify); //$NON-NLS-0$ - textView.addEventListener("Selection", this._listener.onSelection); //$NON-NLS-0$ - textView.addKeyMode(this); - } else { - textView.removeEventListener("Verify", this._listener.onVerify); //$NON-NLS-0$ - textView.removeEventListener("Selection", this._listener.onSelection); //$NON-NLS-0$ - textView.removeKeyMode(this); - } - this._status(); - }, - _backspace: function() { - var prefix = this._prefix; - prefix = this._prefix = prefix.substring(0, prefix.length-1); - if (prefix.length === 0) { - this._success = true; - this._ignoreSelection = true; - this.editor.setCaretOffset(this.editor.getSelection().start); - this._ignoreSelection = false; - this._status(); - return true; - } - return this.find(this._forward, true); - }, - _status: function() { - if (!this.isActive()) { - this.editor.reportStatus(""); - return; - } - var msg; - if (this._forward) { - msg = this._success ? messages.incrementalFindStr : messages.incrementalFindStrNotFound; - } else { - msg = this._success ? messages.incrementalFindReverseStr : messages.incrementalFindReverseStrNotFound; - } - msg = util.formatMessage(msg, this._prefix); - this.editor.reportStatus(msg, this._success ? "" : "error"); //$NON-NLS-0$ - } - }); - exports.IncrementalFind = IncrementalFind; - - - function Find(editor, undoStack, options) { - if (!editor) { return; } - this._editor = editor; - this._undoStack = undoStack; - this._showAll = true; - this._visible = false; - this._caseInsensitive = true; - this._wrap = true; - this._wholeWord = false; - this._incremental = true; - this._regex = false; - this._findAfterReplace = true; - this._hideAfterFind = false; - this._reverse = false; - this._start = undefined; - this._end = undefined; - this._timer = undefined; - this._lastString = ""; - var that = this; - this._listeners = { - onEditorFocus: function(e) { - that._removeCurrentAnnotation(e); - } - }; - this.setOptions(options); - } - Find.prototype = { - find: function (forward, tempOptions, incremental) { - this.setOptions({ - reverse : !forward - }); - var string = this.getFindString(); - var count; - if (tempOptions) { - string = tempOptions.findString || string; - count = tempOptions.count; - } - var savedOptions = this.getOptions(); - this.setOptions(tempOptions); - var startOffset = incremental ? this._startOffset : this.getStartOffset(); - return this._doFind(string, startOffset, count).then(function(result) { - if (result) { - if (!incremental) { - this._startOffset = result.start; - } - } - this.setOptions(savedOptions); - if (this._hideAfterFind) { - this.hide(); - } - return result; - }.bind(this)); - }, - getStartOffset: function() { - if (this._start !== undefined) { - return this._start; - } - if (this._reverse) { - return this._editor.getSelection().start - 1; - } - return this._editor.getCaretOffset(); - }, - getFindString: function() { - var selection = this._editor.getSelection(); - var searchString = this._editor.getText(selection.start, selection.end); - if (this._regex) { - searchString = mRegex.escape(searchString); - } - return searchString || this._lastString; - }, - getOptions: function() { - return { - showAll: this._showAll, - caseInsensitive: this._caseInsensitive, - wrap: this._wrap, - wholeWord: this._wholeWord, - incremental: this._incremental, - regex: this._regex, - findAfterReplace: this._findAfterReplace, - hideAfterFind: this._hideAfterFind, - reverse: this._reverse, - findCallback: this._findCallback, - start: this._start, - end: this._end - }; - }, - getReplaceString: function() { - return ""; - }, - hide: function() { - this._visible = false; - if (this._savedOptions) { - this.setOptions(this._savedOptions.pop()); - if (this._savedOptions.length === 0) { - this._savedOptions = null; - } - } - this._removeAllAnnotations(); - var textView = this._editor.getTextView(); - if (textView) { - textView.removeEventListener("Focus", this._listeners.onEditorFocus); //$NON-NLS-0$ - textView.focus(); - } - }, - _processReplaceString: function(str) { - var newStr = str; - if (this._regex) { - newStr = ""; - var escape = false; - var delimiter = this._editor.getModel().getLineDelimiter(); - for (var i=0; i 0) { - self.endUndo(); - textView.setRedraw(true); - } - if (startPos > 0) { - editor.reportStatus(util.formatMessage(messages.replacedMatches, count)); - } else { - editor.reportStatus(messages.nothingReplaced, "error"); //$NON-NLS-0$ - } - self._replacingAll = false; - }, 100); - } - }, - /** - * @property {String} string the search string to be found. - * @property {Boolean} [regex=false] whether or not the search string is a regular expression. - * @property {Boolean} [wrap=false] whether or not to wrap search. - * @property {Boolean} [wholeWord=false] whether or not to search only whole words. - * @property {Boolean} [caseInsensitive=false] whether or not search is case insensitive. - * @property {Boolean} [reverse=false] whether or not to search backwards. - * @property {Number} [start=0] The start offset to start searching - * @property {Number} [end=charCount] The end offset of the search. Used to search in a given range. - */ - setOptions : function(options) { - if (options) { - if ((options.showAll === true || options.showAll === false) && this._showAll !== options.showAll) { - this._showAll = options.showAll; - if (this.isVisible()) { - if (this._showAll) { - this._markAllOccurrences(); - } else { - var annotationModel = this._editor.getAnnotationModel(); - if (annotationModel) { - annotationModel.removeAnnotations(mAnnotations.AnnotationType.ANNOTATION_MATCHING_SEARCH); - } - } - } - } - if (options.caseInsensitive === true || options.caseInsensitive === false) { - this._caseInsensitive = options.caseInsensitive; - } - if (options.wrap === true || options.wrap === false) { - this._wrap = options.wrap; - } - if (options.wholeWord === true || options.wholeWord === false) { - this._wholeWord = options.wholeWord; - } - //Allow extended TextModelFactory to disable incremental find - if (options.incremental === true || options.incremental === false || options.incremental === "disabled") { - if(options.incremental === "disabled") { - this._incremental = false; - this._incrementalDisabled = true; - } else { - this._incremental = options.incremental; - } - } - if (options.regex === true || options.regex === false) { - this._regex = options.regex; - } - if (options.findAfterReplace === true || options.findAfterReplace === false) { - this._findAfterReplace = options.findAfterReplace; - } - if (options.hideAfterFind === true || options.hideAfterFind === false) { - this._hideAfterFind = options.hideAfterFind; - } - if (options.reverse === true || options.reverse === false) { - this._reverse = options.reverse; - } - if (options.hasOwnProperty("findCallback")) { //$NON-NLS-0$ - this._findCallback = options.findCallback; - } - if (options.hasOwnProperty("start")) { //$NON-NLS-0$ - this._start = options.start; - } - if (options.hasOwnProperty("end")) { //$NON-NLS-0$ - this._end = options.end; - } - } - }, - show: function(tempOptions) { - this._visible = true; - if (tempOptions) { - if (!this._savedOptions) { - this._savedOptions = []; - } - this._savedOptions.push(this.getOptions()); - this.setOptions(tempOptions); - } - this._startOffset = this._editor.getSelection().start; - this._editor.getTextView().addEventListener("Focus", this._listeners.onEditorFocus); //$NON-NLS-0$ - var self = this; - window.setTimeout(function() { - if (self._incremental) { - self.find(true, null, true); - } - }, 0); - }, - startUndo: function() { - if (this._undoStack) { - this._undoStack.startCompoundChange(); - } - }, - endUndo: function() { - if (this._undoStack) { - this._undoStack.endCompoundChange(); - } - }, - _findFromModel: function(string, startOffset, noWrap) { - return this._editor.getModel().find({ - string: string, - start: startOffset, - end: this._end, - reverse: this._reverse, - wrap: noWrap ? false: this._wrap, - regex: this._regex, - wholeWord: this._wholeWord, - caseInsensitive: this._caseInsensitive - }); - }, - - _find: function(editor, string, startOffset, noWrap) { - var iterator; - if (this._regex) { - try { - iterator = this._findFromModel(string, startOffset, noWrap); - } catch (ex) { - editor.reportStatus(ex.message, "error"); //$NON-NLS-0$ - return null; - } - } else { - iterator = this._findFromModel(string, startOffset, noWrap); - } - return iterator; - }, - - _doFindForReplaceAll: function(string, startOffset, count, noWrap) { - count = count || 1; - var editor = this._editor; - if (!string) { - this._removeAllAnnotations(); - return null; - } - this._lastString = string; - var result, iterator; - iterator = this._find(editor, string, startOffset, noWrap); - if(!iterator) { - return null; - } - if(!iterator.hasNext || !iterator.next) { - return null; - } - for (var i=0; i 1)){ actions.startUndo(); } - function setText(text, start, end) { - editor.setText(text, start, end); - offset += (start - end) + text.length; - } - selections.forEach(function(selection) { - selection.start += offset; - selection.end += offset; - callback(selection, setText); - }); - editor.setSelections(selections); - if (!noUndo && (compound || selections.length > 1)){ actions.endUndo(); } - } - - /** - * TextActions connects common text editing keybindings onto an editor. - */ - function TextActions(editor, undoStack, find) { - this.editor = editor; - this.undoStack = undoStack; - this._incrementalFind = new mFind.IncrementalFind(editor); - this._find = find ? find : new mFindUI.FindUI(editor, undoStack); - this._lastEditLocation = null; - this.init(); - } - - TextActions.prototype = { - init: function() { - var textView = this.editor.getTextView(); - - this._lastEditListener = { - onModelChanged: function(e) { - if (this.editor.isDirty()) { - this._lastEditLocation = e.start + e.addedCharCount; - } - }.bind(this) - }; - textView.addEventListener("ModelChanged", this._lastEditListener.onModelChanged); //$NON-NLS-0$ - - textView.setAction("undo", function(data) { //$NON-NLS-0$ - if (this.undoStack) { - var count = 1; - if (data && data.count) { - count = data.count; - } - while (count > 0) { - this.undoStack.undo(); - --count; - } - return true; - } - return false; - }.bind(this), {name: messages.undo}); - - textView.setAction("redo", function(data) { //$NON-NLS-0$ - if (this.undoStack) { - var count = 1; - if (data && data.count) { - count = data.count; - } - while (count > 0) { - this.undoStack.redo(); - --count; - } - return true; - } - return false; - }.bind(this), {name: messages.redo}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("f", true), "find"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("find", function() { //$NON-NLS-0$ - if (this._find) { - var selection = this.editor.getSelection(); - this._find.show({findString:this.editor.getText(selection.start, selection.end)}); - return true; - } - return false; - }.bind(this), {name: messages.find}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("k", true), "findNext"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("findNext", function(options) { //$NON-NLS-0$ - if (this._find){ - this._find.find(true, options); - return true; - } - return false; - }.bind(this), {name: messages.findNext}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("k", true, true), "findPrevious"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("findPrevious", function(options) { //$NON-NLS-0$ - if (this._find){ - this._find.find(false, options); - return true; - } - return false; - }.bind(this), {name: messages.findPrevious}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("j", true), "incrementalFind"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("incrementalFind", function() { //$NON-NLS-0$ - if (this._incrementalFind) { - this._incrementalFind.find(true); - } - return true; - }.bind(this), {name: messages.incrementalFind}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("j", true, true), "incrementalFindReverse"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("incrementalFindReverse", function() { //$NON-NLS-0$ - if (this._incrementalFind) { - this._incrementalFind.find(false); - } - return true; - }.bind(this), {name: messages.incrementalFindReverse}); - - textView.setAction("tab", function() { //$NON-NLS-0$ - return this.indentLines(); - }.bind(this)); - - textView.setAction("shiftTab", function() { //$NON-NLS-0$ - return this.unindentLines(); - }.bind(this), {name: messages.unindentLines}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(38, false, false, true), "moveLinesUp"); //$NON-NLS-0$ - textView.setAction("moveLinesUp", function() { //$NON-NLS-0$ - return this.moveLinesUp(); - }.bind(this), {name: messages.moveLinesUp}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(40, false, false, true), "moveLinesDown"); //$NON-NLS-0$ - textView.setAction("moveLinesDown", function() { //$NON-NLS-0$ - return this.moveLinesDown(); - }.bind(this), {name: messages.moveLinesDown}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(38, true, false, true), "copyLinesUp"); //$NON-NLS-0$ - textView.setAction("copyLinesUp", function() { //$NON-NLS-0$ - return this.copyLinesUp(); - }.bind(this), {name: messages.copyLinesUp}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(40, true, false, true), "copyLinesDown"); //$NON-NLS-0$ - textView.setAction("copyLinesDown", function() { //$NON-NLS-0$ - return this.copyLinesDown(); - }.bind(this), {name: messages.copyLinesDown}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding('d', true, false, false), "deleteLines"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("deleteLines", function(data) { //$NON-NLS-0$ - return this.deleteLines(data); - }.bind(this), {name: messages.deleteLines}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("l", !util.isMac, false, false, util.isMac), "gotoLine"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("gotoLine", function() { //$NON-NLS-0$ - return this.gotoLine(); - }.bind(this), {name: messages.gotoLine}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(190, true), "nextAnnotation"); //$NON-NLS-0$ - textView.setAction("nextAnnotation", function() { //$NON-NLS-0$ - return this.nextAnnotation(true); - }.bind(this), {name: messages.nextAnnotation}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(188, true), "previousAnnotation"); //$NON-NLS-0$ - textView.setAction("previousAnnotation", function() { //$NON-NLS-0$ - return this.nextAnnotation(false); - }.bind(this), {name: messages.prevAnnotation}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("e", true, false, true, false), "expand"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("expand", function() { //$NON-NLS-0$ - return this.expandAnnotation(true); - }.bind(this), {name: messages.expand}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("c", true, false, true, false), "collapse"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("collapse", function() { //$NON-NLS-0$ - return this.expandAnnotation(false); - }.bind(this), {name: messages.collapse}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("e", true, true, true, false), "expandAll"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("expandAll", function() { //$NON-NLS-0$ - return this.expandAnnotations(true); - }.bind(this), {name: messages.expandAll}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("c", true, true, true, false), "collapseAll"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("collapseAll", function() { //$NON-NLS-0$ - return this.expandAnnotations(false); - }.bind(this), {name: messages.collapseAll}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("q", !util.isMac, false, false, util.isMac), "lastEdit"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("lastEdit", function() { //$NON-NLS-0$ - return this.gotoLastEdit(); - }.bind(this), {name: messages.lastEdit}); - }, - copyLinesDown: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var lineCount = model.getLineCount(); - var delimiter = ""; - var text = model.getText(lineStart, lineEnd); - if (lastLine === lineCount-1) { - text = (delimiter = model.getLineDelimiter()) + text; - } - var insertOffset = lineEnd; - setText(text, insertOffset, insertOffset); - selection.start = insertOffset + delimiter.length; - selection.end = insertOffset + text.length; - }); - return true; - }, - copyLinesUp: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var lineCount = model.getLineCount(); - var delimiter = ""; - var text = model.getText(lineStart, lineEnd); - if (lastLine === lineCount-1) { - text += (delimiter = model.getLineDelimiter()); - } - var insertOffset = lineStart; - setText(text, insertOffset, insertOffset); - selection.start = insertOffset; - selection.end = insertOffset + text.length - delimiter.length; - }); - return true; - }, - deleteLines: function(data) { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var count = 1; - if (data && data.count) { - count = data.count; - } - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - var lineStart = model.getLineStart(firstLine); - var lastLine; - if (selection.start !== selection.end || count === 1) { - lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - } else { - lastLine = Math.min(firstLine + count - 1, model.getLineCount() - 1); - } - var lineEnd = model.getLineEnd(lastLine, true); - setText("", lineStart, lineEnd); - selection.start = selection.end = lineStart; - }); - return true; - }, - expandAnnotation: function(expand) { - var editor = this.editor; - if (!editor.getFoldingRulerVisible()) return true; - var annotationModel = editor.getAnnotationModel(); - if(!annotationModel) { return true; } - var model = editor.getModel(); - var currentOffset = editor.getCaretOffset(); - var lineIndex = model.getLineAtOffset(currentOffset); - var start = model.getLineStart(lineIndex); - var end = model.getLineEnd(lineIndex, true); - if (model.getBaseModel) { - start = model.mapOffset(start); - end = model.mapOffset(end); - model = model.getBaseModel(); - } - var annotation, iter = annotationModel.getAnnotations(start, end); - while (!annotation && iter.hasNext()) { - var a = iter.next(); - if (a.type !== mAnnotations.AnnotationType.ANNOTATION_FOLDING) { continue; } - annotation = a; - } - if (annotation) { - if (expand !== annotation.expanded) { - if (expand) { - annotation.expand(); - } else { - editor.setCaretOffset(annotation.start); - annotation.collapse(); - } - } - } - return true; - }, - expandAnnotations: function(expand) { - var editor = this.editor; - if (!editor.getFoldingRulerVisible()) return true; - var textView = editor.getTextView(); - var annotationModel = editor.getAnnotationModel(); - if(!annotationModel) { return true; } - var annotation, iter = annotationModel.getAnnotations(); - textView.setRedraw(false); - while (iter.hasNext()) { - annotation = iter.next(); - if (annotation.type !== mAnnotations.AnnotationType.ANNOTATION_FOLDING) { continue; } - if (expand !== annotation.expanded) { - if (expand) { - annotation.expand(); - } else { - annotation.collapse(); - } - } - } - textView.setRedraw(true); - return true; - }, - indentLines: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - if(!textView.getOptions("tabMode")) { return; } //$NON-NLS-0$ - var model = editor.getModel(); - var offset = 0; - var selections = editor.getSelections(); - if (selections.length > 1) { this.startUndo(); } - if (selections.some( - function(selection) { - selection.start += offset; - selection.end += offset; - var firstLine = model.getLineAtOffset(selection.start); - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - if (firstLine !== lastLine || selections.length > 1) { - var lines = []; - lines.push(""); - for (var i = firstLine; i <= lastLine; i++) { - lines.push(model.getLine(i, true)); - } - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var options = textView.getOptions("tabSize", "expandTab"); //$NON-NLS-1$ //$NON-NLS-2$ - var tab = options.expandTab ? new Array(options.tabSize + 1).join(" ") : "\t"; //$NON-NLS-1$ //$NON-NLS-2$ - var text = lines.join(tab); - editor.setText(text, lineStart, lineEnd); - var start = lineStart === selection.start ? selection.start : selection.start + tab.length; - var end = selection.end + ((lastLine - firstLine + 1) * tab.length); - offset += (lineStart - lineEnd) + text.length; - selection.start = start; - selection.end = end; - } else { - return true; - } - return false; - } - )){ - return false; - } - editor.setSelections(selections); - if (selections.length > 1) { this.endUndo(); } - return true; - }, - gotoLastEdit: function() { - if (typeof this._lastEditLocation === "number") { //$NON-NLS-0$ - this.editor.showSelection(this._lastEditLocation); - } - return true; - }, - gotoLine: function() { - var editor = this.editor; - var model = editor.getModel(); - var line = model.getLineAtOffset(editor.getCaretOffset()); - line = prompt(messages.gotoLinePrompty, line + 1); - if (line) { - line = parseInt(line, 10); - editor.onGotoLine(line - 1, 0); - } - return true; - }, - moveLinesDown: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, true, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - var lineCount = model.getLineCount(); - if (lastLine !== lineCount-1) { - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var insertOffset = model.getLineEnd(lastLine+1, true) - (lineEnd - lineStart); - var text, delimiterLength = 0; - if (lastLine !== lineCount-2) { - text = model.getText(lineStart, lineEnd); - } else { - // Move delimiter following selection to front of the text - var lineEndNoDelimiter = model.getLineEnd(lastLine); - text = model.getText(lineEndNoDelimiter, lineEnd) + model.getText(lineStart, lineEndNoDelimiter); - delimiterLength += lineEnd - lineEndNoDelimiter; - } - setText("", lineStart, lineEnd); - setText(text, insertOffset, insertOffset); - selection.start = insertOffset + delimiterLength; - selection.end = insertOffset + delimiterLength + text.length; - } - }); - return true; - }, - moveLinesUp: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, true, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - if (firstLine !== 0) { - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - var lineCount = model.getLineCount(); - var insertOffset = model.getLineStart(firstLine - 1); - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var text = model.getText(lineStart, lineEnd); - var delimiterLength = 0; - if (lastLine === lineCount-1) { - // Move delimiter preceding selection to end of text - var delimiterStart = model.getLineEnd(firstLine - 1); - var delimiterEnd = model.getLineEnd(firstLine - 1, true); - text += model.getText(delimiterStart, delimiterEnd); - lineStart = delimiterStart; - delimiterLength = delimiterEnd - delimiterStart; - } - setText("", lineStart, lineEnd); - setText(text, insertOffset, insertOffset); - selection.start = insertOffset; - selection.end = insertOffset + text.length - delimiterLength; - } - }); - return true; - }, - nextAnnotation: function (forward) { - var editor = this.editor; - var annotationModel = editor.getAnnotationModel(); - if (!annotationModel) { return true; } - var list = editor.getOverviewRuler() || editor.getAnnotationStyler(); - if (!list) { return true; } - function ignore(annotation) { - return !!annotation.lineStyle || - annotation.type === AT.ANNOTATION_MATCHING_BRACKET || - annotation.type === AT.ANNOTATION_CURRENT_BRACKET || - !list.isAnnotationTypeVisible(annotation.type); - } - var model = editor.getModel(); - var currentOffset = editor.getCaretOffset(); - var annotations = annotationModel.getAnnotations(forward ? currentOffset : 0, forward ? model.getCharCount() : currentOffset); - var foundAnnotation = null; - while (annotations.hasNext()) { - var annotation = annotations.next(); - if (forward) { - if (annotation.start <= currentOffset) { continue; } - } else { - if (annotation.start >= currentOffset) { continue; } - } - if (ignore(annotation)) { - continue; - } - foundAnnotation = annotation; - if (forward) { - break; - } - } - if (foundAnnotation) { - var foundAnnotations = [foundAnnotation]; - annotations = annotationModel.getAnnotations(foundAnnotation.start, foundAnnotation.start); - while (annotations.hasNext()) { - annotation = annotations.next(); - if (annotation !== foundAnnotation && !ignore(annotation)) { - foundAnnotations.push(annotation); - } - } - var view = editor.getTextView(); - var tooltip = mTooltip.Tooltip.getTooltip(view, editor); - if (!tooltip) { - editor.moveSelection(foundAnnotation.start); - return true; - } - editor.moveSelection(foundAnnotation.start, foundAnnotation.start, function() { - setTimeout(function() { - var tv = editor.getTextView(); - var offset = foundAnnotation.start; - var pos = tv.getLocationAtOffset(offset); - tooltip.show({ - x: pos.x, - y: pos.y, - getTooltipInfo: function() { - return editor._getTooltipInfo(this.x, this.y); - } - }, false, false); - }, 0); - }); - } - return true; - }, - unindentLines: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - if(!textView.getOptions("tabMode")) { return; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var firstLine = model.getLineAtOffset(selection.start); - var lastLine = model.getLineAtOffset(selection.end > selection.start ? selection.end - 1 : selection.end); - var tabSize = textView.getOptions("tabSize"); //$NON-NLS-0$ - var spaceTab = new Array(tabSize + 1).join(" "); //$NON-NLS-0$ - var lines = [], removeCount = 0, firstRemoveCount = 0; - for (var i = firstLine; i <= lastLine; i++) { - var line = model.getLine(i, true); - if (model.getLineStart(i) !== model.getLineEnd(i)) { - if (line.indexOf("\t") === 0) { //$NON-NLS-0$ - line = line.substring(1); - removeCount++; - } else if (line.indexOf(spaceTab) === 0) { - line = line.substring(tabSize); - removeCount += tabSize; - } else { - return true; - } - } - if (i === firstLine) { - firstRemoveCount = removeCount; - } - lines.push(line); - } - var lineStart = model.getLineStart(firstLine); - var lineEnd = model.getLineEnd(lastLine, true); - var lastLineStart = model.getLineStart(lastLine); - var text = lines.join(""); - setText(text, lineStart, lineEnd); - var start = lineStart === selection.start ? selection.start : selection.start - firstRemoveCount; - var end = Math.max(start, selection.end - removeCount + (selection.end === lastLineStart+1 && selection.start !== selection.end ? 1 : 0)); - selection.start = start; - selection.end = end; - }); - return true; - }, - startUndo: function() { - if (this.undoStack) { - this.undoStack.startCompoundChange(); - } - }, - endUndo: function() { - if (this.undoStack) { - this.undoStack.endCompoundChange(); - } - } - }; - exports.TextActions = TextActions; - - /** - * @param {orion.editor.Editor} editor - * @param {orion.editor.UndoStack} undoStack - * @param {orion.editor.ContentAssist} [contentAssist] - * @param {orion.editor.LinkedMode} [linkedMode] - */ - function SourceCodeActions(editor, undoStack, contentAssist, linkedMode) { - this.editor = editor; - this.undoStack = undoStack; - this.contentAssist = contentAssist; - this.linkedMode = linkedMode; - if (this.contentAssist) { - this.contentAssist.addEventListener("ProposalApplied", this.contentAssistProposalApplied.bind(this)); //$NON-NLS-0$ - } - this.init(); - } - SourceCodeActions.prototype = { - init: function() { - var textView = this.editor.getTextView(); - - textView.setAction("lineStart", function() { //$NON-NLS-0$ - return this.lineStart(); - }.bind(this)); - - textView.setAction("enter", function() { //$NON-NLS-0$ - return this.autoIndent(); - }.bind(this)); - - textView.setKeyBinding(new mKeyBinding.KeyBinding("t", true, false, true), "trimTrailingWhitespaces"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("trimTrailingWhitespaces", function() { //$NON-NLS-0$ - return this.trimTrailingWhitespaces(); - }.bind(this), {name: messages.trimTrailingWhitespaces}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(191, true), "toggleLineComment"); //$NON-NLS-0$ - textView.setAction("toggleLineComment", function() { //$NON-NLS-0$ - return this.toggleLineComment(); - }.bind(this), {name: messages.toggleLineComment}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(191, true, !util.isMac, false, util.isMac), "addBlockComment"); //$NON-NLS-0$ - textView.setAction("addBlockComment", function() { //$NON-NLS-0$ - return this.addBlockComment(); - }.bind(this), {name: messages.addBlockComment}); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(220, true, !util.isMac, false, util.isMac), "removeBlockComment"); //$NON-NLS-0$ - textView.setAction("removeBlockComment", function() { //$NON-NLS-0$ - return this.removeBlockComment(); - }.bind(this), {name: messages.removeBlockComment}); - - // Autocomplete square brackets [] - textView.setKeyBinding(new mKeyBinding.KeyBinding("[", false, false, false, false, "keypress"), "autoPairSquareBracket"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("autoPairSquareBracket", function() { //$NON-NLS-0$ - return this.autoPairBrackets("[", "]"); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(']', false, false, false, false, "keypress"), "skipClosingSquareBracket"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("skipClosingSquareBracket", function() { //$NON-NLS-0$ - return this.handleClosingBracket(']'); //$NON-NLS-0$ - }.bind(this)); - - // Autocomplete angle brackets <> - textView.setKeyBinding(new mKeyBinding.KeyBinding("<", false, false, false, false, "keypress"), "autoPairAngleBracket"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("autoPairAngleBracket", function() { //$NON-NLS-0$ - return this.autoPairBrackets("<", ">"); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - textView.setKeyBinding(new mKeyBinding.KeyBinding('>', false, false, false, false, "keypress"), "skipClosingAngleBracket"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("skipClosingAngleBracket", function() { //$NON-NLS-0$ - return this.handleClosingBracket('>'); //$NON-NLS-0$ - }.bind(this)); - - // Autocomplete parentheses () - textView.setKeyBinding(new mKeyBinding.KeyBinding("(", false, false, false, false, "keypress"), "autoPairParentheses"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("autoPairParentheses", function() { //$NON-NLS-0$ - return this.autoPairBrackets("(", ")"); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - textView.setKeyBinding(new mKeyBinding.KeyBinding(')', false, false, false, false, "keypress"), "skipClosingParenthesis"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("skipClosingParenthesis", function() { //$NON-NLS-0$ - return this.handleClosingBracket(")"); //$NON-NLS-0$ - }.bind(this)); - - // Autocomplete braces {} - textView.setKeyBinding(new mKeyBinding.KeyBinding("{", false, false, false, false, "keypress"), "autoPairBraces"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("autoPairBraces", function() { //$NON-NLS-0$ - return this.autoPairBrackets("{", "}"); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - textView.setKeyBinding(new mKeyBinding.KeyBinding('}', false, false, false, false, "keypress"), "skipClosingBrace"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("skipClosingBrace", function() { //$NON-NLS-0$ - return this.handleClosingBracket("}"); //$NON-NLS-0$ - }.bind(this)); - - // Autocomplete single quotations - textView.setKeyBinding(new mKeyBinding.KeyBinding("'", false, false, false, false, "keypress"), "autoPairSingleQuotation"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - textView.setAction("autoPairSingleQuotation", function() { //$NON-NLS-0$ - return this.autoPairQuotations("'"); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - // Autocomplete double quotations - textView.setKeyBinding(new mKeyBinding.KeyBinding('"', false, false, false, false, "keypress"), "autoPairDblQuotation"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - textView.setAction("autoPairDblQuotation", function() { //$NON-NLS-0$ - return this.autoPairQuotations('"'); //$NON-NLS-1$ //$NON-NLS-2$ - }.bind(this)); - - textView.setAction("deletePrevious", function() { //$NON-NLS-0$ - return this.deletePrevious(); - }.bind(this)); - }, - autoIndent: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - if (textView.getOptions("singleMode")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - var options = textView.getOptions("tabSize", "expandTab"); //$NON-NLS-1$ //$NON-NLS-2$ - var tab = options.expandTab ? new Array(options.tabSize + 1).join(" ") : "\t"; //$NON-NLS-1$ //$NON-NLS-2$ - var lineDelimiter = model.getLineDelimiter(); - var matchCommentStart = /^[\s]*\/\*[\*]*[\s]*$/; - var matchCommentDelimiter = /^[\s]*\*/; - var matchCommentEnd = /\*\/[\s]*$/; - var self = this; - function indent(selection, setText) { - if (selection.start === selection.end) { - var lineIndex = model.getLineAtOffset(selection.start); - var lineText = model.getLine(lineIndex, false); - var lineStart = model.getLineStart(lineIndex); - var index = 0; - var lineOffset = selection.start - lineStart; - var c; - while (index < lineOffset && ((c = lineText.charCodeAt(index)) === 32 || c === 9)) { index++; } - var prefix = lineText.substring(0, index); - var lineTextBeforeCaret = lineText.substring(0, lineOffset); - var lineTextAfterCaret = lineText.substring(lineOffset); - var text; - // If the character before the caret is an opening brace, smart indent the next line. - var prevCharIdx; - if (self.smartIndentation && lineText.charCodeAt(prevCharIdx = lineTextBeforeCaret.trimRight().length - 1) === 123) { - // Remove any extra whitespace - var whitespaceBeforeCaret = lineOffset - prevCharIdx - 1; - var whitespaceAfterCaret = lineTextAfterCaret.length - lineTextAfterCaret.trimLeft().length; - - text = lineText.charCodeAt(lineOffset + whitespaceAfterCaret) === 125 ? - lineDelimiter + prefix + tab + lineDelimiter + prefix : - lineDelimiter + prefix + tab; - - setText(text, selection.start - whitespaceBeforeCaret, selection.end + whitespaceAfterCaret); - selection.start = selection.end = selection.start + lineDelimiter.length + prefix.length + tab.length - whitespaceBeforeCaret; - return true; - // Proceed with autocompleting multi-line comment if the text before the caret matches - // the start or comment delimiter (*) of a multi-line comment - } else if (self.autoCompleteComments && !matchCommentEnd.test(lineTextBeforeCaret) && - (matchCommentStart.test(lineTextBeforeCaret) || matchCommentDelimiter.test(lineTextBeforeCaret))) { - var caretOffset; - - /** - * Matches the start of a multi-line comment. Autocomplete the multi-line block comment, - * moving any text after the caret into the block comment and setting the caret to be - * after the comment delimiter. - */ - var match = matchCommentStart.exec(lineTextBeforeCaret); - if (match) { - text = lineDelimiter + prefix + " * "; //$NON-NLS-0$ - // Text added into the comment block are trimmed of all preceding and trailing whitespaces. - // If the text after the caret contains the ending of a block comment, exclude the ending. - if (matchCommentEnd.test(lineTextAfterCaret)) { - text += lineTextAfterCaret.substring(0, lineTextAfterCaret.length - 2).trim(); - } else { - text += lineTextAfterCaret.trim(); - } - // Add the closing to the multi-line block comment if the next line is not a - // comment delimiter. - if ((model.getLineCount() === lineIndex + 1) || - !matchCommentDelimiter.test(model.getLine(lineIndex + 1))) { - text += lineDelimiter + prefix + " */"; //$NON-NLS-0$ - } - setText(text, selection.start, selection.end + lineTextAfterCaret.length); - selection.start = selection.end = selection.start + lineDelimiter.length + prefix.length + 3; - return true; - } - - /** - * Matches a comment delimiter (*) as the start of the line, and traverses up the lines to confirm if - * it is a multi-line comment by matching the start of a block comment. If so, continue the - * multi-line comment in the next line. Any text that follows after the caret is moved to the newly - * added comment delimiter. - */ - match = matchCommentDelimiter.exec(lineTextBeforeCaret); - if (match) { - for (var i = lineIndex - 1; i >= 0; i--) { - var prevLine = model.getLine(i, false); - if (matchCommentStart.test(prevLine)) { - /** - * If the text after the caret matches the end of a comment block or the character in front of the - * caret is a forward slash, continue the block comment with the caret and text after the caret on - * the next line directly in front of the star (*). - */ - if (matchCommentEnd.test(lineTextAfterCaret) || lineText.charCodeAt(lineOffset) === 47) { - text = lineDelimiter + prefix + "*" + lineTextAfterCaret; //$NON-NLS-0$ - caretOffset = selection.start + lineDelimiter.length + prefix.length + 1; - } else { - text = lineDelimiter + prefix + "* " + lineTextAfterCaret; //$NON-NLS-0$ - caretOffset = selection.start + lineDelimiter.length + prefix.length + 2; - } - setText(text, selection.start, selection.end + lineTextAfterCaret.length); - selection.start = selection.end = caretOffset; - return true; - } else if (!matchCommentDelimiter.test(prevLine)) { - return false; - } - } - } - return false; - } else if (matchCommentEnd.test(lineTextBeforeCaret) && prefix.charCodeAt(prefix.length - 1) === 32) { - // Matches the end of a block comment. Fix the indentation for the following line. - text = lineDelimiter + prefix.substring(0, prefix.length - 1); - setText(text, selection.start, selection.end); - selection.start = selection.end = selection.start + text.length; - return true; - } else if (index > 0) { - //TODO still wrong when typing inside folding - index = lineOffset; - while (index < lineText.length && ((c = lineText.charCodeAt(index++)) === 32 || c === 9)) { selection.end++; } - text = model.getLineDelimiter() + prefix; - setText(text, selection.start, selection.end); - selection.start = selection.end = selection.start + text.length; - return true; - } - } - return false; - } - forEachSelection(this, true, function(selection, setText) { - if (!indent(selection, setText)) { - setText(lineDelimiter, selection.start, selection.end); - selection.start = selection.end = selection.start + lineDelimiter.length; - } - }); - return true; - }, - addBlockComment: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - var styleAccessor = editor.getStyleAccessor(); - forEachSelection(this, false, function(selection, setText) { - var open, close; - if (styleAccessor) { - var delimiters = styleAccessor.getBlockCommentDelimiters(selection.start); - open = delimiters[0]; - close = delimiters[1]; - } else { - /* fallback values */ - open = "/*"; //$NON-NLS-0$ - close = "*/"; //$NON-NLS-0$ - } - - var result = this._findEnclosingComment(model, selection.start, selection.end, open, close); - if (result.commentStart !== undefined && result.commentEnd !== undefined) { - return; // Already in a comment - } - - var text = model.getText(selection.start, selection.end); - if (text.length === 0) { return; } - - var oldLength = text.length; - text = text.replace(open, ""); - text = text.replace(close, ""); - var newLength = text.length; - text = open + text + close; - - setText(text, selection.start, selection.end); - selection.start += open.length; - selection.end += open.length + (newLength - oldLength); - }.bind(this)); - return true; - }, - /** - * Called on an opening bracket keypress. - * Automatically inserts the specified opening and closing brackets around the caret or selected text. - */ - autoPairBrackets: function(openBracket, closeBracket) { - if (openBracket === "[" && !this.autoPairSquareBrackets) { //$NON-NLS-0$ - return false; - } else if (openBracket === "{" && !this.autoPairBraces) { //$NON-NLS-0$ - return false; - } else if (openBracket === "(" && !this.autoPairParentheses) { //$NON-NLS-0$ - return false; - } else if (openBracket === "<" && !this.autoPairAngleBrackets) { //$NON-NLS-0$ - return false; - } - - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var isClosingBracket = new RegExp("^$|[)}\\]>]"); //$NON-NLS-0$ // matches any empty string and closing bracket - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var nextChar = (selection.start === model.getCharCount()) ? "" : model.getText(selection.start, selection.start + 1).trim(); //$NON-NLS-0$ - var text; - if (selection.start === selection.end && isClosingBracket.test(nextChar)) { - // No selection and subsequent character is not a closing bracket - wrap the caret with the opening and closing brackets, - // and maintain the caret position inbetween the brackets - text = openBracket + closeBracket; - setText(text, selection.start, selection.start); - selection.start = selection.end = selection.start + 1; - } else if (selection.start !== selection.end) { - // Wrap the selected text with the specified opening and closing brackets and keep selection on text - text = openBracket + model.getText(selection.start, selection.end) + closeBracket; - setText(text, selection.start, selection.end); - selection.start += 1; - selection.end += 1; - } else { - setText(openBracket, selection.start, selection.end); - selection.start = selection.end = selection.start + openBracket.length; - } - }); - return true; - }, - /** - * Called on a quotation mark keypress. - * Automatically inserts a pair of the specified quotation around the caret the caret or selected text. - */ - autoPairQuotations: function(quotation) { - if (!this.autoPairQuotation) { return false; } - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var isQuotation = new RegExp("^\"$|^'$"); //$NON-NLS-0$ - var isAlpha = new RegExp("\\w"); //$NON-NLS-0$ - var isClosingBracket = new RegExp("^$|[)}\\]>]"); //$NON-NLS-0$ // matches any empty string and closing bracket - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - var prevChar = (selection.start === 0) ? "" : model.getText(selection.start - 1, selection.start).trim(); //$NON-NLS-0$ - var nextChar = (selection.start === model.getCharCount()) ? "" : model.getText(selection.start, selection.start + 1).trim(); //$NON-NLS-0$ - function insertQuotation() { - setText(quotation, selection.start, selection.end); - selection.start = selection.end = selection.start + quotation.length; - } - // Wrap the selected text with the specified opening and closing quotation marks and keep selection on text - if (selection.start !== selection.end) { - var text = model.getText(selection.start, selection.end); - if (isQuotation.test(text)) { - insertQuotation(); - } else { - setText(quotation + text + quotation, selection.start, selection.end); - selection.start += 1; - selection.end += 1; - } - } else if (nextChar === quotation) { - // Skip over the next character if it matches the specified quotation mark - selection.start = selection.end = selection.start + 1; - } else if (prevChar === quotation || isQuotation.test(nextChar) || isAlpha.test(prevChar) || !isClosingBracket.test(nextChar)) { - insertQuotation(); - } else { - // No selection - wrap the caret with the opening and closing quotation marks, and maintain the caret position inbetween the quotations - setText(quotation + quotation, selection.start, selection.end); - selection.start = selection.end = selection.start + quotation.length; - } - }); - return true; - }, - /** - * Called when a content assist proposal has been applied. Inserts the proposal into the - * document. Activates Linked Mode if applicable for the selected proposal. - * @param {orion.editor.ContentAssist#ProposalAppliedEvent} event - */ - contentAssistProposalApplied: function(event) { - /* - * The event.proposal is an object with this shape: - * { proposal: "[proposal string]", // Actual text of the proposal - * description: "diplay string", // Optional - * positions: [{ - * offset: 10, // Offset of start position of parameter i - * length: 3 // Length of parameter string for parameter i - * }], // One object for each parameter; can be null - * escapePosition: 19, // Optional; offset that caret will be placed at after exiting Linked Mode. - * style: 'emphasis', // Optional: either emphasis, noemphasis, hr to provide custom styling for the proposal - * unselectable: false // Optional: if set to true, then this proposal cannnot be selected through the keyboard - * } - * Offsets are relative to the text buffer. - */ - var proposal = event.data.proposal; - - // If escapePosition is not provided, positioned the cursor at the end of the inserted text - function escapePosition() { - if (typeof proposal.escapePosition === "number") { //$NON-NLS-0$ - return proposal.escapePosition; - } - return event.data.start + proposal.proposal.length; - } - - //if the proposal specifies linked positions, build the model and enter linked mode - if (proposal.positions && proposal.positions.length > 0 && this.linkedMode) { - var positionGroups = []; - for (var i = 0; i < proposal.positions.length; ++i) { - positionGroups[i] = { - positions: [{ - offset: proposal.positions[i].offset, - length: proposal.positions[i].length - }] - }; - } - this.linkedMode.enterLinkedMode({ - groups: positionGroups, - escapePosition: escapePosition() - }); - } else if (proposal.groups && proposal.groups.length > 0 && this.linkedMode) { - this.linkedMode.enterLinkedMode({ - groups: proposal.groups, - escapePosition: escapePosition() - }); - } else if (typeof proposal.escapePosition === "number") { //$NON-NLS-0$ - //we don't want linked mode, but there is an escape position, so just set cursor position - var textView = this.editor.getTextView(); - textView.setCaretOffset(proposal.escapePosition); - } - return true; - }, - // On backspace keypress, checks if there are a pair of brackets or quotation marks to be deleted - deletePrevious: function() { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - forEachSelection(this, false, function(selection, setText) { - if (selection.start !== selection.end) { return; } - - var prevChar = (selection.start === 0) ? "" : model.getText(selection.start - 1, selection.start); //$NON-NLS-0$ - var nextChar = (selection.start === model.getCharCount()) ? "" : model.getText(selection.start, selection.start + 1); //$NON-NLS-0$ - - if (prevChar === "(" && nextChar === ")" || //$NON-NLS-1$ //$NON-NLS-2$ - prevChar === "[" && nextChar === "]" || //$NON-NLS-1$ //$NON-NLS-2$ - prevChar === "{" && nextChar === "}" || //$NON-NLS-1$ //$NON-NLS-2$ - prevChar === "<" && nextChar === ">" || //$NON-NLS-1$ //$NON-NLS-2$ - prevChar === '"' && nextChar === '"' || //$NON-NLS-1$ //$NON-NLS-2$ - prevChar === "'" && nextChar === "'") { //$NON-NLS-1$ //$NON-NLS-2$ - setText("", selection.start, selection.start + 1); //$NON-NLS-0$ - } - }, true); - return false; - }, - _findEnclosingComment: function(model, start, end, open, close) { - var firstLine = model.getLineAtOffset(start); - var lastLine = model.getLineAtOffset(end); - var i, line, extent, openPos, closePos; - var commentStart, commentEnd; - for (i = firstLine; i >= 0; i--) { - line = model.getLine(i); - extent = (i === firstLine) ? start - model.getLineStart(firstLine) : line.length; - openPos = line.lastIndexOf(open, extent); - closePos = line.lastIndexOf(close, extent); - if (closePos > openPos) { - break; // not inside a comment - } - if (openPos !== -1) { - commentStart = model.getLineStart(i) + openPos; - break; - } - } - for (i = lastLine; i < model.getLineCount(); i++) { - line = model.getLine(i); - extent = (i === lastLine) ? end - model.getLineStart(lastLine) : 0; - openPos = line.indexOf(open, extent); - closePos = line.indexOf(close, extent); - if (openPos !== -1 && openPos < closePos) { - break; - } - if (closePos !== -1) { - commentEnd = model.getLineStart(i) + closePos; - break; - } - } - return {commentStart: commentStart, commentEnd: commentEnd}; - }, - lineStart: function() { - var editor = this.editor; - var model = editor.getModel(); - forEachSelection(this, false, function(selection/*, setText*/) { - var caretOffset = selection.getCaret(); - var lineIndex = model.getLineAtOffset(caretOffset); - var lineOffset = model.getLineStart(lineIndex); - var lineText = model.getLine(lineIndex); - var offset; - for (offset=0; offset selection.start ? selection.end - 1 : selection.end); - - var comment; - if (styleAccessor) { - comment = styleAccessor.getLineCommentDelimiter(model.getLineStart(firstLine)); - } else { - comment = "//"; /* fallback value */ //$NON-NLS-0$ - } - - var uncomment = true, lineIndices = [], index; - for (var i = firstLine; i <= lastLine; i++) { - var lineText = model.getLine(i, true); - index = lineText.indexOf(comment); - lineIndices.push(index); - if (!uncomment || index === -1) { - uncomment = false; - } else { - if (index !== 0) { - var j; - for (j = 0; j < index; j++) { - var c = lineText.charCodeAt(j); - if (!(c === 32 || c === 9)) { - break; - } - } - uncomment = j === index; - } - } - } - var selStart, selEnd, l = comment.length, k; - var lineStart = model.getLineStart(firstLine); - if (uncomment) { - for (k = lineIndices.length - 1; k >= 0; k--) { - index = lineIndices[k] + model.getLineStart(firstLine + k); - setText("", index, index + l); - } - var lastLineStart = model.getLineStart(lastLine); - selStart = lineStart === selection.start ? selection.start : selection.start - l; - selEnd = selection.end - (l * (lastLine - firstLine + 1)) + (selection.end === lastLineStart + 1 ? l : 0); - } else { - for (k = lineIndices.length - 1; k >= 0; k--) { - index = model.getLineStart(firstLine + k); - setText(comment, index, index); - } - selStart = lineStart === selection.start ? selection.start : selection.start + l; - selEnd = selection.end + (l * (lastLine - firstLine + 1)); - } - selection.start = selStart; - selection.end = selEnd; - }); - textView.setRedraw(true); - return true; - }, - trimTrailingWhitespaces: function() { - var editor = this.editor; - var model = editor.getModel(); - var selections = editor.getSelections(); - editor.getTextView().setRedraw(false); - this.startUndo(); - var matchTrailingWhiteSpace = /(\s+$)/; - var lineCount = model.getLineCount(); - for (var i = 0; i < lineCount; i++) { - var lineText = model.getLine(i); - var match = matchTrailingWhiteSpace.exec(lineText); - if (match) { - var lineStartOffset = model.getLineStart(i); - var matchLength = match[0].length; - var start = lineStartOffset + match.index; - model.setText("", start, start + matchLength); - /** - * Move the caret to its original position prior to the save. If the caret - * was in the trailing whitespaces, move the caret to the end of the line. - */ - selections.forEach(function(selection) { - if (selection.start > start) { - selection.start = Math.max(start, selection.start - matchLength); - } - if (selection.start !== selection.end && selection.end > start) { - selection.end = Math.max(start, selection.end - matchLength); - } - }); - } - } - this.endUndo(); - editor.setSelections(selections, false); - editor.getTextView().setRedraw(true); - }, - startUndo: function() { - if (this.undoStack) { - this.undoStack.startCompoundChange(); - } - }, - /** - * @name handleClosingBracket - * @description When the user types a closing bracket we should skip auto-paired brackets and reduce indenting if - * we are on a new line. - * @function - * @param closingChar {String} the closing bracket character - * @returns returns true to skip printing the closing bracket, false to print it - */ - handleClosingBracket: function(closingChar) { - var editor = this.editor; - var textView = editor.getTextView(); - if (textView.getOptions("readonly")) { return false; } //$NON-NLS-0$ - var model = editor.getModel(); - var selections = editor.getSelections(); - if (selections.length === 1 && selections[0].start === selections[0].end) { - // If the next character is the same bracket close, skip it - var nextChar = selections[0].start === model.getCharCount() ? "" : model.getText(selections[0].start, selections[0].start + 1); //$NON-NLS-0$ - if (nextChar === closingChar) { - selections[0].start = selections[0].end = selections[0].start + 1; - editor.setSelections(selections); - return true; - } - // If the close bracket is on a new line, reduce the indentation - var lineNum = model.getLineAtOffset(selections[0].start); - var line = model.getLine(lineNum, true); - if (line.match(/^\s*$/)){ - if(textView.getOptions("tabMode")){ //$NON-NLS-1$ - var tabSize = textView.getOptions("tabSize"); //$NON-NLS-1$ - var spaceTab = new Array(tabSize + 1).join(" "); //$NON-NLS-1$ - var lineStart = model.getLineStart(lineNum); - var lineEnd = model.getLineEnd(lineNum); - if (lineStart !== lineEnd) { - if (line.indexOf("\t") === 0) { //$NON-NLS-1$ - line = line.substring(1); - model.setText(line, lineStart, lineEnd); - editor.setSelection(selections[0].start-1, selections[0].end-1); - return false; - } else if (line.indexOf(spaceTab) === 0) { - line = line.substring(tabSize); - model.setText(line, lineStart, lineEnd); - editor.setSelection(selections[0].start-tabSize, selections[0].end-tabSize); - return false; - } - } - } - } - } - return false; - }, - endUndo: function() { - if (this.undoStack) { - this.undoStack.endCompoundChange(); - } - }, - setAutoPairParentheses: function(enabled) { - this.autoPairParentheses = enabled; - }, - setAutoPairBraces: function(enabled) { - this.autoPairBraces = enabled; - }, - setAutoPairSquareBrackets: function(enabled) { - this.autoPairSquareBrackets = enabled; - }, - setAutoPairAngleBrackets: function(enabled) { - this.autoPairAngleBrackets = enabled; - }, - setAutoPairQuotations: function(enabled) { - this.autoPairQuotation = enabled; - }, - setAutoCompleteComments: function(enabled) { - this.autoCompleteComments = enabled; - }, - setSmartIndentation: function(enabled) { - this.smartIndentation = enabled; - } - }; - exports.SourceCodeActions = SourceCodeActions; - - if (!String.prototype.trimLeft) { - String.prototype.trimLeft = function(){ - return this.replace(/^\s+/g, ''); - }; - } - if (!String.prototype.trimRight) { - String.prototype.trimRight = function(){ - return this.replace(/\s+$/g, ''); - }; - } - - return exports; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/** - * @class Provides the various rulers that show up on the left and right sides of the editor. The rulers - * contain annotations with varying styles, hovers and on click behaviours. - */ -/*eslint-env browser, amd*/ -define("orion/editor/rulers", [ - 'i18n!orion/editor/nls/messages', - 'orion/editor/textView', - 'orion/editor/annotations', - 'orion/editor/tooltip', - 'orion/objects', - 'orion/editor/util', - 'orion/util' -], function(messages, mTextView, mAnnotations, mTooltip, objects, textUtil, util) { - - function BaseRuler (rulerLocation, rulerOverview, rulerStyle) { - this._location = rulerLocation || "left"; //$NON-NLS-0$ - this._overview = rulerOverview || "page"; //$NON-NLS-0$ - this._rulerStyle = rulerStyle; - this._view = null; - } - BaseRuler.prototype = /** @lends orion.editor.BaseRuler.prototype */ { - /** - * Returns the ruler location. - * - * @returns {String} the ruler location, which is either "left" or "right" or "margin". - * - * @see orion.editor.Ruler#getOverview - */ - getLocation: function() { - return this._location; - }, - /** - * Returns the ruler overview type. - * - * @returns {String} the overview type, which is either "page" or "document" or "fixed". - * - * @see orion.editor.Ruler#getLocation - */ - getOverview: function() { - return this._overview; - }, - /** - * Returns the style information for the ruler. - * - * @returns {orion.editor.Style} the style information. - */ - getRulerStyle: function() { - return this._rulerStyle; - }, - /** - * Returns the text view. - * - * @returns {orion.editor.TextView} the text view. - * - * @see orion.editor.Ruler#setView - */ - getView: function() { - return this._view; - }, - /** - * Sets the view for the ruler. - *

      - * This method is called by the text view when the ruler - * is added to the view. - *

      - * - * @param {orion.editor.TextView} view the text view. - */ - setView: function (view) { - if (this._onTextModelChanged && this._view) { - this._view.removeEventListener("ModelChanged", this._listener.onTextModelChanged); //$NON-NLS-0$ - } - this._view = view; - if (this._onTextModelChanged && this._view) { - this._view.addEventListener("ModelChanged", this._listener.onTextModelChanged); //$NON-NLS-0$ - } - }, - }; - - /** - * Constructs a new ruler. - *

      - * The default implementation does not implement all the methods in the interface - * and is useful only for objects implementing rulers. - *

      - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model for the ruler. - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {String} [rulerOverview="page"] the overview for the ruler. - * @param {orion.editor.Style} [rulerStyle] the style for the ruler. - * - * @class This interface represents a ruler for the text view. - *

      - * A Ruler is a graphical element that is placed either on the left or on the right side of - * the view. It can be used to provide the view with per line decoration such as line numbering, - * bookmarks, breakpoints, folding disclosures, etc. - *

      - * There are two types of rulers: page and document. A page ruler only shows the content for the lines that are - * visible, while a document ruler always shows the whole content. - *

      - * See:
      - * {@link orion.editor.LineNumberRuler}
      - * {@link orion.editor.AnnotationRuler}
      - * {@link orion.editor.OverviewRuler}
      - * {@link orion.editor.TextView}
      - * {@link orion.editor.TextView#addRuler} - *

      - * @name orion.editor.Ruler - * @borrows orion.editor.AnnotationTypeList#addAnnotationType as #addAnnotationType - * @borrows orion.editor.AnnotationTypeList#getAnnotationTypePriority as #getAnnotationTypePriority - * @borrows orion.editor.AnnotationTypeList#getAnnotationsByType as #getAnnotationsByType - * @borrows orion.editor.AnnotationTypeList#isAnnotationTypeVisible as #isAnnotationTypeVisible - * @borrows orion.editor.AnnotationTypeList#removeAnnotationType as #removeAnnotationType - */ - function Ruler (annotationModel, rulerLocation, rulerOverview, rulerStyle) { - BaseRuler.call(this, rulerLocation, rulerOverview, rulerStyle); - var self = this; - this._listener = { - onTextModelChanged: function(e) { - self._onTextModelChanged(e); - }, - onAnnotationModelChanged: function(e) { - self._onAnnotationModelChanged(e); - } - }; - this.setAnnotationModel(annotationModel); - } - Ruler.prototype = objects.mixin(new BaseRuler(), /** @lends orion.editor.Ruler.prototype */ { - /** - * Returns the annotations for a given line range merging multiple - * annotations when necessary. - *

      - * This method is called by the text view when the ruler is redrawn. - *

      - * - * @param {Number} startLine the start line index - * @param {Number} endLine the end line index - * @return {orion.editor.Annotation[]} the annotations for the line range. The array might be sparse. - */ - getAnnotations: function(startLine, endLine) { - var annotationModel = this._annotationModel; - if (!annotationModel) { return []; } - var model = this._view.getModel(); - var start = model.getLineStart(startLine); - var end = model.getLineEnd(endLine - 1); - var baseModel = model; - if (model.getBaseModel) { - baseModel = model.getBaseModel(); - start = model.mapOffset(start); - end = model.mapOffset(end); - } - var result = []; - var annotations = this.getAnnotationsByType(annotationModel, start, end); - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var annotationLineStart = baseModel.getLineAtOffset(annotation.start); - var annotationLineEnd = baseModel.getLineAtOffset(Math.max(annotation.start, annotation.end - 1)); - for (var lineIndex = annotationLineStart; lineIndex<=annotationLineEnd; lineIndex++) { - var visualLineIndex = lineIndex; - if (model !== baseModel) { - var ls = baseModel.getLineStart(lineIndex); - ls = model.mapOffset(ls, true); - if (ls === -1) { continue; } - visualLineIndex = model.getLineAtOffset(ls); - } - if (!(startLine <= visualLineIndex && visualLineIndex < endLine)) { continue; } - var rulerAnnotation = this._mergeAnnotation(result[visualLineIndex], annotation, lineIndex - annotationLineStart, annotationLineEnd - annotationLineStart + 1); - if (rulerAnnotation) { - result[visualLineIndex] = rulerAnnotation; - } - } - } - if (!this._multiAnnotation && this._multiAnnotationOverlay) { - for (var k in result) { - if (result[k]._multiple) { - result[k].html = result[k].html + this._multiAnnotationOverlay.html; - } - } - } - return result; - }, - /** - * Returns the annotation model. - * - * @returns {orion.editor.AnnotationModel} the ruler annotation model. - * - * @see orion.editor.Ruler#setAnnotationModel - */ - getAnnotationModel: function() { - return this._annotationModel; - }, - /** - * Returns the widest annotation which determines the width of the ruler. - *

      - * If the ruler does not have a fixed width it should provide the widest - * annotation to avoid the ruler from changing size as the view scrolls. - *

      - *

      - * This method is called by the text view when the ruler is redrawn. - *

      - * - * @returns {orion.editor.Annotation} the widest annotation. - * - * @see orion.editor.Ruler#getAnnotations - */ - getWidestAnnotation: function() { - return null; - }, - /** - * Sets the annotation model for the ruler. - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model. - * - * @see orion.editor.Ruler#getAnnotationModel - */ - setAnnotationModel: function (annotationModel) { - if (this._annotationModel) { - this._annotationModel.removeEventListener("Changed", this._listener.onAnnotationModelChanged); //$NON-NLS-0$ - } - this._annotationModel = annotationModel; - if (this._annotationModel) { - this._annotationModel.addEventListener("Changed", this._listener.onAnnotationModelChanged); //$NON-NLS-0$ - } - }, - /** - * Sets the annotation that is displayed when a given line contains multiple - * annotations. This annotation is used when there are different types of - * annotations in a given line. - * - * @param {orion.editor.Annotation} annotation the annotation for lines with multiple annotations. - * - * @see orion.editor.Ruler#setMultiAnnotationOverlay - */ - setMultiAnnotation: function(annotation) { - this._multiAnnotation = annotation; - }, - /** - * Sets the annotation that overlays a line with multiple annotations. This annotation is displayed on - * top of the computed annotation for a given line when there are multiple annotations of the same type - * in the line. It is also used when the multiple annotation is not set. - * - * @param {orion.editor.Annotation} annotation the annotation overlay for lines with multiple annotations. - * - * @see orion.editor.Ruler#setMultiAnnotation - */ - setMultiAnnotationOverlay: function(annotation) { - this._multiAnnotationOverlay = annotation; - }, - /** - * This event is sent when the user clicks a line annotation. We select an annotation on the line using - * the following logic: - * 1) If no selection or selection is on another line, select the first annotation - * 2) If an annotation is selected, select the next annotation in the model - * 3) If there is a selection that does not match an annotation, select the first annotation after the selection start - * - * @event - * @param {Number} lineIndex the line index of the annotation under the pointer. - * @param {DOMEvent} e the click event. - */ - onClick: function(lineIndex, e) { - if (lineIndex === undefined) { return; } - var view = this._view; - - var model = view.getModel(); - var lineStart = model.getLineStart(lineIndex); - var lineEnd = model.getLineEnd(lineIndex, true); - var selectionStart = view.getSelection().start; - var selectionEnd = view.getSelection().end; - - var annotationModel = this._annotationModel; - var annotation, start, end; - if (annotationModel){ - - if (model.getBaseModel) { - lineStart = model.mapOffset(lineStart); - lineEnd = model.mapOffset(lineEnd); - selectionStart = model.mapOffset(selectionStart); - selectionEnd = model.mapOffset(selectionEnd); - } - - var self = this; - annotation = this._findNextAnnotation(annotationModel, lineStart, lineEnd, selectionStart, selectionEnd, - function(annotationType){ - return self.isAnnotationTypeVisible(annotationType); - } - ); - // Select the annotation or the start of the line - start = annotation ? annotation.start : lineStart; - end = annotation ? annotation.end : lineStart; - - if (model.getBaseModel) { - start = model.mapOffset(start, true); - end = model.mapOffset(end, true); - } - - // TODO What does this code do - if (annotation && annotation.groupId !== undefined) { - if (this._currentClickGroup === annotation.groupId) { - this._currentClickGroup = null; - } else { - this._currentClickGroup = annotation.groupId; - } - this._setCurrentGroup(lineIndex); - } - } - - // Set the selection before opening the tooltip otherwise the tooltip will be closed immediately - this._view.setSelection(end, start, 1/3, function(){}); - - // Open the tooltip for the selected annotation in the same location as the multi-annotation ruler tooltip. - var tooltip = mTooltip.Tooltip.getTooltip(this._view); - if (tooltip) { - if (annotation && this.getLocation() === "left"){ //$NON-NLS-0$ - tooltip.show({getTooltipInfo: function() { - return self._getTooltipInfo([annotation]); - } - }, false, false); - } else { - tooltip.hide(); - } - } - }, - /** - * This event is sent when the user double clicks a line annotation. - * - * @event - * @param {Number} lineIndex the line index of the annotation under the pointer. - * @param {DOMEvent} e the double click event. - * @callback - */ - onDblClick: function(lineIndex, e) { - }, - /** - * This event is sent when the user moves the mouse over a line annotation. - * - * @event - * @param {Number} lineIndex the line index of the annotation under the pointer. - * @param {DOMEvent} e the mouse move event. - */ - onMouseMove: function(lineIndex, e) { - var tooltip = mTooltip.Tooltip.getTooltip(this._view); - if (!tooltip) { return; } - if (tooltip.isVisible() && this._tooltipLineIndex === lineIndex) { return; } - this._tooltipLineIndex = lineIndex; - - // Prevent spurious mouse event (e.g. on a scroll) - if (e.clientX === this._lastMouseX - && e.clientY === this._lastMouseY) { - return; - } - - this._lastMouseX = e.clientX; - this._lastMouseY = e.clientY; - - if (this._hoverTimeout) { - window.clearTimeout(this._hoverTimeout); - this._hoverTimeout = null; - } - - var target = e.target ? e.target : e.srcElement; - var bounds = target.getBoundingClientRect(); - this._curElementBounds = Object.create(null); - this._curElementBounds.top = bounds.top; - this._curElementBounds.left = bounds.left; - this._curElementBounds.height = bounds.height; - this._curElementBounds.width = bounds.width; - - // If we have the entire ruler selected, just use a 1 pixel high area in the ruler (Bug 463486) - if (target === this.node){ - this._curElementBounds.top = e.clientY; - this._curElementBounds.height = 1; - } - - var self = this; - self._hoverTimeout = window.setTimeout(function() { - self._hoverTimeout = null; - tooltip.onHover({ - getTooltipInfo: function() { - var annotations = self._getAnnotationsAtLineIndex(self._tooltipLineIndex); - var content = self._getTooltipContents(self._tooltipLineIndex, annotations); - return self._getTooltipInfo(content, e.clientY, {source: "ruler", rulerLocation: self.getLocation()}); //$NON-NLS-0$ - } - }, e.clientX, e.clientY); - }, 175); - }, - /** - * This event is sent when the mouse pointer enters a line annotation. - * - * @event - * @param {Number} lineIndex the line index of the annotation under the pointer. - * @param {DOMEvent} e the mouse over event. - */ - onMouseOver: function(lineIndex, e) { - this.onMouseMove(lineIndex, e); - if (!this._currentClickGroup) { - this._setCurrentGroup(lineIndex); - } - }, - /** - * This event is sent when the mouse pointer exits a line annotation. - * - * @event - * @param {Number} lineIndex the line index of the annotation under the pointer. - * @param {DOMEvent} e the mouse out event. - * @callback - */ - onMouseOut: function(lineIndex, e) { - if (!this._currentClickGroup) { - this._setCurrentGroup(-1); - } - - if (this._hoverTimeout) { - window.clearTimeout(this._hoverTimeout); - this._hoverTimeout = null; - } - }, - /** - * @name _findNextAnnotation - * @description Looks at all annotations in the given range and attempt to find the next valid - * annotation after the current selection. - * @function - * @private - * @param annotationModel The annotation model to lookup annotations in - * @param rangeStart The start range to search for annotations (required) - * @param rangeEnd The end range to search for annotations (required) - * @param selectionStart The start of the current selection (optional) - * @param selectionEnd The end of the current selection (optional) - * @param isAnnotationTypeVisible A function callback to check if a given annotation type is valid or visible (optional) - * @returns The next annotation in the list or null - */ - _findNextAnnotation: function(annotationModel, rangeStart, rangeEnd, selectionStart, selectionEnd, isAnnotationTypeVisible){ - var annotation = null; - var selectedAnnotation; - var searchStart = rangeStart; - - if (selectionStart >= 0 && selectionEnd >= 0){ - if (selectionStart >= rangeStart && selectionStart < rangeEnd){ - searchStart = selectionStart; - var selectedAnnotations = annotationModel.getAnnotations(selectionStart, selectionEnd); - while (!selectedAnnotation && selectedAnnotations.hasNext()){ - var current = selectedAnnotations.next(); - if (isAnnotationTypeVisible && !isAnnotationTypeVisible(current.type)) { continue; } - if (current.start === selectionStart && current.end === selectionEnd){ - selectedAnnotation = current; - } - } - } - } - - var iter = annotationModel.getAnnotations(searchStart, rangeEnd); - var useNextValid; - while (iter.hasNext()){ - current = iter.next(); - if (isAnnotationTypeVisible && !isAnnotationTypeVisible(current.type)) { continue; } - // Default to first visible annotation - if (!annotation){ - annotation = current; - } - // If no selected annotation, use the first in the list - if (!selectedAnnotation){ - annotation = current; - break; - } - // If the selected annotation was found, use the next annotation - // NOTE: If two annotations have the same range, we skip to the next annotation so don't flip between them - if (useNextValid && (selectedAnnotation.start !== current.start || selectedAnnotation.end !== current.end)){ - useNextValid = false; - annotation = current; - break; - } - // Found the selected annotation, use the next in the list - if (selectedAnnotation && selectedAnnotation === current){ - useNextValid = true; - } - } - if (useNextValid){ - annotation = null; // Last annotation on the line was selected, go to line start - } - - return annotation; - }, - - _getAnnotationsAtLineIndex: function _getAnnotationsAtLineIndex(lineIndex){ - if (lineIndex === undefined) { return; } - var view = this._view; - var annotationModel = this._annotationModel; - var annotations = []; - var model; - - //check if the current view exists, if not return empty array - if (view) { - model = view.getModel(); - } else { - return []; - } - - // check if both model exists - if (annotationModel && model) { - var start = model.getLineStart(lineIndex); - var end = model.getLineEnd(lineIndex); - if (model.getBaseModel) { - start = model.mapOffset(start); - end = model.mapOffset(end); - } - annotations = this.getAnnotationsByType(annotationModel, start, end); - } - return annotations; - }, - /** @ignore */ - _getTooltipInfo: function(contents, y, context) { - if (!contents) { return null; } // TODO: shouldn't this check the length, it'll never be null - - var hoverArea = Object.create(null); - hoverArea.top = this._curElementBounds.top; - hoverArea.left = this._curElementBounds.left; - hoverArea.height = this._curElementBounds.height; - hoverArea.width = this._curElementBounds.width; - - if (typeof contents === 'string' && y) { - // Hack for line numbers - hoverArea.top = y; - hoverArea.height = 1; - } - - var rulerLocation = this.getLocation(); - var rulerStyle = this.getRulerStyle(); - // The tooltip is positioned opposite to where the ruler is - var position = rulerLocation === "left" ? "right" : "left"; //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - - var offsetX = 0; - var offsetY = 0; - if (this._view){ - var viewRect = this._view._clientDiv.getBoundingClientRect(); - offsetX = viewRect.left - (hoverArea.left + hoverArea.width); - } else { - offsetX = hoverArea.width; - } - offsetY = hoverArea.height; - if (position === "left") { - offsetX = -25; - // Hack for when the hoverArea is a sliver of the ruler, ruler is 2px wider than annotations - if (hoverArea.height === 1){ - offsetX += 2; - } - } - // Adjust the tooltip for folding comments to exactly cover the unfolded text location - if (rulerStyle.styleClass.indexOf("folding") >= 0){ //$NON-NLS-0$ - offsetY -= 14; - } - - var info = { - contents: contents, - position: position, - tooltipOffsetX: offsetX, - tooltipOffsetY: offsetY, - anchorArea: hoverArea, - context: context - }; - return info; - }, - /** - * @name _getTooltipContents - * @description Overridden by different rulers to provide customer tooltip content - * @function - * @private - * @param lineIndex - * @param annotations - * @returns returns - * @callback - */ - _getTooltipContents: function _getTooltipContents(lineIndex, annotations){ - return annotations; - }, - - _getOnClickTooltipInfo: function(annotation) { - var view = this._view; - var hoverArea = Object.create(null); - hoverArea.top = this._curElementBounds.top; - hoverArea.left = this._curElementBounds.left; - hoverArea.height = this._curElementBounds.height; - hoverArea.width = this._curElementBounds.width; - var rulerLocation = this.getLocation(); - var position = rulerLocation === "left" ? "right" : "left"; //$NON-NLS-0$ //$NON-NLS-1$ //$NON-NLS-2$ - var info = { - contents: [annotation], - position: position, - anchorArea: hoverArea - }; - - if (view){ - var viewRect = view._clientDiv.getBoundingClientRect(); - info.offsetX = viewRect.left - (hoverArea.left + hoverArea.width); - } else { - info.offsetX = hoverArea.width; - } - - info.offsetY = hoverArea.height; - if (info.position === "left") { - info.offsetX = 20; - } - return info; - }, - /** @ignore */ - _onAnnotationModelChanged: function(e) { - var view = this._view; - if (!view) { return; } - var model = view.getModel(), self = this; - var lineCount = model.getLineCount(); - if (e.textModelChangedEvent) { - var start = e.textModelChangedEvent.start; - if (model.getBaseModel) { start = model.mapOffset(start, true); } - var startLine = model.getLineAtOffset(start); - view.redrawLines(startLine, lineCount, self); - return; - } - function redraw(changes) { - for (var i = 0; i < changes.length; i++) { - if (!self.isAnnotationTypeVisible(changes[i].type)) { continue; } - start = changes[i].start; - var end = changes[i].end; - if (model.getBaseModel) { - start = model.mapOffset(start, true); - end = model.mapOffset(end, true); - } - if (start !== -1 && end !== -1) { - view.redrawLines(model.getLineAtOffset(start), model.getLineAtOffset(Math.max(start, end - 1)) + 1, self); - } - } - } - redraw(e.added); - redraw(e.removed); - redraw(e.changed); - }, - /** @ignore */ - _mergeAnnotation: function(result, annotation, annotationLineIndex, annotationLineCount) { - if (!result) { result = {}; } - if (annotationLineIndex === 0) { - if (result.html && annotation.html) { - if (annotation.html !== result.html) { - if (!result._multiple && this._multiAnnotation) { - result.html = this._multiAnnotation.html; - } - } - result._multiple = true; - } else { - result.html = annotation.html; - } - } - result.style = this._mergeStyle(result.style, annotation.style); - return result; - }, - /** @ignore */ - _mergeStyle: function(result, style) { - if (style) { - if (!result) { result = {}; } - if (result.styleClass && style.styleClass && result.styleClass !== style.styleClass) { - result.styleClass += " " + style.styleClass; //$NON-NLS-0$ - } else { - result.styleClass = style.styleClass; - } - var prop; - if (style.style) { - if (!result.style) { result.style = {}; } - for (prop in style.style) { - if (result.style[prop] === undefined) { - result.style[prop] = style.style[prop]; - } - } - } - if (style.attributes) { - if (!result.attributes) { result.attributes = {}; } - for (prop in style.attributes) { - if (result.attributes[prop] === undefined) { - result.attributes[prop] = style.attributes[prop]; - } - } - } - } - return result; - }, - _setCurrentGroup: function(lineIndex) { - var annotationModel = this._annotationModel; - var groupAnnotation = null; - var model = annotationModel.getTextModel(); - var annotation; - var annotations; - var currentGroupAnnotation = this._currentGroupAnnotation; - if (lineIndex !== -1) { - var start = model.getLineStart(lineIndex); - var end = model.getLineEnd(lineIndex); - if (model.getBaseModel) { - start = model.mapOffset(start); - end = model.mapOffset(end); - } - annotations = annotationModel.getAnnotations(start, end); - while(annotations.hasNext()){ - annotation = annotations.next(); - if (!this.isAnnotationTypeVisible(annotation.type)) { continue; } - if (annotation.start <= start && annotation.end >= end){ - if (annotation.groupId !== undefined) { - groupAnnotation = annotation; - break; - } - } - } - if (currentGroupAnnotation && groupAnnotation) { - if (currentGroupAnnotation.groupId === groupAnnotation.groupId) { - return; - } - } - } - this._currentGroupAnnotation = null; - if (currentGroupAnnotation) { - annotationModel.removeAnnotations(currentGroupAnnotation.groupType); - } - if (!groupAnnotation) { return; } - - if (lineIndex === -1) { return; } - this._currentGroupAnnotation = groupAnnotation; - annotations = annotationModel.getAnnotations(); - var add = []; - while (annotations.hasNext()) { - annotation = annotations.next(); - delete annotation.groupAnnotation; - if (annotation.groupId === groupAnnotation.groupId) { - annotation = annotation.createGroupAnnotation(); - add.push(annotation); - } - } - annotationModel.replaceAnnotations(null, add); - } - }); - mAnnotations.AnnotationTypeList.addMixin(Ruler.prototype); - - /** - * Constructs a new line numbering ruler. - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model for the ruler. - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {orion.editor.Style} [rulerStyle=undefined] the style for the ruler. - * @param {orion.editor.Style} [oddStyle={style: {backgroundColor: "white"}] the style for lines with odd line index. - * @param {orion.editor.Style} [evenStyle={backgroundColor: "white"}] the style for lines with even line index. - * - * @augments orion.editor.Ruler - * @class This objects implements a line numbering ruler. - * - *

      See:
      - * {@link orion.editor.Ruler} - *

      - * @name orion.editor.LineNumberRuler - */ - function LineNumberRuler (annotationModel, rulerLocation, rulerStyle, oddStyle, evenStyle) { - Ruler.call(this, annotationModel, rulerLocation, "page", rulerStyle); //$NON-NLS-0$ - this._oddStyle = oddStyle || {style: {backgroundColor: "white"}}; //$NON-NLS-0$ - this._evenStyle = evenStyle || {style: {backgroundColor: "white"}}; //$NON-NLS-0$ - this._numOfDigits = 0; - this._firstLine = 1; - } - LineNumberRuler.prototype = new Ruler(); - /** @ignore */ - LineNumberRuler.prototype.getAnnotations = function(startLine, endLine) { - var result = Ruler.prototype.getAnnotations.call(this, startLine, endLine); - var model = this._view.getModel(); - for (var lineIndex = startLine; lineIndex < endLine; lineIndex++) { - var style = (lineIndex - this._firstLine) & 1 ? this._oddStyle : this._evenStyle; - var mapLine = lineIndex; - if (model.getBaseModel) { - var lineStart = model.getLineStart(mapLine); - mapLine = model.getBaseModel().getLineAtOffset(model.mapOffset(lineStart)); - } - if (!result[lineIndex]) { result[lineIndex] = {}; } - result[lineIndex].html = (this._firstLine + mapLine) + ""; - if (!result[lineIndex].style) { result[lineIndex].style = style; } - } - return result; - }; - /** @ignore */ - LineNumberRuler.prototype.getWidestAnnotation = function() { - var lineCount = this._view.getModel().getLineCount(); - return this.getAnnotations(lineCount - 1, lineCount)[lineCount - 1]; - }; - /** - * Sets the line index displayed for the first line. The default value is - * 1. - * - * @param {Number} [lineIndex=1] the first line index displayed - */ - LineNumberRuler.prototype.setFirstLine = function(lineIndex) { - this._firstLine = lineIndex !== undefined ? lineIndex : 1; - }; - /** @ignore */ - LineNumberRuler.prototype._onTextModelChanged = function(e) { - var start = e.start; - var model = this._view.getModel(); - var lineCount = model.getBaseModel ? model.getBaseModel().getLineCount() : model.getLineCount(); - var numOfDigits = ((this._firstLine + lineCount - 1)+"").length; - if (this._numOfDigits !== numOfDigits) { - this._numOfDigits = numOfDigits; - var startLine = model.getLineAtOffset(start); - this._view.redrawLines(startLine, model.getLineCount(), this); - } - }; - - /** - * @class This is class represents an annotation for the AnnotationRuler. - *

      - * See:
      - * {@link orion.editor.AnnotationRuler} - *

      - * - * @name orion.editor.Annotation - * - * @property {String} [html=""] The html content for the annotation, typically contains an image. - * @property {orion.editor.Style} [style] the style for the annotation. - * @property {orion.editor.Style} [overviewStyle] the style for the annotation in the overview ruler. - */ - /** - * Constructs a new annotation ruler. - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model for the ruler. - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {orion.editor.Style} [rulerStyle=undefined] the style for the ruler. - * @param {orion.editor.Annotation} [defaultAnnotation] the default annotation. - * - * @augments orion.editor.Ruler - * @class This objects implements an annotation ruler. - * - *

      See:
      - * {@link orion.editor.Ruler}
      - * {@link orion.editor.Annotation} - *

      - * @name orion.editor.AnnotationRuler - */ - function AnnotationRuler (annotationModel, rulerLocation, rulerStyle) { - Ruler.call(this, annotationModel, rulerLocation, "page", rulerStyle); //$NON-NLS-0$ - } - AnnotationRuler.prototype = new Ruler(); - - /** - * Constructs a new overview ruler. - *

      - * The overview ruler is used in conjunction with a AnnotationRuler, for each annotation in the - * AnnotationRuler this ruler displays a mark in the overview. Clicking on the mark causes the - * view to scroll to the annotated line. - *

      - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model for the ruler. - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {orion.editor.Style} [rulerStyle=undefined] the style for the ruler. - * - * @augments orion.editor.Ruler - * @class This objects implements an overview ruler. - * - *

      See:
      - * {@link orion.editor.AnnotationRuler}
      - * {@link orion.editor.Ruler} - *

      - * @name orion.editor.OverviewRuler - */ - function OverviewRuler (annotationModel, rulerLocation, rulerStyle) { - Ruler.call(this, annotationModel, rulerLocation, "document", rulerStyle); //$NON-NLS-0$ - } - OverviewRuler.prototype = new Ruler(); - - /** @ignore */ - OverviewRuler.prototype.getRulerStyle = function() { - var result = {style: {lineHeight: "1px", fontSize: "1px"}}; //$NON-NLS-1$ //$NON-NLS-0$ - result = this._mergeStyle(result, this._rulerStyle); - return result; - }; - /** @ignore */ - OverviewRuler.prototype._getTooltipContents = function(lineIndex, annotations) { - if (annotations && annotations.length === 0) { - var model = this._view.getModel(); - var mapLine = lineIndex; - if (model.getBaseModel) { - var lineStart = model.getLineStart(mapLine); - mapLine = model.getBaseModel().getLineAtOffset(model.mapOffset(lineStart)); - } - return util.formatMessage(messages.line, mapLine + 1); - } - return Ruler.prototype._getTooltipContents.call(this, lineIndex, annotations); - }; - /** @ignore */ - OverviewRuler.prototype._mergeAnnotation = function(previousAnnotation, annotation, annotationLineIndex, annotationLineCount) { - if (annotationLineIndex !== 0) { return undefined; } - var result = previousAnnotation; - if (!result) { - //TODO annotationLineCount does not work when there are folded lines - var height = 3 * annotationLineCount; - result = {html: " ", style: { style: {height: height + "px"}}}; //$NON-NLS-1$ //$NON-NLS-0$ - result.style = this._mergeStyle(result.style, annotation.overviewStyle); - } - return result; - }; - - /** - * Constructs a new folding ruler. - * - * @param {orion.editor.AnnotationModel} annotationModel the annotation model for the ruler. - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {orion.editor.Style} [rulerStyle=undefined] the style for the ruler. - * - * @augments orion.editor.Ruler - * @class This objects implements an overview ruler. - * - *

      See:
      - * {@link orion.editor.AnnotationRuler}
      - * {@link orion.editor.Ruler} - *

      - * @name orion.editor.OverviewRuler - */ - function FoldingRuler (annotationModel, rulerLocation, rulerStyle) { - AnnotationRuler.call(this, annotationModel, rulerLocation, rulerStyle); - } - FoldingRuler.prototype = new AnnotationRuler(); - - /** @ignore */ - FoldingRuler.prototype.onClick = /* @callback */ function(lineIndex, e) { - if (lineIndex === undefined) { return; } - var annotationModel = this._annotationModel; - if (!annotationModel) { return; } - var view = this._view; - var model = view.getModel(); - var start = model.getLineStart(lineIndex); - var end = model.getLineEnd(lineIndex, true); - if (model.getBaseModel) { - start = model.mapOffset(start); - end = model.mapOffset(end); - model = model.getBaseModel(); - } - var annotation, iter = annotationModel.getAnnotations(start, end); - while (!annotation && iter.hasNext()) { - var a = iter.next(); - if (!this.isAnnotationTypeVisible(a.type)) { continue; } - if (model.getLineAtOffset(a.start) !== model.getLineAtOffset(start)) { continue; } - annotation = a; - } - if (annotation) { - var tooltip = mTooltip.Tooltip.getTooltip(this._view); - if (tooltip) { - tooltip.hide(); - } - if (annotation.expanded) { - annotation.collapse(); - } else { - annotation.expand(); - } - } - }; - /** @ignore */ - FoldingRuler.prototype._getTooltipContents = function(lineIndex, annotations) { - if (annotations && annotations.length > 0) { - var view = this._view; - var model = view.getModel(); - var start = model.getLineStart(lineIndex); - if (model.getBaseModel) { - start = model.mapOffset(start); - model = model.getBaseModel(); - } - var mapLineIndex = model.getLineAtOffset(start); - for (var i = 0; i < annotations.length; i++) { - var a = annotations[i]; - if (!this.isAnnotationTypeVisible(a.type)) { continue; } - if (model.getLineAtOffset(a.start) !== mapLineIndex) { continue; } - if (annotations[i].expanded) { - break; - } - return AnnotationRuler.prototype._getTooltipContents.call(this, lineIndex, [a]); - } - } - return null; - }; - /** @ignore */ - FoldingRuler.prototype._onAnnotationModelChanged = function(e) { - if (e.textModelChangedEvent) { - AnnotationRuler.prototype._onAnnotationModelChanged.call(this, e); - return; - } - var view = this._view; - if (!view) { return; } - var model = view.getModel(), self = this, i; - var lineCount = model.getLineCount(), lineIndex = lineCount; - function redraw(changes) { - for (i = 0; i < changes.length; i++) { - if (!self.isAnnotationTypeVisible(changes[i].type)) { continue; } - var start = changes[i].start; - if (model.getBaseModel) { - start = model.mapOffset(start, true); - } - if (start !== -1) { - lineIndex = Math.min(lineIndex, model.getLineAtOffset(start)); - } - } - } - redraw(e.added); - redraw(e.removed); - redraw(e.changed); - var rulers = view.getRulers(); - for (i = 0; i < rulers.length; i++) { - view.redrawLines(lineIndex, lineCount, rulers[i]); - } - }; - - - /** - * Constructs a new zoom ruler. - * - * @param {String} [rulerLocation="left"] the location for the ruler. - * @param {orion.editor.Style} [rulerStyle=undefined] the style for the ruler. - * - * @augments orion.editor.Ruler - * @class This objects implements an overview ruler. - * - *

      See:
      - * {@link orion.editor.AnnotationRuler}
      - * {@link orion.editor.Ruler} - *

      - * @name orion.editor.OverviewRuler - */ - var ZoomRuler = function(rulerLocation, rulerStyle) { - BaseRuler.call(this, rulerLocation, "fixed", rulerStyle); //$NON-NLS-0$ - }; - - ZoomRuler.prototype = objects.mixin(new BaseRuler(), { - setView: function (view) { - this._destroy(); - BaseRuler.prototype.setView.call(this, view); - this._create(); - }, - _create: function() { - var textView = this.getView(); - if (!textView) return; - function getOptions(options) { - var rulerTheme = "textviewZoom"; //$NON-NLS-0$ - var theme = options.themeClass; - if (theme) { - theme = theme.replace(rulerTheme, ""); - if (theme) { theme = " " + theme; } //$NON-NLS-0$ - theme = rulerTheme + theme; - } else { - theme = rulerTheme; - } - options.themeClass = theme; - options.noScroll = true; - options.readonly = true; - return options; - } - var options = getOptions(textView.getOptions()); - options.parent = this.node; - var zoomView = this._zoomView = new mTextView.TextView(options); - zoomView._clientDiv.contentEditable = false; - zoomView.setModel(textView.getModel()); - var document = textView.getOptions("parent").ownerDocument; //$NON-NLS-0$ - var windowDiv = this._windowDiv = util.createElement(document, "div"); //$NON-NLS-0$ - windowDiv.className ="rulerZoomWindow"; //$NON-NLS-0$ - this.node.appendChild(windowDiv); - var border = parseInt(textUtil.getNodeStyle(windowDiv, "border-top-width", 0)) + //$NON-NLS-0$ - parseInt(textUtil.getNodeStyle(windowDiv, "border-bottom-width", 0)); //$NON-NLS-0$ - var that = this; - function updateWindow(scroll, p) { - var top = scroll.y * p.zoomFactor; - var height = p.clientHeight * p.zoomFactor; - that.top = top; - that.bottom = top + height; - top = zoomView.convert({y: top}, "document", "page").y; //$NON-NLS-1$ //$NON-NLS-0$ - top = top - that.node.getBoundingClientRect().top; - windowDiv.style.top = top + "px"; //$NON-NLS-0$ - windowDiv.style.height = (height - border) + "px"; //$NON-NLS-0$ - } - function getProps() { - var padding = textView._metrics.viewPadding; - var zoomPadding = textView._metrics.viewPadding; - var lineHeight = textView.getLineHeight(); - var zoomLineHeight = zoomView.getLineHeight(); - var lineCount = textView.getModel().getLineCount(); - var documentHeight = textView._lineHeight ? textView._scrollHeight : lineCount * lineHeight; - var zoomDocumentHeight = zoomView._lineHeight ? zoomView._scrollHeight : lineCount * zoomLineHeight; - var zoomFactor = zoomDocumentHeight / documentHeight; - var clientHeight = textView.getClientArea().height + padding.top + padding.bottom; - var zoomClientHeight = zoomView.getClientArea().height + zoomPadding.top + zoomPadding.bottom; - var windowHeight = clientHeight * zoomFactor; - var scrollWidth = textView._metrics.scrollWidth; - return { - zoomFactor: zoomFactor, - documentHeight: documentHeight, - zoomDocumentHeight: zoomDocumentHeight, - clientHeight: clientHeight, - zoomClientHeight: zoomClientHeight, - scrollWidth: scrollWidth, - windowHeight: windowHeight, - padding: padding - }; - } - function toZoom(scroll, p) { - return scroll.y * (p.zoomFactor + (p.windowHeight - p.clientHeight - p.scrollWidth) / p.documentHeight); - } - function updateScroll(scroll) { - scroll = scroll || {y: textView.getTopPixel()}; - var p = getProps(); - var y = toZoom(scroll, p); - zoomView.setTopPixel(y); - updateWindow(scroll, p); - } - function updateWidth(options) { - var width; - if (options.wrapMode && !options.wrapOffset && textView._metrics.charWidth) { - var div1 = util.createElement(document, "div"); //$NON-NLS-0$ - div1.style.position = "fixed"; //$NON-NLS-0$ - div1.style.left = "-1000px"; //$NON-NLS-0$ - zoomView._clientDiv.appendChild(div1); - div1.textContent = new Array(Math.ceil(textView.getClientArea().width / textView._metrics.charWidth) + 1).join("a"); //$NON-NLS-0$ - var rect1 = div1.getBoundingClientRect(); - width = Math.min(150, Math.ceil(rect1.right - rect1.left)) + "px"; //$NON-NLS-0$ - } else { - width = ""; - } - var oldWidth = that.node.style.width; - that.node.style.width = width; - return oldWidth !== width; - } - textView.addEventListener("Scroll", this._scrollListener = function(event) { //$NON-NLS-0$ - updateScroll(event.newValue); - }); - textView.addEventListener("Resize", this._resizeListener = function() { //$NON-NLS-0$ - updateWidth(zoomView.getOptions()); - updateScroll(); - }); - textView.addEventListener("Redraw", this._redrawListener = function(event) { //$NON-NLS-0$ - if (!event.ruler) { - zoomView.redrawLines(event.startLine, event.endLine); - } - }); - textView.addEventListener("Options", this._optionsListener = function(event) { //$NON-NLS-0$ - var options = getOptions(event.options); - zoomView.setOptions(options); - updateWidth(zoomView.getOptions()); - }); - zoomView.addEventListener("LineStyle", this._lineListener = function(e) { //$NON-NLS-0$ - textView.onLineStyle(e); - }); - function down(event, clientY, touch) { - if (touch || (that.top <= event.y && event.y <= that.bottom)) { - that.mouseDown = true; - that.delta = clientY - windowDiv.getBoundingClientRect().top + that.node.getBoundingClientRect().top; - } else { - var offset = zoomView.getOffsetAtLocation(event.x, event.y); - textView.setSelection(offset, offset, 0.5, function() {}); - } - } - function up() { - that.mouseDown = false; - } - function move(clientY) { - if (that.mouseDown) { - var p = getProps(); - var thumbPos = Math.min(p.zoomClientHeight - p.windowHeight, Math.max(0, clientY - that.delta)); - textView.setTopPixel(thumbPos * (p.documentHeight - p.clientHeight) / Math.min(p.zoomDocumentHeight, p.zoomClientHeight - p.windowHeight)); - } - } - function stop(event) { - event.preventDefault(); - } - if (util.isIOS || util.isAndroid) { - windowDiv.addEventListener("touchstart", function(event) { //$NON-NLS-0$ - var touches = event.touches; - if (touches.length === 1) { - down(event, event.touches[0].clientY, true); - event.preventDefault(); - } - }); - windowDiv.addEventListener("touchend", function(event) { //$NON-NLS-0$ - var touches = event.touches; - if (touches.length === 0) { - up(event); - } - }); - windowDiv.addEventListener("touchmove", function(event) { //$NON-NLS-0$ - var touches = event.touches; - if (touches.length === 1) { - move(event.touches[0].clientY); - } - }); - zoomView.addEventListener("TouchStart", function(event) { //$NON-NLS-0$ - if (event.touchCount === 1) { - down(event, event.event.touches[0].clientY); - stop(event); - } - }); -// windowDiv.style.pointerEvents = "none"; //$NON-NLS-0$ -// zoomView.addEventListener("TouchEnd", function(event) { //$NON-NLS-0$ -// if (event.touchCount === 0) { -// up(event); -// } -// }); -// zoomView.addEventListener("TouchMove", function(event) { //$NON-NLS-0$ -// if (event.touchCount === 1) { -// move(event.event.touches[0].clientY); -// } -// }); - } else { - windowDiv.style.pointerEvents = "none"; //$NON-NLS-0$ - zoomView.addEventListener("MouseDown", function(event) { //$NON-NLS-0$ - var e = event.event; - if (e.which ? e.button === 0 : e.button === 1) { - down(event, e.clientY); - } - stop(event); - }); - zoomView.addEventListener("MouseUp", function(event) { //$NON-NLS-0$ - up(event); - stop(event); - }); - zoomView.addEventListener("MouseMove", function(event) { //$NON-NLS-0$ - move(event.event.clientY); - stop(event); - }); - } - (document.defaultView || document.parentWindow).setTimeout(function() { - updateScroll(); - }, 0); - }, - _destroy: function() { - var textView = this.getView(); - if (textView) { - textView.removeEventListener("Scroll", this._scrollListener); //$NON-NLS-0$ - this._scrollListener = null; - textView.removeEventListener("Resize", this._resizeListener); //$NON-NLS-0$ - this._resizeListener = null; - textView.removeEventListener("Redraw", this._redrawListener); //$NON-NLS-0$ - this._redrawListener = null; - textView.removeEventListener("Options", this._optionsListener); //$NON-NLS-0$ - this._optionsListener = null; - } - var zoomView = this._zoomView; - if (zoomView) { - zoomView.removeEventListener("LineStyle", this._lineListener); //$NON-NLS-0$ - zoomView.setModel(null); - zoomView.destroy(); - this._zoomView = null; - } - } - }); - - return { - BaseRuler: BaseRuler, - Ruler: Ruler, - AnnotationRuler: AnnotationRuler, - LineNumberRuler: LineNumberRuler, - OverviewRuler: OverviewRuler, - FoldingRuler: FoldingRuler, - ZoomRuler: ZoomRuler, - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * Felipe Heidrich (IBM Corporation) - initial API and implementation - * Silenio Quarti (IBM Corporation) - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textDND", ['orion/util'], function(util) { //$NON-NLS-1$ //$NON-NLS-0$ - - function TextDND(view, undoStack) { - this._view = view; - this._undoStack = undoStack; - this._dragSelection = null; - this._dropOffset = -1; - this._dropText = null; - var self = this; - this._listener = { - onDragStart: function (evt) { - self._onDragStart(evt); - }, - onDragEnd: function (evt) { - self._onDragEnd(evt); - }, - onDragEnter: function (evt) { - self._onDragEnter(evt); - }, - onDragOver: function (evt) { - self._onDragOver(evt); - }, - onDrop: function (evt) { - self._onDrop(evt); - }, - onDestroy: function (evt) { - self._onDestroy(evt); - } - }; - view.addEventListener("DragStart", this._listener.onDragStart); //$NON-NLS-0$ - view.addEventListener("DragEnd", this._listener.onDragEnd); //$NON-NLS-0$ - view.addEventListener("DragEnter", this._listener.onDragEnter); //$NON-NLS-0$ - view.addEventListener("DragOver", this._listener.onDragOver); //$NON-NLS-0$ - view.addEventListener("Drop", this._listener.onDrop); //$NON-NLS-0$ - view.addEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - } - TextDND.prototype = { - destroy: function() { - var view = this._view; - if (!view) { return; } - view.removeEventListener("DragStart", this._listener.onDragStart); //$NON-NLS-0$ - view.removeEventListener("DragEnd", this._listener.onDragEnd); //$NON-NLS-0$ - view.removeEventListener("DragEnter", this._listener.onDragEnter); //$NON-NLS-0$ - view.removeEventListener("DragOver", this._listener.onDragOver); //$NON-NLS-0$ - view.removeEventListener("Drop", this._listener.onDrop); //$NON-NLS-0$ - view.removeEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - this._view = null; - }, - _onDestroy: function(e) { - this.destroy(); - }, - _onDragStart: function(e) { - var view = this._view; - var text = view.getSelectionText(); - if (text) { - this._dragSelection = view.getSelections(); - e.event.dataTransfer.effectAllowed = "copyMove"; //$NON-NLS-0$ - e.event.dataTransfer.setData("Text", text); //$NON-NLS-0$ - } - }, - _onDragEnd: function(e) { - if (this._dragSelection) { - var view = this._view; - var dropEffect = e.event.dataTransfer.dropEffect; - if (!util.isFirefox) { - if (dropEffect !== "none" || this._dropText) { //$NON-NLS-0$ - dropEffect = e.event.dataTransfer.dropEffect = this._dropEffect; - } - } - if (this._undoStack) { this._undoStack.startCompoundChange(); } - var move = dropEffect === "move"; //$NON-NLS-0$ - if (move) { - view.setText({text: "", selection: this._dragSelection}); - } - if (this._dropText) { - var text = this._dropText; - var offset = this._dropOffset; - if (move) { - this._dragSelection.forEach(function(selection) { - if (offset >= selection.end) { - offset -= selection.end - selection.start; - } else if (offset >= selection.start) { - offset = selection.start; - } - }); - } - view.setText(text, offset, offset); - view.setSelection(offset, offset + text.length); - this._dropText = null; - this._dropOffset = -1; - } - if (this._undoStack) { this._undoStack.endCompoundChange(); } - this._dragSelection = null; - } - }, - _onDragEnter: function(e) { - this._onDragOver(e); - }, - _onDragOver: function(e) { - var types = e.event.dataTransfer.types; - var allowed = !this._view.getOptions("readonly"); //$NON-NLS-0$ - if (allowed) { - if (types) { - allowed = types.contains ? - types.contains("text/plain") || types.contains("Text") : //$NON-NLS-1$ //$NON-NLS-0$ - types.indexOf("text/plain") !== -1 || types.indexOf("Text") !== -1; //$NON-NLS-1$ //$NON-NLS-0$ - } - } - if (!allowed) { - e.event.dataTransfer.dropEffect = "none"; //$NON-NLS-0$ - } else { - if (!util.isFirefox) { - var copy = util.isMac ? e.event.altKey : e.event.ctrlKey; - this._dropEffect = e.event.dataTransfer.dropEffect = copy ? "copy" : "move"; //$NON-NLS-1$ //$NON-NLS-0$ - } - } - }, - _onDrop: function(e) { - var view = this._view; - var text = e.event.dataTransfer.getData("Text"); //$NON-NLS-0$ - if (text) { - if (!util.isFirefox) { - e.event.dataTransfer.dropEffect = this._dropEffect; //$NON-NLS-1$ //$NON-NLS-0$ - } - var offset = view.getOffsetAtLocation(e.x, e.y); - if (this._dragSelection) { - this._dropOffset = offset; - this._dropText = text; - } else { - view.setText(text, offset, offset); - view.setSelection(offset, offset + text.length); - } - } - } - }; - - return {TextDND: TextDND}; -}); -/******************************************************************************* - * @license - * Copyright (c) 2013, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/linkedMode", [ - 'i18n!orion/editor/nls/messages', - 'orion/keyBinding', - 'orion/editor/keyModes', - 'orion/editor/annotations', - 'orion/objects', - 'orion/util' -], function(messages, mKeyBinding, mKeyModes, mAnnotations, objects) { - - var exports = {}; - - /** - * @name LinkedContentAssist - * @description Creates a new LinkedContentAssist object which is used for linked data in templates - * @constructor - * @param {Object} linkedData The linked data - * @returns A new LinkedContentAssist object - * @since 9.0 - */ - function LinkedContentAssist(linkedData) { - this._data = linkedData; - } - - LinkedContentAssist.prototype = { - /** - * @description Removes the prefix from the given string - * @function - * @param {String} prefix - * @param {String} string - * @returns {String} The substring after removing the prefix - */ - chop: function(prefix, string) { - return string.substring(prefix.length); - }, - - /** - * @callback - */ - computeProposals: function(buffer, offset, context) { - var prefix = context.prefix; - var proposals = []; - var linkedstyle = this._data.style ? this._data.style : null; - linkedstyle = linkedstyle ? linkedstyle : 'emphasis'; //$NON-NLS-1$ - var values = this._data.values; - for (var i = 0; i < values.length; i++) { - var val = values[i]; - if(typeof val === 'string' && val.indexOf(prefix) === 0) { - proposals.push({proposal: this.chop(prefix, val), - description: val, - hover: val, - style: linkedstyle - }); - } else if(typeof val === 'object' && val.proposal) { - proposals.push({proposal: this.chop(prefix, val.proposal), - description: val.description ? val.description : val.proposal, - hover: val.hover ? val.hover : val.proposal, - style: linkedstyle - }); - } - } - var linkedtitle = this._data.title ? this._data.title : null; - if (0 < proposals.length) { - proposals.splice(0, 0,{ - proposal: '', - description: linkedtitle ? linkedtitle : 'Options', //$NON-NLS-0$ - style: 'noemphasis_title', //$NON-NLS-0$ - unselectable: true - }); - } - return proposals; - } - }; - - /** - * @name LinkedMode - * @description Create a new LinkedMode - * @param {Editor} editor The backing editor - * @param {UndoStack} undoStack The undo stack - * @param contentAssist - * @returns returns - */ - function LinkedMode(editor, undoStack, contentAssist) { - var textView = editor.getTextView(); - mKeyModes.KeyMode.call(this, textView); - this.editor = editor; - this.undoStack = undoStack; - this.contentAssist = contentAssist; - - this.linkedModeModel = null; - - textView.setAction("linkedModeEnter", function() { //$NON-NLS-0$ - this.exitLinkedMode(true); - return true; - }.bind(this)); - textView.setAction("linkedModeCancel", function() { //$NON-NLS-0$ - this.exitLinkedMode(true); - return true; - }.bind(this)); - textView.setAction("linkedModeNextGroup", function() { //$NON-NLS-0$ - var model = this.linkedModeModel; - this.selectLinkedGroup((model.selectedGroupIndex + 1) % model.groups.length); - return true; - }.bind(this)); - textView.setAction("linkedModePreviousGroup", function() { //$NON-NLS-0$ - var model = this.linkedModeModel; - this.selectLinkedGroup(model.selectedGroupIndex > 0 ? model.selectedGroupIndex-1 : model.groups.length-1); - return true; - }.bind(this)); - - /** - * Listener called when Linked Mode is active. Updates position's offsets and length - * on user change. Also escapes the Linked Mode if the text buffer was modified outside of the Linked Mode positions. - */ - this.linkedModeListener = { - - onActivating: /* @callback */ function(evnt) { - if (this._groupContentAssistProvider) { - this.contentAssist.setProviders([this._groupContentAssistProvider]); - this.contentAssist.setProgress(null); - } - }.bind(this), - - onModelChanged: function(evnt) { - if (this.ignoreVerify) { return; } - - // Get the position being modified - var start = this.editor.mapOffset(evnt.start); - var model = this.linkedModeModel, positionChanged, changed; - while (model) { - positionChanged = this._getPositionChanged(model, start, start + evnt.removedCharCount); - changed = positionChanged.position; - if (changed === undefined || changed.model !== model) { - // The change has been done outside of the positions, exit the Linked Mode - this.exitLinkedMode(false); - model = this.linkedModeModel; - } else { - break; - } - } - if (!model) { return; } - - // Update position offsets for this change. Group changes are done in #onVerify - var deltaCount = 0; - var changeCount = evnt.addedCharCount - evnt.removedCharCount; - var sortedPositions = positionChanged.positions, position, pos; - for (var i = 0; i < sortedPositions.length; ++i) { - pos = sortedPositions[i]; - position = pos.position; - var inside = position.offset <= start && start <= position.offset + position.length; - if (inside && !pos.ansestor) { - position.offset += deltaCount; - position.length += changeCount; - deltaCount += changeCount; - } else { - position.offset += deltaCount; - if (pos.ansestor && inside) { - position.length += changeCount; - } - } - if (pos.escape) { - pos.model.escapePosition = position.offset; - } - } - this._updateAnnotations(sortedPositions); - }.bind(this), - - onVerify: function(evnt) { - if (this.ignoreVerify) { return; } - - // Get the position being modified - var start = this.editor.mapOffset(evnt.start); - var end = this.editor.mapOffset(evnt.end); - var model = this.linkedModeModel, positionChanged, changed; - while (model) { - positionChanged = this._getPositionChanged(model, start, end); - changed = positionChanged.position; - if (changed === undefined || changed.model !== model) { - // The change has been done outside of the positions, exit the Linked Mode - this.exitLinkedMode(false); - model = this.linkedModeModel; - } else { - break; - } - } - if (!model) { return; } - - // Make sure changes in a same group are compound - var undo = this._compoundChange; - if (undo) { - if (!(undo.owner.model === model && undo.owner.group === changed.group)) { - this.endUndo(); - this.startUndo(); - } - } else { - this.startUndo(); - } - - model.selectedGroupIndex = changed.group; - - // Update position offsets taking into account all positions in the same changing group - var deltaCount = 0; - var changeCount = evnt.text.length - (end - start); - var sortedPositions = positionChanged.positions, position, pos; - var deltaStart = start - changed.position.offset, deltaEnd = end - changed.position.offset; - for (var i = 0; i < sortedPositions.length; ++i) { - pos = sortedPositions[i]; - position = pos.position; - pos.oldOffset = position.offset; - if (pos.model === model && pos.group === changed.group) { - position.offset += deltaCount; - position.length += changeCount; - deltaCount += changeCount; - } else { - position.offset += deltaCount; - if (pos.ansestor) { - position.length += changed.count * changeCount; - } - } - if (pos.escape) { - pos.model.escapePosition = position.offset; - } - } - - // Cancel this modification and apply same modification to all positions in changing group - this.ignoreVerify = true; - for (i = sortedPositions.length - 1; i >= 0; i--) { - pos = sortedPositions[i]; - if (pos.model === model && pos.group === changed.group) { - this.editor.setText(evnt.text, pos.oldOffset + deltaStart , pos.oldOffset + deltaEnd, false); - } - } - this.ignoreVerify = false; - evnt.text = null; - this._updateAnnotations(sortedPositions); - }.bind(this) - }; - } - LinkedMode.prototype = new mKeyModes.KeyMode(); - objects.mixin(LinkedMode.prototype, { - /** - * @description Create the keybindings - * @function - * @returns {Array.} The keybindings - */ - createKeyBindings: function() { - var KeyBinding = mKeyBinding.KeyBinding; - var bindings = []; - bindings.push({actionID: "linkedModeEnter", keyBinding: new KeyBinding(13)}); //$NON-NLS-0$ - bindings.push({actionID: "linkedModeCancel", keyBinding: new KeyBinding(27)}); //$NON-NLS-0$ - bindings.push({actionID: "linkedModeNextGroup", keyBinding: new KeyBinding(9)}); //$NON-NLS-0$ - bindings.push({actionID: "linkedModePreviousGroup", keyBinding: new KeyBinding(9, false, true)}); //$NON-NLS-0$ - return bindings; - }, - /** - * Starts Linked Mode, selects the first position and registers the listeners. - * @param {Object} linkedModeModel An object describing the model to be used by linked mode. - * Contains one or more position groups. If a position in a group is edited, the other positions in - * the same group are edited the same way. The model structure is as follows: - *
      {
      -		 *		groups: [{
      -		 *			data: {},
      -		 *			positions: [{
      -		 *				offset: 10, // Relative to the text buffer
      -		 *				length: 3
      -		 *			}]
      -		 *		}],
      -		 *		escapePosition: 19, // Relative to the text buffer
      -		 * }
      - * - * Each group in the model has an optional data property which can be - * used to provide additional content assist for the group. The type in - * data determines what kind of content assist is provided. These are the support - * structures for the data property. - *
      {
      -		 *		type: "link"
      -		 *		values: ["proposal0", "proposal1", ...]
      -		 * }
      - * - * The "link" data struture provides static content assist proposals stored in the - * values property. - * - *

      - * See:
      - * {@link orion.editor.Template}
      - * {@link orion.editor.TemplateContentAssist}
      - *

      - */ - enterLinkedMode: function(linkedModeModel) { - if (!this.linkedModeModel) { - var textView = this.editor.getTextView(); - textView.addKeyMode(this); - textView.addEventListener("Verify", this.linkedModeListener.onVerify); - textView.addEventListener("ModelChanged", this.linkedModeListener.onModelChanged); - var contentAssist = this.contentAssist; - contentAssist.addEventListener("Activating", this.linkedModeListener.onActivating); - this.editor.reportStatus(messages.linkedModeEntered, null, true); - } - this._sortedPositions = null; - if (this.linkedModeModel) { - linkedModeModel.previousModel = this.linkedModeModel; - linkedModeModel.parentGroup = this.linkedModeModel.selectedGroupIndex; - this.linkedModeModel.nextModel = linkedModeModel; - } - this.linkedModeModel = linkedModeModel; - this.selectLinkedGroup(0); - }, - /** - * Exits Linked Mode. Optionally places the caret at linkedMode escapePosition. - * @param {Boolean} [escapePosition=false] if true, place the caret at the escape position. - */ - exitLinkedMode: function(escapePosition) { - if (!this.isActive()) { - return; - } - if (this._compoundChange) { - this.endUndo(); - this._compoundChange = null; - } - this._sortedPositions = null; - var model = this.linkedModeModel; - this.linkedModeModel = model.previousModel; - model.parentGroup = model.previousModel = undefined; - if (this.linkedModeModel) { - this.linkedModeModel.nextModel = undefined; - } - if (!this.linkedModeModel) { - var editor = this.editor; - var textView = editor.getTextView(); - textView.removeKeyMode(this); - textView.removeEventListener("Verify", this.linkedModeListener.onVerify); - textView.removeEventListener("ModelChanged", this.linkedModeListener.onModelChanged); - var contentAssist = this.contentAssist; - contentAssist.removeEventListener("Activating", this.linkedModeListener.onActivating); - contentAssist.offset = undefined; - this.editor.reportStatus(messages.linkedModeExited, null, true); - } - if (escapePosition && typeof model.escapePosition === "number") { - editor.setCaretOffset(model.escapePosition, false); - } - this.selectLinkedGroup(0); - }, - /** - * @description Start undoing - */ - startUndo: function() { - if (this.undoStack) { - var slf = this; - var model = this.linkedModeModel; - this._compoundChange = this.undoStack.startCompoundChange({ - model: model, - group: model.selectedGroupIndex, - /** - * @callback - */ - end: function() { - slf._compoundChange = null; - } - }); - } - }, - /** - * @description Ends the undo - */ - endUndo: function() { - if (this.undoStack) { - this.undoStack.endCompoundChange(); - } - }, - /** - * @description Returns if linked mode is active in the current editor - * @function - * @returns {Boolean} If linked mode is active - */ - isActive: function() { - return !!this.linkedModeModel; - }, - /** - * @description Returns if linked mode status is active in the current editor - * @function - * @returns {Boolean} If linked mode status is active - */ - isStatusActive: function() { - return !!this.linkedModeModel; - }, - /** - * @description Selects the group of the given index from the currently active model - * @param {Number} index The group index to select - */ - selectLinkedGroup: function(index) { - var model = this.linkedModeModel; - if (model) { - model.selectedGroupIndex = index; - var group = model.groups[index]; - var position = group.positions[0]; - var editor = this.editor; - editor.setSelection(position.offset, position.offset + position.length); - var contentAssist = this.contentAssist; - if (contentAssist) { - contentAssist.offset = undefined; - if (group.data && group.data.type === "link" && group.data.values) { - var provider = this._groupContentAssistProvider = new LinkedContentAssist(group.data); - /** - * @callback - */ - provider.getPrefix = function() { - var selection = editor.getSelection(); - if (selection.start === selection.end) { - var caretOffset = editor.getCaretOffset(); - if (position.offset <= caretOffset && caretOffset <= position.offset + position.length) { - return editor.getText(position.offset, caretOffset); - } - } - return ""; - }; - contentAssist.offset = position.offset; - contentAssist.deactivate(); - contentAssist.activate(); - } else if (this._groupContentAssistProvider) { - this._groupContentAssistProvider = null; - contentAssist.deactivate(); - } - } - } - this._updateAnnotations(); - }, - /** - * @description Collect all model positions into the all array - * @function - * @private - * @param {Array.} all The collector for the position objects - * @param {Object} model The linked model to collect all positions from - * @param {Object} delta The change in position - */ - _getModelPositions: function(all, model, delta) { - var groups = model.groups; - for (var i = 0; i < groups.length; i++) { - var positions = groups[i].positions; - for (var j = 0; j < positions.length; j++) { - var position = positions[j]; - if (delta) { - position = {offset: position.offset + delta, length: position.length}; - } - var pos = { - index: j, - group: i, - count: positions.length, - model: model, - position: position - }; - all.push(pos); - if (model.nextModel && model.nextModel.parentGroup === i) { - pos.ansestor = true; - this._getModelPositions(all, model.nextModel, (delta || 0) + positions[j].offset - positions[0].offset); - } - } - } - }, - /** - * @description Returns an array of all of the positions sorted - * @function - * @private - * @param {Object} model The linked model to get and sort positions from - * @returns {Array.} The sorted array of positions from the given model - */ - _getSortedPositions: function(model) { - var all = this._sortedPositions; - if (!all) { - all = []; - // Get the root linked model - while (model.previousModel) { - model = model.previousModel; - } - // Get all positions under model expanding group positions of stacked linked modes - this._getModelPositions(all, model); - // Add escape position for all models - while (model) { - if (typeof model.escapePosition === "number") { - all.push({ - escape: true, - model: model, - position: {offset: model.escapePosition, length: 0} - }); - } - model = model.nextModel; - } - all.sort(function(a, b) { - return a.position.offset - b.position.offset; - }); - this._sortedPositions = all; - } - return all; - }, - /** - * @description Returns if the given start - end position has changed in the given model - * @function - * @private - * @param {Object} model The model to check - * @param {Number} start The start - * @param {Number} end The end - * @returns {Object} The changed position - */ - _getPositionChanged: function(model, start, end) { - var changed; - var sortedPositions = this._getSortedPositions(model); - for (var i = sortedPositions.length - 1; i >= 0; i--) { - if (sortedPositions[i].escape) { - continue; - } - var position = sortedPositions[i].position; - if (position.offset <= start && end <= position.offset + position.length) { - changed = sortedPositions[i]; - break; - } - } - return {position: changed, positions: sortedPositions}; - }, - /** - * @description Updates the editor annotations based on the given positions - * @function - * @private - * @param {Array.} positions The positions - */ - _updateAnnotations: function(positions) { - var annotationModel = this.editor.getAnnotationModel(); - if (!annotationModel) { return; } - var remove = [], add = []; - var annotations = annotationModel.getAnnotations(), annotation; - while (annotations.hasNext()) { - annotation = annotations.next(); - switch (annotation.type) { - case mAnnotations.AnnotationType.ANNOTATION_LINKED_GROUP: - case mAnnotations.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP: - case mAnnotations.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP: - remove.push(annotation); - } - } - var model = this.linkedModeModel; - if (model) { - positions = positions || this._getSortedPositions(model); - for (var i = 0; i < positions.length; i++) { - var position = positions[i]; - if (position.model !== model) { continue; } - if (position.escape) { continue; } - var type = mAnnotations.AnnotationType.ANNOTATION_LINKED_GROUP; - if (position.group === model.selectedGroupIndex) { - if (position.index === 0) { - type = mAnnotations.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP; - } else { - type = mAnnotations.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP; - } - } - position = position.position; - annotation = mAnnotations.AnnotationType.createAnnotation(type, position.offset, position.offset + position.length, ""); - add.push(annotation); - } - } - annotationModel.replaceAnnotations(remove, add); - } - }); - exports.LinkedMode = LinkedMode; - - return exports; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/factories", [ //$NON-NLS-0$ - 'orion/editor/actions', //$NON-NLS-0$ - 'orion/editor/undoStack', //$NON-NLS-0$ - 'orion/editor/rulers', //$NON-NLS-0$ - 'orion/editor/annotations', //$NON-NLS-0$ - 'orion/editor/textDND', //$NON-NLS-0$ - 'orion/editor/linkedMode', //$NON-NLS-0$ - 'orion/util' //$NON-NLS-0$ -], function(mActions, mUndoStack, mRulers, mAnnotations, mTextDND, mLinkedMode, util) { - - var exports = {}; - - function KeyBindingsFactory() { - } - KeyBindingsFactory.prototype = { - createKeyBindings: function(editor, undoStack, contentAssist, searcher) { - // Create keybindings for generic editing, no dependency on the service model - var textActions = new mActions.TextActions(editor, undoStack , searcher); - // Linked Mode - var linkedMode = new mLinkedMode.LinkedMode(editor, undoStack, contentAssist); - // create keybindings for source editing - // TODO this should probably be something that happens more dynamically, when the editor changes input - var sourceCodeActions = new mActions.SourceCodeActions(editor, undoStack, contentAssist, linkedMode); - return { - textActions: textActions, - linkedMode: linkedMode, - sourceCodeActions: sourceCodeActions - }; - } - }; - exports.KeyBindingsFactory = KeyBindingsFactory; - - function UndoFactory() { - } - UndoFactory.prototype = { - createUndoStack: function(editor) { - var textView = editor.getTextView(); - return new mUndoStack.UndoStack(textView, 200); - } - }; - exports.UndoFactory = UndoFactory; - - function LineNumberRulerFactory() { - } - LineNumberRulerFactory.prototype = { - createLineNumberRuler: function(annotationModel) { - return new mRulers.LineNumberRuler(annotationModel, "left", {styleClass: "ruler lines"}, {styleClass: "rulerLines odd"}, {styleClass: "rulerLines even"}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - }; - exports.LineNumberRulerFactory = LineNumberRulerFactory; - - function FoldingRulerFactory() { - } - FoldingRulerFactory.prototype = { - createFoldingRuler: function(annotationModel) { - return new mRulers.FoldingRuler(annotationModel, "left", {styleClass: "ruler folding"}); //$NON-NLS-1$ //$NON-NLS-0$ - } - }; - exports.FoldingRulerFactory = FoldingRulerFactory; - - function ZoomRulerFactory() { - } - ZoomRulerFactory.prototype = { - createZoomRuler: function(annotationModel) { - return new mRulers.ZoomRuler(util.isIOS || util.isAndroid ? "right" : "innerRight", {styleClass: "ruler zoom"}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - }; - exports.ZoomRulerFactory = ZoomRulerFactory; - - function AnnotationFactory() { - } - AnnotationFactory.prototype = { - createAnnotationModel: function(model) { - return new mAnnotations.AnnotationModel(model); - }, - createAnnotationStyler: function(annotationModel, view) { - return new mAnnotations.AnnotationStyler(annotationModel, view); - }, - createAnnotationRulers: function(annotationModel) { - var annotationRuler = new mRulers.AnnotationRuler(annotationModel, "left", {styleClass: "ruler annotations"}); //$NON-NLS-1$ //$NON-NLS-0$ - var overviewRuler = new mRulers.OverviewRuler(annotationModel, "right", {styleClass: "ruler overview"}); //$NON-NLS-1$ //$NON-NLS-0$ - return {annotationRuler: annotationRuler, overviewRuler: overviewRuler}; - } - }; - exports.AnnotationFactory = AnnotationFactory; - - function TextDNDFactory() { - } - TextDNDFactory.prototype = { - createTextDND: function(editor, undoStack) { - return new mTextDND.TextDND(editor.getTextView(), undoStack); - } - }; - exports.TextDNDFactory = TextDNDFactory; - - return exports; -}); -/******************************************************************************* - * @license - * Copyright (c) 2011, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/editorFeatures", [ //$NON-NLS-0$ - 'orion/editor/factories', //$NON-NLS-0$ - 'orion/editor/actions', //$NON-NLS-0$ - 'orion/editor/linkedMode', //$NON-NLS-0$ - 'orion/objects' //$NON-NLS-0$ -], function(mFactories, mActions, mLinkedMode, objects) { - return objects.mixin({}, mFactories, mActions, mLinkedMode); -}); - -/** - * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked - */ - -;(function() { - -/** - * Block-Level Grammar - */ - -var block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, - nptable: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, - def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, - text: /^[^\n]+/ -}; - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); - -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') - ('def', '\\n+(?=' + block.def.source + ')') - (); - -block.blockquote = replace(block.blockquote) - ('def', block.def) - (); - -block._tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; - -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /])*?>/) - (/tag/g, block._tag) - (); - -block.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('blockquote', block.blockquote) - ('tag', '<' + block._tag) - ('def', block.def) - (); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, - paragraph: /^/ -}); - -block.gfm.paragraph = replace(block.paragraph) - ('(?!', '(?!' - + block.gfm.fences.source.replace('\\1', '\\2') + '|' - + block.list.source.replace('\\1', '\\3') + '|') - (); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ -}); - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = []; - this.tokens.links = {}; - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -Lexer.prototype.lex = function(src) { - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') - .replace(/\u2424/g, '\n'); - - return this.token(src, true); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , bull - , b - , item - , space - , i - , l; - - while (src) { - // newline - if (cap = this.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this.tokens.push({ - type: 'space' - }); - } - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - cap = cap[0].replace(/^ {4}/gm, ''); - this.tokens.push({ - type: 'code', - text: !this.options.pedantic - ? cap.replace(/\n+$/, '') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this.rules.fences.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] - }); - continue; - } - - // heading - if (cap = this.rules.heading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // table no leading pipe (gfm) - if (top && (cap = this.rules.nptable.exec(src))) { - src = src.substring(cap[0].length); - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/\n$/, '').split('\n') - }; - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // lheading - if (cap = this.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // hr - if (cap = this.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top, true); - - this.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = this.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - - this.tokens.push({ - type: 'list_start', - ordered: bull.length > 1 - }); - - // Get each top-level item. - cap = cap[0].match(this.rules.item); - - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) loose = next; - } - - this.tokens.push({ - type: loose - ? 'loose_item_start' - : 'list_item_start' - }); - - // Recurse. - this.token(item, false, bq); - - this.tokens.push({ - type: 'list_item_end' - }); - } - - this.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - if (cap = this.rules.html.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: this.options.sanitize - ? 'paragraph' - : 'html', - pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', - text: cap[0], - /* the following line is added by Orion (10/03/2015) */ - isHTML: true - }); - continue; - } - - // def - if ((!bq && top) && (cap = this.rules.def.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.links[cap[1].toLowerCase()] = { - href: cap[2], - title: cap[3] - }; - - /* the following line is added by Orion (14/10/2014) */ - this.tokens.push({ - type: 'def', - id: cap[1].toLowerCase(), - href: cap[2], - title: cap[3] - }); - - continue; - } - - // table (gfm) - if (top && (cap = this.rules.table.exec(src))) { - src = src.substring(cap[0].length); - - item = { - type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') - }; - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */); - } - - this.tokens.push(item); - - continue; - } - - // top-level paragraph - if (top && (cap = this.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[(inside)\]\(href\)/, - reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, - del: noop, - text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; - -inline.link = replace(inline.link) - ('inside', inline._inside) - ('href', inline._href) - (); - -inline.reflink = replace(inline.reflink) - ('inside', inline._inside) - (); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape)('])', '~|])')(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - (']|', '~]|') - ('|', '|https?://|') - () -}); - -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br)('{2,}', '*')(), - text: replace(inline.gfm.text)('{2,}', '*')() -}); - -/** - * Inline Lexer & Compiler - */ - -function InlineLexer(links, options) { - this.options = options || marked.defaults; - this.links = links; - this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer; - this.renderer.options = this.options; - - if (!this.links) { - throw new - Error('Tokens array requires a `links` property.'); - } - - if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } - } else if (this.options.pedantic) { - this.rules = inline.pedantic; - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var out = '' - , link - , text - , href - , cap; - - while (src) { - // escape - if (cap = this.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += cap[1]; - continue; - } - - // autolink - if (cap = this.rules.autolink.exec(src)) { - src = src.substring(cap[0].length); - if (cap[2] === '@') { - text = cap[1].charAt(6) === ':' - ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]); - href = this.mangle('mailto:') + text; - } else { - text = escape(cap[1]); - href = text; - } - out += this.renderer.link(href, null, text); - continue; - } - - // url (gfm) - if (!this.inLink && (cap = this.rules.url.exec(src))) { - src = src.substring(cap[0].length); - text = escape(cap[1]); - href = text; - out += this.renderer.link(href, null, text); - continue; - } - - // tag - if (cap = this.rules.tag.exec(src)) { - if (!this.inLink && /^/i.test(cap[0])) { - this.inLink = false; - } - src = src.substring(cap[0].length); - out += this.options.sanitize - ? escape(cap[0]) - : cap[0]; - continue; - } - - // link - if (cap = this.rules.link.exec(src)) { - src = src.substring(cap[0].length); - this.inLink = true; - out += this.outputLink(cap, { - href: cap[2], - title: cap[3] - }); - this.inLink = false; - continue; - } - - // reflink, nolink - if ((cap = this.rules.reflink.exec(src)) - || (cap = this.rules.nolink.exec(src))) { - src = src.substring(cap[0].length); - link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = this.links[link.toLowerCase()]; - if (!link || !link.href) { - out += cap[0].charAt(0); - src = cap[0].substring(1) + src; - continue; - } - this.inLink = true; - out += this.outputLink(cap, link); - this.inLink = false; - continue; - } - - // strong - if (cap = this.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[2] || cap[1])); - continue; - } - - // em - if (cap = this.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); - continue; - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[2], true)); - continue; - } - - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.del(this.output(cap[1])); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - src = src.substring(cap[0].length); - out += escape(this.smartypants(cap[0])); - continue; - } - - if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return out; -}; - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = escape(link.href) - , title = link.title ? escape(link.title) : null; - - return cap[0].charAt(0) !== '!' - ? this.renderer.link(href, title, this.output(cap[1])) - : this.renderer.image(href, title, escape(cap[1])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text; - return text - // em-dashes - .replace(/--/g, '\u2014') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - var out = '' - , l = text.length - , i = 0 - , ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || {}; -} - -Renderer.prototype.code = function(code, lang, escaped) { - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - if (!lang) { - return '
      '
      -      + (escaped ? code : escape(code, true))
      -      + '\n
      '; - } - - return '
      '
      -    + (escaped ? code : escape(code, true))
      -    + '\n
      \n'; -}; - -Renderer.prototype.blockquote = function(quote) { - return '
      \n' + quote + '
      \n'; -}; - -/* the following function definition is added by Orion (14/10/2014) */ -Renderer.prototype.def = function(id, href, title) { - return ''; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw) { - return '' - + text - + '\n'; -}; - -Renderer.prototype.hr = function() { - return this.options.xhtml ? '
      \n' : '
      \n'; -}; - -Renderer.prototype.list = function(body, ordered) { - var type = ordered ? 'ol' : 'ul'; - return '<' + type + '>\n' + body + '\n'; -}; - -Renderer.prototype.listitem = function(text) { - return '
    • ' + text + '
    • \n'; -}; - -Renderer.prototype.paragraph = function(text) { - return '

      ' + text + '

      \n'; -}; - -Renderer.prototype.table = function(header, body) { - return '\n' - + '\n' - + header - + '\n' - + '\n' - + body - + '\n' - + '
      \n'; -}; - -Renderer.prototype.tablerow = function(content) { - return '\n' + content + '\n'; -}; - -Renderer.prototype.tablecell = function(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align - ? '<' + type + ' style="text-align:' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; -}; - -// span level renderer -Renderer.prototype.strong = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.em = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.codespan = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.br = function() { - return this.options.xhtml ? '
      ' : '
      '; -}; - -Renderer.prototype.del = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.link = function(href, title, text) { - if (this.options.sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return ''; - } - if (prot.indexOf('javascript:') === 0) { - return ''; - } - } - var out = '
      '; - return out; -}; - -Renderer.prototype.image = function(href, title, text) { - var out = '' + text + '' : '>'; - return out; -}; - -/** - * Parsing & Compiling - */ - -function Parser(options) { - this.tokens = []; - this.token = null; - this.options = options || marked.defaults; - this.options.renderer = this.options.renderer || new Renderer; - this.renderer = this.options.renderer; - this.renderer.options = this.options; -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options, renderer) { - var parser = new Parser(options, renderer); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -Parser.prototype.parse = function(src) { - this.inline = new InlineLexer(src.links, this.options, this.renderer); - this.tokens = src.reverse(); - - var out = ''; - while (this.next()) { - out += this.tok(); - } - - return out; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this.next().text; - } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -Parser.prototype.tok = function() { - switch (this.token.type) { - case 'space': { - return ''; - } - - /* the following case is added by Orion (14/10/2014) */ - case 'def': { - return this.renderer.def( - this.token.id, - this.token.href, - this.token.title); - } - - case 'hr': { - return this.renderer.hr(); - } - case 'heading': { - return this.renderer.heading( - this.inline.output(this.token.text), - this.token.depth, - this.token.text); - } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); - } - case 'table': { - var header = '' - , body = '' - , i - , row - , cell - , flags - , j; - - // header - cell = ''; - for (i = 0; i < this.token.header.length; i++) { - flags = { header: true, align: this.token.align[i] }; - cell += this.renderer.tablecell( - this.inline.output(this.token.header[i]), - { header: true, align: this.token.align[i] } - ); - } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this.renderer.tablecell( - this.inline.output(row[j]), - { header: false, align: this.token.align[j] } - ); - } - - body += this.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - var body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - var body = '' - , ordered = this.token.ordered; - - while (this.next().type !== 'list_end') { - body += this.tok(); - } - - return this.renderer.list(body, ordered); - } - case 'list_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.token.type === 'text' - ? this.parseText() - : this.tok(); - } - - return this.renderer.listitem(body); - } - case 'loose_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.tok(); - } - - return this.renderer.listitem(body); - } - case 'html': { - var html = !this.token.pre && !this.options.pedantic - ? this.inline.output(this.token.text) - : this.token.text; - return this.renderer.html(html); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); - } - case 'text': { - return this.renderer.paragraph(this.parseText()); - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -function unescape(html) { - return html.replace(/&([#\w]+);/g, function(_, n) { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -function replace(regex, opt) { - regex = regex.source; - opt = opt || ''; - return function self(name, val) { - if (!name) return new RegExp(regex, opt); - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return self; - }; -} - -function noop() {} -noop.exec = noop; - -function merge(obj) { - var i = 1 - , target - , key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - - -/** - * Marked - */ - -function marked(src, opt, callback) { - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight - , tokens - , pending - , i = 0; - - try { - tokens = Lexer.lex(src, opt) - } catch (e) { - return callback(e); - } - - pending = tokens.length; - - var done = function() { - var out, err; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) return done(); - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); - } - return highlight(token.text, token.lang, function(err, code) { - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; - } - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.'; - if ((opt || marked.defaults).silent) { - return '

      An error occured:

      '
      -        + escape(e.message + '', true)
      -        + '
      '; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.defaults = { - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: false, - silent: false, - highlight: null, - langPrefix: 'lang-', - smartypants: false, - headerPrefix: '', - renderer: new Renderer, - xhtml: false -}; - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Renderer = Renderer; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -if (typeof exports === 'object') { - module.exports = marked; -} else if (typeof define === 'function' && define.amd) { - define('marked/marked',[],function() { return marked; }); -} else { - this.marked = marked; -} - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ - -define ('orion/hover',[ - 'marked/marked' -], function(Markdown) { - - function Hover(editor, hoverFactory) { - this.editor = editor; - this.hoverFactory = hoverFactory; - this.inputManager = hoverFactory.inputManager; - this.serviceRegistry = hoverFactory.serviceRegistry; - this.commandRegistry = hoverFactory.commandRegistry; - - this._qfToolbars = []; - } - - Hover.prototype = { - computeHoverInfo: function (context) { - var hoverInfo = []; - this.hoverFactory._applicableProviders.forEach(function(provider) { - var providerImpl = this.serviceRegistry.getService(provider); - if (providerImpl && providerImpl.computeHoverInfo) { - var editorContext = this.editor.getEditorContext(); - hoverInfo.push(providerImpl.computeHoverInfo(editorContext, context)); - } - }.bind(this)); - - return hoverInfo; - }, - - renderMarkDown: function(markDown) { - return Markdown(markDown, { - sanitize: true - }); - }, - - clearQuickFixes: function() { - this._qfToolbars.forEach(function(qfTB) { - qfTB.destroy(); - }); - this._qfToolbars = []; - }, - - // TODO The allAnnotations iterator was collected using editor API, currently unused as we instead just get the annotation model from the annotation itself (not official API) - renderQuickFixes: function(annotation, allAnnotations, parentDiv) { - if (!annotation || !parentDiv){ - return; - } - - var actionsDiv = document.createElement("div"); - actionsDiv.classList.add("commandList"); //$NON-NLS-0$ - parentDiv.appendChild(actionsDiv); - - var nodeList = []; - var metadata = this.inputManager.getFileMetadata(); - if (metadata){ - metadata.annotation = annotation; - this.commandRegistry.renderCommands("orion.edit.quickfix", actionsDiv, metadata, this.editor, 'quickfix', annotation, nodeList); //$NON-NLS-1$ //$NON-NLS-2$ - delete metadata.annotation; - } - } - - }; - - function HoverFactory(serviceRegistry, inputManager, commandRegistry) { - this.serviceRegistry = serviceRegistry; - this.inputManager = inputManager; - this.commandRegistry = commandRegistry; - - // Filter the plugins based on contentType... - this.filterHoverPlugins(); - - // Track changes to the input type and re-filter - this.inputManager.addEventListener("InputChanged", function() { - this.filterHoverPlugins(); - }.bind(this)); - } - HoverFactory.prototype = { - createHover: function(editor) { - return new Hover(editor, this); - }, - - filterHoverPlugins: function () { - this._applicableProviders = []; - var infoProviders = this.serviceRegistry.getServiceReferences("orion.edit.hover"); //$NON-NLS-0$ - for (var i = 0; i < infoProviders.length; i++) { - var providerRef = infoProviders[i]; - var contentType = this.inputManager.getContentType(); - if (contentType) { - var validTypes = providerRef.getProperty('contentType'); //$NON-NLS-0$ - if (validTypes && validTypes.indexOf(contentType.id) !== -1) { - this._applicableProviders.push(providerRef); - } - } - } - } - }; - - return {HoverFactory: HoverFactory}; -}); - - - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/contentAssist", [ //$NON-NLS-0$ - 'i18n!orion/editor/nls/messages', //$NON-NLS-0$ - 'orion/keyBinding', //$NON-NLS-0$ - 'orion/editor/keyModes', //$NON-NLS-0$ - 'orion/editor/eventTarget', //$NON-NLS-0$ - 'orion/Deferred', //$NON-NLS-0$ - 'orion/objects', //$NON-NLS-0$ - 'orion/editor/tooltip', //$NON-NLS-0$ - 'orion/editor/util', //$NON-NLS-0$ - 'orion/util', //$NON-NLS-0$ - 'orion/webui/littlelib', //$NON-NLS-0$ - 'orion/metrics' //$NON-NLS-0$ -], function(messages, mKeyBinding, mKeyModes, mEventTarget, Deferred, objects, mTooltip, textUtil, util, lib, mMetrics) { - /** - * @name orion.editor.ContentAssistProvider - * @class Interface defining a provider of content assist proposals. - */ - /** - * @memberOf orion.editor.ContentAssistProvider.prototype - * @function - * @name computeProposals - * @param {String} buffer The buffer being edited. - * @param {Number} offset The position in the buffer at which content assist is being requested. - * @param {orion.editor.ContentAssistProvider.Context} context - * @returns {Object[]} This provider's proposals for the given buffer and offset. - */ - /** - * @name orion.editor.ContentAssistProvider.Context - * @class - * @property {String} line The text of the line on which content assist is being requested. - * @property {String} prefix Any non-whitespace, non-symbol characters preceding the offset. - * @property {orion.editor.Selection} selection The current selection. - */ - - /** - * @name orion.editor.ContentAssist - * @class Provides content assist for a TextView. - * @description Creates a ContentAssist for a TextView. A ContentAssist consults a set of - * {@link orion.editor.ContentAssistProvider}s to obtain proposals for text that may be inserted into a - * TextView at a given offset.

      - * A ContentAssist is generally activated by its TextView action, at which point it computes the set of - * proposals available. It will re-compute the proposals in response to subsequent changes on the TextView - * (for example, user typing) for as long as the ContentAssist is active. A proposal may be applied by calling - * {@link #apply}, after which the ContentAssist becomes deactivated. An active ContentAssist may be deactivated - * by calling {@link #deactivate}.

      - * A ContentAssist dispatches events when it becomes activated or deactivated, and when proposals have been computed. - * @param {orion.editor.TextView} textView The TextView to provide content assist for. - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - /** - * Dispatched when a ContentAssist is about to be activated. - * @name orion.editor.ContentAssist#ActivatingEvent - * @event - */ - /** - * Dispatched when a ContentAssist is about to be deactivated. - * @name orion.editor.ContentAssist#DeactivatingEvent - * @event - */ - /** - * Dispatched when a ContentAssist has applied a proposal.

      This event's data field gives information - * about the proposal that was applied. - * @name orion.editor.ContentAssist#ProposalAppliedEvent - * @event - */ - /** - * Dispatched whenever a ContentAssist has obtained proposals from its providers.

      This event's - * data field gives information about the proposals. - * @name orion.editor.ContentAssist#ProposalsComputedEvent - * @event - */ - - // INACTIVE --Ctrl+Space--> ACTIVE --ModelChanging--> FILTERING - var State = { - INACTIVE: 1, - ACTIVE: 2, - FILTERING: 3 - }; - - var STYLES = { - selected : "selected", //$NON-NLS-0$ - hr : "proposal-hr", //$NON-NLS-0$ - emphasis : "proposal-emphasis", //$NON-NLS-0$ - noemphasis : "proposal-noemphasis", //$NON-NLS-0$ - noemphasis_keyword : "proposal-noemphasis-keyword", //$NON-NLS-0$ - noemphasis_title : "proposal-noemphasis-title", //$NON-NLS-0$ - noemphasis_title_keywords : "proposal-noemphasis-title-keywords", //$NON-NLS-0$ - dfault : "proposal-default" //$NON-NLS-0$ - }; - - /** - * @name ContentAssist - * @description Creates a new content assist manager for the given text view - * @param textView The text view to provide content assist for - * @param serviceRegistry Optional, used to look up page message service for status - */ - function ContentAssist(textView, serviceRegistry) { - this.textView = textView; - if (serviceRegistry){ - this.pageMessage = serviceRegistry.getService("orion.page.message"); //$NON-NLS-1$ - } - this.state = State.INACTIVE; - this.clearProviders(); - var self = this; - this._textViewListeners = { - onModelChanging: (function(event) { - this._latestModelChangingEvent = event; - if (event) { - this._updateFilterText(event); - } - }).bind(this), - onSelection: (function(event) { - if (this.isDeactivatingChange(this._latestModelChangingEvent, event)) { - this.setState(State.INACTIVE); - } else { - if (this.isActive()) { - if (this.state === State.ACTIVE) { - this.setState(State.FILTERING); - } - this.filterProposals(); - } - } - this._latestModelChangingEvent = null; - }).bind(this), - onScroll: (function(event) { - this.setState(State.INACTIVE); - }).bind(this) - }; - - textView.setKeyBinding(util.isMac ? new mKeyBinding.KeyBinding(' ', false, false, false, true) : new mKeyBinding.KeyBinding(' ', true), "contentAssist"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - textView.setKeyBinding(util.isMac ? new mKeyBinding.KeyBinding(' ', false, false, true, true) : new mKeyBinding.KeyBinding(' ', true, false, true), "contentAssist"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - textView.setAction("contentAssist", function() { //$NON-NLS-0$ - if (!textView.getOptions("readonly")) { //$NON-NLS-0$ - self.activate(); - } - return true; - }, {name: messages.contentAssist}); - } - ContentAssist.prototype = /** @lends orion.editor.ContentAssist.prototype */ { - /** - * Applies the given proposal to the TextView. - * @param {Object} [proposal] - * @returns {Boolean} true if the proposal was applied; false if no proposal was provided. - */ - apply: function(proposal) { - if (!proposal) { - return false; - } - - // now handle prefixes - // if there is a non-empty selection, then replace it, - // if overwrite is truthy, then also replace the prefix - var view = this.textView; - var sel = view.getSelection(); - var start = this._initialCaretOffset; - var mapStart = start; - var end = Math.max(sel.start, sel.end), mapEnd = end; - var model = view.getModel(); - if (model.getBaseModel) { - mapStart = model.mapOffset(mapStart); - mapEnd = model.mapOffset(mapEnd); - model = model.getBaseModel(); - } - - if (proposal.overwrite) { - if(typeof proposal.prefix === 'string') { - start = mapStart-proposal.prefix.length; - } else { - start = this.getPrefixStart(model, mapStart); - } - } - - var data = { - proposal: proposal, - start: mapStart, - end: mapEnd - }; - this.setState(State.INACTIVE); - var proposalText = typeof proposal === "string" ? proposal : proposal.proposal; //$NON-NLS-0$ - view.setText(proposalText, start, end); - if (proposal.additionalEdits) { - var edit; - for (var i = 0; i < proposal.additionalEdits.length; i++) { - edit = proposal.additionalEdits[i]; - view.setText(edit.text, edit.offset, edit.offset + edit.length); - } - } - this.dispatchEvent({type: "ProposalApplied", data: data}); //$NON-NLS-0$ - mMetrics.logEvent("contentAssist", "apply"); //$NON-NLS-1$ //$NON-NLS-0$ - return true; - }, - activate: function(providers, autoTriggered) { - if (this.state === State.INACTIVE) { - mMetrics.logEvent("contentAssist", "activate", undefined, autoTriggered ? 0 : 1); //$NON-NLS-1$ //$NON-NLS-0$ - this._autoTriggered = autoTriggered ? true : false; - this.setState(State.ACTIVE, providers); - } - }, - deactivate: function() { - this.setState(State.INACTIVE); - }, - /** @returns {orion.editor.TextView} */ - getTextView: function() { - return this.textView; - }, - /** @returns {Boolean} */ - isActive: function() { - return this.state === State.ACTIVE || this.state === State.FILTERING; - }, - /** @returns {Boolean} true if the event describes a change that should deactivate content assist. */ - isDeactivatingChange: function(/**orion.editor.ModelChangingEvent*/ event, selectionEvent) { - var isDeactivating = false; - - var selections = Array.isArray(selectionEvent.newValue) ? selectionEvent.newValue : [selectionEvent.newValue]; - var isPriorToInitialCaretOffset = selections[0].start < this._initialCaretOffset; - - if (isPriorToInitialCaretOffset || !event) { - isDeactivating = true; - } else if (event) { - isDeactivating = (event.removedLineCount > 0) || (event.addedLineCount > 0); - } - - return isDeactivating; - }, - /** @private */ - setState: function(state, /* Optional. Array of providers to pass to dispatched event.*/ providers) { - var eventType; - if (state === State.ACTIVE) { - eventType = "Activating"; //$NON-NLS-0$ - if (this._mode) { this._mode.setActive(true); } - } else if (state === State.INACTIVE) { - eventType = "Deactivating"; //$NON-NLS-0$ - if (this._mode) { this._mode.setActive(false); } - } - if (eventType) { - this.dispatchEvent({type: eventType, providers: providers}); - } - this.state = state; - this.onStateChange(state); - }, - setMode: function(mode) { - this._mode = mode; - }, - /** @private */ - onStateChange: function(state) { - if (state === State.INACTIVE) { - this._removeTextViewListeners(); - this._filterText = ""; - this._initialCaretOffset = -1; - this._computedProposals = null; - } else if (state === State.ACTIVE) { - this._filterText = ""; - this._addTextViewListeners(); - this.computeProposals(); - } - }, - /** - * Computes the proposals at the TextView's current caret offset. - */ - computeProposals: function() { - // figure out initial offset, it should be the minimum between - // the beginning of the selection and the current caret offset - var offset = this.textView.getCaretOffset(); - var sel = this.textView.getSelection(); - var selectionStart = Math.min(sel.start, sel.end); - this._initialCaretOffset = Math.min(offset, selectionStart); - this._computedProposals = null; - - this._computeProposals(this._initialCaretOffset).then(function(proposals) { - if (this.isActive()) { - var flatProposalArray = this._flatten(proposals); - //check if flattened proposals form a valid array with at least one entry - if (flatProposalArray && Array.isArray(flatProposalArray) && (0 < flatProposalArray.length)) { - this._computedProposals = proposals; - } - this.dispatchEvent({type: "ProposalsComputed", data: {proposals: flatProposalArray}, autoApply: !this._autoTriggered}); //$NON-NLS-0$ - if (this._computedProposals && this._filterText) { - // force filtering here because user entered text after - // computeProposals() was called but before the plugins - // returned the computed proposals - this.filterProposals(true); - } - } - }.bind(this)); - }, - /** @private */ - getPrefixStart: function(model, end) { - var index = end; - while (index > 0 && /[A-Za-z0-9_]/.test(model.getText(index - 1, index))) { - index--; - } - return index; - }, - handleError: function(error) { - if (typeof console !== "undefined") { //$NON-NLS-0$ - console.log("Error retrieving content assist proposals"); //$NON-NLS-0$ - console.log(error && error.stack); - } - }, - /** - * Initializes the providers. A provider must define an initialize() method to be initialized. - * @since 6.0 - */ - initialize: function() { - this._providers.forEach(function(info) { - var provider = info.provider; - if (typeof provider.initialize === "function") {//$NON-NLS-0$ - provider.initialize(); - } - }); - }, - /** - * Retrieves the proposals at the given offset. - * @private - * @param {Number} offset The caret offset. - * @returns {Deferred} A promise that will provide the proposals. - */ - _computeProposals: function(offset) { - var providerInfoArray = this._providers; - var textView = this.textView; - var sel = textView.getSelection(); - var model = textView.getModel(), mapOffset = offset; - if (model.getBaseModel) { - mapOffset = model.mapOffset(mapOffset); - sel.start = model.mapOffset(sel.start); - sel.end = model.mapOffset(sel.end); - model = model.getBaseModel(); - } - var line = model.getLine(model.getLineAtOffset(mapOffset)); - var index = 0; - while (index < line.length && /\s/.test(line.charAt(index))) { - index++; - } - var indentation = line.substring(0, index); - var options = textView.getOptions("tabSize", "expandTab"); //$NON-NLS-1$ //$NON-NLS-0$ - var tab = options.expandTab ? new Array(options.tabSize + 1).join(" ") : "\t"; //$NON-NLS-1$ //$NON-NLS-0$ - var lineDelimiter = model.getLineDelimiter(); - var _self = this; - var promises = providerInfoArray.map(function(providerInfo) { - var provider = providerInfo.provider; - var computePrefixFunc = provider.computePrefix; - var ecProvider; - var editorContext; - var proposals; - var func; - var promise; - var params; - if (computePrefixFunc) { - ecProvider = _self.editorContextProvider; - editorContext = ecProvider.getEditorContext(); - var result = computePrefixFunc.apply(provider, [editorContext, mapOffset]); - return result.then(function(prefix) { - params = { - line: line, - offset: mapOffset, - prefix: prefix, - selection: sel, - delimiter: lineDelimiter, - tab: tab, - indentation: indentation - }; - try { - if ((func = provider.computeContentAssist)) { - params = objects.mixin(params, ecProvider.getOptions()); - promise = func.apply(provider, [editorContext, params]); - } else if ((func = provider.getProposals || provider.computeProposals)) { - // old API - promise = func.apply(provider, [model.getText(), mapOffset, params]); - } - proposals = _self.progress ? _self.progress.progress(promise, "Generating content assist proposal") : promise; //$NON-NLS-0$ - } catch (e) { - return new Deferred().reject(e); - } - return Deferred.when(proposals); - }, - function(err) { - return new Deferred().reject(err); - }); - } - // no computePrefix function is defined for the provider. Use the default prefix - params = { - line: line, - offset: mapOffset, - prefix: model.getText(_self.getPrefixStart(model, mapOffset), mapOffset), - selection: sel, - delimiter: lineDelimiter, - tab: tab, - indentation: indentation - }; - try { - if ((func = provider.computeContentAssist)) { - ecProvider = _self.editorContextProvider; - editorContext = ecProvider.getEditorContext(); - params = objects.mixin(params, ecProvider.getOptions()); - promise = func.apply(provider, [editorContext, params]); - } else if ((func = provider.getProposals || provider.computeProposals)) { - // old API - promise = func.apply(provider, [model.getText(), mapOffset, params]); - } - proposals = _self.progress ? _self.progress.progress(promise, "Generating content assist proposal") : promise; //$NON-NLS-0$ - } catch (e) { - return new Deferred().reject(e); - } - return Deferred.when(proposals); - }); - - // TODO should we allow error to propagate instead of handling here? - var allPromises = Deferred.all(promises, this.handleError); - - if (this.pageMessage){ - allPromises = Deferred.when(allPromises, function(proposals){ - _self.pageMessage.close(); - var foundProposal = false; - if (proposals && proposals.length > 0){ - for (var i=0; i 0){ - foundProposal = true; - break; - } - } - } - if (!foundProposal){ - _self.pageMessage.setErrorMessage(messages["noProposals"]); - } - return proposals; - }); - this.pageMessage.showWhile(allPromises, messages["computingProposals"]); - } - return allPromises; - }, - - filterProposals: function(force) { - if (this._computedProposals && (this._latestModelChangingEvent || force)) { - var model = this.textView.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - var prefixStart = this.getPrefixStart(model, this._initialCaretOffset); - var defaultPrefix = this.textView.getText(prefixStart, this._initialCaretOffset); - var prefixText = defaultPrefix; - // filter proposals based on prefixes and _filterText - var proposals = []; //array of arrays of proposals - this._computedProposals.forEach(function(proposalArray) { - if (proposalArray && Array.isArray(proposalArray)) { - var includedProposals = proposalArray.filter(function(proposal) { - function getRegexp(prefix, filter) { - var modifiedFilter = filter.replace(/([.+^=!:${}()|\[\]\/\\])/g, "\\$1"); //add start of line character and escape all special characters except * and ? //$NON-NLS-1$ //$NON-NLS-0$ - modifiedFilter = modifiedFilter.replace(/([*?])/g, ".$1"); //convert user input * and ? to .* and .? //$NON-NLS-0$ - return new RegExp("^" + prefix + modifiedFilter, "i"); - } - var pattern; - if (!proposal) { - return false; - } - if(typeof proposal.prefix === 'string') { - prefixText = proposal.prefix; - } else { - prefixText = defaultPrefix; - } - if (STYLES[proposal.style] === STYLES.hr - || STYLES[proposal.style] === STYLES.noemphasis_title) { - return true; - } - - var proposalString = ""; - if (proposal.overwrite) { - if (proposal.name) { - proposalString = proposal.name; - } else if (proposal.proposal) { - proposalString = proposal.proposal; - } else { - return false; // unknown format - } - pattern = getRegexp(prefixText, this._filterText); - return pattern.test(proposalString); - } else if (proposal.name || proposal.proposal) { - var activated = false; - // try matching name - if (proposal.name) { - pattern = getRegexp(prefixText, this._filterText); - activated = pattern.test(proposal.name); - } - - // try matching proposal text - if (!activated && proposal.proposal) { - pattern = getRegexp("", this._filterText); - activated = pattern.test(proposal.proposal); - } - - return activated; - } else if (typeof proposal === "string") { //$NON-NLS-0$ - pattern = getRegexp("", this._filterText); - return pattern.test(proposal); - } - return false; - }, this); - - if (includedProposals.length > 0) { - proposals.push(includedProposals); - } - } - }, this); - - var flatProposalArray = []; - if (proposals) { - // filter out extra separators and titles - proposals = this._removeExtraUnselectableElements(proposals); - flatProposalArray = this._flatten(proposals); - } - - this.dispatchEvent({type: "ProposalsComputed", data: {proposals: flatProposalArray}, autoApply: false}); //$NON-NLS-0$ - } - }, - - /** - * Helper method which removes extra separators and titles from - * an array containing arrays of proposals from the various providers. - * @param{Array[]} proposals An array with each element containing an array of proposals - * @returns {Array} An array without the extra unselectable elements - */ - _removeExtraUnselectableElements: function(proposals) { - // get rid of extra separators and titles - var mappedProposals = proposals.map(function(proposalArray) { - var element = proposalArray.filter(function(proposal, index) { - var keepElement = true; - if (STYLES[proposal.style] === STYLES.hr) { - if ((0 === index) || ((proposalArray.length - 1) === index)) { - keepElement = false; // remove separators at first or last element - } else if (STYLES.hr === STYLES[proposalArray[index - 1].style]) { - keepElement = false; // remove separator preceeded by another separator - } - } else if (STYLES[proposal.style] === STYLES.noemphasis_title) { - var nextProposal = proposalArray[index + 1]; - if (nextProposal) { - // remove titles that preceed other titles, all of their subelements have already been filtered out - if (STYLES[nextProposal.style] === STYLES.noemphasis_title) { - keepElement = false; - } - } else { - keepElement = false; //remove titles that are at the end of the array - } - } - return keepElement; - }); - return element; - }); - - return mappedProposals; - }, - - /** - * Sets the provider that will be invoked to generate the Editor Context service and options to any - * content assist providers that implement the v4.0 content assist API. - * @param {Object} editorContextProvider - */ - setEditorContextProvider: function(editorContextProvider) { - this.editorContextProvider = editorContextProvider; - }, - - /** - * Helper method used to generate a unique ID for a provider. - * Note that the uniqueness of the ID is only guaranteed for the life of this - * object and if all of the other IDs are also generated using this method. - */ - _generateProviderId: function() { - if (this._idcount) { - this._idcount++; - } else { - this._idcount = 0; - } - return "ContentAssistGeneratedID_" + this._idcount; //$NON-NLS-0$ - }, - - /** - * Sets whether or not automatic content assist triggering is enabled. - * @param {Boolean} enableAutoTrigger - */ - setAutoTriggerEnabled: function(enableAutoTrigger) { - this._autoTriggerEnabled = enableAutoTrigger; - this._updateAutoTriggerListenerState(); - }, - - /** - * @name orion.editor.ContentAssistProviderInfo - * @class Encapsulates a content assist provider and its automatic triggers. - * - * @property {String} id Unique ID of this provider. - * @property {RegExp} charTriggers A regular expression matching the characters that, when typed, - * will cause this provider to be activated automatically by the content assist engine. - * @property {RegExp} excludedStyles A regular expression matching the style names that are - * exclusions to this provider's charTriggers matching. - * @property {orion.editor.ContentAssistProvider} provider The actual content assist provider. - */ - - /** - * Sets the content assist providers that this ContentAssist will consult to obtain proposals. - * - * @param {orion.editor.ContentAssistProvider[]|orion.edit.ContentAssistProviderInfo[]} providers The - * providers. Each element may be either a plain {@link orion.editor.ContentAssistProvider}, or a - * {@link orion.edit.ContentAssistProviderInfo}. - */ - setProviders: function(providers) { - var _self = this; - this.setProviderInfoArray(providers.map(function(p) { - // Wrap any plain Provider into a ProviderInfo - return p.id ? p : { - provider: p, - id: _self._generateProviderId() - }; - })); - }, - - /** - * @private - */ - setProviderInfoArray: function(providerInfoArray) { - this.clearProviders(); - - this._providers = providerInfoArray; - this._charTriggersInstalled = providerInfoArray.some(function(info){ - return info.charTriggers; - }); - this._updateAutoTriggerListenerState(); - }, - - /** - * @returns orion.edit.ContentAssistProviderInfo[] - */ - getProviders: function() { - return this._providers.slice(); - }, - - clearProviders: function() { - this._providers = []; - this._charTriggersInstalled = false; - this._updateAutoTriggerListenerState(); - }, - - /** - * Sets the progress handler that will display progress information, if any are generated by content assist providers. - */ - setProgress: function(progress){ - this.progress = progress; - }, - - setStyleAccessor: function(styleAccessor) { - this._styleAccessor = styleAccessor; - }, - - /** - * Flattens an array of arrays into a one-dimensional array. - * @param {Array[]} array - * @returns {Array} - */ - _flatten: function(arrayOrObjectArray) { - - return arrayOrObjectArray.reduce(function(prev, curr) { - var returnValue = prev; - var filteredArray = null; - - if (curr && Array.isArray(curr)) { - filteredArray = curr.filter(function(element){ - return element; //filter out falsy elements - }); - } - - // add current proposal array to flattened array - // skip current elements that are not arrays - if (filteredArray && Array.isArray(filteredArray) && (filteredArray.length > 0)) { - var first = filteredArray; - var last = prev; - var filteredArrayStyle = filteredArray[0].style; - - if (filteredArrayStyle && STYLES[filteredArrayStyle] && (0 === STYLES[filteredArrayStyle].indexOf(STYLES.noemphasis))) { - // the style of the first element starts with noemphasis - // add these proposals to the end of the array - first = prev; - last = filteredArray; - } - - if (first.length > 0) { - var firstArrayStyle = first[first.length - 1].style; - if (firstArrayStyle && (STYLES.hr !== STYLES[firstArrayStyle])) { - // add separator between proposals from different providers - // if the previous array didn't already end with a separator - first = first.concat({ - proposal: '', - name: '', - description: '---------------------------------', //$NON-NLS-0$ - style: 'hr', //$NON-NLS-0$ - unselectable: true - }); - } - } - - returnValue = first.concat(last); - } - - return returnValue; - }, []); - }, - - _triggerListener: function(/*event*/) { - var caretOffset = this.textView.getCaretOffset(); - var stylesAtOffset = null; - var providerInfosToActivate = []; - - if (this._charTriggersInstalled) { - var currentChar = this.textView.getText(caretOffset - 1, caretOffset); - - this._providers.forEach(function(info) { - // check if the charTriggers RegExp matches the currentChar - // we're assuming that this will fail much more often than - // the excludedStyles test so do this first for better performance - var charTriggers = info.charTriggers; - if (charTriggers && charTriggers.test(currentChar)) { - var isExcluded = false; - var excludedStyles = info.excludedStyles; - if (this._styleAccessor && excludedStyles) { - if (!stylesAtOffset) { - // lazily initialize this variable to avoid getting the styles - // for every model modification, only ones that may trigger - stylesAtOffset = this._styleAccessor.getStyles(caretOffset - 1); - } - // check if any of the styles match the excludedStyles RegExp - isExcluded = stylesAtOffset.some(function (element) { - return excludedStyles.test(element.style); - }); - } - if (!isExcluded) { - providerInfosToActivate.push(info); - } - } - }, this); - - if (providerInfosToActivate.length > 0) { - this.activate(providerInfosToActivate, true); - } - } - }, - - /** - * Private helper to install/uninstall the automatic trigger - * listener based on the state of the relevant booleans - */ - _updateAutoTriggerListenerState: function() { - if (!this._boundTriggerListener) { - this._boundTriggerListener = this._triggerListener.bind(this); - } - - if (this._triggerListenerInstalled) { - // uninstall the listener if necessary - if (!this._autoTriggerEnabled || !this._charTriggersInstalled) { - this.textView.removeEventListener("Modify", this._boundTriggerListener); //$NON-NLS-0$ - this._triggerListenerInstalled = false; - } - } else if (this._autoTriggerEnabled && this._charTriggersInstalled){ - // install the listener if necessary - this.textView.addEventListener("Modify", this._boundTriggerListener); //$NON-NLS-0$ - this._triggerListenerInstalled = true; - } - }, - - _addTextViewListeners: function() { - if (!this._textViewListenersAdded) { - this.textView.addEventListener("ModelChanging", this._textViewListeners.onModelChanging); //$NON-NLS-0$ - this.textView.addEventListener("Scroll", this._textViewListeners.onScroll); //$NON-NLS-0$ - this.textView.addEventListener("Selection", this._textViewListeners.onSelection); //$NON-NLS-0$ - this._textViewListenersAdded = true; - } - }, - - _removeTextViewListeners: function() { - if (this._textViewListenersAdded) { - this._latestModelChangingEvent = null; - this.textView.removeEventListener("ModelChanging", this._textViewListeners.onModelChanging); //$NON-NLS-0$ - this.textView.removeEventListener("Scroll", this._textViewListeners.onScroll); //$NON-NLS-0$ - this.textView.removeEventListener("Selection", this._textViewListeners.onSelection); //$NON-NLS-0$ - this._textViewListenersAdded = false; - } - }, - - _updateFilterText: function(modelChangingEvent) { - // update this._filterText based on the modification info - // contained in the event - var removedCharCount = modelChangingEvent.removedCharCount; - if (removedCharCount) { - var lastIndex = this._filterText.length - removedCharCount; - this._filterText = this._filterText.substring(0, lastIndex); - } - var text = modelChangingEvent.text; - if (text) { - this._filterText = this._filterText.concat(text); - } - } - }; - mEventTarget.EventTarget.addMixin(ContentAssist.prototype); - - /** - * @name orion.editor.ContentAssistMode - * @class Editor mode for interacting with content assist proposals. - * @description Creates a ContentAssistMode. A ContentAssistMode is a key mode for {@link orion.editor.Editor} - * that provides interaction with content assist proposals retrieved from an {@link orion.editor.ContentAssist}. - * Interaction is performed via the {@link #lineUp}, {@link #lineDown}, and {@link #enter} actions. An - * {@link orion.editor.ContentAssistWidget} may optionally be provided to display which proposal is currently selected. - * @param {orion.editor.ContentAssist} contentAssist - * @param {orion.editor.ContentAssistWidget} [ContentAssistWidget] - */ - function ContentAssistMode(contentAssist, ContentAssistWidget) { - var textView = contentAssist.textView; - mKeyModes.KeyMode.call(this, textView); - this.contentAssist = contentAssist; - this.widget = ContentAssistWidget; - this.proposals = []; - var self = this; - this.contentAssist.addEventListener("ProposalsComputed", function(event) { //$NON-NLS-0$ - self.proposals = event.data.proposals; - if (self.proposals.length === 0) { - self.selectedIndex = -1; - self.cancel(); - } else { - self.selectedIndex = 0; - while(self.proposals[self.selectedIndex] && self.proposals[self.selectedIndex].unselectable) { - self.selectedIndex++; - } - if (self.proposals[self.selectedIndex]) { - if (self.widget) { - var showWidget = true; - - if (event.autoApply) { - var nextIndex = self.selectedIndex + 1; - while (self.proposals[nextIndex] && self.proposals[nextIndex].unselectable) { - nextIndex++; - } - if (!self.proposals[nextIndex]) { - // if there is only one selectable proposal apply it automatically - showWidget = false; - self.contentAssist.apply(self.proposals[self.selectedIndex]); - } - } - - if (showWidget) { - self.widget.show(); - self.widget.selectNode(self.selectedIndex); - } - } - } else { - self.selectedIndex = -1; // didn't find any selectable items - self.cancel(); - } - } - }); - textView.setAction("contentAssistApply", function() { //$NON-NLS-0$ - return this.enter(); - }.bind(this)); - textView.setAction("contentAssistCancel", function() { //$NON-NLS-0$ - return this.cancel(); - }.bind(this)); - textView.setAction("contentAssistNextProposal", function() { //$NON-NLS-0$ - return this.lineDown(); - }.bind(this)); - textView.setAction("contentAssistPreviousProposal", function() { //$NON-NLS-0$ - return this.lineUp(); - }.bind(this)); - textView.setAction("contentAssistNextPage", function() { //$NON-NLS-0$ - return this.pageDown(); - }.bind(this)); - textView.setAction("contentAssistPreviousPage", function() { //$NON-NLS-0$ - return this.pageUp(); - }.bind(this)); - textView.setAction("contentAssistHome", function() { //$NON-NLS-0$ - if (this.widget) { - this.widget.scrollIndex(0, true); - } - return this.lineDown(0); // select first selectable element starting at the top and moving downwards - }.bind(this)); - textView.setAction("contentAssistEnd", function() { //$NON-NLS-0$ - return this.lineUp(this.proposals.length - 1); // select first selectable element starting at the bottom and moving up - }.bind(this)); - textView.setAction("contentAssistTab", function() { //$NON-NLS-0$ - return this.tab(); - }.bind(this)); - - if (this.widget) { - this.widget.setContentAssistMode(this); - this.widget.createAccessible(); - } - } - ContentAssistMode.prototype = new mKeyModes.KeyMode(); - objects.mixin(ContentAssistMode.prototype, { - createKeyBindings: function() { - var KeyBinding = mKeyBinding.KeyBinding; - var bindings = []; - bindings.push({actionID: "contentAssistApply", keyBinding: new KeyBinding(13)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistCancel", keyBinding: new KeyBinding(27)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistNextProposal", keyBinding: new KeyBinding(40)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistPreviousProposal", keyBinding: new KeyBinding(38)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistNextPage", keyBinding: new KeyBinding(34)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistPreviousPage", keyBinding: new KeyBinding(33)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistHome", keyBinding: new KeyBinding(lib.KEY.HOME)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistEnd", keyBinding: new KeyBinding(lib.KEY.END)}); //$NON-NLS-0$ - bindings.push({actionID: "contentAssistTab", keyBinding: new KeyBinding(9)}); //$NON-NLS-0$ - return bindings; - }, - cancel: function() { - this.getContentAssist().deactivate(); - }, - /** @private */ - getContentAssist: function() { - return this.contentAssist; - }, - getProposals: function() { - return this.proposals; - }, - isActive: function() { - return this.getContentAssist().isActive(); - }, - setActive: function(active) { - if (active) { - this.contentAssist.textView.addKeyMode(this); - } else { - this.contentAssist.textView.removeKeyMode(this); - } - }, - /** - * Selects a selectable item in the content assist widget - * iterating backwards for . - * - * @param index {number} Optional. The index of the item to try and select. - */ - lineUp: function(index, noWrap) { - return this.selectNew(index, noWrap, false); - }, - /** - * Selects the item at the specified index or the next - * selectable item - */ - lineDown: function(index, noWrap) { - return this.selectNew(index, noWrap, true); - }, - selectNew: function(index, noWrap, forward) { - var newIndex = index; - - if (forward) { - if (undefined === newIndex) { - newIndex = this.selectedIndex + 1; - } - // handle wrap around - if (newIndex >= this.proposals.length) { - if (noWrap) { - return true; // do nothing - } else { - newIndex = 0; - } - } - } else { - if (undefined === newIndex) { - newIndex = this.selectedIndex - 1; - } - // handle wrap around - if (0 > newIndex) { - if (noWrap) { - return true; // do nothing - } else { - newIndex = this.proposals.length - 1; - } - } - } - - var startIndex = newIndex; - while (this.proposals[newIndex] && this.proposals[newIndex].unselectable) { - if (forward) { - newIndex++; - // handle wrap around - if (newIndex >= this.proposals.length) { - if (noWrap) { - return true; // do nothing - } else { - newIndex = 0; - } - } - } else { - newIndex--; - // handle wrap around - if (0 > newIndex) { - if (noWrap) { - return true; // do nothing - } else { - newIndex = this.proposals.length - 1; - } - } - } - - if (newIndex === startIndex) { - // looped through all nodes and didn't find any that were selectable - newIndex = -1; - break; - } - } - - this.selectedIndex = newIndex; - - if (this.widget) { - this.widget.selectNode(newIndex); - } - - this._showTooltip(true); - - return true; - }, - - /** - * Opens the tooltip for the selected proposal beside the content assist window - * @param update if false, the tooltip will be hidden then reopened with the new contents - * @param noContent if true the current tooltip contents will not be replaced, just size and position updated - */ - _showTooltip: function(update, noContent) { - var tooltip = mTooltip.Tooltip.getTooltip(this.contentAssist.textView); - var self = this; - var target = { - getTooltipInfo: function() { - var bounds = self.widget.parentNode.getBoundingClientRect(); - var tipArea = {width: 350, height: bounds.height, top: bounds.top}; - if ((bounds.left + bounds.width) >= document.documentElement.clientWidth){ - tipArea.left = bounds.left - tipArea.width; - tipArea.left -= 10; - } else { - tipArea.left = bounds.left + bounds.width; - tipArea.left += 10; - } - var info = { - context: {proposal: self.proposals[self.selectedIndex]}, - anchorArea: bounds, - tooltipArea: tipArea - }; - return info; - } - }; - - if (update) { - tooltip.update(target, noContent); - } else { - tooltip.show(target, true, false); - } - }, - - _hideTooltip: function() { - var tooltip = mTooltip.Tooltip.getTooltip(this.contentAssist.textView); - tooltip.hide(true); // Clear the lock - }, - - pageUp: function() { - //TODO find out why this doesn't always go to the very top - if (this.widget) { - var newSelected = this.widget.getTopIndex(); - if (newSelected === this.selectedIndex) { - this.widget.scrollIndex(newSelected, false); - newSelected = this.widget.getTopIndex(); - } - if (0 === newSelected) { - // if we're attempting to select the first item in the list - // move down to the next one if it is not selectable - return this.lineDown(newSelected, true); - } - return this.lineUp(newSelected, true); - } else { - return this.lineUp(); - } - }, - pageDown: function() { - if (this.widget) { - var newSelected = this.widget.getBottomIndex(); - if (newSelected === this.selectedIndex) { - this.widget.scrollIndex(newSelected, true); - newSelected = this.widget.getBottomIndex(); - } - return this.lineDown(newSelected, true); - } else { - return this.lineDown(); - } - }, - enter: function() { - var proposal = this.proposals[this.selectedIndex] || null; - return this.contentAssist.apply(proposal); - }, - tab: function() { - if (this.widget) { - this.widget.parentNode.focus(); - return true; - } else { - return false; - } - } - }); - - /** - * @name orion.editor.ContentAssistWidget - * @class Displays proposals from a {@link orion.editor.ContentAssist}. - * @description Creates a ContentAssistWidget that will display proposals from the given {@link orion.editor.ContentAssist} - * in the given parentNode. Clicking a proposal will cause the ContentAssist to apply that proposal. - * @param {orion.editor.ContentAssist} contentAssist - * @param {String|DomNode} [parentNode] The ID or DOM node to use as the parent for displaying proposals. If not provided, - * a new DIV will be created inside <body> and assigned the CSS class contentassist. - */ - function ContentAssistWidget(contentAssist, parentNode) { - this.contentAssist = contentAssist; - this.textView = this.contentAssist.getTextView(); - this.textViewListenerAdded = false; - this.isShowing = false; - this._useResizeTimer = false; - var document = this.textView.getOptions("parent").ownerDocument; //$NON-NLS-0$ - this.parentNode = typeof parentNode === "string" ? document.getElementById(parentNode) : parentNode; //$NON-NLS-0$ - if (!this.parentNode) { - this.parentNode = util.createElement(document, "div"); //$NON-NLS-0$ - this.parentNode.className = "contentassist"; //$NON-NLS-0$ - var body = document.getElementsByTagName("body")[0]; //$NON-NLS-0$ - if (body) { - body.appendChild(this.parentNode); - } else { - throw new Error("parentNode is required"); //$NON-NLS-0$ - } - } - var MO = window.MutationObserver || window.MozMutationObserver; - if (MO && util.isFirefox) {//MutationObserver does not work in chrome for resize https://code.google.com/p/chromium/issues/detail?id=293948 - this._mutationObserver = new MO(function(mutations) { - this._contentAssistMode._showTooltip(true, true); - }.bind(this)); - } else { - this._useResizeTimer = true; - } - - textUtil.addEventListener(this.parentNode, "scroll", this.onScroll.bind(this)); //$NON-NLS-0$ - - var self = this; - this.textViewListener = { - onMouseDown: function(event) { - var target = event.event.target || event.event.srcElement; - if (target.parentElement !== self.parentNode) { - self.contentAssist.deactivate(); - } - // ignore the event if this is a click inside of the parentNode - // the click is handled by the onClick() function - } - }; - this.contentAssist.addEventListener("Deactivating", function(event) { //$NON-NLS-0$ - self.hide(); - }); - this.scrollListener = function(e) { - if (self.isShowing) { - self.position(); - //TODO: code edit widget : redo the tooltip positioning by the same new api - } - }; - //TODO: code edit widget : clean up the code to remove the listener here - textUtil.addEventListener(document, "scroll", this.scrollListener); //$NON-NLS-0$ - } - ContentAssistWidget.prototype = /** @lends orion.editor.ContentAssistWidget.prototype */ { - /** @private */ - onClick: function(e) { - if (!e) { e = window.event; } - this.contentAssist.apply(this.getProposal(e.target || e.srcElement)); - this.textView.focus(); - }, - /** @private */ - onScroll: function(e) { - if (this.previousCloneNode && !this.preserveCloneThroughScroll) { - this._removeCloneNode(); - this.previousSelectedNode.classList.add(STYLES.selected); - } - this.preserveCloneThroughScroll = false; - }, - /** @private */ - createDiv: function(proposal, parent, itemIndex) { - var document = parent.ownerDocument; - var div = util.createElement(document, "div"); //$NON-NLS-0$ - div.id = "contentoption" + itemIndex; //$NON-NLS-0$ - div.setAttribute("role", "option"); //$NON-NLS-1$ //$NON-NLS-2$ - div.className = STYLES[proposal.style] ? STYLES[proposal.style] : STYLES.dfault; - var node; - if (proposal.style === "hr") { //$NON-NLS-0$ - node = util.createElement(document, "hr"); //$NON-NLS-0$ - } else { - node = this._createDisplayNode(proposal, itemIndex); - div.contentAssistProposalIndex = itemIndex; // make div clickable - } - div.appendChild(node); - parent.appendChild(div); - }, - /** @private */ - createAccessible: function() { - var mode = this._contentAssistMode; - var self = this; - textUtil.addEventListener(this.parentNode, "keydown", function(evt) { //$NON-NLS-0$ - if (!evt) { evt = window.event; } - if (evt.preventDefault) { - evt.preventDefault(); - } - if(evt.keyCode === lib.KEY.ESCAPE) { - return mode.cancel(); - } else if(evt.keyCode === lib.KEY.UP) { - return mode.lineUp(); - } else if(evt.keyCode === lib.KEY.DOWN) { - return mode.lineDown(); - } else if(evt.keyCode === lib.KEY.ENTER) { - return mode.enter(); - } else if(evt.keyCode === lib.KEY.PAGEDOWN) { - return mode.pageDown(); - } else if(evt.keyCode === lib.KEY.PAGEUP) { - return mode.pageUp(); - } else if(evt.keyCode === lib.KEY.HOME) { - self.scrollIndex(0, true); - return mode.lineDown(0); // select first selectable element starting at the top and moving downwards - } else if(evt.keyCode === lib.KEY.END) { - return mode.lineUp(mode.getProposals().length - 1); // select first selectable element starting at the bottom and moving up - } - return false; - }); - }, - /** @private */ - _createDisplayNode: function(proposal, index) { - var node = document.createElement("span"); //$NON-NLS-0$ - - if (!proposal){ - return node; - } - - if (typeof proposal === "string"){ - var simpleName = this._createNameNode(proposal); - simpleName.contentAssistProposalIndex = index; - return simpleName; - } - - var nameNode; - var usingDescription; // Proposals are allowed to use the description as the name - if (proposal.name && typeof proposal.name === "string") { - nameNode = this._createNameNode(proposal.name); - } else if (proposal.description && typeof proposal.description === "string"){ - nameNode = this._createNameNode(proposal.description); - usingDescription = true; - } else if (proposal.proposal && typeof proposal.proposal === "string"){ - nameNode = this._createNameNode(proposal.proposal); - } else { - // Must have a name - return node; - } - - var tagsNode = this._createTagsNode(proposal.tags); - - var descriptionNode; - if (!usingDescription && proposal.description && typeof proposal.description === "string") { - descriptionNode = document.createTextNode(proposal.description); - } - - if (tagsNode) { node.appendChild(tagsNode); } - node.appendChild(nameNode); - if (descriptionNode) { node.appendChild(descriptionNode); } - - nameNode.contentAssistProposalIndex = index; - node.contentAssistProposalIndex = index; - - return node; - }, - /** @private */ - _stopResizeTimer: function() { - if (this._resizeTimer) { - window.clearInterval(this._resizeTimer); - this._resizeTimer = null; - } - }, - _startResizeTimer: function() { - this._stopResizeTimer(); - this._cachedResizeBound = this.parentNode.getBoundingClientRect(); - this._resizeTimer = window.setInterval(function() { - if(this._contentAssistMode) { - var bound = this.parentNode.getBoundingClientRect(); - if(bound.left === this._cachedResizeBound.left && - bound.top === this._cachedResizeBound.top && - bound.width === this._cachedResizeBound.width && - bound.height === this._cachedResizeBound.height) { - return; - } - this._cachedResizeBound = bound; - this._contentAssistMode._showTooltip(true, true); - } - }.bind(this), 100); - }, - /** @private */ - _createNameNode: function(name) { - var node = document.createElement("span"); //$NON-NLS-0$ - node.classList.add("proposal-name"); //$NON-NLS-0$ - node.appendChild(document.createTextNode(name)); - return node; - }, - /** - * @private - * @param tags {Array} The array of tags to display - * @returns {Object} the dom node for the tags or null - */ - _createTagsNode: function(tags) { - var tagsNode = null; - if (tags && tags.constructor === Array && tags.length > 0){ - tagsNode = document.createElement("span"); //$NON-NLS-1$ - for (var i=0; i= this.parentNode.scrollTop) { - return i; - } - } - return 0; - }, - /** @private */ - getBottomIndex: function() { - var nodes = this.parentNode.childNodes; - for (var i=0; i < nodes.length; i++) { - var child = nodes[i]; - if ((child.offsetTop + child.offsetHeight) > (this.parentNode.scrollTop + this.parentNode.clientHeight)) { - return Math.max(0, i - 1); - } - } - return nodes.length - 1; - }, - /** @private */ - scrollIndex: function(index, top) { - var nodeAtIndex = this.parentNode.childNodes[index]; - if (nodeAtIndex){ - nodeAtIndex.scrollIntoView(top); - this.preserveCloneThroughScroll = true; - } - }, - /** - * Visually selects the node at the specified nodeIndex - * by updating its CSS class and scrolling it into view - * if necessary. - * @param{Number} nodeIndex The index of the node to select - */ - selectNode: function(nodeIndex) { - var node = null; - - if (this._hideTimeout) { - window.clearTimeout(this._hideTimeout); - this._hideTimeout = null; - } - if (this._fadeTimer) { - window.clearTimeout(this._fadeTimer); - this._fadeTimer = null; - } - if (this.previousSelectedNode) { - this.previousSelectedNode.classList.remove(STYLES.selected); - this.previousSelectedNode = null; - if (this.previousCloneNode) { - this._removeCloneNode(); - } - } - - if (-1 !== nodeIndex) { - node = this.parentNode.childNodes[nodeIndex]; - if (node){ - node.classList.add(STYLES.selected); - this.parentNode.setAttribute("aria-activedescendant", node.id); //$NON-NLS-0$ - node.focus(); - if (node.offsetTop < this.parentNode.scrollTop) { - node.scrollIntoView(true); - this.preserveCloneThroughScroll = true; - } else if ((node.offsetTop + node.offsetHeight) > (this.parentNode.scrollTop + this.parentNode.clientHeight)) { - node.scrollIntoView(false); - this.preserveCloneThroughScroll = true; - } - - var textNode = node.firstChild || node; - var textBounds = textNode.getBoundingClientRect(); - var parentWidth = this.parentNode.clientWidth ? this.parentNode.clientWidth : this.parentNode.getBoundingClientRect(); // Scrollbar can cover text - var parentStyle = window.getComputedStyle(this.parentNode); - var nodeStyle = window.getComputedStyle(node); - var allPadding = parseInt(parentStyle.paddingLeft) + parseInt(parentStyle.paddingRight) + parseInt(nodeStyle.paddingLeft) + parseInt(nodeStyle.paddingRight); - if (textBounds.width >= (parentWidth - allPadding)) { - var parentTop = parseInt(parentStyle.top); - - // create clone node - var clone = node.cloneNode(true); // deep clone - clone.classList.add("cloneProposal"); //$NON-NLS-0$ - clone.style.top = parentTop + node.offsetTop - this.parentNode.scrollTop + "px"; //$NON-NLS-0$ - clone.style.left = parentStyle.left; - clone.setAttribute("id", clone.id + "_clone"); //$NON-NLS-1$ //$NON-NLS-0$ - - // try to fit clone node on page horizontally - var viewportWidth = document.documentElement.clientWidth; - var horizontalOffset = (textBounds.left + textBounds.width) - parseInt(viewportWidth); - if (horizontalOffset > 0) { - var cloneLeft = parseInt(parentStyle.left) - horizontalOffset; - if (0 > cloneLeft) { - cloneLeft = 0; - } - clone.style.left = cloneLeft + "px"; - } - - // create wrapper parent node (to replicate css class hierarchy) - var parentClone = document.createElement("div"); - parentClone.id = "clone_contentassist"; //$NON-NLS-0$ - parentClone.classList.add("contentassist"); //$NON-NLS-0$ - parentClone.classList.add("cloneWrapper"); //$NON-NLS-0$ - parentClone.appendChild(clone); - parentClone.onclick = this.parentNode.onclick; - this.parentNode.parentNode.insertBefore(parentClone, this.parentNode); - - // make all the cloned nodes clickable by setting their contentAssistProposalIndex - var recursiveSetIndex = function(cloneNode){ - cloneNode.contentAssistProposalIndex = node.contentAssistProposalIndex; - if (cloneNode.hasChildNodes()) { - for (var i = 0 ; i < cloneNode.childNodes.length ; i++){ - recursiveSetIndex(cloneNode.childNodes[i]); - } - } - }; - recursiveSetIndex(parentClone); - - var self = this; - this._hideTimeout = window.setTimeout(function() { - self._hideTimeout = null; - node.classList.add(STYLES.selected); - var opacity = 1; - self._fadeTimer = window.setInterval(function() { - if (!self.previousCloneNode || opacity <= 0.01){ - self._removeCloneNode(); - window.clearInterval(self._fadeTimer); - self._fadeTimer = null; - } else { - parentClone.style.opacity = opacity; - parentClone.style.filter = 'alpha(opacity=' + opacity * 100 + ")"; - opacity -= opacity * 0.1; - } - }, 50); - }, 1500); - - node.classList.remove(STYLES.selected); - - this.previousCloneNode = parentClone; - } - } - } - - this.previousSelectedNode = node; - }, - setContentAssistMode: function(mode) { - this._contentAssistMode = mode; - }, - show: function() { - var proposals = this._contentAssistMode.getProposals(); - if (proposals.length === 0) { - this.hide(); - } else { - this.parentNode.innerHTML = ""; - for (var i = 0; i < proposals.length; i++) { - this.createDiv(proposals[i], this.parentNode, i); - } - this.position(); - this.parentNode.onclick = this.onClick.bind(this); - this.isShowing = true; - - this._contentAssistMode._showTooltip(false); - - if(this._useResizeTimer) { - this._startResizeTimer(); - } else if(this._mutationObserver){ - this._mutationObserver.observe(this.parentNode, {attributes: true}); - } - if (!this.textViewListenerAdded) { - this.textView.addEventListener("MouseDown", this.textViewListener.onMouseDown); //$NON-NLS-0$ - this.textViewListenerAdded = true; - } - } - }, - hide: function() { - if(this.parentNode.ownerDocument.activeElement === this.parentNode) { - this.textView.focus(); - } - this.parentNode.style.display = "none"; //$NON-NLS-0$ - this.parentNode.onclick = null; - this.isShowing = false; - - if(this._useResizeTimer) { - this._stopResizeTimer(); - } else if(this._mutationObserver){ - this._mutationObserver.disconnect(); - } - - this._contentAssistMode._hideTooltip(); - - if (this.textViewListenerAdded) { - this.textView.removeEventListener("MouseDown", this.textViewListener.onMouseDown); //$NON-NLS-0$ - this.textViewListenerAdded = false; - } - - if (this.previousSelectedNode) { - this.previousSelectedNode = null; - if (this.previousCloneNode) { - this._removeCloneNode(); - } - } - }, - position: function() { - var contentAssist = this.contentAssist; - var offset; - var view = this.textView; - if (contentAssist.offset !== undefined) { - offset = contentAssist.offset; - var model = view.getModel(); - if (model.getBaseModel) { - offset = model.mapOffset(offset, true); - } - } else { - offset = this.textView.getCaretOffset(); - } - var caretLocation = view.getLocationAtOffset(offset); - caretLocation.y += view.getLineHeight(); - this.textView.convert(caretLocation, "document", "page"); //$NON-NLS-1$ //$NON-NLS-0$ - this.parentNode.style.position = "fixed"; //$NON-NLS-0$ - this.parentNode.style.left = caretLocation.x + "px"; //$NON-NLS-0$ - this.parentNode.style.top = caretLocation.y + "px"; //$NON-NLS-0$ - this.parentNode.style.display = "block"; //$NON-NLS-0$ - this.parentNode.scrollTop = 0; - - // Make sure that the panel is never outside the viewport - var document = this.parentNode.ownerDocument; - var viewportWidth = document.documentElement.clientWidth, - viewportHeight = document.documentElement.clientHeight; - - var spaceBelow = viewportHeight - caretLocation.y; - if (this.parentNode.offsetHeight > spaceBelow) { - // Check if div is too large to fit above - var spaceAbove = caretLocation.y - this.textView.getLineHeight(); - if (this.parentNode.offsetHeight > spaceAbove){ - // Squeeze the div into the larger area - if (spaceBelow > spaceAbove) { - this.parentNode.style.maxHeight = spaceBelow + "px"; //$NON-NLS-0$ - } else { - this.parentNode.style.maxHeight = spaceAbove + "px"; //$NON-NLS-0$ - this.parentNode.style.top = "0"; //$NON-NLS-0$ - } - } else { - // Put the div above the line - this.parentNode.style.top = (caretLocation.y - this.parentNode.offsetHeight - this.textView.getLineHeight()) + "px"; //$NON-NLS-0$ - this.parentNode.style.maxHeight = spaceAbove + "px"; //$NON-NLS-0$ - } - } else { - this.parentNode.style.maxHeight = spaceBelow + "px"; //$NON-NLS-0$ - } - - if (caretLocation.x + this.parentNode.offsetWidth > viewportWidth) { - var leftSide = viewportWidth - this.parentNode.offsetWidth; - if (leftSide < 0) { - leftSide = 0; - } - this.parentNode.style.left = leftSide + "px"; //$NON-NLS-0$ - this.parentNode.style.maxWidth = viewportWidth - leftSide; - } else { - this.parentNode.style.maxWidth = viewportWidth + caretLocation.x + "px"; //$NON-NLS-0$ - } - }, - _removeCloneNode: function(){ - if (this.parentNode.parentNode.contains(this.previousCloneNode)) { - this.parentNode.parentNode.removeChild(this.previousCloneNode); - } - this.previousCloneNode = null; - } - }; - return { - ContentAssist: ContentAssist, - ContentAssistMode: ContentAssistMode, - ContentAssistWidget: ContentAssistWidget - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/emacs", [ //$NON-NLS-0$ - 'i18n!orion/editor/nls/messages', //$NON-NLS-0$ - "orion/editor/keyModes", //$NON-NLS-0$ - "orion/keyBinding", //$NON-NLS-0$ - "orion/util" //$NON-NLS-0$ -], function(messages, mKeyMode, mKeyBinding, util) { - - function EmacsMode(textView) { - mKeyMode.KeyMode.call(this, textView); - } - EmacsMode.prototype = new mKeyMode.KeyMode(); - EmacsMode.prototype.createKeyBindings = function () { - //no duplicate keybindings - var bindings = []; - - // Changing the Location of Point - bindings.push({actionID: "emacs-beginning-of-line", keyBinding: this._createStroke('a', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-end-of-line", keyBinding: this._createStroke('e', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-forward-char", keyBinding: this._createStroke('f', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-backward-char", keyBinding: this._createStroke('b', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-forward-word", keyBinding: this._createStroke('f', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-backward-word", keyBinding: this._createStroke('b', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-next-line", keyBinding: this._createStroke('n', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-previous-line", keyBinding: this._createStroke('p', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - //TODO these 2 are not right - bindings.push({actionID: "emacs-beginning-of-buffer", keyBinding: this._createStroke(188, false, true, true)}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-end-of-buffer", keyBinding: this._createStroke(190, false, true, true)}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - // Erasing Text - bindings.push({actionID: "emacs-delete-backward-char", keyBinding: this._createStroke(46, !util.isMac, false, false, util.isMac)}); //$NON-NLS-0$ - bindings.push({actionID: "emacs-delete-char", keyBinding: this._createStroke('d', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-kill-line", keyBinding: this._createStroke('k', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-kill-word", keyBinding: this._createStroke('d', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-backward-kill-word", keyBinding: this._createStroke(46, false, false, true)}); //$NON-NLS-0$ - - // Undoing Changes - bindings.push({actionID: "undo", keyBinding: this._createSequence([this._createStroke('x', true), this._createStroke('u')])}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "redo", keyBinding: this._createSequence([this._createStroke('x', true), this._createStroke('r')])}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Scrolling - bindings.push({actionID: "emacs-scroll-up", keyBinding: this._createStroke('v', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-scroll-down", keyBinding: this._createStroke('v', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "emacs-set-mark-command", keyBinding: this._createStroke(' ', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-reset-mark-command", keyBinding: this._createStroke('g', !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-exchange-point-and-mark", keyBinding: this._createSequence([this._createStroke('x', !util.isMac, false, false, util.isMac), this._createStroke('x', !util.isMac, false, false, util.isMac)])}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - for (var c=0; c<=9; c++) { //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-digit-argument-" + c, keyBinding: this._createStroke(48 + c, !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-digit-argument-" + c, keyBinding: this._createStroke(48 + c, false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-digit-argument-" + c, keyBinding: this._createStroke(48 + c, !util.isMac, false, true, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - } - bindings.push({actionID: "emacs-negative-argument", keyBinding: this._createStroke(189, !util.isMac, false, false, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-negative-argument", keyBinding: this._createStroke(189, false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-negative-argument", keyBinding: this._createStroke(189, !util.isMac, false, true, util.isMac)}); //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "emacs-uppercase", keyBinding: this._createStroke('u', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-lowercase", keyBinding: this._createStroke('l', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "emacs-capitalize", keyBinding: this._createStroke('c', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //TODO should these keys be done here? - bindings.push({actionID: "contentAssist", keyBinding: this._createStroke(191, false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "find", keyBinding: this._createStroke('r', false, false, true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "incrementalFind", keyBinding: this._createStroke('s', true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "incrementalFindReverse", keyBinding: this._createStroke('r', true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "save", keyBinding: this._createSequence([this._createStroke('x', !util.isMac, false, false, util.isMac), this._createStroke('s', !util.isMac, false, false, util.isMac)])}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Create actions - this._createActions(this.getView()); - - return bindings; - }; - - EmacsMode.prototype._createStroke = function(keyCode, mod1, mod2, mod3, mod4) { - var result = new mKeyBinding.KeyStroke(keyCode, mod1, mod2, mod3, mod4); - result.scopeName = messages.emacs; - return result; - }; - - EmacsMode.prototype._createSequence = function(keys) { - var result = new mKeyBinding.KeySequence(keys); - result.scopeName = messages.emacs; - return result; - }; - - EmacsMode.prototype._getData = function() { - var data = { - count: (this._argument || 1) * (this._sign || 1) - }; - this._argument = 0; - this._sign = 1; - return data; - }; - - EmacsMode.prototype._moveCursor = function (actionID) { - var data = this._getData(); - if (this._marker) { - data.select = true; - } - var view = this.getView(); - return view.invokeAction(actionID, false, data); - }; - - EmacsMode.prototype._digitArgument = function (n) { - this._argument = (this._argument || 0) * 10 + n; - return true; - }; - - EmacsMode.prototype._negativeArgument = function () { - this._sign = (this._sign || 1) * -1; - return true; - }; - - EmacsMode.prototype._createActions = function (view) { - var self = this; - - // Changing the Location of Point - view.setAction("emacs-beginning-of-line", function() { //$NON-NLS-0$ - return self._moveCursor("lineStart"); //$NON-NLS-0$ - }, {name: messages.lineStart}); - view.setAction("emacs-end-of-line", function() { //$NON-NLS-0$ - return self._moveCursor("lineEnd"); //$NON-NLS-0$ - }, {name: messages.lineEnd}); - view.setAction("emacs-forward-char", function() { //$NON-NLS-0$ - return self._moveCursor("charNext"); //$NON-NLS-0$ - }, {name: messages.charNext}); - view.setAction("emacs-backward-char", function() { //$NON-NLS-0$ - return self._moveCursor("charPrevious"); //$NON-NLS-0$ - }, {name: messages.charPrevious}); - view.setAction("emacs-forward-word", function() { //$NON-NLS-0$ - return self._moveCursor("wordNext"); //$NON-NLS-0$ - }, {name: messages.wordNext}); - view.setAction("emacs-backward-word", function() { //$NON-NLS-0$ - return self._moveCursor("wordPrevious"); //$NON-NLS-0$ - }, {name: messages.wordPrevious}); - view.setAction("emacs-next-line", function() { //$NON-NLS-0$ - return self._moveCursor("lineDown"); //$NON-NLS-0$ - }, {name: messages.lineDown}); - view.setAction("emacs-previous-line", function() { //$NON-NLS-0$ - return self._moveCursor("lineUp"); //$NON-NLS-0$ - }, {name: messages.lineUp}); - view.setAction("emacs-beginning-of-buffer", function() { //$NON-NLS-0$ - return self._moveCursor("textStart"); //$NON-NLS-0$ - }, {name: messages.textStart}); - view.setAction("emacs-end-of-buffer", function() { //$NON-NLS-0$ - return self._moveCursor("textEnd"); //$NON-NLS-0$ - }, {name: messages.textEnd}); - - view.setAction("emacs-delete-backward-char", function() { //$NON-NLS-0$ - return view.invokeAction("deletePrevious"); //$NON-NLS-0$ - }, {name: messages.deletePrevious}); - view.setAction("emacs-delete-char", function() { //$NON-NLS-0$ - return view.invokeAction("deletePrevious"); //$NON-NLS-0$ - }, {name: messages.deletePrevious}); - view.setAction("emacs-kill-line", function() { //$NON-NLS-0$ - return view.invokeAction("deleteLineEnd"); //$NON-NLS-0$ - }, {name: messages.deleteLineEnd}); - view.setAction("emacs-kill-word", function() { //$NON-NLS-0$ - return view.invokeAction("deleteWordNext"); //$NON-NLS-0$ - }, {name: messages.deleteWordNext}); - view.setAction("emacs-backward-kill-word", function() { //$NON-NLS-0$ - return view.invokeAction("deleteWordPrevious"); //$NON-NLS-0$ - }, {name: messages.deleteWordPrevious}); - - view.setAction("emacs-scroll-up", function() { //$NON-NLS-0$ - return self._moveCursor("pageDown"); //$NON-NLS-0$ - }, {name: messages.pageDown}); - view.setAction("emacs-scroll-down", function() { //$NON-NLS-0$ - return self._moveCursor("pageUp"); //$NON-NLS-0$ - }, {name: messages.pageUp}); - - view.setAction("emacs-set-mark-command", function() { //$NON-NLS-0$ - var caretOffset = view.getCaretOffset(); - view.setCaretOffset(caretOffset); - self._marker = caretOffset; - return true; - }, {name: messages.setMarkCommand}); - view.setAction("emacs-exchange-point-and-mark", function() { //$NON-NLS-0$ - if (self._marker !== undefined) { - var caretOffset = view.getCaretOffset(); - var selection = view.getSelection(); - if (selection.end === caretOffset) { - var temp = selection.start; - selection.start = selection.end; - selection.end = temp; - } - self._marker = caretOffset; - view.setSelection(selection.start, selection.end); - } - return true; - }, {name: messages.exchangeMarkPoint}); - view.setAction("emacs-reset-mark-command", function() { //$NON-NLS-0$ - var caretOffset = view.getCaretOffset(); - view.setCaretOffset(caretOffset); - self._marker = undefined; - return true; - }, {name: messages.clearMark}); - - view.setAction("emacs-digit-argument-0", function() { //$NON-NLS-0$ - return self._digitArgument(0); - }, {name: util.formatMessage(messages.digitArgument, "0")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-1", function() { //$NON-NLS-0$ - return self._digitArgument(1); - }, {name: util.formatMessage(messages.digitArgument, "1")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-2", function() { //$NON-NLS-0$ - return self._digitArgument(2); - }, {name: util.formatMessage(messages.digitArgument, "2")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-3", function() { //$NON-NLS-0$ - return self._digitArgument(3); - }, {name: util.formatMessage(messages.digitArgument, "3")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-4", function() { //$NON-NLS-0$ - return self._digitArgument(4); - }, {name: util.formatMessage(messages.digitArgument, "4")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-5", function() { //$NON-NLS-0$ - return self._digitArgument(5); - }, {name: util.formatMessage(messages.digitArgument, "5")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-6", function() { //$NON-NLS-0$ - return self._digitArgument(6); - }, {name: util.formatMessage(messages.digitArgument, "6")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-7", function() { //$NON-NLS-0$ - return self._digitArgument(7); - }, {name: util.formatMessage(messages.digitArgument, "7")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-8", function() { //$NON-NLS-0$ - return self._digitArgument(8); - }, {name: util.formatMessage(messages.digitArgument, "8")}); //$NON-NLS-0$ - view.setAction("emacs-digit-argument-9", function() { //$NON-NLS-0$ - return self._digitArgument(9); - }, {name: util.formatMessage(messages.digitArgument, "9")}); //$NON-NLS-0$ - view.setAction("emacs-negative-argument", function() { //$NON-NLS-0$ - return self._negativeArgument(); - }, {name: messages.negativeArgument}); - - view.setAction("emacs-uppercase", function() { //$NON-NLS-0$ - var data = self._getData(); - data.unit = "word"; //$NON-NLS-0$ - return view.invokeAction("uppercase", false, data); //$NON-NLS-0$ - }, {name: messages.uppercase}); - view.setAction("emacs-lowercase", function() { //$NON-NLS-0$ - var data = self._getData(); - data.unit = "word"; //$NON-NLS-0$ - return view.invokeAction("lowercase", false, data); //$NON-NLS-0$ - }, {name: messages.lowercase}); - view.setAction("emacs-capitalize", function() { //$NON-NLS-0$ - var data = self._getData(); - data.unit = "word"; //$NON-NLS-0$ - return view.invokeAction("capitalize", false, data); //$NON-NLS-0$ - }, {name: messages.capitalize}); - }; - - return { - EmacsMode: EmacsMode - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/vi", [ //$NON-NLS-0$ - "i18n!orion/editor/nls/messages", //$NON-NLS-0$ - "orion/editor/keyModes", //$NON-NLS-0$ - "orion/keyBinding", //$NON-NLS-0$ - "orion/util" //$NON-NLS-0$ -], function (messages, mKeyMode, mKeyBinding, util) { - - var yankText, yankEditLine; - - function mixin(object, proto) { - for (var p in proto) { - if (proto.hasOwnProperty(p)) { - object[p] = proto[p]; - } - } - } - - function createStroke(keyCode, mod1, mod2, mod3, mod4, type, scope) { - var result = new mKeyBinding.KeyStroke(keyCode, mod1, mod2, mod3, mod4, type); - result.scopeName = scope || messages.vi; - return result; - } - - function createSequence(keys, scope) { - var result = new mKeyBinding.KeySequence(keys); - result.scopeName = scope || messages.vi; - return result; - } - - - function NumberMode(textView, key, msg){ - this.key = key; - this.msg = msg; - this.number = ""; - mKeyMode.KeyMode.call(this, textView); - //Create actions - if (textView) { - this._createActions(textView); - } - } - NumberMode.prototype = new mKeyMode.KeyMode(); - mixin(NumberMode.prototype, /** @lends orion.editor.viMode.NumberMode.prototype */ { - _msg: function(key){ - return {name: util.formatMessage(messages[key], this.msg)}; - }, - createKeyBindings: function() { - var bindings = []; - var key = this.key; - - if (key) { - key = "-" + key + "-"; //$NON-NLS-1$ //$NON-NLS-0$ - } else { - key = "-"; //$NON-NLS-0$ - } - - //Numbers - for (var i=0; i<=9; i++) { - bindings.push({actionID: "vi" + key + i, keyBinding: createStroke(i+"", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - } - - //Movement - //left - bindings.push({actionID: "vi" + key + "Left", keyBinding: createStroke("h", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Left", keyBinding: createStroke("h", true, false, false, false)}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Left", keyBinding: createStroke(8)}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Left", keyBinding: createStroke(37)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //down - bindings.push({actionID: "vi" + key + "Down", keyBinding: createStroke("j", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Down", keyBinding: createStroke(40)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //up - bindings.push({actionID: "vi" + key + "Up", keyBinding: createStroke("k", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Up", keyBinding: createStroke(38)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //right - bindings.push({actionID: "vi" + key + "Right", keyBinding: createStroke("l", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Right", keyBinding: createStroke(39)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "Right", keyBinding: createStroke(32)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //text movement - bindings.push({actionID: "vi" + key + "w", keyBinding: createStroke("w", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "b", keyBinding: createStroke("b", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - //TODO: add - bindings.push({actionID: "vi" + key + "W", keyBinding: createStroke("W", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - //TODO: add - bindings.push({actionID: "vi" + key + "B", keyBinding: createStroke("B", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - //TODO: - bindings.push({actionID: "vi" + key + "e", keyBinding: createStroke("e", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "E", keyBinding: createStroke("E", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + ")", keyBinding: createStroke(")", false, false, false, false, "keypress")}); //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + "(", keyBinding: createStroke("(", false, false, false, false, "keypress")}); //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + "}", keyBinding: createStroke("}", false, false, false, false, "keypress")}); //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + "{", keyBinding: createStroke("{", false, false, false, false, "keypress")}); //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + "]]", keyBinding: createStroke("]]", false, false, false, false, "keypress")}); //$NON-NLS-0$ - //bindings.push({actionID: "vi" + key + "[[", keyBinding: createStroke("[[", false, false, false, false, "keypress")}); //$NON-NLS-0$ - - //Lines - bindings.push({actionID: "vi" + key + "$", keyBinding: createStroke("$", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi" + key + "^_", keyBinding: createStroke("^", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "^_", keyBinding: createStroke("_", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi" + key + "+", keyBinding: createStroke("+", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "+", keyBinding: createStroke(13)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "-", keyBinding: createStroke("-", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "|", keyBinding: createStroke("|", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi" + key + "H", keyBinding: createStroke("H", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "M", keyBinding: createStroke("M", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "L", keyBinding: createStroke("L", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Screens - - //Searches - bindings.push({actionID: "vi" + key + "/", keyBinding: createStroke("/", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "?", keyBinding: createStroke("?", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "n", keyBinding: createStroke("n", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "N", keyBinding: createStroke("N", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "f", keyBinding: createStroke("f", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "F", keyBinding: createStroke("F", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "t", keyBinding: createStroke("t", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + "T", keyBinding: createStroke("T", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + ",", keyBinding: createStroke(",", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi" + key + ";", keyBinding: createStroke(";", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Line numbering - bindings.push({actionID: "vi" + key + "G", keyBinding: createStroke("G", false, false, false, false, "keypress")}); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - return bindings; - }, - _createActions: function(view) { - - var key = this.key; - if (key) { - key = "-" + key + "-"; //$NON-NLS-1$ //$NON-NLS-0$ - } else { - key = "-"; //$NON-NLS-0$ - } - var self = this; - view.setAction("vi" + key +"0", function() {return self._storeNumber(0);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"1", function() {return self._storeNumber(1);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"2", function() {return self._storeNumber(2);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"3", function() {return self._storeNumber(3);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"4", function() {return self._storeNumber(4);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"5", function() {return self._storeNumber(5);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"6", function() {return self._storeNumber(6);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"7", function() {return self._storeNumber(7);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"8", function() {return self._storeNumber(8);}); //$NON-NLS-1$ //$NON-NLS-0$ - view.setAction("vi" + key +"9", function() {return self._storeNumber(9);}); //$NON-NLS-1$ //$NON-NLS-0$ - - //Utility - function firstNonBlankChar(lineIndex) { - var model = view.getModel(); - var lineText = model.getLine(lineIndex); - var offsetInLine = 0; - var c = lineText.charCodeAt(offsetInLine); - while (c === 32 || c === 9) { - offsetInLine++; - c = lineText.charCodeAt(offsetInLine); - } - return offsetInLine; - } - - function findCallback(range, data){ - if (range) { - self.getView().setCaretOffset(range.start); - } - if (data.editDone) { - data.editDone(); - } - } - // - - //Movement - view.setAction("vi" + key + "Left", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("charPrevious", {unit: "character"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viLeft")); //$NON-NLS-0$ - - view.setAction("vi" + key + "Right", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("charNext", {unit: "character"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viRight")); //$NON-NLS-0$ - - view.setAction("vi" + key + "Up", function() {//$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("lineUp", {editLine:true}); //$NON-NLS-0$ - }, this._msg("viUp")); //$NON-NLS-0$ - - view.setAction("vi" + key + "Down", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("lineDown", {editLine:true}); //$NON-NLS-0$ - }, this._msg("viDown")); //$NON-NLS-0$ - - //text movement - view.setAction("vi" + key + "w", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("wordNext", {unit: "word"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viw")); //$NON-NLS-0$ - - view.setAction("vi" + key + "b", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("wordPrevious", {unit: "word"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("vib")); //$NON-NLS-0$ - - view.setAction("vi" + key + "W", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("wordNext", {unit: "wordWS"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viW")); //$NON-NLS-0$ - - view.setAction("vi" + key + "B", function() {//$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("wordPrevious", {unit: "wordWS"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viB")); //$NON-NLS-0$ - - view.setAction("vi" + key + "e", function() { //$NON-NLS-1$ //$NON-NLS-0$ - self._invoke("charNext", {unit: "character"}); //$NON-NLS-1$ //$NON-NLS-0$ - self._invoke("wordNext", {unit: "wordend"}); //$NON-NLS-1$ //$NON-NLS-0$ - self._invoke("charPrevious", {unit: "character"}); //$NON-NLS-1$ //$NON-NLS-0$ - return true; - }, this._msg("vie")); //$NON-NLS-0$ - - view.setAction("vi" + key + "E", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("wordNext", {unit: "wordendWS"}); //$NON-NLS-1$ //$NON-NLS-0$ - }, this._msg("viE")); //$NON-NLS-0$ - - //Lines - view.setAction("vi" + key + "$", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("lineEnd"); //$NON-NLS-0$ - }, this._msg("vi$")); //$NON-NLS-0$ - - view.setAction("vi" + key + "^_", function() {//$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function () { - var model = view.getModel(); - var offset = view.getCaretOffset(); - var lineIndex = model.getLineAtOffset(offset); - view.setCaretOffset(model.getLineStart(lineIndex) + firstNonBlankChar(lineIndex)); - }); - }, this._msg("vi^_")); //$NON-NLS-0$ - - view.setAction("vi" + key + "+", function() { ///$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - var model = view.getModel(); - var offset = view.getCaretOffset(); - var lastLineCount = model.getLineCount() - 1; - var lineIndex = Math.min (model.getLineAtOffset(offset) + data.count, lastLineCount); - view.setCaretOffset(model.getLineStart(lineIndex) + firstNonBlankChar(lineIndex)); - }, {editLine:true}); - }, this._msg("vi+")); //$NON-NLS-0$ - - view.setAction("vi" + key + "-", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - var model = view.getModel(); - var offset = view.getCaretOffset(); - var lineIndex = Math.max(model.getLineAtOffset(offset) - data.count, 0); - view.setCaretOffset(model.getLineStart(lineIndex) + firstNonBlankChar(lineIndex)); - }, {editLine:true}); - }, this._msg("vi-")); //$NON-NLS-0$ - - view.setAction("vi" + key + "|", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - var model = view.getModel(); - var offset = view.getCaretOffset(); - var lineIndex = model.getLineAtOffset(offset); - view.setCaretOffset(Math.min(model.getLineStart(lineIndex) + data.count - 1, model.getLineEnd(lineIndex))); - }); - }, this._msg("vi|")); //$NON-NLS-0$ - - view.setAction("vi" + key + "H", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - var topIndex = view.getModel().getLineStart(view.getTopIndex(true) + (data.count - 1)); - view.setCaretOffset(topIndex); - }, {editLine:true}); - }, this._msg("viH")); //$NON-NLS-0$ - - view.setAction("vi" + key + "M", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - var middleIndex = Math.ceil((view.getBottomIndex(true) - view.getTopIndex(true))/2) + view.getTopIndex(true); - view.setCaretOffset(view.getModel().getLineStart(middleIndex)); - }, {editLine:true}); - }, this._msg("viM")); //$NON-NLS-0$ - - view.setAction("vi" + key + "L", function() { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke(function (data) { - view.setCaretOffset(view.getModel().getLineStart(view.getBottomIndex(true) - (data.count - 1))); - }, {editLine:true}); - }, this._msg("viL")); //$NON-NLS-0$ - - //Searches - view.setAction("vi" + key + "/", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var data = {hideAfterFind:true, incremental:false, reverse:false, findCallback: function(range) { - self._searchFwd = true; - findCallback(range, data); - }}; - return self._invoke("find", data); //$NON-NLS-0$ - }, this._msg("vi/")); //$NON-NLS-0$ - - view.setAction("vi" + key + "?", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var data = {hideAfterFind:true, incremental:false, reverse:true, findCallback: function(range) { - self._searchFwd = false; - findCallback(range, data); - }}; - return self._invoke("find", data); //$NON-NLS-0$ - }, this._msg("vi?")); //$NON-NLS-0$ - - view.setAction("vi" + key + "n", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var findAction, start = view.getCaretOffset(); - if (self._searchFwd) { - findAction = "findNext"; //$NON-NLS-0$ - start++; - } else { - findAction = "findPrevious"; //$NON-NLS-0$ - } - var data = {start: start, findCallback: function(range) { - findCallback(range, data); - }}; - return self._invoke(findAction, data); - }, this._msg("vin")); //$NON-NLS-0$ - - view.setAction("vi" + key + "N", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var findAction, start = view.getCaretOffset(); - if (!self._searchFwd) { - findAction = "findNext"; //$NON-NLS-0$ - start++; - } else { - findAction = "findPrevious"; //$NON-NLS-0$ - } - var data = {start: start, findCallback: function(range) { - findCallback(range, data); - }}; - return self._invoke(findAction, data); - }, this._msg("viN")); //$NON-NLS-0$ - - view.setAction("vi" + key + "f", function() {//$NON-NLS-1$ //$NON-NLS-0$ - var model = view.getModel(); - var start = view.getCaretOffset(); - return self._findChar(start, model.getLineEnd(model.getLineAtOffset(start)), false, 0); - }, this._msg("vif")); //$NON-NLS-0$ - - view.setAction("vi" + key + "F", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var model = view.getModel(); - var end = view.getCaretOffset(); - return self._findChar( model.getLineStart(model.getLineAtOffset(end)), end, true, 0); - }, this._msg("viF")); //$NON-NLS-0$ - - view.setAction("vi" + key + "t", function() {//$NON-NLS-1$ //$NON-NLS-0$ - var model = view.getModel(); - var start = view.getCaretOffset(); - return self._findChar(start, model.getLineEnd(model.getLineAtOffset(start)), false, -1); - }, this._msg("vit")); //$NON-NLS-0$ - - view.setAction("vi" + key + "T", function() { //$NON-NLS-1$ //$NON-NLS-0$ - var model = view.getModel(); - var end = view.getCaretOffset(); - return self._findChar( model.getLineStart(model.getLineAtOffset(end)), end, true, 1); - }, this._msg("viT")); //$NON-NLS-0$ - - view.setAction("vi" + key + ",", function() { //$NON-NLS-1$ //$NON-NLS-0$ - if (self._charTempOptions) { - return self._findNextChar(self._charTempOptions.reverse); - } - }, this._msg("vi,")); //$NON-NLS-0$ - - view.setAction("vi" + key + ";", function() { //$NON-NLS-1$ //$NON-NLS-0$ - if (self._charTempOptions) { - return self._findNextChar(!self._charTempOptions.reverse); - } - }, this._msg("vi;")); //$NON-NLS-0$ - - //Line numbering - view.setAction("vi" + key + "G", function() { //$NON-NLS-1$ //$NON-NLS-0$ - if (self.number === "") { //$NON-NLS-0$ - var model = view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - self.number = model.getLineCount(); - } - return self._invoke(function (data) { - data = data || {}; - data.line=data.count; - data.editLine=true; - data.callback = function() { - if (data.editDone) { - data.editDone(); - } - }; - view.invokeAction("gotoLine", false, data); //$NON-NLS-0$ - }); - //TODO: this works if gotoLine is registered (not part of textview) - need to handle fail case - }, this._msg("viG")); //$NON-NLS-0$ - }, - _invoke: function(action, data) { - var view = this.getView(); - data = data || {}; - data.count = this._getCount(); - if (typeof action === "function") { //$NON-NLS-0$ - action(data); - } else { - view.invokeAction(action, false, data); - } - return true; - }, - _getCount: function() { - var num = 1; - if (this.number !== "") { //$NON-NLS-0$ - num = this.number >> 0; - } - this.number = ""; //$NON-NLS-0$ - return num; - }, - _findChar: function (start, end, reverse, offset) { - this._charTempOptions = {}; - this._charTempOptions.start = start; - this._charTempOptions.end= end; - this._charTempOptions.hideAfterFind = true; - this._charTempOptions.incremental = false; - this._charTempOptions.reverse = reverse; - this._charTempOptions.offset = offset; - var data = this._charTempOptions; - var self = this; - this._charTempOptions.findCallback = function(range) { - if (range) { - self.getView().setCaretOffset(range.start + offset); - } - if (data.editDone) { - data.editDone(); - } - }; - return this._invoke("find", this._charTempOptions); //$NON-NLS-0$ - }, - _findNextChar: function (forward) { - if (this._charTempOptions) { - var view = this.getView(); - var tempTempOptions = {}; - tempTempOptions.hideAfterFind = this._charTempOptions.hideAfterFind; - tempTempOptions.incremental = this._charTempOptions.incremental; - tempTempOptions.reverse = this._charTempOptions.reverse; - tempTempOptions.wrap = false; - var data = tempTempOptions; - var self = this; - tempTempOptions.findCallback = function(range){ - if (range) { - self.getView().setCaretOffset(range.start + self._charTempOptions.offset); - } - if (data.editDone) { - data.editDone(); - } - }; - var model = view.getModel(); - if (forward) { - tempTempOptions.start = view.getCaretOffset() + 1 - this._charTempOptions.offset; - tempTempOptions.end= model.getLineEnd(model.getLineAtOffset(tempTempOptions.start)); - tempTempOptions.reverse = false; - return this._invoke("findNext", tempTempOptions); //$NON-NLS-0$ - } else { - tempTempOptions.start = view.getCaretOffset() - this._charTempOptions.offset; - tempTempOptions.end = model.getLineStart(model.getLineAtOffset(tempTempOptions.start)); - tempTempOptions.reverse = true; - return this._invoke("findPrevious", tempTempOptions); //$NON-NLS-0$ - } - } - return true; - }, - _storeNumber: function(index) { - var self = this; - if (index === 0 && !this.number) { - return this._invoke(function() { - self.getView().invokeAction("lineStart", true); //$NON-NLS-0$) - }); - } - this.number += index; - return true; - } - }); - - //Status Line Mode - function StatusLineMode(viMode) { - var view = viMode.getView(); - this.viMode = viMode; - mKeyMode.KeyMode.call(this, view); - this._createActions(view); - } - StatusLineMode.prototype = new mKeyMode.KeyMode(); - mixin(StatusLineMode.prototype, /** @lends orion.editor.viMode.StatusLineMode.prototype */ { - createKeyBindings: function() { - var bindings = []; - bindings.push({actionID: "vi-:-ESC", keyBinding: createStroke(27), predefined: true}); //$NON-NLS-0$ - return bindings; - }, - _createActions: function(view) { - var self = this; - view.setAction("vi-:-ESC", function() { //$NON-NLS-0$ - view.removeKeyMode(self); - view.addKeyMode(self.viMode); - return true; - }); - }, - match: function(e) { - var result = mKeyMode.KeyMode.prototype.match.call(this, e); - if (!result) { - result = this.getView().getKeyModes()[0].match(e); - } - return result; - }, - storeNumber: function(n) { - this.number = n; - } - }); - - - //Edit Mode - function EditMode(viMode, nextMode, key, msg) { - this.viMode = viMode; - this.nextMode = nextMode; - NumberMode.call(this, viMode.getView(), key, msg); - } - - EditMode.prototype = new NumberMode(); - mixin(EditMode.prototype, /** @lends orion.editor.viMode.EditMode.prototype */ { - createKeyBindings: function() { - var bindings = NumberMode.prototype.createKeyBindings.call(this); - bindings.push({actionID: "vi-"+this.key+"ESC", keyBinding: createStroke(27), predefined: true});//$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-"+this.key+"-"+this.key, keyBinding: createStroke(this.key, false, false, false, false, "keypress")});//$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - return bindings; - }, - _invoke: function(action, data) { - data = data || {}; - var view = this.getView(); - var caretOffset = view.getCaretOffset(); - var startOffset = caretOffset; - var model = view.getModel(); - var self = this; - data.editDone = function() { - var endOffset = view.getCaretOffset(); - if (startOffset > endOffset) { - var tmp = startOffset; - startOffset = endOffset; - endOffset = tmp; - } - if (data.editLine) { - startOffset = model.getLineStart(model.getLineAtOffset(startOffset)); - endOffset = model.getLineEnd(model.getLineAtOffset(endOffset), self.key === "c" ? false : true); //$NON-NLS-0$ - } - if (self.key === "y") { //$NON-NLS-0$ - yankText = view.getText(startOffset, endOffset); - yankEditLine = data.editLine; - view.setCaretOffset(caretOffset); - } else { - view.setText("", startOffset, endOffset); - } - view.removeKeyMode(self); - view.addKeyMode(self.nextMode); - }; - NumberMode.prototype._invoke.call(this, action, data); - data.editDone(); - return true; - }, - _getCount: function() { - var num = 1; - if (this.firstNumber !== "") { - num = this.firstNumber >> 0; - } - var secondNum = 1; - if (this.number !== "" ) { - secondNum = this.number >> 0; - } - num *= secondNum; - this.number = this.firstNumber = ""; - return num; - }, - _createActions: function(view) { - NumberMode.prototype._createActions.call(this, view); - var self = this; - view.setAction("vi-"+self.key+"ESC", function() { //$NON-NLS-1$ //$NON-NLS-0$ - view.removeKeyMode(self); - view.addKeyMode(self.viMode); - return true; - }); - view.setAction("vi-"+self.key+"-"+self.key, function () { //$NON-NLS-1$ //$NON-NLS-0$ - return self._invoke("lineEnd", {editLine:true}); //$NON-NLS-0$ - }, this._msg("viycd")); //$NON-NLS-0$ - }, - storeNumber: function(number) { - this.firstNumber = number; - }, - _modeAdded: function() { - this.secondNumber = ""; - }, - _modeRemoved: function() { - this.command = ""; - this.firstNumber = ""; - this.number = ""; - } - }); - - //Insert Mode - function InsertMode(viMode) { - var view = viMode.getView(); - mKeyMode.KeyMode.call(this, view); - this.viMode = viMode; - this._createActions(view); - } - InsertMode.prototype = new mKeyMode.KeyMode(); - - mixin(InsertMode.prototype, /** @lends orion.editor.viMode.InsertMode.prototype */ { - createKeyBindings: function() { - var bindings = []; - bindings.push({actionID: "vi-insert-ESC", keyBinding: createStroke(27), predefined: true}); //$NON-NLS-0$ - return bindings; - }, - _createActions: function(view) { - var self = this; - view.setAction("vi-insert-ESC", function() { //$NON-NLS-0$ - view.removeKeyMode(self); - view.addKeyMode(self.viMode); - return true; - }); - }, - match: function(e) { - var result = mKeyMode.KeyMode.prototype.match.call(this, e); - if (!result) { - result = this.getView().getKeyModes()[0].match(e); - } - return result; - }, - storeNumber: function(n) { - } - }); - - function VIMode(textView, statusReporter){ - NumberMode.call(this, textView, "", messages.vimove); - this.insertMode = new InsertMode(this); - this.changeMode = new EditMode(this, this.insertMode, "c", messages.vichange); //$NON-NLS-0$ - this.deleteMode = new EditMode(this, this, "d", messages.videlete); //$NON-NLS-0$ - this.yankMode = new EditMode(this, this, "y", messages.viyank); //$NON-NLS-0$ - this.statusReporter = statusReporter; - } - VIMode.prototype = new NumberMode(); - mixin(VIMode.prototype, /** @lends orion.editor.viMode.VIMode.prototype */ { - createKeyBindings: function() { - var bindings = NumberMode.prototype.createKeyBindings.call(this); - - bindings.push({actionID: "vi-ctrl-f", keyBinding: createStroke("f", true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-ctrl-b", keyBinding: createStroke("b", true)}); //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-ctrl-e", keyBinding: createStroke("e", true)}); //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-ctrl-y", keyBinding: createStroke("y", true)}); //$NON-NLS-1$ //$NON-NLS-0$ - - //Status Line mode - bindings.push({actionID: "statusLineMode", keyBinding: createStroke(":", false, false, false, false, "keypress")}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - - //Insert - bindings.push({actionID: "vi-a", keyBinding: createStroke("a", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-A", keyBinding: createStroke("A", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-i", keyBinding: createStroke("i", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-I", keyBinding: createStroke("I", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-o", keyBinding: createStroke("o", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-O", keyBinding: createStroke("O", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-R", keyBinding: createStroke("R", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-s", keyBinding: createStroke("s", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-S", keyBinding: createStroke("S", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Paste - bindings.push({actionID: "vi-p", keyBinding: createStroke("p", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-P", keyBinding: createStroke("P", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - // Undo - bindings.push({actionID: "vi-u", keyBinding: createStroke("u", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - //Change - bindings.push({actionID: "vi-c", keyBinding: createStroke("c", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-d", keyBinding: createStroke("d", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-y", keyBinding: createStroke("y", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-~", keyBinding: createStroke("~", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-x", keyBinding: createStroke("x", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-X", keyBinding: createStroke("X", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - bindings.push({actionID: "vi-C", keyBinding: createStroke("C", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-D", keyBinding: createStroke("D", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - bindings.push({actionID: "vi-*", keyBinding: createStroke("*", false, false, false, false, "keypress"), predefined: true}); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - - return bindings; - }, - getKeyBindings: function (actionID) { - var result = mKeyMode.KeyMode.prototype.getKeyBindings.call(this, actionID); - result = result || []; - var keyBindings = this.changeMode.getKeyBindings(actionID); - var i; - if (!this.changeMode.isActive()) { - for (i=0; i> 0; - } - data.count = num; - var view = this.getView(); - this.insertMode.storeNumber(this.number); - view.invokeAction(action, false, data); - view.removeKeyMode(this); - view.addKeyMode(this.insertMode); - this.number = ""; - return true; - }, - _modeAdded: function() { - this.getView().setOptions({blockCursorVisible: true}); - }, - _modeRemoved: function() { - var view = this.getView(); - view.setOptions({blockCursorVisible: false}); - view.removeKeyMode(this.insertMode); - view.removeKeyMode(this.changeMode); - view.removeKeyMode(this.deleteMode); - } - }); - - return { - VIMode: VIMode - }; -}); - -/*eslint-env browser, amd*/ -define('orion/editorPreferences',[], function() { - return { - }; -}); -/*eslint-env browser, amd*/ -define('orion/widgets/themes/ThemePreferences',[], function() { - return { - }; -}); -/*eslint-env browser, amd*/ -define('orion/widgets/themes/editor/ThemeData',[], function() { - return { - }; -}); -/*eslint-env browser, amd*/ -define('orion/widgets/settings/EditorSettings',[], function(){ - return null; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2014 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - * Adrian Aichner - regular expression capture group support in replace - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/searchAndReplace/textSearcher',[], function(){ - return {TextSearcher: null}; -}); -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), - * and the Eclipse Distribution License v1.0 - * (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/globalCommands',[], function() { - return { - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/edit/dispatcher',[], function() { - /** - * @name orion.edit.Dispatcher - * @class Forwards events from an {@link orion.editor.Editor} to interested services. - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {orion.core.ContentTypeRegistry} - * @param {orion.editor.Editor} editor - * @param {orion.editor.InputManger} inputManager - */ - function Dispatcher(serviceRegistry, contentTypeRegistry, editor, inputManager) { - this.serviceRegistry = serviceRegistry; - this.editor = editor; - this.inputManager = inputManager; - this.ctRegistry = contentTypeRegistry; - this.serviceReferences = {}; - - var that = this; - this.inputManager.addEventListener("InputChanged", function(e) { - that.contentType = e.contentType; - that.updateListeners(); - }.bind(this)); - this.listener = { - onServiceAdded: function(evnt) { - that._onServiceAdded(evnt.serviceReference); - }, - onServiceRemoved: function(evnt) { - that._onServiceRemoved(evnt.serviceReference); - } - }; - this.serviceRegistry.addEventListener("registered", this.listener.onServiceAdded); - this.serviceRegistry.addEventListener("unregistering", this.listener.onServiceRemoved); - } - Dispatcher.prototype = /** @lends orion.edit.Dispatcher.prototype */ { - updateListeners: function() { - this._removeAllListeners(); - - var serviceRegistry = this.serviceRegistry, - serviceRefs = serviceRegistry.getServiceReferences("orion.edit.model"); //$NON-NLS-0$ - for (var i=0; i < serviceRefs.length; i++) { - this._wireServiceReference(serviceRefs[i]); - } - }, - _wireServiceReference: function(serviceRef) { - var refContentType = serviceRef.getProperty("contentType"); //$NON-NLS-0$ - if (typeof refContentType !== "undefined" && refContentType !== null) { - // See if the registered service is interested in the current ContentType. - var _self = this; - var inputContentType = this.contentType; - if (this.ctRegistry.isSomeExtensionOf(inputContentType, refContentType)) { - _self._wireService(serviceRef, _self.serviceRegistry.getService(serviceRef)); - } - } - }, - _wireService: function(serviceReference, service) { - var textView = this.editor.getTextView(); - if (!textView) - throw new Error("TextView not installed"); //$NON-NLS-1$ - var keys = Object.keys(service); - for (var i=0; i < keys.length; i++) { - var key = keys[i], method = service[key]; - if (key.substr(0, 2) !== "on" || typeof method !== "function") { - continue; - } - var type = key.substr(2); - this._wireServiceMethod(serviceReference, service, method, textView, type); - } - }, - /** - * @callback - */ - _wireServiceMethod: function(serviceReference, service, serviceMethod, textView, type) { -// console.log(" Add listener " + type + " for " + serviceReference.getProperty('service.id')); - var _self = this; - var listener = function(evnt) { - // Inject metadata about the file being edited into the event. - evnt.file = _self.getServiceFileObject(); - serviceMethod(evnt).then(/*No return value*/); - }; - var serviceId = serviceReference.getProperty('service.id'); //$NON-NLS-0$ - this.serviceReferences[serviceId] = this.serviceReferences[serviceId] || []; - this.serviceReferences[serviceId].push([textView, type, listener]); - textView.addEventListener(type, listener); - }, - _onServiceRemoved: function(serviceReference) { - var serviceId = serviceReference.getProperty('service.id'); //$NON-NLS-1$ - this._removeListeners(serviceId); - }, - _onServiceAdded: function(serviceReference) { - if (serviceReference.getProperty("objectClass").indexOf("orion.edit.model") !== -1) { //$NON-NLS-0$ //$NON-NLS-2$ - this._wireServiceReference(serviceReference); - } - }, - _removeListeners: function(serviceId) { - var serviceReferences = this.serviceReferences[serviceId]; - if (serviceReferences) { - for (var i=0; i < serviceReferences.length; i++) { - var listener = serviceReferences[i]; - var textView = listener[0], type = listener[1], func = listener[2]; -// console.log(" Remove listener " + type + " for " + serviceId); - textView.removeEventListener(type, func); - } - delete this.serviceReferences[serviceId]; - } - }, - _removeAllListeners: function() { - var keys = Object.keys(this.serviceReferences); - for (var i=0; i < keys.length; i++) { - this._removeListeners(keys[i]); - } - }, - /** - * @since 8.0 - */ - getServiceFileObject: function() { - var metadata = this.inputManager.getFileMetadata(); - if (!metadata) { - return null; - } - return Dispatcher.toServiceFileObject(metadata, this.inputManager.getContentType()); - } - }; - - /** - * @since 8.0 - */ - Dispatcher.toServiceFileObject = function(metadata, contentType) { - var data = Object.create(null); - data.name = metadata.Name; - data.location = metadata.Location; - data.parents = metadata.Parents; - - if (contentType) { - data.contentType = Object.create(null); - data.contentType.id = contentType.id; - data.contentType.name = contentType.name; - data.contentType.imageClass = contentType.imageClass; - data.contentType.extension = contentType.extension; - } - return data; - }; - - return {Dispatcher: Dispatcher}; -}); -/******************************************************************************* - * @license - * Copyright (c) 2013, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/edit/editorContext',[ -], function() { - - /** - * @name orion.edit.EditorContext - * @class Encapsulates service methods related to an editor. - * @classdesc Encapsulates service methods related to an editor. - * @description - */ - - /** - * Gets the editor context service. - * @name orion.edit.EditorContext.getEditorContext - * @function - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry The service registry to consult. - * @returns {orion.edit.EditorContext} - */ - function getEditorContext(serviceRegistry, serviceID) { - var editorContext = Object.create(null); - getReferences(serviceRegistry, serviceID).forEach(function(serviceRef) { - var service = serviceRegistry.getService(serviceRef); - Object.keys(service).forEach(function(key) { - if (typeof service[key] === "function") { //$NON-NLS-0$ - editorContext[key] = service[key].bind(service); - } - }); - }); - return editorContext; - } - - /** - * Gets the editor context "options" object. - * @name orion.edit.EditorContext.getOptions - * @function - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry The service registry to consult. - * @returns {Object} - */ - function getOptions(serviceRegistry, serviceID) { - var options = Object.create(null); - getReferences(serviceRegistry, serviceID).forEach(function(serviceRef) { - serviceRef.getPropertyKeys().forEach(function(key) { - if (key !== "service.id" && key !== "service.names" && key !== "objectClass") //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - options[key] = serviceRef.getProperty(key); - }); - }); - return options; - } - - function getReferences(serviceRegistry, serviceID) { - return serviceRegistry.getServiceReferences(serviceID || "orion.edit.context"); //$NON-NLS-0$ - } - - return { - getEditorContext: getEditorContext, - getOptions: getOptions - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), - * and the Eclipse Distribution License v1.0 - * (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('examples/editor/textStyler',[], function() { - return { - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - * Alex Lakatos - fix for bug#369781 - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textStyler", ['orion/editor/annotations', 'orion/editor/eventTarget', 'orion/metrics'], //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - function(mAnnotations, mEventTarget, mMetrics) { - - /* - * Throughout textStyler "block" refers to a potentially multi-line token. - * Typical examples are multi-line comments and multi-line strings. - */ - - var binarySearch = function(array, offset, inclusive, low, high) { - var index; - if (low === undefined) { low = -1; } - if (high === undefined) { high = array.length; } - while (high - low > 1) { - index = Math.floor((high + low) / 2); - if (offset <= array[index].start) { - high = index; - } else if (inclusive && offset < array[index].end) { - high = index; - break; - } else { - low = index; - } - } - return high; - }; - - function copy(object) { - return JSON.parse(JSON.stringify(object)); - } - - var createPatternBasedAdapter = function(grammars, rootId, contentType) { - return new PatternBasedAdapter(grammars, rootId, contentType); - }; - - function PatternBasedAdapter(grammars, rootId, contentType) { - this._patternManager = new PatternManager(grammars, rootId); - this._contentType = contentType; - } - PatternBasedAdapter.prototype = { - blockSpansBeyondEnd: function(block) { - return block.pattern.regexEnd === this._eolRegex; - }, - computeBlocks: function(model, text, block, offset, startIndex, endIndex, maxBlockCount) { - if (!text) { - return []; - } - - var results = []; - var matches = []; - var result; - startIndex = startIndex || 0; - endIndex = endIndex || Infinity; - maxBlockCount = maxBlockCount || Infinity; - block.blockPatterns.forEach(function(current) { - result = this._findMatch(current.regexBegin || current.regex, text, startIndex); - if (result) { - matches.push({result: result, pattern: current}); - } - }.bind(this)); - if (!matches.length) { - return results; - } - matches.sort(function(a,b) { - if (a.result.index < b.result.index) { - return -1; - } - if (a.result.index > b.result.index) { - return 1; - } - return a.pattern.pattern.index < b.pattern.pattern.index ? -1 : 1; - }); - - var index = 0; - while (matches.length > 0) { - var current = matches[0]; - matches.splice(0,1); - - if (endIndex < current.result.index) { - break; - } - - if (current.result.index < index) { - /* processing of another match has moved index beyond this match */ - this._updateMatch(current, text, matches, index, endIndex); - continue; - } - - var start = offset + current.result.index; - var contentStart = current.result.index; - var resultEnd = null; - - var endRegex = current.pattern.regexEnd; - if (!endRegex) { - resultEnd = this.createBlock( - { - start: start, - end: start + current.result[0].length, - contentStart: start, - contentEnd: start + current.result[0].length - }, - block.styler, - model, - block, - current.pattern); - } else { - contentStart += current.result[0].length; - var testPattern = current.pattern; - /* - * If the end regex contains a capture reference (eg.- "\1") then substitute - * the resolved capture values from the begin match. - */ - var resolvedEndRegex = this._substituteCaptureValues(endRegex, current.result); - if (resolvedEndRegex !== endRegex) { - /* - * A substitution was made, so make a copy of the test pattern and set its - * end regex to the resolved one. This will cause end-match detection to be - * performed with this concrete end regex value, but the original pattern - * definition containing the capture reference will not be affected. - */ - testPattern = { - pattern: testPattern.pattern, - regexBegin: testPattern.regexBegin, - regexEnd: resolvedEndRegex - }; - endRegex = resolvedEndRegex; - } - - var lastIndex = contentStart; - while (!resultEnd) { - result = this._findMatch(endRegex, text, lastIndex); - if (!result) { - this._eolRegex.lastIndex = 0; - result = this._eolRegex.exec(text); - testPattern = { - pattern: testPattern.pattern, - regexBegin: testPattern.regexBegin, - regexEnd: this._eolRegex - }; - } - var testBlock = this.createBlock( - { - start: start, - end: offset + result.index + result[0].length, - contentStart: offset + contentStart, - contentEnd: offset + result.index - }, - block.styler, - model, - block, - testPattern); - var subBlocks = testBlock.getBlocks(); - if (!subBlocks.length || subBlocks[subBlocks.length - 1].end <= (result.index + offset)) { - resultEnd = testBlock; - } - lastIndex = result.index + result[0].length; - } - } - results.push(resultEnd); - if (results.length === maxBlockCount || endIndex <= resultEnd.end) { - break; - } - index = resultEnd.end - offset; - this._updateMatch(current, text, matches, index, endIndex); - } - return results; - }, - computeStyle: function(block, model, offset) { - if (!block.pattern) { - return null; - } - - var fullBlock = { - start: block.start, - end: block.end, - style: block.pattern.pattern.name - }; - if (block.contentStart <= offset && offset < block.contentEnd) { - if (block.pattern.pattern.contentName) { - return { - start: block.contentStart, - end: block.contentEnd, - style: block.pattern.pattern.contentName - }; - } - return fullBlock; - } - - var regex, captures, testString, index; - if (offset < block.contentStart) { - captures = block.pattern.pattern.beginCaptures || block.pattern.pattern.captures; - if (!captures) { - return fullBlock; - } - regex = block.pattern.regexBegin; - testString = model.getText(block.start, block.contentStart); - index = block.start; - } else { - captures = block.pattern.pattern.endCaptures || block.pattern.pattern.captures; - if (!captures) { - return fullBlock; - } - regex = block.pattern.regexEnd; - testString = model.getText(block.contentEnd, block.end); - index = block.contentEnd; - } - - regex.lastIndex = 0; - var result = regex.exec(testString); - if (result) { - var styles = []; - this._getCaptureStyles(result, captures, index, styles); - var style = styles[binarySearch(styles, offset, true)]; - if (style && style.start <= offset && offset < style.end) { - return style; - } - } - return fullBlock; - }, - createBlock: function(bounds, styler, model, parent, data) { - /* for pattern-based matching data is a pattern */ - return new Block( - bounds, - data ? data.pattern.name : null, - data ? data.pattern.id : null, - styler, - model, - parent, - function(newBlock) { - newBlock.pattern = data; - newBlock.linePatterns = []; - newBlock.blockPatterns = []; - newBlock.enclosurePatterns = {}; - this._initPatterns(this._patternManager, newBlock); - }.bind(this)); - }, - getBlockCommentDelimiters: function(index) { - var languageBlock = this._getLanguageBlock(index); - var blockPatterns = languageBlock.blockPatterns; - if (blockPatterns) { - var COMMENT_BLOCK = "comment.block"; //$NON-NLS-0$ - for (var i = 0; i < blockPatterns.length; i++) { - var current = blockPatterns[i].pattern; - var name = current.name || current.contentName; - if (name && name.indexOf(COMMENT_BLOCK) !== -1) { - if (current.begin && current.end && current.begin.literal && current.end.literal) { - return [current.begin.literal, current.end.literal]; - } - } - } - } - return ["", ""]; - }, - getBlockContentStyleName: function(block) { - return block.pattern.pattern.contentName || block.pattern.pattern.name; - }, - getBlockEndStyle: function(block, text, endIndex, _styles) { - /* pattern-defined blocks specify an end style by either a capture or name */ - var result; - if (block.pattern.regexEnd) { - result = this._findMatch(block.pattern.regexEnd, text, 0); - if (result) { - /* the end match is still valid */ - var captures = block.pattern.pattern.endCaptures || block.pattern.pattern.captures; - if (captures) { - this._getCaptureStyles(result, captures, endIndex - result[0].length, _styles); - } else if (block.pattern.pattern.name) { - _styles.push({start: endIndex - result[0].length, end: endIndex, style: block.pattern.pattern.name}); - } - } - } - return result ? result[0] : null; - }, - getBlockFoldBounds: function(block, model) { - return {start: block.start, end: block.end}; - }, - getBlockStartStyle: function(block, text, index, _styles) { - /* pattern-defined blocks specify a start style by either a capture or name */ - var result; - if (block.pattern.regexBegin) { - result = this._findMatch(block.pattern.regexBegin, text, 0); - if (result) { - /* the begin match is still valid */ - var captures = block.pattern.pattern.beginCaptures || block.pattern.pattern.captures; - if (captures) { - this._getCaptureStyles(result, captures, index, _styles); - } else { - _styles.push({start: index, end: index + result[0].length, style: block.pattern.pattern.name}); - } - } - } - return result ? result[0] : null; - }, - getBracketMatch: function(block, text) { - var match; - var keys = Object.keys(block.enclosurePatterns); - for (var i = 0; i < keys.length; i++) { - var current = block.enclosurePatterns[keys[i]]; - var result = this._findMatch(current.regex, text, 0); - if (result && result.index === 0) { - match = current; - break; - } - } - if (!match) { return null; } - - var closingName; - var atStart = false; - if (match.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN) !== -1) { - atStart = true; - closingName = match.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN, this._PUNCTUATION_SECTION_END); - } else { - closingName = match.pattern.name.replace(this._PUNCTUATION_SECTION_END, this._PUNCTUATION_SECTION_BEGIN); - } - var closingBracket = block.enclosurePatterns[closingName]; - if (!closingBracket) { return null; } - - return { - beginName: match.pattern.name, - endName: closingName, - atStart: atStart - }; - }, - getContentType: function() { - return this._contentType; - }, - getLineCommentDelimiter: function(index) { - var COMMENT_LINE = "comment.line"; //$NON-NLS-0$ - var languageBlock = this._getLanguageBlock(index); - var linePatterns = languageBlock.linePatterns; - if (linePatterns) { - for (var i = 0; i < linePatterns.length; i++) { - var current = linePatterns[i].pattern; - var name = current.name; - if (name && name.indexOf(COMMENT_LINE) !== -1) { - if (current.match && current.match.literal) { - return current.match.literal; - } - } - } - } - var blockPatterns = languageBlock.blockPatterns; - if (blockPatterns) { - for (i = 0; i < blockPatterns.length; i++) { - current = blockPatterns[i].pattern; - name = current.name || current.contentName; - if (name && name.indexOf(COMMENT_LINE) !== -1) { - if (current.begin && current.begin.literal) { - return current.begin.literal; - } - } - } - } - return ""; - }, - parse: function(text, offset, startIndex, block, _styles, ignoreCaptures) { - if (!text) { - return; - } - var patterns = block.linePatterns; - if (!patterns) { - return; - } - - var matches = []; - var result; - patterns.forEach(function(current) { - var regex = current.regex || current.regexBegin; - regex.oldLastIndex = regex.lastIndex; - result = this._findMatch(regex, text, startIndex); - if (result) { - matches.push({result: result, pattern: current}); - } - }.bind(this)); - matches.sort(function(a,b) { - if (a.result.index < b.result.index) { - return -1; - } - if (a.result.index > b.result.index) { - return 1; - } - return a.pattern.pattern.index < b.pattern.pattern.index ? -1 : 1; - }); - - var index = startIndex; - while (matches.length > 0) { - var current = matches[0]; - matches.splice(0,1); - - if (current.result.index < index) { - /* processing of another match has moved index beyond this match */ - this._updateMatch(current, text, matches, index); - continue; - } - - /* apply the style */ - var start = current.result.index; - var end; - var substyles = []; - if (current.pattern.regex) { /* line pattern defined by a "match" */ - result = current.result; - end = start + result[0].length; - var tokenStyle = {start: offset + start, end: offset + end, style: current.pattern.pattern.name}; - if (!ignoreCaptures) { - if (current.pattern.pattern.captures) { - this._getCaptureStyles(result, current.pattern.pattern.captures, offset + start, substyles); - } - substyles.sort(function(a,b) { - if (a.start < b.start) { - return -1; - } - if (a.start > b.start) { - return 1; - } - return 0; - }); - for (var j = 0; j < substyles.length - 1; j++) { - if (substyles[j + 1].start < substyles[j].end) { - var newStyle = {start: substyles[j + 1].end, end: substyles[j].end, style: substyles[j].style}; - substyles[j].end = substyles[j + 1].start; - substyles.splice(j + 2, 0, newStyle); - } - } - } - this._mergeStyles(tokenStyle, substyles, _styles); - } else { /* pattern defined by a "begin/end" pair */ - /* - * If the end match contains a capture reference (eg.- "\1") then update - * its regex with the resolved capture values from the begin match. - */ - var endRegex = current.pattern.regexEnd; - endRegex = this._substituteCaptureValues(endRegex, current.result); - - result = this._findMatch(endRegex, text, current.result.index + current.result[0].length); - if (!result) { - this._eolRegex.lastIndex = 0; - result = this._eolRegex.exec(text); - } - end = result.index + result[0].length; - _styles.push({start: offset + start, end: offset + end, style: current.pattern.pattern.name}); - } - index = result.index + result[0].length; - this._updateMatch(current, text, matches, index); - } - patterns.forEach(function(current) { - var regex = current.regex || current.regexBegin; - regex.lastIndex = regex.oldLastIndex; - }); - }, - setStyler: function(styler) { - this._styler = styler; - }, - verifyBlock: function(baseModel, text, ancestorBlock, changeCount) { - var result = null; - var matches = []; - var match; - var parentBlock = ancestorBlock.parent; - parentBlock.blockPatterns.forEach(function(current) { - match = this._findMatch(current.regexBegin || current.regex, text, 0); - if (match) { - matches.push({result: match, pattern: current}); - } - }.bind(this)); - matches.sort(function(a,b) { - /* ensure that matches at index 0 make it to the front, other matches do not matter */ - if (!a.result.index && b.result.index) { - return -1; - } - if (a.result.index && !b.result.index) { - return 1; - } - if (!a.result.index && !b.result.index) { - return a.pattern.pattern.index < b.pattern.pattern.index ? -1 : 1; - } - return 0; - }); - if (!matches.length || matches[0].result.index !== 0 || matches[0].pattern.pattern.id !== ancestorBlock.pattern.pattern.id) { - result = false; - } else { - /* the block start appears to be unchanged, now verify that the block end is unchanged */ - match = matches[0]; - var endRegex = match.pattern.regexEnd; - if (!endRegex) { - /* single-match block, just verify its length */ - result = ancestorBlock.start + match.result[0].length === ancestorBlock.end + changeCount; - } else { - /* begin/end-match block */ - - /* - * Determine whether an earlier match of the block's end pattern has been introduced. - * Verifying that this has NOT happened (the most typical case) can be quickly done by - * verifying that the first occurrence of its end pattern is still at its former location. - * However if a match is found prior to this then the blocks preceding it must be computed - * to verify that it is a valid end match (ie.- it is not contained within another block). - */ - - /* - * If the end regex contains a capture reference (eg.- "\1") then substitute - * the resolved capture values from the begin match. - */ - endRegex = this._substituteCaptureValues(endRegex, match.result); - - var searchStartIndex = match.result[0].length; - var currentMatch = this._findMatch(endRegex, text, searchStartIndex); - while (result === null && currentMatch && ancestorBlock.start + currentMatch.index !== ancestorBlock.contentEnd + changeCount) { - /* - * A match was found preceeding the former end match, so now compute - * blocks to determine whether it is in fact a valid new end match. - */ - var blocks = this.computeBlocks(baseModel, text, ancestorBlock, ancestorBlock.start, searchStartIndex, currentMatch.index + 1, null); - if (!blocks.length || blocks[blocks.length - 1].end <= ancestorBlock.start + currentMatch.index) { - /* the match is valid, so the attempt to use ancestorBlock as-is fails */ - result = false; - } else { - /* the match is not valid, so search for the next potential end match */ - if (!blocks.length) { - currentMatch = null; - } else { - searchStartIndex = blocks[blocks.length - 1].end - ancestorBlock.start; - currentMatch = this._findMatch(endRegex, text, searchStartIndex); - } - } - } - if (!currentMatch) { - this._eolRegex.lastIndex = 0; - currentMatch = this._eolRegex.exec(text); - result = ancestorBlock.start + currentMatch.index === ancestorBlock.end + changeCount; - } - } - } - return result !== null ? result : true; - }, - - /** @private */ - - _findMatch: function(regex, text, startIndex, testBeforeMatch) { - /* - * testBeforeMatch provides a potential optimization for callers that do not strongly expect to find - * a match. If this argument is defined then test() is initially called on the regex, which executes - * significantly faster than exec(). If a match is found then the regex's lastIndex is reverted to - * its pre-test() value, and exec() is then invoked on it in order to get the match details. - */ - - var index = startIndex; - var initialLastIndex = regex.lastIndex; - this._linebreakRegex.lastIndex = startIndex; - - var currentLine = this._linebreakRegex.exec(text); - /* - * Processing of the first line is treated specially, as it may not start at the beginning of a logical line, but - * regex's may be dependent on matching '^'. To resolve this, compute the full line corresponding to the start - * of the text, even if it begins prior to startIndex, and adjust the regex's lastIndex accordingly to begin searching - * for matches at the correct location. - */ - var lineString, indexAdjustment; - regex.lastIndex = 0; - if (currentLine) { - var lineStart = currentLine.index; - while (0 <= --lineStart) { - var char = text.charAt(lineStart); - if (char === this._NEWLINE || char === this._CR) { - break; - } - } - lineString = text.substring(lineStart + 1, currentLine.index + currentLine[1].length); - regex.lastIndex = indexAdjustment = currentLine.index - lineStart - 1; - } - while (currentLine && currentLine.index < text.length) { - var result; - if (testBeforeMatch) { - var revertIndex = regex.lastIndex; - if (regex.test(lineString)) { - regex.lastIndex = revertIndex; - result = regex.exec(lineString); - } - } else { - result = regex.exec(lineString); - } - if (result) { - result.index += index; - result.index -= indexAdjustment; - regex.lastIndex = initialLastIndex; - return result; - } - indexAdjustment = 0; - index += currentLine[0].length; - currentLine = this._linebreakRegex.exec(text); - if (currentLine) { - lineString = currentLine[1]; - regex.lastIndex = 0; - } - } - regex.lastIndex = initialLastIndex; - return null; - }, - _getCaptureStyles: function(result, captures, offset, _styles) { - if (captures[0]) { - /* capture index 0 is the full result */ - _styles.push({start: offset, end: offset + result[0].length, style: captures[0].name}); - return; - } - - var stringIndex = 0; - for (var i = 1; i < result.length; i++) { - if (result[i]) { - var capture = captures[i]; - if (capture) { - var styleStart = offset + stringIndex; - _styles.push({start: styleStart, end: styleStart + result[i].length, style: capture.name}); - } - stringIndex += result[i].length; - } - } - }, - _getLanguageBlock: function(index) { - /* Returns the parent block that dictates the language in effect at index */ - var block = this._styler.getBlockAtIndex(index); - var embeddedNameRegex = /^source\..+\.embedded/; - while (block) { - if (block.pattern) { - var pattern = block.pattern.pattern; - if (embeddedNameRegex.test(pattern.name || pattern.contentName)) { - return block; - } - } - block = block.parent; - } - return this._styler.getRootBlock(); - }, - _initPatterns: function(patternManager, block) { - if (block.pattern && block.pattern.pattern.linePatterns) { - block.linePatterns = block.pattern.pattern.linePatterns; - block.blockPatterns = block.pattern.pattern.blockPatterns; - block.enclosurePatterns = block.pattern.pattern.enclosurePatterns; - return; - } - var patterns = patternManager.getPatterns(block.pattern ? block.pattern.pattern : null); - var initRegex = function(match) { - var matchString = typeof(match) === "string" ? match : match.match; - var result = this._ignoreCaseRegex.exec(matchString); - var flags = this._FLAGS; - if (result) { - matchString = matchString.substring(result[0].length); - flags += "i"; - } - return new RegExp(matchString, flags); - }.bind(this); - var lastBlock = -1; - var index = 0; - patterns.forEach(function(current) { - var pattern; - if (current.match && !current.begin && !current.end) { - pattern = {regex: initRegex(current.match), pattern: current}; - block.linePatterns.push(pattern); - if (current.name && current.name.indexOf("punctuation.section") === 0 && (current.name.indexOf(this._PUNCTUATION_SECTION_BEGIN) !== -1 || current.name.indexOf(this._PUNCTUATION_SECTION_END) !== -1)) { //$NON-NLS-0$ - block.enclosurePatterns[current.name] = pattern; - } - } else if (!current.match && current.begin && current.end) { - lastBlock = index; - pattern = {regexBegin: initRegex(current.begin), regexEnd: initRegex(current.end), pattern: current}; - block.linePatterns.push(pattern); - } - index++; - }.bind(this)); - block.blockPatterns = block.linePatterns.slice(0, lastBlock + 1); - if (block.pattern) { - block.pattern.pattern.enclosurePatterns = block.enclosurePatterns; - block.pattern.pattern.linePatterns = block.linePatterns; - block.pattern.pattern.blockPatterns = block.blockPatterns; - } - }, - _mergeStyles: function(fullStyle, substyles, resultStyles) { - var i = fullStyle.start; - substyles.forEach(function(current) { - if (i <= current.start) { - resultStyles.push({start: i, end: current.start, style: fullStyle.style}); - } - resultStyles.push(current); - i = current.end; - }); - if (i < fullStyle.end) { - resultStyles.push({start: i, end: fullStyle.end, style: fullStyle.style}); - } - }, - _substituteCaptureValues: function(regex, resolvedResult) { - var regexString = regex.toString(); - this._captureReferenceRegex.lastIndex = 0; - if (!this._captureReferenceRegex.test(regexString)) { - /* nothing to do */ - return regex; - } - - this._captureReferenceRegex.lastIndex = 0; - var result = this._captureReferenceRegex.exec(regexString); - while (result) { - regexString = regexString.replace(result[0], resolvedResult[result[1]] || ""); - this._captureReferenceRegex.lastIndex = 0; - result = this._captureReferenceRegex.exec(regexString); - } - /* return an updated regex, remove the leading '/' and trailing /FLAGS */ - return new RegExp(regexString.substring(1, regexString.length - 1 - this._FLAGS.length), this._FLAGS); - }, - _updateMatch: function(match, text, matches, minimumIndex, endIndex) { - var regEx = match.pattern.regex ? match.pattern.regex : match.pattern.regexBegin; - endIndex = endIndex || Infinity; - var result = this._findMatch(regEx, text, minimumIndex, true); - if (result && result.index < endIndex) { - match.result = result; - for (var i = 0; i < matches.length; i++) { - if (result.index < matches[i].result.index || (result.index === matches[i].result.index && match.pattern.pattern.index < matches[i].pattern.pattern.index)) { - matches.splice(i, 0, match); - return; - } - } - matches.push(match); - } - }, - _captureReferenceRegex: /\\(\d)/g, - _eolRegex: /$/, - _ignoreCaseRegex: /^\(\?i\)\s*/, - _linebreakRegex: /(.*)(?:[\r\n]|$)/g, - _CR: "\r", //$NON-NLS-0$ - _FLAGS: "g", //$NON-NLS-0$ - _NEWLINE: "\n", //$NON-NLS-0$ - _PUNCTUATION_SECTION_BEGIN: ".begin", //$NON-NLS-0$ - _PUNCTUATION_SECTION_END: ".end" //$NON-NLS-0$ - }; - - function PatternManager(grammars, rootId) { - this._unnamedCounter = 0; - this._patterns = []; - this._rootId = rootId; - grammars.forEach(function(grammar) { - this._addRepositoryPatterns(grammar.repository || {}, grammar.id); - this._addPatterns(grammar.patterns || [], grammar.id); - }.bind(this)); - } - PatternManager.prototype = { - getPatterns: function(pattern) { - var parentId; - if (!pattern) { - parentId = this._rootId + "#" + this._NO_ID; - } else { - if (typeof(pattern) === "string") { //$NON-NLS-0$ - parentId = pattern; - } else { - parentId = pattern.qualifiedId; - } - parentId += "#"; - } - /* indexes on patterns are used to break ties when multiple patterns match the same start text */ - var indexCounter = [0]; - var resultObject = {}; - var regEx = new RegExp("^" + parentId + "[^#]+$"); //$NON-NLS-0$ - this._patterns.forEach(function(current) { - if (regEx.test(current.qualifiedId)) { - if (current.include) { - this._processInclude(current, indexCounter, resultObject); - } else { - var newPattern = copy(current); - newPattern.index = indexCounter[0]++; - resultObject[current.qualifiedId] = newPattern; - } - } - }.bind(this)); - - var result = []; - var keys = Object.keys(resultObject); - keys.forEach(function(current) { - result.push(resultObject[current]); - }); - return result; - }, - - /** @private */ - - _addPattern: function(pattern, patternId, parentId) { - pattern.parentId = parentId; - pattern.id = patternId; - pattern.qualifiedId = pattern.parentId + "#" + pattern.id; - this._patterns.push(pattern); - if (pattern.patterns && !pattern.include) { - this._addPatterns(pattern.patterns, pattern.qualifiedId); - } - }, - _addPatterns: function(patterns, parentId) { - patterns.forEach(function(pattern) { - this._addPattern(pattern, this._NO_ID + this._unnamedCounter++, parentId); - }.bind(this)); - }, - _addRepositoryPatterns: function(repository, parentId) { - var keys = Object.keys(repository); - keys.forEach(function(key) { - this._addPattern(repository[key], key, parentId); - }.bind(this)); - }, - _processInclude: function(pattern, indexCounter, resultObject) { - var searchExp; - var index = pattern.include.indexOf("#"); - if (index === 0) { - /* inclusion of pattern from same grammar */ - searchExp = new RegExp("^" + pattern.qualifiedId.substring(0, pattern.qualifiedId.indexOf("#")) + pattern.include + "$"); - } else if (index === -1) { - /* inclusion of whole grammar */ - searchExp = new RegExp("^" + pattern.include + "#" + this._NO_ID + "[^#]+$"); - } else { - /* inclusion of specific pattern from another grammar */ - searchExp = new RegExp("^" + pattern.include + "$"); - } - this._patterns.forEach(function(current) { - if (searchExp.test(current.qualifiedId)) { - if (current.include) { - this._processInclude(current, indexCounter, resultObject); - } else if (!resultObject[current.qualifiedId]) { - var newPattern = copy(current); - newPattern.index = indexCounter[0]++; - resultObject[current.qualifiedId] = newPattern; - } - } - }.bind(this)); - }, - _NO_ID: "NoID" //$NON-NLS-0$ - }; - - function Block(bounds, name, typeId, styler, model, parent, initFn) { - this.start = bounds.start; - this.end = bounds.end; - this.contentStart = bounds.contentStart; - this.contentEnd = bounds.contentEnd; - this.name = name; - this.typeId = typeId; - this.styler = styler; - this.parent = parent; - if (initFn) { - initFn(this); - } - this._subBlocks = styler.computeBlocks(model, model.getText(this.contentStart, this.end), this, this.contentStart, null, null, null); - } - Block.prototype = { - adjustBounds: function(index, value) { - if (index < this.start) { - this.start += value; - } - if (index < this.contentStart) { - this.contentStart += value; - } - if (index <= this.end) { - this.end += value; - } - if (index <= this.contentEnd) { - this.contentEnd += value; - } - this._subBlocks.forEach(function(current) { - if (index <= current.end) { - current.adjustBounds(index, value); - } - }); - }, - getBlocks: function() { - return this._subBlocks; - }, - getBlockAtIndex: function(index) { - return binarySearch(this.getBlocks(), index, true); - }, - isRenderingWhitespace: function() { - return this.styler._isRenderingWhitespace(); - } - }; - - function TextStylerAccessor(styler) { - this._styler = styler; - } - TextStylerAccessor.prototype = { - getBlockCommentDelimiters: function(offset) { - return this._styler.getBlockCommentDelimiters(offset); - }, - getLineCommentDelimiter: function(offset) { - return this._styler.getLineCommentDelimiter(offset); - }, - getStyles: function(offset) { - return this._styler.getStyles(offset); - } - }; - - function TextStyler(view, annotationModel, stylerAdapter) { - this._whitespacesVisible = false; - this._highlightCaretLine = false; - this._foldingEnabled = true; - this._detectTasks = true; - this._annotationProviders = []; - this._view = view; - this._annotationModel = annotationModel; - this._stylerAdapter = stylerAdapter; - this._stylerAdapter.setStyler(this); - this._accessor = new TextStylerAccessor(this); - this._bracketAnnotations; - - var self = this; - this._listener = { - onChanged: function(e) { - self._onModelChanged(e); - }, - onDestroy: function(e) { - self._onDestroy(e); - }, - onLineStyle: function(e) { - self._onLineStyle(e); - }, - onMouseDown: function(e) { - self._onMouseDown(e); - }, - onSelection: function(e) { - self._onSelection(e); - } - }; - var model = view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - model.addEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - view.addEventListener("MouseDown", this._listener.onMouseDown); //$NON-NLS-0$ - view.addEventListener("Selection", this._listener.onSelection); //$NON-NLS-0$ - view.addEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - view.addEventListener("LineStyle", this._listener.onLineStyle); //$NON-NLS-0$ - - var charCount = model.getCharCount(); - var rootBounds = {start: 0, contentStart: 0, end: charCount, contentEnd: charCount}; - if (charCount >= 50000) { - var startTime = new Date().getTime(); - } - this._rootBlock = this._stylerAdapter.createBlock(rootBounds, this, model, null); - if (startTime) { - var interval = new Date().getTime() - startTime; - if (interval > 10) { - mMetrics.logTiming( - "editor", //$NON-NLS-0$ - "styler compute blocks (ms/50000 chars)", //$NON-NLS-0$ - interval * 50000 / charCount, - stylerAdapter.getContentType()); - } - } - if (annotationModel) { - var add = []; - annotationModel.removeAnnotations(mAnnotations.AnnotationType.ANNOTATION_FOLDING); - this._computeFolding(this._rootBlock.getBlocks(), view.getModel(), add); - if (this._detectTasks) { - annotationModel.removeAnnotations(mAnnotations.AnnotationType.ANNOTATION_TASK); - this._computeTasks(this._rootBlock, model, add); - } - annotationModel.replaceAnnotations([], add); - } - view.redrawLines(); - } - TextStyler.prototype = { - addAnnotationProvider: function(value) { - if (typeof value === "function") { //$NON-NLS-0$ - this._annotationProviders.push(value); - } - }, - computeBlocks: function(model, text, block, offset, startIndex, endIndex, maxBlockCount) { - return this._stylerAdapter.computeBlocks(model, text, block, offset, startIndex, endIndex, maxBlockCount); - }, - destroy: function() { - if (this._view) { - var model = this._view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - model.removeEventListener("Changed", this._listener.onChanged); //$NON-NLS-0$ - this._view.removeEventListener("MouseDown", this._listener.onMouseDown); //$NON-NLS-0$ - this._view.removeEventListener("Selection", this._listener.onSelection); //$NON-NLS-0$ - this._view.removeEventListener("Destroy", this._listener.onDestroy); //$NON-NLS-0$ - this._view.removeEventListener("LineStyle", this._listener.onLineStyle); //$NON-NLS-0$ - this._view = null; - } - }, - getAnnotationModel: function() { - return this._annotationModel; - }, - getBlockAtIndex: function(index) { - return this._findBlock(this._rootBlock, index); - }, - getBlockCommentDelimiters: function(index) { - return this._stylerAdapter.getBlockCommentDelimiters(index); - }, - getLineCommentDelimiter: function(index) { - return this._stylerAdapter.getLineCommentDelimiter(index); - }, - getRootBlock: function() { - return this._rootBlock; - }, - getStyleAccessor: function() { - return this._accessor; - }, - getStyles: function(offset) { - var result = []; - var model = this._view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - var block = this._findBlock(this._rootBlock, offset); - var lineIndex = model.getLineAtOffset(offset); - var lineText = model.getLine(lineIndex); - var styles = []; - this._stylerAdapter.parse(lineText, model.getLineStart(lineIndex), 0, block, styles); - var style = styles[binarySearch(styles, offset, true)]; - if (style && style.start <= offset && offset < style.end) { - result.push(style); - } - while (block) { - style = this._stylerAdapter.computeStyle(block, model, offset); - if (style) { - result.splice(0, 0, style); - } - block = block.parent; - } - return result; - }, - getTextModel: function() { - var model = this._view.getModel(); - if (model.getBaseModel) { - model = model.getBaseModel(); - } - return model; - }, - removeAnnotationProvider: function(value) { - if (typeof value !== "function") { //$NON-NLS-0$ - return; - } - var index = this._annotationProviders.indexOf(value); - if (index !== -1) { - this._annotationProviders.splice(index, 1); - } - }, - setDetectHyperlinks: function() { - }, - setDetectTasks: function(enabled) { - this._detectTasks = enabled; - }, - setFoldingEnabled: function(enabled) { - this._foldingEnabled = enabled; - }, - setHighlightCaretLine: function(highlight) { - this._highlightCaretLine = highlight; - }, - setWhitespacesVisible: function(visible, redraw) { - if (this._whitespacesVisible === visible) { return; } - this._whitespacesVisible = visible; - if (redraw) { - this._view.redraw(); - } - }, - - /** @private */ - - _computeFolding: function(blocks, viewModel, _add) { - if (!viewModel.getBaseModel) { return; } - var baseModel = viewModel.getBaseModel(); - blocks.forEach(function(block) { - var foldBounds = this._stylerAdapter.getBlockFoldBounds(block, baseModel); - var annotation = this._createFoldingAnnotation(viewModel, baseModel, foldBounds.start, foldBounds.end); - if (annotation) { - _add.push(annotation); - } - this._computeFolding(block.getBlocks(), viewModel, _add); - }.bind(this)); - }, - _computeTasks: function(block, baseModel, annotations, start, end) { - start = start || block.start; - end = end || block.end; - if (block.start <= end && start <= block.end) { - if (!this._annotationModel) { return; } - - var annotationType = mAnnotations.AnnotationType.ANNOTATION_TASK; - if (block.name && block.name.indexOf("comment") === 0) { - var substyles = []; - var lineIndex = baseModel.getLineAtOffset(block.contentStart); - var lineStart = baseModel.getLineStart(lineIndex); - this._stylerAdapter.parse(baseModel.getText(lineStart, block.end), lineStart, block.contentStart - lineStart, block, substyles, true); - for (var i = 0; i < substyles.length; i++) { - if (substyles[i].style === "meta.annotation.task.todo" && start <= substyles[i].start && substyles[i].end <= end) { - annotations.push(mAnnotations.AnnotationType.createAnnotation(annotationType, substyles[i].start, substyles[i].end, baseModel.getText(substyles[i].start, substyles[i].end))); - } - } - } - - block.getBlocks().forEach(function(current) { - this._computeTasks(current, baseModel, annotations, start, end); - }.bind(this)); - } - }, - _createFoldingAnnotation: function(viewModel, baseModel, start, end) { - var startLine = baseModel.getLineAtOffset(start); - var endLine = baseModel.getLineAtOffset(end); - if (startLine === endLine) { - return null; - } - if (startLine + 1 === endLine && baseModel.getLineStart(endLine) === baseModel.getLineEnd(endLine)) { - return null; - } - return new (mAnnotations.AnnotationType.getType(mAnnotations.AnnotationType.ANNOTATION_FOLDING))(start, end, viewModel); - }, - _findBlock: function(parentBlock, offset) { - var blocks = parentBlock.getBlocks(); - if (!blocks.length) { - return parentBlock; - } - - var index = binarySearch(blocks, offset, true); - if (index < blocks.length && blocks[index].start <= offset && offset < blocks[index].end) { - return this._findBlock(blocks[index], offset); - } - return parentBlock; - }, - _findBrackets: function(model, bracketMatch, block, text, offset, end) { - var result = [], styles = []; - var start = offset, blocks = block.getBlocks(); - var startIndex = binarySearch(blocks, offset, true); - for (var i = startIndex; i < blocks.length; i++) { - if (blocks[i].start >= end) { break; } - var blockStart = blocks[i].start; - var blockEnd = blocks[i].end; - if (start < blockStart) { - var lineIndex = model.getLineAtOffset(start); - var lineStart = model.getLineStart(lineIndex); - this._stylerAdapter.parse(text.substring(lineStart - offset, blockStart - offset), lineStart, start - lineStart, block, styles); - styles.forEach(function(current) { - if (current.style) { - if (current.style.indexOf(bracketMatch.beginName) === 0) { - result.push(current.start + 1); - } else if (current.style.indexOf(bracketMatch.endName) === 0) { - result.push(-(current.start + 1)); - } - } - }); - styles = []; - } - start = blockEnd; - } - if (start < end) { - lineIndex = model.getLineAtOffset(start); - lineStart = model.getLineStart(lineIndex); - this._stylerAdapter.parse(text.substring(lineStart - offset, end - offset), lineStart, start - lineStart, block, styles); - styles.forEach(function(current) { - if (current.style) { - if (current.style.indexOf(bracketMatch.beginName) === 0) { - result.push(current.start + 1); - } else if (current.style.indexOf(bracketMatch.endName) === 0) { - result.push(-(current.start + 1)); - } - } - }); - } - return result; - }, - _findMatchingBracket: function(model, block, offset) { - var lineIndex = model.getLineAtOffset(offset); - var lineEnd = model.getLineEnd(lineIndex); - var text = model.getText(offset, lineEnd); - - var bracketMatch = this._stylerAdapter.getBracketMatch(block, text); - if (!bracketMatch) { return -1; } - - var lineText = model.getLine(lineIndex); - var lineStart = model.getLineStart(lineIndex); - var brackets = this._findBrackets(model, bracketMatch, block, lineText, lineStart, lineEnd); - for (var i = 0; i < brackets.length; i++) { - var sign = brackets[i] >= 0 ? 1 : -1; - if (brackets[i] * sign - 1 === offset) { - var level = 1; - if (!bracketMatch.atStart) { - i--; - for (; i>=0; i--) { - sign = brackets[i] >= 0 ? 1 : -1; - level += sign; - if (level === 0) { - return brackets[i] * sign - 1; - } - } - lineIndex -= 1; - while (lineIndex >= 0) { - lineText = model.getLine(lineIndex); - lineStart = model.getLineStart(lineIndex); - lineEnd = model.getLineEnd(lineIndex); - brackets = this._findBrackets(model, bracketMatch, block, lineText, lineStart, lineEnd); - for (var j = brackets.length - 1; j >= 0; j--) { - sign = brackets[j] >= 0 ? 1 : -1; - level += sign; - if (level === 0) { - return brackets[j] * sign - 1; - } - } - lineIndex--; - } - } else { - i++; - for (; i= 0 ? 1 : -1; - level += sign; - if (level === 0) { - return brackets[i] * sign - 1; - } - } - lineIndex += 1; - var lineCount = model.getLineCount(); - while (lineIndex < lineCount) { - lineText = model.getLine(lineIndex); - lineStart = model.getLineStart(lineIndex); - lineEnd = model.getLineEnd(lineIndex); - brackets = this._findBrackets(model, bracketMatch, block, lineText, lineStart, lineEnd); - for (var k=0; k= 0 ? 1 : -1; - level += sign; - if (level === 0) { - return brackets[k] * sign - 1; - } - } - lineIndex++; - } - } - break; - } - } - return -1; - }, - _getLineStyle: function(lineIndex) { - if (this._highlightCaretLine) { - var view = this._view; - var model = view.getModel(); - var selections = view.getSelections(); - var hasCaret = false; - if (!selections.some(function(selection) { - if (selection.start === selection.end) { - hasCaret = hasCaret || model.getLineAtOffset(selection.start) === lineIndex; - return false; - } - return true; - }) && hasCaret) return this._caretLineStyle; - } - return null; - }, - _getStyles: function(block, model, text, offset, startIndex) { - var end = offset + text.length; - - var styles = []; - var start = offset + startIndex, blocks = block.getBlocks(); - var startBlockIndex = binarySearch(blocks, start, true); - for (var i = startBlockIndex; i < blocks.length; i++) { - if (blocks[i].start >= end) { break; } - var blockStart = blocks[i].start; - var blockEnd = blocks[i].end; - if (start < blockStart) { - /* content on that line that preceeds the start of the block */ - var lineIndex = model.getLineAtOffset(start); - var lineStart = model.getLineStart(lineIndex); - this._stylerAdapter.parse(text.substring(lineStart - offset, blockStart - offset), lineStart, start - lineStart, block, styles); - } - var s = Math.max(start, blockStart); - if (s === blockStart) { - /* currently in the block's "start" segment */ - var startString = this._stylerAdapter.getBlockStartStyle(blocks[i], text.substring(s - offset), s, styles); - if (startString) { - s += startString.length; - } - } - - /* - * Compute the block end now in order to determine the end-bound of the contained content, but do not add - * its styles to the styles array until content styles have been computed, so that ordering is preserved. - */ - var e = Math.min(end, blockEnd); - var endStyles = []; - if (e === blockEnd) { - /* currently in the block's "end" segment */ - var testString = text.substring(e - start - (blocks[i].end - blocks[i].contentEnd)); - var endString = this._stylerAdapter.getBlockEndStyle(blocks[i], testString, e, endStyles); - if (endString) { - e -= endString.length; - } - } - - lineIndex = model.getLineAtOffset(s); - lineStart = model.getLineStart(lineIndex); - var blockSubstyles = this._getStyles(blocks[i], model, text.substring(lineStart - offset, e - offset), lineStart, s - lineStart); - var blockStyleName = this._stylerAdapter.getBlockContentStyleName(blocks[i]); - if (blockStyleName) { - /* - * If a name was specified for the current block then apply its style throughout its - * content wherever a style is not provided by a sub-element. - */ - var index = s; - blockSubstyles.forEach(function(current) { - if (current.start - index) { - styles.push({start: index, end: current.start, style: blockStyleName}); - } - if (current.mergeable) { - current.style += "," + blockStyleName; - } - styles.push(current); - index = current.end; - }); - if (e - index) { - styles.push({start: index, end: e, style: blockStyleName}); - } - } else { - styles = styles.concat(blockSubstyles); - } - styles = styles.concat(endStyles); - start = blockEnd; - } - if (start < end) { - /* content on that line that follows the end of the block */ - lineIndex = model.getLineAtOffset(start); - lineStart = model.getLineStart(lineIndex); - this._stylerAdapter.parse(text.substring(lineStart - offset, end - offset), lineStart, start - lineStart, block, styles); - } - - return styles; - }, - _isRenderingWhitespace: function() { - return this._whitespacesVisible; - }, - _onDestroy: function() { - this.destroy(); - }, - _onLineStyle: function(e) { - if (e.textView === this._view) { - e.style = this._getLineStyle(e.lineIndex); - } - - var offset = e.lineStart; - var model = e.textView.getModel(); - if (model.getBaseModel) { - offset = model.mapOffset(offset); - var baseModel = model.getBaseModel(); - } - - e.ranges = this._getStyles(this._rootBlock, baseModel || model, e.lineText, offset, 0); - for (var i = e.ranges.length - 1; i >= 0; i--) { - var current = e.ranges[i]; - if (current.style) { - current.style = {styleClass: current.style.replace(/\./g, " ")}; - if (baseModel) { - var length = current.end - current.start; - current.start = model.mapOffset(current.start, true); - current.end = current.start + length; - } - } else { - e.ranges.splice(i, 1); - } - }; - if (this._isRenderingWhitespace()) { - this._spliceStyles(this._spacePattern, e.ranges, e.lineText, e.lineStart); - this._spliceStyles(this._tabPattern, e.ranges, e.lineText, e.lineStart); - } - }, - _onModelChanged: function(e) { - var start = e.start; - var removedCharCount = e.removedCharCount; - var addedCharCount = e.addedCharCount; - var changeCount = addedCharCount - removedCharCount; - var viewModel = this._view.getModel(); - var baseModel = viewModel.getBaseModel ? viewModel.getBaseModel() : viewModel; - var end = start + removedCharCount; - var charCount = baseModel.getCharCount(); - - /* compute the nearest ancestor block to the start and end indices */ - var lineStart = baseModel.getLineStart(baseModel.getLineAtOffset(start)); - var ancestorBlock = this._findBlock(this._rootBlock, start); - - var blockExtended, blocks, parentBlock, redraw, text, te, ts; - do { - parentBlock = ancestorBlock.parent; - - /* - * Determine whether ancestorBlock contains the full range of - * text whose styling may be affected by this model change. - */ - if (!blockExtended && parentBlock) { - /* verify that ancestorBlock's start and end bounds are not affected by this change */ - if (changeCount < 0 && ancestorBlock.end - start <= -changeCount) { - /* the end bound has definitely been affected, no verifyBlock() required, move up to the parent */ - ancestorBlock = parentBlock; - continue; - } - text = baseModel.getText(ancestorBlock.start, Math.min(charCount, ancestorBlock.end + changeCount + 1)); - if (!this._stylerAdapter.verifyBlock(baseModel, text, ancestorBlock, changeCount)) { - ancestorBlock = parentBlock; - continue; - } - } - - /* - * The change has not directly changed ancestorBlock's start/end strings, now verify that its end - * bound is still valid (ie.- ensure that a new block is not extending beyond the end bound). - */ - - blocks = ancestorBlock.getBlocks(); - var blockCount = blocks.length; - var blockStart = binarySearch(blocks, lineStart, true); - var blockEnd = binarySearch(blocks, end, false, blockStart - 1, blockCount); - - /* - * If the change immediately follows the preceding block then test whether - * the block should be extended. - */ - blockExtended = false; - if (blockStart && blocks.length && blocks[blockStart - 1].end === start) { - text = baseModel.getText(blocks[blockStart - 1].start, Math.min(charCount, start + 1)); - var tempBlocks = this.computeBlocks(baseModel, text, ancestorBlock, blocks[blockStart - 1].start, null, null, null); - if (tempBlocks.length && tempBlocks[0].end !== blocks[blockStart - 1].end) { - /* the change has affected the preceding block's end, so include this block */ - blockStart--; - blockExtended = true; - } - } - - if (blockStart < blockCount && blocks[blockStart].start <= lineStart && (lineStart < blocks[blockStart].end || blockExtended)) { - ts = blocks[blockStart].start; - if (ts > start) { ts += changeCount; } - } else if (blockStart === blockCount && blockCount > 0 && ancestorBlock.end - changeCount === blocks[blockCount - 1].end) { - ts = blocks[--blockStart].start; - if (ts > start) { ts += changeCount; } - } else { - ts = Math.max(lineStart, ancestorBlock.contentStart); - } - - if (blockEnd < blockCount) { - te = blocks[blockEnd].end; - } else { - te = ancestorBlock.contentEnd; - } - if (start <= te) { te += changeCount; } - te = Math.min(te, charCount - 1); - text = baseModel.getText(ts, te + 1); - var newBlocks = this.computeBlocks(baseModel, text, ancestorBlock, ts, null, null, null); - - if (blockEnd < blockCount) { - /* ensure that blockEnd's end is preserved */ - if (newBlocks.length && newBlocks[newBlocks.length - 1].end === te && newBlocks[newBlocks.length - 1].typeId === blocks[blockEnd].typeId) { - break; - } - - /* - * ancestorBlock's end match is no longer valid because it is being spanned by a block from - * within. Attempt to find a subsequent sibling block with the same type, as its end match - * will serve as the end match for this spanning block as well. - */ - if (newBlocks.length && this._stylerAdapter.blockSpansBeyondEnd(newBlocks[newBlocks.length - 1])) { - blockEnd++; - var subBlocks = newBlocks[newBlocks.length - 1].getBlocks(); - var spanningTypeId = (subBlocks.length ? subBlocks[subBlocks.length - 1] : newBlocks[newBlocks.length - 1]).typeId; - while (blockEnd < blockCount) { - if (blocks[blockEnd].typeId === spanningTypeId) { - /* found a potential end block, must verify it */ - var tempTe = blocks[blockEnd].end + changeCount; - tempTe = Math.min(tempTe, charCount - 1); - text = baseModel.getText(ts, tempTe + 1); - var tempNewBlocks = this.computeBlocks(baseModel, text, ancestorBlock, ts, null, null, null); - if (tempNewBlocks.length && tempNewBlocks[tempNewBlocks.length - 1].end === tempTe) { - /* verified, can now stop looking */ - te = tempTe; - newBlocks = tempNewBlocks; - break; - } - } - blockEnd++; - } - if (blockEnd < blockCount) { - break; - } - } - } else { - /* ensure that ancestorBlock's end is preserved */ - if (!newBlocks.length || newBlocks[newBlocks.length - 1].end <= ancestorBlock.contentEnd + changeCount) { - break; - } - } - - /* - * The end block's end bound is spanned by a block from within, so move up to the ancestor - * block, or extend end to the end of the content if already at the root-level block. - */ - - if (!parentBlock) { - te = charCount; - blockEnd = blockCount; - text = baseModel.getText(ts, te); - newBlocks = this.computeBlocks(baseModel, text, ancestorBlock, ts, null, null, null); - break; - } - - ancestorBlock = parentBlock; - redraw = true; /* blocks may not appear to be changed in the context of the parent block */ - } while (true); - - this._rootBlock.adjustBounds(start, changeCount); - blockEnd = Math.min(blockEnd + 1, blockCount); - - var block; - if (!redraw) { - redraw = (blockEnd - blockStart) !== newBlocks.length; - } - if (!redraw) { - for (var i = 0; i < newBlocks.length; i++) { - block = blocks[blockStart + i]; - var newBlock = newBlocks[i]; - if (block.start !== newBlock.start || block.end !== newBlock.end || block.typeId !== newBlock.typeId) { - redraw = true; - break; - } - } - } - - if (!blocks.length && !newBlocks.length) { - var eventOldBlocks = [ancestorBlock]; - var eventNewBlocks = [ancestorBlock]; - this.dispatchEvent({ - type: "BlocksChanged", //$NON-NLS-0$ - oldBlocks: eventOldBlocks, - newBlocks: eventNewBlocks - }); - ancestorBlock = eventNewBlocks[0]; /* enables the markdown styler to return a modified ancestorBlock */ - } else { - this.dispatchEvent({ - type: "BlocksChanged", //$NON-NLS-0$ - oldBlocks: blocks.slice(blockStart, blockEnd), - newBlocks: newBlocks - }); - } - - var args = [blockStart, blockEnd - blockStart].concat(newBlocks); - Array.prototype.splice.apply(blocks, args); - if (redraw) { - var redrawStart = ts; - var redrawEnd = te; - if (viewModel !== baseModel) { - redrawStart = viewModel.mapOffset(redrawStart, true); - redrawEnd = viewModel.mapOffset(redrawEnd, true); - } - this._view.redrawRange(redrawStart, redrawEnd); - } - - if (this._annotationModel) { - var remove = [], add = []; - var allFolding = []; - var iter = this._annotationModel.getAnnotations(ts, te); - var doFolding = this._foldingEnabled && baseModel !== viewModel; - var parent = ancestorBlock.parent || ancestorBlock; - while (iter.hasNext()) { - var annotation = iter.next(); - if (doFolding && annotation.type === mAnnotations.AnnotationType.ANNOTATION_FOLDING) { - allFolding.push(annotation); - block = this._findBlock(parent, annotation.start); - while (block) { - var foldBounds = this._stylerAdapter.getBlockFoldBounds(block, baseModel); - if (annotation.start === foldBounds.start && annotation.end === foldBounds.end) { - break; - } - block = block.parent; - } - if (block && annotation.start === foldBounds.start && annotation.end === foldBounds.end) { - var annotationStart = annotation.start; - var annotationEnd = annotation.end; - if (annotationStart > start) { - annotationStart -= changeCount; - } - if (annotationEnd > start) { - annotationEnd -= changeCount; - } - if (annotationStart <= start && start < annotationEnd && annotationStart <= end && end < annotationEnd) { - var startLine = baseModel.getLineAtOffset(annotation.start); - var endLine = baseModel.getLineAtOffset(annotation.end); - if (startLine !== endLine) { - if (!annotation.expanded) { - annotation.expand(); - } - } else { - remove.push(annotation); - } - } - } else { - remove.push(annotation); - annotation.expand(); - } - } else if (annotation.type === mAnnotations.AnnotationType.ANNOTATION_TASK) { - if (ancestorBlock.start <= annotation.start && annotation.end <= ancestorBlock.end) { - remove.push(annotation); - } - } - } - if (doFolding) { - parent.getBlocks().forEach(function(block) { - this._updateFolding(block, baseModel, viewModel, allFolding, add, ts, te); - }.bind(this)); - } - if (this._detectTasks) { - this._computeTasks(ancestorBlock, baseModel, add, ts, te); - } - this._annotationProviders.forEach(function(current) { - var providerRemove = []; - var providerAdd = []; - current(this._annotationModel, baseModel, ancestorBlock, ts, te, providerRemove, providerAdd); - remove = remove.concat(providerRemove); - add = add.concat(providerAdd); - }.bind(this)); - this._annotationModel.replaceAnnotations(remove, add); - } - }, - _onMouseDown: function(e) { - if (e.clickCount !== 2) { return; } - var model = this._view.getModel(); - var offset = this._view.getOffsetAtLocation(e.x, e.y); - if (offset > 0) { - var mapOffset = offset - 1; - var baseModel = model; - if (model.getBaseModel) { - mapOffset = model.mapOffset(mapOffset); - baseModel = model.getBaseModel(); - } - var block = this._findBlock(this._rootBlock, mapOffset); - var bracket = this._findMatchingBracket(baseModel, block, mapOffset); - if (bracket !== -1) { - e.preventDefault(); - var mapBracket = bracket; - if (model.getBaseModel) { - mapBracket = model.mapOffset(mapBracket, true); - } - if (offset > mapBracket) { - offset--; - mapBracket++; - } - this._view.setSelection(mapBracket, offset); - } - } - }, - _onSelection: function(e) { - var oldSelections = Array.isArray(e.oldValue) ? e.oldValue : [e.oldValue]; - var newSelections = Array.isArray(e.newValue) ? e.newValue : [e.newValue]; - var view = this._view; - var model = view.getModel(); - var lineIndex; - if (this._highlightCaretLine) { - function getHighlightLines(selections) { - var lines = {}; - if (selections.some(function(selection) { - if (selection.isEmpty()) { - lines[model.getLineAtOffset(selection.start).toString()] = true; - } else { - return true; - } - return false; - })) return {}; - return lines; - } - var oldLines = getHighlightLines(oldSelections); - var newLines = getHighlightLines(newSelections); - function redraw(o, n) { - for (var p in o) { - if (!n[p]) { - lineIndex = p >> 0; - view.redrawLines(lineIndex, lineIndex + 1); - } - } - } - redraw(oldLines, newLines); - redraw(newLines, oldLines); - } - if (!this._annotationModel) { return; } - - var remove = this._bracketAnnotations, add, caret; - if (newSelections.length === 1 && newSelections[0].isEmpty() && (caret = newSelections[0].getCaret()) > 0) { - var mapCaret = caret - 1; - if (model.getBaseModel) { - mapCaret = model.mapOffset(mapCaret); - model = model.getBaseModel(); - } - var block = this._findBlock(this._rootBlock, mapCaret); - var bracket = this._findMatchingBracket(model, block, mapCaret); - if (bracket !== -1) { - add = [ - mAnnotations.AnnotationType.createAnnotation(mAnnotations.AnnotationType.ANNOTATION_MATCHING_BRACKET, bracket, bracket + 1), - mAnnotations.AnnotationType.createAnnotation(mAnnotations.AnnotationType.ANNOTATION_CURRENT_BRACKET, mapCaret, mapCaret + 1) - ]; - } - } - this._bracketAnnotations = add; - this._annotationModel.replaceAnnotations(remove, add); - }, - _spliceStyles: function(whitespacePattern, ranges, text, offset) { - var regex = whitespacePattern.regex; - regex.lastIndex = 0; - var rangeIndex = 0; - var result = regex.exec(text); - while (result) { - var charIndex = offset + result.index; - while (rangeIndex < ranges.length) { - if (charIndex < ranges[rangeIndex].end) { - break; - } - rangeIndex++; - } - var newStyle = { - start: charIndex, - end: charIndex + 1, - style: copy(whitespacePattern.style) - }; - if (rangeIndex < ranges.length && ranges[rangeIndex].start <= charIndex) { - var endStyle = {start: charIndex + 1, end: ranges[rangeIndex].end, style: ranges[rangeIndex].style}; - ranges[rangeIndex].end = charIndex; - ranges.splice(rangeIndex + 1, 0, endStyle); - ranges.splice(rangeIndex + 1, 0, newStyle); - rangeIndex += 2; - newStyle.style.styleClass += " " + ranges[rangeIndex].style.styleClass; //$NON-NLS-0$ - } else { - ranges.splice(rangeIndex, 0, newStyle); - rangeIndex++; - } - result = regex.exec(text); - } - }, - _updateFolding: function(block, baseModel, viewModel, allFolding, _add, start, end) { - start = start || block.start; - end = end || block.end; - var foldBounds = this._stylerAdapter.getBlockFoldBounds(block, baseModel); - if (!block.doNotFold && foldBounds.start <= end && start <= foldBounds.end) { - var index = binarySearch(allFolding, foldBounds.start, true); - if (!(index < allFolding.length && allFolding[index].start === foldBounds.start && allFolding[index].end === foldBounds.end)) { - var annotation = this._createFoldingAnnotation(viewModel, baseModel, foldBounds.start, foldBounds.end); - if (annotation) { - _add.push(annotation); - } - } - block.getBlocks().forEach(function(current) { - this._updateFolding(current, baseModel, viewModel, allFolding, _add, start, end); - }.bind(this)); - } - }, - _caretLineStyle: {styleClass: "meta annotation currentLine"}, //$NON-NLS-0$ - _spacePattern: {regex: /[ ]/g, style: {styleClass: "punctuation separator space", unmergeable: true}}, //$NON-NLS-0$ - _tabPattern: {regex: /\t/g, style: {styleClass: "punctuation separator tab", unmergeable: true}} //$NON-NLS-0$ - }; - - mEventTarget.EventTarget.addMixin(TextStyler.prototype); - - return { - TextStyler: TextStyler, - Block: Block, - createPatternBasedAdapter: createPatternBasedAdapter - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define("orion/editor/textMateStyler", ['orion/regex' ], function(mRegex) { - -var RegexUtil = { - // Rules to detect some unsupported Oniguruma features - unsupported: [ - {regex: /\(\?[ims\-]:/, func: function(match) { return "option on/off for subexp"; }}, - {regex: /\(\?<([=!])/, func: function(match) { return (match[1] === "=") ? "lookbehind" : "negative lookbehind"; }}, - {regex: /\(\?>/, func: function(match) { return "atomic group"; }} - ], - - /** - * @param {String} str String giving a regular expression pattern from a TextMate grammar. - * @param {String} [flags] [ismg]+ - * @returns {RegExp} - */ - toRegExp: function(str) { - function fail(feature, match) { - throw new Error("Unsupported regex feature \"" + feature + "\": \"" + match[0] + "\" at index: " - + match.index + " in " + match.input); - } - // Turns an extended regex pattern into a normal one - function normalize(/**String*/ str) { - var result = ""; - var insideCharacterClass = false; - var len = str.length; - for (var i=0; i < len; ) { - var chr = str.charAt(i); - if (!insideCharacterClass && chr === "#") { - // skip to eol - while (i < len && chr !== "\r" && chr !== "\n") { - chr = str.charAt(++i); - } - } else if (!insideCharacterClass && /\s/.test(chr)) { - // skip whitespace - while (i < len && /\s/.test(chr)) { - chr = str.charAt(++i); - } - } else if (chr === "\\") { - result += chr; - if (!/\s/.test(str.charAt(i+1))) { - result += str.charAt(i+1); - i += 1; - } - i += 1; - } else if (chr === "[") { - insideCharacterClass = true; - result += chr; - i += 1; - } else if (chr === "]") { - insideCharacterClass = false; - result += chr; - i += 1; - } else { - result += chr; - i += 1; - } - } - return result; - } - - var flags = ""; - var i; - - // Handle global "x" flag (whitespace/comments) - str = RegexUtil.processGlobalFlag("x", str, function(subexp) { - return normalize(subexp); - }); - - // Handle global "i" flag (case-insensitive) - str = RegexUtil.processGlobalFlag("i", str, function(subexp) { - flags += "i"; - return subexp; - }); - - // Check for remaining unsupported syntax - for (i=0; i < this.unsupported.length; i++) { - var match; - if ((match = this.unsupported[i].regex.exec(str))) { - fail(this.unsupported[i].func(match), match); - } - } - - return new RegExp(str, flags); - }, - - /** - * Checks if flag applies to entire pattern. If so, obtains replacement string by calling processor - * on the unwrapped pattern. Handles 2 possible syntaxes: (?f)pat and (?f:pat) - * @param {String} flag - * @param {String} str - * @param {Function} processor - */ - processGlobalFlag: function(flag, str, processor) { - function getMatchingCloseParen(/*String*/pat, /*Number*/start) { - var depth = 0, - len = pat.length, - flagStop = -1; - for (var i=start; i < len && flagStop === -1; i++) { - switch (pat.charAt(i)) { - case "\\": - i++; // escape: skip next char - break; - case "(": - depth++; - break; - case ")": - depth--; - if (depth === 0) { - flagStop = i; - } - break; - } - } - return flagStop; - } - var flag1 = "(?" + flag + ")", - flag2 = "(?" + flag + ":"; - if (str.substring(0, flag1.length) === flag1) { - return processor(str.substring(flag1.length)); - } else if (str.substring(0, flag2.length) === flag2) { - var flagStop = getMatchingCloseParen(str, 0); - if (flagStop < str.length-1) { - throw new Error("Only a " + flag2 + ") group that encloses the entire regex is supported in: " + str); - } - return processor(str.substring(flag2.length, flagStop)); - } - return str; - }, - - hasBackReference: function(/**RegExp*/ regex) { - return (/\\\d+/).test(regex.source); - }, - - /** @returns {RegExp} A regex made by substituting any backreferences in regex for the value of the property - * in sub with the same name as the backreferenced group number. */ - getSubstitutedRegex: function(/**RegExp*/ regex, /**Object*/ sub, /**Boolean*/ escape) { - escape = (typeof escape === "undefined") ? true : false; - var exploded = regex.source.split(/(\\\d+)/g); - var array = []; - for (var i=0; i < exploded.length; i++) { - var term = exploded[i]; - var backrefMatch = /\\(\d+)/.exec(term); - if (backrefMatch) { - var text = sub[backrefMatch[1]] || ""; - array.push(escape ? mRegex.escape(text) : text); - } else { - array.push(term); - } - } - return new RegExp(array.join("")); - }, - - /** - * Builds a version of regex with every non-capturing term converted into a capturing group. This is a workaround - * for JavaScript's lack of API to get the index at which a matched group begins in the input string.

      - * Using the "groupified" regex, we can sum the lengths of matches from consuming groups 1..n-1 to obtain the - * starting index of group n. (A consuming group is a capturing group that is not inside a lookahead assertion).

      - * Example: groupify(/(a+)x+(b+)/) === /(a+)(x+)(b+)/
      - * Example: groupify(/(?:x+(a+))b+/) === /(?:(x+)(a+))(b+)/ - * @param {RegExp} regex The regex to groupify. - * @param {Object} [backRefOld2NewMap] Optional. If provided, the backreference numbers in regex will be updated using the - * properties of this object rather than the new group numbers of regex itself. - *
      • [0] {RegExp} The groupified version of the input regex.
      • - *
      • [1] {Object} A map containing old-group to new-group info. Each property is a capturing group number of regex - * and its value is the corresponding capturing group number of [0].
      • - *
      • [2] {Object} A map indicating which capturing groups of [0] are also consuming groups. If a group number is found - * as a property in this object, then it's a consuming group.
      - */ - groupify: function(regex, backRefOld2NewMap) { - var NON_CAPTURING = 1, - CAPTURING = 2, - LOOKAHEAD = 3, - NEW_CAPTURING = 4; - var src = regex.source, - len = src.length; - var groups = [], - lookaheadDepth = 0, - newGroups = [], - oldGroupNumber = 1, - newGroupNumber = 1; - var result = [], - old2New = {}, - consuming = {}; - for (var i=0; i < len; i++) { - var curGroup = groups[groups.length-1]; - var chr = src.charAt(i); - switch (chr) { - case "(": - // If we're in new capturing group, close it since ( signals end-of-term - if (curGroup === NEW_CAPTURING) { - groups.pop(); - result.push(")"); - newGroups[newGroups.length-1].end = i; - } - var peek2 = (i + 2 < len) ? (src.charAt(i+1) + "" + src.charAt(i+2)) : null; - if (peek2 === "?:" || peek2 === "?=" || peek2 === "?!") { - // Found non-capturing group or lookahead assertion. Note that we preserve non-capturing groups - // as such, but any term inside them will become a new capturing group (unless it happens to - // also be inside a lookahead). - var groupType; - if (peek2 === "?:") { - groupType = NON_CAPTURING; - } else { - groupType = LOOKAHEAD; - lookaheadDepth++; - } - groups.push(groupType); - newGroups.push({ start: i, end: -1, type: groupType /*non capturing*/ }); - result.push(chr); - result.push(peek2); - i += peek2.length; - } else { - groups.push(CAPTURING); - newGroups.push({ start: i, end: -1, type: CAPTURING, oldNum: oldGroupNumber, num: newGroupNumber }); - result.push(chr); - if (lookaheadDepth === 0) { - consuming[newGroupNumber] = null; - } - old2New[oldGroupNumber] = newGroupNumber; - oldGroupNumber++; - newGroupNumber++; - } - break; - case ")": - var group = groups.pop(); - if (group === LOOKAHEAD) { lookaheadDepth--; } - newGroups[newGroups.length-1].end = i; - result.push(chr); - break; - case "*": - case "+": - case "?": - case "}": - // Unary operator. If it's being applied to a capturing group, we need to add a new capturing group - // enclosing the pair - var op = chr; - var prev = src.charAt(i-1), - prevIndex = i-1; - if (chr === "}") { - for (var j=i-1; src.charAt(j) !== "{" && j >= 0; j--) {} - prev = src.charAt(j-1); - prevIndex = j-1; - op = src.substring(j, i+1); - } - var lastGroup = newGroups[newGroups.length-1]; - if (prev === ")" && (lastGroup.type === CAPTURING || lastGroup.type === NEW_CAPTURING)) { - // Shove in the new group's (, increment num/start in from [lastGroup.start .. end] - result.splice(lastGroup.start, 0, "("); - result.push(op); - result.push(")"); - var newGroup = { start: lastGroup.start, end: result.length-1, type: NEW_CAPTURING, num: lastGroup.num }; - for (var k=0; k < newGroups.length; k++) { - group = newGroups[k]; - if (group.type === CAPTURING || group.type === NEW_CAPTURING) { - if (group.start >= lastGroup.start && group.end <= prevIndex) { - group.start += 1; - group.end += 1; - group.num = group.num + 1; - if (group.type === CAPTURING) { - old2New[group.oldNum] = group.num; - } - } - } - } - newGroups.push(newGroup); - newGroupNumber++; - break; - } else { - // Fallthrough to default - } - default: - if (chr !== "|" && curGroup !== CAPTURING && curGroup !== NEW_CAPTURING) { - // Not in a capturing group, so make a new one to hold this term. - // Perf improvement: don't create the new group if we're inside a lookahead, since we don't - // care about them (nothing inside a lookahead actually consumes input so we don't need it) - if (lookaheadDepth === 0) { - groups.push(NEW_CAPTURING); - newGroups.push({ start: i, end: -1, type: NEW_CAPTURING, num: newGroupNumber }); - result.push("("); - consuming[newGroupNumber] = null; - newGroupNumber++; - } - } - result.push(chr); - if (chr === "\\") { - var peek = src.charAt(i+1); - // Eat next so following iteration doesn't think it's a real special character - result.push(peek); - i += 1; - } - break; - } - } - while (groups.length) { - // Close any remaining new capturing groups - groups.pop(); - result.push(")"); - } - var newRegex = new RegExp(result.join("")); - - // Update backreferences so they refer to the new group numbers. Use backRefOld2NewMap if provided - var subst = {}; - backRefOld2NewMap = backRefOld2NewMap || old2New; - for (var prop in backRefOld2NewMap) { - if (backRefOld2NewMap.hasOwnProperty(prop)) { - subst[prop] = "\\" + backRefOld2NewMap[prop]; - } - } - newRegex = this.getSubstitutedRegex(newRegex, subst, false); - - return [newRegex, old2New, consuming]; - }, - - /** @returns {Boolean} True if the captures object assigns scope to a matching group other than "0". */ - complexCaptures: function(capturesObj) { - if (!capturesObj) { return false; } - for (var prop in capturesObj) { - if (capturesObj.hasOwnProperty(prop)) { - if (prop !== "0") { - return true; - } - } - } - return false; - } -}; - - /** - * @private - * @param obj {Object} A JSON-ish object. - * @returns {Object} Deep copy of obj. Does not work on properties that are functions or RegExp instances. - */ - function clone(obj) { - var c; - if (obj instanceof Array) { - c = new Array(obj.length); - for (var i=0; i < obj.length; i++) { - c[i] = clone(obj[i]); - } - } else { - c = {}; - for (var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - var value = obj[prop]; - if (typeof value === "object" && value !== null) { - c[prop] = clone(value); - } else { - c[prop] = value; - } - } - } - } - return c; - } - - /** - * @name orion.editor.TextMateStyler - * @class A styler that knows how to apply a subset of the TextMate grammar format to style a line. - * - *

      Styling from a grammar:

      - *

      Each scope name given in the grammar is converted to an array of CSS class names. For example - * a region of text with scope keyword.control.php will be assigned the CSS classes
      - * keyword, keyword-control, keyword-control-php

      - * - *

      A CSS file can give rules matching any of these class names to provide generic or more specific styling. - * For example,

      - *

      .keyword { font-color: blue; }

      - *

      colors all keywords blue, while

      - *

      .keyword-control-php { font-weight: bold; }

      - *

      bolds only PHP control keywords.

      - * - *

      This is useful when using grammars that adhere to TextMate's - * scope name conventions, - * as a single CSS rule can provide consistent styling to similar constructs across different languages.

      - * - *

      Top-level grammar constructs:

      - *
      • patterns, repository (with limitations, see "Other Features") are supported.
      • - *
      • scopeName, firstLineMatch, foldingStartMarker, foldingStopMarker are not supported.
      • - *
      • fileTypes is not supported. When using the Orion service registry, the "orion.edit.highlighter" - * service serves a similar purpose.
      • - *
      - * - *

      Regular expression constructs:

      - *
        - *
      • match patterns are supported.
      • - *
      • begin .. end patterns are supported.
      • - *
      • The "extended" regex forms (?x) and (?x:...) are supported, but only when they - * apply to the entire regex pattern.
      • - *
      • Matching is done using native JavaScript RegExps. As a result, many features of the Oniguruma regex - * engine used by TextMate are not supported. - * Unsupported features include: - *
        • Named captures
        • - *
        • Setting flags inside subgroups (eg. (?i:a)b)
        • - *
        • Lookbehind and negative lookbehind
        • - *
        • Subexpression call
        • - *
        • etc.
        • - *
        - *
      • - *
      - * - *

      Scope-assignment constructs:

      - *
        - *
      • captures, beginCaptures, endCaptures are supported.
      • - *
      • name and contentName are supported.
      • - *
      - * - *

      Other features:

      - *
        - *
      • applyEndPatternLast is supported.
      • - *
      • include is supported, but only when it references a rule in the current grammar's repository. - * Including $self, $base, or rule.from.another.grammar is not supported.
      • - *
      - * - * @description Creates a new TextMateStyler. - * @extends orion.editor.AbstractStyler - * @param {orion.editor.TextView} textView The TextView to provide styling for. - * @param {Object} grammar The TextMate grammar to use for styling the TextView, as a JavaScript object. You can - * produce this object by running a PList-to-JavaScript conversion tool on a TextMate .tmLanguage file. - * @param {Object[]} [externalGrammars] Additional grammar objects that will be used to resolve named rule references. - */ - function TextMateStyler(textView, grammar, externalGrammars) { - this.initialize(textView); - // Copy grammar object(s) since we will mutate them - this.grammar = clone(grammar); - this.externalGrammars = externalGrammars ? clone(externalGrammars) : []; - - this._styles = {}; /* key: {String} scopeName, value: {String[]} cssClassNames */ - this._tree = null; - this._allGrammars = {}; /* key: {String} scopeName of grammar, value: {Object} grammar */ - this.preprocess(this.grammar); - } - TextMateStyler.prototype = /** @lends orion.editor.TextMateStyler.prototype */ { - initialize: function(textView) { - this.textView = textView; - this.textView.stylerOptions = this; - var self = this; - - this._listener = { - onModelChanged: function(e) { - self.onModelChanged(e); - }, - onDestroy: function(e) { - self.onDestroy(e); - }, - onLineStyle: function(e) { - self.onLineStyle(e); - }, - onStorage: function(e){ - self.onStorage(e); - } - }; - textView.addEventListener("ModelChanged", this._listener.onModelChanged); - textView.addEventListener("Destroy", this._listener.onDestroy); - textView.addEventListener("LineStyle", this._listener.onLineStyle); - textView.redrawLines(); - }, - onDestroy: function(/**eclipse.DestroyEvent*/ e) { - this.destroy(); - }, - destroy: function() { - if (this.textView) { - this.textView.removeEventListener("ModelChanged", this._listener.onModelChanged); - this.textView.removeEventListener("Destroy", this._listener.onDestroy); - this.textView.removeEventListener("LineStyle", this._listener.onLineStyle); - this.textView = null; - } - this.grammar = null; - this._styles = null; - this._tree = null; - this._listener = null; - }, - /** @private */ - preprocess: function(grammar) { - var stack = [grammar]; - for (; stack.length !== 0; ) { - var rule = stack.pop(); - if (rule._resolvedRule && rule._typedRule) { - continue; - } -// console.debug("Process " + (rule.include || rule.name)); - - // Look up include'd rule, create typed *Rule instance - rule._resolvedRule = this._resolve(rule); - rule._typedRule = this._createTypedRule(rule); - - // Convert the scope names to styles and cache them for later - this.addStyles(rule.name); - this.addStyles(rule.contentName); - this.addStylesForCaptures(rule.captures); - this.addStylesForCaptures(rule.beginCaptures); - this.addStylesForCaptures(rule.endCaptures); - - if (rule._resolvedRule !== rule) { - // Add include target - stack.push(rule._resolvedRule); - } - if (rule.patterns) { - // Add subrules - for (var i=0; i < rule.patterns.length; i++) { - stack.push(rule.patterns[i]); - } - } - } - }, - - /** - * Adds eclipse.Style objects for scope to our _styles cache. - * @private - * @param {String} scope A scope name, like "constant.character.php". - */ - addStyles: function(scope) { - if (scope && !this._styles[scope]) { - this._styles[scope] = []; - var scopeArray = scope.split("."); - for (var i = 0; i < scopeArray.length; i++) { - this._styles[scope].push(scopeArray.slice(0, i + 1).join("-")); - } - } - }, - /** @private */ - addStylesForCaptures: function(/**Object*/ captures) { - for (var prop in captures) { - if (captures.hasOwnProperty(prop)) { - var scope = captures[prop].name; - this.addStyles(scope); - } - } - }, - /** - * A rule that contains subrules ("patterns" in TextMate parlance) but has no "begin" or "end". - * Also handles top level of grammar. - * @private - */ - ContainerRule: (function() { - function ContainerRule(/**Object*/ rule) { - this.rule = rule; - this.subrules = rule.patterns; - } - ContainerRule.prototype.valueOf = function() { return "aa"; }; - return ContainerRule; - }()), - /** - * A rule that is delimited by "begin" and "end" matches, which may be separated by any number of - * lines. This type of rule may contain subrules, which apply only inside the begin .. end region. - * @private - */ - BeginEndRule: (function() { - function BeginEndRule(/**Object*/ rule) { - this.rule = rule; - // TODO: the TextMate blog claims that "end" is optional. - this.beginRegex = RegexUtil.toRegExp(rule.begin); - this.endRegex = RegexUtil.toRegExp(rule.end); - this.subrules = rule.patterns || []; - - this.endRegexHasBackRef = RegexUtil.hasBackReference(this.endRegex); - - // Deal with non-0 captures - var complexCaptures = RegexUtil.complexCaptures(rule.captures); - var complexBeginEnd = RegexUtil.complexCaptures(rule.beginCaptures) || RegexUtil.complexCaptures(rule.endCaptures); - this.isComplex = complexCaptures || complexBeginEnd; - if (this.isComplex) { - var bg = RegexUtil.groupify(this.beginRegex); - this.beginRegex = bg[0]; - this.beginOld2New = bg[1]; - this.beginConsuming = bg[2]; - - var eg = RegexUtil.groupify(this.endRegex, this.beginOld2New /*Update end's backrefs to begin's new group #s*/); - this.endRegex = eg[0]; - this.endOld2New = eg[1]; - this.endConsuming = eg[2]; - } - } - BeginEndRule.prototype.valueOf = function() { return this.beginRegex; }; - return BeginEndRule; - }()), - /** - * A rule with a "match" pattern. - * @private - */ - MatchRule: (function() { - function MatchRule(/**Object*/ rule) { - this.rule = rule; - this.matchRegex = RegexUtil.toRegExp(rule.match); - this.isComplex = RegexUtil.complexCaptures(rule.captures); - if (this.isComplex) { - var mg = RegexUtil.groupify(this.matchRegex); - this.matchRegex = mg[0]; - this.matchOld2New = mg[1]; - this.matchConsuming = mg[2]; - } - } - MatchRule.prototype.valueOf = function() { return this.matchRegex; }; - return MatchRule; - }()), - /** - * @param {Object} rule A rule from the grammar. - * @returns {MatchRule|BeginEndRule|ContainerRule} - * @private - */ - _createTypedRule: function(rule) { - if (rule.match) { - return new this.MatchRule(rule); - } else if (rule.begin) { - return new this.BeginEndRule(rule); - } else { - return new this.ContainerRule(rule); - } - }, - /** - * Resolves a rule from the grammar (which may be an include) into the real rule that it points to. - * @private - */ - _resolve: function(rule) { - var resolved = rule; - if (rule.include) { - if (rule.begin || rule.end || rule.match) { - throw new Error("Unexpected regex pattern in \"include\" rule " + rule.include); - } - var name = rule.include; - if (name.charAt(0) === "#") { - resolved = this.grammar.repository && this.grammar.repository[name.substring(1)]; - if (!resolved) { throw new Error("Couldn't find included rule " + name + " in grammar repository"); } - } else if (name === "$self") { - resolved = this.grammar; - } else if (name === "$base") { - // $base is only relevant when including rules from foreign grammars - throw new Error("Include \"$base\" is not supported"); - } else { - resolved = this._allGrammars[name]; - if (!resolved) { - for (var i=0; i < this.externalGrammars.length; i++) { - var grammar = this.externalGrammars[i]; - if (grammar.scopeName === name) { - this.preprocess(grammar); - this._allGrammars[name] = grammar; - resolved = grammar; - break; - } - } - } - } - } - return resolved; - }, - - /** @private */ - ContainerNode: (function() { - function ContainerNode(parent, rule) { - this.parent = parent; - this.rule = rule; - this.children = []; - - this.start = null; - this.end = null; - } - ContainerNode.prototype.addChild = function(child) { - this.children.push(child); - }; - ContainerNode.prototype.valueOf = function() { - var r = this.rule; - return "ContainerNode { " + (r.include || "") + " " + (r.name || "") + (r.comment || "") + "}"; - }; - return ContainerNode; - }()), - /** @private */ - BeginEndNode: (function() { - function BeginEndNode(parent, rule, beginMatch) { - this.parent = parent; - this.rule = rule; - this.children = []; - - this.setStart(beginMatch); - this.end = null; // will be set eventually during parsing (may be EOF) - this.endMatch = null; // may remain null if we never match our "end" pattern - - // Build a new regex if the "end" regex has backrefs since they refer to matched groups of beginMatch - if (rule.endRegexHasBackRef) { - this.endRegexSubstituted = RegexUtil.getSubstitutedRegex(rule.endRegex, beginMatch); - } else { - this.endRegexSubstituted = null; - } - } - BeginEndNode.prototype.addChild = function(child) { - this.children.push(child); - }; - /** @return {Number} This node's index in its parent's "children" list */ - BeginEndNode.prototype.getIndexInParent = function(node) { - return this.parent ? this.parent.children.indexOf(this) : -1; - }; - /** @param {RegExp.match} beginMatch */ - BeginEndNode.prototype.setStart = function(beginMatch) { - this.start = beginMatch.index; - this.beginMatch = beginMatch; - }; - /** @param {RegExp.match|Number} endMatchOrLastChar */ - BeginEndNode.prototype.setEnd = function(endMatchOrLastChar) { - if (endMatchOrLastChar && typeof(endMatchOrLastChar) === "object") { - var endMatch = endMatchOrLastChar; - this.endMatch = endMatch; - this.end = endMatch.index + endMatch[0].length; - } else { - var lastChar = endMatchOrLastChar; - this.endMatch = null; - this.end = lastChar; - } - }; - BeginEndNode.prototype.shiftStart = function(amount) { - this.start += amount; - this.beginMatch.index += amount; - }; - BeginEndNode.prototype.shiftEnd = function(amount) { - this.end += amount; - if (this.endMatch) { this.endMatch.index += amount; } - }; - BeginEndNode.prototype.valueOf = function() { - return "{" + this.rule.beginRegex + " range=" + this.start + ".." + this.end + "}"; - }; - return BeginEndNode; - }()), - /** Pushes rules onto stack such that rules[startFrom] is on top - * @private - */ - push: function(/**Array*/ stack, /**Array*/ rules) { - if (!rules) { return; } - for (var i = rules.length; i > 0; ) { - stack.push(rules[--i]); - } - }, - /** Executes regex on text, and returns the match object with its index - * offset by the given amount. - * @returns {RegExp.match} - * @private - */ - exec: function(/**RegExp*/ regex, /**String*/ text, /**Number*/ offset) { - var match = regex.exec(text); - if (match) { match.index += offset; } - regex.lastIndex = 0; // Just in case - return match; - }, - /** @returns {Number} The position immediately following the match. - * @private - */ - afterMatch: function(/**RegExp.match*/ match) { - return match.index + match[0].length; - }, - /** - * @returns {RegExp.match} If node is a BeginEndNode and its rule's "end" pattern matches the text. - * @private - */ - getEndMatch: function(/**Node*/ node, /**String*/ text, /**Number*/ offset) { - if (node instanceof this.BeginEndNode) { - var rule = node.rule; - var endRegex = node.endRegexSubstituted || rule.endRegex; - if (!endRegex) { return null; } - return this.exec(endRegex, text, offset); - } - return null; - }, - /** Called once when file is first loaded to build the parse tree. Tree is updated incrementally thereafter - * as buffer is modified. - * @private - */ - initialParse: function() { - var last = this.textView.getModel().getCharCount(); - // First time; make parse tree for whole buffer - var root = new this.ContainerNode(null, this.grammar._typedRule); - this._tree = root; - this.parse(this._tree, false, 0); - }, - onModelChanged: function(/**eclipse.ModelChangedEvent*/ e) { - var addedCharCount = e.addedCharCount, - addedLineCount = e.addedLineCount, - removedCharCount = e.removedCharCount, - removedLineCount = e.removedLineCount, - start = e.start; - if (!this._tree) { - this.initialParse(); - } else { - var model = this.textView.getModel(); - var charCount = model.getCharCount(); - - // For rs, we must rewind to the line preceding the line 'start' is on. We can't rely on start's - // line since it may've been changed in a way that would cause a new beginMatch at its lineStart. - var rs = model.getLineEnd(model.getLineAtOffset(start) - 1); // may be < 0 - var fd = this.getFirstDamaged(rs, rs); - rs = rs === -1 ? 0 : rs; - var stoppedAt; - if (fd) { - // [rs, re] is the region we need to verify. If we find the structure of the tree - // has changed in that area, then we may need to reparse the rest of the file. - stoppedAt = this.parse(fd, true, rs, start, addedCharCount, removedCharCount); - } else { - // FIXME: fd == null ? - stoppedAt = charCount; - } - this.textView.redrawRange(rs, stoppedAt); - } - }, - /** @returns {BeginEndNode|ContainerNode} The result of taking the first (smallest "start" value) - * node overlapping [start,end] and drilling down to get its deepest damaged descendant (if any). - * @private - */ - getFirstDamaged: function(start, end) { - // If start === 0 we actually have to start from the root because there is no position - // we can rely on. (First index is damaged) - if (start < 0) { - return this._tree; - } - - var nodes = [this._tree]; - var result = null; - while (nodes.length) { - var n = nodes.pop(); - if (!n.parent /*n is root*/ || this.isDamaged(n, start, end)) { - // n is damaged by the edit, so go into its children - // Note: If a node is damaged, then some of its descendents MAY be damaged - // If a node is undamaged, then ALL of its descendents are undamaged - if (n instanceof this.BeginEndNode) { - result = n; - } - // Examine children[0] last - for (var i=0; i < n.children.length; i++) { - nodes.push(n.children[i]); - } - } - } - return result || this._tree; - }, - /** @returns true If n overlaps the interval [start,end]. - * @private - */ - isDamaged: function(/**BeginEndNode*/ n, start, end) { - // Note strict > since [2,5] doesn't overlap [5,7] - return (n.start <= end && n.end > start); - }, - /** - * Builds tree from some of the buffer content - * - * TODO cleanup params - * @param {BeginEndNode|ContainerNode} origNode The deepest node that overlaps [rs,rs], or the root. - * @param {Boolean} repairing - * @param {Number} rs See _onModelChanged() - * @param {Number} [editStart] Only used for repairing === true - * @param {Number} [addedCharCount] Only used for repairing === true - * @param {Number} [removedCharCount] Only used for repairing === true - * @returns {Number} The end position that redrawRange should be called for. - * @private - */ - parse: function(origNode, repairing, rs, editStart, addedCharCount, removedCharCount) { - var model = this.textView.getModel(); - var lastLineStart = model.getLineStart(model.getLineCount() - 1); - var eof = model.getCharCount(); - var initialExpected = this.getInitialExpected(origNode, rs); - - // re is best-case stopping point; if we detect change to tree, we must continue past it - var re = -1; - if (repairing) { - origNode.repaired = true; - origNode.endNeedsUpdate = true; - var lastChild = origNode.children[origNode.children.length-1]; - var delta = addedCharCount - removedCharCount; - var lastChildLineEnd = lastChild ? model.getLineEnd(model.getLineAtOffset(lastChild.end + delta)) : -1; - var editLineEnd = model.getLineEnd(model.getLineAtOffset(editStart + removedCharCount)); - re = Math.max(lastChildLineEnd, editLineEnd); - } - re = (re === -1) ? eof : re; - - var expected = initialExpected; - var node = origNode; - var matchedChildOrEnd = false; - var pos = rs; - var redrawEnd = -1; - while (node && (!repairing || (pos < re))) { - var matchInfo = this.getNextMatch(model, node, pos); - if (!matchInfo) { - // Go to next line, if any - pos = (pos >= lastLineStart) ? eof : model.getLineStart(model.getLineAtOffset(pos) + 1); - } - var match = matchInfo && matchInfo.match, - rule = matchInfo && matchInfo.rule, - isSub = matchInfo && matchInfo.isSub, - isEnd = matchInfo && matchInfo.isEnd; - if (isSub) { - pos = this.afterMatch(match); - if (rule instanceof this.BeginEndRule) { - matchedChildOrEnd = true; - // Matched a child. Did we expect that? - if (repairing && rule === expected.rule && node === expected.parent) { - // Yes: matched expected child - var foundChild = expected; - foundChild.setStart(match); - // Note: the 'end' position for this node will either be matched, or fixed up by us post-loop - foundChild.repaired = true; - foundChild.endNeedsUpdate = true; - node = foundChild; // descend - expected = this.getNextExpected(expected, "begin"); - } else { - if (repairing) { - // No: matched unexpected child. - this.prune(node, expected); - repairing = false; - } - - // Add the new child (will replace 'expected' in node's children list) - var subNode = new this.BeginEndNode(node, rule, match); - node.addChild(subNode); - node = subNode; // descend - } - } else { - // Matched a MatchRule; no changes to tree required - } - } else if (isEnd || pos === eof) { - if (node instanceof this.BeginEndNode) { - if (match) { - matchedChildOrEnd = true; - redrawEnd = Math.max(redrawEnd, node.end); // if end moved up, must still redraw to its old value - node.setEnd(match); - pos = this.afterMatch(match); - // Matched node's end. Did we expect that? - if (repairing && node === expected && node.parent === expected.parent) { - // Yes: found the expected end of node - node.repaired = true; - delete node.endNeedsUpdate; - expected = this.getNextExpected(expected, "end"); - } else { - if (repairing) { - // No: found an unexpected end - this.prune(node, expected); - repairing = false; - } - } - } else { - // Force-ending a BeginEndNode that runs until eof - node.setEnd(eof); - delete node.endNeedsUpdate; - } - } - node = node.parent; // ascend - } - - if (repairing && pos >= re && !matchedChildOrEnd) { - // Reached re without matching any begin/end => initialExpected itself was removed => repair fail - this.prune(origNode, initialExpected); - repairing = false; - } - } // end loop - // TODO: do this for every node we end? - this.removeUnrepairedChildren(origNode, repairing, rs); - - //console.debug("parsed " + (pos - rs) + " of " + model.getCharCount + "buf"); - this.cleanup(repairing, origNode, rs, re, eof, addedCharCount, removedCharCount); - if (repairing) { - return Math.max(redrawEnd, pos); - } else { - return pos; // where we stopped reparsing - } - }, - /** Helper for parse() in the repair case. To be called when ending a node, as any children that - * lie in [rs,node.end] and were not repaired must've been deleted. - * @private - */ - removeUnrepairedChildren: function(node, repairing, start) { - if (repairing) { - var children = node.children; - var removeFrom = -1; - for (var i=0; i < children.length; i++) { - var child = children[i]; - if (!child.repaired && this.isDamaged(child, start, Number.MAX_VALUE /*end doesn't matter*/)) { - removeFrom = i; - break; - } - } - if (removeFrom !== -1) { - node.children.length = removeFrom; - } - } - }, - /** Helper for parse() in the repair case - * @private - */ - cleanup: function(repairing, origNode, rs, re, eof, addedCharCount, removedCharCount) { - var i, node, maybeRepairedNodes; - if (repairing) { - // The repair succeeded, so update stale begin/end indices by simple translation. - var delta = addedCharCount - removedCharCount; - // A repaired node's end can't exceed re, but it may exceed re-delta+1. - // TODO: find a way to guarantee disjoint intervals for repaired vs unrepaired, then stop using flag - var maybeUnrepairedNodes = this.getIntersecting(re-delta+1, eof); - maybeRepairedNodes = this.getIntersecting(rs, re); - // Handle unrepaired nodes. They are those intersecting [re-delta+1, eof] that don't have the flag - for (i=0; i < maybeUnrepairedNodes.length; i++) { - node = maybeUnrepairedNodes[i]; - if (!node.repaired && node instanceof this.BeginEndNode) { - node.shiftEnd(delta); - node.shiftStart(delta); - } - } - // Translate 'end' index of repaired node whose 'end' was not matched in loop (>= re) - for (i=0; i < maybeRepairedNodes.length; i++) { - node = maybeRepairedNodes[i]; - if (node.repaired && node.endNeedsUpdate) { - node.shiftEnd(delta); - } - delete node.endNeedsUpdate; - delete node.repaired; - } - } else { - // Clean up after ourself - maybeRepairedNodes = this.getIntersecting(rs, re); - for (i=0; i < maybeRepairedNodes.length; i++) { - delete maybeRepairedNodes[i].repaired; - } - } - }, - /** - * @param model {orion.editor.TextModel} - * @param {Node} node - * @param {Number} pos - * @param {Boolean} [matchRulesOnly] Optional, if true only "match" subrules will be considered. - * @returns {Object} A match info object with properties: - * {Boolean} isEnd - * {Boolean} isSub - * {RegExp.match} match - * {(Match|BeginEnd)Rule} rule - * @private - */ - getNextMatch: function(model, node, pos, matchRulesOnly) { - var lineIndex = model.getLineAtOffset(pos); - var lineEnd = model.getLineEnd(lineIndex); - var line = model.getText(pos, lineEnd); - - var stack = [], - expandedContainers = [], - subMatches = [], - subrules = []; - this.push(stack, node.rule.subrules); - while (stack.length) { - var next = stack.length ? stack.pop() : null; - var subrule = next && next._resolvedRule._typedRule; - if (subrule instanceof this.ContainerRule && expandedContainers.indexOf(subrule) === -1) { - // Expand ContainerRule by pushing its subrules on - expandedContainers.push(subrule); - this.push(stack, subrule.subrules); - continue; - } - if (subrule && matchRulesOnly && !(subrule.matchRegex)) { - continue; - } - var subMatch = subrule && this.exec(subrule.matchRegex || subrule.beginRegex, line, pos); - if (subMatch) { - subMatches.push(subMatch); - subrules.push(subrule); - } - } - - var bestSub = Number.MAX_VALUE, - bestSubIndex = -1; - for (var i=0; i < subMatches.length; i++) { - var match = subMatches[i]; - if (match.index < bestSub) { - bestSub = match.index; - bestSubIndex = i; - } - } - - if (!matchRulesOnly) { - // See if the "end" pattern of the active begin/end node matches. - // TODO: The active begin/end node may not be the same as the node that holds the subrules - var activeBENode = node; - var endMatch = this.getEndMatch(node, line, pos); - if (endMatch) { - var doEndLast = activeBENode.rule.applyEndPatternLast; - var endWins = bestSubIndex === -1 || (endMatch.index < bestSub) || (!doEndLast && endMatch.index === bestSub); - if (endWins) { - return {isEnd: true, rule: activeBENode.rule, match: endMatch}; - } - } - } - return bestSubIndex === -1 ? null : {isSub: true, rule: subrules[bestSubIndex], match: subMatches[bestSubIndex]}; - }, - /** - * Gets the node corresponding to the first match we expect to see in the repair. - * @param {BeginEndNode|ContainerNode} node The node returned via getFirstDamaged(rs,rs) -- may be the root. - * @param {Number} rs See _onModelChanged() - * Note that because rs is a line end (or 0, a line start), it will intersect a beginMatch or - * endMatch either at their 0th character, or not at all. (begin/endMatches can't cross lines). - * This is the only time we rely on the start/end values from the pre-change tree. After this - * we only look at node ordering, never use the old indices. - * @returns {Node} - * @private - */ - getInitialExpected: function(node, rs) { - // TODO: Kind of weird.. maybe ContainerNodes should have start & end set, like BeginEndNodes - var i, child; - if (node === this._tree) { - // get whichever of our children comes after rs - for (i=0; i < node.children.length; i++) { - child = node.children[i]; // BeginEndNode - if (child.start >= rs) { - return child; - } - } - } else if (node instanceof this.BeginEndNode) { - if (node.endMatch) { - // Which comes next after rs: our nodeEnd or one of our children? - var nodeEnd = node.endMatch.index; - for (i=0; i < node.children.length; i++) { - child = node.children[i]; // BeginEndNode - if (child.start >= rs) { - break; - } - } - if (child && child.start < nodeEnd) { - return child; // Expect child as the next match - } - } else { - // No endMatch => node goes until eof => it end should be the next match - } - } - return node; // We expect node to end, so it should be the next match - }, - /** - * Helper for repair() to tell us what kind of event we expect next. - * @param {Node} expected Last value returned by this method. - * @param {String} event "begin" if the last value of expected was matched as "begin", - * or "end" if it was matched as an end. - * @returns {Node} The next expected node to match, or null. - * @private - */ - getNextExpected: function(/**Node*/ expected, event) { - var node = expected; - if (event === "begin") { - var child = node.children[0]; - if (child) { - return child; - } else { - return node; - } - } else if (event === "end") { - var parent = node.parent; - if (parent) { - var nextSibling = parent.children[parent.children.indexOf(node) + 1]; - if (nextSibling) { - return nextSibling; - } else { - return parent; - } - } - } - return null; - }, - /** Helper for parse() when repairing. Prunes out the unmatched nodes from the tree so we can continue parsing. - * @private - */ - prune: function(/**BeginEndNode|ContainerNode*/ node, /**Node*/ expected) { - var expectedAChild = expected.parent === node; - if (expectedAChild) { - // Expected child wasn't matched; prune it and all siblings after it - node.children.length = expected.getIndexInParent(); - } else if (node instanceof this.BeginEndNode) { - // Expected node to end but it didn't; set its end unknown and we'll match it eventually - node.endMatch = null; - node.end = null; - } - // Reparsing from node, so prune the successors outside of node's subtree - if (node.parent) { - node.parent.children.length = node.getIndexInParent() + 1; - } - }, - onLineStyle: function(/**eclipse.LineStyleEvent*/ e) { - function byStart(r1, r2) { - return r1.start - r2.start; - } - - if (!this._tree) { - // In some cases it seems onLineStyle is called before onModelChanged, so we need to parse here - this.initialParse(); - } - var lineStart = e.lineStart, - model = this.textView.getModel(), - lineEnd = model.getLineEnd(e.lineIndex); - - var rs = model.getLineEnd(model.getLineAtOffset(lineStart) - 1); // may be < 0 - var node = this.getFirstDamaged(rs, rs); - - var scopes = this.getLineScope(model, node, lineStart, lineEnd); - e.ranges = this.toStyleRanges(scopes); - // Editor requires StyleRanges must be in ascending order by 'start', or else some will be ignored - e.ranges.sort(byStart); - }, - /** Runs parse algorithm on [start, end] in the context of node, assigning scope as we find matches. - * @private - */ - getLineScope: function(model, node, start, end) { - var pos = start; - var expected = this.getInitialExpected(node, start); - var scopes = [], - gaps = []; - while (node && (pos < end)) { - var matchInfo = this.getNextMatch(model, node, pos); - if (!matchInfo) { - break; // line is over - } - var match = matchInfo && matchInfo.match, - rule = matchInfo && matchInfo.rule, - isSub = matchInfo && matchInfo.isSub, - isEnd = matchInfo && matchInfo.isEnd; - if (match.index !== pos) { - // gap [pos..match.index] - gaps.push({ start: pos, end: match.index, node: node}); - } - if (isSub) { - pos = this.afterMatch(match); - if (rule instanceof this.BeginEndRule) { - // Matched a "begin", assign its scope and descend into it - this.addBeginScope(scopes, match, rule); - node = expected; // descend - expected = this.getNextExpected(expected, "begin"); - } else { - // Matched a child MatchRule; - this.addMatchScope(scopes, match, rule); - } - } else if (isEnd) { - pos = this.afterMatch(match); - // Matched and "end", assign its end scope and go up - this.addEndScope(scopes, match, rule); - expected = this.getNextExpected(expected, "end"); - node = node.parent; // ascend - } - } - if (pos < end) { - gaps.push({ start: pos, end: end, node: node }); - } - var inherited = this.getInheritedLineScope(gaps, start, end); - return scopes.concat(inherited); - }, - /** @private */ - getInheritedLineScope: function(gaps, start, end) { - var scopes = []; - for (var i=0; i < gaps.length; i++) { - var gap = gaps[i]; - var node = gap.node; - while (node) { - // if node defines a contentName or name, apply it - var rule = node.rule.rule; - var name = rule.name, - contentName = rule.contentName; - // TODO: if both are given, we don't resolve the conflict. contentName always wins - var scope = contentName || name; - if (scope) { - this.addScopeRange(scopes, gap.start, gap.end, scope); - break; - } - node = node.parent; - } - } - return scopes; - }, - /** @private */ - addBeginScope: function(scopes, match, typedRule) { - var rule = typedRule.rule; - this.addCapturesScope(scopes, match, (rule.beginCaptures || rule.captures), typedRule.isComplex, typedRule.beginOld2New, typedRule.beginConsuming); - }, - /** @private */ - addEndScope: function(scopes, match, typedRule) { - var rule = typedRule.rule; - this.addCapturesScope(scopes, match, (rule.endCaptures || rule.captures), typedRule.isComplex, typedRule.endOld2New, typedRule.endConsuming); - }, - /** @private */ - addMatchScope: function(scopes, match, typedRule) { - var rule = typedRule.rule, - name = rule.name, - captures = rule.captures; - if (captures) { - // captures takes priority over name - this.addCapturesScope(scopes, match, captures, typedRule.isComplex, typedRule.matchOld2New, typedRule.matchConsuming); - } else { - this.addScope(scopes, match, name); - } - }, - /** @private */ - addScope: function(scopes, match, name) { - if (!name) { return; } - scopes.push({start: match.index, end: this.afterMatch(match), scope: name }); - }, - /** @private */ - addScopeRange: function(scopes, start, end, name) { - if (!name) { return; } - scopes.push({start: start, end: end, scope: name }); - }, - /** @private */ - addCapturesScope: function(/**Array*/scopes, /*RegExp.match*/ match, /**Object*/captures, /**Boolean*/isComplex, /**Object*/old2New, /**Object*/consuming) { - if (!captures) { return; } - if (!isComplex) { - this.addScope(scopes, match, captures[0] && captures[0].name); - } else { - // apply scopes captures[1..n] to matching groups [1]..[n] of match - - // Sum up the lengths of preceding consuming groups to get the start offset for each matched group. - var newGroupStarts = {1: 0}; - var sum = 0; - for (var num = 1; match[num] !== undefined; num++) { - if (consuming[num] !== undefined) { - sum += match[num].length; - } - if (match[num+1] !== undefined) { - newGroupStarts[num + 1] = sum; - } - } - // Map the group numbers referred to in captures object to the new group numbers, and get the actual matched range. - var start = match.index; - for (var oldGroupNum = 1; captures[oldGroupNum]; oldGroupNum++) { - var scope = captures[oldGroupNum].name; - var newGroupNum = old2New[oldGroupNum]; - var groupStart = start + newGroupStarts[newGroupNum]; - // Not every capturing group defined in regex need match every time the regex is run. - // eg. (a)|b matches "b" but group 1 is undefined - if (typeof match[newGroupNum] !== "undefined") { - var groupEnd = groupStart + match[newGroupNum].length; - this.addScopeRange(scopes, groupStart, groupEnd, scope); - } - } - } - }, - /** @returns {Node[]} In depth-first order - * @private - */ - getIntersecting: function(start, end) { - var result = []; - var nodes = this._tree ? [this._tree] : []; - while (nodes.length) { - var n = nodes.pop(); - var visitChildren = false; - if (n instanceof this.ContainerNode) { - visitChildren = true; - } else if (this.isDamaged(n, start, end)) { - visitChildren = true; - result.push(n); - } - if (visitChildren) { - var len = n.children.length; -// for (var i=len-1; i >= 0; i--) { -// nodes.push(n.children[i]); -// } - for (var i=0; i < len; i++) { - nodes.push(n.children[i]); - } - } - } - return result.reverse(); - }, - /** - * Applies the grammar to obtain the {@link eclipse.StyleRange[]} for the given line. - * @returns {eclipse.StyleRange[]} - * @private - */ - toStyleRanges: function(/**ScopeRange[]*/ scopeRanges) { - var styleRanges = []; - for (var i=0; i < scopeRanges.length; i++) { - var scopeRange = scopeRanges[i]; - var classNames = this._styles[scopeRange.scope]; - if (!classNames) { throw new Error("styles not found for " + scopeRange.scope); } - var classNamesString = classNames.join(" "); - styleRanges.push({start: scopeRange.start, end: scopeRange.end, style: {styleClass: classNamesString}}); -// console.debug("{start " + styleRanges[i].start + ", end " + styleRanges[i].end + ", style: " + styleRanges[i].style.styleClass + "}"); - } - return styleRanges; - } - }; - - return { - RegexUtil: RegexUtil, - TextMateStyler: TextMateStyler - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define("orion/editor/AsyncStyler", ['i18n!orion/editor/nls/messages', 'orion/editor/annotations'], function(messages, mAnnotations) { - var SERVICE_NAME = "orion.edit.highlighter"; - var HIGHLIGHT_ERROR_ANNOTATION = "orion.annotation.highlightError"; - var badServiceError = SERVICE_NAME + " service must be an event emitter"; - mAnnotations.AnnotationType.registerType(HIGHLIGHT_ERROR_ANNOTATION, { - title: messages.syntaxError, - html: "
      ", - rangeStyle: {styleClass: "annotationRange error"} - }); - - function isRelevant(serviceReference) { - return serviceReference.getProperty("objectClass").indexOf(SERVICE_NAME) !== -1 && - serviceReference.getProperty("type") === "highlighter"; - } - - /** - * @name orion.editor.AsyncStyler - * @class Provides asynchronous styling for a TextView using registered "highlighter" services. - * @description Creates an AsyncStyler. An AsyncStyler allows style information to be sent to a - * TextView asynchronously through the service segistry. Style is generated by style providers, which are services - * having the 'orion.edit.highlighter' service name and a type === 'highlighter' service property. - * - *

      A style provider monitors changes to the TextView (typically using an orion.edit.model service) and - * dispatches a service event of type 'orion.edit.highlighter.styleReady' when it has style information to send. - * The event carries a payload of style information for one or more lines in the TextView. The AsyncStyler then applies - * the style information fron the event to the TextView using the {@link orion.editor.TextView#event:onLineStyle} API. - *

      - * - *

      Applying style information may cause the TextView to be redrawn, which is potentially expensive. To minimize the - * number of redraws, a provider should provide style for many lines in a single StyleReadyEvent. - *

      - * - * @param {orion.editor.TextView} textView The TextView to style. - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry The ServiceRegistry to monitor for highlighter services. - * @param {orion.editor.AnnotationModel} [annotationModel] The Annotation Model to use for creating error and warning annotations. - * @see orion.editor.StyleReadyEvent - */ - function AsyncStyler(textView, serviceRegistry, annotationModel) { - this.initialize(textView, serviceRegistry, annotationModel); - this.lineStyles = []; - } - AsyncStyler.prototype = /** @lends orion.editor.AsyncStyler.prototype*/ { - /** @private */ - initialize: function(textView, serviceRegistry, annotationModel) { - this.textView = textView; - this.serviceRegistry = serviceRegistry; - this.annotationModel = annotationModel; - this.services = []; - - var self = this; - this.listener = { - onModelChanging: function(e) { - self.onModelChanging(e); - }, - onModelChanged: function(e) { - self.onModelChanged(e); - }, - onDestroy: function(e) { - self.onDestroy(e); - }, - onLineStyle: function(e) { - self.onLineStyle(e); - }, - onStyleReady: function(e) { - self.onStyleReady(e); - }, - onServiceAdded: function(serviceEvent) { - self.onServiceAdded(serviceEvent.serviceReference, self.serviceRegistry.getService(serviceEvent.serviceReference)); - }, - onServiceRemoved: function(serviceEvent) { - self.onServiceRemoved(serviceEvent.serviceReference, self.serviceRegistry.getService(serviceEvent.serviceReference)); - } - }; - textView.addEventListener("ModelChanging", this.listener.onModelChanging); - textView.addEventListener("ModelChanged", this.listener.onModelChanged); - textView.addEventListener("Destroy", this.listener.onDestroy); - textView.addEventListener("LineStyle", this.listener.onLineStyle); - serviceRegistry.addEventListener("registered", this.listener.onServiceAdded); - serviceRegistry.addEventListener("unregistering", this.listener.onServiceRemoved); - - var serviceRefs = serviceRegistry.getServiceReferences(SERVICE_NAME); - for (var i = 0; i < serviceRefs.length; i++) { - var serviceRef = serviceRefs[i]; - if (isRelevant(serviceRef)) { - this.addServiceListener(serviceRegistry.getService(serviceRef)); - } - } - }, - /** @private */ - onDestroy: function(e) { - this.destroy(); - }, - /** Deactivates this styler and removes any listeners it registered. */ - destroy: function() { - if (this.textView) { - this.textView.removeEventListener("ModelChanging", this.listener.onModelChanging); - this.textView.removeEventListener("ModelChanged", this.listener.onModelChanged); - this.textView.removeEventListener("Destroy", this.listener.onDestroy); - this.textView.removeEventListener("LineStyle", this.listener.onLineStyle); - this.textView = null; - } - if (this.services) { - for (var i = 0; i < this.services.length; i++) { - this.removeServiceListener(this.services[i]); - } - this.services = null; - } - if (this.serviceRegistry) { - this.serviceRegistry.removeEventListener("registered", this.listener.onServiceAdded); - this.serviceRegistry.removeEventListener("unregistering", this.listener.onServiceRemoved); - this.serviceRegistry = null; - } - this.listener = null; - this.lineStyles = null; - }, - /** @private */ - onModelChanging: function(e) { - this.startLine = this.textView.getModel().getLineAtOffset(e.start); - }, - /** @private */ - onModelChanged: function(e) { - var startLine = this.startLine; - if (e.addedLineCount || e.removedLineCount) { - Array.prototype.splice.apply(this.lineStyles, [startLine, e.removedLineCount].concat(this._getEmptyStyle(e.addedLineCount))); - } - }, - /** @private */ - onStyleReady: function(e) { - var style = e.lineStyles || e.style; - var min = Number.MAX_VALUE, max = -1; - var model = this.textView.getModel(); - for (var lineIndex in style) { - if (Object.prototype.hasOwnProperty.call(style, lineIndex)) { - this.lineStyles[lineIndex] = style[lineIndex]; - min = Math.min(min, lineIndex); - max = Math.max(max, lineIndex); - } - } -// console.debug("Got style for lines " + (min+1) + " to " + (max+1)); - min = Math.max(min, 0); - max = Math.min(max, model.getLineCount()); - - var annotationModel = this.annotationModel; - if (annotationModel) { - var annos = annotationModel.getAnnotations(model.getLineStart(min), model.getLineEnd(max)); - var toRemove = []; - while (annos.hasNext()) { - var anno = annos.next(); - if (anno.type === HIGHLIGHT_ERROR_ANNOTATION) { - toRemove.push(anno); - } - } - var toAdd = []; - for (var i = min; i <= max; i++) { - lineIndex = i; - var lineStyle = this.lineStyles[lineIndex], errors = lineStyle && lineStyle.errors; - var lineStart = model.getLineStart(lineIndex); - if (errors) { - for (var j=0; j < errors.length; j++) { - var err = errors[j]; - toAdd.push(mAnnotations.AnnotationType.createAnnotation(HIGHLIGHT_ERROR_ANNOTATION, err.start + lineStart, err.end + lineStart)); - } - } - } - annotationModel.replaceAnnotations(toRemove, toAdd); - } - this.textView.redrawLines(min, max + 1); - }, - /** @private */ - onLineStyle: function(e) { - function _toDocumentOffset(ranges, lineStart) { - var len = ranges.length, result = []; - for (var i=0; i < len; i++) { - var r = ranges[i]; - result.push({ - start: r.start + lineStart, - end: r.end + lineStart, - style: r.style - }); - } - return result; - } - var style = this.lineStyles[e.lineIndex]; - if (style) { - // The 'ranges', 'errors' are of type {@link orion.editor.LineStyleEvent#ranges}, except the - // start and end indices are line-relative offsets, not document-relative. - if (style.ranges) { e.ranges = _toDocumentOffset(style.ranges, e.lineStart); } - else if (style.style) { e.style = style.style; } - } - }, - /** @private */ - _getEmptyStyle: function(n) { - var result = []; - for (var i=0; i < n; i++) { - result.push(null); - } - return result; - }, - /** - * Sets the content type ID for which style information will be provided. The ID will be passed to all style provider - * services monitored by this AsyncStyler by calling the provider's own setContentType(contentTypeId) method. - * - *

      In this way, a single provider service can be registered for several content types, and select different logic for - * each type.

      - * @param {String} contentTypeId The Content Type ID describing the kind of file currently being edited in the TextView. - * @see orion.core.ContentType - */ - setContentType: function(contentTypeId) { - this.contentType = contentTypeId; - if (this.services) { - for (var i = 0; i < this.services.length; i++) { - var service = this.services[i]; - if (service.setContentType) { - var progress = this.serviceRegistry.getService("orion.page.progress"); - if(progress){ - progress.progress(service.setContentType(this.contentType), "Styling content type: " + this.contentType.id ? this.contentType.id: this.contentType); - } else { - service.setContentType(this.contentType); - } - } - } - } - }, - /** @private */ - onServiceAdded: function(serviceRef, service) { - if (isRelevant(serviceRef)) { - this.addServiceListener(service); - } - }, - /** @private */ - onServiceRemoved: function(serviceRef, service) { - if (this.services.indexOf(service) !== -1) { - this.removeServiceListener(service); - } - }, - /** @private */ - addServiceListener: function(service) { - if (typeof service.addEventListener === "function") { - service.addEventListener("orion.edit.highlighter.styleReady", this.listener.onStyleReady); - this.services.push(service); - if (service.setContentType && this.contentType) { - var progress = this.serviceRegistry.getService("orion.page.progress"); - if(progress){ - progress.progress(service.setContentType(this.contentType), "Styling content type: " + this.contentType.id ? this.contentType.id: this.contentType); - } else { - service.setContentType(this.contentType); - } - } - } else { - if (typeof console !== "undefined") { - console.log(new Error(badServiceError)); - } - } - }, - /** @private */ - removeServiceListener: function(service) { - if (typeof service.removeEventListener === "function") { - service.removeEventListener("orion.edit.highlighter.styleReady", this.listener.onStyleReady); - var serviceIndex = this.services.indexOf(service); - if (serviceIndex !== -1) { - this.services.splice(serviceIndex, 1); - } - } else { - if (typeof console !== "undefined") { - console.log(new Error(badServiceError)); - } - } - } - }; - - /** - * @name orion.editor.StyleReadyEvent - * @class Represents the styling for a range of lines, as provided by a service. - * @description Represents the styling for a range of lines, as provided by a service. - * @property {Object} lineStyles A map of style information. Each key of the map is a line index, and the value - * is a {@link orion.editor.StyleReadyEvent#LineStyle} giving the style information for the line. - */ - /** - * @name orion.editor.StyleReadyEvent#LineStyle - * @class Represents style information for a line. - * @description Represents style information for a line. - *

      Note that the offsets given in the {@link #ranges} and {@link #errors} properties are relative to the start of the - * line that this LineStyle is associated with, not the start of the document.

      - * @property {orion.editor.StyleRange[]} ranges Optional; Gives the styles for this line. - * @property {orion.editor.StyleRange[]} errors Optional; Gives the error styles for this line. Error styles will be - * presented as annotations in the UI. - */ - - return AsyncStyler; -}); -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/highlight',['examples/editor/textStyler', 'orion/editor/textStyler', 'orion/editor/textMateStyler', 'orion/editor/AsyncStyler', 'orion/Deferred'], - function(mTextStyler, mTextStyler2, mTextMateStyler, AsyncStyler, Deferred) { - - var NEW = 1; - - /** - * Returns a promise that will provide a styler for the given content type. - * @static - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry - * @param {orion.core.ContentTypeRegistry} contentTypeService - * @param {orion.core.ContentType} contentType - * @param {orion.editor.TextView} textView - * @param {orion.editor.AnnotationModel} annotationModel - * @param {String} [fileName] Deprecated. - * @param {Boolean} [allowAsync=true] - * @returns {orion.Deferred} - */ - function createStyler(serviceRegistry, contentTypeService, contentType, textView, annotationModel, fileName, allowAsync) { - // Returns a promise (if provider matches) or null (if it doesn't match). - function getPromise(provider, extension) { - var contentTypeIds = provider.getProperty("contentType") || provider.getProperty("contentTypes"), //$NON-NLS-1$ //$NON-NLS-0$ - fileTypes = provider.getProperty("fileTypes"); // backwards compatibility //$NON-NLS-0$ - if (contentTypeIds) { - return Deferred.when(contentTypeService.isSomeExtensionOf(contentType, contentTypeIds)).then( - function (isMatch) { - return isMatch ? provider : null; - }); - } else if (extension && fileTypes && fileTypes.indexOf(extension) !== -1) { - var d = new Deferred(); - d.resolve(provider); - return d; - } - return null; - } - function isAllowed(provider) { - return allowAsync || provider.getProperty("type") !== "highlighter"; //$NON-NLS-1$ //$NON-NLS-0$ - } - function createDefaultStyler(contentType) { - var styler = null; - switch (contentType && contentType.id) { - case "application/javascript": //$NON-NLS-0$ - case "application/json": //$NON-NLS-0$ - styler = new mTextStyler.TextStyler(textView, "js", annotationModel); //$NON-NLS-0$ - break; - case "text/x-java-source": //$NON-NLS-0$ - styler = new mTextStyler.TextStyler(textView, "java", annotationModel); //$NON-NLS-0$ - break; - case "text/css": //$NON-NLS-0$ - styler = new mTextStyler.TextStyler(textView, "css", annotationModel); //$NON-NLS-0$ - break; - } - return styler; - } - // Check default styler - if (!NEW) { - var styler = createDefaultStyler(contentType); - if (styler) { - var result = new Deferred(); - result.resolve(styler); - return result; - } - } - - if (NEW && !this.orionGrammars) { - this.orionGrammars = {}; - } - - // Check services - var extension = fileName && fileName.split(".").pop().toLowerCase(); //$NON-NLS-0$ - var serviceRefs = serviceRegistry.getServiceReferences("orion.edit.highlighter"); //$NON-NLS-0$ - var textmateGrammars = [], promises = []; - for (var i = 0; i < serviceRefs.length; i++) { - var serviceRef = serviceRefs[i]; - var type = serviceRef.getProperty("type"); - if (type === "grammar" || (!NEW && typeof type === "undefined")) { //$NON-NLS-1$ //$NON-NLS-0$ - textmateGrammars.push(serviceRef.getProperty("grammar")); //$NON-NLS-0$ - } else if (type !== "highlighter") { - var id = serviceRef.getProperty("id"); - if (id && !this.orionGrammars[id]) { - this.orionGrammars[id] = { - id: id, - contentTypes: serviceRef.getProperty("contentTypes"), - patterns: serviceRef.getProperty("patterns"), - repository: serviceRef.getProperty("repository") - }; - } - } - var promise = getPromise(serviceRef, extension); - if (promise) { - promises.push(promise); - } - } - return Deferred.all(promises, function(error) {return {_error: error};}).then(function(promises) { - // Take the last matching provider. Could consider ranking them here. - var provider; - for (var i = promises.length - 1; i >= 0; i--) { - var promise = promises[i]; - if (promise && !promise._error && isAllowed(promise)) { - provider = promise; - break; - } - } - var styler; - if (provider) { - var type = provider.getProperty("type"); //$NON-NLS-0$ - if (type === "highlighter") { //$NON-NLS-0$ - styler = new AsyncStyler(textView, serviceRegistry, annotationModel); - styler.setContentType(contentType); - } else if (type === "grammar" || (!NEW && typeof type === "undefined")) { //$NON-NLS-1$ //$NON-NLS-0$ - var textmateGrammar = provider.getProperty("grammar"); //$NON-NLS-0$ - styler = new mTextMateStyler.TextMateStyler(textView, textmateGrammar, textmateGrammars); - } else { - if (NEW) { - var grammars = []; - for(var key in this.orionGrammars) { - grammars.push(this.orionGrammars[key]); - } - var stylerAdapter = new mTextStyler2.createPatternBasedAdapter(grammars, provider.getProperty("id"), contentType.id); //$NON-NLS-0$ - styler = new mTextStyler2.TextStyler(textView, annotationModel, stylerAdapter); - } - } - } else if (NEW && (!contentType || contentType.id !== "text/x-markdown")) { //$NON-NLS-0$ - /* even if a grammar was not found create a default pattern adapter so that whitespace will be shown if appropriate */ - stylerAdapter = new mTextStyler2.createPatternBasedAdapter([], ""); - styler = new mTextStyler2.TextStyler(textView, annotationModel, stylerAdapter); - } - return styler; - }); - } - - /** - * @name orion.highlight.SyntaxHighlighter - * @class - * @description - *

      Requires service {@link orion.core.ContentTypeRegistry}

      - * @param {orion.serviceregistry.ServiceRegistry} serviceRegistry Registry to look up highlight providers from. - * @param {orion.core.ContentType} [contentTypeService=null] A stand alone content type service that is not registered in theservice registry. - */ - function SyntaxHighlighter(serviceRegistry, contentTypeService) { - this.serviceRegistry = serviceRegistry; - this.contentTypeService = contentTypeService; - this.styler = null; - } - SyntaxHighlighter.prototype = /** @lends orion.highlight.SyntaxHighlighter.prototype */ { - /** - * @param {orion.core.ContentType} contentType - * @param {orion.editor.TextView} textView - * @param {orion.editor.AnnotationModel} annotationModel - * @param {String} [fileName] Deprecated. For backwards compatibility only, service-contributed highlighters - * will be checked against the file extension instead of contentType. - * @param {Boolean} [allowAsync=true] If true, plugin-contributed asynchronous highlighters (i.e. type == "highlighter" - * will be consulted. If false, only rule-based highlighters will be consulted. - * @returns {orion.Deferred} A promise that is resolved when this highlighter has been set up. - */ - setup: function(fileContentType, textView, annotationModel, fileName, allowAsync) { - allowAsync = typeof allowAsync === "undefined" ? true : allowAsync; //$NON-NLS-0$ - if (this.styler) { - if (this.styler.destroy) { - this.styler.destroy(); - } - this.styler = null; - } - var self = this; - return createStyler(this.serviceRegistry, this.contentTypeService ? this.contentTypeService : this.serviceRegistry.getService("orion.core.contentTypeRegistry"), //$NON-NLS-0$ - fileContentType, textView, annotationModel, fileName, allowAsync).then( - function(styler) { - self.styler = styler; - return styler; - }); - }, - getStyler: function() { - return this.styler; - } - }; - return { - createStyler: createStyler, - SyntaxHighlighter: SyntaxHighlighter - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/markOccurrences',[ - 'orion/Deferred' -], function(Deferred) { - - function MarkOccurrences(serviceRegistry, inputManager, editor) { - this.registry = serviceRegistry; - this.inputManager = inputManager; - this.editor = editor; - } - MarkOccurrences.prototype = { - /** - * Sets whether mark occurrences are shown. - * - * @param visible whether mark occurrences are shown - */ - setOccurrencesVisible: function(visible) { - if (this.occurrencesVisible === visible) { - return; - } - this.occurrencesVisible = visible; - if (!visible) { - this.editor.showOccurrences([]); - } - }, - /* Looks up applicable references of occurrence service, calls references, calls the editor to show the occurrences. */ - findOccurrences: function() { - function getServiceRefs(registry, contentType, title) { - var contentTypeService = registry.getService("orion.core.contentTypeRegistry"); //$NON-NLS-0$ - function getFilteredServiceRef(registry, sReference, contentType) { - var contentTypeIds = sReference.getProperty("contentType"); //$NON-NLS-0$ - return contentTypeService.isSomeExtensionOf(contentType, contentTypeIds).then(function(result) { - return result ? sReference : null; - }); - } - var serviceRefs = registry.getServiceReferences("orion.edit.occurrences"); //$NON-NLS-0$ - var filteredServiceRefs = []; - for (var i=0; i < serviceRefs.length; i++) { - var serviceRef = serviceRefs[i]; - var pattern = serviceRef.getProperty("pattern"); // backwards compatibility //$NON-NLS-0$ - if (serviceRef.getProperty("contentType")) { //$NON-NLS-0$ - filteredServiceRefs.push(getFilteredServiceRef(registry, serviceRef, contentType)); - } else if (pattern && new RegExp(pattern).test(title)) { - var d = new Deferred(); - d.resolve(serviceRef); - filteredServiceRefs.push(d); - } - } - - // Return a promise that gives the service references that aren't null - return Deferred.all(filteredServiceRefs, function(error) {return {_error: error}; }).then( - function(serviceRefs) { - var capableServiceRefs = []; - for (var i=0; i < serviceRefs.length; i++) { - var currentServiceRef = serviceRefs[i]; - if (currentServiceRef && !currentServiceRef._error) { - capableServiceRefs.push(currentServiceRef); - } - } - return capableServiceRefs; - }); - } - - var occurrenceTimer; - var that = this; - var selectionListener = function() { - if (occurrenceTimer) { - window.clearTimeout(occurrenceTimer); - } - if (!that.occurrencesVisible) { return; } - occurrenceTimer = window.setTimeout(function() { - occurrenceTimer = null; - var editor = that.editor; - var selections = editor.getSelections(); - if (selections.length > 1) { - that.editor.showOccurrences([]); - return; - } - var context = { - selection: selections[0], - contentType: that.inputManager.getContentType().id - }; - - if(Array.isArray(that.occurrencesServices) && that.occurrencesServices.length > 0) { - var servicePromises = []; - var allOccurrences = []; - for (var i=0; i 1 && charCount === model.getLineStart(model.getLineCount() - 1)) { - var prevLine = model.getLineCount() - 2, prevLineStart = model.getLineStart(prevLine), prevLineEnd = model.getLineEnd(prevLine); - if (prevLineStart === prevLineEnd) { - // Empty range on an empty line seems to be OK, if not at EOF - problem.start = problem.end = prevLineEnd; - } else { - problem.start = prevLineEnd - 1; - problem.end = prevLineEnd; - } - } - } - } - } - - /** - * @name orion.SyntaxChecker - * @class Provides access to validation services registered with the service registry. - * @description Provides access to validation services registered with the service registry. - */ - function SyntaxChecker(serviceRegistry, model) { - this.registry = serviceRegistry; - this.textModel = model; - } - - SyntaxChecker.prototype = /** @lends orion.SyntaxChecker.prototype */ { - /** - * @name initialize - * @description Allows providers that implement this function to pre-initisalize their state, etc, before being called later to actually perform validation - * @function - * @public - * @param {String} loc The location path to initialize from - * @param {Object} contentType The optional content type - * @since 12.0 - */ - initialize: function initialize(loc, contentType) { - if(!contentType) { - //initialize all of them - this.registry.getServiceReferences("orion.edit.validator").forEach(function(ref) { - var _v = this.registry.getService(ref); - if(_v && typeof _v.initialize === "function") { - _v.initialize(loc); - } - }.bind(this)); - return; - } - this.getValidators(loc, contentType).then(function(validators) { - if(Array.isArray(validators) && validators.length > 0) { - validators.forEach(function(validator) { - var _v = this.registry.getService(validator); - if(_v && typeof _v.initialize === "function") { - _v.initialize(loc, contentType); - } - }.bind(this)); - } - }.bind(this)); - }, - /** - * @description Looks up applicable validators, calls them to obtain problems, passes problems to the marker service. - * @function - * @public - * @param {Object} contentType The content type of the file to check - * @param {String} loc The fully qualified path of the file to check - * @param {String} message The message to display - * @param {String} contents The file contents to check - * @param {Object} editorContext The backing editor content to run with - * @returns {Array.} The array of problem objects or the empty array - * @see https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#The_Problem_object - */ - checkSyntax: function checkSyntax(contentType, loc, message, contents, editorContext) { - if (!contentType || message) { - return new Deferred().resolve([]); - } - if (!message) { - var serviceRegistry = this.registry; - return this.getValidators(loc, contentType).then(function(validators) { - if(validators.length === 0) { - return new Deferred().resolve(); - } - var progress = serviceRegistry.getService("orion.page.progress"); - var problemPromises = validators.map(function(validator) { - var service = serviceRegistry.getService(validator); - var promise; - if (service.computeProblems) { - var context = { - contentType: contentType.id, - title: loc - }; - promise = service.computeProblems(editorContext ? editorContext : EditorContext.getEditorContext(serviceRegistry), context); - } else if (service.checkSyntax) { - // Old API - promise = service.checkSyntax(loc, contents); - } - return progress.progress(promise, "Validating " + loc).then(extractProblems); - }); - - return Deferred.all(problemPromises, function(error) {return {_error: error}; }) - .then(function(results) { - var problems = []; - for (var i=0; i < results.length; i++) { - var probs = results[i]; - if (!probs._error) { - _fixup(probs, this.textModel); - problems = problems.concat(probs); - } - } - return new Deferred().resolve(problems); - //serviceRegistry.getService("orion.core.marker")._setProblems(problems); //$NON-NLS-0$ - }.bind(this)); - }.bind(this), - /* @callback */ function(err) { - return new Deferred().resolve([]); - }); - } - }, - /** - * @description Allows the text model to be set - * @function - * @public - * @param {editor.TextModel} model The new model to set - */ - setTextModel: function setTextModel(model) { - this.textModel = model; - }, - /** - * @name getValidators - * @description Returns the filtered list of validators that aply to the given location and content type - * @function - * @public - * @param {String} loc The location of the resource - * @param {Object} contentType The content type object - * @returns {Array.} The array of applicable validators or the empty array - * @since 12.0 - */ - getValidators: function getValidators(loc, contentType) { - var contentTypeService = this.registry.getService("orion.core.contentTypeRegistry"); //$NON-NLS-0$ - var validators = this.registry.getServiceReferences("orion.edit.validator"); //$NON-NLS-0$ - var filteredValidators = []; - for (var i=0; i < validators.length; i++) { - var serviceReference = validators[i]; - var pattern = serviceReference.getProperty("pattern"); // backwards compatibility //$NON-NLS-0$ - if (serviceReference.getProperty("contentType")) { //$NON-NLS-0$ - filteredValidators.push(getFilteredValidator(serviceReference, contentType, contentTypeService)); - } else if (pattern && new RegExp(pattern).test(loc)) { - var d = new Deferred(); - d.resolve(serviceReference); - filteredValidators.push(d); - } - } - // Return a promise that gives the validators that aren't null - return Deferred.all(filteredValidators, function(error) {return {_error: error}; }).then( - function(validators) { - var capableValidators = []; - for (i=0; i < validators.length; i++) { - var validator = validators[i]; - if (validator && !validator._error) { - capableValidators.push(validator); - } - } - return capableValidators; - }); - } - }; - return { - SyntaxChecker: SyntaxChecker - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2014 Pivotal Software Inc. and others - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: Pivotal Software Inc. - initial API and implementation - ******************************************************************************/ -/*eslint-env amd, browser*/ -define('orion/liveEditSession',[ - 'orion/Deferred' -], function(Deferred) { - - var resource; - var services = []; -// var previousEditSession; - - function handleError(err) { - return err instanceof Error ? err : new Error(err); - } - - /** - * @name orion.LiveEditSession - * @class Provides access to validation services registered with the service registry. - * @description Provides access to validation services registered with the service registry. - */ - function LiveEditSession(serviceRegistry, editor) { - this.registry = serviceRegistry; - this.editor = editor; - } - - LiveEditSession.prototype = /** @lends orion.LiveEditSession.prototype */ { - /** - * Looks up applicable live edit sessions, calls them to pass editor context to services. - */ - start: function (contentType, title) { - function getLiveEditors(registry, contentType) { - var contentTypeService = registry.getService("orion.core.contentTypeRegistry"); //$NON-NLS-0$ - function getFilteredLiveEditSession(liveEditSession, contentType) { - var contentTypeIds = liveEditSession.getProperty("contentType"); //$NON-NLS-0$ - return contentTypeService.isSomeExtensionOf(contentType, contentTypeIds).then(function(result) { - return result ? liveEditSession : null; - }); - } - var liveEditSessions = registry.getServiceReferences("orion.edit.live"); //$NON-NLS-0$ - var filteredLiveEditSessions = []; - for (var i=0; i < liveEditSessions.length; i++) { - var serviceReference = liveEditSessions[i]; - if (serviceReference.getProperty("contentType")) { //$NON-NLS-0$ - filteredLiveEditSessions.push(getFilteredLiveEditSession(serviceReference, contentType)); - } - } - // Return a promise that gives the live edit sessions that aren't null - return Deferred.all(filteredLiveEditSessions, handleError).then(function(liveEditSessions) { - var capableLiveEditSessions = []; - for (var i=0; i < liveEditSessions.length; i++) { - var liveEdit = liveEditSessions[i]; - if (liveEdit && !(liveEdit instanceof Error)) { - capableLiveEditSessions.push(liveEdit); - } - } - return capableLiveEditSessions; - }); - } - - if (resource !== title) { - if (services) { - services.forEach(function(service) { - service.endEdit(resource); - }); - } - services = []; - resource = title; - if (!contentType) { - return; - } - var editor = this.editor; - var serviceRegistry = this.registry; - getLiveEditors(serviceRegistry, contentType).then(function(liveEditors) { - var editSessionPromises = liveEditors.map(function(liveEditor) { - var service = serviceRegistry.getService(liveEditor); - if (service.startEdit) { - var context = { - contentType: contentType.id, - title: title - }; - services.push(service); - var editorContext = editor.getEditorContext(); - return service.startEdit(editorContext, context); - } - }); - - /*previousEditSession =*/ Deferred.all(editSessionPromises, handleError); - }); - } - } - }; - - return LiveEditSession; -}); -/******************************************************************************* - * @license - * Copyright (c) 2010, 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/problems',["orion/EventTarget"], function(EventTarget) { - - /** - * Creates a new problem service instance. Client should obtain the service - * orion.core.marker from the service registry rather than instantiate - * this service directly. - * @class The problem service tracks markers and sends notification of marker changes. - * @name orion.problems.ProblemService - */ - function ProblemService(serviceRegistry, serviceID) { - this._serviceRegistry = serviceRegistry; - EventTarget.attach(this); - this._serviceRegistration = serviceRegistry.registerService(serviceID || "orion.core.marker", this); //$NON-NLS-0$ - } - - ProblemService.prototype = /** @lends orion.problems.ProblemService.prototype */ { - // provider - _setProblems: function(problems) { - this.problems = problems; - this.dispatchEvent({type:"problemsChanged", problems:problems}); //$NON-NLS-0$ - } - }; - ProblemService.prototype.constructor = ProblemService; - - //return the module exports - return {ProblemService: ProblemService}; -}); - - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ - -define ('orion/blamer',[ - 'orion/extensionCommands', //$NON-NLS-0$ - 'orion/PageLinks', //$NON-NLS-0$ - 'orion/URITemplate' //$NON-NLS-0$ -], function(mExtensionCommands, PageLinks, URITemplate) { - - function Blamer(serviceRegistry, inputManager, editor) { - this.serviceRegistry = serviceRegistry; - this.inputManager = inputManager; - this.editor = editor; - } - - Blamer.prototype = { - getBlamer: function() { - var metadata = this.inputManager.getFileMetadata(); - var blamers = this.serviceRegistry.getServiceReferences("orion.edit.blamer"); //$NON-NLS-0$ - for (var i=0; i < blamers.length; i++) { - var serviceReference = blamers[i]; - var info = {}; - info.validationProperties = serviceReference.getProperty("validationProperties"); //$NON-NLS-0$ - info.forceSingleItem = true; - var validator = mExtensionCommands._makeValidator(info, this.serviceRegistry); - if (validator.validationFunction.bind(validator)(metadata)) { - return this.serviceRegistry.getService(serviceReference); - } - } - return null; - }, - - isVisible: function() { - return !!this.getBlamer(); - }, - - doBlame: function() { - var service = this.getBlamer(); - if (service) { - var handleResult = function(results) { - var orionHome = PageLinks.getOrionHome(); - for (var i=0; i 0){ - console.log(" **Diff content on change/add: \n"); //$NON-NLS-0$ - for(var j = 0;j < this._deltaMap[i][0] ; j++){ - console.log(" " + this._diffContents[this._deltaMap[i][2]+j-1]); //$NON-NLS-0$ - } - } - } - }, - - _logNewFile: function(){ - for(var i = 0;i < this._nFileContents.length ; i++){ - console.log(this._nFileContents[i]); - } - }, - - _createBlock: function(token , blocks , startAtLine , endAtLine){ - if(endAtLine === startAtLine && token === " "){ //$NON-NLS-0$ - return; - } - var block = [startAtLine , endAtLine - startAtLine ,"s" ]; //$NON-NLS-0$ - if(token === "-"){ //$NON-NLS-0$ - block[2] = "r"; //$NON-NLS-0$ - } else if(token === "+"){ //$NON-NLS-0$ - block[2] = "a"; //$NON-NLS-0$ - } else if(token === "c"){ //$NON-NLS-0$ - block[2] = "c"; //$NON-NLS-0$ - } - blocks.push(block); - }, - - _createMinusBlock: function(oBlkStart , nBlkStart , oBlockLength, lastMinusPos){ - var len = this._oBlocks.length; - if(len === 0 || oBlkStart !== this._oBlocks[len-1][0]){ - this._oBlocks.push([oBlkStart === 0 ? 1 : oBlkStart , oBlockLength, lastMinusPos]); - this._nBlocks.push([nBlkStart , 0 , -2]); - } else { - this._oBlocks[len-1][1] = this._oBlocks[len-1][1] + oBlockLength; - this._oBlocks[len-1][2] = lastMinusPos; - } - }, - - _createPlusBlock: function(oBlkStart , nBlkStart , nBlockLength , lastPlusPos ){ - var len = this._nBlocks.length; - if(len === 0 || nBlkStart !== this._nBlocks[len-1][0]){ - this._oBlocks.push([oBlkStart === 0 ? 1 : oBlkStart , 0]); - this._nBlocks.push([nBlkStart , nBlockLength , lastPlusPos]); - } else { - this._nBlocks[len-1][1] = this._nBlocks[len-1][1] + nBlockLength; - this._nBlocks[len-1][2] = lastPlusPos; - } - }, - - //read line by line in a hunk range - _parseHunkBlock: function(hunkRangeNo ){ - var lastToken = " "; //$NON-NLS-0$ - var startNo = this._hunkRanges[hunkRangeNo][0] + 1; - var endNo = (hunkRangeNo === (this._hunkRanges.length - 1) ) ? this._diffContents.length : this._hunkRanges[hunkRangeNo+1][0]; - - var oCursor = 0; - var nCursor = 0; - var oBlkStart = this._hunkRanges[hunkRangeNo][1]; - var nBlkStart = this._hunkRanges[hunkRangeNo][3]; - var lastPlusPos = startNo; - var lastMinusPos = startNo; - for (var i = startNo ; i< endNo ; i++){ - if( 0 === this._diffContents[i].length){ - continue; - } - var curToken = this._diffContents[i][0]; - if(curToken === "\\"){ //$NON-NLS-0$ - if( NO_NEW_LINE === this._diffContents[i].substring(0 , this._diffContents[i].length-1) || - NO_NEW_LINE === this._diffContents[i]){ - if(lastToken === "-"){ //$NON-NLS-0$ - this._oNewLineAtEnd = false; - } else if(lastToken === " "){ //$NON-NLS-0$ - this._nNewLineAtEnd = false; - this._oNewLineAtEnd = false; - } else { - this._nNewLineAtEnd = false; - } - if(i > startNo && this._diffContents[i-1][this._diffContents[i-1].length-1] === "\r"){ //$NON-NLS-0$ - this._diffContents[i-1] = this._diffContents[i-1].substring(0 , this._diffContents[i-1].length-1); - } - continue; - } - } - switch(curToken){ - case "-": //$NON-NLS-0$ - case "+": //$NON-NLS-0$ - case " ": //$NON-NLS-0$ - break; - default: - continue; - } - - if(lastToken !== curToken){ - if(curToken === "+"){ //$NON-NLS-0$ - lastPlusPos = i; - } - if(curToken === "-"){ //$NON-NLS-0$ - lastMinusPos = i; - } - switch(lastToken){ - case " ": //$NON-NLS-0$ - oBlkStart = this._hunkRanges[hunkRangeNo][1] + oCursor; - nBlkStart = this._hunkRanges[hunkRangeNo][3] + nCursor; - break; - case "-": //$NON-NLS-0$ - this._createMinusBlock(oBlkStart , nBlkStart ,this._hunkRanges[hunkRangeNo][1] + oCursor - oBlkStart, lastMinusPos); - break; - case "+": //$NON-NLS-0$ - this._createPlusBlock(oBlkStart , nBlkStart ,this._hunkRanges[hunkRangeNo][3] + nCursor - nBlkStart , lastPlusPos); - break; - default: - } - lastToken = curToken; - } - - switch(curToken){ - case "-": //$NON-NLS-0$ - oCursor++; - break; - case "+": //$NON-NLS-0$ - nCursor++; - break; - case " ": //$NON-NLS-0$ - oCursor++; - nCursor++; - break; - } - } - switch(lastToken){ - case "-": //$NON-NLS-0$ - this._createMinusBlock(oBlkStart , nBlkStart ,this._hunkRanges[hunkRangeNo][1] + oCursor - oBlkStart, lastMinusPos); - break; - case "+": //$NON-NLS-0$ - this._createPlusBlock(oBlkStart , nBlkStart ,this._hunkRanges[hunkRangeNo][3] + nCursor - nBlkStart , lastPlusPos); - break; - } - }, - - _detectConflictes: function(startIndexInDiff , lines){ - if(startIndexInDiff < 0){ - return false; - } - var endIndex = startIndexInDiff + lines; - for(var i = startIndexInDiff ; i < endIndex ; i++){ - var line = this._diffContents[i]; - if(line.indexOf("<<<<<") > -1 || line.indexOf(">>>>>") > -1){ //$NON-NLS-1$ //$NON-NLS-0$ - return true; - } - } - return false; - }, - - _buildMap: function(detectConflicts){ - var blockLen = this._oBlocks.length; - var oFileLen = this._oFileContents.length; - var oFileLineCounter = 0; - var delta, lastSamePos = 1; - for(var i = 0 ; i < blockLen ; i++){ - delta = this._oBlocks[i][0] - lastSamePos; - //Create the "same on both" delta - if(delta > 0){ - this._deltaMap.push([delta , delta , 0]); - oFileLineCounter += delta; - } - if(detectConflicts && this._detectConflictes(this._nBlocks[i][2] , this._nBlocks[i][1])){ - this._deltaMap.push([this._nBlocks[i][1] , this._oBlocks[i][1] , this._nBlocks[i][2]+1 , 1]); - } else { - this._deltaMap.push([this._nBlocks[i][1] , this._oBlocks[i][1] , this._nBlocks[i][2]+1]); - } - oFileLineCounter += this._oBlocks[i][1]; - lastSamePos = this._oBlocks[i][0] + this._oBlocks[i][1]; - } - if(0 < (oFileLen - lastSamePos)){ - this._deltaMap.push([oFileLen - lastSamePos+1 , oFileLen - lastSamePos+1 , 0]); - oFileLineCounter += (oFileLen - lastSamePos+1); - } - if(oFileLineCounter < oFileLen){ - delta = oFileLen - oFileLineCounter; - var lastMapItem = this._deltaMap[this._deltaMap.length-1]; - if(lastMapItem[2] === 0){ - lastMapItem[0] += delta; - lastMapItem[1] += delta; - } else if (lastMapItem[2] === -1){ - this._deltaMap.push([delta , delta , 0]); - } else if(this._nNewLineAtEnd === this._oNewLineAtEnd){ - this._deltaMap.push([delta , delta , 0]); - } else { - if(this._nNewLineAtEnd){ - lastMapItem[0] += delta; - } - if(this._oNewLineAtEnd){ - lastMapItem[1] += delta; - } - } - } - }, - - _buildNewFile: function(){ - var oFileCursor = 1; - var lastUpdateBySameBlk = false; - var len = this._deltaMap.length; - var i, j; - for(i = 0;i < len ; i++){ - lastUpdateBySameBlk = false; - if(this._deltaMap[i][2] === 0){ - for(j = 0;j < this._deltaMap[i][0] ; j++){ - this._nFileContents.push(this._oFileContents[oFileCursor+j-1]); - } - lastUpdateBySameBlk = true; - } else if(this._deltaMap[i][2] > 0){ - for(j = 0;j < this._deltaMap[i][0] ; j++){ - this._nFileContents.push(this._diffContents[this._deltaMap[i][2]+j-1].substring(1)); - } - } - oFileCursor = oFileCursor + this._deltaMap[i][1]; - } - if(this._nNewLineAtEnd && !lastUpdateBySameBlk){ - this._nFileContents.push(""); - //this._deltaMap[len-1][0] = this._deltaMap[len-1][0] + 1; - } - }, - - //In many versions of GNU diff, each range can omit the comma and trailing value s, in which case s defaults to 1. - _converHRangeBody: function(body , retVal){ - if( body ){ - var number = parseInt(body, 10); - retVal.push( number >= 0 ? number : 1); - } else { - retVal.push(1); - } - }, - - //The hunk range information contains two hunk ranges. - //The range for the hunk of the original file is preceded by a minus symbol, and the range for the new file is preceded by a plus symbol. - //Each hunk range is of the format l,s where l is the starting line number and s is the number of lines the change hunk applies to for each respective file. - //In many versions of GNU diff, each range can omit the comma and trailing value s, in which case s defaults to 1. - //Note that the only really interesting value is the l line number of the first range; all the other values can be computed from the diff. - /* - * return value : - * [lineNumberInDiff , OriginalL , OriginalS , NewL ,NewS] , no matter "-l,s +l,s" or "+l,s -l,s" - */ - _parseHunkRange: function(lineNumber){ - var oneLine = this._diffContents[lineNumber]; - var regex = /^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/;// Pattern : "@@-l,s +l,s@@" or "@@-l,s +l@@" or "@@-l +l,s@@" or even "@@--l,s +-l,s@@" - var regexReverse = /^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/;// Pattern : "@@+l,s -l,s@@" or "@@+l,s -l@@" or "@@+l -l,s@@" or even "@@+-l,s --l,s@@" - var match = regex.exec(oneLine); - var retVal = null; - if(match && match.length === 5) { - retVal = [lineNumber]; - this._converHRangeBody(match[1], retVal); - this._converHRangeBody(match[2], retVal); - this._converHRangeBody(match[3], retVal); - this._converHRangeBody(match[4], retVal); - } else { - match = regexReverse.exec(oneLine); - if(match && match.length === 5) { - retVal = [lineNumber]; - this._converHRangeBody(match[3], retVal); - this._converHRangeBody(match[4], retVal); - this._converHRangeBody(match[1], retVal); - this._converHRangeBody(match[2], retVal); - } - } - return retVal; - } - - }; - return DiffParser; -}()); -return orion; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ - -define('orion/differ',[ - 'orion/extensionCommands', //$NON-NLS-0$ - 'orion/compare/diffParser' //$NON-NLS-0$ -], function(mExtensionCommands, mDiffParser) { - - function Differ(serviceRegistry, inputManager, editor) { - this._serviceRegistry = serviceRegistry; - this._inputManager = inputManager; - this._editor = editor; - this._enabled = false; - this.init(); - } - - Differ.prototype = { - init: function(){ - var that = this; - this._changeListener = function() { - if (that._enabled) { - if (that.occurrenceTimer) { - window.clearTimeout(that.occurrenceTimer); - } - that.occurrenceTimer = window.setTimeout(function() { - that.occurrenceTimer = null; - that.doDiff(); - }, 500); - } - }; - this._inputManager.addEventListener("InputChanged", function() { //$NON-NLS-0$ - var textView = that._editor.getTextView(); - if (textView) { - textView.removeEventListener("ModelChanged", that._changeListener); //$NON-NLS-0$ - } - var service = that.service = that.getDiffer(); - if (service) { - if (textView) { - textView.addEventListener("ModelChanged", that._changeListener); //$NON-NLS-0$ - } - } - }); - }, - - isVisible: function() { - return !!this.getDiffer(); - }, - - getDiffer: function(){ - var metadata = this._inputManager.getFileMetadata(); - var diffServices = this._serviceRegistry.getServiceReferences("orion.edit.diff"); //$NON-NLS-0$ - for (var i = 0; i < diffServices.length; i++) { - var serviceReference = diffServices[i]; - var info = {}; - info.validationProperties = serviceReference.getProperty("validationProperties"); //$NON-NLS-0$ - info.forceSingleItem = true; - var validator = mExtensionCommands._makeValidator(info, this._serviceRegistry); - if (validator.validationFunction.bind(validator)(metadata)) { - return this._serviceRegistry.getService(serviceReference); - } - } - return null; - }, - - showAnnotations: function(service){ - var that = this; - var diffParser = new mDiffParser.DiffParser(); - var context = { - metadata: this._inputManager.getFileMetadata() - }; - service.computeDiff(this._editor.getEditorContext(), context).then(function(diffContent) { - diffParser.setLineDelim("\n"); //$NON-NLS-0$ - diffParser.parse("", diffContent); - var oBlocks = diffParser.getOriginalBlocks(); - var nBlocks = diffParser.getNewBlocks(); - var diffArray = diffParser.getDiffArray(); - var diffRanges = that.getDiffRanges(oBlocks, nBlocks, diffArray); - if(that._enabled){//for cases when user turns off diffService computing diff - that._editor.showDiffAnnotations(diffRanges); - } - }); - }, - - getDiffRanges: function(originalHunkBlocks, newHunkBlocks){ - var diffResult = []; - for (var i = 0; i < newHunkBlocks.length; i++) { - var lineStart = newHunkBlocks[i][0]; - var oldSize = originalHunkBlocks[i][1]; - var newSize = newHunkBlocks[i][1]; - if (newSize === 0) { - diffResult.push({ - lineStart: lineStart - 1, - lineEnd: lineStart, - type:"deleted" //$NON-NLS-0$ - }); - } else if (oldSize === 0) { - diffResult.push({ - lineStart: lineStart - 1, - lineEnd: lineStart + newSize - 1, - type:"added" //$NON-NLS-0$ - }); - } else { - diffResult.push({ - lineStart: lineStart - 1, - lineEnd: lineStart + newSize - 1, - type:"modified" //$NON-NLS-0$ - }); - } - } - return diffResult; - }, - - toggleEnabled: function(){ - this.setEnabled(!this.isEnabled()); - }, - - setEnabled: function(state){ - this._enabled = state; - this.doDiff(); - }, - - isEnabled: function(){ - return this._enabled; - }, - - doDiff: function() { - if (!this._enabled) { - this._editor.showDiffAnnotations([]); - } else { - if (this.service) { - var that = this; - this._inputManager.save().then(function() { - that.showAnnotations(that.service); - }); - } - } - } - - }; - - Differ.prototype.constructor = Differ; - - //return the module exports - return {Differ: Differ}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/webui/contextmenu',[ - 'orion/webui/littlelib', - 'orion/webui/dropdown', - 'orion/objects' -], function(lib, mDropdown, objects) { - - var Dropdown = mDropdown.Dropdown; - - /** - * @class orion.webui.ContextMenu - * @extends orion.webui.Dropdown - * - * Attaches context menu behavior to a given node. - * - * @see orion.webui.Dropdown for more documentation - * - * @name orion.webui.contextmenu.ContextMenu - * - */ - function ContextMenu(options) { - options.skipTriggerEventListeners = true; //we want different event listeners on the trigger node - Dropdown.call(this, options); //invoke super constructor - this._initialize(); - } - - ContextMenu.prototype = Object.create(Dropdown.prototype); - ContextMenu.prototype.constructor = ContextMenu; - - objects.mixin(ContextMenu.prototype, /** @lends orion.webui.contextmenu.ContextMenu.prototype */ { - - _initialize: function() { - if (!this._dropdownNode.dropdown) { - //used by commandRegistry to set the parentNode of a child dropdown menu - this._dropdownNode.dropdown = this; - } - - //add context menu event handlers - this._boundcontextmenuEventHandler = this._contextmenuEventHandler.bind(this); - this._boundContextMenuCloser = this._contextMenuCloser.bind(this); - this._triggerNode.addEventListener("contextmenu", this._boundcontextmenuEventHandler, true); //$NON-NLS-0$ - window.addEventListener("contextmenu", this._boundContextMenuCloser, false); //$NON-NLS-0$ - }, - - _contextMenuCloser: function(event){ - this.close(event); - }, - - _contextmenuEventHandler: function(event){ - if (this.open(event)) { - lib.stop(event); - } else { - this.close(); - } - }, - }); - - // overrides Dropdown.protoype.open - ContextMenu.prototype.open = function(event) { - //clicking on the trigger node should close the context menu - this._triggerNode.addEventListener("click", this._boundContextMenuCloser, false);//$NON-NLS-0$ - - return Dropdown.prototype.open.call(this, event); //call function in super class - }; - - // overrides Dropdown.protoype.close - ContextMenu.prototype.close = function(restoreFocus) { - this._triggerNode.removeEventListener("click", this._boundContextMenuCloser, false); //$NON-NLS-0$ - - return Dropdown.prototype.close.call(this, restoreFocus); //call function in super class - }; - - // overrides Dropdown.protoype._positionDropdown - ContextMenu.prototype._positionDropdown = function(mouseEvent) { - if (mouseEvent) { - var mouseLeft = mouseEvent.clientX; - var mouseTop = mouseEvent.clientY; - - // we want the position to be relative to the mouse event - this._dropdownNode.style.position = "fixed"; //$NON-NLS-0$ - - // set the initial position - this._dropdownNode.style.left = (mouseLeft + 1) + "px"; //$NON-NLS-0$ - this._dropdownNode.style.top = mouseTop + "px"; //$NON-NLS-0$ - - // ensure that the menu fits on the page... - var bounds = lib.bounds(this._dropdownNode); - var width = bounds.width; - var height = bounds.height; - var bodyBounds = lib.bounds(document.body); - - //ensure menu fits on page horizontally - var overflowX = (mouseLeft + width) - (bodyBounds.left + bodyBounds.width); - if (0 < overflowX) { - this._dropdownNode.style.left = Math.floor(mouseLeft - overflowX) + "px"; //$NON-NLS-0$ - } - - //ensure menu fits on page vertically - var overflowY = (mouseTop + height) - (bodyBounds.top + bodyBounds.height); - if (0 < overflowY) { - this._dropdownNode.style.top = Math.floor(mouseTop - overflowY) + "px"; //$NON-NLS-0$ - } - } else { - Dropdown.prototype._positionDropdown.call(this); //call function in super class - } - }; - - // overrides Dropdown.protoype.destroy - ContextMenu.prototype.destroy = function() { - this._triggerNode.removeEventListener("contextmenu", this._boundcontextmenuEventHandler, true); //$NON-NLS-0$ - this._triggerNode.removeEventListener("click", this._boundContextMenuCloser, false); //$NON-NLS-0$ - window.removeEventListener("contextmenu", this._boundContextMenuCloser, false); //$NON-NLS-0$ - this._dropdownNode.dropdown = null; - Dropdown.prototype.destroy.call(this); //call function in super class - }; - - //return the module exports - return {ContextMenu: ContextMenu}; -}); -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ - -define('orion/commonPreferences',[ - 'orion/EventTarget' -], function(EventTarget) { - function mergeSettings(defaults, settings) { - for (var property in defaults) { - if (!settings.hasOwnProperty(property)) { - settings[property] = defaults[property]; - } - } - return settings; - } - - function CommonPreferences(preferences, callback) { - this._preferences = preferences; - EventTarget.attach(this); - preferences.addEventListener("changed", function (e) { - if (e.namespace === this.getPrefsSection()) { - this.dispatchEvent({type: "Changed"}); //$NON-NLS-0$ - } - }.bind(this)); - if (callback) { - this.addEventListener("Changed", function(evt) { //$NON-NLS-0$ - callback(evt.preferences); - }); - } - } - - CommonPreferences.prototype = /** @lends edit.EditorPreferences.prototype */ { - _initialize: function(prefs) { - var settings = prefs[this.getPrefsKey()] || {}; - var defaults = this.getDefaults(); - return mergeSettings(defaults, settings); - }, - getDefaults: function() { - return {}; - }, - getPrefsSection: function() { - return "common/settings"; //$NON-NLS-0$ - }, - getPrefsKey: function() { - return "commonSettings"; //$NON-NLS-0$ - }, - getPrefs: function(callback) { - return this._preferences.get(this.getPrefsSection()).then(function(prefs) { - var object = this._initialize(prefs); - if (typeof object === "string") { //$NON-NLS-0$ - object = JSON.parse(object); - } - if (callback) { - callback(object); - } - return object; - }.bind(this)); - }, - setPrefs: function(object, callback) { - var data = {}; - data[this.getPrefsKey()] = object; - this._preferences.put(this.getPrefsSection(), data).then(function() { - object = this._initialize(data); - if (callback) { - callback(object); - } - this.dispatchEvent({type: "Changed", preferences: object}); //$NON-NLS-0$ - }.bind(this)); - } - }; - - return { CommonPreferences: CommonPreferences, - mergeSettings: mergeSettings}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/*eslint-env browser, amd*/ -define('orion/editorView',[ - 'i18n!orion/edit/nls/messages', - 'orion/editor/editor', - 'orion/editor/eventTarget', - 'orion/editor/textView', - 'orion/editor/textModelFactory', - 'orion/editor/editorFeatures', - 'orion/hover', - 'orion/editor/contentAssist', - 'orion/editor/emacs', - 'orion/editor/vi', - 'orion/editorPreferences', - 'orion/widgets/themes/ThemePreferences', - 'orion/widgets/themes/editor/ThemeData', - 'orion/widgets/settings/EditorSettings', - 'orion/searchAndReplace/textSearcher', - 'orion/editorCommands', - 'orion/globalCommands', - 'orion/edit/dispatcher', - 'orion/edit/editorContext', - 'orion/highlight', - 'orion/markOccurrences', - 'orion/syntaxchecker', - 'orion/liveEditSession', - 'orion/problems', - 'orion/blamer', - 'orion/differ', - 'orion/keyBinding', - 'orion/util', - 'orion/Deferred', - 'orion/webui/contextmenu', - 'orion/metrics', - 'orion/commonPreferences', - 'embeddedEditor/helper/memoryFileSysConst', - 'orion/objects' -], function( - messages, - mEditor, mEventTarget, mTextView, mTextModelFactory, mEditorFeatures, mHoverFactory, mContentAssist, - mEmacs, mVI, mEditorPreferences, mThemePreferences, mThemeData, EditorSettings, - mSearcher, mEditorCommands, mGlobalCommands, - mDispatcher, EditorContext, Highlight, - mMarkOccurrences, mSyntaxchecker, LiveEditSession, - mProblems, mBlamer, mDiffer, - mKeyBinding, util, Deferred, mContextMenu, mMetrics, mCommonPreferences, memoryFileSysConst, objects -) { - var inMemoryFilePattern = memoryFileSysConst.MEMORY_FILE_PATTERN; - var Dispatcher = mDispatcher.Dispatcher; - - function parseNumericParams(input, params) { - for (var i = 0; i < params.length; i++) { - var param = params[i]; - if (input[param]) { - input[param] = parseInt(input[param], 10); - } - } - } - - /** - * Constructs a new EditorView object. - * - * @class - * @name orion.EditorView - * @borrows orion.editor.EventTarget#addEventListener as #addEventListener - * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener - * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent - */ - function EditorView(options) { - this._parent = options.parent; - if(typeof this._parent === "string") { - this._parent = document.getElementById(options.parent); - } - this.id = options.id || ""; - this.activateContext = options.activateContext; - this.renderToolbars = options.renderToolbars; - this.serviceRegistry = options.serviceRegistry; - this.contentTypeRegistry = options.contentTypeRegistry; - this.commandRegistry = options.commandRegistry; - this.progress = options.progress; - this.statusService = options.statusService; - this.editorCommands = options.editorCommands; - this.fileClient = options.fileService; - this.inputManager = options.inputManager; - this.preferences = options.preferences; - this.readonly = options.readonly; - this.searcher = options.searcher; - this.statusReporter = options.statusReporter; - this.model = options.model; - this.undoStack = options.undoStack; - this.problemsServiceID = options.problemsServiceID || "orion.core.marker"; //$NON-NLS-0$ - this.editContextServiceID = options.editContextServiceID || "orion.edit.context"; //$NON-NLS-0$ - this.syntaxHighlighter = new Highlight.SyntaxHighlighter(this.serviceRegistry); - var keyAssist = mGlobalCommands.getKeyAssist ? mGlobalCommands.getKeyAssist() : null; - if(keyAssist) { - keyAssist.addProvider(this.editorCommands); - } - var mainSplitter = mGlobalCommands.getMainSplitter ? mGlobalCommands.getMainSplitter() : null; - if(mainSplitter) { - mainSplitter.splitter.addEventListener("resize", function (evt) { - if (this.editor && evt.node === mainSplitter.main) { - this.editor.resize(); - } - }.bind(this)); - } - if(mGlobalCommands.getGlobalEventTarget) { - mGlobalCommands.getGlobalEventTarget().addEventListener("toggleTrim", function() { - if (this.editor) { - this.editor.resize(); - } - }.bind(this)); - } - this.settings = {}; - this._editorConfig = options.editorConfig; - this._init(); - } - EditorView.prototype = /** @lends orion.EditorView.prototype */ { - updateKeyMode: function(prefs, textView) { - if (this.emacs) { - textView.removeKeyMode(this.emacs); - } - if (this.vi) { - textView.removeKeyMode(this.vi); - } - if (prefs.keyBindings === "Emacs") { - if (!this.emacs) { - this.emacs = new mEmacs.EmacsMode(textView); - } - textView.addKeyMode(this.emacs); - } else if (prefs.keyBindings === "vi") { - if (!this.vi) { - this.vi = new mVI.VIMode(textView, this.statusReporter); - } - textView.addKeyMode(this.vi); - } - }, - setContents: function(contents, contentType) { - var cType = this.contentTypeRegistry.getContentType(contentType); - var fileExt = "txt"; //$NON-NLS-1$ - if(cType && cType.extension && cType.extension.length > 0) { - fileExt = cType.extension[0]; - } - var currentLocation = inMemoryFilePattern + this.id + "/foo." + fileExt; //$NON-NLS-1$ - var def; - var sameFile = currentLocation === this.lastFileLocation; - if(sameFile || !this.lastFileLocation) { - def = new Deferred().resolve(); - } else { - def = this.fileClient.deleteFile(this.lastFileLocation); - } - return def.then(function() { - return this.fileClient.write(currentLocation, contents).then(function(){ - this.lastFileLocation = currentLocation; - if (sameFile) { - this.inputManager.load(); - } else { - this.inputManager.setInput(currentLocation); - } - }.bind(this)); - }.bind(this)); - }, - getParent: function() { - return this._parent; - }, - getSettings: function() { - return this.settings; - }, - setParent: function(p) { - this._parent = p; - }, - updateSourceCodeActions: function(prefs, sourceCodeActions) { - if (sourceCodeActions) { - sourceCodeActions.setAutoPairParentheses(prefs.autoPairParentheses); - sourceCodeActions.setAutoPairBraces(prefs.autoPairBraces); - sourceCodeActions.setAutoPairSquareBrackets(prefs.autoPairSquareBrackets); - sourceCodeActions.setAutoPairAngleBrackets(prefs.autoPairAngleBrackets); - sourceCodeActions.setAutoPairQuotations(prefs.autoPairQuotations); - sourceCodeActions.setAutoCompleteComments(prefs.autoCompleteComments); - sourceCodeActions.setSmartIndentation(prefs.smartIndentation); - } - }, - updateViewOptions: function(prefs) { - var marginOffset = 0; - if (prefs.showMargin) { - marginOffset = prefs.marginOffset; - if (typeof marginOffset !== "number") { - marginOffset = prefs.marginOffset = parseInt(marginOffset, 10); - } - } - var wrapOffset = 0; - if (prefs.wordWrap) { - wrapOffset = marginOffset; - } - return { - readonly: this.readonly || this.inputManager.getReadOnly(), - tabSize: prefs.tabSize || 4, - expandTab: prefs.expandTab, - wrapMode: prefs.wordWrap, - wrapOffset: wrapOffset, - marginOffset: marginOffset, - scrollAnimation: prefs.scrollAnimation ? prefs.scrollAnimationTimeout : 0 - }; - }, - updateSettings: function(prefs) { - this.settings = prefs; - var editor = this.editor; - var inputManager = this.inputManager; - inputManager.setAutoLoadEnabled(prefs.autoLoad); - inputManager.setAutoSaveTimeout(prefs.autoSave ? prefs.autoSaveTimeout : -1); - if(this.differ) { - inputManager.setSaveDiffsEnabled(prefs.saveDiffs); - this.differ.setEnabled(this.settings.diffService); - } - this.updateStyler(prefs); - var textView = editor.getTextView(); - if (textView) { - this.updateKeyMode(prefs, textView); - textView.setOptions(this.updateViewOptions(prefs)); - } - this.updateSourceCodeActions(prefs, editor.getSourceCodeActions()); - editor.setAnnotationRulerVisible(prefs.annotationRuler); - editor.setLineNumberRulerVisible(prefs.lineNumberRuler); - editor.setFoldingRulerVisible(prefs.foldingRuler); - editor.setOverviewRulerVisible(prefs.overviewRuler); - editor.setZoomRulerVisible(prefs.zoomRuler); - if (this.renderToolbars) { - this.renderToolbars(inputManager.getFileMetadata()); - } - this.markOccurrences.setOccurrencesVisible(prefs.showOccurrences); - if (editor.getContentAssist()) { - editor.getContentAssist().setAutoTriggerEnabled(prefs.contentAssistAutoTrigger); - } - - this.dispatchEvent({ - type: "Settings", //$NON-NLS-0$ - newSettings: this.settings - }); - }, - updateStyler: function(prefs) { - var styler = this.syntaxHighlighter.getStyler(); - if (styler) { - if (styler.setWhitespacesVisible) { - styler.setWhitespacesVisible(prefs.showWhitespaces, true); - } - } - }, - createSession: function(evt) { - var editor = this.editor; - var textView = editor.getTextView(); - var inputManager = this.inputManager; - if (textView && inputManager) { - var metadata = inputManager.getFileMetadata(); - if (metadata) { - evt.session = { - get: function() { - return sessionStorage.editorViewSection ? JSON.parse(sessionStorage.editorViewSection) : {}; - }, - apply: function(animate) { - if (!metadata.Location) return; - var session = this.get(); - var locationSession = session[metadata.Location]; - if (locationSession && locationSession.ETag === metadata.ETag) { - editor.setSelections(locationSession.selections); - textView.setTopIndex(locationSession.topIndex, animate ? function() {} : undefined); - } - }, - save: function() { - if (!metadata.Location) return; - var session = this.get(); - session[metadata.Location] = { - ETag: metadata.ETag, - topIndex: textView.getTopIndex(), - selections: editor.getSelections().map(function(s) { return s.getOrientedSelection(); }) - }; - sessionStorage.editorViewSection = JSON.stringify(session); - } - }; - } - } - }, - _init: function() { - if (this.preferences) { - // There should be only one editor preferences - this.editorCommands.editorPreferences = this.editorPreferences = this.editorCommands.editorPreferences || new mEditorPreferences.EditorPreferences(this.preferences); - this.editorPreferences.addEventListener("Changed", function (evt) { - var prefs = evt.preferences; - if (!prefs) { - this.editorPreferences.getPrefs(this.updateSettings.bind(this)); - } else { - this.updateSettings(prefs); - } - }.bind(this)); - // There should be only one theme preferences - this.editorCommands.themePreferences = this.themePreferences = this.editorCommands.themePreferences || new mThemePreferences.ThemePreferences(this.preferences, new mThemeData.ThemeData()); - this.themePreferences.apply(); - } - - var that = this; - - var readonly = this.readonly; - var commandRegistry = this.commandRegistry; - var serviceRegistry = this.serviceRegistry; - var activateContext = this.activateContext; - var inputManager = this.inputManager; - var progress = this.progress; - var contentTypeRegistry = this.contentTypeRegistry; - var editorCommands = this.editorCommands; - - var textViewFactory = function() { - var options = that.updateViewOptions(that.settings); - objects.mixin(options, { - parent: that._parent, - model: new mTextModelFactory.TextModelFactory().createProjectionTextModel(that.model, {serviceRegistry: that.serviceRegistry}), - wrappable: true - }); - var textView = new mTextView.TextView(options); - return textView; - }; - - /** - * @callback - */ - var keyBindingFactory = function(editor, keyModeStack, undoStack, contentAssist) { - - //Allow extended TextModelFactory to pass default find options - var defaultFindOptions, factory = new mTextModelFactory.TextModelFactory(); - if(typeof factory.getDefaultFindOptions === "function") { - defaultFindOptions = factory.getDefaultFindOptions(); - } - var localSearcher = that.textSearcher = mSearcher.TextSearcher ? new mSearcher.TextSearcher(editor, serviceRegistry, commandRegistry, undoStack, defaultFindOptions) : null; - - var keyBindings = new mEditorFeatures.KeyBindingsFactory().createKeyBindings(editor, undoStack, contentAssist, localSearcher); - that.updateSourceCodeActions(that.settings, keyBindings.sourceCodeActions); - - var textView = editor.getTextView(); - textView.setAction("toggleWrapMode", function() { //$NON-NLS-0$ - textView.invokeAction("toggleWrapMode", true); //$NON-NLS-0$ - var wordWrap = textView.getOptions("wrapMode"); //$NON-NLS-0$ - that.settings.wordWrap = wordWrap; - if (that.editorPreferences) { - that.editorPreferences.setPrefs(that.settings); - } - return true; - }); - - textView.setKeyBinding(new mKeyBinding.KeyStroke('z', true, false, true), "toggleZoomRuler"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("toggleZoomRuler", function() { //$NON-NLS-0$ - if (!that.settings.zoomRulerVisible) return false; - that.settings.zoomRuler = !that.settings.zoomRuler; - if (that.editorPreferences) { - that.editorPreferences.setPrefs(that.settings); - } - return true; - }, {name: messages.toggleZoomRuler}); - - that.vi = that.emacs = null; - that.updateKeyMode(that.settings, textView); - - editorCommands.overwriteKeyBindings(editor); - - return keyBindings; - }; - - // Content Assist - var setContentAssistProviders = function(editor, contentAssist, evnt) { - // Content assist is about to be activated; set its providers. - var fileContentType = inputManager.getContentType(); - var fileName = editor.getTitle(); - var serviceRefs = serviceRegistry.getServiceReferences("orion.edit.contentAssist").concat(serviceRegistry.getServiceReferences("orion.edit.contentassist")); //$NON-NLS-1$ //$NON-NLS-2$ - var providerInfoArray = evnt && evnt.providers; - if (!providerInfoArray) { - providerInfoArray = serviceRefs.map(function(serviceRef) { - var contentTypeIds = serviceRef.getProperty("contentType"), //$NON-NLS-0$ - pattern = serviceRef.getProperty("pattern"); // backwards compatibility //$NON-NLS-0$ - if ((contentTypeIds && contentTypeRegistry.isSomeExtensionOf(fileContentType, contentTypeIds)) || - (pattern && new RegExp(pattern).test(fileName))) { - var service = serviceRegistry.getService(serviceRef); - var id = serviceRef.getProperty("service.id").toString(); //$NON-NLS-0$ - var charTriggers = serviceRef.getProperty("charTriggers"); //$NON-NLS-0$ - var excludedStyles = serviceRef.getProperty("excludedStyles"); //$NON-NLS-0$ - - if (charTriggers) { - charTriggers = new RegExp(charTriggers); - } - - if (excludedStyles) { - excludedStyles = new RegExp(excludedStyles); - } - - return {provider: service, id: id, charTriggers: charTriggers, excludedStyles: excludedStyles}; - } - return null; - }).filter(function(providerInfo) { - return !!providerInfo; - }); - } - - // Produce a bound EditorContext that contentAssist can invoke with no knowledge of ServiceRegistry. - var boundEditorContext = {}; - Object.keys(EditorContext).forEach(function(key) { - if (typeof EditorContext[key] === "function") { - boundEditorContext[key] = EditorContext[key].bind(null, serviceRegistry, that.editContextServiceID); - } - }); - contentAssist.setEditorContextProvider(boundEditorContext); - contentAssist.setProviders(providerInfoArray); - contentAssist.setAutoTriggerEnabled(that.settings.contentAssistAutoTrigger); - contentAssist.setProgress(progress); - contentAssist.setStyleAccessor(that.getStyleAccessor()); - }; - - var contentAssistFactory = readonly ? null : { - createContentAssistMode: function(editor) { - var contentAssist = new mContentAssist.ContentAssist(editor.getTextView(), serviceRegistry); - - contentAssist.addEventListener("Activating", setContentAssistProviders.bind(null, editor, contentAssist)); - var widget = new mContentAssist.ContentAssistWidget(contentAssist, "contentassist"); //$NON-NLS-0$ - var result = new mContentAssist.ContentAssistMode(contentAssist, widget); - contentAssist.setMode(result); - - // preload content assist plugins to reduce the delay - // that happens when a user first triggers content assist - setContentAssistProviders(editor, contentAssist); - contentAssist.initialize(); - return result; - } - }; - - var editor = this.editor = new mEditor.Editor({ - textViewFactory: textViewFactory, - undoStackFactory: that.undoStack ? {createUndoStack: function(editor) { - that.undoStack.setView(editor.getTextView()); - return that.undoStack; - }}: new mEditorFeatures.UndoFactory(), - textDNDFactory: new mEditorFeatures.TextDNDFactory(), - annotationFactory: new mEditorFeatures.AnnotationFactory(), - foldingRulerFactory: new mEditorFeatures.FoldingRulerFactory(), - zoomRulerFactory: new mEditorFeatures.ZoomRulerFactory(), - lineNumberRulerFactory: new mEditorFeatures.LineNumberRulerFactory(), - hoverFactory: new mHoverFactory.HoverFactory(serviceRegistry, inputManager, commandRegistry), - contentAssistFactory: contentAssistFactory, - keyBindingFactory: keyBindingFactory, - statusReporter: this.statusReporter, - domNode: this._parent, - syntaxHighlighter: this.syntaxHighlighter - }); - editor.id = "orion.editor"; //$NON-NLS-0$ - editor.processParameters = function(params) { - parseNumericParams(params, ["start", "end", "line", "offset", "length"]); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$ - return this.showSelection(params.start, params.end, params.line, params.offset, params.length); - }; - editor.getEditorContext = function() { - return EditorContext.getEditorContext(serviceRegistry, that.editContextServiceID); - }; - - this.dispatcher = new Dispatcher(this.serviceRegistry, this.contentTypeRegistry, editor, inputManager); - if(this.themePreferences && this.editorPreferences){ - this.localSettings = EditorSettings ? new EditorSettings({local: true, editor: editor, themePreferences: this.themePreferences, preferences: this.editorPreferences}) : null; - } - var liveEditSession = new LiveEditSession(serviceRegistry, editor); - inputManager.addEventListener("InputChanging", function(evt) { - that.createSession(evt); - }); - window.addEventListener("beforeunload", function(evt) { - that.createSession(evt); - if (evt.session) { - evt.session.save(); - } - }); - inputManager.addEventListener("InputChanged", function(evnt) { - that.createSession(evnt); - var textView = editor.getTextView(); - if (textView) { - liveEditSession.start(inputManager.getContentType(), evnt.title); - textView.setOptions(this.updateViewOptions(this.settings)); - this.markOccurrences.setOccurrencesVisible(this.settings.showOccurrences); - this.syntaxHighlighter.setup(evnt.contentType, editor.getTextView(), editor.getAnnotationModel(), evnt.title, true).then(function() { - this.updateStyler(this.settings); - if (editor.getContentAssist()) { - // the file changed, we need to figure out the correct auto triggers to use - setContentAssistProviders(editor, editor.getContentAssist()); - } - }.bind(this)); - if(textView.onInputChanged) { - textView.onInputChanged({type:evnt.type}); - } - } else { - liveEditSession.start(); - } - }.bind(this)); - inputManager.addEventListener("Saving", function(evnt) { - if (that.settings.trimTrailingWhiteSpace) { - editor.getTextView().invokeAction("trimTrailingWhitespaces"); //$NON-NLS-0$ - } - var textView = editor.getTextView(); - if(textView && textView.onSaving) { - textView.onSaving({type:evnt.type}); - } - }); - - this.blamer = new mBlamer.Blamer(serviceRegistry, inputManager, editor); - this.differ = new mDiffer.Differ(serviceRegistry, inputManager, editor); - - this.problemService = new mProblems.ProblemService(serviceRegistry, this.problemsServiceID); - var markerService = serviceRegistry.getService(this.problemsServiceID); - if(markerService) { - markerService.addEventListener("problemsChanged", function(evt) { - editor.showProblems(evt.problems); - }); - } - - var markOccurrences = this.markOccurrences = new mMarkOccurrences.MarkOccurrences(serviceRegistry, inputManager, editor); - markOccurrences.setOccurrencesVisible(this.settings.showOccurrences); - markOccurrences.findOccurrences(); - - var syntaxChecker = new mSyntaxchecker.SyntaxChecker(serviceRegistry, editor.getModel()); - - function syntaxCheck(title, message, contents) { - syntaxChecker.setTextModel(editor.getModel()); - var input = inputManager.getInput(); - syntaxChecker.checkSyntax(inputManager.getContentType(), title, message, contents, editor.getEditorContext()).then(function(problems) { - if (input === inputManager.getInput() && problems) { - serviceRegistry.getService(that.problemsServiceID)._setProblems(problems); - } - }); - if (inputManager.getReadOnly()) { - editor.reportStatus(messages.readonly, "error"); //$NON-NLS-0$ - } - } - this.refreshSyntaxCheck = function() { - syntaxCheck(inputManager.getInput()); - } - editor.addEventListener("InputChanged", function(evt) { - syntaxCheck(evt.title, evt.message, evt.contents); - }); - - var contextImpl = Object.create(null); - [ - "getCaretOffset", "setCaretOffset", //$NON-NLS-1$ //$NON-NLS-2$ - "getSelection", "getSelectionText", "setSelection", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "getSelections", "setSelections", //$NON-NLS-1$ //$NON-NLS-2$ - "getText", "setText", //$NON-NLS-1$ //$NON-NLS-2$ - "getLineAtOffset", //$NON-NLS-0$ - "getLineStart", //$NON-NLS-0$ - "isDirty", //$NON-NLS-0$. - "markClean", //$NON-NLS-0$. - ].forEach(function(method) { - contextImpl[method] = editor[method].bind(editor); - }); - contextImpl.showMarkers = function(markers) { - serviceRegistry.getService(that.problemsServiceID)._setProblems(markers); - }; - contextImpl.enterLinkedMode = function(linkedModeModel) { - editor.getLinkedMode().enterLinkedMode(linkedModeModel); - }; - contextImpl.exitLinkedMode = function(escapePosition) { - editor.getLinkedMode().exitLinkedMode(escapePosition); - }; - contextImpl.syntaxCheck = function(title, message, contents) { - syntaxCheck(title, message, contents); - }; - /** - * @description Opens the given location - * @function - * @param {String} fileurl The URL to open - * @param {Object} options The map of options. - * - * Current set of understood options include: - * start - (number) The start range to select when opening an editor - * end - (number) The end range to select when opening an editor - * newwindow - (boolean) If we should open the URL in a new tab - * - * @since 9.0 - */ - contextImpl.openEditor = function(fileurl, options) { - activateContext.openEditor(fileurl, options); - }; - - /** - * @since 7.0 - */ - contextImpl.getFileMetadata = function() { - return that.dispatcher.getServiceFileObject(); - }; - // Forward status from plugin to orion.page.message - contextImpl.setStatus = mEditorCommands.handleStatusMessage.bind(null, serviceRegistry); - serviceRegistry.registerService(this.editContextServiceID, contextImpl, null); - }, - create: function() { - this.editor.install(); - if(this.editorPreferences) { - this.editorPreferences.getPrefs(this.updateSettings.bind(this)); - } else if(this._editorConfig) { - var prefs = mCommonPreferences.mergeSettings(this._editorConfig, {}); - this.updateSettings(prefs); - } - - // Create a context menu... - this._createContextMenu(); - }, - destroy: function() { - if(this.lastFileLocation) { - this.fileClient.deleteFile(this.lastFileLocation); - } - this.editor.uninstall(); - }, - getStyleAccessor: function() { - var styleAccessor = null; - var styler = this.syntaxHighlighter.getStyler(); - if (styler && styler.getStyleAccessor) { - styleAccessor = styler.getStyleAccessor(); - } - return styleAccessor; - }, - _createContextMenu: function() { - // Create the context menu element (TBD: re0use a single Node for all context Menus ??) - this._editorContextMenuNode = document.createElement("ul"); //$NON-NLS-0$ - this._editorContextMenuNode.className = "dropdownMenu"; //$NON-NLS-0$ - this._editorContextMenuNode.setAttribute("role", "menu"); //$NON-NLS-1$ //$NON-NLS-2$ - this._parent.parentNode.appendChild(this._editorContextMenuNode); - - // Hook the context menu to the textView's content node - var tv = this.editor.getTextView(); - var contextMenu = new mContextMenu.ContextMenu({ - dropdown: this._editorContextMenuNode, - triggerNode: tv._clientDiv - }); - - //function called when the context menu is triggered to set the nav selection properly - var contextMenuTriggered = function(wrapper) { - var re = wrapper.event; - if (re.target) { - this.commandRegistry.destroy(this._editorContextMenuNode); // remove previous content - this.commandRegistry.renderCommands("editorContextMenuActions", this._editorContextMenuNode, null, this, "menu"); //$NON-NLS-1$ //$NON-NLS-2$ - mMetrics.logEvent("contextMenu", "opened", "editor"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - }.bind(this); - contextMenu.addEventListener("triggered", contextMenuTriggered); - } - }; - mEventTarget.EventTarget.addMixin(EditorView.prototype); - - return {EditorView: EditorView}; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('embeddedEditor/helper/editorSetup',[ - 'orion/editor/textModel', - 'orion/editor/undoStack', - 'orion/inputManager', - 'orion/editorView', - 'orion/Deferred', - 'orion/webui/littlelib', - 'orion/objects' -], function( - mTextModel, - mUndoStack, - mInputManager, - mEditorView, - Deferred, - lib, - objects -) { - var idCounter = 0; - function EditorSetupHelper(options) { - this._serviceRegistry = options.serviceRegistry; - this._pluginRegistry = options.pluginRegistry; - this._commandRegistry = options.commandRegistry; - this._fileClient = options.fileClient; - this._contentTypeRegistry = options.contentTypeRegistry; - this._editorCommands = options.editorCommands; - this._progressService = options.progressService; - this._toolbarId = options.toolbarId; - this._editorConfig = options.editorConfig; - } - - objects.mixin(EditorSetupHelper.prototype, /** @lends orion.editor.EditorSetupHelper.prototype */ { - destroy: function() { - }, - createInputManager: function() { - var inputManager = this._inputManager = new mInputManager.InputManager({ - serviceRegistry: this._serviceRegistry, - fileClient: this._fileClient, - progressService: this._progressService, - //statusReporter: this.statusReporter.bind(this), - selection: this.selection, - contentTypeRegistry: this._contentTypeRegistry - }); - inputManager.addEventListener("InputChanged", function(evt) { //$NON-NLS-0$ - evt.editor = this.editorView.editor; - this.setActiveEditorView(this.editorView); - }.bind(this)); - inputManager.addEventListener("InputChanging", function(e) { //$NON-NLS-0$ - e.editor = this.editorView.editor; - }.bind(this)); - }, - - - defaultOptions: function(options) { - var parentId = options.parent; - var model = new mTextModel.TextModel(); - var id = idCounter.toString(); - var context = Object.create(null); - context.openEditor = function(fileurl, options){this.editorView.editor.setSelection(options.start, options.end);}.bind(this); - return { - activateContext: context, - id: id, - parent: parentId, - model: model, - undoStack: new mUndoStack.UndoStack(model, 500), - serviceRegistry: this._serviceRegistry, - pluginRegistry: this._pluginRegistry, - commandRegistry: this._commandRegistry, - contentTypeRegistry: this._contentTypeRegistry, - editorCommands: this._editorCommands, - editorConfig: this._editorConfig, - statusReporter: options.statusReporter, - progressService: this._progressService, - inputManager: this._inputManager, // fake it - fileService: this._fileClient, // fake it - problemsServiceID: "orion.core.marker" + id, //$NON-NLS-0$ - editContextServiceID: "orion.edit.context" + id, //$NON-NLS-0$ - editModelContextServiceID: "orion.edit.model.context" + id, //$NON-NLS-0$ - readonly: false - }; - }, - - setActiveEditorView: function(eView) { - this._editorCommands.updateCommands(eView); - this._commandRegistry.destroy(this._toolbarId); - this._commandRegistry.renderCommands(this._toolbarId, this._toolbarId, this._inputManager.getFileMetadata(), eView.editor, "tool"); //$NON-NLS-0$ - }, - - createEditor: function(options, startupOptions) { - this.createInputManager(); - this.editorView = new mEditorView.EditorView(this.defaultOptions(options)); - idCounter++; - this.editorView.create(); - this._inputManager.editor = this.editorView.editor; - - var domNode = lib.node(options.parent); - domNode.addEventListener("mousedown", function() { //$NON-NLS-0$ - this.setActiveEditorView(this.editorView); - }.bind(this), true); - domNode.addEventListener("keyup", function() { //$NON-NLS-0$ - this.setActiveEditorView(this.editorView); - }.bind(this), true); - - if(options.contentType && typeof options.contents === "string") { - this.editorView.setContents(options.contents, options.contentType); - } - return new Deferred().resolve(this.editorView); - } - }); - - return { - EditorSetupHelper: EditorSetupHelper - }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/serviceregistry',["orion/Deferred", "orion/EventTarget"], function(Deferred, EventTarget) { - - /** - * @name orion.serviceregistry.ServiceReference - * @description Creates a new service reference. - * @class A reference to a service in the Orion service registry - * @param {String} serviceId The symbolic id of this service instance - * @param {String} name The service name - * @param {Object} properties A JSON object containing the service's declarative properties - */ - function ServiceReference(serviceId, objectClass, properties) { - this._properties = properties || {}; - this._properties["service.id"] = serviceId; - this._properties.objectClass = objectClass; - this._properties["service.names"] = objectClass; - } - - ServiceReference.prototype = /** @lends orion.serviceregistry.ServiceReference.prototype */ - { - /** - * @name getPropertyKeys - * @description Returns the names of the declarative properties of this service. - * @function - * @public - * @memberof orion.serviceregistry.ServiceReference.prototype - * @returns the names of the declarative properties of this service - */ - getPropertyKeys: function() { - var result = []; - var name; - for (name in this._properties) { - if (this._properties.hasOwnProperty(name)) { - result.push(name); - } - } - return result; - }, - /** - * @name getProperty - * @description Returns the declarative service property with the given name, or undefined - * if this service does not have such a property. - * @function - * @public - * @memberof orion.serviceregistry.ServiceReference.prototype - * @param {String} propertyName The name of the service property to return - * @returns The {String} property with the given name or undefined - */ - getProperty: function(propertyName) { - return this._properties[propertyName]; - } - }; - ServiceReference.prototype.constructor = ServiceReference; - - /** - * @name orion.serviceregistry.ServiceRegistration - * @description Creates a new service registration. This constructor is private and should only be called by the service registry. - * @class A reference to a registered service in the Orion service registry - * @param {String} serviceId The symbolic id of this service - * @param {String} serviceReference A reference to the service - * @param {Object} internalRegistry A JSON object containing the service's declarative properties - */ - function ServiceRegistration(serviceId, serviceReference, internalRegistry) { - this._serviceId = serviceId; - this._serviceReference = serviceReference; - this._internalRegistry = internalRegistry; - } - - ServiceRegistration.prototype = /** @lends orion.serviceregistry.ServiceRegistration.prototype */ - { - /** - * @name unregister - * @description Unregister this service registration. Clients registered for unregistering service events - * will be notified of this change. - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistration.prototype - */ - unregister: function() { - this._internalRegistry.unregisterService(this._serviceId); - }, - - /** - * @name getReference - * @description Returns the {@link orion.serviceregistry.ServiceReference} in this registration - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistration.prototype - * @param properties - * @returns the {@link orion.serviceregistry.ServiceReference} in this registration - * @throws An error is the service has been unregistered - */ - getReference: function() { - if (!this._internalRegistry.isRegistered(this._serviceId)) { - throw new Error("Service has already been unregistered: "+this._serviceId); - } - return this._serviceReference; - }, - /** - * @name setProperties - * @description Sets the properties of this registration to the new given properties. Clients registered for modified service events - * will be notified of the change. - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistration.prototype - * @param {Object} properties - */ - setProperties: function(properties) { - var oldProperties = this._serviceReference._properties; - this._serviceReference._properties = properties || {}; - properties["service.id"] = this._serviceId; - properties.objectClass = oldProperties.objectClass; - properties["service.names"] = oldProperties["service.names"]; - this._internalRegistry.modifyService(this._serviceId); - } - }; - ServiceRegistration.prototype.constructor = ServiceRegistration; - - /** - * @name orion.serviceregistry.DeferredService - * @description Creates a new service promise to resolve the service at a later time. - * @class A service that is resolved later - * @private - * @param {orion.serviceregistry.ServiceReference} implementation The implementation of the service - * @param {Function} isRegistered A function to call to know if the service is already registered - */ - function DeferredService(implementation, isRegistered) { - - function _createServiceCall(methodName) { - return function() { - var d; - try { - if (!isRegistered()) { - throw new Error("Service was unregistered"); - } - var result = implementation[methodName].apply(implementation, Array.prototype.slice.call(arguments)); - if (result && typeof result.then === "function") { - return result; - } else { - d = new Deferred(); - d.resolve(result); - } - } catch (e) { - d = new Deferred(); - d.reject(e); - } - return d.promise; - }; - } - - var method; - for (method in implementation) { - if (typeof implementation[method] === 'function') { - this[method] = _createServiceCall(method); - } - } - } - - /** - * @name orion.serviceregistry.ServiceEvent - * @description An event that is fired from the service registry. Clients must register to listen to events using - * the {@link orion.serviceregistry.ServiceRegistry#addEventListener} function. - *
      - * There are three types of events that this registry will send: - *
        - *
      • modified - the service has been modified
      • - *
      • registered - the service has been registered
      • - *
      • unregistering - the service is unregistering
      • - *
      - * @class A service event - * @param {String} type The type of the event, one of modified, registered or unregistered - * @param {orion.serviceregistry.ServiceReference} serviceReference the service reference the event is for - */ - function ServiceEvent(type, serviceReference) { - this.type = type; - this.serviceReference = serviceReference; - } - - /** - * @name orion.serviceregistry.ServiceRegistry - * @description Creates a new service registry - * @class The Orion service registry - */ - function ServiceRegistry() { - this._entries = []; - this._namedReferences = {}; - this._serviceEventTarget = new EventTarget(); - var _this = this; - this._internalRegistry = { - /** - * @name isRegistered - * @description Returns if the service with the given identifier is registered or not. - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistry - * @param {String} serviceId the identifier of the service - * @returns true if the service with the given identifier is registered, false otherwise - */ - isRegistered: function(serviceId) { - return _this._entries[serviceId] ? true : false; - }, - - /** - * @name unregisterService - * @description Unregisters a service with the given identifier. This function will notify - * clients registered for unregistering service events. - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistry - * @param {String} serviceId the identifier of the service - * @throws An error if the service has already been unregistered - * @see orion.serviceregistry.ServiceEvent - */ - unregisterService: function(serviceId) { - var entry = _this._entries[serviceId]; - if (!entry) { - throw new Error("Service has already been unregistered: "+serviceId); - } - var reference = entry.reference; - _this._serviceEventTarget.dispatchEvent(new ServiceEvent("unregistering", reference)); - _this._entries[serviceId] = null; - var objectClass = reference.getProperty("objectClass"); - objectClass.forEach(function(type) { - var namedReferences = _this._namedReferences[type]; - for (var i = 0; i < namedReferences.length; i++) { - if (namedReferences[i] === reference) { - if (namedReferences.length === 1) { - delete _this._namedReferences[type]; - } else { - namedReferences.splice(i, 1); - } - break; - } - } - }); - }, - /** - * @name modifyService - * @description Notifies that the service with the given identifier has been modified. This function will notify clients - * registered for modified service events. - * @function - * @private - * @memberof orion.serviceregistry.ServiceRegistry - * @param {String} serviceId the identifier of the service - * @throws An error if the service for the given identifier does not exist - * @see orion.serviceregistry.ServiceEvent - */ - modifyService: function(serviceId) { - var entry = _this._entries[serviceId]; - if (!entry) { - throw new Error("Service not found while trying to send modified event: "+serviceId); - } - var reference = entry.reference; - _this._serviceEventTarget.dispatchEvent(new ServiceEvent("modified", reference)); - } - }; - } - - ServiceRegistry.prototype = /** @lends orion.serviceregistry.ServiceRegistry.prototype */ - { - /** - * @name getService - * @description Returns the service with the given name or reference. - * @function - * @public - * @memberof orion.serviceregistry.ServiceRegistry.prototype - * @param {String|orion.serviceregistry.ServiceReference} nameOrServiceReference The service name or a service reference - * @returns {orion.serviceregistry.ServiceReference|null} The service implementation, or null if no such service was found. - */ - getService: function(typeOrServiceReference) { - var service; - if (typeof typeOrServiceReference === "string") { - var references = this._namedReferences[typeOrServiceReference]; - if (references) { - references.some(function(reference) { - service = this._entries[reference.getProperty("service.id")].service; - return !!service; - }, this); - } - } else { - var entry = this._entries[typeOrServiceReference.getProperty("service.id")]; - if (entry) { - service = entry.service; - } - } - return service || null; - }, - - /** - * @name getServiceReferences - * @description Returns all references to the service with the given name. - * @function - * @public - * @memberof orion.serviceregistry.ServiceRegistry.prototype - * @param {String} name The name of the service to return - * @returns {orion.serviceregistry.ServiceReference[]} An array of service references - */ - getServiceReferences: function(name) { - if (name) { - return this._namedReferences[name] ? this._namedReferences[name] : []; - } - var result = []; - this._entries.forEach(function(entry) { - if (entry) { - result.push(entry.reference); - } - }); - return result; - }, - - /** - * @name registerService - * @description Registers a service with this registry. This function will notify clients registered - * for registered service events. - * @function - * @public - * @memberof orion.serviceregistry.ServiceRegistry.prototype - * @param {String|String[]} names the name or names of the service being registered - * @param {Object} service The service implementation - * @param {Object} properties A JSON collection of declarative service properties - * @returns {orion.serviceregistry.ServiceRegistration} A service registration object for the service. - * @see orion.serviceregistry.ServiceEvent - */ - registerService: function(names, service, properties) { - if (typeof service === "undefined" || service === null) { - throw new Error("invalid service"); - } - - if (typeof names === "string") { - names = [names]; - } else if (!Array.isArray(names)) { - names = []; - } - - var serviceId = this._entries.length; - var reference = new ServiceReference(serviceId, names, properties); - var namedReferences = this._namedReferences; - names.forEach(function(name) { - namedReferences[name] = namedReferences[name] || []; - namedReferences[name].push(reference); - }); - var deferredService = new DeferredService(service, this._internalRegistry.isRegistered.bind(null, serviceId)); - this._entries.push({ - reference: reference, - service: deferredService - }); - var internalRegistry = this._internalRegistry; - this._serviceEventTarget.dispatchEvent(new ServiceEvent("registered", reference)); - return new ServiceRegistration(serviceId, reference, internalRegistry); - }, - - /** - * @name addEventListener - * @description Adds a listener for events on this registry. - *
      - * The events that this registry notifies about: - *
        - *
      • modified - the service has been modified
      • - *
      • registered - the service has been registered
      • - *
      • unregistering - the service is unregistering
      • - *
      - * @function - * @public - * @memberof orion.serviceregistry.ServiceRegistry.prototype - * @param {String} eventName The name of the event to be notified about. - * @param {Function} listener The listener to add - * @see orion.serviceregistry.ServiceEvent - */ - addEventListener: function(eventName, listener) { - this._serviceEventTarget.addEventListener(eventName, listener); - }, - - /** - * @name removeEventListener - * @description Removes a listener for service events in this registry. - * @function - * @public - * @memberof orion.serviceregistry.ServiceRegistry.prototype - * @param {String} eventName The name of the event to stop listening for - * @param {Function} listener The listener to remove - * @see orion.serviceregistry.ServiceEvent - */ - removeEventListener: function(eventName, listener) { - this._serviceEventTarget.removeEventListener(eventName, listener); - } - }; - ServiceRegistry.prototype.constructor = ServiceRegistry; - - //return the module exports - return { - ServiceRegistry: ServiceRegistry - }; -}); -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('orion/defaultEditorPreferences',[ - 'orion/util' -], function(util) { - var defaults = { - autoSave: util.isElectron ? false : true, - autoSaveVisible: true, - autoSaveLocalVisible: true, - autoSaveTimeout: 250, - autoSaveTimeoutVisible: true, - themeVisible: true, - themeLocalVisible: true, - fontSizeVisible: true, - fontSizeLocalVisible: true, - autoLoad: true, - autoLoadVisible: true, - saveDiffs: true, - saveDiffsVisible: true, - contentAssistAutoTrigger: true, - contentAssistAutoTriggerVisible: true, - showOccurrences: true, - showOccurrencesVisible: true, - autoPairParentheses: true, - autoPairParenthesesVisible: true, - autoPairBraces: true, - autoPairBracesVisible: true, - autoPairSquareBrackets: true, - autoPairSquareBracketsVisible: true, - autoPairAngleBrackets: false, - autoPairAngleBracketsVisible: true, - autoPairQuotations: true, - autoPairQuotationsVisible: true, - autoCompleteComments: true, - autoCompleteCommentsVisible: true, - smartIndentation: true, - smartIndentationVisible: true, - trimTrailingWhiteSpace: false, - trimTrailingWhiteSpaceVisible: true, - tabSize: 4, - tabSizeVisible: true, - expandTab: false, - expandTabVisible: true, - scrollAnimation: true, - scrollAnimationVisible: true, - scrollAnimationTimeout: 300, - scrollAnimationTimeoutVisible: true, - annotationRuler: true, - annotationRulerVisible: true, - lineNumberRuler: true, - lineNumberRulerVisible: true, - foldingRuler: true, - foldingRulerVisible: true, - overviewRuler: true, - overviewRulerVisible: true, - zoomRuler: false, - zoomRulerVisible: true, - zoomRulerLocalVisible: true, - showWhitespaces: false, - showWhitespacesVisible: true, - wordWrap: false, - wordWrapVisible: true, - showMargin: false, - showMarginVisible: true, - marginOffset: 80, - marginOffsetVisible: true, - keyBindings: "Default", - keyBindingsVisible: true, - keyBindingsLocalVisible: true, - diffService: false, - diffServiceVisible: false - }; - return { defaults: defaults }; -}); - -/******************************************************************************* - * @license - * Copyright (c) 2011, 2012 IBM Corporation and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), - * and the Eclipse Distribution License v1.0 - * (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ -/*eslint-env browser, amd*/ -define('embeddedEditor/builder/embeddedEditor',[ - 'orion/commandRegistry', - 'orion/fileClient', - 'orion/contentTypes', - 'orion/editorCommands', - 'embeddedEditor/helper/bootstrap', - 'embeddedEditor/helper/editorSetup', - 'embeddedEditor/helper/memoryFileSysConst', - 'orion/serviceregistry', - 'orion/Deferred', - 'orion/commonPreferences', - 'orion/defaultEditorPreferences', - 'orion/objects' -], function( - mCommandRegistry, - mFileClient, - mContentTypes, - mEditorCommands, - mBootstrap, - mEditorSetup, - memoryFileSysConst, - mServiceRegistry, - Deferred, - mCommonPreferences, - mDefaultEditorPreferences, - objects -) { - function CodeEdit(options) { - this.serviceRegistry = new mServiceRegistry.ServiceRegistry(); - this.contentTypeRegistry = new mContentTypes.ContentTypeRegistry(this.serviceRegistry); - this._startupOptions = options; - this._toolbarId = options && options.toolbarId ? options.toolbarId : "__code__edit__hidden__toolbar"; - this.Deferred = Deferred; - } - var once; - objects.mixin(CodeEdit.prototype, { - _init: function(core) { - if(once) { - return once; - } - if(!(this._startupOptions && this._startupOptions.toolbarId)) { - //TODO: We should create this hidden div somewhere else - //The hidden DIV that allows some commands for editorCommnads to be rendered. We only want to use keybinding of them though. - var orionHiddenDiv = document.createElement("div"); - orionHiddenDiv.id = this._toolbarId; - document.body.appendChild(orionHiddenDiv); - orionHiddenDiv.style.display = "none"; - } - //once = new Deferred(); - this._commandRegistry = new mCommandRegistry.CommandRegistry({}); - this._fileClient = new mFileClient.FileClient(this.serviceRegistry); - this._editorCommands = new mEditorCommands.EditorCommandFactory({ - serviceRegistry: this.serviceRegistry, - commandRegistry: this._commandRegistry, - fileClient: this._fileClient, - toolbarId: this._toolbarId, - navToolbarId: this._toolbarId - }); - this._editorConfig = this._startupOptions && this._startupOptions.editorConfig ? this._startupOptions.editorConfig : {}; - mCommonPreferences.mergeSettings(mDefaultEditorPreferences.defaults, this._editorConfig); - this._progressService = { - progress: function(deferred/*, operationName, progressMonitor*/){ - return deferred; - }, - showWhile: function(deferred/*, message, avoidDisplayError*/){ - return deferred; - } - }; - this.serviceRegistry.registerService("orion.page.progress", this._progressService); - once = this._editorCommands.createCommands().then(function() { - this._editorCommands.registerCommands(); - return new Deferred().resolve(); - }.bind(this)); - //once.resolve(); - return once; - }, - - /** - * @class This object describes the options for create. - * @name orion.editor.EditOptions - * - * @property {String|DOMElement} parent the parent element for the view, it can be either a DOM element or an ID for a DOM element. - * @property {String} [contents=""] the editor contents. - * @property {String} [contentType] the type of the content (eg.- application/javascript, text/html, etc.) - */ - /** - * If options is defined, creates an editorview instance configured with the given options. Otherwise load all the plugins nad initialize the widegt. - * - * @param {orion.editor.EditOptions} options the editor options. - */ - startup: function(options) { - return mBootstrap.startup(this.serviceRegistry, this.contentTypeRegistry, this._startupOptions).then(function(core) { - var serviceRegistry = core.serviceRegistry; - var pluginRegistry = core.pluginRegistry; - return this._init(core).then( function () { - if(!options) { - return new Deferred().resolve(core); - } - var editorHelper = new mEditorSetup.EditorSetupHelper({ - serviceRegistry: serviceRegistry, - pluginRegistry: pluginRegistry, - commandRegistry: this._commandRegistry, - fileClient: this._fileClient, - contentTypeRegistry: this.contentTypeRegistry, - editorCommands: this._editorCommands, - editorConfig: this._editorConfig, - progressService: this._progressService, - toolbarId: this._toolbarId - }); - return editorHelper.createEditor(options); - }.bind(this)); - - }.bind(this)); - }, - /** - * @class This object describes the options for create. - * @name orion.editor.EditOptions - * - * @property {String|DOMElement} parent the parent element for the view, it can be either a DOM element or an ID for a DOM element. - * @property {String} [contents=""] the editor contents. - * @property {String} [contentType] the type of the content (eg.- application/javascript, text/html, etc.) - */ - /** - * Creates an editorview instance configured with the given options. - * - * @param {orion.editor.EditOptions} options the editor options. - */ - create: function(options) { - return this.startup(options); - }, - importFiles: function(files2import) { - var fileClient = this.serviceRegistry.getService("orion.core.file.client"); - var promises = []; - if(fileClient) { - files2import.forEach(function(file) { - var promise = fileClient.createFile(file.parentLocation ? file.parentLocation : memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN, file.name).then(function(result){ - return fileClient.write(result.Location, file.contents); - }); - promises.push(promise); - }); - } - return Deferred.all(promises); - }, - exportFiles: function(files2export) { - var fileClient = this.serviceRegistry.getService("orion.core.file.client"); - var promises = []; - if(fileClient) { - files2export.forEach(function(file) { - var promise; - if(file.name || file.location) { - var readLocation = file.location ? file.location : memoryFileSysConst.MEMORY_FILE_PROJECT_PATTERN + file.name; - promise = fileClient.read(readLocation); - } else { - promise = new Deferred().resolve(""); - } - promises.push(promise); - }); - } - return Deferred.all(promises); - } - }); - - return CodeEdit; -}); -define('orion/codeEdit', ['embeddedEditor/builder/embeddedEditor'], function(p) { return p; }); \ No newline at end of file diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit.css b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit.css deleted file mode 100644 index 558fb9c9b63..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/code_edit/built-codeEdit.css +++ /dev/null @@ -1,2457 +0,0 @@ -.textview { - background-color: white; - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - min-width: 50px; - min-height: 50px; -} -.textviewSelection { - background: rgb(180, 213, 255); -} -.textviewContent ::-moz-selection { - background: rgb(180, 213, 255); -} -.textviewContent ::selection { - background: rgb(180, 213, 255); -} -.textviewSelectionUnfocused { - background: lightgray; -} -.textviewSelectionCaret { - background: black; -} -.textviewScroll { - padding: 4px 2px 4px 2px; -} -.textviewContent { - cursor: auto; -} -.textviewLeftRuler { - border-right: 1px solid #eaeaea; -} -.textviewRightRuler { - border-left: 1px solid #eaeaea; -} -.textviewInnerRightRuler { - border-left: 1px solid #eaeaea; - background-color: white; -} -.textviewMarginRuler { - border-left: 1px solid #eaeaea; -} -.textviewBlockCursor { - background: black; - opacity: 0.4; -} -.ruler { -} -.ruler.annotations { - width: 16px; -} -.ruler.folding { - width: 14px; -} -.ruler.lines { - text-align: right; -} -.ruler.overview { - width: 14px; -} -.ruler.zoom { - width: 100px; - height: 100%; -} -.rulerLines { - color: #767676; -} -.rulerLines.even -.rulerLines.odd { -} -.rulerZoomWindow { - background-color: rgba(0, 0, 0, 0.1); - margin-left: 1px; - border: 1px solid #eee; - position: absolute; - width: calc(100% - 4px); - border-radius: 5px; - z-index: 100; -} -.textviewZoom { - font-size: 2px !important; - cursor: pointer; -} -.textviewZoom .textviewContent { - cursor: pointer; -} -.textviewZoom .textviewScroll { - padding: 0; -} -.textviewZoom .punctuation.separator.tab { - background-image: none; -} -.textviewZoom .punctuation.separator.space { - background-image: none; -} -.textviewTooltip { - font-family: "Consolas", "Monaco", "Vera Mono", monospace; - font-size: 12px; - background-color: #325C80; - color: #FAFAFA; - padding: 8px; - - box-sizing: content-box; - border-radius: 3px; - z-index: 101; - position: fixed; - overflow: hidden; -} -.tooltipTheme .textviewScroll { - padding: 0; -} -.tooltipTheme .annotationLine.currentLine { - background-color: transparent !important; -} -.textviewTooltipCodeProjection { - border: 1px solid black !important; - - padding: 0 !important; -} -.textviewTooltip a { - color: #7CC7FF; -} -.textviewTooltip h3 { - -webkit-margin-before: 0; - margin-top: 0; -} -.textviewTooltip p:first-of-type { - -webkit-margin-before: 0; - margin-top: 0; - -webkit-margin-after: 0; - margin-bottom: 0; -} -.textviewTooltip p { - word-wrap: break-word; -} -.textviewTooltip multi_anno { - font-style: normal; - font-weight: bold; -} -.textviewTooltip span { - vertical-align: baseline; -} -.textviewTooltip .tooltipRow { - display: table-row; -} -.textviewTooltip .tooltipImage { - display: inline-block; - vertical-align: middle; - padding: 1px; -} -.textviewTooltip .tooltipTitle { - padding-left: 3px; - vertical-align: middle; -} -.textviewTooltip .hoverTooltipTitle { - font-weight: normal; -} -.textviewTooltip .quickFixList { - margin-top: 5px; -} -.textviewTooltip .commandButton { - border: 1px solid #325C80; - background-color: inherit; - color: white; -} -.textviewTooltip .commandButton:not(.dropdownTrigger){ - text-transform: initial; -} -.textviewTooltip .commandList > li { - margin: 0; -} -.textviewTooltip .quickfixAllParameter { - margin-bottom: 4px; - vertical-align: middle; - font-weight: normal; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; -} -.textViewTooltipOnFocus { - resize: both; - overflow: auto; -} -.textViewTooltipOnHover { - overflow: auto; -} - -.textViewFind { - background-color: #ddd; - position: absolute; - border: 1px solid #aaa; - border-top: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - padding: 2px; - z-index: 100; - display: none; -} -.textViewFind.show { - top: 0; - right: 40px; - transition: top 0.3s ease-out; - -ms-transition: top 0.3s ease-out; - -moz-transition: top 0.3s ease-out; - -webkit-transition: top 0.3s ease-out; - -o-transition: top 0.3s ease-out; - display: inline-block; -} -.textViewFindButton { - margin-right: 1px; - margin-left: 0; -} -.textViewFindButton:first-child { - margin-left: 5px; -} -.textViewFindButton:last-child { - margin-right: 5px; -} -.textViewFindButton.checked { - color: blue; - text-decoration: underline; -} -.textViewReplaceInput { -} -.textViewFindInput { -} -.textViewFindCloseButton { - width: 16px; - height: 16px; - border-width: 0; - background-color: transparent; - vertical-align: baseline; - background-position: center; - background-repeat: no-repeat; - background-image: url(data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///4CAgP///yH5BAEAAAMALAAAAAAQABAAAAIdnI+py+1vhECSyTluu9px+HkctnSdUh0pxLYuVAAAOw==); -} -.contentassist { - font-size:12px; - display: none; - background-color: white; - position: fixed; - top: 100px; - left: 100px; - z-index:100; - cursor: default; - min-width: 70px; - width: 350px; - height: 170px; - overflow-x: hidden; - overflow-y: auto; - white-space: nowrap; - border-radius: 5px; - box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px; - line-height: 18px; - resize: both; -} -.contentassist:focus { - outline: none; -} -.contentassist .proposal-emphasis { - font-weight: normal; -} -.contentassist hr{ - border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} -.contentassist .proposal-noemphasis-keyword { - background-color: aliceblue; - color: #CC4C07; - font-weight: bold; -} -.contentassist .proposal-noemphasis { - background-color: aliceblue; - font-weight: lighter; - color: black; -} -.contentassist .proposal-noemphasis-title-keywords { - background-color: aliceblue; - color: #717171; -} -.contentassist .proposal-noemphasis-title { - background-color: aliceblue; - color: #717171; - padding-top: 5px; -} -.contentassist .proposal-default { - -} -.contentassist .proposal-name { - font-weight: bold; -} -.contentassist .selected { - background-color: rgb(48, 135, 179); - background: linear-gradient(rgb(60, 150, 190), rgb(30, 120, 160)); - border-radius: 3px; - color: white; -} -.contentassist .cloneProposal { - box-shadow: rgba(0, 0, 0, 0.9) 2px 2px 8px; - position: fixed; - visibility: visible; - z-index: 1000; -} -.contentassist .proposalTag { - display: inline-block; - line-height: 11px; - height: 10px; - border-radius: 2px; - background: #325C80; - padding: 2px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist .iconTagGreen { - display: inline-block; - font-size: 10px; - font-weight: bold; - line-height: 13px; - height: 12px; - width: 12px; - border-radius: 50%; - background: green; - padding: 1px; - margin-right: 3px; - text-align: center; - color: white; -} -.contentassist>div { - padding: 1px 3px 1px 5px; -} -.cloneWrapper { - display: block; - height: 0; - overflow: visible; - visibility: hidden; - width: 0; - z-index: 1000; -} -.contentassist.cloneWrapper:hover { - overflow: visible; -} -.comment { - color: #3C802C; -} -.constant { - color: blue; -} -.entity { - color: #3f7f7f; -} -.invalid { - color: red; - font-weight: bold; -} -.keyword { - color: #9F4177; - font-weight: bold; -} -.storage { - color: #7F0055; -} -.string { - color: #446fbd; -} -.support { - color: #21439c; -} -.variable { - color: #0000c0; -} -.punctuation.separator.space { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABVJREFUCNdj3L17938GBgYGJgYoAAAxOAM004kASgAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center center; -} -.punctuation.separator.tab { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAFCAYAAABmWJ3mAAAAAXNSR0IArs4c6QAAABtJREFUCNdj2L17938GKEBmYwgQJ0m8IAMDAwDemh/hgxuOkwAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: left center; -} -.comment-block-documentation { - color: #00008F; -} -.constant-character-entity { - font-style: normal; -} -.entity-name-function, .entity-name-type { - font-weight: bold; - color: #67BBB8; -} -.entity-name-tag { - color: #98937B; -} -.entity-other-attribute-name { - color: #3C802C; -} -.invalid-illegal { - color: white; - background-color: red; -} -.invalid-deprecated { - text-decoration: line-through; -} -.keyword-operator { - color: #CC4C07; - font-weight: bold; -} -.meta.annotation.currentLine { - background-color: #EAF2FE; -} -.meta.tag { - color: #3f7f7f; -} -.punctuation-definition-comment { - color: #3f5fbf; -} -.punctuation-definition-string { - color: blue; -} -.variable-parameter { - color: #D1416F; -} -.variable-language { - color: #7F0055; - font-weight: bold; -} -.cm-meta { color: #00008F; } -.cm-keyword { font-weight: bold; color: #7F0055; } -.cm-atom { color: #21439c; } -.cm-number { color: black; } -.cm-def { color: green; } -.cm-variable { color: black; } -.cm-variable-2 { color: #004080; } -.cm-variable-3 { color: #004080; } -.cm-property { color: black; } -.cm-operator { color: #222; } -.cm-comment { color: green; } -.cm-string { color: blue; } -.cm-error { color: #ff0000; } -.cm-qualifier { color: gray; } -.cm-builtin { color: #7F0055; } -.cm-bracket { color: white; background-color: gray; } -.cm-tag { color: #3f7f7f; } -.cm-attribute { color: #7f007f; } - -.annotation { -} -.annotation.error, -.annotation.warning, -.annotation.task, -.annotation.bookmark, -.annotation.breakpoint, -.annotation.collapsed, -.annotation.expanded, -.annotation.currentBracket, -.annotation.matchingBracket, -.annotation.currentLine, -.annotation.matchingSearch, -.annotation.currentSearch, -.annotation.readOccurrence, -.annotation.writeOccurrence, -.annotation.linkedGroup, -.annotation.currentLinkedGroup, -.annotation.selectedLinkedGroup { -} -.annotation.blame { - color: gray; - background-color: rgb(255, 132, 44); -} -.annotation.currentBlame { - color: black; - background-color: rgb(184, 103, 163); -} -.annotation.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - color: #CCCCCC; -} -.annotation.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - color: #CCCCCC; -} -.lines .annotation.diffAdded { - background-image: none; - background-color: rgba(159, 202, 86, 0.68); - color: #555555; -} -.lines .annotation.diffModified { - background-image: none; - background-color: rgba(85, 181, 219, 0.67); - color: #555555; -} -.annotationHTML { - cursor: pointer; - width: 16px; - height: 16px; - display: inline-block; - vertical-align: middle; - background-position: center; - background-repeat: no-repeat; -} -.annotationHTML.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjNGNTlDOUMxMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjNGNTlDOUMyMUVDNDExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6M0Y1OUM5QkYxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6M0Y1OUM5QzAxRUM0MTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Be44kAAAAqklEQVR42mL8//8/AyWAiYFCQLEBLNgEX+aURgGpAiA2gAqdB+KJ4lO6l6GrZUQPA6DmqUAqC4eF04CGZOP0AtRmkOZ/QHwLSeoWVCwLqgZnGORD6TtA7ArEp6DYFSqGrAZrGBhCaTUgXg3EoVD+aqgYshraRON5JD+HQm2GueQWmhqsBkyE0ipAvBuIzaB4N1QMWQ11opERW16ARlU+UoARn5CGXmYCCDAAPz09iI0KJ9QAAAAASUVORK5CYII="); -} -.annotationHTML.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkREMTE1OUNDMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkREMTE1OUNEMUVDMjExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6REQxMTU5Q0ExRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6REQxMTU5Q0IxRUMyMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Kzt/qAAAA0ElEQVR42mL8//8/AyWAiYFCQLEBLLgkfl8obARSZUD8HYiLWQ3652NTx4gtDICao4HUbCDeBRVyBmI3oCHHCRoA1MwOpO4A8V+gBgWo2AMg9QaITYFi/wl5IRaIZYD4K1AjI8gSIBYBYnkg9gLirYQCMRdKc0M1KUDZIFCM1wtAG02B1Ckk+WlQSzKQxLSA3riOywUpaHxHILZHE8vA54VQNL4XFCODaHyB+B6IBZH4s7CE0Ud8LvCHhsFfKN8VihmgYqegavAnpKGVmQACDACxJDv3vmRk+gAAAABJRU5ErkJggg=="); -} -.annotationHTML.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkI2MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkI3MUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjQxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjUxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Utm8RAAAAl0lEQVR42mL8//8/AyWAiYFCQLEBLMicqtVRRPmnLXQZIzkuuEuJF04BsTEQ15JjAEizGxB/AmJpYgz4DsTLoewrQOwJ9PNHID0ViDPwBiIURAPxBqjm2UDN74CB2wFkZxKMBSioAOJ9QI1t0JgBaS4nKhqhwAyIdwE1ugLpLHyacRkAM+QcECtTkhKViYlfxqGfmQACDAAjXCa0hW/NdQAAAABJRU5ErkJggg=="); -} -.annotationHTML.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdEMjg0RkIyMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdEMjg0RkIzMUVFMzExRTM4NDU4RjQ3Q0I3NkI4OTBDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0QyODRGQjAxRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0QyODRGQjExRUUzMTFFMzg0NThGNDdDQjc2Qjg5MEMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz54SgjJAAAAuUlEQVR42mL8//8/AyWAiYFCQFsDWrdcMAViY3xqWAhYEADEv4H4LLle8IVinIARORaAzpUHiUG5qkC8C8p2AOKHQPwDhKt9DD7gcoEREJ8H4vtImkHgAFTsKhB743QB1BWyQGo+EDujGb4JiNOBtr/AawDUEH0gdQFNWBGo+QGxgRgEpV8C8SsoO4KUWAAZsAeIDYBYB4g3A3EUwViAOl8Falsb0Mn/kMRTQYYCxe4TDIOhlZkAAgwAunFAhB2QB2cAAAAASUVORK5CYII="); -} -.annotationHTML.breakpoint { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAFheoFxkoFxnpmt0pmZxpnF7rYyWwmJwpnaFs3aDrWt8rXGBrYycwmZ3mXuNs42cu77F03GIs3aJrYGVu2J5oKCuxeDj6LK/03GLrYieu3aIoIygu6m4zcLN3MTM1m6Rs2aLriRgkSZilXGXtoGcs7LD0QBLhSZikihol3ScubrO2Yaqu5q4xpO0wpm7yabF0ZO9yaXI0r3X3tHj6P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADQALAAAAAAQABAAAAafQJpwSCwWLYZBIDAwWIw0A+FFpW6aRUPCxe1yE4ahhdCCxWSzmSwGgxGeUceKpUqhUCkVa7UK0wgkJCUjJoUmIyWBBEIEGhoeJ4YmJx6OAUIADQ0QIZIhEJoAQgEUFBUgkiAVpZdRCxIPFx8iIh8XDw4FfhYHDhgZHB0dHBkYEwdwUQoTEc3OEwp+QwYHCBMMDBMIB9JESAJLAk5Q5EVBADs="); -} -.annotationHTML.collapsed { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNpi/P//PwMlgImBQkCxASzoAp++fo+6de+Z+fXbD/Jev/nAICoiwKCpqrBBTUlqNR835zJ09YzIYfDxy7eo/cevLmXlYGNQUJAEahZieP3mHcODB08Zfv/4w+BoqR3Nz8O1DKcXzt94HPqXmZlBU1+LgZNfkMHazIOBA0hr6uswgMTP33gYijcMLlx/EMAnLs7w7sc/hg9AG0HgPZB+B8S84hJA+UcBeMPg+at3DJIMnAxZzt5wsUhnXzDdsmIVWB6vAcLCfAys3z4wzN64huEfkJ/uH8IwexOQDQymD2/fgeXxekFLRWHD51evGDhZGRi4WSFSnCwgNjB2Xr1m0AbK4zXAQkdhNdPf3wx3r91g+PruLcOqnasYvn54x3Dv2k0G5r+/GMyB8nijEQTefvoadeH6w9Cbtx8GvH//kUFQkJ9BQ1V+g76m/GphPu5lBA0YenmBYgMAAgwA34GIKjmLxOUAAAAASUVORK5CYII="); -} -.annotationHTML.expanded { - - width: 14px; - height: 14px; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNrUksFKw0AURW+mTWw67SSEiG209U90r4jddFO34l+5U0HdZCHiFwiCOz9AlMSmGEpMOqk1TWJSFGyFbATR2dyZd+Dw3mOENE3xkyP8PYHrBT3OX7uW43ZefA6FUaw1dJPSyrmu1k8KBYOh37Od4XFZLEPXFdRrFMGIw3U9TKMYqw1tb0VjcxLy9eEF425CCIxWE5JcxSQGxCyNloG87gXhwWIHc4J767lTZQw8ShFGSZbxRyaQmZJxd3NRUJ6ffwQNEi6PzG/L2tjdmvFCgcKqKL2F2Olu43MzggDka+IjPuOFI7Sbujn2fUglYKkkzFIi+R0I/QDrGS8UqDX5QkhiOHYfE84hkhSTkGNgOyDJFCzjhYLTq+vDtrG8r1LZtB6fcHtzB+uhD5VWzLx+lvF/8JV/XfAuwADsrJbMGG4l4AAAAABJRU5ErkJggg=="); -} -.annotationHTML.multiple { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAOdpa+yJiuFYXOFYXeBYXONwded8f+NwdmhwkHB4iPr7/ezx+fP2+2h4kOzy+Wh4iPr8/gCBwTaczjaXyjaYyjaXyTaYyfr8/QCMzQCMzACHxzao2jal2Dak1zag03iAgI/Ckn64fZrHmX+4fZLCianPopPCiarOoqbLlafLlbnXq7nWq6fLlMTcsoCIeJCQcIiIeKCYaJiQcO16ee16evGVlfGWlfahn/ahoPWhn/WhoPe1tP///////wAAAAAAACH5BAEAAD0ALAAAAAAQABAAAAaRwJ5wSCwaj8WYcslcDmObaDTGq1Zjzw4mk+FQIRcFTzaUeTRoj4zHaI+HL0lkLnnxFgsH7zWEWSoTFBMwVlUwQy6JMDCJjYwuQx8tk5MfOzk4OjcfkSssKCkqHzY0MzQ1nEIJJSYkJCcJAQCzAQlDDyIjISMiCQYEAgMGD0MNIMfHDQUHBc3EQgjR0tPSSNY9QQA7"); -} -.annotationHTML.overlay { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII="); - background-position: right bottom; - position: relative; - top: -16px; -} -.annotationHTML.currentBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.matchingBracket { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gobFRYVQuAvZwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABnSURBVDjLtVJBDsAgCCuNT/L/L9if2GUHthUTRUlItEmBUoAtccFXqawWYXUSDuR4SAjMAaD9CnTY8zLR0MYTdEk668I3Ms3Zv347rEpmdV8taFN2+QsTy2YgxITApc3zEpZvJdnFDZs2IdfwZr8PAAAAAElFTkSuQmCC"); -} -.annotationHTML.currentLine { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAALxe0bNWzbdZzrlb0KpPx61RybBTy6VLxadNxZGctIeUroyYsG92hHyMqIKRq2l9nmyAoHGDonaIpStXj6q80k1aXf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABYALAAAAAAQABAAAAVCoCWOZGmeKDql5ppOMGXBk/zOoltSNO6XrlXwxIPNYiMGq8SoLC2MaNPygEQkDYdikUg6LQcEoWAICAaA5HPNLoUAADs="); -} -.annotationHTML.matchingSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.currentSearch { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAALClrLu1ubOpsKqdp6eapKufqMTAw7attLSrsrGnr62jq8C7v765vaebpb22vLmyuMbCxsnGycfEx8G+wcrIysTBxUltof//yf///v70jergpPvws+nWc/npqvrpqvrpq/raffffnvXVkfTVkvXUkd+9f+SiOemvV+uyXa2OX7mYZqeIXKuNX/ClO7KQYqiIXJ59Vp19VpFvTo9uTZBvTpNyUJNyUf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADgALAAAAAAQABAAAAZ4QJxwSCwajS2aS1U6DlunzcagcuKgG4sn5HJiLZ2QiHbEbj6hEapVTKVYr3OItG5TIhVGLF0npigUEAsPAjV9Q24pEhMBCAoybEUmGRcrDgcAAzNGkxcYNzAJBQSbRJ0YqBc2DaVEHJ6pGTStRBqfGBcZILRWvThBADs="); -} -.annotationHTML.readOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.writeOccurrence { - - background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP3ykf3zn/7lIv7kI/fbI/7nRf7scLe0oMXDtfXXHsG4gaKdgOXBF+rIJqKdhaijjNWxHeLBL6GafLuYJpmQcvvdg5OHZpyRcJ+UdLavm4+BXqGWeYZ1TYx7VZ6QcJ2NbI+Ebv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACEALAAAAAAQABAAAAZewJBwSCwaj0KMBFlULphDJwIakh6gGckCcXgyLxjuYol0PA6YMQbZqFAOhw/Gc2wHABaJhAMy2gEGBRoSHRtFf4ECDRpGERV3iQ0TRwyQBQSSRAmbAwEMnxAQClRQQQA7"); -} -.annotationHTML.blame { - float: left; -} -.annotationHTML.currentBlame { - float: left; -} -.annotationHTML.blame.single { - width: 32px; - height: 32px; -} -.annotationHTML.currentBlame.single { - width: 32px; - height: 32px; -} -.annotationHTML.diffAdded { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVBhXY5x/KoyBgSHBdCUTkIIAGIuBAQBMsAMD4UOAtwAAAABJRU5ErkJggg==); - background-repeat: repeat-y; - background-position: left top; -} -.annotationHTML.diffDeleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAVSURBVBhXY3growJBDP9hAMb6/x8ADgMVdmD2Og4AAAAASUVORK5CYII=); - background-repeat: repeat-x; - background-position: left top; -} -.annotationHTML.diffModified { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAcSURBVBhXYwzdevs/AxCs8lJhYAIxYACJw8AAAIlKBAKlNXzqAAAAAElFTkSuQmCC); - background-repeat: repeat-y; - background-position: left top; -} -.annotationOverview { - cursor: pointer; - border-radius: 2px; - left: 2px; - width: 8px; -} -.annotationOverview.task { - background-color: #93bb7a; - border: 1px solid #79aa59; -} -.annotationOverview.breakpoint { - background-color: lightblue; - border: 1px solid blue; -} -.annotationOverview.bookmark { - background-color: #84b3cf; - border: 1px solid #9cc2d8; -} -.annotationOverview.error { - background-color: #EFA1A7; - border: 1px solid #ec8a91; -} -.annotationOverview.warning { - background-color: #fce1a9; - border: 1px solid #face70; -} -.annotationOverview.currentBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.matchingBracket { - background-color: #00cc00; - border: 1px solid #00aa00; -} -.annotationOverview.currentLine { - background-color: #EAF2FE; - border: 1px solid black; -} -.annotationOverview.matchingSearch { - background-color: #C3E1FF; - border: 1px solid #afcae5; -} -.annotationOverview.currentSearch { - background-color: #53D1FF; - border: 1px solid #42a7cc; -} -.annotationOverview.readOccurrence { - background-color: lightgray; - border: 1px solid black; -} -.annotationOverview.writeOccurrence { - background-color: Gold; - border: 1px solid darkred; -} -.annotationOverview.currentBlame { - background-color: rgb(184, 103, 163); - border: 1px solid black; -} -.annotationOverview.diffAdded { - background-color: rgba(159, 202, 86, 0.52); - border: 1px solid black; -} -.annotationOverview.diffDeleted { -} -.annotationOverview.diffModified { - background-color: rgba(85, 181, 219, 0.61); - border: 1px solid black; -} -.annotationRange { - background-repeat: repeat-x; - background-position: left bottom; -} -.annotationRange.task { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEoIrb7JmcAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAGUlEQVQI12NggIH/DGdhDCM45z/DfyiBAADgdQjGhI/4DAAAAABJRU5ErkJggg=="); -} -.annotationRange.breakpoint { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sLDhEqHTKradgAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAIklEQVQI11XJMQ0AMAzAMGMafwrFlD19+sUKIJTFo9k+B/kQ+Qr2bIVKOgAAAABJRU5ErkJggg=="); -} -.annotationRange.bookmark { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.error { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); -} -.annotationRange.warning { - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} -.annotationRange.currentBracket { - background-color: #00FE00; -} -.annotationRange.matchingBracket { - background-color: #00FE00; -} -.annotationRange.readOccurrence { - background-color: lightgray; -} -.annotationRange.writeOccurrence { - background-color: yellow; -} -.annotationRange.matchingSearch { - background-color: #C3E1FF; -} -.annotationRange.currentSearch { - background-color: #53D1FF; -} -.annotationRange.linkedGroup { - outline: 1px solid grey; -} -.annotationRange.currentLinkedGroup { - background-color: #C3E1FF; -} -.annotationRange.selectedLinkedGroup { - background-color: #53D1FF; -} -.annotationLine { -} -.annotationLine.currentLine { - background-color: #EAF2FE; -} - -.headerLayout { - height: 35px; -} -.toolbarLayout { - height: 35px; - - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - flex-direction: row; - -ms-flex-direction: row; - -webkit-flex-direction: row; - -webkit-align-items: center; - align-items: center; -} -.fsToolbarLayout { - height: 30px; -} -.bannerLeftArea{ - - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 1; - -webkit-order: 1; - -ms-flex-order: 1; - order: 1; - -moz-box-flex: 1; - -webkit-box-flex:1; - -webkit-box-ordinal-group: 1; - - width: 20%; - - padding-left:5px; -} -.bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 60%; -} -@media only screen and (device-width: 768px) { - - - .bannerMiddleArea{ - -ms-flex: 3 1 60%; - - -webkit-order: 2; - -ms-flex-order: 2; - order: 2; - -moz-box-flex: 1; - -moz-box-ordinal-group: 2; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 2; - width: 59%; -} - -} -.bannerRightArea{ - -ms-flex: 1 6 20%; - -moz-box-ordinal-group: 3; - -webkit-order: 3; - -ms-flex-order: 3; - order: 3; - -moz-box-flex: 1; - - -webkit-box-flex:1; - -webkit-box-ordinal-group: 3; - width: 20%; - padding-right:5px; -} -.banner-maximized { - display: none; -} -.footer-maximized { - display: none; -} -.content-fixedHeight { - clear: both; - overflow: hidden; - position: absolute; - top: 0; - - bottom: 0; - left: 35px; - right: 0; - background: #3b4b54; - -} -.content-fixedHeight-animation { - transition: left 0.3s ease; -} -.content-fixedHeight-maximized { - top: 0; - bottom: 0; -} -.content-sideMenu-closed { - left: 0; -} -.content-fluid { -} -.footer-fixed-bottom { - position: fixed; - bottom: 0; - z-index: 50; - right: 0; - left: 0; - - height: 0; - background:#ededed; -} -.layoutBlock { - clear: both; - margin: 0; - - padding: 4px 4px 0 4px; - vertical-align: baseline; -} -.layoutLeft { - float: left; - margin: 0; -} -.layoutRight { - float: right; - margin: 0; -} -.layoutFlexStretch { - flex: 1 1; - -ms-flex: 1 1; - -webkit-flex: 1 1; -} -.spacingLeft { - margin-left: 5px; -} -.spacingRight { - margin-right: 5px; -} -.clear { - clear: both; -} -.hidden { - visibility: hidden; -} -.sidePanelLayout { - display: block; - position: absolute; - left: 0; - width: 33%; - height: 100%; -} -.generalAnimation { - -webkit-transition: all 0.5s ease; - -moz-transition: all 0.5s ease; - -o-transition: all 0.5s ease; - transition: all 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelLayoutAnimation { - -webkit-transition: width 0.5s ease; - -moz-transition: width 0.5s ease; - -o-transition: width 0.5s ease; - transition: width 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelVerticalLayout { - display: block; - position: absolute; - top: 0; - height: 33%; - width: 100%; -} -.sidePanelVerticalLayoutAnimation { - -webkit-transition: height 0.5s ease; - -moz-transition: height 0.5s ease; - -o-transition: height 0.5s ease; - transition: height 0.5s ease; - z-index: 50; - overflow: auto; -} -.sidePanelMargins { - margin-left: 8px; - margin-top: 2px; - margin-bottom: 8px; - width: auto; -} -.mainPanelLayout { - display: block; - position: absolute; - right: 0; - height: 100%; -} -.mainPanelLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.mainPanelVerticalLayout { - display: block; - position: absolute; - bottom: 0; - width: 100%; -} -.mainPanelVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.fixedToolbarHolder { - position: relative; - left: 0; - top: 0; - height: 100%; - width: 100%; - min-width:140px; - background:#3b4b54; -} -.sidebarWrapper { - overflow-x: auto; - overflow-y: hidden; - min-width: 0; -} -.sidebarWrapper > .sidebar { - position: relative; - left: 0; - top: 0; - height: calc(100% - 29px); - overflow-x: visible; -} -.projectNavSidebarWrapper > .sidebar { - height: calc(100% - 0px); -} -.workingTarget { - position: absolute; - top: 0; - width: 100%; - bottom: 0; - overflow-y: auto; - background:white; -} -.toolbarTarget { - position: absolute; - top: 35px; - width: 100%; - overflow-y: auto; -} -.toolbarTarget-toolbarHidden { - top: 0; -} -.pageLayoutTarget { - position: absolute; - width: calc( 100% - 15px ); - bottom: 0; - overflow-y: auto; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.33); - margin: 5px; - margin-right: 0; - padding-top: 10px; - padding-bottom: 5px; - background: white; -} -.hasSplit { - display: none; -} -.editorViewerFrame { - width: 100%; - height: 100%; -} -.editorViewerHeader { - display:flex; - background: #3B4B54; - color: white; - flex-direction:row; - align-items:center; - line-height:26px; - border-bottom: 1px solid #263238; -} -.editorViewerHeaderDirtyIndicator { - padding-left: 5px; -} -.editorViewerHeaderTitle { - padding-left: 5px; -} -.editorViewerContent { - position: absolute; - width: 100%; - top: 27px; - bottom: 0; - overflow: auto -} -.editorViewerPicInPic { - position: absolute; - border: 1px solid #ccc; - background-color: white; - z-index: 100; - bottom: 35px; - right: 35px; - width: 40%; - height: 40%; -} -.splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 51; - width: 3px; - cursor: e-resize; - visibility: hidden; -} -.splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 51; - height: 3px; - cursor: n-resize; - visibility: hidden; -} -@media only screen -and (min-device-width : 768px) -and (max-device-width : 1024px) { - - .splitLayout { - position: absolute; - left: 33%; - height: 100%; - z-index: 50; - width: 20px; - cursor: e-resize; - visibility: hidden; - } - - - .splitVerticalLayout { - position: absolute; - top: 33%; - width: 100%; - z-index: 50; - height: 20px; - cursor: n-resize; - visibility: hidden; - } - -} -.splitThumbLeftLayout { - position: absolute; - left: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-left: -1px; - cursor: pointer; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitThumbRightLayout { - position: absolute; - right: 100%; - height: 4em; - width: 4px; - top: calc(50% - 2em); - margin-right: -1px; - cursor: pointer; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; -} -.splitVerticalThumbUpLayout { - position: absolute; - top: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - margin-top: -1px; - cursor: pointer; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} -.splitVerticalThumbDownLayout { - position: absolute; - bottom: 100%; - width: 4em; - height: 4px; - left: calc(50% - 2em); - cursor: pointer; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} -.splitLayoutAnimation { - -webkit-transition: left 0.5s ease; - -moz-transition: left 0.5s ease; - -o-transition: left 0.5s ease; - transition: left 0.5s ease; -} -.splitVerticalLayoutAnimation { - -webkit-transition: top 0.5s ease; - -moz-transition: top 0.5s ease; - -o-transition: top 0.5s ease; - transition: top 0.5s ease; -} -.panelTracking { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: auto; -} -.commandList { - padding: 0; - margin-left: 0; - margin-right: 0; - list-style-type: none; - vertical-align: baseline; -} -.commandList > li { - float: left; - margin-left: 4px; - margin-right: 4px; -} -.commandMargins { - margin-left: 4px !important; - margin-right: 4px !important; -} -.commandMargins:last-child { - margin-right: 0 !important; -} -.sideMenu{ - width: 35px; - background: #26343F; - float: left; - position: absolute; - top: 0; - - bottom: 0; - -webkit-animation: slide 0.5s forwards; - -webkit-animation-delay: 2s; - animation: slide 0.5s forwards; - animation-delay: 2s; - display:block; - margin:0; - font-family: sans-serif; - font-size:10px; - text-decoration:none !important; - user-select: none; - -webkit-user-select: none; - -moz-user-select: -moz-none; -} -.sideMenu.animating { - z-index: 0; -} -.sideMenu-maximized { - top: 0; - bottom: 0; -} -.sideMenu-closed { - width: 0; - display: none; -} -.sideMenuHome{ - width: 100%; - height: 35px; -} -.sideMenuList{ - display:inline-block !important; - height: calc(100% - 64px); - margin: 0; - overflow-y: hidden; - padding: 0; - text-align: center; - width: 100%; -} -.sideMenuItem{ - list-style-type: none; - font-size:16px !important; - padding: 0; - margin: 3px; -} -.sideMenuItem:hover, .sideMenuItem.expanded { - text-decoration:none; - color:#F47D64 !important; -} -.sideMenu:hover > .sideMenuScrollButton { - opacity: 1; -} -.sideMenuScrollButton { - background-color: rgba(0,0,0,0.5) !important; - color: white !important; - cursor: pointer; - display: none; - height: 19px; - opacity: 0.5; - position: absolute; - width: 100%; - z-index: 100; -} -.sideMenuScrollButton.visible { - display: block; -} -.sideMenuTopScrollButton { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); -} -.sideMenuBottomScrollButton { - bottom: 0; - left: 0; -} -.sideMenuItem > .submenu-trigger { - color: #6D8B93 !important; - font-size:16px; - text-decoration:none !important; - width: 100%; - display: inline-block; - padding: 4px 0 4px 0; -} -.sideMenuItem>.submenu-trigger:hover, .sideMenuItem.expanded>.submenu-trigger{ - text-decoration:none; - color:white !important; -} -.sideMenuItemActive { -} -.sideMenuItemActive > .submenu-trigger { - color: white !important; -} -.sideMenuToggle { - display: none; -} -.sideMenu-notification { - position: relative; -} -.sideMenu-notification[level=info] { - background-image: radial-gradient(#1EB3DC, #1EB3DC 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=warn] { - background-image: radial-gradient(#FFFF66, #FFFF66 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenu-notification[level=error] { - background-image: radial-gradient(#FF0000, #FF0000 2px, transparent 3px); - background-size: 6px 6px; - background-repeat: no-repeat; - background-position: 30px 29px; -} -.sideMenuSubMenu{ - display: none; - list-style-type:none; - position:absolute; - font-family:sans-serif; - padding-left: 0; - z-index:100; - text-align: left; - left: 40px; -} -.sideMenuSubMenuItem{ - display: inline-block; - width: 100%; - white-space: nowrap; - font-size: 12px; - background: white; - border-right:1px solid #ddd; -} -.sideMenuSubMenuItem:before { - width: 0; - height: 0; - top: 13px; - content: ""; - left: -8px; - position: absolute; - z-index: 200; - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-right: 8px solid white; -} -.sideMenuSubMenuItem:first-child{ - border-top:1px solid #ddd; - border-top-right-radius: 4px; -} -.sideMenuSubMenuItem:last-child{ - border-bottom:1px solid #ddd; - border-bottom-right-radius: 4px; -} -.sideMenuSubMenuItem a { - display: inline-block; - color: #444; - padding: 12px 30px 12px 10px; - width: calc(100% - 30px - 10px + 8px); -} -.sideMenuSubMenuItem a:hover{ - text-decoration:none; - color: black !important; -} - -.sideMenuSubMenuItem:hover { - background-color: #fde7cf; -} -.sideMenuSubMenuItem:only-child:hover { - -} -.sideMenuSubMenuItem:only-child:hover a { - color: #333; -} -.sideMenuSubMenuItem a span { - display: inline-block; -} -.sideMenuItem:hover .sideMenuSubMenu, .sideMenuSubMenu.expanded { - display:inline-block; -} -.sidebar-decorate-active { - position: relative; - background: - radial-gradient(#1EB3DC, #1EB3DC 2px, #47575F 3px) no-repeat, - #47575F; - background-position: - 30px 29px, - 0 0; - background-size: - 8px 8px; -} -.mainContent{ - position:absolute; - left:35px; -} -.innerPanels{ - position:absolute; - width:100%; - top:35px; - bottom:0; -} -.userMenu { -} -.splash { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgb(57,75,84); - z-index: 149; - display: block; - box-shadow: 0 3px 7pt 0 rgba(0,0,0,0.3) inset; -} -.splashSeeThroughX { - -webkit-animation-name: splashSeeThrough; - animation-name: splashSeeThrough; - animation-duration: 0.7s; - background-color: rgba(38,52,63, 0.7); -} -@-webkit-keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -@keyframes splashSeeThrough { - from {background-color: rgb(38,52,63);} - to {background-color: rgba(38,52,63, 0.7);} -} -.splashContainer { - display: flex; - display: -webkit-flex; - align-items: center; - -webkit-align-items: center; - justify-content: center; - -webkit-justify-content: center; - height:100%; - flex-direction: column; - -webkit-flex-direction: column; - font-family: sans-serif; - font-size: 14px; -} -.splashLoader { - display: flex; - display: -webkit-flex; - height:300px; - width:100%; - flex-direction: column; - -webkit-flex-direction: column; - align-items: center; - -webkit-align-items: center; - background-color: rgb(57,75,84); -} -.splashAbout { - text-align: center; - color: #FFFFFF; - font-size:16px; - font-family: 'helvetica'; - font-weight: bold; - margin-bottom: 10px; -} -.splashSteps { - margin:20px; - max-width: 300px; -} -.splashStep { - display: flex; - display: -webkit-flex; - flex-direction: row; - -webkit-flex-direction: row; - padding-top: 10px; - padding-bottom:10px; - height:24px; -} -.splashMessages { -} -.splashMessage { - color: white; - font-size: 14px; -} -.splashDetailedMessage { - color: white; - font-size: 12px; - padding-left: 20px; -} -.splashVisual { - width: 24px; -} -.splashVerbal { - margin-left:20px; - color: #3BDEFF; - font-family: 'helvetica'; - font-weight: bold; - margin-top: 3px; -} -.splashVerbalwaiting { - color:grey; -} -.splashLoadingImage { - background: url(../../images/loading_24.gif) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.splashSuccessImage { - background: url(../../images/message_success_24.png) no-repeat top left; - vertical-align: middle; - display: inline-block; - border: none; - height:24px; - width:24px; -} -.orionPage { - background-color: #26343F; - width: 100%; - height: 100%; -} -.topRowBanner { - margin: 0; - border: 0; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - border-top-width: 0px; - border-right-width: 0px; - border-left-width: 0px; - border-bottom-style: none; - background-color: white; - height: 16px; - padding: 8px 2px 7px 6px !important; - box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 2px 0px, rgba(0, 0, 0, 0.0980392) 0px 1px 0px 0px; - z-index: 100; - display: none; -} -a { - text-decoration: none; - color: #00AED1; -} -a:hover { - cursor: pointer; - text-decoration: underline; -} -.primaryNav { - font-size: 8pt; - font-weight: normal; - color: #BFBFBF; - vertical-align: baseline; -} -.primaryNav > div { - padding-top: 6px; -} -.primaryNav > nav { - padding-top: 6px; -} -.primaryNav > nav > a { - color: #BFBFBF; - margin-right: 6px; - margin-left: 6px; - text-decoration: none; -} -.primaryNav > nav > a:hover, .primaryNav span.dropdownTrigger:hover { - cursor: pointer; - color: white; -} -.titleArea { - margin: 0; - padding-top: 3px; - border: 0; - background: #EFEFEF; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#EFEFEF), color-stop(100%,#EFEFEF)); - border-bottom: 1px solid #DEDEDE; - min-height: 20px; -} -.checkedRow { - color: white !important; - background-color: #1bb199 !important; -} -.checkedRow.disabledRow { - background-color: #dadada !important; -} -.checkedRow > td > span -{ - color:white !important; -} -.checkedRow > td > span > a -{ - color:white !important; -} -.checkedRow > td > span > span -{ - color:white !important; -} -.checkedRow > td > span > a > span -{ - color:white !important; -} -.checkedRow > td > a > span > span -{ - color:white !important; -} -.checkedRow .secondaryColumn { - color: white; -} -.checkedRow .navColumnNoIcon { - color: white; -} -.checkedRow .secondaryColumn > a:hover { - color: white !important; - font-weight:bold; - text-decoration: none; -} -.checkedRow .sectionTableItem { - color: white !important; -} -.checkedRow a { - color: white; -} -.checkedRow .jazz-description { - color: white; -} -.checkedRow .commandButton { - color: white; - border-color: white; -} -.checkedRow .commandImage { - color: white; -} -.navRow > td:first-child { - -} -.navRow.checkedRow > td:first-child { - border-left-color: #d57152; -} -.navbar-item-selected { - color: #FFFFFF !important; - font-weight: bold; - position: relative; - background: #1bb199 !important; -} -.breadcrumbContainer { - align-items: baseline; - display: inline-flex; - justify-content: center; - - -webkit-align-items: baseline; - display: -webkit-inline-flex; - -webkit-justify-content: center; - - margin-right: 0; - overflow: hidden; - visibility: visible; - width: 100%; -} -.breadcrumb { - color: #E6E6E6; - -webkit-flex-grow: 0; - flex-grow: 0; - font: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - overflow: hidden; - text-decoration: none; - text-overflow: ellipsis; -} -a.breadcrumb:hover { - text-decoration: none; - border-bottom: 1px dotted; - color: #00AED1; - cursor: pointer; -} -.breadcrumbSeparator { - color: #E6E6E6; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - font-weight: bold; - -webkit-flex-shrink: 0; - flex-shrink: 0; - margin: 2px; - text-decoration: none; -} -.currentLocation { - padding-top:1px; - font-weight: bold; - font-size: 9pt; - font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", - Helvetica, Tahoma, Geneva, Arial, "Lucida Grande", sans-serif; - color: #E6E6E6; - text-decoration: none; - line-height: 10pt; - white-space:nowrap; -} -div.currentLocation { - width: 100%; -} -.breadcrumbContainer > .currentLocation { - margin: 0; -} -a.currentLocation:hover { - font-weight: bold; - color: #00AED1; - text-decoration: none; - border-bottom: 1px dotted; -} -a.breadcrumb.currentLocation { - font-weight: bold; - margin: 0; -} -.tooltipContainer .currentLocation { - color: white; -} -.tooltipContainer .breadcrumb { - color: white; -} -.tooltipContainer .breadcrumbSeparator { - color: white; -} -.tooltipContainer a.currentLocation:hover { - color: white; -} -.tooltipContainer a.breadcrumb:hover { - color: white; -} -.auxpane { - border: 0; - background: #3B4B54; - color: white; -} -.mainpane { - border: 0; - background: #3B4B54 !important; - padding-right:5px; -} -.mainToolbar { - color: white; - background: #26343f; - padding-left: 2px; - padding-right: 5px; - white-space: nowrap; -} -.fsToolbar { - padding: 2px 4px 2px 4px; - background-color: #DFE6EB; - - -} -.filesystemName { - display: inline-block; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; - margin-bottom: 8px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - max-width: calc(100% - 6px - 4px - 24px); - max-width: -webkit-calc(100% - 6px - 4px - 24px); - -moz-user-select: -moz-none; - -webkit-user-select: none; - -ms-user-select: none; - user-select: none; - color: white; -} -.filesystemSwitcher { - display: inline-block; - margin: 0; -} -.filesystemSwitcherWrapper { - display: block; - max-width: 100%; - white-space: nowrap; -} -.sidebarToolbar { - display: inline; - overflow: visible; - padding: 0 !important; -} -.searchbox { - background-image: url(../../images/core_sprites.png); - background-repeat: no-repeat; - background-position: 4px -297px; - width: 12px; height: 12px; - background-color: #444; - border: 1px solid #222; - font-size: 11px; - width: 15em; - height: 16px; - border-radius: 10px; - color: #999; - padding: 0; - padding-left: 20px; - padding-right: 16px; - margin-left: 5px; - font-size: 7pt; -} -.searchbox:focus{ - color: white; - outline: none; -} - -.orionButton { - border: 1px solid transparent; - text-align: center; - vertical-align: baseline; - display: inline-block; - padding: 4px 6px; - border-radius: 1px; - line-height: 12px; - font-size: 9pt; - font-family: "HelveticaNeue", "Helvetica Neue", "HelveticaNeueRoman", "HelveticaNeue-Roman", "Helvetica Neue Roman", - 'TeXGyreHerosRegular', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - margin: 0; -} -.commandButton.orionButton.dropdownTrigger { - -} -.commandButton.orionButton.dropdownTrigger:hover { - border-color: #ccc; -} -.mainToolbar .commandButton.orionButton.dropdownTrigger { - color:white; -} -.commandButton { - color: #00AED1; - border: 1px solid #00AED1; - background-color: rgba(0, 0, 0, 0); - - vertical-align: middle; - -webkit-transition: color 0.2s ease; - transition: color 0.2s ease; -} -.commandButton:not(.dropdownTrigger) { - -} -.extraActions .commandButton { - text-transform: uppercase; -} -.commandButton.dropdownDefaultButton { - -} -.commandButton:not(.primaryButton):hover, .commandButton:not(.primaryButton):focus { - color: white; - background-color: #a5b5bc; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); -} -.commandButton.disabled { - color: #cdcdcd; -} -.primaryButton{ - background: #1bb199; - border-color: #1bb199; - color: white; -} -.primaryButton:hover, .primaryButton:focus { - background: #01CDB0; - border-color: #01CDB0; -} -.commandImage { - border: 1px solid transparent; - border-radius: 1px; - color: inherit; - background-color: transparent; - vertical-align: baseline; - cursor: pointer; - display: inline-block; - padding: 2px; - padding-top: 0; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandImage:hover, .commandImage:focus { - background-color: #a5b5bc; - border: 1px solid #ccc; -} -.mainToolbar .commandImage.dropdownTrigger { - color: white; -} -.orionToggleOff { - color: inherit; - border-radius: 3px; - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn { - color: inherit; - background-color: whitesmoke; - border-radius: 3px; - box-shadow: inset 1px 1px 2px 1px rgba(0,0,0,0.3); - vertical-align:middle; - -webkit-animation-duration: .2s; - animation-duration: .2s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation-timing-function: linear; - animation-timing-function: linear; -} -.orionToggleOn:hover { - background: white; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleOff:hover { - background: whitesmoke; - box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.2); -} -.orionToggleAnimate { - -webkit-animation-name: pulse; - animation-name: pulse; -} -@-webkit-keyframes pulse { - 0% { -webkit-transform: scale(1); } - 50% { -webkit-transform: scale(1.3); } - 100% { -webkit-transform: scale(1); } -} -@keyframes pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.3); } - 100% { transform: scale(1); } -} -.orionSwitch { - position: relative; - width: auto; -} -.orionSwitchCheck { - display: none; -} -.orionSwitchLabel { - display: block; - overflow: hidden; - cursor: pointer; - border: 1px solid #DFE6EB; - border-radius: 3px; - height: 20px; -} -.orionSwitchInner { - display: block; - width: 200%; - margin-left: -100%; - margin-top:-1px; - text-align: left; - -moz-transition: margin 0.2s ease-in 0s; - -webkit-transition: margin 0.2s ease-in 0s; - -o-transition: margin 0.2s ease-in 0s; - transition: margin 0.2s ease-in 0s; -} -.orionSwitchInner:before, .orionSwitchInner:after { - display: block; - float: left; - width: 50%; - padding: 0; - padding-bottom: 2px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.orionSwitchInner:before { - padding-left: 3px; - padding-right: 2px; - background-color: #FFF; - color: #808080; -} -.orionSwitchInner:after { - padding-right: 3px; - background-color: #eee; - color: #808080; - text-align: right; -} -.orionSwitchSwitch { - display: block; - width: calc(50% - 2px); - margin: 0; - background: #DFE6EB; - border: 1px solid #DFE6EB; - border-radius: 3px; - position: absolute; - top: 0; - bottom: 0; - right: calc(50% + 2px); - -moz-transition: all 0.2s ease-in 0s; - -webkit-transition: all 0.2s ease-in 0s; - -o-transition: all 0.2s ease-in 0s; - transition: all 0.2s ease-in 0s; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchInner { - margin-left: 0; -} -.orionSwitchCheck:checked + .orionSwitchLabel .orionSwitchSwitch { - right: 0px; -} -.commandMissingImageButton { - font-weight: normal; -} -.commandLink { - display: inline-block; - vertical-align: middle; - padding: 4px 0 1px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.commandSeparator { - padding: 2px; -} -.commandActive { - background-color: #e6e6e6 !important; - border: 1px solid #808080 !important; - border-radius: 2px !important; -} -.commandActiveItem { -} -.commandInactiveItem { -} -.split { - background: #3B4B54; -} -.splitTracking { - background: #3B4B54; -} -.splitThumb { - background: #3B4B54; -} -.dropdown { -} -.dropdownArrowDown { - display: inline-block; - vertical-align: top; - line-height: 12px; - text-transform: lowercase; -} -.dropdownArrowRight { - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 12px; -} -.dropdownTrigger:not(.dropdownDefaultButton) { - font-weight: normal; - color: #FFFFFF; - border-color: transparent; -} -.dropdownTrigger a { - text-decoration: none; -} -.dropdownMenu { - box-shadow: 2px 2px 5px 3px rgba(0, 0, 0, .2); - color: #3b4b54; - background-color: white; - border-collapse: separate; - border: 1px solid #bbbbbb; - border-radius: 1px; - visibility: hidden; - z-index: 150; - position: absolute; - list-style-type: none; - display: none; - line-height: normal; - margin: 0; - cursor: default; - font-size: 12px; - margin: 0; - outline: none; - padding: 3px 0 3px; -} -.dropdownMenuOpen { - min-width: 120px; - display: block; - visibility: visible; -} -.dropdownSubMenu { - position: relative; - line-height: normal; -} -.dropdownSubMenu > ul { - top: 0; - left: 100%; -} -.dropdownMenu > li { - min-width: 120px; - display: flex; - display: -webkit-flex; -} -.dropdownMenu > li > a, .dropdownMenu > li > span { - width: calc( 100% - 9px ); - margin: 0; -} -.dropdownMenu > li > *:focus { - outline: none; -} -.dropdownSeparator { - height: 1px; - background-color: #ddd; - color: #ddd; - padding: 0 !important; - margin: 0; -} -.dropdownMenuItem, .dropdownMenuItem a { - align-items: center; - -webkit-align-items: center; - align-content: stretch; - -webkit-align-content: stretch; - display: inline-flex; - display: -webkit-inline-flex; - vertical-align: middle; - color: #3b4b54 !important; - padding: 3px 3px 3px 5px; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - border-left: 4px solid transparent; -} -.dropdownMenu .dropdownMenuItemSelected { - background-color: rgba(27,177,153, 0.1); - border-left-color: #1BB199; -} -.dropdownMenuItem .check { - display: inline-block; - width: 12px; -} -.dropdownMenuItem .dropdownKeyBinding { - color: grey !important; - flex-grow: 0; - -webkit-flex-grow: 0; - font-size: 11px; - padding-left: 15px; - padding-right: 10px; -} -.dropdownMenuItem .dropdownCommandName { - -webkit-align-items: center; - align-items: center; - display: inline-flex; - display: -webkit-inline-flex; - - flex-grow: 1; - -webkit-flex-grow: 1; - text-decoration: inherit; -} -.dropdownSelection { - background-color: white !important; - color: #3b4b54 !important; - border: 1px solid #bbbbbb !important; - border-bottom: none !important; - border-bottom-left-radius: 0 !important; - border-bottom-right-radius: 0 !important; - box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, .2) !important; - margin-bottom: -1px !important; - position: relative !important; - z-index: 200 !important; -} -.checkedMenuItem { - margin: 4px 6px 2px 0; - vertical-align: bottom; -} -.tooltipContainer { - display: none; - z-index: 200; - background: transparent; - position: absolute; - max-width: 110em; -} -.tooltip .textContent { - max-width: 40em; -} -.tooltip { - color: white; - background-color: #158d7a; - border-radius: 3px; - padding: 8px; - clear: both; - float: left; - border: 1px solid #158d7a; - box-shadow: 0px 0px 10pt -2pt rgba(0, 0, 0, 0.5); -} -.tooltip.left { -} -.tooltip .navlinkonpage { - color: #00aed1 !important; -} -.tooltip h2 { - color: #3b4b54; -} -.tooltip .operationStatus { - color: #00aed1; -} -.tooltip .operationError { - color: #a6b5bc; -} -.tooltipTailFromleft { - position: absolute; - display: inline-block; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromleft:after, .tooltipTailFromleft:before { - left: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromleft:after { - border-color: transparent; - border-left-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromleft:before { - border-color: transparent; - border-left-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromleft { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent transparent transparent #158d7a; - top: 2px; - right: -17px; - content: ''; -} -.tooltipTailFromright { - position: absolute; - display: inline-block; - left: 0; - top: 14px; - content: ''; - z-index: 201; -} -.tooltipTailFromright:after, .tooltipTailFromright:before { - right: -1px; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromright:after { - border-color: transparent; - border-right-color: #158d7a; - border-width: 8px; - margin-top: -8px; -} -.tooltipTailFromright:before { - border-color: transparent; - border-right-color: #158d7a; - border-width: 9px; - margin-top: -9px; -} -.tooltipTailBorderFromright { - position: absolute; - display: inline-block; - border: 10px solid; - border-color: transparent #158d7a transparent transparent; - left: -17px; - top: 2px; - content: ''; -} -.tooltipTailFrombelow { - position: absolute; - display: block; - left: 16px; - top: 0; - content: ''; - z-index: 201; -} -.tooltipTailFrombelow:after, .tooltipTailFrombelow:before { - bottom: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFrombelow:after { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFrombelow:before { - border-color: transparent; - border-bottom-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFrombelow { - position: absolute; - display: block; - border: 10px solid; - border-color: transparent transparent #158d7a transparent; - left: 14px; - top: -17px; - content: ''; -} -.tooltipTailFromabove { - position: absolute; - display: block; - left: 16px; - content: ''; - bottom: 0; - z-index: 201; -} -.tooltipTailFromabove:after, .tooltipTailFromabove:before { - top: -1px; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -.tooltipTailFromabove:after { - border-color: transparent; - border-top-color: #158d7a; - border-width: 8px; - margin-left: -8px; -} -.tooltipTailFromabove:before { - border-color: transparent; - border-top-color: #158d7a; - border-width: 9px; - margin-left: -9px; -} -.tooltipTailBorderFromabove { - position: absolute; - display: block; - border: 10px solid; - border-color: #158d7a transparent transparent transparent; - left: 14px; - bottom: -17px; - content: ''; -} -.tooltipShowing { - display: block; -} -.tooltip > .parametersDismiss > .dismissButton { - color: whitesmoke; -} -.tooltip > .parametersDismiss > .dismissButton:hover { - color: white; -} -.dialog { - visibility: hidden; - z-index: 175; - position: absolute; - color: #222; - background-color: #fbfbfb; - border-radius: 2px; - border: 1px solid #BBB; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - padding-bottom:5px; -} -.dialogShowing { - visibility: visible; -} -.dialogTitle { - display: block; -} -.dialogTitle { - padding-top: 5px; - display: inline-block; - background: #555; - width: 100%; - padding-bottom: 5px; - border-top-left-radius: 1px; - border-top-right-radius: 1px; -} -.dialogTitle > .dismissButton { - margin-right: 0; -} -.dialogTitleText { - margin: 2px 2px 0; - color: whitesmoke; - font-size: 1em; - height: 18px; - padding-left: 4px; - font-weight: bold; -} -.dialogDismiss { - display: block; - cursor: pointer; - padding: 2px; -} -.dialogContent { - padding: 8px; -} -.parameterPopup .dismissButton, .dialogTitle .dismissButton { - color: rgb(221, 221, 221); - cursor: pointer; -} -.parameterPopup .dismissButton:hover, .dialogTitle .dismissButton:hover { - color: white; -} -.dialogButtons { - -webkit-align-items: center; - align-items: center; - - display: -webkit-flex; - display: flex; - - -webkit-justify-content: center; - justify-content: center; - margin: 2px 4px 4px 4px; -} -.dialogButtons > button.commandButton { - min-width: 60px; -} -.confirmDialog { - min-width: 300px; - max-width: 450px; -} -.confirmDialog .checkboxWrapper { - margin: 10px 2px 5px 2px; -} -.checkboxMessage > .confirmDialogCheckbox { - margin: 0 5px 0 0; - outline: none; - vertical-align: top; -} -.modalBackdrop { - opacity: 0.5; - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; -} -.textviewTooltip { - background-color: #158d7a; -} -.textviewTooltip .commandButton { - border-color: white; - color: white; - margin-bottom: 2px; -} -.core-sprite-git-logo { - font-size: 20px !important; -} -.outlineExplorer .navlinkonpage { - color: #333 !important; -} -.outlineExplorer .treeIterationCursorRow_Dotted { - background-color: #1BB199; -} -.outlineExplorer .treeIterationCursorRow_Dotted .modelDecorationSprite { - color: white; -} -.outlineExplorer .treeIterationCursorRow_Dotted .navlinkonpage { - color: white !important; -} -.contentassist .selected { - background-color: #1BB199 !important; - background: #1BB199 !important; - border-radius: 0; - color: #FFF; -} diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.html b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.html deleted file mode 100644 index 6284564b4de..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Orion JavaScript Support - - - -

      JavaScript Tools Support

      - - \ No newline at end of file diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.js b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.js deleted file mode 100644 index 25bb6472c3a..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/javascriptPlugin.js +++ /dev/null @@ -1,10 +0,0 @@ -!function(e,t){"function"==typeof define&&define.amd?define([],t):(e.orion=e.orion||{},e.orion.webtools=e.orion.webtools||{},e.orion.webtools.javascript=t())}(this,function(){var e,t,n;return function(r){function i(e,t){return E.call(e,t)}function o(e,t){var n,r,i,o,a,s,u,l,c,p,d=t&&t.split("/"),f=y.map,m=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),l=0;l0&&(e.splice(l-1,2),l-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||m)&&f){for(n=e.split("/"),l=n.length;l>0;l-=1){if(r=n.slice(0,l).join("/"),d)for(c=d.length;c>0;c-=1)if(i=f[d.slice(0,c).join("/")],i&&(i=i[r])){o=i,a=l;break}if(o)break;!s&&m&&m[r]&&(s=m[r],u=l)}!o&&s&&(o=s,a=u),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function a(e,t){return function(){return f.apply(r,A.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function u(e){return function(t){g[e]=t}}function l(e){if(i(v,e)){var t=v[e];delete v[e],D[e]=!0,d.apply(r,t)}if(!i(g,e)&&!i(D,e))throw new Error("No "+e);return g[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function p(e){return function(){return y&&y.config&&y.config[e]||{}}}var d,f,m,h,g={},v={},y={},D={},E=Object.prototype.hasOwnProperty,A=[].slice;m=function(e,t){var n,r=c(e),i=r[0];return e=r[1],i&&(i=o(i,t),n=l(i)),i?e=n&&n.normalize?n.normalize(e,s(t)):o(e,t):(e=o(e,t),r=c(e),i=r[0],e=r[1],i&&(n=l(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},h={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:p(e)}}},d=function(e,t,n,o){var s,c,p,d,f,y,E=[];if(o=o||e,"function"==typeof n){for(t=!t.length&&n.length?["require","exports","module"]:t,f=0;fi;i++){var a=n[i];if(a!==r[i])return!1;var s=e[a],u=t[a];if(s!==u&&JSON.stringify(s)!==JSON.stringify(u))return!1}return!0}function r(e,t){this.__objectId=e,this.__methods=t}function i(i,o){function a(e,t){t=t||I,t&&("undefined"==typeof ArrayBuffer&&(e=JSON.stringify(e)),t===self||L?t.postMessage(e):t.postMessage(e,"*"))}function s(e){"undefined"!=typeof localStorage&&localStorage.pluginLogging&&console.log(e+"("+((new Date).getTime()-R)+"ms)="+self.location)}function u(){var e=(new Date).getTime();M&&4e3>e-M||(M=e,a({method:"loading"}),s("heartbeat"))}function l(){var e=[];return Object.keys(_).forEach(function(t){var n=_[t];e.push({serviceId:t,names:n.names,methods:n.methods,properties:n.properties})}),{updateRegistry:!!P,headers:C||{},services:e}}function c(e,t){if(t&&t instanceof XMLHttpRequest){var n,r;try{n=t.status,r=t.statusText}catch(i){n=0,r=""}return{status:n||0,statusText:r}}return t}function p(e){var t=e?JSON.parse(JSON.stringify(e,c)):e;return e instanceof Error&&(t.__isError=!0,t.message=t.message||e.message,t.name=t.name||e.name),t}function d(t,n){if(n=n||I,!n)return(new e).reject(new Error("plugin not connected"));t.id=String(b++);var i=new e;B[t.id]=i,i.then(null,function(e){F&&e instanceof Error&&"Cancel"===e.name&&N({requestId:t.id,method:"cancel",params:e.message?[e.message]:[]},n)});var o=Object.prototype.toString;return t.params.forEach(function(e,n){if("[object Object]"===o.call(e)&&!(e instanceof r)){var a,s;for(a in e)"[object Function]"===o.call(e[a])&&(s=s||[],s.push(a));if(s){var u=x++;k[u]=e;var l=function(){delete k[u]};i.then(l,l),t.params[n]=new r(u,s)}}}),N(t,n),i.promise}function f(e,t,n){e||0===e?N({id:e,result:null,error:t},n):console.log(t)}function m(e,t,n,r,i){r.forEach(function(e,t){if(e&&"undefined"!=typeof e.__objectId){var n={};e.__methods.forEach(function(t){n[t]=function(){return d({objectId:e.__objectId,method:t,params:Array.prototype.slice.call(arguments)},i)}}),r[t]=n}});var o="undefined"==typeof e?null:{id:e,result:null,error:null};try{var a=n.apply(t,r);if(!o)return;a&&"function"==typeof a.then?(w[e]=a,a.then(function(t){delete w[e],o.result=t,N(o,i)},function(t){w[e]&&(delete w[e],o.error=p(t),N(o,i))},function(){N({responseId:e,method:"progress",params:Array.prototype.slice.call(arguments)},i)})):(o.result=a,N(o,i))}catch(s){o&&(o.error=p(s),N(o,i))}}function h(e,t){if(L||e.source===I||"undefined"==typeof window){var n=e.data,r="string"!=typeof n?n:JSON.parse(n);try{if(r.method){var i=r.method,o=r.params||[];if("serviceId"in r){var a=_[r.serviceId];a?(a=a.implementation,i in a?m(r.id,a,a[i],o,t):f(r.id,"method not found",t)):f(r.id,"service not found",t)}else if("objectId"in r){var s=k[r.objectId];s?!i in s?m(r.id,s,s[i],o,t):f(r.id,"method not found",t):f(r.id,"object not found",t)}else if("requestId"in r){var u=w[r.requestId];u&&"cancel"===i&&u.cancel&&u.cancel.apply(u,o)}else if("responseId"in r){var l=B[r.responseId];l&&"progress"===i&&l.progress&&l.progress.apply(l,o)}else{if("plugin"!==r.method)throw new Error("Bad method: "+r.method);var c=r.params[0];D({services:c.services})}}else if(r.id){var p=B[String(r.id)];p&&(delete B[String(r.id)],r.error?p.reject(r.error):p.resolve(r.result))}}catch(d){console.log("Plugin._messageHandler "+d)}}}function g(e){var n={};if(e.methods&&(e.methods.forEach(function(t){n[t]=function(){var n={serviceId:e.serviceId,method:t,params:Array.prototype.slice.call(arguments)};return d(n)}}),n.addEventListener&&n.removeEventListener&&t)){var i=new t,o=x++;k[o]={handleEvent:i.dispatchEvent.bind(i)};var a=new r(o,["handleEvent"]),s=n.addEventListener;n.addEventListener=function(e,t){i._namedListeners[e]||s(e,a),i.addEventListener(e,t)};var u=n.removeEventListener;n.removeEventListener=function(e,t){i.removeEventListener(e,t),i._namedListeners[e]||u(e,a)}}return n}function v(e){var t=JSON.parse(JSON.stringify(e.properties)),n=e.names||e.type||[];return Array.isArray(n)||(n=[n]),t.objectClass=n,t}function y(e){if(P){var t=g(e),n=v(e),r=P.registerService(e.names||e.type,t,n);T[e.serviceId]={registration:r,proxy:t}}}function D(e){var t=E||[];if(E=e.services||[],!n(E,t)){var r=[];E.forEach(function(e){var t=e.serviceId;r.push(t);var i=T[t];if(i){if(n(e.methods,Object.keys(i.proxy))){var o=v(e),a=i.registration.getReference(),s={};return a.getPropertyKeys().forEach(function(e){s[e]=a.getProperty(e)}),void(n(o,s)||i.registration.setProperties(o))}i.registration.unregister(),delete T[t]}y(e)}),Object.keys(T).forEach(function(e){-1===r.indexOf(e)&&(T[e].registration.unregister(),delete T[e])})}A&&(A(),A=null)}var E,A,C=i,F=!1,b=0,x=0,S=0,w={},B={},k={},_={},T={},P=o,j=[],L=!1,I=null;"undefined"==typeof window?self.postMessage?I=self:L=!0:window!==window.parent?I=window.parent:null!==window.opener&&(I=window.opener);var N=a,O=function(e){a({method:"error",error:p(e.error)})};addEventListener("error",O);var M,R=(new Date).getTime();u(),L&&self.addEventListener("connect",function(e){var t=e.ports[0];if(j.push(t),F){var n={method:"plugin",params:[l()]};a(n,t)}else u();t.addEventListener("message",function(e){h(e,t)}),t.start()}),this.updateHeaders=function(e){if(F)throw new Error("Cannot update headers. Plugin Provider is connected");C=e},this.registerService=function(e,t,n){if(F)throw new Error("Cannot register service. Plugin Provider is connected");"string"==typeof e?e=[e]:Array.isArray(e)||(e=[]);var r=null,i=[];for(r in t)"function"==typeof t[r]&&i.push(r);_[S++]={names:e,methods:i,implementation:t,properties:n||{},listeners:{}},u()},this.registerServiceProvider=this.registerService,this.connect=function(e,t){if(F)return void(e&&e());removeEventListener("error",O);var n={method:"plugin",params:[l()]};if(!L){if(!I)return void(t&&t("No valid plugin target"));addEventListener("message",h,!1),a(n)}if("undefined"!=typeof window){var r=document.getElementsByTagName("head")[0]||document.documentElement,i=r.getElementsByTagName("title")[0];i||(i=document.createElement("title"),i.textContent=C.name,r.appendChild(i))}j.forEach(function(e){a(n,e)}),F=!0,P?A=e:e&&e()},this.disconnect=function(){F&&(removeEventListener("message",h),j.forEach(function(e){e.close()}),j=null,I=null,F=!1)}}return i}),n("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(e,t){function n(e,t,n){this._properties=n||{},this._properties["service.id"]=e,this._properties.objectClass=t,this._properties["service.names"]=t}function r(e,t,n){this._serviceId=e,this._serviceReference=t,this._internalRegistry=n}function i(t,n){function r(r){return function(){var i;try{if(!n())throw new Error("Service was unregistered");var o=t[r].apply(t,Array.prototype.slice.call(arguments));if(o&&"function"==typeof o.then)return o;i=new e,i.resolve(o)}catch(a){i=new e,i.reject(a)}return i.promise}}var i;for(i in t)"function"==typeof t[i]&&(this[i]=r(i))}function o(e,t){this.type=e,this.serviceReference=t}function a(){this._entries=[],this._namedReferences={},this._serviceEventTarget=new t;var e=this;this._internalRegistry={isRegistered:function(t){return e._entries[t]?!0:!1},unregisterService:function(t){var n=e._entries[t];if(!n)throw new Error("Service has already been unregistered: "+t);var r=n.reference;e._serviceEventTarget.dispatchEvent(new o("unregistering",r)),e._entries[t]=null;var i=r.getProperty("objectClass");i.forEach(function(t){for(var n=e._namedReferences[t],i=0;i=48&&57>=e}function r(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function i(e){return"01234567".indexOf(e)>=0}function o(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function s(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Pn.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function u(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&Pn.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function l(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function c(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function p(e){return"eval"===e||"arguments"===e}function d(e){if(Ln&&c(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function f(e,n,r,i,o){var a;t("number"==typeof r,"Comment must have valid position"),Jn.lastCommentStart=r,a={type:e,value:n},zn.range&&(a.range=[r,i]),zn.loc&&(a.loc=o),zn.comments.push(a),zn.attachComment&&(zn.leadingComments.push(a),zn.trailingComments.push(a))}function m(e){var t,n,r,i;for(t=In-e,n={start:{line:Nn,column:In-On-e}};Hn>In;)if(r=jn.charCodeAt(In),++In,a(r))return Mn=!0,zn.comments&&(i=jn.slice(t+e,In-1),n.end={line:Nn,column:In-On-1},f("Line",i,t,In-1,n)),13===r&&10===jn.charCodeAt(In)&&++In,++Nn,void(On=In);zn.comments&&(i=jn.slice(t+e,In),n.end={line:Nn,column:In-On},f("Line",i,t,In,n))}function h(){var e,t,n,r;for(zn.comments&&(e=In-2,t={start:{line:Nn,column:In-On-2}});Hn>In;)if(n=jn.charCodeAt(In),a(n))13===n&&10===jn.charCodeAt(In+1)&&++In,Mn=!0,++Nn,++In,On=In;else if(42===n){if(47===jn.charCodeAt(In+1))return++In,++In,void(zn.comments&&(r=jn.slice(e+2,In-2),t.end={line:Nn,column:In-On},f("Block",r,e,In,t)));++In}else++In;In>=Hn&&zn.comments?(t.end={line:Nn,column:In-On},r=jn.slice(e+2,In),f("Block",r,e,In,t),Z()):Y()}function g(){var e,t;for(Mn=!1,t=0===In;Hn>In;)if(e=jn.charCodeAt(In),o(e))++In;else if(a(e))Mn=!0,++In,13===e&&10===jn.charCodeAt(In)&&++In,++Nn,On=In,t=!0;else if(47===e)if(e=jn.charCodeAt(In+1),47===e)++In,++In,m(2),t=!0;else{if(42!==e)break;++In,++In,h()}else if(t&&45===e){if(45!==jn.charCodeAt(In+1)||62!==jn.charCodeAt(In+2))break;In+=3,m(3)}else{if(60!==e)break;if("!--"!==jn.slice(In+1,In+4))break;++In,++In,++In,++In,m(4)}}function v(e){var t,n,i,o=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(Hn>In&&r(jn[In])))return"";i=jn[In++],o=16*o+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(o)}function y(){var e,t,n,i;for(e=jn[In],t=0,"}"===e&&Y();Hn>In&&(e=jn[In++],r(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Y(),65535>=t?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function D(){var e,t;for(e=jn.charCodeAt(In++),t=String.fromCharCode(e),92===e&&(117!==jn.charCodeAt(In)&&Y(),++In,e=v("u"),e&&"\\"!==e&&s(e.charCodeAt(0))||Y(),t=e);Hn>In&&(e=jn.charCodeAt(In),u(e));)++In,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==jn.charCodeAt(In)&&Y(),++In,e=v("u"),e&&"\\"!==e&&u(e.charCodeAt(0))||Y(),t+=e);return t}function E(){var e,t;for(e=In++;Hn>In;){if(t=jn.charCodeAt(In),92===t)return In=e,D();if(!u(t))break;++In}return jn.slice(e,In)}function A(){var e,t,n;return e=In,t=92===jn.charCodeAt(In)?D():E(),n=1===t.length?xn.Identifier:d(t)?xn.Keyword:"null"===t?xn.NullLiteral:"true"===t||"false"===t?xn.BooleanLiteral:xn.Identifier,{type:n,value:t,lineNumber:Nn,lineStart:On,start:e,end:In}}function C(){var e,t,n,r,i=In,o=jn.charCodeAt(In),a=jn[In];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++In,zn.tokenize&&(40===o?zn.openParenToken=zn.tokens.length:123===o&&(zn.openCurlyToken=zn.tokens.length)),{type:xn.Punctuator,value:String.fromCharCode(o),lineNumber:Nn,lineStart:On,start:i,end:In};default:if(e=jn.charCodeAt(In+1),61===e)switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return In+=2,{type:xn.Punctuator,value:String.fromCharCode(o)+String.fromCharCode(e),lineNumber:Nn,lineStart:On,start:i,end:In};case 33:case 61:return In+=2,61===jn.charCodeAt(In)&&++In,{type:xn.Punctuator,value:jn.slice(i,In),lineNumber:Nn,lineStart:On,start:i,end:In}}}if(r=jn.substr(In,4),">>>="===r)return In+=4,{type:xn.Punctuator,value:r,lineNumber:Nn,lineStart:On,start:i,end:In};if(n=r.substr(0,3),">>>"===n||"<<="===n||">>="===n)return In+=3,{type:xn.Punctuator,value:n,lineNumber:Nn,lineStart:On,start:i,end:In};if(t=n.substr(0,2),a===t[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t)return In+=2,{type:xn.Punctuator,value:t,lineNumber:Nn,lineStart:On,start:i,end:In};if("<>=!+-*%&|^/".indexOf(a)>=0)return++In,{type:xn.Punctuator,value:a,lineNumber:Nn,lineStart:On,start:i,end:In};++In;var s={type:xn.Punctuator,lineNumber:Nn,lineStart:On,start:i,end:In,value:jn.slice(i,In)};Y(s)}function F(e){for(var t="";Hn>In&&r(jn[In]);)t+=jn[In++];return 0===t.length&&Y(),s(jn.charCodeAt(In))&&Y(),{type:xn.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:Nn,lineStart:On,start:e,end:In}}function b(e){var t,r;for(r="";Hn>In&&(t=jn[In],"0"===t||"1"===t);)r+=jn[In++];return 0===r.length&&Y(),Hn>In&&(t=jn.charCodeAt(In),(s(t)||n(t))&&Y()),{type:xn.NumericLiteral,value:parseInt(r,2),lineNumber:Nn,lineStart:On,start:e,end:In}}function x(e,t){var r,o;for(i(e)?(o=!0,r="0"+jn[In++]):(o=!1,++In,r="");Hn>In&&i(jn[In]);)r+=jn[In++];return o||0!==r.length||Y(),(s(jn.charCodeAt(In))||n(jn.charCodeAt(In)))&&Y(),{type:xn.NumericLiteral,value:parseInt(r,8),octal:o,lineNumber:Nn,lineStart:On,start:t,end:In}}function S(){var e,t;for(e=In+1;Hn>e;++e){if(t=jn[e],"8"===t||"9"===t)return!1;if(!i(t))return!0}return!0}function w(){var e,r,o;if(o=jn[In],t(n(o.charCodeAt(0))||"."===o,"Numeric literal must start with a decimal digit or a decimal point"),r=In,e="","."!==o){if(e=jn[In++],o=jn[In],"0"===e){if("x"===o||"X"===o)return++In,F(r);if("b"===o||"B"===o)return++In,b(r);if("o"===o||"O"===o)return x(o,r);if(i(o)&&S())return x(o,r)}for(;n(jn.charCodeAt(In));)e+=jn[In++];o=jn[In]}if("."===o){for(e+=jn[In++];n(jn.charCodeAt(In));)e+=jn[In++];o=jn[In]}if("e"===o||"E"===o)if(e+=jn[In++],o=jn[In],("+"===o||"-"===o)&&(e+=jn[In++]),n(jn.charCodeAt(In)))for(;n(jn.charCodeAt(In));)e+=jn[In++];else Y();return s(jn.charCodeAt(In))&&Y(),{type:xn.NumericLiteral,value:parseFloat(e),lineNumber:Nn,lineStart:On,start:r,end:In}}function B(){var e,n,r,o,s,u,l="",c=!1;for(e=jn[In],t("'"===e||'"'===e,"String literal must starts with a quote"),n=In,++In;Hn>In;){if(r=jn[In++],r===e){e="";break}if("\\"===r)if(r=jn[In++],r&&a(r.charCodeAt(0)))++Nn,"\r"===r&&"\n"===jn[In]&&++In,On=In;else switch(r){case"u":case"x":"{"===jn[In]?(++In,l+=y()):(u=In,s=v(r),s?l+=s:(In=u,l+=r));break;case"n":l+="\n";break;case"r":l+="\r";break;case"t":l+=" ";break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+=" ";break;default:i(r)?(o="01234567".indexOf(r),0!==o&&(c=!0),Hn>In&&i(jn[In])&&(c=!0,o=8*o+"01234567".indexOf(jn[In++]),"0123".indexOf(r)>=0&&Hn>In&&i(jn[In])&&(o=8*o+"01234567".indexOf(jn[In++]))),l+=String.fromCharCode(o)):l+=r}else{if(a(r.charCodeAt(0)))break;l+=r}}var p={type:xn.StringLiteral,value:l,octal:c,lineNumber:Un,lineStart:Gn,start:n,end:In};return""!==e&&Z(p),p}function k(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){return parseInt(t,16)<=1114111?"x":void Y(null,Tn.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{RegExp(n)}catch(r){Y(null,Tn.InvalidRegExp)}try{return new RegExp(e,t)}catch(i){return null}}function _(){var e,n,r,i,o;for(e=jn[In],t("/"===e,"Regular expression literal must start with a slash"),n=jn[In++],r=!1,i=!1;Hn>In;)if(e=jn[In++],n+=e,"\\"===e)e=jn[In++],a(e.charCodeAt(0))&&Y(null,Tn.UnterminatedRegExp),n+=e;else if(a(e.charCodeAt(0)))Y(null,Tn.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){i=!0;break}"["===e&&(r=!0)}return i||Y(Kn,Tn.UnterminatedRegExp),o=n.substr(1,n.length-2),{value:o,literal:n}}function T(){var e,t,n,r;for(t="",n="";Hn>In&&(e=jn[In],u(e.charCodeAt(0)));)if(++In,"\\"===e&&Hn>In)if(e=jn[In],"u"===e){if(++In,r=In,e=v("u"))for(n+=e,t+="\\u";In>r;++r)t+=jn[r];else In=r,n+="u",t+="\\u";Z()}else t+="\\",Z();else n+=e,t+=e;return{value:n,literal:t}}function P(){Wn=!0;var e,t,n,r;return g(),e=In,t=_(),n=T(),r=k(t.value,n.value),Wn=!1,zn.tokenize?{type:xn.RegularExpression,value:r,regex:{pattern:t.value,flags:n.value},lineNumber:Nn,lineStart:On,start:e,end:In}:{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:In}}function j(){var e,t,n,r;return g(),e=In,t={start:{line:Nn,column:In-On}},n=P(),t.end={line:Nn,column:In-On},zn.tokenize||(zn.tokens.length>0&&(r=zn.tokens[zn.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&zn.tokens.pop()),zn.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,In],loc:t})),n}function L(e){return e.type===xn.Identifier||e.type===xn.Keyword||e.type===xn.BooleanLiteral||e.type===xn.NullLiteral}function I(){var e,t;if(e=zn.tokens[zn.tokens.length-1],!e)return j();if("Punctuator"===e.type){if("]"===e.value)return C();if(")"===e.value)return t=zn.tokens[zn.openParenToken-1],!t||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?C():j();if("}"===e.value){if(zn.tokens[zn.openCurlyToken-3]&&"Keyword"===zn.tokens[zn.openCurlyToken-3].type){if(t=zn.tokens[zn.openCurlyToken-4],!t)return C()}else{if(!zn.tokens[zn.openCurlyToken-4]||"Keyword"!==zn.tokens[zn.openCurlyToken-4].type)return C();if(t=zn.tokens[zn.openCurlyToken-5],!t)return j()}return wn.indexOf(t.value)>=0?C():j()}return j()}return"Keyword"===e.type&&"this"!==e.value?j():C()}function N(){var e;return In>=Hn?{type:xn.EOF,lineNumber:Nn,lineStart:On,start:In,end:In,range:[In,In]}:(e=jn.charCodeAt(In),s(e)?A():40===e||41===e||59===e?C():39===e||34===e?B():46===e?n(jn.charCodeAt(In+1))?w():C():n(e)?w():zn.tokenize&&47===e?I():C())}function O(){var e,t,n,r;return e={start:{line:Nn,column:In-On}},t=N(),e.end={line:Nn,column:In-On},t.type!==xn.EOF&&(n=jn.slice(t.start,t.end),r={type:Sn[t.type],value:n,range:[t.start,t.end],loc:e},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),zn.tokens.push(r)),t}function M(){var e;return Wn=!0,Rn=In,Vn=Nn,$n=On,g(),e=Kn,qn=In,Un=Nn,Gn=On,Kn="undefined"!=typeof zn.tokens?O():N(),Wn=!1,e}function R(){Wn=!0,g(),Rn=In,Vn=Nn,$n=On,qn=In,Un=Nn,Gn=On,Kn="undefined"!=typeof zn.tokens?O():N(),Wn=!1}function V(e){if(zn.deps)for(var t=e.length,n=0;t>n;n++)$(e[n])}function $(e){if(zn.deps&&e.type===Bn.Literal){for(var t=0;t1&&(r=t[1],r.type===Bn.ArrayExpression&&(zn.envs.node=!0,V(r.elements)))}else"requirejs"===e.name?(r=t[0],r.type===Bn.ArrayExpression&&(zn.envs.amd=!0,V(r.elements))):"define"===e.name&&n>1&&(r=t[0],r.type===Bn.Literal&&(r=t[1]),r.type===Bn.ArrayExpression&&(zn.envs.amd=!0,V(r.elements)))}}function U(){this.line=Un,this.column=qn-Gn}function G(){this.start=new U,this.end=null}function W(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function H(){zn.loc&&(this.loc=new G),zn.range&&(this.range=[qn,0]),zn.directSourceFile&&(this.sourceFile=zn.directSourceFile)}function K(e){zn.loc&&(this.loc=new W(e)),zn.range&&(this.range=[e.start,0]),zn.directSourceFile&&(this.sourceFile=zn.directSourceFile)}function J(e,t,n,r){var i=new Error("Line "+e+": "+n);if(i.index=t,i.lineNumber=e,i.column=t-(Wn?On:$n)+1,i.description=n,r){var o=r;2===r.type&&zn&&Array.isArray(zn.tokens)&&zn.tokens.length>0&&(o=zn.tokens[zn.tokens.length-1]),i.index="number"==typeof o.start?o.start:o.range[0],i.token=o.value,i.end="number"==typeof o.end?o.end:o.range[1]}return i}function z(e){var n,r;throw n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r0&&(t=zn.tokens[zn.tokens.length-2]),Z(t,Tn.MissingToken,n)}else t.type!==xn.EOF&&(zn.tokens&&zn.tokens.length>0&&(t=zn.tokens[zn.tokens.length-2]),Z(t,Tn.MissingToken,","));else et(",")}function nt(e){var t=M();(t.type!==xn.Keyword||t.value!==e)&&Y(t)}function rt(e){return Kn.type===xn.Punctuator&&Kn.value===e -}function it(e){return Kn.type===xn.Keyword&&Kn.value===e}function ot(){var e;return Kn.type!==xn.Punctuator?!1:(e=Kn.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function at(){try{if(59===jn.charCodeAt(qn)||rt(";"))return void M();if(Mn)return;if(Rn=qn,Vn=Un,$n=Gn,Kn.type!==xn.EOF&&!rt("}")){var e=Kn;zn.errors&&En(Gn),Y(e)}}catch(t){if(zn.errors)return void vn(t);throw t}}function st(e){return e.type===Bn.Identifier||e.type===Bn.MemberExpression}function ut(){var e=[],t=new H;for(et("[");!rt("]");)rt(",")?(M(),e.push(null)):(e.push(_t()),rt("]")||et(","));return M(),t.finishArrayExpression(e)}function lt(e,t){var n,r,i=new H;return n=Ln,r=rn(),t&&Ln&&p(e[0].name)&&Z(t,Tn.StrictParamName),Ln=n,i.finishFunctionExpression(null,e,[],r)}function ct(){var e,t=new H;return e=M(),e.type===xn.StringLiteral||e.type===xn.NumericLiteral?(Ln&&e.octal&&Z(e,Tn.StrictOctalLiteral),t.finishLiteral(e)):t.finishIdentifier(e.value)}function pt(){var e,t,n,r,i,o=new H;return e=Kn,e.type===xn.Identifier?(n=ct(),"get"!==e.value||rt(":")||rt("(")?"set"!==e.value||rt(":")||rt("(")?bn(e,n,o):(t=ct(),et("("),e=Kn,e.type!==xn.Identifier?(et(")"),Z(e),r=lt([])):(i=[Lt()],et(")"),r=lt(i,e)),o.finishProperty("set",t,r,!1,!1)):(t=ct(),et("("),et(")"),r=lt([]),o.finishProperty("get",t,r,!1,!1))):e.type!==xn.EOF&&e.type!==xn.Punctuator?bn(e,ct(),o):void Y(e)}function dt(){var e,t,n,r,i=[],o={},a=String,s=new H;for(et("{");!rt("}");)e=pt(),null!=e&&"undefined"!=typeof e&&(t=e.key.type===Bn.Identifier?e.key.name:a(e.key.value),r="init"===e.kind?_n.Data:"get"===e.kind?_n.Get:_n.Set,n="$"+t,Object.prototype.hasOwnProperty.call(o,n)?(o[n]===_n.Data?Ln&&r===_n.Data?Q(Tn.StrictDuplicateProperty):r!==_n.Data&&Q(Tn.AccessorDataProperty):r===_n.Data?Q(Tn.AccessorDataProperty):o[n]&r&&Q(Tn.AccessorGetSet),o[n]|=r):o[n]=r,i.push(e),rt("}")||tt("}"));return et("}"),s.finishObjectExpression(i)}function ft(){var e;return et("("),rt(")")?(M(),kn.ArrowParameterPlaceHolder):(++Jn.parenthesisCount,e=Tt(),et(")"),e)}function mt(){var e,t,n,r;if(rt("("))return ft();if(rt("["))return ut();if(rt("{"))return dt();if(e=Kn.type,r=new H,e===xn.Identifier)n=r.finishIdentifier(M().value);else if(e===xn.StringLiteral||e===xn.NumericLiteral)Ln&&Kn.octal&&Z(Kn,Tn.StrictOctalLiteral),n=r.finishLiteral(M());else if(e===xn.Keyword){if(it("function"))return ln();it("this")?(M(),n=r.finishThisExpression()):Y(M())}else e===xn.BooleanLiteral?(t=M(),t.value="true"===t.value,n=r.finishLiteral(t)):e===xn.NullLiteral?(t=M(),t.value=null,n=r.finishLiteral(t)):rt("/")||rt("/=")?(In=qn,t="undefined"!=typeof zn.tokens?j():P(),M(),n=r.finishLiteral(t)):Y(M());return n}function ht(){var e=[];if(et("("),!rt(")"))for(;Hn>qn&&(e.push(_t()),!rt(")"));)tt(")");return gn(")"),e}function gt(){var e,t=new H;try{e=M(),L(e)||(zn.errors&&Cn(e),Y(e))}catch(n){if(zn.errors)return vn(n),Fn(t,Bn.Identifier);throw n}return t.finishIdentifier(e.value)}function vt(){return et("."),gt()}function yt(){var e;return et("["),e=Tt(),et("]"),e}function Dt(){var e,t,n=new H;return nt("new"),e=At(),t=rt("(")?ht():[],n.finishNewExpression(e,t)}function Et(){var e,t,n,r,i=Jn.allowIn;for(r=Kn,Jn.allowIn=!0,e=it("new")?Dt():mt();;)if(rt("."))n=vt(),e=new K(r).finishMemberExpression(".",e,n);else if(rt("("))t=ht(),e=new K(r).finishCallExpression(e,t);else{if(!rt("["))break;n=yt(),e=new K(r).finishMemberExpression("[",e,n)}return Jn.allowIn=i,e}function At(){var e,n,r;for(t(Jn.allowIn,"callee of new expression always allow in keyword."),r=Kn,e=it("new")?Dt():mt();;)if(rt("["))n=yt(),e=new K(r).finishMemberExpression("[",e,n);else{if(!rt("."))break;n=vt(),e=new K(r).finishMemberExpression(".",e,n)}return e}function Ct(){var e,t,n=Kn;return e=Et(),Mn||Kn.type!==xn.Punctuator||(rt("++")||rt("--"))&&(Ln&&e.type===Bn.Identifier&&p(e.name)&&Q(Tn.StrictLHSPostfix),st(e)||Q(Tn.InvalidLHSInAssignment),t=M(),e=new K(n).finishPostfixExpression(t.value,e)),e}function Ft(){var e,t,n;return Kn.type!==xn.Punctuator&&Kn.type!==xn.Keyword?t=Ct():rt("++")||rt("--")?(n=Kn,e=M(),t=Ft(),Ln&&t.type===Bn.Identifier&&p(t.name)&&Q(Tn.StrictLHSPrefix),st(t)||Q(Tn.InvalidLHSInAssignment),t=new K(n).finishUnaryExpression(e.value,t)):rt("+")||rt("-")||rt("~")||rt("!")?(n=Kn,e=M(),t=Ft(),t=new K(n).finishUnaryExpression(e.value,t)):it("delete")||it("void")||it("typeof")?(n=Kn,e=M(),t=Ft(),t=new K(n).finishUnaryExpression(e.value,t),Ln&&"delete"===t.operator&&t.argument.type===Bn.Identifier&&Q(Tn.StrictDelete)):t=Ct(),t}function bt(e,t){var n=0;if(e.type!==xn.Punctuator&&e.type!==xn.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=t?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function xt(){var e,t,n,r,i,o,a,s,u,l;if(e=Kn,u=Ft(),u===kn.ArrowParameterPlaceHolder)return u;if(r=Kn,i=bt(r,Jn.allowIn),0===i)return u;for(r.prec=i,M(),t=[e,Kn],a=Ft(),o=[u,r,a];(i=bt(Kn,Jn.allowIn))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=new K(t[t.length-1]).finishBinaryExpression(s,u,a),o.push(n);r=M(),r.prec=i,o.push(r),t.push(Kn),n=Ft(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)n=new K(t.pop()).finishBinaryExpression(o[l-1].value,o[l-2],n),l-=2;return n}function St(){var e,t,n,r,i;return i=Kn,e=xt(),e===kn.ArrowParameterPlaceHolder?e:(rt("?")&&(M(),t=Jn.allowIn,Jn.allowIn=!0,n=_t(),Jn.allowIn=t,et(":"),r=_t(),e=new K(i).finishConditionalExpression(e,n,r)),e)}function wt(){return rt("{")?rn():_t()}function Bt(e){var t,n,r,i,o,a,s,u,l;for(i=[],o=[],a=0,u=null,s={paramSet:{}},t=0,n=e.length;n>t;t+=1)if(r=e[t],r.type===Bn.Identifier)i.push(r),o.push(null),on(s,r,r.name);else{if(r.type!==Bn.AssignmentExpression)return null;i.push(r.left),o.push(r.right),++a,on(s,r.left,r.left.name)}return s.message===Tn.StrictParamDupe&&(l=Ln?s.stricted:s.firstRestricted,Y(l,s.message)),0===a&&(o=[]),{params:i,defaults:o,rest:u,stricted:s.stricted,firstRestricted:s.firstRestricted,message:s.message}}function kt(e,t){var n,r;return et("=>"),n=Ln,r=wt(),Ln&&e.firstRestricted&&Y(e.firstRestricted,e.message),Ln&&e.stricted&&Z(e.stricted,e.message),Ln=n,t.finishArrowFunctionExpression(e.params,e.defaults,r,r.type!==Bn.BlockStatement)}function _t(){var e,t,n,r,i,o;return e=Jn.parenthesisCount,o=Kn,t=Kn,n=St(),n!==kn.ArrowParameterPlaceHolder&&!rt("=>")||Jn.parenthesisCount!==e&&Jn.parenthesisCount!==e+1||(n.type===Bn.Identifier?i=Bt([n]):n.type===Bn.AssignmentExpression?i=Bt([n]):n.type===Bn.SequenceExpression?i=Bt(n.expressions):n===kn.ArrowParameterPlaceHolder&&(i=Bt([])),!i)?(ot()&&(st(n)||Q(Tn.InvalidLHSInAssignment),Ln&&n.type===Bn.Identifier&&p(n.name)&&Z(t,Tn.StrictLHSAssignment),t=M(),r=_t(),n=new K(o).finishAssignmentExpression(t.value,n,r)),n):kt(i,new K(o))}function Tt(){var e,t,n=Kn;if(e=_t(),rt(",")){for(t=[e];Hn>qn&&rt(",");)M(),t.push(_t());e=new K(n).finishSequenceExpression(t)}return e}function Pt(){for(var e,t=[],n=In;Hn>qn&&!rt("}")&&(e=cn(),"undefined"!=typeof e&&n!==In);)t.push(e),n=In;return t}function jt(){var e,t=new H;return et("{"),e=Pt(),gn("}"),t.finishBlockStatement(e)}function Lt(){var e,t=new H;return e=M(),e.type!==xn.Identifier&&(Ln&&e.type===xn.Keyword&&c(e.value)?Z(e,Tn.StrictReservedWord):Y(e)),t.finishIdentifier(e.value)}function It(e){var t,n=null,r=new H;return t=Lt(),Ln&&p(t.name)&&Q(Tn.StrictVarName),"const"===e?(et("="),n=_t()):rt("=")&&(M(),n=_t()),r.finishVariableDeclarator(t,n)}function Nt(e){var t=[];do{if(t.push(It(e)),!rt(","))break;M()}while(Hn>qn);return t}function Ot(e){var t;return nt("var"),t=Nt(),at(),e.finishVariableDeclaration(t,"var")}function Mt(e){var t,n=new H;return nt(e),t=Nt(e),at(),n.finishVariableDeclaration(t,e)}function Rt(){var e=new H;return et(";"),e.finishEmptyStatement()}function Vt(e){var t=Tt();return at(),t||(t=Fn(e)),e.finishExpressionStatement(t)}function $t(e){var t,n,r;return nt("if"),et("("),t=Tt(),gn(")","{"),n=nn(),it("else")?(M(),r=nn()):r=null,e.finishIfStatement(t,n,r)}function qt(e){var t,n,r;return nt("do"),r=Jn.inIteration,Jn.inIteration=!0,t=nn(),Jn.inIteration=r,nt("while"),et("("),n=Tt(),gn(")","{"),rt(";")&&M(),e.finishDoWhileStatement(t,n)}function Ut(e){var t,n,r;return nt("while"),et("("),t=Tt(),gn(")","{"),r=Jn.inIteration,Jn.inIteration=!0,n=nn(),Jn.inIteration=r,e.finishWhileStatement(t,n)}function Gt(){var e,t,n=new H;return e=M(),t=Nt(),n.finishVariableDeclaration(t,e.value)}function Wt(e){var t,n,r,i,o,a,s,u=Jn.allowIn;return t=n=r=null,nt("for"),et("("),rt(";")?M():(it("var")||it("let")?(Jn.allowIn=!1,t=Gt(),Jn.allowIn=u,1===t.declarations.length&&it("in")&&(M(),i=t,o=Tt(),t=null)):(Jn.allowIn=!1,t=Tt(),Jn.allowIn=u,it("in")&&(st(t)||Q(Tn.InvalidLHSInForIn),M(),i=t,o=Tt(),t=null)),"undefined"==typeof i&&et(";")),"undefined"==typeof i&&(rt(";")||(n=Tt()),et(";"),rt(")")||(r=Tt())),gn(")","{"),s=Jn.inIteration,Jn.inIteration=!0,a=nn(),Jn.inIteration=s,"undefined"==typeof i?e.finishForStatement(t,n,r,a):e.finishForInStatement(i,o,a)}function Ht(e){var t,n=null;if(nt("continue"),59===jn.charCodeAt(qn))return M(),Jn.inIteration||z(Tn.IllegalContinue),e.finishContinueStatement(null);if(Mn)return Jn.inIteration||z(Tn.IllegalContinue),e.finishContinueStatement(null);if(Kn.type===xn.Identifier){var r=Kn;n=Lt(),t="$"+n.name,Object.prototype.hasOwnProperty.call(Jn.labelSet,t)||Z(r,Tn.UnknownLabel,n.name)}return at(),null!==n||Jn.inIteration||z(Tn.IllegalContinue),e.finishContinueStatement(n)}function Kt(e){var t,n=null;return nt("break"),59===jn.charCodeAt(Rn)?(M(),Jn.inIteration||Jn.inSwitch||z(Tn.IllegalBreak),e.finishBreakStatement(null)):Mn?(Jn.inIteration||Jn.inSwitch||z(Tn.IllegalBreak),e.finishBreakStatement(null)):(Kn.type===xn.Identifier&&(n=Lt(),t="$"+n.name,Object.prototype.hasOwnProperty.call(Jn.labelSet,t)||z(Tn.UnknownLabel,n.name)),at(),null!==n||Jn.inIteration||Jn.inSwitch||z(Tn.IllegalBreak),e.finishBreakStatement(n))}function Jt(e){var t=null,n=Kn;return nt("return"),Jn.inFunctionBody||Z(n,Tn.IllegalReturn,n.value),32===jn.charCodeAt(Rn)&&s(jn.charCodeAt(Rn+1))?(t=Tt(),at(),e.finishReturnStatement(t)):Mn?e.finishReturnStatement(null):(rt(";")||rt("}")||Kn.type===xn.EOF||(t=Tt()),at(),e.finishReturnStatement(t))}function zt(e){var t,n;return Ln&&Q(Tn.StrictModeWith),nt("with"),et("("),t=Tt(),gn(")","{"),n=nn(),e.finishWithStatement(t,n)}function Qt(){var e,t,n=[],r=new H;it("default")?(M(),e=null):(nt("case"),e=Tt()),rt(":")&&M();for(var i=In;Hn>qn&&!(rt("}")||it("default")||it("case"))&&(t=nn(),"undefined"!=typeof t&&null!==t)&&(n.push(t),i!==In);)i=In;return r.finishSwitchCase(e,n)}function Xt(e){var t,n,r,i,o;if(nt("switch"),et("("),t=Tt(),et(")"),et("{"),n=[],rt("}"))return M(),e.finishSwitchStatement(t,n);for(i=Jn.inSwitch,Jn.inSwitch=!0,o=!1;Hn>qn&&!rt("}");)r=Qt(),null===r.test&&(o&&z(Tn.MultipleDefaultsInSwitch),o=!0),n.push(r);return Jn.inSwitch=i,et("}"),e.finishSwitchStatement(t,n)}function Yt(e){var t;return nt("throw"),Mn&&z(Tn.NewlineAfterThrow),t=Tt(),at(),e.finishThrowStatement(t)}function Zt(){var e,t,n=new H;return nt("catch"),et("("),rt(")")&&Y(Kn),e=Lt(),Ln&&p(e.name)&&Q(Tn.StrictCatchVariable),et(")"),t=jt(),n.finishCatchClause(e,t)}function en(e){var t,n=[],r=null;return nt("try"),t=jt(),it("catch")&&n.push(Zt()),it("finally")&&(M(),r=jt()),0!==n.length||r||z(Tn.NoCatchOrFinally),e.finishTryStatement(t,[],n,r)}function tn(e){return nt("debugger"),at(),e.finishDebuggerStatement()}function nn(){var e,t,n,r,i=Kn.type;if(i===xn.EOF&&Y(Kn),i===xn.Punctuator&&"{"===Kn.value)return jt();if(r=new H,i===xn.Punctuator)switch(Kn.value){case";":return Rt(r);case"(":return Vt(r)}else if(i===xn.Keyword)switch(Kn.value){case"break":return Kt(r);case"continue":return Ht(r);case"debugger":return tn(r);case"do":return qt(r);case"for":return Wt(r);case"function":return un(r);case"if":return $t(r);case"return":return Jt(r);case"switch":return Xt(r);case"throw":return Yt(r);case"try":return en(r);case"var":return Ot(r);case"while":return Ut(r);case"with":return zt(r)}return e=Tt(),e&&e.type===Bn.Identifier&&rt(":")?(M(),n="$"+e.name,Object.prototype.hasOwnProperty.call(Jn.labelSet,n)&&z(Tn.Redeclaration,"Label",e.name),Jn.labelSet[n]=!0,t=nn(),delete Jn.labelSet[n],r.finishLabeledStatement(e,t)):(at(),e||(e=Fn(r)),r.finishExpressionStatement(e))}function rn(){var e,t,n,r,i,o,a,s,u,l=[],c=new H;for(et("{");Hn>qn&&Kn.type===xn.StringLiteral&&(t=Kn,e=cn(),l.push(e),e.expression.type===Bn.Literal);)n=jn.slice(t.start+1,t.end-1),"use strict"===n?(Ln=!0,r&&Z(r,Tn.StrictOctalLiteral)):!r&&t.octal&&(r=t);i=Jn.labelSet,o=Jn.inIteration,a=Jn.inSwitch,s=Jn.inFunctionBody,u=Jn.parenthesizedCount,Jn.labelSet={},Jn.inIteration=!1,Jn.inSwitch=!1,Jn.inFunctionBody=!0,Jn.parenthesizedCount=0;for(var p=In;Hn>In&&!rt("}")&&(e=cn(),"undefined"!=typeof e&&null!=e)&&(l.push(e),p!==In);)p=In;return gn("}"),Jn.labelSet=i,Jn.inIteration=o,Jn.inSwitch=a,Jn.inFunctionBody=s,Jn.parenthesizedCount=u,c.finishBlockStatement(l)}function on(e,t,n){var r="$"+n;Ln?(p(n)&&(e.stricted=t,e.message=Tn.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=Tn.StrictParamDupe)):e.firstRestricted||(p(n)?(e.firstRestricted=t,e.message=Tn.StrictParamName):c(n)?(e.firstRestricted=t,e.message=Tn.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.firstRestricted=t,e.message=Tn.StrictParamDupe)),e.paramSet[r]=!0}function an(e){var t,n,r;return t=Kn,n=Lt(),on(e,t,t.value),rt("=")&&(M(),r=_t(),++e.defaultCount),e.params.push(n),e.defaults.push(r),!rt(")")}function sn(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},et("("),!rt(")"))for(t.paramSet={};Hn>qn&&an(t);)et(",");return et(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function un(){var e,t,n,r,i,o,a,s,u=[],l=[],d=new H;return nt("function"),n=Kn,e=Lt(),Ln?p(n.value)&&Z(n,Tn.StrictFunctionName):p(n.value)?(o=n,a=Tn.StrictFunctionName):c(n.value)&&(o=n,a=Tn.StrictReservedWord),i=sn(o),u=i.params,l=i.defaults,r=i.stricted,o=i.firstRestricted,i.message&&(a=i.message),s=Ln,t=rn(),Ln&&o&&Y(o,a),Ln&&r&&Z(r,a),Ln=s,d.finishFunctionDeclaration(e,u,l,t)}function ln(){var e,t,n,r,i,o,a,s=null,u=[],l=[],d=new H;return nt("function"),rt("(")||(e=Kn,s=Lt(),Ln?p(e.value)&&Z(e,Tn.StrictFunctionName):p(e.value)?(n=e,r=Tn.StrictFunctionName):c(e.value)&&(n=e,r=Tn.StrictReservedWord)),i=sn(n),u=i.params,l=i.defaults,t=i.stricted,n=i.firstRestricted,i.message&&(r=i.message),a=Ln,o=rn(),Ln&&n&&Y(n,r),Ln&&t&&Z(t,r),Ln=a,d.finishFunctionExpression(s,u,l,o)}function cn(){if(Kn.type===xn.Keyword)switch(Kn.value){case"const":case"let":return Mt(Kn.value);case"function":return un();default:return nn()}return Kn.type!==xn.EOF?nn():void 0}function pn(){for(var e,t,n,r,i=[];Hn>qn&&(t=Kn,t.type===xn.StringLiteral)&&(e=cn(),i.push(e),e.expression.type===Bn.Literal);)n=jn.slice(t.start+1,t.end-1),"use strict"===n?(Ln=!0,r&&Z(r,Tn.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(var o=In;Hn>qn&&(e=cn(),"undefined"!=typeof e&&null!==e)&&(i.push(e),o!==In);)o=In;return i}function dn(){var e,t;return R(),t=new H,Ln=!1,e=pn(),t.finishProgram(e)}function fn(){var e,t,n,r=[];for(e=0;e0?1:0,On=0,qn=In,Un=Nn,Gn=On,Hn=jn.length,Kn=null,Jn={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},zn={},t=t||{},t.tokens=!0,zn.tokens=[],zn.tokenize=!0,zn.openParenToken=-1,zn.openCurlyToken=-1,zn.range="boolean"==typeof t.range&&t.range,zn.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&(zn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(zn.errors=[]);try{if(R(),Kn.type===xn.EOF)return zn.tokens;for(M();Kn.type!==xn.EOF;)try{M()}catch(i){if(zn.errors){zn.errors.push(i);break}throw i}fn(),r=zn.tokens,"undefined"!=typeof zn.comments&&(r.comments=zn.comments),"undefined"!=typeof zn.errors&&(r.errors=zn.errors)}catch(o){throw o}finally{zn={}}return r}function hn(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),jn=e,In=0,Nn=jn.length>0?1:0,On=0,qn=In,Un=Nn,Gn=On,Hn=jn.length,Kn=null,Jn={allowIn:!0,labelSet:{},parenthesisCount:0,inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},zn={},"undefined"!=typeof t&&("boolean"==typeof t.deps&&t.deps&&(zn.deps=[],zn.envs=Object.create(null)),zn.range="boolean"==typeof t.range&&t.range,zn.loc="boolean"==typeof t.loc&&t.loc,zn.attachComment="boolean"==typeof t.attachComment&&t.attachComment,zn.loc&&null!==t.source&&void 0!==t.source&&(zn.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(zn.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(zn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(zn.errors=[],zn.parseStatement=nn,zn.parseExpression=Tt,nn=Dn(nn),Tt=yn(Tt)),zn.attachComment&&(zn.range=!0,zn.comments=[],zn.bottomRightStack=[],zn.trailingComments=[],zn.leadingComments=[]),zn.directSourceFile=t.directSourceFile);try{n=dn(),"undefined"!=typeof zn.comments&&(n.comments=zn.comments),"undefined"!=typeof zn.tokens&&(fn(),n.tokens=zn.tokens),"undefined"!=typeof zn.errors&&(n.errors=zn.errors),"undefined"!=typeof zn.deps&&(n.dependencies=zn.deps,n.environments=zn.envs)}catch(i){throw i}finally{"undefined"!=typeof zn.errors&&(nn=zn.parseStatement,Tt=zn.parseExpression),zn={}}return n}function gn(e,t){try{et(e)}catch(n){if(!zn.errors)throw n;vn(n),t&&jn[n.index]===t&&(In=n.index,R())}}function vn(e){for(var t=zn.errors.length,n=0;t>n;n++){var r=zn.errors[n];if(r.index===e.index&&r.message===e.message)return}zn.errors.push(e)}function yn(e){return function(){try{return e.apply(null,arguments)}catch(t){vn(t)}}}function Dn(e){return function(){zn.statementStart=In;try{return e.apply(null,arguments)}catch(t){vn(t)}}}function En(e){for(var t=e;t>-1&&";"!==jn[t]&&"\n"!==jn[t];)t--;if(!(t<=zn.statementStart)){var n=!1;zn.lastRewindLocation?n=!0:zn.lastRewindLocation!==t&&(n=!0),n&&(In=t,An(e),R(),zn.lastRewindLocation=In)}}function An(e,t){for(var n=zn.tokens.length-1;n>-1;){var r=zn.tokens[n];if(r.range[0]",Sn[xn.Identifier]="Identifier",Sn[xn.Keyword]="Keyword",Sn[xn.NullLiteral]="Null",Sn[xn.NumericLiteral]="Numeric",Sn[xn.Punctuator]="Punctuator",Sn[xn.StringLiteral]="String",Sn[xn.RegularExpression]="RegularExpression",wn=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],Bn={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},kn={ArrowParameterPlaceHolder:{type:"ArrowParameterPlaceHolder"}},_n={Data:1,Get:2,Set:4},Tn={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingToken:"Missing expected '%0'"},Pn={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},K.prototype=H.prototype={processComment:function(){var e,t,n,r,i,o=zn.bottomRightStack,a=o[o.length-1];if(!(this.type===Bn.Program&&this.body.length>0)){if(zn.trailingComments.length>0){for(n=[],r=zn.trailingComments.length-1;r>=0;--r)i=zn.trailingComments[r],i.range[0]>=this.range[1]&&(n.unshift(i),zn.trailingComments.splice(r,1));zn.trailingComments=[]}else a&&a.trailingComments&&a.trailingComments[0].range[0]>=this.range[1]&&(n=a.trailingComments,delete a.trailingComments);if(a)for(;a&&a.range[0]>=this.range[0];)e=a,a=o.pop();if(e)e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=this.range[0]&&(this.leadingComments=e.leadingComments,e.leadingComments=void 0);else if(zn.leadingComments.length>0)for(t=[],r=zn.leadingComments.length-1;r>=0;--r)i=zn.leadingComments[r],i.range[1]<=this.range[0]&&(t.unshift(i),zn.leadingComments.splice(r,1));t&&t.length>0&&(this.leadingComments=t),n&&n.length>0&&(this.trailingComments=n),o.push(this)}},finish:function(){zn.loc&&(this.loc.end={line:Vn,column:Rn-$n},zn.source&&(this.loc.source=zn.source)),zn.range&&(this.range[1]=Rn,this.start=this.range[0],this.end=Rn),zn.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=Bn.ArrayExpression,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,n,r){return this.type=Bn.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=n,this.rest=null,this.generator=!1,this.expression=r,this.finish(),this},finishAssignmentExpression:function(e,t,n){return this.type=Bn.AssignmentExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBinaryExpression:function(e,t,n){return this.type="||"===e||"&&"===e?Bn.LogicalExpression:Bn.BinaryExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBlockStatement:function(e){return this.type=Bn.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=Bn.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=Bn.CallExpression,this.callee=e,this.arguments=t,q(e,t),this.finish(),this},finishCatchClause:function(e,t){return this.type=Bn.CatchClause,this.param=e,this.body=t,this.finish(),this},finishConditionalExpression:function(e,t,n){return this.type=Bn.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishContinueStatement:function(e){return this.type=Bn.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=Bn.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=Bn.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=Bn.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=Bn.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,n,r){return this.type=Bn.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r,this.finish(),this},finishForInStatement:function(e,t,n){return this.type=Bn.ForInStatement,this.left=e,this.right=t,this.body=n?n:Fn(this,"Statement"),this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,n,r){return this.type=Bn.FunctionDeclaration,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,n,r){return this.type=Bn.FunctionExpression,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=Bn.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,n){return this.type=Bn.IfStatement,this.test=e,this.consequent=t?t:Fn(this,"Statement"),this.alternate=n,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=Bn.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=Bn.Literal,this.value=e.value,this.raw=jn.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,n){return this.type=Bn.MemberExpression,this.computed="["===e,this.object=t,this.property=n,this.finish(),this},finishNewExpression:function(e,t){return this.type=Bn.NewExpression,this.callee=e,this.arguments=t,q(e,t),this.finish(),this},finishObjectExpression:function(e){return this.type=Bn.ObjectExpression,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=Bn.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e){return this.type=Bn.Program,this.body=e,this.finish(),this},finishProperty:function(e,t,n,r,i){return this.type=Bn.Property,this.key=t,this.value=n,this.kind=e,this.method=r,this.shorthand=i,this.finish(),this},finishReturnStatement:function(e){return this.type=Bn.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=Bn.SequenceExpression,this.expressions=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=Bn.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=Bn.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishThisExpression:function(){return this.type=Bn.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=Bn.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,n,r){return this.type=Bn.TryStatement,this.block=e,this.guardedHandlers=t,this.handlers=n,Array.isArray(n)&&n.length>0&&(this.handler=n[0]),this.finalizer=r,this.finish(),this -},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?Bn.UpdateExpression:Bn.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e,t){return this.type=Bn.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=Bn.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=Bn.WhileStatement,this.test=e,this.body=t?t:Fn(this,"Statement"),this.finish(),this},finishWithStatement:function(e,t){return this.type=Bn.WithStatement,this.object=e,this.body=t?t:Fn(this,"Statement"),this.finish(),this}},e.version="2.0.0",e.tokenize=mn,e.parse=hn,e.isIdentifierPart=u,e.isIdentifierStart=s,e.isIdentifierChar=u,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in Bn)Bn.hasOwnProperty(e)&&(t[e]=Bn[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof n&&n.amd)n("estraverse/estraverse",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.estraverse=e()}}(function(){return function e(n,r,i){function o(s,u){if(!r[s]){if(!n[s]){var l="function"==typeof t&&t;if(!u&&l)return l(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[s]={exports:{}};n[s][0].call(p.exports,function(e){var t=n[s][1][e];return o(t?t:e)},p,p.exports,e,n,r,i)}return r[s].exports}for(var a="function"==typeof t&&t,s=0;s>>1,o=i+n,t(e[o])?r=n:(i=o+1,r-=n+1);return i}function s(e,t){var n,r,i,o;for(r=e.length,i=0;r;)n=r>>>1,o=i+n,t(e[o])?(i=o+1,r-=n+1):r=n;return i}function u(e,t){var n,r,i,o=F(t);for(r=0,i=o.length;i>r;r+=1)n=o[r],e[n]=t[n];return e}function l(e,t){this.parent=e,this.key=t}function c(e,t,n,r){this.node=e,this.path=t,this.wrap=n,this.ref=r}function p(){}function d(e){return null==e?!1:"object"==typeof e&&"string"==typeof e.type}function f(e,t){return(e===y.ObjectExpression||e===y.ObjectPattern)&&"properties"===t}function m(e,t){var n=new p;return n.traverse(e,t)}function h(e,t){var n=new p;return n.replace(e,t)}function g(e,t){var n;return n=a(t,function(t){return t.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],n!==t.length&&(e.extendedRange[1]=t[n].range[0]),n-=1,n>=0&&(e.extendedRange[0]=t[n].range[1]),e}function v(e,t,n){var r,o,a,s,u=[];if(!e.range)throw new Error("attachComments needs range information");if(!n.length){if(t.length){for(a=0,o=t.length;o>a;a+=1)r=i(t[a]),r.extendedRange=[0,e.range[0]],u.push(r);e.leadingComments=u}return e}for(a=0,o=t.length;o>a;a+=1)u.push(g(i(t[a]),n));return s=0,m(e,{enter:function(e){for(var t;se.range[0]));)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),u.splice(s,1)):s+=1;return s===u.length?E.Break:u[s].extendedRange[0]>e.range[1]?E.Skip:void 0}}),s=0,m(e,{leave:function(e){for(var t;se.range[1]?E.Skip:void 0}}),e}var y,D,E,A,C,F,b,x,S;return D=Array.isArray,D||(D=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),n(o),n(s),C=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}(),F=Object.keys||function(e){var t,n=[];for(t in e)n.push(t);return n},y={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},A={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","body"],FunctionExpression:["id","params","defaults","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},b={},x={},S={},E={Break:b,Skip:x,Remove:S},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return D(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},p.prototype.path=function(){function e(e,t){if(D(t))for(r=0,i=t.length;i>r;++r)e.push(t[r]);else e.push(t)}var t,n,r,i,o,a;if(!this.__current.path)return null;for(o=[],t=2,n=this.__leavelist.length;n>t;++t)a=this.__leavelist[t],e(o,a.path);return e(o,this.__current.path),o},p.prototype.type=function(){var e=this.current();return e.type||this.__current.wrap},p.prototype.parents=function(){var e,t,n;for(n=[],e=1,t=this.__leavelist.length;t>e;++e)n.push(this.__leavelist[e].node);return n},p.prototype.current=function(){return this.__current.node},p.prototype.__execute=function(e,t){var n,r;return r=void 0,n=this.__current,this.__current=t,this.__state=null,e&&(r=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=n,r},p.prototype.notify=function(e){this.__state=e},p.prototype.skip=function(){this.notify(x)},p.prototype["break"]=function(){this.notify(b)},p.prototype.remove=function(){this.notify(S)},p.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback="iteration"===t.fallback,this.__keys=A,t.keys&&(this.__keys=u(C(this.__keys),t.keys))},p.prototype.traverse=function(e,t){var n,r,i,o,a,s,u,l,p,m,h,g;for(this.__initialize(e,t),g={},n=this.__worklist,r=this.__leavelist,n.push(new c(e,null,null,null)),r.push(new c(null,null,null,null));n.length;)if(i=n.pop(),i!==g){if(i.node){if(s=this.__execute(t.enter,i),this.__state===b||s===b)return;if(n.push(g),r.push(i),this.__state===x||s===x)continue;if(o=i.node,a=o.type||i.wrap,m=this.__keys[a],!m){if(!this.__fallback)throw new Error("Unknown node type "+a+".");m=F(o)}for(l=m.length;(l-=1)>=0;)if(u=m[l],h=o[u])if(D(h)){for(p=h.length;(p-=1)>=0;)if(h[p]){if(f(a,m[l]))i=new c(h[p],[u,p],"Property",null);else{if(!d(h[p]))continue;i=new c(h[p],[u,p],null,null)}n.push(i)}}else d(h)&&n.push(new c(h,u,null,null))}}else if(i=r.pop(),s=this.__execute(t.leave,i),this.__state===b||s===b)return},p.prototype.replace=function(e,t){function n(e){var t,n,i,o;if(e.ref.remove())for(n=e.ref.key,o=e.ref.parent,t=r.length;t--;)if(i=r[t],i.ref&&i.ref.parent===o){if(i.ref.key=0;)if(E=h[p],g=o[E])if(D(g)){for(m=g.length;(m-=1)>=0;)if(g[m]){if(f(a,h[p]))u=new c(g[m],[E,m],"Property",new l(g,m));else{if(!d(g[m]))continue;u=new c(g[m],[E,m],null,new l(g,m))}r.push(u)}}else d(g)&&r.push(new c(g,E,null,new l(o,E)))}}else if(u=i.pop(),s=this.__execute(t.leave,u),void 0!==s&&s!==b&&s!==x&&s!==S&&u.ref.replace(s),(this.__state===S||s===S)&&n(u),this.__state===b||s===b)return y.root;return y.root},t.version=e("./package.json").version,t.Syntax=y,t.traverse=m,t.replace=h,t.attachComments=v,t.VisitorKeys=A,t.VisitorOption=E,t.Controller=p,t.cloneEnvironment=function(){return r({})},t}(n)},{"./package.json":2}],2:[function(e,t){t.exports={name:"estraverse",description:"ECMAScript JS AST traversal functions",homepage:"https://github.com/estools/estraverse",main:"estraverse.js",version:"4.1.1",engines:{node:">=0.10.0"},maintainers:[{name:"Yusuke Suzuki",email:"utatane.tea@gmail.com",web:"http://github.com/Constellation"}],repository:{type:"git",url:"http://github.com/estools/estraverse.git"},devDependencies:{chai:"^2.1.1","coffee-script":"^1.8.0",espree:"^1.11.0",gulp:"^3.8.10","gulp-bump":"^0.2.2","gulp-filter":"^2.0.0","gulp-git":"^1.0.1","gulp-tag-version":"^1.2.1",jshint:"^2.5.6",mocha:"^2.1.0"},license:"BSD-2-Clause",scripts:{test:"npm run-script lint && npm run-script unit-test",lint:"jshint estraverse.js","unit-test":"mocha --compilers coffee:coffee-script/register"}}},{}]},{},[1])(1)}),n("orion/objects",[],function(){function e(e){for(var t=Object.prototype.hasOwnProperty,n=1,r=arguments.length;r>n;n++){var i=arguments[n];for(var o in i)t.call(i,o)&&(e[o]=i[o])}return e}return{clone:function(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=Object.create(Object.getPrototypeOf(t));return e(n,t),n},mixin:e,toArray:function(e){return Array.isArray(e)?e:[e]}}}),n("javascript/lru",[],function(){function e(e,t){var n=Object.create(null);return n._p=null,n._n=null,n._v={key:e,value:t},n}function t(e){this._max="undefined"==typeof e?-1:e,this._start=this._end=null,this._size=0,this._cache=Object.create(null)}return t.prototype.clear=function(){this._cache=Object.create(null),this._start=null,this._end=null,this._size=0},t.prototype.size=function(){return this._size},t.prototype.containsKey=function(e){return"undefined"!=typeof this._cache[e]},t.prototype.put=function(t,n){-1!==this._max&&this._size+1>this._max&&this.remove(this._end._v.key),this.remove(t);var r=e(t,n);this._start?(r=e(t,n),r._n=this._start,this._start._p=r,this._start=r):this._start=this._end=r,this._cache[t]=r,this._size++},t.prototype.get=function(e){if(this._size>0){var t=this._cache[e];if(t&&t._v)return t._v.value}return null},t.prototype.remove=function(e){if(0===this._size)return null;var t=this._cache[e];if(t){var n=t._p;this._end===t&&(this._end=n);var r=t._n;return this._start===t&&(this._start=t._n),n&&(n._n=r),r&&(r._p=n),delete this._cache[e],this._size--,t._v.value}return null},t.prototype.keys=function n(){var n=[];if(this._end)for(var e=this._end;e;)n.push(e._v.key),e=e._p;return n},t}),n("javascript/scriptResolver",["orion/objects","orion/Deferred","javascript/lru"],function(e,t,n){function r(e){this.serviceRegistry=e,this.cache=new n(10)}return e.mixin(r.prototype,{getWorkspaceFile:function(e,n){return e?this._getFile(e,n):(new t).resolve(null)},getFileClient:function(){return this.fileclient||(this.fileclient=this.serviceRegistry.getService("orion.core.file.client")),this.fileclient},setSearchLocation:function(e){this.searchLocation=e},getSearchLocation:function(){return"string"==typeof this.searchLocation&&this.searchLocation.length>0?(new t).resolve(this.searchLocation):this.getFileClient().fileServiceRootURL()},_getFile:function(e,n){var r=this.cache.get(e);if(r)return(new t).resolve(r);var i=this,o=n?n:Object.create(null),a=o.ext?o.ext:"js",s=o.icon?o.icon:"../javascript/images/javascript.png",u=o.type?o.type:"JavaScript",l="."+a,c=this._removePrefix(e),p=c.length>1?c[1]:c[0],d=p.lastIndexOf("/"),f=p.slice(d+1);return this.getFileClient().search({resource:i.searchLocation||"",keyword:f,sort:"Name asc",nameSearch:!0,fileType:a,start:0,rows:30}).then(function(e){var t=e.response,n=t.docs.length;if(t.numFound>0){r=[];var o=p.replace(/(?:\.?\.\/)*/,"");o=o.replace(new RegExp("\\"+l+"$"),""),o=o.replace(/\//g,"\\/");for(var a=0;n>a;a++){var c=t.docs[a],d=".*(?:"+o+")$";new RegExp(d).test(c.Location.slice(0,c.Location.length-l.length))&&r.push(i._newFileObj(c.Name,c.Location,i._trimName(c.Path),s,u))}if(r.length>0)return i.cache.put(p,r),r}return null})},_removePrefix:function(e){var t=e.indexOf("!");return t>-1?e.split("!"):[e]},resolveRelativeFiles:function(e,t,n){if(t&&t.length>0&&n){var r=n.location,i=[],o=this._removePrefix(e),a=o.length>1?o[1]:o[0];r=r.slice(0,r.lastIndexOf("/"));var s=!1;if("."!==a.charAt(0))r=this._appendPath(r,a);else{s=!0;var u=/^\.\.\//.exec(a);if(u){for(;null!=u;)r=r.slice(0,r.lastIndexOf("/")),a=a.slice(3),u=/^\.\.\//.exec(a);r=this._appendPath(r,a)}else{for(;/^\.\//.test(a);)a=a.slice(2);r=this._appendPath(r,a)}}for(var l=0;l-1&&(f=p.slice(0,d));var m=a.replace(/[/?|{}()*.#$^]/g,"\\$&"),h=new RegExp(m+"$");h.test(f)&&i.push(c)}}return i}return[]},_samePaths:function(e,t,n){if(null==e)return null==t;if("undefined"==typeof e)return"undefined"==typeof t;if(null==t)return null==e;if("undefined"==typeof t)return"undefined"==typeof e;if(e.contentType&&n.contentType&&e.contentType.name===n.contentType.name){var r=e.location?e.location:e.Location;if(!r)return!1;var i=r.lastIndexOf("."),o=r;if(i>-1&&(o=r.slice(0,i)),t===o)return!0;i=t.lastIndexOf(".");var a=t;return i>-1&&(a=t.slice(0,i)),o===a?!0:o===decodeURIComponent(a)?!0:!1}},_appendPath:function(e,t){if("string"==typeof e&&"string"==typeof t){var n=e;return"/"!==n.charAt(n.length-1)&&(n+="/"),n+="/"===t.charAt(0)?t.slice(1):t}return null},_trimName:function(e){return e.replace(/^(?:org\.eclipse\.orion\.client)?(?:\/)?bundles\//,"")},_newFileObj:function(e,t,n,r,i){var o=Object.create(null);return o.name=e,o.location=t,o.path=n,o.contentType=Object.create(null),r&&(o.contentType.icon=r),i&&(o.contentType.name=i),o}}),{ScriptResolver:r}}),n("javascript/util",[],function(){function e(e){return e.length<1?!1:isNaN(e.charCodeAt(0))?!1:e.toLocaleUpperCase().charAt(0)===e.charAt(0)}function t(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(0===e.length)return!0;if(e.charAt(0).toLowerCase()!==t.charAt(0).toLowerCase())return!1;if(n(t,e))return!0;var i=t.toLowerCase();if(n(i,e))return!0;var o=e.toLowerCase(),a=e.indexOf("=");if(-1!==a&&n(t,e.substring(0,a)))return!0;if(e===o)return!1;if(n(i,o))return!0;var s=r(e),u=r(t);if(s.length>u.length)return!1;for(var l=0;l=0;--r)e(t.charAt(r))&&(n.push(t.substring(r)),t=t.substring(0,r));return 0!==t.length&&n.push(t),n.reverse()}function i(e,t,n){var r=a;return r.range[1]="string"==typeof n?n.length:0,r.loc.start.line=e.lineNumber,r.loc.start.column=0,r.loc.end.line=e.lineNumber,r.loc.end.column=e.column,r.errors=[e],r.sourceFile=Object.create(null),r.sourceFile.text=n,r.sourceFile.name=t,r}function o(e){var t=[];return e&&e.errors&&e.errors.forEach(function(e){var n=e?JSON.parse(JSON.stringify(e)):e;e instanceof Error&&(n.__isError=!0,n.lineNumber="number"==typeof n.lineNumber?n.lineNumber:e.lineNumber,n.message=n.message||e.message,n.name=n.name||e.name,n.stack=n.stack||e.stack);var r=e.message;n.message=r=r.replace(/^Line \d+: /,""),/^Unexpected/.test(r)&&(n.type=1,/end of input$/.test(r)&&(n.type=2)),t.push(n)}),t}var a={type:"Program",body:[],comments:[],tokens:[],range:[0,0],loc:{start:{},end:{}}};return{isUpperCase:e,looselyMatches:t,startsWith:n,toCamelCaseParts:r,errorAST:i,serializeAstErrors:o}}),n("javascript/astManager",["orion/Deferred","orion/objects","javascript/lru","orion/metrics","javascript/util"],function(e,t,n,r,i){function o(e){if(this.parser=e,this.cache=new n(10),!this.parser)throw new Error("Missing parser")}var a={Unexpected:1,EndOfInput:2};return t.mixin(o.prototype,{getAST:function(t){var n=this;return t.getFileMetadata().then(function(r){var i=n._getKey(r),o=n.cache.get(i);return o?(new e).resolve(o):t.getText().then(function(e){return o=n.parse(e,r?r.location:"unknown"),n.cache.put(i,o),o})})},_getKey:function(e){return e&&e.location?e.location:"unknown"},parse:function(e,t){var n=Date.now();try{var o=this.parser.parse(e,{range:!0,loc:!0,tolerant:!0,tokens:!0,attachComment:!0,directSourceFile:t,deps:!0})}catch(a){o=i.errorAST(a,t,e)}var s=Date.now()-n;return r.logTiming("language tools","parse",s,"application/javascript"),o.errors=i.serializeAstErrors(o),o.fileLocation=t,o.source=e,o},onModelChanging:function(e){this.inputChanged?this.inputChanged=null:this.cache.remove(this._getKey(e.file))},onInputChanged:function(e){this.inputChanged=e}}),{ASTManager:o,ErrorTypes:a}}),n("orion/editor/eventTarget",[],function(){function e(){}return e.addMixin=function(t){var n=e.prototype;for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])},e.prototype={addEventListener:function(e,t,n){this._eventTypes||(this._eventTypes={});var r=this._eventTypes[e];r||(r=this._eventTypes[e]={level:0,listeners:[]});var i=r.listeners;i.push({listener:t,useCapture:n})},dispatchEvent:function(e){var t=e.type;this._dispatchEvent("pre"+t,e),this._dispatchEvent(t,e),this._dispatchEvent("post"+t,e)},_dispatchEvent:function(e,t){var n=this._eventTypes?this._eventTypes[e]:null;if(n){var r=n.listeners;try{if(n.level++,r)for(var i=0,o=r.length;o>i;i++)if(r[i]){var a=r[i].listener;"function"==typeof a?a.call(this,t):a.handleEvent&&"function"==typeof a.handleEvent&&a.handleEvent(t)}}finally{if(n.level--,n.compact&&0===n.level){for(var s=r.length-1;s>=0;s--)r[s]||r.splice(s,1);0===r.length&&delete this._eventTypes[e],n.compact=!1}}}},isListening:function(e){return this._eventTypes?void 0!==this._eventTypes[e]:!1},removeEventListener:function(e,t,n){if(this._eventTypes){var r=this._eventTypes[e];if(r){for(var i=r.listeners,o=0,a=i.length;a>o;o++){var s=i[o];if(s&&s.listener===t&&s.useCapture===n){0!==r.level?(i[o]=null,r.compact=!0):i.splice(o,1);break}}0===i.length&&delete this._eventTypes[e]}}}},{EventTarget:e}}),n("orion/regex",[],function(){function e(e){return e.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function t(e){var t=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(e);return t?{pattern:t[1],flags:t[2]}:null}return{escape:e,parse:t}}),n("orion/util",[],function(){function e(e){var t=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(e,n){return t[(n<<0)+1]})}function t(e,t){return e.createElementNS?e.createElementNS(y,t):e.createElement(t)}var n=navigator.userAgent,r=-1!==n.indexOf("MSIE")||-1!==n.indexOf("Trident")?document.documentMode:void 0,i=parseFloat(n.split("Firefox/")[1]||n.split("Minefield/")[1])||void 0,o=-1!==n.indexOf("Opera")?parseFloat(n.split("Version/")[1]):void 0,a=parseFloat(n.split("Chrome/")[1])||void 0,s=-1!==n.indexOf("Safari")&&!a,u=parseFloat(n.split("WebKit/")[1])||void 0,l=-1!==n.indexOf("Android"),c=-1!==n.indexOf("iPad"),p=-1!==n.indexOf("iPhone"),d=c||p,f=-1!==navigator.platform.indexOf("Mac"),m=-1!==navigator.platform.indexOf("Win"),h=-1!==navigator.platform.indexOf("Linux"),g="undefined"!=typeof document&&"ontouchstart"in document.createElement("input"),v=m?"\r\n":"\n",y="http://www.w3.org/1999/xhtml";return{formatMessage:e,createElement:t,isIE:r,isFirefox:i,isOpera:o,isChrome:a,isSafari:s,isWebkit:u,isAndroid:l,isIPad:c,isIPhone:p,isIOS:d,isMac:f,isWindows:m,isLinux:h,isTouch:g,platformDelimiter:v}}),n("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(e,t,n){function r(e,t){this._lastLineIndex=-1,this._text=[""],this._lineOffsets=[0],this.setText(e),this.setLineDelimiter(t)}return r.prototype={destroy:function(){},find:function(e){this._text.length>1&&(this._text=[this._text.join("")]);var n=e.string,r=e.regex,i=n,o="",a=e.caseInsensitive;if(i)if(r){var s=t.parse(i);s&&(i=s.pattern,o=s.flags)}else i=n.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(i=i.replace(/[iI\u0130\u0131]/g,"[Iiİı]"));var u,l=null;if(i){var c=e.reverse,p=e.wrap,d=e.wholeWord,f=e.start||0,m=e.end,h=null!==m&&void 0!==m;-1===o.indexOf("g")&&(o+="g"),-1===o.indexOf("m")&&(o+="m"),a&&-1===o.indexOf("i")&&(o+="i"),d&&(i="\\b"+i+"\\b");var g,v,y=this._text[0],D=0;if(h){var E=m>f?f:m,A=m>f?m:f;y=y.substring(E,A),D=E}var C=new RegExp(i,o);c?u=function(){var e=null;for(C.lastIndex=0;;){if(v=C.lastIndex,g=C.exec(y),v===C.lastIndex)return null;if(!g)break;if(g.index+D=0&&n>e))return null;var r=this._lineOffsets[e];if(n>e+1){var i=this.getText(r,this._lineOffsets[e+1]);if(t)return i;for(var o,a=i.length;10===(o=i.charCodeAt(a-1))||13===o;)a--;return i.substring(0,a)}return this.getText(r)},getLineAtOffset:function(e){var t=this.getCharCount();if(!(e>=0&&t>=e))return-1;var n=this.getLineCount();if(e===t)return n-1;var r,i,o=this._lastLineIndex;if(o>=0&&n>o&&(r=this._lineOffsets[o],i=n>o+1?this._lineOffsets[o+1]:t,e>=r&&i>e))return o;for(var a=n,s=-1;a-s>1;)if(o=Math.floor((a+s)/2),r=this._lineOffsets[o],i=n>o+1?this._lineOffsets[o+1]:t,r>=e)a=o;else{if(i>e){a=o;break}s=o}return this._lastLineIndex=a,a},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(e,t){var n=this.getLineCount();if(!(e>=0&&n>e))return-1;if(n>e+1){var r=this._lineOffsets[e+1];if(t)return r;for(var i,o=this.getText(Math.max(this._lineOffsets[e],r-2),r),a=o.length;10===(i=o.charCodeAt(a-1))||13===i;)a--;return r-(o.length-a)}return this.getCharCount()},getLineStart:function(e){return e>=0&&e=e));)r+=n,i++;for(var o=r,a=i;i=t));)r+=n,i++;var s=r,u=i;if(a>=this._text.length||u>=this._text.length||a>u)return"";if(a===u)return this._text[a].substring(e-o,t-s);var l=this._text[a].substring(e-o),c=this._text[u].substring(0,t-s);return l+this._text.slice(a+1,u).join("")+c},onChanging:function(e){return this.dispatchEvent(e)},onChanged:function(e){return this.dispatchEvent(e)},setLineDelimiter:function(e,t){if("auto"===e&&(e=void 0,this.getLineCount()>1&&(e=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0)))),this._lineDelimiter=e?e:n.platformDelimiter,t){var r=this.getLineCount();if(r>1){for(var i=new Array(r),o=0;r>o;o++)i[o]=this.getLine(o);this.setText(i.join(this._lineDelimiter))}}},setText:function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=0),void 0===n&&(n=this.getCharCount()),t!==n||""!==e){for(var r=this.getLineAtOffset(t),i=this.getLineAtOffset(n),o=t,a=n-t,s=i-r,u=e.length,l=0,c=this.getLineCount(),p=0,d=0,f=0,m=[];;){if(-1!==p&&f>=p&&(p=e.indexOf("\r",f)),-1!==d&&f>=d&&(d=e.indexOf("\n",f)),-1===d&&-1===p)break;f=-1!==p&&-1!==d?p+1===d?d+1:(d>p?p:d)+1:-1!==p?p+1:d+1,m.push(t+f),l++}var h={type:"Changing",text:e,start:o,removedCharCount:a,addedCharCount:u,removedLineCount:s,addedLineCount:l};if(this.onChanging(h),0===m.length){var g,v=this.getLineStart(r);g=c>i+1?this.getLineStart(i+1):this.getCharCount(),t!==v&&(e=this.getText(v,t)+e,t=v),n!==g&&(e+=this.getText(n,g),n=g)}for(var y=u-a,D=r+s+1;c>D;D++)this._lineOffsets[D]+=y;var E,A=5e4,C=A;if(m.length=t));)x+=b,S++;for(var w=x,B=S;S=n));)x+=b,S++;var k=x,_=S,T=this._text[B],P=this._text[_],j=T.substring(0,t-w),L=P.substring(n-k),I=[B,_-B+1];j&&I.push(j),e&&I.push(e),L&&I.push(L),Array.prototype.splice.apply(this._text,I),0===this._text.length&&(this._text=[""]);var N={type:"Changed",start:o,removedCharCount:a,addedCharCount:u,removedLineCount:s,addedLineCount:l};this.onChanged(N)}}},e.EventTarget.addMixin(r.prototype),{TextModel:r}}),n("eslint/conf/globals",[],function(){return{builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{addEventListener:!1,alert:!1,AnalyserNode:!1,AnimationEvent:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AutocompleteErrorEvent:!1,BarProp:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,blur:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CDATASection:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClientRect:!1,ClientRectList:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConvolverNode:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSFontFaceRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CSSUnknownRule:!1,CSSViewportRule:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,Debug:!1,defaultStatus:!1,defaultstatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMParser:!1,DOMSettableTokenList:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,fetch:!1,File:!1,FileError:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAppletElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLKeygenElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,ImageBitmap:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,InputMethodContext:!1,Intl:!1,KeyboardEvent:!1,length:!1,localStorage:!1,location:!1,Location:!1,locationbar:!1,matchMedia:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyError:!1,MediaKeyEvent:!1,MediaKeyMessageEvent:!1,MediaKeys:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaSource:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,navigator:!1,Navigator:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,Path2D:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,Plugin:!1,PluginArray:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,RadioNodeList:!1,Range:!1,ReadableByteStream:!1,ReadableStream:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,resizeBy:!1,resizeTo:!1,Response:!1,RTCIceCandidate:!1,RTCSessionDescription:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedWorker:!1,showModalDialog:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,status:!1,statusbar:!1,stop:!1,Storage:!1,StorageEvent:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,SVGZoomEvent:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeEvent:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,ValidityState:!1,VTTCue:!1,WaveShaperNode:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestProgressEvent:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1,XSLTProcessor:!1},worker:{applicationCache:!1,atob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,WebSocket:!1,Worker:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,root:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},commonjs:{exports:!0,module:!1,require:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterEach:!1,beforeEach:!1,describe:!1,expect:!1,it:!1,jest:!1,pit:!1,require:!1,xdescribe:!1,xit:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,Java:!1,java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,target:!1,tempdir:!1,test:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,ObjectId:!1,PlanCache:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{caches:!1,Cache:!1,CacheStorage:!1,Client:!1,clients:!1,Clients:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,FetchEvent:!1,importScripts:!1,registration:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,skipWaiting:!1,WindowClient:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentUrl:!1,fillIn:!1,find:!1,keyEvent:!1,triggerEvent:!1,visit:!1},protractor:{$:!1,$$:!1,browser:!1,By:!1,by:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1},webextensions:{browser:!1,chrome:!1,opr:!1}} -}),n("eslint/conf/environments",["./globals"],function(e){var t={builtin:e.builtin,browser:{globals:e.browser},node:{globals:e.node,ecmaFeatures:{globalReturn:!0}},commonjs:{globals:e.commonjs,ecmaFeatures:{globalReturn:!0}},worker:{globals:e.worker},amd:{globals:e.amd},mocha:{globals:e.mocha},jasmine:{globals:e.jasmine},jest:{globals:e.jest},phantomjs:{globals:e.phantom},jquery:{globals:e.jquery},qunit:{globals:e.qunit},prototypejs:{globals:e.prototypejs},shelljs:{globals:e.shelljs},meteor:{globals:e.meteor},mongo:{globals:e.mongo},protractor:{globals:e.protractor},applescript:{globals:e.applescript},nashorn:{globals:e.nashorn},serviceworker:{globals:e.serviceworker},embertest:{globals:e.embertest},webextensions:{globals:e.webextensions},es6:{ecmaFeatures:{arrowFunctions:!0,blockBindings:!0,regexUFlag:!0,regexYFlag:!0,templateStrings:!0,binaryLiterals:!0,octalLiterals:!0,unicodeCodePointEscapes:!0,superInFunctions:!0,defaultParams:!0,restParams:!0,forOf:!0,objectLiteralComputedProperties:!0,objectLiteralShorthandMethods:!0,objectLiteralShorthandProperties:!0,objectLiteralDuplicateProperties:!0,generators:!0,destructuring:!0,classes:!0,spread:!0,newTarget:!0}}};return t}),n("javascript/finder",["estraverse/estraverse","eslint/conf/environments"],function(e,t){e.VisitorKeys.RecoveredNode||(e.VisitorKeys.RecoveredNode=[]);var n={visitor:null,punc:"\n \r (){}[]:;,.+=-*^&@!%~`'\"/\\",findWord:function(e,t){if(e&&t>-1){for(var n=this.punc.indexOf(e.charAt(t))>-1,r=n&&t>0?t-1:t;r>=0&&!(this.punc.indexOf(e.charAt(r))>-1);)r--;var i=r;for(r=t;r<=e.length&&!(this.punc.indexOf(e.charAt(r))>-1);)r++;return(i===t||n&&i===t-1)&&r===t?null:i===t?e.substring(i,r):e.substring(i+1,r)}return null},findNode:function(t,n,r){var i=null,o=r&&r.parents?[]:null,a=r&&r.next?r.next:!1;if("number"==typeof t&&t>-1&&n&&e.traverse(n,{enter:function(n){if(n.type&&n.range){if(!a&&n.type===e.Syntax.Program&&te.range[1]&&o.pop()}}),i&&o&&o.length>0){var s=o[o.length-1];"Program"!==s.type&&s.range[0]===i.range[0]&&s.range[1]===i.range[1]&&o.pop(),i.parents=o}return i},findNodeAfterComment:function(t,n){var r=null,i=[];if(Array.isArray(t.range)&&n){var o=t.range[1];e.traverse(n,{enter:function(t,n){if(t.type&&t.range)if(n&&i.push(n),o>t.range[0])r=t;else if(r=t,t.type!==e.Syntax.Program)return e.VisitorOption.Break}})}return r&&(r.parents=i),r},findNodesForRange:function(t,n,r){var i=[];return t&&e.traverse(t,{enter:function(t){return t.range[0]>=n&&t.range[0]=r?e.VisitorOption.BREAK:void 0}}),i},findToken:function(e,t){if("number"==typeof e&&e>-1&&t&&t.length>0){var n,r=0,i=t.length-1,o=0;if(n=t[0],e>=n.range[0]&&e=n.range[0])return n.index=i,n;for(n=null;i>=r;){if(o=Math.floor((r+i)/2),n=t[o],en.range[1])r=o+1;else if(e===n.range[1]){var a=t[o+1];if(a.range[0]!==n.range[1])return n.index=o,n;r=o+1}else if(e>=n.range[0]&&e=n.range[0]&&e<=n.range[1]?(n.index=r,n):null}}return null},findComment:function(e,t){if(t.comments){for(var n=t.comments,r=n.length,i=0;r>i;i++){var o=n[i];if(o.range[0]=e)return o;if(e===t.range[1]&&e===o.range[1])return o;if(e>t.range[1]&&e<=o.range[1])return o;if(o.range[0]>e)return null}return null}},findScriptBlocks:function(e,t){var n=[],r=null,i=/<\s*script([^>]*)(?:\/>|>((?:.|\r?\n)*?)<\s*\/script[^<>]*>)/gi,o=/(type|language)\s*=\s*"([^"]*)"/i,a=/src\s*=\s*"([^"]*)"/i,s=this.findHtmlCommentBlocks(e,t);e:for(;null!==(r=i.exec(e));){var u=r[1],l=r[2],c=null;if(u){var p=o.exec(u);if(p&&p[2]){var d=p[2];if("language"===p[1]&&(d="text/"+d),!/^(application|text)\/(ecmascript|javascript(\d.\d)?|livescript|jscript|x\-ecmascript|x\-javascript)$/gi.test(d))continue}var f=a.exec(u);f&&(c=f[1])}if(l||!c){if(void 0!==l){var m=r.index+r[0].indexOf(">")+1;if("number"!=typeof t||t>=m&&m+l.length>=t){for(var h=0;h=m)continue e;n.push({text:l,offset:m,dependencies:c})}}}else n.push({text:"",offset:0,dependencies:c})}var g={blur:!0,change:!0,click:!0,dblclick:!0,focus:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,mousedown:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,reset:!0,select:!0,submit:!0,unload:!0},v=/(\s+)on(\w*)(\s*=\s*")([^"]*)"/gi,y=0;e:for(;null!==(r=v.exec(e));){y++;var D=r[1],E=r[2],A=r[3];if(l=r[4],E&&E.toLowerCase()in g&&(l||(l=""),m=r.index+D.length+2+E.length+A.length,"number"!=typeof t||t>=m&&m+l.length>=t)){for(var C=0;C=m)continue e;n.push({text:l,offset:m,isWrappedFunctionCall:!0})}}return n},findHtmlCommentBlocks:function(e,t){for(var n=[],r=null,i=//gi;null!=(r=i.exec(e));){var o=r[1];o.length<1||("number"!=typeof t||r.index<=t&&r.index+o.length>=r.index)&&n.push({text:o,start:r.index,end:r.index+o.length})}return n},findESLintEnvForMember:function(e){var n=Object.keys(t);if(n)for(var r=n.length,i=0;r>i;i++){var o=t[n[i]];if("undefined"!=typeof o[e])return n[i];var a=o.globals;if(a&&"undefined"!=typeof a[e])return n[i]}return null},findDirective:function(e,t){if(e&&"undefined"!=typeof t)for(var n=e.comments.length,r=0;n>r;r++){var i=/^\s*(eslint-\w+|eslint|globals?)(\s|$)/.exec(e.comments[r].value);if(null!==i&&"undefined"!=typeof i&&i[1]===t)return e.comments[r]}return null},findCommentForNode:function r(e){var t=e.leadingComments,n=null;if(t&&t.length>0){if(n=t[t.length-1],"Block"===n.type)return n.node=e,n}else if("Property"===e.type){if(n=r(e.key))return n.node=e,n}else if("FunctionDeclaration"===e.type&&(n=r(e.id)))return n.node=e,n;return n=Object.create(null),n.node=e,n.value="",n},findParentFunction:function(e){if(e)if(e.parents)for(var t=e.parents,n=t.pop();n;){if("FunctionDeclaration"===n.type||"FunctionExpression"===n.type)return n;n=t.pop()}else if(e.parent)for(n=e.parent;n;){if("FunctionDeclaration"===n.type||"FunctionExpression"===n.type)return n;n=n.parent}return null}};return n}),n("javascript/compilationUnit",["orion/Deferred"],function(e){function t(e,t,n){this._blocks=e,this._metadata=t,this._ec=n,this._deps=[]}return t.prototype._init=function(){var e="",t=0;this._source="",this._blocks.sort(function(e,t){var n=e.offset?e.offset:0,r=t.offset?t.offset:0;return n-r});for(var n=0;n0;)this._source+=" ",i--;this._source+=e,this._source+=r.text,r.text&&";"!==r.text.charAt(r.text.length-1)&&(this._source+=";")}else{for(;i>0;)this._source+=" ",i--;this._source+=r.text}t=this._source.length}},t.prototype.getSource=function(){return this._source||this._init(),this._source},t.prototype.validOffset=function(e){if(!this._blocks||this._blocks.length<1||0>e)return!1;for(var t=0;t=r&&e<=r+n.text.length)return!0}return!1},t.prototype.getEditorContext=function(){var t=Object.create(null),n=this;return t.getText=function(){return(new e).resolve(n.getSource())},t.getFileMetadata=function(){return(new e).resolve(n._metadata)},t.setText=function(t,r,i){return n._ec?n._ec.setText(t,r,i):(new e).resolve(null)},t},t.prototype.getDependencies=function(){return this._deps},t}),n("javascript/quickFixes",["orion/objects","orion/Deferred","orion/editor/textModel","javascript/finder","javascript/compilationUnit","orion/metrics"],function(e,t,n,r,i,o){function a(e,t,n){this.astManager=e,this.renamecommand=t,this.generatedoc=n}function s(e,t){if(!e)return 0;if(0>t)return 0;for(var n=t,r=e[n];n>-1&&!/[\r\n]/.test(r);)r=e[--n];return n+1}function u(e,t){if(!e)return 0;if(0>t)return 0;for(var n=t,r=e[n];nt)return"";for(var r=t,i=e[r],o=n?" ":"";" "===i||" "===i;)o+=i,i=e[++r];return o}function c(e,t,n){if(!e||!t)return"";for(var r=t.start,i=e[r],o="",a=!1;r>=t.start&&r<=t.end;){if("\n"===i){a=!0;break}i=e[r++]}return a||(o+="\n"),"undefined"!=typeof n&&(o+=n),o}function p(e,t){return"*"===e.charAt(t+1)?"*"===e.charAt(t+2)?3:2:0}function d(e,t,n,r){return r&&""!==e.slice(t.length).trim()?e.trim()+", "+n:e.trim()+" "+n}function f(e,t){if(e&&e.length)for(var n=0;nt||t>e.length)){var r=e[t];return 1===e.length?n.setText("",r.range[0],r.range[1]):t===e.length-1?n.setText("",e[t-1].range[1],r.range[1]):r?n.setText("",r.range[0],e[t+1].range[0]):null}}function h(e,t,n,r){if(e.leadingComments&&e.leadingComments.length>0)for(var i=e.leadingComments.length-1;i>-1;i--){var o=e.leadingComments[i],a=new RegExp("(\\s*[*]+\\s*(?:@param)\\s*(?:\\{.*\\})?\\s*(?:"+r+")+.*)").exec(o.value);if(a){var s=o.range[0]+a.index+p(t,o.range[0]);return n.setText("",s,s+a[1].length)}}return null}function g(e,t){if(t.leadingComments)for(var n=0;ni;i++){var a=e[i];if(r.value.indexOf(a)>-1)return!0}return!1}function v(e){if("Program"===e.type&&e.body&&e.body.length>0){var t=e.body[0],n=-1;switch(t.type){case"FunctionDeclaration":if(n=y(t),n>-1)return n;if(n=y(t.id),n>-1)return n;break;case"ExpressionStatement":if(t.expression&&t.expression.right&&"FunctionExpression"===t.expression.right.type){if(n=y(t),n>-1)return n;if(n=y(t.expression.left),n>-1)return n}}}return e.range[0]}function y(e){if(e.leadingComments&&e.leadingComments.length>0){var t=e.leadingComments[e.leadingComments.length-1];if(/(?:@param|@return|@returns|@type|@constructor|@name|@description)/gi.test(t.value))return t.range[0]}return-1}function D(e){if(!e||!e.parents)return null;for(var t=e.parents.length-1,n=e.parents[t];n&&t>-1;){if(A.indexOf(n.type)>-1)return n;n=e.parents[--t]}}function E(e,t,n,r){if(n){for(var i=[],o=[],a=0,s=0;s0){var n=t[t.length>a?a:0];return e.setSelection(n.start,n.end,!0)}})})}var c=r(t);return c?e.setText(c.text,c.start,c.end):void 0}var A=["IfStatement","WhileStatement","ForStatement","ForInStatement","WithStatement","DoWhileStatement","ForOfStatement"];return e.mixin(a.prototype,{execute:function(e,n){var a=n.annotation.fixid?n.annotation.fixid:n.annotation.id;delete n.annotation.fixid,o.logEvent("language tools","quickfix",a,"application/javascript");var s=this.fixes[a];return s?e.getFileMetadata().then(function(t){return"text/html"===t.contentType.id?e.getText().then(function(o){var a=r.findScriptBlocks(o);if(a&&a.length>0){var u=new i(a,t,e);return s.call(this,u.getEditorContext(),n,this.astManager)}}.bind(this)):s.call(this,e,n,this.astManager)}.bind(this)):(new t).resolve(null)},fixes:{radix:function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findNode(e.start,n,{parents:!0});if(t&&"Identifier"===t.type&&(t=t.parents[t.parents.length-1],"CallExpression"===t.type&&Array.isArray(t.arguments))){var i=t.arguments[t.arguments.length-1];return{text:", 10",start:i.range[1],end:i.range[1]}}})})},curly:function(e,t,n){return n.getAST(e).then(function(n){var i=r.findToken(t.annotation.start,n.tokens);if(i){i=n.tokens[i.index-1];for(var o=i.range[1],a=i.range[1],c=t.annotation.end,p=!1;oc&&E.length<1&&(y+=n.source.slice(c,v),c=v),d+=y+"\n"+l(n.source,h,0)+"}"}}else d+=" }";return e.setText(d,a,c)}})},"no-dupe-keys":function(e,t){var n=t.annotation.start,r=[{data:{},positions:[{offset:n,length:t.annotation.end-n}]}],i={groups:r};return e.exitLinkedMode().then(function(){return e.enterLinkedMode(i)})},"no-duplicate-case":function(e,t){var n=t.annotation.start,r=[{data:{},positions:[{offset:n,length:t.annotation.end-n}]}],i={groups:r};return e.exitLinkedMode().then(function(){return e.enterLinkedMode(i)})},"no-new-wrappers":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0});if(i){var o=i.parents[i.parents.length-1];if("NewExpression"===o.type){var a=r.findToken(o.range[0],n.tokens);if(a&&"Keyword"===a.type&&"new"===a.value){var s="",u=a.range[1],l=a.range[0],c=n.tokens[a.index-1];return c.range[1]1&&(u+=i.range[0]-u-1),("Math"===o.callee.name||"JSON"===o.callee.name)&&(u=o.range[1],s=o.callee.name),e.setText(s,l,u)}}}})},"no-new-wrappers-literal":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0});if(i){var o=i.parents[i.parents.length-1];if("NewExpression"===o.type)switch(o.callee.name){case"Math":case"JSON":return e.setText(o.callee.name,o.range[0],o.range[1]);case"String":var a="";if(o.arguments.length>0){var s=o.arguments[0];"Literal"===s.type?a=String(s.value):"Identifier"===s.type&&(a=String("undefined"===s.name?void 0:"NaN"===s.name?0/0:s.name))}else a=String();return e.setText('"'+a.toString()+'"',o.range[0],o.range[1]);case"Number":var u;if(o.arguments.length>0){var l=o.arguments[0];u=Number("Literal"===l.type?l.value:"Identifier"===l.type?"undefined"===l.name?void 0:"NaN"===l.name?0/0:l.name:l)}else u=Number();return e.setText(u.toString(),o.range[0],o.range[1]);case"Boolean":var c;if(o.arguments.length>0){var p=o.arguments[0];"ObjectExpression"===p.type?c=!0:"Literal"===p.type?c=Boolean(p.value):"Identifier"===p.type?c=Boolean("undefined"===p.name?void 0:"NaN"===p.name?0/0:p.name):"UnaryExpression"===p.type&&"-"===p.operator&&"Literal"===p.argument.type&&"number"==typeof p.argument.value&&(c=!1)}else c=!1;return e.setText(c.toString(),o.range[0],o.range[1])}}})},"no-debugger":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=e.end,i=r.findToken(e.end,n.tokens);return i&&"Punctuator"===i.type&&";"===i.value&&(t=i.range[1]),{text:"",start:e.start,end:t}})})},"missing-doc":function(e,t){return t.offset=t.annotation.start,this.generatedoc.execute.call(this.generatedoc,e,t)},"no-shadow":function(e,t){return this.renamecommand.execute.call(this.renamecommand,e,t)},"no-shadow-global":function(e,t){return this.renamecommand.execute.call(this.renamecommand,e,t)},"no-shadow-global-param":function(e,t){return this.renamecommand.execute.call(this.renamecommand,e,t)},eqeqeq:function(e,t){return E(e,t.annotation,t.annotations,function(e){var t=/^.*\'(\!==|===)\'/.exec(e.title);return{text:t[1],start:e.start,end:e.end}})},"no-eq-null":function(e,t){return E(e,t.annotation,t.annotations,function(e){var t=/^.*\'(\!==|===)\'/.exec(e.title);return{text:t[1],start:e.start,end:e.end}})},"no-undef-init":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findNode(e.start,n,{parents:!0});if(t){var i=t.parents[t.parents.length-1];if("VariableDeclarator"===i.type)return{text:"",start:i.id.range[1],end:i.range[1]}}})})},"no-self-assign":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findNode(e.start,n,{parents:!0});if(t){var i=t.parents[t.parents.length-1];if("AssignmentExpression"===i.type){var o=i.range[1],a=r.findToken(o,n.tokens);return a&&(a=n.tokens[a.index+1],a&&"Punctuator"===a.type&&";"===a.value&&(o=a.range[1])),{text:"",start:i.range[0],end:o}}}})})},"no-self-assign-rename":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.end,n);if(i&&"Identifier"===i.type){var o=i.range[0],a=[{data:{},positions:[{offset:o,length:i.range[1]-o}]}],s={groups:a};return e.exitLinkedMode().then(function(){return e.enterLinkedMode(s)})}})},"new-parens":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0});return i&&"Identifier"===i.type?e.setText("()",i.range[1],i.range[1]):void 0})},"missing-nls":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){if(e.data&&"number"==typeof e.data.indexOnLine){var t=u(n.source,e.end),r=" //$NON-NLS-"+(e.data.indexOnLine+1)+"$";return{text:r,start:t,end:t}}})})},"no-comma-dangle":function(e,t){return E(e,t.annotation,t.annotations,function(e){return{text:"",start:e.start,end:e.end}})},"no-empty-block":function(e,t){return e.getText().then(function(n){var r=s(n,t.annotation.start),i="//TODO empty block",o=l(n,r,!0);return i="\n"+o+i,i+=c(n,t.annotation),e.setText(i,t.annotation.start+1,t.annotation.start+1)})},"no-extra-semi":function(e,t){return E(e,t.annotation,t.annotations,function(e){return{text:"",start:e.start,end:e.end}})},"no-fallthrough":function(e,t){return e.getText().then(function(n){var r=s(n,t.annotation.start),i="//$FALLTHROUGH$",o=l(n,r);return i+=c(n,t.annotation,o),e.setText(i,t.annotation.start,t.annotation.start)})},"no-fallthrough-break":function(e,t){return e.getText().then(function(n){var r=s(n,t.annotation.start),i="break;",o=l(n,r);return i+=c(n,t.annotation,o),e.setText(i,t.annotation.start,t.annotation.start)})},"no-new-array":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0});if(i&&i.parents){var o=i.parents[i.parents.length-1];if("CallExpression"===o.type||"NewExpression"===o.type){var a="";if(o.arguments.length>0){var s=o.arguments[0].range[0],u=o.arguments[o.arguments.length-1].range[1];a+="["+n.source.substring(s,u)+"]"}else a+="[]";return e.setText(a,o.start,o.end)}}})},"no-reserved-keys":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findNode(e.start,n,{parents:!0});return t&&"Identifier"===t.type?{text:'"'+t.name+'"',start:t.range[0],end:t.range[1]}:void 0})})},"no-sparse-arrays":function(e,t,i){return i.getAST(e).then(function(i){var o=r.findNode(t.annotation.start,i,{parents:!0});if(o&&"ArrayExpression"===o.type){var a=new n.TextModel(i.source.slice(t.annotation.start,t.annotation.end)),s=o.elements.length,u=s-1,l=o.elements[u];if(null===l){var c=r.findToken(o.range[1],i.tokens);for("]"!==c.value&&(c=i.tokens[c.index-1]);u>-1&&(l=o.elements[u],null===l);u--);if(null===l)return e.setText(a.getText(),t.annotation.start+1,t.annotation.end-1);a.setText("",l.range[1]-t.annotation.start,c.range[0]-t.annotation.start)}for(var p=l;u>-1;u--)l=o.elements[u],null!==l&&l.range[0]!==p.range[0]&&(a.setText(", ",l.range[1]-t.annotation.start,p.range[0]-t.annotation.start),p=l);return null===l&&null!==p&&a.setText("",o.range[0]+1-t.annotation.start,p.range[0]-t.annotation.start),e.setText(a.getText(),t.annotation.start,t.annotation.end)}return null})},"no-throw-literal":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0}),o=i.raw||n.source.slice(i.range[0],i.range[1]);return e.setText("new Error("+o+")",t.annotation.start,t.annotation.end)})},"no-undef-defined":function(e,t,n){function i(e){if(e&&e.parents&&e.parents.length>0&&"Identifier"===e.type){var t=e.parents.pop();return t&&("AssignmentExpression"===t.type||"UpdateExpression"===t.type)}return!1}var o=/^'(.*)'/.exec(t.annotation.title);return null!==o&&"undefined"!=typeof o?n.getAST(e).then(function(n){var a=null,u=0,c=o[1],p=r.findNode(t.annotation.start,n,{parents:!0});if(i(p)&&(c+=":true"),a=r.findDirective(n,"globals"))return u=a.range[0]+2,e.setText(d(a.value,"globals",c),u,u+a.value.length);var f=v(n),m=s(n.source,f),h=l(n.source,m,!1),g="/*globals "+c+" */\n"+h;return e.setText(g,f,f)}):null},"no-undef-defined-inenv":function(e,t,n){var i=/^'(.*)'/.exec(t.annotation.title);return null!==i&&"undefined"!=typeof i?n.getAST(e).then(function(t){var n=null,o=0;if("console"===i[1])var a="node";else a=r.findESLintEnvForMember(i[1]);if(a){if(n=r.findDirective(t,"eslint-env"))return o=p(t.source,n.range[0])+n.range[0],e.setText(d(n.value,"eslint-env",a,!0),o,o+n.value.length);var u=v(t),c=s(t.source,u),f=l(t.source,c,!1),m="/*eslint-env "+a+" */\n"+f;return e.setText(m,u,u)}}):null},"no-unreachable":function(e,t){return e.setText("",t.annotation.start,t.annotation.end)},"no-unused-params":function(e,n,i){return i.getAST(e).then(function(i){var o=r.findNode(n.annotation.start,i,{parents:!0});if(o){for(var a=[],s=o.parents.pop(),u=-1,l=0;l0&&(p=h(d,i.source,e,s.params[u].name),p&&a.push(p));else{var f=d.arguments;for(l=0;l0){var o=i.parents.pop();if("VariableDeclarator"===o.type){var a=i.parents.pop();if("VariableDeclaration"===a.type){if(1===a.declarations.length)return e.setText("",a.range[0],a.range[1]);var s=f(a.declarations,o);if(s>-1)return m(a.declarations,s,e)}}}return null})},"no-unused-vars-unused-funcdecl":function(e,t,n){return n.getAST(e).then(function(n){var i=r.findNode(t.annotation.start,n,{parents:!0});if(i&&i.parents&&i.parents.length>0){var o=i.parents.pop();if("FunctionDeclaration"===o.type)return e.setText("",o.range[0],o.range[1])}return null})},"no-unused-params-expr":function(e,t,n){function i(t,n,r){if(Array.isArray(r)){var i=r[r.length-1];if("Block"===i.type){var o=i.range[0]+i.value.length+p(n.source,i.range[0]),a=s(n.source,o),u=l(n.source,a),c="* @callback\n"+u;return e.setText(c,o-1,o-1)}}return a=s(n.source,t.range[0]),u=l(n.source,a),e.setText("/**\n"+u+" * @callback\n"+u+" */\n"+u,t.range[0],t.range[0])}return n.getAST(e).then(function(n){var o=r.findNode(t.annotation.start,n,{parents:!0});if(o&&o.parents&&o.parents.length>0){var a,s=o.parents.pop(),u=o.parents.pop();switch(u.type){case"Property":g(["@callback","@public"],u)||g(["@callback","@public"],u.key)||(a=i(u,n,u.leadingComments?u.leadingComments:u.key.leadingComments));break;case"AssignmentExpression":var l=u.left;"MemberExpression"!==l.type||g(["@callback","@public"],l)?"Identifier"!==l.type||g(["@callback","@public"],l)||(a=i(u.left,n,l.leadingComments)):a=i(l,n,l.leadingComments);break;case"VariableDeclarator":var c=u;u=o.parents.pop(),u.declarations[0].range[0]===c.range[0]&&u.declarations[0].range[1]===c.range[1]?a=i(u,n,c.id.leadingComments):g(["@callback","@public"],c.id)||(a=i(c,n,c.id.leadingComments))}if(!a&&!g(["@callback","@public"],s))return e.setText("/* @callback */ ",s.range[0],s.range[0])}return a})},"use-isnan":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findNode(e.start,n,{parents:!0});if(t&&t.parents&&t.parents.length>0){var i=t.parents.pop();if("BinaryExpression"===i.type){var o;if("Identifier"===i.left.type&&"NaN"===i.left.name?o=i.right:"Identifier"===i.right.type&&"NaN"===i.right.name&&(o=i.left),o){var a=n.source.slice(o.range[0],o.range[1]);return{text:"isNaN("+a+")",start:i.range[0],end:i.range[1]}}}}})})},semi:function(e,t){return E(e,t.annotation,t.annotations,function(e){return{text:";",start:e.end,end:e.end}})},"unnecessary-nls":function(e,t,n){return n.getAST(e).then(function(n){return E(e,t.annotation,t.annotations,function(e){var t=r.findComment(e.start+2,n),i=e.data.nlsComment;if(t&&"line"===t.type.toLowerCase()&&i){var o=t.value.indexOf(i);if(o>0){for(var a=e.start;" "===n.source.charAt(a-1)||" "===n.source.charAt(a-1);)a--;return{text:"",start:a,end:e.end}}if(0===o){var s=t.value.substring(o+i.length);a=e.start;var u=e.end;if(s.match(/^(\s*|\s*\/\/.*)$/))for(;" "===n.source.charAt(a-1)||" "===n.source.charAt(a-1);)a--;else a+=2;if(s.match(/^\s*$/))for(u=t.range[1];" "===n.source.charAt(a-1)||" "===n.source.charAt(a-1);)a--;return{text:"",start:a,end:u}}}return null})})}}}),a.prototype.contructor=a,{JavaScriptQuickfixes:a}}),function(){"use strict";function e(e,t,n,r,i,o){t[e]&&(n.push(e),(t[e]===!0||1===t[e])&&r.push(i+e+"/"+o))}function r(e,n,r,i,o){var a=i+n+"/"+o;t._fileExists(e.toUrl(a+".js"))&&r.push(a)}function i(e,t,n){var r;for(r in t)!t.hasOwnProperty(r)||e.hasOwnProperty(r)&&!n?"object"==typeof t[r]&&(!e[r]&&t[r]&&(e[r]={}),i(e[r],t[r],n)):e[r]=t[r]}var o=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;n("i18n",["module"],function(t){var n=t.config?t.config():{};return n=n||{},{version:"2.0.4",load:function(t,a,s,u){u=u||{},u.locale&&(n.locale=u.locale);var l,c,p,d=o.exec(t),f=d[1],m=d[4],h=d[5],g=m.split("-"),v=[],y={},D="";if(d[5]?(f=d[1],l=f+h):(l=t,h=d[4],m=n.locale,m||(m=n.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),g=m.split("-")),u.isBuild){for(v.push(l),r(a,"root",v,f,h),c=0;c-1&&r[e];e--)o=r[e],n=t[o],(n===!0||1===n)&&(n=a(f+o+"/"+h)),i(y,n);s(y)})})}}})}(),n("javascript/nls/messages",{root:!0}),n("javascript/nls/root/messages",{pluginName:"Orion JavaScript Tool Support",pluginDescription:"This plug-in provides JavaScript tools support for Orion, like editing, search, navigation, validation, and code completion.",error:"Error",warning:"Warning",ignore:"Ignore",ternContentAssist:"Tern JavaScript content assist",ternProjectAssist:"Tern project file content assist",emptyFileTemplateDoc:"Create new default contents for the .tern-project file",prefCodeStyle:"Code Style",prefBestPractices:"Best Practices",prefPotentialProblems:"Potential Programming Problems",sourceOutline:"Source Outline",sourceOutlineTitle:"JavaScript source outline",contentAssist:"JavaScript content assist",eslintValidator:"JavaScript Validator",missingCurly:"Statements not enclosed in braces:",curlyFixName:"Enclose statement in braces",noCaller:"Discouraged 'arguments.caller' or 'arguments.callee' use:",noCommaDangle:"Trailing commas in object expressions:",noCondAssign:"Assignments in conditional expressions:",noConsole:"Discouraged console use in browser code:",noConstantCondition:"Constant as conditional expression:",noRegexSpaces:"Multiple spaces in regular expressions:",noReservedKeys:"Reserved words used as property keys:",noReservedKeysFixName:"Surround key with quotes",noEqeqeq:"Discouraged '==' use:",noDebugger:"Discouraged 'debugger' statement use:",noDebuggerFixName:"Remove statement",noWith:"Discouraged 'with' statement use:",noEval:"Discouraged 'eval()' use:",noImpliedEval:"Discouraged implied 'eval()' use:",noDupeKeys:"Duplicate object keys:",noDupeKeysFixName:"Rename key",noDuplicateCaseFixName:"Rename case",noIterator:"Discouraged __iterator__ property use:",noProto:"Discouraged __proto__ property use:",noUndefInit:"Explicitly initializing variables to undefined:",noundefinitFixName:"Remove assignment",useIsNaN:"NaN not compared with isNaN():",useIsNanFixName:"Use isNaN()",missingDoc:"Missing JSDoc:",missingDocFixName:"Generate element JSDoc",noUnreachable:"Unreachable code:",noFallthrough:"Switch case fall-through:",useBeforeDefine:"Member used before definition:",noEmptyBlock:"Undocumented empty block:",newParens:"Missing parentheses in constructor call:",newparensFixName:"Add parentheses",noNewArray:"Discouraged 'new Array()':",noNewArrayFixName:"Convert to array literal",noNewFunc:"Discouraged 'new Function()':",noNewObject:"Discouraged 'new Object()':",noNewWrappers:"Discouraged wrapper objects:",noNewWrappersLiteralFixName:"Convert to literal",noNewWrappersFixName:"Remove 'new' keyword",noMixedSpacesAndTabs:"Mixed spaces and tabs:",missingSemi:"Missing semicolons:",unusedVars:"Unused variables:",varRedecl:"Variable re-declarations:",varShadow:"Variable shadowing:",undefMember:"Undeclared global reference:",unnecessarySemis:"Unnecessary semicolons:",unusedParams:"Unused parameters:",unsupportedJSLint:"Unsupported environment directive:",noThrowLiteral:"Literal used in 'throw':",noselfassignFixName:"Remove assignment",noselfassignRenameFixName:"Rename right hand variable",missingNls:"Non-externalized string literals (missing $NON-NLS$ tag):",unnecessaryNls:"Unnecessary $NON-NLS$ tags:",generateDocName:"Generate Element Comment",generateDocTooltip:"Generate a JSDoc-like comment for the selected JavaScript element",renameElement:"Rename Element",renameElementTooltip:"Rename the selected JavaScript element",renameFailedTimedOut:"Could not rename element - operation timed out",openDeclName:"Open Declaration",openDeclTooltip:"Open the declaration of the selected element",openImplName:"Open Implementation",openImplTooltip:"Open the implementation of the selected element",noImplFound:"No implementation was found",implTimedOut:"Could not compute implementation, the operation timed out",workspaceRefsName:"Workspace",workspaceRefsTooltip:"Show all references to the selection in the workspace",projectRefsName:"Project",projectRefsTooltip:"Show all references to the selection in the current project",referencesMenuName:"References",referencesMenuTooltip:"Show different kinds of references",noDeclTimedOut:"No declaration was found - operation timed out",validTypeof:"Invalid 'typeof' comparison:",noSparseArrays:"Sparse array declarations:",javascriptValidation:"Javascript Validation",jsHover:"JavaScript Hover Provider",removeExtraSemiFixName:"Remove extra semicolon",addFallthroughCommentFixName:"Add $FALLTHROUGH$ comment",addEmptyCommentFixName:"Comment empty block",addESLintEnvFixName:"Add to eslint-env directive",addESLintGlobalFixName:"Add to globals directive",removeUnusedParamsFixName:"Remove parameter",commentCallbackFixName:"Add @callback to function",eqeqeqFixName:"Update operator",unreachableFixName:"Remove unreachable code",sparseArrayFixName:"Convert to normal array",semiFixName:"Add missing ';'",radix:"Missing radix parameter to parseInt():",radixFixName:"Add default radix",unusedVarsUnusedFixName:"Remove unused variable",unusedFuncDeclFixName:"Remove unused function",noCommaDangleFixName:"Remove extra ','",addBBreakFixName:"Add break statement",noShadowGlobals:"Global shadowing:",noThrowLiteralFixName:"Change to Error",missingNlsFixName:"Add missing $NON-NLS$ tag",unnecessaryNlsFixName:"Remove unnecessary $NON-NLS$ tag",funcProposalDescription:" - The name of the function",funcParamProposalDescription:" - Function parameter",eslintRuleProposalDescripton:" - ESLint rule",eslintEnvProposalDescription:" - ESLint environment name",onlineDocumentationProposalEntry:"\n\n[Online documentation](${0})",keywordProposalDescription:" - Keyword",keywordHoverProposal:"ECMAScript reserved keyword",reloadPluginCmd:"Reload",reloadPluginCmdTooltip:"Reload plug-in",reloadAllPluginsCmd:"Reload All",reloadAllPluginsCmdTooltip:"Reload all plug-ins",templateHoverHeader:"Template source code:\n\n",templateAssistHeader:"Templates",keywordAssistHeader:"Keywords",ternPlugins:"Tern Plug-ins",noTernPluginsAvailable:"No Tern plug-ins are currently loaded. This may be because you have not yet activated content assist in a JavaScript file. Tern plug-ins provide type information and code templates for JavaScript.",noDeclFound:"Could not find declaration",deprecatedHoverTitle:"Deprecated.",parametersHoverTitle:"Parameters:",returnsHoverTitle:"Returns:",throwsHoverTitle:"Throws:",callbackHoverTitle:"Callback:",callbackText:"This function is used as a callback",sinceHoverTitle:"Since:",seeAlsoHoverTitle:"See Also:",openFileForTitle:"Open file for",failedToReadFile:"Failed to read file: ${0}",badInlineRename:"In-line rename is only available for local variables and declarations.",failedRename:"In-line rename failed: ${0}",declDisplayName:"${0} (start: ${1}, end: ${2})",declPotentialHeader:"**Potential matches:**\n",typeofOptions:"Typeof Options",functionDecls:"Function Declarations",functionCalls:"Function Calls",propAccess:"Property Access",propWrite:"Property Write",varAccess:"Variable Access",varWrite:"Variable Write",varDecls:"Variable Declarations",regex:"Regular Expressions",strings:"Strings",blockComments:"Block Comments",lineComments:"Line Comments",partial:"Partial Matches",uncategorized:"Uncategorized",parseErrors:"Parse Errors",noFileContents:"Could not compute references: failed to compute file text content",noFileMeta:"Could not compute references: failed to compute file metadata",cannotComputeRefs:"Cannot compute references: ${0}",notAnIdentifier:"Cannot compute references at the selected location: Location is not an identifier",notHtmlOffset:"Not a valid offset in HTML",allProjectRefs:"Finding all project references...",allWorkspaceRefs:"Finding all workspace references...",refsFoundIn:"References found in file: '${0}' (${1}/${2})",addToTernCommand:"Add to .tern-project",addToTernCommandTooltip:"The JavaScript tooling will always load the contents of this file to Tern","accessor-pairs":"Getter and setter accessors not in pairs:","no-control-regex":"Disallow control characters in regular expressions:","no-duplicate-case":"Duplicate case:","no-empty-character-class":"Disallow empty character classes:","no-extra-boolean-cast":"Discourage redundant double negation:","no-extra-parens":"Discourage redundant parentheses:","no-invalid-regexp":"Invalid regular expressions:","no-negated-in-lhs":"Disallow negated left operand of in operator:","no-obj-calls":"Disallow global object as function calls:","no-eq-null":"Disallow null comparisons:",noeqnullFixName:"Update operator","no-else-return":"Unnecessary else after return:","no-empty-label":"No empty labels:","no-self-compare":"Disallow self compare:","no-irregular-whitespace":"Disallow irregular whitespace:","no-self-assign":"Disallow self assignment:",noShadowFixName:"Rename in scope","type-checked-consistent-return":"Discouraged inconsistent returns:",ternDocPluginName:"Doc Comments",ternDocPluginDescription:"Tern plug-in to parse and use JSDoc-like comments for inferencing",orionAMQPPluginName:"Orion AMQP",orionAMQPPluginDescription:"Plug-in that contributes type information and code templates for AMQP.",orionAngularPluginName:"AngularJS",orionAngularPluginDescription:"Plug-in that contributes type information and code templates for AngularJS.",orionComponentPluginName:"ComponentJS",orionComponentPluginDescription:"Plug-in that contributes type information and code templates for ComponentJS.",orionExpressPluginName:"Orion ExpressJS",orionExpressPluginDescription:"Plug-in that contributes type information and code templates for ExpressJS.",orionMongoDBPluginName:"Orion MongoDB",orionMongoDBPluginDescription:"Plug-in that contributes type information and code templates for MongoDB.",orionMySQLPluginName:"Orion MySQL",orionMySQLPluginDescription:"Plug-in that contributes type information and code templates for MySQL.",orionNodePluginName:"Orion Node.js",orionNodePluginDescription:"Plug-in that contributes type information and code templates for Node.js.",orionPostgresPluginName:"Orion PostgreSQL",orionPostgresPluginDescription:"Plug-in that contributes type information and code templates for PostgreSQL.",orionRequirePluginName:"Orion RequireJS",orionRequirePluginDescription:"Plug-in that contributes type information and code templates for RequireJS.",orionRedisPluginName:"Orion Redis",orionRedisPluginDescription:"Plug-in that contributes type information and code templates for Redis.",ternPluginsPluginName:"Orion Tern Plug-in Support",ternPluginsPluginDescription:"Plug-in that allows Orion to inspect and modify plug-ins running in Tern.",openImplPluginName:"Orion Open Implementation Support",openImplPluginDescription:"Plug-in that allows Orion to try to find implementation locations of elements rather than simple declarations",htmlDepPluginName:"Orion HTML Dependency Analysis",htmlDepPluginDescription:"Resolves script block and script tag dependencies",findTypesName:"Orion References Support",findTypesDescription:"Plug-in that provides expanded type-finding support in Orion",eslintPluginName:"ESLint plugin for Tern",eslintPluginDescription:"Provides ESLint linting for Tern",jsdocPluginName:"JSDoc types and completion support",jsdocPluginDescription:"Provides auto-complete and type information for JSDoc",outlinerPluginName:"JavaScript outlining",outlinerPluginDescription:"Provides JavaScript outlining",browser:"Browser global variables.",node:"Node.js global variables and Node.js scoping.",commonjs:"CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).",worker:"Web workers global variables.",amd:"Defines require() and define() as global variables as per the amd spec.",mocha:"Adds all of the Mocha testing global variables.",jasmine:"Adds all of the Jasmine testing global variables for version 1.3 and 2.0.",jest:"Jest global variables.",phantomjs:"PhantomJS global variables.",protractor:"Protractor global variables.",qunit:"QUnit global variables.",jquery:"jQuery global variables.",prototypejs:"Prototype.js global variables.",shelljs:"ShellJS global variables.",meteor:"Meteor global variables.",mongo:"MongoDB global variables.",applescript:"AppleScript global variables.",nashorn:"Java 8 Nashorn global variables.",serviceworker:"Service Worker global variables.",embertest:"Ember test helper globals.",webextensions:"WebExtensions globals.",es6:"Enable all ECMAScript 6 features except for modules.",unknownError:"An unknown error occurred.",failedDeleteRequest:"Failed to delete file from Tern: ${0}",failedReadRequest:"Failed to read file into Tern: ${0}",failedToComputeProposals:"Failed to compute proposals",failedToComputeProposalsNoServer:"Failed to compute proposals, server not started",failedToComputeDecl:"Failed to compute declaration",failedToComputeDeclNoServer:"Failed to compute declaration, server not started",failedToComputeImpl:"Failed to compute implementation",failedToComputeImplNoServer:"Failed to compute implementation, server not started",failedToComputeDoc:"Failed to compute documentation",failedToComputeDocNoServer:"Failed to compute documentation, server not started",failedToComputeOccurrences:"Failed to compute occurrences",failedToComputeOccurrencesNoServer:"failed to compute occurrences, server not started",failedGetInstalledPlugins:"Failed to get installed plug-ins",failedGetInstalledPluginsNoServer:"Failed to get installed plug-ins, server not started",failedGetInstalledDefs:"Failed to get installed Tern definitions",failedGetInstalledDefsNoServer:"Failed to get installed Tern definitions, server not started",failedInstallPlugins:"Failed to install plug-ins",failedInstallPluginsNoServer:"Failed to install plug-ins, server not started",failedRemovePlugins:"Failed to remove plug-ins",failedRemovePluginsNoServer:"Failed to remove plug-ins, server not started",failedEnablementPlugins:"Failed to set enablement of plug-ins",failedEnablementPluginsNoServer:"Failed to set enablement of plug-ins, server not started",failedGetEnvs:"Failed to get contributed environments",failedGetEnvsNoServer:"Failed to get contributed environments, server not started",failedRenameTern:"Failed to compute rename changes",failedRenameNoServer:"Failed to compute rename changes, server not started",failedRefs:"Failed to find references",failedRefsNoServer:"failed to find references - server not started",failedType:"Failed to find type",unknownRequest:"The request '${0}' is unknown",serverNotStarted:"The server has not been started. Request: '${0}'",eslintRuleEnableDisable:"Enable or disable ESLint rule using the ```ruleid:0/1/2``` form.\n\nExample use:\n\n>```/* eslint semi:1, no-console:0, no-redeclare:2 */```",eslintEnvDirective:"Specify which environments are used in this JavaScript file.\n\nExample use:\n\n>```/* eslint-env amd, node, broswer */```",eslintRuleEnable:"Enable a given set of ESLint rules.\n\nExample use:\n\n>```/* eslint-enable semi, no-console, no-redeclare */```",eslintRuleDisable:"Disable a given set of ESLint rules.\n\nExample use:\n\n>```/* eslint-disable semi, no-console, no-redeclare */```",failedToComputeProblems:"Failed to compute ESLint problems/markers",failedToComputeOutline:"Failed to compute outline"}),n("orion/editor/templates",[],function(){function e(e,t){return t.substring(e.length) -}function t(e,t,n,r){this.prefix=e,this.description=t,this.template=n,this.name=r,this._parse()}function n(e,t){this._keywords=e||[],this._templates=[],this.addTemplates(t||[])}var r="${tab}",i="${delimiter}",o="${cursor}";return t.prototype={getProposal:function(e,t,n){var a,s=t-e.length,u={},l=void 0!==n.delimiter?n.delimiter:"\n";n.indentation&&(l+=n.indentation);for(var c=void 0!==n.tab?n.tab:" ",p=0,d=this.variables,f=this.segments,m=[],h=0;ht.name?1:0}),r.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0})),r},removePrefix:function(t,n){var r=n.overwrite=n.proposal.substring(0,t.length)!==t;r||(n.proposal=e(t,n.proposal))},isValid:function(){return!0}},{Template:t,TemplateContentAssist:n}}),n("javascript/contentAssist/templates",["orion/editor/templates","i18n!javascript/nls/messages"],function(e,t){function n(t){if(t.t)return t.t;var n=new e.Template(t.prefix,t.description,t.template,t.name);return t.doc&&(n.doc=t.doc),t.url&&(n.url=t.url),t.t=n,n}function r(e){for(var t=[],r=o.length,i=0;r>i;i++){var a=o[i];a.nodes&&a.nodes[e]&&t.push(a)}return t.map(n,this)}var i={type:"link",values:["boolean","function","number","object","string","symbol","undefined"],title:t.typeofOptions,style:"emphasis"},o=[{prefix:"arrow",name:"arrow",nodes:{top:!0,member:!1,prop:!1},description:" - arrow function expression",template:"${param} => {${cursor}}"},{prefix:"arrow",name:"arrow object",nodes:{top:!0,member:!1,prop:!1},description:" - arrow function expression returning an object",template:"var ${name} = () => ({ ${prop}: ${val}${cursor} });"},{prefix:"if",name:"if",nodes:{top:!0,member:!1,prop:!1},description:" - if statement",template:"if (${condition}) {\n ${cursor}\n}"},{prefix:"if",name:"if",nodes:{top:!0,member:!1,prop:!1},description:" - if else statement",template:"if (${condition}) {\n ${cursor}\n} else {\n \n}"},{prefix:"for",name:"for",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over array",template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n ${cursor}\n}"},{prefix:"for",name:"for",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over array with local var",template:"for (var ${i}=0; ${i}<${array}.length; ${i}++) {\n var ${value} = ${array}[${i}];\n ${cursor}\n}"},{prefix:"for",name:"for..in",nodes:{top:!0,member:!1,prop:!1},description:" - iterate over properties of an object",template:"for (var ${property} in ${object}) {\n if (${object}.hasOwnProperty(${property})) {\n ${cursor}\n }\n}"},{prefix:"while",name:"while",nodes:{top:!0,member:!1,prop:!1},description:" - while loop with condition",template:"while (${condition}) {\n ${cursor}\n}"},{prefix:"do",name:"do",nodes:{top:!0,member:!1,prop:!1},description:" - do while loop with condition",template:"do {\n ${cursor}\n} while (${condition});"},{prefix:"eslint",name:"eslint",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:"",template:"/* eslint ${rule-id}:${0/1}*/",url:"http://eslint.org/docs/user-guide/configuring.html#configuring-rules",doc:t.eslintRuleEnableDisable},{prefix:"eslint-env",name:"eslint-env",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:"",template:"/* eslint-env ${library}*/",url:"http://eslint.org/docs/user-guide/configuring.html#specifying-environments",doc:t.eslintEnvDirective},{prefix:"eslint-enable",name:"eslint-enable",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:"",template:"/* eslint-enable ${rule-id} */",url:"http://eslint.org/docs/user-guide/configuring.html#configuring-rule",doc:t.eslintRuleEnable},{prefix:"eslint-disable",name:"eslint-disable",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:"",template:"/* eslint-disable ${rule-id} */",url:"http://eslint.org/docs/user-guide/configuring.html#configuring-rules",doc:t.eslintRuleDisable},{prefix:"switch",name:"switch",nodes:{top:!0,member:!1,prop:!1},description:" - switch case statement",template:"switch (${expression}) {\n case ${value1}:\n ${cursor}\n break;\n default:\n}"},{prefix:"case",name:"case",nodes:{top:!0,member:!1,prop:!1,swtch:!0},description:" - case statement",template:"case ${value}:\n ${cursor}\n break;"},{prefix:"try",name:"try",nodes:{top:!0,member:!1,prop:!1},description:" - try..catch statement",template:"try {\n ${cursor}\n} catch (${err}) {\n}"},{prefix:"try",name:"try",nodes:{top:!0,member:!1,prop:!1},description:" - try..catch statement with finally block",template:"try {\n ${cursor}\n} catch (${err}) {\n} \n finally {\n}"},{prefix:"typeof",name:"typeof",nodes:{top:!0,member:!1,prop:!1},description:" - typeof statement",template:'typeof ${object} === "${type:'+JSON.stringify(i).replace("}","\\}")+'}"'},{prefix:"instanceof",name:"instanceof",nodes:{top:!0,member:!1,prop:!1},description:" - instanceof statement",template:"${object} instanceof ${type}"},{prefix:"with",name:"with",nodes:{top:!0,member:!1,prop:!1},description:" - with statement",template:"with (${object}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!0,member:!1,prop:!1},description:" - function declaration",template:"/**\n * @name ${name}\n * @param ${parameter}\n */\nfunction ${name} (${parameter}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!1,member:!1,prop:!1,obj:!0},description:" - member function expression",template:"/**\n * @name ${name}\n * @function\n * @param ${parameter}\n */\n${name}: function(${parameter}) {\n ${cursor}\n}"},{prefix:"function",name:"function",nodes:{top:!1,member:!1,prop:!0,obj:!1},description:" - member function expression",template:"function(${parameter}) {\n ${cursor}\n}"},{prefix:"define",name:"define",nodes:{top:!0,member:!1,prop:!1},description:" - define function call",template:"/* eslint-env amd */\ndefine('${name}', [\n'${import}'\n], function(${importname}) {\n ${cursor}\n});"},{prefix:"nls",name:"nls",nodes:{top:!0,member:!1,prop:!1},description:" - non NLS string",template:"${cursor} //$NON-NLS-${0}$"},{prefix:"log",name:"log",nodes:{top:!0,member:!1,prop:!1},description:" - console log",template:"console.log(${object});"},{prefix:"node",name:"node",nodes:{top:!0,member:!1,prop:!1,doc:!1,jsdoc:!1},description:" - Node require function call",template:"/* eslint-env node*/\nvar lib = require('${cursor}');"}];return{getTemplatesForKind:r}}),n("orion/URITemplate",[],function(){function e(e){this._text=e}function t(e){return e.replace("%25","%")}function n(e,n){if("U"===n)return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(p,t);if("U+R-,"===n)return encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+n)}function r(e,t,r){for(var i=[],o=0;o=48&&57>=e}function n(e){return e>=48&&57>=e||e>=97&&102>=e||e>=65&&70>=e}function r(e){return e>=48&&55>=e}function i(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&f.indexOf(e)>=0}function o(e){return 10===e||13===e||8232===e||8233===e}function a(e){if(65535>=e)return String.fromCharCode(e);var t=String.fromCharCode(Math.floor((e-65536)/1024)+55296),n=String.fromCharCode((e-65536)%1024+56320);return t+n}function s(e){return 128>e?m[e]:d.NonAsciiIdentifierStart.test(a(e))}function u(e){return 128>e?h[e]:d.NonAsciiIdentifierPart.test(a(e))}function l(e){return 128>e?m[e]:p.NonAsciiIdentifierStart.test(a(e))}function c(e){return 128>e?h[e]:p.NonAsciiIdentifierPart.test(a(e))}var p,d,f,m,h,g;for(d={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},p={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},f=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],m=new Array(128),g=0;128>g;++g)m[g]=g>=97&&122>=g||g>=65&&90>=g||36===g||95===g; -for(h=new Array(128),g=0;128>g;++g)h[g]=g>=97&&122>=g||g>=65&&90>=g||g>=48&&57>=g||36===g||95===g;e.isDecimalDigit=t,e.isHexDigit=n,e.isOctalDigit=r,e.isWhiteSpace=i,e.isLineTerminator=o,e.isIdentifierStartES5=s,e.isIdentifierPartES5=u,e.isIdentifierStartES6=l,e.isIdentifierPartES6=c}),function(e,r){"use strict";"function"==typeof n&&n.amd?n("esutils/keyword",["exports","./code"],r):"undefined"!=typeof exports?r(exports,t("./code")):r(e.keyword={})}(this,function(e,t){"use strict";function n(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function r(e,t){return t||"yield"!==e?i(e,t):!1}function i(e,t){if(t&&n(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function o(e,t){return"null"===e||"true"===e||"false"===e||r(e,t)}function a(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function s(e){return"eval"===e||"arguments"===e}function u(e){var n,r,i;if(0===e.length)return!1;if(i=e.charCodeAt(0),!t.isIdentifierStartES5(i))return!1;for(n=1,r=e.length;r>n;++n)if(i=e.charCodeAt(n),!t.isIdentifierPartES5(i))return!1;return!0}function l(e,t){return 1024*(e-55296)+(t-56320)+65536}function c(e){var n,r,i,o,a;if(0===e.length)return!1;for(a=t.isIdentifierStartES6,n=0,r=e.length;r>n;++n){if(i=e.charCodeAt(n),i>=55296&&56319>=i){if(++n,n>=r)return!1;if(o=e.charCodeAt(n),!(o>=56320&&57343>=o))return!1;i=l(i,o)}if(!a(i))return!1;a=t.isIdentifierPartES6}return!0}function p(e,t){return u(e)&&!o(e,t)}function d(e,t){return c(e)&&!a(e,t)}e.isKeywordES5=r,e.isKeywordES6=i,e.isReservedWordES5=o,e.isReservedWordES6=a,e.isRestrictedWord=s,e.isIdentifierNameES5=u,e.isIdentifierNameES6=c,e.isIdentifierES5=p,e.isIdentifierES6=d}),function(e,r){"use strict";"function"==typeof n&&n.amd?n("esutils/utils",["exports","./ast","./code","./keyword"],r):"undefined"!=typeof exports?r(exports,t("./ast"),t("./code"),t("./keyword")):r(e.utils={})}(this,function(e,t,n,r){"use strict";e.ast=t,e.code=n,e.keyword=r}),function(e,r){"use strict";"function"==typeof n&&n.amd?n("doctrine/typed",["exports","./utility","esutils/utils"],r):"undefined"!=typeof exports?r(exports,t("./utility"),t("esutils/utils")):r(e.typed={})}(this,function(e,t,n){"use strict";function r(e){return-1==="><(){}[],:*|?!=".indexOf(String.fromCharCode(e))&&!n.code.isWhiteSpace(e)&&!n.code.isLineTerminator(e)}function i(e,t,n,r){this._previous=e,this._index=t,this._token=n,this._value=r}function o(){var e=L.charAt(N);return N+=1,e}function a(e){var t,r,i,a=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(I>N&&n.code.isHexDigit(L.charCodeAt(N))))return"";i=o(),a=16*a+"0123456789abcdef".indexOf(i.toLowerCase())}return String.fromCharCode(a)}function s(){var e,r,i,s,u,l="";for(e=L.charAt(N),++N;I>N;){if(r=o(),r===e){e="";break}if("\\"===r)if(r=o(),n.code.isLineTerminator(r.charCodeAt(0)))"\r"===r&&10===L.charCodeAt(N)&&++N;else switch(r){case"n":l+="\n";break;case"r":l+="\r";break;case"t":l+=" ";break;case"u":case"x":u=N,s=a(r),s?l+=s:(N=u,l+=r);break;case"b":l+="\b";break;case"f":l+="\f";break;case"v":l+=" ";break;default:n.code.isOctalDigit(r.charCodeAt(0))?(i="01234567".indexOf(r),I>N&&n.code.isOctalDigit(L.charCodeAt(N))&&(i=8*i+"01234567".indexOf(o()),"0123".indexOf(r)>=0&&I>N&&n.code.isOctalDigit(L.charCodeAt(N))&&(i=8*i+"01234567".indexOf(o()))),l+=String.fromCharCode(i)):l+=r}else{if(n.code.isLineTerminator(r.charCodeAt(0)))break;l+=r}}return""!==e&&t.throwError("unexpected quote"),R=l,j.STRING}function u(){var e,r;if(e="",r=L.charCodeAt(N),46!==r){if(e=o(),r=L.charCodeAt(N),"0"===e){if(120===r||88===r){for(e+=o();I>N&&(r=L.charCodeAt(N),n.code.isHexDigit(r));)e+=o();return e.length<=2&&t.throwError("unexpected token"),I>N&&(r=L.charCodeAt(N),n.code.isIdentifierStart(r)&&t.throwError("unexpected token")),R=parseInt(e,16),j.NUMBER}if(n.code.isOctalDigit(r)){for(e+=o();I>N&&(r=L.charCodeAt(N),n.code.isOctalDigit(r));)e+=o();return I>N&&(r=L.charCodeAt(N),(n.code.isIdentifierStart(r)||n.code.isDecimalDigit(r))&&t.throwError("unexpected token")),R=parseInt(e,8),j.NUMBER}n.code.isDecimalDigit(r)&&t.throwError("unexpected token")}for(;I>N&&(r=L.charCodeAt(N),n.code.isDecimalDigit(r));)e+=o()}if(46===r)for(e+=o();I>N&&(r=L.charCodeAt(N),n.code.isDecimalDigit(r));)e+=o();if(101===r||69===r)if(e+=o(),r=L.charCodeAt(N),(43===r||45===r)&&(e+=o()),r=L.charCodeAt(N),n.code.isDecimalDigit(r))for(e+=o();I>N&&(r=L.charCodeAt(N),n.code.isDecimalDigit(r));)e+=o();else t.throwError("unexpected token");return I>N&&(r=L.charCodeAt(N),n.code.isIdentifierStart(r)&&t.throwError("unexpected token")),R=parseFloat(e),j.NUMBER}function l(){var e,t;for(R=o();I>N&&r(L.charCodeAt(N));){if(e=L.charCodeAt(N),46===e){if(N+1>=I)return j.ILLEGAL;if(t=L.charCodeAt(N+1),60===t)break}R+=o()}return j.NAME}function c(){var e;for(O=N;I>N&&n.code.isWhiteSpace(L.charCodeAt(N));)o();if(N>=I)return M=j.EOF;switch(e=L.charCodeAt(N)){case 39:case 34:return M=s();case 58:return o(),M=j.COLON;case 44:return o(),M=j.COMMA;case 40:return o(),M=j.LPAREN;case 41:return o(),M=j.RPAREN;case 91:return o(),M=j.LBRACK;case 93:return o(),M=j.RBRACK;case 123:return o(),M=j.LBRACE;case 125:return o(),M=j.RBRACE;case 46:if(I>N+1){if(e=L.charCodeAt(N+1),60===e)return o(),o(),M=j.DOT_LT;if(46===e&&I>N+2&&46===L.charCodeAt(N+2))return o(),o(),o(),M=j.REST;if(n.code.isDecimalDigit(e))return M=u()}return M=j.ILLEGAL;case 60:return o(),M=j.LT;case 62:return o(),M=j.GT;case 42:return o(),M=j.STAR;case 124:return o(),M=j.PIPE;case 63:return o(),M=j.QUESTION;case 33:return o(),M=j.BANG;case 61:return o(),M=j.EQUAL;default:return n.code.isDecimalDigit(e)?M=u():(t.assert(r(e)),M=l())}}function p(e,n){t.assert(M===e,n||"consumed token not matched"),c()}function d(e,n){M!==e&&t.throwError(n||"unexpected token"),c()}function f(){var e;if(p(j.LPAREN,"UnionType should start with ("),e=[],M!==j.RPAREN)for(;;){if(e.push(x()),M===j.RPAREN)break;d(j.PIPE)}return p(j.RPAREN,"UnionType should end with )"),{type:P.UnionType,elements:e}}function m(){var e;for(p(j.LBRACK,"ArrayType should start with ["),e=[];M!==j.RBRACK;){if(M===j.REST){p(j.REST),e.push({type:P.RestType,expression:x()});break}e.push(x()),M!==j.RBRACK&&d(j.COMMA)}return d(j.RBRACK),{type:P.ArrayType,elements:e}}function h(){var e=R;return M===j.NAME||M===j.STRING?(c(),e):M===j.NUMBER?(p(j.NUMBER),String(e)):void t.throwError("unexpected token")}function g(){var e;return e=h(),M===j.COLON?(p(j.COLON),{type:P.FieldType,key:e,value:x()}):{type:P.FieldType,key:e,value:null}}function v(){var e;if(p(j.LBRACE,"RecordType should start with {"),e=[],M===j.COMMA)p(j.COMMA);else for(;M!==j.RBRACE;)e.push(g()),M!==j.RBRACE&&d(j.COMMA);return d(j.RBRACE),{type:P.RecordType,fields:e}}function y(){var e=R;return d(j.NAME),M!==j.COLON||"module"!==e&&"external"!==e&&"event"!==e||(p(j.COLON),e+=":"+R,d(j.NAME)),{type:P.NameExpression,name:e}}function D(){var e=[];for(e.push(S());M===j.COMMA;)p(j.COMMA),e.push(S());return e}function E(){var e,t;return e=y(),M===j.DOT_LT||M===j.LT?(c(),t=D(),d(j.GT),{type:P.TypeApplication,expression:e,applications:t}):e}function A(){return p(j.COLON,"ResultType should start with :"),M===j.NAME&&"void"===R?(p(j.NAME),{type:P.VoidLiteral}):x()}function C(){for(var e,n=[],r=!1,i=!1;M!==j.RPAREN;)M===j.REST&&(p(j.REST),i=!0),e=x(),e.type===P.NameExpression&&M===j.COLON&&(p(j.COLON),e={type:P.ParameterType,name:e.name,expression:x()}),M===j.EQUAL?(p(j.EQUAL),e={type:P.OptionalType,expression:e},r=!0):r&&t.throwError("unexpected token"),i&&(e={type:P.RestType,expression:e}),n.push(e),M!==j.RPAREN&&d(j.COMMA);return n}function F(){var e,n,r,i,o;return t.assert(M===j.NAME&&"function"===R,"FunctionType should start with 'function'"),p(j.NAME),d(j.LPAREN),e=!1,r=[],n=null,M!==j.RPAREN&&(M!==j.NAME||"this"!==R&&"new"!==R?r=C():(e="new"===R,p(j.NAME),d(j.COLON),n=E(),M===j.COMMA&&(p(j.COMMA),r=C()))),d(j.RPAREN),i=null,M===j.COLON&&(i=A()),o={type:P.FunctionType,params:r,result:i},n&&(o["this"]=n,e&&(o["new"]=!0)),o}function b(){var e;switch(M){case j.STAR:return p(j.STAR),{type:P.AllLiteral};case j.LPAREN:return f();case j.LBRACK:return m();case j.LBRACE:return v();case j.NAME:if("null"===R)return p(j.NAME),{type:P.NullLiteral};if("undefined"===R)return p(j.NAME),{type:P.UndefinedLiteral};if(e=i.save(),"function"===R)try{return F()}catch(n){e.restore()}return E();default:t.throwError("unexpected token")}}function x(){var e;return M===j.QUESTION?(p(j.QUESTION),M===j.COMMA||M===j.EQUAL||M===j.RBRACE||M===j.RPAREN||M===j.PIPE||M===j.EOF||M===j.RBRACK||M===j.GT?{type:P.NullableLiteral}:{type:P.NullableType,expression:b(),prefix:!0}):M===j.BANG?(p(j.BANG),{type:P.NonNullableType,expression:b(),prefix:!0}):(e=b(),M===j.BANG?(p(j.BANG),{type:P.NonNullableType,expression:e,prefix:!1}):M===j.QUESTION?(p(j.QUESTION),{type:P.NullableType,expression:e,prefix:!1}):M===j.LBRACK?(p(j.LBRACK),d(j.RBRACK,"expected an array-style type declaration ("+R+"[])"),{type:P.TypeApplication,expression:{type:P.NameExpression,name:"Array"},applications:[e]}):e)}function S(){var e,t;if(e=x(),M!==j.PIPE)return e;for(t=[e],p(j.PIPE);;){if(t.push(x()),M!==j.PIPE)break;p(j.PIPE)}return{type:P.UnionType,elements:t}}function w(){var e;return M===j.REST?(p(j.REST),{type:P.RestType,expression:S()}):(e=S(),M===j.EQUAL?(p(j.EQUAL),{type:P.OptionalType,expression:e}):e)}function B(e,n){var r;return L=e,I=L.length,N=0,O=0,c(),r=S(),n&&n.midstream?{expression:r,index:O}:(M!==j.EOF&&t.throwError("not reach to EOF"),r)}function k(e,n){var r;return L=e,I=L.length,N=0,O=0,c(),r=w(),n&&n.midstream?{expression:r,index:O}:(M!==j.EOF&&t.throwError("not reach to EOF"),r)}function _(e,n,r){var i,o,a;switch(e.type){case P.NullableLiteral:i="?";break;case P.AllLiteral:i="*";break;case P.NullLiteral:i="null";break;case P.UndefinedLiteral:i="undefined";break;case P.VoidLiteral:i="void";break;case P.UnionType:for(i=r?"":"(",o=0,a=e.elements.length;a>o;++o)i+=_(e.elements[o],n),o+1!==a&&(i+="|");r||(i+=")");break;case P.ArrayType:for(i="[",o=0,a=e.elements.length;a>o;++o)i+=_(e.elements[o],n),o+1!==a&&(i+=n?",":", ");i+="]";break;case P.RecordType:for(i="{",o=0,a=e.fields.length;a>o;++o)i+=_(e.fields[o],n),o+1!==a&&(i+=n?",":", ");i+="}";break;case P.FieldType:i=e.value?e.key+(n?":":": ")+_(e.value,n):e.key;break;case P.FunctionType:for(i=n?"function(":"function (",e["this"]&&(i+=e["new"]?n?"new:":"new: ":n?"this:":"this: ",i+=_(e["this"],n),0!==e.params.length&&(i+=n?",":", ")),o=0,a=e.params.length;a>o;++o)i+=_(e.params[o],n),o+1!==a&&(i+=n?",":", ");i+=")",e.result&&(i+=(n?":":": ")+_(e.result,n));break;case P.ParameterType:i=e.name+(n?":":": ")+_(e.expression,n);break;case P.RestType:i="...",e.expression&&(i+=_(e.expression,n));break;case P.NonNullableType:i=e.prefix?"!"+_(e.expression,n):_(e.expression,n)+"!";break;case P.OptionalType:i=_(e.expression,n)+"=";break;case P.NullableType:i=e.prefix?"?"+_(e.expression,n):_(e.expression,n)+"?";break;case P.NameExpression:i=e.name;break;case P.TypeApplication:for(i=_(e.expression,n)+".<",o=0,a=e.applications.length;a>o;++o)i+=_(e.applications[o],n),o+1!==a&&(i+=n?",":", ");i+=">";break;default:t.throwError("Unknown type "+e.type)}return i}function T(e,t){return null==t&&(t={}),_(e,t.compact,t.topLevel)}var P,j,L,I,N,O,M,R;P={NullableLiteral:"NullableLiteral",AllLiteral:"AllLiteral",NullLiteral:"NullLiteral",UndefinedLiteral:"UndefinedLiteral",VoidLiteral:"VoidLiteral",UnionType:"UnionType",ArrayType:"ArrayType",RecordType:"RecordType",FieldType:"FieldType",FunctionType:"FunctionType",ParameterType:"ParameterType",RestType:"RestType",NonNullableType:"NonNullableType",OptionalType:"OptionalType",NullableType:"NullableType",NameExpression:"NameExpression",TypeApplication:"TypeApplication"},j={ILLEGAL:0,DOT_LT:1,REST:2,LT:3,GT:4,LPAREN:5,RPAREN:6,LBRACE:7,RBRACE:8,LBRACK:9,RBRACK:10,COMMA:11,COLON:12,STAR:13,PIPE:14,QUESTION:15,BANG:16,EQUAL:17,NAME:18,STRING:19,NUMBER:20,EOF:21},i.prototype.restore=function(){O=this._previous,N=this._index,M=this._token,R=this._value},i.save=function(){return new i(O,N,M,R)},e.parseType=B,e.parseParamType=k,e.stringify=T,e.Syntax=P}),function(e,r){"use strict";"function"==typeof n&&n.amd?n("doctrine/doctrine",["exports","./typed","./utility","esutils/utils"],r):"undefined"!=typeof exports?r(exports,t("./typed"),t("./utility"),t("esutils/utils")):r(e.doctrine={})}(this,function(e,t,n,r){"use strict";function i(e,t,n){return e.slice(t,n)}function o(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function a(e){return e>=97&&122>=e||e>=65&&90>=e||e>=48&&57>=e}function s(e){return"param"===e||"argument"===e||"arg"===e}function u(e){return"return"===e||"returns"===e}function l(e){return"property"===e||"prop"===e}function c(e){return s(e)||l(e)||"alias"===e||"this"===e||"mixes"===e||"requires"===e}function p(e){return c(e)||"const"===e||"constant"===e}function d(e){return l(e)||s(e)}function f(e){return s(e)||u(e)||"define"===e||"enum"===e||"implements"===e||"this"===e||"type"===e||"typedef"===e||l(e)}function m(e){return f(e)||"throws"===e||"const"===e||"constant"===e||"namespace"===e||"member"===e||"var"===e||"module"===e||"constructor"===e||"class"===e||"extends"===e||"augments"===e||"public"===e||"private"===e||"protected"===e}function h(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function g(e){var t,n,i,o,a,s=0,u=1,l=2;for(e=e.replace(/^\/\*\*?/,"").replace(/\*\/$/,""),t=0,n=e.length,i=s,o="";n>t;){switch(a=e.charCodeAt(t),i){case s:r.code.isLineTerminator(a)?o+=String.fromCharCode(a):42===a?i=u:r.code.isWhiteSpace(a)||(o+=String.fromCharCode(a),i=l);break;case u:r.code.isWhiteSpace(a)||(o+=String.fromCharCode(a)),i=r.code.isLineTerminator(a)?s:l;break;case l:o+=String.fromCharCode(a),r.code.isLineTerminator(a)&&(i=s)}t+=1}return o.replace(/\s+$/,"")}var v,y;y=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),function(e){function o(){var e=P.charCodeAt(k);return k+=1,!r.code.isLineTerminator(e)||13===e&&10===P.charCodeAt(k)||(_+=1),String.fromCharCode(e)}function l(){var e="";for(o();T>k&&a(P.charCodeAt(k));)e+=o();return e}function v(){var e,t,n=k;for(t=!1;T>n;){if(e=P.charCodeAt(n),!r.code.isLineTerminator(e)||13===e&&10===P.charCodeAt(n+1)){if(t){if(64===e)break;r.code.isWhiteSpace(e)||(t=!1)}}else _+=1,t=!0;n+=1}return n}function D(e,i){for(var a,u,l,c=!1;i>k;){if(a=P.charCodeAt(k),!r.code.isWhiteSpace(a)){if(123===a){o();break}c=!0;break}o()}if(c)return null;for(u=1,l="";i>k;)if(a=P.charCodeAt(k),r.code.isLineTerminator(a))o();else{if(125===a){if(u-=1,0===u){o();break}}else 123===a&&(u+=1);l+=o()}return 0!==u?n.throwError("Braces are not balanced"):s(e)?t.parseParamType(l):t.parseType(l)}function E(e){var t;if(!r.code.isIdentifierStartES5(P.charCodeAt(k)))return null;for(t=o();e>k&&r.code.isIdentifierPartES5(P.charCodeAt(k));)t+=o();return t}function A(e){for(;e>k&&(r.code.isWhiteSpace(P.charCodeAt(k))||r.code.isLineTerminator(P.charCodeAt(k)));)o()}function C(e,t,n){var i,a="";if(A(e),k>=e)return null;if(t&&91===P.charCodeAt(k)&&(i=!0,a=o()),!r.code.isIdentifierStartES5(P.charCodeAt(k)))return null;if(a+=E(e),n)for(58!==P.charCodeAt(k)||"module"!==a&&"external"!==a&&"event"!==a||(a+=o(),a+=E(e)),91===P.charCodeAt(k)&&93===P.charCodeAt(k+1)&&(a+=o(),a+=o());46===P.charCodeAt(k)||35===P.charCodeAt(k)||126===P.charCodeAt(k);)a+=o(),a+=E(e);if(i){if(61===P.charCodeAt(k)){a+=o();for(var s=1;e>k;){if(91===P.charCodeAt(k))s++;else if(93===P.charCodeAt(k)&&0===--s)break;a+=o()}}if(k>=e||93!==P.charCodeAt(k))return null;a+=o()}return a}function F(){for(;T>k&&64!==P.charCodeAt(k);)o();return k>=T?!1:(n.assert(64===P.charCodeAt(k)),!0)}function b(e,t){this._options=e,this._title=t,this._tag={title:t,description:null},this._options.lineNumbers&&(this._tag.lineNumber=_),this._last=0,this._extra={}}function x(e){var t,n;return F()?(t=l(),n=new b(e,t),n.parse()):null}function S(e){var t,n,i="";for(n=!0;T>k&&(t=P.charCodeAt(k),!n||64!==t);)r.code.isLineTerminator(t)?n=!0:n&&!r.code.isWhiteSpace(t)&&(n=!1),i+=o();return e?i:h(i)}function w(e,t){var r,i,o,a,s,u=[];if(void 0===t&&(t={}),P="boolean"==typeof t.unwrap&&t.unwrap?g(e):e,t.tags)if(Array.isArray(t.tags))for(o={},a=0,s=t.tags.length;s>a;a++)"string"==typeof t.tags[a]?o[t.tags[a]]=!0:n.throwError('Invalid "tags" parameter: '+t.tags);else n.throwError('Invalid "tags" parameter: '+t.tags);for(T=P.length,k=0,_=0,j=t.recoverable,L=t.sloppy,I=t.strict,i=S(t.preserveWhitespace);;){if(r=x(t),!r)break;(!o||o.hasOwnProperty(r.title))&&u.push(r)}return{description:i,tags:u}}var B,k,_,T,P,j,L,I;b.prototype.addError=function(e){var t=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return n.assert(re;++e)if(r=n[e],!this[r]())return null;return k=this._last,this._tag},e.parse=w}(v={}),e.version=n.VERSION,e.parse=v.parse,e.parseType=t.parseType,e.parseParamType=t.parseParamType,e.unwrapComment=g,e.Syntax=o(t.Syntax),e.Error=n.DoctrineError,e.type={Syntax:e.Syntax,parseType:t.parseType,parseParamType:t.parseParamType,stringify:t.stringify}}),n("javascript/hover",["orion/objects","javascript/finder","orion/URITemplate","orion/Deferred","i18n!javascript/nls/messages","orion/i18nUtil","doctrine/doctrine"],function(e,t,n,r,i,o,a){function s(e,t){if(!e)return null;try{var n=Object.create(null);if(e){var r=a.parse(e,{recoverable:!0,unwrap:!0});if(n.params=[],n["throws"]=[],n.see=[],n.desc=r.description?r.description:"",r.tags)for(var s=r.tags.length,l=0;s>l;l++){var c=r.tags[l];switch(c.title){case"name":c.name&&(n.name=c.name);break;case"description":null!==c.description&&(n.desc=""===n.desc?c.description:n.desc+"\n"+c.description);break;case"param":n.params.push(u(c.type)+(c.name?"__"+c.name+"__ ":"")+(c.description?c.description+"\n":""));break;case"returns":case"return":n.returns=u(c.type)+(c.description?c.description+"\n":"");break;case"since":c.description&&(n.since=c.description);break;case"callback":n.callback=c.description?c.description:i.callbackText;break;case"throws":n["throws"].push(u(c.type)+(c.description?c.description+"\n":""));break;case"see":n.see.push(u(c.type)+(c.description?c.description+"\n":""));break;case"deprecated":n.deprecated=c.description?c.description+"\n":""}}}var p="";if("undefined"!=typeof n.deprecated&&(p+=o.formatMessage("__${0}__ ",i.deprecatedHoverTitle)+n.deprecated+"\n\n"),""!==n.desc&&(p+=n.desc+"\n\n"),n.params.length>0)for(p+=o.formatMessage("__${0}__\n\n",i.parametersHoverTitle),l=0;l"+n.params[l]+"\n\n";if(n.returns&&(p+=o.formatMessage("__${0}__\n\n>",i.returnsHoverTitle)+n.returns+"\n\n"),n["throws"].length>0)for(p+=o.formatMessage("__${0}__\n\n",i.throwsHoverTitle),l=0;l"+n["throws"][l]+"\n\n";if(n.callback&&(p+=o.formatMessage("__${0}__\n\n>",i.callbackHoverTitle)+n.callback+"\n\n"),n.since&&(p+=o.formatMessage("__${0}__\n\n>",i.sinceHoverTitle)+n.since+"\n\n"),n.see.length>0)for(p+=o.formatMessage("__${0}__\n\n",i.seeAlsoHoverTitle),l=0;l"+n.see[l],l0){var t=e.applications[0];return t.name?"*("+t.name+"[])* ":u(t.fields&&t.fields.length>0?t.fields[0]:t)}return u(e.expression);case"UnionType":case"ArrayType":if(e.elements&&e.elements.length>0)return u(e.elements[0]);break;case"FieldType":return u(e.value);default:return""}}function l(e,t,n,r){this.astManager=e,this.resolver=t,this.ternworker=n,this.cuprovider=r}var c;return e.mixin(l.prototype,{computeHoverInfo:function(e,n){if(n.proposal&&"js"===n.proposal.kind)return n.proposal.hover;var r=this;return e.getFileMetadata().then(function(i){return i?(r.resolver.setSearchLocation(Array.isArray(i.parents)&&i.parents.length>0?i.parents[i.parents.length-1].Location:null),i&&"application/javascript"===i.contentType.id?r.astManager.getAST(e).then(function(e){return r._doHover(e,n,i)}):e.getText().then(function(e){var o=r.cuprovider.getCompilationUnit(function(){t.findScriptBlocks(e)},i);return o.validOffset(n.offset)?r.astManager.getAST(o.getEditorContext()).then(function(t){return r._doHover(t,n,i,e)}):null})):null})},_doHover:function(e,n,i,o){var a=t.findNode(n.offset,e,{parents:!0});if(a&&"Literal"===a.type){if(n.offset<=a.range[0]||n.offset>=a.range[1])return null;var u=a.parents,l=u.pop(),p=this;if("ArrayExpression"===l.type){if(l=u.pop(),"CallExpression"===l.type&&("define"===l.callee.name||"require"===l.callee.name)){var d=a.value;return p.resolver.getWorkspaceFile(d).then(function(e){return p._formatFilesHover(d,e)})}}else if("CallExpression"===l.type)switch(d=a.value,l.callee.name){case"require":return p.resolver.getWorkspaceFile(d).then(function(e){/\.js$/.test(d)||(d+=".js");var t=p.resolver.resolveRelativeFiles(d,e,i);return t&&t.length>0?p._formatFilesHover(a.value,t):void 0});case"importScripts":return d=a.value,p.resolver.getWorkspaceFile(d).then(function(e){/\.js$/.test(d)||(d+=".js");var t=p.resolver.resolveRelativeFiles(d,e,i);return t&&t.length>0?p._formatFilesHover(a.value,t):void 0})}return null}c=new r;var f=[{type:"full",name:i.location,text:o?o:e.source}];return this.ternworker.postMessage({request:"documentation",args:{params:{offset:n.offset,docFormat:"full"},files:f,meta:{location:i.location}}},function(e){var t="";"documentation"===e.request&&(e.doc&&(t=s(e.doc.doc)),c.resolve(t))}),c},_formatFilesHover:function(e,t){if(e&&t){var r=null;t.length>1&&(r=o.formatMessage("###${0} '${1}'###",i.openFileForTitle,e));for(var a="",s=0;s0?r:(d++,i);if("-"===i){if(">"===e.charAt(d+1))return d+=2,"->"}else{if("("===i)return"fn"===r?(r+=i,d++,r):i;if("|"===i)return r;""===i?d++:(r+=i,d++,i=e.charAt(d))}}return r}function i(t){var n=r(t),i=new e(f);if("fn("===n){var o=[];")"!==t.charAt(d)&&a(t,o),r(t);var u=s(t);return i.finishFunction(t.substring(i.start,d),u,o)}return null}function o(e){var t;return t="f"===e.charAt(d)&&"n"===e.charAt(d+1)&&"("===e.charAt(d+2)?i(e):u(e),"|"===e.charAt(d)&&(t=l(t,e)),t}function a(t,i){var s=r(t),u=new e(f),l=r(t);":"===l&&(n(t),i.push(u.finishParam(s,o(t))),n(t),","===t.charAt(d)&&(r(t),a(t,i)))}function s(e){return n(e),"-"===e.charAt(d)&&">"===e.charAt(d+1)?(r(e),n(e),o(e)):null}function u(n){var i=r(n),a=new e(f);if(t(i)){if("{"===i){var s=n.charAt(d);if("}"===s)return r(n),a.finishObject(n.substring(a.start,d),[]);for(var u=[];"}"!==s&&d0&&(n.positions=r)}function g(e){return e.replace(/:\s*\?/g,": any")}function v(e){var t=/([^/.]+\/[^\/]+)$/g.exec(e);return t?t[1]:(t=/\/([^\/]+)$/g.exec(e),t?t[1]:e)}function y(t,n,r){for(var i=r.envs?r.envs:{},o=Object.create(null),a=Object.create(null),u=[],l=[],c=0;c0&&(n.sort(function(e,t){return e.namet.name?1:0}),n.splice(0,0,{proposal:"",description:e.templateAssistHeader,style:"noemphasis_title",unselectable:!0}),y=y.concat(n)),l.length>0&&(l.sort(A),l.splice(0,0,{proposal:"",description:e.keywordAssistHeader,style:"noemphasis_title",unselectable:!0}),y=y.concat(l)),y}c.prototype=new i.TemplateContentAssist([],[]),n.mixin(c.prototype,{uninterestingChars:":!#$^&.?<>",isValid:function(e,t,n){var r=t.charAt(n-e.length-1);return!r||-1===this.uninterestingChars.indexOf(r)},getTemplateProposals:function(t,n,r,i){for(var s=[],u=this.getKind(i,n),c=o.getTemplatesForKind(u.kind),p=0;pt.name?1:0}),s},templateMatches:function(e,t,n,r){if(e.match(t)){if("undefined"!=typeof r.line){var i=r.line.length-("undefined"!=typeof t?t.length:0),o=r.line.slice(0,i>-1?i:0).trim();if(n&&"jsdoc"===n.kind)return!/^[\/]?[\*]+\s*[@]/gi.test(o)}if(n&&"doc"===n.kind){var a=n.node.value.trim();if(a){var s=r.offset-t.length-n.node.range[0];if(s>-1){var u=/^(eslint-\w+|eslint?)(\s|$)/gi.exec(a.slice(0,s));if(u)return!1}}}return!0}return!1},getKind:function(e,t){var n=r.findNode(t,e,{parents:!0});if(n&&n.parents&&n.parents.length>0){var i=n.parents.pop();switch(i.type){case"MemberExpression":return{kind:"member"};case"Program":case"BlockStatement":break;case"VariableDeclarator":if(!i.init||t=i.value.range[0]&&t-1<=i.value.range[1]?{kind:"prop"}:null;case"SwitchStatement":return{kind:"swtch"}}}return n=r.findComment(t,e),n?{kind:"doc",node:n}:{kind:"top"}}});var D=new c;n.mixin(p.prototype,{initialize:function(){},computeContentAssist:function(e,t){var n=this;return e.getFileMetadata().then(function(i){return"text/html"===i.contentType.id?e.getText().then(function(e){var o=n.cuprovider.getCompilationUnit(function(){return r.findScriptBlocks(e)},i);return o.validOffset(t.offset)?n.astManager.getAST(o.getEditorContext()).then(function(r){return n.pluginenvs().then(function(o){return n.doAssist(r,t,i,{ecma5:!0,ecma6:!0,browser:!0},o,e)})}):[]}):n.astManager.getAST(e).then(function(e){return n.pluginenvs().then(function(r){return n.doAssist(e,t,i,{ecma5:!0,ecma6:!0},r)})})})},doAssist:function(e,n,r,i,o,a){var s=d(n,e),u=this.getActiveEnvironments(e,i),l=[{type:"full",name:r.location,text:a?a:e.source}];"undefined"==typeof n.keywords&&(n.keywords=!0);var c={params:n,meta:r,envs:u,files:l},p=new t,f=this;return this.ternworker.postMessage({request:"completions",args:c},function(e){clearTimeout(f.timeout),p.resolve(y(e.proposals,s,c))}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){p&&p.resolve(n.timeoutReturn?n.timeoutReturn:[]),f.timeout=null},n.timeout?n.timeout:5e3),p},getActiveEnvironments:function(e,t){var r=Object.create(null);if(n.mixin(r,t),e.comments)for(var i=0;it.relevance)return-1;if(t.relevance>e.relevance)return 1;var n=e.name,r=t.name;return r>n?-1:n>r?1:0};return{TernContentAssist:p}}),n("javascript/contentAssist/ternProjectAssist",["i18n!javascript/nls/messages","orion/i18nUtil","javascript/finder","javascript/hover","javascript/util","orion/editor/templates","esprima/esprima"],function(e,t,n,r,i,o,a){function s(e){try{var t=a.parse(e,{range:!0,tolerant:!0})}catch(n){t=i.errorAST(n,"",e)}return t}function u(e){var t=[];return d.forEach(function(n){if(i.looselyMatches(e,n.prefix)){var r=new o.Template(e,n.description,n.template,n.name);n.doc&&(r.doc=n.doc),n.url&&(r.url=n.url),t.push(r)}}),t}function l(n,i){var o,a=n.getProposal(i.prefix,i.offset,i);return n.doc?o=r.formatMarkdownHover(n.doc):(o=Object.create(null),o.type="markdown",o.content=e.templateHoverHeader,o.content+=a.proposal),n.url&&(o.content+=t.formatMessage.call(null,e.onlineDocumentationProposalEntry,n.url)),a.hover=o,a.style="emphasis",c(i.prefix,a),a.kind="js",a}function c(e,t){var n=t.overwrite=t.proposal.substring(0,e.length)!==e;n||(t.proposal=t.proposal.substring(e.length))}function p(e,t){var r=[];if(0===e.trim().length){var i=u(t.prefix);i.forEach(function(e){r.push(l(e,t))})}else{var o="var v="+e,a=s(o);n.findNode(t.offset,a,{parents:!0})}return r}var d=[{prefix:"",name:"New file",description:"",template:'{\n "plugins": {},\n "libs": ["ecma5"],\n "ecmaVersion": 5,\n "dependencyBudget": 20000\n}',doc:e.emptyFileTemplateDoc,url:"http://ternjs.net/doc/manual.html#configuration"}];return{getProposals:p}}),n("javascript/nls/problems",{root:!0}),n("javascript/nls/root/problems",{syntaxErrorIncomplete:"Syntax error, incomplete statement.",syntaxErrorBadToken:"Syntax error on token '${0}', delete this token.",esprimaParseFailure:"Esprima failed to parse this file because an error occurred: ${0}",eslintValidationFailure:"ESLint failed to validate this file because an error occurred: ${0}",curly:"Statement should be enclosed in braces.","curly-description":"Require curly braces for all control statements.",eqeqeq:"Expected '${0}' and instead saw '${1}'.","eqeqeq-description":"Require the use of === and !==.","missing-doc":"Missing documentation for function '${0}'.","missing-doc-description":"Require JSDoc for all functions.","missing-nls":"Non-externalized string literal '${0}'.","missing-nls-description":"Disallow non-externalized string literals.","new-parens":"Missing parentheses invoking constructor.","new-parens-description":"Require parenthesis for constructors.","no-caller":"'arguments.${0}' is deprecated.","no-caller-description":"Warn on use of arguments.callee or arguments.caller.","no-comma-dangle":"Trailing commas in object expressions are discouraged.","no-comma-dangle-description":"Report extra trailing comma in object expressions.","no-cond-assign":"Expected a conditional expression and instead saw an assignment.","no-cond-assign-description":"Disallow assignment statements in control statements like if-else, do-while, while and for statements.","no-console":"Discouraged use of console in browser-based code.","no-console-description":"Disallow the use of 'console' in browser-run code.","no-constant-condition":"Discouraged use of constant as a conditional expression.","no-constant-condition-description":"Disallow use of a constant value as a conditional expression.","no-debugger":"'debugger' statement use is discouraged.","no-debugger-description":"Disallow use of the debugger keyword.","no-dupe-keys":"Duplicate object key '${0}'.","no-dupe-keys-description":"Warn when object contains duplicate keys.","no-empty-block":"Empty block should be removed or commented.","no-empty-block-description":"Warn when a code block is empty.","no-eval":"${0} function calls are discouraged.","no-eval-description":"Disallow use of eval function.","no-extra-semi":"Unnecessary semicolon.","no-extra-semi-description":"Warn about extraneous semi colons.","no-fallthrough":"Switch case may be entered by falling through the previous case.","no-fallthrough-description":"Warn when a switch case falls through.","no-implied-eval":"${0} function calls are discouraged.","no-implied-eval-description":"Disallow use of implied eval function.","no-iterator":"Discouraged __iterator__ property use.","no-iterator-description":"Warn when the __iterator__ property is used.","no-proto":"Discouraged __proto__ property use.","no-proto-description":"Warn when the __proto__ property is used.","no-jslint":"The '${0}' directive is unsupported, please use eslint-env.","no-jslint-description":"Warn when the jslint/jshint directive is used.","no-mixed-spaces-and-tabs":"Mixed spaces and tabs.","no-mixed-spaces-and-tabs-description":"Warn about mixed spaces and tabs.","no-new-array":"Use the array literal notation '[]'.","no-new-array-description":"Disallow use of the Array constructor.","no-new-func":"The Function constructor is eval.","no-new-func-description":"Disallow use of the Function constructor.","no-new-object":"Use the object literal notation '{}' or Object.create(null).","no-new-object-description":"Disallow use of the Object constructor.","no-new-wrappers":"Do not use '${0}' as a constructor.","no-new-wrappers-description":"Disallow creating new String, Number or Boolean via their constructor.","no-redeclare":"'${0}' is already defined.","no-redeclare-description":"Warn when variable or function is redeclared.","no-regex-spaces":"Avoid multiple spaces in regular expressions. Use ' {${0}}' instead.","no-regex-spaces-description":"Warn when multiple spaces are used in regular expressions.","no-reserved-keys":"Reserved words should not be used as property keys.","no-reserved-keys-description":"Warn when a reserved word is used as a property key.","no-shadow":"'${0}' is already declared in the upper scope.","no-shadow-description":"Warn when shadowing variable from upper scope.","no-shadow-global":"Variable '${0}' shadows a global member.","no-shadow-global-description":"Warn when a variable or parameter shadows a member from the global environment.","no-shadow-global-param":"Parameter '${0}' shadows a global member.","no-sparse-arrays":"Sparse array declarations should be avoided.","no-sparse-arrays-description":"Warn when sparse arrays are defined.","no-throw-literal":"Throw an Error instead.","no-throw-literal-description":"Warn when a Literal is used in a throw statement.","no-undef-defined":"'${0}' is undefined.","no-undef-init":"Avoid explicitly initializing variables to 'undefined'.","no-undef-init-description":"Warn when variables are explicitly initialized to undefined.","no-undef-readonly":"'${0}' is read-only.","no-undef-description":"Warn when used variable or function has not been defined.","no-unreachable":"Unreachable code.","no-unreachable-description":"Warn when code is not reachable.","no-unused-params":"Parameter '${0}' is never used.","no-unused-params-description":"Warn when function parameters are not used.","no-unused-vars-unused":"'${0}' is unused.","no-unused-vars-unused-funcdecl":"Function '${0}' is unused.","no-unused-vars-unread":"'${0}' is unread.","no-unused-vars-description":"Warn when declared variables are not used.","no-use-before-define":"'${0}' was used before it was defined.","no-use-before-define-description":"Warn when a variable or function is used before it is defined.","no-with":"Discouraged use of 'with' statement.","no-with-description":"Warn when the with statement is used.",radix:"Missing radix parameter.","radix-description":"Warn when parseInt() is called without the 'radix' parameter.",semi:"Missing semicolon.","semi-description":"Warn about missing semicolons.","unnecessary-nls":"Unnecessary $NON-NLS$ tag.","unnecessary-nls-description":"Disallow unnecessary non-NLS comments.","use-isnan":"Use the isNaN function to compare with NaN.","use-isnan-description":"Disallow comparison to the value NaN.","valid-typeof":"Invalid typeof comparison.","valid-typeof-description":"Warn when incorrectly comparing the result of a typeof expression.","accessor-pairs-description":"Report when accessors don't come in pairs (getter, setter)","no-control-regex-description":"Disallow control characters in regular expressions","no-duplicate-case-description":"Disallow a duplicate case label","no-empty-character-class-description":"Disallow empty character classes","no-extra-boolean-cast-description":"Discourage redundant double negation","no-extra-parens-description":"Discourage redundant parentheses","no-invalid-regexp-description":"Report invalid regular expressions","no-negated-in-lhs-description":"Disallow negated left operand of in operator","no-obj-calls-description":"Disallow global object as function calls","no-eq-null-description":"Disallow null comparisons","no-else-return-description":"Report else after return","no-empty-label-description":"No empty labels","no-self-compare-description":"Disallow self compare","no-irregular-whitespace-description":"No irregular whitespace:","no-self-assign-description":"Disallow self assignment","no-self-assign":"Assigning to itself is pointless.","type-checked-consistent-return-description":"Detect inconsistent return values","inconsistent-return":"Inconsistent return types: '{{type1}}', '{{type2}}'",notNum:"'${0}' must be a number",notArray:"'${0}' must be an array of strings",notEmpty:"'${0}' should not be empty",onlyStrings:"'${0}' entries can only be strings",notObject:"'${0}' must be an object",pluginNotObject:"plugin '${0}' must be an object",noDupes:"Duplicate entries are not allowed",problemInFile:"There is a problem with your .tern-project-file.",openFile:"Open the .tern-project file",errorParsing:"There was an error parsing the JSON in your .tern-project file",multiAttrProblems:"Multiple problems were found with attributes in your .tern-project file.",attrProblem:"A problem with one of the attributes in your .tern-project file was found.",multipleFileMatchesProblem:"Multiple file matches found for: ${0}. Defaulting to: ${1}.",noFileMatchProblem:"No file match found for: ${0}.",tooManyFileMatchProblems:"... (${0} more)",fileMatchProblems:"Problems found in the loadEagerly attribute of your .tern-project file.",fileMatchProgress:"Validating loadEagerly paths in your .tern-project file.",failedWrite:"There was a problem writing to your .tern-project file."}),n("javascript/ruleData",["i18n!javascript/nls/problems"],function(e){var t={defaults:{"accessor-pairs":1,curly:0,eqeqeq:1,"missing-doc":0,"missing-nls":0,"new-parens":1,"no-caller":1,"no-comma-dangle":0,"no-cond-assign":2,"no-console":0,"no-constant-condition":2,"no-control-regex":2,"no-debugger":1,"no-dupe-keys":2,"no-duplicate-case":2,"no-else-return":1,"no-empty-block":0,"no-empty-character-class":2,"no-empty-label":2,"no-eq-null":1,"no-eval":0,"no-extra-boolean-cast":2,"no-extra-parens":1,"no-extra-semi":1,"no-fallthrough":2,"no-implied-eval":0,"no-invalid-regexp":2,"no-irregular-whitespace":0,"no-iterator":2,"no-jslint":1,"no-mixed-spaces-and-tabs":0,"no-negated-in-lhs":2,"no-new-array":1,"no-new-func":1,"no-new-object":1,"no-new-wrappers":1,"no-obj-calls":2,"no-proto":2,"no-redeclare":1,"no-regex-spaces":2,"no-reserved-keys":2,"no-self-compare":2,"no-self-assign":2,"no-shadow":1,"no-shadow-global":1,"no-sparse-arrays":1,"no-throw-literal":1,"no-undef":2,"no-undef-init":1,"no-unreachable":2,"no-unused-params":1,"no-unused-vars":1,"no-use-before-define":1,"no-with":1,radix:1,semi:1,"type-checked-consistent-return":0,"unnecessary-nls":0,"use-isnan":2,"valid-typeof":2},metadata:{"accessor-pairs":{description:e["accessor-pairs-description"],url:"http://eslint.org/docs/rules/accessor-pairs"},curly:{description:e["curly-description"],url:"http://eslint.org/docs/rules/curly"},eqeqeq:{description:e["eqeqeq-description"],url:"http://eslint.org/docs/rules/eqeqeq"},"missing-doc":{description:e["missing-doc-description"],url:"http://eslint.org/docs/rules/valid-jsdoc"},"missing-nls":{description:e["missing-nls-description"]},"new-parens":{description:e["new-parens-description"],url:"http://eslint.org/docs/rules/new-parens"},"no-caller":{description:e["no-caller-description"],url:"http://eslint.org/docs/rules/no-caller"},"no-comma-dangle":{description:e["no-comma-dangle-description"],url:"http://eslint.org/docs/rules/no-comma-dangle"},"no-cond-assign":{description:e["no-cond-assign-description"],url:"http://eslint.org/docs/rules/no-cond-assign"},"no-console":{description:e["no-console-description"],url:"http://eslint.org/docs/rules/no-console"},"no-constant-condition":{description:e["no-constant-condition-description"],url:"http://eslint.org/docs/rules/no-constant-condition"},"no-control-regex":{description:e["no-control-regex-description"],url:"http://eslint.org/docs/rules/no-control-regex"},"no-debugger":{description:e["no-debugger-description"],url:"http://eslint.org/docs/rules/no-debugger"},"no-dupe-keys":{description:e["no-dupe-keys-description"],url:"http://eslint.org/docs/rules/no-dupe-keys"},"no-duplicate-case":{description:e["no-duplicate-case-description"],url:"http://eslint.org/docs/rules/no-duplicate-case"},"no-else-return":{description:e["no-else-return-description"],url:"http://eslint.org/docs/rules/no-else-return"},"no-empty-block":{description:e["no-empty-block-description"],url:"http://eslint.org/docs/rules/no-empty"},"no-empty-character-class":{description:e["no-empty-character-class-description"],url:"http://eslint.org/docs/rules/no-empty-character-class"},"no-empty-label":{description:e["no-empty-label-description"],url:"http://eslint.org/docs/rules/no-empty-label"},"no-eq-null":{description:e["no-eq-null-description"],url:"http://eslint.org/docs/rules/no-eq-null"},"no-eval":{description:e["no-eval-description"],url:"http://eslint.org/docs/rules/no-eval"},"no-extra-boolean-cast":{description:e["no-extra-boolean-cast-description"],url:"http://eslint.org/docs/rules/no-extra-boolean-cast"},"no-extra-parens":{description:e["no-extra-parens-description"],url:"http://eslint.org/docs/rules/no-extra-parens"},"no-extra-semi":{description:e["no-extra-semi-description"],url:"http://eslint.org/docs/rules/no-extra-semi"},"no-fallthrough":{description:e["no-fallthrough-description"],url:"http://eslint.org/docs/rules/no-fallthrough"},"no-implied-eval":{description:e["no-implied-eval-description"],url:"http://eslint.org/docs/rules/no-implied-eval"},"no-invalid-regexp":{description:e["no-invalid-regexp-description"],url:"http://eslint.org/docs/rules/no-invalid-regexp"},"no-irregular-whitespace":{description:e["no-irregular-whitespace-description"],url:"http://eslint.org/docs/rules/no-irregular-whitespace"},"no-iterator":{description:e["no-iterator-description"],url:"http://eslint.org/docs/rules/no-iterator"},"no-jslint":{description:e["no-jslint-description"]},"no-mixed-spaces-and-tabs":{description:e["no-mixed-spaces-and-tabs-description"],url:"http://eslint.org/docs/rules/no-mixed-spaces-and-tabs"},"no-negated-in-lhs":{description:e["no-negated-in-lhs-description"],url:"http://eslint.org/docs/rules/no-negated-in-lhs"},"no-new-array":{description:e["no-new-array-description"],url:"http://eslint.org/docs/rules/no-array-constructor.html"},"no-new-func":{description:e["no-new-func-description"],url:"http://eslint.org/docs/rules/no-new-func"},"no-new-object":{description:e["no-new-object-description"],url:"http://eslint.org/docs/rules/no-new-object"},"no-new-wrappers":{description:e["no-new-wrappers-description"],url:"http://eslint.org/docs/rules/no-new-wrappers"},"no-obj-calls":{description:e["no-obj-calls-description"],url:"http://eslint.org/docs/rules/no-obj-calls"},"no-proto":{description:e["no-proto-description"],url:"http://eslint.org/docs/rules/no-proto.html"},"no-redeclare":{description:e["no-redeclare-description"],url:"http://eslint.org/docs/rules/no-redeclare"},"no-regex-spaces":{description:e["no-regex-spaces-description"],url:"http://eslint.org/docs/rules/no-regex-spaces"},"no-reserved-keys":{description:e["no-reserved-keys-description"],url:"http://eslint.org/docs/rules/no-reserved-keys"},"no-self-compare":{description:e["no-self-compare-description"],url:"http://eslint.org/docs/rules/no-self-compare"},"no-self-assign":{description:e["no-self-assign-description"],url:"http://eslint.org/docs/rules/no-self-assign"},"no-shadow":{description:e["no-shadow-description"],url:"http://eslint.org/docs/rules/no-shadow"},"no-shadow-global":{description:e["no-shadow-global-description"]},"no-sparse-arrays":{description:e["no-sparse-arrays-description"],url:"http://eslint.org/docs/rules/no-sparse-arrays"},"no-throw-literal":{description:e["no-throw-literal-description"],url:"http://eslint.org/docs/rules/no-throw-literal"},"no-undef":{description:e["no-undef-description"],url:"http://eslint.org/docs/rules/no-undef"},"no-undef-init":{description:e["no-undef-init-description"],url:"http://eslint.org/docs/rules/no-undef-init.html"},"no-unreachable":{description:e["no-unreachable-description"],url:"http://eslint.org/docs/rules/no-unreachable"},"no-unused-params":{description:e["no-unused-params-description"]},"no-unused-vars":{description:e["no-unused-vars-description"],url:"http://eslint.org/docs/rules/no-unused-vars"},"no-use-before-define":{description:e["no-use-before-define-description"],url:"http://eslint.org/docs/rules/no-use-before-define"},"no-with":{description:e["no-with-description"],url:"http://eslint.org/docs/rules/no-with"},radix:{description:e["radix-description"],url:"http://eslint.org/docs/rules/radix"},semi:{description:e["semi-description"],url:"http://eslint.org/docs/rules/semi"},"unnecessary-nls":{description:e["unnecessary-nls-description"]},"use-isnan":{description:e["use-isnan-description"],url:"http://eslint.org/docs/rules/use-isnan"},"valid-typeof":{description:e["valid-typeof-description"],url:"http://eslint.org/docs/rules/valid-typeof"},"type-checked-consistent-return":{description:e["type-checked-consistent-return-description"]}}};return t}),n("javascript/validator",["orion/objects","javascript/ruleData","orion/i18nUtil","i18n!javascript/nls/problems","orion/Deferred"],function(e,t,n,r,i){function o(e){this.ternWorker=e,l.setDefaults()}function a(e){var t=2,n=l.rules[e.ruleId];if(Array.isArray(n)){var r=e.related,i=r&&r.type;t="missing-doc"===e.ruleId&&void 0!==n[1][i]?n[1][i]:n[0]}else t=e.severity;switch(t){case 1:return"warning";case 2:return"error"}return"error"}function s(e){if(e.args){if(e.args.pid)return e.args.pid;if(e.args.nls)return e.args.nls}return e.ruleId}function u(e){var t=e.start,i=e.end;if(e.node&&(t=e.node.range[0],i=e.node.range[1],e.related&&e.related.range)){var o=e.related;t=o.range[0],i=o.range[1]}var u=e.args&&e.args.nls?e.args.nls:e.ruleId,l=e.args||Object.create(null),c=e.message;u&&r[u]&&(c=n.formatMessage.call(null,r[u],l));var p={id:s(e),description:c,severity:a(e)};return e.nodeType&&(p.nodeType=e.nodeType),e.node&&"Program"===e.nodeType&&"undefined"!=typeof e.line?(p.line=e.line,p.start=e.column):"undefined"!=typeof t?(p.start=t,p.end=i):"number"==typeof e.index?(p.start=i,p.end=e.index):"undefined"!=typeof e.lineNumber?(p.line=e.lineNumber,p.start=e.column):"number"==typeof e.line&&"number"==typeof e.column?(p.line=e.line,p.start=e.column):(p.start=0,p.end=0),e.args&&e.args.data&&(p.data=e.args.data),p}var l={defaults:t.defaults,setOption:function(e,t,n){if("number"==typeof t)if(Array.isArray(this.rules[e])){var r=this.rules[e];n?(r[1]=r[1]||{},r[1][n]=t):r[0]=t}else this.rules[e]=t},setDefaults:function(){this.rules=Object.create(null);for(var e=Object.keys(this.defaults),t=0;to;o++){var s=e.plugins[i[o]];(null===s||"object"!=typeof s)&&t.push(r.formatMessage(n.pluginNotObject,i[o]))}}"undefined"!=typeof e.loadEagerly&&(Array.isArray(e.loadEagerly)?e.loadEagerly.length<1?t.push(r.formatMessage(n.notEmpty,"loadEagerly")):e.loadEagerly.every(function(e){return"string"==typeof e})||t.push(r.formatMessage(n.onlyStrings,"loadEagerly")):t.push(r.formatMessage(n.notArray,"loadEagerly")))}return t}function o(i){var o=[];if("string"==typeof i&&i.trim().length>0){var s="var v="+i;try{var u=e.parse(s,{range:!0});if(u&&u.body&&u.body.length>0){var l=!0;t.traverse(u,{enter:function(e){if("ObjectExpression"===e.type){var t=e.properties,i=Object.create(null);t.forEach(function(e){var t=e.key.value;if(Object.prototype.hasOwnProperty.call(i,t)?a(o,n.noDupes,e.key.range):i[t]=1,l)switch(t){case"ecmaVersion":case"dependencyBudget":"number"!=typeof e.value.value&&a(o,r.formatMessage(n.notNum,t),e.value.range);break;case"libs":case"dontLoad":case"loadEagerly":var s=e.value;"ArrayExpression"!==s.type?a(o,r.formatMessage(n.notArray,t),s.range):s.elements&&(s.elements.length<1&&a(o,r.formatMessage(n.notEmpty,t),s.range),s.elements.forEach(function(e){("Literal"!==e.type||"Literal"===e.type&&"string"!=typeof e.value)&&a(o,r.formatMessage(n.onlyStrings,t),e.range)}));break;case"plugins":var u=e.value;null===u.value||"ObjectExpression"!==u.type?a(o,r.formatMessage(n.notObject,t),u.range):u.properties&&u.properties.forEach(function(e){(null===e.value||"ObjectExpression"!==e.value.type)&&a(o,r.formatMessage(n.notObject,e.key.value),e.value.range)})}}),l=!1}}})}}catch(c){}}return o}function a(e,t,n){var r=Object.create(null);r.start=n[0]-6,r.end=n[1]-6,r.id="tern-project-pb",r.description=t,r.severity="error",e.push(r)}return{validate:i,validateAST:o}}),n("javascript/occurrences",["orion/objects","javascript/finder","estraverse/estraverse"],function(e,t,n){function r(){}function i(e,r){if(e&&r){var i=r.selection.start,c=r.selection.end,p=a(i,e);if(p){var d=t.findNode(i,e,{parents:!0});if(!u(d)&&p.range[0]>=d.range[0]&&p.range[1]<=d.range[1]){if(d.type===n.Syntax.Literal){var f=o(d,e);if(!f)return[];d=f,i=d.range[0],c=d.range[1]}var m={start:i,end:c,word:s(d),token:d},h=l(m);return n.traverse(e,h),h.occurrences}}}return[]}function o(e,r){var i=e.parent?e.parent:e.parents&&e.parents.length>0?e.parents[e.parents.length-1]:null;if(i&&i.type===n.Syntax.ArrayExpression){var o=i.parent?i.parent:e.parents&&e.parents.length>1?e.parents[e.parents.length-2]:null;if(o&&o.type===n.Syntax.CallExpression&&o.callee&&"define"===o.callee.name)for(var a=i.elements,s=0;ss))return t.findNode(u.params[s].range[0],r,{parents:!0});break}}return null}function a(e,n){if(n.tokens&&n.tokens.length>0){var r=t.findToken(e,n.tokens);if(r){if("Punctuator"===r.type){var i=r.index;if(e===r.range[0]&&null!=i&&i>0){var o=n.tokens[i-1];if(o.range[1]!==r.range[0])return null;r=o}}if("Identifier"===r.type||"String"===r.type||"Keyword"===r.type&&"this"===r.value)return r}}return null}function s(e){switch(e.type){case n.Syntax.Identifier:return e.name;case n.Syntax.ThisExpression:return"this"}}function u(e){return e?e.type===n.Syntax.ThisExpression?!1:e.type===n.Syntax.Literal?!1:e.type!==n.Syntax.Identifier:!0}function l(e){if(this.visitor||(this.visitor=new r,this.visitor.enter=this.visitor.enter.bind(this.visitor),this.visitor.leave=this.visitor.leave.bind(this.visitor)),e.token){var t=e.token.parent?e.token.parent:e.token.parents&&e.token.parents.length>0?e.token.parents[e.token.parents.length-1]:null;this.visitor.thisCheck=e.token.type===n.Syntax.ThisExpression,this.visitor.objectPropCheck=!1,t&&t.type===n.Syntax.Property?this.visitor.objectPropCheck=e.token===t.key:t&&t.type===n.Syntax.MemberExpression?t.object&&t.object.type===n.Syntax.ThisExpression?this.visitor.objectPropCheck=!0:!t.computed&&t.property&&e.start>=t.property.range[0]&&e.end<=t.property.range[1]&&(this.visitor.objectPropCheck=!0):t&&t.type===n.Syntax.FunctionExpression&&e.token.parents&&e.token.parents.length>1&&e.token.parents[e.token.parents.length-2].type===n.Syntax.Property&&t.id&&t.id.range===e.token.range&&(this.visitor.objectPropCheck=!0),this.visitor.labeledStatementCheck=t&&(t.type===n.Syntax.LabeledStatement||t.type===n.Syntax.ContinueStatement||t.type===n.Syntax.BreakStatement) -}return this.visitor.context=e,this.visitor}function c(e,t){this.astManager=e,this.cuprovider=t}return n.VisitorKeys.RecoveredNode=[],e.mixin(r.prototype,{occurrences:[],scopes:[],context:null,thisCheck:!1,objectPropCheck:!1,enter:function(e,t){var r,i;switch(e.parent=t,e.type){case n.Syntax.Program:this.occurrences=[],this.scopes=[{range:e.range,occurrences:[],kind:"p"}],this.defscope=null,this.skipScope=null;break;case n.Syntax.FunctionDeclaration:if(this.checkId(e.id,e,!0),this._enterScope(e),this.skipScope)return n.VisitorOption.Skip;if(e.params)for(r=e.params.length,i=0;r>i;i++)if(this.checkId(e.params[i],e,!0))return n.VisitorOption.Skip;break;case n.Syntax.FunctionExpression:case n.Syntax.ArrowFunctionExpression:if(this._enterScope(e))return n.VisitorOption.Skip;if(this.checkId(e.id,e,!0),e.params)for(r=e.params.length,i=0;r>i;i++)if(this.checkId(e.params[i],e,!0))return n.VisitorOption.Skip;break;case n.Syntax.AssignmentExpression:this.checkId(e.left,e),this.checkId(e.right,e);break;case n.Syntax.ExpressionStatement:this.checkId(e.expression,e);break;case n.Syntax.ArrayExpression:if(e.elements)for(r=e.elements.length,i=0;r>i;i++)this.checkId(e.elements[i],e);break;case n.Syntax.MemberExpression:this.checkId(e.object,e),e.computed?this.checkId(e.property,e):this.checkId(e.property,e,!1,!0);break;case n.Syntax.BinaryExpression:this.checkId(e.left,e),this.checkId(e.right,e);break;case n.Syntax.UnaryExpression:this.checkId(e.argument,e);break;case n.Syntax.SwitchStatement:this.checkId(e.discriminant,e);break;case n.Syntax.UpdateExpression:this.checkId(e.argument,e);break;case n.Syntax.ConditionalExpression:this.checkId(e.test,e),this.checkId(e.consequent,e),this.checkId(e.alternate,e);break;case n.Syntax.CallExpression:if(this.checkId(e.callee,e,!1),e.arguments)for(r=e.arguments.length,i=0;r>i;i++)this.checkId(e.arguments[i],e);break;case n.Syntax.ReturnStatement:this.checkId(e.argument,e);break;case n.Syntax.ObjectExpression:if(this._enterScope(e))return n.VisitorOption.Skip;if(e.properties)for(r=e.properties.length,i=0;r>i;i++){var o=e.properties[i];o.value&&o.value.type===n.Syntax.FunctionExpression&&(this.thisCheck?o.value.isprop=!0:this.checkId(o.value.id,e,!1,!0)),this.checkId(o.key,e,!0,!0),this.checkId(o.value,e)}break;case n.Syntax.VariableDeclarator:this.checkId(e.id,e,!0),this.checkId(e.init,e);break;case n.Syntax.NewExpression:if(this.checkId(e.callee,e,!1),e.arguments)for(r=e.arguments.length,i=0;r>i;i++)this.checkId(e.arguments[i],e);break;case n.Syntax.LogicalExpression:this.checkId(e.left,e),this.checkId(e.right,e);break;case n.Syntax.ThisExpression:if(this.thisCheck){var a=this.scopes[this.scopes.length-1];a.occurrences.push({start:e.range[0],end:e.range[1]}),e.range[0]===this.context.token.range[0]&&(this.defscope=a)}break;case n.Syntax.IfStatement:case n.Syntax.DoWhileStatement:case n.Syntax.WhileStatement:this.checkId(e.test,e);break;case n.Syntax.ForStatement:this.checkId(e.init,e);break;case n.Syntax.ForInStatement:this.checkId(e.left,e),this.checkId(e.right,e);break;case n.Syntax.WithStatement:this.checkId(e.object,e);break;case n.Syntax.ThrowStatement:this.checkId(e.argument,e);break;case n.Syntax.LabeledStatement:this._enterScope(e),this.checkId(e.label,e,!0,!1,!0);break;case n.Syntax.ContinueStatement:this.checkId(e.label,e,!1,!1,!0);break;case n.Syntax.BreakStatement:this.checkId(e.label,e,!1,!1,!0)}},_enterScope:function(e){if(this.thisCheck)switch(e.type){case n.Syntax.ObjectExpression:if(this.scopes.push({range:e.range,occurrences:[],kind:"o"}),this.defscope)return!0;break;case n.Syntax.FunctionExpression:if(!e.isprop&&(this.scopes.push({range:e.body.range,occurrences:[],kind:"fe"}),this.defscope))return!0}else if(this.objectPropCheck)switch(e.type){case n.Syntax.ObjectExpression:this.scopes.push({range:e.range,occurrences:[],kind:"o"})}else if(this.labeledStatementCheck)switch(e.type){case n.Syntax.LabeledStatement:if(this.scopes.push({range:e.range,occurrences:[],kind:"ls"}),e.range[0]>this.context.start||e.range[1]0&&(r=e.params[0].range[0]);break;case n.Syntax.FunctionExpression:case n.Syntax.ArrowFunctionExpression:t="fe",e.id?r=e.id.range[0]:e.params&&e.params.length>0&&(r=e.params[0].range[0])}t&&this.scopes.push({range:[r,e.range[1]],occurrences:[],kind:t})}return!1},leave:function(e){if(this.thisCheck)switch(e.type){case n.Syntax.FunctionExpression:if(e.isprop){delete e.isprop;break}case n.Syntax.ObjectExpression:case n.Syntax.Program:if(this._popScope())return n.VisitorOption.Break}else if(this.objectPropCheck)switch(e.type){case n.Syntax.ObjectExpression:case n.Syntax.Program:if(this._popScope())return n.VisitorOption.Break}else if(this.labeledStatementCheck)switch(e.type){case n.Syntax.LabeledStatement:if(this._popScope())return n.VisitorOption.Break}else switch(e.type){case n.Syntax.FunctionExpression:case n.Syntax.FunctionDeclaration:case n.Syntax.ArrowFunctionExpression:if(this._popScope())return n.VisitorOption.Break;break;case n.Syntax.Program:this._popScope()}},_popScope:function(){var e=this.scopes.pop();if(this.skipScope)return this.skipScope===e&&(this.skipScope=null),!1;var t,n,r=e.occurrences.length;if(this.defscope&&this.defscope===e){for(t=0;r>t;t++)this.occurrences.push(e.occurrences[t]);if(this.defscope.range[0]===e.range[0]&&this.defscope.range[1]===e.range[1]&&this.defscope.kind===e.kind)return!0}else if(this.scopes.length>0)for(n=0;r>n;n++)this.scopes[this.scopes.length-1].occurrences.push(e.occurrences[n]);else for(this.occurrences=[],n=0;r>n;n++)this.occurrences.push(e.occurrences[n]);return!1},_markDefineStatementOccurrences:function(e,t){var r=e.parent;if(r&&r.type===n.Syntax.FunctionExpression){var i=r.parent;if(i&&i.type===n.Syntax.CallExpression&&i.callee&&"define"===i.callee.name)for(var o=r,a=0;aa&&t.push({start:s.elements[a].range[0],end:s.elements[a].range[1]})}break}}},checkId:function(e,t,r,i,o){if(this.skipScope)return!0;if(this.thisCheck)return!1;if(i&&!this.objectPropCheck||!i&&this.objectPropCheck)return!1;if(o&&!this.labeledStatementCheck||!o&&this.labeledStatementCheck)return!1;if(e&&(e.parent=t),e&&e.type===n.Syntax.Identifier&&e.name===this.context.word){var a=this.scopes[this.scopes.length-1];if(r){if(this.defscope)return a.range[0]<=this.context.start&&a.range[1]>=this.context.end?(this.occurrences=[],this.defscope=a,a.occurrences.push({start:e.range[0],end:e.range[1]}),!1):(a.occurrences=[],this.skipScope=a,!0);if(!(a.range[0]<=this.context.start&&a.range[1]>=this.context.end))return a.occurrences=[],this.skipScope=a,!0;this.defscope=a,this._markDefineStatementOccurrences(e,a.occurrences)}a.occurrences.push({start:e.range[0],end:e.range[1]})}return!1}}),r.prototype.constructor=r,e.mixin(c.prototype,{computeOccurrences:function(e,n){return e.getFileMetadata().then(function(r){return"application/javascript"===r.contentType.id?this.astManager.getAST(e).then(function(e){return i(e,n)}):e.getText().then(function(e){var o=this.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(e)},r);return o.validOffset(n.selection.start)?this.astManager.getAST(o.getEditorContext()).then(function(e){return i(e,n)}):[]}.bind(this))}.bind(this))}}),c.prototype.contructor=c,{findOccurrences:i,JavaScriptOccurrences:c}}),n("javascript/outliner",["orion/Deferred"],function(e){function t(e){this.ternWorker=e}return t.prototype.computeOutline=function(t){var n=new e;return t.getFileMetadata().then(function(e){t.getText().then(function(t){var r=[{type:"full",name:e.location,text:t}];this.ternWorker.postMessage({request:"outline",args:{files:r,meta:{location:e.location}}},function(e,t){e.outline?n.resolve(e.outline):t&&n.reject(t)})}.bind(this))}.bind(this)),n},{JSOutliner:t}}),n("javascript/cuProvider",["javascript/lru","javascript/compilationUnit"],function(e,t){function n(e,n,r){if(u){var i=s.get(n.location);if(i)return i}var o=e();return o||(o=[]),i=new t(o,n,r),u&&s.put(n.location,i),i}function r(e){l?l=null:s.remove(o(e.file))}function i(e){u=e}function o(e){return e&&e.location?e.location:"unknown"}function a(e){l=e}var s=new e(10),u=!0,l=null;return{getCompilationUnit:n,onModelChanging:r,onInputChanged:a,setUseCache:i}}),n("javascript/ternProjectManager",["orion/objects","orion/Deferred","orion/URITemplate","orion/i18nUtil","javascript/ternProjectValidator","i18n!javascript/nls/problems"],function(e,t,n,r,i,o){function a(e,t,n){this.ternWorker=e,this.scriptResolver=t,this.currentProjectLocation=null,this.currentFile=null,this.registry=n}return e.mixin(a.prototype,{_report:function(e,t){if(!this.inEditor){var r=e;r||(r=o.problemInFile);var i=Object.create(null);if(i.HTML=!0,i.Severity="Error",i.Message=""+r+"

      "+t+"

      ",this.currentFile){var a=new n("#{,resource,params*}").expand({resource:this.currentFile,params:{}});i.Message+='

      '+o.openFile+"

      "}this.registry.getService("orion.page.message").setProgressResult(i)}},getProjectFile:function(e){if(e){var t=e.parents?e.parents:e.Parents;if(t&&t.length>0)return t[t.length-1]}return null},getTernProjectFileLocation:function(e){if(this.currentFile=null,!e)return null;var n;return e.Children?n=(new t).resolve(e.Children):e.ChildrenLocation&&(n=this.scriptResolver.getFileClient().fetchChildren(e.ChildrenLocation)),n.then(function(e){for(var t=0;t1){var n="
        ";t.forEach(function(e){n+="
      • "+e+"
      • "}),n+="
      ",this._hasValidationProblem=!0,this._report(o.multiAttrProblems,n)}else 1===t.length&&(this._hasValidationProblem=!0,this._report(o.attrProblem,t[0]))}},loadTernProjectOptions:function(e){if(this.ternWorker.postMessage({request:"start_server",args:{options:e}}),Array.isArray(e.loadEagerly)){var n=[];this._fileLoadWarnings=[];for(var i=0;i0?(t.length>1&&this._fileLoadWarnings.push(r.formatMessage(o.multipleFileMatchesProblem,e,t[0].location)),this.ternWorker.postMessage({request:"addFile",args:{file:t[0].location}})):this._fileLoadWarnings.push(r.formatMessage(o.noFileMatchProblem,e))}.bind(this,a)))}return this._hasValidationProblem||this.registry.getService("orion.page.message").setProgressMessage(o.fileMatchProgress),t.all(n).then(function(){if(!this._hasValidationProblem&&(this.registry.getService("orion.page.message").close(),this._fileLoadWarnings.length>0)){for(var e="",t=0;tt;t++)e+=this._fileLoadWarnings[t]+"
      ";this._fileLoadWarnings.length>10&&(e+=r.formatMessage(o.tooManyFileMatchProblems,this._fileLoadWarnings.length-10)+"
      "),this._report(o.fileMatchProblems,e)}this._fileLoadWarnings=[]}.bind(this))}},onInputChanged:function(e){if(this.inEditor=".tern-project"===e.file.name,this.inEditor)this.currentProjectLocation=null;else{var t=e.file,n=this.getProjectFile(t);if(n&&(!this.currentProjectLocation||n.Location!==this.currentProjectLocation))return this.currentProjectLocation=n.Location,this.scriptResolver.setSearchLocation(n.Location),this.getTernProjectFileLocation(n).then(function(e){return this.parseTernJSON(e).then(function(e){return this.loadTernProjectOptions(e)}.bind(this))}.bind(this))}}}),{TernProjectManager:a}}),n("javascript/logger",[],function(){return{log:function(){"undefined"!=typeof console&&console&&console.log?console.log.apply(console,arguments):postMessage&&postMessage.apply(null,arguments)},error:function(){"undefined"!=typeof console&&console&&console.error?console.error.apply(console,arguments):postMessage&&postMessage.apply(null,arguments)}}}),n("javascript/signatures",[],function(){var e={computeSignature:function(e){if(e){if(e.sig)return e.sig;var t=this.getNameFrom(e);return{sig:t.name,details:t.details,range:this.getSignatureSourceRangeFrom(e)}}return null},getParamsFrom:function(e){if(e){var t=e.params;if(t&&t.length>0){for(var n=t.length,r="",i=0;n>i;i++)r+=t[i].name?t[i].name:"Object",n-1>i&&(r+=", ");return r}}},getPropertyListFrom:function(e,t){if(t||(t=50),0>t&&(t=0),e){var n=e.properties;if(n&&n.length>0){for(var r,i=n.length,o="{",a=0;i>a;a++){if(r=n[a].key&&n[a].key.name?n[a].key.name:"Object",o.length+r.length>t+1){o+="...";break}o+=r,i-1>a&&(o+=", ")}return o+="}"}}return"{...}"},getNameFrom:function(e){var t,n="Anonyous "+e.type;if(e&&e.type)if("FunctionDeclaration"===e.type){if(e.id&&e.id.name){n=e.id.name+"(";var r=this.getParamsFrom(e);r&&(n+=r),n+=")"}}else if("FunctionExpression"===e.type){n="function(";var i=this.getParamsFrom(e);i&&(n+=i),n+=")"}else if("ObjectExpression"===e.type)n="closure ",t=this.getPropertyListFrom(e);else if("Property"===e.type){if(e.value)if("FunctionExpression"===e.value.type){e.key?e.key.name?n=e.key.name+"(":e.key.value&&(n=e.key.value+"("):n="function(";var o=this.getParamsFrom(e.value);o&&(n+=o),n+=")"}else"ObjectExpression"===e.value.type?e.key&&(e.key.name?n=e.key.name+" ":e.key.value&&(n=e.key.value+" "),t=this.getPropertyListFrom(e.value)):e.key&&(e.key.name?n=e.key.name:e.key.value&&(n=e.key.value))}else if("VariableDeclarator"===e.type){if(e.init)if("ObjectExpression"===e.init.type)e.id&&e.id.name&&(n="var "+e.id.name+" = ",t=this.getPropertyListFrom(e.init));else if("FunctionExpression"===e.init.type)if(e.id&&e.id.name){n=e.id.name+"(";var a=this.getParamsFrom(e.init);a&&(n+=a),n+=")"}else n=this.getNameFrom(e.init)}else if("AssignmentExpression"===e.type){if(e.left&&e.right){var s="ObjectExpression"===e.right.type;if(s||"FunctionExpression"===e.right.type)if(e.left.name?n=e.left.name:"MemberExpression"===e.left.type&&(n=this.expandMemberExpression(e.left,"")),n)if(s)n+=" ",t=this.getPropertyListFrom(e.right);else{n+="(";var u=this.getParamsFrom(e.right);u&&(n+=u),n+=")"}else n=this.getNameFrom(e.right)}}else"ReturnStatement"===e.type&&e.argument&&("ObjectExpression"===e.argument.type||"FunctionExpression"===e.argument.type)&&(n="return ",t=this.getPropertyListFrom(e.argument));return{name:n,details:t}},expandMemberExpression:function(e,t){if("MemberExpression"===e.type){if(e.property){var n=e.property.name;"Literal"===e.property.type&&(n=e.property.value),n&&(t=t&&t.length>0?n+"."+t:n)}return e.object&&e.object.name&&(t=e.object.name+"."+t),this.expandMemberExpression(e.object,t)}return t},getSignatureSourceRangeFrom:function(e){var t=[0,0];return e&&("AssignmentExpression"===e.type?e.left&&e.left.range&&(t=e.left.range):"Property"===e.type?e.key&&e.key.range&&(t=e.key.range):"ReturnStatement"===e.type?(t[0]=e.range[0],t[1]=t[0]+6):e.id&&e.id.range?t=e.id.range:e.range&&(t=e.range,"FunctionExpression"===e.type&&(t[1]=t[0]+8)),t[0]<1&&(t[0]=1)),t}};return e}),n("javascript/commands/generateDocCommand",["orion/objects","javascript/finder","javascript/signatures","orion/Deferred"],function(e,t,n,r){function i(e,t){this.astManager=e,this.cuprovider=t}return e.mixin(i.prototype,{execute:function(e,n){var r=this;return e.getFileMetadata().then(function(i){return"application/javascript"===i.contentType.id?r.astManager.getAST(e).then(function(t){r._doCommand(e,t,n.offset)}):e.getText().then(function(o){var a=n.offset,s=r.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(o)},i);return s.validOffset(a)?r.astManager.getAST(s.getEditorContext()).then(function(t){r._doCommand(e,t,a)}):void 0})})},_doCommand:function(e,i,o){var a=t.findNode(o,i,{parents:!0});if(a){var s=i.source,u=this._resolveParent(a);if(u){var l,c=u.range[0];if("FunctionDeclaration"===u.type)l=this._genTemplate(u.id.name,u.params,!1,u.range[0],s);else if("Property"===u.type)l=this._genTemplate(u.key.name?u.key.name:u.key.value,u.value.params,!0,u.range[0],s);else if("VariableDeclarator"===u.type){if(c=u.range[0],u.decl){if(u.decl.leadingComments)return;u.decl.declarations&&1===u.decl.declarations.length&&(c=u.decl.range[0])}l=this._genTemplate(u.id.name,u.init.params,!0,c,s)}else"AssignmentExpression"===u.type&&(l=this._genTemplate(n.expandMemberExpression(u.left,""),u.right.params,!0,u.range[0],s))}if(l)return r.all([e.setText(l,c,c),e.setCaretOffset(o+l.length)])}},_genTemplate:function(e,t,n,r,i){for(var o=i[--r],a="";" "===o||" "===o;)a+=o,o=i[--r];var s=[];s.push("/**\n"+a+" * @name "+e+"\n"),s.push(a+" * @description description\n"),n&&s.push(a+" * @function\n"),"_"===e.charAt(0)&&s.push(a+" * @private\n");var u=e.lastIndexOf(".");if(u>-1&&"_"===e.slice(u+1).charAt(0)&&s.push(a+" * @private\n"),t)for(var l=t.length,c=0;l>c;c++)s.push(a+" * @param "+t[c].name+"\n");return s.push(a+" * @returns returns\n"+a+" */\n"+a),s.join("")},_resolveParent:function(e){if(!e.parents||e.parents.length<1)return null;switch(e.type){case"FunctionDeclaration":return e;case"Property":return e.value&&"FunctionExpression"===e.value.type?e:null;case"VariableDeclarator":return e.init&&"FunctionExpression"===e.init.type?(e.decl=e.parents[e.parents.length-1],e):null;case"VariableDeclaration":if(e.declarations&&1===e.declarations.length){var t=e.declarations[0];if(t.init&&"FunctionExpression"===t.init.type)return e.parents.push(e),t.parents=e.parents,this._resolveParent(t)}case"AssignmentExpression":if(e.left&&"MemberExpression"===e.left.type&&e.right&&"FunctionExpression"===e.right.type)return e}var n=e.parents.length-1,r=e.parents[n];return r.parents=e.parents.slice(0,n),this._resolveParent(r)}}),{GenerateDocCommand:i}}),n("javascript/commands/openDeclaration",["orion/objects","orion/Deferred","i18n!javascript/nls/messages","orion/i18nUtil","orion/URITemplate"],function(e,t,n,r,i){function o(e,t){s=e,this.openMode=t,this.timeout=null}function a(e){var t=e.file;return t=t.replace(/^\/file\//,""),t=t.substring(t.indexOf("/")+1,t.length),r.formatMessage(n.declDisplayName,t,e.start,e.end)}var s;return e.mixin(o.prototype,{execute:function(e,n){var r=this,i=new t;return e.getText().then(function(t){return r._findDecl(e,n,t,i)},i.reject),i},_findDecl:function(e,t,r,o){this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){o.reject({Severity:"Error",Message:n.noDeclTimedOut}),this.timeout=null},1e4);var u=[{type:"full",name:t.input,text:r}];s.postMessage({request:"definition",args:{params:{offset:t.offset},guess:!0,files:u,meta:{location:t.input}}},function(t){if(t.declaration){if(t.declaration.results){var r=Object.create(null);r.Severity="Status";var s=n.declPotentialHeader,u=t.declaration.results;return u.forEach(function(e){if("number"==typeof e.start&&"number"==typeof e.end){var t=new i("#{,resource,params*}").expand({resource:e.file,params:{start:e.start,end:e.end}}),n=e.file.substring(e.file.lastIndexOf("/")+1);s+="* ["+n+"]("+t+") - "+a(e)+"\n"}},this),r.stayOnTarget=!0,r.Message=s,o.reject(r)}if("number"==typeof t.declaration.start&&"number"==typeof t.declaration.end){var l=Object.create(null);return l.start=t.declaration.start,l.end=t.declaration.end,null!==this.openMode&&"undefined"!=typeof this.openMode&&(l.mode=this.openMode),o.resolve(e.openEditor(t.declaration.file,l))}}o.reject({Severity:"Warning",Message:n.noDeclFound})}.bind(this))}}),{OpenDeclarationCommand:o}}),n("javascript/commands/openImplementation",["orion/objects","orion/Deferred","i18n!javascript/nls/messages"],function(e,t,n){function r(e){this.ternworker=e,this.timeout=null}return e.mixin(r.prototype,{execute:function(e,n){var r=this,i=new t;return e.getText().then(function(t){return r._findImpl(e,n,t,i)},i.reject),i},_findImpl:function(e,t,r,i){this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){i.reject({Severity:"Error",Message:n.implTimedOut}),this.timeout=null},5e3);var o=[{type:"full",name:t.input,text:r}];this.ternworker.postMessage({request:"implementation",args:{params:{offset:t.offset},guess:!0,files:o,meta:{location:t.input}}},function(t){if(t.implementation&&"number"==typeof t.implementation.start&&"number"==typeof t.implementation.end){var r=Object.create(null);r.start=t.implementation.start,r.end=t.implementation.end,i.resolve(e.openEditor(t.implementation.file,r))}else i.reject({Severity:"Warning",Message:n.noImplFound})})}}),{OpenImplementationCommand:r}}),n("javascript/commands/renameCommand",["orion/objects","orion/Deferred","i18n!javascript/nls/messages","orion/i18nUtil"],function(e,t,n,r){function i(e,t){this.ternworker=e,this.scriptResolver=t,this.timeout=null}function o(e){return"Not at a variable."===e?n.badInlineRename:r.formatMessage(n.failedRename,e)}return e.mixin(i.prototype,{execute:function(e,r){var i=this,o=new t;return e.getFileMetadata().then(function(t){return i.scriptResolver.setSearchLocation(Array.isArray(t.parents)&&t.parents.length>1?t.parents[t.parents.length-1].Location:null),i._doRename(e,r,o)},function(){o.reject({Severity:"Error",Message:n.noFileMeta})}),o},_doRename:function(e,t,r){var i=this;return e.getText().then(function(a){i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(function(){r.reject({Severity:"Error",Message:n.renameFailedTimedOut}),i.timeout=null},5e3);var s=[{type:"full",name:t.input,text:a}],u=t.offset;t.annotation&&(u=t.annotation.start),i.ternworker.postMessage({request:"rename",args:{params:{offset:u},files:s,meta:{location:t.input},newname:""}},function(t){var n=t.changes;if(n&&n.changes&&n.changes.length>0){for(var i=n.changes,a=[i.length],s=0;s0?(s=n.parents[n.parents.length-1].Location,a.progress({message:r.allProjectRefs})):a.progress({message:r.allWorkspaceRefs}),o.scriptresolver.setSearchLocation(s),"application/javascript"!==i.contentType.id?e.getText().then(function(s){var u=i.offset,l=o.cuprovider.getCompilationUnit(function(){return t.findScriptBlocks(s)},{location:i.input,contentType:i.contentType});l.validOffset(u)?o._findRefs(e,i,n,a):a.resolve(r.notHtmlOffset)},function(){a.resolve(r.noFileContents)}):void o._findRefs(e,i,n,a)},function(){a.reject({Severity:"Error",Message:r.noFileMeta})}),a},_findRefs:function(e,n,o,s){var u=this;return u.astmanager.getAST(e).then(function(e){var l=t.findNode(n.offset,e);l&&"Identifier"===l.type?u.ternworker.postMessage({request:"type",args:{meta:o,params:n}},function(e,n){n?s.reject({Severity:"Error",Message:n}):u.scriptresolver.getSearchLocation().then(function(n){var o=Object.create(null);o.total=0,o.done=0,o.result=[];var c={keyword:l.name,resource:n,fileNamePatterns:["*.js","*.html","*.htm"],caseSensitive:!0,incremental:!1,shape:"group"};o.params=c,o.deferred=s;var p={};u.serviceRegistry.getService("orion.core.search.client").search(c,!0,!0).then(function(n){o.result=n;for(var r=0,i=n.length;i>r;r++){var s=n[r],c=Array.isArray(s.contents)?s.contents.join(""):null;p[s.metadata.Location]={};for(var d=0,f=s.children.length;f>d;d++){var m=s.children[d];o.total+=m.matches.length;for(var h=0,g=m.matches.length;g>h;h++){var v=m.matches[h],y=t.findWord(m.name,v.startIndex);if(y===l.name){var D={request:"checkRef",args:{meta:{location:s.metadata.Location},params:{offset:v.end},origin:e}};p[s.metadata.Location].src||(p[s.metadata.Location].src=!0,D.files=[{type:"full",name:s.metadata.Location,text:c}]),u._checkType(e,s.metadata,v,o,D)}else v.category=a.partial.category,v.confidence=0,o.done++}}}u._checkDone(o)},function(e){s.reject({Severity:"Error",Message:i.formatMessage(r.cannotComputeRefs,e.message)})},function(){})})}):s.reject({Severity:"Error",Message:r.notAnIdentifier})})},_checkType:function(e,t,n,o,s){var u=this;u.ternworker.postMessage(s,function(s,l){if(s&&s.type){var c=s.type,p=e.type;n.confidence=c.name===p.name&&c.type===p.type&&u._sameOrigin(c.origin,p.origin)?c.guess?50:100:c.staticCheck?c.staticCheck.confidence:c.category===a.strings.category||c.category===a.regex.category?0:-1,n.category=c.category}else l&&(n.category=a.uncategorized.category,n.confidence=-1);o.done++,o.deferred.progress({message:i.formatMessage(r.refsFoundIn,t.Name,o.done,o.total)}),u._checkDone(o)})},_sameOrigin:function(e,t){if(e===t)return!0;var n=decodeURIComponent(e),r=decodeURIComponent(t);return n===r?!0:decodeURIComponent(n)===decodeURIComponent(r)},_checkDone:function(e){e.done>=e.total&&e.deferred.resolve({searchParams:e.params,refResult:e.result,categories:a})}}),o}),n("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},operator:{match:"(\\+|-|!|=|>|<|&|(\\|\\|))+",name:"punctuation.operator"},doc_block:{begin:"/\\*\\*",end:"\\*/",name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"meta.documentation.annotation"},{match:"<[^\\s>]*>",name:"meta.documentation.tag"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}}),n("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["class","const","debugger","delete","enum","export","extends","function","implements","import","in","instanceof","interface","let","new","package","private","protected","public","static","super","typeof","var","void","with"],n=["break","case","catch","continue","default","do","else","finally","for","if","return","switch","throw","try","while","yield"],r=["this"],i=["false","null","true","undefined"],o=[];return o.push.apply(o,e.grammars),o.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"#jsFunctionDef"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#operator"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.js"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"},{match:"\\b(?:"+i.join("|")+")\\b",name:"constant.language.js"},{match:"\\b(?:"+r.join("|")+")\\b",name:"variable.language.js"}],repository:{jsFunctionDef:{begin:"(function)(\\s+[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*)?\\s*\\(",end:"\\)",captures:{1:{name:"keyword.operator.js"},2:{name:"entity.name.function.js"}},patterns:[{include:"orion.c-like#comment_singleLine"},{include:"orion.c-like#comment_block"},{match:"[^\\s,]+",name:"variable.parameter.js"}]}}}),{id:o[o.length-1].id,grammars:o,keywords:t.concat(n).concat(r).concat(i)}}),n("orion/editor/stylers/application_json/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=["false","true"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.json",contentTypes:["application/json"],patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+t.join("|")+")\\b",name:"keyword.operator.json"}]}),{id:n[n.length-1].id,grammars:n,keywords:t}}),n("orion/editor/stylers/application_schema_json/syntax",["orion/editor/stylers/application_json/syntax"],function(e){var t=["additionalItems","additionalProperties","allOf","anyOf","default","definitions","dependencies","description","enum","exclusiveMaximum","exclusiveMinimum","format","id","maximum","maxItems","maxLength","maxProperties","minimum","minItems","minLength","minProperties","multipleOf","not","oneOf","patternProperties","pattern","properties","required","title","type","uniqueItems"],n=[];return n.push.apply(n,e.grammars),n.push({id:"orion.json.schema",contentTypes:["application/schema+json"],patterns:[{include:"orion.json"},{match:"(?:\\$schema|(?:\\b(?:"+t.join("|")+")))\\b",name:"keyword.operator.schema.json"}]}),{id:n[n.length-1].id,grammars:n,keywords:t} -}),n("orion/editor/stylers/application_xml/syntax",["orion/editor/stylers/lib/syntax"],function(e){var t=[];return t.push.apply(t,e.grammars),t.push({id:"orion.xml",contentTypes:["application/xml","application/xhtml+xml"],patterns:[{include:"#comment"},{include:"#doctype"},{include:"#xmlDeclaration"},{include:"#tag"},{include:"#ampersandEscape"}],repository:{ampersandEscape:{match:"<|>|&",name:"constant.character"},comment:{begin:{match:"",literal:"-->"},name:"comment.block.xml",patterns:[{match:"(\\b)(TODO)(\\b)(((?!-->).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}]},doctype:{begin:"",name:"meta.tag.doctype.xml",captures:{0:{name:"meta.tag.doctype.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},tag:{begin:"",captures:{0:{name:"meta.tag.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}]},xmlDeclaration:{begin:"<\\?xml",end:"\\?>",captures:{0:{name:"meta.tag.declaration.xml"}},patterns:[{include:"#comment"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"}],name:"meta.tag.declaration.xml"}}}),{id:t[t.length-1].id,grammars:t,keywords:[]}}),n("orion/editor/stylers/application_x-ejs/syntax",["orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_xml/syntax"],function(e,t){var n=[];return n.push.apply(n,e.grammars),n.push.apply(n,t.grammars),n.push({id:"orion.ejs",contentTypes:["application/x-ejs"],patterns:[{include:"orion.xml#comment"},{include:"orion.xml#doctype"},{begin:"<%=?(?:\\s|$)",end:"%>",captures:{0:{name:"entity.name.declaration.js"}},contentName:"source.js.embedded.ejs",patterns:[{include:"orion.js"}]},{include:"orion.xml#tag"},{include:"orion.xml#ampersandEscape"}]}),{id:n[n.length-1].id,grammars:n,keywords:[]}}),function(){function e(e){if("string"!=typeof e)throw new TypeError}function t(e){return e?e.split("&"):[]}function n(e){return 0===e.length?"":e.join("&")}function r(e){var t=/([^=]*)(?:=?)(.*)/.exec(e),n=t[1]?decodeURIComponent(t[1]):"",r=t[2]?decodeURIComponent(t[2]):"";return[n,r]}function i(e){var t=encodeURIComponent(e[0]);return e[1]&&(t+="="+encodeURIComponent(e[1])),t}function o(e,n){var i="",o=[],a=0;return{next:function(){if(i!==e.query&&(i=e.query,o=t(i)),a1&&t.pop():"."!==e&&t.push(e)}),t.join("/")}function p(e){e.scheme&&(e.scheme=u(e.scheme)),e.port&&(e.port=l(e.port)),e.host&&e.path&&(e.path=c(e.path))}function d(e){return e.replace(/\s/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}function f(e,t){if("string"!=typeof e)throw new TypeError;e=d(e);var n=y.exec(e);if(!n)return null;var r={};if(r.scheme=n[1]||"",r.scheme&&!A.test(r.scheme))return null;var i=n[2];if(i){var o=D.exec(i);if(r.userinfo=o[1],r.host=o[2],r.port=o[3],r.port&&!C.test(r.port))return null}return r.path=n[3],r.query=n[4],r.fragment=n[5],s(r,t),p(r),r}function m(e){var t=e.scheme?e.scheme+":":"";return e.host&&(t+="//",e.userinfo&&(t+=e.userinfo+"@"),t+=e.host,e.port&&(t+=":"+e.port)),t+=e.path,e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function h(e,t){var n;if(t){if(t=t.href||t,n=f(t),!n||!n.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:n})}var r=f(e,n);if(!r)throw new SyntaxError;Object.defineProperty(this,"_input",{value:e,writable:!0}),Object.defineProperty(this,"_url",{value:r,writable:!0});var i=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?i:null},enumerable:!0})}try{var g;if("function"==typeof self.URL&&0!==self.URL.length&&"http:"===(g=new self.URL("http://www.w3.org?q")).protocol&&g.query)return}catch(v){}var y=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,D=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,E=/^\S*$/,A=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,C=/^\d*$/,F=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,b=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,x=/^([^?#\s]*)$/,S=/^([^\s]*)$/,w=E,B=/([^:]*):?(.*)/,k="undefined"!=typeof StopIteration?StopIteration:new Error("Stop Iteration"),_={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(n){e(n);var i,o=t(this._url.query);return o.some(function(e){var t=r(e);return t[0]===n?(i=t[1],!0):void 0}),i},enumerable:!0},set:{value:function(o,a){e(o),e(a);var s=t(this._url.query),u=s.some(function(e,t){var n=r(e);return n[0]===o?(n[1]=a,s[t]=i(n),!0):void 0});u||s.push(i([o,a])),this._url.query=n(s)},enumerable:!0},has:{value:function(n){e(n);var i=t(this._url.query);return i.some(function(e){var t=r(e);return t[0]===n?!0:void 0})},enumerable:!0},"delete":{value:function(i){e(i);var o=t(this._url.query),a=o.filter(function(e){var t=r(e);return t[0]!==i});return a.length!==o.length?(this._url.query=n(a),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(e,t){if("function"!=typeof e)throw new TypeError;var n=o(this._url,"keys+values");try{for(;;){var r=n.next();e.call(t,r[1],r[0],this)}}catch(i){if(i!==k)throw i}},enumerable:!0},keys:{value:function(){return o(this._url,"keys")},enumerable:!0},values:{value:function(){return o(this._url,"values")},enumerable:!0},items:{value:function(){return o(this._url,"keys+values")}},size:{get:function(){return t(this._url.query).length},enumerable:!0},getAll:{value:function(n){e(n);var i=[],o=t(this._url.query);return o.forEach(function(e){var t=r(e);t[0]===n&&i.push(t[1])}),i},enumerable:!0},append:{value:function(r,o){e(r),e(o);var a=t(this._url.query);a.push(i([r,o])),this._url.query=n(a)},enumerable:!0}}),Object.defineProperties(h.prototype,{toString:{value:function(){return this.href}},href:{get:function(){return this._url?m(this._url):this._input},set:function(t){e(t),this._input=t,this._url=f(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(t){if(e(t),this._url){var n=":"===t.slice(-1)?t.substring(0,t.length-1):t;(""===n||A.test(n))&&(this._url.scheme=u(n))}},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(t){e(t),this._url&&(this._url.userinfo=t)}},username:{get:function(){if(!this._url)return"";var e=B.exec(this._userinfo),t=decodeURIComponent(e[1]||"");return t},set:function(t){if(e(t),this._url){var n=B.exec(this._userinfo),r=[encodeURIComponent(t||"")];n[2]&&r.push(n[2]),this._userinfo=r.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var e=B.exec(this._userinfo),t=decodeURIComponent(e[2]||"");return t},set:function(t){if(e(t),this._url){var n=B.exec(this._userinfo),r=[n[1]||""];t&&r.push(encodeURIComponent(t)),this._userinfo=r.join(":")}},enumerable:!0},host:{get:function(){var e="";return this._url&&this._url.host&&(e+=this._url.host,this._url.port&&(e+=":"+this._url.port)),e},set:function(t){if(e(t),this._url){var n=b.exec(t);n&&(this._url.host=n[1],this._url.port=l(n[2]))}},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(t){if(e(t),this._url){var n=F.exec(t);n&&(this._url.host=t)}},enumerable:!0},port:{get:function(){var e=this._url?this._url.port||"":"";return e&&e===_[this.protocol]&&(e=""),e},set:function(t){if(e(t),this._url){var n=C.exec(t);n&&(this._url.port=l(t))}},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(t){if(e(t),this._url){var n=x.exec(t);n&&(this._url.host&&t&&"/"!==t[0]&&(t="/"+t),this._url.path=t?c(t):"")}},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(t){if(e(t),this._url){t&&"?"===t[0]&&(t=t.substring(1));var n=S.exec(t);n&&(this._url.query=t)}},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(t){if(e(t),this._url){t&&"#"===t[0]&&(t=t.substring(1));var n=w.exec(t);n&&(this._url.fragment=t)}},enumerable:!0}});var T=self.URL||self.webkitURL;T&&T.createObjectURL&&(Object.defineProperty(h,"createObjectURL",{value:T.createObjectURL.bind(T),enumerable:!1}),Object.defineProperty(h,"revokeObjectURL",{value:T.revokeObjectURL.bind(T),enumerable:!1})),self.URL=h}(),n("orion/URL-shim",function(){}),n("javascript/plugins/javascriptPlugin",["orion/plugin","orion/serviceregistry","orion/Deferred","orion/metrics","esprima/esprima","estraverse/estraverse","javascript/scriptResolver","javascript/astManager","javascript/quickFixes","javascript/contentAssist/ternAssist","javascript/contentAssist/ternProjectAssist","javascript/validator","javascript/ternProjectValidator","javascript/occurrences","javascript/hover","javascript/outliner","javascript/cuProvider","javascript/ternProjectManager","orion/util","javascript/logger","javascript/commands/generateDocCommand","javascript/commands/openDeclaration","javascript/commands/openImplementation","javascript/commands/renameCommand","javascript/commands/refsCommand","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/application_json/syntax","orion/editor/stylers/application_schema_json/syntax","orion/editor/stylers/application_x-ejs/syntax","i18n!javascript/nls/messages","orion/i18nUtil","orion/URL-shim"],function(e,t,n,r,i,o,a,s,u,l,c,p,d,f,m,h,g,v,y,D,E,A,C,F,b,x,S,w,B,k,_){function T(e,t,n){var r=new URL(e,window.location.href);r.query.set("worker-language",navigator.language),this.worker=new Worker(r.href),this.worker.onmessage=t.bind(this),this.worker.onerror=n.bind(this),this.worker.postMessage({request:"start_worker"}),this.messageId=0,this.callbacks=Object.create(null)}function P(e){var t={request:"read",ternID:e.ternID,args:{}},n=I.getService("orion.core.file.client");if("object"==typeof e.args.file){var r=e.args.file.logical;t.args.logical=r,O.getWorkspaceFile(r).then(function(i){if(i&&i.length>0){var o=O.resolveRelativeFiles(r,i,{location:e.args.file.file,contentType:{name:"JavaScript"}});if(o&&o.length>0)return n.read(o[0].location).then(function(e){t.args.contents=e,t.args.file=o[0].location,t.args.path=o[0].path,W.postMessage(t)});t.args.error=_.formatMessage(k.failedToReadFile,r),W.postMessage(t)}else t.args.error=_.formatMessage(k.failedToReadFile,r),W.postMessage(t)},function(e){t.args.error=_.formatMessage(k.failedToReadFile,r),t.args.message=e.toString(),W.postMessage(t)})}else{var i=e.args.file;t.args.file=i,/\.js|\.htm|\.htm$/gi.test(i)||(i+=".js");try{return n.read(i).then(function(e){t.args.contents=e,W.postMessage(t)},function(e){t.args.message=e.toString(),t.args.error=_.formatMessage(k.failedToReadFile,i),W.postMessage(t)})}catch(o){t.args.message=o.toString(),t.args.error=_.formatMessage(k.failedToReadFile,i),W.postMessage(t)}}}function j(){R=!0;for(var e=0,t=U.length;t>e;e++){var n=U[e];W.postMessage(n.msg,n.f)}for(U=[],e=0,t=q.length;t>e;e++)n=q[e],W.postMessage(n.msg,n.f);q=[]}function L(){var e=new n;return G?e.resolve(G):(W.postMessage({request:"environments"},function(t){G=t.envs,e.resolve(t.envs)}),e)}var I=new t.ServiceRegistry,N=new e({name:k.pluginName,version:"1.0",description:k.pluginDescription},I);N.registerService("orion.core.contenttype",{},{contentTypes:[{id:"application/javascript","extends":"text/plain",name:"JavaScript",extension:["js"],imageClass:"file-sprite-javascript modelDecorationSprite"},{id:"application/json","extends":"text/plain",name:"JSON",extension:["json","pref","tern-project"],imageClass:"file-sprite-javascript modelDecorationSprite"},{id:"application/x-ejs","extends":"text/plain",name:"Embedded Javascript",extension:["ejs"],imageClass:"file-sprite-javascript modelDecorationSprite"}]}),o.VisitorKeys.RecoveredNode=[];var O=new a.ScriptResolver(I),M=new s.ASTManager(i),R=!1,V=!1,$=Object.create(null),q=[],U=[];T.prototype.postMessage=function(e,t){var n="start_server"===e.request;if(n){if(!V)return $.msg=e,void($.f=t);R=!1}R||n||"read"===e.request?(null!==e&&"object"==typeof e&&"number"!=typeof e.messageID&&"number"!=typeof e.ternID&&(e.messageID=this.messageId++,this.callbacks[e.messageID]=t),this.worker.postMessage(e)):"addFile"===e.request||"delFile"===e.request?U.push({msg:e,f:t}):q.push({msg:e,f:t})};var G,W,H={read:P,worker_ready:function(){V=!0,$.msg&&$.msg.request||($.msg={request:"start_server",args:{}}),W.postMessage($.msg,$.f)},start_server:function(){j()}};W=new T("ternWorker.js",function(e){var t=e.data;if(t.__isError)D.log(t.message);else if("object"==typeof t){var n=t.messageID,r=this.callbacks[n];"function"==typeof r&&(r(t,t.error),delete this.callbacks[n]);var i=H[t.request];"function"==typeof i&&i(t)}},function(e){D.log(e)}),N.registerService("orion.edit.contentassist",new l.TernContentAssist(M,W,L,g),{contentType:["application/javascript","text/html"],nls:"javascript/nls/messages",name:"ternContentAssist",id:"orion.edit.contentassist.javascript.tern",charTriggers:"[.]",excludedStyles:"(string.*)"}),N.registerService("orion.edit.contentassist",{computeContentAssist:function(e,t){return e.getFileMetadata().then(function(n){return".tern-project"===n.name?e.getText().then(function(e){return c.getProposals(e,t)}):void 0})}},{contentType:["application/json"],nls:"javascript/nls/messages",name:"ternProjectAssist",id:"orion.edit.contentassist.javascript.tern.project"}),N.registerService("orion.edit.outliner",new h.JSOutliner(W),{contentType:["application/javascript"],name:k.sourceOutline,title:k.sourceOutlineTitle,id:"orion.javascript.outliner.source"}),N.registerService("orion.edit.occurrences",new f.JavaScriptOccurrences(M,g),{contentType:["application/javascript","text/html"]}),N.registerService("orion.edit.hover",new m.JavaScriptHover(M,O,W,g),{name:k.jsHover,contentType:["application/javascript","text/html"]});var K=new p(W);N.registerService("orion.edit.validator",K,{contentType:["application/javascript","text/html"],pid:"eslint.config"}),N.registerService("orion.edit.validator",{computeProblems:function(e){return e.getFileMetadata().then(function(t){return".tern-project"===t.name?e.getText().then(function(e){return d.validateAST(e)}):null})}},{contentType:["application/json"]}),N.registerService("orion.edit.model",{onModelChanging:M.onModelChanging.bind(M),onInputChanged:M.onInputChanged.bind(M)},{contentType:["application/javascript","text/html"],types:["ModelChanging","onInputChanged"]});var J=new v.TernProjectManager(W,O,I);N.registerService("orion.edit.model",{onInputChanged:J.onInputChanged.bind(J)},{contentType:["application/javascript","application/json","text/html"],types:["onInputChanged"]}),N.registerService("orion.edit.model",{onModelChanging:g.onModelChanging.bind(g),onInputChanged:g.onInputChanged.bind(g)},{contentType:["text/html"],types:["ModelChanging","onInputChanged"]});var z=new E.GenerateDocCommand(M,g);N.registerServiceProvider("orion.edit.command",z,{name:k.generateDocName,tooltip:k.generateDocTooltip,id:"generate.js.doc.comment",key:["j",!1,!0,!y.isMac,y.isMac],contentType:["application/javascript","text/html"]}),N.registerServiceProvider("orion.edit.command",new A.OpenDeclarationCommand(W,"replace"),{name:k.openDeclName,tooltip:k.openDeclTooltip,id:"open.js.decl",key:[114,!1,!1,!1,!1],contentType:["application/javascript","text/html"]}),N.registerServiceProvider("orion.edit.command.category",{},{id:"js.references",name:k.referencesMenuName,tooltip:k.referencesMenuTooltip});var Q=new b(W,M,O,g,I);N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return t.kind="project",Q.execute(e,t)}},{name:k.projectRefsName,tooltip:k.projectRefsTooltip,parentPath:"js.references",id:"project.js.refs",key:["y",!0,!0,!1,!1],contentType:["application/javascript","text/html"]}),N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return t.kind="workspace",Q.execute(e,t)}},{name:k.workspaceRefsName,tooltip:k.workspaceRefsTooltip,parentPath:"js.references",id:"workspace.js.refs",contentType:["application/javascript","text/html"]}),N.registerServiceProvider("orion.edit.command",new C.OpenImplementationCommand(W),{name:k.openImplName,tooltip:k.openImplTooltip,id:"open.js.impl",contentType:["application/javascript","text/html"],key:[114,!0,!1,!1,!1]});var X=new F.RenameCommand(W,O);N.registerServiceProvider("orion.edit.command",X,{name:k.renameElement,tooltip:k.renameElementTooltip,id:"rename.js.element",key:["R",!1,!0,!y.isMac,y.isMac],contentType:["application/javascript","text/html"]});var Y=new u.JavaScriptQuickfixes(M,X,z);N.registerServiceProvider("orion.edit.command",Y,{name:k.curlyFixName,scopeId:"orion.edit.quickfix",id:"curly.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:curly)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.removeExtraSemiFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"rm.extra.semi.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-extra-semi)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.addFallthroughCommentFixName,scopeId:"orion.edit.quickfix",id:"add.fallthrough.comment.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-fallthrough)$"}]}),N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return"no-fallthrough"===t.annotation.id&&(t.annotation.fixid="no-fallthrough-break"),Y.execute(e,t)}},{name:k.addBBreakFixName,scopeId:"orion.edit.quickfix",id:"add.fallthrough.break.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-fallthrough)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.addEmptyCommentFixName,scopeId:"orion.edit.quickfix",id:"add.empty.comment.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-empty-block)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.addESLintEnvFixName,scopeId:"orion.edit.quickfix",id:"add.eslint-env.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-undef-defined-inenv)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noReservedKeysFixName,scopeId:"orion.edit.quickfix",fixAllEnabled:!0,id:"update.reserved.property.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-reserved-keys)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.useIsNanFixName,scopeId:"orion.edit.quickfix",fixAllEnabled:!0,id:"use.isnan.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:use-isnan)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.addESLintGlobalFixName,scopeId:"orion.edit.quickfix",id:"add.eslint-global.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-undef-defined)$"}]}),N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return"no-unused-params-expr"===t.annotation.id&&(t.annotation.fixid="no-unused-params"),Y.execute(e,t)}},{name:k.removeUnusedParamsFixName,scopeId:"orion.edit.quickfix",id:"remove.unused.param.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-unused-params|no-unused-params-expr)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.commentCallbackFixName,scopeId:"orion.edit.quickfix",id:"comment.callback.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-unused-params-expr)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.eqeqeqFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"eqeqeq.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:eqeqeq)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noeqnullFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"noeqnull.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-eq-null)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noundefinitFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"no.undef.init.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-undef-init)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noselfassignFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"no.self.assign.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-self-assign)$"}]}),N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return"no-self-assign"===t.annotation.id&&(t.annotation.fixid="no-self-assign-rename"),Y.execute(e,t)}},{name:k.noselfassignRenameFixName,scopeId:"orion.edit.quickfix",id:"no.self.assign.rename.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-self-assign)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.newparensFixName,scopeId:"orion.edit.quickfix",id:"new.parens.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:new-parens)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.unreachableFixName,scopeId:"orion.edit.quickfix",id:"remove.unreachable.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-unreachable)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.sparseArrayFixName,scopeId:"orion.edit.quickfix",id:"sparse.array.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-sparse-arrays)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.semiFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"semi.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:semi)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.unusedVarsUnusedFixName,scopeId:"orion.edit.quickfix",id:"unused.var.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-unused-vars-unused)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.unusedFuncDeclFixName,scopeId:"orion.edit.quickfix",id:"unused.func.decl.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-unused-vars-unused-funcdecl)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noCommaDangleFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"no.comma.dangle.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-comma-dangle)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noThrowLiteralFixName,scopeId:"orion.edit.quickfix",id:"no.throw.literal.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-throw-literal)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.missingNlsFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"missing.nls.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:missing-nls)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.missingDocFixName,scopeId:"orion.edit.quickfix",id:"missing.doc.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:missing-doc)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.unnecessaryNlsFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"unnecessary.nls.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:unnecessary-nls)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noNewArrayFixName,scopeId:"orion.edit.quickfix",id:"no.new.array.literal.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-new-array)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noShadowFixName,scopeId:"orion.edit.quickfix",id:"no.shadow.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-shadow|no-shadow-global|no-shadow-global-param)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noDebuggerFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"no.debugger.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-debugger)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.radixFixName,fixAllEnabled:!0,scopeId:"orion.edit.quickfix",id:"radix.base.ten.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:radix)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noNewWrappersFixName,scopeId:"orion.edit.quickfix",id:"no.new.wrappers.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-new-wrappers)$"}]}),N.registerServiceProvider("orion.edit.command",{execute:function(e,t){return"no-new-wrappers"===t.annotation.id&&(t.annotation.fixid="no-new-wrappers-literal"),Y.execute(e,t)}},{name:k.noNewWrappersLiteralFixName,scopeId:"orion.edit.quickfix",id:"no.new.wrappers.literal.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-new-wrappers)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noDupeKeysFixName,scopeId:"orion.edit.quickfix",id:"no.dupe.keys.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-dupe-keys)$"}]}),N.registerServiceProvider("orion.edit.command",Y,{name:k.noDuplicateCaseFixName,scopeId:"orion.edit.quickfix",id:"no.duplicate.case.fix",contentType:["application/javascript","text/html"],validationProperties:[{source:"annotation:id",match:"^(?:no-duplicate-case)$"}]}),N.registerService("orion.cm.managedservice",K,{pid:"eslint.config"}),N.registerService("orion.cm.managedservice",K,{pid:"eslint.config.potential"}),N.registerService("orion.cm.managedservice",K,{pid:"eslint.config.practices"}),N.registerService("orion.cm.managedservice",K,{pid:"eslint.config.codestyle"});var Z=0,et=1,tt=2,nt=[{label:k.ignore,value:Z},{label:k.warning,value:et},{label:k.error,value:tt}];N.registerService("orion.core.setting",{},{settings:[{pid:"eslint.config.potential",order:1,name:k.prefPotentialProblems,tags:"validation javascript js eslint".split(" "),category:"javascript",categoryLabel:k.javascriptValidation,properties:[{id:"no-cond-assign",name:k.noCondAssign,type:"number",defaultValue:tt,options:nt},{id:"no-constant-condition",name:k.noConstantCondition,type:"number",defaultValue:tt,options:nt},{id:"no-control-regex",name:k["no-control-regex"],type:"number",defaultValue:tt,options:nt},{id:"no-empty-character-class",name:k["no-empty-character-class"],type:"number",defaultValue:tt,options:nt},{id:"no-obj-calls",name:k["no-obj-calls"],type:"number",defaultValue:tt,options:nt},{id:"no-negated-in-lhs",name:k["no-negated-in-lhs"],type:"number",defaultValue:tt,options:nt},{id:"no-console",name:k.noConsole,type:"number",defaultValue:Z,options:nt},{id:"no-debugger",name:k.noDebugger,type:"number",defaultValue:et,options:nt},{id:"type-checked-consistent-return",name:k["type-checked-consistent-return"],type:"number",defaultValue:Z,options:nt},{id:"no-extra-boolean-cast",name:k["no-extra-boolean-cast"],type:"number",defaultValue:tt,options:nt},{id:"no-extra-parens",name:k["no-extra-parens"],type:"number",defaultValue:et,options:nt},{id:"no-dupe-keys",name:k.noDupeKeys,type:"number",defaultValue:tt,options:nt},{id:"no-duplicate-case",name:k["no-duplicate-case"],type:"number",defaultValue:tt,options:nt},{id:"no-invalid-regexp",name:k["no-invalid-regexp"],type:"number",defaultValue:tt,options:nt},{id:"valid-typeof",name:k.validTypeof,type:"number",defaultValue:tt,options:nt},{id:"no-regex-spaces",name:k.noRegexSpaces,type:"number",defaultValue:tt,options:nt},{id:"use-isnan",name:k.useIsNaN,type:"number",defaultValue:tt,options:nt},{id:"no-reserved-keys",name:k.noReservedKeys,type:"number",defaultValue:tt,options:nt},{id:"no-sparse-arrays",name:k.noSparseArrays,type:"number",defaultValue:et,options:nt},{id:"no-fallthrough",name:k.noFallthrough,type:"number",defaultValue:tt,options:nt},{id:"no-comma-dangle",name:k.noCommaDangle,type:"number",defaultValue:Z,options:nt},{id:"no-empty-block",name:k.noEmptyBlock,type:"number",defaultValue:Z,options:nt},{id:"no-extra-semi",name:k.unnecessarySemis,type:"number",defaultValue:et,options:nt},{id:"no-unreachable",name:k.noUnreachable,type:"number",defaultValue:tt,options:nt}]},{pid:"eslint.config.practices",order:2,name:k.prefBestPractices,tags:"validation javascript js eslint".split(" "),category:"javascript",categoryLabel:k.javascriptValidation,properties:[{id:"no-eq-null",name:k["no-eq-null"],type:"number",defaultValue:tt,options:nt},{id:"no-self-assign",name:k["no-self-assign"],type:"number",defaultValue:tt,options:nt},{id:"no-self-compare",name:k["no-self-compare"],type:"number",defaultValue:tt,options:nt},{id:"no-caller",name:k.noCaller,type:"number",defaultValue:et,options:nt},{id:"eqeqeq",name:k.noEqeqeq,type:"number",defaultValue:et,options:nt},{id:"no-eval",name:k.noEval,type:"number",defaultValue:Z,options:nt},{id:"no-implied-eval",name:k.noImpliedEval,type:"number",defaultValue:Z,options:nt},{id:"no-iterator",name:k.noIterator,type:"number",defaultValue:tt,options:nt},{id:"no-new-array",name:k.noNewArray,type:"number",defaultValue:et,options:nt},{id:"no-new-func",name:k.noNewFunc,type:"number",defaultValue:et,options:nt},{id:"no-new-object",name:k.noNewObject,type:"number",defaultValue:et,options:nt},{id:"no-proto",name:k.noProto,type:"number",defaultValue:tt,options:nt},{id:"no-with",name:k.noWith,type:"number",defaultValue:et,options:nt},{id:"no-new-wrappers",name:k.noNewWrappers,type:"number",defaultValue:et,options:nt},{id:"no-undef-init",name:k.noUndefInit,type:"number",defaultValue:et,options:nt},{id:"accessor-pairs",name:k["accessor-pairs"],type:"number",defaultValue:et,options:nt},{id:"no-shadow-global",name:k.noShadowGlobals,defaultValue:et,type:"number",options:nt},{id:"no-use-before-define",name:k.useBeforeDefine,type:"number",defaultValue:et,options:nt},{id:"radix",name:k.radix,type:"number",defaultValue:et,options:nt},{id:"no-empty-label",name:k["no-empty-label"],type:"number",defaultValue:tt,options:nt},{id:"no-throw-literal",name:k.noThrowLiteral,type:"number",defaultValue:et,options:nt},{id:"curly",name:k.missingCurly,type:"number",defaultValue:Z,options:nt},{id:"no-undef",name:k.undefMember,type:"number",defaultValue:tt,options:nt},{id:"no-else-return",name:k["no-else-return"],type:"number",defaultValue:et,options:nt},{id:"no-unused-params",name:k.unusedParams,type:"number",defaultValue:et,options:nt},{id:"no-unused-vars",name:k.unusedVars,type:"number",defaultValue:et,options:nt},{id:"no-redeclare",name:k.varRedecl,type:"number",defaultValue:et,options:nt},{id:"no-shadow",name:k.varShadow,type:"number",defaultValue:et,options:nt}]},{pid:"eslint.config.codestyle",order:3,name:k.prefCodeStyle,tags:"validation javascript js eslint".split(" "),category:"javascript",categoryLabel:k.javascriptValidation,properties:[{id:"missing-doc",name:k.missingDoc,type:"number",defaultValue:Z,options:nt},{id:"new-parens",name:k.newParens,type:"number",defaultValue:tt,options:nt},{id:"semi",name:k.missingSemi,type:"number",defaultValue:et,options:nt},{id:"no-mixed-spaces-and-tabs",name:k.noMixedSpacesAndTabs,type:"number",defaultValue:Z,options:nt},{id:"missing-nls",name:k.missingNls,type:"number",defaultValue:Z,options:nt},{id:"unnecessary-nls",name:k.unnecessaryNls,type:"number",defaultValue:Z,options:nt},{id:"no-jslint",name:k.unsupportedJSLint,type:"number",defaultValue:et,options:nt}]}]}); -var rt={};x.grammars.forEach(function(e){rt[e.id]=e}),S.grammars.forEach(function(e){rt[e.id]=e}),w.grammars.forEach(function(e){rt[e.id]=e}),B.grammars.forEach(function(e){rt[e.id]=e});for(var it in rt)rt.hasOwnProperty(it)&&N.registerService("orion.edit.highlighter",{},rt[it]);N.connect(function(){r.initFromRegistry(I)})}),t("javascript/plugins/javascriptPlugin")}); \ No newline at end of file diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorker.js b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorker.js deleted file mode 100644 index c7b5e6904c2..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorker.js +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/*eslint-env node, browser*/ -/*globals importScripts */ -importScripts('../../requirejs/require.min.js'); // synchronous //$NON-NLS-1$ -require(["../../orion/require-config.js"], function(config){ - require.config({ - baseUrl: "../../" - }); - require(["javascript/plugins/ternWorkerCore"], null, config.errback); -}); diff --git a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorkerCore.js b/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorkerCore.js deleted file mode 100644 index 2ef85d55ead..00000000000 --- a/plugins/plugin-orion/che-plugin-orion-editor/src/main/resources/org/eclipse/che/ide/editor/orion/public/built-codeEdit-12.0/javascript/plugins/ternWorkerCore.js +++ /dev/null @@ -1,500 +0,0 @@ -/* - Copyright (C) 2013 Ariya Hidayat - Copyright (C) 2013 Thaddee Tyl - Copyright (C) 2013 Mathias Bynens - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Mathias Bynens - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/** - * @license RequireJS i18n 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/i18n for details - */ - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2014, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ - -/** - * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/text for details - */ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2010, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/* - Copyright (C) 2012-2013 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @fileoverview Defines environment settings and globals. - * @author Elan Shanker - * @copyright 2014 Elan Shanker. All rights reserved. - */ - -/******************************************************************************* - * @license - * Copyright (c) 2013, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/******************************************************************************* - * @license - * Copyright (c) 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/* - Copyright (C) 2012-2014 Yusuke Suzuki - Copyright (C) 2013 Alex Seville - Copyright (C) 2014 Thiago de Arruda - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/******************************************************************************* - * @license - * Copyright (c) 2013, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2014, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/** - * @fileoverview Rule to flag wrapping non-iife in parens - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - */ - -/** - * @fileoverview Rule to disallow a duplicate case label. - * @author Dieter Oberkofler - * @author Burak Yigit Kaya - * @copyright 2015 Dieter Oberkofler. All rights reserved. - * @copyright 2015 Burak Yigit Kaya. All rights reserved. - */ - -/** - * @fileoverview Disallow parenthesising higher precedence subexpressions. - * @author Michael Ficarra - * @copyright 2014 Michael Ficarra. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/** - * @fileoverview Validate strings passed to the RegExp constructor - * @author Michael Ficarra - * @copyright 2014 Michael Ficarra. All rights reserved. - */ - -/** - * @fileoverview Rule to disalow whitespace that is not a tab or space, whitespace inside strings and comments are allowed - * @author Jonathan Kingston - * @copyright 2014 Jonathan Kingston. All rights reserved. - */ - -/******************************************************************************* - * @license - * Copyright (c) 2013, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/** - * @fileoverview An object that creates fix commands for rules. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/** - * @fileoverview RuleContext utility for rules - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/** - * @fileoverview Object to handle access and retrieval of tokens. - * @author Brandon Mills - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Brandon Mills. All rights reserved. - */ - -/** - * @fileoverview Abstraction of JavaScript source code. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/** - * @fileoverview The event generator for AST nodes. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/** - * @fileoverview The event generator for comments. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -/** - * @fileoverview Validates configs. - * @author Brandon Mills - * @copyright 2015 Brandon Mills - */ - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2012 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - ******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2013, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - Allow original requirejs plugin to find files in Orion workspace - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - Allow original requirejs plugin to find files in Orion workspace - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - Allow original requirejs plugin to find files in Orion workspace - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -/******************************************************************************* - * @license - * Copyright (c) 2012, 2015 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Eclipse Public License v1.0 - * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution - * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). - * - * Contributors: IBM Corporation - initial API and implementation - *******************************************************************************/ - -!function(e,t){"use strict";"function"==typeof define&&define.amd?define("esprima/esprima",["exports"],t):t("undefined"!=typeof exports?exports:e.esprima={})}(this,function(e){"use strict";function t(e,t){if(!e)throw new Error("ASSERT: "+t)}function n(e){return e>=48&&57>=e}function r(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function o(e){return"01234567".indexOf(e)>=0}function s(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function i(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Mn.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function l(e){return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&Mn.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function p(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function u(e){return"eval"===e||"arguments"===e}function d(e){if(Pn&&p(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function h(e,n,r,o,s){var a;t("number"==typeof r,"Comment must have valid position"),$n.lastCommentStart=r,a={type:e,value:n},Xn.range&&(a.range=[r,o]),Xn.loc&&(a.loc=s),Xn.comments.push(a),Xn.attachComment&&(Xn.leadingComments.push(a),Xn.trailingComments.push(a))}function f(e){var t,n,r,o;for(t=In-e,n={start:{line:zn,column:In-Nn-e}};Jn>In;)if(r=Cn.charCodeAt(In),++In,a(r))return Ln=!0,Xn.comments&&(o=Cn.slice(t+e,In-1),n.end={line:zn,column:In-Nn-1},h("Line",o,t,In-1,n)),13===r&&10===Cn.charCodeAt(In)&&++In,++zn,void(Nn=In);Xn.comments&&(o=Cn.slice(t+e,In),n.end={line:zn,column:In-Nn},h("Line",o,t,In,n))}function m(){var e,t,n,r;for(Xn.comments&&(e=In-2,t={start:{line:zn,column:In-Nn-2}});Jn>In;)if(n=Cn.charCodeAt(In),a(n))13===n&&10===Cn.charCodeAt(In+1)&&++In,Ln=!0,++zn,++In,Nn=In;else if(42===n){if(47===Cn.charCodeAt(In+1))return++In,++In,void(Xn.comments&&(r=Cn.slice(e+2,In-2),t.end={line:zn,column:In-Nn},h("Block",r,e,In,t)));++In}else++In;In>=Jn&&Xn.comments?(t.end={line:zn,column:In-Nn},r=Cn.slice(e+2,In),h("Block",r,e,In,t),Z()):Q()}function g(){var e,t;for(Ln=!1,t=0===In;Jn>In;)if(e=Cn.charCodeAt(In),s(e))++In;else if(a(e))Ln=!0,++In,13===e&&10===Cn.charCodeAt(In)&&++In,++zn,Nn=In,t=!0;else if(47===e)if(e=Cn.charCodeAt(In+1),47===e)++In,++In,f(2),t=!0;else{if(42!==e)break;++In,++In,m()}else if(t&&45===e){if(45!==Cn.charCodeAt(In+1)||62!==Cn.charCodeAt(In+2))break;In+=3,f(3)}else{if(60!==e)break;if("!--"!==Cn.slice(In+1,In+4))break;++In,++In,++In,++In,f(4)}}function b(e){var t,n,o,s=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(Jn>In&&r(Cn[In])))return"";o=Cn[In++],s=16*s+"0123456789abcdef".indexOf(o.toLowerCase())}return String.fromCharCode(s)}function y(){var e,t,n,o;for(e=Cn[In],t=0,"}"===e&&Q();Jn>In&&(e=Cn[In++],r(e));)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Q(),65535>=t?String.fromCharCode(t):(n=(t-65536>>10)+55296,o=(t-65536&1023)+56320,String.fromCharCode(n,o))}function v(){var e,t;for(e=Cn.charCodeAt(In++),t=String.fromCharCode(e),92===e&&(117!==Cn.charCodeAt(In)&&Q(),++In,e=b("u"),e&&"\\"!==e&&i(e.charCodeAt(0))||Q(),t=e);Jn>In&&(e=Cn.charCodeAt(In),l(e));)++In,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Cn.charCodeAt(In)&&Q(),++In,e=b("u"),e&&"\\"!==e&&l(e.charCodeAt(0))||Q(),t+=e);return t}function w(){var e,t;for(e=In++;Jn>In;){if(t=Cn.charCodeAt(In),92===t)return In=e,v();if(!l(t))break;++In}return Cn.slice(e,In)}function S(){var e,t,n;return e=In,t=92===Cn.charCodeAt(In)?v():w(),n=1===t.length?En.Identifier:d(t)?En.Keyword:"null"===t?En.NullLiteral:"true"===t||"false"===t?En.BooleanLiteral:En.Identifier,{type:n,value:t,lineNumber:zn,lineStart:Nn,start:e,end:In}}function _(){var e,t,n,r,o=In,s=Cn.charCodeAt(In),a=Cn[In];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++In,Xn.tokenize&&(40===s?Xn.openParenToken=Xn.tokens.length:123===s&&(Xn.openCurlyToken=Xn.tokens.length)),{type:En.Punctuator,value:String.fromCharCode(s),lineNumber:zn,lineStart:Nn,start:o,end:In};default:if(e=Cn.charCodeAt(In+1),61===e)switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return In+=2,{type:En.Punctuator,value:String.fromCharCode(s)+String.fromCharCode(e),lineNumber:zn,lineStart:Nn,start:o,end:In};case 33:case 61:return In+=2,61===Cn.charCodeAt(In)&&++In,{type:En.Punctuator,value:Cn.slice(o,In),lineNumber:zn,lineStart:Nn,start:o,end:In}}}if(r=Cn.substr(In,4),">>>="===r)return In+=4,{type:En.Punctuator,value:r,lineNumber:zn,lineStart:Nn,start:o,end:In};if(n=r.substr(0,3),">>>"===n||"<<="===n||">>="===n)return In+=3,{type:En.Punctuator,value:n,lineNumber:zn,lineStart:Nn,start:o,end:In};if(t=n.substr(0,2),a===t[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t)return In+=2,{type:En.Punctuator,value:t,lineNumber:zn,lineStart:Nn,start:o,end:In};if("<>=!+-*%&|^/".indexOf(a)>=0)return++In,{type:En.Punctuator,value:a,lineNumber:zn,lineStart:Nn,start:o,end:In};++In;var i={type:En.Punctuator,lineNumber:zn,lineStart:Nn,start:o,end:In,value:Cn.slice(o,In)};Q(i)}function x(e){for(var t="";Jn>In&&r(Cn[In]);)t+=Cn[In++];return 0===t.length&&Q(),i(Cn.charCodeAt(In))&&Q(),{type:En.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:zn,lineStart:Nn,start:e,end:In}}function j(e){var t,r;for(r="";Jn>In&&(t=Cn[In],"0"===t||"1"===t);)r+=Cn[In++];return 0===r.length&&Q(),Jn>In&&(t=Cn.charCodeAt(In),(i(t)||n(t))&&Q()),{type:En.NumericLiteral,value:parseInt(r,2),lineNumber:zn,lineStart:Nn,start:e,end:In}}function E(e,t){var r,s;for(o(e)?(s=!0,r="0"+Cn[In++]):(s=!1,++In,r="");Jn>In&&o(Cn[In]);)r+=Cn[In++];return s||0!==r.length||Q(),(i(Cn.charCodeAt(In))||n(Cn.charCodeAt(In)))&&Q(),{type:En.NumericLiteral,value:parseInt(r,8),octal:s,lineNumber:zn,lineStart:Nn,start:t,end:In}}function T(){var e,t;for(e=In+1;Jn>e;++e){if(t=Cn[e],"8"===t||"9"===t)return!1;if(!o(t))return!0}return!0}function k(){var e,r,s;if(s=Cn[In],t(n(s.charCodeAt(0))||"."===s,"Numeric literal must start with a decimal digit or a decimal point"),r=In,e="","."!==s){if(e=Cn[In++],s=Cn[In],"0"===e){if("x"===s||"X"===s)return++In,x(r);if("b"===s||"B"===s)return++In,j(r);if("o"===s||"O"===s)return E(s,r);if(o(s)&&T())return E(s,r)}for(;n(Cn.charCodeAt(In));)e+=Cn[In++];s=Cn[In]}if("."===s){for(e+=Cn[In++];n(Cn.charCodeAt(In));)e+=Cn[In++];s=Cn[In]}if("e"===s||"E"===s)if(e+=Cn[In++],s=Cn[In],("+"===s||"-"===s)&&(e+=Cn[In++]),n(Cn.charCodeAt(In)))for(;n(Cn.charCodeAt(In));)e+=Cn[In++];else Q();return i(Cn.charCodeAt(In))&&Q(),{type:En.NumericLiteral,value:parseFloat(e),lineNumber:zn,lineStart:Nn,start:r,end:In}}function O(){var e,n,r,s,i,l,c="",p=!1;for(e=Cn[In],t("'"===e||'"'===e,"String literal must starts with a quote"),n=In,++In;Jn>In;){if(r=Cn[In++],r===e){e="";break}if("\\"===r)if(r=Cn[In++],r&&a(r.charCodeAt(0)))++zn,"\r"===r&&"\n"===Cn[In]&&++In,Nn=In;else switch(r){case"u":case"x":"{"===Cn[In]?(++In,c+=y()):(l=In,i=b(r),i?c+=i:(In=l,c+=r));break;case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+=" ";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+=" ";break;default:o(r)?(s="01234567".indexOf(r),0!==s&&(p=!0),Jn>In&&o(Cn[In])&&(p=!0,s=8*s+"01234567".indexOf(Cn[In++]),"0123".indexOf(r)>=0&&Jn>In&&o(Cn[In])&&(s=8*s+"01234567".indexOf(Cn[In++]))),c+=String.fromCharCode(s)):c+=r}else{if(a(r.charCodeAt(0)))break;c+=r}}var u={type:En.StringLiteral,value:c,octal:p,lineNumber:Wn,lineStart:Bn,start:n,end:In};return""!==e&&Z(u),u}function D(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){return parseInt(t,16)<=1114111?"x":void Q(null,An.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{RegExp(n)}catch(r){Q(null,An.InvalidRegExp)}try{return new RegExp(e,t)}catch(o){return null}}function R(){var e,n,r,o,s;for(e=Cn[In],t("/"===e,"Regular expression literal must start with a slash"),n=Cn[In++],r=!1,o=!1;Jn>In;)if(e=Cn[In++],n+=e,"\\"===e)e=Cn[In++],a(e.charCodeAt(0))&&Q(null,An.UnterminatedRegExp),n+=e;else if(a(e.charCodeAt(0)))Q(null,An.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){o=!0;break}"["===e&&(r=!0)}return o||Q(Vn,An.UnterminatedRegExp),s=n.substr(1,n.length-2),{value:s,literal:n}}function A(){var e,t,n,r;for(t="",n="";Jn>In&&(e=Cn[In],l(e.charCodeAt(0)));)if(++In,"\\"===e&&Jn>In)if(e=Cn[In],"u"===e){if(++In,r=In,e=b("u"))for(n+=e,t+="\\u";In>r;++r)t+=Cn[r];else In=r,n+="u",t+="\\u";Z()}else t+="\\",Z();else n+=e,t+=e;return{value:n,literal:t}}function M(){Hn=!0;var e,t,n,r;return g(),e=In,t=R(),n=A(),r=D(t.value,n.value),Hn=!1,Xn.tokenize?{type:En.RegularExpression,value:r,regex:{pattern:t.value,flags:n.value},lineNumber:zn,lineStart:Nn,start:e,end:In}:{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:In}}function C(){var e,t,n,r;return g(),e=In,t={start:{line:zn,column:In-Nn}},n=M(),t.end={line:zn,column:In-Nn},Xn.tokenize||(Xn.tokens.length>0&&(r=Xn.tokens[Xn.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"===r.value||"/="===r.value)&&Xn.tokens.pop()),Xn.tokens.push({type:"RegularExpression",value:n.literal,regex:n.regex,range:[e,In],loc:t})),n}function P(e){return e.type===En.Identifier||e.type===En.Keyword||e.type===En.BooleanLiteral||e.type===En.NullLiteral}function I(){var e,t;if(e=Xn.tokens[Xn.tokens.length-1],!e)return C();if("Punctuator"===e.type){if("]"===e.value)return _();if(")"===e.value)return t=Xn.tokens[Xn.openParenToken-1],!t||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?_():C();if("}"===e.value){if(Xn.tokens[Xn.openCurlyToken-3]&&"Keyword"===Xn.tokens[Xn.openCurlyToken-3].type){if(t=Xn.tokens[Xn.openCurlyToken-4],!t)return _()}else{if(!Xn.tokens[Xn.openCurlyToken-4]||"Keyword"!==Xn.tokens[Xn.openCurlyToken-4].type)return _();if(t=Xn.tokens[Xn.openCurlyToken-5],!t)return C()}return kn.indexOf(t.value)>=0?_():C()}return C()}return"Keyword"===e.type&&"this"!==e.value?C():_()}function z(){var e;return In>=Jn?{type:En.EOF,lineNumber:zn,lineStart:Nn,start:In,end:In,range:[In,In]}:(e=Cn.charCodeAt(In),i(e)?S():40===e||41===e||59===e?_():39===e||34===e?O():46===e?n(Cn.charCodeAt(In+1))?k():_():n(e)?k():Xn.tokenize&&47===e?I():_())}function N(){var e,t,n,r;return e={start:{line:zn,column:In-Nn}},t=z(),e.end={line:zn,column:In-Nn},t.type!==En.EOF&&(n=Cn.slice(t.start,t.end),r={type:Tn[t.type],value:n,range:[t.start,t.end],loc:e},t.regex&&(r.regex={pattern:t.regex.pattern,flags:t.regex.flags}),Xn.tokens.push(r)),t}function L(){var e;return Hn=!0,Fn=In,Un=zn,qn=Nn,g(),e=Vn,Gn=In,Wn=zn,Bn=Nn,Vn="undefined"!=typeof Xn.tokens?N():z(),Hn=!1,e}function F(){Hn=!0,g(),Fn=In,Un=zn,qn=Nn,Gn=In,Wn=zn,Bn=Nn,Vn="undefined"!=typeof Xn.tokens?N():z(),Hn=!1}function U(e){if(Xn.deps)for(var t=e.length,n=0;t>n;n++)q(e[n])}function q(e){if(Xn.deps&&e.type===On.Literal){for(var t=0;t1&&(r=t[1],r.type===On.ArrayExpression&&(Xn.envs.node=!0,U(r.elements)))}else"requirejs"===e.name?(r=t[0],r.type===On.ArrayExpression&&(Xn.envs.amd=!0,U(r.elements))):"define"===e.name&&n>1&&(r=t[0],r.type===On.Literal&&(r=t[1]),r.type===On.ArrayExpression&&(Xn.envs.amd=!0,U(r.elements)))}}function W(){this.line=Wn,this.column=Gn-Bn}function B(){this.start=new W,this.end=null}function H(e){this.start={line:e.lineNumber,column:e.start-e.lineStart},this.end=null}function J(){Xn.loc&&(this.loc=new B),Xn.range&&(this.range=[Gn,0]),Xn.directSourceFile&&(this.sourceFile=Xn.directSourceFile)}function V(e){Xn.loc&&(this.loc=new H(e)),Xn.range&&(this.range=[e.start,0]),Xn.directSourceFile&&(this.sourceFile=Xn.directSourceFile)}function $(e,t,n,r){var o=new Error("Line "+e+": "+n);if(o.index=t,o.lineNumber=e,o.column=t-(Hn?Nn:qn)+1,o.description=n,r){var s=r;2===r.type&&Xn&&Array.isArray(Xn.tokens)&&Xn.tokens.length>0&&(s=Xn.tokens[Xn.tokens.length-1]),o.index="number"==typeof s.start?s.start:s.range[0],o.token=s.value,o.end="number"==typeof s.end?s.end:s.range[1]}return o}function X(e){var n,r;throw n=Array.prototype.slice.call(arguments,1),r=e.replace(/%(\d)/g,function(e,r){return t(r0&&(t=Xn.tokens[Xn.tokens.length-2]),Z(t,An.MissingToken,n)}else t.type!==En.EOF&&(Xn.tokens&&Xn.tokens.length>0&&(t=Xn.tokens[Xn.tokens.length-2]),Z(t,An.MissingToken,","));else et(",")}function nt(e){var t=L();(t.type!==En.Keyword||t.value!==e)&&Q(t)}function rt(e){return Vn.type===En.Punctuator&&Vn.value===e}function ot(e){return Vn.type===En.Keyword&&Vn.value===e}function st(){var e;return Vn.type!==En.Punctuator?!1:(e=Vn.value,"="===e||"*="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e)}function at(){try{if(59===Cn.charCodeAt(Gn)||rt(";"))return void L();if(Ln)return;if(Fn=Gn,Un=Wn,qn=Bn,Vn.type!==En.EOF&&!rt("}")){var e=Vn;Xn.errors&&wn(Bn),Q(e)}}catch(t){if(Xn.errors)return void bn(t);throw t}}function it(e){return e.type===On.Identifier||e.type===On.MemberExpression}function lt(){var e=[],t=new J;for(et("[");!rt("]");)rt(",")?(L(),e.push(null)):(e.push(Rt()),rt("]")||et(","));return L(),t.finishArrayExpression(e)}function ct(e,t){var n,r,o=new J;return n=Pn,r=rn(),t&&Pn&&u(e[0].name)&&Z(t,An.StrictParamName),Pn=n,o.finishFunctionExpression(null,e,[],r)}function pt(){var e,t=new J;return e=L(),e.type===En.StringLiteral||e.type===En.NumericLiteral?(Pn&&e.octal&&Z(e,An.StrictOctalLiteral),t.finishLiteral(e)):t.finishIdentifier(e.value)}function ut(){var e,t,n,r,o,s=new J;return e=Vn,e.type===En.Identifier?(n=pt(),"get"!==e.value||rt(":")||rt("(")?"set"!==e.value||rt(":")||rt("(")?jn(e,n,s):(t=pt(),et("("),e=Vn,e.type!==En.Identifier?(et(")"),Z(e),r=ct([])):(o=[Pt()],et(")"),r=ct(o,e)),s.finishProperty("set",t,r,!1,!1)):(t=pt(),et("("),et(")"),r=ct([]),s.finishProperty("get",t,r,!1,!1))):e.type!==En.EOF&&e.type!==En.Punctuator?jn(e,pt(),s):void Q(e)}function dt(){var e,t,n,r,o=[],s={},a=String,i=new J;for(et("{");!rt("}");)e=ut(),null!=e&&"undefined"!=typeof e&&(t=e.key.type===On.Identifier?e.key.name:a(e.key.value),r="init"===e.kind?Rn.Data:"get"===e.kind?Rn.Get:Rn.Set,n="$"+t,Object.prototype.hasOwnProperty.call(s,n)?(s[n]===Rn.Data?Pn&&r===Rn.Data?K(An.StrictDuplicateProperty):r!==Rn.Data&&K(An.AccessorDataProperty):r===Rn.Data?K(An.AccessorDataProperty):s[n]&r&&K(An.AccessorGetSet),s[n]|=r):s[n]=r,o.push(e),rt("}")||tt("}"));return et("}"),i.finishObjectExpression(o)}function ht(){var e;return et("("),rt(")")?(L(),Dn.ArrowParameterPlaceHolder):(++$n.parenthesisCount,e=At(),et(")"),e)}function ft(){var e,t,n,r;if(rt("("))return ht();if(rt("["))return lt();if(rt("{"))return dt();if(e=Vn.type,r=new J,e===En.Identifier)n=r.finishIdentifier(L().value);else if(e===En.StringLiteral||e===En.NumericLiteral)Pn&&Vn.octal&&Z(Vn,An.StrictOctalLiteral),n=r.finishLiteral(L());else if(e===En.Keyword){if(ot("function"))return cn();ot("this")?(L(),n=r.finishThisExpression()):Q(L())}else e===En.BooleanLiteral?(t=L(),t.value="true"===t.value,n=r.finishLiteral(t)):e===En.NullLiteral?(t=L(),t.value=null,n=r.finishLiteral(t)):rt("/")||rt("/=")?(In=Gn,t="undefined"!=typeof Xn.tokens?C():M(),L(),n=r.finishLiteral(t)):Q(L());return n}function mt(){var e=[];if(et("("),!rt(")"))for(;Jn>Gn&&(e.push(Rt()),!rt(")"));)tt(")");return gn(")"),e}function gt(){var e,t=new J;try{e=L(),P(e)||(Xn.errors&&_n(e),Q(e))}catch(n){if(Xn.errors)return bn(n),xn(t,On.Identifier);throw n}return t.finishIdentifier(e.value)}function bt(){return et("."),gt()}function yt(){var e;return et("["),e=At(),et("]"),e}function vt(){var e,t,n=new J;return nt("new"),e=St(),t=rt("(")?mt():[],n.finishNewExpression(e,t)}function wt(){var e,t,n,r,o=$n.allowIn;for(r=Vn,$n.allowIn=!0,e=ot("new")?vt():ft();;)if(rt("."))n=bt(),e=new V(r).finishMemberExpression(".",e,n);else if(rt("("))t=mt(),e=new V(r).finishCallExpression(e,t);else{if(!rt("["))break;n=yt(),e=new V(r).finishMemberExpression("[",e,n)}return $n.allowIn=o,e}function St(){var e,n,r;for(t($n.allowIn,"callee of new expression always allow in keyword."),r=Vn,e=ot("new")?vt():ft();;)if(rt("["))n=yt(),e=new V(r).finishMemberExpression("[",e,n);else{if(!rt("."))break;n=bt(),e=new V(r).finishMemberExpression(".",e,n)}return e}function _t(){var e,t,n=Vn;return e=wt(),Ln||Vn.type!==En.Punctuator||(rt("++")||rt("--"))&&(Pn&&e.type===On.Identifier&&u(e.name)&&K(An.StrictLHSPostfix),it(e)||K(An.InvalidLHSInAssignment),t=L(),e=new V(n).finishPostfixExpression(t.value,e)),e}function xt(){var e,t,n;return Vn.type!==En.Punctuator&&Vn.type!==En.Keyword?t=_t():rt("++")||rt("--")?(n=Vn,e=L(),t=xt(),Pn&&t.type===On.Identifier&&u(t.name)&&K(An.StrictLHSPrefix),it(t)||K(An.InvalidLHSInAssignment),t=new V(n).finishUnaryExpression(e.value,t)):rt("+")||rt("-")||rt("~")||rt("!")?(n=Vn,e=L(),t=xt(),t=new V(n).finishUnaryExpression(e.value,t)):ot("delete")||ot("void")||ot("typeof")?(n=Vn,e=L(),t=xt(),t=new V(n).finishUnaryExpression(e.value,t),Pn&&"delete"===t.operator&&t.argument.type===On.Identifier&&K(An.StrictDelete)):t=_t(),t}function jt(e,t){var n=0;if(e.type!==En.Punctuator&&e.type!==En.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=t?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function Et(){var e,t,n,r,o,s,a,i,l,c;if(e=Vn,l=xt(),l===Dn.ArrowParameterPlaceHolder)return l;if(r=Vn,o=jt(r,$n.allowIn),0===o)return l;for(r.prec=o,L(),t=[e,Vn],a=xt(),s=[l,r,a];(o=jt(Vn,$n.allowIn))>0;){for(;s.length>2&&o<=s[s.length-2].prec;)a=s.pop(),i=s.pop().value,l=s.pop(),t.pop(),n=new V(t[t.length-1]).finishBinaryExpression(i,l,a),s.push(n);r=L(),r.prec=o,s.push(r),t.push(Vn),n=xt(),s.push(n)}for(c=s.length-1,n=s[c],t.pop();c>1;)n=new V(t.pop()).finishBinaryExpression(s[c-1].value,s[c-2],n),c-=2;return n}function Tt(){var e,t,n,r,o;return o=Vn,e=Et(),e===Dn.ArrowParameterPlaceHolder?e:(rt("?")&&(L(),t=$n.allowIn,$n.allowIn=!0,n=Rt(),$n.allowIn=t,et(":"),r=Rt(),e=new V(o).finishConditionalExpression(e,n,r)),e)}function kt(){return rt("{")?rn():Rt()}function Ot(e){var t,n,r,o,s,a,i,l,c;for(o=[],s=[],a=0,l=null,i={paramSet:{}},t=0,n=e.length;n>t;t+=1)if(r=e[t],r.type===On.Identifier)o.push(r),s.push(null),on(i,r,r.name);else{if(r.type!==On.AssignmentExpression)return null;o.push(r.left),s.push(r.right),++a,on(i,r.left,r.left.name)}return i.message===An.StrictParamDupe&&(c=Pn?i.stricted:i.firstRestricted,Q(c,i.message)),0===a&&(s=[]),{params:o,defaults:s,rest:l,stricted:i.stricted,firstRestricted:i.firstRestricted,message:i.message}}function Dt(e,t){var n,r;return et("=>"),n=Pn,r=kt(),Pn&&e.firstRestricted&&Q(e.firstRestricted,e.message),Pn&&e.stricted&&Z(e.stricted,e.message),Pn=n,t.finishArrowFunctionExpression(e.params,e.defaults,r,r.type!==On.BlockStatement)}function Rt(){var e,t,n,r,o,s;return e=$n.parenthesisCount,s=Vn,t=Vn,n=Tt(),n!==Dn.ArrowParameterPlaceHolder&&!rt("=>")||$n.parenthesisCount!==e&&$n.parenthesisCount!==e+1||(n.type===On.Identifier?o=Ot([n]):n.type===On.AssignmentExpression?o=Ot([n]):n.type===On.SequenceExpression?o=Ot(n.expressions):n===Dn.ArrowParameterPlaceHolder&&(o=Ot([])),!o)?(st()&&(it(n)||K(An.InvalidLHSInAssignment),Pn&&n.type===On.Identifier&&u(n.name)&&Z(t,An.StrictLHSAssignment),t=L(),r=Rt(),n=new V(s).finishAssignmentExpression(t.value,n,r)),n):Dt(o,new V(s))}function At(){var e,t,n=Vn;if(e=Rt(),rt(",")){for(t=[e];Jn>Gn&&rt(",");)L(),t.push(Rt());e=new V(n).finishSequenceExpression(t)}return e}function Mt(){for(var e,t=[],n=In;Jn>Gn&&!rt("}")&&(e=pn(),"undefined"!=typeof e&&n!==In);)t.push(e),n=In;return t}function Ct(){var e,t=new J;return et("{"),e=Mt(),gn("}"),t.finishBlockStatement(e)}function Pt(){var e,t=new J;return e=L(),e.type!==En.Identifier&&(Pn&&e.type===En.Keyword&&p(e.value)?Z(e,An.StrictReservedWord):Q(e)),t.finishIdentifier(e.value)}function It(e){var t,n=null,r=new J;return t=Pt(),Pn&&u(t.name)&&K(An.StrictVarName),"const"===e?(et("="),n=Rt()):rt("=")&&(L(),n=Rt()),r.finishVariableDeclarator(t,n)}function zt(e){var t=[];do{if(t.push(It(e)),!rt(","))break;L()}while(Jn>Gn);return t}function Nt(e){var t;return nt("var"),t=zt(),at(),e.finishVariableDeclaration(t,"var")}function Lt(e){var t,n=new J;return nt(e),t=zt(e),at(),n.finishVariableDeclaration(t,e)}function Ft(){var e=new J;return et(";"),e.finishEmptyStatement()}function Ut(e){var t=At();return at(),t||(t=xn(e)),e.finishExpressionStatement(t)}function qt(e){var t,n,r;return nt("if"),et("("),t=At(),gn(")","{"),n=nn(),ot("else")?(L(),r=nn()):r=null,e.finishIfStatement(t,n,r)}function Gt(e){var t,n,r;return nt("do"),r=$n.inIteration,$n.inIteration=!0,t=nn(),$n.inIteration=r,nt("while"),et("("),n=At(),gn(")","{"),rt(";")&&L(),e.finishDoWhileStatement(t,n)}function Wt(e){var t,n,r;return nt("while"),et("("),t=At(),gn(")","{"),r=$n.inIteration,$n.inIteration=!0,n=nn(),$n.inIteration=r,e.finishWhileStatement(t,n)}function Bt(){var e,t,n=new J;return e=L(),t=zt(),n.finishVariableDeclaration(t,e.value)}function Ht(e){var t,n,r,o,s,a,i,l=$n.allowIn;return t=n=r=null,nt("for"),et("("),rt(";")?L():(ot("var")||ot("let")?($n.allowIn=!1,t=Bt(),$n.allowIn=l,1===t.declarations.length&&ot("in")&&(L(),o=t,s=At(),t=null)):($n.allowIn=!1,t=At(),$n.allowIn=l,ot("in")&&(it(t)||K(An.InvalidLHSInForIn),L(),o=t,s=At(),t=null)),"undefined"==typeof o&&et(";")),"undefined"==typeof o&&(rt(";")||(n=At()),et(";"),rt(")")||(r=At())),gn(")","{"),i=$n.inIteration,$n.inIteration=!0,a=nn(),$n.inIteration=i,"undefined"==typeof o?e.finishForStatement(t,n,r,a):e.finishForInStatement(o,s,a)}function Jt(e){var t,n=null;if(nt("continue"),59===Cn.charCodeAt(Gn))return L(),$n.inIteration||X(An.IllegalContinue),e.finishContinueStatement(null);if(Ln)return $n.inIteration||X(An.IllegalContinue),e.finishContinueStatement(null);if(Vn.type===En.Identifier){var r=Vn;n=Pt(),t="$"+n.name,Object.prototype.hasOwnProperty.call($n.labelSet,t)||Z(r,An.UnknownLabel,n.name)}return at(),null!==n||$n.inIteration||X(An.IllegalContinue),e.finishContinueStatement(n)}function Vt(e){var t,n=null;return nt("break"),59===Cn.charCodeAt(Fn)?(L(),$n.inIteration||$n.inSwitch||X(An.IllegalBreak),e.finishBreakStatement(null)):Ln?($n.inIteration||$n.inSwitch||X(An.IllegalBreak),e.finishBreakStatement(null)):(Vn.type===En.Identifier&&(n=Pt(),t="$"+n.name,Object.prototype.hasOwnProperty.call($n.labelSet,t)||X(An.UnknownLabel,n.name)),at(),null!==n||$n.inIteration||$n.inSwitch||X(An.IllegalBreak),e.finishBreakStatement(n))}function $t(e){var t=null,n=Vn;return nt("return"),$n.inFunctionBody||Z(n,An.IllegalReturn,n.value),32===Cn.charCodeAt(Fn)&&i(Cn.charCodeAt(Fn+1))?(t=At(),at(),e.finishReturnStatement(t)):Ln?e.finishReturnStatement(null):(rt(";")||rt("}")||Vn.type===En.EOF||(t=At()),at(),e.finishReturnStatement(t))}function Xt(e){var t,n;return Pn&&K(An.StrictModeWith),nt("with"),et("("),t=At(),gn(")","{"),n=nn(),e.finishWithStatement(t,n)}function Kt(){var e,t,n=[],r=new J;ot("default")?(L(),e=null):(nt("case"),e=At()),rt(":")&&L();for(var o=In;Jn>Gn&&!(rt("}")||ot("default")||ot("case"))&&(t=nn(),"undefined"!=typeof t&&null!==t)&&(n.push(t),o!==In);)o=In;return r.finishSwitchCase(e,n)}function Yt(e){var t,n,r,o,s;if(nt("switch"),et("("),t=At(),et(")"),et("{"),n=[],rt("}"))return L(),e.finishSwitchStatement(t,n);for(o=$n.inSwitch,$n.inSwitch=!0,s=!1;Jn>Gn&&!rt("}");)r=Kt(),null===r.test&&(s&&X(An.MultipleDefaultsInSwitch),s=!0),n.push(r);return $n.inSwitch=o,et("}"),e.finishSwitchStatement(t,n)}function Qt(e){var t;return nt("throw"),Ln&&X(An.NewlineAfterThrow),t=At(),at(),e.finishThrowStatement(t)}function Zt(){var e,t,n=new J;return nt("catch"),et("("),rt(")")&&Q(Vn),e=Pt(),Pn&&u(e.name)&&K(An.StrictCatchVariable),et(")"),t=Ct(),n.finishCatchClause(e,t)}function en(e){var t,n=[],r=null;return nt("try"),t=Ct(),ot("catch")&&n.push(Zt()),ot("finally")&&(L(),r=Ct()),0!==n.length||r||X(An.NoCatchOrFinally),e.finishTryStatement(t,[],n,r)}function tn(e){return nt("debugger"),at(),e.finishDebuggerStatement()}function nn(){var e,t,n,r,o=Vn.type;if(o===En.EOF&&Q(Vn),o===En.Punctuator&&"{"===Vn.value)return Ct();if(r=new J,o===En.Punctuator)switch(Vn.value){case";":return Ft(r);case"(":return Ut(r)}else if(o===En.Keyword)switch(Vn.value){case"break":return Vt(r);case"continue":return Jt(r);case"debugger":return tn(r);case"do":return Gt(r);case"for":return Ht(r);case"function":return ln(r);case"if":return qt(r);case"return":return $t(r);case"switch":return Yt(r);case"throw":return Qt(r);case"try":return en(r);case"var":return Nt(r);case"while":return Wt(r);case"with":return Xt(r)}return e=At(),e&&e.type===On.Identifier&&rt(":")?(L(),n="$"+e.name,Object.prototype.hasOwnProperty.call($n.labelSet,n)&&X(An.Redeclaration,"Label",e.name),$n.labelSet[n]=!0,t=nn(),delete $n.labelSet[n],r.finishLabeledStatement(e,t)):(at(),e||(e=xn(r)),r.finishExpressionStatement(e))}function rn(){var e,t,n,r,o,s,a,i,l,c=[],p=new J;for(et("{");Jn>Gn&&Vn.type===En.StringLiteral&&(t=Vn,e=pn(),c.push(e),e.expression.type===On.Literal);)n=Cn.slice(t.start+1,t.end-1),"use strict"===n?(Pn=!0,r&&Z(r,An.StrictOctalLiteral)):!r&&t.octal&&(r=t);o=$n.labelSet,s=$n.inIteration,a=$n.inSwitch,i=$n.inFunctionBody,l=$n.parenthesizedCount,$n.labelSet={},$n.inIteration=!1,$n.inSwitch=!1,$n.inFunctionBody=!0,$n.parenthesizedCount=0;for(var u=In;Jn>In&&!rt("}")&&(e=pn(),"undefined"!=typeof e&&null!=e)&&(c.push(e),u!==In);)u=In;return gn("}"),$n.labelSet=o,$n.inIteration=s,$n.inSwitch=a,$n.inFunctionBody=i,$n.parenthesizedCount=l,p.finishBlockStatement(c)}function on(e,t,n){var r="$"+n;Pn?(u(n)&&(e.stricted=t,e.message=An.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=An.StrictParamDupe)):e.firstRestricted||(u(n)?(e.firstRestricted=t,e.message=An.StrictParamName):p(n)?(e.firstRestricted=t,e.message=An.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.firstRestricted=t,e.message=An.StrictParamDupe)),e.paramSet[r]=!0}function sn(e){var t,n,r;return t=Vn,n=Pt(),on(e,t,t.value),rt("=")&&(L(),r=Rt(),++e.defaultCount),e.params.push(n),e.defaults.push(r),!rt(")")}function an(e){var t;if(t={params:[],defaultCount:0,defaults:[],firstRestricted:e},et("("),!rt(")"))for(t.paramSet={};Jn>Gn&&sn(t);)et(",");return et(")"),0===t.defaultCount&&(t.defaults=[]),{params:t.params,defaults:t.defaults,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}}function ln(){var e,t,n,r,o,s,a,i,l=[],c=[],d=new J;return nt("function"),n=Vn,e=Pt(),Pn?u(n.value)&&Z(n,An.StrictFunctionName):u(n.value)?(s=n,a=An.StrictFunctionName):p(n.value)&&(s=n,a=An.StrictReservedWord),o=an(s),l=o.params,c=o.defaults,r=o.stricted,s=o.firstRestricted,o.message&&(a=o.message),i=Pn,t=rn(),Pn&&s&&Q(s,a),Pn&&r&&Z(r,a),Pn=i,d.finishFunctionDeclaration(e,l,c,t)}function cn(){var e,t,n,r,o,s,a,i=null,l=[],c=[],d=new J;return nt("function"),rt("(")||(e=Vn,i=Pt(),Pn?u(e.value)&&Z(e,An.StrictFunctionName):u(e.value)?(n=e,r=An.StrictFunctionName):p(e.value)&&(n=e,r=An.StrictReservedWord)),o=an(n),l=o.params,c=o.defaults,t=o.stricted,n=o.firstRestricted,o.message&&(r=o.message),a=Pn,s=rn(),Pn&&n&&Q(n,r),Pn&&t&&Z(t,r),Pn=a,d.finishFunctionExpression(i,l,c,s)}function pn(){if(Vn.type===En.Keyword)switch(Vn.value){case"const":case"let":return Lt(Vn.value);case"function":return ln();default:return nn()}return Vn.type!==En.EOF?nn():void 0}function un(){for(var e,t,n,r,o=[];Jn>Gn&&(t=Vn,t.type===En.StringLiteral)&&(e=pn(),o.push(e),e.expression.type===On.Literal);)n=Cn.slice(t.start+1,t.end-1),"use strict"===n?(Pn=!0,r&&Z(r,An.StrictOctalLiteral)):!r&&t.octal&&(r=t);for(var s=In;Jn>Gn&&(e=pn(),"undefined"!=typeof e&&null!==e)&&(o.push(e),s!==In);)s=In;return o}function dn(){var e,t;return F(),t=new J,Pn=!1,e=un(),t.finishProgram(e)}function hn(){var e,t,n,r=[];for(e=0;e0?1:0,Nn=0,Gn=In,Wn=zn,Bn=Nn,Jn=Cn.length,Vn=null,$n={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},Xn={},t=t||{},t.tokens=!0,Xn.tokens=[],Xn.tokenize=!0,Xn.openParenToken=-1,Xn.openCurlyToken=-1,Xn.range="boolean"==typeof t.range&&t.range,Xn.loc="boolean"==typeof t.loc&&t.loc,"boolean"==typeof t.comment&&t.comment&&(Xn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(Xn.errors=[]);try{if(F(),Vn.type===En.EOF)return Xn.tokens;for(L();Vn.type!==En.EOF;)try{L()}catch(o){if(Xn.errors){Xn.errors.push(o);break}throw o}hn(),r=Xn.tokens,"undefined"!=typeof Xn.comments&&(r.comments=Xn.comments),"undefined"!=typeof Xn.errors&&(r.errors=Xn.errors)}catch(s){throw s}finally{Xn={}}return r}function mn(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),Cn=e,In=0,zn=Cn.length>0?1:0,Nn=0,Gn=In,Wn=zn,Bn=Nn,Jn=Cn.length,Vn=null,$n={allowIn:!0,labelSet:{},parenthesisCount:0,inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},Xn={},"undefined"!=typeof t&&("boolean"==typeof t.deps&&t.deps&&(Xn.deps=[],Xn.envs=Object.create(null)),Xn.range="boolean"==typeof t.range&&t.range,Xn.loc="boolean"==typeof t.loc&&t.loc,Xn.attachComment="boolean"==typeof t.attachComment&&t.attachComment,Xn.loc&&null!==t.source&&void 0!==t.source&&(Xn.source=r(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(Xn.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(Xn.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(Xn.errors=[],Xn.parseStatement=nn,Xn.parseExpression=At,nn=vn(nn),At=yn(At)),Xn.attachComment&&(Xn.range=!0,Xn.comments=[],Xn.bottomRightStack=[],Xn.trailingComments=[],Xn.leadingComments=[]),Xn.directSourceFile=t.directSourceFile); -try{n=dn(),"undefined"!=typeof Xn.comments&&(n.comments=Xn.comments),"undefined"!=typeof Xn.tokens&&(hn(),n.tokens=Xn.tokens),"undefined"!=typeof Xn.errors&&(n.errors=Xn.errors),"undefined"!=typeof Xn.deps&&(n.dependencies=Xn.deps,n.environments=Xn.envs)}catch(o){throw o}finally{"undefined"!=typeof Xn.errors&&(nn=Xn.parseStatement,At=Xn.parseExpression),Xn={}}return n}function gn(e,t){try{et(e)}catch(n){if(!Xn.errors)throw n;bn(n),t&&Cn[n.index]===t&&(In=n.index,F())}}function bn(e){for(var t=Xn.errors.length,n=0;t>n;n++){var r=Xn.errors[n];if(r.index===e.index&&r.message===e.message)return}Xn.errors.push(e)}function yn(e){return function(){try{return e.apply(null,arguments)}catch(t){bn(t)}}}function vn(e){return function(){Xn.statementStart=In;try{return e.apply(null,arguments)}catch(t){bn(t)}}}function wn(e){for(var t=e;t>-1&&";"!==Cn[t]&&"\n"!==Cn[t];)t--;if(!(t<=Xn.statementStart)){var n=!1;Xn.lastRewindLocation?n=!0:Xn.lastRewindLocation!==t&&(n=!0),n&&(In=t,Sn(e),F(),Xn.lastRewindLocation=In)}}function Sn(e,t){for(var n=Xn.tokens.length-1;n>-1;){var r=Xn.tokens[n];if(r.range[0]",Tn[En.Identifier]="Identifier",Tn[En.Keyword]="Keyword",Tn[En.NullLiteral]="Null",Tn[En.NumericLiteral]="Numeric",Tn[En.Punctuator]="Punctuator",Tn[En.StringLiteral]="String",Tn[En.RegularExpression]="RegularExpression",kn=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],On={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},Dn={ArrowParameterPlaceHolder:{type:"ArrowParameterPlaceHolder"}},Rn={Data:1,Get:2,Set:4},An={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",MissingToken:"Missing expected '%0'"},Mn={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},V.prototype=J.prototype={processComment:function(){var e,t,n,r,o,s=Xn.bottomRightStack,a=s[s.length-1];if(!(this.type===On.Program&&this.body.length>0)){if(Xn.trailingComments.length>0){for(n=[],r=Xn.trailingComments.length-1;r>=0;--r)o=Xn.trailingComments[r],o.range[0]>=this.range[1]&&(n.unshift(o),Xn.trailingComments.splice(r,1));Xn.trailingComments=[]}else a&&a.trailingComments&&a.trailingComments[0].range[0]>=this.range[1]&&(n=a.trailingComments,delete a.trailingComments);if(a)for(;a&&a.range[0]>=this.range[0];)e=a,a=s.pop();if(e)e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=this.range[0]&&(this.leadingComments=e.leadingComments,e.leadingComments=void 0);else if(Xn.leadingComments.length>0)for(t=[],r=Xn.leadingComments.length-1;r>=0;--r)o=Xn.leadingComments[r],o.range[1]<=this.range[0]&&(t.unshift(o),Xn.leadingComments.splice(r,1));t&&t.length>0&&(this.leadingComments=t),n&&n.length>0&&(this.trailingComments=n),s.push(this)}},finish:function(){Xn.loc&&(this.loc.end={line:Un,column:Fn-qn},Xn.source&&(this.loc.source=Xn.source)),Xn.range&&(this.range[1]=Fn,this.start=this.range[0],this.end=Fn),Xn.attachComment&&this.processComment()},finishArrayExpression:function(e){return this.type=On.ArrayExpression,this.elements=e,this.finish(),this},finishArrowFunctionExpression:function(e,t,n,r){return this.type=On.ArrowFunctionExpression,this.id=null,this.params=e,this.defaults=t,this.body=n,this.rest=null,this.generator=!1,this.expression=r,this.finish(),this},finishAssignmentExpression:function(e,t,n){return this.type=On.AssignmentExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBinaryExpression:function(e,t,n){return this.type="||"===e||"&&"===e?On.LogicalExpression:On.BinaryExpression,this.operator=e,this.left=t,this.right=n,this.finish(),this},finishBlockStatement:function(e){return this.type=On.BlockStatement,this.body=e,this.finish(),this},finishBreakStatement:function(e){return this.type=On.BreakStatement,this.label=e,this.finish(),this},finishCallExpression:function(e,t){return this.type=On.CallExpression,this.callee=e,this.arguments=t,G(e,t),this.finish(),this},finishCatchClause:function(e,t){return this.type=On.CatchClause,this.param=e,this.body=t,this.finish(),this},finishConditionalExpression:function(e,t,n){return this.type=On.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n,this.finish(),this},finishContinueStatement:function(e){return this.type=On.ContinueStatement,this.label=e,this.finish(),this},finishDebuggerStatement:function(){return this.type=On.DebuggerStatement,this.finish(),this},finishDoWhileStatement:function(e,t){return this.type=On.DoWhileStatement,this.body=e,this.test=t,this.finish(),this},finishEmptyStatement:function(){return this.type=On.EmptyStatement,this.finish(),this},finishExpressionStatement:function(e){return this.type=On.ExpressionStatement,this.expression=e,this.finish(),this},finishForStatement:function(e,t,n,r){return this.type=On.ForStatement,this.init=e,this.test=t,this.update=n,this.body=r,this.finish(),this},finishForInStatement:function(e,t,n){return this.type=On.ForInStatement,this.left=e,this.right=t,this.body=n?n:xn(this,"Statement"),this.each=!1,this.finish(),this},finishFunctionDeclaration:function(e,t,n,r){return this.type=On.FunctionDeclaration,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishFunctionExpression:function(e,t,n,r){return this.type=On.FunctionExpression,this.id=e,this.params=t,this.defaults=n,this.body=r,this.rest=null,this.generator=!1,this.expression=!1,this.finish(),this},finishIdentifier:function(e){return this.type=On.Identifier,this.name=e,this.finish(),this},finishIfStatement:function(e,t,n){return this.type=On.IfStatement,this.test=e,this.consequent=t?t:xn(this,"Statement"),this.alternate=n,this.finish(),this},finishLabeledStatement:function(e,t){return this.type=On.LabeledStatement,this.label=e,this.body=t,this.finish(),this},finishLiteral:function(e){return this.type=On.Literal,this.value=e.value,this.raw=Cn.slice(e.start,e.end),e.regex&&(this.regex=e.regex),this.finish(),this},finishMemberExpression:function(e,t,n){return this.type=On.MemberExpression,this.computed="["===e,this.object=t,this.property=n,this.finish(),this},finishNewExpression:function(e,t){return this.type=On.NewExpression,this.callee=e,this.arguments=t,G(e,t),this.finish(),this},finishObjectExpression:function(e){return this.type=On.ObjectExpression,this.properties=e,this.finish(),this},finishPostfixExpression:function(e,t){return this.type=On.UpdateExpression,this.operator=e,this.argument=t,this.prefix=!1,this.finish(),this},finishProgram:function(e){return this.type=On.Program,this.body=e,this.finish(),this},finishProperty:function(e,t,n,r,o){return this.type=On.Property,this.key=t,this.value=n,this.kind=e,this.method=r,this.shorthand=o,this.finish(),this},finishReturnStatement:function(e){return this.type=On.ReturnStatement,this.argument=e,this.finish(),this},finishSequenceExpression:function(e){return this.type=On.SequenceExpression,this.expressions=e,this.finish(),this},finishSwitchCase:function(e,t){return this.type=On.SwitchCase,this.test=e,this.consequent=t,this.finish(),this},finishSwitchStatement:function(e,t){return this.type=On.SwitchStatement,this.discriminant=e,this.cases=t,this.finish(),this},finishThisExpression:function(){return this.type=On.ThisExpression,this.finish(),this},finishThrowStatement:function(e){return this.type=On.ThrowStatement,this.argument=e,this.finish(),this},finishTryStatement:function(e,t,n,r){return this.type=On.TryStatement,this.block=e,this.guardedHandlers=t,this.handlers=n,Array.isArray(n)&&n.length>0&&(this.handler=n[0]),this.finalizer=r,this.finish(),this},finishUnaryExpression:function(e,t){return this.type="++"===e||"--"===e?On.UpdateExpression:On.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0,this.finish(),this},finishVariableDeclaration:function(e,t){return this.type=On.VariableDeclaration,this.declarations=e,this.kind=t,this.finish(),this},finishVariableDeclarator:function(e,t){return this.type=On.VariableDeclarator,this.id=e,this.init=t,this.finish(),this},finishWhileStatement:function(e,t){return this.type=On.WhileStatement,this.test=e,this.body=t?t:xn(this,"Statement"),this.finish(),this},finishWithStatement:function(e,t){return this.type=On.WithStatement,this.object=e,this.body=t?t:xn(this,"Statement"),this.finish(),this}},e.version="2.0.0",e.tokenize=fn,e.parse=mn,e.isIdentifierPart=l,e.isIdentifierStart=i,e.isIdentifierChar=l,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in On)On.hasOwnProperty(e)&&(t[e]=On[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("acorn/dist/walk",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.acorn||(t.acorn={})).walk=e()}}(function(){return function e(t,n,r){function o(a,i){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!i&&l)return l(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a=r)&&s[i](e,n,c),(null==t||e.start==t)&&(null==r||e.end==r)&&o(i,e))throw new m(e,n)}(e,a)}catch(l){if(l instanceof m)return l;throw l}}function c(e,t,r,o,s){r=i(r),o||(o=n.base);try{!function l(e,n,s){var a=s||e.type;if(!(e.start>t||e.end=t&&r(a,e))throw new m(e,n);o[a](e,n,l)}}(e,s)}catch(a){if(a instanceof m)return a;throw a}}function u(e,t,r,o,s){r=i(r),o||(o=n.base);var a=void 0;return function l(e,n,s){if(!(e.start>t)){var i=s||e.type;e.end<=t&&(!a||a.node.end ")){var g=this.pos;d=this.parseType(!0),d.call&&(r?(h=d,d=t.ANull,f=g):i=!0)}else d=t.ANull;return i?s(o,d):(r&&(m=this.base)?t.Fn.call(this.base,n,t.ANull,o,a,d):m=new t.Fn(n,t.ANull,o,a,d),h&&(m.computeRet=h),null!=f&&(m.computeRetSource=this.spec.slice(f,this.pos)),m)},parseType:function(e,n,r){var o=this.parseTypeMaybeProp(e,n,r);if(!this.eat("|"))return o;for(var s=[o],i=o.call;;){var l=this.parseTypeMaybeProp(e,n,r);if(s.push(l),l.call&&(i=!0),!this.eat("|"))break}if(i)return a(s);for(var c=new t.AVal,p=0;p$!]/)||this.error();return e.apply?function(n,r){return o(e(n,r),t)}:o(e,t)},parseTypeInner:function(e,n,r){if(this.eat("fn("))return this.parseFnType(e,n,r);if(this.eat("[")){var o=this.parseType(e);return this.eat("]")||this.error(),o.call?i(o):r&&this.base?(t.Arr.call(this.base,o),this.base):new t.Arr(o)}if(this.eat("+")){var s=this.word(/[\w$<>\.!]/),a=w(s+".prototype");return a instanceof t.Obj||(a=w(s)),a instanceof t.Obj?e&&this.eat("[")?this.parsePoly(a):r&&this.forceNew?new t.Obj(a):t.getInstance(a):a}if(e&&this.eat("!")){var l=this.word(/\d/);if(l)return l=Number(l),function(e,n){return n[l]||t.ANull};if(this.eat("this"))return function(e){return e};if(this.eat("custom:")){var c=this.word(/[\w$]/);return S[c]||function(){return t.ANull}}return this.fromWord("!"+this.word(/[\w$<>\.!]/))}return this.eat("?")?t.ANull:this.fromWord(this.word(/[\w$<>\.!`]/))},fromWord:function(e){var n=t.cx();switch(e){case"number":return n.num;case"string":return n.str;case"bool":return n.bool;case"":return n.topScope}return n.localDefs&&e in n.localDefs?n.localDefs[e]:w(e)},parsePoly:function(e){var n,r="";(n=this.spec.slice(this.pos).match(/^\s*(\w+)\s*=\s*/))&&(r=n[1],this.pos+=n[0].length);var o=this.parseType(!0);if(this.eat("]")||this.error(),o.call)return function(n,s){var a=t.getInstance(e);return o(n,s).propagate(a.defProp(r)),a};var s=t.getInstance(e);return o.propagate(s.defProp(r)),s}};var y,v=e.parseEffect=function(e,n){var o;if(0==e.indexOf("propagate ")){var s=new b(e,10),a=s.parseType(!0);s.eat(" ")||s.error();var i=s.parseType(!0);c(n,function(e,t){r(a,e,t).propagate(r(i,e,t))})}else if(0==e.indexOf("call ")){var l=5==e.indexOf("and return ",5),s=new b(e,l?16:5),p=s.parseType(!0),u=null,d=[];for(s.eat(" this=")&&(u=s.parseType(!0));s.eat(" ");)d.push(s.parseType(!0));c(n,function(e,n){for(var o=r(p,e,n),s=u?r(u,e,n):t.ANull,a=[],i=0;i"!=e&&s.propagate(new t.PropHasSubset(e,n))})})}},w=e.parsePath=function(e,n){var r=t.cx(),o=r.paths[e],s=e;if(null!=o)return o;r.paths[e]=t.ANull;var a=n||y||r.topScope;if(r.localDefs)for(var i in r.localDefs)if(0==e.indexOf(i)){if(e==i)return r.paths[e]=r.localDefs[e];if("."==e.charAt(i.length)){a=r.localDefs[i],e=e.slice(i.length+1);break}}for(var l=e.split("."),c=0;c=3&&"Literal"==r[1].type&&"string"==typeof r[1].value){var o=n[0],s=new t.AVal; -o.propagate(new t.PropHasSubset(r[1].value,s,r[1])),n[2].propagate(new x(s))}return t.ANull}),t.registerFunction("Object_defineProperties",function(e,n,r){if(n.length>=2){var o=n[0];n[1].forAllProps(function(e,n,s){if(s){var a=new t.AVal;o.propagate(new t.PropHasSubset(e,a,r&&r[1])),n.propagate(new x(a))}})}return t.ANull});var j=t.constraint({construct:function(e,t,n){this.self=e,this.args=t,this.target=n},addType:function(e){if(e instanceof t.Fn){this.target.addType(new t.Fn(e.name,t.ANull,e.args.slice(this.args.length),e.argNames.slice(this.args.length),e.retval)),this.self.propagate(e.self);for(var n=0;n"),s=0;sl.length)return!1;for(var c=0;c=0;--r)e(t.charAt(r))&&(n.push(t.substring(r)),t=t.substring(0,r));return 0!==t.length&&n.push(t),n.reverse()}function o(e,t,n){var r=a;return r.range[1]="string"==typeof n?n.length:0,r.loc.start.line=e.lineNumber,r.loc.start.column=0,r.loc.end.line=e.lineNumber,r.loc.end.column=e.column,r.errors=[e],r.sourceFile=Object.create(null),r.sourceFile.text=n,r.sourceFile.name=t,r}function s(e){var t=[];return e&&e.errors&&e.errors.forEach(function(e){var n=e?JSON.parse(JSON.stringify(e)):e;e instanceof Error&&(n.__isError=!0,n.lineNumber="number"==typeof n.lineNumber?n.lineNumber:e.lineNumber,n.message=n.message||e.message,n.name=n.name||e.name,n.stack=n.stack||e.stack);var r=e.message;n.message=r=r.replace(/^Line \d+: /,""),/^Unexpected/.test(r)&&(n.type=1,/end of input$/.test(r)&&(n.type=2)),t.push(n)}),t}var a={type:"Program",body:[],comments:[],tokens:[],range:[0,0],loc:{start:{},end:{}}};return{isUpperCase:e,looselyMatches:t,startsWith:n,toCamelCaseParts:r,errorAST:o,serializeAstErrors:s}}),function(e,t){return"object"==typeof exports&&"object"==typeof module?t(exports,require("esprima/esprima"),require("acorn/dist/walk"),require("./def"),require("./signal"),require("javascript/util")):"function"==typeof define&&define.amd?define("tern/lib/infer",["exports","esprima/esprima","acorn/dist/walk","./def","./signal","javascript/util"],t):void t(e.tern||(e.tern={}),acorn,acorn.walk,tern.def,tern.signal,Util)}(this,function(e,t,n,r,o,s){"use strict";function a(e,t){var n=Object.create(e);if(t)for(var r in t)n[r]=t[r];return n}function i(e,t,n){var r=e.getType(!1),o=t.getType(!1);return r&&o?l(r,o,n):!0}function l(e,t,n){if(!e||n>=5)return t;if(!e||e==t)return e;if(!t)return e;if(e.constructor!=t.constructor)return!1;if(e.constructor!=at){if(e.constructor==ot){var r=0,o=0,s=0;for(var a in e.props)r++,a in t.props&&i(e.props[a],t.props[a],n+1)&&s++;for(var a in t.props)o++;return r&&o&&so?e:t}return e.constructor==st&&e.args.length==t.args.length&&e.args.every(function(e,r){return i(e,t.args[r],n+1)})&&i(e.retval,t.retval,n+1)&&i(e.self,t.self,n+1)?e:!1}var c=e.getProp("").getType(!1);if(!c)return t;var p=t.getProp("").getType(!1);return!p||l(c,p,n+1)?t:void 0}function c(e){for(var t=0,n=0,r=0,o=null,s=0;s1)return null;if(o)return o;for(var l=0,c=null,s=0;s").isEmpty()?1:2;else if(n){p=1;for(var u=0;u=l&&(l=p,c=a)}return c}function p(e,t){it.disabledComputing={fn:e,prev:it.disabledComputing};try{return t()}finally{it.disabledComputing=it.disabledComputing.prev}}function u(e,t){var n=it.props[e]||(it.props[e]=[]);n.push(t)}function d(e){return it.props[e]}function h(t){if(it.workList)return t(it.workList);var n=[],r=0,o=it.workList=function(e,t,o){r=lt)throw new e.TimedOut;r=n[a+3]+1,n[a+1].addType(n[a],n[a+2])}return s}finally{it.workList=null}}function f(e,t){e.fnType&&(e.fnType.instantiateScore=(e.fnType.instantiateScore||0)+t)}function m(e,t){try{return n.simple(e,{Expression:function(){if(--t<=0)throw dt}}),!0}catch(r){if(r==dt)return!1;throw r}}function g(e,t){var n=t.fnType.instantiateScore;return!it.disabledComputing&&n&&t.fnType.args.length&&m(e,5*n)?(f(t.prev,n/2),b(e,t),!0):void(t.fnType.instantiateScore=null)}function b(e,t){for(var r=t.fnType,o=0;o3)&&e.forward)for(var s=0;s"));for(var i=t(n.self,"!this",0),l=0;!i&&l"):r.name}function S(e){switch(e){case"+":case"-":case"~":return it.num;case"!":return it.bool;case"typeof":return it.str;case"void":case"delete":return M}}function _(e){switch(e){case"==":case"!=":case"===":case"!==":case"<":case">":case">=":case"<=":case"in":case"instanceof":return!0}}function x(e){if(e.regex)return X(it.protos.RegExp);switch(typeof e.value){case"boolean":return it.bool;case"number":return it.num;case"string":return it.str;case"object":case"function":return e.value?X(it.protos.RegExp):M}}function j(e){return function(t,n,r,o,s){var a=e(t,n,r,s);return o&&a.propagate(o),a}}function E(e){return function(t,n,r,o,s){return o||(o=new U),e(t,n,r,o,s),o}}function T(e,t,n,r,o){var s=ft[e.type];return s?s(e,t,n,r,o):void 0}function k(e,t){var n=e&&e[t],r=Array.prototype.slice.call(arguments,2);if(n)for(var o=0;o-1}:function(r,o){return o&&o.start>=t&&o.end<=n&&e.indexOf(r.origin)>-1}:null==n?function(t){return t.origin==e}:function(r,o){return o&&o.start>=t&&o.end<=n&&r.origin==e}}function D(e){wt=!0;var t=d(e);if(t)for(var n=0;nt?"?":e.toString(t,n)},M=e.ANull=o.mixin({addType:function(){},propagate:function(){},getProp:function(){return M},forAllProps:function(){},hasType:function(){return!1},isEmpty:function(){return!0},getFunctionType:function(){},getObjType:function(){},getType:function(){},gatherProperties:function(){},propagatesTo:function(){},typeHint:function(){},propHint:function(){},toString:function(){return"?"}}),C=100,P=90,I=10,z=5,N=5,L=90,F=2,U=e.AVal=function(){this.types=[],this.forward=null,this.maxWeight=0};U.prototype=a(M,{addType:function(e,t){if(t=t||C,this.maxWeightt||this.types.indexOf(e)>-1)return;this.signal("addType",e),this.types.push(e);var n=this.forward;n&&h(function(r){for(var o=0;o2)){t&&t!=C&&(e=new tt(e,t)),(this.forward||(this.forward=[])).push(e);var n=this.types;n.length&&h(function(r){for(var o=0;o-1},isEmpty:function(){return 0===this.types.length},getFunctionType:function(){for(var e=this.types.length-1;e>=0;--e)if(this.types[e]instanceof st)return this.types[e]},getObjType:function(){for(var e=null,t=this.types.length-1;t>=0;--t){var n=this.types[t];if(n instanceof ot){if(n.name)return n;e||(e=n)}}return e},getType:function(e){return 0===this.types.length&&e!==!1?this.makeupType():1===this.types.length?this.types[0]:c(this.types)},toString:function(e,t){if(0==this.types.length)return A(this.makeupType(),e,t);if(1==this.types.length)return A(this.types[0],e,t);var n=q(this.types);return n.length>2?"?":n.map(function(n){return A(n,e,t)}).join("|")},computedPropType:function(){if(!this.propertyOf)return null;if(this.propertyOf.hasProp("")){var e=this.propertyOf.getProp("");return e==this?null:e.getType()}if(this.propertyOf.maybeProps&&this.propertyOf.maybeProps[""]==this){for(var t in this.propertyOf.props){var n=this.propertyOf.props[t];if(!n.isEmpty())return n}return null}},makeupType:function(){var e=this.computedPropType();if(e)return e;if(!this.forward)return null;for(var t=this.forward.length-1;t>=0;--t){var n=this.forward[t].typeHint();if(n&&!n.isEmpty())return wt=!0,n}for(var r=Object.create(null),o=null,t=0;t"!=s&&"✖"!=s&&s!=it.completingProperty&&(r[s]=!0,o=s)}if(!o)return null;var a=d(o);if(a){var i=[];e:for(var t=0;t0&&(p.potentialMatches=i),p}},typeHint:function(){return this.types.length?this.getType():null},propagatesTo:function(){return this},gatherProperties:function(e,t){for(var n=0;n"!=this.prop&&/[^\w_]/.test(this.prop)?void 0:{target:this.target,pathExt:"."+this.prop}}}),B=e.PropHasSubset=G({construct:function(e,t,n){this.prop=e,this.type=t,this.originNode=n},addType:function(e,t){if(e instanceof ot){var n=e.defProp(this.prop,this.originNode);n.origin||(n.origin=this.origin),this.type.propagate(n,t)}},propHint:function(){return this.prop}}),H=G({construct:function(e){this.c=e},addType:function(e){e instanceof ot&&e.forAllProps(this.c)}}),J=e.IsCallee=G({construct:function(e,t,n,r){this.self=e,this.args=t,this.argNodes=n,this.retval=r,this.disabled=it.disabledComputing},addType:function(e,t){if(e instanceof st){for(var n=0;n8||this.target.addType(e==it.protos.Array?new at:X(e,this.ctor)))}}),Y=G({construct:function(e){this.fn=e},addType:function(e){if(e instanceof ot&&!e.hasCtor){e.hasCtor=this.fn;var t=new et(e,this.fn);t.addType(this.fn),e.forAllProps(function(e,n,r){r&&n.propagate(t)})}}}),Q=G({construct:function(e,t){this.other=e,this.target=t},addType:function(e,t){e==it.str?this.target.addType(it.str,t):e==it.num&&this.other.hasType(it.num)&&this.target.addType(it.num,t)},typeHint:function(){return this.other}}),Z=e.IfObj=G({construct:function(e){this.target=e},addType:function(e,t){e instanceof ot&&this.target.addType(e,t)},propagatesTo:function(){return this.target}}),et=G({construct:function(e,t){this.obj=e,this.ctor=t},addType:function(e){e instanceof st&&e.self&&e.self.isEmpty()&&e.self.addType(X(this.obj,this.ctor),F)}}),tt=G({construct:function(e,t){this.inner=e,this.weight=t},addType:function(e,t){this.inner.addType(e,Math.min(t,this.weight))},propagatesTo:function(){return this.inner.propagatesTo()},typeHint:function(){return this.inner.typeHint()},propHint:function(){return this.inner.propHint()}}),nt=e.Type=function(){};nt.prototype=a(M,{constructor:nt,propagate:function(e,t){e.addType(this,t)},hasType:function(e){return e==this},isEmpty:function(){return!1},typeHint:function(){return this},getType:function(){return this}});var rt=e.Prim=function(e,t){this.name=t,this.proto=e};rt.prototype=a(nt.prototype,{constructor:rt,toString:function(){return this.name},getProp:function(e){return this.proto.hasProp(e)||M},gatherProperties:function(e,t){this.proto&&this.proto.gatherProperties(e,t)}});var ot=e.Obj=function(e,t){if(this.props||(this.props=Object.create(null)),this.proto=e===!0?it.protos.Object:e,e&&!t&&e.name&&!(this instanceof st)){var n=/^(.*)\.prototype$/.exec(this.proto.name);n&&(t=n[1])}this.name=t,this.maybeProps=null,this.origin=it.curOrigin};ot.prototype=a(nt.prototype,{constructor:ot,toString:function(e){if(null==e&&(e=0),0>=e&&this.name)return this.name;var t=[],n=!1;for(var r in this.props)if(""!=r){if(t.length>5){n=!0;break}t.push(e?r+": "+A(this.props[r],e-1,this):r)}return t.sort(),n&&t.push("..."),"{"+t.join(", ")+"}"},hasProp:function(e,t){var n=this.props[e];if(t!==!1)for(var r=this.proto;r&&!n;r=r.proto)n=r.props[e];return n},defProp:function(e,t){var n=this.hasProp(e,!1);if(n)return t&&!n.originNode&&(n.originNode=t),n;if("__proto__"==e||"✖"==e)return M;var r=this.maybeProps&&this.maybeProps[e];return r?(delete this.maybeProps[e],this.maybeUnregProtoPropHandler()):(r=new U,r.propertyOf=this),this.props[e]=r,r.originNode=t,r.origin=it.curOrigin,this.broadcastProp(e,r,!0),r},getProp:function(e){var t=this.hasProp(e,!0)||this.maybeProps&&this.maybeProps[e];if(t)return t;if("__proto__"==e||"✖"==e)return M;var n=this.ensureMaybeProps()[e]=new U;return n.propertyOf=this,n},broadcastProp:function(e,t,n){if(n&&(this.signal("addProp",e,t),this instanceof ut||u(e,this)),this.onNewProp)for(var r=0;r"!=n&&e(n,this,t);this.proto&&this.proto.gatherProperties(e,t+1)},getObjType:function(){return this}});var st=e.Fn=function(e,t,n,r,o){ot.call(this,it.protos.Function,e),this.self=t,this.args=n,this.argNames=r,this.retval=o};st.prototype=a(ot.prototype,{constructor:st,toString:function(e){null==e&&(e=0);for(var t="fn(",n=0;n-3?A(this.args[n],e-1,this):"?"}return t+=")",this.retval.isEmpty()||(t+=" -> "+(e>-3?A(this.retval,e-1,this):"?")),t},getProp:function(e){if("prototype"==e){var t=this.hasProp(e,!1);if(!t){t=this.defProp(e);var n=new ot(!0,this.name&&this.name+".prototype");n.origin=this.origin,t.addType(n,I)}return t}return ot.prototype.getProp.call(this,e)},defProp:function(e,t){if("prototype"==e){var n=this.hasProp(e,!1);return n?n:(n=ot.prototype.defProp.call(this,e,t),n.origin=this.origin,n.propagate(new Y(this)),n)}return ot.prototype.defProp.call(this,e,t)},getFunctionType:function(){return this}});var at=e.Arr=function(e){ot.call(this,it.protos.Array);var t=this.defProp("");e&&e.propagate(t)};at.prototype=a(ot.prototype,{constructor:at,toString:function(e){return null==e&&(e=0),"["+(e>-3?A(this.getProp(""),e-1,this):"?")+"]"}}),e.Context=function(t,n){this.parent=n,this.props=Object.create(null),this.protos=Object.create(null),this.origins=[],this.curOrigin="ecma5",this.paths=Object.create(null),this.definitions=Object.create(null),this.purgeGen=0,this.workList=null,this.disabledComputing=null,e.withContext(this,function(){if(it.protos.Object=new ot(null,"Object.prototype"),it.topScope=new ut,it.topScope.name="",it.protos.Array=new ot(!0,"Array.prototype"),it.protos.Function=new st("Function.prototype",M,[],[],M),it.protos.Function.proto=it.protos.Object,it.protos.RegExp=new ot(!0,"RegExp.prototype"),it.protos.String=new ot(!0,"String.prototype"),it.protos.Number=new ot(!0,"Number.prototype"),it.protos.Boolean=new ot(!0,"Boolean.prototype"),it.str=new rt(it.protos.String,"string"),it.bool=new rt(it.protos.Boolean,"bool"),it.num=new rt(it.protos.Number,"number"),it.curOrigin=null,t)for(var e=0;er)return t();lt=n;try{return t()}finally{lt=r}},e.addOrigin=function(e){it.origins.indexOf(e)<0&&it.origins.push(e)};var ct=20,pt=1e-4,ut=e.Scope=function(e){ot.call(this,e||!0),this.prev=e};ut.prototype=a(ot.prototype,{constructor:ut,defVar:function(e,t){for(var n=this;;n=n.proto){var r=n.props[e];if(r)return r;if(!n.prev)return n.defProp(e,t)}}});var dt={},ht=n.make({Function:function(e,t,n){var r=e.body.scope=new ut(t);r.originNode=e;for(var o=[],s=[],a=0;ar;++r)T(e.expressions[r],t,n,M);return T(e.expressions[o],t,n)}),UnaryExpression:j(function(e,t,n){return T(e.argument,t,n,M),S(e.operator)}),UpdateExpression:j(function(e,t,n){return T(e.argument,t,n,M),it.num}),BinaryExpression:j(function(e,t,n){if("+"==e.operator){var r=T(e.left,t,n),o=T(e.right,t,n);if(r.hasType(it.str)||o.hasType(it.str))return it.str;if(r.hasType(it.num)&&o.hasType(it.num))return it.num;var s=new U;return r.propagate(new Q(o,s)),o.propagate(new Q(r,s)),s}return T(e.left,t,n,M),T(e.right,t,n,M),_(e.operator)?it.bool:it.num}),AssignmentExpression:j(function(e,t,n){var r,o,s;if("MemberExpression"==e.left.type?(s=w(e.left,t,n),"Identifier"==e.left.object.type&&(o=e.left.object.name+"."+s)):o=e.left.name,"="!=e.operator&&"+="!=e.operator?(T(e.right,t,n,M),r=it.num):r=T(e.right,t,n,null,o),"MemberExpression"==e.left.type){var a=T(e.left.object,t,n);if("prototype"==s&&f(t,20),""==s){var i=e.left.property.name,l=t.props[i],c=l&&l.iteratesOver;if(c){f(t,20);var p="MemberExpression"==e.right.type&&e.right.computed&&e.right.property.name==i;return c.forAllProps(function(e,t,n){n&&"prototype"!=e&&""!=e&&a.propagate(new B(e,p?t:M))}),r}}a.propagate(new B(s,r,e.left.property))}else r.propagate(t.defVar(e.left.name,e.left));return r}),LogicalExpression:E(function(e,t,n,r){T(e.left,t,n,r),T(e.right,t,n,r)}),ConditionalExpression:E(function(e,t,n,r){T(e.test,t,n,M),T(e.consequent,t,n,r),T(e.alternate,t,n,r)}),NewExpression:E(function(e,t,n,r,o){"Identifier"==e.callee.type&&e.callee.name in t.props&&f(t,20);for(var s=0,a=[];s-1&&f(t,30),a.propagate(new V(i,s,e.arguments,r))}else{var l=T(e.callee,t,n);t.fnType&&t.fnType.args.indexOf(l)>-1&&f(t,30);var c=l.getFunctionType();c&&c.instantiateScore&&t.fnType&&f(t,c.instantiateScore/5),l.propagate(new J(it.topScope,s,e.arguments,r))}}),MemberExpression:E(function(e,t,n,r){var o=w(e,t),s=T(e.object,t,n),a=s.getProp(o);if(""==o){var i=T(e.property,t,n);if(!i.hasType(it.num))return a.propagate(r,z)}a.propagate(r)}),Identifier:j(function(e,t){return"arguments"!=e.name||!t.fnType||e.name in t.props||t.defProp(e.name,t.fnType.originNode).addType(new at(t.fnType.arguments=new U)),t.getProp(e.name)}),ThisExpression:j(function(e,t){return t.fnType?t.fnType.self:it.topScope}),Literal:j(function(e){return x(e)})},mt=n.make({Expression:function(e,t,n){T(e,t,n,M)},FunctionDeclaration:function(e,t,n){var r=e.body.scope,o=r.fnType;n(e.body,t,"ScopeBody"),g(e,r)||y(r);var s=t.getProp(e.id.name);s.addType(o)},VariableDeclaration:function(e,t,n){for(var r=0;ri;i++){var c=s[i],p=c.getProp(n);"undefined"!=typeof p&&"undefined"!=typeof p.originNode&&"undefined"!=typeof p.origin&&p.originNode.sourceFile&&p.originNode.sourceFile.name===p.origin&&a.push(p)}a.length>0&&(o.potentialMatches=a)}return o}return""==n?M:D(n)},Identifier:function(e,t){return t.hasProp(e.name)||M},ThisExpression:function(e,t){return t.fnType?t.fnType.self:it.topScope},Literal:function(e){return x(e)}},yt=e.searchVisitor=n.make({Function:function(e,t,n){var r=e.body.scope;e.id&&n(e.id,r);for(var o=0;ot?!1:"Identifier"==n.type&&"✖"==n.name?!1:bt.hasOwnProperty(n.type)};return n.findNodeAround(e,r,a,yt,o||it.topScope)},e.expressionType=function(e){return R(e.node,e.state)},e.parentNode=function(e,t){function r(t,s,a){if(t.start<=e.start&&t.end>=e.end){var i=o[o.length-1];if(t==e)throw{found:i};i!=t&&o.push(t),n.base[a||t.type](t,s,r),i!=t&&o.pop()}}var o=[];try{r(t,null)}catch(s){if(s.found)return s.found;throw s}};var vt={ArrayExpression:function(e,t,n){return n(e,!0).getProp("")},ObjectExpression:function(e,t,n){for(var r=0;ry(e,n)?(o.parent=n,o.excluded&&(o.excluded=null)):o.parent||(o.parent=n));var i=new s(t,n);e.files.push(i),e.fileMap[t]=i,null!=r?a(i,r,e):e.options.async?(e.startAsyncAction(),e.options.getFile(t,function(t,n){a(i,n||"",e),e.finishAsyncAction(t)})):a(i,e.options.getFile(t)||"",e)}function p(e,t,n){var r=function(){e.off("everythingFetched",r),clearTimeout(o),u(e,t,n)};e.on("everythingFetched",r);var o=setTimeout(r,e.options.fetchTimeout)}function u(e,n,r){if(e.pending)return p(e,n,r);var o=e.fetchError;if(o)return e.fetchError=null,r(o);e.needsPurge.length>0&&t.withContext(e.cx,function(){t.purge(e.needsPurge),e.needsPurge.length=0});for(var s=!0,a=0;at?e:e.slice(0,t)}function h(e,t,n){var r=Math.max(0,n-500),o=null;if(!/^\s*$/.test(e))for(;;){var s=t.indexOf(e,r);if(0>s||s>n+500)break;(null==o||Math.abs(o-n)>Math.abs(s-n))&&(o=s),r=s+e.length}return o}function f(e){for(var t=0;e;++t,e=e.prev);return t}function m(e){var t=new Error(e);return t.name="TernError",t}function g(e,n,r){var s=r.match(/^#(\d+)$/);if(!s)return e.findFile(r);var a=n[s[1]];if(!a||"delete"==a.type)throw m("Reference to unknown file "+r);if("full"==a.type)return e.findFile(a.name);var i=a.backing=e.findFile(a.name),l=a.offset;a.offsetLines&&(l={line:a.offsetLines,ch:0}),a.offset=l=Y(i,null==a.offsetLines?a.offset:{line:a.offsetLines,ch:0},!0);var c,p,u=d(a.text),g=h(u,i.text,l),b=null==g?Math.max(0,i.text.lastIndexOf("\n",l)):g;return t.withContext(e.cx,function(){t.purge(a.name,b,b+a.text.length);var n,r=a.text;if(n=r.match(/(?:"([^"]*)"|([\w$]+))\s*:\s*function\b/)){var s=o.findNodeAround(a.backing.ast,b,"ObjectExpression");s&&s.node.objType&&(c={type:s.node.objType,prop:n[2]||n[1]})}if(g&&(n=u.match(/^(.*?)\bfunction\b/))){for(var l=n[1].length,d="",h=0;l>h;++h)d+=" ";r=d+r.slice(l),p=!0}var m=t.scopeAt(i.ast,b,i.scope),y=t.scopeAt(i.ast,b+r.length,i.scope),v=a.scope=f(m)h;++h)x.args[h].propagate(j.args[h]);x.self.propagate(j.self),j.retval.propagate(x.retval)}}}),a}function b(e){var t=0;return o.simple(e,{Expression:function(){++t}}),t}function y(e,t){for(var n=0;t;)t=e.findFile(t).parent,++n;return n}function v(e,t){for(;;){var n=e.findFile(t.parent);if(!n.parent)break;t=n}return t.name}function w(e,t){var n=v(e,t),r=b(t.ast),o=e.budgets[n];return null==o&&(o=e.budgets[n]=e.options.dependencyBudget),r>o?!1:(e.budgets[n]=o-r,!0)}function S(e){return"number"==typeof e||"object"==typeof e&&"number"==typeof e.line&&"number"==typeof e.ch}function _(e){if(e.query){if("string"!=typeof e.query.type)return".query.type must be a string";if(e.query.start&&!S(e.query.start))return".query.start must be a position";if(e.query.end&&!S(e.query.end))return".query.end must be a position"}if(e.files){if(!Array.isArray(e.files))return"Files property must be an array";for(var t=0;ts;){if(++s,o=n.indexOf("\n",o)+1,0===o)return null;s%K===0&&r.push(o)}return o}function j(e,t){if(!e)return{line:0,ch:0};for(var n,r,o=e.lineOffsets||(e.lineOffsets=[0]),s=e.text,a=o.length-1;a>=0;--a)o[a]<=t&&(n=a*K,r=o[a]);for(;;){var i=s.indexOf("\n",r);if(i>=t||0>i)break;r=i+1,++n}return{line:n,ch:t-r}}function E(e){for(var t in e)null==e[t]&&delete e[t];return e}function T(e,t,n){null!=n&&(e[t]=n)}function k(e,t){"string"!=typeof e&&(e=e.name,t=t.name);var n=/^[A-Z]/.test(e),r=/^[A-Z]/.test(t);return n==r?t>e?-1:e==t?0:1:n?1:-1}function O(e,t,n){return"Literal"==e.type&&"string"==typeof e.value&&e.start==t-1&&e.end<=n+1}function D(e,t){for(var n=0;n=t)return r}}function R(e,n,o){function s(r,o,s,a){if((!w&&n.omitObjectPrototype===!1||o!=e.cx.protos.Object||d)&&!(n.filter!==!1&&d&&0!==(n.caseInsensitive?r.toLowerCase():r).indexOf(d)||u&&u.props[r])){for(var i=0;i=2&&n.guess!==!1)for(var g in e.cx.props)s(g,e.cx.props[g][0],0);f="memberCompletion"}else t.forAllLocalsAt(o.ast,l,o.scope,s),n.includeKeywords&&Z.forEach(function(e){s(e,null,0,function(e){e.isKeyword=!0})}),f="variableCompletion";return n.sort!==!1&&h.sort(k),e.cx.completingProperty=null,{start:Q(n,o,l),end:Q(n,o,c),isProperty:!!g,isObjectKey:!!y,completions:h}}function A(e,t){var n=t.prefix,r=[];for(var o in e.cx.props)""==o||n&&0!==o.indexOf(n)||r.push(o);return t.sort!==!1&&r.sort(k),{completions:r}}function M(e,t,n){var r=et(e,t,n);if(r)return r;throw m("No expression at the given position.")}function C(e){return e&&(e=e.getType())&&e instanceof t.Obj?e:null}function P(e,n,r,o){var s;if(o&&(t.resetGuessing(),s=t.expressionType(o)),e.passes.typeAt){var a=Y(r,n.end);e.passes.typeAt.forEach(function(e){s=e(r,a,o,s)})}if(!s)throw m("No type found at the given position.");var i;if("ObjectExpression"==o.node.type&&null!=n.end&&(i=D(o.node,Y(r,n.end)))){var l=i.key.name,c=C(t.typeFromContext(r.ast,o));if(c&&c.hasProp(l))s=c.hasProp(l);else{var p=C(s);p&&p.hasProp(l)&&(s=p.hasProp(l))}}return s}function I(e,n,r){var o,s=et(r,n),a=P(e,n,r,s),i=a;if(a=n.preferFunction?a.getFunctionType()||a.getType():a.getType(),s&&("Identifier"==s.node.type?o=s.node.name:"MemberExpression"!=s.node.type||s.node.computed||(o=s.node.property.name)),null!=n.depth&&"number"!=typeof n.depth)throw m(".query.depth must be a number");var l={guess:t.didGuess(),type:t.toString(i,n.depth),name:a&&a.name,exprName:o};return a&&L(n,a,l),!l.doc&&i.doc&&(l.doc=z(n,i.doc)),E(l)}function z(e,t){if(!t)return null;if("full"==e.docFormat)return t;var n=/.\n[\s@\n]/.exec(t);if(n&&(t=t.slice(0,n.index+1)),t=t.replace(/\n\s*/g," "),t.length<100)return t;var r=/[\.!?] [A-Z]/g;r.lastIndex=80;var o=r.exec(t);return o&&(t=t.slice(0,o.index+1)),t}function N(e,n,r){var o=et(r,n),s=P(e,n,r,o),a={url:s.url,doc:z(n,s.doc),type:t.toString(s)},i=s.getType();return i&&L(n,i,a),E(a)}function L(e,n,r){r.url||(r.url=n.url),r.doc||(r.doc=z(e,n.doc)),r.origin||(r.origin=n.origin);var o,s=t.cx().protos;!r.url&&!r.doc&&n.proto&&(o=n.proto.hasCtor)&&n.proto!=s.Object&&n.proto!=s.Function&&n.proto!=s.Array&&(r.url=o.url,r.doc=z(e,o.doc))}function F(e,n,r){var o=et(r,n),s=P(e,n,r,o);if(t.didGuess()&&!n.guess)return{};var a=U(s,e,n);if(t.didGuess()&&s.potentialMatches){for(var i=[],l=0;l=0;--a){var i=e.types[a];L(r,i,s),o||(o=tt(i))}if(o&&o.node){var l=o.node.sourceFile||n.findFile(o.origin),c=Q(r,l,o.node.start),p=Q(r,l,o.node.end);s.start=c,s.end=p,s.file=o.origin;var u=Math.max(0,o.node.start-50);s.contextOffset=o.node.start-u,s.context=l.text.slice(u,u+50)}else o&&(s.file=o.origin,nt(n,r,o,s));return E(s)}function q(e,n,r,o,s){function a(e){return function(t,r){if(s)for(var o=r;o!=l;o=o.prev){var a=o.hasProp(s);if(a)throw m("Renaming `"+i+"` to `"+s+"` would make a variable at line "+(j(e,t.start).line+1)+" point to the definition at line "+(j(e,a.name.start).line+1))}p.push({file:e.name,start:Q(n,e,t.start),end:Q(n,e,t.end)})}}for(var i=o.node.name,l=o.state;l&&!(i in l.props);l=l.prev);if(!l)throw m("Could not find a definition for "+i+" "+!!e.cx.topScope.props.x);var c,p=[];if(l.originNode){if(c="local",s){for(var u=l.prev;u&&!(s in u.props);u=u.prev);u&&t.findRefs(l.originNode,l,s,u,function(e){throw m("Renaming `"+i+"` to `"+s+"` would shadow the definition used at line "+(j(r,e.start).line+1))})}t.findRefs(l.originNode,l,i,l,a(r))}else{c="global";for(var d=0;d=s)return G(e,t,r,i)}throw m("Not at a variable or property name.")}function B(e,t,n){if("string"!=typeof t.newName)throw m(".query.newName should be a string");var r=M(n,t);if(!r||"Identifier"!=r.node.type)throw m("Not at a variable.");var o=q(e,t,n,r,t.newName),s=o.refs;delete o.refs,o.files=e.files.map(function(e){return e.name});for(var a=o.changes=[],i=0;i4e4&&(r.reset(),u(r,null,function(){}))})},findFile:function(e){return this.fileMap[e]},flush:function(e){var n=this.cx;u(this,null,function(r){return r?e(r):void t.withContext(n,e)})},startAsyncAction:function(){++this.pending},finishAsyncAction:function(e){e&&(this.asyncError=e),this.pending>0&&this.pending--,0===this.pending&&this.signal("everythingFetched")}});var K=25,Y=e.resolvePos=function(e,t,n){if("number"!=typeof t){var r=x(e,t.line);if(null==r){if(!n)throw m("File doesn't contain a line "+t.line);t=e.text.length}else t=r+t.ch}if(t>e.text.length){if(!n)throw m("Position "+t+" is outside of file.");t=e.text.length}return t},Q=e.outputPos=function(e,t,n){if(e.lineCharPositions){var r=j(t,n);return"part"==t.type&&(r.line+=null!=t.offsetLines?t.offsetLines:j(t.backing,t.offset).line),r}return n+("part"==t.type?t.offset:0)},Z="break do instanceof typeof case else new var catch finally return void continue for switch while debugger function this with default if throw delete in try".split(" "),et=e.findQueryExpr=function(e,n,r){if(null==n.end)throw m("missing .query.end field");if(n.variable){var o=t.scopeAt(e.ast,Y(e,n.end),e.scope);return{node:{type:"Identifier",name:n.variable,start:n.end,end:n.end+1},state:o}}var s=n.start&&Y(e,n.start),a=Y(e,n.end),i=t.findExpressionAt(e.ast,s,a,e.scope);return i?i:(i=t.findExpressionAround(e.ast,s,a,e.scope),i&&("ObjectExpression"==i.node.type||r||(null==s?a:s)-i.node.start<20||i.node.end-a<20)?i:null)},tt=e.getSpan=function(e){if(e.origin){if(e.originNode){var t=e.originNode;return/^Function/.test(t.type)&&t.id&&(t=t.id),{origin:e.origin,node:t}}return e.span?{origin:e.origin,span:e.span}:void 0}},nt=e.storeSpan=function(e,t,n,r){if(r.origin=n.origin,n.span){var o=/^(\d+)\[(\d+):(\d+)\]-(\d+)\[(\d+):(\d+)\]$/.exec(n.span);r.start=t.lineCharPositions?{line:Number(o[2]),ch:Number(o[3])}:Number(o[1]),r.end=t.lineCharPositions?{line:Number(o[5]),ch:Number(o[6])}:Number(o[4])}else{var s=e.findFile(n.origin);r.start=Q(t,s,n.node.start),r.end=Q(t,s,n.node.end)}};e.version="0.12.0",e.findDef=F,e.findExpr=et,e.findExprType=P,e.resolveFile=g,e.storeTypeDocs=L,e.parseDoc=z}),function(){"use strict";function e(e,t,n,r,o,s){t[e]&&(n.push(e),(t[e]===!0||1===t[e])&&r.push(o+e+"/"+s))}function t(e,t,n,r,o){var s=r+t+"/"+o;require._fileExists(e.toUrl(s+".js"))&&n.push(s)}function n(e,t,r){var o;for(o in t)!t.hasOwnProperty(o)||e.hasOwnProperty(o)&&!r?"object"==typeof t[o]&&(!e[o]&&t[o]&&(e[o]={}),n(e[o],t[o],r)):e[o]=t[o]}var r=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(o){var s=o.config?o.config():{};return s=s||{},{version:"2.0.4",load:function(o,a,i,l){l=l||{},l.locale&&(s.locale=l.locale);var c,p,u,d=r.exec(o),h=d[1],f=d[4],m=d[5],g=f.split("-"),b=[],y={},v="";if(d[5]?(h=d[1],c=h+m):(c=o,m=d[4],f=s.locale,f||(f=s.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),g=f.split("-")),l.isBuild){for(b.push(c),t(a,"root",b,h,m),p=0;p-1&&o[e];e--)s=o[e],r=t[s],(r===!0||1===r)&&(r=a(h+s+"/"+m)),n(y,r);i(y)})})}}})}(),define("javascript/nls/messages",{root:!0}),define("javascript/nls/root/messages",{pluginName:"Orion JavaScript Tool Support",pluginDescription:"This plug-in provides JavaScript tools support for Orion, like editing, search, navigation, validation, and code completion.",error:"Error",warning:"Warning",ignore:"Ignore",ternContentAssist:"Tern JavaScript content assist",ternProjectAssist:"Tern project file content assist",emptyFileTemplateDoc:"Create new default contents for the .tern-project file",prefCodeStyle:"Code Style",prefBestPractices:"Best Practices",prefPotentialProblems:"Potential Programming Problems",sourceOutline:"Source Outline",sourceOutlineTitle:"JavaScript source outline",contentAssist:"JavaScript content assist",eslintValidator:"JavaScript Validator",missingCurly:"Statements not enclosed in braces:",curlyFixName:"Enclose statement in braces",noCaller:"Discouraged 'arguments.caller' or 'arguments.callee' use:",noCommaDangle:"Trailing commas in object expressions:",noCondAssign:"Assignments in conditional expressions:",noConsole:"Discouraged console use in browser code:",noConstantCondition:"Constant as conditional expression:",noRegexSpaces:"Multiple spaces in regular expressions:",noReservedKeys:"Reserved words used as property keys:",noReservedKeysFixName:"Surround key with quotes",noEqeqeq:"Discouraged '==' use:",noDebugger:"Discouraged 'debugger' statement use:",noDebuggerFixName:"Remove statement",noWith:"Discouraged 'with' statement use:",noEval:"Discouraged 'eval()' use:",noImpliedEval:"Discouraged implied 'eval()' use:",noDupeKeys:"Duplicate object keys:",noDupeKeysFixName:"Rename key",noDuplicateCaseFixName:"Rename case",noIterator:"Discouraged __iterator__ property use:",noProto:"Discouraged __proto__ property use:",noUndefInit:"Explicitly initializing variables to undefined:",noundefinitFixName:"Remove assignment",useIsNaN:"NaN not compared with isNaN():",useIsNanFixName:"Use isNaN()",missingDoc:"Missing JSDoc:",missingDocFixName:"Generate element JSDoc",noUnreachable:"Unreachable code:",noFallthrough:"Switch case fall-through:",useBeforeDefine:"Member used before definition:",noEmptyBlock:"Undocumented empty block:",newParens:"Missing parentheses in constructor call:",newparensFixName:"Add parentheses",noNewArray:"Discouraged 'new Array()':",noNewArrayFixName:"Convert to array literal",noNewFunc:"Discouraged 'new Function()':",noNewObject:"Discouraged 'new Object()':",noNewWrappers:"Discouraged wrapper objects:",noNewWrappersLiteralFixName:"Convert to literal",noNewWrappersFixName:"Remove 'new' keyword",noMixedSpacesAndTabs:"Mixed spaces and tabs:",missingSemi:"Missing semicolons:",unusedVars:"Unused variables:",varRedecl:"Variable re-declarations:",varShadow:"Variable shadowing:",undefMember:"Undeclared global reference:",unnecessarySemis:"Unnecessary semicolons:",unusedParams:"Unused parameters:",unsupportedJSLint:"Unsupported environment directive:",noThrowLiteral:"Literal used in 'throw':",noselfassignFixName:"Remove assignment",noselfassignRenameFixName:"Rename right hand variable",missingNls:"Non-externalized string literals (missing $NON-NLS$ tag):",unnecessaryNls:"Unnecessary $NON-NLS$ tags:",generateDocName:"Generate Element Comment",generateDocTooltip:"Generate a JSDoc-like comment for the selected JavaScript element",renameElement:"Rename Element",renameElementTooltip:"Rename the selected JavaScript element",renameFailedTimedOut:"Could not rename element - operation timed out",openDeclName:"Open Declaration",openDeclTooltip:"Open the declaration of the selected element",openImplName:"Open Implementation",openImplTooltip:"Open the implementation of the selected element",noImplFound:"No implementation was found",implTimedOut:"Could not compute implementation, the operation timed out",workspaceRefsName:"Workspace",workspaceRefsTooltip:"Show all references to the selection in the workspace",projectRefsName:"Project",projectRefsTooltip:"Show all references to the selection in the current project",referencesMenuName:"References",referencesMenuTooltip:"Show different kinds of references",noDeclTimedOut:"No declaration was found - operation timed out",validTypeof:"Invalid 'typeof' comparison:",noSparseArrays:"Sparse array declarations:",javascriptValidation:"Javascript Validation",jsHover:"JavaScript Hover Provider",removeExtraSemiFixName:"Remove extra semicolon",addFallthroughCommentFixName:"Add $FALLTHROUGH$ comment",addEmptyCommentFixName:"Comment empty block",addESLintEnvFixName:"Add to eslint-env directive",addESLintGlobalFixName:"Add to globals directive",removeUnusedParamsFixName:"Remove parameter",commentCallbackFixName:"Add @callback to function",eqeqeqFixName:"Update operator",unreachableFixName:"Remove unreachable code",sparseArrayFixName:"Convert to normal array",semiFixName:"Add missing ';'",radix:"Missing radix parameter to parseInt():",radixFixName:"Add default radix",unusedVarsUnusedFixName:"Remove unused variable",unusedFuncDeclFixName:"Remove unused function",noCommaDangleFixName:"Remove extra ','",addBBreakFixName:"Add break statement",noShadowGlobals:"Global shadowing:",noThrowLiteralFixName:"Change to Error",missingNlsFixName:"Add missing $NON-NLS$ tag",unnecessaryNlsFixName:"Remove unnecessary $NON-NLS$ tag",funcProposalDescription:" - The name of the function",funcParamProposalDescription:" - Function parameter",eslintRuleProposalDescripton:" - ESLint rule",eslintEnvProposalDescription:" - ESLint environment name",onlineDocumentationProposalEntry:"\n\n[Online documentation](${0})",keywordProposalDescription:" - Keyword",keywordHoverProposal:"ECMAScript reserved keyword",reloadPluginCmd:"Reload",reloadPluginCmdTooltip:"Reload plug-in",reloadAllPluginsCmd:"Reload All",reloadAllPluginsCmdTooltip:"Reload all plug-ins",templateHoverHeader:"Template source code:\n\n",templateAssistHeader:"Templates",keywordAssistHeader:"Keywords",ternPlugins:"Tern Plug-ins",noTernPluginsAvailable:"No Tern plug-ins are currently loaded. This may be because you have not yet activated content assist in a JavaScript file. Tern plug-ins provide type information and code templates for JavaScript.",noDeclFound:"Could not find declaration",deprecatedHoverTitle:"Deprecated.",parametersHoverTitle:"Parameters:",returnsHoverTitle:"Returns:",throwsHoverTitle:"Throws:",callbackHoverTitle:"Callback:",callbackText:"This function is used as a callback",sinceHoverTitle:"Since:",seeAlsoHoverTitle:"See Also:",openFileForTitle:"Open file for",failedToReadFile:"Failed to read file: ${0}",badInlineRename:"In-line rename is only available for local variables and declarations.",failedRename:"In-line rename failed: ${0}",declDisplayName:"${0} (start: ${1}, end: ${2})",declPotentialHeader:"**Potential matches:**\n",typeofOptions:"Typeof Options",functionDecls:"Function Declarations",functionCalls:"Function Calls",propAccess:"Property Access",propWrite:"Property Write",varAccess:"Variable Access",varWrite:"Variable Write",varDecls:"Variable Declarations",regex:"Regular Expressions",strings:"Strings",blockComments:"Block Comments",lineComments:"Line Comments",partial:"Partial Matches",uncategorized:"Uncategorized",parseErrors:"Parse Errors",noFileContents:"Could not compute references: failed to compute file text content",noFileMeta:"Could not compute references: failed to compute file metadata",cannotComputeRefs:"Cannot compute references: ${0}",notAnIdentifier:"Cannot compute references at the selected location: Location is not an identifier",notHtmlOffset:"Not a valid offset in HTML",allProjectRefs:"Finding all project references...",allWorkspaceRefs:"Finding all workspace references...",refsFoundIn:"References found in file: '${0}' (${1}/${2})",addToTernCommand:"Add to .tern-project",addToTernCommandTooltip:"The JavaScript tooling will always load the contents of this file to Tern","accessor-pairs":"Getter and setter accessors not in pairs:","no-control-regex":"Disallow control characters in regular expressions:","no-duplicate-case":"Duplicate case:","no-empty-character-class":"Disallow empty character classes:","no-extra-boolean-cast":"Discourage redundant double negation:","no-extra-parens":"Discourage redundant parentheses:","no-invalid-regexp":"Invalid regular expressions:","no-negated-in-lhs":"Disallow negated left operand of in operator:","no-obj-calls":"Disallow global object as function calls:","no-eq-null":"Disallow null comparisons:",noeqnullFixName:"Update operator","no-else-return":"Unnecessary else after return:","no-empty-label":"No empty labels:","no-self-compare":"Disallow self compare:","no-irregular-whitespace":"Disallow irregular whitespace:","no-self-assign":"Disallow self assignment:",noShadowFixName:"Rename in scope","type-checked-consistent-return":"Discouraged inconsistent returns:",ternDocPluginName:"Doc Comments",ternDocPluginDescription:"Tern plug-in to parse and use JSDoc-like comments for inferencing",orionAMQPPluginName:"Orion AMQP",orionAMQPPluginDescription:"Plug-in that contributes type information and code templates for AMQP.",orionAngularPluginName:"AngularJS",orionAngularPluginDescription:"Plug-in that contributes type information and code templates for AngularJS.",orionComponentPluginName:"ComponentJS",orionComponentPluginDescription:"Plug-in that contributes type information and code templates for ComponentJS.",orionExpressPluginName:"Orion ExpressJS",orionExpressPluginDescription:"Plug-in that contributes type information and code templates for ExpressJS.",orionMongoDBPluginName:"Orion MongoDB",orionMongoDBPluginDescription:"Plug-in that contributes type information and code templates for MongoDB.",orionMySQLPluginName:"Orion MySQL",orionMySQLPluginDescription:"Plug-in that contributes type information and code templates for MySQL.",orionNodePluginName:"Orion Node.js",orionNodePluginDescription:"Plug-in that contributes type information and code templates for Node.js.",orionPostgresPluginName:"Orion PostgreSQL",orionPostgresPluginDescription:"Plug-in that contributes type information and code templates for PostgreSQL.",orionRequirePluginName:"Orion RequireJS",orionRequirePluginDescription:"Plug-in that contributes type information and code templates for RequireJS.",orionRedisPluginName:"Orion Redis",orionRedisPluginDescription:"Plug-in that contributes type information and code templates for Redis.",ternPluginsPluginName:"Orion Tern Plug-in Support",ternPluginsPluginDescription:"Plug-in that allows Orion to inspect and modify plug-ins running in Tern.",openImplPluginName:"Orion Open Implementation Support",openImplPluginDescription:"Plug-in that allows Orion to try to find implementation locations of elements rather than simple declarations",htmlDepPluginName:"Orion HTML Dependency Analysis",htmlDepPluginDescription:"Resolves script block and script tag dependencies",findTypesName:"Orion References Support",findTypesDescription:"Plug-in that provides expanded type-finding support in Orion",eslintPluginName:"ESLint plugin for Tern",eslintPluginDescription:"Provides ESLint linting for Tern",jsdocPluginName:"JSDoc types and completion support",jsdocPluginDescription:"Provides auto-complete and type information for JSDoc",outlinerPluginName:"JavaScript outlining",outlinerPluginDescription:"Provides JavaScript outlining",browser:"Browser global variables.",node:"Node.js global variables and Node.js scoping.",commonjs:"CommonJS global variables and CommonJS scoping (use this for browser-only code that uses Browserify/WebPack).",worker:"Web workers global variables.",amd:"Defines require() and define() as global variables as per the amd spec.",mocha:"Adds all of the Mocha testing global variables.",jasmine:"Adds all of the Jasmine testing global variables for version 1.3 and 2.0.",jest:"Jest global variables.",phantomjs:"PhantomJS global variables.",protractor:"Protractor global variables.",qunit:"QUnit global variables.",jquery:"jQuery global variables.",prototypejs:"Prototype.js global variables.",shelljs:"ShellJS global variables.",meteor:"Meteor global variables.",mongo:"MongoDB global variables.",applescript:"AppleScript global variables.",nashorn:"Java 8 Nashorn global variables.",serviceworker:"Service Worker global variables.",embertest:"Ember test helper globals.",webextensions:"WebExtensions globals.",es6:"Enable all ECMAScript 6 features except for modules.",unknownError:"An unknown error occurred.",failedDeleteRequest:"Failed to delete file from Tern: ${0}",failedReadRequest:"Failed to read file into Tern: ${0}",failedToComputeProposals:"Failed to compute proposals",failedToComputeProposalsNoServer:"Failed to compute proposals, server not started",failedToComputeDecl:"Failed to compute declaration",failedToComputeDeclNoServer:"Failed to compute declaration, server not started",failedToComputeImpl:"Failed to compute implementation",failedToComputeImplNoServer:"Failed to compute implementation, server not started",failedToComputeDoc:"Failed to compute documentation",failedToComputeDocNoServer:"Failed to compute documentation, server not started",failedToComputeOccurrences:"Failed to compute occurrences",failedToComputeOccurrencesNoServer:"failed to compute occurrences, server not started",failedGetInstalledPlugins:"Failed to get installed plug-ins",failedGetInstalledPluginsNoServer:"Failed to get installed plug-ins, server not started",failedGetInstalledDefs:"Failed to get installed Tern definitions",failedGetInstalledDefsNoServer:"Failed to get installed Tern definitions, server not started",failedInstallPlugins:"Failed to install plug-ins",failedInstallPluginsNoServer:"Failed to install plug-ins, server not started",failedRemovePlugins:"Failed to remove plug-ins",failedRemovePluginsNoServer:"Failed to remove plug-ins, server not started",failedEnablementPlugins:"Failed to set enablement of plug-ins",failedEnablementPluginsNoServer:"Failed to set enablement of plug-ins, server not started",failedGetEnvs:"Failed to get contributed environments",failedGetEnvsNoServer:"Failed to get contributed environments, server not started",failedRenameTern:"Failed to compute rename changes",failedRenameNoServer:"Failed to compute rename changes, server not started",failedRefs:"Failed to find references",failedRefsNoServer:"failed to find references - server not started",failedType:"Failed to find type",unknownRequest:"The request '${0}' is unknown",serverNotStarted:"The server has not been started. Request: '${0}'",eslintRuleEnableDisable:"Enable or disable ESLint rule using the ```ruleid:0/1/2``` form.\n\nExample use:\n\n>```/* eslint semi:1, no-console:0, no-redeclare:2 */```",eslintEnvDirective:"Specify which environments are used in this JavaScript file.\n\nExample use:\n\n>```/* eslint-env amd, node, broswer */```",eslintRuleEnable:"Enable a given set of ESLint rules.\n\nExample use:\n\n>```/* eslint-enable semi, no-console, no-redeclare */```",eslintRuleDisable:"Disable a given set of ESLint rules.\n\nExample use:\n\n>```/* eslint-disable semi, no-console, no-redeclare */```",failedToComputeProblems:"Failed to compute ESLint problems/markers",failedToComputeOutline:"Failed to compute outline"}),define("requirejs/text",["module"],function(e){"use strict"; -var t,n,r,o,s,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,p=c&&location.protocol&&location.protocol.replace(/\:/,""),u=c&&location.hostname,d=c&&(location.port||void 0),h={},f=e.config&&e.config()||{};return t={version:"2.0.12",strip:function(e){if(e){e=e.replace(i,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;3>t;t+=1){n=a[t];try{e=new ActiveXObject(n)}catch(r){}if(e){a=[n];break}}return e},parseName:function(e){var t,n,r,o=!1,s=e.indexOf("."),a=0===e.indexOf("./")||0===e.indexOf("../");return-1!==s&&(!a||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),-1!==s&&(o="strip"===r.substring(s+1),r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:o}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,o){var s,a,i,l=t.xdRegExp.exec(e);return l?(s=l[2],a=l[3],a=a.split(":"),i=a[1],a=a[0],!(s&&s!==n||a&&a.toLowerCase()!==r.toLowerCase()||(i||a)&&i!==o)):!0},finishLoad:function(e,n,r,o){r=n?t.strip(r):r,f.isBuild&&(h[e]=r),o(r)},load:function(e,n,r,o){if(o&&o.isBuild&&!o.inlineText)return void r();f.isBuild=o&&o.isBuild;var s=t.parseName(e),a=s.moduleName+(s.ext?"."+s.ext:""),i=n.toUrl(a),l=f.useXhr||t.useXhr;return 0===i.indexOf("empty:")?void r():void(!c||l(i,p,u,d)?t.get(i,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([a],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)}))},write:function(e,n,r){if(h.hasOwnProperty(n)){var o=t.jsEscape(h[n]);r.asModule(e+"!"+n,"define(function () { return '"+o+"';});\n")}},writeFile:function(e,n,r,o,s){var a=t.parseName(n),i=a.ext?"."+a.ext:"",l=a.moduleName+i,c=r.toUrl(a.moduleName+i)+".js";t.load(l,r,function(){var n=function(e){return o(c,e)};n.asModule=function(e,t){return o.asModule(e,c,t)},t.write(e,l,n,s)},s)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var o=n.readFileSync(e,"utf8");0===o.indexOf("")&&(o=o.substring(1)),t(o)}catch(s){r&&r(s)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,n,r,o){var s,a=t.createXhr();if(a.open("GET",e,!0),o)for(s in o)o.hasOwnProperty(s)&&a.setRequestHeader(s.toLowerCase(),o[s]);f.onXhr&&f.onXhr(a,e),a.onreadystatechange=function(){var t,o;4===a.readyState&&(t=a.status||0,t>399&&600>t?(o=new Error(e+" HTTP status: "+t),o.xhr=a,r&&r(o)):n(a.responseText),f.onXhrComplete&&f.onXhrComplete(a,e))},a.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var n,r,o="utf-8",s=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),i=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),o)),l="";try{for(n=new java.lang.StringBuffer,r=i.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=i.readLine());)n.append(a),n.append(r);l=String(n.toString())}finally{i.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,o=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,a,i,l={};s&&(e=e.replace(/\//g,"\\")),i=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(o.nsIFileInputStream),n.init(i,1,0,!1),a=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),a.init(n,"utf-8",n.available(),o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),a.readString(n.available(),l),a.close(),n.close(),t(l.value)}catch(c){throw new Error((i&&i.path||"")+": "+c)}}),t}),define("json",["requirejs/text"],function(e){var t=Object.create(null);return{load:function(n,r,o,s){e.get(r.toUrl(n),function(e){if(s.isBuild)t[n]=e,o(e);else{try{var r=JSON.parse(e)}catch(a){o.error(a)}o(r)}},o.error,{accept:"application/json"})},write:function(e,n,r){var o=t[n];o&&r('define("'+e+"!"+n+'", function(){ return '+o+";});\n")}}}),define("json!tern/defs/ecma5.json",function(){return{"!name":"ecma5","!define":{"Error.prototype":"Error.prototype"},Infinity:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Infinity","!doc":"A numeric value representing infinity."},undefined:{"!type":"?","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/undefined","!doc":"The value undefined."},NaN:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/NaN","!doc":"A value representing Not-A-Number."},Object:{"!type":"fn()",getPrototypeOf:{"!type":"fn(obj: ?) -> ?","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getPrototypeOf","!doc":"Returns the prototype (i.e. the internal prototype) of the specified object."},create:{"!type":"fn(proto: ?) -> !custom:Object_create","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create","!doc":"Creates a new object with the specified prototype object and properties."},defineProperty:{"!type":"fn(obj: ?, prop: string, desc: ?) -> !custom:Object_defineProperty","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty","!doc":"Defines a new property directly on an object, or modifies an existing property on an object, and returns the object. If you want to see how to use the Object.defineProperty method with a binary-flags-like syntax, see this article."},defineProperties:{"!type":"fn(obj: ?, props: ?) -> !custom:Object_defineProperties","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty","!doc":"Defines a new property directly on an object, or modifies an existing property on an object, and returns the object. If you want to see how to use the Object.defineProperty method with a binary-flags-like syntax, see this article."},getOwnPropertyDescriptor:{"!type":"fn(obj: ?, prop: string) -> ?","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor","!doc":"Returns a property descriptor for an own property (that is, one directly present on an object, not present by dint of being along an object's prototype chain) of a given object."},keys:{"!type":"fn(obj: ?) -> [string]","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys","!doc":"Returns an array of a given object's own enumerable properties, in the same order as that provided by a for-in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well)."},getOwnPropertyNames:{"!type":"fn(obj: ?) -> [string]","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames","!doc":"Returns an array of all properties (enumerable or not) found directly upon a given object."},seal:{"!type":"fn(obj: ?)","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/seal","!doc":"Seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed as long as they are writable."},isSealed:{"!type":"fn(obj: ?) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/isSealed","!doc":"Determine if an object is sealed."},freeze:{"!type":"fn(obj: ?) -> !0","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/freeze","!doc":"Freezes an object: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. In essence the object is made effectively immutable. The method returns the object being frozen."},isFrozen:{"!type":"fn(obj: ?) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/isFrozen","!doc":"Determine if an object is frozen."},preventExtensions:{"!type":"fn(obj: ?)","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions","!doc":"Prevents new properties from ever being added to an object."},isExtensible:{"!type":"fn(obj: ?) -> bool","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible","!doc":"The Object.isExtensible() method determines if an object is extensible (whether it can have new properties added to it)."},prototype:{"!stdProto":"Object",toString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/toString","!doc":"Returns a string representing the object."},toLocaleString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/toLocaleString","!doc":"Returns a string representing the object. This method is meant to be overriden by derived objects for locale-specific purposes."},valueOf:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/valueOf","!doc":"Returns the primitive value of the specified object"},hasOwnProperty:{"!type":"fn(prop: string) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/hasOwnProperty","!doc":"Returns a boolean indicating whether the object has the specified property."},propertyIsEnumerable:{"!type":"fn(prop: string) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable","!doc":"Returns a Boolean indicating whether the specified property is enumerable."},isPrototypeOf:{"!type":"fn(obj: ?) -> bool","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf","!doc":"Tests for an object in another object's prototype chain."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object","!doc":"Creates an object wrapper."},Function:{"!type":"fn(body: string) -> fn()",prototype:{"!stdProto":"Function",apply:{"!type":"fn(this: ?, args: [?])","!effects":["call and return !this this=!0 !1. !1. !1."],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/apply","!doc":"Calls a function with a given this value and arguments provided as an array (or an array like object)."},call:{"!type":"fn(this: ?, args?: ?) -> !this.!ret","!effects":["call and return !this this=!0 !1 !2 !3 !4"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/call","!doc":"Calls a function with a given this value and arguments provided individually."},bind:{"!type":"fn(this: ?, args?: ?) -> !custom:Function_bind","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind","!doc":"Creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function was called."},prototype:"?"},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function","!doc":"Every function in JavaScript is actually a Function object."},Array:{"!type":"fn(size: number) -> !custom:Array_ctor",isArray:{"!type":"fn(value: ?) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/isArray","!doc":"Returns true if an object is an array, false if it is not."},prototype:{"!stdProto":"Array",length:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/length","!doc":"An unsigned, 32-bit integer that specifies the number of elements in an array."},concat:{"!type":"fn(other: [?]) -> !this","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/concat","!doc":"Returns a new array comprised of this array joined with other array(s) and/or value(s)."},join:{"!type":"fn(separator?: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/join","!doc":"Joins all elements of an array into a string."},splice:{"!type":"fn(pos: number, amount: number)","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/splice","!doc":"Changes the content of an array, adding new elements while removing old elements."},pop:{"!type":"fn() -> !this.","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/pop","!doc":"Removes the last element from an array and returns that element."},push:{"!type":"fn(newelt: ?) -> number","!effects":["propagate !0 !this."],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/push","!doc":"Mutates an array by appending the given elements and returning the new length of the array."},shift:{"!type":"fn() -> !this.","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/shift","!doc":"Removes the first element from an array and returns that element. This method changes the length of the array."},unshift:{"!type":"fn(newelt: ?) -> number","!effects":["propagate !0 !this."],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/unshift","!doc":"Adds one or more elements to the beginning of an array and returns the new length of the array."},slice:{"!type":"fn(from: number, to?: number) -> !this","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/slice","!doc":"Returns a shallow copy of a portion of an array."},reverse:{"!type":"fn()","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/reverse","!doc":"Reverses an array in place. The first array element becomes the last and the last becomes the first."},sort:{"!type":"fn(compare?: fn(a: ?, b: ?) -> number)","!effects":["call !0 !this. !this."],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort","!doc":"Sorts the elements of an array in place and returns the array."},indexOf:{"!type":"fn(elt: ?, from?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf","!doc":"Returns the first index at which a given element can be found in the array, or -1 if it is not present."},lastIndexOf:{"!type":"fn(elt: ?, from?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/lastIndexOf","!doc":"Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex."},every:{"!type":"fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> bool","!effects":["call !0 this=!1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/every","!doc":"Tests whether all elements in the array pass the test implemented by the provided function."},some:{"!type":"fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> bool","!effects":["call !0 this=!1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/some","!doc":"Tests whether some element in the array passes the test implemented by the provided function."},filter:{"!type":"fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> !this","!effects":["call !0 this=!1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter","!doc":"Creates a new array with all elements that pass the test implemented by the provided function."},forEach:{"!type":"fn(f: fn(elt: ?, i: number), context?: ?)","!effects":["call !0 this=!1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach","!doc":"Executes a provided function once per array element."},map:{"!type":"fn(f: fn(elt: ?, i: number) -> ?, context?: ?) -> [!0.!ret]","!effects":["call !0 this=!1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map","!doc":"Creates a new array with the results of calling a provided function on every element in this array."},reduce:{"!type":"fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret","!effects":["call !0 !1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce","!doc":"Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value."},reduceRight:{"!type":"fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret","!effects":["call !0 !1 !this. number"],"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/ReduceRight","!doc":"Apply a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array","!doc":"The JavaScript Array global object is a constructor for arrays, which are high-level, list-like objects."},String:{"!type":"fn(value: ?) -> string",fromCharCode:{"!type":"fn(code: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode","!doc":"Returns a string created by using the specified sequence of Unicode values."},prototype:{"!stdProto":"String",length:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/length","!doc":"Represents the length of a string."},"":"string",charAt:{"!type":"fn(i: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charAt","!doc":"Returns the specified character from a string."},charCodeAt:{"!type":"fn(i: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charCodeAt","!doc":"Returns the numeric Unicode value of the character at the given index (except for unicode codepoints > 0x10000)."},indexOf:{"!type":"fn(char: string, from?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf","!doc":"Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex,\nreturns -1 if the value is not found."},lastIndexOf:{"!type":"fn(char: string, from?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/lastIndexOf","!doc":"Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex."},substring:{"!type":"fn(from: number, to?: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/substring","!doc":"Returns a subset of a string between one index and another, or through the end of the string."},substr:{"!type":"fn(from: number, length?: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/substr","!doc":"Returns the characters in a string beginning at the specified location through the specified number of characters."},slice:{"!type":"fn(from: number, to?: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/slice","!doc":"Extracts a section of a string and returns a new string."},trim:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim","!doc":"Removes whitespace from both ends of the string."},toUpperCase:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toUpperCase","!doc":"Returns the calling string value converted to uppercase."},toLowerCase:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLowerCase","!doc":"Returns the calling string value converted to lowercase."},toLocaleUpperCase:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase","!doc":"Returns the calling string value converted to upper case, according to any locale-specific case mappings."},toLocaleLowerCase:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase","!doc":"Returns the calling string value converted to lower case, according to any locale-specific case mappings."},split:{"!type":"fn(pattern: string) -> [string]","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/split","!doc":"Splits a String object into an array of strings by separating the string into substrings."},concat:{"!type":"fn(other: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/concat","!doc":"Combines the text of two or more strings and returns a new string."},localeCompare:{"!type":"fn(other: string) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/localeCompare","!doc":"Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order."},match:{"!type":"fn(pattern: +RegExp) -> [string]","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/match","!doc":"Used to retrieve the matches when matching a string against a regular expression."},replace:{"!type":"fn(pattern: string|+RegExp, replacement: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/replace","!doc":"Returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match."},search:{"!type":"fn(pattern: +RegExp) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/search","!doc":"Executes the search for a match between a regular expression and this String object."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String","!doc":"The String global object is a constructor for strings, or a sequence of characters."},Number:{"!type":"fn(value: ?) -> number",MAX_VALUE:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/MAX_VALUE","!doc":"The maximum numeric value representable in JavaScript."},MIN_VALUE:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/MIN_VALUE","!doc":"The smallest positive numeric value representable in JavaScript."},POSITIVE_INFINITY:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY","!doc":"A value representing the positive Infinity value."},NEGATIVE_INFINITY:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY","!doc":"A value representing the negative Infinity value."},prototype:{"!stdProto":"Number",toString:{"!type":"fn(radix?: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toString","!doc":"Returns a string representing the specified Number object"},toFixed:{"!type":"fn(digits: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toFixed","!doc":"Formats a number using fixed-point notation"},toExponential:{"!type":"fn(digits: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toExponential","!doc":"Returns a string representing the Number object in exponential notation"},toPrecision:{"!type":"fn(digits: number) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toPrecision","!doc":"The toPrecision() method returns a string representing the number to the specified precision."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number","!doc":"The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor."},Boolean:{"!type":"fn(value: ?) -> bool",prototype:{"!stdProto":"Boolean"},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean","!doc":"The Boolean object is an object wrapper for a boolean value."},RegExp:{"!type":"fn(source: string, flags?: string)",prototype:{"!stdProto":"RegExp",exec:{"!type":"fn(input: string) -> [string]","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/exec","!doc":"Executes a search for a match in a specified string. Returns a result array, or null."},test:{"!type":"fn(input: string) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/test","!doc":"Executes the search for a match between a regular expression and a specified string. Returns true or false."},global:{"!type":"bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp","!doc":"Creates a regular expression object for matching text with a pattern."},ignoreCase:{"!type":"bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp","!doc":"Creates a regular expression object for matching text with a pattern."},multiline:{"!type":"bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/multiline","!doc":"Reflects whether or not to search in strings across multiple lines.\n"},source:{"!type":"string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/source","!doc":"A read-only property that contains the text of the pattern, excluding the forward slashes.\n"},lastIndex:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/lastIndex","!doc":"A read/write integer property that specifies the index at which to start the next match."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp","!doc":"Creates a regular expression object for matching text with a pattern."},Date:{"!type":"fn(ms: number)",parse:{"!type":"fn(source: string) -> +Date","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/parse","!doc":"Parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC."},UTC:{"!type":"fn(year: number, month: number, date: number, hour?: number, min?: number, sec?: number, ms?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/UTC","!doc":"Accepts the same parameters as the longest form of the constructor, and returns the number of milliseconds in a Date object since January 1, 1970, 00:00:00, universal time."},now:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now","!doc":"Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC."},prototype:{toUTCString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toUTCString","!doc":"Converts a date to a string, using the universal time convention."},toISOString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toISOString","!doc":"JavaScript provides a direct way to convert a date object into a string in ISO format, the ISO 8601 Extended Format."},toDateString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toDateString","!doc":"Returns the date portion of a Date object in human readable form in American English."},toTimeString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toTimeString","!doc":"Returns the time portion of a Date object in human readable form in American English."},toLocaleDateString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleDateString","!doc":"Converts a date to a string, returning the \"date\" portion using the operating system's locale's conventions.\n"},toLocaleTimeString:{"!type":"fn() -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString","!doc":'Converts a date to a string, returning the "time" portion using the current locale\'s conventions.'},getTime:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTime","!doc":"Returns the numeric value corresponding to the time for the specified date according to universal time."},getFullYear:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getFullYear","!doc":"Returns the year of the specified date according to local time."},getYear:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getYear","!doc":"Returns the year in the specified date according to local time."},getMonth:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMonth","!doc":"Returns the month in the specified date according to local time."},getUTCMonth:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCMonth","!doc":"Returns the month of the specified date according to universal time.\n"},getDate:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getDate","!doc":"Returns the day of the month for the specified date according to local time."},getUTCDate:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCDate","!doc":"Returns the day (date) of the month in the specified date according to universal time.\n"},getDay:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getDay","!doc":"Returns the day of the week for the specified date according to local time."},getUTCDay:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCDay","!doc":"Returns the day of the week in the specified date according to universal time.\n"},getHours:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getHours","!doc":"Returns the hour for the specified date according to local time."},getUTCHours:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCHours","!doc":"Returns the hours in the specified date according to universal time.\n"},getMinutes:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMinutes","!doc":"Returns the minutes in the specified date according to local time."},getUTCMinutes:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date","!doc":"Creates JavaScript Date instances which let you work with dates and times."},getSeconds:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getSeconds","!doc":"Returns the seconds in the specified date according to local time."},getUTCSeconds:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCSeconds","!doc":"Returns the seconds in the specified date according to universal time.\n"},getMilliseconds:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getMilliseconds","!doc":"Returns the milliseconds in the specified date according to local time."},getUTCMilliseconds:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds","!doc":"Returns the milliseconds in the specified date according to universal time.\n"},getTimezoneOffset:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset","!doc":"Returns the time-zone offset from UTC, in minutes, for the current locale."},setTime:{"!type":"fn(date: +Date) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setTime","!doc":"Sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC.\n"},setFullYear:{"!type":"fn(year: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setFullYear","!doc":"Sets the full year for a specified date according to local time.\n"},setUTCFullYear:{"!type":"fn(year: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCFullYear","!doc":"Sets the full year for a specified date according to universal time.\n"},setMonth:{"!type":"fn(month: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMonth","!doc":"Set the month for a specified date according to local time."},setUTCMonth:{"!type":"fn(month: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMonth","!doc":"Sets the month for a specified date according to universal time.\n"},setDate:{"!type":"fn(day: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setDate","!doc":"Sets the day of the month for a specified date according to local time."},setUTCDate:{"!type":"fn(day: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCDate","!doc":"Sets the day of the month for a specified date according to universal time.\n"},setHours:{"!type":"fn(hour: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setHours","!doc":"Sets the hours for a specified date according to local time, and returns the number of milliseconds since 1 January 1970 00:00:00 UTC until the time represented by the updated Date instance."},setUTCHours:{"!type":"fn(hour: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCHours","!doc":"Sets the hour for a specified date according to universal time.\n"},setMinutes:{"!type":"fn(min: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMinutes","!doc":"Sets the minutes for a specified date according to local time."},setUTCMinutes:{"!type":"fn(min: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMinutes","!doc":"Sets the minutes for a specified date according to universal time.\n"},setSeconds:{"!type":"fn(sec: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setSeconds","!doc":"Sets the seconds for a specified date according to local time."},setUTCSeconds:{"!type":"fn(sec: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCSeconds","!doc":"Sets the seconds for a specified date according to universal time.\n"},setMilliseconds:{"!type":"fn(ms: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setMilliseconds","!doc":"Sets the milliseconds for a specified date according to local time.\n"},setUTCMilliseconds:{"!type":"fn(ms: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/setUTCMilliseconds","!doc":"Sets the milliseconds for a specified date according to universal time.\n"}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date","!doc":"Creates JavaScript Date instances which let you work with dates and times."},Error:{"!type":"fn(message: string)",prototype:{name:{"!type":"string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error/name","!doc":"A name for the type of error."},message:{"!type":"string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error/message","!doc":"A human-readable description of the error."}},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error","!doc":"Creates an error object."},SyntaxError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/SyntaxError","!doc":"Represents an error when trying to interpret syntactically invalid code."},ReferenceError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/ReferenceError","!doc":"Represents an error when a non-existent variable is referenced."},URIError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/URIError","!doc":"Represents an error when a malformed URI is encountered."},EvalError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/EvalError","!doc":"Represents an error regarding the eval function."},RangeError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RangeError","!doc":"Represents an error when a number is not within the correct range allowed."},TypeError:{"!type":"fn(message: string)",prototype:"Error.prototype","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/TypeError","!doc":"Represents an error an error when a value is not of the expected type."},parseInt:{"!type":"fn(string: string, radix?: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt","!doc":"Parses a string argument and returns an integer of the specified radix or base."},parseFloat:{"!type":"fn(string: string) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseFloat","!doc":"Parses a string argument and returns a floating point number."},isNaN:{"!type":"fn(value: number) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/isNaN","!doc":"Determines whether a value is NaN or not. Be careful, this function is broken. You may be interested in ECMAScript 6 Number.isNaN."},isFinite:{"!type":"fn(value: number) -> bool","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/isFinite","!doc":"Determines whether the passed value is a finite number."},eval:{"!type":"fn(code: string) -> ?","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/eval","!doc":"Evaluates JavaScript code represented as a string."},encodeURI:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI","!doc":'Encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).'},encodeURIComponent:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent","!doc":'Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).'},decodeURI:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURI","!doc":"Decodes a Uniform Resource Identifier (URI) previously created by encodeURI or by a similar routine."},decodeURIComponent:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURIComponent","!doc":"Decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent or by a similar routine."},Math:{E:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/E","!doc":"The base of natural logarithms, e, approximately 2.718."},LN2:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LN2","!doc":"The natural logarithm of 2, approximately 0.693."},LN10:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LN10","!doc":"The natural logarithm of 10, approximately 2.302."},LOG2E:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LOG2E","!doc":"The base 2 logarithm of E (approximately 1.442)."},LOG10E:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/LOG10E","!doc":"The base 10 logarithm of E (approximately 0.434)."},SQRT1_2:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/SQRT1_2","!doc":"The square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707."},SQRT2:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/SQRT2","!doc":"The square root of 2, approximately 1.414."},PI:{"!type":"number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/PI","!doc":"The ratio of the circumference of a circle to its diameter, approximately 3.14159."},abs:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/abs","!doc":"Returns the absolute value of a number."},cos:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/cos","!doc":"Returns the cosine of a number."},sin:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/sin","!doc":"Returns the sine of a number."},tan:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/tan","!doc":"Returns the tangent of a number."},acos:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/acos","!doc":"Returns the arccosine (in radians) of a number."},asin:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/asin","!doc":"Returns the arcsine (in radians) of a number."},atan:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/atan","!doc":"Returns the arctangent (in radians) of a number."},atan2:{"!type":"fn(y: number, x: number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/atan2","!doc":"Returns the arctangent of the quotient of its arguments."},ceil:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/ceil","!doc":"Returns the smallest integer greater than or equal to a number."},floor:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/floor","!doc":"Returns the largest integer less than or equal to a number."},round:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/round","!doc":"Returns the value of a number rounded to the nearest integer."},exp:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/exp","!doc":"Returns Ex, where x is the argument, and E is Euler's constant, the base of the natural logarithms."},log:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/log","!doc":"Returns the natural logarithm (base E) of a number."},sqrt:{"!type":"fn(number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/sqrt","!doc":"Returns the square root of a number."},pow:{"!type":"fn(number, number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/pow","!doc":"Returns base to the exponent power, that is, baseexponent."},max:{"!type":"fn(number, number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/max","!doc":"Returns the largest of zero or more numbers."},min:{"!type":"fn(number, number) -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/min","!doc":"Returns the smallest of zero or more numbers."},random:{"!type":"fn() -> number","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random","!doc":"Returns a floating-point, pseudo-random number in the range [0, 1) that is, from 0 (inclusive) up to but not including 1 (exclusive), which you can then scale to your desired range."},"!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math","!doc":"A built-in object that has properties and methods for mathematical constants and functions."},JSON:{parse:{"!type":"fn(json: string) -> ?","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/parse","!doc":"Parse a string as JSON, optionally transforming the value produced by parsing."},stringify:{"!type":"fn(value: ?) -> string","!url":"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify","!doc":"Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified."},"!url":"https://developer.mozilla.org/en-US/docs/JSON","!doc":"JSON (JavaScript Object Notation) is a data-interchange format. It closely resembles a subset of JavaScript syntax, although it is not a strict subset. (See JSON in the JavaScript Reference for full details.) It is useful when writing any kind of JavaScript-based application, including websites and browser extensions. For example, you might store user information in JSON format in a cookie, or you might store extension preferences in JSON in a string-valued browser preference."}} -}),define("json!tern/defs/ecma6.json",function(){return{"!name":"ecma6","!define":{"Promise.prototype":{"catch":{"!doc":"The catch() method returns a Promise and deals with rejected cases only. It behaves the same as calling Promise.prototype.then(undefined, onRejected).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch","!type":"fn(onRejected: fn(reason: ?))"},then:{"!doc":"The then() method returns a Promise. It takes two arguments, both are callback functions for the success and failure cases of the Promise.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then","!type":"fn(onFulfilled: fn(value: ?), onRejected: fn(reason: ?))","!effects":["call !0 !this.value"]}},promiseReject:{"!type":"fn(reason: ?)"}},Array:{from:{"!type":"fn(arrayLike: [], mapFn?: fn(), thisArg?: ?) -> !custom:Array_ctor","!doc":"The Array.from() method creates a new Array instance from an array-like or iterable object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from"},of:{"!type":"fn(elementN: ?) -> !custom:Array_ctor","!doc":"The Array.of() method creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of"},prototype:{copyWithin:{"!type":"fn(target: number, start: number, end?: number) -> !custom:Array_ctor","!doc":"The copyWithin() method copies the sequence of array elements within the array to the position starting at target. The copy is taken from the index positions of the second and third arguments start and end. The end argument is optional and defaults to the length of the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin"},entries:{"!type":"fn() -> TODO_ITERATOR","!doc":"The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries"},fill:{"!type":"fn(value: ?, start?: number, end?: number)","!doc":"The fill() method fills all the elements of an array from a start index to an end index with a static value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill"},find:{"!type":"fn(callback: fn(element: ?, index: number, array: []), thisArg?: ?) -> ?","!doc":"The find() method returns a value in the array, if an element in the array satisfies the provided testing function. Otherwise undefined is returned.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find"},findIndex:{"!type":"fn(callback: fn(element: ?, index: number, array: []), thisArg?: ?) -> number","!doc":"The findIndex() method returns an index in the array, if an element in the array satisfies the provided testing function. Otherwise -1 is returned.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex"},keys:{"!type":"fn() -> !custom:Array_ctor","!doc":"The keys() method returns a new Array Iterator that contains the keys for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys"},values:{"!type":"fn() -> !custom:Array_ctor","!doc":"The values() method returns a new Array Iterator object that contains the values for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values"}}},ArrayBuffer:{"!type":"fn(length: number)","!doc":"The ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. You can not directly manipulate the contents of an ArrayBuffer; instead, you create one of the typed array objects or a DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",isView:{"!type":"fn(arg: ?) -> bool","!doc":"The ArrayBuffer.isView() method returns true if arg is a view one of the ArrayBuffer views, such as typed array objects or a DataView; false otherwise.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView"},transfer:{"!type":"fn(oldBuffer: ?, newByteLength: ?)","!doc":"The static ArrayBuffer.transfer() method returns a new ArrayBuffer whose contents are taken from the oldBuffer's data and then is either truncated or zero-extended by newByteLength. If newByteLength is undefined, the byteLength of the oldBuffer is used. This operation leaves oldBuffer in a detached state.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer"},prototype:{byteLength:{"!type":"number","!doc":"The byteLength accessor property represents the length of an ArrayBuffer in bytes.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength"},slice:{"!type":"fn(begin: number, end?: number) -> +ArrayBuffer","!doc":"The slice() method returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice"}}},DataView:{"!type":"fn(buffer: +ArrayBuffer, byteOffset?: number, byteLength?: number)","!doc":"The DataView view provides a low-level interface for reading data from and writing it to an ArrayBuffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",prototype:{buffer:{"!type":"+ArrayBuffer","!doc":"The buffer accessor property represents the ArrayBuffer referenced by the DataView at construction time.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer"},byteLength:{"!type":"number","!doc":"The byteLength accessor property represents the length (in bytes) of this view from the start of its ArrayBuffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength"},byteOffset:{"!type":"number","!doc":"The byteOffset accessor property represents the offset (in bytes) of this view from the start of its ArrayBuffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset"},getFloat32:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getFloat32() method gets a signed 32-bit integer (float) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32"},getFloat64:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getFloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64"},getInt16:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getInt16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16"},getInt32:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getInt32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32"},getInt8:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getInt8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8"},getUint16:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getUint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16"},getUint32:{"!type":"fn(byteOffset: number, littleEndian?: bool) -> number","!doc":"The getUint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32"},getUint8:{"!type":"fn(byteOffset: number) -> number","!doc":"The getUint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8"},setFloat32:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setFloat32() method stores a signed 32-bit integer (float) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32"},setFloat64:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setFloat64() method stores a signed 64-bit integer (double) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64"},setInt16:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setInt16() method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16"},setInt32:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setInt32() method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32"},setInt8:{"!type":"fn(byteOffset: number, value: number)","!doc":"The setInt8() method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8"},setUint16:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setUint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16"},setUint32:{"!type":"fn(byteOffset: number, value: number, littleEndian?: bool)","!doc":"The setUint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32"},setUint8:{"!type":"fn(byteOffset: number, value: number)","!doc":"The setUint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the DataView.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8"}}},Float32Array:{"!type":"fn(length: number)","!doc":"The Float32Array typed array represents an array of 32-bit floating point numbers (corresponding to the C float data type) in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",prototype:{"!proto":"TypedArray.prototype"},length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of"},Float64Array:{"!type":"fn(length: number)","!doc":"The Float64Array typed array represents an array of 64-bit floating point numbers (corresponding to the C double data type) in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",prototype:{"!proto":"TypedArray.prototype"},length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of"},Int16Array:{"!type":"fn(length: number)","!doc":"The Int16Array typed array represents an array of twos-complement 16-bit signed integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",prototype:{"!proto":"TypedArray.prototype"},length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of"},Int32Array:{"!type":"fn(length: number)","!doc":"The Int32Array typed array represents an array of twos-complement 32-bit signed integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",prototype:{"!proto":"TypedArray.prototype"},length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of"},Int8Array:{"!type":"fn(length: number)","!doc":"The Int8Array typed array represents an array of twos-complement 8-bit signed integers. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",prototype:{"!proto":"TypedArray.prototype"},length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of"},Map:{"!type":"fn(iterable?: [])","!doc":"The Map object is a simple key/value map. Any value (both objects and primitive values) may be used as either a key or a value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",prototype:{clear:{"!type":"fn()","!doc":"The clear() method removes all elements from a Map object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear"},"delete":{"!type":"fn(key: ?)","!doc":"The delete() method removes the specified element from a Map object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete"},entries:{"!type":"fn() -> TODO_ITERATOR","!doc":"The entries() method returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries"},forEach:{"!type":"fn(callback: fn(value: ?, key: ?, map: +Map), thisArg?: ?)","!effects":["call !0 this=!1 !this. number !this"],"!doc":"The forEach() method executes a provided function once per each key/value pair in the Map object, in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach"},get:{"!type":"fn(key: ?) -> !this.","!doc":"The get() method returns a specified element from a Map object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get"},has:{"!type":"fn(key: ?) -> bool","!doc":"The has() method returns a boolean indicating whether an element with the specified key exists or not.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has"},keys:{"!type":"fn() -> TODO_ITERATOR","!doc":"The keys() method returns a new Iterator object that contains the keys for each element in the Map object in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys"},set:{"!type":"fn(key: ?, value: ?) -> !this","!doc":"The set() method adds a new element with a specified key and value to a Map object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set"},size:{"!type":"number","!doc":"The size accessor property returns the number of elements in a Map object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size"},values:{"!type":"fn() -> TODO_ITERATOR","!doc":"The values() method returns a new Iterator object that contains the values for each element in the Map object in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values"},"prototype[@@iterator]":{"!type":"fn()","!doc":"The initial value of the @@iterator property is the same function object as the initial value of the entries property.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/@@iterator"}}},Math:{acosh:{"!type":"fn(x: number) -> number","!doc":"The Math.acosh() function returns the hyperbolic arc-cosine of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh"},asinh:{"!type":"fn(x: number) -> number","!doc":"The Math.asinh() function returns the hyperbolic arcsine of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh"},atanh:{"!type":"fn(x: number) -> number","!doc":"The Math.atanh() function returns the hyperbolic arctangent of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh"},cbrt:{"!type":"fn(x: number) -> number","!doc":"The Math.cbrt() function returns the cube root of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt"},clz32:{"!type":"fn(x: number) -> number","!doc":"The Math.clz32() function returns the number of leading zero bits in the 32-bit binary representation of a number.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32"},cosh:{"!type":"fn(x: number) -> number","!doc":"The Math.cosh() function returns the hyperbolic cosine of a number, that can be expressed using the constant e:","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh"},expm1:{"!type":"fn(x: number) -> number","!doc":"The Math.expm1() function returns ex - 1, where x is the argument, and e the base of the natural logarithms.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1"},fround:{"!type":"fn(x: number) -> number","!doc":"The Math.fround() function returns the nearest single precision float representation of a number.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround"},hypot:{"!type":"fn(value: number) -> number","!doc":"The Math.hypot() function returns the square root of the sum of squares of its arguments, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot"},imul:{"!type":"fn(a: number, b: number) -> number","!doc":"The Math.imul() function returns the result of the C-like 32-bit multiplication of the two parameters.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul"},log10:{"!type":"fn(x: number) -> number","!doc":"The Math.log10() function returns the base 10 logarithm of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10"},log1p:{"!type":"fn(x: number) -> number","!doc":"The Math.log1p() function returns the natural logarithm (base e) of 1 + a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p"},log2:{"!type":"fn(x: number) -> number","!doc":"The Math.log2() function returns the base 2 logarithm of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2"},sign:{"!type":"fn(x: number) -> number","!doc":"The Math.sign() function returns the sign of a number, indicating whether the number is positive, negative or zero.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign"},sinh:{"!type":"fn(x: number) -> number","!doc":"The Math.sinh() function returns the hyperbolic sine of a number, that can be expressed using the constant e:","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh"},tanh:{"!type":"fn(x: number) -> number","!doc":"The Math.tanh() function returns the hyperbolic tangent of a number, that is","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh"},trunc:{"!type":"fn(x: number) -> number","!doc":"The Math.trunc() function returns the integral part of a number by removing any fractional digits. It does not round any numbers. The function can be expressed with the floor() and ceil() function:","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc"}},Number:{EPSILON:{"!type":"number","!doc":"The Number.EPSILON property represents the difference between one and the smallest value greater than one that can be represented as a Number.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON"},MAX_SAFE_INTEGER:{"!type":"number","!doc":"The Number.MAX_SAFE_INTEGER constant represents the maximum safe integer in JavaScript (253 - 1).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER"},MIN_SAFE_INTEGER:{"!type":"number","!doc":"The Number.MIN_SAFE_INTEGER constant represents the minimum safe integer in JavaScript (-(253 - 1)).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER"},isFinite:{"!type":"fn(testValue: ?) -> bool","!doc":"The Number.isFinite() method determines whether the passed value is finite.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite"},isInteger:{"!type":"fn(testValue: ?) -> bool","!doc":"The Number.isInteger() method determines whether the passed value is an integer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger"},isNaN:{"!type":"fn(testValue: ?) -> bool","!doc":"The Number.isNaN() method determines whether the passed value is NaN. More robust version of the original global isNaN().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN"},isSafeInteger:{"!type":"fn(testValue: ?) -> bool","!doc":"The Number.isSafeInteger() method determines whether the provided value is a number that is a safe integer. A safe integer is an integer that","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger"},parseFloat:{"!type":"fn(string: string) -> number","!doc":"The Number.parseFloat() method parses a string argument and returns a floating point number. This method behaves identically to the global function parseFloat() and is part of ECMAScript 6 (its purpose is modularization of globals).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat"},parseInt:{"!type":"fn(string: string, radix?: number) -> number","!doc":"The Number.parseInt() method parses a string argument and returns an integer of the specified radix or base. This method behaves identically to the global function parseInt() and is part of ECMAScript 6 (its purpose is modularization of globals).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt"}},Object:{assign:{"!type":"fn(target: ?, sources: ?) -> ?","!doc":"The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign"},getOwnPropertySymbols:{"!type":"fn(obj: ?) -> [?]","!doc":"The Object.getOwnPropertySymbols() method returns an array of all symbol properties found directly upon a given object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols"},is:{"!type":"fn(value1: ?, value2: ?) -> bool","!doc":"The Object.is() method determines whether two values are the same value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is"},setPrototypeOf:{"!type":"fn(obj: ?, prototype: ?)","!doc":"The Object.setPrototype() method sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or null.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf"}},Promise:{"!type":"fn(executor: fn(resolve: fn(value: ?), reject: promiseReject)) -> !custom:Promise_ctor","!doc":"The Promise object is used for deferred and asynchronous computations. A Promise is in one of the three states:","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",all:{"!type":"fn(iterable: [+Promise]) -> !0.","!doc":"The Promise.all(iterable) method returns a promise that resolves when all of the promises in the iterable argument have resolved.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all"},race:{"!type":"fn(iterable: [+Promise]) -> !0.","!doc":"The Promise.race(iterable) method returns a promise that resolves or rejects as soon as one of the promises in the iterable resolves or rejects, with the value or reason from that promise.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race"},reject:{"!type":"fn(reason: ?) -> !this","!doc":"The Promise.reject(reason) method returns a Promise object that is rejected with the given reason.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject"},resolve:{"!type":"fn(value: ?) -> +Promise[value=!0]","!doc":"The Promise.resolve(value) method returns a Promise object that is resolved with the given value. If the value is a thenable (i.e. has a then method), the returned promise will 'follow' that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve"},prototype:"Promise.prototype"},Proxy:{"!type":"fn(target: ?, handler: ?)","!doc":"The Proxy object is used to define the custom behavior in JavaScript fundamental operation (e.g. property lookup, assignment, enumeration, function invocation, etc).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",revocable:{"!doc":"The Proxy.revocable() method is used to create a revocable Proxy object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable"}},RegExp:{prototype:{flags:{"!type":"string","!doc":"The flags property returns a string consisting of the flags of the current regular expression object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags"},sticky:{"!type":"bool","!doc":"The sticky property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastIndex property of this regular expression). sticky is a read-only property of an individual regular expression object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky"}}},Set:{"!type":"fn(iterable: [?])","!doc":"The Set object lets you store unique values of any type, whether primitive values or object references.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",length:{"!type":"number","!doc":"The value of the length property is 1."},prototype:{add:{"!type":"fn(value: ?) -> !this","!doc":"The add() method appends a new element with a specified value to the end of a Set object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add"},clear:{"!type":"fn()","!doc":"The clear() method removes all elements from a Set object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear"},"delete":{"!type":"fn(value: ?) -> bool","!doc":"The delete() method removes the specified element from a Set object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete"},entries:{"!type":"fn() -> TODO_ITERATOR","!doc":"The entries() method returns a new Iterator object that contains an array of [value, value] for each element in the Set object, in insertion order. For Set objects there is no key like in Map objects. However, to keep the API similar to the Map object, each entry has the same value for its key and value here, so that an array [value, value] is returned.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries"},forEach:{"!type":"fn(callback: fn(value: ?, value2: ?, set: +Set), thisArg?: ?)","!effects":["call !0 this=!1 !this. number !this"]},has:{"!type":"fn(value: ?) -> bool","!doc":"The has() method returns a boolean indicating whether an element with the specified value exists in a Set object or not.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has"},keys:{"!type":"fn() -> TODO_ITERATOR","!doc":"The values() method returns a new Iterator object that contains the values for each element in the Set object in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/keys"},size:{"!type":"number","!doc":"The size accessor property returns the number of elements in a Set object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size"},values:{"!type":"fn() -> TODO_ITERATOR","!doc":"The values() method returns a new Iterator object that contains the values for each element in the Set object in insertion order.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values"},"prototype[@@iterator]":{"!type":"fn()","!doc":"The initial value of the @@iterator property is the same function object as the initial value of the values property.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/@@iterator"}}},String:{fromCodePoint:{"!type":"fn(num1: ?) -> string","!doc":"The static String.fromCodePoint() method returns a string created by using the specified sequence of code points.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint"},raw:{"!type":"fn(callSite: ?, substitutions: ?, templateString: ?) -> string","!doc":"The static String.raw() method is a tag function of template strings, like the r prefix in Python or the @ prefix in C# for string literals, this function is used to get the raw string form of template strings.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw"},prototype:{codePointAt:{"!type":"fn(pos: number) -> number","!doc":"The codePointAt() method returns a non-negative integer that is the UTF-16 encoded code point value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt"},endsWith:{"!type":"fn(searchString: string, position?: number) -> bool","!doc":"The endsWith() method determines whether a string ends with the characters of another string, returning true or false as appropriate.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith"},includes:{"!type":"fn(searchString: string, position?: number) -> bool","!doc":"The includes() method determines whether one string may be found within another string, returning true or false as appropriate.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/contains"},normalize:{"!type":"fn(form: string) -> string","!doc":"The normalize() method returns the Unicode Normalization Form of a given string (if the value isn't a string, it will be converted to one first).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize"},repeat:{"!type":"fn(count: number) -> string","!doc":"The repeat() method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat"},startsWith:{"!type":"fn(searchString: string, position?: number) -> bool","!doc":"The startsWith() method determines whether a string begins with the characters of another string, returning true or false as appropriate.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith"}}},Symbol:{"!type":"fn(description?: string)","!doc":"A symbol is a unique and immutable data type and may be used as an identifier for object properties. The symbol object is an implicit object wrapper for the symbol primitive data type.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol","for":{"!type":"fn(key: string) -> +Symbol","!doc":"The Symbol.for(key) method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for"},keyFor:{"!type":"fn(sym: +Symbol) -> +Symbol","!doc":"The Symbol.keyFor(sym) method retrieves a shared symbol key from the global symbol registry for the given symbol.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/keyFor"},prototype:{toString:{"!type":"fn() -> string","!doc":"The toString() method returns a string representing the specified Symbol object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toString"},valueOf:{"!type":"fn() -> ?","!doc":"The valueOf() method returns the primitive value of a Symbol object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/valueOf"}}},TypedArray:{"!type":"fn(length: number)","!doc":"A TypedArray object describes an array-like view of an underlying binary data buffer. There is no global property named TypedArray, nor is there a directly visible TypedArray constructor. Instead, there are a number of different global properties, whose values are typed array constructors for specific element types, listed below. On the following pages you will find common properties and methods that can be used with any typed array containing elements of any type.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray",BYTES_PER_ELEMENT:{"!type":"number","!doc":"The TypedArray.BYTES_PER_ELEMENT property represents the size in bytes of each element in an typed array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT"},length:{"!type":"number","!doc":"The length accessor property represents the length (in elements) of a typed array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length"},name:{"!type":"string","!doc":"The TypedArray.name property represents a string value of the typed array constructor name.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/name"},prototype:{buffer:{"!type":"+ArrayBuffer","!doc":"The buffer accessor property represents the ArrayBuffer referenced by a TypedArray at construction time.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer"},byteLength:{"!type":"number","!doc":"The byteLength accessor property represents the length (in bytes) of a typed array from the start of its ArrayBuffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength"},byteOffset:{"!type":"number","!doc":"The byteOffset accessor property represents the offset (in bytes) of a typed array from the start of its ArrayBuffer.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset"},copyWithin:{"!type":"fn(target: number, start: number, end?: number) -> ?","!doc":"The copyWithin() method copies the sequence of array elements within the array to the position starting at target. The copy is taken from the index positions of the second and third arguments start and end. The end argument is optional and defaults to the length of the array. This method has the same algorithm as Array.prototype.copyWithin. TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin"},entries:{"!type":"fn() -> TODO_ITERATOR","!doc":"The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/entries"},every:{"!type":"fn(callback: fn(currentValue: ?, index: number, array: +TypedArray) -> bool, thisArg?: ?) -> bool","!effects":["call !0 this=!1 !this. number !this"],"!doc":"The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every"},fill:{"!type":"fn(value: ?, start?: number, end?: number)","!doc":"The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill"},filter:{"!type":"fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> !this","!effects":["call !0 this=!1 !this. number"],"!doc":"Creates a new array with all of the elements of this array for which the provided filtering function returns true. See also Array.prototype.filter().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter"},find:{"!type":"fn(callback: fn(element: ?, index: number, array: +TypedArray) -> bool, thisArg?: ?) -> ?","!effects":["call !0 this=!1 !this. number !this"],"!doc":"The find() method returns a value in the typed array, if an element satisfies the provided testing function. Otherwise undefined is returned. TypedArray is one of the typed array types here.\nSee also the findIndex() method, which returns the index of a found element in the typed array instead of its value.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find"},findIndex:{"!type":"fn(callback: fn(element: ?, index: number, array: +TypedArray) -> bool, thisArg?: ?) -> number","!effects":["call !0 this=!1 !this. number !this"],"!doc":"The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned.\nSee also the find() method, which returns the value of a found element in the typed array instead of its index.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex"},forEach:{"!type":"fn(callback: fn(value: ?, key: ?, array: +TypedArray), thisArg?: ?)","!effects":["call !0 this=!1 !this. number !this"],"!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach"},includes:{"!type":"fn(searchElement: ?, fromIndex?: number) -> bool","!doc":"The includes() method determines whether a typed array includes a certain element, returning true or false as appropriate. This method has the same algorithm as Array.prototype.includes(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes"},indexOf:{"!type":"fn(searchElement: ?, fromIndex?: number) -> number","!doc":"The indexOf() method returns the first index at which a given element can be found in the typed array, or -1 if it is not present. This method has the same algorithm as Array.prototype.indexOf(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf"},join:{"!type":"fn(separator?: string) -> string","!doc":"The join() method joins all elements of an array into a string. This method has the same algorithm as Array.prototype.join(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join"},keys:{"!type":"fn() -> TODO_ITERATOR","!doc":"The keys() method returns a new Array Iterator object that contains the keys for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/keys"},lastIndexOf:{"!type":"fn(searchElement: ?, fromIndex?: number) -> number","!doc":"The lastIndexOf() method returns the last index at which a given element can be found in the typed array, or -1 if it is not present. The typed array is searched backwards, starting at fromIndex. This method has the same algorithm as Array.prototype.lastIndexOf(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf"},length:{"!type":"number","!doc":"Returns the number of elements hold in the typed array. Fixed at construction time and thus read only.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length"},map:{"!type":"fn(f: fn(elt: ?, i: number) -> ?, context?: ?) -> [!0.!ret]","!effects":["call !0 this=!1 !this. number"],"!doc":"Creates a new array with the results of calling a provided function on every element in this array. See also Array.prototype.map().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map"},reduce:{"!type":"fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret","!effects":["call !0 !1 !this. number"],"!doc":"Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. See also Array.prototype.reduce().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce"},reduceRight:{"!type":"fn(combine: fn(sum: ?, elt: ?, i: number) -> ?, init?: ?) -> !0.!ret","!effects":["call !0 !1 !this. number"],"!doc":"Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value. See also Array.prototype.reduceRight().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight"},reverse:{"!type":"fn()","!doc":"The reverse() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse"},set:{"!type":"fn(array: [?], offset?: ?)","!doc":"The set() method stores multiple values in the typed array, reading input values from a specified array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set"},slice:{"!type":"fn(from: number, to?: number) -> !this","!doc":"Extracts a section of an array and returns a new array. See also Array.prototype.slice().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice"},some:{"!type":"fn(test: fn(elt: ?, i: number) -> bool, context?: ?) -> bool","!effects":["call !0 this=!1 !this. number"],"!doc":"The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some(). TypedArray is one of the typed array types here.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some"},sort:{"!type":"fn(compare?: fn(a: ?, b: ?) -> number)","!effects":["call !0 !this. !this."],"!doc":"Sorts the elements of an array in place and returns the array. See also Array.prototype.sort().","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort"},subarray:{"!type":"fn(begin?: number, end?: number) -> +TypedArray","!doc":"The subarray() method returns a new TypedArray on the same ArrayBuffer store and with the same element types as for this TypedArray object. The begin offset is inclusive and the end offset is exclusive. TypedArray is one of the typed array types.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray"},values:{"!type":"fn() -> TODO_ITERATOR","!doc":"The values() method returns a new Array Iterator object that contains the values for each index in the array.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/values"},"prototype[@@iterator]":{"!type":"fn()","!doc":"The initial value of the @@iterator property is the same function object as the initial value of the values property.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/@@iterator"}}},Uint16Array:{"!type":"fn()","!doc":"The Uint16Array typed array represents an array of 16-bit unsigned integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of",prototype:{"!proto":"TypedArray.prototype"}},Uint32Array:{"!type":"fn()","!doc":"The Uint32Array typed array represents an array of 32-bit unsigned integers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of",prototype:{"!proto":"TypedArray.prototype"}},Uint8Array:{"!type":"fn()","!doc":"The Uint8Array typed array represents an array of 8-bit unsigned integers. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of",prototype:{"!proto":"TypedArray.prototype"}},Uint8ClampedArray:{"!type":"fn()","!doc":"The Uint8ClampedArray typed array represents an array of 8-bit unsigned integers clamped to 0-255. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",length:"TypedArray.length",BYTES_PER_ELEMENT:"TypedArray.BYTES_PER_ELEMENT",name:"TypedArray.name",from:"TypedArray.from",of:"TypedArray.of",prototype:{"!proto":"TypedArray.prototype"}},WeakMap:{"!type":"fn(iterable: [?])","!doc":"The WeakMap object is a collection of key/value pairs in which the keys are objects and the values can be arbitrary values.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",prototype:{"delete":{"!type":"fn(key: ?) -> bool","!doc":"The delete() method removes the specified element from a WeakMap object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/delete"},get:{"!type":"fn(key: ?) !this.","!doc":"The get() method returns a specified element from a WeakMap object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/get"},has:{"!type":"fn(key: ?) -> bool","!doc":"The has() method returns a boolean indicating whether an element with the specified key exists in the WeakMap object or not.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/has"},set:{"!type":"fn(key: ?, value: ?)","!doc":"The set() method adds a new element with a specified key and value to a WeakMap object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap/set"}}},WeakSet:{"!type":"fn(iterable: [?])","!doc":"The WeakSet object lets you store weakly held objects in a collection.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",prototype:{add:{"!type":"fn(value: ?)","!doc":"The add() method appends a new object to the end of a WeakSet object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/add"},"delete":{"!type":"fn(value: ?) -> bool","!doc":"The delete() method removes the specified element from a WeakSet object.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/delete"},has:{"!type":"fn(value: ?) -> bool","!doc":"The has() method returns a boolean indicating whether an object exists in a WeakSet or not.","!url":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/has"}}}} -}),define("json!tern/defs/browser.json",function(){return{"!name":"browser",location:{assign:{"!type":"fn(url: string)","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"Load the document at the provided URL."},replace:{"!type":"fn(url: string)","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it."},reload:{"!type":"fn()","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"Reload the document from the current URL. forceget is a boolean, which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified, the browser may reload the page from its cache."},origin:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The origin of the URL."},hash:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The part of the URL that follows the # symbol, including the # symbol."},search:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The part of the URL that follows the ? symbol, including the ? symbol."},pathname:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The path (relative to the host)."},port:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The port number of the URL."},hostname:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The host name (without the port number or square brackets)."},host:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The host name and port number."},protocol:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The protocol of the URL."},href:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"The entire URL."},"!url":"https://developer.mozilla.org/en/docs/DOM/window.location","!doc":"Returns a location object with information about the current location of the document. Assigning to the location property changes the current page to the new address."},Node:{"!type":"fn()",prototype:{parentElement:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.parentElement","!doc":"Returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element."},textContent:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.textContent","!doc":"Gets or sets the text content of a node and its descendants."},baseURI:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.baseURI","!doc":"The absolute base URI of a node or null if unable to obtain an absolute URI."},localName:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.localName","!doc":"Returns the local part of the qualified name of this node."},prefix:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.prefix","!doc":"Returns the namespace prefix of the specified node, or null if no prefix is specified. This property is read only."},namespaceURI:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.namespaceURI","!doc":"The namespace URI of the node, or null if the node is not in a namespace (read-only). When the node is a document, it returns the XML namespace for the current document."},ownerDocument:{"!type":"+Document","!url":"https://developer.mozilla.org/en/docs/DOM/Node.ownerDocument","!doc":"The ownerDocument property returns the top-level document object for this node."},attributes:{"!type":"+NamedNodeMap","!url":"https://developer.mozilla.org/en/docs/DOM/Node.attributes","!doc":"A collection of all attribute nodes registered to the specified node. It is a NamedNodeMap,not an Array, so it has no Array methods and the Attr nodes' indexes may differ among browsers."},nextSibling:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.nextSibling","!doc":"Returns the node immediately following the specified one in its parent's childNodes list, or null if the specified node is the last node in that list."},previousSibling:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.previousSibling","!doc":"Returns the node immediately preceding the specified one in its parent's childNodes list, null if the specified node is the first in that list."},lastChild:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.lastChild","!doc":"Returns the last child of a node."},firstChild:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.firstChild","!doc":"Returns the node's first child in the tree, or null if the node is childless. If the node is a Document, it returns the first node in the list of its direct children."},childNodes:{"!type":"+NodeList","!url":"https://developer.mozilla.org/en/docs/DOM/Node.childNodes","!doc":"Returns a collection of child nodes of the given element."},parentNode:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.parentNode","!doc":"Returns the parent of the specified node in the DOM tree."},nodeType:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/Node.nodeType","!doc":"Returns an integer code representing the type of the node."},nodeValue:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.nodeValue","!doc":"Returns or sets the value of the current node."},nodeName:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.nodeName","!doc":"Returns the name of the current node as a string."},tagName:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.nodeName","!doc":"Returns the name of the current node as a string."},insertBefore:{"!type":"fn(newElt: +Element, before: +Element) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.insertBefore","!doc":"Inserts the specified node before a reference element as a child of the current node."},replaceChild:{"!type":"fn(newElt: +Element, oldElt: +Element) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.replaceChild","!doc":"Replaces one child node of the specified element with another."},removeChild:{"!type":"fn(oldElt: +Element) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.removeChild","!doc":"Removes a child node from the DOM. Returns removed node."},appendChild:{"!type":"fn(newElt: +Element) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.appendChild","!doc":"Adds a node to the end of the list of children of a specified parent node. If the node already exists it is removed from current parent node, then added to new parent node."},hasChildNodes:{"!type":"fn() -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.hasChildNodes","!doc":"Returns a Boolean value indicating whether the current Node has child nodes or not."},cloneNode:{"!type":"fn(deep: bool) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Node.cloneNode","!doc":"Returns a duplicate of the node on which this method was called."},normalize:{"!type":"fn()","!url":"https://developer.mozilla.org/en/docs/DOM/Node.normalize","!doc":'Puts the specified node and all of its subtree into a "normalized" form. In a normalized subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.'},isSupported:{"!type":"fn(features: string, version: number) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.isSupported","!doc":"Tests whether the DOM implementation implements a specific feature and that feature is supported by this node."},hasAttributes:{"!type":"fn() -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.hasAttributes","!doc":"Returns a boolean value of true or false, indicating if the current element has any attributes or not."},lookupPrefix:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.lookupPrefix","!doc":"Returns the prefix for a given namespaceURI if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent."},isDefaultNamespace:{"!type":"fn(uri: string) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.isDefaultNamespace","!doc":"Accepts a namespace URI as an argument and returns true if the namespace is the default namespace on the given node or false if not."},lookupNamespaceURI:{"!type":"fn(uri: string) -> string","!url":"https://developer.mozilla.org/en/docs/DOM/Node.lookupNamespaceURI","!doc":"Takes a prefix and returns the namespaceURI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace."},addEventListener:{"!type":"fn(type: string, listener: fn(e: +Event), capture: bool)","!url":"https://developer.mozilla.org/en/docs/DOM/EventTarget.addEventListener","!doc":"Registers a single event listener on a single target. The event target may be a single element in a document, the document itself, a window, or an XMLHttpRequest."},removeEventListener:{"!type":"fn(type: string, listener: fn(), capture: bool)","!url":"https://developer.mozilla.org/en/docs/DOM/EventTarget.removeEventListener","!doc":"Allows the removal of event listeners from the event target."},isSameNode:{"!type":"fn(other: +Node) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.isSameNode","!doc":"Tests whether two nodes are the same, that is they reference the same object."},isEqualNode:{"!type":"fn(other: +Node) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.isEqualNode","!doc":"Tests whether two nodes are equal."},compareDocumentPosition:{"!type":"fn(other: +Node) -> number","!url":"https://developer.mozilla.org/en/docs/DOM/Node.compareDocumentPosition","!doc":"Compares the position of the current node against another node in any other document."},contains:{"!type":"fn(other: +Node) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/Node.contains","!doc":"Indicates whether a node is a descendent of a given node."},dispatchEvent:{"!type":"fn(event: +Event) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/EventTarget.dispatchEvent","!doc":"Dispatches an event into the event system. The event is subject to the same capturing and bubbling behavior as directly dispatched events."},ELEMENT_NODE:"number",ATTRIBUTE_NODE:"number",TEXT_NODE:"number",CDATA_SECTION_NODE:"number",ENTITY_REFERENCE_NODE:"number",ENTITY_NODE:"number",PROCESSING_INSTRUCTION_NODE:"number",COMMENT_NODE:"number",DOCUMENT_NODE:"number",DOCUMENT_TYPE_NODE:"number",DOCUMENT_FRAGMENT_NODE:"number",NOTATION_NODE:"number",DOCUMENT_POSITION_DISCONNECTED:"number",DOCUMENT_POSITION_PRECEDING:"number",DOCUMENT_POSITION_FOLLOWING:"number",DOCUMENT_POSITION_CONTAINS:"number",DOCUMENT_POSITION_CONTAINED_BY:"number",DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:"number"},"!url":"https://developer.mozilla.org/en/docs/DOM/Node","!doc":"A Node is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly."},Element:{"!type":"fn()",prototype:{"!proto":"Node.prototype",getAttribute:{"!type":"fn(name: string) -> string","!url":"https://developer.mozilla.org/en/docs/DOM/element.getAttribute","!doc":'Returns the value of the named attribute on the specified element. If the named attribute does not exist, the value returned will either be null or "" (the empty string).'},setAttribute:{"!type":"fn(name: string, value: string)","!url":"https://developer.mozilla.org/en/docs/DOM/element.setAttribute","!doc":"Adds a new attribute or changes the value of an existing attribute on the specified element."},removeAttribute:{"!type":"fn(name: string)","!url":"https://developer.mozilla.org/en/docs/DOM/element.removeAttribute","!doc":"Removes an attribute from the specified element."},getAttributeNode:{"!type":"fn(name: string) -> +Attr","!url":"https://developer.mozilla.org/en/docs/DOM/element.getAttributeNode","!doc":"Returns the specified attribute of the specified element, as an Attr node."},getElementsByTagName:{"!type":"fn(tagName: string) -> +NodeList","!url":"https://developer.mozilla.org/en/docs/DOM/element.getElementsByTagName","!doc":"Returns a list of elements with the given tag name. The subtree underneath the specified element is searched, excluding the element itself. The returned list is live, meaning that it updates itself with the DOM tree automatically. Consequently, there is no need to call several times element.getElementsByTagName with the same element and arguments."},getElementsByTagNameNS:{"!type":"fn(ns: string, tagName: string) -> +NodeList","!url":"https://developer.mozilla.org/en/docs/DOM/element.getElementsByTagNameNS","!doc":"Returns a list of elements with the given tag name belonging to the given namespace."},getAttributeNS:{"!type":"fn(ns: string, name: string) -> string","!url":"https://developer.mozilla.org/en/docs/DOM/element.getAttributeNS","!doc":'Returns the string value of the attribute with the specified namespace and name. If the named attribute does not exist, the value returned will either be null or "" (the empty string).'},setAttributeNS:{"!type":"fn(ns: string, name: string, value: string)","!url":"https://developer.mozilla.org/en/docs/DOM/element.setAttributeNS","!doc":"Adds a new attribute or changes the value of an attribute with the given namespace and name."},removeAttributeNS:{"!type":"fn(ns: string, name: string)","!url":"https://developer.mozilla.org/en/docs/DOM/element.removeAttributeNS","!doc":"removeAttributeNS removes the specified attribute from an element."},getAttributeNodeNS:{"!type":"fn(ns: string, name: string) -> +Attr","!url":"https://developer.mozilla.org/en/docs/DOM/element.getAttributeNodeNS","!doc":"Returns the Attr node for the attribute with the given namespace and name."},hasAttribute:{"!type":"fn(name: string) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/element.hasAttribute","!doc":"hasAttribute returns a boolean value indicating whether the specified element has the specified attribute or not."},hasAttributeNS:{"!type":"fn(ns: string, name: string) -> bool","!url":"https://developer.mozilla.org/en/docs/DOM/element.hasAttributeNS","!doc":"hasAttributeNS returns a boolean value indicating whether the current element has the specified attribute."},focus:{"!type":"fn()","!url":"https://developer.mozilla.org/en/docs/DOM/element.focus","!doc":"Sets focus on the specified element, if it can be focused."},blur:{"!type":"fn()","!url":"https://developer.mozilla.org/en/docs/DOM/element.blur","!doc":"The blur method removes keyboard focus from the current element."},scrollIntoView:{"!type":"fn(top: bool)","!url":"https://developer.mozilla.org/en/docs/DOM/element.scrollIntoView","!doc":"The scrollIntoView() method scrolls the element into view."},scrollByLines:{"!type":"fn(lines: number)","!url":"https://developer.mozilla.org/en/docs/DOM/window.scrollByLines","!doc":"Scrolls the document by the given number of lines."},scrollByPages:{"!type":"fn(pages: number)","!url":"https://developer.mozilla.org/en/docs/DOM/window.scrollByPages","!doc":"Scrolls the current document by the specified number of pages."},getElementsByClassName:{"!type":"fn(name: string) -> +NodeList","!url":"https://developer.mozilla.org/en/docs/DOM/document.getElementsByClassName","!doc":"Returns a set of elements which have all the given class names. When called on the document object, the complete document is searched, including the root node. You may also call getElementsByClassName on any element; it will return only elements which are descendants of the specified root element with the given class names."},querySelector:{"!type":"fn(selectors: string) -> +Element","!url":"https://developer.mozilla.org/en/docs/DOM/Element.querySelector","!doc":"Returns the first element that is a descendent of the element on which it is invoked that matches the specified group of selectors."},querySelectorAll:{"!type":"fn(selectors: string) -> +NodeList","!url":"https://developer.mozilla.org/en/docs/DOM/Element.querySelectorAll","!doc":"Returns a non-live NodeList of all elements descended from the element on which it is invoked that match the specified group of CSS selectors."},getClientRects:{"!type":"fn() -> [+ClientRect]","!url":"https://developer.mozilla.org/en/docs/DOM/element.getClientRects","!doc":"Returns a collection of rectangles that indicate the bounding rectangles for each box in a client."},getBoundingClientRect:{"!type":"fn() -> +ClientRect","!url":"https://developer.mozilla.org/en/docs/DOM/element.getBoundingClientRect","!doc":"Returns a text rectangle object that encloses a group of text rectangles."},setAttributeNode:{"!type":"fn(attr: +Attr) -> +Attr","!url":"https://developer.mozilla.org/en/docs/DOM/element.setAttributeNode","!doc":"Adds a new Attr node to the specified element."},removeAttributeNode:{"!type":"fn(attr: +Attr) -> +Attr","!url":"https://developer.mozilla.org/en/docs/DOM/element.removeAttributeNode","!doc":"Removes the specified attribute from the current element."},setAttributeNodeNS:{"!type":"fn(attr: +Attr) -> +Attr","!url":"https://developer.mozilla.org/en/docs/DOM/element.setAttributeNodeNS","!doc":"Adds a new namespaced attribute node to an element."},insertAdjacentHTML:{"!type":"fn(position: string, text: string)","!url":"https://developer.mozilla.org/en/docs/DOM/element.insertAdjacentHTML","!doc":"Parses the specified text as HTML or XML and inserts the resulting nodes into the DOM tree at a specified position. It does not reparse the element it is being used on and thus it does not corrupt the existing elements inside the element. This, and avoiding the extra step of serialization make it much faster than direct innerHTML manipulation."},children:{"!type":"+HTMLCollection","!url":"https://developer.mozilla.org/en/docs/DOM/Element.children","!doc":"Returns a collection of child elements of the given element."},childElementCount:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/Element.childElementCount","!doc":"Returns the number of child elements of the given element."},className:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/element.className","!doc":"Gets and sets the value of the class attribute of the specified element."},style:{cssText:"string",alignmentBaseline:"string",background:"string",backgroundAttachment:"string",backgroundClip:"string",backgroundColor:"string",backgroundImage:"string",backgroundOrigin:"string",backgroundPosition:"string",backgroundPositionX:"string",backgroundPositionY:"string",backgroundRepeat:"string",backgroundRepeatX:"string",backgroundRepeatY:"string",backgroundSize:"string",baselineShift:"string",border:"string",borderBottom:"string",borderBottomColor:"string",borderBottomLeftRadius:"string",borderBottomRightRadius:"string",borderBottomStyle:"string",borderBottomWidth:"string",borderCollapse:"string",borderColor:"string",borderImage:"string",borderImageOutset:"string",borderImageRepeat:"string",borderImageSlice:"string",borderImageSource:"string",borderImageWidth:"string",borderLeft:"string",borderLeftColor:"string",borderLeftStyle:"string",borderLeftWidth:"string",borderRadius:"string",borderRight:"string",borderRightColor:"string",borderRightStyle:"string",borderRightWidth:"string",borderSpacing:"string",borderStyle:"string",borderTop:"string",borderTopColor:"string",borderTopLeftRadius:"string",borderTopRightRadius:"string",borderTopStyle:"string",borderTopWidth:"string",borderWidth:"string",bottom:"string",boxShadow:"string",boxSizing:"string",captionSide:"string",clear:"string",clip:"string",clipPath:"string",clipRule:"string",color:"string",colorInterpolation:"string",colorInterpolationFilters:"string",colorProfile:"string",colorRendering:"string",content:"string",counterIncrement:"string",counterReset:"string",cursor:"string",direction:"string",display:"string",dominantBaseline:"string",emptyCells:"string",enableBackground:"string",fill:"string",fillOpacity:"string",fillRule:"string",filter:"string","float":"string",floodColor:"string",floodOpacity:"string",font:"string",fontFamily:"string",fontSize:"string",fontStretch:"string",fontStyle:"string",fontVariant:"string",fontWeight:"string",glyphOrientationHorizontal:"string",glyphOrientationVertical:"string",height:"string",imageRendering:"string",kerning:"string",left:"string",letterSpacing:"string",lightingColor:"string",lineHeight:"string",listStyle:"string",listStyleImage:"string",listStylePosition:"string",listStyleType:"string",margin:"string",marginBottom:"string",marginLeft:"string",marginRight:"string",marginTop:"string",marker:"string",markerEnd:"string",markerMid:"string",markerStart:"string",mask:"string",maxHeight:"string",maxWidth:"string",minHeight:"string",minWidth:"string",opacity:"string",orphans:"string",outline:"string",outlineColor:"string",outlineOffset:"string",outlineStyle:"string",outlineWidth:"string",overflow:"string",overflowWrap:"string",overflowX:"string",overflowY:"string",padding:"string",paddingBottom:"string",paddingLeft:"string",paddingRight:"string",paddingTop:"string",page:"string",pageBreakAfter:"string",pageBreakBefore:"string",pageBreakInside:"string",pointerEvents:"string",position:"string",quotes:"string",resize:"string",right:"string",shapeRendering:"string",size:"string",speak:"string",src:"string",stopColor:"string",stopOpacity:"string",stroke:"string",strokeDasharray:"string",strokeDashoffset:"string",strokeLinecap:"string",strokeLinejoin:"string",strokeMiterlimit:"string",strokeOpacity:"string",strokeWidth:"string",tabSize:"string",tableLayout:"string",textAlign:"string",textAnchor:"string",textDecoration:"string",textIndent:"string",textLineThrough:"string",textLineThroughColor:"string",textLineThroughMode:"string",textLineThroughStyle:"string",textLineThroughWidth:"string",textOverflow:"string",textOverline:"string",textOverlineColor:"string",textOverlineMode:"string",textOverlineStyle:"string",textOverlineWidth:"string",textRendering:"string",textShadow:"string",textTransform:"string",textUnderline:"string",textUnderlineColor:"string",textUnderlineMode:"string",textUnderlineStyle:"string",textUnderlineWidth:"string",top:"string",unicodeBidi:"string",unicodeRange:"string",vectorEffect:"string",verticalAlign:"string",visibility:"string",whiteSpace:"string",width:"string",wordBreak:"string",wordSpacing:"string",wordWrap:"string",writingMode:"string",zIndex:"string",zoom:"string","!url":"https://developer.mozilla.org/en/docs/DOM/element.style","!doc":"Returns an object that represents the element's style attribute."},classList:{"!type":"+DOMTokenList","!url":"https://developer.mozilla.org/en/docs/DOM/element.classList","!doc":"Returns a token list of the class attribute of the element."},contentEditable:{"!type":"bool","!url":"https://developer.mozilla.org/en/docs/DOM/Element.contentEditable","!doc":"Indicates whether or not the element is editable."},firstElementChild:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Element.firstElementChild","!doc":"Returns the element's first child element or null if there are no child elements."},lastElementChild:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Element.lastElementChild","!doc":"Returns the element's last child element or null if there are no child elements."},nextElementSibling:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Element.nextElementSibling","!doc":"Returns the element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list."},previousElementSibling:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/Element.previousElementSibling","!doc":"Returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list."},tabIndex:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.tabIndex","!doc":"Gets/sets the tab order of the current element."},title:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/element.title","!doc":"Establishes the text to be displayed in a 'tool tip' popup when the mouse is over the displayed node."},width:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetWidth","!doc":"Returns the layout width of an element."},height:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetHeight","!doc":"Height of an element relative to the element's offsetParent."},getContext:{"!type":"fn(id: string) -> CanvasRenderingContext2D","!url":"https://developer.mozilla.org/en/docs/DOM/HTMLCanvasElement","!doc":"DOM canvas elements expose the HTMLCanvasElement interface, which provides properties and methods for manipulating the layout and presentation of canvas elements. The HTMLCanvasElement interface inherits the properties and methods of the element object interface."},supportsContext:"fn(id: string) -> bool",oncopy:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.oncopy","!doc":"The oncopy property returns the onCopy event handler code on the current element."},oncut:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.oncut","!doc":"The oncut property returns the onCut event handler code on the current element."},onpaste:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onpaste","!doc":"The onpaste property returns the onPaste event handler code on the current element."},onbeforeunload:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/HTML/Element/body","!doc":"The HTML element represents the main content of an HTML document. There is only one element in a document."},onfocus:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onfocus","!doc":"The onfocus property returns the onFocus event handler code on the current element."},onblur:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onblur","!doc":"The onblur property returns the onBlur event handler code, if any, that exists on the current element."},onchange:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onchange","!doc":"The onchange property sets and returns the onChange event handler code for the current element."},onclick:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onclick","!doc":"The onclick property returns the onClick event handler code on the current element."},ondblclick:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.ondblclick","!doc":"The ondblclick property returns the onDblClick event handler code on the current element."},onmousedown:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onmousedown","!doc":"The onmousedown property returns the onMouseDown event handler code on the current element."},onmouseup:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onmouseup","!doc":"The onmouseup property returns the onMouseUp event handler code on the current element."},onmousewheel:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/wheel","!doc":"The wheel event is fired when a wheel button of a pointing device (usually a mouse) is rotated. This event deprecates the legacy mousewheel event."},onmouseover:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onmouseover","!doc":"The onmouseover property returns the onMouseOver event handler code on the current element."},onmouseout:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onmouseout","!doc":"The onmouseout property returns the onMouseOut event handler code on the current element."},onmousemove:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onmousemove","!doc":"The onmousemove property returns the mousemove event handler code on the current element."},oncontextmenu:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/window.oncontextmenu","!doc":'An event handler property for right-click events on the window. Unless the default behavior is prevented, the browser context menu will activate. Note that this event will occur with any non-disabled right-click event and does not depend on an element possessing the "contextmenu" attribute.'},onkeydown:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onkeydown","!doc":"The onkeydown property returns the onKeyDown event handler code on the current element."},onkeyup:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onkeyup","!doc":"The onkeyup property returns the onKeyUp event handler code for the current element."},onkeypress:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onkeypress","!doc":"The onkeypress property sets and returns the onKeyPress event handler code for the current element."},onresize:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onresize","!doc":"onresize returns the element's onresize event handler code. It can also be used to set the code to be executed when the resize event occurs."},onscroll:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/element.onscroll","!doc":"The onscroll property returns the onScroll event handler code on the current element."},ondragstart:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DragDrop/Drag_Operations","!doc":"The following describes the steps that occur during a drag and drop operation."},ondragover:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/dragover","!doc":"The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds)."},ondragleave:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/dragleave","!doc":"The dragleave event is fired when a dragged element or text selection leaves a valid drop target."},ondragenter:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/dragenter","!doc":"The dragenter event is fired when a dragged element or text selection enters a valid drop target."},ondragend:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/dragend","!doc":"The dragend event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key)."},ondrag:{"!type":"?","!url":"https://developer.mozilla.org/en/docs/DOM/Mozilla_event_reference/drag","!doc":"The drag event is fired when an element or text selection is being dragged (every few hundred milliseconds)."},offsetTop:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetTop","!doc":"Returns the distance of the current element relative to the top of the offsetParent node."},offsetLeft:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetLeft","!doc":"Returns the number of pixels that the upper left corner of the current element is offset to the left within the offsetParent node."},offsetHeight:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetHeight","!doc":"Height of an element relative to the element's offsetParent."},offsetWidth:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.offsetWidth","!doc":"Returns the layout width of an element."},scrollTop:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.scrollTop","!doc":"Gets or sets the number of pixels that the content of an element is scrolled upward."},scrollLeft:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.scrollLeft","!doc":"Gets or sets the number of pixels that an element's content is scrolled to the left."},scrollHeight:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.scrollHeight","!doc":"Height of the scroll view of an element; it includes the element padding but not its margin."},scrollWidth:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.scrollWidth","!doc":"Read-only property that returns either the width in pixels of the content of an element or the width of the element itself, whichever is greater."},clientTop:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.clientTop","!doc":"The width of the top border of an element in pixels. It does not include the top margin or padding. clientTop is read-only."},clientLeft:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.clientLeft","!doc":"The width of the left border of an element in pixels. It includes the width of the vertical scrollbar if the text direction of the element is right-to-left and if there is an overflow causing a left vertical scrollbar to be rendered. clientLeft does not include the left margin or the left padding. clientLeft is read-only."},clientHeight:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.clientHeight","!doc":"Returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin."},clientWidth:{"!type":"number","!url":"https://developer.mozilla.org/en/docs/DOM/element.clientWidth","!doc":"The inner width of an element in pixels. It includes padding but not the vertical scrollbar (if present, if rendered), border or margin."},innerHTML:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/element.innerHTML","!doc":"Sets or gets the HTML syntax describing the element's descendants."},createdCallback:{"!type":"fn()","!url":"http://w3c.github.io/webcomponents/spec/custom/index.html#dfn-created-callback","!doc":"This callback is invoked after custom element instance is created and its definition is registered. The actual timing of this callback is defined further in this specification."},attachedCallback:{"!type":"fn()","!url":"http://w3c.github.io/webcomponents/spec/custom/index.html#dfn-entered-view-callback","!doc":"Unless specified otherwise, this callback must be enqueued whenever custom element is inserted into a document and this document has a browsing context."},detachedCallback:{"!type":"fn()","!url":"http://w3c.github.io/webcomponents/spec/custom/index.html#dfn-left-view-callback","!doc":"Unless specified otherwise, this callback must be enqueued whenever custom element is removed from the document and this document has a browsing context."},attributeChangedCallback:{"!type":"fn()","!url":"http://w3c.github.io/webcomponents/spec/custom/index.html#dfn-attribute-changed-callback","!doc":"Unless specified otherwise, this callback must be enqueued whenever custom element's attribute is added, changed or removed."}},"!url":"https://developer.mozilla.org/en/docs/DOM/Element","!doc":"Represents an element in an HTML or XML document."},Text:{"!type":"fn()",prototype:{"!proto":"Node.prototype",wholeText:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/Text.wholeText","!doc":"Returns all text of all Text nodes logically adjacent to the node. The text is concatenated in document order. This allows you to specify any text node and obtain all adjacent text as a single string."},splitText:{"!type":"fn(offset: number) -> +Text","!url":"https://developer.mozilla.org/en/docs/DOM/Text.splitText","!doc":"Breaks the Text node into two nodes at the specified offset, keeping both nodes in the tree as siblings."}},"!url":"https://developer.mozilla.org/en/docs/DOM/Text","!doc":"In the DOM, the Text interface represents the textual content of an Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children."},Document:{"!type":"fn()",prototype:{"!proto":"Node.prototype",activeElement:{"!type":"+Element","!url":"https://developer.mozilla.org/en/docs/DOM/document.activeElement","!doc":"Returns the currently focused element, that is, the element that will get keystroke events if the user types any. This attribute is read only."},compatMode:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/document.compatMode","!doc":"Indicates whether the document is rendered in Quirks mode or Strict mode."},designMode:{"!type":"string","!url":"https://developer.mozilla.org/en/docs/DOM/document.designMode","!doc":"Can be used to make any document editable, for example in a