javascript_library

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "javascript_library".
... in profile_backbutton.naml
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
<override_macro name="javascript_library" requires="servlet">
    <n.overridden/>
    <n.comment.>
        Adding "Back" Button.
    </n.comment.>
    <n.compress.>
        $( document ).ready(function() {
        
        var title = document.title;
        var nextUrl2 = $(location).attr('href');
        var res = nextUrl2.split("nextUrl=");
        nextUrl2 = res[1];        
 
        if(title.search( 'Edit Personal Information' ) >= 0 )
        profileLink();
        if(title.search( 'Change Avatar' ) >= 0 )
        profileLink();
        if(title.search( 'Advanced Settings' ) >= 0 )
        profileLink();
        if(title.search( 'Remove Your Account' ) >= 0 )
        profileLink();
        if(title.search( ' Edit Signature' ) >= 0 )
        profileLink();           
    
        if(title.search( ' Change User Groups' ) >= 0 )
        profileLink();          
 
        
        function profileLink () {
        console.log("one of those");
        $('.breadcrumbs span').html("<a href='/template/NamlServlet.jtp?macro=user_profile&nextUrl="+nextUrl2+"' style='display:inline !important;'>Back</a>");
        console.log("Setting Cookie:" + nextUrl2);
        Nabble.setCookie("nextUrl12345",nextUrl2);
        }
       
   
        
        
        });
    </n.compress.>
</override_macro>
Overrides default macro
... in poll.naml
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
<override_macro name="javascript_library" requires="servlet">
    <n.overridden/>
    <n.comment.>
        Javascript to validate and submit a poll vote.
    </n.comment.>
    <n.compress.>
        Nabble.vote = function(nodeId,maxChoices) {
            var vote_count = $('#poll_form'+nodeId+' input:checked').length;
            <![CDATA[
            if (vote_count > maxChoices) {
            ]]>
                alert('<t>Please select no more than <t.number>'+maxChoices+'</t.number> options.</t>');
                return false;
            } else if (vote_count == 0) {
                alert('<t>Please select at least one option.</t>');
                return false;
            }
            var params = $('#poll_form'+nodeId).serialize();
            var call = '/template/NamlServlet.jtp?macro=vote&'+params;
            var call2 = '/template/NamlServlet.jtp?macro=poll_js&poll_node_id='+nodeId;
            $.getScript(call, function() {
                notice('<t>Your vote has been submitted.</t>', 5000, 2000);
                $.getScript(call2);
            });
            return false;
        };
    </n.compress.>
</override_macro>
Overrides default macro
... in javascript_library.naml
1
2
3
4
5
6
7
8
9
10
11
12
<macro name="javascript_library" requires="servlet">
    <n.uncache_for/>
    <n.javascript_response/>
    <n.js_basic_nabble_functions/>
    <n.js_basic_embedding_code/>
    <n.js_basic_site_functions/>
    <n.js_date_functions/>
    <n.js_header_functions/>
    <n.js_delete_functions/>
    <n.js_topic_and_post_functions/>
    <n.js_search_functions/>
</macro>