Commits

Luke Plant committed adf0e19

Replaced 'optsbox' with the more descriptive 'classlist'

Comments (0)

Files changed (2)

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

 PresentationControls.prototype.setup_controls = function(container) {
     var id_prefix = "id_prescontrol_" + this.name + "_";
     var headingsbox_id = id_prefix + 'headings';
-    var optsbox_id = id_prefix + 'optsbox';
+    var classlist_id = id_prefix + 'classlist';
     var headingsfilter_id = id_prefix + 'headingsfilter';
     var previewbutton_id = id_prefix + 'previewbutton';
     var previewbox_id = id_prefix + 'previewbox';
     // Create elements
     container.after(
 	"<div class=\"prescontrol\">" +
-	"<div class=\"prescontroloptsboxcont\">Presentation choices:<div class=\"prescontroloptsbox\" id=\"" + optsbox_id + "\"></div>" +
+	"<div class=\"prescontrolclasslistcont\">Presentation choices:<div class=\"prescontrolclasslist\" id=\"" + classlist_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  +"\" />" +
 
     jQuery("body").append("<div style=\"position: absolute; display: none\" class=\"previewbox\" id=\"" + previewbox_id + "\">");
 
-    this.optsbox = jQuery('#' + optsbox_id);
+    this.classlist = jQuery('#' + classlist_id);
     this.headingscontrol = jQuery('#' + headingsbox_id);
     this.headingsfilter = jQuery('#' + headingsfilter_id);
     this.errorbox = jQuery('#' + id_prefix + "errorbox");
     this.newcolbutton = jQuery('#' + newcolbutton_id);
     this.removebutton = jQuery('#' + removebutton_id);
     this.cleanhtmlbutton = jQuery('#' + cleanhtmlbutton_id);
-    this.optsbox.css('height', this.headingscontrol.get(0).clientHeight.toString() + "px");
+    this.classlist.css('height', this.headingscontrol.get(0).clientHeight.toString() + "px");
 
     // Initial set up
     this.retrieve_styles();
 
     // Event handlers
     this.headingscontrol.change(function(event) {
-				    self.update_optsbox();
+				    self.update_classlist();
     });
     this.refreshbutton.click(function(event) {
 				 self.refresh_headings();
 		  self.form_submit(event);
 	      });
 
-    // Other event handlers added in update_optsbox
+    // Other event handlers added in update_classlist
 };
 
 PresentationControls.prototype.set_html = function(html) {
     }
 };
 
-PresentationControls.prototype.build_optsbox = function() {
-    this.optsbox.empty();
+PresentationControls.prototype.build_classlist = function() {
+    this.classlist.empty();
     // Remove any tooltips
     jQuery(".orbitaltooltip-simplebox").unbind().remove();
 
     var self = this;
     jQuery.each(this.available_styles, function(i, item) {
 	var val = flattenPresStyle(item);
-	self.optsbox.append("<div><label><input type=\"checkbox\" value=\"" +
+	self.classlist.append("<div><label><input type=\"checkbox\" value=\"" +
 			    escapeHtml(val) + "\" /> " +
 			    escapeHtml(item.verbose_name) +
 			    "</label></div>");
 	// Attach tooltip to label we just added:
-	self.optsbox.find("input[value='" + val + "']").parent().each(function() {
+	self.classlist.find("input[value='" + val + "']").parent().each(function() {
 	    var help = item.description;
 	    if (help == "") {
 		help = "(No help available)";
             help = help + '<br/><hr/><p>Can be used on these elements:</p><p>' + item.allowed_elements.join(' ') + '</p>';
 	    // Assign an id, because orbitaltooltip
             // doesn't work without it.
-	    $(this).attr('id', 'id_optsbox_label_' + i);
+	    $(this).attr('id', 'id_classlist_label_' + i);
             var inputitem = this;
             setTimeout(function() {
 	        $(inputitem).orbitaltooltip({
 					      });
 };
 
-PresentationControls.prototype.unbind_optsbox = function() {
+PresentationControls.prototype.unbind_classlist = function() {
     // Remove existing event handlers, reset state
-    this.optsbox.find("input").unbind().removeAttr("checked").attr("disabled", true);
+    this.classlist.find("input").unbind().removeAttr("checked").attr("disabled", true);
 };
 
 PresentationControls.prototype.get_heading_index = function() {
     return parseInt(selected, 10);
 };
 
-PresentationControls.prototype.update_optsbox = function() {
+PresentationControls.prototype.update_classlist = function() {
     var self = this;
-    this.unbind_optsbox();
+    this.unbind_classlist();
     // Currently selected heading?
     var headingIndex = self.get_heading_index();
     if (headingIndex == null) return;
 	styles = new Array();
 	this.presentation_info[sect_id] = styles;
     }
-    this.optsbox.find("input").each(
+    this.classlist.find("input").each(
 	function(i, input) {
 	    // Set state
 	    var val = input.value;
 
 PresentationControls.prototype.update_headingbox = function() {
     var self = this;
-    this.unbind_optsbox();
+    this.unbind_classlist();
     this.headingscontrol.empty();
     jQuery.each(this.active_heading_list, function(i, item) {
 		    var spaces = (new Array((item.level - 1)*3)).join("&nbsp;");
 		   function (data) {
 		       self.with_good_data(data, function(value) {
 			   self.available_styles = data.value;
-			   self.build_optsbox();
+			   self.build_classlist();
 		       });
 		   });
 };

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

 	.prescontrol td             { padding: 0; }
 	.prescontrolheadings        { margin-right: 260px; }
 	.prescontrolheadings select { background: inherit; border: none; width: 100%;}
-	.prescontroloptsboxcont div { clear:left; }
-	.prescontroloptsbox         { overflow-y: scroll; border: none; }
+	.prescontrolclasslistcont div { clear:left; }
+	.prescontrolclasslist         { overflow-y: scroll; border: none; }
 	.prescontrolerror           { color: red; text-align: center; padding-top: 5px; }
-	.prescontroloptsboxcont {width: 220px; float: right;}
-	.prescontrol .prescontroloptsbox label {
+	.prescontrolclasslistcont {width: 220px; float: right;}
+	.prescontrol .prescontrolclasslist label {
 	    /* Override some stuff set by Django admin CSS*/
 	    display: inline;
 	    width: auto;