-
Notifications
You must be signed in to change notification settings - Fork 12
/
app.js
51 lines (36 loc) · 1.84 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* Copyright 2015 PetaByteBoy
This file is part of the Material Design Firmware Downloader.
The Material Design Firmware Downloader is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Material Design Firmware Downloader is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the Material Design Firmware Downloader. If not, see <http://www.gnu.org/licenses/>. */
angular.module('firmwareDownload', ['ngMaterial'])
.controller('DownloadCtrl', function($scope, $location, $interpolate){
$scope.modes = modes;
$scope.sites = sites;
$scope.manufacturers = manufacturers;
$scope.routers = routers;
$scope.version = version;
$scope.splitString = function (string, nb) {
return string.substring(0,nb);
};
$scope.interpolate = function (value) {
return $interpolate(value)($scope);
};
//select factory by default
$scope.selectedMode = "factory";
//read selection from url parameters
if($location.search().mode != null) { $scope.selectedMode = $location.search().mode; }
if($location.search().region != null) { $scope.selectedSite = $location.search().region; }
if($location.search().router != null) { $scope.selectedRouter = $location.search().router; }
})
//make parameters work without #! in the url
.config(function($locationProvider) {
$locationProvider.html5Mode({ enabled: true, requireBase: false });
});