{:uriI"file:///Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/assets.js.coffee?type=application/javascript&pipeline=self&id=571e8b585fed11441b67edecb05fc369ace3d6f21ebe9a0996ab018199d6ac10:ET:load_pathI"E/Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts;T: filenameI"`/Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/assets.js.coffee;T: nameI"push_type/assets;T:logical_pathI"push_type/assets.self.js;T:content_typeI"application/javascript;T: sourceI" (function() { this.app.controller('AssetListCtrl', [ '$scope', function($scope) { $scope.assetCount = function() { return $scope.assets.length; }; $scope.editUrl = function(asset) { return $scope.assetUrl.replace(/~id/, asset.id); }; return $scope.afterUpload = function(asset) { $scope.assets.unshift(asset); return $scope.assets = $scope.assets.slice(0, 20); }; } ]); this.app.controller('AssetUploadCtrl', [ '$scope', function($scope) { $scope.method = function() { if ($scope.asset['new_record?']) { return 'post'; } else { return 'patch'; } }; $scope.saveUrl = function() { if ($scope.asset['new_record?']) { return $scope.createUrl; } else { return $scope.updateUrl.replace(/~id$/, $scope.asset.id); } }; $scope.saveButtonClass = function() { if ($scope.asset['new_record?']) { return 'success'; } else { return 'primary'; } }; $scope.saveButtonText = function() { if ($scope.asset['new_record?']) { return 'Upload file'; } else { return 'Update media'; } }; return $scope.afterUpload = function(asset) { return $scope.asset = asset; }; } ]); this.app.directive('assetUpload', function() { return function(scope, $el, attrs) { if (!(window.FileReader && Modernizr.draganddrop)) { $el.hide(); return; } if (attrs.assetFallback) { scope.hideFileField = true; } return $el.filedrop({ fallback_id: attrs.assetFallback, url: attrs.assetUpload, paramname: 'asset[file]', maxfiles: attrs.assetMaxfiles || 1, dragOver: function() { return $(this).addClass('hover'); }, dragLeave: function() { return $(this).removeClass('hover'); }, drop: function() { return $(this).removeClass('hover'); }, uploadFinished: function(i, file, response, time) { scope.afterUpload(response.asset); if (!scope.$$phase) { return scope.$apply(); } } }); }; }); }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"nfile-digest:///Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/assets.js.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%;ZdL{[` L&W@O: lengthi :dependencies_digest"%C!/4Z%s&eV:idI"E571e8b585fed11441b67edecb05fc369ace3d6f21ebe9a0996ab018199d6ac10;F: mtimel+~T