Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +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 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 18 | function renderBundle( /* Array of Data Objects */ bundleData ) |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 19 | { |
| 20 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 21 | // number of actions plus 3 -- id, name and state |
| 22 | var columns = bundleData.numActions + 3; |
| 23 | var startLevel = bundleData.startLevel; |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 24 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 25 | header( columns ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 26 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 27 | installForm( startLevel ); |
| 28 | |
| 29 | if (bundleData.error) |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 30 | { |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 31 | error( columns, bundleData.error ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 32 | } |
| 33 | else |
| 34 | { |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 35 | data ( bundleData.data ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 38 | installForm( startLevel ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 39 | |
Felix Meschberger | a3214dd | 2008-06-19 11:08:47 +0000 | [diff] [blame] | 40 | footer( columns ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 43 | function installForm( /* int */ startLevel ) |
| 44 | { |
| 45 | document.write( "<form method='post' enctype='multipart/form-data'>" ); |
| 46 | document.write( "<tr class='content'>" ); |
| 47 | document.write( "<td class='content'> </td>" ); |
| 48 | document.write( "<td class='content'>" ); |
| 49 | document.write( "<input type='hidden' name='action' value='install' />" ); |
Felix Meschberger | 0704b05 | 2008-06-25 08:44:16 +0000 | [diff] [blame] | 50 | document.write( "<input class='input' type='file' name='bundlefile' size='50'>" ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 51 | document.write( " - Start <input class='checkradio' type='checkbox' name='bundlestart' value='start'>" ); |
Felix Meschberger | 0704b05 | 2008-06-25 08:44:16 +0000 | [diff] [blame] | 52 | document.write( " - Start Level <input class='input' type='input' name='bundlestartelevel' value='" + startLevel + "' size='4'>" ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 53 | document.write( "</td>" ); |
| 54 | document.write( "<td class='content' align='right' colspan='5' noWrap>" ); |
| 55 | document.write( "<input class='submit' style='width:auto' type='submit' value='Install or Update'>" ); |
| 56 | document.write( " " ); |
Felix Meschberger | f96d39f | 2008-06-26 09:53:18 +0000 | [diff] [blame] | 57 | document.write( "<input class='submit' style='width:auto' type='button' value='Refresh Packages' onClick='changeDataEntryState(0, \"refreshPackages\");'>" ); |
Felix Meschberger | 4c66413 | 2008-06-02 13:52:15 +0000 | [diff] [blame] | 58 | document.write( "</td>" ); |
| 59 | document.write( "</tr>" ); |
| 60 | document.write( "</form>" ); |
| 61 | } |