Subversion Repositories DevTools

Rev

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

Rev 7536 Rev 7573
Line 27... Line 27...
27
<%
27
<%
28
'------------ Variable Definition -------------
28
'------------ Variable Definition -------------
29
Dim parRtagId
29
Dim parRtagId
30
Dim modifyState
30
Dim modifyState
31
Dim bReleaseSyncEnabled
31
Dim bReleaseSyncEnabled
-
 
32
Dim bCanDestroy
32
 
33
 
33
'------------ Constants Declaration -----------
34
'------------ Constants Declaration -----------
34
'------------ Variable Init -------------------
35
'------------ Variable Init -------------------
35
parRtagId = Request("rtag_id")
36
parRtagId = Request("rtag_id")
36
objPMod.PersistInQryString("rtag_id")
37
objPMod.PersistInQryString("rtag_id")
37
ReleaseMode = GetReleaseMode( Request("rtag_id") )
38
ReleaseMode = GetReleaseMode( Request("rtag_id") )
38
modifyState = "disabled"
-
 
39
bReleaseSyncEnabled = (releaseInfoHash("S3MANIFEST") = "Y")
39
bReleaseSyncEnabled = (releaseInfoHash("S3MANIFEST") = "Y")
-
 
40
bCanDestroy = canActionControlInProject("DestroyRelease")
40
 
41
 
41
If releaseIsWritable(ReleaseMode) Then
-
 
42
    If canActionControlInProject("ConfigureRelease") OR canActionControlInProject("EditNonCriticalInfoForLockedPackage") Then modifyState = ""
-
 
43
End If
-
 
44
'----------------------------------------------
-
 
45
Sub ShowSidePanel
42
Sub ShowSidePanel
46
End Sub
43
End Sub
47
'----------------------------------------------
44
'----------------------------------------------
48
Sub ShowMainPanel
45
Sub ShowMainPanel
49
 %>
46
 %>
Line 56... Line 53...
56
                <!-- Section Body Header ---->
53
                <!-- Section Body Header ---->
57
                <!-- Main Pane -->
54
                <!-- Main Pane -->
58
                <table id="snapshotTable" width="100%" class="stripe">
55
                <table id="snapshotTable" width="100%" class="stripe">
59
                    <thead class="body_col">
56
                    <thead class="body_col">
60
                        <tr>
57
                        <tr>
-
 
58
                          <th class=tleft>Opr
61
                          <th class=tleft>PV_ID
59
                          <th class=tleft>PV_ID
62
                          <th class=tleft>Release Name
60
                          <th class=tleft>Release Name
63
                          <th class=tleft>Created
61
                          <th class=tleft>Created
64
                          <th class=tleft>Comments
62
                          <th class=tleft>Comments
65
                          <th class=tleft>Gen Manifest
63
                          <th class=tleft>Gen Manifest
Line 80... Line 78...
80
                </div>
78
                </div>
81
            </div>
79
            </div>
82
            </td>
80
            </td>
83
        </tr>
81
        </tr>
84
    </table>
82
    </table>
-
 
83
    <div >
-
 
84
      <ul id="select-menu" style="display:none;">
-
 
85
       <li data-opr="open" title="Goto this Snapshot">Open ...</li>
-
 
86
        <li data-opr="edit" title="Edit the properties of the Snapshot">Edit Properties</li>
-
 
87
        <li>-</li>
-
 
88
        <li data-opr="diffRelease" title="Compare or Merge with parent Release">Merge/Diff with Release</li>
-
 
89
        <li data-opr="diffSelect" title="Select as the source (left side) of a comparison">Select for Diff</li>
-
 
90
        <li id="select-menu-diff" data-opr="diff" title="Compare from selected snapshot to this snapshot">Diff from selected</li>
-
 
91
        <li>-</li>
-
 
92
        <li id="select-menu-destroy" data-opr="delete", title="Delete the selected Snapshot">Destroy Snapshot</li>
-
 
93
        <li>-</li>
-
 
94
        <li>Close Menu</li>
