Subversion Repositories DevTools

Rev

Rev 5117 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5117 Rev 5142
Line 99... Line 99...
99
                $.fn.deserialize = function (options) {
99
                $.fn.deserialize = function (options) {
100
                    return $.deserialize($(this).serialize(), options);
100
                    return $.deserialize($(this).serialize(), options);
101
                };
101
                };
102
            })(jQuery);
102
            })(jQuery);
103
 
103
 
104
            //  Function to load a page using data inthe window.location.hash
104
            //  Function to load a page using data in the window.location.hash
105
            //      Used on direct page load
105
            //      Used on direct page load
106
            //      Used via navigation buttons
106
            //      Used via navigation buttons
107
            function load_page_from_hash(mode) {
107
            function load_page_from_hash(mode) {
108
                if (typeof mode === 'object') mode = 'Indirect';
108
                if (typeof mode === 'object') mode = 'Indirect';
109
                var hash = window.location.hash;
109
                var hash = window.location.hash;
110
                if (hash.charAt(0) == '#')
110
                if (hash.charAt(0) == '#')
111
                {
111
                {
112
                    hash = hash.substr(1) ;
112
                    hash = hash.substr(1) ;
113
                    var locationData = $.deserialize(hash);
113
                    var locationData = $.deserialize(hash);
114
                    load_page_body(locationData.url, locationData );
114
                    load_page_body(locationData.url, locationData, false );
115
                }
115
                }
116
            }
116
            }
117
 
117
 
118
            load_page_from_hash('DirectLoad');
118
            load_page_from_hash('DirectLoad');
119
            $(window).on('hashchange',load_page_from_hash );
119
            $(window).on('hashchange',load_page_from_hash );
Line 124... Line 124...
124
            //      this - a DOM node
124
            //      this - a DOM node
125
            //      $(this) - The jquery wrapped node
125
            //      $(this) - The jquery wrapped node
126
            //
126
            //
127
            tableEl.on( 'click', 'tbody tr', function () {
127
            tableEl.on( 'click', 'tbody tr', function () {
128
                    var sdk_id = table.row( this ).data()[0];
128
                    var sdk_id = table.row( this ).data()[0];
129
                    load_page_body('sdk_versions.asp', {sdk_id: sdk_id});
129
                    load_page_body('sdk_versions.asp', {sdk_id: sdk_id}, true);
130
                    });
130
                    });
131
 
131
 
132
 
132
 
133
<%If canActionControl("AdminSdk") Then %>
133
<%If canActionControl("AdminSdk") Then %>
134
            //  Wire up an 'Add New SDK' button
134
            //  Wire up an 'Add New SDK' button
135
            $( '#addSdkName' ).click(function() {
135
            $( '#addSdkName' ).click(function() {
136
                load_page_body('sdk_names_body.asp');
136
                load_page_body('sdk_names_body.asp', true);
137
                });
137
                });
138
<%End If%>
138
<%End If%>
139
 
139
 
140
        //  Listen for any trigger to force the table to be refreshed
140
        //  Listen for any trigger to force the table to be refreshed
141
        //  Listen on 'document' as the event will trickle up
141
        //  Listen on 'document' as the event will trickle up
Line 143... Line 143...
143
            table.ajax.reload();
143
            table.ajax.reload();
144
            });
144
            });
145
 
145
 
146
        // Listen for new page body reload requests
146
        // Listen for new page body reload requests
147
        $(document).on("newPageBody", function(e, args){
147
        $(document).on("newPageBody", function(e, args){
148
            load_page_body(args.url, args.data);
148
            load_page_body(args.url, args.data, true);
149
 
149
 
150
            });
150
            });
151
        });
151
        });
152
 
152
 
153
//  Centralise the loading of the body of the page
153
//  Centralise the loading of the body of the page
154
//
154
//
155
function load_page_body(url, data) {
155
function load_page_body(url, data, mode) {
156
    //  Persist these values, but don't add to the stored URL
156
    //  Persist these values, but don't add to the stored URL
157
    var persist = {
157
    var persist = {
158
        rtag_id : <%=DB_RTAG_ID%>,
158
        rtag_id : <%=DB_RTAG_ID%>,
159
        proj_id : <%=DB_PROJ_ID%>,
159
        proj_id : <%=DB_PROJ_ID%>,
160
        pv_id : <%=DB_PV_ID%>
160
        pv_id : <%=DB_PV_ID%>
Line 173... Line 173...
173
    }
173
    }
174
 
174
 
175
    //  Prevent duplicates caused by changing window.location.hash
175
    //  Prevent duplicates caused by changing window.location.hash
176
    //
176
    //
177
    var newHash = jQuery.param(newdata);
177
    var newHash = jQuery.param(newdata);
178
    if ( newHash !== load_page_body.last ) {
178
    if ( newHash !== load_page_body.last || mode === true ) {
179
        $('#sdk_version').off();
179
        $('#sdk_version').off();
180
        $('#sdk_version').empty();
180
        $('#sdk_version').empty();
181
        $('#sdk_version').load(url, $.extend({}, data, persist));
181
        $('#sdk_version').load(url, $.extend({}, data, persist));
182
 
182
 
183
        load_page_body.last = newHash;
183
        load_page_body.last = newHash;
Line 203... Line 203...
203
            <td valign="top" class=side_panel style="position:relative;height:100%;width:10%">
203
            <td valign="top" class=side_panel style="position:relative;height:100%;width:10%">
204
                <!-- Side panel -->
204
                <!-- Side panel -->
205
               <table id=sdk_names class="full_table side_panel_table">
205
               <table id=sdk_names class="full_table side_panel_table">
206
                <thead>
206
                <thead>
207
                    <tr class="body_col form_align">
207
                    <tr class="body_col form_align">
208
                        <th onclick="load_page_body('sdk_names_body.asp');">SDK Names
208
                        <th onclick="load_page_body('sdk_names_body.asp', null, true);">SDK Names
209
                </thead>
209
                </thead>
210
               </table>
210
               </table>
211
 
211
 
212
            <!-- Side panel Bottom-->
212
            <!-- Side panel Bottom-->
213
<%If canActionControl("AdminSdk") Then %>
213
<%If canActionControl("AdminSdk") Then %>