Subversion Repositories DevTools

Rev

Rev 5357 | Rev 5751 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|  sdk_main_page.asp
5
'|  Create a new version of an SDK
6
'|
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<%
20
'------------ ACCESS CONTROL ------------------
21
%>
22
<!--#include file="_access_control_general.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parSdkTag_id
26
 
27
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
parSdkTag_id = Request("sdktag_id")
30
If parSdkTag_id = "" Then parSdkTag_id = 0
31
%>
32
<!DOCTYPE html>
33
<html>
34
   <head>
35
        <title>Release Manager</title>
36
        <link rel="shortcut icon" href="<%=FavIcon%>"/>
37
        <meta http-equiv="Pragma" content="no-cache">
38
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39
        <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
40
        <link rel="stylesheet" href="images/navigation.css" type="text/css">
41
        <script language="JavaScript" src="images/common.js"></script>
42
        <%bJqueryDataTables = TRUE%>
43
        <%bJqueryForms = TRUE%>
44
        <!--#include file="_jquery_includes.asp"-->
45
        <!-- TIPS -->
46
        <script language="JavaScript" src="images/tipster.js"></script>
47
        <script language="JavaScript" src="images/_help_tips.js"></script>
48
        <!-- DROPDOWN MENUS -->
49
        <!--#include file="_menu_def.asp"-->
50
        <script language="JavaScript1.2" src="images/popup_menu.js"></script>
51
        <!-- Script associated with the display of the SDK Names side panel -->
52
        <script type="text/javascript" charset="utf-8">
53
        $(document).ready(function() {
54
            var tableEl = $('#sdk_names');
55
 
56
            // Disable caching of AJAX responses
57
            $.ajaxSetup ({
58
                cache: false 
59
            });
60
 
61
            //  Configure the Summary Table
62
            var table = tableEl.DataTable({
63
                deferRender:    true,
64
                dom:            "t",
65
                sScrollY: $( document ).height() - 200,
66
                scrollCollapse: true,
67
                processing: true,
68
                'retrieve': true,
69
                'serverSide': true,
70
                'ajaxSource': 'sdk_names_json.asp',
71
                'ordering': false,
72
                'columns': [ { data: 1, className: 'dt-nowrap side_panel_data'  } ]
73
            });
74
            //
75
            //  jQuery function to deserialise an encoded parameter list
76
            //  The opposite of $.param()
77
            (function ($) {
78
                $.deserialize = function (str, options) {
79
                    var pairs = str.split(/&amp;|&/i),
80
                        h = {},
81
                        options = options || {};
82
                    for(var i = 0; i < pairs.length; i++) {
83
                        var kv = pairs[i].split('=');
84
                        kv[0] = decodeURIComponent(kv[0]);
85
                        if(!options.except || options.except.indexOf(kv[0]) == -1) {
86
                            if((/^\w+\[\w+\]$/).test(kv[0])) {
87
                                var matches = kv[0].match(/^(\w+)\[(\w+)\]$/);
88
                                if(typeof h[matches[1]] === 'undefined') {
89
                                    h[matches[1]] = {};
90
                                }
91
                                h[matches[1]][matches[2]] = decodeURIComponent(kv[1]);
92
                            } else {
93
                                h[kv[0]] = decodeURIComponent(kv[1]);
94
                            }
95
                        }
96
                    }
97
                    return h;
98
                };
99
 
100
                $.fn.deserialize = function (options) {
101
                    return $.deserialize($(this).serialize(), options);
102
                };
103
            })(jQuery);
104
 
105
            //  Function to load a page using data in the window.location.hash
106
            //      Used on direct page load
107
            //      Used via navigation buttons
108
            function load_page_from_hash(mode) {
109
                if (typeof mode === 'object') mode = 'Indirect';
110
                var hash = window.location.hash;
111
                if (hash.charAt(0) == '#')
112
                {
113
                    hash = hash.substr(1) ;
114
                    var locationData = $.deserialize(hash);
115
                    load_page_body(locationData.url, locationData, false );
116
                }
117
            }
118
 
119
            load_page_from_hash('DirectLoad');
120
            $(window).on('hashchange',load_page_from_hash );
121
 
122
 
123
            // Process click on the table row
124
            // Display versions available for this SDK
125
            //      this - a DOM node
126
            //      $(this) - The jquery wrapped node
127
            //
128
            tableEl.on( 'click', 'tbody tr', function () {
129
                    var sdk_id = table.row( this ).data()[0];
130
                    load_page_body('sdk_versions.asp', {sdk_id: sdk_id}, true);
131
                    });
132
 
133
 
134
<%If canActionControl("AdminSdk") Then %>
135
            //  Wire up an 'Add New SDK' button
136
            $( '#addSdkName' ).click(function() {
137
                load_page_body('sdk_names_body.asp', true);
138
                });
139
<%End If%>
140
 
141
        //  Listen for any trigger to force the table to be refreshed
142
        //  Listen on 'document' as the event will trickle up
143
        $(document).on("sdkNameEdited", function(){
144
            table.ajax.reload();
145
            });
146
 
147
        // Listen for new page body reload requests
148
        $(document).on("newPageBody", function(e, args){
149
            load_page_body(args.url, args.data, true);
150
 
151
            });
152
        });
