Subversion Repositories DevTools

Rev

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

Rev 5052 Rev 5053
Line 5... Line 5...
5
'   It is a pop up dialog
5
'   It is a pop up dialog
6
'
6
'
7
'   Add a new version to the current sdk_id
7
'   Add a new version to the current sdk_id
8
%>
8
%>
9
<script>
9
<script>
10
$( "#f1" ).dialog({
10
$( "#fNewSdkVersion" ).dialog({
11
    autoOpen: true,
11
    autoOpen: true,
12
    width: 350,
12
    width: 350,
13
    modal: true,
13
    modal: true,
14
    draggable: true,
14
    draggable: true,
15
    resizable: true,
15
    resizable: true,
Line 18... Line 18...
18
            {
18
            {
19
            text  : 'Create',
19
            text  : 'Create',
20
            class : 'hideOnError',
20
            class : 'hideOnError',
21
            click : function(){
21
            click : function(){
22
                        clearInfo();
22
                        clearInfo();
23
                        $( "#f1" ).submit();
23
                        $( "#fNewSdkVersion" ).submit();
24
                        },
24
                        },
25
            },
25
            },
26
            {
26
            {
27
            text : 'Cancel',
27
            text : 'Cancel',
28
            click : function(){ 
28
            click : function(){ 
Line 46... Line 46...
46
function clearInfo(txt) {
46
function clearInfo(txt) {
47
    $("#sdkv_info").text(" ").removeClass("error");
47
    $("#sdkv_info").text(" ").removeClass("error");
48
}
48
}
49
 
49
 
50
$.validate({
50
$.validate({
51
    form: '#f1',
51
    form: '#fNewSdkVersion',
52
    validateOnBlur : false,
52
    validateOnBlur : false,
53
    onSuccess : function(f) {
53
    onSuccess : function(f) {
54
        processSdkForm(f);
54
        processSdkForm(f);
55
    },
55
    },
56
 
56
 
Line 60... Line 60...
60
//  Disable all the inputs on a form
60
//  Disable all the inputs on a form
61
//  Hide dialog buttons marked to be hidden
61
//  Hide dialog buttons marked to be hidden
62
//  All the user can do is read the error message and close the form
62
//  All the user can do is read the error message and close the form
63
function disableForm()
63
function disableForm()
64
{   
64
{   
65
    var form = $("#f1");
65
    var form = $("#fNewSdkVersion");
66
    form.dialog( "widget" ).find(".hideOnError").hide();
66
    form.dialog( "widget" ).find(".hideOnError").hide();
67
    form.find(":input").prop("disabled",true);
67
    form.find(":input").prop("disabled",true);
68
}
68
}
69
 
69
 
70
//  Process the Form
70
//  Process the Form
Line 84... Line 84...
84
        });    
84
        });    
85
};
85
};
86
 
86
 
87
//  Attach a function to the submit event
87
//  Attach a function to the submit event
88
//  Allows local processing
88
//  Allows local processing
89
$( "#f1" ).submit(function(e) {
89
$( "#fNewSdkVersion" ).submit(function(e) {
90
        e.preventDefault(); //STOP default action
90
        e.preventDefault(); //STOP default action
91
        return false;
91
        return false;
92
        });
92
        });
93
 
93
 
94
function populateProjects(){
94
function populateProjects(){
95
    getAjaxData (
95
    getAjaxData (
96
        "sdk_opr_json.asp",
96
        "sdk_opr_json.asp",
97
        { action: "getProjectList", rtag_id: <%=Request("rtag_id")%> },
97
        { action: "getProjectList" },
98
        function(data){
98
        function(data){
99
            // Populate selection
99
            // Populate selection
100
            var $options = $("#sel_project").empty();
100
            var $options = $("#sel_project").empty();
-
 
101
            $options.append($("<option />").val(null).text('Select One'));
101
            $.each(data.aaData, function (index, value) {
102
            $.each(data.aaData, function (index, value) {
102
                $options.append($("<option />").val(value.PROJ_ID).text(value.PROJ_NAME));
103
                $options.append($("<option />").val(value.PROJ_ID).text(value.PROJ_NAME));
103
            });
104
            });
104
            //$options[0].selectedIndex = 0
105
            //$options[0].selectedIndex = 0
105
            //populateReleases( $options.val())
106
            //populateReleases( $options.val())
106
 
107
 
107
            populateReleases( null, <%=Request("rtag_id")%>); 
108
            populateReleases( null, null); 
108
 
109
 
109
        });    
110
        });    
110
};
111
};
111
 
112
 
112
function populateReleases(proj_id, rtag_id){
113
function populateReleases(proj_id, rtag_id){
Line 124... Line 125...
124
                $options.val(rtag_id);
125
                $options.val(rtag_id);
125
            $("#sel_project").val(data.proj_id);
126
            $("#sel_project").val(data.proj_id);
126
        });    
127
        });    
127
};
128
};
128
 
129
 
129
//  Populate the SDK Names selection drop down
-
 
130
//      sdk_id - Current SDK Family.
-
 
131
//      el     - Eleemnt to set name into. Use .val() as it is an <input>
-
 
132
//
-
 
133
function populateSdkNames(sdk_id, el){
-
 
134
    getAjaxData (
-
 
135
        "sdk_opr_json.asp",
-
 
136
        { action: "getSdkNames" },
-
 
137
        function(data){
-
 
138
            // Populate selection
-
 
139
            var $options = $("#sel_sdkname").empty();
-
 
140
            var name
-
 
141
            $options.append($("<option />").val(null).text('Select One'));
-
 
142
            $.each(data.aaData, function (index, value) {
-
 
143
                $options.append($("<option />").val(value.SDK_ID).text(value.SDK_NAME));
-
 
144
                if ( sdk_id == value.SDK_ID ) name = value.SDK_NAME;
-
 
145
            });
-
 
146
            if ( sdk_id != null)
-
 
147
            {
-
 
148
                $options.val(sdk_id);
-
 
149
                if ( el != null && name != null)
-
 
150
                {
-
 
151
                    el.val(name);
-
 
152
                }
-
 
153
            }
-
 
154
 
-
 
155
            populateSdkVersions( sdk_id ); 
-
 
156
 
-
 
157
        });    
-
 
158
};
-
 
159
 
-
 
160
//  Populate the SDK Versions selection drop down
-
 
161
//      sdk_id  - Identify the family to select
-
 
162
//
-
 
163
function populateSdkVersions(sdk_id){
-
 
164
    getAjaxData (
-
 
165
        "sdk_opr_json.asp",
-
 
166
        { action: "getSdkVersions", sdk_id : sdk_id, mode: $("#chk_sdkversion").is(':checked') },
-
 
167
        function(data){
-
 
168
            // Populate selection
-
 
169
            var $options = $("#sel_sdkversion").empty();
-
 
170
            $options.append($("<option />").val(null).text('Select One'));
-
 
171
            $.each(data.aaData, function (index, value) {
-
 
172
                $options.append($("<option />").val(value.SDKTAG_ID).text(value.SDKTAG_NAME));
-
 
173
            });
-
 
174
        });    
-
 
175
};
-
 
176
 
-
 
177
 
-
 
178
 
130
 
179
//  getAjaxData - with error processing
131
//  getAjaxData - with error processing
180
//      url - url to fetch
132
//      url - url to fetch
181
//      data    - additional data to pass to ajax request
133
//      data    - additional data to pass to ajax request
182
//      success - function to call on success
134
//      success - function to call on success
Line 216... Line 168...
216
        }
168
        }
