Upgrade to Bootstrap 3

This commit is contained in:
benweet 2013-08-10 02:19:32 +01:00
parent 907c721459
commit 27322f3a98
3 changed files with 70 additions and 48 deletions

View File

@ -188,7 +188,7 @@ define([
togglerLength_closed: 60, togglerLength_closed: 60,
stateManagement__enabled: false, stateManagement__enabled: false,
center__minWidth: 200, center__minWidth: 200,
center__minHeight: 200, center__minHeight: 100,
onopen: function() { onopen: function() {
setPreviewButtonsVisibility(); setPreviewButtonsVisibility();
}, },
@ -365,21 +365,25 @@ define([
editor.undoManager.reinit(initDocumentContent, fileDesc.editorStart, fileDesc.editorEnd, fileDesc.editorScrollTop); editor.undoManager.reinit(initDocumentContent, fileDesc.editorStart, fileDesc.editorEnd, fileDesc.editorScrollTop);
// Hide default buttons // Hide default buttons
$(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)").addClass("btn btn-success").css("left", 0).find("span").hide(); $(".wmd-button-row li").addClass("btn btn-success").css("left", 0).find("span").hide();
// Add customized buttons // Add customized buttons
$("#wmd-bold-button").append($('<i class="icon-bold">')); var btnGroupElt = $('.wmd-button-group1');
$("#wmd-italic-button").append($('<i class="icon-italic">')); $("#wmd-bold-button").append($('<i class="icon-bold">')).appendTo(btnGroupElt);
$("#wmd-link-button").append($('<i class="icon-globe">')); $("#wmd-italic-button").append($('<i class="icon-italic">')).appendTo(btnGroupElt);
$("#wmd-quote-button").append($('<i class="icon-indent-right">')); var btnGroupElt = $('.wmd-button-group2');
$("#wmd-code-button").append($('<i class="icon-code">')); $("#wmd-link-button").append($('<i class="icon-globe">')).appendTo(btnGroupElt);
$("#wmd-image-button").append($('<i class="icon-picture">')); $("#wmd-quote-button").append($('<i class="icon-indent-right">')).appendTo(btnGroupElt);
$("#wmd-olist-button").append($('<i class="icon-list-numbered">')); $("#wmd-code-button").append($('<i class="icon-code">')).appendTo(btnGroupElt);
$("#wmd-ulist-button").append($('<i class="icon-list-bullet">')); $("#wmd-image-button").append($('<i class="icon-picture">')).appendTo(btnGroupElt);
$("#wmd-heading-button").append($('<i class="icon-text-height">')); var btnGroupElt = $('.wmd-button-group3');
$("#wmd-hr-button").append($('<i class="icon-ellipsis">')); $("#wmd-olist-button").append($('<i class="icon-list-numbered">')).appendTo(btnGroupElt);
$("#wmd-undo-button").append($('<i class="icon-reply">')); $("#wmd-ulist-button").append($('<i class="icon-list-bullet">')).appendTo(btnGroupElt);
$("#wmd-redo-button").append($('<i class="icon-forward">')); $("#wmd-heading-button").append($('<i class="icon-text-height">')).appendTo(btnGroupElt);
$("#wmd-hr-button").append($('<i class="icon-ellipsis">')).appendTo(btnGroupElt);
var btnGroupElt = $('.wmd-button-group4');
$("#wmd-undo-button").append($('<i class="icon-reply">')).appendTo(btnGroupElt);
$("#wmd-redo-button").append($('<i class="icon-forward">')).appendTo(btnGroupElt);
eventMgr.onFileOpen(fileDesc); eventMgr.onFileOpen(fileDesc);
}; };

View File

@ -1,20 +1,20 @@
<div class="navbar navbar-fixed-top ui-layout-north"> <div class="navbar navbar-fixed-top ui-layout-north">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="nav left-space"></div>
<div class="nav right-space pull-right"></div>
<ul class="nav"> <ul class="nav">
<li><div id="wmd-button-bar"></div></li> <li class="wmd-button-group1 btn-group"></li>
</ul>
<ul class="nav">
<li class="wmd-button-group2 btn-group"></li>
</ul>
<ul class="nav">
<li class="wmd-button-group3 btn-group"></li>
</ul>
<ul class="nav">
<li class="wmd-button-group4 btn-group"></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li id="extension-buttons"></li>
<li class="btn-group"><button
class="btn btn-success action-create-file"
title="New local document">
<i class="icon-file"></i>
</button>
<button class="btn btn-success" title="Delete current document"
data-toggle="modal" data-target="#modal-remove-file-confirm">
<i class="icon-trash"></i>
</button></li>
<li> <li>
<button data-toggle="dropdown" class="action-open-file hide"></button> <button data-toggle="dropdown" class="action-open-file hide"></button>
<ul class="dropdown-menu file-selector"> <ul class="dropdown-menu file-selector">
@ -27,11 +27,26 @@
</ul> </ul>
</li> </li>
</ul> </ul>
<ul class="nav pull-right">
<li class="btn-group"><button
class="btn btn-success action-create-file"
title="New local document">
<i class="icon-file"></i>
</button>
<button class="btn btn-success" title="Delete current document"
data-toggle="modal" data-target="#modal-remove-file-confirm">
<i class="icon-trash"></i>
</button></li>
</ul>
<ul class="nav pull-right">
<li id="extension-buttons"></li>
</ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li><a class="btn btn-success file-title-navbar" href="#" <li><a class="btn btn-success file-title-navbar" href="#"
title="Rename current document"> </a></li> title="Rename current document"> </a></li>
<li><input type="text" <li><input type="text"
class="col-lg-4 form-control hide input-file-title" placeholder="Document title" /></li> class="col-lg-4 form-control hide input-file-title"
placeholder="Document title" /></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li><i class="working-indicator icon-none"></i></li> <li><i class="working-indicator icon-none"></i></li>
@ -41,6 +56,7 @@
<textarea id="wmd-input" class="ui-layout-center form-control"></textarea> <textarea id="wmd-input" class="ui-layout-center form-control"></textarea>
<div class="ui-layout-east preview-container"></div> <div class="ui-layout-east preview-container"></div>
<div class="ui-layout-south preview-container"></div> <div class="ui-layout-south preview-container"></div>
<div id="wmd-button-bar" class="hide"></div>
<div class="menu-panel collapse width"> <div class="menu-panel collapse width">
@ -59,10 +75,12 @@
<ul class="nav collapse collapse-open-from"> <ul class="nav collapse collapse-open-from">
<li><a data-toggle="modal" <li><a data-toggle="modal"
data-target="#modal-import-harddrive-markdown" data-target="#modal-import-harddrive-markdown"
class="action-reset-input action-close-panel" href="#">Import from hard drive</a></li> class="action-reset-input action-close-panel" href="#">Import
from hard drive</a></li>
<li><a data-toggle="modal" <li><a data-toggle="modal"
data-target="#modal-import-harddrive-html" data-target="#modal-import-harddrive-html"
class="action-reset-input action-close-panel" href="#">Convert HTML to Markdown</a></li> class="action-reset-input action-close-panel" href="#">Convert
HTML to Markdown</a></li>
</ul> </ul>
<a href="#" data-toggle="collapse" data-target=".collapse-save-as" <a href="#" data-toggle="collapse" data-target=".collapse-save-as"
@ -105,16 +123,17 @@
<ul class="nav collapse collapse-publish-on"> <ul class="nav collapse collapse-publish-on">
</ul> </ul>
<a href="#" data-toggle="modal" data-target="#modal-manage-publish" <a href="#" data-toggle="modal" data-target="#modal-manage-publish"
class="action-reset-input list-group-item action-close-panel"><i class="icon-share"></i> class="action-reset-input list-group-item action-close-panel"><i
Manage publication</a> class="icon-share"></i> Manage publication</a>
</div> </div>
<ul class="nav"> <ul class="nav">
<li><a href="#" data-toggle="modal" <li><a href="#" data-toggle="modal"
data-target="#modal-settings" data-target="#modal-settings"
class="action-load-settings list-group-item action-close-panel"><i class="icon-cog"></i> class="action-load-settings list-group-item action-close-panel"><i
Settings</a></li> class="icon-cog"></i> Settings</a></li>
<li><a href="#" data-toggle="modal" data-target="#modal-about" <li><a href="#" data-toggle="modal" data-target="#modal-about"
class="list-group-item action-close-panel"><i class="icon-help-circled"></i> About</a></li> class="list-group-item action-close-panel"><i
class="icon-help-circled"></i> About</a></li>
</ul> </ul>
</div> </div>
@ -128,12 +147,12 @@
</button> </button>
<div class="panel-content"> <div class="panel-content">
<div class="list-group"> <div class="list-group">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon"><i class="icon-search"></i></span><input <span class="input-group-addon"><i class="icon-search"></i></span><input
type="text" class="form-control"></input> type="text" class="form-control"></input>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>

View File

@ -81,10 +81,6 @@ Override Bootstrap
background-color: @bg-navbar-hover; background-color: @bg-navbar-hover;
} }
.btn-group {
margin-right: 10px;
}
// Last dropdown-toggle in a button-group (Bootstrap override) // Last dropdown-toggle in a button-group (Bootstrap override)
.btn-group>.btn+.dropdown-toggle { .btn-group>.btn+.dropdown-toggle {
padding-right: 11px; padding-right: 11px;
@ -164,13 +160,17 @@ Override Bootstrap
.navbar { .navbar {
position: static; position: static;
padding: 0; padding: 0;
.navbar-inner { .left-space {
margin-left: 50px; width: 30px;
margin-right: 30px; height: 38px;
}
.right-space {
width: 20px;
height: 38px;
} }
.nav { .nav {
float: left; float: left;
margin: 6px 5px 0; margin: 6px 10px 5px;
& > li { & > li {
display: inline-block; display: inline-block;
} }
@ -351,7 +351,6 @@ Override Bootstrap
********************/ ********************/
#extension-buttons { #extension-buttons {
margin-right: 15px;
.btn-group { .btn-group {
margin: 0; margin: 0;
} }