diff --git a/UNLexample.shtml b/UNLexample.shtml index 156c272fbba297e0cfb165f15de16a6daf5405c2..7703b73c93704f0bda08aa92775d194c5d4af75d 100644 --- a/UNLexample.shtml +++ b/UNLexample.shtml @@ -47,7 +47,7 @@ WDN.loadJS("jquery.tinymce.js",function () { theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", - theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,|,unlZenBox,unlLayout,unlTooltip,unlTabs", + theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,|,unlZenBox,unlLayout,unlGrid,unlTooltip,unlTabs", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", diff --git a/designfiles/icons.psd b/designfiles/icons.psd index 5230f789fa533ae41021b72b3ad4fb52a4b094f3..7aa857d62e33017df47ee047d273fcc8e315eb9d 100644 Binary files a/designfiles/icons.psd and b/designfiles/icons.psd differ diff --git a/plugins/unl/editor_plugin.js b/plugins/unl/editor_plugin.js index 0c9563b436418cd9ad445b543601b2809765cd71..7bf9c74a60044779b22c2f695efbb8e70126f329 100644 --- a/plugins/unl/editor_plugin.js +++ b/plugins/unl/editor_plugin.js @@ -274,6 +274,19 @@ Unl.hasParentNodeWithClass = function(childNode, parentClass) { ed.selection.setContent('<table class="zentable neutral"><thead><tr><th colspan="3">zentable neutral</th></tr></thead><tbody><tr><td>row1 col1</td><td>row1 col2</td><td>row1 col3</td></tr><tr><td>row2 col1</td><td>row2 col2</td><td>row2 col3</td></tr></tbody></table>'); }); + // WDN Grid http://wdn.unl.edu/documentation/layouts.shtml + ed.addCommand('mceUnlGrid', function() { + ed.windowManager.open({ + file : url + '/grid.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250, + inline : 1 + }, { + plugin_url : url + }); + }); + ed.addButton('unlGrid', {title : 'Add Grid Layout', cmd : 'mceUnlGrid', 'class' : 'unlGrid'}); + // WDN Tabs ed.addCommand('mceUnlTabs', function() { ed.windowManager.open({ @@ -393,14 +406,14 @@ Unl.hasParentNodeWithClass = function(childNode, parentClass) { case 'unlLayout': var c = cm.createSplitButton('unlLayout', { - title: 'Add Layout', + title: 'Add Col Layout (Deprecated)', 'class' : 'unlLayout', onclick: function() { this.control_manager.get('unlLayout').showMenu(); } }); c.onRenderMenu.add(function(c, m) { - m.add({title: 'UNL Layouts', 'class': 'mceMenuItemTitle'}).setDisabled(1); + m.add({title: 'UNL Layouts (Deprecated)', 'class': 'mceMenuItemTitle'}).setDisabled(1); m.add({title: 'Two Column (1/3)', cmd: 'mceUnlCol13'}); m.add({title: 'Two Column (2/2)', cmd: 'mceUnlCol22'}); m.add({title: 'Two Column (3/1)', cmd: 'mceUnlCol31'}); diff --git a/plugins/unl/grid.htm b/plugins/unl/grid.htm new file mode 100644 index 0000000000000000000000000000000000000000..cda2f6bc50547f8e3f51cf501ca29ce67eaafe12 --- /dev/null +++ b/plugins/unl/grid.htm @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>{#advanced_dlg.unl_grid_title}</title> + <script type="text/javascript" src="../../tiny_mce_popup.js"></script> + <script type="text/javascript" src="js/grid.js"></script> +</head> +<body style="display: none"> +<form onsubmit="UnlGridDialog.submit();return false;" action="#"> + <table border="0" cellpadding="4" cellspacing="0"> + <tr> + <td colspan="2" class="title">{#advanced_dlg.unl_grid_title}</td> + </tr> + <tr> + <td class="nowrap">Grid Numbers:</td> + <td><input name="gridValues" type="text" class="mceFocus" id="gridValues" value="3,6,3" style="width: 100px" /></td> + </tr> + <tr> + <td colspan="2">Enter numbers only; separated by commas (e.g. 9,3)</td> + </tr> + </table> + + <div class="mceActionPanel"> + <input type="submit" id="insert" name="insert" value="{#update}" /> + <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> + </div> +</form> +</body> +</html> diff --git a/plugins/unl/js/grid.js b/plugins/unl/js/grid.js new file mode 100644 index 0000000000000000000000000000000000000000..5fdc78a6997f35b21c2e37ed3775d3820196e2fb --- /dev/null +++ b/plugins/unl/js/grid.js @@ -0,0 +1,36 @@ +tinyMCEPopup.requireLangPack(); + +var UnlGridDialog = { + init : function(ed) { + this.editor = ed; + }, + + submit : function() { + var ed = this.editor, elm, values = document.forms[0].gridValues.value; + var selection = tinyMCEPopup.editor.selection; + var grid = values.split(','); + + tinyMCEPopup.restoreSelection(); + + elm = ed.dom.getParent(ed.selection.getNode(), 'P'); + + if (elm) { + ed.dom.remove(elm); + } + + var newContent = '<div class="grid'+grid[0]+' first">' + selection.getContent() + ' </div>'; + + for (var i=1;i<grid.length;i++) { + newContent = newContent + '<div class="grid'+grid[i]+'"> </div>'; + } + + newContent = '<p> </p>' + newContent + '<p class="clear"> </p>'; + + selection.setContent(newContent); + + tinyMCEPopup.close(); + return false; + } +}; + +tinyMCEPopup.onInit.add(UnlGridDialog.init, UnlGridDialog); diff --git a/plugins/unl/langs/en_dlg.js b/plugins/unl/langs/en_dlg.js new file mode 100644 index 0000000000000000000000000000000000000000..9cd38ff3a8fb4431278dbcbca4761fd4e3f02bd8 --- /dev/null +++ b/plugins/unl/langs/en_dlg.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.advanced_dlg',{ +unl_grid_title:"Insert Empty Grid Columns", +}); \ No newline at end of file diff --git a/themes/advanced/skins/unl/content.css b/themes/advanced/skins/unl/content.css index 58dbfa256f5d6cd0d9dfbfb7871ae1ac26464123..e1c9a997443ba7eb7f2f1561ef16387a608ff661 100644 --- a/themes/advanced/skins/unl/content.css +++ b/themes/advanced/skins/unl/content.css @@ -1,4 +1,4 @@ -/* themes/advanced/skins/default/content.css +/* themes/advanced/skins/unl/content.css ********************************************/ /*body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}*/ body {background:#FFF;} @@ -36,7 +36,7 @@ scrollbar-track-color:#F5F5F5; /* UNL UI helpers for tinymce *****************************/ -#maincontent{ +#maincontent { width: 960px; margin: 0 auto !important; } @@ -53,9 +53,13 @@ scrollbar-track-color:#F5F5F5; -webkit-border-top-right-radius: 5px; } /* UI tweaks not visible in rendered page to help our users */ -.col,.one_col,.two_col,.three_col { - border: 1px dashed #ccc; - margin: -1px; +.col,.one_col,.two_col,.three_col, +.grid1, .grid2, .grid3, .grid4, .grid5, .grid6, .grid7, .grid8, .grid9, .grid10, .grid11, .grid12 { + outline: 1px dashed #ccc; +} +#maincontent .first { + clear: left; + margin-left: 0; } #monthwidget { diff --git a/themes/advanced/skins/unl/img/icons.png b/themes/advanced/skins/unl/img/icons.png index 954bcdce4ad38374b9f8680c322ea3dc9c594720..fc7541bedd79ca4d84027b6f89b1dcbc70fc33dd 100644 Binary files a/themes/advanced/skins/unl/img/icons.png and b/themes/advanced/skins/unl/img/icons.png differ diff --git a/themes/advanced/skins/unl/ui.css b/themes/advanced/skins/unl/ui.css index 40c10edc640b371e5d37dc7c67df1632c00b80b7..d4eb0141d1932398b630fa2a99c7e19217c59d67 100644 --- a/themes/advanced/skins/unl/ui.css +++ b/themes/advanced/skins/unl/ui.css @@ -990,16 +990,19 @@ /*UNL Plugin*/ .unlSkin .unlZenBox span.mceAction { - background-position: -40px -40px; + background-position: -40px -40px; } .unlSkin .unlLayout span.mceAction { - background-position: -60px -40px; + background-position: -60px -40px; } .unlSkin .unlTabs span.mceIcon { - background-position: -80px -40px; + background-position: -80px -40px; } .unlSkin .unlTooltip span.mceIcon { - background-position: -100px -40px; + background-position: -100px -40px; +} +.unlSkin .unlGrid span.mceIcon { + background-position: -120px -40px; } /* border */