# HG changeset patch
# User Brian Neal ');
$.ajax({
- url: '/forums/fetch_attachments/',
+ url: '/forums/fetch_attachments/',
type: 'GET',
data: {
pid : post_id
@@ -147,7 +146,7 @@
success: processEmbeds,
error: function (xhr, textStatus, ex) {
vidDiv.find('img').remove();
- alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
+ alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
xhr.responseText);
}
});
@@ -161,7 +160,7 @@
});
attachments.remove();
$.ajax({
- url: '/oembed/fetch_saved/',
+ url: '/oembed/fetch_saved/',
type: 'GET',
data: {
embeds: embeds
@@ -171,7 +170,7 @@
success: processEmbeds,
error: function (xhr, textStatus, ex) {
vidDiv.find('img').remove();
- alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
+ alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
xhr.responseText);
}
});
@@ -245,7 +244,7 @@
var button = $(this);
button.attr('disabled', 'disabled');
$.ajax({
- url: '/oembed/fetch/',
+ url: '/oembed/fetch/',
type: 'POST',
data: {
q : vidText.val()
@@ -267,7 +266,7 @@
});
},
error: function (xhr, textStatus, ex) {
- alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
+ alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
xhr.responseText);
button.removeAttr('disabled');
}
@@ -287,4 +286,43 @@
}
initAttachments();
+
+ var topicTitle = $('#id_name');
+ var topicSearchButton = $('#search_topics');
+ var searchBusy = $('#search-busy-icon');
+ topicSearchButton.click(function () {
+ var text = $.trim(topicTitle.val());
+ if (!text) return;
+
+ $(this).attr('disabled', 'disabled');
+ $('#quick-search-results').remove();
+ searchBusy.toggle();
+
+ $.ajax({
+ url: '/search/ajax/',
+ type: 'GET',
+ data: {
+ q : text,
+ models : 'forums.topic'
+ },
+ traditional: true,
+ dataType: 'html',
+ success: function (data, textStatus) {
+ topicSearchButton.removeAttr('disabled');
+ searchBusy.hide();
+ searchBusy.after(data);
+ $('#hide-search-results').click(function() {
+ var results = $('#quick-search-results');
+ results.fadeOut(1500, function() { results.remove(); });
+ });
+ },
+ error: function (xhr, textStatus, ex) {
+ topicSearchButton.removeAttr('disabled');
+ searchBusy.hide();
+ alert('Oops, an error occurred. ' + xhr.statusText + ' - ' +
+ xhr.responseText);
+ }
+ });
+ return false;
+ });
});
diff -r 69e8aa135c2e -r 92101013d5ac sg101/templates/forums/show_form.html
--- a/sg101/templates/forums/show_form.html Sun May 26 13:29:44 2013 -0500
+++ b/sg101/templates/forums/show_form.html Mon May 27 15:04:52 2013 -0500
@@ -2,7 +2,29 @@
{{ form.body.errors }}{{ form.body }}
+{% if form.sticky %} +{{ form.sticky.errors }}{{ form.sticky }}
+{% endif %} +{% if form.locked %} +{{ form.locked.errors }}{{ form.locked }}
+{% endif %} + +{% else %} {{ form.as_p }} +{% endif %} + {% comment_dialogs %} diff -r 69e8aa135c2e -r 92101013d5ac sg101/templates/search/search_ajax.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sg101/templates/search/search_ajax.html Mon May 27 15:04:52 2013 -0500 @@ -0,0 +1,23 @@ +{% load core_tags %} +