Skip to content

Commit

Permalink
Bugfix for nonfunctional Safari help button.
Browse files Browse the repository at this point in the history
Turns the help button into a real hyperlink.
  • Loading branch information
derobins committed Jan 31, 2009
1 parent aa4386f commit 7c22050
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
11 changes: 11 additions & 0 deletions wmd.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ body
list-style: none;
}

.wmd-button > a
{
width: 20px;
height: 20px;
margin-left: 5px;
margin-right: 5px;

position: absolute;
display: inline-block;
}


/* sprite button slicing style information */
#wmd-button-bar #wmd-bold-button {left: 0px; background-position: 0px 0;}
Expand Down
28 changes: 18 additions & 10 deletions wmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Attacklab.wmdBase = function(){
// The link and title for the help button
var helpLink = "http://wmd-editor.com/";
var helpHoverTitle = "WMD website";
var helpTarget = "_blank";

// -------------------------------------------------------------------
// END OF YOUR CHANGES
Expand Down Expand Up @@ -884,13 +885,16 @@ Attacklab.wmdBase = function(){
wmd.ieCachedRange = document.selection.createRange();
};
}

button.onclick = function() {
if (this.onmouseout) {
this.onmouseout();

if (!button.isHelp)
{
button.onclick = function() {
if (this.onmouseout) {
this.onmouseout();
}
doClick(this);
return false;
}
doClick(this);
return false;
}
}
else {
Expand Down Expand Up @@ -1057,11 +1061,15 @@ Attacklab.wmdBase = function(){
var helpButton = document.createElement("li");
helpButton.className = "wmd-button";
helpButton.id = "wmd-help-button";
helpButton.title = helpHoverTitle;
helpButton.XShift = "-240px";
helpButton.execute = function(){
window.open(helpLink);
};
helpButton.isHelp = true;

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

setupButton(helpButton, true);
buttonRow.appendChild(helpButton);

Expand Down

0 comments on commit 7c22050

Please sign in to comment.