Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anandology committed Apr 15, 2010
1 parent 0b08c95 commit bddc713
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Example without using jquery:
</div>

<script type="text/javascript">
setup_wmd({
new WMDEditor({
"input": "notes",
"button_bar": "notes-button-bar",
"preview": "notes-preview",
Expand Down
34 changes: 18 additions & 16 deletions jquery.wmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
});
};
})(jQuery);
/**
* WMD Editor - v3.0
*/
;(function() {

WMDEditor = function(options) {
Expand Down Expand Up @@ -511,7 +514,7 @@ var TextareaState = function(textarea){ // {{{
this.text = inputArea.value;
}

}
};

// Sets the selected text in the input box after we've performed an
// operation.
Expand Down Expand Up @@ -597,7 +600,7 @@ var TextareaState = function(textarea){ // {{{
// Restore this state into the input area.
this.restore = function(){

if (stateObj.text != undefined && stateObj.text != inputArea.value) {
if (stateObj.text !== undefined && stateObj.text != inputArea.value) {
inputArea.value = stateObj.text;
}
this.setInputAreaSelection();
Expand Down Expand Up @@ -945,12 +948,10 @@ var PreviewManager = function(wmd){ // {{{

if (wmd.panels.preview) {
wmd.panels.preview.scrollTop = (wmd.panels.preview.scrollHeight - wmd.panels.preview.clientHeight) * getScaleFactor(wmd.panels.preview);
;
}

if (wmd.panels.output) {
wmd.panels.output.scrollTop = (wmd.panels.output.scrollHeight - wmd.panels.output.clientHeight) * getScaleFactor(wmd.panels.output);
;
}
};

Expand Down Expand Up @@ -1257,7 +1258,7 @@ var UndoManager = function(textarea, pastePollInterval, callback){ // {{{

var handlePaste = function(){
if (browser.isIE || (inputStateObj && inputStateObj.text != textarea.value)) {
if (timer == undefined) {
if (timer === undefined) {
mode = "paste";
saveState();
refreshState();
Expand Down Expand Up @@ -1295,7 +1296,6 @@ var UndoManager = function(textarea, pastePollInterval, callback){ // {{{
WMDEditor.util = util;
WMDEditor.position = position;
WMDEditor.TextareaState = TextareaState;
WMDEditor.Checks = Checks;
WMDEditor.InputPoller = InputPoller;
WMDEditor.PreviewManager = PreviewManager;
WMDEditor.UndoManager = UndoManager;
Expand Down Expand Up @@ -1474,14 +1474,14 @@ var wmdBase = function(wmd, wmd_options){ // {{{
}
doClick(this);
return false;
}
};
}
}
else {
button.style.backgroundPosition = button.XShift + " " + disabledYShift;
button.onmouseover = button.onmouseout = button.onclick = function(){};
}
}
};

var makeSpritedButtonRow = function(){

Expand All @@ -1492,7 +1492,7 @@ var wmdBase = function(wmd, wmd_options){ // {{{
var highlightYShift = "-40px";

var buttonRow = document.createElement("ul");
buttonRow.className = "wmd-button-row"
buttonRow.className = "wmd-button-row";
buttonRow = buttonBar.appendChild(buttonRow);

var xoffset = 0;
Expand All @@ -1504,11 +1504,13 @@ var wmdBase = function(wmd, wmd_options){ // {{{
button.XShift = xoffset + "px";
xoffset -= 20;

if (title)
if (title) {
button.title = title;

if (textOp)
}

if (textOp) {
button.textOp = textOp;
}

return button;
}
Expand Down Expand Up @@ -1579,12 +1581,12 @@ var wmdBase = function(wmd, wmd_options){ // {{{

var helpAnchor = document.createElement("a");
helpAnchor.href = wmd_options.helpLink;
helpAnchor.target = wmd_options.helpTarget
helpAnchor.target = wmd_options.helpTarget;
helpAnchor.title = wmd_options.helpHoverTitle;
helpButton.appendChild(helpAnchor);

setUndoRedoButtonStates();
}
};

var setupEditor = function(){

Expand Down Expand Up @@ -2277,7 +2279,7 @@ var wmdBase = function(wmd, wmd_options){ // {{{
// Try to get the current header level by looking for - and = in the line
// below the selection.
chunk.findTags(null, /\s?(-+|=+)/);
if(/=+/.test(chunk.endTag)){
if(/\=+/.test(chunk.endTag)){
headerLevel = 1;
}
if(/-+/.test(chunk.endTag)){
Expand Down Expand Up @@ -2313,7 +2315,7 @@ var wmdBase = function(wmd, wmd_options){ // {{{
chunk.startTag = "----------\n";
chunk.selection = "";
chunk.addBlankLines(2, 1, true);
}
};
// }}}

}; // }}}
Expand Down
Loading

0 comments on commit bddc713

Please sign in to comment.