Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _addInteraction(interaction) {
- var template = $("#interactionTemplate").clone();
- template.attr("id", interaction.InteractionId);
- populateInteractionTemplate(template, interaction);
- template.show();
- template.prependTo("#accordion");
- template.find("#newNoteArea").htmlarea({
- toolbar: [
- ["html"], ["bold", "italic", "underline", "strikethrough", "|", "subscript", "superscript"],
- ["increasefontsize", "decreasefontsize"],
- ["orderedlist", "unorderedlist"],
- ["indent", "outdent"],
- ["justifyleft", "justifycenter", "justifyright"],
- ["link", "unlink", "image", "horizontalrule"],
- ["h1", "h2", "h3", "h4", "h5", "h6"],
- ["cut", "copy", "paste"],
- [{
- // This is how to add a completely custom Toolbar Button
- css: "custom_disk_button",
- text: "Save",
- action: function(btn) {
- // 'this' = jHtmlArea object
- // 'btn' = jQuery object that represents the <A> "anchor" tag for the Toolbar Button
- var noteContainer = this.container.parent().parent();
- var noteString = this.toHtmlString();
- var noteAreaForInteraction = noteContainer.find("#notes");
- saveNewNote(noteContainer.find("#noteId").val(), this.toHtmlString(),
- function(id) {
- addNote(id, noteString, noteAreaForInteraction);
- }
- );
- template.find("#newNoteArea").val('');
- this.updateHtmlArea();
- }
- }]
- ]
- });
- template.find("#newNoteDiv").hide();
- template.find("#newNote").click(function() {
- $(this).parent().find("#newNoteDiv").toggle('blind', null, 500, null);
- });
- }
Add Comment
Please, Sign In to add comment