From 49f9367a400a6102beaace2d1b95d74bbe8f44bc Mon Sep 17 00:00:00 2001 From: llj Date: Thu, 18 Apr 2013 20:15:33 +0800 Subject: [PATCH] [sf editor] fixed bugs and cleaned up code * fixed 'font menu no content when lang is zh-cn' bug * added back necessary '.btn-into' styles * rm no used js/css --- media/css/sf_editor_toolbar.css | 9 +++------ templates/file_edit.html | 5 ++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/media/css/sf_editor_toolbar.css b/media/css/sf_editor_toolbar.css index 637b37e9d8..438376c103 100644 --- a/media/css/sf_editor_toolbar.css +++ b/media/css/sf_editor_toolbar.css @@ -27,6 +27,8 @@ input[type="file"]{height:30px;*margin-top:4px;line-height:30px;} .btn:hover,.btn:focus{color:#333333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} .btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} .btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} +.btn-info{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;} +.btn-info:active,.btn-info.active{background-color:#24748c \9;} input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;} button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} .btn-group{position:relative;display:inline-block;*display:inline;*zoom:1;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em;}.btn-group:first-child{*margin-left:0;} @@ -35,9 +37,6 @@ button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button .btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} .btn-group>.btn+.btn{margin-left:-1px;} .btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px;} -.btn-group>.btn-mini{font-size:10.5px;} -.btn-group>.btn-small{font-size:11.9px;} -.btn-group>.btn-large{font-size:17.5px;} .btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} .btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} .btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} @@ -45,11 +44,9 @@ button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button .btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;} .btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} .btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);*padding-top:5px;*padding-bottom:5px;} -.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px;} -.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px;} -.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px;} .btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} .btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;} +.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;} .btn .caret{margin:8px 0 0 4px;} .tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} .tooltip.top{margin-top:-3px;padding:5px 0;} diff --git a/templates/file_edit.html b/templates/file_edit.html index bb609c4c57..4c19947506 100644 --- a/templates/file_edit.html +++ b/templates/file_edit.html @@ -187,7 +187,7 @@
- +
@@ -408,7 +408,7 @@ $(function() { var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier', 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times', 'Times New Roman', 'Verdana'], - fontTarget = $('[title=Font]').siblings('.dropdown-menu'); + fontTarget = $('#font-list'); $.each(fonts, function (idx, fontName) { fontTarget.append($('
  • '+fontName + '
  • ')); }); @@ -424,7 +424,6 @@ $(function() { }; initToolbarBootstrapBindings(); $('#sf').wysiwyg(); - window.prettyPrint && prettyPrint(); }); {% endif %}