Permalink
Browse files

Reset to revision 102389b.

  • Loading branch information...
1 parent bddc713 commit 9c37c6f9e2a04cbe028a4799f32733a0d1d002e5 @anandology anandology committed Jun 9, 2010
Showing with 51 additions and 51 deletions.
  1. +1 −2 License.txt
  2. +1 −1 Readme.md
  3. +16 −18 jquery.wmd.js
  4. +17 −12 jquery.wmd.min.js
  5. +16 −18 wmd.js
View
@@ -1,8 +1,7 @@
The MIT License
-Original WMD and Showdown code copyright (c) 2007 John Fraser
+Original WMD and Showdwon code copyright (c) 2007 John Fraser
Modifications and bugfixes (c) 2009 Dana Robinson
-More modifications and jQuery plugin (c) 2010 Internet Archive
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -61,7 +61,7 @@ Example without using jquery:
</div>
<script type="text/javascript">
- new WMDEditor({
+ setup_wmd({
"input": "notes",
"button_bar": "notes-button-bar",
"preview": "notes-preview",
View
@@ -42,9 +42,6 @@
});
};
})(jQuery);
-/**
- * WMD Editor - v3.0
- */
;(function() {
WMDEditor = function(options) {
@@ -514,7 +511,7 @@ var TextareaState = function(textarea){ // {{{
this.text = inputArea.value;
}
- };
+ }
// Sets the selected text in the input box after we've performed an
// operation.
@@ -600,7 +597,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();
@@ -948,10 +945,12 @@ 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);
+ ;
}
};
@@ -1258,7 +1257,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();
@@ -1296,6 +1295,7 @@ 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;
@@ -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(){
@@ -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;
@@ -1504,13 +1504,11 @@ 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;
}
@@ -1581,12 +1579,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(){
@@ -2279,7 +2277,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)){
@@ -2315,7 +2313,7 @@ var wmdBase = function(wmd, wmd_options){ // {{{
chunk.startTag = "----------\n";
chunk.selection = "";
chunk.addBlankLines(2, 1, true);
- };
+ }
// }}}
}; // }}}
Oops, something went wrong.

0 comments on commit 9c37c6f

Please sign in to comment.