-
 
95
      </ul>
-
 
96
    </div>
85
<%
97
<%
86
End Sub
98
End Sub
87
'----------------------------------------------
99
'----------------------------------------------
88
%>
100
%>
89
<html>
101
<html>
Line 100... Line 112...
100
        <!-- TIPS -->
112
        <!-- TIPS -->
101
        <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
113
        <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
102
        <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
114
        <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
103
        <script language="JavaScript" type="text/javascript">
115
        <script language="JavaScript" type="text/javascript">
104
        </script>
116
        </script>
-
 
117
        <!-- Dropdown action menu scripts -->
-
 
118
        <style>
-
 
119
            .ui-menu { position: absolute; text-align: left }
-
 
120
        </style>
105
        <script type="text/javascript" charset="utf-8">
121
        <script type="text/javascript" charset="utf-8">
106
        var table;
122
        var table;
107
        $(document).ready(function() {
123
        $(document).ready(function() {
108
            /* Init DataTables */
124
            /* Init DataTables */
109
            table = $("#snapshotTable").DataTable({
125
            table = $("#snapshotTable").DataTable({
Line 134... Line 150...
134
 
150
 
135
                        row[6] = '';
151
                        row[6] = '';
136
                        if ( checked != '' ) {
152
                        if ( checked != '' ) {
137
                            row[6] = 'manifest_<%=parRtagId%>_'+row[0]+'.json' + "&nbsp<%=enum_imgClipBoard10%>"
153
                            row[6] = 'manifest_<%=parRtagId%>_'+row[0]+'.json' + "&nbsp<%=enum_imgClipBoard10%>"
138
                        }
154
                        }
-
 
155
 
-
 
156
                        row.unshift("<span title='Select operation from dropdown menu' " +
-
 
157
                                    "class='select-operation ui-icon ui-icon-triangle-1-s' " +
-
 
158
                                    "data-rtag-id='" + row[0] +
-
 
159
                                    "' style='display:inline-block'>" +
-
 
160
                                    "</span>" );
139
                        
161
                        
140
                    });
162
                    });
141
                    return json.data;
163
                    return json.data;
142
                }
164
                }
143
            },
165
            },
Line 148... Line 170...
148
            scroller : {
170
            scroller : {
149
                loadingIndicator : true,
171
                loadingIndicator : true,
150
                displayBuffer: 9,
172
                displayBuffer: 9,
151
            },
173
            },
152
            columns: [
174
            columns: [
-
 
175
               { width: "1%", className: "dt-nowrap",orderable: false },
153
               { visible : false },
176
               { visible : false },
154
               { width: "10%", className: "dt-nowrap"  },
177
               { width: "10%", className: "dt-nowrap"  },
155
               { width: "10%", className: "dt-nowrap"  },
178
               { width: "10%", className: "dt-nowrap"  },
156
               { width: "70%",orderable: false },
179
               { width: "70%",orderable: false },
157
               { width: "1%", className: "dt-nowrap" ,orderable: false },
180
               { width: "1%", className: "dt-nowrap" ,orderable: false },
158
               { width: "1%", className: "dt-nowrap" ,orderable: false },
181
               { width: "1%", className: "dt-nowrap" ,orderable: false },
159
               { width: "1%", className: "dt-nowrap clipThis" ,orderable: false },
182
               { width: "1%", className: "dt-nowrap clipThis" ,orderable: false },
160
               //{ width: "10%",className: "dt-nowrap" },
183
               //{ width: "10%",className: "dt-nowrap" },
161
           ]
184
           ]
162
        });
185
        });
-
 
186
 
-
 
187
    // Create and Hide the Menu
-
 
188
    $( "#select-menu" ).hide().menu();
-
 
189
 
-
 
190
    // Register menuselect event handler
-
 
