2017-03-27 15:54:17 +08:00
|
|
|
(function () {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
angular
|
|
|
|
|
.module('torrents')
|
2017-04-25 10:33:03 +08:00
|
|
|
.controller('TorrentsUploadController', TorrentsUploadController);
|
2017-03-27 15:54:17 +08:00
|
|
|
|
2017-04-25 10:33:03 +08:00
|
|
|
TorrentsUploadController.$inject = ['$scope', '$state', '$translate', '$timeout', 'Authentication', 'MeanTorrentConfig', 'Upload', 'Notification',
|
2017-05-22 18:16:35 +08:00
|
|
|
'TorrentsService', 'getStorageLangService', '$filter'];
|
2017-03-27 15:54:17 +08:00
|
|
|
|
2017-04-25 10:33:03 +08:00
|
|
|
function TorrentsUploadController($scope, $state, $translate, $timeout, Authentication, MeanTorrentConfig, Upload, Notification,
|
2017-05-22 18:16:35 +08:00
|
|
|
TorrentsService, getStorageLangService, $filter) {
|
2017-03-27 15:54:17 +08:00
|
|
|
var vm = this;
|
2017-04-07 15:34:51 +08:00
|
|
|
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
|
|
|
|
|
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
2017-04-12 22:14:38 +08:00
|
|
|
vm.imdbConfig = MeanTorrentConfig.meanTorrentConfig.imdbConfig;
|
2017-04-07 15:34:51 +08:00
|
|
|
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
|
2017-05-23 18:55:59 +08:00
|
|
|
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
|
|
|
|
|
vm.lang = getStorageLangService.getLang();
|
2017-03-29 13:41:47 +08:00
|
|
|
vm.user = Authentication.user;
|
|
|
|
|
vm.progress = 0;
|
2017-05-23 18:55:59 +08:00
|
|
|
vm.selectedType = 'movie';
|
2017-03-29 13:41:47 +08:00
|
|
|
vm.successfully = undefined;
|
2017-03-31 13:24:36 +08:00
|
|
|
vm.tmdb_info_ok = undefined;
|
2017-05-24 17:26:09 +08:00
|
|
|
vm.selectedSeasons = undefined;
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.torrentInfo = null;
|
2017-05-24 17:26:09 +08:00
|
|
|
vm.inputedEpisodesError = undefined;
|
|
|
|
|
vm.inputedEpisodesOK = false;
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.tags = [];
|
2017-04-09 16:13:01 +08:00
|
|
|
vm.videoNfo = '';
|
2017-03-27 15:54:17 +08:00
|
|
|
|
|
|
|
|
// If user is not signed in then redirect back home
|
|
|
|
|
if (!Authentication.user) {
|
|
|
|
|
$state.go('authentication.signin');
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* upload
|
|
|
|
|
* @param dataUrl
|
|
|
|
|
*/
|
2017-03-29 13:41:47 +08:00
|
|
|
vm.upload = function (dataUrl) {
|
2017-04-02 00:15:33 +08:00
|
|
|
//console.log(dataUrl);
|
2017-03-29 13:41:47 +08:00
|
|
|
|
2017-03-29 19:02:28 +08:00
|
|
|
if (dataUrl === null || dataUrl === undefined) {
|
2017-03-29 13:41:47 +08:00
|
|
|
vm.fileSelected = false;
|
2017-03-29 19:02:28 +08:00
|
|
|
Notification.info({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-info-sign"></i> ' + $translate.instant('TORRENTS_NO_FILE_SELECTED')
|
2017-03-29 13:41:47 +08:00
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Upload.upload({
|
|
|
|
|
url: '/api/torrents/upload',
|
|
|
|
|
data: {
|
|
|
|
|
newTorrentFile: dataUrl
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response) {
|
|
|
|
|
$timeout(function () {
|
|
|
|
|
onSuccessItem(response);
|
|
|
|
|
});
|
|
|
|
|
}, function (response) {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if (response.status > 0) onErrorItem(response);
|
|
|
|
|
}, function (evt) {
|
|
|
|
|
vm.progress = parseInt(100.0 * evt.loaded / evt.total, 10);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* onSuccessItem
|
|
|
|
|
* @param response
|
|
|
|
|
*/
|
2017-03-29 13:41:47 +08:00
|
|
|
function onSuccessItem(response) {
|
|
|
|
|
vm.fileSelected = false;
|
|
|
|
|
vm.successfully = true;
|
|
|
|
|
// Show success message
|
2017-04-02 00:15:33 +08:00
|
|
|
console.log(response);
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.torrentInfo = response.data;
|
2017-03-29 13:41:47 +08:00
|
|
|
Notification.success({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-ok"></i> ' + $translate.instant('TORRENTS_UPLOAD_SUCCESSFULLY')
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* onErrorItem
|
|
|
|
|
* @param response
|
|
|
|
|
*/
|
2017-03-29 13:41:47 +08:00
|
|
|
function onErrorItem(response) {
|
|
|
|
|
vm.fileSelected = false;
|
|
|
|
|
vm.successfully = false;
|
|
|
|
|
vm.tFile = undefined;
|
|
|
|
|
// Show error message
|
|
|
|
|
Notification.error({
|
|
|
|
|
message: response.data,
|
|
|
|
|
title: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TORRENTS_UPLOAD_FAILED')
|
|
|
|
|
});
|
|
|
|
|
}
|
2017-03-29 19:02:28 +08:00
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* onTMDBIDKeyDown
|
|
|
|
|
* @param evt
|
|
|
|
|
*/
|
2017-03-30 19:09:41 +08:00
|
|
|
vm.onTMDBIDKeyDown = function (evt) {
|
|
|
|
|
if (evt.keyCode === 13) {
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.getInfo(vm.tmdb_id);
|
2017-03-30 19:09:41 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* onTextClick
|
|
|
|
|
* @param $event
|
|
|
|
|
*/
|
2017-03-29 19:02:28 +08:00
|
|
|
vm.onTextClick = function ($event) {
|
|
|
|
|
$event.target.select();
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
/**
|
|
|
|
|
* getIncludeInfoTemplate
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
vm.getIncludeInfoTemplate = function () {
|
|
|
|
|
switch (vm.selectedType) {
|
2017-05-26 11:53:49 +08:00
|
|
|
case 'tvserial':
|
2017-05-23 18:55:59 +08:00
|
|
|
return 'tvinfo.html';
|
|
|
|
|
case 'music':
|
|
|
|
|
return 'musicinfo.html';
|
|
|
|
|
case 'other':
|
|
|
|
|
return 'otherinfo.html';
|
|
|
|
|
default:
|
|
|
|
|
return 'movieinfo.html';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* onTorrentTypeChanged
|
|
|
|
|
*/
|
|
|
|
|
vm.onTorrentTypeChanged = function () {
|
|
|
|
|
vm.tmdb_info_ok = undefined;
|
2017-05-24 17:26:09 +08:00
|
|
|
vm.inputedEpisodesError = undefined;
|
|
|
|
|
vm.inputedEpisodesOK = false;
|
2017-05-23 18:55:59 +08:00
|
|
|
vm.tmdb_isloading = false;
|
|
|
|
|
vm.movieinfo = undefined;
|
|
|
|
|
vm.tvinfo = undefined;
|
|
|
|
|
vm.tmdb_id = undefined;
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* getInfo
|
|
|
|
|
* @param tmdbid
|
|
|
|
|
*/
|
2017-03-29 19:02:28 +08:00
|
|
|
vm.getInfo = function (tmdbid) {
|
2017-05-23 18:55:59 +08:00
|
|
|
switch (vm.selectedType) {
|
2017-05-26 11:53:49 +08:00
|
|
|
case 'tvserial':
|
2017-05-23 18:55:59 +08:00
|
|
|
vm.getTVInfo(tmdbid);
|
|
|
|
|
break;
|
|
|
|
|
case 'music':
|
|
|
|
|
break;
|
|
|
|
|
case 'other':
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
vm.getMovieInfo(tmdbid);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* getMovieInfo
|
|
|
|
|
* @param tmdbid
|
|
|
|
|
*/
|
|
|
|
|
vm.getMovieInfo = function (tmdbid) {
|
2017-03-29 19:02:28 +08:00
|
|
|
if (tmdbid === null || tmdbid === undefined) {
|
|
|
|
|
Notification.info({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-info-sign"></i> ' + $translate.instant('TMDB_ID_REQUIRED')
|
|
|
|
|
});
|
|
|
|
|
angular.element('#tmdbid').focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 13:24:36 +08:00
|
|
|
vm.tmdb_isloading = true;
|
2017-05-23 18:55:59 +08:00
|
|
|
TorrentsService.getTMDBMovieInfo({
|
2017-03-29 19:02:28 +08:00
|
|
|
tmdbid: tmdbid,
|
2017-05-05 18:27:22 +08:00
|
|
|
language: getStorageLangService.getLang()
|
2017-03-29 19:02:28 +08:00
|
|
|
}, function (res) {
|
2017-03-31 13:24:36 +08:00
|
|
|
vm.tmdb_info_ok = true;
|
|
|
|
|
vm.tmdb_isloading = false;
|
2017-05-24 17:26:09 +08:00
|
|
|
vm.inputedEpisodesOK = true;
|
2017-03-29 19:02:28 +08:00
|
|
|
Notification.success({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-ok"></i> ' + $translate.instant('TMDB_ID_OK')
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
vm.movieinfo = res;
|
2017-05-22 18:16:35 +08:00
|
|
|
|
|
|
|
|
vm.movieinfo.release_date = $filter('date')(vm.movieinfo.release_date, 'yyyy');
|
2017-03-29 19:02:28 +08:00
|
|
|
}, function (err) {
|
2017-03-31 13:24:36 +08:00
|
|
|
vm.tmdb_info_ok = false;
|
|
|
|
|
vm.tmdb_isloading = false;
|
2017-03-29 19:02:28 +08:00
|
|
|
Notification.error({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TMDB_ID_ERROR')
|
|
|
|
|
});
|
|
|
|
|
angular.element('#tmdbid').focus();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
/**
|
|
|
|
|
* getTVInfo
|
|
|
|
|
* @param tmdbid
|
|
|
|
|
*/
|
|
|
|
|
vm.getTVInfo = function (tmdbid) {
|
|
|
|
|
if (tmdbid === null || tmdbid === undefined) {
|
|
|
|
|
Notification.info({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-info-sign"></i> ' + $translate.instant('TMDB_ID_REQUIRED')
|
|
|
|
|
});
|
|
|
|
|
angular.element('#tmdbid').focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vm.tmdb_isloading = true;
|
|
|
|
|
TorrentsService.getTMDBTVInfo({
|
|
|
|
|
tmdbid: tmdbid,
|
|
|
|
|
language: getStorageLangService.getLang()
|
|
|
|
|
}, function (res) {
|
|
|
|
|
vm.tmdb_info_ok = true;
|
|
|
|
|
vm.tmdb_isloading = false;
|
|
|
|
|
Notification.success({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-ok"></i> ' + $translate.instant('TMDB_ID_OK')
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
vm.tvinfo = res;
|
2017-05-24 17:26:09 +08:00
|
|
|
if (parseInt(vm.tvinfo.number_of_seasons, 10) > 0) {
|
|
|
|
|
vm.selectedSeasons = '1';
|
|
|
|
|
}
|
2017-05-23 18:55:59 +08:00
|
|
|
}, function (err) {
|
|
|
|
|
vm.tmdb_info_ok = false;
|
|
|
|
|
vm.tmdb_isloading = false;
|
|
|
|
|
Notification.error({
|
|
|
|
|
message: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TMDB_ID_ERROR')
|
|
|
|
|
});
|
|
|
|
|
angular.element('#tmdbid').focus();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-24 17:26:09 +08:00
|
|
|
/**
|
|
|
|
|
* tvContinue
|
|
|
|
|
* @param isValid
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
|
|
|
|
vm.tvContinue = function (isValid) {
|
|
|
|
|
if (!isValid) {
|
|
|
|
|
$scope.$broadcast('show-errors-check-validity', 'vm.episodesForm');
|
|
|
|
|
|
|
|
|
|
vm.inputedEpisodesError = true;
|
|
|
|
|
return false;
|
2017-05-25 16:20:24 +08:00
|
|
|
} else {
|
2017-05-24 17:26:09 +08:00
|
|
|
vm.inputedEpisodesError = false;
|
|
|
|
|
vm.inputedEpisodesOK = true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* create
|
|
|
|
|
*/
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.create = function () {
|
|
|
|
|
//console.log(vm.torrentInfo);
|
|
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
switch (vm.selectedType) {
|
2017-05-26 11:53:49 +08:00
|
|
|
case 'tvserial':
|
2017-05-23 18:55:59 +08:00
|
|
|
vm.createTVTorrent();
|
|
|
|
|
break;
|
|
|
|
|
case 'music':
|
|
|
|
|
vm.createMusicTorrent();
|
|
|
|
|
break;
|
|
|
|
|
case 'other':
|
|
|
|
|
vm.createOtherTorrent();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
vm.createMovieTorrent();
|
2017-04-18 10:46:23 +08:00
|
|
|
}
|
2017-05-23 18:55:59 +08:00
|
|
|
};
|
2017-04-02 18:06:28 +08:00
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
/**
|
|
|
|
|
* createMovieTorrent
|
|
|
|
|
*/
|
|
|
|
|
vm.createMovieTorrent = function () {
|
|
|
|
|
var l = vm.getTorrentSize();
|
|
|
|
|
var t = vm.getResourceTag();
|
|
|
|
|
|
|
|
|
|
var torrent = new TorrentsService({
|
|
|
|
|
info_hash: vm.torrentInfo.info_hash,
|
|
|
|
|
torrent_filename: vm.torrentInfo.filename,
|
|
|
|
|
torrent_type: 'movie',
|
|
|
|
|
torrent_tags: t,
|
|
|
|
|
torrent_nfo: vm.videoNfo,
|
|
|
|
|
torrent_announce: vm.torrentInfo.announce,
|
|
|
|
|
torrent_size: l,
|
|
|
|
|
|
|
|
|
|
resource_detail_info: vm.movieinfo
|
2017-04-02 18:06:28 +08:00
|
|
|
});
|
2017-05-23 18:55:59 +08:00
|
|
|
|
|
|
|
|
torrent.$save(function (response) {
|
|
|
|
|
successCallback(response);
|
|
|
|
|
}, function (errorResponse) {
|
|
|
|
|
errorCallback(errorResponse);
|
2017-04-02 18:06:28 +08:00
|
|
|
});
|
|
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
function successCallback(res) {
|
|
|
|
|
$state.reload('torrents.uploads');
|
|
|
|
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
|
|
|
Notification.success({message: '<i class="glyphicon glyphicon-ok"></i> Torrent created successfully!'});
|
|
|
|
|
}
|
2017-05-17 10:54:08 +08:00
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
function errorCallback(res) {
|
|
|
|
|
vm.error_msg = res.data.message;
|
|
|
|
|
Notification.error({message: res.data.message, title: '<i class="glyphicon glyphicon-remove"></i> Torrent created error!'});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* createTvTorrent
|
|
|
|
|
*/
|
|
|
|
|
vm.createTVTorrent = function () {
|
|
|
|
|
var l = vm.getTorrentSize();
|
|
|
|
|
var t = vm.getResourceTag();
|
2017-05-17 10:54:08 +08:00
|
|
|
|
2017-04-02 18:06:28 +08:00
|
|
|
var torrent = new TorrentsService({
|
|
|
|
|
info_hash: vm.torrentInfo.info_hash,
|
2017-04-08 04:03:41 +08:00
|
|
|
torrent_filename: vm.torrentInfo.filename,
|
2017-05-26 11:53:49 +08:00
|
|
|
torrent_type: 'tvserial',
|
2017-05-24 17:26:09 +08:00
|
|
|
torrent_seasons: vm.selectedSeasons,
|
|
|
|
|
torrent_episodes: vm.inputedEpisodes,
|
2017-04-02 18:06:28 +08:00
|
|
|
torrent_tags: t,
|
2017-04-09 16:13:01 +08:00
|
|
|
torrent_nfo: vm.videoNfo,
|
2017-04-02 18:06:28 +08:00
|
|
|
torrent_announce: vm.torrentInfo.announce,
|
|
|
|
|
torrent_size: l,
|
2017-05-22 18:16:35 +08:00
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
resource_detail_info: vm.tvinfo
|
2017-04-02 18:06:28 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
torrent.$save(function (response) {
|
|
|
|
|
successCallback(response);
|
|
|
|
|
}, function (errorResponse) {
|
|
|
|
|
errorCallback(errorResponse);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function successCallback(res) {
|
|
|
|
|
$state.reload('torrents.uploads');
|
|
|
|
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
|
|
|
Notification.success({message: '<i class="glyphicon glyphicon-ok"></i> Torrent created successfully!'});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function errorCallback(res) {
|
|
|
|
|
vm.error_msg = res.data.message;
|
|
|
|
|
Notification.error({message: res.data.message, title: '<i class="glyphicon glyphicon-remove"></i> Torrent created error!'});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-23 18:55:59 +08:00
|
|
|
/**
|
|
|
|
|
* getTorrentSize
|
|
|
|
|
* @returns {number}
|
|
|
|
|
*/
|
|
|
|
|
vm.getTorrentSize = function () {
|
|
|
|
|
var l = 0;
|
|
|
|
|
|
|
|
|
|
if (vm.torrentInfo.length !== undefined) {
|
|
|
|
|
l = vm.torrentInfo.length;
|
|
|
|
|
} else if (vm.torrentInfo.info.length !== undefined) {
|
|
|
|
|
l = vm.torrentInfo.info.length;
|
|
|
|
|
} else {
|
|
|
|
|
angular.forEach(vm.torrentInfo.info.files, function (item) {
|
|
|
|
|
l = l + item.length;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return l;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* getResourceTag
|
|
|
|
|
* @returns {Array}
|
|
|
|
|
*/
|
|
|
|
|
vm.getResourceTag = function () {
|
|
|
|
|
var t = [];
|
|
|
|
|
var r = undefined;
|
|
|
|
|
|
|
|
|
|
switch (vm.selectedType) {
|
2017-05-26 11:53:49 +08:00
|
|
|
case 'tvserial':
|
2017-05-23 18:55:59 +08:00
|
|
|
r = vm.resourcesTags.tv;
|
|
|
|
|
break;
|
|
|
|
|
case 'music':
|
|
|
|
|
r = vm.resourcesTags.music;
|
|
|
|
|
break;
|
|
|
|
|
case 'other':
|
|
|
|
|
r = vm.resourcesTags.other;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
r = vm.resourcesTags.movie;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
angular.forEach(r.radio, function (item) {
|
|
|
|
|
if (vm.tags['tag_' + item.name]) {
|
|
|
|
|
t.push(vm.tags['tag_' + item.name]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
angular.forEach(r.checkbox, function (item) {
|
|
|
|
|
angular.forEach(item.value, function (sitem) {
|
|
|
|
|
if (vm.tags['tag_' + item.name + '_' + sitem.name]) {
|
|
|
|
|
t.push(sitem.name);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return t;
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* cancel
|
|
|
|
|
*/
|
2017-04-02 18:06:28 +08:00
|
|
|
vm.cancel = function () {
|
|
|
|
|
$state.reload('torrents.uploads');
|
|
|
|
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
|
|
|
};
|
2017-04-06 16:42:08 +08:00
|
|
|
|
2017-04-06 17:39:14 +08:00
|
|
|
/**
|
|
|
|
|
* clearAllCondition
|
|
|
|
|
*/
|
2017-04-06 16:42:08 +08:00
|
|
|
vm.clearAllCondition = function () {
|
|
|
|
|
vm.tags = [];
|
|
|
|
|
};
|
2017-03-27 15:54:17 +08:00
|
|
|
}
|
|
|
|
|
}());
|