1
1
function preview ( e ) {
2
2
e . preventDefault ( ) ;
3
3
e . stopPropagation ( ) ;
4
- if ( $ ( ".ace_editor " ) . is ( ":visible" ) ) {
5
- $ ( ".ace_editor " ) . hide ( ) ;
4
+ if ( $ ( ".commit-create " ) . is ( ":visible" ) ) {
5
+ $ ( ".commit-create " ) . hide ( ) ;
6
6
$ ( "#readme article" ) . show ( ) ;
7
7
$ ( "#gist-preview span" ) . html ( "Edit" ) ;
8
8
} else {
9
9
$ ( "#readme article" ) . hide ( ) ;
10
- $ ( ".ace_editor " ) . show ( ) ;
10
+ $ ( ".commit-create " ) . show ( ) ;
11
11
$ ( "#gist-preview span" ) . html ( "Preview" ) ;
12
12
}
13
- $ ( "#readme article" ) . html ( $ . markdown ( $ ( ".input > textarea" ) . val ( ) ) ) ;
13
+ $ ( "#readme article" ) . html ( $ . markdown ( $ ( ".commit-create > textarea" ) . val ( ) ) ) ;
14
14
return false ;
15
15
}
16
16
@@ -32,16 +32,16 @@ function appendHtml(e){
32
32
if ( ! isMarkdown ) {
33
33
$ ( "#readme" ) . remove ( ) ;
34
34
$ ( "#gist-preview span" ) . parent ( ) . remove ( ) ;
35
- $ ( ".ace_editor " ) . show ( ) ;
35
+ $ ( ".commit-create " ) . show ( ) ;
36
36
return ;
37
37
}
38
38
39
39
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>" ) ;
42
42
}
43
43
44
44
jQuery ( function ( $ ) {
45
45
$ ( "#gist-preview" ) . live ( "click" , preview ) ;
46
- $ ( ".gist-name-textbox " ) . live ( "change" , appendHtml ) ;
46
+ $ ( ".js- gist-filename " ) . live ( "change" , appendHtml ) ;
47
47
} ) ;
0 commit comments