Added a WYSIWYG Editor for editing replies in Cosora.
This commit is contained in:
parent
3cb5896316
commit
a28b6c2690
@ -599,6 +599,7 @@ function mainInit(){
|
|||||||
else source = block.innerHTML;
|
else source = block.innerHTML;
|
||||||
// TODO: Add a client template for this
|
// TODO: Add a client template for this
|
||||||
block.innerHTML = "<textarea style='width: 99%;' name='edit_item'>" + source + "</textarea><br><a href='" + this.closest('a').getAttribute("href") + "'><button class='submit_edit' type='submit'>Update</button></a>";
|
block.innerHTML = "<textarea style='width: 99%;' name='edit_item'>" + source + "</textarea><br><a href='" + this.closest('a').getAttribute("href") + "'><button class='submit_edit' type='submit'>Update</button></a>";
|
||||||
|
runHook("edit_item_pre_bind");
|
||||||
|
|
||||||
$(".submit_edit").click(function(event){
|
$(".submit_edit").click(function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -14,6 +14,7 @@ var hooks = {
|
|||||||
"after_update_alert_list":[],
|
"after_update_alert_list":[],
|
||||||
"open_edit":[],
|
"open_edit":[],
|
||||||
"close_edit":[],
|
"close_edit":[],
|
||||||
|
"edit_item_pre_bind":[],
|
||||||
};
|
};
|
||||||
var ranInitHooks = {}
|
var ranInitHooks = {}
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ func init() {
|
|||||||
func ViewProfile(w http.ResponseWriter, r *http.Request, user common.User, header *common.Header) common.RouteError {
|
func ViewProfile(w http.ResponseWriter, r *http.Request, user common.User, header *common.Header) common.RouteError {
|
||||||
// TODO: Preload this?
|
// TODO: Preload this?
|
||||||
header.AddSheet(header.Theme.Name + "/profile.css")
|
header.AddSheet(header.Theme.Name + "/profile.css")
|
||||||
|
if user.Loggedin {
|
||||||
header.AddScript("profile_member.js")
|
header.AddScript("profile_member.js")
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var replyCreatedAt time.Time
|
var replyCreatedAt time.Time
|
||||||
|
@ -33,6 +33,12 @@ $(document).ready(function(){
|
|||||||
btns: [['viewHTML'],['strong','em','del'],['link'],['insertImage'],['removeformat']],
|
btns: [['viewHTML'],['strong','em','del'],['link'],['insertImage'],['removeformat']],
|
||||||
autogrow: true,
|
autogrow: true,
|
||||||
});
|
});
|
||||||
|
addHook("edit_item_pre_bind", () => {
|
||||||
|
$('.user_content textarea').trumbowyg({
|
||||||
|
btns: btnlist,
|
||||||
|
autogrow: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor this to use `each` less
|
// TODO: Refactor this to use `each` less
|
||||||
|
Loading…
Reference in New Issue
Block a user