Guest User

Untitled

a guest
Jul 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. function _addInteraction(interaction) {
  2. var template = $("#interactionTemplate").clone();
  3. template.attr("id", interaction.InteractionId);
  4. populateInteractionTemplate(template, interaction);
  5. template.show();
  6. template.prependTo("#accordion");
  7. template.find("#newNoteArea").htmlarea({
  8. toolbar: [
  9. ["html"], ["bold", "italic", "underline", "strikethrough", "|", "subscript", "superscript"],
  10. ["increasefontsize", "decreasefontsize"],
  11. ["orderedlist", "unorderedlist"],
  12. ["indent", "outdent"],
  13. ["justifyleft", "justifycenter", "justifyright"],
  14. ["link", "unlink", "image", "horizontalrule"],
  15. ["h1", "h2", "h3", "h4", "h5", "h6"],
  16. ["cut", "copy", "paste"],
  17. [{
  18. // This is how to add a completely custom Toolbar Button
  19. css: "custom_disk_button",
  20. text: "Save",
  21. action: function(btn) {
  22. // 'this' = jHtmlArea object
  23. // 'btn' = jQuery object that represents the <A> "anchor" tag for the Toolbar Button
  24. var noteContainer = this.container.parent().parent();
  25. var noteString = this.toHtmlString();
  26. var noteAreaForInteraction = noteContainer.find("#notes");
  27. saveNewNote(noteContainer.find("#noteId").val(), this.toHtmlString(),
  28. function(id) {
  29. addNote(id, noteString, noteAreaForInteraction);
  30. }
  31. );
  32. template.find("#newNoteArea").val('');
  33. this.updateHtmlArea();
  34. }
  35. }]
  36. ]
  37. });
  38. template.find("#newNoteDiv").hide();
  39. template.find("#newNote").click(function() {
  40. $(this).parent().find("#newNoteDiv").toggle('blind', null, 500, null);
  41. });
  42. }
Add Comment
Please, Sign In to add comment