217
    });
169
    });
218
 
170
 
219
}
171
}
220
 
172
 
-
 
173
//  Get getSdkDetails
-
 
174
//      When this is complete we will populate the remainder of the page.
-
 
175
getAjaxData (
-
 
176
    "sdk_opr_json.asp",
-
 
177
    { action: "getSdkDetails", sdk_id : <%=Request("sdk_id")%> },
-
 
178
    function(data){
-
 
179
        
-
 
180
        $("#sdkDetails").val( data.aaData.SDK_NAME);
221
//  Populate the Projects Drop Down List
181
        //  Populate the Projects Drop Down List
222
populateProjects();
182
        populateProjects();
223
populateSdkNames(<%=Request("sdk_id")%>, $("#sdk_familyname"));
183
    });    
-
 
184
 
224
 
185
 
225
//  Wire up various controls to auto-populate others
186
//  Wire up various controls to auto-populate others
226
$("#sel_project").change(function(){
187
$("#sel_project").change(function(){
227
    setInfo("New project Value: " + $(this).val());
-
 
228
    populateReleases( $(this).val(), null);
188
    populateReleases( $(this).val(), null);
229
    });
189
    });
230
 
190
 
231
$("#chk_release").change(function(){
191
$("#chk_release").change(function(){
232
    populateReleases( $("#sel_project").val(), $("#sel_release").val());
192
    populateReleases( $("#sel_project").val(), $("#sel_release").val());
233
});
193
});
234
 
