Carsten Ziegeler | ce5bccd | 2011-07-14 11:13:23 +0000 | [diff] [blame^] | 1 | /*
|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more
|
| 3 | * contributor license agreements. See the NOTICE file distributed with
|
| 4 | * this work for additional information regarding copyright ownership.
|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0
|
| 6 | * (the "License"); you may not use this file except in compliance with
|
| 7 | * the License. You may obtain a copy of the License at
|
| 8 | *
|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 10 | *
|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 | * See the License for the specific language governing permissions and
|
| 15 | * limitations under the License.
|
| 16 | */
|
| 17 | function pad(value) {
|
| 18 | if ( value < 10 ) {
|
| 19 | return "0" + value;
|
| 20 | }
|
| 21 | return "" + value;
|
| 22 | }
|
| 23 |
|
| 24 | function downloadDump(ext) {
|
| 25 | var now = new Date();
|
| 26 | var name = "configuration-status-" + now.getUTCFullYear() + pad(now.getUTCMonth() + 1) + pad(now.getUTCDate()) + "-" + pad(now.getUTCHours()) + pad(now.getUTCMinutes()) + pad(now.getUTCSeconds()) + ".";
|
| 27 | location.href = location.href + "/" + name + ext;
|
| 28 | }
|
| 29 |
|
Valentin Pavlov Valchev | 06471f1 | 2010-04-06 13:42:15 +0000 | [diff] [blame] | 30 | $(document).ready(function() {
|
| 31 | var dlg = $('#waitDlg').dialog({
|
| 32 | modal : true,
|
| 33 | autoOpen : false,
|
| 34 | draggable: false,
|
| 35 | resizable: false,
|
| 36 | closeOnEscape: false
|
| 37 | });
|
| 38 |
|
| 39 | $('#tabs').tabs({ajaxOptions: {
|
| 40 | beforeSend : function() { dlg.dialog('open') },
|
| 41 | complete : function() { dlg.dialog('close')}
|
| 42 | }}).tabs('paging');
|
Carsten Ziegeler | ce5bccd | 2011-07-14 11:13:23 +0000 | [diff] [blame^] | 43 |
|
| 44 | $('.downloadTxt').click(function() { downloadDump('txt')});
|
| 45 | $('.downloadZip').click(function() { downloadDump('zip')});
|
Valentin Pavlov Valchev | 06471f1 | 2010-04-06 13:42:15 +0000 | [diff] [blame] | 46 | }); |