Mercurial > public > sg101
comparison media/js/forums.js @ 135:13330e1836f3
Cutting forums over to the new common way to add markItUp, extra smileys, and markdown help.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 03:30:15 +0000 |
parents | 2d299909e074 |
children | 8fd4984d5c3b |
comparison
equal
deleted
inserted
replaced
134:b8474ffe76d9 | 135:13330e1836f3 |
---|---|
80 }); | 80 }); |
81 $('#forum-mod-del-topic').click(function () { | 81 $('#forum-mod-del-topic').click(function () { |
82 return confirm('Are you sure you want to delete this topic?\n' + | 82 return confirm('Are you sure you want to delete this topic?\n' + |
83 'WARNING: all posts will be lost.'); | 83 'WARNING: all posts will be lost.'); |
84 }); | 84 }); |
85 $('#id_body').markItUp(mySettings); | |
86 $('#smileys_dialog').dialog({autoOpen:false}); | |
87 var firstTime = true; | |
88 $('#more_smileys').click(function () { | |
89 $('#smileys_dialog').dialog('open'); | |
90 var postBox = $('#id_body')[0]; | |
91 if (firstTime) { | |
92 $.ajax({ | |
93 url: '/smiley/farm/extra/', | |
94 type: 'GET', | |
95 dataType: 'html', | |
96 success: function(data, textStatus) { | |
97 var img = $('#smiley_busy'); | |
98 img.hide(); | |
99 img.after(data); | |
100 $('#smileys_dialog .smiley_farm img').click(function() { | |
101 postBox.value += ' ' + this.alt + ' '; | |
102 postBox.focus(); | |
103 }); | |
104 firstTime = false; | |
105 }, | |
106 error: function (xhr, textStatus, ex) { | |
107 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); | |
108 } | |
109 }); | |
110 } | |
111 return false; | |
112 }); | |
113 $('#markdown_help_dialog').dialog({autoOpen: false, width: 720, height: 600}); | |
114 var firstTimeMd = true; | |
115 $('#markdown_help').click(function () { | |
116 $('#markdown_help_dialog').dialog('open'); | |
117 if (firstTimeMd) { | |
118 $.ajax({ | |
119 url: '/core/markdown_help/', | |
120 type: 'GET', | |
121 dataType: 'html', | |
122 success: function(data, textStatus) { | |
123 var img = $('#markdown_busy'); | |
124 img.hide(); | |
125 img.after(data); | |
126 firstTimeMd = false; | |
127 }, | |
128 error: function (xhr, textStatus, ex) { | |
129 alert('Oops, an error occurred: ' + xhr.statusText + ' - ' + xhr.responseText); | |
130 } | |
131 }); | |
132 } | |
133 return false; | |
134 }); | |
135 }); | 85 }); |