Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disable packages to build without dependancies.

  • Loading branch information...
commit 6eee2fa36c280c4686d8caa342c51e9d2327fc1f 1 parent 0e47c80
@timwienk timwienk authored
View
20 assets/packager.css
@@ -61,6 +61,14 @@ table {
margin-bottom: 20px;
}
+div.package-disabled table.horizontal {
+ display: none;
+}
+
+div.package-disabled table.vertical tbody {
+ display: none;
+}
+
th {
text-align: left;
background: #fff;
@@ -194,6 +202,18 @@ div.buttons {
float: right;
}
+div.package div.disabled {
+ display: none;
+}
+
+div.package-disabled div.enabled {
+ display: none;
+}
+
+div.package-disabled div.disabled {
+ display: block;
+}
+
p.submit input {
font: 14px/1.2 Helvetica;
font-weight: bold;
View
37 assets/packager.js
@@ -14,6 +14,7 @@ var Packager = this.Packager = {
var pkg = packages[name] = {
enabled: true,
element: element,
+ toggle: element.getElement('.toggle'),
components: []
};
@@ -50,6 +51,14 @@ var Packager = this.Packager = {
Packager.deselectPackage(name);
});
+ element.getElement('.disable').addListener('click', function(){
+ Packager.disablePackage(name);
+ });
+
+ element.getElement('.enable').addListener('click', function(){
+ Packager.enablePackage(name);
+ });
+
});
form.addEvents({
@@ -159,6 +168,34 @@ var Packager = this.Packager = {
});
},
+ enablePackage: function(name){
+ var pkg = packages[name];
+ if (!pkg || pkg.enabled) return;
+
+ pkg.enabled = true;
+ pkg.element.removeClass('package-disabled');
+ pkg.element.getElement('tr').removeClass('last');
+ pkg.toggle.set('value', '');
+
+ pkg.components.each(function(name){
+ components[name].element.set('disabled', false);
+ });
+ },
+
+ disablePackage: function(name){
+ var pkg = packages[name];
+ if (!pkg || !pkg.enabled) return;
+
+ pkg.enabled = false;
+ pkg.element.addClass('package-disabled');
+ pkg.element.getElement('tr').addClass('last');
+ pkg.toggle.set('value', name);
+
+ pkg.components.each(function(name){
+ components[name].element.set('disabled', true);
+ });
+ },
+
getSelected: function(){
var selected = [];
for (var name in components) if (components[name].selected) selected.push(name);
View
6 controllers/web.php
@@ -47,8 +47,14 @@ public function download(){
$files = $this->post('files');
$addheaders = $this->post('addheaders');
+ $disabled = $this->post('disabled');
$pkg = new Packager($packages);
+
+ foreach ($disabled as $package){
+ if ($package) $pkg->remove_package($package);
+ }
+
$contents = $pkg->build_from_files($files);
header("Content-Type: text/plain");
View
71 views/interface.tpl
@@ -19,36 +19,47 @@
<div id="package-<?php echo $name; ?>" class="package">
<table class="vertical">
- <tr class="first">
- <th>Name</th>
- <td>
- <?php echo $name; ?>
- <div class="buttons">
- <input type="button" class="select" value="select package" />
- <input type="button" class="deselect" value="deselect package" />
- </div>
- </td>
- </tr>
- <tr class="middle">
- <th>Web</th>
- <td><?php echo $data['package_web']; ?></td>
- </tr>
- <tr class="middle">
- <th>Description</th>
- <td><?php echo $data['package_description']; ?></td>
- </tr>
- <tr class="middle">
- <th>Copyright</th>
- <td><?php echo $data['package_copyright']; ?></td>
- </tr>
- <tr class="middle">
- <th>License</th>
- <td><?php echo $data['package_license']; ?></td>
- </tr>
- <tr class="last">
- <th>Authors</th>
- <td><?php echo $data['package_authors']; ?></td>
- </tr>
+ <thead>
+ <tr class="first">
+ <th>Name</th>
+ <td>
+ <?php echo $name; ?>
+ <div class="buttons">
+ <input type="hidden" name="disabled[]" class="toggle" value="" />
+ <div class="enabled">
+ <input type="button" class="select" value="select package" />
+ <input type="button" class="deselect" value="deselect package" />
+ <input type="button" class="disable" value="disable package" />
+ </div>
+ <div class="disabled">
+ <input type="button" class="enable" value="enable package" />
+ </div>
+ </div>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="middle">
+ <th>Web</th>
+ <td><?php echo $data['package_web']; ?></td>
+ </tr>
+ <tr class="middle">
+ <th>Description</th>
+ <td><?php echo $data['package_description']; ?></td>
+ </tr>
+ <tr class="middle">
+ <th>Copyright</th>
+ <td><?php echo $data['package_copyright']; ?></td>
+ </tr>
+ <tr class="middle">
+ <th>License</th>
+ <td><?php echo $data['package_license']; ?></td>
+ </tr>
+ <tr class="last">
+ <th>Authors</th>
+ <td><?php echo $data['package_authors']; ?></td>
+ </tr>
+ </tbody>
</table>
<table class="horizontal">
Please sign in to comment.
Something went wrong with that request. Please try again.