| 1 |
<!DOCTYPE html> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 5 |
<title>Editor Table Plugins</title> |
| 6 |
<style type="text/css"> |
| 7 |
@import "../../../dojo/resources/dojo.css"; |
| 8 |
@import "../../../dijit/themes/claro/claro.css"; |
| 9 |
@import "../../widget/ColorPicker/ColorPicker.css"; |
| 10 |
</style> |
| 11 |
|
| 12 |
<link href="../plugins/resources/editorPlugins.css" type="text/css" rel="stylesheet" /> |
| 13 |
|
| 14 |
<script type="text/javascript"> |
| 15 |
var dojoConfig = { |
| 16 |
async: true, |
| 17 |
isDebug: true, |
| 18 |
popup:true |
| 19 |
//forceFirebugLite:true |
| 20 |
}; |
| 21 |
</script> |
| 22 |
|
| 23 |
<script type="text/javascript" src="../../../dojo/dojo.js"></script> |
| 24 |
|
| 25 |
|
| 26 |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
| 27 |
|
| 28 |
<script> |
| 29 |
require([ |
| 30 |
"dojo/_base/kernel", |
| 31 |
"dojo/on", |
| 32 |
"dojo/parser", |
| 33 |
"dijit/registry", |
| 34 |
"dijit/Editor", |
| 35 |
"dijit/form/Button", |
| 36 |
"dojox/editor/plugins/TablePlugins", |
| 37 |
"dijit/_editor/plugins/ViewSource", |
| 38 |
"dojo/domReady" |
| 39 |
], function(kernel, on, parser, registry) { |
| 40 |
console.log(kernel.version.toString()); |
| 41 |
|
| 42 |
parser.parse(); |
| 43 |
|
| 44 |
var editor = registry.byId("editor"); |
| 45 |
var button = registry.byId("removeButton"); |
| 46 |
var c = on(button, "click", function(){ |
| 47 |
c.remove(); |
| 48 |
editor.close(); |
| 49 |
editor.destroy(); |
| 50 |
}); |
| 51 |
}); |
| 52 |
</script> |
| 53 |
<style> |
| 54 |
#main{ |
| 55 |
width:auto; |
| 56 |
margin:20px 100px; |
| 57 |
} |
| 58 |
</style> |
| 59 |
</head> |
| 60 |
<body class="claro"> |
| 61 |
<div id="main"> |
| 62 |
<div id="editor" data-dojo-type="dijit/Editor" |
| 63 |
data-dojo-props="height: '200px', plugins: [ |
| 64 |
'undo', 'redo', 'bold','italic','|', |
| 65 |
{name: 'insertTable'}, |
| 66 |
{name: 'modifyTable'}, |
| 67 |
{name: 'insertTableRowBefore'}, |
| 68 |
{name: 'insertTableRowAfter'}, |
| 69 |
{name: 'insertTableColumnBefore'}, |
| 70 |
{name: 'insertTableColumnAfter'}, |
| 71 |
{name: 'deleteTableRow'}, |
| 72 |
{name: 'deleteTableColumn'}, |
| 73 |
{name: 'colorTableCell'}, |
| 74 |
{name: 'tableContextMenu'} |
| 75 |
]"> |
| 76 |
Dojo Rocks with a fox in socks. Red socks. In a box. |
| 77 |
<br/><br/> |
| 78 |
<table width="200" border="2" cellpadding="2" cellspacing="2" id="myTable" |
| 79 |
style="border-color: #0ff; background-color: #f00"> |
| 80 |
<tr> |
| 81 |
<td> </td> |
| 82 |
<td> </td> |
| 83 |
<td> </td> |
| 84 |
</tr> |
| 85 |
<tr> |
| 86 |
<td> </td> |
| 87 |
<td id="myCell"> </td> |
| 88 |
<td> </td> |
| 89 |
</tr> |
| 90 |
<tr> |
| 91 |
<td> </td> |
| 92 |
<td> </td> |
| 93 |
<td bgcolor="#00FFFF">Text</td> |
| 94 |
</tr> |
| 95 |
</table> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<button id="removeButton" data-dojo-type="dijit/form/Button">Remove Editor</button> |
| 99 |
<hr> |
| 100 |
<h2>Test Different Color Picker in modifyTable and colorTableCell</h2> |
| 101 |
<p>This test uses the dojox/widget/ColorPicker picker in modifyTable, which normally uses dijit/ColorPalette, and vice versa for colorTableCell.</p> |
| 102 |
<div id="editor2" data-dojo-type="dijit/Editor" style="height: 200px" |
| 103 |
data-dojo-props="plugins: [ 'undo', 'redo', 'bold','italic','|', |
| 104 |
{name: 'modifyTable', colorPicker: 'dojox/widget/ColorPicker'}, |
| 105 |
{name: 'colorTableCell', colorPicker: 'dijit/ColorPalette'}]"> |
| 106 |
Dojo Rocks with a fox in socks. Red socks. In a box. |
| 107 |
<br/><br/> |
| 108 |
<table width="200" border="2" cellpadding="2" id="myTable2" |
| 109 |
style="border-color: #0ff; background-color: #f00"> |
| 110 |
<tr> |
| 111 |
<td> </td> |
| 112 |
<td> </td> |
| 113 |
<td> </td> |
| 114 |
</tr> |
| 115 |
<tr> |
| 116 |
<td> </td> |
| 117 |
<td id="myCell2"> </td> |
| 118 |
<td> </td> |
| 119 |
</tr> |
| 120 |
<tr> |
| 121 |
<td> </td> |
| 122 |
<td> </td> |
| 123 |
<td bgcolor="#00FFFF">Text</td> |
| 124 |
</tr> |
| 125 |
</table> |
| 126 |
</div> |
| 127 |
|
| 128 |
</body> |
| 129 |
</html> |