Produced by Araxis Merge on 2/1/2017 2:57:56 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM Portal\trunk\BTSSSPortal\js\ckeditor\samples\old\dialog | dialog.html | Tue Dec 20 19:50:51 2016 UTC |
| 2 | Wed Feb 1 19:57:56 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 190 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | <!DOCTYPE html> | |||||
| 2 | <!-- | |||||
| 3 | Copyright (c) 2003-2 015, CKSou rce - Fred erico Knab ben. All r ights rese rved. | |||||
| 4 | This softw are is cov ered by CK Editor Com mercial Li cense. Usa ge without proper li cense is p rohibited. | |||||
| 5 | --> | |||||
| 6 | <html> | |||||
| 7 | <head> | |||||
| 8 | <m eta charse t="utf-8"> | |||||
| 9 | <t itle>Using API to Cu stomize Di alog Windo ws — CKEditor Sample</ti tle> | |||||
| 10 | <s cript src= "../../../ ckeditor.j s"></scrip t> | |||||
| 11 | <l ink rel="s tylesheet" href="../ ../../samp les/old/sa mple.css"> | |||||
| 12 | <m eta name=" ckeditor-s ample-name " content= "Using the JavaScrip t API to c ustomize d ialog wind ows"> | |||||
| 13 | <m eta name=" ckeditor-s ample-grou p" content ="Advanced Samples"> | |||||
| 14 | <m eta name=" ckeditor-s ample-desc ription" c ontent="Us ing the di alog windo ws API to customize dialog win dows witho ut changin g the orig inal edito r code."> | |||||
| 15 | <s tyle> | |||||
| 16 | ||||||
| 17 | .cke _button__m ybutton_ic on | |||||
| 18 | { | |||||
| 19 | displa y: none !i mportant; | |||||
| 20 | } | |||||
| 21 | ||||||
| 22 | .cke _button__m ybutton_la bel | |||||
| 23 | { | |||||
| 24 | displa y: inline !important ; | |||||
| 25 | } | |||||
| 26 | ||||||
| 27 | </ style> | |||||
| 28 | <s cript> | |||||
| 29 | ||||||
| 30 | CKED ITOR.on( ' instanceCr eated', fu nction( ev ){ | |||||
| 31 | var ed itor = ev. editor; | |||||
| 32 | ||||||
| 33 | // Lis ten for th e "plugins Loaded" ev ent, so we are sure that the | |||||
| 34 | // "di alog" plug in has bee n loaded a nd we are able to do our | |||||
| 35 | // cus tomization s. | |||||
| 36 | editor .on( 'plug insLoaded' , function () { | |||||
| 37 | ||||||
| 38 | // If ou r custom d ialog has not been r egistered, do that n ow. | |||||
| 39 | if ( !CK EDITOR.dia log.exists ( 'myDialo g' ) ) { | |||||
| 40 | // We need to do the following trick to find out t he dialog | |||||
| 41 | // definit ion file U RL path. I n the real world, yo u would si mply | |||||
| 42 | // point t o an absol ute path d irectly, l ike "/mydi r/mydialog .js". | |||||
| 43 | var href = document. location.h ref.split( '/' ); | |||||
| 44 | href.pop() ; | |||||
| 45 | href.push( 'assets/m y_dialog.j s' ); | |||||
| 46 | href = hre f.join( '/ ' ); | |||||
| 47 | ||||||
| 48 | // Finally , register the dialo g. | |||||
| 49 | CKEDITOR.d ialog.add( 'myDialog ', href ); | |||||
| 50 | } | |||||
| 51 | ||||||
| 52 | // Regis ter the co mmand used to open t he dialog. | |||||
| 53 | editor.a ddCommand( 'myDialog Cmd', new CKEDITOR.d ialogComma nd( 'myDia log' ) ); | |||||
| 54 | ||||||
| 55 | // Add t he a custo m toolbar buttons, w hich fires the above | |||||
| 56 | // comma nd.. | |||||
| 57 | editor.u i.add( 'My Button', C KEDITOR.UI _BUTTON, { | |||||
| 58 | label: 'My Dialog', | |||||
| 59 | command: ' myDialogCm d' | |||||
| 60 | }); | |||||
| 61 | }); | |||||
| 62 | }); | |||||
| 63 | ||||||
| 64 | // W hen openin g a dialog , its "def inition" i s created for it, fo r | |||||
| 65 | // e ach editor instance. The "dial ogDefiniti on" event is then | |||||
| 66 | // f ired. We s hould use this event to make c ustomizati ons to the | |||||
| 67 | // d efinition of existin g dialogs. | |||||
| 68 | CKED ITOR.on( ' dialogDefi nition', f unction( e v ) { | |||||
| 69 | // Tak e the dial og name an d its defi nition fro m the even t data. | |||||
| 70 | var di alogName = ev.data.n ame; | |||||
| 71 | var di alogDefini tion = ev. data.defin ition; | |||||
| 72 | ||||||
| 73 | // Che ck if the definition is from t he dialog we're | |||||
| 74 | // int erested on (the "Lin k" dialog) . | |||||
| 75 | if ( d ialogName == 'myDial og' && ev. editor.nam e == 'edit or2' ) { | |||||
| 76 | // Get a reference to the "L ink Info" tab. | |||||
| 77 | var info Tab = dial ogDefiniti on.getCont ents( 'tab 1' ); | |||||
| 78 | ||||||
| 79 | // Add a new text field to t he "tab1" tab page. | |||||
| 80 | infoTab. add( { | |||||
| 81 | type: 'tex t', | |||||
| 82 | label: 'My Custom Fi eld', | |||||
| 83 | id: 'custo mField', | |||||
| 84 | 'default': 'Sample!' , | |||||
| 85 | validate: function() { | |||||
| 86 | if ( ( /\d/ ).test( th is.getValu e() ) ) | |||||
| 87 | retu rn 'My Cus tom Field must not c ontain dig its'; | |||||
| 88 | } | |||||
| 89 | }); | |||||
| 90 | ||||||
| 91 | // Remov e the "sel ect1" fiel d from the "tab1" ta b. | |||||
| 92 | infoTab. remove( 's elect1' ); | |||||
| 93 | ||||||
| 94 | // Set t he default value for "input1" field. | |||||
| 95 | var inpu t1 = infoT ab.get( 'i nput1' ); | |||||
| 96 | input1[ 'default' ] = 'www.e xample.com '; | |||||
| 97 | ||||||
| 98 | // Remov e the "tab 2" tab pag e. | |||||
| 99 | dialogDe finition.r emoveConte nts( 'tab2 ' ); | |||||
| 100 | ||||||
| 101 | // Add a new tab t o the "Lin k" dialog. | |||||
| 102 | dialogDe finition.a ddContents ( { | |||||
| 103 | id: 'custo mTab', | |||||
| 104 | label: 'My Tab', | |||||
| 105 | accessKey: 'M', | |||||
| 106 | elements: [ | |||||
| 107 | { | |||||
| 108 | id: 'myField1' , | |||||
| 109 | type : 'text', | |||||
| 110 | labe l: 'My Tex t Field' | |||||
| 111 | }, | |||||
| 112 | { | |||||
| 113 | id: 'myField2' , | |||||
| 114 | type : 'text', | |||||
| 115 | labe l: 'Anothe r Text Fie ld' | |||||
| 116 | } | |||||
| 117 | ] | |||||
| 118 | }); | |||||
| 119 | ||||||
| 120 | // Provi de the foc us handler to start initial fo cus in "cu stomField" field. | |||||
| 121 | dialogDe finition.o nFocus = f unction() { | |||||
| 122 | var urlFie ld = this. getContent Element( ' tab1', 'cu stomField' ); | |||||
| 123 | urlField.s elect(); | |||||
| 124 | }; | |||||
| 125 | } | |||||
| 126 | }); | |||||
| 127 | ||||||
| 128 | var config = { | |||||
| 129 | extraP lugins: 'd ialog', | |||||
| 130 | toolba r: [ [ 'My Button' ] ] | |||||
| 131 | }; | |||||
| 132 | ||||||
| 133 | </ script> | |||||
| 134 | </head> | |||||
| 135 | <body> | |||||
| 136 | <h 1 class="s amples"> | |||||
| 137 | <a h ref="../.. /../sample s/old/inde x.html">CK Editor Sam ples</a> & raquo; Usi ng CKEdito r Dialog A PI | |||||
| 138 | </ h1> | |||||
| 139 | <d iv class=" warning de precated"> | |||||
| 140 | This sample is not maint ained anym ore. Check out the < a href="ht tp://sdk.c keditor.co m/">brand new sample s in CKEdi tor SDK</a >. | |||||
| 141 | </ div> | |||||
| 142 | <d iv class=" descriptio n"> | |||||
| 143 | <p> | |||||
| 144 | This s ample show s how to u se the | |||||
| 145 | <a cla ss="sample s" href="h ttp://docs .ckeditor. com/#!/api /CKEDITOR. dialog">CK Editor Dia log API</a > | |||||
| 146 | to cus tomize CKE ditor dial og windows without c hanging th e original editor co de. | |||||
| 147 | The fo llowing cu stomizatio ns are bei ng done in the examp le below: | |||||
| 148 | </p> | |||||
| 149 | <p> | |||||
| 150 | For de tails on h ow to crea te this se tup check the source code of t his sample page. | |||||
| 151 | </p> | |||||
| 152 | </ div> | |||||
| 153 | <p >A custom dialog is added to t he editors using the <code>plu ginsLoaded </code> ev ent, from an externa l <a targe t="_blank" href="ass ets/my_dia log.js">di alog defin ition file </a>:</p> | |||||
| 154 | <o l> | |||||
| 155 | <li> <strong>Cr eating a c ustom dial og window< /strong> & ndash; "My Dialog" d ialog wind ow opened with the " My Dialog" toolbar b utton.</li > | |||||
| 156 | <li> <strong>Cr eating a c ustom butt on</strong > – Add button to open t he dialog with "My D ialog" too lbar butto n.</li> | |||||
| 157 | </ ol> | |||||
| 158 | <t extarea co ls="80" id ="editor1" name="edi tor1" rows ="10">< p>This is some &l t;strong&g t;sample t ext</st rong>. You are us ing <a href="http ://ckedito r.com/"> ;CKEditor& lt;/a>. </p> </textarea > | |||||
| 159 | <s cript> | |||||
| 160 | // R eplace the <textarea id="edito r1"> with an CKEdito r instance . | |||||
| 161 | CKED ITOR.repla ce( 'edito r1', confi g ); | |||||
| 162 | </ script> | |||||
| 163 | <p >The below editor mo dify the d ialog defi nition of the above added dial og using t he <code>d ialogDefin ition</cod e> event:< /p> | |||||
| 164 | <o l> | |||||
| 165 | <li> <strong>Ad ding dialo g tab</str ong> &ndas h; Add new tab "My T ab" to dia log window .</li> | |||||
| 166 | <li> <strong>Re moving a d ialog wind ow tab</st rong> &nda sh; Remove "Second T ab" page f rom the di alog windo w.</li> | |||||
| 167 | <li> <strong>Ad ding dialo g window f ields</str ong> &ndas h; Add "My Custom Fi eld" to th e dialog w indow.</li > | |||||
| 168 | <li> <strong>Re moving dia log window field</st rong> &nda sh; Remove "Select F ield" sele ction fiel d from the dialog wi ndow.</li> | |||||
| 169 | <li> <strong>Se tting defa ult values for dialo g window f ields</str ong> &ndas h; Set def ault value of "Text Field" tex t field. < /li> | |||||
| 170 | <li> <strong>Se tup initia l focus fo r dialog w indow</str ong> &ndas h; Put ini tial focus on "My Cu stom Field " text fie ld. </li> | |||||
| 171 | </ ol> | |||||
| 172 | <t extarea co ls="80" id ="editor2" name="edi tor2" rows ="10">< p>This is some &l t;strong&g t;sample t ext</st rong>. You are us ing <a href="http ://ckedito r.com/"> ;CKEditor& lt;/a>. </p> </textarea > | |||||
| 173 | <s cript> | |||||
| 174 | ||||||
| 175 | // R eplace the <textarea id="edito r1"> with an CKEdito r instance . | |||||
| 176 | CKED ITOR.repla ce( 'edito r2', confi g ); | |||||
| 177 | ||||||
| 178 | </ script> | |||||
| 179 | <d iv id="foo ter"> | |||||
| 180 | <hr> | |||||
| 181 | <p> | |||||
| 182 | CKEdit or - The t ext editor for the I nternet - <a class=" samples" h ref="http: //ckeditor .com/">htt p://ckedit or.com</a> | |||||
| 183 | </p> | |||||
| 184 | <p i d="copy"> | |||||
| 185 | Copyri ght © 2003-2015 , <a class ="samples" href="htt p://cksour ce.com/">C KSource</a > - Freder ico | |||||
| 186 | Knabbe n. All rig hts reserv ed. | |||||
| 187 | </p> | |||||
| 188 | </ div> | |||||
| 189 | </body> | |||||
| 190 | </html> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.