Mercurial > public > sg101
comparison media/js/comments.js @ 134:b8474ffe76d9
Cutting comments over to the new common way of using markItUp and getting the extra smiley and markdown help dialogs.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 00:39:50 +0000 |
parents | 2d299909e074 |
children | 7d3e5aca095f |
comparison
equal
deleted
inserted
replaced
133:c515b7401078 | 134:b8474ffe76d9 |
---|---|
59 }); | 59 }); |
60 } | 60 } |
61 } | 61 } |
62 return false; | 62 return false; |
63 }); | 63 }); |
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 }); | |
115 }); | 64 }); |