comparison media/js/forums.js @ 123:3ae999b0c53b

Forums: added a jquery ui dialog of extra smileys.
author Brian Neal <bgneal@gmail.com>
date Sun, 08 Nov 2009 21:15:31 +0000
parents 07be3e39e639
children b0d62247c3e4
comparison
equal deleted inserted replaced
122:b28d30848c57 123:3ae999b0c53b
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); 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 });
86 }); 113 });