page_notes.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // use this to isolate the scope
  2. (function () {
  3. if (!$axure.document.configuration.showPageNotes) { return; }
  4. $(window.document).ready(function () {
  5. $axure.player.createPluginHost({
  6. id: 'pageNotesHost',
  7. context: 'interface',
  8. title: 'Page Notes'
  9. });
  10. generatePageNotes();
  11. // bind to the page load
  12. $axure.page.bind('load.page_notes', function () {
  13. $('#pageNameHeader').html("");
  14. $('#pageNotesContent').html("");
  15. //populate the notes
  16. var notes = $axure.page.notes;
  17. if (notes) {
  18. var pageName = $axure.page.pageName;
  19. $('#pageNameHeader').html(pageName);
  20. var showNames = $axure.document.configuration.showPageNoteNames;
  21. for (var noteName in notes) {
  22. if (showNames) {
  23. $('#pageNotesContent').append("<div class='pageNoteName'>" + noteName + "</div>");
  24. }
  25. $('#pageNotesContent').append("<div class='pageNote'>" + notes[noteName] + "</div>");
  26. }
  27. }
  28. return false;
  29. });
  30. });
  31. function generatePageNotes() {
  32. var pageNotesUi = "<div id='pageNotesScrollContainer'>";
  33. pageNotesUi += "<div id='pageNotesContainer'>";
  34. pageNotesUi += "<div id='pageNameHeader'></div>";
  35. pageNotesUi += "<span id='pageNotesContent'></span>";
  36. pageNotesUi += "</div></div>";
  37. $('#pageNotesHost').html(pageNotesUi);
  38. }
  39. })();