153
 
154
//  Centralise the loading of the body of the page
155
//
156
function load_page_body(url, data, mode) {
157
    //  Persist these values, but don't add to the stored URL
158
    var persist = {
159
        rtag_id : <%=DB_RTAG_ID%>,
160
        proj_id : <%=DB_PROJ_ID%>,
161
        pv_id : <%=DB_PV_ID%>
162
    };
163
 
164
    //  Reflect the current page load in the URL
165
    //      Shows what we are doing
166
    //      Allows page reload to work
167
    //      Allows browser history to work
168
    var newdata = {};
169
    newdata['url'] = url;
170
    if ( typeof(data) !== 'undefined' ){
171
        for (var key in data) {
172
            newdata[key] = (data[key]);
173
        }
174
    }
175
 
176
    //  Prevent duplicates caused by changing window.location.hash
177
    //
178
    var newHash = jQuery.param(newdata);
179
    if ( newHash !== load_page_body.last || mode === true ) {
180
        $('#sdk_version').off();
181
        $('#sdk_version').empty();
182
        $('#sdk_version').load(url, $.extend({}, data, persist));
183
 
184
        load_page_body.last = newHash;
185
        window.location.hash = newHash;
186
   }
187
}
188
        </script>
189
      <!-- DROPDOWN MENUS -->
190
   </head>
191
   <body>
192
 
193
      <!-- MENU LAYERS -->
194
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')"
195
         onmouseout="highlightmenu(event,'off');dynamichide(event)">
196
      </div>
197
      <!-- TIPS LAYERS -->
198
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
199
      <!-- HEADER -->
200
      <!--#include file="_header.asp"-->
201
      <!-- BODY -->
202
      <table border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEFEF" style="min-height:500px;width:100%">
203
         <tr>
204
            <td valign="top" class=side_panel style="position:relative;height:100%;width:10%;border-right:#999999 solid 1px;">
205
                <!-- Side panel -->
206
               <table id=sdk_names class="full_table side_panel_table">
207
                <thead>
208
                    <tr class="body_col form_align">
209
                        <th onclick="load_page_body('sdk_names_body.asp', null, true);">SDK Names
210
                </thead>
211
               </table>
212
 
213
            <!-- Side panel Bottom-->
214
<%If canActionControl("AdminSdk") Then %>
215
                <img id=addSdkName style="position:absolute;bottom:0;right:0;" src="images/bt_new_project.gif" width="16" height="16" border="0" vspace="5" hspace="5" align="right" alt="Create new SDK Family" title="Create new SDK Family">
216
<%End If%>
217
            </td>
218
            <td width="5%"  rowspan="2" valign="top"></td>
219
            <td width="80%" rowspan="2" align="center" valign="top">
220
               <!-- Main display panel -->
221
               <div id=sdk_version></div>
222
               <!-- End Main display panel -->
223
            <td width="5%"  rowspan="2" valign="top"></td>
224
         </tr>
225
      </table>
226
<!-- FOOTER -->
227
<!--#include file="_footer.asp"-->
228
</body>
229
</html>
230
<%
231
Call Destroy_All_Objects
232
%>