Merge branch 'master' of git@stigma:platforma
authorŁukasz Rekucki <lrekucki@gmail.com>
Fri, 28 Aug 2009 14:23:18 +0000 (16:23 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Fri, 28 Aug 2009 14:23:18 +0000 (16:23 +0200)
project/static/css/master.css
project/static/js/editor.js
project/templates/explorer/panels/xmleditor.html

index 1b428fd..604b69a 100644 (file)
@@ -240,8 +240,6 @@ label {
 
 .toolbar-tabs {
     height: 21px;
-/*    z-index: 1000;*/
-/*    overflow: hidden;*/
 }
 
 .toolbar-tabs li:hover, .toolbar-tabs li.active {
@@ -272,6 +270,33 @@ label {
     cursor: default;
 }
 
+.change-font-size {
+    width: 45px;
+    height: 18px;
+    padding: 3px 0 0;
+    position: absolute;
+    top: 0;
+    right: 0;
+}
+
+.change-font-size div {
+    float: left;
+    text-align: center;
+    width: 20px;
+    font-size: 13px;
+    margin: 1px;
+    cursor: default;
+    border-radius: 2px;
+    -moz-border-radius: 2px;
+    -webkit-border-radius: 2px;
+}
+
+.change-font-size div:hover {
+    background-color: #EEE;
+    border: 1px solid #AAA;
+    margin: 0;
+}
+
 /* =========================== */
 /* = DublinCore Editor panel = */
 /* =========================== */
index 131c863..7b14562 100644 (file)
@@ -86,8 +86,7 @@ Panel.prototype.otherPanelChanged = function(other) {
 }      
 
 Panel.prototype.markChanged = function () {
-       if(!this.wrap.hasClass('changed') ) // TODO: is this needed ?
-               this.wrap.addClass('changed');
+       this.wrap.addClass('changed');
 }
 
 Panel.prototype.changed = function () {
index f93e6ea..2253609 100644 (file)
@@ -1,6 +1,10 @@
 {% load toolbar_tags %}
 
 {% toolbar %}
+<div class="change-font-size" style="">
+    <div class="decrease-font-size">A<sup>-</sup></div>
+    <div class="increase-font-size">A<sup>+</sup></div>
+</div>
 <div class="iframe-container" style="position: absolute; top: 48px; left:0px; right:0px; bottom: 0px;">
        <textarea name="text">{{ text }}</textarea>
 </div>
@@ -74,6 +78,18 @@ panel_hooks = {
             }
         });
 
+        $('.decrease-font-size', panel).click(function() {
+            var frameBody = $('body', $(texteditor.frame).contents());
+            console.log(frameBody.css('font-size'));
+            frameBody.css('font-size', parseInt(frameBody.css('font-size')) - 2);
+        });
+        
+        $('.increase-font-size', panel).click(function() {
+            var frameBody = $('body', $(texteditor.frame).contents());
+            console.log(frameBody.css('font-size'));
+            frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
+        });
+        
                this.texteditor = texteditor;
     },