Update LinkPreview plugin for multiple notice forms.

* main notice form setup now encapsulated into SN.Init.NoticeForm(form) -- this can be monkeypatched by plugins to append their own setup code, as LinkPreview does
* LinkPreview now supports debugging with non-minified JS source when $config['site']['minify'] is false
* tweaked core & neo styles so 'notice-status' class gets same styles as attach-status, so we can more easily add mroe statusy things. (needs more consolidation with geo-status, etc)
* tweaked LinkPreview's preview area to use that style
This commit is contained in:
Brion Vibber
2011-03-09 17:43:31 -08:00
parent cecc2576a5
commit ec828a094c
8 changed files with 219 additions and 178 deletions

View File

@@ -612,10 +612,7 @@ var SN = { // StatusNet
list.append(replyItem);
var form = replyForm = $(formEl);
SN.U.NoticeLocationAttach(form);
SN.U.FormNoticeXHR(form);
SN.U.FormNoticeEnhancements(form);
SN.U.NoticeDataAttach(form);
SN.Init.NoticeFormSetup(form);
nextStep();
};
@@ -1310,14 +1307,25 @@ var SN = { // StatusNet
if ($('body.user_in').length > 0) {
$('.ajax-notice').each(function() {
var form = $(this);
SN.U.NoticeLocationAttach(form);
SN.U.FormNoticeXHR(form);
SN.U.FormNoticeEnhancements(form);
SN.U.NoticeDataAttach(form);
SN.Init.NoticeFormSetup(form);
});
}
},
/**
* Encapsulate notice form setup for a single form.
* Plugins can add extra setup by monkeypatching this
* function.
*
* @param {jQuery} form
*/
NoticeFormSetup: function(form) {
SN.U.NoticeLocationAttach(form);
SN.U.FormNoticeXHR(form);
SN.U.FormNoticeEnhancements(form);
SN.U.NoticeDataAttach(form);
},
/**
* Run setup code for notice timeline views items:
*