Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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