Mercurial > public > sg101
comparison media/js/comments.js @ 127:2d299909e074
Adding markdown help to comments and forums. Still need to add it to a few other places that use the markItUp editor.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 16 Nov 2009 01:00:28 +0000 |
parents | b0d62247c3e4 |
children | b8474ffe76d9 |
comparison
equal
deleted
inserted
replaced
126:b0d62247c3e4 | 127:2d299909e074 |
---|---|
60 } | 60 } |
61 } | 61 } |
62 return false; | 62 return false; |
63 }); | 63 }); |
64 postText.markItUp(mySettings); | 64 postText.markItUp(mySettings); |
65 | |
66 $('#smileys_dialog').dialog({autoOpen:false}); | |
67 var firstTime = true; | |
68 $('#more_smileys').click(function () { | |
69 $('#smileys_dialog').dialog('open'); | |
70 var postBox = $('#id_comment')[0]; | |
71 if (firstTime) { | |
72 $.ajax({ | |
73 url: '/smiley/farm/extra/', | |
74 type: 'GET', | |
75 dataType: 'html', | |
76 success: function(data, textStatus) { | |
77 var img = $('#smiley_busy'); | |
78 img.hide(); | |
79 img.after(data); | |
80 $('#smileys_dialog .smiley_farm img').click(function() { | |
81 postBox.value += ' ' + this.alt + ' '; | |
82 postBox.focus(); | |
83 }); | |
84 firstTime = false; | |
85 }, | |
86 error: function (xhr, textStatus, ex) { | |
87 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); | |
88 } | |
89 }); | |
90 } | |
91 return false; | |
92 }); | |
93 $('#markdown_help_dialog').dialog({autoOpen: false, width: 720, height: 600}); | |
94 var firstTimeMd = true; | |
95 $('#markdown_help').click(function () { | |
96 $('#markdown_help_dialog').dialog('open'); | |
97 if (firstTimeMd) { | |
98 $.ajax({ | |
99 url: '/core/markdown_help/', | |
100 type: 'GET', | |
101 dataType: 'html', | |
102 success: function(data, textStatus) { | |
103 var img = $('#markdown_busy'); | |
104 img.hide(); | |
105 img.after(data); | |
106 firstTimeMd = false; | |
107 }, | |
108 error: function (xhr, textStatus, ex) { | |
109 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); | |
110 } | |
111 }); | |
112 } | |
113 return false; | |
114 }); | |
65 }); | 115 }); |