191
    $( "#select-menu" ).on( "menuselect", function( event, ui ) {
-
 
192
       var opr = ui.item.data('opr');
-
 
193
 
-
 
194
        // Invoke operation within the menu data structure
-
 
195
        if (typeof $.miniMenu[opr] == 'function' ) {
-
 
196
          $.miniMenu['event'] = event;
-
 
197
          $.miniMenu[opr]($.miniMenu);
-
 
198
          return;
-
 
199
        }
-
 
200
        console.log ("Menu Operation:", opr, "Not found");
-
 
201
    });
-
 
202
 
-
 
203
    $.miniMenu = {
-
 
204
        //  Data
-
 
205
 
-
 
206
        //  Menu operations
-
 
207
        open : function (data) {
-
 
208
            //console.log("Opening:", data.rtagid);
-
 
209
            this.gotoUrl("dependencies.asp", {rtag_id : data.rtagid});
-
 
210
         },
-
 
211
 
-
 
212
         edit : function (data) {
-
 
213
             //console.log("Editing:", data.rtagid);
-
 
214
             this.gotoUrl("form_edit_release.asp", {rtag_id : data.rtagid, rfile : "<%=ScriptName%>"});
-
 
215
         },
-
 
216
 
-
 
217
         diffSelect : function (data) {
-
 
218
             //console.log("Merge from:", data.rtagid );
-
 
219
             $('#snapshotTable .body_row_sel2').removeClass('body_row_sel2');
-
 
220
             if (data.mergeLeft != data.rtagid) {
-
 
221
                 data.mergeLeft = data.rtagid;
-
 
222
                 $.miniMenu.currentRow.removeClass('body_row_sel');
-
 
223
                 $.miniMenu.currentRow.addClass('body_row_sel2');
-
 
224
             } else {
-
 
225
                 delete(data.mergeLeft);
-
 
226
             }
-
 
227
         },
-
 
228
 
-
 
229
         diffRelease : function (data) {
-
 
230
             //console.log ("diffRelease", data.mergeLeft, data.rtagid);
-
 
231
             this.gotoUrl("diff.asp", { rtagA : data.rtagid, rtagB : <%=parRtagId%>});
-
 
232
         },
-
 
233
 
-
 
234
 
-
 
235
         diff : function (data) {
-
 
236
             //console.log ("Merge:Diff", data.mergeLeft, data.rtagid);
-
 
237
             this.gotoUrl("diff.asp", { rtagA : data.mergeLeft, rtagB : data.rtagid});
-
 
238
         },
-
 
239
 
-
 
240
<%If objAccessControl.UserLogedIn Then%>
-
 
241
         delete : function (data) {
-
 
242
             //console.log("Delete:", data.rtagid);
-
 
243
             $.miniMenu.currentRow.addClass('body_row_sel_outline');
-
 
244
             var that = this;
-
 
245
             vixConfirm("This Snapshot will be permanently destroyed.<p>Are you sure?", { 
-
 
246
                deferred : true, 
-
 
247
                title: 'Destroy Snapshot', 
-
 
248
                button : 'Destroy Snapshot',
-
 
249
                icon : 'images/i_critical.gif' }
-
 
250
             ).done(function(){
-
 
251
                 that.gotoUrl("_destroy_release.asp", {rtag_id_list : data.rtagid, proj_id : <%=DB_PROJ_ID%>, parentRtag : <%=DB_RTAG_ID%> ,rfile : "<%=ScriptName%>"});
-
 
252
             }).fail(function(){
-
 
253
                 $('#snapshotTable .body_row_sel_outline').removeClass('body_row_sel_outline');
-
 
254
             });
-
 
255
         },
-
 
256
<%End If%>
-
 
257
 
-
 
258
         //
-
 
259
         // Internal functions
-
 
260
         // Goto url, or open in new tab
-
 
261
         gotoUrl: function (url, params)
-
 
262
         {
-
 
263
             // Open in new tab - not as simple as it sounds
-
 
264
             // Need to create a form and submit it
-
 
265
             if(this.event.shiftKey){
-
 
266
                 var form = $('<form>',{
-
 
267
                     action : url,
-
 
268
                     target : '_blank',
-
 
269
                     //method : 'GET'
-
 
270
                     });
-
 
271
 
-
 
272
                 $.each(params,function(n,v){
-
 
273
                     var item = $('<input>',{
-
 
274
                         name : n,
-
 
275
                         value : v
-
 
276
                     });
-
 
277
                     form.append(item);
-
 
278
                    });
-
 
279
 
-
 
280
 
-
 
281
                 form.appendTo(document.body);
-
 
282
                 form.submit();
-
 
283
                 form.remove();
-
 
284
             }
-
 
285
             else {
-
 
286
                 if (params)
-
 
287
                     url += '?' + jQuery.param(params)
-
 
288
                 window.location.href = url;
-
 
289
             }
-
 
290
         },
-
 
291
};
-
 
