Commits

dja...@v026.medcn.uwcm.ac.uk  committed 12db72e

modifications by Daniele

  • Participants
  • Parent commits 6fe4e59

Comments (0)

Files changed (5)

File semanticeditor/cms_plugins.py

 
 class SemanticTextPlugin(TextPlugin):
 
-    name = _("Text with presentation")
+    name = _("Text/layout")
 
     def get_editor_widget(self, request, plugins):
         return SemanticEditor(installed_plugins=plugins)

File semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

     // Create elements
     container.after(
 	"<div class=\"prescontrol\">" +
-	"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"50%\"><div class=\"prescontrolheadings\">Structure:<br/><select size=\"7\" id=\"" + headingsbox_id + "\"></select>" +
-	"<br/><label><input type=\"checkbox\" id=\"" + headingsfilter_id + "\"> Headings only</label></div></td>" +
-	"<td width=\"50%\"><div class=\"prescontroloptsboxcont\">Presentation choices:<div class=\"prescontroloptsbox\" id=\"" + optsbox_id + "\"></div>" +
+	"<div class=\"prescontroloptsboxcont\">Presentation choices:<div class=\"prescontroloptsbox\" id=\"" + optsbox_id + "\"></div>" +
         "<input type=\"submit\" value=\"New row\" id=\"" + newrowbutton_id  +"\" />" +
         "<input type=\"submit\" value=\"New column\" id=\"" + newcolbutton_id  +"\" />" +
         "<input type=\"submit\" value=\"Remove\" id=\"" + removebutton_id  +"\" />" +
-        "</div></td></tr></table>" +
+        "</div>" +
+    "<div class=\"prescontrolheadings\" style=\"margin-right: 260px;\">Document structure:<br/><select size=\"15\" id=\"" + headingsbox_id + "\"></select>" +
+	"<br/><label><input type=\"checkbox\" id=\"" + headingsfilter_id + "\"> Headings only</label></div>" +
+
 	"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>" +
 	    "<td><input type=\"submit\" value=\"Refresh structure\" id=\"" + refresh_id + "\" /></td>" +
 	    "<td><input type=\"submit\" value=\"Preview\" id=\"" + previewbutton_id + "\" /></td>" +
                     var caption = "";
                     var tag = item.tag.toLowerCase();
                     if (tag == 'row' || tag == 'column') {
-                        caption = "[" + escapeHtml(item.name) + "]";
+                        caption = escapeHtml(item.name);
                     } else {
                         caption = tag + ": " + escapeHtml(item.name);
                     }
-		    self.headingscontrol.append("<option value='" + i.toString() + "'>" + spaces + caption + "</option>");
+		    self.headingscontrol.append("<option class ='" + tag + "' value='" + i.toString() + "'>" + spaces + caption + "</span>" + "</option>");
     });
 };
 

File semanticeditor/media/semanticeditor/javascript/wymeditor/skins/semanticeditor/skin.css

 
 
 /*HIDDEN BY DEFAULT*/
-        .wym_skin_semanticeditor .wym_area_left          { display: none; }
+        .wym_skin_semanticeditor .wym_area_left          { display: block; }
         .wym_skin_semanticeditor .wym_area_right         { display: block; }
 
 
 /*TYPO*/    
-        .wym_skin_semanticeditor                { font-size: 62,5%; font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", Verdana, Arial, sans-serif }
+        .wym_skin_semanticeditor                { font-size: 62,5%; font-family: "Lucida Grande", "DejaVu Sans", "Bitstream Vera Sans", sans-serif }
         .wym_skin_semanticeditor h2             { font-size: 110%; /* = 11px */}
         .wym_skin_semanticeditor h3             { font-size: 100%; /* = 10px */}
         .wym_skin_semanticeditor li             { font-size: 100%; /* = 10px */}
 
 /*WYM_IFRAME*/
         .wym_skin_semanticeditor .wym_iframe             { width: 98%;}
-        .wym_skin_semanticeditor .wym_iframe iframe      { width: 100%; height: 200px; border: 1px solid #ccc; background: white }
+        .wym_skin_semanticeditor .wym_iframe iframe      { width: 100%; height: 400px; border: 1px solid #ccc; background: white }
 
 
 /*AREAS*/
         .wym_skin_semanticeditor .wym_section            { margin-bottom: 5px; }
         .wym_skin_semanticeditor .wym_section h2,
         .wym_skin_semanticeditor .wym_section h3         { padding: 1px 3px; margin: 0; color:#333; }
-        .wym_skin_semanticeditor .wym_section a          { padding: 0 3px; display: block; text-decoration: none; color: black; }
-        .wym_skin_semanticeditor .wym_section a:hover    { background-color: #eaeaea; }
+        .wym_skin_semanticeditor .wym_section a          { padding: 0 5px; display: block; text-decoration: none; color: #903; 
+            margin: 4px 0;
+            font-family: "Futura";
+            background: #cde8cd ;
+        }
+        .wym_skin_semanticeditor .wym_section a:hover    { background-color: #903; color: #cde8cd;}
       /*hide section titles by default*/
         .wym_skin_semanticeditor .wym_section h2         { display: none; }
       /*disable any margin-collapse*/
 
 
 /* SEMANTIC EDITOR PRESENTATION CONTROLS */
+    div.prescontrol             {border-top: 1px solid black; padding-top: 20px;}
 	.prescontrol td             { padding: 0; }
-	.prescontrolheadings        {  }
-	.prescontrolheadings select { min-width: 150px; }
+	.prescontrolheadings        { margin-right: 260px; }
+	.prescontrolheadings select { background: inherit; border: none; width: 100%;}
 	.prescontroloptsboxcont div { clear:left; }
-	.prescontroloptsbox         { overflow-y: scroll; }
+	.prescontroloptsbox         { overflow-y: scroll; border: none; }
 	.prescontrolerror           { color: red; text-align: center; padding-top: 5px; }
+	.prescontroloptsboxcont {width: 220px; float: right;}
 	.prescontrol .prescontroloptsbox label {
 	    /* Override some stuff set by Django admin CSS*/
 	    display: inline;
 	    float: none;
 	    /* Make them harder to 'fall off' w.r.t tooltips */
 	    line-height: 1.5em;
+	    font-size: 100%;
+	    font-family: "Futura", "Helvetica";
 	}
         .prescontrol .prescontrolheadings label {
             display: inline; /* override hiding */
             float: none;
         }
 
+    .prescontrol td {border: none;}    
+
 /* TOOLTIPS */
 
 	.orbitaltooltip-simplebox {
 	    width: 25%;
 	}
 
+.prescontrolheadings select { border: 1px solid #ccc; font-family: "Gill Sans"; font-size: 110%;}
+.prescontrolheadings option {color: #666;}
+.prescontrolheadings option.column  {color: blue; }
+.prescontrolheadings option.row  {color: black; }

File semanticeditor/utils/presentation.py

 preview_blockdef = technical_blockdef
 
 # The number of chars we trim block level elements to.
-BLOCK_LEVEL_TRIM_LENGTH = 20
+BLOCK_LEVEL_TRIM_LENGTH = 200
 
 ### Layout CSS class names ###
 

File semanticeditor/widgets.py

 from cms.plugins.text import settings as wym_settings
-from cms.plugins.text.widgets import WYMEditor
+from cms.plugins.text.widgets.wymeditor_widget import WYMEditor
 from cms.settings import CMS_MEDIA_URL
 from django import forms
 from django.conf import settings as global_settings