Update icons

This commit is contained in:
benweet 2013-03-25 23:17:34 +00:00
parent 09645f2447
commit 1476883aee
6 changed files with 67 additions and 33 deletions

View File

@ -27,23 +27,18 @@ body {
}
.wmd-button-row {
margin: 10px 30px;
top: 10px;
left: 30px;
padding: 0px;
margin: 10px;
height: 20px;
}
.wmd-spacer {
width: 1px;
height: 20px;
margin: 0 7px;
background-color: Silver;
display: inline-block;
list-style: none;
}
/*
.wmd-button {
width: 20px;
height: 20px;
padding-left: 2px;
@ -52,7 +47,7 @@ body {
list-style: none;
cursor: pointer;
}
*/
.wmd-button>span {
background-image: url(../img/wmd-buttons.png);
background-repeat: no-repeat;
@ -60,7 +55,7 @@ body {
width: 20px;
height: 20px;
display: inline-block;
border: 1px solid #e3e3e3;
border: 1px solid #f2f2f2;
}
.wmd-prompt-background {
@ -87,4 +82,21 @@ body {
font-family: trebuchet MS, helvetica, sans-serif;
font-size: 0.8em;
font-weight: bold;
}
}
.icon-code {
background-position: -384px -168px;
}
.icon-numbered-list {
background-position: -408px -168px;
}
.icon-hr {
background-position: -432px -168px;
}
.icon-undo {
background-position: -456px -168px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -39,29 +39,33 @@
<body>
<div id="navbar" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div id="wmd-button-bar" class="nav"></div>
<ul class="nav">
<li class="divider-vertical"></li>
<li><div id="wmd-button-bar"></div></li>
</ul>
<ul class="nav pull-right">
<li>
<a class="brand pull-right" id="file-title" href="javascript:void(0);"></a>
</li>
<li class="navbar-form">
<input id="file-title-input" type="text" class="span3" placeholder="File title" />
</li>
<li><a class="brand" id="file-title" href="javascript:void(0);" title="Rename"><span></span></a></li>
<li class="navbar-form"><input id="file-title-input"
type="text" class="span3" placeholder="File title" /></li>
<li class="dropdown"><a class="dropdown-toggle"
data-toggle="dropdown" href="#"><b class="caret"></b></a>
data-toggle="dropdown" href="#" title="Open file"><i
class="icon-folder-open"></i></a>
<ul id="file-selector" class="dropdown-menu">
</ul></li>
<li class="divider-vertical"></li>
<li class="dropdown"><a class="dropdown-toggle"
data-toggle="dropdown" href="#"><img src="img/stackedit-16.png" />
data-toggle="dropdown" href="#" title="Menu"><img src="img/stackedit-16.png" />
Menu <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a id="new-file" href="javascript:void(0);"><i class="icon-file"></i> New file</a></li>
<li><a id="remove-file" href="javascript:void(0);"><i class="icon-trash"></i> Remove file</a></li>
<li><a id="drive-link" href="javascript:void(0);"><i class="icon-magnet"></i> Link
with Google Drive</a></li>
<li><a id="new-file" href="javascript:void(0);" title="Create a new local file"><i
class="icon-file"></i> New file</a></li>
<li><a id="remove-file" href="javascript:void(0);" title="Delete the current file locally"><i
class="icon-trash"></i> Remove file</a></li>
<li><a id="drive-link" href="javascript:void(0);"><i
class="icon-magnet"></i> Link with Google Drive</a></li>
</ul></li>
<li class="divider-vertical"></li>
<li class="divider-vertical"></li>
</ul>
</div>
</div>

View File

@ -1412,10 +1412,12 @@
return false;
}
}
button.className = button.className.replace(/ disabled/g, "");
}
else {
image.style.backgroundPosition = button.XShift + " " + disabledYShift;
button.onmouseover = button.onmouseout = button.onclick = function () { };
button.className += " disabled";
}
}

View File

@ -58,13 +58,13 @@ var fileManager = (function($) {
// Update the editor and the file title
var fileIndex = localStorage["file.current"];
$("#wmd-input").val(localStorage[fileIndex + ".content"]);
editor.refreshPreview();
createEditor();
this.updateFileTitleUI();
};
fileManager.createFile = function(title) {
if(!title) {
title = "New file";
title = "Filename";
}
var fileIndex = "file." + parseInt(localStorage["file.count"]);
localStorage[fileIndex + ".title"] = title;
@ -90,7 +90,7 @@ var fileManager = (function($) {
// Update the editor and the file title
var fileIndex = localStorage["file.current"];
var title = localStorage[fileIndex + ".title"];
$("#file-title").text(title);
$("#file-title > span").text(title);
$("#file-title-input").val(title);
$("#file-selector").empty();
for(var i=0; i<this.fileTitleList.length; i++) {
@ -195,15 +195,31 @@ var gdrive = (function($) {
return gdrive;
})(jQuery);
var converter;
var editor;
function createEditor() {
$("#wmd-button-bar").empty();
var converter = Markdown.getSanitizingConverter();
var editor = new Markdown.Editor(converter);
editor.run();
$(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)").addClass("btn").css({"left": 0,}).find("span").hide();
$("#wmd-bold-button").append($("<i>").addClass("icon-bold"));
$("#wmd-italic-button").append($("<i>").addClass("icon-italic"));
$("#wmd-link-button").append($("<i>").addClass("icon-globe"));
$("#wmd-quote-button").append($("<i>").addClass("icon-indent-left"));
$("#wmd-code-button").append($("<i>").addClass("icon-code"));
$("#wmd-image-button").append($("<i>").addClass("icon-picture"));
$("#wmd-olist-button").append($("<i>").addClass("icon-numbered-list"));
$("#wmd-ulist-button").append($("<i>").addClass("icon-list"));
$("#wmd-heading-button").append($("<i>").addClass("icon-text-height"));
$("#wmd-hr-button").append($("<i>").addClass("icon-hr"));
$("#wmd-undo-button").append($("<i>").addClass("icon-undo"));
$("#wmd-redo-button").append($("<i>").addClass("icon-share-alt"));
}
(function($) {
$(function() {
converter = Markdown.getSanitizingConverter();
editor = new Markdown.Editor(converter);
editor.run();
$(window).resize(resize);
resize();