Commits

Luke Plant committed eff8b09

Gave style buttons a border that indicates if they are used by current section

Comments (0)

Files changed (2)

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

 PresentationControls.prototype.build_classlist = function() {
     var self = this;
     this.build_list_generic(this.classlist, this.available_styles,
-                            function(style) { self.toggle_style(style); },
+                            function(style, btn) { self.toggle_style(style, btn); },
                             'id_classlist_');
 };
 
 PresentationControls.prototype.build_commandlist = function () {
     var self = this;
     this.build_list_generic(this.commandlist, this.commands,
-                            function(command) { self.do_command(command); },
+                            function(command, btn) { self.do_command(command); },
                             'id_commandlist_');
 };
 
         var style = stylelist[i];
 
         btn.click(function(event) {
-                      btn_action(style);
+                      btn_action(style, btn);
                   });
 
         // Attach tooltip to label we just added:
     return undefined;
 };
 
-PresentationControls.prototype.toggle_style = function(style) {
+PresentationControls.prototype.toggle_style = function(style, btn) {
     // What section are we on?
     var sect_id = this.get_current_section(style);
     if (sect_id == undefined) {
         this.add_style(sect_id, style);
     }
     this.update_style_display(sect_id);
+    this.update_classlist_item(btn, style);
 };
 
 PresentationControls.prototype.insert_command_block = function(sect_id, command) {
             btn.removeClass("disabled");
         else
             btn.show();
+        if (self.has_style(sect_id, style)) {
+            btn.addClass("used");
+        } else {
+            btn.removeClass("used");
+        }
     }
 };
 

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

         .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 5px; display: block; text-decoration: none; color: #903; 
+        .wym_skin_semanticeditor .wym_section a {
+            padding: 0 5px;
+            display: block;
+            text-decoration: none;
+            color: #903;
             margin: 4px 0;
             font-family: "Futura";
-            background: #cde8cd ;
+            background-color: #cde8cd;
+            border: 1px solid #cde8cd;
         }
-        .wym_skin_semanticeditor .wym_section a:hover    { background-color: #903; color: #cde8cd;}
+        .wym_skin_semanticeditor .wym_section a:hover {
+            background-color: #903;
+            border: 1px solid #903;
+            color: #cde8cd;
+        }
 
-        .wym_skin_semanticeditor .wym_section a.disabled { color: #888; cursor: default; background-color: #dde8dd; }
-        .wym_skin_semanticeditor .wym_section a.disabled:hover    { color: #888; background-color: #dde8dd; }
+        .wym_skin_semanticeditor .wym_section a.disabled,
+        .wym_skin_semanticeditor .wym_section a.disabled:hover
+        {
+            color: #888;
+            cursor: default;
+            background-color: #dde8dd;
+            border: 1px solid #dde88d;
+        }
+        .wym_skin_semanticeditor .wym_section a.used {
+            border: 1px solid #903;
+        }
       /*hide section titles by default*/
         .wym_skin_semanticeditor .wym_section h2         { display: none; }
       /*disable any margin-collapse*/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.