292
 
-
 
293
    // Add menu to all require instances
-
 
294
$( '#snapshotTable' ).on ('click', '.select-operation', function(event) {
-
 
295
     // When clicked - create and show the menu
-
 
296
     // Insert rtag-id
-
 
297
 
-
 
298
    // In order to have the menu positioing work correctly
-
 
299
    //   Create a div that covers the visible screen area
-
 
300
    //   Us it within the menu poistioning
-
 
301
    //   Then delete it again
-
 
302
    var positionDiv = $( "<div></div>" ).css({
-
 
303
            position: 'absolute',
-
 
304
            top : $(document).scrollTop(),
-
 
305
            left : $(document).scrollLeft(),
-
 
306
            width: '100vw',
-
 
307
            height: '100vh',
-
 
308
            'z-index' : -1,
-
 
309
        });
-
 
310
    positionDiv.appendTo(document.body);
-
 
311
 
-
 
312
     //  Create the menu
-
 
313
     var menu = $("#select-menu").show().position({
-
 
314
          my: "left top",
-
 
315
          at: "center bottom",
-
 
316
          of: this,
-
 
317
          within : positionDiv,
-
 
318
     }).zIndex(10);
-
 
319
 
-
 
320
     // Cleanup the poistioning div
-
 
321
     positionDiv.remove();
-
 
322
 
-
 
323
     // Setup global data
-
 
324
     $.miniMenu.rtagid = $(this).data('rtag-id');
-
 
325
 
-
 
326
     // Set initial menu state - merge target
-
 
327
     $('#select-menu-diff').toggleClass('ui-state-disabled',!('mergeLeft' in $.miniMenu ));
-
 
328
 
-
 
329
    // Set initial state destroy
-
 
330
    var canDestroy = <%=iif(bCanDestroy,"1","0")%>
-
 
331
    $('#select-menu-destroy').toggleClass('ui-state-disabled',(canDestroy == 0));
-
 
332
 
-
 
333
    // Highlight the row selected
-
 
334
    $('#snapshotTable .body_row_sel').removeClass('body_row_sel');
-
 
335
    $.miniMenu.currentRow = $(event.target).closest('tr').addClass('body_row_sel');
-
 
336
 
-
 
337
    // Allow click outside of the menu to close it
-
 
338
    $( document ).one( "click", function() {
-
 
339
        menu.hide();
-
 
340
    });
-
 
341
 
-
 
342
 
-
 
343
        // Prevent propagation of event
-
 
344
    return false;
-
 
345
    });
-
 
346
 
163
});
347
});
164
 
348
 
165
//  getAjaxData - with error processing
349
//  getAjaxData - with error processing
166
//      url - url to fetch
350
//      url - url to fetch
167
//      data    - additional data to pass to ajax request
351
//      data    - additional data to pass to ajax request
Line 213... Line 397...
213
    $("#ds_info").text(" ");
397
    $("#ds_info").text(" ");
214
}
398
}
215
 
399
 
216
}
400
}
217
</script>
401
</script>
218
 
-
 
219
      <!-- DROPDOWN MENUS -->
402
      <!-- DROPDOWN MENUS -->
220
      <!--#include file="_menu_def.asp"-->
403
      <!--#include file="_menu_def.asp"-->
221
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
404
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
222
   </head>
405
   </head>
223
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
406
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">