Subversion Repositories DevTools

Rev

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

Rev 5051 Rev 5052
Line 75... Line 75...
75
                        {"visible" : false, "targets" : [2]},
75
                        {"visible" : false, "targets" : [2]},
76
                        {"visible" : false, "targets" : [3]},
76
                        {"visible" : false, "targets" : [3]},
77
                        ],
77
                        ],
78
                    });
78
                    });
79
 
79
 
-
 
80
            //
-
 
81
            //  jQuery function to deserialise an encoded parameter list
-
 
82
            //  The opposite of $.param()
-
 
83
            (function ($) {
-
 
84
                $.deserialize = function (str, options) {
-
 
85
                    var pairs = str.split(/&|&/i),
-
 
86
                        h = {},
-
 
87
                        options = options || {};
-
 
88
                    for(var i = 0; i < pairs.length; i++) {
-
 
89
                        var kv = pairs[i].split('=');
-
 
90
                        kv[0] = decodeURIComponent(kv[0]);
-
 
91
                        if(!options.except || options.except.indexOf(kv[0]) == -1) {
-
 
92
                            if((/^\w+\[\w+\]$/).test(kv[0])) {
-
 
93
                                var matches = kv[0].match(/^(\w+)\[(\w+)\]$/);
-
 
94
                                if(typeof h[matches[1]] === 'undefined') {
-
 
95
                                    h[matches[1]] = {};
-
 
96
                                }
-
 
97
                                h[matches[1]][matches[2]] = decodeURIComponent(kv[1]);
-
 
98
                            } else {
-
 
99
                                h[kv[0]] = decodeURIComponent(kv[1]);
-
 
100
                            }
-
 
101
                        }
-
 
102
                    }
-
 
103
                    return h;
-
 
104
                };
-
 
105
 
-
 
106
                $.fn.deserialize = function (options) {
-
 
107
                    return $.deserialize($(this).serialize(), options);
-
 
108
                };
-
 
109
            })(jQuery);
-
 
110
 
-
 
111
            //
-
 
112
            //  If this is a page refresh, then pick up the #, decode it
-
 
113
            //  and navigate to the required location
-
 
114
            var hash = window.location.hash;
-
 
115
            if (hash.charAt(0) == '#')
-
 
116
            {
-
 
117
                hash = hash.substr(1) ;
-
 
118
                var locationData = $.deserialize(hash);
-
 
119
                load_page_body(locationData.url, locationData );
-
 
120
            }
-
 
121
 
-
 
122
 
80
            //  Centralise the loading of the body of the page
123
            //  Centralise the loading of the body of the page
81
            //
124
            //
82
            function load_page_body(url, data) {
125
            function load_page_body(url, data) {
83
                $('#sdk_version').off();
126
                $('#sdk_version').off();
84
                $('#sdk_version').empty();
127
                $('#sdk_version').empty();
85
                $('#sdk_version').load(url, data);
128
                $('#sdk_version').load(url, data);
-
 
129
 
-
 
130
                //  Reflect the current page load in the URL
-
 
131
                //      Shows what we are doing
-
 
132
                //      Allows page reload to
-
 
133
                
-
 
134
                var newdata = {};
-
 
135
                newdata['url'] = url;
-
 
136
                if ( typeof(data) !== 'undefined' ){
-
 
137
                    for (var key in data) {
-
 
138
                        newdata[key] = (data[key]);
-
 
139
                    }
-
 
140
                }
-
 
141
                window.location.hash = jQuery.param(newdata);
86
            }
142
            }
87
 
143
 
88
                    // Process click on the table row
144
                    // Process click on the table row
89
                    // Display versions available for this SDK
145
                    // Display versions available for this SDK
90
                    //      this - a DOM node
146
                    //      this - a DOM node
Line 109... Line 165...
109
            table.ajax.reload();
165
            table.ajax.reload();
110
            });
166
            });
111
 
167
 
112
        // Listen for new page body reload requests
168
        // Listen for new page body reload requests
113
        $(document).on("newPageBody", function(e, args){
169
        $(document).on("newPageBody", function(e, args){
114
console.log ("nePageBody:" + args.url + args.data);
-
 
115
            load_page_body(args.url, args.data);
170
            load_page_body(args.url, args.data);
116
 
171
 
117
            });
172
            });
118
        });
173
        });
119
        </script>
174
        </script>