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