Skip to content

Commit 55d9005

Browse files
committed
Update for latest Github changes.
1 parent 3e9d5ed commit 55d9005

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gist_markdown_preview.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
function preview(e){
22
e.preventDefault();
33
e.stopPropagation();
4-
if($(".ace_editor").is(":visible")){
5-
$(".ace_editor").hide();
4+
if($(".commit-create").is(":visible")){
5+
$(".commit-create").hide();
66
$("#readme article").show();
77
$("#gist-preview span").html("Edit");
88
} else {
99
$("#readme article").hide();
10-
$(".ace_editor").show();
10+
$(".commit-create").show();
1111
$("#gist-preview span").html("Preview");
1212
}
13-
$("#readme article").html($.markdown($(".input > textarea").val()));
13+
$("#readme article").html($.markdown($(".commit-create > textarea").val()));
1414
return false;
1515
}
1616

@@ -32,16 +32,16 @@ function appendHtml(e){
3232
if(!isMarkdown){
3333
$("#readme").remove();
3434
$("#gist-preview span").parent().remove();
35-
$(".ace_editor").show();
35+
$(".commit-create").show();
3636
return;
3737
}
3838

3939
preview_area = $('<div class="blob instapaper_body" id="readme"><article class="markdown-body entry-content" itemprop="mainContentOfPage"></article>');
40-
$(".ace_editor").parent().append(preview_area);
41-
$(".form-actions").append("<button type='button' class='classy' id='gist-preview'><span>Preview</span></button>");
40+
$(".commit-create").parent().append(preview_area);
41+
$(".form-actions").append("<button type='button' class='btn' id='gist-preview'><span>Preview</span></button>");
4242
}
4343

4444
jQuery(function($){
4545
$("#gist-preview").live("click",preview);
46-
$(".gist-name-textbox").live("change", appendHtml);
46+
$(".js-gist-filename").live("change", appendHtml);
4747
});

0 commit comments

Comments
 (0)