Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script type="text/javascript" src="https://snxd.akamaized.net/js/stamp-1.0.14.js"></script>
<div ng-app="multi-download-app" ng-controller="multi-download-cart" id="multi-download-app">
  <table>
    <tr>
      <th><h4>Industry</h4></th>
      <th><h4>Sample</h4></th>
      <th><h4>Description</h4></th>
      <th><h4>Size</h4></th>
      <th><h4>Download</h4></th>
    </tr>
    <tr ng-repeat="item in items">
      <td>
        <b>{{ item.name }}</b>
      </td>
      <td>
        <div ng-repeat="image in item.images">
          <img ng-src="{{image}}" width="150" align="left" />
        </div>
      </td>
      <td ng-bind-html="item.description"></td>
      <td>{{ item.size }}</td>
      <td>
        <center>
          <div class="item-in-cart">
            <input class="download-item" id="checkbox-{{$index}}" type="checkbox" ng-model="item.checked" ng-change="checkItem()" value="None">
            <label for="checkbox-{{$index}}"></label>
          </div>
        </center>
      </td>
    </tr>
  </table>
  <button class="alignright" disabled="disabled" ng-click="downloadItems()">
    <i class="fa fa-download"></i> Download Selected Items</button>
</div>
              
            
!

CSS

              
                #multi-download-app .download-popup {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

#multi-download-app table {
  border-collapse: collapse;
  background-color: white;
}
#multi-download-app td,
#multi-download-app th {
  font-family: Open Sans;
  font-size: 15px;
  color: #535353;
  vertical-align: top;
  line-height: 1.6;
  border: 0px solid lightgray;
}
#multi-download-app td { 
  padding: 10px;
}
#multi-download-app td:nth-child(1) {
  width: 100px;
  text-align: center;
}
#multi-download-app td:nth-child(2) {
  width: 170px;
  text-align: center;
}
#multi-download-app td:nth-child(5) {
  width: 170px;
  text-align: center;
}
#multi-download-app td img {
  padding-right: 6px;
  padding-bottom: 6px;
}
#multi-download-app th {
  background-color: #e7e2e2;
}
#multi-download-app th h4 {
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  margin: 6px;
}

#multi-download-app button {
  font-family: Raleway, Open Sans;
  font-weight: 600;
  text-transform: uppercase;
  border-width: 0px;
  border-bottom: 3px;
  border-color: #73353f;
  border-style: solid;
  border-radius: 4px;
  padding: 8px;
  padding-left: 16px;
  padding-right: 16px;
  background-color: #a24d4f;
  color: white;
}
#multi-download-app button:hover {
  color: #f8f1d1;
  cursor: pointer;
}
#multi-download-app button:disabled {
  background-color: #e0e0e0 !important;
  border-color: lightgray !important;
  color: #909090 !important;
}
#multi-download-app button.alignright {
  float: right;
}

#multi-download-app .item-in-cart {
  width: 20px;
  position: relative;
}
#multi-download-app .item-in-cart label {
  width: 20px;
  height: 20px;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  background: #ffffff;
  background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 40%, #cecece 100%);
  border-radius: 4px;
  border: 1px solid #c0c0c0;
}
#multi-download-app .item-in-cart label:after {
  content: '';
  width: 9px;
  height: 5px;
  position: absolute;
  top: 5px;
  left: 4px;
  border: 3px solid #333;
  border-top: none;
  border-right: none;
  background: transparent;
  opacity: 0;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
#multi-download-app .item-in-cart label:hover::after {
  opacity: 0.5;
}
#multi-download-app .item-in-cart input[type=checkbox] {
  visibility: hidden;
}
#multi-download-app .item-in-cart input[type=checkbox]:checked + label:after {
  opacity: 1;
}

              
            
!

JS

              
                angular.module('multi-download-app', ['ngSanitize'])
  .controller('multi-download-cart', function ($scope) {
  // List of all items available for download
  $scope.items = [
    {
      "name": "Oil",
      "images": ["https://snxd.akamaized.net/demoassets/earth/GeoEye_Ikonos_Oil_2005NOV25.png"],
      "description": "High resolution operation of an oil town and facilties. Resolution of 1m using IKONOS sensor. Provided by GeoEye.",
      "size": "33MB",
      "data":
      {
          "name": "Oil",
          "url": "https://snxd.akamaized.net/demoassets/earth/GeoEye_Ikonos_Oil_2005NOV25.jpg"
      }
    },
    {
      "name": "Mining",
      "images": ["https://snxd.akamaized.net/demoassets/earth/GeoEye_Mining_2009FEB14.png"],
      "description": "High resolution image of a mining operation from an imaging satellite. Resolution of 50cm provided by GeoEye.",
      "size": "47MB",
      "data":
      {
          "name": "Mining",
          "url": "https://snxd.akamaized.net/demoassets/earth/GeoEye_Mining_2009FEB14.jpg"
      }
    },
    {
      "name": "Agriculture",
      "images": ["https://snxd.akamaized.net/demoassets/earth/RapidEye_Altotting_Germany_Agriculture_and_Forestry_2009MAY17.png"],
      "description": "High resolution satelitte image of agriculture and forestry in Altötting, Germany. Resolution of 5m provided by RapidEye.",
      "size": "56MB",
      "data":
      {
          "name": "Agriculture",
          "url": "https://snxd.akamaized.net/demoassets/earth/RapidEye_Altotting_Germany_Agriculture_and_Forestry_2009MAY17.jpg"
      }
    }
  ];
  $scope.getCartItems = function () {
    // Get the items to send to the stamping service
    var items = [];
    for (var i = 0; i < $scope.items.length; i += 1) {
      if ($scope.items[i].checked === true) {
        items.push($scope.items[i].data);
      }
    }
    return items;
  };
  $scope.checkItem = function() {
    // Assign disabled css class to download button based on if items selected
    var button = angular.element("#multi-download-app button");
    if ($scope.getCartItems().length == 0) {
      button.prop('disabled', true);
    } else {
      button.prop('disabled', false);
    }
  };
  $scope.downloadItems = function () {
    var directDlm = createDirectDlm();    
    directDlm.setIdWin("ca2122ce-5519-42fd-8929-8ed739a84cea");
    directDlm.setIdMac("9d5104e4-a23d-456c-afcb-7711914145fa");
    directDlm.setFilename("MultiDownloadDLM");
    directDlm.addItems($scope.getCartItems());
    directDlm.download();
  };
});
              
            
!
999px

Console