diff --git a/DEPENDS b/DEPENDS index 16d206e16..8cdbab2c6 100644 --- a/DEPENDS +++ b/DEPENDS @@ -1,7 +1,6 @@ === Core === * python >= 2.6 * twisted >= 8.1 - * twisted-web >= 8.1 * pyopenssl * setuptools * gettext @@ -10,7 +9,7 @@ * chardet * geoip-database (optional) * setproctitle (optional) - * rencode >= 1.0.2 (optional), a Python port is already included + * rencode >= 1.0.2 (optional), Python port is included * libtorrent (rasterbar) >= 0.16.7 @@ -28,3 +27,4 @@ === Web === * mako + * slimit diff --git a/deluge/ui/web/build b/deluge/ui/web/build deleted file mode 100755 index ad8944285..000000000 --- a/deluge/ui/web/build +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -BASE_DIR="${PWD}/`dirname ${0}`" -BASE_DIR=`readlink -f "$BASE_DIR"` -SOURCE_DIR=`readlink -f "${BASE_DIR}/${1}"` -BUILD_NAME=`basename $1` -BUILD_FILE="${SOURCE_DIR}/.build" -BUILD_DATA="${SOURCE_DIR}/.build_data" -BUILD_DIR=`dirname $SOURCE_DIR` -BUILD_DATA_GENERATED=0 - -YUI_COMPRESSOR=`which yuicompressor` -BUILD_TYPE="js" - -if [ -z $YUI_COMPRESSOR ]; then - YUI_COMPRESSOR=`which yui-compressor` - if [ -z $YUI_COMPRESSOR ]; then - echo "Please install yuicompressor" - exit 1 - fi -fi - -add_file() -{ - FILES="${FILES} ${SOURCE_DIR}/$1" -} - -check_file() -{ - # No build data is stored so return 1 since we can't make any guesses. - [ ! -e $BUILD_DATA ] && return 1; - - FILE=$1 - LAST_BUILD=`grep $FILE $BUILD_DATA` - if [ $? = 1 ]; then return 1; fi; - - CURRENT=`grep $FILE $BUILD_DATA.tmp` - - [ "$CURRENT" != "$LAST_BUILD" ] && return 1 - - return 0; -} - -gen_build_data() -{ - for FILE in $FILES; do - md5sum $FILE >> $BUILD_DATA.tmp - done; - BUILD_DATA_GENERATED=1 -} - -check() -{ - # no build data exists so we can't make guesses - [ -e $BUILD_DATA ] || return 1 - - # remove an existing temp build data file - [ -e $BUILD_DATA.tmp ] && rm $BUILD_DATA.tmp - - # generate new build data - gen_build_data - - # check files for building - NEEDS_BUILDING=0 - for FILE in $FILES; do - check_file $FILE || NEEDS_BUILDING=1 - done; - - # return the result - return $NEEDS_BUILDING -} - -build() -{ - - echo "building $BUILD_NAME" - - # generated the unminified version - cat $FILES > $BUILD_DIR/$BUILD_NAME-debug.js - - # generated the minified version - $YUI_COMPRESSOR --type=$BUILD_TYPE -o "$BUILD_DIR/$BUILD_NAME.js" \ - $BUILD_DIR/$BUILD_NAME-debug.js - - # generate build data incase there hasn't been any - [ $BUILD_DATA_GENERATED = 1 ] || gen_build_data - - # move new build data to take the place of the old data - mv $BUILD_DATA.tmp $BUILD_DATA -} - -do_exit() -{ - echo $1 - exit $2 -} - -# check to see if the folders build file exists -[ -e "$BUILD_FILE" ] || do_exit "no build file found" 1 - -# include the folders build file -. $BUILD_FILE - -# check if the build needs to take place -check && do_exit "no changes have been made" 0 - -build diff --git a/deluge/ui/web/js/deluge-all/.build b/deluge/ui/web/js/deluge-all/.build deleted file mode 100644 index 0a7a4af44..000000000 --- a/deluge/ui/web/js/deluge-all/.build +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -add_file "data/SortTypes.js" -add_file "data/PeerRecord.js" -add_file "data/TorrentRecord.js" -add_file "details/DetailsPanel.js" -add_file "details/DetailsTab.js" -add_file "details/FilesTab.js" -add_file "details/OptionsTab.js" -add_file "details/PeersTab.js" -add_file "details/StatusTab.js" -add_file "add/Window.js" -add_file "add/AddWindow.js" -add_file "add/FileWindow.js" -add_file "add/FilesTab.js" -add_file "add/Infohash.js" -add_file "add/OptionsPanel.js" -add_file "add/OptionsTab.js" -add_file "add/UrlWindow.js" -add_file "preferences/BandwidthPage.js" -add_file "preferences/CachePage.js" -add_file "preferences/DaemonPage.js" -add_file "preferences/DownloadsPage.js" -add_file "preferences/EncryptionPage.js" -add_file "preferences/InstallPluginWindow.js" -add_file "preferences/InterfacePage.js" -add_file "preferences/NetworkPage.js" -add_file "preferences/OtherPage.js" -add_file "preferences/PluginsPage.js" -add_file "preferences/PreferencesWindow.js" -add_file "preferences/ProxyField.js" -add_file "preferences/ProxyPage.js" -add_file "preferences/QueuePage.js" -add_file "StatusbarMenu.js" -add_file "OptionsManager.js" -add_file "AddConnectionWindow.js" -add_file "AddTrackerWindow.js" -add_file "Client.js" -add_file "ConnectionManager.js" -add_file "Deluge.js" -add_file "EditTrackerWindow.js" -add_file "EditTrackersWindow.js" -add_file "EventsManager.js" -add_file "FileBrowser.js" -add_file "FilterPanel.js" -add_file "Formatters.js" -add_file "Keys.js" -add_file "LoginWindow.js" -add_file "Menus.js" -add_file "MoveStorage.js" -add_file "MultiOptionsManager.js" -add_file "OtherLimitWindow.js" -add_file "Plugin.js" -add_file "RemoveWindow.js" -add_file "Sidebar.js" -add_file "Statusbar.js" -add_file "Toolbar.js" -add_file "TorrentGrid.js" -add_file "UI.js" diff --git a/deluge/ui/web/js/extjs/ext-extensions/.build b/deluge/ui/web/js/extjs/ext-extensions/.build deleted file mode 100644 index 7e0b691e1..000000000 --- a/deluge/ui/web/js/extjs/ext-extensions/.build +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -add_file "layout/FormLayoutFix.js" -add_file "tree/TreeGrid.js" -add_file "tree/TreeGridColumnResizer.js" -add_file "tree/TreeGridColumns.js" -add_file "tree/TreeGridLoader.js" -add_file "tree/TreeGridNodeUI.js" -add_file "tree/TreeGridNodeUIFix.js" -add_file "tree/TreeGridRenderColumn.js" -add_file "tree/TreeGridSorter.js" -add_file "grid/BufferView.js" -add_file "form/FileUploadField.js" -add_file "form/RadioGroupFix.js" -add_file "form/SpinnerField.js" -add_file "form/SpinnerFieldFix.js" -add_file "form/SpinnerGroup.js" -add_file "form/ToggleField.js" -add_file "JSLoader.js" -add_file "Spinner.js" -add_file "StatusBar.js" diff --git a/minify_web_js.py b/minify_web_js.py new file mode 100755 index 000000000..41d6c26b7 --- /dev/null +++ b/minify_web_js.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +import os +import sys +import fileinput +import fnmatch +from slimit import minify + +"""Minifies the Webui JS files + +Usage: python minify_web_js.py deluge/ui/web/js/deluge-all +""" + +if len(sys.argv) != 2: + print "Specify a source js directory... e.g. " + sys.exit(1) + +SOURCE_DIR = os.path.abspath(sys.argv[1]) +BUILD_NAME = os.path.basename(SOURCE_DIR) +BUILD_DIR = os.path.dirname(SOURCE_DIR) +SRC_FILE_LIST = [] +for root, dirnames, filenames in os.walk(SOURCE_DIR): + for filename in fnmatch.filter(filenames, '*.js'): + SRC_FILE_LIST.append(os.path.join(root, filename)) + +if not SRC_FILE_LIST: + print 'No js files found' + sys.exit(1) + +print 'Minifying %s' % BUILD_NAME + +# generate the single file, unminified version +file_dbg_js = os.path.join(BUILD_DIR, BUILD_NAME + '-debug.js') +with open(file_dbg_js, 'w') as _file: + input_lines = fileinput.input(SRC_FILE_LIST) + _file.writelines(input_lines) + +# generate the minified version +fileout_js = os.path.join(BUILD_DIR, BUILD_NAME + '.js') +with open(fileout_js, 'w') as out_file: + with open(file_dbg_js, 'r') as in_file: + out_file.write(minify(in_file.read()))