PageSourceSearch

https://www.alejandrosanz.com/services/media.js

js alejandrosanz.com collected 2026-10-02 07:17:12 UTC 933 bytes, 38 lines download raw bytes

1'use strict';
2
3angular.module('alejandrosanz').factory('Media', ['domain', '$resource', '$modal', '$rootScope', 'Upload', function(domain, $resource, $modal, $rootScope, Upload) {
4
5  var Media = $resource(domain + '/media/:id', { id: '@id' }, {
6    update: { method: 'PUT' }
7  });
8
9  Media.openManageModal = function(media) {
10    var scope = $rootScope.$new();
11    scope.media = media;
12    $modal({
13      scope: scope,
14      templateUrl: 'modules/media/manage/manageMedia.tpl.html',
15      controller: 'ManageMediaCtrl'
16    });
17  }
18
19  Media.prototype.$save = function(cb, err) {
20    var data = this.toJSON();
21    Upload.upload({
22      url: domain + '/media',
23      data: data
24    }).then(cb, err);
25  }
26
27  Media.prototype.$update = function(cb, err) {
28    var data = this.toJSON();
29    data._method = "PUT";
30    Upload.upload({
31      url: domain + '/media/' + data.id,
32      data: data
33    }).then(cb, err);
34  }
35
36  return Media;
37
38}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.