[silva.core.editor][Emiliano D'Alterio] Fixed bug on the table s...

[email protected]
Newsgroups gmane.comp.web.zope.silva.cvs
Message-ID <[email protected]>
author:    Emiliano D'Alterio
date:      Thu Aug 08 17:02:07 2013 +0200
revision:  255:96df227b19e3 in silva.core.editor
branch:    
details:   https://hg.infrae.com/silva.core.editor?cmd=changeset;node=96df227b19e3
modified:  src/silva/core/editor/static/content.css src/silva/core/editor/static/content.min.css src/silva/core/editor/static/plugins/silvatablestyles/plugin.js src/silva/core/editor/static/plugins/silvautils/plugin.js src/silva/core/editor/static/skins/silva/editor.css
added:     
removed:   
log:       Fixed bug on the table styles menu not showing items upon inserting
	a table. Improved styling of tables in the editor.


diffstat:

 src/silva/core/editor/static/content.css                        |  38 +++++++--
 src/silva/core/editor/static/content.min.css                    |   2 +-
 src/silva/core/editor/static/plugins/silvatablestyles/plugin.js |   7 +-
 src/silva/core/editor/static/plugins/silvautils/plugin.js       |  13 +--
 src/silva/core/editor/static/skins/silva/editor.css             |  13 ++-
 5 files changed, 44 insertions(+), 29 deletions(-)

diffs (165 lines):

diff -r c4c87193b8a9 -r 96df227b19e3 src/silva/core/editor/static/content.css
--- a/src/silva/core/editor/static/content.css	Wed Aug 07 15:38:11 2013 +0200
+++ b/src/silva/core/editor/static/content.css	Thu Aug 08 17:02:07 2013 +0200
@@ -60,26 +60,42 @@
 
 /* table styling in ckeditor, it can be overridden by using '.ckeditor_contents' */
 
-table.plain, table.list {
+table.plain,
+table.list,
+table.grid {
+    width: 100%;
     border: none;
+    border-collapse: collapse
 }
 
-table.plain td {
-    border: 1px dashed #777;
+table.datagrid {
+    width: 100%;
+    border-collapse: separate;
+    border-spacing: 2px;
 }
 
-table.list td {
-    border: 1px solid #777;
-    border-right: none;
-    border-left: none;
+table.plain td, table.plain th {
+    border: 1px dashed #777;
+    text-align: left;
+    padding: 0 4px 0 0;
 }
 
-table.grid,
-table.grid td {
+table.list td, table.list th {
     border: 1px solid #777;
+    border-right: 1px dashed #777;
+    border-left: 1px dashed #777;
+    text-align: left;
+    padding: 0 4px 0 0;
 }
 
-table.datagrid,
-table.datagrid td {
+table.grid td, table.grid th {
+    border: 1px solid #777;
+    text-align: left;
+    padding: 0 2px;
+}
+
+table.datagrid td, table.datagrid th {
     border: 2px solid #777;
+    text-align: left;
+    padding: 0 2px;
 }
diff -r c4c87193b8a9 -r 96df227b19e3 src/silva/core/editor/static/content.min.css
--- a/src/silva/core/editor/static/content.min.css	Wed Aug 07 15:38:11 2013 +0200
+++ b/src/silva/core/editor/static/content.min.css	Thu Aug 08 17:02:07 2013 +0200
@@ -1,1 +1,1 @@
-body{font:70% Verdana,Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{margin:1em 0 0}h1{margin-top:.8em;margin-bottom:.7em;font-size:170%}h2{margin-bottom:.6em;font-size:145%}h3{margin-bottom:.5em;font-size:120%}h4{margin-bottom:.2em;font-size:110%}h5{margin-bottom:.1em;font-size:105%}ul{margin:.5em 0;padding-left:1.4em}ol{margin:.5em 0;padding-left:1.9em}p.lead{font-weight:700}p.annotation{font-style:italic}a.broken-link{color:#a00}table.plain,table.list{border:0}table.plain td{border:1px dashed #777}table.list td{border:1px solid #777;border-right:0;border-left:0}table.grid,table.grid td{border:1px solid #777}table.datagrid,table.datagrid td{border:2px solid #777}
\ No newline at end of file
+body{font:70% Verdana,Helvetica,Arial,sans-serif}h1,h2,h3,h4,h5,h6{margin:1em 0 0}h1{margin-top:.8em;margin-bottom:.7em;font-size:170%}h2{margin-bottom:.6em;font-size:145%}h3{margin-bottom:.5em;font-size:120%}h4{margin-bottom:.2em;font-size:110%}h5{margin-bottom:.1em;font-size:105%}ul{margin:.5em 0;padding-left:1.4em}ol{margin:.5em 0;padding-left:1.9em}p.lead{font-weight:700}p.annotation{font-style:italic}a.broken-link{color:#a00}table.plain,table.list,table.grid{width:100%;border:0;border-collapse:collapse}table.datagrid{width:100%;border-collapse:separate;border-spacing:2px}table.plain td,table.plain th{border:1px dashed #777;text-align:left;padding:0 4px 0 0}table.list td,table.list th{border:1px solid #777;border-right:1px dashed #777;border-left:1px dashed #777;text-align:left;paddin
 g:0 4px 0 0}table.grid td,table.grid th{border:1px solid #777;text-align:left;padding:0 2px}table.datagrid td,table.datagrid th{border:2px solid #777;text-align:left;padding:0 2px}
\ No newline at end of file
diff -r c4c87193b8a9 -r 96df227b19e3 src/silva/core/editor/static/plugins/silvatablestyles/plugin.js
--- a/src/silva/core/editor/static/plugins/silvatablestyles/plugin.js	Wed Aug 07 15:38:11 2013 +0200
+++ b/src/silva/core/editor/static/plugins/silvatablestyles/plugin.js	Thu Aug 08 17:02:07 2013 +0200
@@ -64,7 +64,7 @@
 
                     if (selected !== null && selected.getName() === 'table') {
 
-                        $('#cke_'+ this.id).slideDown(300);
+                        $('#cke_'+ this.id).show(500);
 
                         var id = null;
                         var table_style = null;
@@ -80,14 +80,13 @@
                         }
                         var default_table_style = table_styles[table_styles.order[0]];
                         selected.addClass(default_table_style.html_class);
-                        this.setValue(default_table_style.name);
+                        this.setValue(table_styles.order[0], default_table_style.name);
                     }
                     else {
                         this.setValue('');
-                        $('#cke_'+ this.id).slideUp(300);
+                        $('#cke_'+ this.id).hide(500);
                     }
                 }, this);
-                $('#cke_'+ this.id).slideDown(300);
             }
         });
     }
diff -r c4c87193b8a9 -r 96df227b19e3 src/silva/core/editor/static/plugins/silvautils/plugin.js
--- a/src/silva/core/editor/static/plugins/silvautils/plugin.js	Wed Aug 07 15:38:11 2013 +0200
+++ b/src/silva/core/editor/static/plugins/silvautils/plugin.js	Thu Aug 08 17:02:07 2013 +0200
@@ -107,16 +107,13 @@
              */
             getSelectedElement: function(editor) {
                 var selection = selection = editor.document.$.selection,
-                    range,
+                    range = selection.createRange(),
                     element = null;
 
-                if (selection.type != "None") {
-                    range = editor.document.$.selection.createRange();
-                    if (selection.type == "Text") {
-                        element = range.parentElement();
-                    } else if (range.length > 0) {
-                        element = range.item(0);
-                    };
+                if (selection.type == "Control") {
+                    element = range.item(0);
+                } else {
+                    element = range.parentElement();
                 };
                 if (element !== null) {
                     return new CKEDITOR.dom.element(element);
diff -r c4c87193b8a9 -r 96df227b19e3 src/silva/core/editor/static/skins/silva/editor.css
--- a/src/silva/core/editor/static/skins/silva/editor.css	Wed Aug 07 15:38:11 2013 +0200
+++ b/src/silva/core/editor/static/skins/silva/editor.css	Thu Aug 08 17:02:07 2013 +0200
@@ -962,7 +962,7 @@
 display:block;
 }
 
-.cke_skin_silva .cke_maximized .cke_resizer,.cke_skin_silva .cke_voice_label,.cke_skin_silva legend.cke_voice_label,cke_skin_silva .cke_panel_frame .cke_label,.cke_skin_silva a.cke_toolbox_collapser span,.cke_skin_silva .cke_hc .cke_button .cke_icon,.cke_skin_silva .cke_browser_gecko18 .cke_hc .cke_button .cke_icon,.cke_skin_silva .cke_menuarrow span,.cke_skin_silva .cke_rcombo .cke_openbutton span,.cke_skin_silva .cke_path .cke_label {
+.cke_skin_silva .cke_maximized .cke_resizer,.cke_skin_silva .cke_voice_label,.cke_skin_silva legend.cke_voice_label,.cke_skin_silva .cke_panel_frame .cke_label,.cke_skin_silva a.cke_toolbox_collapser span,.cke_skin_silva .cke_hc .cke_button .cke_icon,.cke_skin_silva .cke_browser_gecko18 .cke_hc .cke_button .cke_icon,.cke_skin_silva .cke_menuarrow span,.cke_skin_silva .cke_rcombo .cke_openbutton span,.cke_skin_silva .cke_path .cke_label {
 display:none;
 }
 
@@ -988,7 +988,7 @@
 }
 
 .cke_skin_silva .cke_browser_ie .cke_rtl .cke_toolgroup,.cke_skin_silva .cke_browser_ie .cke_rtl .cke_separator {
-#float:none;
+float:none;
 }
 
 .cke_skin_silva .cke_button a.cke_disabled *,.cke_skin_silva .cke_browser_ie a:hover.cke_button .cke_disabled *,.cke_skin_silva .cke_rcombo .cke_disabled .cke_label {
@@ -1019,8 +1019,8 @@
 }
 
 .cke_skin_silva .cke_browser_ie .cke_rcombo,.cke_skin_silva .cke_browser_ie .cke_toolgroup,.cke_skin_silva .cke_browser_ie .cke_separator {
-#display:inline;
-#float:none;
+display:inline;
+float:none;
 }
 
 .cke_skin_silva .cke_hc .cke_rcombo a,.cke_skin_silva .cke_hc .cke_rcombo .cke_label,.cke_skin_silva .cke_rcombo .cke_off a:hover,.cke_skin_silva .cke_rcombo .cke_off a:focus,.cke_skin_silva .cke_rcombo .cke_off a:active,.cke_skin_silva .cke_rcombo .cke_on a {
@@ -1045,9 +1045,12 @@
 width:150px;
 }
 
+.cke_table_style {
+    display: none;
+}
+
 @media print {
 .cke_skin_silva .cke_toolbox,.cke_path {
 display:none;
 }
 }
-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.