From 35f7ae11771d961d4b6cc787eb6c578fbe000044 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 6 Nov 2016 15:23:08 +0800 Subject: [PATCH] code refactor --- src/index.html | 1 + src/scripts/config/constants.js | 97 ------------------------------ src/scripts/config/fileTypes.js | 102 ++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 97 deletions(-) create mode 100644 src/scripts/config/fileTypes.js diff --git a/src/index.html b/src/index.html index aacf4a2..6f7757f 100644 --- a/src/index.html +++ b/src/index.html @@ -298,6 +298,7 @@ + diff --git a/src/scripts/config/constants.js b/src/scripts/config/constants.js index 82194a5..d851cf9 100644 --- a/src/scripts/config/constants.js +++ b/src/scripts/config/constants.js @@ -15,103 +15,6 @@ lazySaveTimeout: 500, errorTooltipDelay: 500, notificationInPageTimeout: 2000 - }).constant('ariaNgFileTypes', { - video: [ - '.3gp', - '.3gpp', - '.asf', - '.asx', - '.avi', - '.dat', - '.flv', - '.m4v', - '.mkv', - '.mov', - '.mp4', - '.mpe', - '.mpeg', - '.mpg', - '.rm', - '.rmvb', - '.vob', - '.wmv' - ], - audio: [ - '.aac', - '.amr', - '.ape', - '.flac', - '.m4a', - '.mid', - '.mp3', - '.ogg', - '.ra', - '.vqf', - '.wav', - '.wma' - ], - picture: [ - '.bmp', - '.emf', - '.gif', - '.jp2', - '.jpeg', - '.jpg', - '.png', - '.psd', - '.raw', - '.tga', - '.tif', - '.tiff', - '.wmf' - ], - document: [ - '.doc', - '.docx', - '.key', - '.numbers', - '.odp', - '.ods', - '.odt', - '.pages', - '.pdf', - '.ppt', - '.pptx', - '.rtf', - '.txt', - '.vsd', - '.vsdx', - '.wps', - '.xls', - '.xlsx' - ], - application: [ - '.apk', - '.bat', - '.com', - '.deb', - '.dll', - '.dmg', - '.exe', - '.ipa', - '.jar', - '.rpm', - '.sh' - ], - archive: [ - '.7z', - '.arj', - '.bz2', - '.cab', - '.gz', - '.iso', - '.r', - '.rar', - '.tar', - '.tar', - '.z', - '.zip' - ] }).constant('ariaNgDefaultOptions', { language: 'en', title: '${downspeed}, ${upspeed} - ${title}', diff --git a/src/scripts/config/fileTypes.js b/src/scripts/config/fileTypes.js new file mode 100644 index 0000000..3da8dcb --- /dev/null +++ b/src/scripts/config/fileTypes.js @@ -0,0 +1,102 @@ +(function () { + 'use strict'; + + angular.module('ariaNg').constant('ariaNgFileTypes', { + video: [ + '.3gp', + '.3gpp', + '.asf', + '.asx', + '.avi', + '.dat', + '.flv', + '.m4v', + '.mkv', + '.mov', + '.mp4', + '.mpe', + '.mpeg', + '.mpg', + '.rm', + '.rmvb', + '.vob', + '.wmv' + ], + audio: [ + '.aac', + '.amr', + '.ape', + '.flac', + '.m4a', + '.mid', + '.mp3', + '.ogg', + '.ra', + '.vqf', + '.wav', + '.wma' + ], + picture: [ + '.bmp', + '.emf', + '.gif', + '.jp2', + '.jpeg', + '.jpg', + '.png', + '.psd', + '.raw', + '.tga', + '.tif', + '.tiff', + '.wmf' + ], + document: [ + '.doc', + '.docx', + '.key', + '.numbers', + '.odp', + '.ods', + '.odt', + '.pages', + '.pdf', + '.ppt', + '.pptx', + '.rtf', + '.txt', + '.vsd', + '.vsdx', + '.wps', + '.xls', + '.xlsx' + ], + application: [ + '.apk', + '.bat', + '.com', + '.deb', + '.dll', + '.dmg', + '.exe', + '.ipa', + '.jar', + '.rpm', + '.sh' + ], + archive: [ + '.7z', + '.arj', + '.bz2', + '.cab', + '.gz', + '.iso', + '.r', + '.rar', + '.tar', + '.tar', + '.z', + '.zip' + ] + }); +}());