| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>Editor Test: LinkDialog Plugin</title> |
| 6 | |
| 7 | <script type="text/javascript" src="../boilerplate.js"></script> |
| 8 | |
| 9 | <script type="text/javascript"> |
| 10 | function filterLink () { |
| 11 | return 'Filtered Value'; |
| 12 | } |
| 13 | |
| 14 | require([ |
| 15 | "dojo/parser", |
| 16 | "dijit/Editor", |
| 17 | "dijit/_editor/plugins/LinkDialog", |
| 18 | "dijit/_editor/plugins/ViewSource", |
| 19 | "dojo/domReady!" |
| 20 | ], function(parser){ |
| 21 | parser.parse(); |
| 22 | }); |
| 23 | </script> |
| 24 | </head> |
| 25 | <body class="claro" role="main"> |
| 26 | <div style="border: 1px dotted black;"> |
| 27 | <div id="editor" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor",extraPlugins:["createLink", "insertImage", "viewSource"]'> |
| 28 | <ol> |
| 29 | <li>The LinkDialog plugin is an 'example' style plugin that shows how to insert basic web links as well as |
| 30 | image tags. This plugin is intended to guide users in writing their own, more complex, link and image handlers |
| 31 | while still providing useful function.</li> |
| 32 | </ol> |
| 33 | <br> |
| 34 | <div><a href="http://www.example.com/example.html" target="_top" id="exampleLink">This is an example link in the page.</a></div> |
| 35 | <br> |
| 36 | <br> |
| 37 | <div><img src="./sample.jpg" alt="Sample Image" id="exampleImage" /></div> |
| 38 | <br> |
| 39 | <br> |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | <p>Editor with <code>allowUnsafeHtml</code> set to <code>true</code></p> |
| 44 | <div style="border: 1px dotted black;"> |
| 45 | <div id="editorUnsafe" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor",extraPlugins:[{name: "createLink", allowUnsafeHtml: true}, "insertImage", "viewSource"]'> |
| 46 | <p>This editor will allow unrestricted HTML in the Description field of links</p> |
| 47 | <br> |
| 48 | </div> |
| 49 | </div> |
| 50 | |
| 51 | <p>Editor with custom <code>linkFilter</code> function</p> |
| 52 | <div style="border: 1px dotted black;"> |
| 53 | <div id="editorLinkFilter" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor",extraPlugins:[{name: "createLink", linkFilter: filterLink}, "insertImage", "viewSource"]'> |
| 54 | <p>Links created in this editor will always have a description of "Filtered Value", which is the value returned by the custom <code>linkFilter</code> function.</p> |
| 55 | <br> |
| 56 | </div> |
| 57 | </div> |
| 58 | |
| 59 | <p>RTL Editor:</p> |
| 60 | <div style="border: 1px dotted black;"> |
| 61 | <div id="reditor" data-dojo-type="dijit/Editor" dir="rtl" data-dojo-props='"aria-label":"reditor",extraPlugins:["createLink", "insertImage"]'> |
| 62 | <ol> |
| 63 | <li>The LinkDialog plugin is an 'example' style plugin that shows how to insert basic web links as well as |
| 64 | image tags. This plugin is intended to guide users in writing their own, more complex, link and image handlers |
| 65 | while still providing useful function.</li> |
| 66 | </ol> |
| 67 | <br> |
| 68 | <div><a href="http://www.example.com/example.html" target="_top" id="rexampleLink">This is an example link in the page.</a></div> |
| 69 | <br> |
| 70 | <br> |
| 71 | <div><img src="./sample.jpg" alt="Sample Image" id="rexampleImage" /></div> |
| 72 | <br> |
| 73 | <br> |
| 74 | </div> |
| 75 | </div> |
| 76 | </body> |
| 77 | </html> |