194
 
235
$("#sel_release").change(function(){
-
 
236
    setInfo("New Release Value: " + $(this).val());
-
 
237
    });
-
 
238
 
-
 
239
$("#sel_sdkname").change(function(){
-
 
240
    populateSdkVersions( $("#sel_sdkname").val());
-
 
241
});
-
 
242
 
-
 
243
$("#chk_sdkversion").change(function(){
-
 
244
    populateSdkVersions( $("#sel_sdkname").val());
-
 
245
});
-
 
246
 
-
 
247
//# sourceURL=sdk_versions_add.asp
195
//# sourceURL=sdk_versions_add.asp
248
</script>
196
</script>
249
<form title="Create new SDK Version" id=f1 action="sdk_opr_json.asp" class=td>
197
<form title="Create new SDK Version" id=fNewSdkVersion action="sdk_opr_json.asp" class=td>
250
    
198
    
251
	<div style='min-height:25px;position:relative;'>
199
	<div style='min-height:25px;position:relative;'>
252
        <img id='sdkv_progressBar' src='icons/i_processing.gif' width='79' height='14'style='visibility:hidden;position:absolute;'>
200
        <img id='sdkv_progressBar' src='icons/i_processing.gif' width='79' height='14'style='visibility:hidden;position:absolute;'>
253
        <div id='sdkv_info' style='position:absolute;'></div>
201
        <div id='sdkv_info' style='position:absolute;'></div>
254
    </div>
202
    </div>
255
 
203
 
256
    <fieldset>
204
    <p>SDK:
257
    <legend>SDK Family</legend>
205
    <br><input id=sdkDetails disabled>
258
    <input id=sdk_familyname type="text" readonly size=40>
-
 
259
    </fieldset>
-
 
260
 
206
 
261
    <fieldset>
207
    <fieldset>
262
    <legend>SDK Version</legend>
208
    <legend>SDK Version</legend>
263
    <p>Name:
209
    <p>Name:
264
    <br><input id=sdk_name type="text" name="sdkName" autofocus maxlength=50 size=40 data-validation="length" data-validation-length="min4">
210
    <br><input id=sdk_name type="text" name="sdkName" maxlength=50 size=40 data-validation="length,alphanumeric" data-validation-length="min4" data-validation-allowing="_. -">
265
 
211
 
266
    <p>Description:
212
    <p>Description:
267
    <br><textarea id=sdk_comment name="sdkComment" cols=40  data-validation="length" data-validation-length="5-4000"></textarea>                                              
213
    <br><textarea id=sdk_comment name="sdkComment" cols=40  data-validation="length" data-validation-length="5-4000"></textarea>                                              
268
    </fieldset>
214
    </fieldset>
269
 
215
 
Line 279... Line 225...
279
        <select id=sel_release name=rtag_id data-validation="required">
225
        <select id=sel_release name=rtag_id data-validation="required">
280
        <option value="">Select One</option>
226
        <option value="">Select One</option>
281
        </select>
227
        </select>
282
    </fieldset>
228
    </fieldset>
283
 
229
 
284
    <fieldset>
-
 
285
    <legend>Template SDK</legend>
-
 
286
    <p>SDK Family:<br>
-
 
287
        <select id=sel_sdkname name=sdk_id data-validation="required">
230
    <input type="hidden" name="sdk_id" value="<%=Request("sdk_id")%>">
288
        <option value="">Select One</option>
-
 
289
        </select>
-
 
290
 
-
 
291
    <p>Version:<br>
-
 
292
        <select id=sel_sdkversion name=sdktag_id>
-
 
293
        <option value="">Select One</option>
-
 
294
        </select>
-
 
295
    <input id=chk_sdkversion type=checkbox>Show all versions
-
 
296
    </fieldset>
-
 
297
 
-
 
298
    <input type="hidden" name="action" value="addNewSdkVersion">
231
    <input type="hidden" name="action" value="addNewSdkVersion">
299
</form>
232
</form>
300
 
233