Download pool/shard000/JavaScript/0000003_gallery.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 2.54 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000003_gallery.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/JavaScript/0000003_gallery.js
-
curl -L -o 0000003_gallery.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000003_gallery.js
2.54 kB
| /** | |
| * Each section of the site has its own module. It probably also has | |
| * submodules, though this boilerplate is too simple to demonstrate it. Within | |
| * `src/app/gallery`, however, could exist several additional folders representing | |
| * additional modules that would then be listed as dependencies of this one. | |
| * For example, a `note` section could have the submodules `note.create`, | |
| * `note.delete`, `note.edit`, etc. | |
| * | |
| * Regardless, so long as dependencies are managed correctly, the build process | |
| * will automatically take take of the rest. | |
| * | |
| * The dependencies block here is also where component dependencies should be | |
| * specified, as shown below. | |
| */ | |
| angular.module( 'dash.gallery', [ | |
| 'ui.router', | |
| 'angular-hal' | |
| ]) | |
| /** | |
| * Each section or module of the site can also have its own routes. AngularJS | |
| * will handle ensuring they are all available at run-time, but splitting it | |
| * this way makes each module more "self-contained". | |
| */ | |
| .config(function config( $stateProvider ) { | |
| $stateProvider.state( 'gallery', { | |
| url: '/gallery', | |
| views: { | |
| "main": { | |
| controller: 'GalleryCtrl', | |
| templateUrl: 'gallery/gallery.tpl.html' | |
| } | |
| }, | |
| data:{ pageTitle: 'Gallery' } | |
| }); | |
| }) | |
| /** | |
| * And of course we define a controller for our route. | |
| */ | |
| .controller( 'GalleryCtrl', function GalleryController( $scope, GalleryApi, $q, $modal ) { | |
| GalleryApi.albums() | |
| .then( function( albums ) { | |
| // console.log(GalleryApi); | |
| // console.log(albums); | |
| $scope.albums = albums; | |
| }) | |
| ; | |
| $scope.loadAlbum = function(album) { | |
| $scope.selected = album; | |
| album.$get('images') | |
| .then(function(images) { | |
| $scope.images = images.map( function( image ) { | |
| image.href = image.$href('medium'); | |
| image.thumb = image.$href('thumb'); | |
| return image; | |
| }); | |
| }); | |
| }; | |
| $scope.open = function (image, images) { | |
| var modalInstance = $modal.open({ | |
| resolve: { | |
| images: function() { | |
| return images.map(function(img) { | |
| img.active = img === image ? true : false; | |
| return img; | |
| }); | |
| } | |
| }, | |
| templateUrl: 'lightbox-modal.html', | |
| controller: 'ModalInstanceCtrl' | |
| }); | |
| }; | |
| }).controller( 'ModalInstanceCtrl', function ( $scope, images ) { | |
| $scope.images = images; | |
| }) | |
| .factory( 'GalleryApi', function ( $http, halClient ) { | |
| // console.log(halClient); | |
| var apiFactory = | |
| { | |
| load: function() { return halClient.$get('/gallery/api'); }, | |
| albums: function() { | |
| return apiFactory.load() | |
| .then(function(api) { return api.$get('albums'); }); | |
| } | |
| }; | |
| return apiFactory; | |
| }) | |
| ; | |