summaryrefslogtreecommitdiffstats
path: root/deluge/ui
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/ui')
-rw-r--r--deluge/ui/common.py2
-rw-r--r--deluge/ui/console/__init__.py8
-rw-r--r--deluge/ui/console/cmdline/command.py1
-rw-r--r--deluge/ui/console/console.py1
-rw-r--r--deluge/ui/console/eventlog.py125
-rw-r--r--deluge/ui/console/main.py461
-rw-r--r--deluge/ui/console/modes/basemode.py22
-rw-r--r--deluge/ui/console/modes/connectionmanager.py7
-rw-r--r--deluge/ui/console/modes/torrentdetail.py2
-rw-r--r--deluge/ui/console/modes/torrentlist/torrentactions.py1
-rw-r--r--deluge/ui/console/utils/config.py118
-rw-r--r--deluge/ui/console/widgets/popup.py3
-rw-r--r--deluge/ui/data/share/metainfo/deluge.metainfo.xml.in (renamed from deluge/ui/data/share/appdata/deluge.appdata.xml.in)0
-rw-r--r--deluge/ui/gtk3/__init__.py1
-rw-r--r--deluge/ui/gtk3/addtorrentdialog.py25
-rw-r--r--deluge/ui/gtk3/files_tab.py3
-rw-r--r--deluge/ui/gtk3/glade/add_torrent_dialog.ui4
-rw-r--r--deluge/ui/gtk3/glade/main_window.tabs.ui~1507
-rw-r--r--deluge/ui/gtk3/glade/main_window.ui40
-rw-r--r--deluge/ui/gtk3/gtkui.py2
-rw-r--r--deluge/ui/gtk3/listview.py2
-rw-r--r--deluge/ui/gtk3/mainwindow.py1
-rw-r--r--deluge/ui/gtk3/menubar.py16
-rw-r--r--deluge/ui/gtk3/menubar_osx.py54
-rwxr-xr-xdeluge/ui/gtk3/path_combo_chooser.py2
-rw-r--r--deluge/ui/gtk3/peers_tab.py2
-rw-r--r--deluge/ui/gtk3/preferences.py10
-rw-r--r--deluge/ui/gtk3/systemtray.py1
-rw-r--r--deluge/ui/hostlist.py2
-rw-r--r--deluge/ui/sessionproxy.py1
-rwxr-xr-xdeluge/ui/web/docs/build.sh3
-rw-r--r--deluge/ui/web/docs/deluge-docs.xml15
-rw-r--r--deluge/ui/web/docs/template/index.html44
-rw-r--r--deluge/ui/web/docs/template/license.txt42
-rw-r--r--deluge/ui/web/docs/template/resources/TabCloseMenu.js42
-rw-r--r--deluge/ui/web/docs/template/resources/accordian.gifbin0 -> 943 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/block-bg.gifbin0 -> 834 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/block-bottom.gifbin0 -> 3133 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/block-top.gifbin0 -> 915 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/class.gifbin0 -> 925 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/cmp.gifbin0 -> 988 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/collapse-all.gifbin0 -> 983 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/collapse-bg.gifbin0 -> 1623 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/collapser.css34
-rw-r--r--deluge/ui/web/docs/template/resources/config.gifbin0 -> 955 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/css/ext-all.css925
-rw-r--r--deluge/ui/web/docs/template/resources/deluge.pngbin0 -> 722 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/docs.css346
-rw-r--r--deluge/ui/web/docs/template/resources/docs.gifbin0 -> 1016 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/docs.js632
-rw-r--r--deluge/ui/web/docs/template/resources/elbow-end.gifbin0 -> 844 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/event.gifbin0 -> 919 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/example.gifbin0 -> 1008 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/expand-all.gifbin0 -> 1009 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/expand-bg-over.gifbin0 -> 820 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/expand-bg.gifbin0 -> 827 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/expand-members.gifbin0 -> 981 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/ext-all.js162
-rw-r--r--deluge/ui/web/docs/template/resources/ext-base.js10
-rw-r--r--deluge/ui/web/docs/template/resources/extanim32.gifbin0 -> 3424 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/extanim64.gifbin0 -> 6562 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/extjs.gifbin0 -> 2093 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/fav.gifbin0 -> 954 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/folder.gifbin0 -> 1003 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/folder_open.gifbin0 -> 997 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/form.pngbin0 -> 478 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/forum.gifbin0 -> 1031 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/hd-bg.gifbin0 -> 889 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/hide-inherited.gifbin0 -> 919 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/icon-grid.gifbin0 -> 917 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/corners-blue.gifbin0 -> 1010 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/corners.gifbin0 -> 1005 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/l-blue.gifbin0 -> 810 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/l.gifbin0 -> 810 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/r-blue.gifbin0 -> 810 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/r.gifbin0 -> 810 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/tb-blue.gifbin0 -> 851 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/box/tb.gifbin0 -> 839 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/button/btn-arrow.gifbin0 -> 870 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/button/btn-sprite.gifbin0 -> 1341 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/dd/drop-add.gifbin0 -> 1001 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/dd/drop-no.gifbin0 -> 949 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/dd/drop-yes.gifbin0 -> 1016 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/editor/tb-sprite.gifbin0 -> 2072 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/checkbox.gifbin0 -> 2061 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.gifbin0 -> 1988 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.psdbin0 -> 11804 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/date-trigger.gifbin0 -> 1603 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/date-trigger.psdbin0 -> 12377 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/error-tip-corners.gifbin0 -> 4183 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/exclamation.gifbin0 -> 996 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/radio.gifbin0 -> 1746 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/search-trigger.gifbin0 -> 2182 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/search-trigger.psdbin0 -> 15601 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/text-bg.gifbin0 -> 819 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/trigger-tpl.gifbin0 -> 1487 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/trigger.gifbin0 -> 1816 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/form/trigger.psdbin0 -> 10829 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/gradient-bg.gifbin0 -> 1472 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/arrow-left-white.gifbin0 -> 825 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/arrow-right-white.gifbin0 -> 825 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/col-move-bottom.gifbin0 -> 868 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/col-move-top.gifbin0 -> 869 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/columns.gifbin0 -> 962 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/dirty.gifbin0 -> 832 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/done.gifbin0 -> 133 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/drop-no.gifbin0 -> 947 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/drop-yes.gifbin0 -> 860 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/footer-bg.gifbin0 -> 834 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-hd.gifbin0 -> 829 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-split.gifbin0 -> 817 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-hrow.gifbin0 -> 855 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-loading.gifbin0 -> 701 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-split.gifbin0 -> 817 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid-vista-hd.gifbin0 -> 829 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid3-hd-btn.gifbin0 -> 1229 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow-over.gifbin0 -> 823 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow.gifbin0 -> 836 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-bg.gifbin0 -> 837 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-sel-bg.gifbin0 -> 843 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/group-by.gifbin0 -> 917 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/group-expand-sprite.gifbin0 -> 955 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hd-pop.gifbin0 -> 839 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-asc.gifbin0 -> 931 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-desc.gifbin0 -> 930 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.gifbin0 -> 955 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.pngbin0 -> 648 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.gifbin0 -> 971 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.pngbin0 -> 697 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/invalid_line.gifbin0 -> 815 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/loading.gifbin0 -> 771 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/mso-hd.gifbin0 -> 875 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/nowait.gifbin0 -> 884 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-first-disabled.gifbin0 -> 925 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-first.gifbin0 -> 925 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-last-disabled.gifbin0 -> 923 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-last.gifbin0 -> 923 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-next-disabled.gifbin0 -> 875 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-next.gifbin0 -> 875 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-prev-disabled.gifbin0 -> 879 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/page-prev.gifbin0 -> 879 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/pick-button.gifbin0 -> 1036 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/refresh.gifbin0 -> 977 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/row-check-sprite.gifbin0 -> 1083 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/row-expand-sprite.gifbin0 -> 955 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/row-over.gifbin0 -> 823 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/row-sel.gifbin0 -> 823 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/sort_asc.gifbin0 -> 830 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/sort_desc.gifbin0 -> 833 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/grid/wait.gifbin0 -> 1100 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/collapse.gifbin0 -> 842 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/expand.gifbin0 -> 842 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/gradient-bg.gifbin0 -> 1472 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/mini-bottom.gifbin0 -> 856 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/mini-left.gifbin0 -> 871 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/mini-right.gifbin0 -> 872 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/mini-top.gifbin0 -> 856 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/ns-collapse.gifbin0 -> 842 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/ns-expand.gifbin0 -> 843 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/panel-close.gifbin0 -> 829 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/panel-title-bg.gifbin0 -> 838 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/panel-title-light-bg.gifbin0 -> 835 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/stick.gifbin0 -> 874 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/stuck.gifbin0 -> 92 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/tab-close-on.gifbin0 -> 880 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/layout/tab-close.gifbin0 -> 859 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/checked.gifbin0 -> 959 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/group-checked.gifbin0 -> 891 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/item-over.gifbin0 -> 820 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/menu-parent.gifbin0 -> 854 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/menu.gifbin0 -> 834 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/menu/unchecked.gifbin0 -> 941 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/corners-sprite.gifbin0 -> 1418 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/left-right.gifbin0 -> 815 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/light-hd.gifbin0 -> 827 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/tool-sprite-tpl.gifbin0 -> 971 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/tool-sprites.gifbin0 -> 4158 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/tools-sprites-trans.gifbin0 -> 2640 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.gifbin0 -> 875 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.pngbin0 -> 218 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/white-corners-sprite.gifbin0 -> 1366 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/white-left-right.gifbin0 -> 815 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/panel/white-top-bottom.gifbin0 -> 872 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/progress/progress-bg.gifbin0 -> 834 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/qtip/bg.gifbin0 -> 1091 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/qtip/close.gifbin0 -> 972 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/qtip/tip-sprite.gifbin0 -> 4271 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/s.gifbin0 -> 43 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shadow-c.pngbin0 -> 118 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shadow-c.psdbin0 -> 23266 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shadow-lr.pngbin0 -> 135 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shadow.pngbin0 -> 311 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/blue-loading.gifbin0 -> 3236 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/calendar.gifbin0 -> 979 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/glass-bg.gifbin0 -> 873 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/hd-sprite.gifbin0 -> 1099 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/large-loading.gifbin0 -> 3236 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/left-btn.gifbin0 -> 870 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/loading-balls.gifbin0 -> 2118 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/right-btn.gifbin0 -> 871 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/shared/warning.gifbin0 -> 960 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/e-handle-dark.gifbin0 -> 1062 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/e-handle.gifbin0 -> 1586 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle-dark.gifbin0 -> 839 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle.gifbin0 -> 854 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle-dark.gifbin0 -> 839 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle.gifbin0 -> 853 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/s-handle-dark.gifbin0 -> 1060 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/s-handle.gifbin0 -> 1318 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/se-handle-dark.gifbin0 -> 838 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/se-handle.gifbin0 -> 853 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/square.gifbin0 -> 864 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle-dark.gifbin0 -> 839 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle.gifbin0 -> 855 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/slider/slider-bg.pngbin0 -> 300 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/slider/slider-thumb.pngbin0 -> 933 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/slider/slider-v-bg.pngbin0 -> 288 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/slider/slider-v-thumb.pngbin0 -> 883 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/scroll-left.gifbin0 -> 1295 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/scroll-right.gifbin0 -> 1300 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/scroller-bg.gifbin0 -> 1100 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-left-bg.gifbin0 -> 886 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-right-bg.gifbin0 -> 1386 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-left-bg.gifbin0 -> 863 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-right-bg.gifbin0 -> 1402 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-close.gifbin0 -> 896 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.gifbin0 -> 835 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.pngbin0 -> 259 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-btm-bg.gifbin0 -> 826 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tabs/tabs-sprite.gifbin0 -> 2120 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/bg.gifbin0 -> 904 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow-light.gifbin0 -> 916 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow.gifbin0 -> 919 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/btn-over-bg.gifbin0 -> 837 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/gray-bg.gifbin0 -> 832 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/tb-bg.gifbin0 -> 862 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/toolbar/tb-btn-sprite.gifbin0 -> 1127 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/arrows.gifbin0 -> 1024 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-add.gifbin0 -> 1001 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-between.gifbin0 -> 907 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-no.gifbin0 -> 949 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-over.gifbin0 -> 911 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-under.gifbin0 -> 911 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/drop-yes.gifbin0 -> 1016 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus-nl.gifbin0 -> 898 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus.gifbin0 -> 905 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus-nl.gifbin0 -> 900 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus.gifbin0 -> 907 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-end.gifbin0 -> 844 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-line.gifbin0 -> 846 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus-nl.gifbin0 -> 898 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus.gifbin0 -> 908 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus-nl.gifbin0 -> 900 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus.gifbin0 -> 910 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/elbow.gifbin0 -> 850 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/folder-open.gifbin0 -> 956 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/folder.gifbin0 -> 952 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/leaf.gifbin0 -> 945 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/loading.gifbin0 -> 771 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/tree/s.gifbin0 -> 43 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/icon-error.gifbin0 -> 1669 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/icon-info.gifbin0 -> 1586 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/icon-question.gifbin0 -> 1607 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/icon-warning.gifbin0 -> 1483 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/left-corners.pngbin0 -> 272 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/left-corners.psdbin0 -> 15576 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/left-right.pngbin0 -> 135 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/left-right.psdbin0 -> 25060 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/right-corners.pngbin0 -> 340 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/right-corners.psdbin0 -> 15530 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/top-bottom.pngbin0 -> 211 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/images/default/window/top-bottom.psdbin0 -> 32214 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/inherited.gifbin0 -> 881 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/member-collapsed.gifbin0 -> 856 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/member-expanded.gifbin0 -> 845 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/member-hover.gifbin0 -> 861 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/method.gifbin0 -> 931 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/minus.gifbin0 -> 904 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/pkg-closed.gifbin0 -> 1037 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/pkg-open.gifbin0 -> 1040 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/pkg.gifbin0 -> 936 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/plus.gifbin0 -> 912 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/prettify/prettify.css1
-rw-r--r--deluge/ui/web/docs/template/resources/prettify/prettify.js25
-rw-r--r--deluge/ui/web/docs/template/resources/print.css206
-rw-r--r--deluge/ui/web/docs/template/resources/print.gifbin0 -> 1032 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/prop.gifbin0 -> 923 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/reset.css7
-rw-r--r--deluge/ui/web/docs/template/resources/s.gifbin0 -> 43 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/static.gifbin0 -> 962 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/style.css360
-rw-r--r--deluge/ui/web/docs/template/resources/tabs.gifbin0 -> 917 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/tree-bg.gifbin0 -> 1925 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/wel-bg.gifbin0 -> 991 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/welcome-bg.gifbin0 -> 1925 bytes
-rw-r--r--deluge/ui/web/docs/template/resources/welcome.css25
-rw-r--r--deluge/ui/web/docs/template/source-wrap.html10
-rw-r--r--deluge/ui/web/docs/template/template.xml11
-rw-r--r--deluge/ui/web/docs/template/tpl/class.xsl405
-rw-r--r--deluge/ui/web/docs/template/tpl/tree.xsl45
-rw-r--r--deluge/ui/web/docs/template/welcome.html47
-rw-r--r--deluge/ui/web/js/deluge-all-debug.js9969
-rw-r--r--deluge/ui/web/js/deluge-all.js291
-rw-r--r--deluge/ui/web/js/deluge-all/ConnectionManager.js21
-rw-r--r--deluge/ui/web/js/deluge-all/Sidebar.js18
-rw-r--r--deluge/ui/web/js/deluge-all/UI.js31
-rw-r--r--deluge/ui/web/js/deluge-all/details/FilesTab.js4
-rw-r--r--deluge/ui/web/js/deluge-all/details/OptionsTab.js4
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js2
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/DaemonPage.js2
-rw-r--r--deluge/ui/web/js/deluge-all/preferences/InterfacePage.js2
-rw-r--r--deluge/ui/web/js/extjs/ext-extensions-debug.js2927
-rw-r--r--deluge/ui/web/js/extjs/ext-extensions.js84
-rw-r--r--deluge/ui/web/js/gettext.js326
-rw-r--r--deluge/ui/web/server.py65
-rw-r--r--deluge/ui/web/web.py1
316 files changed, 3928 insertions, 15640 deletions
diff --git a/deluge/ui/common.py b/deluge/ui/common.py
index f9f774e..e9b445d 100644
--- a/deluge/ui/common.py
+++ b/deluge/ui/common.py
@@ -216,7 +216,7 @@ class TorrentInfo:
if 'files' in info_dict:
paths = {}
dirs = {}
- prefix = self._name if len(info_dict['files']) > 1 else ''
+ prefix = self._name
for index, f in enumerate(info_dict['files']):
f = {k.decode(): v for k, v in f.items()}
diff --git a/deluge/ui/console/__init__.py b/deluge/ui/console/__init__.py
index 7da04a6..a09d936 100644
--- a/deluge/ui/console/__init__.py
+++ b/deluge/ui/console/__init__.py
@@ -12,5 +12,13 @@ UI_PATH = __path__[0]
def start():
+ Console().start()
+
+def test_start():
+ """Entry point for tests
+
+ A workaround for unit tests which require a deferred object to be
+ returned to run properly due to mocking the Twisted reactor.
+ """
return Console().start()
diff --git a/deluge/ui/console/cmdline/command.py b/deluge/ui/console/cmdline/command.py
index 40edd78..63dc926 100644
--- a/deluge/ui/console/cmdline/command.py
+++ b/deluge/ui/console/cmdline/command.py
@@ -142,7 +142,6 @@ class Commander:
class BaseCommand:
-
usage = None
interactive_only = False
aliases = []
diff --git a/deluge/ui/console/console.py b/deluge/ui/console/console.py
index 8ef87e8..f91563f 100644
--- a/deluge/ui/console/console.py
+++ b/deluge/ui/console/console.py
@@ -61,7 +61,6 @@ class LogStream:
class Console(UI):
-
cmd_description = """Console or command-line user interface"""
def __init__(self, *args, **kwargs):
diff --git a/deluge/ui/console/eventlog.py b/deluge/ui/console/eventlog.py
new file mode 100644
index 0000000..c1ee6ab
--- /dev/null
+++ b/deluge/ui/console/eventlog.py
@@ -0,0 +1,125 @@
+import time
+
+import deluge.component as component
+from deluge.decorators import maybe_coroutine
+from deluge.ui.client import client
+from deluge.ui.console.utils import colors
+
+
+class EventLog(component.Component):
+ """
+ Prints out certain events as they are received from the core.
+ """
+
+ def __init__(self):
+ component.Component.__init__(self, 'EventLog')
+ self.console = component.get('ConsoleUI')
+ self.prefix = '{!event!}* [%H:%M:%S] '
+ self.date_change_format = 'On {!yellow!}%a, %d %b %Y{!input!} %Z:'
+
+ event_callbacks = {
+ 'TorrentAddedEvent': self.on_torrent_added,
+ 'PreTorrentRemovedEvent': self.on_torrent_removed,
+ 'TorrentStateChangedEvent': self.on_torrent_state_changed,
+ 'TorrentFinishedEvent': self.on_torrent_finished,
+ 'NewVersionAvailableEvent': self.on_new_version_available,
+ 'SessionPausedEvent': self.on_session_paused,
+ 'SessionResumedEvent': self.on_session_resumed,
+ 'ConfigValueChangedEvent': self.on_config_value_changed,
+ 'PluginEnabledEvent': self.on_plugin_enabled,
+ 'PluginDisabledEvent': self.on_plugin_disabled,
+ }
+
+ for event, callback in event_callbacks.items():
+ client.register_event_handler(event, callback)
+
+ self.previous_time = time.localtime(0)
+
+ @maybe_coroutine
+ async def on_torrent_added(self, torrent_id, from_state):
+ if from_state:
+ return
+
+ status = await client.core.get_torrent_status(torrent_id, ['name', 'state'])
+ self.write(
+ '{!green!}Torrent Added: {!info!}%s ({!cyan!}%s{!info!})'
+ % (status['name'], torrent_id)
+ )
+ # Write out what state the added torrent took
+ self.on_torrent_state_changed(torrent_id, status['state'])
+
+ def on_torrent_removed(self, torrent_id):
+ self.write(
+ '{!red!}Torrent Removed: {!info!}%s ({!cyan!}%s{!info!})'
+ % (self.console.get_torrent_name(torrent_id), torrent_id)
+ )
+
+ def on_torrent_state_changed(self, torrent_id, state):
+ # It's probably a new torrent, ignore it
+ if not state:
+ return
+ # Modify the state string color
+ if state in colors.state_color:
+ state = colors.state_color[state] + state
+
+ t_name = self.console.get_torrent_name(torrent_id)
+
+ # Again, it's most likely a new torrent
+ if not t_name:
+ return
+
+ self.write(f'{state}: {{!info!}}{t_name} ({{!cyan!}}{torrent_id}{{!info!}})')
+
+ def on_torrent_finished(self, torrent_id):
+ if component.get('TorrentList').config['ring_bell']:
+ import curses.beep
+
+ curses.beep()
+ self.write(
+ '{!info!}Torrent Finished: %s ({!cyan!}%s{!info!})'
+ % (self.console.get_torrent_name(torrent_id), torrent_id)
+ )
+
+ def on_new_version_available(self, version):
+ self.write('{!input!}New Deluge version available: {!info!}%s' % (version))
+
+ def on_session_paused(self):
+ self.write('{!input!}Session Paused')
+
+ def on_session_resumed(self):
+ self.write('{!green!}Session Resumed')
+
+ def on_config_value_changed(self, key, value):
+ color = '{!white,black,bold!}'
+ try:
+ color = colors.type_color[type(value)]
+ except KeyError:
+ pass
+
+ self.write(f'ConfigValueChanged: {{!input!}}{key}: {color}{value}')
+
+ def write(self, s):
+ current_time = time.localtime()
+
+ date_different = False
+ for field in ['tm_mday', 'tm_mon', 'tm_year']:
+ c = getattr(current_time, field)
+ p = getattr(self.previous_time, field)
+ if c != p:
+ date_different = True
+
+ if date_different:
+ string = time.strftime(self.date_change_format)
+ self.console.write_event(' ')
+ self.console.write_event(string)
+
+ p = time.strftime(self.prefix)
+
+ self.console.write_event(p + s)
+ self.previous_time = current_time
+
+ def on_plugin_enabled(self, name):
+ self.write('PluginEnabled: {!info!}%s' % name)
+
+ def on_plugin_disabled(self, name):
+ self.write('PluginDisabled: {!info!}%s' % name)
diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
index 31d1db1..106169f 100644
--- a/deluge/ui/console/main.py
+++ b/deluge/ui/console/main.py
@@ -11,16 +11,15 @@ import locale
import logging
import os
import sys
-import time
from twisted.internet import defer, error, reactor
import deluge.common
import deluge.component as component
from deluge.configmanager import ConfigManager
-from deluge.decorators import overrides
-from deluge.error import DelugeError
+from deluge.decorators import maybe_coroutine, overrides
from deluge.ui.client import client
+from deluge.ui.console.eventlog import EventLog
from deluge.ui.console.modes.addtorrents import AddTorrents
from deluge.ui.console.modes.basemode import TermResizeHandler
from deluge.ui.console.modes.cmdline import CmdLine
@@ -29,6 +28,7 @@ from deluge.ui.console.modes.preferences import Preferences
from deluge.ui.console.modes.torrentdetail import TorrentDetail
from deluge.ui.console.modes.torrentlist.torrentlist import TorrentList
from deluge.ui.console.utils import colors
+from deluge.ui.console.utils.config import migrate_1_to_2
from deluge.ui.console.widgets import StatusBars
from deluge.ui.coreconfig import CoreConfig
from deluge.ui.sessionproxy import SessionProxy
@@ -160,82 +160,54 @@ deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
wrapper(self.run)
- def quit(self):
+ @maybe_coroutine
+ async def quit(self):
if client.connected():
+ await client.disconnect()
- def on_disconnect(result):
- reactor.stop()
-
- return client.disconnect().addCallback(on_disconnect)
- else:
- try:
- reactor.stop()
- except error.ReactorNotRunning:
- pass
+ try:
+ reactor.stop()
+ except error.ReactorNotRunning:
+ pass
- def exec_args(self, options):
+ @maybe_coroutine
+ async def exec_args(self, options):
"""Execute console commands from command line."""
from deluge.ui.console.cmdline.command import Commander
commander = Commander(self._commands)
-
- def on_connect(result):
- def on_components_started(result):
- def on_started(result):
- def do_command(result, cmd):
- return commander.do_command(cmd)
-
- def exec_command(result, cmd):
- return commander.exec_command(cmd)
-
- d = defer.succeed(None)
- for command in options.parsed_cmds:
- if command.command in ('quit', 'exit'):
- break
- d.addCallback(exec_command, command)
- d.addCallback(do_command, 'quit')
- return d
-
- # We need to wait for the rpcs in start() to finish before processing
- # any of the commands.
- self.started_deferred.addCallback(on_started)
- return self.started_deferred
-
- d = self.start_console()
- d.addCallback(on_components_started)
- return d
-
- def on_connect_fail(reason):
- if reason.check(DelugeError):
- rm = reason.getErrorMessage()
+ try:
+ if not self.interactive and options.parsed_cmds[0].command == 'connect':
+ await commander.exec_command(options.parsed_cmds.pop(0))
else:
- rm = reason.value.message
+ daemon_options = (
+ options.daemon_addr,
+ options.daemon_port,
+ options.daemon_user,
+ options.daemon_pass,
+ )
+ log.info(
+ 'Connect: host=%s, port=%s, username=%s',
+ *daemon_options[0:3],
+ )
+ await client.connect(*daemon_options)
+ except Exception as reason:
print(
'Could not connect to daemon: %s:%s\n %s'
- % (options.daemon_addr, options.daemon_port, rm)
+ % (options.daemon_addr, options.daemon_port, reason)
)
commander.do_command('quit')
- d = None
- if not self.interactive and options.parsed_cmds[0].command == 'connect':
- d = commander.exec_command(options.parsed_cmds.pop(0))
- else:
- log.info(
- 'connect: host=%s, port=%s, username=%s, password=%s',
- options.daemon_addr,
- options.daemon_port,
- options.daemon_user,
- options.daemon_pass,
- )
- d = client.connect(
- options.daemon_addr,
- options.daemon_port,
- options.daemon_user,
- options.daemon_pass,
- )
- d.addCallback(on_connect)
- d.addErrback(on_connect_fail)
- return d
+ await self.start_console()
+ # Wait for RPCs in start() to finish before processing commands.
+ await self.started_deferred
+
+ for cmd in options.parsed_cmds:
+ if cmd.command in ('quit', 'exit'):
+ break
+ await commander.exec_command(cmd)
+
+ commander.do_command('quit')
def run(self, stdscr):
"""This method is called by the curses.wrapper to start the mainloop and screen.
@@ -251,7 +223,7 @@ deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
self.config = ConfigManager(
'console.conf', defaults=DEFAULT_CONSOLE_PREFS, file_version=2
)
- self.config.run_converter((0, 1), 2, self._migrate_config_1_to_2)
+ self.config.run_converter((0, 1), 2, migrate_1_to_2)
self.statusbars = StatusBars()
from deluge.ui.console.modes.connectionmanager import ConnectionManager
@@ -282,8 +254,8 @@ deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
reactor.run()
@overrides(TermResizeHandler)
- def on_terminal_size(self, *args):
- rows, cols = super().on_terminal_size(args)
+ def on_resize(self, *args):
+ rows, cols = super().on_resize(*args)
for mode in self.modes:
self.modes[mode].on_resize(rows, cols)
@@ -353,78 +325,64 @@ deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
def is_active_mode(self, mode):
return mode == self.active_mode
- def start_components(self):
- def on_started(result):
- component.pause(
- [
- 'TorrentList',
- 'EventView',
- 'AddTorrents',
- 'TorrentDetail',
- 'Preferences',
- ]
- )
-
- if self.interactive:
- d = component.start().addCallback(on_started)
- else:
- d = component.start(['SessionProxy', 'ConsoleUI', 'CoreConfig'])
- return d
+ @maybe_coroutine
+ async def start_components(self):
+ if not self.interactive:
+ return await component.start(['SessionProxy', 'ConsoleUI', 'CoreConfig'])
+
+ await component.start()
+ component.pause(
+ [
+ 'TorrentList',
+ 'EventView',
+ 'AddTorrents',
+ 'TorrentDetail',
+ 'Preferences',
+ ]
+ )
- def start_console(self):
- # Maintain a list of (torrent_id, name) for use in tab completion
+ @maybe_coroutine
+ async def start_console(self):
self.started_deferred = defer.Deferred()
- if not self.initialized:
- self.initialized = True
- d = self.start_components()
+ if self.initialized:
+ await component.stop(['SessionProxy'])
+ await component.start(['SessionProxy'])
else:
+ self.initialized = True
+ await self.start_components()
- def on_stopped(result):
- return component.start(['SessionProxy'])
-
- d = component.stop(['SessionProxy']).addCallback(on_stopped)
- return d
-
- def start(self):
- def on_session_state(result):
- self.torrents = []
- self.events = []
-
- def on_torrents_status(torrents):
- for torrent_id, status in torrents.items():
- self.torrents.append((torrent_id, status['name']))
- self.started_deferred.callback(True)
+ @maybe_coroutine
+ async def start(self):
+ result = await client.core.get_session_state()
+ # Maintain a list of (torrent_id, name) for use in tab completion
+ self.torrents = []
+ self.events = []
- client.core.get_torrents_status({'id': result}, ['name']).addCallback(
- on_torrents_status
- )
+ torrents = await client.core.get_torrents_status({'id': result}, ['name'])
+ for torrent_id, status in torrents.items():
+ self.torrents.append((torrent_id, status['name']))
- d = client.core.get_session_state().addCallback(on_session_state)
+ self.started_deferred.callback(True)
# Register event handlers to keep the torrent list up-to-date
- client.register_event_handler('TorrentAddedEvent', self.on_torrent_added_event)
- client.register_event_handler(
- 'TorrentRemovedEvent', self.on_torrent_removed_event
- )
- return d
-
- def on_torrent_added_event(self, event, from_state=False):
- def on_torrent_status(status):
- self.torrents.append((event, status['name']))
+ client.register_event_handler('TorrentAddedEvent', self.on_torrent_added)
+ client.register_event_handler('TorrentRemovedEvent', self.on_torrent_removed)
- client.core.get_torrent_status(event, ['name']).addCallback(on_torrent_status)
+ @defer.inlineCallbacks
+ def on_torrent_added(self, event, from_state=False):
+ status = yield client.core.get_torrent_status(event, ['name'])
+ self.torrents.append((event, status['name']))
- def on_torrent_removed_event(self, event):
+ def on_torrent_removed(self, event):
for index, (tid, name) in enumerate(self.torrents):
if event == tid:
del self.torrents[index]
def match_torrents(self, strings):
- torrent_ids = []
- for s in strings:
- torrent_ids.extend(self.match_torrent(s))
- return list(set(torrent_ids))
+ return list(
+ {torrent for string in strings for torrent in self.match_torrent(string)}
+ )
def match_torrent(self, string):
"""
@@ -510,256 +468,3 @@ deluge-console.exe "add -p c:\\mytorrents c:\\new.torrent"
self.events.append(s)
else:
print(colors.strip_colors(s))
-
- def _migrate_config_1_to_2(self, config):
- """Create better structure by moving most settings out of dict root
- and into sub categories. Some keys are also renamed to be consistent
- with other UIs.
- """
-
- def move_key(source, dest, source_key, dest_key=None):
- if dest_key is None:
- dest_key = source_key
- dest[dest_key] = source[source_key]
- del source[source_key]
-
- # These are moved to 'torrentview' sub dict
- for k in [
- 'sort_primary',
- 'sort_secondary',
- 'move_selection',
- 'separate_complete',
- ]:
- move_key(config, config['torrentview'], k)
-
- # These are moved to 'addtorrents' sub dict
- for k in [
- 'show_misc_files',
- 'show_hidden_folders',
- 'sort_column',
- 'reverse_sort',
- 'last_path',
- ]:
- move_key(config, config['addtorrents'], 'addtorrents_%s' % k, dest_key=k)
-
- # These are moved to 'cmdline' sub dict
- for k in [
- 'ignore_duplicate_lines',
- 'torrents_per_tab_press',
- 'third_tab_lists_all',
- ]:
- move_key(config, config['cmdline'], k)
-
- move_key(
- config,
- config['cmdline'],
- 'save_legacy_history',
- dest_key='save_command_history',
- )
-
- # Add key for localization
- config['language'] = DEFAULT_CONSOLE_PREFS['language']
-
- # Migrate column settings
- columns = [
- 'queue',
- 'size',
- 'state',
- 'progress',
- 'seeds',
- 'peers',
- 'downspeed',
- 'upspeed',
- 'eta',
- 'ratio',
- 'avail',
- 'added',
- 'tracker',
- 'savepath',
- 'downloaded',
- 'uploaded',
- 'remaining',
- 'owner',
- 'downloading_time',
- 'seeding_time',
- 'completed',
- 'seeds_peers_ratio',
- 'complete_seen',
- 'down_limit',
- 'up_limit',
- 'shared',
- 'name',
- ]
- column_name_mapping = {
- 'downspeed': 'download_speed',
- 'upspeed': 'upload_speed',
- 'added': 'time_added',
- 'savepath': 'download_location',
- 'completed': 'completed_time',
- 'complete_seen': 'last_seen_complete',
- 'down_limit': 'max_download_speed',
- 'up_limit': 'max_upload_speed',
- 'downloading_time': 'active_time',
- }
-
- from deluge.ui.console.modes.torrentlist.torrentview import default_columns
-
- # These are moved to 'torrentview.columns' sub dict
- for k in columns:
- column_name = column_name_mapping.get(k, k)
- config['torrentview']['columns'][column_name] = {}
- if k == 'name':
- config['torrentview']['columns'][column_name]['visible'] = True
- else:
- move_key(
- config,
- config['torrentview']['columns'][column_name],
- 'show_%s' % k,
- dest_key='visible',
- )
- move_key(
- config,
- config['torrentview']['columns'][column_name],
- '%s_width' % k,
- dest_key='width',
- )
- config['torrentview']['columns'][column_name]['order'] = default_columns[
- column_name
- ]['order']
-
- return config
-
-
-class EventLog(component.Component):
- """
- Prints out certain events as they are received from the core.
- """
-
- def __init__(self):
- component.Component.__init__(self, 'EventLog')
- self.console = component.get('ConsoleUI')
- self.prefix = '{!event!}* [%H:%M:%S] '
- self.date_change_format = 'On {!yellow!}%a, %d %b %Y{!input!} %Z:'
-
- client.register_event_handler('TorrentAddedEvent', self.on_torrent_added_event)
- client.register_event_handler(
- 'PreTorrentRemovedEvent', self.on_torrent_removed_event
- )
- client.register_event_handler(
- 'TorrentStateChangedEvent', self.on_torrent_state_changed_event
- )
- client.register_event_handler(
- 'TorrentFinishedEvent', self.on_torrent_finished_event
- )
- client.register_event_handler(
- 'NewVersionAvailableEvent', self.on_new_version_available_event
- )
- client.register_event_handler(
- 'SessionPausedEvent', self.on_session_paused_event
- )
- client.register_event_handler(
- 'SessionResumedEvent', self.on_session_resumed_event
- )
- client.register_event_handler(
- 'ConfigValueChangedEvent', self.on_config_value_changed_event
- )
- client.register_event_handler(
- 'PluginEnabledEvent', self.on_plugin_enabled_event
- )
- client.register_event_handler(
- 'PluginDisabledEvent', self.on_plugin_disabled_event
- )
-
- self.previous_time = time.localtime(0)
-
- def on_torrent_added_event(self, torrent_id, from_state):
- if from_state:
- return
-
- def on_torrent_status(status):
- self.write(
- '{!green!}Torrent Added: {!info!}%s ({!cyan!}%s{!info!})'
- % (status['name'], torrent_id)
- )
- # Write out what state the added torrent took
- self.on_torrent_state_changed_event(torrent_id, status['state'])
-
- client.core.get_torrent_status(torrent_id, ['name', 'state']).addCallback(
- on_torrent_status
- )
-
- def on_torrent_removed_event(self, torrent_id):
- self.write(
- '{!red!}Torrent Removed: {!info!}%s ({!cyan!}%s{!info!})'
- % (self.console.get_torrent_name(torrent_id), torrent_id)
- )
-
- def on_torrent_state_changed_event(self, torrent_id, state):
- # It's probably a new torrent, ignore it
- if not state:
- return
- # Modify the state string color
- if state in colors.state_color:
- state = colors.state_color[state] + state
-
- t_name = self.console.get_torrent_name(torrent_id)
-
- # Again, it's most likely a new torrent
- if not t_name:
- return
-
- self.write(f'{state}: {{!info!}}{t_name} ({{!cyan!}}{torrent_id}{{!info!}})')
-
- def on_torrent_finished_event(self, torrent_id):
- if component.get('TorrentList').config['ring_bell']:
- import curses.beep
-
- curses.beep()
- self.write(
- '{!info!}Torrent Finished: %s ({!cyan!}%s{!info!})'
- % (self.console.get_torrent_name(torrent_id), torrent_id)
- )
-
- def on_new_version_available_event(self, version):
- self.write('{!input!}New Deluge version available: {!info!}%s' % (version))
-
- def on_session_paused_event(self):
- self.write('{!input!}Session Paused')
-
- def on_session_resumed_event(self):
- self.write('{!green!}Session Resumed')
-
- def on_config_value_changed_event(self, key, value):
- color = '{!white,black,bold!}'
- try:
- color = colors.type_color[type(value)]
- except KeyError:
- pass
-
- self.write(f'ConfigValueChanged: {{!input!}}{key}: {color}{value}')
-
- def write(self, s):
- current_time = time.localtime()
-
- date_different = False
- for field in ['tm_mday', 'tm_mon', 'tm_year']:
- c = getattr(current_time, field)
- p = getattr(self.previous_time, field)
- if c != p:
- date_different = True
-
- if date_different:
- string = time.strftime(self.date_change_format)
- self.console.write_event(' ')
- self.console.write_event(string)
-
- p = time.strftime(self.prefix)
-
- self.console.write_event(p + s)
- self.previous_time = current_time
-
- def on_plugin_enabled_event(self, name):
- self.write('PluginEnabled: {!info!}%s' % name)
-
- def on_plugin_disabled_event(self, name):
- self.write('PluginDisabled: {!info!}%s' % name)
diff --git a/deluge/ui/console/modes/basemode.py b/deluge/ui/console/modes/basemode.py
index 5ebaf86..a8ab1db 100644
--- a/deluge/ui/console/modes/basemode.py
+++ b/deluge/ui/console/modes/basemode.py
@@ -8,7 +8,10 @@
#
import logging
+import signal
+import struct
import sys
+from typing import Tuple
import deluge.component as component
import deluge.ui.console.utils.colors as colors
@@ -22,10 +25,8 @@ except ImportError:
pass
try:
- import signal
- import struct
- import termios
from fcntl import ioctl
+ from termios import TIOCGWINSZ
except ImportError:
pass
@@ -62,17 +63,20 @@ class InputKeyHandler:
class TermResizeHandler:
def __init__(self):
try:
- signal.signal(signal.SIGWINCH, self.on_terminal_size)
+ signal.signal(signal.SIGWINCH, self.on_resize)
except ValueError as ex:
log.debug('TermResize unavailable, unable to catch SIGWINCH signal: %s', ex)
except AttributeError as ex:
log.debug('TermResize unavailable, no SIGWINCH signal on Windows: %s', ex)
- def on_terminal_size(self, *args):
- # Get the new rows and cols value
- rows, cols = struct.unpack('hhhh', ioctl(0, termios.TIOCGWINSZ, b'\000' * 8))[
- 0:2
- ]
+ @staticmethod
+ def get_window_size(fd: int = 0) -> Tuple[int, int]:
+ """Return the tty window size as row, col."""
+ return struct.unpack('4h', ioctl(fd, TIOCGWINSZ, b'\x00' * 8))[0:2]
+
+ def on_resize(self, _signum, _frame):
+ """Handler for SIGWINCH when terminal changes size"""
+ rows, cols = self.get_window_size()
curses.resizeterm(rows, cols)
return rows, cols
diff --git a/deluge/ui/console/modes/connectionmanager.py b/deluge/ui/console/modes/connectionmanager.py
index 0ccdd93..ce8b6f5 100644
--- a/deluge/ui/console/modes/connectionmanager.py
+++ b/deluge/ui/console/modes/connectionmanager.py
@@ -127,12 +127,14 @@ class ConnectionManager(BaseMode, PopupsHandler):
def add_host(self, hostname, port, username, password):
log.info('Adding host: %s', hostname)
+ if port.isdecimal():
+ port = int(port)
try:
self.hostlist.add_host(hostname, port, username, password)
except ValueError as ex:
self.report_message(_('Error adding host'), f'{hostname}: {ex}')
else:
- self.update_select_host_popup()
+ self.pop_popup()
def delete_host(self, host_id):
log.info('Deleting host: %s', host_id)
@@ -195,7 +197,8 @@ class ConnectionManager(BaseMode, PopupsHandler):
if chr(c) == 'q':
return
elif chr(c) == 'D':
- host_id = self.popup.current_selection()[1]
+ host_index = self.popup.current_selection()
+ host_id = self.popup.inputs[host_index].name
self.delete_host(host_id)
return
elif chr(c) == 'a':
diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py
index 16bd08a..4383d58 100644
--- a/deluge/ui/console/modes/torrentdetail.py
+++ b/deluge/ui/console/modes/torrentdetail.py
@@ -181,7 +181,6 @@ class TorrentDetail(BaseMode, PopupsHandler):
self.refresh()
def set_state(self, state):
-
if state.get('files'):
self.full_names = {x['index']: x['path'] for x in state['files']}
@@ -363,7 +362,6 @@ class TorrentDetail(BaseMode, PopupsHandler):
).addCallback(self.set_state)
def draw_files(self, files, depth, off, idx):
-
color_selected = 'blue'
color_partially_selected = 'magenta'
color_highlighted = 'white'
diff --git a/deluge/ui/console/modes/torrentlist/torrentactions.py b/deluge/ui/console/modes/torrentlist/torrentactions.py
index 6450118..a153e11 100644
--- a/deluge/ui/console/modes/torrentlist/torrentactions.py
+++ b/deluge/ui/console/modes/torrentlist/torrentactions.py
@@ -240,7 +240,6 @@ def torrent_action(action, *args, **kwargs):
# Creates the popup. mode is the calling mode, tids is a list of torrents to take action upon
def torrent_actions_popup(mode, torrent_ids, details=False, action=None, close_cb=None):
-
if action is not None:
torrent_action(action, mode=mode, torrent_ids=torrent_ids)
return
diff --git a/deluge/ui/console/utils/config.py b/deluge/ui/console/utils/config.py
new file mode 100644
index 0000000..debb52a
--- /dev/null
+++ b/deluge/ui/console/utils/config.py
@@ -0,0 +1,118 @@
+def migrate_1_to_2(config):
+ """Create better structure by moving most settings out of dict root
+ and into sub categories. Some keys are also renamed to be consistent
+ with other UIs.
+ """
+
+ def move_key(source, dest, source_key, dest_key=None):
+ if dest_key is None:
+ dest_key = source_key
+
+ dest[dest_key] = source[source_key]
+ del source[source_key]
+
+ # These are moved to 'torrentview' sub dict
+ for k in [
+ 'sort_primary',
+ 'sort_secondary',
+ 'move_selection',
+ 'separate_complete',
+ ]:
+ move_key(config, config['torrentview'], k)
+
+ # These are moved to 'addtorrents' sub dict
+ for k in [
+ 'show_misc_files',
+ 'show_hidden_folders',
+ 'sort_column',
+ 'reverse_sort',
+ 'last_path',
+ ]:
+ move_key(config, config['addtorrents'], 'addtorrents_%s' % k, dest_key=k)
+
+ # These are moved to 'cmdline' sub dict
+ for k in [
+ 'ignore_duplicate_lines',
+ 'torrents_per_tab_press',
+ 'third_tab_lists_all',
+ ]:
+ move_key(config, config['cmdline'], k)
+
+ move_key(
+ config,
+ config['cmdline'],
+ 'save_legacy_history',
+ dest_key='save_command_history',
+ )
+
+ # Add key for localization
+ config['language'] = ''
+
+ # Migrate column settings
+ columns = [
+ 'queue',
+ 'size',
+ 'state',
+ 'progress',
+ 'seeds',
+ 'peers',
+ 'downspeed',
+ 'upspeed',
+ 'eta',
+ 'ratio',
+ 'avail',
+ 'added',
+ 'tracker',
+ 'savepath',
+ 'downloaded',
+ 'uploaded',
+ 'remaining',
+ 'owner',
+ 'downloading_time',
+ 'seeding_time',
+ 'completed',
+ 'seeds_peers_ratio',
+ 'complete_seen',
+ 'down_limit',
+ 'up_limit',
+ 'shared',
+ 'name',
+ ]
+ column_name_mapping = {
+ 'downspeed': 'download_speed',
+ 'upspeed': 'upload_speed',
+ 'added': 'time_added',
+ 'savepath': 'download_location',
+ 'completed': 'completed_time',
+ 'complete_seen': 'last_seen_complete',
+ 'down_limit': 'max_download_speed',
+ 'up_limit': 'max_upload_speed',
+ 'downloading_time': 'active_time',
+ }
+
+ from deluge.ui.console.modes.torrentlist.torrentview import default_columns
+
+ # These are moved to 'torrentview.columns' sub dict
+ for k in columns:
+ column_name = column_name_mapping.get(k, k)
+ config['torrentview']['columns'][column_name] = {}
+ if k == 'name':
+ config['torrentview']['columns'][column_name]['visible'] = True
+ else:
+ move_key(
+ config,
+ config['torrentview']['columns'][column_name],
+ 'show_%s' % k,
+ dest_key='visible',
+ )
+ move_key(
+ config,
+ config['torrentview']['columns'][column_name],
+ '%s_width' % k,
+ dest_key='width',
+ )
+ config['torrentview']['columns'][column_name]['order'] = default_columns[
+ column_name
+ ]['order']
+
+ return config
diff --git a/deluge/ui/console/widgets/popup.py b/deluge/ui/console/widgets/popup.py
index 4b0d027..07d667d 100644
--- a/deluge/ui/console/widgets/popup.py
+++ b/deluge/ui/console/widgets/popup.py
@@ -130,7 +130,6 @@ class Popup(BaseWindow, InputKeyHandler):
BaseWindow.refresh(self)
def calculate_size(self):
-
if isinstance(self.height_req, float) and 0.0 < self.height_req <= 1.0:
height = int((self.parent.rows - 2) * self.height_req)
else:
@@ -252,7 +251,7 @@ class SelectablePopup(BaseInputPane, Popup):
def set_selection(self, index):
"""Set a selected index"""
- self.active_input = index
+ self.active_input = min(index, len(self.inputs) - 1)
def add_line(
self,
diff --git a/deluge/ui/data/share/appdata/deluge.appdata.xml.in b/deluge/ui/data/share/metainfo/deluge.metainfo.xml.in
index dcbf063..dcbf063 100644
--- a/deluge/ui/data/share/appdata/deluge.appdata.xml.in
+++ b/deluge/ui/data/share/metainfo/deluge.metainfo.xml.in
diff --git a/deluge/ui/gtk3/__init__.py b/deluge/ui/gtk3/__init__.py
index 8db2773..d1b4ec5 100644
--- a/deluge/ui/gtk3/__init__.py
+++ b/deluge/ui/gtk3/__init__.py
@@ -18,7 +18,6 @@ environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
# Keep this class in __init__.py to avoid the console having to import everything in gtkui.py
class Gtk(UI):
-
cmd_description = """GTK-based graphical user interface"""
def __init__(self, *args, **kwargs):
diff --git a/deluge/ui/gtk3/addtorrentdialog.py b/deluge/ui/gtk3/addtorrentdialog.py
index cf3851d..aa71cc4 100644
--- a/deluge/ui/gtk3/addtorrentdialog.py
+++ b/deluge/ui/gtk3/addtorrentdialog.py
@@ -379,7 +379,7 @@ class AddTorrentDialog(component.Component):
self.listview_files.expand_row(root, False)
def prepare_file(self, _file, file_name, file_num, download, files_storage):
- first_slash_index = file_name.find(os.path.sep)
+ first_slash_index = file_name.find('/')
if first_slash_index == -1:
files_storage[file_name] = (file_num, _file, download)
else:
@@ -397,7 +397,7 @@ class AddTorrentDialog(component.Component):
def add_files(self, parent_iter, split_files):
ret = 0
for key, value in split_files.items():
- if key.endswith(os.path.sep):
+ if key.endswith('/'):
chunk_iter = self.files_treestore.append(
parent_iter, [True, key, 0, -1, False, 'folder-symbolic']
)
@@ -584,7 +584,7 @@ class AddTorrentDialog(component.Component):
self.build_priorities(
self.files_treestore.iter_children(_iter), priorities
)
- elif not self.files_treestore.get_value(_iter, 1).endswith(os.path.sep):
+ elif not self.files_treestore.get_value(_iter, 1).endswith('/'):
priorities[
self.files_treestore.get_value(_iter, 3)
] = self.files_treestore.get_value(_iter, 0)
@@ -985,7 +985,10 @@ class AddTorrentDialog(component.Component):
def _on_filename_edited(self, renderer, path, new_text):
index = self.files_treestore[path][3]
- new_text = new_text.strip(os.path.sep).strip()
+ # Ensure agnostic path separator
+ new_text = new_text.replace('\\', '/')
+
+ new_text = new_text.strip('/').strip()
# Return if the text hasn't changed
if new_text == self.files_treestore[path][1]:
@@ -1012,10 +1015,10 @@ class AddTorrentDialog(component.Component):
for row in self.files_treestore[parent].iterchildren():
if new_text == row[1]:
return
- if os.path.sep in new_text:
+ if '/' in new_text:
# There are folders in this path, so we need to create them
# and then move the file iter to top
- split_text = new_text.split(os.path.sep)
+ split_text = new_text.split('/')
for s in split_text[:-1]:
parent = self.files_treestore.append(
parent, [True, s, 0, -1, False, 'folder-symbolic']
@@ -1068,19 +1071,19 @@ class AddTorrentDialog(component.Component):
# we can construct the new proper paths
# We need to check if this folder has been split
- if os.path.sep in new_text:
+ if '/' in new_text:
# It's been split, so we need to add new folders and then re-parent
# itr.
parent = self.files_treestore.iter_parent(itr)
- split_text = new_text.split(os.path.sep)
+ split_text = new_text.split('/')
for s in split_text[:-1]:
# We don't iterate over the last item because we'll just use
# the existing itr and change the text
parent = self.files_treestore.append(
- parent, [True, s + os.path.sep, 0, -1, False, 'folder-symbolic']
+ parent, [True, s + '/', 0, -1, False, 'folder-symbolic']
)
- self.files_treestore[itr][1] = split_text[-1] + os.path.sep
+ self.files_treestore[itr][1] = split_text[-1] + '/'
# Now re-parent itr to parent
reparent_iter(self.files_treestore, itr, parent)
@@ -1093,7 +1096,7 @@ class AddTorrentDialog(component.Component):
else:
# This was a simple folder rename without any splits, so just
# change the path for itr
- self.files_treestore[itr][1] = new_text + os.path.sep
+ self.files_treestore[itr][1] = new_text + '/'
# Walk through the tree from 'itr' and add all the new file paths
# to the 'mapped_files' option
diff --git a/deluge/ui/gtk3/files_tab.py b/deluge/ui/gtk3/files_tab.py
index 24c1697..6e0fba4 100644
--- a/deluge/ui/gtk3/files_tab.py
+++ b/deluge/ui/gtk3/files_tab.py
@@ -245,7 +245,7 @@ class FilesTab(Tab):
if state['sort_id'] is not None and state['sort_order'] is not None:
self.treestore.set_sort_column_id(state['sort_id'], state['sort_order'])
- for (index, column) in enumerate(self.listview.get_columns()):
+ for index, column in enumerate(self.listview.get_columns()):
cname = column.get_title()
if cname in state['columns']:
cstate = state['columns'][cname]
@@ -759,7 +759,6 @@ class FilesTab(Tab):
fd['path'] = fd['path'].replace(old_folder, new_folder, 1)
if torrent_id == self.torrent_id:
-
old_split = old_folder.split('/')
try:
old_split.remove('')
diff --git a/deluge/ui/gtk3/glade/add_torrent_dialog.ui b/deluge/ui/gtk3/glade/add_torrent_dialog.ui
index 7183272..b0f507d 100644
--- a/deluge/ui/gtk3/glade/add_torrent_dialog.ui
+++ b/deluge/ui/gtk3/glade/add_torrent_dialog.ui
@@ -4,13 +4,13 @@
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">-1</property>
- <property name="upper">9999</property>
+ <property name="upper">2097151</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="lower">-1</property>
- <property name="upper">9999</property>
+ <property name="upper">2097151</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
diff --git a/deluge/ui/gtk3/glade/main_window.tabs.ui~ b/deluge/ui/gtk3/glade/main_window.tabs.ui~
deleted file mode 100644
index 4362183..0000000
--- a/deluge/ui/gtk3/glade/main_window.tabs.ui~
+++ /dev/null
@@ -1,1507 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.2 -->
-<interface>
- <requires lib="gtk+" version="3.0"/>
- <object class="GtkAdjustment" id="spin_max_connections_adjustment">
- <property name="lower">-1</property>
- <property name="upper">999999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- <signal name="value-changed" handler="on_spin_value_changed" swapped="no"/>
- </object>
- <object class="GtkAdjustment" id="spin_max_download_adjustment">
- <property name="lower">-1</property>
- <property name="upper">2097151</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- <signal name="value-changed" handler="on_spin_value_changed" swapped="no"/>
- </object>
- <object class="GtkAdjustment" id="spin_max_upload_adjustment">
- <property name="lower">-1</property>
- <property name="upper">2097151</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- <signal name="value-changed" handler="on_spin_value_changed" swapped="no"/>
- </object>
- <object class="GtkAdjustment" id="spin_max_upload_slots_adjustment">
- <property name="lower">-1</property>
- <property name="upper">999999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- <signal name="value-changed" handler="on_spin_value_changed" swapped="no"/>
- </object>
- <object class="GtkAdjustment" id="spin_stop_ratio_adjustment">
- <property name="upper">999999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- <signal name="value-changed" handler="on_spin_value_changed" swapped="no"/>
- </object>
- <object class="GtkWindow" id="tabs">
- <property name="can_focus">False</property>
- <child type="titlebar">
- <placeholder/>
- </child>
- <child>
- <object class="GtkNotebook" id="dummy_nb_see_main_win_torrent_info">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="enable_popup">True</property>
- <child>
- <object class="GtkScrolledWindow" id="status_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkViewport" id="viewport1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="resize_mode">queue</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment43">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">5</property>
- <property name="bottom_padding">2</property>
- <property name="left_padding">10</property>
- <property name="right_padding">10</property>
- <child>
- <object class="GtkBox" id="vbox3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkBox" id="status_progress_vbox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkProgressBar" id="progressbar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pulse_step">0.10000000149</property>
- <property name="show_text">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="table8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">5</property>
- <property name="column_spacing">10</property>
- <child>
- <object class="GtkLabel" id="summary_download_speed">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="width_chars">20</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_total_downloaded">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_upload_speed">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="width_chars">15</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_seed_rank">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_availability">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- <property name="wrap_mode">word-char</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_share_ratio">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_peers">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="width_chars">10</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_eta">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">5</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_active_time">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">5</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_seed_time">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">5</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_last_transfer">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- <property name="wrap_mode">char</property>
- </object>
- <packing>
- <property name="left_attach">5</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_last_seen_complete">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap">True</property>
- <property name="wrap_mode">char</property>
- </object>
- <packing>
- <property name="left_attach">5</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label42">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Down Speed:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label43">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Up Speed:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label38">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Downloaded:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label39">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Uploaded:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_seeds">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="width_chars">10</property>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_total_uploaded">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="width_chars">15</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_seeds">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Seeds:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_peers">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Peers:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label41">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Share Ratio:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_availablity">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Availability:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_seed_rank">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Seed Rank:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_eta">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">ETA Time:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_last_transfer">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Last Transfer:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_active_time">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Active Time:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_last_seen_complete">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Complete Seen:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_seed_time">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Seeding Time:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="status_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Status</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="details_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkViewport" id="viewport2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="resize_mode">queue</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment54">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">5</property>
- <property name="bottom_padding">2</property>
- <property name="left_padding">10</property>
- <property name="right_padding">15</property>
- <child>
- <object class="GtkGrid" id="table_details">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">5</property>
- <property name="column_spacing">10</property>
- <child>
- <object class="GtkLabel" id="summary_name">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="wrap">True</property>
- <property name="wrap_mode">word-char</property>
- <property name="selectable">True</property>
- <property name="ellipsize">end</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_total_size">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_num_files">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_completed">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_date_added">
- <property name="width_request">100</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_private">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_pieces">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Pieces:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_pieces">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- </object>
- <packing>
- <property name="left_attach">4</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_hash">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- <property name="width_chars">40</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_torrent_path">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="wrap">True</property>
- <property name="wrap_mode">char</property>
- <property name="selectable">True</property>
- <property name="ellipsize">start</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_comments">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="wrap_mode">char</property>
- <property name="selectable">True</property>
- <property name="ellipsize">end</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">6</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_creator">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="wrap_mode">char</property>
- <property name="selectable">True</property>
- <property name="ellipsize">end</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_name">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Name:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_path">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Download Folder:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_date_added">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Added:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_total_size">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Total Size:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_num_files">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Total Files:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_hash">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Hash:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_creator">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Created By:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_comments">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Comments:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_completed">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Completed:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_private">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Private Torrent:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">3</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparator" id="vseparator5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
- <property name="height">4</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="details_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Details</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="files_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkTreeView" id="files_listview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeselection1"/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="files_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Fi_les</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">2</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="peers_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkTreeView" id="peers_listview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeselection2"/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="peers_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Peers</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">3</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="options_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkViewport" id="viewport3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="resize_mode">queue</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">5</property>
- <property name="bottom_padding">2</property>
- <property name="left_padding">5</property>
- <property name="right_padding">15</property>
- <child>
- <object class="GtkGrid" id="table6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkAlignment" id="alignment8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">2</property>
- <property name="left_padding">5</property>
- <property name="right_padding">5</property>
- <child>
- <object class="GtkBox" id="vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="hbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label_owner">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Owner:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_owner">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="wrap_mode">char</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">10</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_shared">
- <property name="label" translatable="yes">Shared</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_prioritize_first_last">
- <property name="label" translatable="yes">Prioritize First/Last</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_sequential_download">
- <property name="label" translatable="yes">Sequential Download</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_super_seeding">
- <property name="label" translatable="yes">Super Seeding</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_move_completed">
- <property name="label" translatable="yes">Move completed:</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_move_completed_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="hbox_move_completed_path_chooser">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">10</property>
- <child>
- <object class="GtkBox" id="vbox6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">15</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkCheckButton" id="chk_auto_managed">
- <property name="label" translatable="yes">Auto Managed</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="chk_stop_at_ratio">
- <property name="label" translatable="yes">Stop seed at ratio:</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_stop_at_ratio_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">10</property>
- <property name="right_padding">10</property>
- <child>
- <object class="GtkSpinButton" id="spin_stop_ratio">
- <property name="width_request">50</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">spin_stop_ratio_adjustment</property>
- <property name="digits">1</property>
- <property name="numeric">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">10</property>
- <child>
- <object class="GtkCheckButton" id="chk_remove_at_ratio">
- <property name="label" translatable="yes">Remove at ratio</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chk_toggled" swapped="no"/>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparator" id="hseparator1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">7</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="button_apply">
- <property name="label" translatable="yes">_Apply</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="on_button_apply_clicked" swapped="no"/>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkGrid" id="table1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
- <child>
- <object class="GtkSpinButton" id="spin_max_connections">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">spin_max_connections_adjustment</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spin_max_upload">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">spin_max_upload_adjustment</property>
- <property name="digits">1</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spin_max_download">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">spin_max_download_adjustment</property>
- <property name="climb_rate">1</property>
- <property name="digits">1</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Upload Speed:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">K/s</property>
- <property name="ellipsize">start</property>
- <attributes>
- <attribute name="scale" value="0.90000000000000002"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">K/s</property>
- <attributes>
- <attribute name="scale" value="0.90000000000000002"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="spin_max_upload_slots">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="adjustment">spin_max_upload_slots_adjustment</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Download Speed:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Connections:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Upload Slots:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Bandwidth Limits</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="options_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Options</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">4</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="trackers_tab">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkTreeView" id="trackers_listview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeselection3"/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="trackers_tab_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Trackers</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">5</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/deluge/ui/gtk3/glade/main_window.ui b/deluge/ui/gtk3/glade/main_window.ui
index ecbb8f6..e726756 100644
--- a/deluge/ui/gtk3/glade/main_window.ui
+++ b/deluge/ui/gtk3/glade/main_window.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkImage" id="about-image">
@@ -7,7 +7,6 @@
<property name="can_focus">False</property>
<property name="icon_name">help-about-symbolic</property>
</object>
- <object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkImage" id="add-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -67,6 +66,7 @@
<property name="icon_name">zoom-fit-best-symbolic</property>
<property name="icon_size">1</property>
</object>
+ <object class="GtkAccelGroup" id="main_accelgroup"/>
<object class="GtkImage" id="new-image">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -93,9 +93,9 @@
<property name="can_focus">False</property>
<property name="title">Deluge</property>
<accel-groups>
- <group name="accelgroup1"/>
+ <group name="main_accelgroup"/>
</accel-groups>
- <child>
+ <child type="titlebar">
<placeholder/>
</child>
<child>
@@ -114,8 +114,10 @@
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child type="submenu">
- <object class="GtkMenu" id="menuitem1_menu1">
+ <object class="GtkMenu" id="submenu_file">
<property name="can_focus">False</property>
+ <property name="accel_group">main_accelgroup</property>
+ <property name="accel_path">&lt;Deluge-MainWindow&gt;/File</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_addtorrent">
<property name="label" translatable="yes">_Add Torrent</property>
@@ -126,7 +128,6 @@
<property name="image">add-image</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_addtorrent_activate" swapped="no"/>
- <accelerator key="O" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
<child>
@@ -138,7 +139,6 @@
<property name="image">new-image</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_createtorrent_activate" swapped="no"/>
- <accelerator key="N" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
<child>
@@ -155,7 +155,6 @@
<property name="use_stock">False</property>
<property name="always_show_image">True</property>
<signal name="activate" handler="on_menuitem_quitdaemon_activate" swapped="no"/>
- <accelerator key="Q" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
</object>
</child>
<child>
@@ -172,9 +171,8 @@
<property name="use_underline">True</property>
<property name="image">quit_image</property>
<property name="use_stock">False</property>
- <property name="accel_group">accelgroup1</property>
+ <property name="accel_group">main_accelgroup</property>
<signal name="activate" handler="on_menuitem_quit_activate" swapped="no"/>
- <accelerator key="Q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
</object>
@@ -188,9 +186,11 @@
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
- <object class="GtkMenu" id="menu1">
+ <object class="GtkMenu" id="submenu_edit">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="accel_group">main_accelgroup</property>
+ <property name="accel_path">&lt;Deluge-MainWindow&gt;/Edit</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_preferences">
<property name="label" translatable="yes">_Preferences</property>
@@ -199,9 +199,8 @@
<property name="use_underline">True</property>
<property name="image">prefs-image</property>
<property name="use_stock">False</property>
- <property name="accel_group">accelgroup1</property>
+ <property name="accel_group">main_accelgroup</property>
<signal name="activate" handler="on_menuitem_preferences_activate" swapped="no"/>
- <accelerator key="P" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
<child>
@@ -213,7 +212,6 @@
<property name="image">connection-image</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_connectionmanager_activate" swapped="no"/>
- <accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
</object>
@@ -223,6 +221,7 @@
<child>
<object class="GtkMenuItem" id="menu_torrent">
<property name="can_focus">False</property>
+ <property name="accel_path">&lt;MainWindow&gt;/Torrent</property>
<property name="label" translatable="yes">_Torrent</property>
<property name="use_underline">True</property>
</object>
@@ -234,9 +233,11 @@
<property name="label" translatable="yes">_View</property>
<property name="use_underline">True</property>
<child type="submenu">
- <object class="GtkMenu" id="menu2">
+ <object class="GtkMenu" id="submenu_view">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="accel_group">main_accelgroup</property>
+ <property name="accel_path">&lt;Deluge-MainWindow&gt;/View</property>
<child>
<object class="GtkCheckMenuItem" id="menuitem_toolbar">
<property name="visible">True</property>
@@ -297,7 +298,6 @@
<property name="label" translatable="yes">_Find ...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_search_filter_toggle" swapped="no"/>
- <accelerator key="f" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
<child>
@@ -356,8 +356,10 @@
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child type="submenu">
- <object class="GtkMenu" id="menuitem2_menu1">
+ <object class="GtkMenu" id="submenu_help">
<property name="can_focus">False</property>
+ <property name="accel_group">main_accelgroup</property>
+ <property name="accel_path">&lt;Deluge-MainWindow&gt;/Help</property>
<child>
<object class="GtkImageMenuItem" id="menuitem_homepage">
<property name="label" translatable="yes">_Homepage</property>
@@ -377,7 +379,6 @@
<property name="use_underline">True</property>
<property name="use_stock">False</property>
<signal name="activate" handler="on_menuitem_faq_activate" swapped="no"/>
- <accelerator key="F1" signal="activate"/>
</object>
</child>
<child>
@@ -405,7 +406,7 @@
<property name="use_underline">True</property>
<property name="image">about-image</property>
<property name="use_stock">False</property>
- <property name="accel_group">accelgroup1</property>
+ <property name="accel_group">main_accelgroup</property>
<signal name="activate" handler="on_menuitem_about_activate" swapped="no"/>
</object>
</child>
@@ -467,7 +468,6 @@ This will filter torrents for the current selection on the sidebar.</property>
<property name="label" translatable="yes">Filter</property>
<property name="icon_name">system-search-symbolic</property>
<signal name="clicked" handler="on_search_filter_toggle" swapped="no"/>
- <accelerator key="f" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
</object>
<packing>
<property name="expand">False</property>
diff --git a/deluge/ui/gtk3/gtkui.py b/deluge/ui/gtk3/gtkui.py
index ddb2eb5..434d1b8 100644
--- a/deluge/ui/gtk3/gtkui.py
+++ b/deluge/ui/gtk3/gtkui.py
@@ -89,7 +89,7 @@ DEFAULT_PREFS = {
'enable_system_tray': True,
'close_to_tray': False,
'start_in_tray': False,
- 'enable_appindicator': False,
+ 'enable_appindicator': True,
'lock_tray': False,
'tray_password': '',
'check_new_releases': True,
diff --git a/deluge/ui/gtk3/listview.py b/deluge/ui/gtk3/listview.py
index e9f6b10..a80d795 100644
--- a/deluge/ui/gtk3/listview.py
+++ b/deluge/ui/gtk3/listview.py
@@ -72,7 +72,7 @@ class ListView:
"""
__gsignals__ = {
- 'button-press-event': (GObject.SIGNAL_RUN_LAST, None, (object,))
+ 'button-press-event': (GObject.SignalFlags.RUN_LAST, None, (object,))
}
def __init__(self, title=None, cell_renderer=None, **args):
diff --git a/deluge/ui/gtk3/mainwindow.py b/deluge/ui/gtk3/mainwindow.py
index d11ff31..e1e3bb3 100644
--- a/deluge/ui/gtk3/mainwindow.py
+++ b/deluge/ui/gtk3/mainwindow.py
@@ -44,7 +44,6 @@ log = logging.getLogger(__name__)
class _GtkBuilderSignalsHolder:
def connect_signals(self, mapping_or_class):
-
if isinstance(mapping_or_class, dict):
for name, handler in mapping_or_class.items():
if hasattr(self, name):
diff --git a/deluge/ui/gtk3/menubar.py b/deluge/ui/gtk3/menubar.py
index a812a8c..328cb7e 100644
--- a/deluge/ui/gtk3/menubar.py
+++ b/deluge/ui/gtk3/menubar.py
@@ -23,6 +23,17 @@ from .path_chooser import PathChooser
log = logging.getLogger(__name__)
+default_main_window_accelmap = {
+ '<Deluge-MainWindow>/File/Add Torrent': '<Primary>o',
+ '<Deluge-MainWindow>/File/Create Torrent': '<Primary>n',
+ '<Deluge-MainWindow>/File/Quit & Shutdown Daemon': '<Primary><Shift>q',
+ '<Deluge-MainWindow>/File/Quit': '<Primary>q',
+ '<Deluge-MainWindow>/Edit/Preferences': '<Primary>p',
+ '<Deluge-MainWindow>/Edit/Connection Manager': '<Primary>m',
+ '<Deluge-MainWindow>/View/Find ...': '<Primary>f',
+ '<Deluge-MainWindow>/Help/FAQ': 'F1',
+}
+
class MenuBar(component.Component):
def __init__(self):
@@ -112,6 +123,11 @@ class MenuBar(component.Component):
# Attach the torrent_menu to the Torrent file menu
self.menu_torrent.set_submenu(self.torrentmenu)
+ # Set keyboard shortcuts
+ for accel_path, accelerator in default_main_window_accelmap.items():
+ accel_key, accel_mods = Gtk.accelerator_parse(accelerator)
+ Gtk.AccelMap.change_entry(accel_path, accel_key, accel_mods, True)
+
# Make sure the view menuitems are showing the correct active state
self.main_builder.get_object('menuitem_toolbar').set_active(
self.config['show_toolbar']
diff --git a/deluge/ui/gtk3/menubar_osx.py b/deluge/ui/gtk3/menubar_osx.py
index 53150fb..7f846dc 100644
--- a/deluge/ui/gtk3/menubar_osx.py
+++ b/deluge/ui/gtk3/menubar_osx.py
@@ -5,48 +5,36 @@
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
-
-from gi.repository.Gdk import ModifierType
-from gi.repository.Gtk import SeparatorMenuItem, accel_groups_from_object
-from gi.repository.Gtk.AccelFlags import VISIBLE
+from gi.repository import Gtk
from deluge.configmanager import ConfigManager
-
-def accel_swap(item, group, skey, smod, dkey, dmod):
- # Accel map hack broken, see ticket #3078
- # item.remove_accelerator(group, ord(skey), smod)
- item.add_accelerator('activate', group, ord(dkey), dmod, VISIBLE)
-
-
-def accel_meta(item, group, key):
- accel_swap(item, group, key, ModifierType.CONTROL_MASK, key, ModifierType.META_MASK)
+macos_main_window_accelmap = {
+ '<Deluge-MainWindow>/File/Add Torrent': '<Meta>o',
+ '<Deluge-MainWindow>/File/Create Torrent': '<Meta>n',
+ '<Deluge-MainWindow>/File/Quit & Shutdown Daemon': '<Meta><Shift>q',
+ '<Deluge-MainWindow>/File/Quit': '<Meta>q',
+ '<Deluge-MainWindow>/Edit/Preferences': '<Meta>comma',
+ '<Deluge-MainWindow>/Edit/Connection Manager': '<Meta>m',
+ '<Deluge-MainWindow>/View/Find ...': '<Meta>f',
+ '<Deluge-MainWindow>/Help/FAQ': '<Meta>question',
+}
def menubar_osx(gtkui, osxapp):
+ # Change key shortcuts
+ for accel_path, accelerator in macos_main_window_accelmap.items():
+ accel_key, accel_mods = Gtk.accelerator_parse(accelerator)
+ Gtk.AccelMap.change_entry(accel_path, accel_key, accel_mods, True)
+
main_builder = gtkui.mainwindow.get_builder()
menubar = main_builder.get_object('menubar')
- group = accel_groups_from_object(gtkui.mainwindow.window)[0]
config = ConfigManager('gtk3ui.conf')
-
- # NOTE: accel maps doesn't work with glade file format
- # because of libglade not setting MenuItem accel groups
- # That's why we remove / set accelerators by hand... (dirty)
- # Clean solution: migrate glades files to gtkbuilder format
file_menu = main_builder.get_object('menu_file').get_submenu()
file_items = file_menu.get_children()
- accel_meta(file_items[0], group, 'o')
- accel_meta(file_items[1], group, 'n')
quit_all_item = file_items[3]
- accel_swap(
- quit_all_item,
- group,
- 'q',
- ModifierType.SHIFT_MASK | ModifierType.CONTROL_MASK,
- 'q',
- ModifierType.SHIFT_MASK | ModifierType.META_MASK,
- )
+
for item in range(2, len(file_items)): # remove quits
file_menu.remove(file_items[item])
@@ -54,13 +42,9 @@ def menubar_osx(gtkui, osxapp):
edit_menu = menu_widget.get_submenu()
edit_items = edit_menu.get_children()
pref_item = edit_items[0]
- accel_swap(
- pref_item, group, 'p', ModifierType.CONTROL_MASK, ',', ModifierType.META_MASK
- )
edit_menu.remove(pref_item)
conn_item = edit_items[1]
- accel_meta(conn_item, group, 'm')
edit_menu.remove(conn_item)
menubar.remove(menu_widget)
@@ -75,10 +59,10 @@ def menubar_osx(gtkui, osxapp):
osxapp.set_menu_bar(menubar)
# populate app menu
osxapp.insert_app_menu_item(about_item, 0)
- osxapp.insert_app_menu_item(SeparatorMenuItem(), 1)
+ osxapp.insert_app_menu_item(Gtk.SeparatorMenuItem(), 1)
osxapp.insert_app_menu_item(pref_item, 2)
if not config['standalone']:
osxapp.insert_app_menu_item(conn_item, 3)
if quit_all_item.get_visible():
- osxapp.insert_app_menu_item(SeparatorMenuItem(), 4)
+ osxapp.insert_app_menu_item(Gtk.SeparatorMenuItem(), 4)
osxapp.insert_app_menu_item(quit_all_item, 5)
diff --git a/deluge/ui/gtk3/path_combo_chooser.py b/deluge/ui/gtk3/path_combo_chooser.py
index 74d9055..aeb4c7a 100755
--- a/deluge/ui/gtk3/path_combo_chooser.py
+++ b/deluge/ui/gtk3/path_combo_chooser.py
@@ -62,7 +62,6 @@ def path_without_trailing_path_sep(path):
class ValueList:
-
paths_without_trailing_path_sep = False
def get_values_count(self):
@@ -1097,7 +1096,6 @@ class PathAutoCompleter:
class PathChooserComboBox(Gtk.Box, StoredValuesPopup, GObject.GObject):
-
__gsignals__ = {
signal: (SignalFlags.RUN_FIRST, GObject.TYPE_NONE, (object,))
for signal in [
diff --git a/deluge/ui/gtk3/peers_tab.py b/deluge/ui/gtk3/peers_tab.py
index b458f7a..5768fbe 100644
--- a/deluge/ui/gtk3/peers_tab.py
+++ b/deluge/ui/gtk3/peers_tab.py
@@ -186,7 +186,7 @@ class PeersTab(Tab):
if state['sort_id'] and state['sort_order'] is not None:
self.liststore.set_sort_column_id(state['sort_id'], state['sort_order'])
- for (index, column) in enumerate(self.listview.get_columns()):
+ for index, column in enumerate(self.listview.get_columns()):
cname = column.get_title()
if cname in state['columns']:
cstate = state['columns'][cname]
diff --git a/deluge/ui/gtk3/preferences.py b/deluge/ui/gtk3/preferences.py
index a008a95..3463b70 100644
--- a/deluge/ui/gtk3/preferences.py
+++ b/deluge/ui/gtk3/preferences.py
@@ -30,8 +30,12 @@ from .dialogs import AccountDialog, ErrorDialog, InformationDialog, YesNoDialog
from .path_chooser import PathChooser
try:
- require_version('AppIndicator3', '0.1')
- from gi.repository import AppIndicator3 # noqa: F401
+ try:
+ require_version('AyatanaAppIndicator3', '0.1')
+ from gi.repository import AyatanaAppIndicator3 # noqa: F401
+ except (ValueError, ImportError):
+ require_version('AppIndicator3', '0.1')
+ from gi.repository import AppIndicator3 # noqa: F401
except (ImportError, ValueError):
appindicator = False
else:
@@ -295,7 +299,7 @@ class Preferences(component.Component):
'Bandwidth'"""
self.window_open = True
if page is not None:
- for (index, string, __) in self.liststore:
+ for index, string, __ in self.liststore:
if page == string:
self.treeview.get_selection().select_path(index)
break
diff --git a/deluge/ui/gtk3/systemtray.py b/deluge/ui/gtk3/systemtray.py
index f65fde5..5318cf2 100644
--- a/deluge/ui/gtk3/systemtray.py
+++ b/deluge/ui/gtk3/systemtray.py
@@ -144,7 +144,6 @@ class SystemTray(component.Component):
def __start(self):
if self.config['enable_system_tray']:
-
if self.config['standalone']:
try:
self.hide_widget_list.remove('menuitem_quitdaemon')
diff --git a/deluge/ui/hostlist.py b/deluge/ui/hostlist.py
index 0fc3eab..0dba126 100644
--- a/deluge/ui/hostlist.py
+++ b/deluge/ui/hostlist.py
@@ -50,6 +50,8 @@ def validate_host_info(hostname, port):
if not isinstance(port, int):
raise ValueError('Invalid port. Must be an integer')
+ if not 0 <= port <= 65535:
+ raise ValueError('Invalid port. Must be between 0-65535')
def migrate_hostlist(old_filename, new_filename):
diff --git a/deluge/ui/sessionproxy.py b/deluge/ui/sessionproxy.py
index b50ba6c..6cb8550 100644
--- a/deluge/ui/sessionproxy.py
+++ b/deluge/ui/sessionproxy.py
@@ -190,6 +190,7 @@ class SessionProxy(component.Component):
:rtype: dict
"""
+
# Helper functions and callbacks ---------------------------------------
def on_status(result, torrent_ids, keys):
# Update the internal torrent status dict with the update values
diff --git a/deluge/ui/web/docs/build.sh b/deluge/ui/web/docs/build.sh
new file mode 100755
index 0000000..74232c7
--- /dev/null
+++ b/deluge/ui/web/docs/build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ext-doc -p deluge-docs.xml -o build -t template/template.xml
diff --git a/deluge/ui/web/docs/deluge-docs.xml b/deluge/ui/web/docs/deluge-docs.xml
new file mode 100644
index 0000000..f3ce1d4
--- /dev/null
+++ b/deluge/ui/web/docs/deluge-docs.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc>
+ <sources>
+ <source src="../js/extjs" match="ext-base-debug.js" />
+ <source src="../js/extjs" match="ext-all-debug.js" />
+ <source src="../js/extjs/ext-extensions" match="*.js" />
+ <source src="../js/deluge-all" match="*.js" />
+ </sources>
+ <tags>
+ <tag name="author" title="Author" />
+ <tag name="version" title="Version" />
+ <tag name="note" format="&lt;i&gt;NOTE: {0}&lt;/i&gt;" />
+ <tag name="demo" title="Demo" format="&lt;a href=&quot;{0}&quot;&gt;{0}&lt;/a&gt;" />
+ </tags>
+</doc>
diff --git a/deluge/ui/web/docs/template/index.html b/deluge/ui/web/docs/template/index.html
new file mode 100644
index 0000000..eaeb5d4
--- /dev/null
+++ b/deluge/ui/web/docs/template/index.html
@@ -0,0 +1,44 @@
+<html lang="en" xmlns:ext="http://extjs.com/docs">
+<head>
+ <title>Deluge 1.3 Web UI - API Documentation</title>
+ <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="resources/docs.css"></link>
+ <link rel="stylesheet" type="text/css" href="resources/style.css"></link>
+ <link rel="shortcut icon" href="resources/deluge.png" />
+ <link rel="icon" href="resources/deluge.png" />
+ <style type="text/css">
+ </style>
+ <!-- GC -->
+</head>
+<body scroll="no" id="docs">
+ <div id="loading-mask" style=""></div>
+ <div id="loading">
+ <div class="loading-indicator"><img src="resources/extanim32.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>Loading...</div>
+ </div>
+ <!-- include everything after the loading indicator -->
+ <script type="text/javascript" src="resources/ext-base.js"></script>
+ <script type="text/javascript" src="resources/ext-all.js"></script>
+ <script type="text/javascript" src="resources/TabCloseMenu.js"></script>
+
+ <script type="text/javascript" src="resources/docs.js"></script>
+ <script type="text/javascript" src="output/tree.js">
+// Docs.classData = {"id":"apidocs","iconCls":"icon-docs","text":"API Documentation","singleClickExpand":true,"children":[{"id":"pkg-Ext","text":"Ext","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"id":"pkg-air","text":"air","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.air.DragType.html","text":"DragType","id":"Ext.air.DragType","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.air.FileProvider.html","text":"FileProvider","id":"Ext.air.FileProvider","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.air.NativeObservable.html","text":"NativeObservable","id":"Ext.air.NativeObservable","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.air.NativeWindow.html","text":"NativeWindow","id":"Ext.air.NativeWindow","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.air.NativeWindowGroup.html","text":"NativeWindowGroup","id":"Ext.air.NativeWindowGroup","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.air.NativeWindowManager.html","text":"NativeWindowManager","id":"Ext.air.NativeWindowManager","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.air.Sound.html","text":"Sound","id":"Ext.air.Sound","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.air.SystemMenu.html","text":"SystemMenu","id":"Ext.air.SystemMenu","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-data","text":"data","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.data.ArrayReader.html","text":"ArrayReader","id":"Ext.data.ArrayReader","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.Connection.html","text":"Connection","id":"Ext.data.Connection","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.DataProxy.html","text":"DataProxy","id":"Ext.data.DataProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.DataReader.html","text":"DataReader","id":"Ext.data.DataReader","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.GroupingStore.html","text":"GroupingStore","id":"Ext.data.GroupingStore","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.HttpProxy.html","text":"HttpProxy","id":"Ext.data.HttpProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.JsonReader.html","text":"JsonReader","id":"Ext.data.JsonReader","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.JsonStore.html","text":"JsonStore","id":"Ext.data.JsonStore","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.MemoryProxy.html","text":"MemoryProxy","id":"Ext.data.MemoryProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.Node.html","text":"Node","id":"Ext.data.Node","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.Record.html","text":"Record","id":"Ext.data.Record","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.ScriptTagProxy.html","text":"ScriptTagProxy","id":"Ext.data.ScriptTagProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.SimpleStore.html","text":"SimpleStore","id":"Ext.data.SimpleStore","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.SortTypes.html","text":"SortTypes","id":"Ext.data.SortTypes","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.data.Store.html","text":"Store","id":"Ext.data.Store","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.Tree.html","text":"Tree","id":"Ext.data.Tree","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.data.XmlReader.html","text":"XmlReader","id":"Ext.data.XmlReader","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-dd","text":"dd","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.dd.DD.html","text":"DD","id":"Ext.dd.DD","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DDProxy.html","text":"DDProxy","id":"Ext.dd.DDProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DDTarget.html","text":"DDTarget","id":"Ext.dd.DDTarget","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DragDrop.html","text":"DragDrop","id":"Ext.dd.DragDrop","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DragDropMgr.html","text":"DragDropMgr","id":"Ext.dd.DragDropMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DragSource.html","text":"DragSource","id":"Ext.dd.DragSource","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DragZone.html","text":"DragZone","id":"Ext.dd.DragZone","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DropTarget.html","text":"DropTarget","id":"Ext.dd.DropTarget","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.DropZone.html","text":"DropZone","id":"Ext.dd.DropZone","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.dd.Registry.html","text":"Registry","id":"Ext.dd.Registry","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.dd.ScrollManager.html","text":"ScrollManager","id":"Ext.dd.ScrollManager","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.dd.StatusProxy.html","text":"StatusProxy","id":"Ext.dd.StatusProxy","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-form","text":"form","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.form.Action.html","text":"Action","id":"Ext.form.Action","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.form.Action.Load.html","text":"Action.Load","id":"Ext.form.Action.Load","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.form.Action.Submit.html","text":"Action.Submit","id":"Ext.form.Action.Submit","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.form.BasicForm.html","text":"BasicForm","id":"Ext.form.BasicForm","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.form.Checkbox.html","text":"Checkbox","id":"Ext.form.Checkbox","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.CheckboxGroup.html","text":"CheckboxGroup","id":"Ext.form.CheckboxGroup","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.ComboBox.html","text":"ComboBox","id":"Ext.form.ComboBox","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.DateField.html","text":"DateField","id":"Ext.form.DateField","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.Field.html","text":"Field","id":"Ext.form.Field","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.FieldSet.html","text":"FieldSet","id":"Ext.form.FieldSet","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.FormPanel.html","text":"FormPanel","id":"Ext.form.FormPanel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.Hidden.html","text":"Hidden","id":"Ext.form.Hidden","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.HtmlEditor.html","text":"HtmlEditor","id":"Ext.form.HtmlEditor","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.Label.html","text":"Label","id":"Ext.form.Label","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.NumberField.html","text":"NumberField","id":"Ext.form.NumberField","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.Radio.html","text":"Radio","id":"Ext.form.Radio","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.RadioGroup.html","text":"RadioGroup","id":"Ext.form.RadioGroup","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.TextArea.html","text":"TextArea","id":"Ext.form.TextArea","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.TextField.html","text":"TextField","id":"Ext.form.TextField","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.TimeField.html","text":"TimeField","id":"Ext.form.TimeField","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.TriggerField.html","text":"TriggerField","id":"Ext.form.TriggerField","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.form.VTypes.html","text":"VTypes","id":"Ext.form.VTypes","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-grid","text":"grid","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.grid.AbstractSelectionModel.html","text":"AbstractSelectionModel","id":"Ext.grid.AbstractSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.CellSelectionModel.html","text":"CellSelectionModel","id":"Ext.grid.CellSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.CheckboxSelectionModel.html","text":"CheckboxSelectionModel","id":"Ext.grid.CheckboxSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.ColumnModel.html","text":"ColumnModel","id":"Ext.grid.ColumnModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.EditorGridPanel.html","text":"EditorGridPanel","id":"Ext.grid.EditorGridPanel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.grid.GridDragZone.html","text":"GridDragZone","id":"Ext.grid.GridDragZone","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.GridPanel.html","text":"GridPanel","id":"Ext.grid.GridPanel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.grid.GridView.html","text":"GridView","id":"Ext.grid.GridView","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.GroupingView.html","text":"GroupingView","id":"Ext.grid.GroupingView","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.PropertyColumnModel.html","text":"PropertyColumnModel","id":"Ext.grid.PropertyColumnModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.PropertyGrid.html","text":"PropertyGrid","id":"Ext.grid.PropertyGrid","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.grid.PropertyRecord.html","text":"PropertyRecord","id":"Ext.grid.PropertyRecord","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.PropertyStore.html","text":"PropertyStore","id":"Ext.grid.PropertyStore","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.RowNumberer.html","text":"RowNumberer","id":"Ext.grid.RowNumberer","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.grid.RowSelectionModel.html","text":"RowSelectionModel","id":"Ext.grid.RowSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-layout","text":"layout","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.layout.AbsoluteLayout.html","text":"AbsoluteLayout","id":"Ext.layout.AbsoluteLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.Accordion.html","text":"Accordion","id":"Ext.layout.Accordion","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.AnchorLayout.html","text":"AnchorLayout","id":"Ext.layout.AnchorLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.BorderLayout.html","text":"BorderLayout","id":"Ext.layout.BorderLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.BorderLayout.Region.html","text":"BorderLayout.Region","id":"Ext.layout.BorderLayout.Region","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.BorderLayout.SplitRegion.html","text":"BorderLayout.SplitRegion","id":"Ext.layout.BorderLayout.SplitRegion","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.CardLayout.html","text":"CardLayout","id":"Ext.layout.CardLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.ColumnLayout.html","text":"ColumnLayout","id":"Ext.layout.ColumnLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.ContainerLayout.html","text":"ContainerLayout","id":"Ext.layout.ContainerLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.FitLayout.html","text":"FitLayout","id":"Ext.layout.FitLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.FormLayout.html","text":"FormLayout","id":"Ext.layout.FormLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.layout.TableLayout.html","text":"TableLayout","id":"Ext.layout.TableLayout","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-menu","text":"menu","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.menu.Adapter.html","text":"Adapter","id":"Ext.menu.Adapter","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.BaseItem.html","text":"BaseItem","id":"Ext.menu.BaseItem","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.CheckItem.html","text":"CheckItem","id":"Ext.menu.CheckItem","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.ColorItem.html","text":"ColorItem","id":"Ext.menu.ColorItem","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.ColorMenu.html","text":"ColorMenu","id":"Ext.menu.ColorMenu","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.menu.DateItem.html","text":"DateItem","id":"Ext.menu.DateItem","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.DateMenu.html","text":"DateMenu","id":"Ext.menu.DateMenu","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.menu.Item.html","text":"Item","id":"Ext.menu.Item","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.Menu.html","text":"Menu","id":"Ext.menu.Menu","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.menu.MenuMgr.html","text":"MenuMgr","id":"Ext.menu.MenuMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.menu.Separator.html","text":"Separator","id":"Ext.menu.Separator","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.menu.TextItem.html","text":"TextItem","id":"Ext.menu.TextItem","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-state","text":"state","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.state.CookieProvider.html","text":"CookieProvider","id":"Ext.state.CookieProvider","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.state.Manager.html","text":"Manager","id":"Ext.state.Manager","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.state.Provider.html","text":"Provider","id":"Ext.state.Provider","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-tree","text":"tree","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.tree.AsyncTreeNode.html","text":"AsyncTreeNode","id":"Ext.tree.AsyncTreeNode","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.DefaultSelectionModel.html","text":"DefaultSelectionModel","id":"Ext.tree.DefaultSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.MultiSelectionModel.html","text":"MultiSelectionModel","id":"Ext.tree.MultiSelectionModel","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.RootTreeNodeUI.html","text":"RootTreeNodeUI","id":"Ext.tree.RootTreeNodeUI","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeDragZone.html","text":"TreeDragZone","id":"Ext.tree.TreeDragZone","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeDropZone.html","text":"TreeDropZone","id":"Ext.tree.TreeDropZone","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeEditor.html","text":"TreeEditor","id":"Ext.tree.TreeEditor","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeFilter.html","text":"TreeFilter","id":"Ext.tree.TreeFilter","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeLoader.html","text":"TreeLoader","id":"Ext.tree.TreeLoader","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeNode.html","text":"TreeNode","id":"Ext.tree.TreeNode","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeNodeUI.html","text":"TreeNodeUI","id":"Ext.tree.TreeNodeUI","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreePanel.html","text":"TreePanel","id":"Ext.tree.TreePanel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.tree.TreeSorter.html","text":"TreeSorter","id":"Ext.tree.TreeSorter","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":0},{"id":"pkg-util","text":"util","iconCls":"icon-pkg","cls":"package","singleClickExpand":true,"children":[{"href":"output\/Ext.util.CSS.html","text":"CSS","id":"Ext.util.CSS","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.util.ClickRepeater.html","text":"ClickRepeater","id":"Ext.util.ClickRepeater","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.util.DelayedTask.html","text":"DelayedTask","id":"Ext.util.DelayedTask","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.util.Format.html","text":"Format","id":"Ext.util.Format","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.util.JSON.html","text":"JSON","id":"Ext.util.JSON","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.util.MixedCollection.html","text":"MixedCollection","id":"Ext.util.MixedCollection","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.util.Observable.html","text":"Observable","id":"Ext.util.Observable","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.util.TaskRunner.html","text":"TaskRunner","id":"Ext.util.TaskRunner","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.util.TextMetrics.html","text":"TextMetrics","id":"Ext.util.TextMetrics","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true}],"pcount":0},{"href":"output\/Ext.Action.html","text":"Action","id":"Ext.Action","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Ajax.html","text":"Ajax","id":"Ext.Ajax","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.BoxComponent.html","text":"BoxComponent","id":"Ext.BoxComponent","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Button.html","text":"Button","id":"Ext.Button","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.ColorPalette.html","text":"ColorPalette","id":"Ext.ColorPalette","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Component.html","text":"Component","id":"Ext.Component","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.ComponentMgr.html","text":"ComponentMgr","id":"Ext.ComponentMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.CompositeElement.html","text":"CompositeElement","id":"Ext.CompositeElement","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.CompositeElementLite.html","text":"CompositeElementLite","id":"Ext.CompositeElementLite","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Container.html","text":"Container","id":"Ext.Container","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.CycleButton.html","text":"CycleButton","id":"Ext.CycleButton","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.DataView.html","text":"DataView","id":"Ext.DataView","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.DatePicker.html","text":"DatePicker","id":"Ext.DatePicker","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.DomHelper.html","text":"DomHelper","id":"Ext.DomHelper","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.DomQuery.html","text":"DomQuery","id":"Ext.DomQuery","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.Editor.html","text":"Editor","id":"Ext.Editor","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Element.html","text":"Element","id":"Ext.Element","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.EventManager.html","text":"EventManager","id":"Ext.EventManager","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.EventObject.html","text":"EventObject","id":"Ext.EventObject","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.Fx.html","text":"Fx","id":"Ext.Fx","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.History.html","text":"History","id":"Ext.History","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.KeyMap.html","text":"KeyMap","id":"Ext.KeyMap","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.KeyNav.html","text":"KeyNav","id":"Ext.KeyNav","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Layer.html","text":"Layer","id":"Ext.Layer","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.LoadMask.html","text":"LoadMask","id":"Ext.LoadMask","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.MessageBox.html","text":"MessageBox","id":"Ext.MessageBox","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.PagingToolbar.html","text":"PagingToolbar","id":"Ext.PagingToolbar","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Panel.html","text":"Panel","id":"Ext.Panel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.ProgressBar.html","text":"ProgressBar","id":"Ext.ProgressBar","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.QuickTip.html","text":"QuickTip","id":"Ext.QuickTip","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.QuickTips.html","text":"QuickTips","id":"Ext.QuickTips","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.Resizable.html","text":"Resizable","id":"Ext.Resizable","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Shadow.html","text":"Shadow","id":"Ext.Shadow","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Slider.html","text":"Slider","id":"Ext.Slider","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.SplitBar.html","text":"SplitBar","id":"Ext.SplitBar","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.SplitBar.AbsoluteLayoutAdapter.html","text":"SplitBar.AbsoluteLayoutAdapter","id":"Ext.SplitBar.AbsoluteLayoutAdapter","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.SplitBar.BasicLayoutAdapter.html","text":"SplitBar.BasicLayoutAdapter","id":"Ext.SplitBar.BasicLayoutAdapter","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.SplitButton.html","text":"SplitButton","id":"Ext.SplitButton","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.StatusBar.html","text":"StatusBar","id":"Ext.StatusBar","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.StoreMgr.html","text":"StoreMgr","id":"Ext.StoreMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.TabPanel.html","text":"TabPanel","id":"Ext.TabPanel","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.TaskMgr.html","text":"TaskMgr","id":"Ext.TaskMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.Template.html","text":"Template","id":"Ext.Template","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Tip.html","text":"Tip","id":"Ext.Tip","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.ToolTip.html","text":"ToolTip","id":"Ext.ToolTip","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.html","text":"Toolbar","id":"Ext.Toolbar","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.Button.html","text":"Toolbar.Button","id":"Ext.Toolbar.Button","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.Fill.html","text":"Toolbar.Fill","id":"Ext.Toolbar.Fill","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.Item.html","text":"Toolbar.Item","id":"Ext.Toolbar.Item","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.Separator.html","text":"Toolbar.Separator","id":"Ext.Toolbar.Separator","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.Spacer.html","text":"Toolbar.Spacer","id":"Ext.Toolbar.Spacer","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.SplitButton.html","text":"Toolbar.SplitButton","id":"Ext.Toolbar.SplitButton","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Toolbar.TextItem.html","text":"Toolbar.TextItem","id":"Ext.Toolbar.TextItem","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Updater.html","text":"Updater","id":"Ext.Updater","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Updater.BasicRenderer.html","text":"Updater.BasicRenderer","id":"Ext.Updater.BasicRenderer","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Updater.defaults.html","text":"Updater.defaults","id":"Ext.Updater.defaults","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.Viewport.html","text":"Viewport","id":"Ext.Viewport","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.Window.html","text":"Window","id":"Ext.Window","isClass":true,"iconCls":"icon-cmp","cls":"cls","leaf":true},{"href":"output\/Ext.WindowGroup.html","text":"WindowGroup","id":"Ext.WindowGroup","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.WindowMgr.html","text":"WindowMgr","id":"Ext.WindowMgr","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Ext.XTemplate.html","text":"XTemplate","id":"Ext.XTemplate","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":10},{"href":"output\/Array.html","text":"Array","id":"Array","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Date.html","text":"Date","id":"Date","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Ext.html","text":"Ext","id":"Ext","isClass":true,"iconCls":"icon-static","cls":"cls","leaf":true},{"href":"output\/Function.html","text":"Function","id":"Function","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/Number.html","text":"Number","id":"Number","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true},{"href":"output\/String.html","text":"String","id":"String","isClass":true,"iconCls":"icon-cls","cls":"cls","leaf":true}],"pcount":1};
+// Docs.icons = {"Ext.Action":"icon-cls","Ext.Ajax":"icon-static","Ext.BoxComponent":"icon-cmp","Ext.Button":"icon-cmp","Ext.ColorPalette":"icon-cmp","Ext.Component":"icon-cls","Ext.ComponentMgr":"icon-static","Ext.CompositeElement":"icon-cls","Ext.CompositeElementLite":"icon-cls","Ext.Container":"icon-cmp","Ext.CycleButton":"icon-cmp","Ext.DataView":"icon-cmp","Ext.DatePicker":"icon-cmp","Ext.DomHelper":"icon-static","Ext.DomQuery":"icon-static","Ext.Editor":"icon-cmp","Ext.Element":"icon-cls","Ext.EventManager":"icon-static","Ext.EventObject":"icon-static","Ext.Fx":"icon-cls","Ext.History":"icon-static","Ext.KeyMap":"icon-cls","Ext.KeyNav":"icon-cls","Ext.Layer":"icon-cls","Ext.LoadMask":"icon-cls","Ext.MessageBox":"icon-static","Ext.PagingToolbar":"icon-cmp","Ext.Panel":"icon-cmp","Ext.ProgressBar":"icon-cmp","Ext.QuickTip":"icon-cmp","Ext.QuickTips":"icon-static","Ext.Resizable":"icon-cls","Ext.Shadow":"icon-cls","Ext.Slider":"icon-cmp","Ext.SplitBar":"icon-cls","Ext.SplitBar.AbsoluteLayoutAdapter":"icon-cls","Ext.SplitBar.BasicLayoutAdapter":"icon-cls","Ext.SplitButton":"icon-cmp","Ext.StatusBar":"icon-cmp","Ext.StoreMgr":"icon-static","Ext.TabPanel":"icon-cmp","Ext.TaskMgr":"icon-static","Ext.Template":"icon-cls","Ext.Tip":"icon-cmp","Ext.ToolTip":"icon-cmp","Ext.Toolbar":"icon-cmp","Ext.Toolbar.Button":"icon-cmp","Ext.Toolbar.Fill":"icon-cls","Ext.Toolbar.Item":"icon-cls","Ext.Toolbar.Separator":"icon-cls","Ext.Toolbar.Spacer":"icon-cls","Ext.Toolbar.SplitButton":"icon-cmp","Ext.Toolbar.TextItem":"icon-cls","Ext.Updater":"icon-cls","Ext.Updater.BasicRenderer":"icon-cls","Ext.Updater.defaults":"icon-cls","Ext.Viewport":"icon-cmp","Ext.Window":"icon-cmp","Ext.WindowGroup":"icon-cls","Ext.WindowMgr":"icon-static","Ext.XTemplate":"icon-cls","Ext.air.DragType":"icon-static","Ext.air.FileProvider":"icon-cls","Ext.air.NativeObservable":"icon-cls","Ext.air.NativeWindow":"icon-cls","Ext.air.NativeWindowGroup":"icon-cls","Ext.air.NativeWindowManager":"icon-static","Ext.air.Sound":"icon-static","Ext.air.SystemMenu":"icon-static","Ext.data.ArrayReader":"icon-cls","Ext.data.Connection":"icon-cls","Ext.data.DataProxy":"icon-cls","Ext.data.DataReader":"icon-cls","Ext.data.GroupingStore":"icon-cls","Ext.data.HttpProxy":"icon-cls","Ext.data.JsonReader":"icon-cls","Ext.data.JsonStore":"icon-cls","Ext.data.MemoryProxy":"icon-cls","Ext.data.Node":"icon-cls","Ext.data.Record":"icon-cls","Ext.data.ScriptTagProxy":"icon-cls","Ext.data.SimpleStore":"icon-cls","Ext.data.SortTypes":"icon-static","Ext.data.Store":"icon-cls","Ext.data.Tree":"icon-cls","Ext.data.XmlReader":"icon-cls","Ext.dd.DD":"icon-cls","Ext.dd.DDProxy":"icon-cls","Ext.dd.DDTarget":"icon-cls","Ext.dd.DragDrop":"icon-cls","Ext.dd.DragDropMgr":"icon-static","Ext.dd.DragSource":"icon-cls","Ext.dd.DragZone":"icon-cls","Ext.dd.DropTarget":"icon-cls","Ext.dd.DropZone":"icon-cls","Ext.dd.Registry":"icon-static","Ext.dd.ScrollManager":"icon-static","Ext.dd.StatusProxy":"icon-cls","Ext.form.Action":"icon-cls","Ext.form.Action.Load":"icon-cls","Ext.form.Action.Submit":"icon-cls","Ext.form.BasicForm":"icon-cls","Ext.form.Checkbox":"icon-cmp","Ext.form.CheckboxGroup":"icon-cmp","Ext.form.ComboBox":"icon-cmp","Ext.form.DateField":"icon-cmp","Ext.form.Field":"icon-cmp","Ext.form.FieldSet":"icon-cmp","Ext.form.FormPanel":"icon-cmp","Ext.form.Hidden":"icon-cmp","Ext.form.HtmlEditor":"icon-cmp","Ext.form.Label":"icon-cmp","Ext.form.NumberField":"icon-cmp","Ext.form.Radio":"icon-cmp","Ext.form.RadioGroup":"icon-cmp","Ext.form.TextArea":"icon-cmp","Ext.form.TextField":"icon-cmp","Ext.form.TimeField":"icon-cmp","Ext.form.TriggerField":"icon-cmp","Ext.form.VTypes":"icon-static","Ext.grid.AbstractSelectionModel":"icon-cls","Ext.grid.CellSelectionModel":"icon-cls","Ext.grid.CheckboxSelectionModel":"icon-cls","Ext.grid.ColumnModel":"icon-cls","Ext.grid.EditorGridPanel":"icon-cmp","Ext.grid.GridDragZone":"icon-cls","Ext.grid.GridPanel":"icon-cmp","Ext.grid.GridView":"icon-cls","Ext.grid.GroupingView":"icon-cls","Ext.grid.PropertyColumnModel":"icon-cls","Ext.grid.PropertyGrid":"icon-cmp","Ext.grid.PropertyRecord":"icon-cls","Ext.grid.PropertyStore":"icon-cls","Ext.grid.RowNumberer":"icon-cls","Ext.grid.RowSelectionModel":"icon-cls","Ext.layout.AbsoluteLayout":"icon-cls","Ext.layout.Accordion":"icon-cls","Ext.layout.AnchorLayout":"icon-cls","Ext.layout.BorderLayout":"icon-cls","Ext.layout.BorderLayout.Region":"icon-cls","Ext.layout.BorderLayout.SplitRegion":"icon-cls","Ext.layout.CardLayout":"icon-cls","Ext.layout.ColumnLayout":"icon-cls","Ext.layout.ContainerLayout":"icon-cls","Ext.layout.FitLayout":"icon-cls","Ext.layout.FormLayout":"icon-cls","Ext.layout.TableLayout":"icon-cls","Ext.menu.Adapter":"icon-cmp","Ext.menu.BaseItem":"icon-cmp","Ext.menu.CheckItem":"icon-cmp","Ext.menu.ColorItem":"icon-cmp","Ext.menu.ColorMenu":"icon-cls","Ext.menu.DateItem":"icon-cmp","Ext.menu.DateMenu":"icon-cls","Ext.menu.Item":"icon-cmp","Ext.menu.Menu":"icon-cls","Ext.menu.MenuMgr":"icon-static","Ext.menu.Separator":"icon-cmp","Ext.menu.TextItem":"icon-cmp","Ext.state.CookieProvider":"icon-cls","Ext.state.Manager":"icon-static","Ext.state.Provider":"icon-cls","Ext.tree.AsyncTreeNode":"icon-cls","Ext.tree.DefaultSelectionModel":"icon-cls","Ext.tree.MultiSelectionModel":"icon-cls","Ext.tree.RootTreeNodeUI":"icon-cls","Ext.tree.TreeDragZone":"icon-cls","Ext.tree.TreeDropZone":"icon-cls","Ext.tree.TreeEditor":"icon-cmp","Ext.tree.TreeFilter":"icon-cls","Ext.tree.TreeLoader":"icon-cls","Ext.tree.TreeNode":"icon-cls","Ext.tree.TreeNodeUI":"icon-cls","Ext.tree.TreePanel":"icon-cmp","Ext.tree.TreeSorter":"icon-cls","Ext.util.CSS":"icon-static","Ext.util.ClickRepeater":"icon-cls","Ext.util.DelayedTask":"icon-cls","Ext.util.Format":"icon-static","Ext.util.JSON":"icon-static","Ext.util.MixedCollection":"icon-cls","Ext.util.Observable":"icon-cls","Ext.util.TaskRunner":"icon-cls","Ext.util.TextMetrics":"icon-static","Array":"icon-cls","Date":"icon-cls","Ext":"icon-static","Function":"icon-cls","Number":"icon-cls","String":"icon-cls"};
+ </script>
+
+ <div id="header">
+ <a href="http://extjs.com" style="float:right;margin-right:10px;"><img src="resources/extjs.gif" style="width:83px;height:24px;margin-top:1px;"/></a>
+
+ <div class="api-title">Deluge 1.3 Web UI - API Documentation</div>
+ </div>
+
+ <div id="classes"></div>
+
+ <div id="main"></div>
+ <select id="search-options" style="display:none">
+ <option>Starts with</option>
+ <option>Ends with</option>
+ <option>Any Match</option>
+</select>
+ </body>
+</html>
diff --git a/deluge/ui/web/docs/template/license.txt b/deluge/ui/web/docs/template/license.txt
new file mode 100644
index 0000000..da0f921
--- /dev/null
+++ b/deluge/ui/web/docs/template/license.txt
@@ -0,0 +1,42 @@
+Ext JS - JavaScript Library
+Copyright (c) 2006-2008, Ext JS, LLC
+All rights reserved.
+licensing@extjs.com
+
+http://extjs.com/license
+
+Open Source License
+------------------------------------------------------------------------------------------
+Ext is licensed under the terms of the Open Source GPL 3.0 license.
+
+http://www.gnu.org/licenses/gpl.html
+
+There are several FLOSS exceptions available for use with this release for
+open source applications that are distributed under a license other than the GPL.
+
+* Open Source License Exception for Applications
+
+ http://extjs.com/products/floss-exception.php
+
+* Open Source License Exception for Development
+
+ http://extjs.com/products/ux-exception.php
+
+
+Commercial License
+------------------------------------------------------------------------------------------
+This is the appropriate option if you are creating proprietary applications and you are
+not prepared to distribute and share the source code of your application under the
+GPL v3 license. Please visit http://extjs.com/license for more details.
+
+
+OEM / Reseller License
+------------------------------------------------------------------------------------------
+For more details, please visit: http://extjs.com/license.
+
+--
+
+This library 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. \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/TabCloseMenu.js b/deluge/ui/web/docs/template/resources/TabCloseMenu.js
new file mode 100644
index 0000000..bdd7e19
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/TabCloseMenu.js
@@ -0,0 +1,42 @@
+// Very simple plugin for adding a close context menu to tabs
+Ext.ux.TabCloseMenu = function(){
+ var tabs, menu, ctxItem;
+ this.init = function(tp){
+ tabs = tp;
+ tabs.on('contextmenu', onContextMenu);
+ }
+
+ function onContextMenu(ts, item, e){
+ if(!menu){ // create context menu on first right click
+ menu = new Ext.menu.Menu([{
+ id: tabs.id + '-close',
+ text: 'Close Tab',
+ handler : function(){
+ tabs.remove(ctxItem);
+ }
+ },{
+ id: tabs.id + '-close-others',
+ text: 'Close Other Tabs',
+ handler : function(){
+ tabs.items.each(function(item){
+ if(item.closable && item != ctxItem){
+ tabs.remove(item);
+ }
+ });
+ }
+ }]);
+ }
+ ctxItem = item;
+ var items = menu.items;
+ items.get(tabs.id + '-close').setDisabled(!item.closable);
+ var disableOthers = true;
+ tabs.items.each(function(){
+ if(this != item && this.closable){
+ disableOthers = false;
+ return false;
+ }
+ });
+ items.get(tabs.id + '-close-others').setDisabled(disableOthers);
+ menu.showAt(e.getPoint());
+ }
+}; \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/accordian.gif b/deluge/ui/web/docs/template/resources/accordian.gif
new file mode 100644
index 0000000..8846b0f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/accordian.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/block-bg.gif b/deluge/ui/web/docs/template/resources/block-bg.gif
new file mode 100644
index 0000000..f3cf86d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/block-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/block-bottom.gif b/deluge/ui/web/docs/template/resources/block-bottom.gif
new file mode 100644
index 0000000..c0570c5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/block-bottom.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/block-top.gif b/deluge/ui/web/docs/template/resources/block-top.gif
new file mode 100644
index 0000000..cf3fb24
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/block-top.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/class.gif b/deluge/ui/web/docs/template/resources/class.gif
new file mode 100644
index 0000000..72a4026
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/class.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/cmp.gif b/deluge/ui/web/docs/template/resources/cmp.gif
new file mode 100644
index 0000000..4f791e1
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/cmp.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/collapse-all.gif b/deluge/ui/web/docs/template/resources/collapse-all.gif
new file mode 100644
index 0000000..891d1b7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/collapse-all.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/collapse-bg.gif b/deluge/ui/web/docs/template/resources/collapse-bg.gif
new file mode 100644
index 0000000..e6b8da2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/collapse-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/collapser.css b/deluge/ui/web/docs/template/resources/collapser.css
new file mode 100644
index 0000000..d1c7b46
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/collapser.css
@@ -0,0 +1,34 @@
+.pkg h3 {
+ padding-left:34px;
+ font:normal 11px verdana,helvetica,tahoma,sans-serif;
+ height:18px;
+ cursor:pointer;
+}
+h3.collapser-expanded{
+ background: #fff url(pkg-open.gif) no-repeat 0px -1px;
+}
+h3.collapser-collapsed {
+ background: #fff url(pkg-closed.gif) no-repeat 0px -1px;
+}
+.pkg-body{
+ margin-left:16px;
+ font:normal 11px verdana,helvetica,tahoma,sans-serif;
+}
+#classes a{
+ font:normal 11px verdana,helvetica,tahoma,sans-serif;
+ display:block;
+ text-decoration:none;
+ height:18px;
+ color:black;
+ background: #fff url(class.gif) no-repeat 16px -1px;
+ padding-left:34px;
+ -moz-outline:none;
+ outline:none;
+ white-space: nowrap;
+}
+#classes a:hover{
+ text-decoration: underline;
+}
+#classes a.ex{
+ background: #fff url(example.gif) no-repeat 16px -1px;
+} \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/config.gif b/deluge/ui/web/docs/template/resources/config.gif
new file mode 100644
index 0000000..6534c65
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/config.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/css/ext-all.css b/deluge/ui/web/docs/template/resources/css/ext-all.css
new file mode 100644
index 0000000..5f87f8f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/css/ext-all.css
@@ -0,0 +1,925 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
+img,body,html{border:0;}
+address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
+ol,ul{list-style:none;}
+caption,th{text-align:left;}
+h1,h2,h3,h4,h5,h6{font-size:100%;}
+q:before,q:after{content:'';}
+
+.ext-el-mask{z-index:20000;position:absolute;top:0;left:0;-moz-opacity:0.5;opacity:.50;filter:alpha(opacity=50);background-color:#CCC;width:100%;height:100%;zoom:1;}
+.ext-el-mask-msg{z-index:20001;position:absolute;top:0;left:0;border:1px solid #6593cf;background:#c3daf9 url(../images/default/box/tb-blue.gif) repeat-x 0 -16px;padding:2px;}
+.ext-el-mask-msg div{padding:5px 10px 5px 10px;background:#eee;border:1px solid #a3bad9;color:#222;font:normal 11px tahoma,arial,helvetica,sans-serif;cursor:wait;}
+.ext-shim{position:absolute;visibility:hidden;left:0;top:0;overflow:hidden;}
+.ext-ie .ext-shim{filter:alpha(opacity=0);}
+.ext-ie6 .ext-shim{margin-left:5px;margin-top:3px;}
+.x-mask-loading div{padding:5px 10px 5px 25px;background:#fbfbfb url( '../images/default/grid/loading.gif' ) no-repeat 5px 5px;line-height:16px;}
+.x-hidden,.x-hide-offsets{position:absolute;left:-10000px;top:-10000px;visibility:hidden;}
+.x-hide-display{display:none!important;}
+.x-hide-visibility{visibility:hidden!important;}
+.x-masked{overflow:hidden!important;}
+.x-masked select,.x-masked object,.x-masked embed{visibility:hidden;}
+.x-layer{visibility:hidden;}
+.x-unselectable,.x-unselectable *{-moz-user-select:none;-khtml-user-select:none;}
+.x-repaint{zoom:1;background-color:transparent;-moz-outline:none;}
+.x-item-disabled{color:gray;cursor:default;opacity:.6;-moz-opacity:.6;filter:alpha(opacity=60);}
+.x-item-disabled *{color:gray!important;cursor:default!important;}
+.x-splitbar-proxy{position:absolute;visibility:hidden;z-index:20001;background:#aaa;zoom:1;line-height:1px;font-size:1px;overflow:hidden;}
+.x-splitbar-h,.x-splitbar-proxy-h{cursor:e-resize;cursor:col-resize;}
+.x-splitbar-v,.x-splitbar-proxy-v{cursor:s-resize;cursor:row-resize;}
+.x-color-palette{width:150px;height:92px;cursor:pointer;}
+.x-color-palette a{border:1px solid #fff;float:left;padding:2px;text-decoration:none;-moz-outline:0 none;outline:0 none;cursor:pointer;}
+.x-color-palette a:hover,.x-color-palette a.x-color-palette-sel{border:1px solid #8BB8F3;background:#deecfd;}
+.x-color-palette em{display:block;border:1px solid #ACA899;}
+.x-color-palette em span{cursor:pointer;display:block;height:10px;line-height:10px;width:10px;}
+.x-ie-shadow{display:none;position:absolute;overflow:hidden;left:0;top:0;background:#777;zoom:1;}
+.x-shadow{display:none;position:absolute;overflow:hidden;left:0;top:0;}
+.x-shadow *{overflow:hidden;}
+.x-shadow *{padding:0;border:0;margin:0;clear:none;zoom:1;}
+.x-shadow .xstc,.x-shadow .xsbc{height:6px;float:left;}
+.x-shadow .xstl,.x-shadow .xstr,.x-shadow .xsbl,.x-shadow .xsbr{width:6px;height:6px;float:left;}
+.x-shadow .xsc{width:100%;}
+.x-shadow .xsml,.x-shadow .xsmr{width:6px;float:left;height:100%;}
+.x-shadow .xsmc{float:left;height:100%;background:transparent url( ../images/default/shadow-c.png );}
+.x-shadow .xst,.x-shadow .xsb{height:6px;overflow:hidden;width:100%;}
+.x-shadow .xsml{background:transparent url( ../images/default/shadow-lr.png ) repeat-y 0 0;}
+.x-shadow .xsmr{background:transparent url( ../images/default/shadow-lr.png ) repeat-y -6px 0;}
+.x-shadow .xstl{background:transparent url( ../images/default/shadow.png ) no-repeat 0 0;}
+.x-shadow .xstc{background:transparent url( ../images/default/shadow.png ) repeat-x 0 -30px;}
+.x-shadow .xstr{background:transparent url( ../images/default/shadow.png ) repeat-x 0 -18px;}
+.x-shadow .xsbl{background:transparent url( ../images/default/shadow.png ) no-repeat 0 -12px;}
+.x-shadow .xsbc{background:transparent url( ../images/default/shadow.png ) repeat-x 0 -36px;}
+.x-shadow .xsbr{background:transparent url( ../images/default/shadow.png ) repeat-x 0 -6px;}
+.loading-indicator{font-size:11px;background-image:url(../images/default/grid/loading.gif);background-repeat:no-repeat;background-position:left;padding-left:20px;line-height:16px;margin:3px;}
+.x-text-resize{position:absolute;left:-1000px;top:-1000px;visibility:hidden;zoom:1;}
+.x-drag-overlay{width:100%;height:100%;display:none;position:absolute;left:0;top:0;background-image:url(../images/default/s.gif);z-index:20000;}
+.x-clear{clear:both;height:0;overflow:hidden;line-height:0;font-size:0;}
+.x-spotlight{z-index:8999;position:absolute;top:0;left:0;-moz-opacity:0.5;opacity:.50;filter:alpha(opacity=50);background-color:#CCC;width:0;height:0;zoom:1;}
+
+.x-tab-panel{overflow:hidden;}
+.x-tab-panel-header,.x-tab-panel-footer{background:#deecfd;border:1px solid #8db2e3;overflow:hidden;zoom:1;}
+.x-tab-panel-header{border:1px solid #8db2e3;padding-bottom:2px;}
+.x-tab-panel-footer{border:1px solid #8db2e3;padding-top:2px;}
+.x-tab-strip-wrap{width:100%;overflow:hidden;position:relative;zoom:1;}
+ul.x-tab-strip{display:block;width:5000px;zoom:1;}
+ul.x-tab-strip-top{padding-top:1px;background:url(../images/default/tabs/tab-strip-bg.gif) #cedff5 repeat-x bottom;border-bottom:1px solid #8db2e3;}
+ul.x-tab-strip-bottom{padding-bottom:1px;background:url(../images/default/tabs/tab-strip-btm-bg.gif) #cedff5 repeat-x top;border-top:1px solid #8db2e3;border-bottom:0 none;}
+.x-tab-panel-header-plain .x-tab-strip-top{background:transparent!important;padding-top:0!important;}
+.x-tab-panel-header-plain{background:transparent!important;border-width:0!important;padding-bottom:0!important;}
+.x-tab-panel-header-plain .x-tab-strip-spacer,.x-tab-panel-footer-plain .x-tab-strip-spacer{border:1px solid #8db2e3;height:2px;background:#deecfd;font-size:1px;line-height:1px;}
+.x-tab-panel-header-plain .x-tab-strip-spacer{border-top:0 none;}
+.x-tab-panel-footer-plain .x-tab-strip-spacer{border-bottom:0 none;}
+.x-tab-panel-footer-plain .x-tab-strip-bottom{background:transparent!important;padding-bottom:0!important;}
+.x-tab-panel-footer-plain{background:transparent!important;border-width:0!important;padding-top:0!important;}
+.ext-border-box .x-tab-panel-header-plain .x-tab-strip-spacer,.ext-border-box .x-tab-panel-footer-plain .x-tab-strip-spacer{height:3px;}
+ul.x-tab-strip li{float:left;margin-left:2px;}
+ul.x-tab-strip li.x-tab-edge{float:left;margin:0!important;padding:0!important;border:0 none!important;font-size:1px!important;line-height:1px!important;overflow:hidden;zoom:1;background:transparent!important;width:1px;}
+.x-tab-strip a,.x-tab-strip span,.x-tab-strip em{display:block;}
+.x-tab-strip a{text-decoration:none!important;-moz-outline:none;outline:none;cursor:pointer;}
+.x-tab-strip-inner{overflow:hidden;text-overflow:ellipsis;}
+.x-tab-strip span.x-tab-strip-text{font:normal 11px tahoma,arial,helvetica;color:#416aa3;white-space:nowrap;cursor:pointer;padding:4px 0;}
+.x-tab-strip-top .x-tab-with-icon .x-tab-right{padding-left:6px;}
+.x-tab-strip .x-tab-with-icon span.x-tab-strip-text{padding-left:20px;background-position:0 3px;background-repeat:no-repeat;}
+.x-tab-strip-over span.x-tab-strip-text{color:#15428b;}
+.x-tab-strip-active,.x-tab-strip-active a.x-tab-right{cursor:default;}
+.x-tab-strip-active span.x-tab-strip-text{cursor:default;color:#15428b;font-weight:bold;}
+.x-tab-strip-disabled .x-tabs-text{cursor:default;color:#aaa;}
+.x-tab-panel-body{overflow:hidden;}
+.x-tab-panel-bwrap{overflow:hidden;}
+.ext-ie .x-tab-strip .x-tab-right{position:relative;}
+.x-tab-strip-top .x-tab-strip-active .x-tab-right{margin-bottom:-1px;}
+.x-tab-strip-top .x-tab-strip-active .x-tab-right span.x-tab-strip-text{padding-bottom:5px;}
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-right{margin-top:-1px;}
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-right span.x-tab-strip-text{padding-top:5px;}
+.x-tab-strip-top .x-tab-right{background:transparent url(../images/default/tabs/tabs-sprite.gif) no-repeat 0 -51px;padding-left:10px;}
+.x-tab-strip-top .x-tab-left{background:transparent url(../images/default/tabs/tabs-sprite.gif) no-repeat right -351px;padding-right:10px;}
+.x-tab-strip-top .x-tab-strip-inner{background:transparent url(../images/default/tabs/tabs-sprite.gif) repeat-x 0 -201px;}
+.x-tab-strip-top .x-tab-strip-over .x-tab-right{background-position:0 -101px;}
+.x-tab-strip-top .x-tab-strip-over .x-tab-left{background-position:right -401px;}
+.x-tab-strip-top .x-tab-strip-over .x-tab-strip-inner{background-position:0 -251px;}
+.x-tab-strip-top .x-tab-strip-active .x-tab-right{background-position:0 0;}
+.x-tab-strip-top .x-tab-strip-active .x-tab-left{background-position:right -301px;}
+.x-tab-strip-top .x-tab-strip-active .x-tab-strip-inner{background-position:0 -151px;}
+.x-tab-strip-bottom .x-tab-right{background:url(../images/default/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom right;}
+.x-tab-strip-bottom .x-tab-left{background:url(../images/default/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom left;}
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-right{background:url(../images/default/tabs/tab-btm-right-bg.gif) no-repeat bottom left;}
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-left{background:url(../images/default/tabs/tab-btm-left-bg.gif) no-repeat bottom right;}
+.x-tab-strip-bottom .x-tab-left{padding:0 10px;}
+.x-tab-strip-bottom .x-tab-right{padding:0;}
+.x-tab-strip .x-tab-strip-close{display:none;}
+.x-tab-strip-closable{position:relative;}
+.x-tab-strip-closable .x-tab-left{padding-right:19px;}
+.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close{background-image:url(../images/default/tabs/tab-close.gif);opacity:.6;-moz-opacity:.6;background-repeat:no-repeat;display:block;width:11px;height:11px;position:absolute;top:3px;right:3px;cursor:pointer;z-index:2;}
+.x-tab-strip .x-tab-strip-active a.x-tab-strip-close{opacity:.8;-moz-opacity:.8;}
+.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{background-image:url(../images/default/tabs/tab-close.gif);opacity:1;-moz-opacity:1;}
+.x-tab-panel-body{border:1px solid #8db2e3;background:#fff;}
+.x-tab-panel-body-top{border-top:0 none;}
+.x-tab-panel-body-bottom{border-bottom:0 none;}
+.x-tab-scroller-left{background:transparent url(../images/default/tabs/scroll-left.gif) no-repeat -18px 0;border-bottom:1px solid #8db2e3;width:18px;position:absolute;left:0;top:0;z-index:10;cursor:pointer;}
+.x-tab-scroller-left-over{background-position:0 0;}
+.x-tab-scroller-left-disabled{background-position:-18px 0;opacity:.5;-moz-opacity:.5;filter:alpha(opacity=50);cursor:default;}
+.x-tab-scroller-right{background:transparent url(../images/default/tabs/scroll-right.gif) no-repeat 0 0;border-bottom:1px solid #8db2e3;width:18px;position:absolute;right:0;top:0;z-index:10;cursor:pointer;}
+.x-tab-scroller-right-over{background-position:-18px 0;}
+.x-tab-scroller-right-disabled{background-position:0 0;opacity:.5;-moz-opacity:.5;filter:alpha(opacity=50);cursor:default;}
+.x-tab-scrolling .x-tab-strip-wrap{margin-left:18px;margin-right:18px;}
+.x-tab-scrolling{position:relative;}
+.x-tab-panel-bbar .x-toolbar{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;padding:2px;}
+.x-tab-panel-tbar .x-toolbar{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;padding:2px;}
+
+ .x-form-field{margin:0;font:normal 12px tahoma,arial,helvetica,sans-serif;}
+.x-form-text,textarea.x-form-field{padding:1px 3px;background:#fff url(../images/default/form/text-bg.gif) repeat-x 0 0;border:1px solid #B5B8C8;}
+textarea.x-form-field{padding:2px 3px;}
+.x-form-text{height:22px;line-height:18px;vertical-align:middle;}
+.ext-ie .x-form-text{margin:-1px 0;height:22px;line-height:18px;}
+.ext-ie textarea.x-form-field{margin:-1px 0;}
+.ext-strict .x-form-text{height:18px;}
+.ext-safari .x-form-text{height:20px;padding:0 3px;}
+.ext-safari.ext-mac textarea.x-form-field{margin-bottom:-2px;}
+.ext-gecko .x-form-text{padding-top:2px;padding-bottom:0;}
+textarea{resize:none;}
+.x-form-select-one{height:20px;line-height:18px;vertical-align:middle;background-color:#fff;border:1px solid #B5B8C8;}
+.x-form-check-group,.x-form-radio-group{margin-bottom:0;}
+.x-form-check-group .x-form-invalid .x-panel-body,.x-form-radio-group .x-form-invalid .x-panel-body{background-color:transparent;}
+.x-form-check-wrap,.x-form-radio-wrap{padding:3px 0 0 0;line-height:18px;}
+.x-form-check-group .x-form-check-wrap,.x-form-radio-group .x-form-radio-wrap{height:18px;}
+.ext-ie .x-form-check-group .x-form-check-wrap,.ext-ie .x-form-radio-group .x-form-radio-wrap{height:21px;}
+.ext-ie .x-form-check-wrap input,.ext-ie .x-form-radio-wrap input{width:15px;height:15px;}
+.x-form-check,.x-form-radio{height:13px;width:13px;vertical-align:bottom;}
+.x-form-radio{margin-bottom:3px;}
+.x-form-check,.ext-ie .x-form-radio{margin-bottom:2px;}
+.x-form-check-wrap-inner,.x-form-radio-wrap-inner{display:inline;padding:3px 0 0 0;}
+.x-form-check{background:url('../images/default/form/checkbox.gif') no-repeat 0 0;}
+.x-form-radio{background:url('../images/default/form/radio.gif') no-repeat 0 0;}
+.x-form-check-focus .x-form-check,.x-form-check-over .x-form-check,.x-form-check-focus .x-form-radio,.x-form-check-over .x-form-radio{background-position:-13px 0;}
+.x-form-check-down .x-form-check,.x-form-check-down .x-form-radio{background-position:-26px 0;}
+.x-form-check-checked .x-form-check-focus .x-form-check,.x-form-check-checked .x-form-check-over .x-form-check{background-position:-13px -13px;}
+.x-form-check-checked .x-form-check-down .x-form-check{background-position:-26px -13px;}
+.x-form-check-checked .x-form-check,.x-form-check-checked .x-form-radio{background-position:0 -13px;}
+.x-form-check-group-label{border-bottom:1px solid #99BBE8;color:#15428B;margin-bottom:5px;padding-left:3px!important;float:none!important;}
+.x-form-field-wrap{position:relative;zoom:1;white-space:nowrap;}
+.x-form-field-wrap .x-form-trigger{width:17px;height:21px;border:0;background:transparent url(../images/default/form/trigger.gif) no-repeat 0 0;cursor:pointer;border-bottom:1px solid #B5B8C8;position:absolute;top:0;}
+.ext-safari .x-form-field-wrap .x-form-trigger{height:21px;}
+.x-form-field-wrap .x-form-date-trigger{background-image:url(../images/default/form/date-trigger.gif);cursor:pointer;}
+.x-form-field-wrap .x-form-clear-trigger{background-image:url(../images/default/form/clear-trigger.gif);cursor:pointer;}
+.x-form-field-wrap .x-form-search-trigger{background-image:url(../images/default/form/search-trigger.gif);cursor:pointer;}
+.ext-safari .x-form-field-wrap .x-form-trigger{right:0;}
+.x-form-field-wrap .x-form-twin-triggers .x-form-trigger{position:static;top:auto;vertical-align:top;}
+.x-form-field-wrap .x-form-trigger-over{background-position:-17px 0;}
+.x-form-field-wrap .x-form-trigger-click{background-position:-34px 0;}
+.x-trigger-wrap-focus .x-form-trigger{background-position:-51px 0;}
+.x-trigger-wrap-focus .x-form-trigger-over{background-position:-68px 0;}
+.x-trigger-wrap-focus .x-form-trigger-click{background-position:-85px 0;}
+.x-trigger-wrap-focus .x-form-trigger{border-bottom:1px solid #7eadd9;}
+.x-item-disabled .x-form-trigger-over{background-position:0 0!important;border-bottom:1px solid #B5B8C8;}
+.x-item-disabled .x-form-trigger-click{background-position:0 0!important;border-bottom:1px solid #B5B8C8;}
+.x-form-focus,textarea.x-form-focus{border:1px solid #7eadd9;}
+.x-form-invalid,textarea.x-form-invalid{background:#fff url(../images/default/grid/invalid_line.gif) repeat-x bottom;border:1px solid #dd7870;}
+.ext-safari .x-form-invalid{background-color:#fee;border:1px solid #ff7870;}
+.x-editor{visibility:hidden;padding:0;margin:0;}
+.x-editor .x-form-check-wrap,.x-editor .x-form-radio-wrap{background:#fff;padding:3px;}
+.x-editor .x-form-checkbox{height:13px;}
+.x-form-grow-sizer{font:normal 12px tahoma,arial,helvetica,sans-serif;left:-10000px;padding:8px 3px;position:absolute;visibility:hidden;top:-10000px;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;zoom:1;}
+.x-form-grow-sizer p{margin:0!important;border:0 none!important;padding:0!important;}
+.x-form-item{font:normal 12px tahoma,arial,helvetica,sans-serif;display:block;margin-bottom:4px;zoom:1;}
+.x-form-item label{display:block;float:left;width:100px;padding:3px;padding-left:0;clear:left;z-index:2;position:relative;}
+.x-form-element{padding-left:105px;position:relative;}
+.x-form-invalid-msg{color:#e00;padding:2px;padding-left:18px;font:normal 11px tahoma,arial,helvetica,sans-serif;background:transparent url(../images/default/shared/warning.gif) no-repeat 0 2px;line-height:16px;width:200px;}
+.x-form-label-right label{text-align:right;}
+.x-form-label-left label{text-align:left;}
+.x-form-label-top .x-form-item label{width:auto;float:none;clear:none;display:inline;margin-bottom:4px;position:static;}
+.x-form-label-top .x-form-element{padding-left:0;padding-top:4px;}
+.x-form-label-top .x-form-item{padding-bottom:4px;}
+.x-form-empty-field{color:gray;}
+.x-small-editor .x-form-field{font:normal 11px arial,tahoma,helvetica,sans-serif;}
+.x-small-editor .x-form-text{height:20px;line-height:16px;vertical-align:middle;}
+.ext-ie .x-small-editor .x-form-text{margin-top:-1px!important;margin-bottom:-1px!important;height:20px!important;line-height:16px!important;}
+.ext-strict .x-small-editor .x-form-text{height:16px!important;}
+.ext-safari .x-small-editor .x-form-field{font:normal 12px arial,tahoma,helvetica,sans-serif;}
+.ext-ie .x-small-editor .x-form-text{height:20px;line-height:16px;}
+.ext-border-box .x-small-editor .x-form-text{height:20px;}
+.x-small-editor .x-form-select-one{height:20px;line-height:16px;vertical-align:middle;}
+.x-small-editor .x-form-num-field{text-align:right;}
+.x-small-editor .x-form-field-wrap .x-form-trigger{height:19px;}
+.x-form-clear{clear:both;height:0;overflow:hidden;line-height:0;font-size:0;}
+.x-form-clear-left{clear:left;height:0;overflow:hidden;line-height:0;font-size:0;}
+.x-form-cb-label{width:'auto'!important;float:none!important;clear:none!important;display:inline!important;margin-left:4px;}
+.x-form-column{float:left;padding:0;margin:0;width:48%;overflow:hidden;zoom:1;}
+.x-form .x-form-btns-ct .x-btn{float:right;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns td{border:0;padding:0;}
+.x-form .x-form-btns-ct .x-form-btns-right table{float:right;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns-left table{float:left;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns-center{text-align:center;}
+.x-form .x-form-btns-ct .x-form-btns-center table{margin:0 auto;}
+.x-form .x-form-btns-ct table td.x-form-btn-td{padding:3px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-left{background-position:0 -147px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-right{background-position:0 -168px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-center{background-position:0 -189px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-center{background-position:0 -126px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-right{background-position:0 -84px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-left{background-position:0 -63px;}
+.x-form-invalid-icon{width:16px;height:18px;visibility:hidden;position:absolute;left:0;top:0;display:block;background:transparent url(../images/default/form/exclamation.gif) no-repeat 0 2px;}
+.x-fieldset{border:1px solid #B5B8C8;padding:10px;margin-bottom:10px;display:block;}
+.x-fieldset legend{font:bold 11px tahoma,arial,helvetica,sans-serif;color:#15428b;}
+.ext-ie .x-fieldset legend{margin-bottom:10px;}
+.ext-ie .x-fieldset{padding-top:0;padding-bottom:10px;}
+.x-fieldset legend .x-tool-toggle{margin-right:3px;margin-left:0;float:left!important;}
+.x-fieldset legend input{margin-right:3px;float:left!important;height:13px;width:13px;}
+fieldset.x-panel-collapsed{padding-bottom:0!important;border-width:1px 0 0 0!important;}
+fieldset.x-panel-collapsed .x-fieldset-bwrap{visibility:hidden;position:absolute;left:-1000px;top:-1000px;}
+.ext-ie .x-fieldset-bwrap{zoom:1;}
+.ext-ie td .x-form-text{position:relative;top:-1px;}
+.x-fieldset-noborder{border:0 none transparent;}
+.x-fieldset-noborder legend{margin-left:-3px;}
+.ext-ie .x-fieldset-noborder legend{position:relative;margin-bottom:23px;}
+.ext-ie .x-fieldset-noborder legend span{position:absolute;left:-5px;}
+.ext-gecko .x-window-body .x-form-item{-moz-outline:none;overflow:auto;}
+.ext-gecko .x-form-item{-moz-outline:none;}
+.x-hide-label label.x-form-item-label{display:none;}
+.x-hide-label .x-form-element{padding-left:0!important;}
+.x-fieldset{overflow:hidden;}
+.x-fieldset-bwrap{overflow:hidden;zoom:1;}
+.x-fieldset-body{overflow:hidden;}
+
+.x-btn{font:normal 11px tahoma,verdana,helvetica;cursor:pointer;white-space:nowrap;}
+.x-btn button{border:0 none;background:transparent;font:normal 11px tahoma,verdana,helvetica;padding-left:3px;padding-right:3px;cursor:pointer;margin:0;overflow:visible;width:auto;-moz-outline:0 none;outline:0 none;}
+* html .ext-ie .x-btn button{width:1px;}
+.ext-gecko .x-btn button{padding-left:0;padding-right:0;}
+.ext-ie .x-btn button{padding-top:2px;}
+.x-btn-icon .x-btn-center .x-btn-text{background-position:center;background-repeat:no-repeat;height:16px;width:16px;cursor:pointer;white-space:nowrap;padding:0;}
+.x-btn-icon .x-btn-center{padding:1px;}
+.x-btn em{font-style:normal;font-weight:normal;}
+.x-btn-text-icon .x-btn-center .x-btn-text{background-position:0 2px;background-repeat:no-repeat;padding-left:18px;padding-top:3px;padding-bottom:2px;padding-right:0;}
+.ext-gecko3 .x-btn-text-icon .x-btn-center .x-btn-text{padding-top:2px;}
+.x-btn-left,.x-btn-right{font-size:1px;line-height:1px;}
+.x-btn-left{width:3px;height:21px;background:url(../images/default/button/btn-sprite.gif) no-repeat 0 0;}
+.x-btn-right{width:3px;height:21px;background:url(../images/default/button/btn-sprite.gif) no-repeat 0 -21px;}
+.x-btn-left i,.x-btn-right i{display:block;width:3px;overflow:hidden;font-size:1px;line-height:1px;}
+.x-btn-center{background:url(../images/default/button/btn-sprite.gif) repeat-x 0 -42px;vertical-align:middle;text-align:center;padding:0 5px;cursor:pointer;white-space:nowrap;}
+.x-btn-over .x-btn-left{background-position:0 -63px;}
+.x-btn-over .x-btn-right{background-position:0 -84px;}
+.x-btn-over .x-btn-center{background-position:0 -105px;}
+.x-btn-click .x-btn-center,.x-btn-menu-active .x-btn-center{background-position:0 -126px;}
+.x-btn-disabled *{color:gray!important;cursor:default!important;}
+.x-btn-menu-text-wrap .x-btn-center{padding:0 3px;}
+.ext-gecko .x-btn-menu-text-wrap .x-btn-center{padding:0 1px;}
+.x-btn-menu-arrow-wrap .x-btn-center{padding:0;}
+.x-btn-menu-arrow-wrap .x-btn-center button{width:12px!important;height:21px;padding:0!important;display:block;background:transparent url(../images/default/button/btn-arrow.gif) no-repeat left 3px;}
+.x-btn-with-menu .x-btn-center{padding-right:2px!important;}
+.x-btn-with-menu .x-btn-center em{display:block;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat right 0;padding-right:10px;}
+.x-btn-text-icon .x-btn-with-menu .x-btn-center em{display:block;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat right 3px;padding-right:10px;}
+.x-btn-pressed .x-btn-left{background:url(../images/default/button/btn-sprite.gif) no-repeat 0 -63px;}
+.x-btn-pressed .x-btn-right{background:url(../images/default/button/btn-sprite.gif) no-repeat 0 -84px;}
+.x-btn-pressed .x-btn-center{background:url(../images/default/button/btn-sprite.gif) repeat-x 0 -126px;}
+
+.x-toolbar{border-color:#a9bfd3;border-style:solid;border-width:0 0 1px 0;display:block;padding:2px;background:#d0def0 url(../images/default/toolbar/bg.gif) repeat-x top left;position:relative;zoom:1;}
+.x-toolbar .x-item-disabled .x-btn-icon{opacity:.35;-moz-opacity:.35;filter:alpha(opacity=35);}
+.x-toolbar td{vertical-align:middle;}
+.mso .x-toolbar,.x-grid-mso .x-toolbar{border:0 none;background:url(../images/default/grid/mso-hd.gif);}
+.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 11px tahoma,arial,helvetica,sans-serif;}
+.x-toolbar .x-item-disabled{color:gray;cursor:default;opacity:.6;-moz-opacity:.6;filter:alpha(opacity=60);}
+.x-toolbar .x-item-disabled *{color:gray;cursor:default;}
+.x-toolbar .x-btn-left{background:none;}
+.x-toolbar .x-btn-right{background:none;}
+.x-toolbar .x-btn-center{background:none;padding:0;}
+.x-toolbar .x-btn-menu-text-wrap .x-btn-center button{padding-right:2px;}
+.ext-gecko .x-toolbar .x-btn-menu-text-wrap .x-btn-center button{padding-right:0;}
+.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button{padding:0 2px;}
+.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button{width:12px;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat 0 3px;}
+.x-toolbar .x-btn-text-icon .x-btn-menu-arrow-wrap .x-btn-center button{width:12px;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat 0 3px;}
+.x-toolbar .x-btn-over .x-btn-menu-arrow-wrap .x-btn-center button{background-position:0 -47px;}
+.x-toolbar .x-btn-over .x-btn-left{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 0;}
+.x-toolbar .x-btn-over .x-btn-right{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -21px;}
+.x-toolbar .x-btn-over .x-btn-center{background:url(../images/default/toolbar/tb-btn-sprite.gif) repeat-x 0 -42px;}
+.x-toolbar .x-btn-click .x-btn-left,.x-toolbar .x-btn-pressed .x-btn-left,.x-toolbar .x-btn-menu-active .x-btn-left{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -63px;}
+.x-toolbar .x-btn-click .x-btn-right,.x-toolbar .x-btn-pressed .x-btn-right,.x-toolbar .x-btn-menu-active .x-btn-right{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -84px;}
+.x-toolbar .x-btn-click .x-btn-center,.x-toolbar .x-btn-pressed .x-btn-center,.x-toolbar .x-btn-menu-active .x-btn-center{background:url(../images/default/toolbar/tb-btn-sprite.gif) repeat-x 0 -105px;}
+.x-toolbar .x-btn-with-menu .x-btn-center em{padding-right:8px;}
+.x-toolbar .ytb-text{padding:2px;}
+.x-toolbar .ytb-sep{background-image:url(../images/default/grid/grid-blue-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px 0;border:0;}
+.x-toolbar .ytb-spacer{width:2px;}
+.x-tbar-page-number{width:24px;height:14px;}
+.x-tbar-page-first{background-image:url(../images/default/grid/page-first.gif)!important;}
+.x-tbar-loading{background-image:url(../images/default/grid/refresh.gif)!important;}
+.x-tbar-page-last{background-image:url(../images/default/grid/page-last.gif)!important;}
+.x-tbar-page-next{background-image:url(../images/default/grid/page-next.gif)!important;}
+.x-tbar-page-prev{background-image:url(../images/default/grid/page-prev.gif)!important;}
+.x-item-disabled .x-tbar-loading{background-image:url(../images/default/grid/loading.gif)!important;}
+.x-item-disabled .x-tbar-page-first{background-image:url(../images/default/grid/page-first-disabled.gif)!important;}
+.x-item-disabled .x-tbar-page-last{background-image:url(../images/default/grid/page-last-disabled.gif)!important;}
+.x-item-disabled .x-tbar-page-next{background-image:url(../images/default/grid/page-next-disabled.gif)!important;}
+.x-item-disabled .x-tbar-page-prev{background-image:url(../images/default/grid/page-prev-disabled.gif)!important;}
+.x-paging-info{position:absolute;top:5px;right:8px;color:#444;}
+.x-statusbar .x-status-text{height:21px;line-height:21px;padding:0 4px;cursor:default;}
+.x-statusbar .x-status-busy{padding-left:25px;background:transparent url(../images/default/grid/loading.gif) no-repeat 3px 3px;}
+.x-statusbar .x-status-text-panel{border-top:1px solid #99BBE8;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #99BBE8;padding:2px 8px 2px 5px;}
+
+.x-resizable-handle{position:absolute;z-index:100;font-size:1px;line-height:6px;overflow:hidden;background:white;filter:alpha(opacity=0);opacity:0;zoom:1;}
+.x-resizable-handle-east{width:6px;cursor:e-resize;right:0;top:0;height:100%;}
+.ext-ie .x-resizable-handle-east{margin-right:-1px;}
+.x-resizable-handle-south{width:100%;cursor:s-resize;left:0;bottom:0;height:6px;}
+.ext-ie .x-resizable-handle-south{margin-bottom:-1px;}
+.x-resizable-handle-west{width:6px;cursor:w-resize;left:0;top:0;height:100%;}
+.x-resizable-handle-north{width:100%;cursor:n-resize;left:0;top:0;height:6px;}
+.x-resizable-handle-southeast{width:6px;cursor:se-resize;right:0;bottom:0;height:6px;z-index:101;}
+.x-resizable-handle-northwest{width:6px;cursor:nw-resize;left:0;top:0;height:6px;z-index:101;}
+.x-resizable-handle-northeast{width:6px;cursor:ne-resize;right:0;top:0;height:6px;z-index:101;}
+.x-resizable-handle-southwest{width:6px;cursor:sw-resize;left:0;bottom:0;height:6px;z-index:101;}
+.x-resizable-over .x-resizable-handle,.x-resizable-pinned .x-resizable-handle{filter:alpha(opacity=100);opacity:1;}
+.x-resizable-over .x-resizable-handle-east,.x-resizable-pinned .x-resizable-handle-east{background:url(../images/default/sizer/e-handle.gif);background-position:left;}
+.x-resizable-over .x-resizable-handle-west,.x-resizable-pinned .x-resizable-handle-west{background:url(../images/default/sizer/e-handle.gif);background-position:left;}
+.x-resizable-over .x-resizable-handle-south,.x-resizable-pinned .x-resizable-handle-south{background:url(../images/default/sizer/s-handle.gif);background-position:top;}
+.x-resizable-over .x-resizable-handle-north,.x-resizable-pinned .x-resizable-handle-north{background:url(../images/default/sizer/s-handle.gif);background-position:top;}
+.x-resizable-over .x-resizable-handle-southeast,.x-resizable-pinned .x-resizable-handle-southeast{background:url(../images/default/sizer/se-handle.gif);background-position:top left;}
+.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{background:url(../images/default/sizer/nw-handle.gif);background-position:bottom right;}
+.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{background:url(../images/default/sizer/ne-handle.gif);background-position:bottom left;}
+.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{background:url(../images/default/sizer/sw-handle.gif);background-position:top right;}
+.x-resizable-proxy{border:1px dashed #3b5a82;position:absolute;overflow:hidden;display:none;left:0;top:0;z-index:50000;}
+.x-resizable-overlay{width:100%;height:100%;display:none;position:absolute;left:0;top:0;background:white;z-index:200000;-moz-opacity:0;opacity:0;filter:alpha(opacity=0);}
+
+ .x-grid3{position:relative;overflow:hidden;background-color:#fff;}
+.x-grid-panel .x-panel-body{overflow:hidden!important;}
+.x-grid-panel .x-panel-mc .x-panel-body{border:1px solid #99bbe8;}
+.x-grid3 table{table-layout:fixed;}
+.x-grid3-viewport{overflow:hidden;}
+.x-grid3-hd-row td,.x-grid3-row td,.x-grid3-summary-row td{font:normal 11px arial,tahoma,helvetica,sans-serif;-moz-outline:none;-moz-user-focus:normal;}
+.x-grid3-row td,.x-grid3-summary-row td{line-height:13px;vertical-align:top;padding-left:1px;padding-right:1px;-moz-user-select:none;}
+.x-grid3-hd-row td{line-height:15px;vertical-align:middle;border-left:1px solid #eee;border-right:1px solid #d0d0d0;}
+.x-grid3-hd-row .x-grid3-marker-hd{padding:3px;}
+.x-grid3-row .x-grid3-marker{padding:3px;}
+.x-grid3-cell-inner,.x-grid3-hd-inner{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;padding:3px 3px 3px 5px;white-space:nowrap;}
+.x-grid3-hd-inner{position:relative;cursor:inherit;padding:4px 3px 4px 5px;}
+.x-grid3-row-body{white-space:normal;}
+.x-grid3-body-cell{-moz-outline:0 none;outline:0 none;}
+.ext-ie .x-grid3-cell-inner,.ext-ie .x-grid3-hd-inner{width:100%;}
+.ext-strict .x-grid3-cell-inner,.ext-strict .x-grid3-hd-inner{width:auto;}
+.x-grid-row-loading{background:#fff url(../images/default/shared/loading-balls.gif) no-repeat center center;}
+.x-grid-page{overflow:hidden;}
+.x-grid3-row{cursor:default;border:1px solid #ededed;border-top-color:#fff;width:100%;}
+.x-grid3-row-alt{background-color:#fafafa;}
+.x-grid3-row-over{border:1px solid #ddd;background:#efefef url(../images/default/grid/row-over.gif) repeat-x left top;}
+.x-grid3-resize-proxy{width:1px;left:0;background-color:#777;cursor:e-resize;cursor:col-resize;position:absolute;top:0;height:100px;overflow:hidden;visibility:hidden;border:0 none;z-index:7;}
+.x-grid3-resize-marker{width:1px;left:0;background-color:#777;position:absolute;top:0;height:100px;overflow:hidden;visibility:hidden;border:0 none;z-index:7;}
+.x-grid3-focus{position:absolute;left:0;top:0;width:1px;height:1px;line-height:1px;font-size:1px;-moz-outline:0 none;outline:0 none;-moz-user-select:text;-khtml-user-select:text;}
+.x-grid3-header{background:#f9f9f9 url(../images/default/grid/grid3-hrow.gif) repeat-x 0 bottom;cursor:default;zoom:1;padding:1px 0 0 0;}
+.x-grid3-header-pop{border-left:1px solid #d0d0d0;float:right;clear:none;}
+.x-grid3-header-pop-inner{border-left:1px solid #eee;width:14px;height:19px;background:transparent url(../images/default/grid/hd-pop.gif) no-repeat center center;}
+.ext-ie .x-grid3-header-pop-inner{width:15px;}
+.ext-strict .x-grid3-header-pop-inner{width:14px;}
+.x-grid3-header-inner{overflow:hidden;zoom:1;float:left;}
+.x-grid3-header-offset{padding-left:1px;width:10000px;}
+td.x-grid3-hd-over,td.sort-desc,td.sort-asc,td.x-grid3-hd-menu-open{border-left:1px solid #aaccf6;border-right:1px solid #aaccf6;}
+td.x-grid3-hd-over .x-grid3-hd-inner,td.sort-desc .x-grid3-hd-inner,td.sort-asc .x-grid3-hd-inner,td.x-grid3-hd-menu-open .x-grid3-hd-inner{background:#ebf3fd url(../images/default/grid/grid3-hrow-over.gif) repeat-x left bottom;}
+.x-grid3-sort-icon{background-repeat:no-repeat;display:none;height:4px;width:13px;margin-left:3px;vertical-align:middle;}
+.sort-asc .x-grid3-sort-icon{background-image:url(../images/default/grid/sort_asc.gif);display:inline;}
+.sort-desc .x-grid3-sort-icon{background-image:url(../images/default/grid/sort_desc.gif);display:inline;}
+.ext-strict .ext-ie .x-grid3-header-inner{position:relative;}
+.ext-strict .ext-ie6 .x-grid3-hd{position:relative;}
+.ext-strict .ext-ie6 .x-grid3-hd-inner{position:static;}
+.x-grid3-body{zoom:1;}
+.x-grid3-scroller{overflow:auto;zoom:1;position:relative;}
+.x-grid3-cell-text,.x-grid3-hd-text{display:block;padding:3px 5px 3px 5px;-moz-user-select:none;-khtml-user-select:none;color:black;}
+.x-grid3-split{background-image:url(../images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;cursor:e-resize;cursor:col-resize;display:block;font-size:1px;height:16px;overflow:hidden;position:absolute;top:2px;width:6px;z-index:3;}
+.x-grid3-hd-text{color:#15428b;}
+.x-dd-drag-proxy .x-grid3-hd-inner{background:#ebf3fd url(../images/default/grid/grid3-hrow-over.gif) repeat-x left bottom;width:120px;padding:3px;border:1px solid #aaccf6;overflow:hidden;}
+.col-move-top,.col-move-bottom{width:9px;height:9px;position:absolute;top:0;line-height:1px;font-size:1px;overflow:hidden;visibility:hidden;z-index:20000;}
+.col-move-top{background:transparent url(../images/default/grid/col-move-top.gif) no-repeat left top;}
+.col-move-bottom{background:transparent url(../images/default/grid/col-move-bottom.gif) no-repeat left top;}
+.x-grid3-row-selected{background:#DFE8F6!important;border:1px dotted #a3bae9;}
+.x-grid3-cell-selected{background-color:#B8CFEE!important;color:black;}
+.x-grid3-cell-selected span{color:black!important;}
+.x-grid3-cell-selected .x-grid3-cell-text{color:black;}
+.x-grid3-locked td.x-grid3-row-marker,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{background:#ebeadb url(../images/default/grid/grid-hrow.gif) repeat-x 0 bottom!important;vertical-align:middle!important;color:black;padding:0;border-top:1px solid white;border-bottom:none!important;border-right:1px solid #6fa0df!important;text-align:center;}
+.x-grid3-locked td.x-grid3-row-marker div,.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{padding:0 4px;color:#15428b!important;text-align:center;}
+.x-grid3-dirty-cell{background:transparent url(../images/default/grid/dirty.gif) no-repeat 0 0;}
+.x-grid3-topbar,.x-grid3-bottombar{font:normal 11px arial,tahoma,helvetica,sans-serif;overflow:hidden;display:none;zoom:1;position:relative;}
+.x-grid3-topbar .x-toolbar{border-right:0 none;}
+.x-grid3-bottombar .x-toolbar{border-right:0 none;border-bottom:0 none;border-top:1px solid #a9bfd3;}
+.x-props-grid .x-grid3-cell{padding:1px;}
+.x-props-grid .x-grid3-td-name .x-grid3-cell-inner{background:transparent url(../images/default/grid/grid3-special-col-bg.gif) repeat-y -16px!important;padding-left:12px;color:black!important;}
+.x-props-grid .x-grid3-body .x-grid3-td-name{padding:1px;padding-right:0;background:white!important;border:0 none;border-right:1px solid #eee;}
+.xg-hmenu-sort-asc .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-asc.gif);}
+.xg-hmenu-sort-desc .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-desc.gif);}
+.xg-hmenu-lock .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-lock.gif);}
+.xg-hmenu-unlock .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-unlock.gif);}
+.x-grid3-col-dd{border:0 none;padding:0;background:transparent;}
+.x-dd-drag-ghost .x-grid3-dd-wrap{padding:1px 3px 3px 1px;}
+.x-grid3-hd{-moz-user-select:none;}
+.x-grid3-hd-btn{display:none;position:absolute;width:14px;background:#c3daf9 url(../images/default/grid/grid3-hd-btn.gif) no-repeat left center;right:0;top:0;z-index:2;cursor:pointer;}
+.x-grid3-hd-over .x-grid3-hd-btn,.x-grid3-hd-menu-open .x-grid3-hd-btn{display:block;}
+a.x-grid3-hd-btn:hover{background-position:-14px center;}
+.x-grid3-body .x-grid3-td-expander{background:transparent url(../images/default/grid/grid3-special-col-bg.gif) repeat-y right;}
+.x-grid3-body .x-grid3-td-expander .x-grid3-cell-inner{padding:0!important;height:100%;}
+.x-grid3-row-expander{width:100%;height:18px;background-position:4px 2px;background-repeat:no-repeat;background-color:transparent;background-image:url(../images/default/grid/row-expand-sprite.gif);}
+.x-grid3-row-collapsed .x-grid3-row-expander{background-position:4px 2px;}
+.x-grid3-row-expanded .x-grid3-row-expander{background-position:-21px 2px;}
+.x-grid3-row-collapsed .x-grid3-row-body{display:none!important;}
+.x-grid3-row-expanded .x-grid3-row-body{display:block!important;}
+.x-grid3-body .x-grid3-td-checker{background:transparent url(../images/default/grid/grid3-special-col-bg.gif) repeat-y right;}
+.x-grid3-body .x-grid3-td-checker .x-grid3-cell-inner,.x-grid3-header .x-grid3-td-checker .x-grid3-hd-inner{padding:0!important;height:100%;}
+.x-grid3-row-checker,.x-grid3-hd-checker{width:100%;height:18px;background-position:2px 2px;background-repeat:no-repeat;background-color:transparent;background-image:url(../images/default/grid/row-check-sprite.gif);}
+.x-grid3-row .x-grid3-row-checker{background-position:2px 2px;}
+.x-grid3-row-selected .x-grid3-row-checker,.x-grid3-hd-checker-on .x-grid3-hd-checker{background-position:-23px 2px;}
+.x-grid3-hd-checker{background-position:2px 3px;}
+.x-grid3-hd-checker-on .x-grid3-hd-checker{background-position:-23px 3px;}
+.x-grid3-body .x-grid3-td-numberer{background:transparent url(../images/default/grid/grid3-special-col-bg.gif) repeat-y right;}
+.x-grid3-body .x-grid3-td-numberer .x-grid3-cell-inner{padding:3px 5px 0 0!important;text-align:right;color:#444;}
+.x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer,.x-grid3-body .x-grid3-row-selected .x-grid3-td-checker,.x-grid3-body .x-grid3-row-selected .x-grid3-td-expander{background:transparent url(../images/default/grid/grid3-special-col-sel-bg.gif) repeat-y right;}
+.x-grid3-body .x-grid3-check-col-td .x-grid3-cell-inner{padding:1px 0 0 0!important;}
+.x-grid3-check-col{width:100%;height:16px;background-position:center center;background-repeat:no-repeat;background-color:transparent;background-image:url(../images/default/menu/unchecked.gif);}
+.x-grid3-check-col-on{width:100%;height:16px;background-position:center center;background-repeat:no-repeat;background-color:transparent;background-image:url(../images/default/menu/checked.gif);}
+.x-grid-group,.x-grid-group-body,.x-grid-group-hd{zoom:1;}
+.x-grid-group-hd{border-bottom:2px solid #99bbe8;cursor:pointer;padding-top:6px;}
+.x-grid-group-hd div{background:transparent url(../images/default/grid/group-expand-sprite.gif) no-repeat 3px -47px;padding:4px 4px 4px 17px;color:#3764a0;font:bold 11px tahoma,arial,helvetica,sans-serif;}
+.x-grid-group-collapsed .x-grid-group-hd div{background-position:3px 3px;}
+.x-grid-group-collapsed .x-grid-group-body{display:none;}
+.x-group-by-icon{background-image:url(../images/default/grid/group-by.gif);}
+.x-cols-icon{background-image:url(../images/default/grid/columns.gif);}
+.x-show-groups-icon{background-image:url(../images/default/grid/group-by.gif);}
+.ext-ie .x-grid3 .x-editor .x-form-text{position:relative;top:-1px;}
+.ext-ie .x-props-grid .x-editor .x-form-text{position:static;top:0;}
+.x-grid-empty{padding:10px;color:gray;font:normal 11px tahoma,arial,helvetica,sans-serif;}
+.ext-ie7 .x-grid-panel .x-panel-bbar{position:relative;}
+
+.x-dd-drag-proxy{position:absolute;left:0;top:0;visibility:hidden;z-index:15000;}
+.x-dd-drag-ghost{color:black;font:normal 11px arial,helvetica,sans-serif;-moz-opacity:0.85;opacity:.85;filter:alpha(opacity=85);border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #bbb;border-bottom:1px solid #bbb;padding:3px;padding-left:20px;background-color:white;white-space:nowrap;}
+.x-dd-drag-repair .x-dd-drag-ghost{-moz-opacity:0.4;opacity:.4;filter:alpha(opacity=40);border:0 none;padding:0;background-color:transparent;}
+.x-dd-drag-repair .x-dd-drop-icon{visibility:hidden;}
+.x-dd-drop-icon{position:absolute;top:3px;left:3px;display:block;width:16px;height:16px;background-color:transparent;background-position:center;background-repeat:no-repeat;z-index:1;}
+.x-dd-drop-nodrop .x-dd-drop-icon{background-image:url(../images/default/dd/drop-no.gif);}
+.x-dd-drop-ok .x-dd-drop-icon{background-image:url(../images/default/dd/drop-yes.gif);}
+.x-dd-drop-ok-add .x-dd-drop-icon{background-image:url(../images/default/dd/drop-add.gif);}
+.x-view-selector{position:absolute;left:0;top:0;width:0;background:#c3daf9;border:1px dotted #39b;opacity:.5;-moz-opacity:.5;filter:alpha(opacity=50);zoom:1;}
+
+.x-tree .x-panel-body{background-color:#fff;}
+.ext-strict .ext-ie .x-tree .x-panel-bwrap{position:relative;overflow:hidden;}
+.x-tree-icon,.x-tree-ec-icon,.x-tree-elbow-line,.x-tree-elbow,.x-tree-elbow-end,.x-tree-elbow-plus,.x-tree-elbow-minus,.x-tree-elbow-end-plus,.x-tree-elbow-end-minus{border:0 none;height:18px;margin:0;padding:0;vertical-align:top;width:16px;background-repeat:no-repeat;}
+.x-tree-node-collapsed .x-tree-node-icon,.x-tree-node-expanded .x-tree-node-icon,.x-tree-node-leaf .x-tree-node-icon{border:0 none;height:18px;margin:0;padding:0;vertical-align:top;width:16px;background-position:center;background-repeat:no-repeat;}
+.ext-ie .x-tree-node-indent img,.ext-ie .x-tree-node-icon,.ext-ie .x-tree-ec-icon{vertical-align:middle!important;}
+.x-tree-node-expanded .x-tree-node-icon{background-image:url(../images/default/tree/folder-open.gif);}
+.x-tree-node-leaf .x-tree-node-icon{background-image:url(../images/default/tree/leaf.gif);}
+.x-tree-node-collapsed .x-tree-node-icon{background-image:url(../images/default/tree/folder.gif);}
+.ext-ie input.x-tree-node-cb{width:15px;height:15px;}
+input.x-tree-node-cb{margin-left:1px;}
+.ext-ie input.x-tree-node-cb{margin-left:0;}
+.x-tree-noicon .x-tree-node-icon{width:0;height:0;}
+.x-tree-node-loading .x-tree-node-icon{background-image:url(../images/default/tree/loading.gif)!important;}
+.x-tree-node-loading a span{font-style:italic;color:#444;}
+.ext-ie .x-tree-node-el input{width:15px;height:15px;}
+.x-tree-lines .x-tree-elbow{background-image:url(../images/default/tree/elbow.gif);}
+.x-tree-lines .x-tree-elbow-plus{background-image:url(../images/default/tree/elbow-plus.gif);}
+.x-tree-lines .x-tree-elbow-minus{background-image:url(../images/default/tree/elbow-minus.gif);}
+.x-tree-lines .x-tree-elbow-end{background-image:url(../images/default/tree/elbow-end.gif);}
+.x-tree-lines .x-tree-elbow-end-plus{background-image:url(../images/default/tree/elbow-end-plus.gif);}
+.x-tree-lines .x-tree-elbow-end-minus{background-image:url(../images/default/tree/elbow-end-minus.gif);}
+.x-tree-lines .x-tree-elbow-line{background-image:url(../images/default/tree/elbow-line.gif);}
+.x-tree-no-lines .x-tree-elbow{background:transparent;}
+.x-tree-no-lines .x-tree-elbow-plus{background-image:url(../images/default/tree/elbow-plus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-minus{background-image:url(../images/default/tree/elbow-minus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-end{background:transparent;}
+.x-tree-no-lines .x-tree-elbow-end-plus{background-image:url(../images/default/tree/elbow-end-plus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-end-minus{background-image:url(../images/default/tree/elbow-end-minus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-line{background:transparent;}
+.x-tree-arrows .x-tree-elbow{background:transparent;}
+.x-tree-arrows .x-tree-elbow-plus{background:transparent url(../images/default/tree/arrows.gif) no-repeat 0 0;}
+.x-tree-arrows .x-tree-elbow-minus{background:transparent url(../images/default/tree/arrows.gif) no-repeat -16px 0;}
+.x-tree-arrows .x-tree-elbow-end{background:transparent;}
+.x-tree-arrows .x-tree-elbow-end-plus{background:transparent url(../images/default/tree/arrows.gif) no-repeat 0 0;}
+.x-tree-arrows .x-tree-elbow-end-minus{background:transparent url(../images/default/tree/arrows.gif) no-repeat -16px 0;}
+.x-tree-arrows .x-tree-elbow-line{background:transparent;}
+.x-tree-arrows .x-tree-ec-over .x-tree-elbow-plus{background-position:-32px 0;}
+.x-tree-arrows .x-tree-ec-over .x-tree-elbow-minus{background-position:-48px 0;}
+.x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-plus{background-position:-32px 0;}
+.x-tree-arrows .x-tree-ec-over .x-tree-elbow-end-minus{background-position:-48px 0;}
+.x-tree-elbow-plus,.x-tree-elbow-minus,.x-tree-elbow-end-plus,.x-tree-elbow-end-minus{cursor:pointer;}
+.ext-ie ul.x-tree-node-ct{font-size:0;line-height:0;zoom:1;}
+.x-tree-node{color:black;font:normal 11px arial,tahoma,helvetica,sans-serif;white-space:nowrap;}
+.x-tree-node-el{line-height:18px;cursor:pointer;}
+.x-tree-node a,.x-dd-drag-ghost a{text-decoration:none;color:black;-khtml-user-select:none;-moz-user-select:none;-kthml-user-focus:normal;-moz-user-focus:normal;-moz-outline:0 none;outline:0 none;}
+.x-tree-node a span,.x-dd-drag-ghost a span{text-decoration:none;color:black;padding:1px 3px 1px 2px;}
+.x-tree-node .x-tree-node-disabled a span{color:gray!important;}
+.x-tree-node .x-tree-node-disabled .x-tree-node-icon{-moz-opacity:0.5;opacity:.5;filter:alpha(opacity=50);}
+.x-tree-node .x-tree-node-inline-icon{background:transparent;}
+.x-tree-node a:hover,.x-dd-drag-ghost a:hover{text-decoration:none;}
+.x-tree-node div.x-tree-drag-insert-below{border-bottom:1px dotted #36c;}
+.x-tree-node div.x-tree-drag-insert-above{border-top:1px dotted #36c;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{border-bottom:0 none;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{border-top:0 none;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{border-bottom:2px solid #36c;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{border-top:2px solid #36c;}
+.x-tree-node .x-tree-drag-append a span{background:#ddd;border:1px dotted gray;}
+.x-tree-node .x-tree-node-over{background-color:#eee;}
+.x-tree-node .x-tree-selected{background-color:#d9e8fb;}
+.x-dd-drag-ghost .x-tree-node-indent,.x-dd-drag-ghost .x-tree-ec-icon{display:none!important;}
+.x-tree-drop-ok-append .x-dd-drop-icon{background-image:url(../images/default/tree/drop-add.gif);}
+.x-tree-drop-ok-above .x-dd-drop-icon{background-image:url(../images/default/tree/drop-over.gif);}
+.x-tree-drop-ok-below .x-dd-drop-icon{background-image:url(../images/default/tree/drop-under.gif);}
+.x-tree-drop-ok-between .x-dd-drop-icon{background-image:url(../images/default/tree/drop-between.gif);}
+.x-tree-root-ct{zoom:1;}
+
+.x-date-picker{border:1px solid #1b376c;border-top:0 none;background:#fff;position:relative;}
+.x-date-picker a{-moz-outline:0 none;outline:0 none;}
+.x-date-inner,.x-date-inner td,.x-date-inner th{border-collapse:separate;}
+.x-date-middle,.x-date-left,.x-date-right{background:url(../images/default/shared/hd-sprite.gif) repeat-x 0 -83px;color:#FFF;font:bold 11px "sans serif",tahoma,verdana,helvetica;overflow:hidden;}
+.x-date-middle .x-btn-left,.x-date-middle .x-btn-center,.x-date-middle .x-btn-right{background:transparent!important;vertical-align:middle;}
+.x-date-middle .x-btn .x-btn-text{color:#fff;}
+.x-date-middle .x-btn-with-menu .x-btn-center em{background:transparent url(../images/default/toolbar/btn-arrow-light.gif) no-repeat right 0;}
+.x-date-right,.x-date-left{width:18px;}
+.x-date-right{text-align:right;}
+.x-date-middle{padding-top:2px;padding-bottom:2px;width:130px;}
+.x-date-right a,.x-date-left a{display:block;width:16px;height:16px;background-position:center;background-repeat:no-repeat;cursor:pointer;-moz-opacity:0.6;opacity:.6;filter:alpha(opacity=60);}
+.x-date-right a:hover,.x-date-left a:hover{-moz-opacity:1;opacity:1;filter:alpha(opacity=100);}
+.x-date-right a{background-image:url(../images/default/shared/right-btn.gif);margin-right:2px;text-decoration:none!important;}
+.x-date-left a{background-image:url(../images/default/shared/left-btn.gif);margin-left:2px;text-decoration:none!important;}
+table.x-date-inner{width:100%;table-layout:fixed;}
+.x-date-inner th{width:25px;}
+.x-date-inner th{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;text-align:right!important;border-bottom:1px solid #a3bad9;font:normal 10px arial,helvetica,tahoma,sans-serif;color:#233d6d;cursor:default;padding:0;border-collapse:separate;}
+.x-date-inner th span{display:block;padding:2px;padding-right:7px;}
+.x-date-inner td{border:1px solid #fff;text-align:right;padding:0;}
+.x-date-inner a{padding:2px 5px;display:block;font:normal 11px arial,helvetica,tahoma,sans-serif;text-decoration:none;color:black;text-align:right;zoom:1;}
+.x-date-inner .x-date-active{cursor:pointer;color:black;}
+.x-date-inner .x-date-selected a{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;border:1px solid #8db2e3;padding:1px 4px;}
+.x-date-inner .x-date-today a{border:1px solid darkred;padding:1px 4px;}
+.x-date-inner .x-date-selected span{font-weight:bold;}
+.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a{color:#aaa;text-decoration:none!important;}
+.x-date-bottom{padding:4px;border-top:1px solid #a3bad9;background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;}
+.x-date-inner a:hover,.x-date-inner .x-date-disabled a:hover{text-decoration:none!important;color:black;background:#ddecfe;}
+.x-date-inner .x-date-disabled a{cursor:default;background:#eee;color:#bbb;}
+.x-date-mmenu{background:#eee!important;}
+.x-date-mmenu .x-menu-item{font-size:10px;padding:1px 24px 1px 4px;white-space:nowrap;color:#000;}
+.x-date-mmenu .x-menu-item .x-menu-item-icon{width:10px;height:10px;margin-right:5px;background-position:center -4px!important;}
+.x-date-mp{position:absolute;left:0;top:0;background:white;display:none;}
+.x-date-mp td{padding:2px;font:normal 11px arial,helvetica,tahoma,sans-serif;}
+td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn{border:0 none;text-align:center;vertical-align:middle;width:25%;}
+.x-date-mp-ok{margin-right:3px;}
+.x-date-mp-btns button{text-decoration:none;text-align:center;text-decoration:none!important;background:#083772;color:white;border:1px solid;border-color:#36c #005 #005 #36c;padding:1px 3px 1px;font:normal 11px arial,helvetica,tahoma,sans-serif;cursor:pointer;}
+.x-date-mp-btns{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;}
+.x-date-mp-btns td{border-top:1px solid #c5d2df;text-align:center;}
+td.x-date-mp-month a,td.x-date-mp-year a{display:block;padding:2px 4px;text-decoration:none;text-align:center;color:#15428b;}
+td.x-date-mp-month a:hover,td.x-date-mp-year a:hover{color:#15428b;text-decoration:none;cursor:pointer;background:#ddecfe;}
+td.x-date-mp-sel a{padding:1px 3px;background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;border:1px solid #8db2e3;}
+.x-date-mp-ybtn a{overflow:hidden;width:15px;height:15px;cursor:pointer;background:transparent url(../images/default/panel/tool-sprites.gif) no-repeat;display:block;margin:0 auto;}
+.x-date-mp-ybtn a.x-date-mp-next{background-position:0 -120px;}
+.x-date-mp-ybtn a.x-date-mp-next:hover{background-position:-15px -120px;}
+.x-date-mp-ybtn a.x-date-mp-prev{background-position:0 -105px;}
+.x-date-mp-ybtn a.x-date-mp-prev:hover{background-position:-15px -105px;}
+.x-date-mp-ybtn{text-align:center;}
+td.x-date-mp-sep{border-right:1px solid #c5d2df;}
+
+.x-tip{position:absolute;top:0;left:0;visibility:hidden;z-index:20000;border:0 none;}
+.x-tip .x-tip-close{background-image:url(../images/default/qtip/close.gif);height:15px;float:right;width:15px;margin:0 0 2px 2px;cursor:pointer;display:none;}
+.x-tip .x-tip-tc{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -62px;padding-top:3px;overflow:hidden;zoom:1;}
+.x-tip .x-tip-tl{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 0;padding-left:6px;overflow:hidden;zoom:1;}
+.x-tip .x-tip-tr{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right 0;padding-right:6px;overflow:hidden;zoom:1;}
+.x-tip .x-tip-bc{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -121px;height:3px;overflow:hidden;}
+.x-tip .x-tip-bl{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -59px;padding-left:6px;zoom:1;}
+.x-tip .x-tip-br{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right -59px;padding-right:6px;zoom:1;}
+.x-tip .x-tip-mc{border:0 none;font:normal 11px tahoma,arial,helvetica,sans-serif;}
+.x-tip .x-tip-ml{background:#fff url(../images/default/qtip/tip-sprite.gif) no-repeat 0 -124px;padding-left:6px;zoom:1;}
+.x-tip .x-tip-mr{background:transparent url(../images/default/qtip/tip-sprite.gif) no-repeat right -124px;padding-right:6px;zoom:1;}
+.ext-ie .x-tip .x-tip-header,.ext-ie .x-tip .x-tip-tc{font-size:0;line-height:0;}
+.x-tip .x-tip-header-text{font:bold 11px tahoma,arial,helvetica,sans-serif;padding:0;margin:0 0 2px 0;color:#444;}
+.x-tip .x-tip-body{font:normal 11px tahoma,arial,helvetica,sans-serif;margin:0!important;line-height:14px;color:#444;padding:0;}
+.x-tip .x-tip-body .loading-indicator{margin:0;}
+.x-tip-draggable .x-tip-header,.x-tip-draggable .x-tip-header-text{cursor:move;}
+.x-form-invalid-tip .x-tip-tc{background:url(../images/default/form/error-tip-corners.gif) repeat-x 0 -12px;padding-top:6px;}
+.x-form-invalid-tip .x-tip-tl{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-tr{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-bc{background:url(../images/default/form/error-tip-corners.gif) repeat-x 0 -18px;height:6px;}
+.x-form-invalid-tip .x-tip-bl{background:url(../images/default/form/error-tip-corners.gif) no-repeat 0 -6px;}
+.x-form-invalid-tip .x-tip-br{background:url(../images/default/form/error-tip-corners.gif) no-repeat right -6px;}
+.x-form-invalid-tip .x-tip-ml{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-mr{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-body{padding:2px;}
+.x-form-invalid-tip .x-tip-body{padding-left:24px;background:transparent url(../images/default/form/exclamation.gif) no-repeat 2px 2px;}
+
+.x-menu{border:1px solid #718bb7;z-index:15000;zoom:1;background:#f0f0f0 url(../images/default/menu/menu.gif) repeat-y;padding:2px;}
+.x-menu a{text-decoration:none!important;}
+.ext-ie .x-menu{zoom:1;overflow:hidden;}
+.x-menu-list{background:transparent;border:0 none;}
+.x-menu li{line-height:100%;}
+.x-menu li.x-menu-sep-li{font-size:1px;line-height:1px;}
+.x-menu-list-item{font:normal 11px tahoma,arial,sans-serif;white-space:nowrap;-moz-user-select:none;-khtml-user-select:none;display:block;padding:1px;}
+.x-menu-item-arrow{background:transparent url(../images/default/menu/menu-parent.gif) no-repeat right;}
+.x-menu-sep{display:block;font-size:1px;line-height:1px;margin:2px 3px;background-color:#e0e0e0;border-bottom:1px solid #fff;overflow:hidden;}
+.x-menu-focus{position:absolute;left:-1px;top:-1px;width:1px;height:1px;line-height:1px;font-size:1px;-moz-outline:0 none;outline:0 none;-moz-user-select:text;-khtml-user-select:text;overflow:hidden;display:block;}
+.x-menu a.x-menu-item{display:block;line-height:16px;padding:3px 21px 3px 3px;white-space:nowrap;text-decoration:none;color:#222;-moz-outline:0 none;outline:0 none;cursor:pointer;}
+.x-menu-item-active{background:#ebf3fd url(../images/default/menu/item-over.gif) repeat-x left bottom;border:1px solid #aaccf6;padding:0;}
+.x-menu-item-active a.x-menu-item{color:#233d6d;}
+.x-menu-item-icon{border:0 none;height:16px;padding:0;vertical-align:top;width:16px;margin:0 8px 0 0;background-position:center;}
+.x-menu-check-item .x-menu-item-icon{background:transparent url(../images/default/menu/unchecked.gif) no-repeat center;}
+.x-menu-item-checked .x-menu-item-icon{background-image:url(../images/default/menu/checked.gif);}
+.x-menu-group-item .x-menu-item-icon{background:transparent;}
+.x-menu-item-checked .x-menu-group-item .x-menu-item-icon{background:transparent url(../images/default/menu/group-checked.gif) no-repeat center;}
+.x-menu-plain{background:#fff!important;}
+.x-menu-date-item{padding:0;}
+.x-menu .x-color-palette,.x-menu .x-date-picker{margin-left:26px;margin-right:4px;}
+.x-menu .x-date-picker{border:1px solid #a3bad9;margin-top:2px;margin-bottom:2px;}
+.x-menu-plain .x-color-palette,.x-menu-plain .x-date-picker{margin:0;border:0 none;}
+.x-date-menu{padding:0!important;}
+.x-cycle-menu .x-menu-item-checked{border:1px dotted #a3bae9!important;background:#DFE8F6;padding:0;}
+
+ .x-box-tl{background:transparent url(../images/default/box/corners.gif) no-repeat 0 0;zoom:1;}
+.x-box-tc{height:8px;background:transparent url(../images/default/box/tb.gif) repeat-x 0 0;overflow:hidden;}
+.x-box-tr{background:transparent url(../images/default/box/corners.gif) no-repeat right -8px;}
+.x-box-ml{background:transparent url(../images/default/box/l.gif) repeat-y 0;padding-left:4px;overflow:hidden;zoom:1;}
+.x-box-mc{background:#eee url(../images/default/box/tb.gif) repeat-x 0 -16px;padding:4px 10px;font-family:"Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;color:#393939;font-size:12px;}
+.x-box-mc h3{font-size:14px;font-weight:bold;margin:0 0 4px 0;zoom:1;}
+.x-box-mr{background:transparent url(../images/default/box/r.gif) repeat-y right;padding-right:4px;overflow:hidden;}
+.x-box-bl{background:transparent url(../images/default/box/corners.gif) no-repeat 0 -16px;zoom:1;}
+.x-box-bc{background:transparent url(../images/default/box/tb.gif) repeat-x 0 -8px;height:8px;overflow:hidden;}
+.x-box-br{background:transparent url(../images/default/box/corners.gif) no-repeat right -24px;}
+.x-box-tl,.x-box-bl{padding-left:8px;overflow:hidden;}
+.x-box-tr,.x-box-br{padding-right:8px;overflow:hidden;}
+.x-box-blue .x-box-bl,.x-box-blue .x-box-br,.x-box-blue .x-box-tl,.x-box-blue .x-box-tr{background-image:url(../images/default/box/corners-blue.gif);}
+.x-box-blue .x-box-bc,.x-box-blue .x-box-mc,.x-box-blue .x-box-tc{background-image:url(../images/default/box/tb-blue.gif);}
+.x-box-blue .x-box-mc{background-color:#c3daf9;}
+.x-box-blue .x-box-mc h3{color:#17385b;}
+.x-box-blue .x-box-ml{background-image:url(../images/default/box/l-blue.gif);}
+.x-box-blue .x-box-mr{background-image:url(../images/default/box/r-blue.gif);}
+
+#x-debug-browser .x-tree .x-tree-node a span{color:#222297;font-size:11px;padding-top:2px;font-family:"monotype","courier new",sans-serif;line-height:18px;}
+#x-debug-browser .x-tree a i{color:#FF4545;font-style:normal;}
+#x-debug-browser .x-tree a em{color:#999;}
+#x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{background:#c3daf9;}
+#x-debug-browser .x-tool-toggle{background-position:0 -75px;}
+#x-debug-browser .x-tool-toggle-over{background-position:-15px -75px;}
+#x-debug-browser.x-panel-collapsed .x-tool-toggle{background-position:0 -60px;}
+#x-debug-browser.x-panel-collapsed .x-tool-toggle-over{background-position:-15px -60px;}
+
+.x-combo-list{border:1px solid #98c0f4;background:#ddecfe;zoom:1;overflow:hidden;}
+.x-combo-list-inner{overflow:auto;background:white;position:relative;zoom:1;overflow-x:hidden;}
+.x-combo-list-hd{font:bold 11px tahoma,arial,helvetica,sans-serif;color:#15428b;background-image:url(../images/default/layout/panel-title-light-bg.gif);border-bottom:1px solid #98c0f4;padding:3px;}
+.x-resizable-pinned .x-combo-list-inner{border-bottom:1px solid #98c0f4;}
+.x-combo-list-item{font:normal 12px tahoma,arial,helvetica,sans-serif;padding:2px;border:1px solid #fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
+.x-combo-list .x-combo-selected{border:1px dotted #a3bae9!important;background:#DFE8F6;cursor:pointer;}
+.x-combo-noedit{cursor:pointer;}
+.x-combo-list .x-toolbar{border-top:1px solid #98c0f4;border-bottom:0 none;}
+.x-combo-list-small .x-combo-list-item{font:normal 11px tahoma,arial,helvetica,sans-serif;}
+
+.x-panel{border-style:solid;border-color:#99bbe8;border-width:0;}
+.x-panel-header{overflow:hidden;zoom:1;color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;padding:5px 3px 4px 5px;border:1px solid #99bbe8;line-height:15px;background:transparent url(../images/default/panel/white-top-bottom.gif) repeat-x 0 -1px;}
+.x-panel-body{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;background:white;position:relative;}
+.x-panel-bbar .x-toolbar{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;padding:2px;}
+.x-panel-tbar .x-toolbar{border:1px solid #99bbe8;border-top:0 none;overflow:hidden;padding:2px;}
+.x-panel-tbar-noheader .x-toolbar,.x-panel-mc .x-panel-tbar .x-toolbar{border-top:1px solid #99bbe8;border-bottom:0 none;}
+.x-panel-body-noheader,.x-panel-mc .x-panel-body{border-top:1px solid #99bbe8;}
+.x-panel-header{overflow:hidden;zoom:1;}
+.x-panel-tl .x-panel-header{color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;padding:5px 0 4px 0;border:0 none;background:transparent;}
+.x-panel-tl .x-panel-icon,.x-window-tl .x-panel-icon{padding-left:20px!important;background-repeat:no-repeat;background-position:0 4px;zoom:1;}
+.x-panel-inline-icon{width:16px;height:16px;background-repeat:no-repeat;background-position:0 0;vertical-align:middle;margin-right:4px;margin-top:-1px;margin-bottom:-1px;}
+.x-panel-tc{background:transparent url(../images/default/panel/top-bottom.gif) repeat-x 0 0;overflow:hidden;}
+.ext-strict .ext-ie7 .x-panel-tc{overflow:visible;}
+.x-panel-tl{background:transparent url(../images/default/panel/corners-sprite.gif) no-repeat 0 0;padding-left:6px;zoom:1;border-bottom:1px solid #99bbe8;}
+.x-panel-tr{background:transparent url(../images/default/panel/corners-sprite.gif) no-repeat right 0;zoom:1;padding-right:6px;}
+.x-panel-bc{background:transparent url(../images/default/panel/top-bottom.gif) repeat-x 0 bottom;zoom:1;}
+.x-panel-bc .x-panel-footer{zoom:1;}
+.x-panel-bl{background:transparent url(../images/default/panel/corners-sprite.gif) no-repeat 0 bottom;padding-left:6px;zoom:1;}
+.x-panel-br{background:transparent url(../images/default/panel/corners-sprite.gif) no-repeat right bottom;padding-right:6px;zoom:1;}
+.x-panel-mc{border:0 none;padding:0;margin:0;font:normal 11px tahoma,arial,helvetica,sans-serif;padding-top:6px;background:#dfe8f6;}
+.x-panel-mc .x-panel-body{background:transparent;border:0 none;}
+.x-panel-ml{background:#fff url(../images/default/panel/left-right.gif) repeat-y 0 0;padding-left:6px;zoom:1;}
+.x-panel-mr{background:transparent url(../images/default/panel/left-right.gif) repeat-y right 0;padding-right:6px;zoom:1;}
+.x-panel-bc .x-panel-footer{padding-bottom:6px;}
+.x-panel-nofooter .x-panel-bc,.x-panel-nofooter .x-window-bc{height:6px;font-size:0;line-height:0;}
+.x-panel-bwrap{overflow:hidden;zoom:1;left:0;top:0;}
+.x-panel-body{overflow:hidden;zoom:1;}
+.x-panel-collapsed .x-resizable-handle{display:none;}
+.ext-gecko .x-panel-animated div{overflow:hidden!important;}
+.x-plain-body{overflow:hidden;}
+.x-plain-bbar .x-toolbar{overflow:hidden;padding:2px;}
+.x-plain-tbar .x-toolbar{overflow:hidden;padding:2px;}
+.x-plain-bwrap{overflow:hidden;zoom:1;}
+.x-plain{overflow:hidden;}
+.x-tool{overflow:hidden;width:15px;height:15px;float:right;cursor:pointer;background:transparent url(../images/default/panel/tool-sprites.gif) no-repeat;margin-left:2px;}
+.x-tool-toggle{background-position:0 -60px;}
+.x-tool-toggle-over{background-position:-15px -60px;}
+.x-panel-collapsed .x-tool-toggle{background-position:0 -75px;}
+.x-panel-collapsed .x-tool-toggle-over{background-position:-15px -75px;}
+.x-tool-close{background-position:0 -0;}
+.x-tool-close-over{background-position:-15px 0;}
+.x-tool-minimize{background-position:0 -15px;}
+.x-tool-minimize-over{background-position:-15px -15px;}
+.x-tool-maximize{background-position:0 -30px;}
+.x-tool-maximize-over{background-position:-15px -30px;}
+.x-tool-restore{background-position:0 -45px;}
+.x-tool-restore-over{background-position:-15px -45px;}
+.x-tool-gear{background-position:0 -90px;}
+.x-tool-gear-over{background-position:-15px -90px;}
+.x-tool-pin{background-position:0 -135px;}
+.x-tool-pin-over{background-position:-15px -135px;}
+.x-tool-unpin{background-position:0 -150px;}
+.x-tool-unpin-over{background-position:-15px -150px;}
+.x-tool-right{background-position:0 -165px;}
+.x-tool-right-over{background-position:-15px -165px;}
+.x-tool-left{background-position:0 -180px;}
+.x-tool-left-over{background-position:-15px -180px;}
+.x-tool-up{background-position:0 -210px;}
+.x-tool-up-over{background-position:-15px -210px;}
+.x-tool-down{background-position:0 -195px;}
+.x-tool-down-over{background-position:-15px -195px;}
+.x-tool-refresh{background-position:0 -225px;}
+.x-tool-refresh-over{background-position:-15px -225px;}
+.x-tool-minus{background-position:0 -255px;}
+.x-tool-minus-over{background-position:-15px -255px;}
+.x-tool-plus{background-position:0 -240px;}
+.x-tool-plus-over{background-position:-15px -240px;}
+.x-tool-search{background-position:0 -270px;}
+.x-tool-search-over{background-position:-15px -270px;}
+.x-tool-save{background-position:0 -285px;}
+.x-tool-save-over{background-position:-15px -285px;}
+.x-tool-help{background-position:0 -300px;}
+.x-tool-help-over{background-position:-15px -300px;}
+.x-tool-print{background-position:0 -315px;}
+.x-tool-print-over{background-position:-15px -315px;}
+.x-panel-ghost{background:#cbddf3;z-index:12000;overflow:hidden;position:absolute;left:0;top:0;opacity:.65;-moz-opacity:.65;filter:alpha(opacity=65);}
+.x-panel-ghost ul{margin:0;padding:0;overflow:hidden;font-size:0;line-height:0;border:1px solid #99bbe8;border-top:0 none;display:block;}
+.x-panel-ghost *{cursor:move!important;}
+.x-panel-dd-spacer{border:2px dashed #99bbe8;}
+.x-panel-btns-ct{padding:5px;}
+.x-panel-btns-ct .x-btn{float:right;clear:none;}
+.x-panel-btns-ct .x-panel-btns td{border:0;padding:0;}
+.x-panel-btns-ct .x-panel-btns-right table{float:right;clear:none;}
+.x-panel-btns-ct .x-panel-btns-left table{float:left;clear:none;}
+.x-panel-btns-ct .x-panel-btns-center{text-align:center;}
+.x-panel-btns-ct .x-panel-btns-center table{margin:0 auto;}
+.x-panel-btns-ct table td.x-panel-btn-td{padding:3px;}
+.x-panel-btns-ct .x-btn-focus .x-btn-left{background-position:0 -147px;}
+.x-panel-btns-ct .x-btn-focus .x-btn-right{background-position:0 -168px;}
+.x-panel-btns-ct .x-btn-focus .x-btn-center{background-position:0 -189px;}
+.x-panel-btns-ct .x-btn-over .x-btn-left{background-position:0 -63px;}
+.x-panel-btns-ct .x-btn-over .x-btn-right{background-position:0 -84px;}
+.x-panel-btns-ct .x-btn-over .x-btn-center{background-position:0 -105px;}
+.x-panel-btns-ct .x-btn-click .x-btn-center{background-position:0 -126px;}
+.x-panel-btns-ct .x-btn-click .x-btn-right{background-position:0 -84px;}
+.x-panel-btns-ct .x-btn-click .x-btn-left{background-position:0 -63px;}
+
+.x-window{zoom:1;}
+.x-window .x-resizable-handle{opacity:0;-moz-opacity:0;filter:alpha(opacity=0);}
+.x-window-proxy{background:#C7DFFC;border:1px solid #99bbe8;z-index:12000;overflow:hidden;position:absolute;left:0;top:0;display:none;opacity:.5;-moz-opacity:.5;filter:alpha(opacity=50);}
+.x-window-header{overflow:hidden;zoom:1;}
+.x-window-bwrap{z-index:1;position:relative;zoom:1;left:0;top:0;}
+.x-window-tl .x-window-header{color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;padding:5px 0 4px 0;}
+.x-window-header-text{cursor:pointer;}
+.x-window-tc{background:transparent url(../images/default/window/top-bottom.png) repeat-x 0 0;overflow:hidden;zoom:1;}
+.x-window-tl{background:transparent url(../images/default/window/left-corners.png) no-repeat 0 0;padding-left:6px;zoom:1;z-index:1;position:relative;}
+.x-window-tr{background:transparent url(../images/default/window/right-corners.png) no-repeat right 0;padding-right:6px;}
+.x-window-bc{background:transparent url(../images/default/window/top-bottom.png) repeat-x 0 bottom;zoom:1;}
+.x-window-bc .x-window-footer{padding-bottom:6px;zoom:1;font-size:0;line-height:0;}
+.x-window-bl{background:transparent url(../images/default/window/left-corners.png) no-repeat 0 bottom;padding-left:6px;zoom:1;}
+.x-window-br{background:transparent url(../images/default/window/right-corners.png) no-repeat right bottom;padding-right:6px;zoom:1;}
+.x-window-mc{border:1px solid #99bbe8;padding:0;margin:0;font:normal 11px tahoma,arial,helvetica,sans-serif;background:#dfe8f6;}
+.x-window-ml{background:transparent url(../images/default/window/left-right.png) repeat-y 0 0;padding-left:6px;zoom:1;}
+.x-window-mr{background:transparent url(../images/default/window/left-right.png) repeat-y right 0;padding-right:6px;zoom:1;}
+.x-window-body{overflow:hidden;}
+.x-window-bwrap{overflow:hidden;}
+.x-window-maximized .x-window-bl,.x-window-maximized .x-window-br,.x-window-maximized .x-window-ml,.x-window-maximized .x-window-mr,.x-window-maximized .x-window-tl,.x-window-maximized .x-window-tr{padding:0;}
+.x-window-maximized .x-window-footer{padding-bottom:0;}
+.x-window-maximized .x-window-tc{padding-left:3px;padding-right:3px;background-color:white;}
+.x-window-maximized .x-window-mc{border-left:0 none;border-right:0 none;}
+.x-window-tbar .x-toolbar,.x-window-bbar .x-toolbar{border-left:0 none;border-right:0 none;}
+.x-window-bbar .x-toolbar{border-top:1px solid #99bbe8;border-bottom:0 none;}
+.x-window-draggable,.x-window-draggable .x-window-header-text{cursor:move;}
+.x-window-maximized .x-window-draggable,.x-window-maximized .x-window-draggable .x-window-header-text{cursor:default;}
+.x-window-body{background:transparent;}
+.x-panel-ghost .x-window-tl{border-bottom:1px solid #99bbe8;}
+.x-panel-collapsed .x-window-tl{border-bottom:1px solid #84a0c4;}
+.x-window-maximized-ct{overflow:hidden;}
+.x-window-maximized .x-resizable-handle{display:none;}
+.x-window-sizing-ghost ul{border:0 none!important;}
+.x-dlg-focus{-moz-outline:0 none;outline:0 none;width:0;height:0;overflow:hidden;position:absolute;top:0;left:0;}
+.x-dlg-mask{z-index:10000;display:none;position:absolute;top:0;left:0;-moz-opacity:0.5;opacity:.50;filter:alpha(opacity=50);background-color:#CCC;}
+body.ext-ie6.x-body-masked select{visibility:hidden;}
+body.ext-ie6.x-body-masked .x-window select{visibility:visible;}
+.x-window-plain .x-window-mc{background:#CAD9EC;border-right:1px solid #DFE8F6;border-bottom:1px solid #DFE8F6;border-top:1px solid #a3bae9;border-left:1px solid #a3bae9;}
+.x-window-plain .x-window-body{border-left:1px solid #DFE8F6;border-top:1px solid #DFE8F6;border-bottom:1px solid #a3bae9;border-right:1px solid #a3bae9;background:transparent!important;}
+body.x-body-masked .x-window-plain .x-window-mc{background:#C7D6E9;}
+
+.x-html-editor-wrap{border:1px solid #a9bfd3;background:white;}
+.x-html-editor-tb .x-btn-text{background:transparent url(../images/default/editor/tb-sprite.gif) no-repeat;}
+.x-html-editor-tb .x-edit-bold .x-btn-text{background-position:0 0;}
+.x-html-editor-tb .x-edit-italic .x-btn-text{background-position:-16px 0;}
+.x-html-editor-tb .x-edit-underline .x-btn-text{background-position:-32px 0;}
+.x-html-editor-tb .x-edit-forecolor .x-btn-text{background-position:-160px 0;}
+.x-html-editor-tb .x-edit-backcolor .x-btn-text{background-position:-176px 0;}
+.x-html-editor-tb .x-edit-justifyleft .x-btn-text{background-position:-112px 0;}
+.x-html-editor-tb .x-edit-justifycenter .x-btn-text{background-position:-128px 0;}
+.x-html-editor-tb .x-edit-justifyright .x-btn-text{background-position:-144px 0;}
+.x-html-editor-tb .x-edit-insertorderedlist .x-btn-text{background-position:-80px 0;}
+.x-html-editor-tb .x-edit-insertunorderedlist .x-btn-text{background-position:-96px 0;}
+.x-html-editor-tb .x-edit-increasefontsize .x-btn-text{background-position:-48px 0;}
+.x-html-editor-tb .x-edit-decreasefontsize .x-btn-text{background-position:-64px 0;}
+.x-html-editor-tb .x-edit-sourceedit .x-btn-text{background-position:-192px 0;}
+.x-html-editor-tb .x-edit-createlink .x-btn-text{background-position:-208px 0;}
+.x-html-editor-tip .x-tip-bd .x-tip-bd-inner{padding:5px;padding-bottom:1px;}
+.x-html-editor-tb .x-toolbar{position:static!important;}
+
+.x-panel-noborder .x-panel-body-noborder{border-width:0;}
+.x-panel-noborder .x-panel-header-noborder{border-width:0;border-bottom:1px solid #99bbe8;}
+.x-panel-noborder .x-panel-tbar-noborder .x-toolbar{border-width:0;border-bottom:1px solid #99bbe8;}
+.x-panel-noborder .x-panel-bbar-noborder .x-toolbar{border-width:0;border-top:1px solid #99bbe8;}
+.x-window-noborder .x-window-mc{border-width:0;}
+.x-window-plain .x-window-body-noborder{border-width:0;}
+.x-tab-panel-noborder .x-tab-panel-body-noborder{border-width:0;}
+.x-tab-panel-noborder .x-tab-panel-header-noborder{border-top-width:0;border-left-width:0;border-right-width:0;}
+.x-tab-panel-noborder .x-tab-panel-footer-noborder{border-bottom-width:0;border-left-width:0;border-right-width:0;}
+.x-tab-panel-bbar-noborder .x-toolbar{border-width:0;border-top:1px solid #99bbe8;}
+.x-tab-panel-tbar-noborder .x-toolbar{border-width:0;border-bottom:1px solid #99bbe8;}
+
+.x-border-layout-ct{background:#dfe8f6;}
+.x-border-panel{position:absolute;left:0;top:0;}
+.x-tool-collapse-south{background-position:0 -195px;}
+.x-tool-collapse-south-over{background-position:-15px -195px;}
+.x-tool-collapse-north{background-position:0 -210px;}
+.x-tool-collapse-north-over{background-position:-15px -210px;}
+.x-tool-collapse-west{background-position:0 -180px;}
+.x-tool-collapse-west-over{background-position:-15px -180px;}
+.x-tool-collapse-east{background-position:0 -165px;}
+.x-tool-collapse-east-over{background-position:-15px -165px;}
+.x-tool-expand-south{background-position:0 -210px;}
+.x-tool-expand-south-over{background-position:-15px -210px;}
+.x-tool-expand-north{background-position:0 -195px;}
+.x-tool-expand-north-over{background-position:-15px -195px;}
+.x-tool-expand-west{background-position:0 -165px;}
+.x-tool-expand-west-over{background-position:-15px -165px;}
+.x-tool-expand-east{background-position:0 -180px;}
+.x-tool-expand-east-over{background-position:-15px -180px;}
+.x-tool-expand-north,.x-tool-expand-south{float:right;margin:3px;}
+.x-tool-expand-east,.x-tool-expand-west{float:none;margin:3px auto;}
+.x-accordion-hd .x-tool-toggle{background-position:0 -255px;}
+.x-accordion-hd .x-tool-toggle-over{background-position:-15px -255px;}
+.x-panel-collapsed .x-accordion-hd .x-tool-toggle{background-position:0 -240px;}
+.x-panel-collapsed .x-accordion-hd .x-tool-toggle-over{background-position:-15px -240px;}
+.x-accordion-hd{color:#222;padding-top:4px;padding-bottom:3px;border-top:0 none;font-weight:normal;background:transparent url(../images/default/panel/light-hd.gif) repeat-x 0 -9px;}
+.x-layout-collapsed{position:absolute;left:-10000px;top:-10000px;visibility:hidden;background-color:#d2e0f2;width:20px;height:20px;overflow:hidden;border:1px solid #98c0f4;z-index:20;}
+.ext-border-box .x-layout-collapsed{width:22px;height:22px;}
+.x-layout-collapsed-over{cursor:pointer;background-color:#d9e8fb;}
+.x-layout-collapsed-west .x-layout-collapsed-tools,.x-layout-collapsed-east .x-layout-collapsed-tools{position:absolute;top:0;left:0;width:20px;height:20px;}
+.x-layout-split{position:absolute;height:5px;width:5px;line-height:1px;font-size:1px;z-index:3;background-color:transparent;}
+.ext-strict .ext-ie6 .x-layout-split{background-color:#fff!important;filter:alpha(opacity=1);}
+.x-layout-split-h{background-image:url(../images/default/s.gif);background-position:left;}
+.x-layout-split-v{background-image:url(../images/default/s.gif);background-position:top;}
+.x-column-layout-ct{overflow:hidden;zoom:1;}
+.x-column{float:left;padding:0;margin:0;overflow:hidden;zoom:1;}
+.x-layout-mini{position:absolute;top:0;left:0;display:block;width:5px;height:35px;cursor:pointer;opacity:.5;-moz-opacity:.5;filter:alpha(opacity=50);}
+.x-layout-mini-over,.x-layout-collapsed-over .x-layout-mini{opacity:1;-moz-opacity:1;filter:none;}
+.x-layout-split-west .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-left.gif);}
+.x-layout-split-east .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-right.gif);}
+.x-layout-split-north .x-layout-mini{left:48%;height:5px;width:35px;background-image:url(../images/default/layout/mini-top.gif);}
+.x-layout-split-south .x-layout-mini{left:48%;height:5px;width:35px;background-image:url(../images/default/layout/mini-bottom.gif);}
+.x-layout-cmini-west .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-right.gif);}
+.x-layout-cmini-east .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-left.gif);}
+.x-layout-cmini-north .x-layout-mini{left:48%;height:5px;width:35px;background-image:url(../images/default/layout/mini-bottom.gif);}
+.x-layout-cmini-south .x-layout-mini{left:48%;height:5px;width:35px;background-image:url(../images/default/layout/mini-top.gif);}
+.x-layout-cmini-west,.x-layout-cmini-east{border:0 none;width:5px!important;padding:0;background:transparent;}
+.x-layout-cmini-north,.x-layout-cmini-south{border:0 none;height:5px!important;padding:0;background:transparent;}
+.x-viewport,.x-viewport body{margin:0;padding:0;border:0 none;overflow:hidden;height:100%;}
+.x-abs-layout-item{position:absolute;left:0;top:0;}
+.ext-ie input.x-abs-layout-item,.ext-ie textarea.x-abs-layout-item{margin:0;}
+
+.x-progress-wrap{border:1px solid #6593cf;overflow:hidden;}
+.x-progress-inner{height:18px;background:#e0e8f3 url(../images/default/qtip/bg.gif) repeat-x;position:relative;}
+.x-progress-bar{height:18px;float:left;width:0;background:#9CBFEE url( ../images/default/progress/progress-bg.gif ) repeat-x left center;border-top:1px solid #D1E4FD;border-bottom:1px solid #7FA9E4;border-right:1px solid #7FA9E4;}
+.x-progress-text{font-size:11px;font-weight:bold;color:#fff;padding:1px 5px;overflow:hidden;position:absolute;left:0;text-align:center;}
+.x-progress-text-back{color:#396095;line-height:16px;}
+.ext-ie .x-progress-text-back{line-height:15px;}
+
+.x-window-dlg .x-window-body{border:0 none!important;padding:5px 10px;overflow:hidden!important;}
+.x-window-dlg .x-window-mc{border:0 none!important;}
+.x-window-dlg .ext-mb-text,.x-window-dlg .x-window-header-text{font-size:12px;}
+.x-window-dlg .ext-mb-input{margin-top:4px;width:95%;}
+.x-window-dlg .ext-mb-textarea{margin-top:4px;font:normal 12px tahoma,arial,helvetica,sans-serif;}
+.x-window-dlg .x-progress-wrap{margin-top:4px;}
+.ext-ie .x-window-dlg .x-progress-wrap{margin-top:6px;}
+.x-window-dlg .x-msg-box-wait{background:transparent url(../images/default/grid/loading.gif) no-repeat left;display:block;width:300px;padding-left:18px;line-height:18px;}
+.x-window-dlg .ext-mb-icon{float:left;width:47px;height:32px;}
+.x-window-dlg .ext-mb-icon{float:left;width:47px;height:32px;}
+.ext-ie .x-window-dlg .ext-mb-icon{width:44px;}
+.x-window-dlg .ext-mb-info{background:transparent url(../images/default/window/icon-info.gif) no-repeat top left;}
+.x-window-dlg .ext-mb-warning{background:transparent url(../images/default/window/icon-warning.gif) no-repeat top left;}
+.x-window-dlg .ext-mb-question{background:transparent url(../images/default/window/icon-question.gif) no-repeat top left;}
+.x-window-dlg .ext-mb-error{background:transparent url(../images/default/window/icon-error.gif) no-repeat top left;}
+.ext-gecko2 .ext-mb-fix-cursor{overflow:auto;}
+
+ .x-slider{zoom:1;}
+.x-slider-inner{position:relative;left:0;top:0;overflow:visible;zoom:1;}
+.x-slider-focus{position:absolute;left:0;top:0;width:1px;height:1px;line-height:1px;font-size:1px;-moz-outline:0 none;outline:0 none;-moz-user-select:text;-khtml-user-select:text;}
+.x-slider-horz{padding-left:7px;background:transparent url(../images/default/slider/slider-bg.png) no-repeat 0 -22px;}
+.x-slider-horz .x-slider-end{padding-right:7px;zoom:1;background:transparent url(../images/default/slider/slider-bg.png) no-repeat right -44px;}
+.x-slider-horz .x-slider-inner{background:transparent url(../images/default/slider/slider-bg.png) repeat-x 0 0;height:22px;}
+.x-slider-horz .x-slider-thumb{width:14px;height:15px;position:absolute;left:0;top:3px;background:transparent url(../images/default/slider/slider-thumb.png) no-repeat 0 0;}
+.x-slider-horz .x-slider-thumb-over{background-position:-14px -15px;}
+.x-slider-horz .x-slider-thumb-drag{background-position:-28px -30px;}
+.x-slider-vert{padding-top:7px;background:transparent url(../images/default/slider/slider-v-bg.png) no-repeat -44px 0;width:22px;}
+.x-slider-vert .x-slider-end{padding-bottom:7px;zoom:1;background:transparent url(../images/default/slider/slider-v-bg.png) no-repeat -22px bottom;}
+.x-slider-vert .x-slider-inner{background:transparent url(../images/default/slider/slider-v-bg.png) repeat-y 0 0;}
+.x-slider-vert .x-slider-thumb{width:15px;height:14px;position:absolute;left:3px;bottom:0;background:transparent url(../images/default/slider/slider-v-thumb.png) no-repeat 0 0;}
+.x-slider-vert .x-slider-thumb-over{background-position:-15px -14px;}
+.x-slider-vert .x-slider-thumb-drag{background-position:-30px -28px;}
+
diff --git a/deluge/ui/web/docs/template/resources/deluge.png b/deluge/ui/web/docs/template/resources/deluge.png
new file mode 100644
index 0000000..e39cd0c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/deluge.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/docs.css b/deluge/ui/web/docs/template/resources/docs.css
new file mode 100644
index 0000000..4d3c5e9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/docs.css
@@ -0,0 +1,346 @@
+body {
+ font: normal 12px verdana,arial,tahoma;
+}
+html, body {
+ margin:0;
+ padding:0;
+ border:0 none;
+ overflow:hidden;
+ height:100%;
+ width:100%;
+}
+#class .loading-indicator{
+ font-size:12px;
+ height:18px;
+}
+
+
+#docs .top-toolbar{
+ border:0 none;
+ border-top:1px solid #d0d0d0;
+ background:transparent;
+}
+#docs .top-toolbar button {
+
+}
+.x-panel-noborder {
+ border: 0 none;
+}
+#header{
+ border:0 none;
+ background:#1E4176 url(hd-bg.gif) repeat-x 0 0;
+ padding-top:3px;
+ padding-left:3px;
+}
+.docs-header .x-panel-body {
+ background:transparent;
+}
+
+#header {
+
+}
+
+#header .api-title {
+ font:normal 16px tahoma, arial, sans-serif;
+ color:white;
+ margin:5px;
+}
+
+.loading-indicator {
+ font-size:11px;
+ background-image:url('../resources/images/default/grid/loading.gif');
+ background-repeat: no-repeat;
+ background-position:top left;
+ padding-left:20px;
+ height:18px;
+ text-align:left;
+}
+
+#doc-body .loading-indicator {
+ font:bold 13px Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ position:absolute;
+ top:35%;
+ left:43%;
+ color:#444;
+ background-image:url(../resources/images/default/shared/large-loading.gif);
+ background-repeat: no-repeat;
+ background-position:left 5px;
+ padding:10px 10px 10px 38px;
+ text-align:left;
+}
+a#welcome-link{
+ background:#fff url(docs.gif) no-repeat 0px 0px;
+ padding-left:18px;
+}
+a#help-forums{
+ background:#fff url(forum.gif) no-repeat 16px 0px;
+ padding-left:34px;
+ display:block
+}
+#loading-mask{
+ position:absolute;
+ left:0;
+ top:0;
+ width:100%;
+ height:100%;
+ z-index:20000;
+ background-color:white;
+}
+#loading{
+ position:absolute;
+ left:45%;
+ top:40%;
+ padding:2px;
+ z-index:20001;
+ height:auto;
+}
+#loading img {
+ margin-bottom:5px;
+}
+#loading .loading-indicator{
+ background:white;
+ color:#555;
+ font:bold 13px tahoma,arial,helvetica;
+ padding:10px;
+ margin:0;
+ text-align:center;
+ height:auto;
+}
+#api-tree a span {
+ font-family:verdana,arial,tahoma,sans-serif;
+ font-size:11px;
+}
+#api-tree .cls a:hover span {
+ text-decoration:underline;
+}
+#api-tree .x-panel-body {
+ background-color:white;
+ position:relative;
+ padding:3px;
+}
+#api-tree .cls{
+ border:1px solid #fff;
+}
+
+#api-tree .x-tree-selected {
+ border:1px dotted #a3bae9;
+ background:#DFE8F6;
+}
+#api-tree .x-tree-node .x-tree-selected a span{
+ background:transparent;
+ color:#1E4176;
+ font-weight:bold;
+}
+
+a {
+ color: #1E4176;
+}
+a:link {
+ color: #1E4176;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #555;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+ color: #15428b;
+}
+
+#welcome {
+ position:relative;
+ top:0;
+ left: 0;
+ zoom:1;
+}
+.col{
+ margin:0 250px 0 10px;
+ zoom:1;
+ padding: 10px 0;
+}
+
+.col-last {
+ width: 220px;
+ position:absolute;
+ right:10px;
+ top:10px;
+}
+
+.block{
+ margin-bottom:10px;
+}
+.block-title{
+ color: #1E4176;
+ font:normal 18px tahoma,verdana,sans-serif;
+ letter-spacing:-1px;
+ padding: 4px;
+ padding-left: 8px;
+}
+.block-body{
+ padding:8px;
+ padding-top:2px;
+}
+.block-body b{
+ color:#333333;
+ font-size:11px;
+}
+.block-body em {
+ display:block;
+ margin-top:5px;
+ font-size:11px;
+ color:gray;
+ text-align:right;
+}
+.list{
+ list-style: square;
+ padding-left:20px;
+ margin-top:5px;
+}
+
+.res-block {
+ padding-top:5px;
+ background:transparent url(block-top.gif) no-repeat;
+ width:210px;
+ margin-bottom:15px;
+}
+.res-block-inner {
+ padding:6px 11px;
+ background:transparent url(block-bottom.gif) no-repeat left bottom;
+}
+
+.res-block h3 {
+ font: bold 12px tahoma,arial,sans-serif;
+ color:#555;
+ margin-bottom:8px;
+}
+
+.res-block ul {
+ list-style-type: disc;
+ margin-left:15px;
+ font: normal 12px tahoma,arial,sans-serif;
+ color:#555;
+}
+
+.res-block ul li {
+ margin:0 0 5px 3px;
+}
+
+.hide-inherited .inherited {
+ display:none;
+}
+
+#doc-body .x-tab-panel-body {
+ background:#fff url(../resources/images/default/form/text-bg.gif) repeat-x 0 0;
+}
+#doc-body .x-panel-body, #doc-body .body-wrap {
+ background:transparent !important;
+}
+.icon-cls {
+ background-image: url(class.gif) !important;
+}
+.icon-event {
+ background-image: url(event.gif) !important;
+}
+.icon-config {
+ background-image: url(config.gif) !important;
+}
+.icon-prop {
+ background-image: url(prop.gif) !important;
+}
+.icon-method {
+ background-image: url(method.gif) !important;
+}
+.icon-cmp {
+ background-image: url(cmp.gif) !important;
+}
+.icon-pkg {
+ background-image: url(pkg.gif) !important;
+}
+.icon-fav {
+ background-image: url(fav.gif) !important;
+}
+.icon-static {
+ background-image: url(static.gif) !important;
+}
+.icon-docs {
+ background-image: url(docs.gif) !important;
+}
+.icon-expand-all {
+ background-image: url(expand-all.gif) !important;
+}
+.icon-collapse-all {
+ background-image: url(collapse-all.gif) !important;
+}
+.icon-expand-members {
+ background-image: url(expand-members.gif) !important;
+}
+.icon-hide-inherited {
+ background-image: url(hide-inherited.gif) !important;
+}
+
+#legend li {
+ line-height:16px;
+}
+.item-icon {
+ vertical-align:top;
+ width:16px;
+ height:16px;
+ margin-right:6px;
+}
+.ext-ie .item-icon {
+ vertical-align:middle;
+}
+h3.home-title {
+ margin:5px 0;
+ font:bold 13px tahoma,arial,sans-serif;
+ color:#444;
+}
+
+.search-item {
+ margin:5px 5px 9px;
+ padding:0 5px 10px 0;
+}
+
+.search-item .member {
+ font:bold 12px tahoma,arial,sans-serif;
+ color:#444;
+ margin:5px;
+ overflow:hidden;
+ white-space:nowrap;
+ zoom:1;
+}
+
+.search-item .cls {
+ font:normal 12px tahoma,arial,sans-serif;
+ color:#444;
+ margin:5px;
+ overflow:hidden;
+ text-align:left;
+ white-space:nowrap;
+ zoom:1;
+}
+.search-item p {
+ font:normal 11px tahoma,arial,sans-serif;
+ clear:both;
+ margin: 0 5px 5px 28px;
+ color:#444;
+ zoom:1;
+}
+#search .loading-indicator {
+ position:static !important;
+}
+#search h3 {
+ font:normal 12px tahoma,arial,sans-serif;
+ color:#444;
+ margin:10px;
+}
+.inner-link .item-icon, .bookmark .item-icon{
+ margin-right:3px;
+}
+.inner-link, .bookmark {
+ margin-left:10px;
+}
+
diff --git a/deluge/ui/web/docs/template/resources/docs.gif b/deluge/ui/web/docs/template/resources/docs.gif
new file mode 100644
index 0000000..a915dfb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/docs.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/docs.js b/deluge/ui/web/docs/template/resources/docs.js
new file mode 100644
index 0000000..7baadc9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/docs.js
@@ -0,0 +1,632 @@
+Ext.BLANK_IMAGE_URL = 'resources/s.gif';
+
+Docs = {};
+
+ApiPanel = function() {
+ ApiPanel.superclass.constructor.call(this, {
+ id:'api-tree',
+ region:'west',
+ split:true,
+ width: 280,
+ minSize: 175,
+ maxSize: 500,
+ collapsible: true,
+ margins:'0 0 5 5',
+ cmargins:'0 0 0 0',
+ rootVisible:false,
+ lines:false,
+ autoScroll:true,
+ animCollapse:false,
+ animate: false,
+ collapseMode:'mini',
+ loader: new Ext.tree.TreeLoader({
+ preloadChildren: true,
+ clearOnLoad: false
+ }),
+ root: new Ext.tree.AsyncTreeNode({
+ text:'Ext JS',
+ id:'root',
+ expanded:true,
+ children:[Docs.classData]
+ }),
+ collapseFirst:false
+ });
+ // no longer needed!
+ //new Ext.tree.TreeSorter(this, {folderSort:true,leafAttr:'isClass'});
+
+ this.getSelectionModel().on('beforeselect', function(sm, node){
+ return node.isLeaf();
+ });
+};
+
+Ext.extend(ApiPanel, Ext.tree.TreePanel, {
+ selectClass : function(cls){
+ if(cls){
+ var parts = cls.split('.');
+ var last = parts.length-1;
+ var res = [];
+ var pkg = [];
+ for(var i = 0; i < last; i++){ // things get nasty - static classes can have .
+ var p = parts[i];
+ var fc = p.charAt(0);
+ var staticCls = fc.toUpperCase() == fc;
+ if(p == 'Ext' || !staticCls){
+ pkg.push(p);
+ res[i] = 'pkg-'+pkg.join('.');
+ }else if(staticCls){
+ --last;
+ res.splice(i, 1);
+ }
+ }
+ res[last] = cls;
+
+ this.selectPath('/root/apidocs/'+res.join('/'));
+ }
+ }
+});
+
+
+DocPanel = Ext.extend(Ext.Panel, {
+ closable: true,
+ autoScroll:true,
+
+ initComponent : function(){
+ var ps = this.cclass.split('.');
+ this.title = ps[ps.length-1];
+
+ DocPanel.superclass.initComponent.call(this);
+ },
+
+ scrollToMember : function(member){
+ var el = Ext.fly(this.cclass + '-' + member);
+ if(el){
+ var top = (el.getOffsetsTo(this.body)[1]) + this.body.dom.scrollTop;
+ this.body.scrollTo('top', top-25, {duration:.75, callback: this.hlMember.createDelegate(this, [member])});
+ }
+ },
+
+ scrollToSection : function(id){
+ var el = Ext.getDom(id);
+ if(el){
+ var top = (Ext.fly(el).getOffsetsTo(this.body)[1]) + this.body.dom.scrollTop;
+ this.body.scrollTo('top', top-25, {duration:.5, callback: function(){
+ Ext.fly(el).next('h2').pause(.2).highlight('#8DB2E3', {attr:'color'});
+ }});
+ }
+ },
+
+ hlMember : function(member){
+ var el = Ext.fly(this.cclass + '-' + member);
+ if(el){
+ el.up('tr').highlight('#cadaf9');
+ }
+ }
+});
+
+
+MainPanel = function(){
+
+ this.searchStore = new Ext.data.Store({
+ proxy: new Ext.data.ScriptTagProxy({
+ url: 'http://extjs.com/playpen/api.php'
+ }),
+ reader: new Ext.data.JsonReader({
+ root: 'data'
+ },
+ ['cls', 'member', 'type', 'doc']
+ ),
+ baseParams: {},
+ listeners: {
+ 'beforeload' : function(){
+ this.baseParams.qt = Ext.getCmp('search-type').getValue();
+ }
+ }
+ });
+
+ MainPanel.superclass.constructor.call(this, {
+ id:'doc-body',
+ region:'center',
+ margins:'0 5 5 0',
+ resizeTabs: true,
+ minTabWidth: 135,
+ tabWidth: 135,
+ plugins: new Ext.ux.TabCloseMenu(),
+ enableTabScroll: true,
+ activeTab: 0,
+
+ items: {
+ id:'welcome-panel',
+ title: 'API Home',
+ autoLoad: {url: 'welcome.html', callback: this.initSearch, scope: this},
+ iconCls:'icon-docs',
+ autoScroll: true,
+ tbar: [
+ 'Search: ', ' ',
+ new Ext.ux.SelectBox({
+ listClass:'x-combo-list-small',
+ width:90,
+ value:'Starts with',
+ id:'search-type',
+ store: new Ext.data.SimpleStore({
+ fields: ['text'],
+ expandData: true,
+ data : ['Starts with', 'Ends with', 'Any match']
+ }),
+ displayField: 'text'
+ }), ' ',
+ new Ext.app.SearchField({
+ width:240,
+ store: this.searchStore,
+ paramName: 'q'
+ })
+ ]
+ }
+ });
+};
+
+Ext.extend(MainPanel, Ext.TabPanel, {
+
+ initEvents : function(){
+ MainPanel.superclass.initEvents.call(this);
+ this.body.on('click', this.onClick, this);
+ },
+
+ onClick: function(e, target){
+ if(target = e.getTarget('a:not(.exi)', 3)){
+ var cls = Ext.fly(target).getAttributeNS('ext', 'cls');
+ e.stopEvent();
+ if(cls){
+ var member = Ext.fly(target).getAttributeNS('ext', 'member');
+ this.loadClass(target.href, cls, member);
+ }else if(target.className == 'inner-link'){
+ this.getActiveTab().scrollToSection(target.href.split('#')[1]);
+ }else{
+ window.open(target.href);
+ }
+ }else if(target = e.getTarget('.micon', 2)){
+ e.stopEvent();
+ var tr = Ext.fly(target.parentNode);
+ if(tr.hasClass('expandable')){
+ tr.toggleClass('expanded');
+ }
+ }
+ },
+
+ loadClass : function(href, cls, member){
+ var id = 'docs-' + cls;
+ var tab = this.getComponent(id);
+ if(tab){
+ this.setActiveTab(tab);
+ if(member){
+ tab.scrollToMember(member);
+ }
+ }else{
+ var autoLoad = {url: href};
+ if(member){
+ autoLoad.callback = function(){
+ Ext.getCmp(id).scrollToMember(member);
+ }
+ }
+ var p = this.add(new DocPanel({
+ id: id,
+ cclass : cls,
+ autoLoad: autoLoad,
+ iconCls: Docs.icons[cls]
+ }));
+ this.setActiveTab(p);
+ }
+ },
+
+ initSearch : function(){
+ // Custom rendering Template for the View
+ var resultTpl = new Ext.XTemplate(
+ '<tpl for=".">',
+ '<div class="search-item">',
+ '<a class="member" ext:cls="{cls}" ext:member="{member}" href="output/{cls}.html">',
+ '<img src="resources/images/default/s.gif" class="item-icon icon-{type}"/>{member}',
+ '</a> ',
+ '<a class="cls" ext:cls="{cls}" href="output/{cls}.html">{cls}</a>',
+ '<p>{doc}</p>',
+ '</div></tpl>'
+ );
+
+ var p = new Ext.DataView({
+ applyTo: 'search',
+ tpl: resultTpl,
+ loadingText:'Searching...',
+ store: this.searchStore,
+ itemSelector: 'div.search-item',
+ emptyText: '<h3>Use the search field above to search the Ext API for classes, properties, config options, methods and events.</h3>'
+ });
+ },
+
+ doSearch : function(e){
+ var k = e.getKey();
+ if(!e.isSpecialKey()){
+ var text = e.target.value;
+ if(!text){
+ this.searchStore.baseParams.q = '';
+ this.searchStore.removeAll();
+ }else{
+ this.searchStore.baseParams.q = text;
+ this.searchStore.reload();
+ }
+ }
+ }
+});
+
+
+Ext.onReady(function(){
+
+ Ext.QuickTips.init();
+
+ var api = new ApiPanel();
+ var mainPanel = new MainPanel();
+
+ api.on('click', function(node, e){
+ if(node.isLeaf()){
+ e.stopEvent();
+ mainPanel.loadClass(node.attributes.href, node.id);
+ }
+ });
+
+ mainPanel.on('tabchange', function(tp, tab){
+ api.selectClass(tab.cclass);
+ });
+
+ var hd = new Ext.Panel({
+ border: false,
+ layout:'anchor',
+ region:'north',
+ cls: 'docs-header',
+ height:60,
+ items: [{
+ xtype:'box',
+ el:'header',
+ border:false,
+ anchor: 'none -25'
+ },
+ new Ext.Toolbar({
+ cls:'top-toolbar',
+ items:[ ' ',
+ new Ext.form.TextField({
+ width: 200,
+ emptyText:'Find a Class',
+ listeners:{
+ render: function(f){
+ f.el.on('keydown', filterTree, f, {buffer: 350});
+ }
+ }
+ }), ' ', ' ',
+ {
+ iconCls: 'icon-expand-all',
+ tooltip: 'Expand All',
+ handler: function(){ api.root.expand(true); }
+ }, '-', {
+ iconCls: 'icon-collapse-all',
+ tooltip: 'Collapse All',
+ handler: function(){ api.root.collapse(true); }
+ }, '->', {
+ tooltip:'Hide Inherited Members',
+ iconCls: 'icon-hide-inherited',
+ enableToggle: true,
+ toggleHandler : function(b, pressed){
+ mainPanel[pressed ? 'addClass' : 'removeClass']('hide-inherited');
+ }
+ }, '-', {
+ tooltip:'Expand All Members',
+ iconCls: 'icon-expand-members',
+ enableToggle: true,
+ toggleHandler : function(b, pressed){
+ mainPanel[pressed ? 'addClass' : 'removeClass']('full-details');
+ }
+ }]
+ })]
+ })
+
+ var viewport = new Ext.Viewport({
+ layout:'border',
+ items:[ hd, api, mainPanel ]
+ });
+
+ api.expandPath('/root/apidocs');
+
+ // allow for link in
+ var page = window.location.href.split('?')[1];
+ if(page){
+ var ps = Ext.urlDecode(page);
+ var cls = ps['class'];
+ mainPanel.loadClass('output/' + cls + '.html', cls, ps.member);
+ }
+
+ viewport.doLayout();
+
+ setTimeout(function(){
+ Ext.get('loading').remove();
+ Ext.get('loading-mask').fadeOut({remove:true});
+ }, 250);
+
+ var filter = new Ext.tree.TreeFilter(api, {
+ clearBlank: true,
+ autoClear: true
+ });
+ var hiddenPkgs = [];
+ function filterTree(e){
+ var text = e.target.value;
+ Ext.each(hiddenPkgs, function(n){
+ n.ui.show();
+ });
+ if(!text){
+ filter.clear();
+ return;
+ }
+ api.expandAll();
+
+ var re = new RegExp('^' + Ext.escapeRe(text), 'i');
+ filter.filterBy(function(n){
+ return !n.attributes.isClass || re.test(n.text);
+ });
+
+ // hide empty packages that weren't filtered
+ hiddenPkgs = [];
+ api.root.cascade(function(n){
+ if(!n.attributes.isClass && n.ui.ctNode.offsetHeight < 3){
+ n.ui.hide();
+ hiddenPkgs.push(n);
+ }
+ });
+ }
+
+});
+
+
+Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
+ initComponent : function(){
+ if(!this.store.baseParams){
+ this.store.baseParams = {};
+ }
+ Ext.app.SearchField.superclass.initComponent.call(this);
+ this.on('specialkey', function(f, e){
+ if(e.getKey() == e.ENTER){
+ this.onTrigger2Click();
+ }
+ }, this);
+ },
+
+ validationEvent:false,
+ validateOnBlur:false,
+ trigger1Class:'x-form-clear-trigger',
+ trigger2Class:'x-form-search-trigger',
+ hideTrigger1:true,
+ width:180,
+ hasSearch : false,
+ paramName : 'query',
+
+ onTrigger1Click : function(){
+ if(this.hasSearch){
+ this.store.baseParams[this.paramName] = '';
+ this.store.removeAll();
+ this.el.dom.value = '';
+ this.triggers[0].hide();
+ this.hasSearch = false;
+ this.focus();
+ }
+ },
+
+ onTrigger2Click : function(){
+ var v = this.getRawValue();
+ if(v.length < 1){
+ this.onTrigger1Click();
+ return;
+ }
+ if(v.length < 2){
+ Ext.Msg.alert('Invalid Search', 'You must enter a minimum of 2 characters to search the API');
+ return;
+ }
+ this.store.baseParams[this.paramName] = v;
+ var o = {start: 0};
+ this.store.reload({params:o});
+ this.hasSearch = true;
+ this.triggers[0].show();
+ this.focus();
+ }
+});
+
+
+/**
+ * Makes a ComboBox more closely mimic an HTML SELECT. Supports clicking and dragging
+ * through the list, with item selection occurring when the mouse button is released.
+ * When used will automatically set {@link #editable} to false and call {@link Ext.Element#unselectable}
+ * on inner elements. Re-enabling editable after calling this will NOT work.
+ *
+ * @author Corey Gilmore
+ * http://extjs.com/forum/showthread.php?t=6392
+ *
+ * @history 2007-07-08 jvs
+ * Slight mods for Ext 2.0
+ */
+Ext.ux.SelectBox = function(config){
+ this.searchResetDelay = 1000;
+ config = config || {};
+ config = Ext.apply(config || {}, {
+ editable: false,
+ forceSelection: true,
+ rowHeight: false,
+ lastSearchTerm: false,
+ triggerAction: 'all',
+ mode: 'local'
+ });
+
+ Ext.ux.SelectBox.superclass.constructor.apply(this, arguments);
+
+ this.lastSelectedIndex = this.selectedIndex || 0;
+};
+
+Ext.extend(Ext.ux.SelectBox, Ext.form.ComboBox, {
+ lazyInit: false,
+ initEvents : function(){
+ Ext.ux.SelectBox.superclass.initEvents.apply(this, arguments);
+ // you need to use keypress to capture upper/lower case and shift+key, but it doesn't work in IE
+ this.el.on('keydown', this.keySearch, this, true);
+ this.cshTask = new Ext.util.DelayedTask(this.clearSearchHistory, this);
+ },
+
+ keySearch : function(e, target, options) {
+ var raw = e.getKey();
+ var key = String.fromCharCode(raw);
+ var startIndex = 0;
+
+ if( !this.store.getCount() ) {
+ return;
+ }
+
+ switch(raw) {
+ case Ext.EventObject.HOME:
+ e.stopEvent();
+ this.selectFirst();
+ return;
+
+ case Ext.EventObject.END:
+ e.stopEvent();
+ this.selectLast();
+ return;
+
+ case Ext.EventObject.PAGEDOWN:
+ this.selectNextPage();
+ e.stopEvent();
+ return;
+
+ case Ext.EventObject.PAGEUP:
+ this.selectPrevPage();
+ e.stopEvent();
+ return;
+ }
+
+ // skip special keys other than the shift key
+ if( (e.hasModifier() && !e.shiftKey) || e.isNavKeyPress() || e.isSpecialKey() ) {
+ return;
+ }
+ if( this.lastSearchTerm == key ) {
+ startIndex = this.lastSelectedIndex;
+ }
+ this.search(this.displayField, key, startIndex);
+ this.cshTask.delay(this.searchResetDelay);
+ },
+
+ onRender : function(ct, position) {
+ this.store.on('load', this.calcRowsPerPage, this);
+ Ext.ux.SelectBox.superclass.onRender.apply(this, arguments);
+ if( this.mode == 'local' ) {
+ this.calcRowsPerPage();
+ }
+ },
+
+ onSelect : function(record, index, skipCollapse){
+ if(this.fireEvent('beforeselect', this, record, index) !== false){
+ this.setValue(record.data[this.valueField || this.displayField]);
+ if( !skipCollapse ) {
+ this.collapse();
+ }
+ this.lastSelectedIndex = index + 1;
+ this.fireEvent('select', this, record, index);
+ }
+ },
+
+ render : function(ct) {
+ Ext.ux.SelectBox.superclass.render.apply(this, arguments);
+ if( Ext.isSafari ) {
+ this.el.swallowEvent('mousedown', true);
+ }
+ this.el.unselectable();
+ this.innerList.unselectable();
+ this.trigger.unselectable();
+ this.innerList.on('mouseup', function(e, target, options) {
+ if( target.id && target.id == this.innerList.id ) {
+ return;
+ }
+ this.onViewClick();
+ }, this);
+
+ this.innerList.on('mouseover', function(e, target, options) {
+ if( target.id && target.id == this.innerList.id ) {
+ return;
+ }
+ this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
+ this.cshTask.delay(this.searchResetDelay);
+ }, this);
+
+ this.trigger.un('click', this.onTriggerClick, this);
+ this.trigger.on('mousedown', function(e, target, options) {
+ e.preventDefault();
+ this.onTriggerClick();
+ }, this);
+
+ this.on('collapse', function(e, target, options) {
+ Ext.getDoc().un('mouseup', this.collapseIf, this);
+ }, this, true);
+
+ this.on('expand', function(e, target, options) {
+ Ext.getDoc().on('mouseup', this.collapseIf, this);
+ }, this, true);
+ },
+
+ clearSearchHistory : function() {
+ this.lastSelectedIndex = 0;
+ this.lastSearchTerm = false;
+ },
+
+ selectFirst : function() {
+ this.focusAndSelect(this.store.data.first());
+ },
+
+ selectLast : function() {
+ this.focusAndSelect(this.store.data.last());
+ },
+
+ selectPrevPage : function() {
+ if( !this.rowHeight ) {
+ return;
+ }
+ var index = Math.max(this.selectedIndex-this.rowsPerPage, 0);
+ this.focusAndSelect(this.store.getAt(index));
+ },
+
+ selectNextPage : function() {
+ if( !this.rowHeight ) {
+ return;
+ }
+ var index = Math.min(this.selectedIndex+this.rowsPerPage, this.store.getCount() - 1);
+ this.focusAndSelect(this.store.getAt(index));
+ },
+
+ search : function(field, value, startIndex) {
+ field = field || this.displayField;
+ this.lastSearchTerm = value;
+ var index = this.store.find.apply(this.store, arguments);
+ if( index !== -1 ) {
+ this.focusAndSelect(index);
+ }
+ },
+
+ focusAndSelect : function(record) {
+ var index = typeof record === 'number' ? record : this.store.indexOf(record);
+ this.select(index, this.isExpanded());
+ this.onSelect(this.store.getAt(record), index, this.isExpanded());
+ },
+
+ calcRowsPerPage : function() {
+ if( this.store.getCount() ) {
+ this.rowHeight = Ext.fly(this.view.getNode(0)).getHeight();
+ this.rowsPerPage = this.maxHeight / this.rowHeight;
+ } else {
+ this.rowHeight = false;
+ }
+ }
+
+});
+
+Ext.Ajax.on('requestcomplete', function(ajax, xhr, o){
+ if(typeof urchinTracker == 'function' && o && o.url){
+ urchinTracker(o.url);
+ }
+}); \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/elbow-end.gif b/deluge/ui/web/docs/template/resources/elbow-end.gif
new file mode 100644
index 0000000..f24ddee
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/elbow-end.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/event.gif b/deluge/ui/web/docs/template/resources/event.gif
new file mode 100644
index 0000000..9fb1ba9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/event.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/example.gif b/deluge/ui/web/docs/template/resources/example.gif
new file mode 100644
index 0000000..ad599cf
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/example.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/expand-all.gif b/deluge/ui/web/docs/template/resources/expand-all.gif
new file mode 100644
index 0000000..3798498
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/expand-all.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/expand-bg-over.gif b/deluge/ui/web/docs/template/resources/expand-bg-over.gif
new file mode 100644
index 0000000..ec3a546
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/expand-bg-over.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/expand-bg.gif b/deluge/ui/web/docs/template/resources/expand-bg.gif
new file mode 100644
index 0000000..135aa89
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/expand-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/expand-members.gif b/deluge/ui/web/docs/template/resources/expand-members.gif
new file mode 100644
index 0000000..14b5437
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/expand-members.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/ext-all.js b/deluge/ui/web/docs/template/resources/ext-all.js
new file mode 100644
index 0000000..6d86ccb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/ext-all.js
@@ -0,0 +1,162 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+Ext.DomHelper=function(){var L=null;var F=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var B=/^table|tbody|tr|td$/i;var A=function(T){if(typeof T=="string"){return T}var O="";if(Ext.isArray(T)){for(var R=0,P=T.length;R<P;R++){O+=A(T[R])}return O}if(!T.tag){T.tag="div"}O+="<"+T.tag;for(var N in T){if(N=="tag"||N=="children"||N=="cn"||N=="html"||typeof T[N]=="function"){continue}if(N=="style"){var S=T["style"];if(typeof S=="function"){S=S.call()}if(typeof S=="string"){O+=" style=\""+S+"\""}else{if(typeof S=="object"){O+=" style=\"";for(var Q in S){if(typeof S[Q]!="function"){O+=Q+":"+S[Q]+";"}}O+="\""}}}else{if(N=="cls"){O+=" class=\""+T["cls"]+"\""}else{if(N=="htmlFor"){O+=" for=\""+T["htmlFor"]+"\""}else{O+=" "+N+"=\""+T[N]+"\""}}}}if(F.test(T.tag)){O+="/>"}else{O+=">";var U=T.children||T.cn;if(U){O+=A(U)}else{if(T.html){O+=T.html}}O+="</"+T.tag+">"}return O};var M=function(T,O){var S;if(Ext.isArray(T)){S=document.createDocumentFragment();for(var R=0,P=T.length;R<P;R++){M(T[R],S)}}else{if(typeof T=="string"){S=document.createTextNode(T)}else{S=document.createElement(T.tag||"div");var Q=!!S.setAttribute;for(var N in T){if(N=="tag"||N=="children"||N=="cn"||N=="html"||N=="style"||typeof T[N]=="function"){continue}if(N=="cls"){S.className=T["cls"]}else{if(Q){S.setAttribute(N,T[N])}else{S[N]=T[N]}}}Ext.DomHelper.applyStyles(S,T.style);var U=T.children||T.cn;if(U){M(U,S)}else{if(T.html){S.innerHTML=T.html}}}}if(O){O.appendChild(S)}return S};var I=function(S,Q,P,R){L.innerHTML=[Q,P,R].join("");var N=-1,O=L;while(++N<S){O=O.firstChild}return O};var J="<table>",E="</table>",C=J+"<tbody>",K="</tbody>"+E,H=C+"<tr>",D="</tr>"+K;var G=function(N,O,Q,P){if(!L){L=document.createElement("div")}var R;var S=null;if(N=="td"){if(O=="afterbegin"||O=="beforeend"){return }if(O=="beforebegin"){S=Q;Q=Q.parentNode}else{S=Q.nextSibling;Q=Q.parentNode}R=I(4,H,P,D)}else{if(N=="tr"){if(O=="beforebegin"){S=Q;Q=Q.parentNode;R=I(3,C,P,K)}else{if(O=="afterend"){S=Q.nextSibling;Q=Q.parentNode;R=I(3,C,P,K)}else{if(O=="afterbegin"){S=Q.firstChild}R=I(4,H,P,D)}}}else{if(N=="tbody"){if(O=="beforebegin"){S=Q;Q=Q.parentNode;R=I(2,J,P,E)}else{if(O=="afterend"){S=Q.nextSibling;Q=Q.parentNode;R=I(2,J,P,E)}else{if(O=="afterbegin"){S=Q.firstChild}R=I(3,C,P,K)}}}else{if(O=="beforebegin"||O=="afterend"){return }if(O=="afterbegin"){S=Q.firstChild}R=I(2,J,P,E)}}}Q.insertBefore(R,S);return R};return{useDom:false,markup:function(N){return A(N)},applyStyles:function(P,Q){if(Q){P=Ext.fly(P);if(typeof Q=="string"){var O=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var R;while((R=O.exec(Q))!=null){P.setStyle(R[1],R[2])}}else{if(typeof Q=="object"){for(var N in Q){P.setStyle(N,Q[N])}}else{if(typeof Q=="function"){Ext.DomHelper.applyStyles(P,Q.call())}}}}},insertHtml:function(P,R,Q){P=P.toLowerCase();if(R.insertAdjacentHTML){if(B.test(R.tagName)){var O;if(O=G(R.tagName.toLowerCase(),P,R,Q)){return O}}switch(P){case"beforebegin":R.insertAdjacentHTML("BeforeBegin",Q);return R.previousSibling;case"afterbegin":R.insertAdjacentHTML("AfterBegin",Q);return R.firstChild;case"beforeend":R.insertAdjacentHTML("BeforeEnd",Q);return R.lastChild;case"afterend":R.insertAdjacentHTML("AfterEnd",Q);return R.nextSibling}throw"Illegal insertion point -> \""+P+"\""}var N=R.ownerDocument.createRange();var S;switch(P){case"beforebegin":N.setStartBefore(R);S=N.createContextualFragment(Q);R.parentNode.insertBefore(S,R);return R.previousSibling;case"afterbegin":if(R.firstChild){N.setStartBefore(R.firstChild);S=N.createContextualFragment(Q);R.insertBefore(S,R.firstChild);return R.firstChild}else{R.innerHTML=Q;return R.firstChild}case"beforeend":if(R.lastChild){N.setStartAfter(R.lastChild);S=N.createContextualFragment(Q);R.appendChild(S);return R.lastChild}else{R.innerHTML=Q;return R.lastChild}case"afterend":N.setStartAfter(R);S=N.createContextualFragment(Q);R.parentNode.insertBefore(S,R.nextSibling);return R.nextSibling}throw"Illegal insertion point -> \""+P+"\""},insertBefore:function(N,P,O){return this.doInsert(N,P,O,"beforeBegin")},insertAfter:function(N,P,O){return this.doInsert(N,P,O,"afterEnd","nextSibling")},insertFirst:function(N,P,O){return this.doInsert(N,P,O,"afterBegin","firstChild")},doInsert:function(Q,S,R,T,P){Q=Ext.getDom(Q);var O;if(this.useDom){O=M(S,null);(P==="firstChild"?Q:Q.parentNode).insertBefore(O,P?Q[P]:Q)}else{var N=A(S);O=this.insertHtml(T,Q,N)}return R?Ext.get(O,true):O},append:function(P,R,Q){P=Ext.getDom(P);var O;if(this.useDom){O=M(R,null);P.appendChild(O)}else{var N=A(R);O=this.insertHtml("beforeEnd",P,N)}return Q?Ext.get(O,true):O},overwrite:function(N,P,O){N=Ext.getDom(N);N.innerHTML=A(P);return O?Ext.get(N.firstChild,true):N.firstChild},createTemplate:function(O){var N=A(O);return new Ext.Template(N)}}}();
+Ext.Template=function(E){var B=arguments;if(Ext.isArray(E)){E=E.join("")}else{if(B.length>1){var C=[];for(var D=0,A=B.length;D<A;D++){if(typeof B[D]=="object"){Ext.apply(this,B[D])}else{C[C.length]=B[D]}}E=C.join("")}}this.html=E;if(this.compiled){this.compile()}};Ext.Template.prototype={applyTemplate:function(B){if(this.compiled){return this.compiled(B)}var A=this.disableFormats!==true;var E=Ext.util.Format,C=this;var D=function(G,I,L,H){if(L&&A){if(L.substr(0,5)=="this."){return C.call(L.substr(5),B[I],B)}else{if(H){var K=/^\s*['"](.*)["']\s*$/;H=H.split(",");for(var J=0,F=H.length;J<F;J++){H[J]=H[J].replace(K,"$1")}H=[B[I]].concat(H)}else{H=[B[I]]}return E[L].apply(E,H)}}else{return B[I]!==undefined?B[I]:""}};return this.html.replace(this.re,D)},set:function(A,B){this.html=A;this.compiled=null;if(B){this.compile()}return this},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format="this.call(\""+format.substr(5)+"\", ";args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"};var body;if(Ext.isGecko){body="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return this},call:function(C,B,A){return this[C](B,A)},insertFirst:function(B,A,C){return this.doInsert("afterBegin",B,A,C)},insertBefore:function(B,A,C){return this.doInsert("beforeBegin",B,A,C)},insertAfter:function(B,A,C){return this.doInsert("afterEnd",B,A,C)},append:function(B,A,C){return this.doInsert("beforeEnd",B,A,C)},doInsert:function(C,E,B,A){E=Ext.getDom(E);var D=Ext.DomHelper.insertHtml(C,E,this.applyTemplate(B));return A?Ext.get(D,true):D},overwrite:function(B,A,C){B=Ext.getDom(B);B.innerHTML=this.applyTemplate(A);return C?Ext.get(B.firstChild,true):B.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(B,A){B=Ext.getDom(B);return new Ext.Template(B.value||B.innerHTML,A||"")};
+Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={};var nonSpace=/\S/;var trimRe=/^\s+|\s+$/g;var tplRe=/\{(\d+)\}/g;var modeRe=/^(\s?[\/>+~]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*]+)/;var nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/;function child(p,index){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(tagName=="*"||n.tagName.toLowerCase()!=tagName))){}if(n){result[++ri]=n}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var r=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[++ri]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],ri=-1,st=custom=="{";var f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}if((f&&f(a,value))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}var isIE=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length;if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<len1;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,null,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=path,mode,lq;var tk=Ext.DomQuery.matchers;var tklen=tk.length;var mm;var lmode=q.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]="mode=\""+lmode[1].replace(trimRe,"")+"\";";q=q.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]="n = quickId(n, mode, root, \""+tm[2]+"\");"}else{fn[fn.length]="n = getNodes(n, mode, \""+tm[2]+"\");"}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]="n = getNodes(n, mode, \"*\");"}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]="n = byId(n, null, \""+tm[2]+"\");"}else{fn[fn.length]="n = byTag(n, \""+tm[2]+"\");"}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw"Error parsing selector, parsing failed at \""+q+"\""}}if(mm[1]){fn[fn.length]="mode=\""+mm[1].replace(trimRe,"")+"\";";q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(",");var results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"");if(!cache[p]){cache[p]=Ext.DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el);var result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:"n = byClassName(n, null, \" {1} \");"},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:"n = byPseudo(n, \"{1}\", \"{2}\");"},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:"n = byAttribute(n, \"{2}\", \"{4}\", \"{3}\", \"{1}\");"},{re:/^#([\w-]+)/,select:"n = byId(n, null, \"{1}\");"},{re:/^@([\w-]+)/,select:"return {firstChild:{nodeValue:attrValue(n, \"{1}\")}};"}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1;var m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},"checked":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},"not":function(c,ss){return Ext.DomQuery.filter(c,ss,true)},"any":function(c,selectors){var ss=selectors.split("|");var r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},"odd":function(c){return this["nth-child"](c,"odd")},"even":function(c){return this["nth-child"](c,"even")},"nth":function(c,a){return c[a-1]||[]},"first":function(c){return c[0]||[]},"last":function(c){return c[c.length-1]||[]},"has":function(c,ss){var s=Ext.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},"next":function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},"prev":function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;
+Ext.util.Observable=function(){if(this.listeners){this.on(this.listeners);delete this.listeners}};Ext.util.Observable.prototype={fireEvent:function(){if(this.eventsSuspended!==true){var A=this.events[arguments[0].toLowerCase()];if(typeof A=="object"){return A.fire.apply(A,Array.prototype.slice.call(arguments,1))}}return true},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(A,C,B,F){if(typeof A=="object"){F=A;for(var E in F){if(this.filterOptRe.test(E)){continue}if(typeof F[E]=="function"){this.addListener(E,F[E],F.scope,F)}else{this.addListener(E,F[E].fn,F[E].scope,F[E])}}return }F=(!F||typeof F=="boolean")?{}:F;A=A.toLowerCase();var D=this.events[A]||true;if(typeof D=="boolean"){D=new Ext.util.Event(this,A);this.events[A]=D}D.addListener(C,B,F)},removeListener:function(A,C,B){var D=this.events[A.toLowerCase()];if(typeof D=="object"){D.removeListener(C,B)}},purgeListeners:function(){for(var A in this.events){if(typeof this.events[A]=="object"){this.events[A].clearListeners()}}},relayEvents:function(F,D){var E=function(G){return function(){return this.fireEvent.apply(this,Ext.combine(G,Array.prototype.slice.call(arguments,0)))}};for(var C=0,A=D.length;C<A;C++){var B=D[C];if(!this.events[B]){this.events[B]=true}F.on(B,E(B),this)}},addEvents:function(D){if(!this.events){this.events={}}if(typeof D=="string"){for(var C=0,A=arguments,B;B=A[C];C++){if(!this.events[A[C]]){this.events[A[C]]=true}}}else{Ext.applyIf(this.events,D)}},hasListener:function(A){var B=this.events[A];return typeof B=="object"&&B.listeners.length>0},suspendEvents:function(){this.eventsSuspended=true},resumeEvents:function(){this.eventsSuspended=false},getMethodEvent:function(G){if(!this.methodEvents){this.methodEvents={}}var F=this.methodEvents[G];if(!F){F={};this.methodEvents[G]=F;F.originalFn=this[G];F.methodName=G;F.before=[];F.after=[];var C,B,D;var E=this;var A=function(J,I,H){if((B=J.apply(I||E,H))!==undefined){if(typeof B==="object"){if(B.returnValue!==undefined){C=B.returnValue}else{C=B}if(B.cancel===true){D=true}}else{if(B===false){D=true}else{C=B}}}};this[G]=function(){C=B=undefined;D=false;var I=Array.prototype.slice.call(arguments,0);for(var J=0,H=F.before.length;J<H;J++){A(F.before[J].fn,F.before[J].scope,I);if(D){return C}}if((B=F.originalFn.apply(E,I))!==undefined){C=B}for(var J=0,H=F.after.length;J<H;J++){A(F.after[J].fn,F.after[J].scope,I);if(D){return C}}return C}}return F},beforeMethod:function(D,B,A){var C=this.getMethodEvent(D);C.before.push({fn:B,scope:A})},afterMethod:function(D,B,A){var C=this.getMethodEvent(D);C.after.push({fn:B,scope:A})},removeMethodListener:function(F,D,C){var E=this.getMethodEvent(F);for(var B=0,A=E.before.length;B<A;B++){if(E.before[B].fn==D&&E.before[B].scope==C){E.before.splice(B,1);return }}for(var B=0,A=E.after.length;B<A;B++){if(E.after[B].fn==D&&E.after[B].scope==C){E.after.splice(B,1);return }}}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(C,B,A){C.fireEvent=C.fireEvent.createInterceptor(B,A)};Ext.util.Observable.releaseCapture=function(A){A.fireEvent=Ext.util.Observable.prototype.fireEvent};(function(){var B=function(F,G,E){var D=new Ext.util.DelayedTask();return function(){D.delay(G.buffer,F,E,Array.prototype.slice.call(arguments,0))}};var C=function(F,G,E,D){return function(){G.removeListener(E,D);return F.apply(D,arguments)}};var A=function(E,F,D){return function(){var G=Array.prototype.slice.call(arguments,0);setTimeout(function(){E.apply(D,G)},F.delay||10)}};Ext.util.Event=function(E,D){this.name=D;this.obj=E;this.listeners=[]};Ext.util.Event.prototype={addListener:function(G,F,E){F=F||this.obj;if(!this.isListening(G,F)){var D=this.createListener(G,F,E);if(!this.firing){this.listeners.push(D)}else{this.listeners=this.listeners.slice(0);this.listeners.push(D)}}},createListener:function(G,F,H){H=H||{};F=F||this.obj;var D={fn:G,scope:F,options:H};var E=G;if(H.delay){E=A(E,H,F)}if(H.single){E=C(E,this,G,F)}if(H.buffer){E=B(E,H,F)}D.fireFn=E;return D},findListener:function(I,H){H=H||this.obj;var F=this.listeners;for(var G=0,D=F.length;G<D;G++){var E=F[G];if(E.fn==I&&E.scope==H){return G}}return -1},isListening:function(E,D){return this.findListener(E,D)!=-1},removeListener:function(F,E){var D;if((D=this.findListener(F,E))!=-1){if(!this.firing){this.listeners.splice(D,1)}else{this.listeners=this.listeners.slice(0);this.listeners.splice(D,1)}return true}return false},clearListeners:function(){this.listeners=[]},fire:function(){var F=this.listeners,I,D=F.length;if(D>0){this.firing=true;var G=Array.prototype.slice.call(arguments,0);for(var H=0;H<D;H++){var E=F[H];if(E.fireFn.apply(E.scope||this.obj||window,arguments)===false){this.firing=false;return false}}this.firing=false}return true}}})();
+Ext.EventManager=function(){var X,Q,M=false;var N,W,H,S;var P=Ext.lib.Event;var R=Ext.lib.Dom;var A="Ex"+"t";var J={};var O=function(b,E,a,Z,Y){var d=Ext.id(b);if(!J[d]){J[d]={}}var c=J[d];if(!c[E]){c[E]=[]}var D=c[E];D.push({id:d,ename:E,fn:a,wrap:Z,scope:Y});P.on(b,E,Z);if(E=="mousewheel"&&b.addEventListener){b.addEventListener("DOMMouseScroll",Z,false);P.on(window,"unload",function(){b.removeEventListener("DOMMouseScroll",Z,false)})}if(E=="mousedown"&&b==document){Ext.EventManager.stoppedMouseDownEvent.addListener(Z)}};var I=function(Y,a,e,g){Y=Ext.getDom(Y);var D=Ext.id(Y),f=J[D],E;if(f){var c=f[a],Z;if(c){for(var b=0,d=c.length;b<d;b++){Z=c[b];if(Z.fn==e&&(!g||Z.scope==g)){E=Z.wrap;P.un(Y,a,E);c.splice(b,1);break}}}}if(a=="mousewheel"&&Y.addEventListener&&E){Y.removeEventListener("DOMMouseScroll",E,false)}if(a=="mousedown"&&Y==document&&E){Ext.EventManager.stoppedMouseDownEvent.removeListener(E)}};var F=function(a){a=Ext.getDom(a);var c=Ext.id(a),b=J[c],E;if(b){for(var Z in b){if(b.hasOwnProperty(Z)){E=b[Z];for(var Y=0,D=E.length;Y<D;Y++){P.un(a,Z,E[Y].wrap);E[Y]=null}}b[Z]=null}delete J[c]}};var C=function(){if(!M){M=Ext.isReady=true;if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",C,false)}}if(Q){clearInterval(Q);Q=null}if(X){X.fire();X.clearListeners()}};var B=function(){X=new Ext.util.Event();if(Ext.isReady){return }P.on(window,"load",C);if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",C,false)}else{if(Ext.isIE){Q=setInterval(function(){try{Ext.isReady||(document.documentElement.doScroll("left"))}catch(D){return }C()},5);document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;C()}}}else{if(Ext.isSafari){Q=setInterval(function(){var D=document.readyState;if(D=="complete"){C()}},10)}}}};var V=function(E,Y){var D=new Ext.util.DelayedTask(E);return function(Z){Z=new Ext.EventObjectImpl(Z);D.delay(Y.buffer,E,null,[Z])}};var T=function(a,Z,D,Y,E){return function(b){Ext.EventManager.removeListener(Z,D,Y,E);a(b)}};var G=function(D,E){return function(Y){Y=new Ext.EventObjectImpl(Y);setTimeout(function(){D(Y)},E.delay||10)}};var L=function(Y,E,D,c,b){var d=(!D||typeof D=="boolean")?{}:D;c=c||d.fn;b=b||d.scope;var a=Ext.getDom(Y);if(!a){throw"Error listening for \""+E+"\". Element \""+Y+"\" doesn't exist."}var Z=function(g){if(!window[A]){return }g=Ext.EventObject.setEvent(g);var f;if(d.delegate){f=g.getTarget(d.delegate,a);if(!f){return }}else{f=g.target}if(d.stopEvent===true){g.stopEvent()}if(d.preventDefault===true){g.preventDefault()}if(d.stopPropagation===true){g.stopPropagation()}if(d.normalized===false){g=g.browserEvent}c.call(b||a,g,f,d)};if(d.delay){Z=G(Z,d)}if(d.single){Z=T(Z,a,E,c,b)}if(d.buffer){Z=V(Z,d)}O(a,E,c,Z,b);return Z};var K=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var U={addListener:function(Y,D,a,Z,E){if(typeof D=="object"){var c=D;for(var b in c){if(K.test(b)){continue}if(typeof c[b]=="function"){L(Y,b,c,c[b],c.scope)}else{L(Y,b,c[b])}}return }return L(Y,D,E,a,Z)},removeListener:function(E,D,Z,Y){return I(E,D,Z,Y)},removeAll:function(D){return F(D)},onDocumentReady:function(Y,E,D){if(!X){B()}if(M||Ext.isReady){D||(D={});Y.defer(D.delay||0,E)}else{X.addListener(Y,E,D)}},onWindowResize:function(Y,E,D){if(!N){N=new Ext.util.Event();W=new Ext.util.DelayedTask(function(){N.fire(R.getViewWidth(),R.getViewHeight())});P.on(window,"resize",this.fireWindowResize,this)}N.addListener(Y,E,D)},fireWindowResize:function(){if(N){if((Ext.isIE||Ext.isAir)&&W){W.delay(50)}else{N.fire(R.getViewWidth(),R.getViewHeight())}}},onTextResize:function(Z,Y,D){if(!H){H=new Ext.util.Event();var E=new Ext.Element(document.createElement("div"));E.dom.className="x-text-resize";E.dom.innerHTML="X";E.appendTo(document.body);S=E.dom.offsetHeight;setInterval(function(){if(E.dom.offsetHeight!=S){H.fire(S,S=E.dom.offsetHeight)}},this.textResizeInterval)}H.addListener(Z,Y,D)},removeResizeListener:function(E,D){if(N){N.removeListener(E,D)}},fireResize:function(){if(N){N.fire(R.getViewWidth(),R.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};U.on=U.addListener;U.un=U.removeListener;U.stoppedMouseDownEvent=new Ext.util.Event();return U}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var A=function(){var C=document.body||document.getElementsByTagName("body")[0];if(!C){return false}var B=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":"ext-ie7"):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":""];if(Ext.isMac){B.push("ext-mac")}if(Ext.isLinux){B.push("ext-linux")}if(Ext.isBorderBox){B.push("ext-border-box")}if(Ext.isStrict){var D=C.parentNode;if(D){D.className+=" ext-strict"}}C.className+=B.join(" ");return true};if(!A()){Ext.onReady(A)}})();Ext.EventObject=function(){var B=Ext.lib.Event;var A={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var C=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(D){if(D){this.setEvent(D.browserEvent||D)}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,setEvent:function(D){if(D==this||(D&&D.browserEvent)){return D}this.browserEvent=D;if(D){this.button=D.button?C[D.button]:(D.which?D.which-1:-1);if(D.type=="click"&&this.button==-1){this.button=0}this.type=D.type;this.shiftKey=D.shiftKey;this.ctrlKey=D.ctrlKey||D.metaKey;this.altKey=D.altKey;this.keyCode=D.keyCode;this.charCode=D.charCode;this.target=B.getTarget(D);this.xy=B.getXY(D)}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}B.stopEvent(this.browserEvent)}},preventDefault:function(){if(this.browserEvent){B.preventDefault(this.browserEvent)}},isNavKeyPress:function(){var D=this.keyCode;D=Ext.isSafari?(A[D]||D):D;return(D>=33&&D<=40)||D==this.RETURN||D==this.TAB||D==this.ESC},isSpecialKey:function(){var D=this.keyCode;return(this.type=="keypress"&&this.ctrlKey)||D==9||D==13||D==40||D==27||(D==16)||(D==17)||(D>=18&&D<=20)||(D>=33&&D<=35)||(D>=36&&D<=39)||(D>=44&&D<=45)},stopPropagation:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}B.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){var D=this.keyCode||this.charCode;return Ext.isSafari?(A[D]||D):D},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getTime:function(){if(this.browserEvent){return B.getTime(this.browserEvent)}return null},getXY:function(){return this.xy},getTarget:function(E,F,D){return E?Ext.fly(this.target).findParent(E,F,D):(D?Ext.get(this.target):this.target)},getRelatedTarget:function(){if(this.browserEvent){return B.getRelatedTarget(this.browserEvent)}return null},getWheelDelta:function(){var D=this.browserEvent;var E=0;if(D.wheelDelta){E=D.wheelDelta/120}else{if(D.detail){E=-D.detail/3}}return E},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false},within:function(E,F){var D=this[F?"getRelatedTarget":"getTarget"]();return D&&Ext.fly(E).contains(D)},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])}};return new Ext.EventObjectImpl()}();
+(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var propCache={};var camelRe=/(-[a-z])/gi;var camelFn=function(m,a){return a.charAt(1).toUpperCase()};var view=document.defaultView;Ext.Element=function(element,forceNew){var dom=typeof element=="string"?document.getElementById(element):element;if(!dom){return null}var id=dom.id;if(forceNew!==true&&id&&Ext.Element.cache[id]){return Ext.Element.cache[id]}this.dom=dom;this.id=id||Ext.id(dom)};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(visMode){this.visibilityMode=visMode;return this},enableDisplayMode:function(display){this.setVisibilityMode(El.DISPLAY);if(typeof display!="undefined"){this.originalDisplay=display}return this},findParent:function(simpleSelector,maxDepth,returnEl){var p=this.dom,b=document.body,depth=0,dq=Ext.DomQuery,stopEl;maxDepth=maxDepth||50;if(typeof maxDepth!="number"){stopEl=Ext.getDom(maxDepth);maxDepth=10}while(p&&p.nodeType==1&&depth<maxDepth&&p!=b&&p!=stopEl){if(dq.is(p,simpleSelector)){return returnEl?Ext.get(p):p}depth++;p=p.parentNode}return null},findParentNode:function(simpleSelector,maxDepth,returnEl){var p=Ext.fly(this.dom.parentNode,"_internal");return p?p.findParent(simpleSelector,maxDepth,returnEl):null},up:function(simpleSelector,maxDepth){return this.findParentNode(simpleSelector,maxDepth,true)},is:function(simpleSelector){return Ext.DomQuery.is(this.dom,simpleSelector)},animate:function(args,duration,onComplete,easing,animType){this.anim(args,{duration:duration,callback:onComplete,easing:easing},animType);return this},anim:function(args,opt,animType,defaultDur,defaultEase,cb){animType=animType||"run";opt=opt||{};var anim=Ext.lib.Anim[animType](this.dom,args,(opt.duration||defaultDur)||0.35,(opt.easing||defaultEase)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt])},this);opt.anim=anim;return anim},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]})},clean:function(forceReclean){if(this.isCleaned&&forceReclean!==true){return this}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}this.isCleaned=true;return this},scrollIntoView:function(container,hscroll){var c=Ext.getDom(container)||Ext.getBody().dom;var el=this.dom;var o=this.getOffsetsTo(c),l=o[0]+c.scrollLeft,t=o[1]+c.scrollTop,b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(el.offsetHeight>ch||t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}c.scrollTop=c.scrollTop;if(hscroll!==false){if(el.offsetWidth>c.clientWidth||l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}c.scrollLeft=c.scrollLeft}return this},scrollChildIntoView:function(child,hscroll){Ext.fly(child,"_scrollChildIntoView").scrollIntoView(this,hscroll)},autoHeight:function(animate,duration,onComplete,easing){var oldHeight=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var height=parseInt(this.dom.scrollHeight,10);if(!animate){this.setHeight(height);this.unclip();if(typeof onComplete=="function"){onComplete()}}else{this.setHeight(oldHeight);this.setHeight(height,animate,duration,function(){this.unclip();if(typeof onComplete=="function"){onComplete()}}.createDelegate(this),easing)}}.createDelegate(this),0);return this},contains:function(el){if(!el){return false}return D.isAncestor(this.dom,el.dom?el.dom:el)},isVisible:function(deep){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true},select:function(selector,unique){return El.select(selector,unique,this.dom)},query:function(selector){return Ext.DomQuery.select(selector,this.dom)},child:function(selector,returnDom){var n=Ext.DomQuery.selectNode(selector,this.dom);return returnDom?n:Ext.get(n)},down:function(selector,returnDom){var n=Ext.DomQuery.selectNode(" > "+selector,this.dom);return returnDom?n:Ext.get(n)},initDD:function(group,config,overrides){var dd=new Ext.dd.DD(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDProxy:function(group,config,overrides){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDTarget:function(group,config,overrides){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},setVisible:function(visible,animate){if(!animate||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(visible)}else{this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!visible){if(visMode==El.DISPLAY){dom.style.display="none"}else{dom.style.visibility="hidden"}Ext.get(dom).setOpacity(1)}})}return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(animate){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(value){if(typeof value=="boolean"){value=value?this.originalDisplay:"none"}this.setStyle("display",value);return this},focus:function(){try{this.dom.focus()}catch(e){}return this},blur:function(){try{this.dom.blur()}catch(e){}return this},addClass:function(className){if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.addClass(className[i])}}else{if(className&&!this.hasClass(className)){this.dom.className=this.dom.className+" "+className}}return this},radioClass:function(className){var siblings=this.dom.parentNode.childNodes;for(var i=0;i<siblings.length;i++){var s=siblings[i];if(s.nodeType==1){Ext.get(s).removeClass(className)}}this.addClass(className);return this},removeClass:function(className){if(!className||!this.dom.className){return this}if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.removeClass(className[i])}}else{if(this.hasClass(className)){var re=this.classReCache[className];if(!re){re=new RegExp("(?:^|\\s+)"+className+"(?:\\s+|$)","g");this.classReCache[className]=re}this.dom.className=this.dom.className.replace(re," ")}}return this},classReCache:{},toggleClass:function(className){if(this.hasClass(className)){this.removeClass(className)}else{this.addClass(className)}return this},hasClass:function(className){return className&&(" "+this.dom.className+" ").indexOf(" "+className+" ")!=-1},replaceClass:function(oldClassName,newClassName){this.removeClass(oldClassName);this.addClass(newClassName);return this},getStyles:function(){var a=arguments,len=a.length,r={};for(var i=0;i<len;i++){r[a[i]]=this.getStyle(a[i])}return r},getStyle:function(){return view&&view.getComputedStyle?function(prop){var el=this.dom,v,cs,camel;if(prop=="float"){prop="cssFloat"}if(v=el.style[prop]){return v}if(cs=view.getComputedStyle(el,"")){if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}return cs[camel]}return null}:function(prop){var el=this.dom,v,cs,camel;if(prop=="opacity"){if(typeof el.style.filter=="string"){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0}}}return 1}else{if(prop=="float"){prop="styleFloat"}}if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(v=el.style[camel]){return v}if(cs=el.currentStyle){return cs[camel]}return null}}(),setStyle:function(prop,value){if(typeof prop=="string"){var camel;if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(camel=="opacity"){this.setOpacity(value)}else{this.dom.style[camel]=value}}else{for(var style in prop){if(typeof prop[style]!="function"){this.setStyle(style,prop[style])}}}return this},applyStyles:function(style){Ext.DomHelper.applyStyles(this.dom,style);return this},getX:function(){return D.getX(this.dom)},getY:function(){return D.getY(this.dom)},getXY:function(){return D.getXY(this.dom)},getOffsetsTo:function(el){var o=this.getXY();var e=Ext.fly(el,"_internal").getXY();return[o[0]-e[0],o[1]-e[1]]},setX:function(x,animate){if(!animate||!A){D.setX(this.dom,x)}else{this.setXY([x,this.getY()],this.preanim(arguments,1))}return this},setY:function(y,animate){if(!animate||!A){D.setY(this.dom,y)}else{this.setXY([this.getX(),y],this.preanim(arguments,1))}return this},setLeft:function(left){this.setStyle("left",this.addUnits(left));return this},setTop:function(top){this.setStyle("top",this.addUnits(top));return this},setRight:function(right){this.setStyle("right",this.addUnits(right));return this},setBottom:function(bottom){this.setStyle("bottom",this.addUnits(bottom));return this},setXY:function(pos,animate){if(!animate||!A){D.setXY(this.dom,pos)}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion")}return this},setLocation:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},moveTo:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},getRegion:function(){return D.getRegion(this.dom)},getHeight:function(contentHeight){var h=this.dom.offsetHeight||0;h=contentHeight!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");return h<0?0:h},getWidth:function(contentWidth){var w=this.dom.offsetWidth||0;w=contentWidth!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");return w<0?0:w},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb")}}return h},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr")}}return w},getSize:function(contentSize){return{width:this.getWidth(contentSize),height:this.getHeight(contentSize)}},getStyleSize:function(){var w,h,d=this.dom,s=d.style;if(s.width&&s.width!="auto"){w=parseInt(s.width,10);if(Ext.isBorderBox){w-=this.getFrameWidth("lr")}}if(s.height&&s.height!="auto"){h=parseInt(s.height,10);if(Ext.isBorderBox){h-=this.getFrameWidth("tb")}}return{width:w||this.getWidth(true),height:h||this.getHeight(true)}},getViewSize:function(){var d=this.dom,doc=document,aw=0,ah=0;if(d==doc||d==doc.body){return{width:D.getViewWidth(),height:D.getViewHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getValue:function(asNumber){return asNumber?parseInt(this.dom.value,10):this.dom.value},adjustWidth:function(width){if(typeof width=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){width-=(this.getBorderWidth("lr")+this.getPadding("lr"))}if(width<0){width=0}}return width},adjustHeight:function(height){if(typeof height=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){height-=(this.getBorderWidth("tb")+this.getPadding("tb"))}if(height<0){height=0}}return height},setWidth:function(width,animate){width=this.adjustWidth(width);if(!animate||!A){this.dom.style.width=this.addUnits(width)}else{this.anim({width:{to:width}},this.preanim(arguments,1))}return this},setHeight:function(height,animate){height=this.adjustHeight(height);if(!animate||!A){this.dom.style.height=this.addUnits(height)}else{this.anim({height:{to:height}},this.preanim(arguments,1))}return this},setSize:function(width,height,animate){if(typeof width=="object"){height=width.height;width=width.width}width=this.adjustWidth(width);height=this.adjustHeight(height);if(!animate||!A){this.dom.style.width=this.addUnits(width);this.dom.style.height=this.addUnits(height)}else{this.anim({width:{to:width},height:{to:height}},this.preanim(arguments,2))}return this},setBounds:function(x,y,width,height,animate){if(!animate||!A){this.setSize(width,height);this.setLocation(x,y)}else{width=this.adjustWidth(width);height=this.adjustHeight(height);this.anim({points:{to:[x,y]},width:{to:width},height:{to:height}},this.preanim(arguments,4),"motion")}return this},setRegion:function(region,animate){this.setBounds(region.left,region.top,region.right-region.left,region.bottom-region.top,this.preanim(arguments,1));return this},addListener:function(eventName,fn,scope,options){Ext.EventManager.on(this.dom,eventName,fn,scope||this,options)},removeListener:function(eventName,fn,scope){Ext.EventManager.removeListener(this.dom,eventName,fn,scope||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},relayEvent:function(eventName,observable){this.on(eventName,function(e){observable.fireEvent(eventName,e)})},setOpacity:function(opacity,animate){if(!animate||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(opacity==1?"":" alpha(opacity="+opacity*100+")")}else{s.opacity=opacity}}else{this.anim({opacity:{to:opacity}},this.preanim(arguments,1),null,0.35,"easeIn")}return this},getLeft:function(local){if(!local){return this.getX()}else{return parseInt(this.getStyle("left"),10)||0}},getRight:function(local){if(!local){return this.getX()+this.getWidth()}else{return(this.getLeft(true)+this.getWidth())||0}},getTop:function(local){if(!local){return this.getY()}else{return parseInt(this.getStyle("top"),10)||0}},getBottom:function(local){if(!local){return this.getY()+this.getHeight()}else{return(this.getTop(true)+this.getHeight())||0}},position:function(pos,zIndex,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}}else{this.setStyle("position",pos)}if(zIndex){this.setStyle("z-index",zIndex)}if(x!==undefined&&y!==undefined){this.setXY([x,y])}else{if(x!==undefined){this.setX(x)}else{if(y!==undefined){this.setY(y)}}}},clearPositioning:function(value){value=value||"";this.setStyle({"left":value,"right":value,"top":value,"bottom":value,"z-index":"","position":"static"});return this},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{"position":this.getStyle("position"),"left":l,"right":l?"":this.getStyle("right"),"top":t,"bottom":t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},getBorderWidth:function(side){return this.addStyles(side,El.borders)},getPadding:function(side){return this.addStyles(side,El.paddings)},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right=""}if(pc.bottom=="auto"){this.dom.style.bottom=""}return this},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block")}}},setOverflow:function(v){if(v=="auto"&&Ext.isMac&&Ext.isGecko2){this.dom.style.overflow="hidden";(function(){this.dom.style.overflow="auto"}).defer(1,this)}else{this.dom.style.overflow=v}},setLeftTop:function(left,top){this.dom.style.left=this.addUnits(left);this.dom.style.top=this.addUnits(top);return this},move:function(direction,distance,animate){var xy=this.getXY();direction=direction.toLowerCase();switch(direction){case"l":case"left":this.moveTo(xy[0]-distance,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+distance,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-distance,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+distance,this.preanim(arguments,2));break}return this},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={"o":this.getStyle("overflow"),"x":this.getStyle("overflow-x"),"y":this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o)}if(o.x){this.setStyle("overflow-x",o.x)}if(o.y){this.setStyle("overflow-y",o.y)}}return this},getAnchorXY:function(anchor,local,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight()}else{w=this.getWidth();h=this.getHeight()}}else{w=s.width;h=s.height}var x=0,y=0,r=Math.round;switch((anchor||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break}if(local===true){return[x,y]}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top]}var o=this.getXY();return[x+o[0],y+o[1]]},getAlignToXY:function(el,p,o){el=Ext.get(el);if(!el||!el.dom){throw"Element.alignToXY with an element that doesn't exist"}var d=this.dom;var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl"}else{if(p=="?"){p="tl-bl?"}else{if(p.indexOf("-")==-1){p="tl-"+p}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p}p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var scrollX=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;var scrollY=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw+scrollX){x=swapX?r.left-w:dw+scrollX-w}if(x<scrollX){x=swapX?r.right:scrollX}if((y+h)>dh+scrollY){y=swapY?r.top-h:dh+scrollY-h}if(y<scrollY){y=swapY?r.bottom:scrollY}}return[x,y]},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,local,offsets,proposedXY){el=Ext.get(el);offsets=offsets?Ext.applyIf(offsets,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Ext.lib.Dom.getViewWidth();vh=Ext.lib.Dom.getViewHeight()}else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!local){var vxy=el.getXY();vx=vxy[0];vy=vxy[1]}}var s=el.getScroll();vx+=offsets.left+s.left;vy+=offsets.top+s.top;vw-=offsets.right;vh-=offsets.bottom;var vr=vx+vw;var vb=vy+vh;var xy=proposedXY||(!local?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var moved=false;if((x+w)>vr){x=vr-w;moved=true}if((y+h)>vb){y=vb-h;moved=true}if(x<vx){x=vx;moved=true}if(y<vy){y=vy;moved=true}return moved?[x,y]:false}}(),adjustForConstraints:function(xy,parent,offsets){return this.getConstrainToXY(parent||document,false,offsets,xy)||xy},alignTo:function(element,position,offsets,animate){var xy=this.getAlignToXY(element,position,offsets);this.setXY(xy,this.preanim(arguments,3));return this},anchorTo:function(el,alignment,offsets,animate,monitorScroll,callback){var action=function(){this.alignTo(el,alignment,offsets,animate);Ext.callback(callback,this)};Ext.EventManager.onWindowResize(action,this);var tm=typeof monitorScroll;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",action,this,{buffer:tm=="number"?monitorScroll:50})}action.call(this);return this},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=="string"&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter=""}}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]=""}return this},hide:function(animate){this.setVisible(false,this.preanim(arguments,0));return this},show:function(animate){this.setVisible(true,this.preanim(arguments,0));return this},addUnits:function(size){return Ext.Element.addUnits(size,this.defaultUnit)},update:function(html,loadScripts,callback){if(typeof html=="undefined"){html=""}if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id();var dom=this.dom;html+="<span id=\""+id+"\"></span>";E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var srcRe=/\ssrc=([\'\"])(.*?)\1/i;var typeRe=/\stype=([\'\"])(.*?)\1/i;var match;while(match=re.exec(html)){var attrs=match[1];var srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];var typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}var el=document.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdater();um.update.apply(um,arguments);return this},getUpdater:function(){if(!this.updateManager){this.updateManager=new Ext.Updater(this)}return this.updateManager},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(centerIn){this.alignTo(centerIn||document,"c-c");return this},isBorderBox:function(){return noBoxAdjust[this.dom.tagName.toLowerCase()]||Ext.isBorderBox},getBox:function(contentBox,local){var xy;if(!local){xy=this.getXY()}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top]}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!contentBox){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx},getFrameWidth:function(sides,onlyContentBox){return onlyContentBox&&Ext.isBorderBox?0:(this.getPadding(sides)+this.getBorderWidth(sides))},setBox:function(box,adjust,animate){var w=box.width,h=box.height;if((adjust&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"))}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint")},1);return this},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0}}else{return this.addStyles(side,El.margins)}},addStyles:function(sides,styles){var val=0,v,w;for(var i=0,len=sides.length;i<len;i++){v=this.getStyle(styles[sides.charAt(i)]);if(v){w=parseInt(v,10);if(w){val+=(w>=0?w:-1*w)}}}return val},createProxy:function(config,renderTo,matchBox){config=typeof config=="object"?config:{tag:"div",cls:config};var proxy;if(renderTo){proxy=Ext.DomHelper.append(renderTo,config,true)}else{proxy=Ext.DomHelper.insertBefore(this.dom,config,true)}if(matchBox){proxy.setBox(this.getBox())}return proxy},mask:function(msg,msgCls){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}if(this._maskMsg){this._maskMsg.remove()}if(this._mask){this._mask.remove()}this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true);this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true);var mm=this._maskMsg;mm.dom.className=msgCls?"ext-el-mask-msg "+msgCls:"ext-el-mask-msg";mm.dom.firstChild.innerHTML=msg;mm.setDisplayed(true);mm.center(this)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setSize(this.dom.clientWidth,this.getHeight())}return this._mask},unmask:function(){if(this._mask){if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}this._mask.remove();delete this._mask}this.removeClass("x-masked")},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="0";el.className="ext-shim";if(Ext.isIE&&Ext.isSecure){el.src=Ext.SSL_SECURE_URL}var shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));shim.autoBoxAdjust=false;return shim},remove:function(){Ext.removeNode(this.dom);delete El.cache[this.dom.id]},hover:function(overFn,outFn,scope){var preOverFn=function(e){if(!e.within(this,true)){overFn.apply(scope||this,arguments)}};var preOutFn=function(e){if(!e.within(this,true)){outFn.apply(scope||this,arguments)}};this.on("mouseover",preOverFn,this.dom);this.on("mouseout",preOutFn,this.dom);return this},addClassOnOver:function(className){this.hover(function(){Ext.fly(this,"_internal").addClass(className)},function(){Ext.fly(this,"_internal").removeClass(className)});return this},addClassOnFocus:function(className){this.on("focus",function(){Ext.fly(this,"_internal").addClass(className)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(className)},this.dom);return this},addClassOnClick:function(className){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(className);var d=Ext.getDoc();var fn=function(){Ext.fly(dom,"_internal").removeClass(className);d.removeListener("mouseup",fn)};d.on("mouseup",fn)});return this},swallowEvent:function(eventName,preventDefault){var fn=function(e){e.stopPropagation();if(preventDefault){e.preventDefault()}};if(Ext.isArray(eventName)){for(var i=0,len=eventName.length;i<len;i++){this.on(eventName[i],fn)}return this}this.on(eventName,fn);return this},parent:function(selector,returnDom){return this.matchNode("parentNode","parentNode",selector,returnDom)},next:function(selector,returnDom){return this.matchNode("nextSibling","nextSibling",selector,returnDom)},prev:function(selector,returnDom){return this.matchNode("previousSibling","previousSibling",selector,returnDom)},first:function(selector,returnDom){return this.matchNode("nextSibling","firstChild",selector,returnDom)},last:function(selector,returnDom){return this.matchNode("previousSibling","lastChild",selector,returnDom)},matchNode:function(dir,start,selector,returnDom){var n=this.dom[start];while(n){if(n.nodeType==1&&(!selector||Ext.DomQuery.is(n,selector))){return !returnDom?Ext.get(n):n}n=n[dir]}return null},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this},createChild:function(config,insertBefore,returnDom){config=config||{tag:"div"};if(insertBefore){return Ext.DomHelper.insertBefore(insertBefore,config,returnDom!==true)}return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,config,returnDom!==true)},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this},insertFirst:function(el,returnDom){el=el||{};if(typeof el=="object"&&!el.nodeType&&!el.dom){return this.createChild(el,this.dom.firstChild,returnDom)}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return !returnDom?Ext.get(el):el}},insertSibling:function(el,where,returnDom){var rt;if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){rt=this.insertSibling(el[i],where,returnDom)}return rt}where=where?where.toLowerCase():"before";el=el||{};var refNode=where=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType&&!el.dom){if(where=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!returnDom)}else{rt=Ext.DomHelper[where=="after"?"insertAfter":"insertBefore"](this.dom,el,!returnDom)}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),refNode);if(!returnDom){rt=Ext.get(rt)}}return rt},wrap:function(config,returnDom){if(!config){config={tag:"div"}}var newEl=Ext.DomHelper.insertBefore(this.dom,config,!returnDom);newEl.dom?newEl.dom.appendChild(this.dom):newEl.appendChild(this.dom);return newEl},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this},replaceWith:function(el){if(typeof el=="object"&&!el.nodeType&&!el.dom){el=this.insertSibling(el,"before")}else{el=Ext.getDom(el);this.dom.parentNode.insertBefore(el,this.dom)}El.uncache(this.id);this.dom.parentNode.removeChild(this.dom);this.dom=el;this.id=Ext.id(el);El.cache[this.id]=this;return this},insertHtml:function(where,html,returnEl){var el=Ext.DomHelper.insertHtml(where,this.dom,html);return returnEl?Ext.get(el):el},set:function(o,useSet){var el=this.dom;useSet=typeof useSet=="undefined"?(el.setAttribute?true:false):useSet;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue}if(attr=="cls"){el.className=o["cls"]}else{if(o.hasOwnProperty(attr)){if(useSet){el.setAttribute(attr,o[attr])}else{el[attr]=o[attr]}}}}if(o.style){Ext.DomHelper.applyStyles(el,o.style)}return this},addKeyListener:function(key,fn,scope){var config;if(typeof key!="object"||Ext.isArray(key)){config={key:key,fn:fn,scope:scope}}else{config={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:scope}}return new Ext.KeyMap(this,config)},addKeyMap:function(config){return new Ext.KeyMap(this,config)},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth},scrollTo:function(side,value,animate){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!animate||!A){this.dom[prop]=value}else{var to=prop=="scrollLeft"?[value,this.dom.scrollTop]:[this.dom.scrollLeft,value];this.anim({scroll:{"to":to}},this.preanim(arguments,2),"scroll")}return this},scroll:function(direction,distance,animate){if(!this.isScrollable()){return }var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;direction=direction.toLowerCase();var scrolled=false;var a=this.preanim(arguments,2);switch(direction){case"l":case"left":if(w-l>cw){var v=Math.min(l+distance,w-cw);this.scrollTo("left",v,a);scrolled=true}break;case"r":case"right":if(l>0){var v=Math.max(l-distance,0);this.scrollTo("left",v,a);scrolled=true}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-distance,0);this.scrollTo("top",v,a);scrolled=true}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+distance,h-ch);this.scrollTo("top",v,a);scrolled=true}break}return scrolled},translatePoints:function(x,y){if(typeof x=="object"||Ext.isArray(x)){y=x[1];x=x[0]}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop}return{left:(x-o[0]+l),top:(y-o[1]+t)}},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l,t;if(Ext.isIE&&Ext.isStrict){l=doc.documentElement.scrollLeft||(doc.body.scrollLeft||0);t=doc.documentElement.scrollTop||(doc.body.scrollTop||0)}else{l=window.pageXOffset||(doc.body.scrollLeft||0);t=window.pageYOffset||(doc.body.scrollTop||0)}return{left:l,top:t}}else{return{left:d.scrollLeft,top:d.scrollTop}}},getColor:function(attr,defaultValue,prefix){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return defaultValue}var color=typeof prefix=="undefined"?"#":prefix;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]);var s=h.toString(16);if(h<16){s="0"+s}color+=s}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);color+=c+c}}else{if(v.length==7){color+=v.substr(1)}}}}return(color.length>5?color.toLowerCase():defaultValue)},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format("<div class=\"{0}\">"+El.boxMarkup+"</div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name]}return d[name]}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name]},getTextWidth:function(text,min,max){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width).constrain(min||0,max||1000000)}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.getUpdateManager=ep.getUpdater;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,defaultUnit){if(v===""||v=="auto"){return v}if(v===undefined){return""}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(defaultUnit||"px")}return v};El.boxMarkup="<div class=\"{0}-tl\"><div class=\"{0}-tr\"><div class=\"{0}-tc\"></div></div></div><div class=\"{0}-ml\"><div class=\"{0}-mr\"><div class=\"{0}-mc\"></div></div></div><div class=\"{0}-bl\"><div class=\"{0}-br\"><div class=\"{0}-bc\"></div></div></div>";El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var docEl;El.get=function(el){var ex,elm,id;if(!el){return null}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null}if(ex=El.cache[el]){ex.dom=elm}else{ex=El.cache[el]=new El(elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=El.cache[id]){ex.dom=el}else{ex=El.cache[id]=new El(el)}return ex}else{if(el instanceof El){if(el!=docEl){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return El.select(el)}else{if(el==document){if(!docEl){var f=function(){};f.prototype=El.prototype;docEl=new f();docEl.dom=document}return docEl}}}}}}return null};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i<len;i++){if(a[i]){delete El.cache[a[i].id||a[i]]}}};El.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(El.collectorThread);return }for(var eid in El.cache){var el=El.cache[eid],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(eid))){delete El.cache[eid];if(d&&Ext.enableListenerCollection){Ext.EventManager.removeAll(d)}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);var flyFn=function(){};flyFn.prototype=El.prototype;var _cls=new flyFn();El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=_cls;El.Flyweight.prototype.isFlyweight=true;El._flyweights={};El.fly=function(el,named){named=named||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[named]){El._flyweights[named]=new El.Flyweight()}El._flyweights[named].dom=el;return El._flyweights[named]};Ext.get=El.get;Ext.fly=El.fly;var noBoxAdjust=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){noBoxAdjust["button"]=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();
+Ext.enableFx=true;Ext.Fx={slideIn:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"t";this.fixDisplay();var D=this.getFxRestore();var I=this.getBox();this.setSize(I);var F=this.fxWrap(D.pos,C,"hidden");var K=this.dom.style;K.visibility="visible";K.position="absolute";var E=function(){B.fxUnwrap(F,D.pos,C);K.width=D.width;K.height=D.height;B.afterFx(C)};var J,L={to:[I.x,I.y]},H={to:I.width},G={to:I.height};switch(A.toLowerCase()){case"t":F.setSize(I.width,0);K.left=K.bottom="0";J={height:G};break;case"l":F.setSize(0,I.height);K.right=K.top="0";J={width:H};break;case"r":F.setSize(0,I.height);F.setX(I.right);K.left=K.top="0";J={width:H,points:L};break;case"b":F.setSize(I.width,0);F.setY(I.bottom);K.left=K.top="0";J={height:G,points:L};break;case"tl":F.setSize(0,0);K.right=K.bottom="0";J={width:H,height:G};break;case"bl":F.setSize(0,0);F.setY(I.y+I.height);K.right=K.top="0";J={width:H,height:G,points:L};break;case"br":F.setSize(0,0);F.setXY([I.right,I.bottom]);K.left=K.top="0";J={width:H,height:G,points:L};break;case"tr":F.setSize(0,0);F.setX(I.x+I.width);K.left=K.bottom="0";J={width:H,height:G,points:L};break}this.dom.style.visibility="visible";F.show();arguments.callee.anim=F.fxanim(J,C,"motion",0.5,"easeOut",E)});return this},slideOut:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"t";var I=this.getFxRestore();var D=this.getBox();this.setSize(D);var G=this.fxWrap(I.pos,C,"visible");var F=this.dom.style;F.visibility="visible";F.position="absolute";G.setSize(D);var J=function(){if(C.useDisplay){B.setDisplayed(false)}else{B.hide()}B.fxUnwrap(G,I.pos,C);F.width=I.width;F.height=I.height;B.afterFx(C)};var E,H={to:0};switch(A.toLowerCase()){case"t":F.left=F.bottom="0";E={height:H};break;case"l":F.right=F.top="0";E={width:H};break;case"r":F.left=F.top="0";E={width:H,points:{to:[D.right,D.y]}};break;case"b":F.left=F.top="0";E={height:H,points:{to:[D.x,D.bottom]}};break;case"tl":F.right=F.bottom="0";E={width:H,height:H};break;case"bl":F.right=F.top="0";E={width:H,height:H,points:{to:[D.x,D.bottom]}};break;case"br":F.left=F.top="0";E={width:H,height:H,points:{to:[D.x+D.width,D.bottom]}};break;case"tr":F.left=F.bottom="0";E={width:H,height:H,points:{to:[D.right,D.y]}};break}arguments.callee.anim=G.fxanim(E,C,"motion",0.5,"easeOut",J)});return this},puff:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.clearOpacity();this.show();var F=this.getFxRestore();var D=this.dom.style;var G=function(){if(B.useDisplay){A.setDisplayed(false)}else{A.hide()}A.clearOpacity();A.setPositioning(F.pos);D.width=F.width;D.height=F.height;D.fontSize="";A.afterFx(B)};var E=this.getWidth();var C=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(E*2)},height:{to:this.adjustHeight(C*2)},points:{by:[-(E*0.5),-(C*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},B,"motion",0.5,"easeOut",G)});return this},switchOff:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.clearOpacity();this.clip();var D=this.getFxRestore();var C=this.dom.style;var E=function(){if(B.useDisplay){A.setDisplayed(false)}else{A.hide()}A.clearOpacity();A.setPositioning(D.pos);C.width=D.width;C.height=D.height;A.afterFx(B)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},B,"motion",0.3,"easeIn",E)}).defer(100,this)})});return this},highlight:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"ffff9c";var D=C.attr||"backgroundColor";this.clearOpacity();this.show();var G=this.getColor(D);var H=this.dom.style[D];var F=(C.endColor||G)||"ffffff";var I=function(){B.dom.style[D]=H;B.afterFx(C)};var E={};E[D]={from:A,to:F};arguments.callee.anim=this.fxanim(E,C,"color",1,"easeIn",I)});return this},frame:function(A,C,D){var B=this.getFxEl();D=D||{};B.queueFx(D,function(){A=A||"#C3DAF9";if(A.length==6){A="#"+A}C=C||1;var G=D.duration||1;this.show();var E=this.getBox();var F=function(){var H=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+A}});var I=Ext.isBorderBox?2:1;H.animate({top:{from:E.y,to:E.y-20},left:{from:E.x,to:E.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:E.height,to:(E.height+(20*I))},width:{from:E.width,to:(E.width+(20*I))}},G,function(){H.remove();if(--C>0){F()}else{B.afterFx(D)}})};F.call(this)});return this},pause:function(C){var A=this.getFxEl();var B={};A.queueFx(B,function(){setTimeout(function(){A.afterFx(B)},C*1000)});return this},fadeIn:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var C=B.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:C}},B,null,0.5,"easeOut",function(){if(C==1){this.clearOpacity()}A.afterFx(B)})});return this},fadeOut:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){arguments.callee.anim=this.fxanim({opacity:{to:B.endOpacity||0}},B,null,0.5,"easeOut",function(){if(this.visibilityMode==Ext.Element.DISPLAY||B.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity();A.afterFx(B)})});return this},scale:function(A,B,C){this.shift(Ext.apply({},C,{width:A,height:B}));return this},shift:function(B){var A=this.getFxEl();B=B||{};A.queueFx(B,function(){var E={},D=B.width,F=B.height,C=B.x,H=B.y,G=B.opacity;if(D!==undefined){E.width={to:this.adjustWidth(D)}}if(F!==undefined){E.height={to:this.adjustHeight(F)}}if(B.left!==undefined){E.left={to:B.left}}if(B.top!==undefined){E.top={to:B.top}}if(B.right!==undefined){E.right={to:B.right}}if(B.bottom!==undefined){E.bottom={to:B.bottom}}if(C!==undefined||H!==undefined){E.points={to:[C!==undefined?C:this.getX(),H!==undefined?H:this.getY()]}}if(G!==undefined){E.opacity={to:G}}if(B.xy!==undefined){E.points={to:B.xy}}arguments.callee.anim=this.fxanim(E,B,"motion",0.35,"easeOut",function(){A.afterFx(B)})});return this},ghost:function(A,C){var B=this.getFxEl();C=C||{};B.queueFx(C,function(){A=A||"b";var H=this.getFxRestore();var E=this.getWidth(),G=this.getHeight();var F=this.dom.style;var J=function(){if(C.useDisplay){B.setDisplayed(false)}else{B.hide()}B.clearOpacity();B.setPositioning(H.pos);F.width=H.width;F.height=H.height;B.afterFx(C)};var D={opacity:{to:0},points:{}},I=D.points;switch(A.toLowerCase()){case"t":I.by=[0,-G];break;case"l":I.by=[-E,0];break;case"r":I.by=[E,0];break;case"b":I.by=[0,G];break;case"tl":I.by=[-E,-G];break;case"bl":I.by=[-E,G];break;case"br":I.by=[E,G];break;case"tr":I.by=[E,-G];break}arguments.callee.anim=this.fxanim(D,C,"motion",0.5,"easeOut",J)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var A=this.fxQueue[0];if(A){A.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var A=this.fxQueue[0];if(A&&A.anim&&A.anim.isAnimated()){this.fxQueue=[A];A.anim.stop(true)}}return this},beforeFx:function(A){if(this.hasActiveFx()&&!A.concurrent){if(A.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var A=this.fxQueue;return A&&A[0]&&A[0].block},queueFx:function(C,A){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(C,this.fxDefaults);if(!C.concurrent){var B=this.beforeFx(C);A.block=C.block;this.fxQueue.push(A);if(B){this.nextFx()}}else{A.call(this)}}return this},fxWrap:function(F,D,C){var B;if(!D.wrap||!(B=Ext.get(D.wrap))){var A;if(D.fixPosition){A=this.getXY()}var E=document.createElement("div");E.style.visibility=C;B=Ext.get(this.dom.parentNode.insertBefore(E,this.dom));B.setPositioning(F);if(B.getStyle("position")=="static"){B.position("relative")}this.clearPositioning("auto");B.clip();B.dom.appendChild(this.dom);if(A){B.setXY(A)}}return B},fxUnwrap:function(A,C,B){this.clearPositioning();this.setPositioning(C);if(!B.wrap){A.dom.parentNode.insertBefore(this.dom,A.dom);A.remove()}},getFxRestore:function(){var A=this.dom.style;return{pos:this.getPositioning(),width:A.width,height:A.height}},afterFx:function(A){if(A.afterStyle){this.applyStyles(A.afterStyle)}if(A.afterCls){this.addClass(A.afterCls)}if(A.remove===true){this.remove()}Ext.callback(A.callback,A.scope,[this]);if(!A.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(D,E,B,F,C,A){B=B||"run";E=E||{};var G=Ext.lib.Anim[B](this.dom,D,(E.duration||F)||0.35,(E.easing||C)||"easeOut",function(){Ext.callback(A,this)},this);E.anim=G;return G}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);
+Ext.CompositeElement=function(A){this.elements=[];this.addElements(A)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(E){if(!E){return this}if(typeof E=="string"){E=Ext.Element.selectorFunction(E)}var D=this.elements;var B=D.length-1;for(var C=0,A=E.length;C<A;C++){D[++B]=Ext.get(E[C])}return this},fill:function(A){this.elements=[];this.add(A);return this},filter:function(A){var B=[];this.each(function(C){if(C.is(A)){B[B.length]=C.dom}});this.fill(B);return this},invoke:function(E,B){var D=this.elements;for(var C=0,A=D.length;C<A;C++){Ext.Element.prototype[E].apply(D[C],B)}return this},add:function(A){if(typeof A=="string"){this.addElements(Ext.Element.selectorFunction(A))}else{if(A.length!==undefined){this.addElements(A)}else{this.addElements([A])}}return this},each:function(E,D){var C=this.elements;for(var B=0,A=C.length;B<A;B++){if(E.call(D||C[B],C[B],this,B)===false){break}}return this},item:function(A){return this.elements[A]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(A){return this.indexOf(A)!==-1},indexOf:function(A){return this.elements.indexOf(Ext.get(A))},removeElement:function(D,F){if(Ext.isArray(D)){for(var C=0,A=D.length;C<A;C++){this.removeElement(D[C])}return this}var B=typeof D=="number"?D:this.indexOf(D);if(B!==-1&&this.elements[B]){if(F){var E=this.elements[B];if(E.dom){E.remove()}else{Ext.removeNode(E)}}this.elements.splice(B,1)}return this},replaceElement:function(D,C,A){var B=typeof D=="number"?D:this.indexOf(D);if(B!==-1){if(A){this.elements[B].replaceWith(C)}else{this.elements.splice(B,1,Ext.get(C))}}return this},clear:function(){this.elements=[]}};(function(){Ext.CompositeElement.createCall=function(B,C){if(!B[C]){B[C]=function(){return this.invoke(C,arguments)}}};for(var A in Ext.Element.prototype){if(typeof Ext.Element.prototype[A]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,A)}}})();Ext.CompositeElementLite=function(A){Ext.CompositeElementLite.superclass.constructor.call(this,A);this.el=new Ext.Element.Flyweight()};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(E){if(E){if(Ext.isArray(E)){this.elements=this.elements.concat(E)}else{var D=this.elements;var B=D.length-1;for(var C=0,A=E.length;C<A;C++){D[++B]=E[C]}}}return this},invoke:function(F,B){var D=this.elements;var E=this.el;for(var C=0,A=D.length;C<A;C++){E.dom=D[C];Ext.Element.prototype[F].apply(E,B)}return this},item:function(A){if(!this.elements[A]){return null}this.el.dom=this.elements[A];return this.el},addListener:function(B,G,F,E){var D=this.elements;for(var C=0,A=D.length;C<A;C++){Ext.EventManager.on(D[C],B,G,F||D[C],E)}return this},each:function(F,E){var C=this.elements;var D=this.el;for(var B=0,A=C.length;B<A;B++){D.dom=C[B];if(F.call(E||D,D,this,B)===false){break}}return this},indexOf:function(A){return this.elements.indexOf(Ext.getDom(A))},replaceElement:function(D,C,A){var B=typeof D=="number"?D:this.indexOf(D);if(B!==-1){C=Ext.getDom(C);if(A){var E=this.elements[B];E.parentNode.insertBefore(C,E);Ext.removeNode(E)}this.elements.splice(B,1,C)}return this}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(A,D,B){var C;if(typeof A=="string"){C=Ext.Element.selectorFunction(A,B)}else{if(A.length!==undefined){C=A}else{throw"Invalid selector"}}if(D===true){return new Ext.CompositeElement(C)}else{return new Ext.CompositeElementLite(C)}};Ext.select=Ext.Element.select;
+Ext.data.Connection=function(A){Ext.apply(this,A);this.addEvents("beforerequest","requestcomplete","requestexception");Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(E){if(this.fireEvent("beforerequest",this,E)!==false){var C=E.params;if(typeof C=="function"){C=C.call(E.scope||window,E)}if(typeof C=="object"){C=Ext.urlEncode(C)}if(this.extraParams){var G=Ext.urlEncode(this.extraParams);C=C?(C+"&"+G):G}var B=E.url||this.url;if(typeof B=="function"){B=B.call(E.scope||window,E)}if(E.form){var D=Ext.getDom(E.form);B=B||D.action;var J=D.getAttribute("enctype");if(E.isUpload||(J&&J.toLowerCase()=="multipart/form-data")){return this.doFormUpload(E,C,B)}var I=Ext.lib.Ajax.serializeForm(D);C=C?(C+"&"+I):I}var K=E.headers;if(this.defaultHeaders){K=Ext.apply(K||{},this.defaultHeaders);if(!E.headers){E.headers=K}}var F={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:E},timeout:E.timeout||this.timeout};var A=E.method||this.method||((C||E.xmlData||E.jsonData)?"POST":"GET");if(A=="GET"&&(this.disableCaching&&E.disableCaching!==false)||E.disableCaching===true){var H=E.disableCachingParam||this.disableCachingParam;B+=(B.indexOf("?")!=-1?"&":"?")+H+"="+(new Date().getTime())}if(typeof E.autoAbort=="boolean"){if(E.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((A=="GET"||E.xmlData||E.jsonData)&&C){B+=(B.indexOf("?")!=-1?"&":"?")+C;C=""}this.transId=Ext.lib.Ajax.request(A,B,F,C,E);return this.transId}else{Ext.callback(E.callback,E.scope,[E,null,null]);return null}},isLoading:function(A){if(A){return Ext.lib.Ajax.isCallInProgress(A)}else{return this.transId?true:false}},abort:function(A){if(A||this.isLoading()){Ext.lib.Ajax.abort(A||this.transId)}},handleResponse:function(A){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestcomplete",this,A,B);Ext.callback(B.success,B.scope,[A,B]);Ext.callback(B.callback,B.scope,[B,true,A])},handleFailure:function(A,C){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestexception",this,A,B,C);Ext.callback(B.failure,B.scope,[A,B]);Ext.callback(B.callback,B.scope,[B,false,A])},doFormUpload:function(E,A,B){var C=Ext.id();var F=document.createElement("iframe");F.id=C;F.name=C;F.className="x-hidden";if(Ext.isIE){F.src=Ext.SSL_SECURE_URL}document.body.appendChild(F);if(Ext.isIE){document.frames[C].name=C}var D=Ext.getDom(E.form);D.target=C;D.method="POST";D.enctype=D.encoding="multipart/form-data";if(B){D.action=B}var L,J;if(A){L=[];A=Ext.urlDecode(A,false);for(var H in A){if(A.hasOwnProperty(H)){J=document.createElement("input");J.type="hidden";J.name=H;J.value=A[H];D.appendChild(J);L.push(J)}}}function G(){var M={responseText:"",responseXML:null};M.argument=E?E.argument:null;try{var O;if(Ext.isIE){O=F.contentWindow.document}else{O=(F.contentDocument||window.frames[C].document)}if(O&&O.body){M.responseText=O.body.innerHTML}if(O&&O.XMLDocument){M.responseXML=O.XMLDocument}else{M.responseXML=O}}catch(N){}Ext.EventManager.removeListener(F,"load",G,this);this.fireEvent("requestcomplete",this,M,E);Ext.callback(E.success,E.scope,[M,E]);Ext.callback(E.callback,E.scope,[E,true,M]);setTimeout(function(){Ext.removeNode(F)},100)}Ext.EventManager.on(F,"load",G,this);D.submit();if(L){for(var I=0,K=L.length;I<K;I++){Ext.removeNode(L[I])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(A){return Ext.lib.Ajax.serializeForm(A)}});
+Ext.Updater=Ext.extend(Ext.util.Observable,{constructor:function(B,A){B=Ext.get(B);if(!A&&B.updateManager){return B.updateManager}this.el=B;this.defaultUrl=null;this.addEvents("beforeupdate","update","failure");var C=Ext.Updater.defaults;this.sslBlankUrl=C.sslBlankUrl;this.disableCaching=C.disableCaching;this.indicatorText=C.indicatorText;this.showLoadIndicator=C.showLoadIndicator;this.timeout=C.timeout;this.loadScripts=C.loadScripts;this.transaction=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);if(!this.renderer){this.renderer=this.getDefaultRenderer()}Ext.Updater.superclass.constructor.call(this)},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},getEl:function(){return this.el},update:function(B,F,G,D){if(this.fireEvent("beforeupdate",this.el,B,F)!==false){var A,C;if(typeof B=="object"){A=B;B=A.url;F=F||A.params;G=G||A.callback;D=D||A.discardUrl;C=A.scope;if(typeof A.nocache!="undefined"){this.disableCaching=A.nocache}if(typeof A.text!="undefined"){this.indicatorText="<div class=\"loading-indicator\">"+A.text+"</div>"}if(typeof A.scripts!="undefined"){this.loadScripts=A.scripts}if(typeof A.timeout!="undefined"){this.timeout=A.timeout}}this.showLoading();if(!D){this.defaultUrl=B}if(typeof B=="function"){B=B.call(this)}var E=Ext.apply({},{url:B,params:(typeof F=="function"&&C)?F.createDelegate(C):F,success:this.processSuccess,failure:this.processFailure,scope:this,callback:undefined,timeout:(this.timeout*1000),disableCaching:this.disableCaching,argument:{"options":A,"url":B,"form":null,"callback":G,"scope":C||window,"params":F}},A);this.transaction=Ext.Ajax.request(E)}},formUpdate:function(C,A,B,D){if(this.fireEvent("beforeupdate",this.el,C,A)!==false){if(typeof A=="function"){A=A.call(this)}C=Ext.getDom(C);this.transaction=Ext.Ajax.request({form:C,url:A,success:this.processSuccess,failure:this.processFailure,scope:this,timeout:(this.timeout*1000),argument:{"url":A,"form":C,"callback":D,"reset":B}});this.showLoading.defer(1,this)}},refresh:function(A){if(this.defaultUrl==null){return }this.update(this.defaultUrl,null,A,true)},startAutoRefresh:function(B,C,D,E,A){if(A){this.update(C||this.defaultUrl,D,E,true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[C||this.defaultUrl,D,E,true]),B*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText)}},processSuccess:function(A){this.transaction=null;if(A.argument.form&&A.argument.reset){try{A.argument.form.reset()}catch(B){}}if(this.loadScripts){this.renderer.render(this.el,A,this,this.updateComplete.createDelegate(this,[A]))}else{this.renderer.render(this.el,A,this);this.updateComplete(A)}},updateComplete:function(A){this.fireEvent("update",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback.call(A.argument.scope,this.el,true,A,A.argument.options)}},processFailure:function(A){this.transaction=null;this.fireEvent("failure",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback.call(A.argument.scope,this.el,false,A,A.argument.options)}},setRenderer:function(A){this.renderer=A},getRenderer:function(){return this.renderer},setDefaultUrl:function(A){this.defaultUrl=A},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){if(this.transaction){return Ext.Ajax.isLoading(this.transaction)}return false}});Ext.Updater.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:"<div class=\"loading-indicator\">Loading...</div>"};Ext.Updater.updateElement=function(D,C,E,B){var A=Ext.get(D).getUpdater();Ext.apply(A,B);A.update(C,E,B?B.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(C,A,B,D){C.update(A.responseText,B.loadScripts,D)}};Ext.UpdateManager=Ext.Updater;
+(function(){Date.formatCodeToRegex=function(character,currentGroup){var p=Date.parseCodes[character];if(p){p=Ext.type(p)=="function"?p():p;Date.parseCodes[character]=p}return p?Ext.applyIf({c:p.c?String.format(p.c,currentGroup||"{0}"):p.c},p):{g:0,c:null,s:Ext.escapeRe(character)}};var $f=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{count:0},parseRegexes:[],formatFunctions:{count:0},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(month){return Date.monthNames[month].substring(0,3)},getShortDayName:function(day){return Date.dayNames[day].substring(0,3)},getMonthNumber:function(name){return Date.monthNumbers[name.substring(0,1).toUpperCase()+name.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var c="Y-m-dTH:i:sP",code=[],i=0,l=c.length;i<l;++i){var e=c.charAt(i);code.push(e=="T"?"'T'":Date.getFormatCode(e))}return code.join(" + ")},U:"Math.round(this.getTime() / 1000)"},parseDate:function(input,format){var p=Date.parseFunctions;if(p[format]==null){Date.createParser(format)}var func=p[format];return Date[func](input)},getFormatCode:function(character){var f=Date.formatCodes[character];if(f){f=Ext.type(f)=="function"?f():f;Date.formatCodes[character]=f}return f||("'"+String.escape(character)+"'")},createNewFormat:function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function(){return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;code+="'"+String.escape(ch)+"' + "}else{code+=Date.getFormatCode(ch)+" + "}}}eval(code.substring(0,code.length-3)+";}")},createParser:function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input){\n"+"var y, m, d, h = 0, i = 0, s = 0, ms = 0, o, z, u, v;\n"+"input = String(input);\n"+"d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"var results = input.match(Date.parseRegexes["+regexNum+"]);\n"+"if (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;regex+=String.escape(ch)}else{var obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c}}}}code+="if (u){\n"+"v = new Date(u * 1000);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){\n"+"v = new Date(y, m, d, h, i, s, ms);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){\n"+"v = new Date(y, m, d, h, i, s);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){\n"+"v = new Date(y, m, d, h, i);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){\n"+"v = new Date(y, m, d, h);\n"+"}else if (y >= 0 && m >= 0 && d > 0){\n"+"v = new Date(y, m, d);\n"+"}else if (y >= 0 && m >= 0){\n"+"v = new Date(y, m);\n"+"}else if (y >= 0){\n"+"v = new Date(y);\n"+"}\n}\nreturn (v && (z || o))?"+" (Ext.type(z) == 'number' ? v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - z) :"+" v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn))) : v;\n"+"}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$","i");eval(code)},parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var a=[],i=0;i<7;a.push(Date.getShortDayName(i)),++i){}return{g:0,c:null,s:"(?:"+a.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:0,c:null,s:"(?:\\d{1,3}"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var a=[],i=0;i<12;a.push(Date.getShortMonthName(i)),++i){}return Ext.applyIf({s:"("+a.join("|")+")"},$f("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return $f("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"},g:function(){return $f("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return $f("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);","var mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);","var mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"z = results[{0}] * 1;\n"+"z = (-43200 <= z && z <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var calc=[];var arr=[$f("Y",1),$f("m",2),$f("d",3),$f("h",4),$f("i",5),$f("s",6),{c:"ms = (results[7] || '.0').substring(1); ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:"if(results[9] == 'Z'){\no = 0;\n}else{\n"+$f("P",9).c+"\n}"}];for(var i=0,l=arr.length;i<l;++i){calc.push(arr[i].c)}return{g:1,c:calc.join(""),s:arr[0].s+"-"+arr[1].s+"-"+arr[2].s+"T"+arr[3].s+":"+arr[4].s+":"+arr[5].s+"((.|,)\\d+)?"+"("+$f("P",null).s+"|Z)"}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.override(Date,{dateFormat:function(B){if(Date.formatFunctions[B]==null){Date.createNewFormat(B)}var A=Date.formatFunctions[B];return this[A]()},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(A){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+(A?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var A=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var B=0;B<this.getMonth();++B){A+=Date.daysInMonth[B]}return A+this.getDate()-1},getWeekOfYear:function(){var B=86400000;var C=7*B;var D=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/B;var A=Math.floor(D/7);var E=new Date(A*C).getUTCFullYear();return A-Math.floor(Date.UTC(E,0,7)/C)+1},isLeapYear:function(){var A=this.getFullYear();return !!((A&3)==0&&(A%100||(A%400==0&&A)))},getFirstDayOfMonth:function(){var A=(this.getDay()-(this.getDate()-1))%7;return(A<0)?(A+7):A},getLastDayOfMonth:function(){var A=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(A<0)?(A+7):A},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]},getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},clearTime:function(A){if(A){return this.clone().clearTime()}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this},add:function(B,C){var D=this.clone();if(!B||C===0){return D}switch(B.toLowerCase()){case Date.MILLI:D.setMilliseconds(this.getMilliseconds()+C);break;case Date.SECOND:D.setSeconds(this.getSeconds()+C);break;case Date.MINUTE:D.setMinutes(this.getMinutes()+C);break;case Date.HOUR:D.setHours(this.getHours()+C);break;case Date.DAY:D.setDate(this.getDate()+C);break;case Date.MONTH:var A=this.getDate();if(A>28){A=Math.min(A,this.getFirstDateOfMonth().add("mo",C).getLastDateOfMonth().getDate())}D.setDate(A);D.setMonth(this.getMonth()+C);break;case Date.YEAR:D.setFullYear(this.getFullYear()+C);break}return D},between:function(C,A){var B=this.getTime();return C.getTime()<=B&&B<=A.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(A){if(A<=-1){var D=Math.ceil(-A);var C=Math.ceil(D/12);var B=(D%12)?12-D%12:0;this.setFullYear(this.getFullYear()-C);return Date.brokenSetMonth.call(this,B)}else{return Date.brokenSetMonth.apply(this,arguments)}}};
+Ext.util.DelayedTask=function(E,D,A){var G=null,F,B;var C=function(){var H=new Date().getTime();if(H-B>=F){clearInterval(G);G=null;E.apply(D,A||[])}};this.delay=function(I,K,J,H){if(G&&I!=F){this.cancel()}F=I;B=new Date().getTime();E=K||E;D=J||D;A=H||A;if(!G){G=setInterval(C,F)}};this.cancel=function(){if(G){clearInterval(G);G=null}}};
+Ext.util.TaskRunner=function(E){E=E||10;var F=[],A=[];var B=0;var G=false;var D=function(){G=false;clearInterval(B);B=0};var H=function(){if(!G){G=true;B=setInterval(I,E)}};var C=function(J){A.push(J);if(J.onStop){J.onStop.apply(J.scope||J)}};var I=function(){if(A.length>0){for(var O=0,K=A.length;O<K;O++){F.remove(A[O])}A=[];if(F.length<1){D();return }}var M=new Date().getTime();for(var O=0,K=F.length;O<K;++O){var N=F[O];var J=M-N.taskRunTime;if(N.interval<=J){var L=N.run.apply(N.scope||N,N.args||[++N.taskRunCount]);N.taskRunTime=M;if(L===false||N.taskRunCount===N.repeat){C(N);return }}if(N.duration&&N.duration<=(M-N.taskStartTime)){C(N)}}};this.start=function(J){F.push(J);J.taskStartTime=new Date().getTime();J.taskRunTime=0;J.taskRunCount=0;H();return J};this.stop=function(J){C(J);return J};this.stopAll=function(){D();for(var K=0,J=F.length;K<J;K++){if(F[K].onStop){F[K].onStop()}}F=[];A=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();
+Ext.util.MixedCollection=function(B,A){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=B===true;if(A){this.getKey=A}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(B,C){if(arguments.length==1){C=arguments[0];B=this.getKey(C)}if(typeof B=="undefined"||B===null){this.length++;this.items.push(C);this.keys.push(null)}else{var A=this.map[B];if(A){return this.replace(B,C)}this.length++;this.items.push(C);this.map[B]=C;this.keys.push(B)}this.fireEvent("add",this.length-1,C,B);return C},getKey:function(A){return A.id},replace:function(C,D){if(arguments.length==1){D=arguments[0];C=this.getKey(D)}var A=this.item(C);if(typeof C=="undefined"||C===null||typeof A=="undefined"){return this.add(C,D)}var B=this.indexOfKey(C);this.items[B]=D;this.map[C]=D;this.fireEvent("replace",C,A,D);return D},addAll:function(E){if(arguments.length>1||Ext.isArray(E)){var B=arguments.length>1?arguments:E;for(var D=0,A=B.length;D<A;D++){this.add(B[D])}}else{for(var C in E){if(this.allowFunctions||typeof E[C]!="function"){this.add(C,E[C])}}}},each:function(E,D){var B=[].concat(this.items);for(var C=0,A=B.length;C<A;C++){if(E.call(D||B[C],B[C],C,A)===false){break}}},eachKey:function(D,C){for(var B=0,A=this.keys.length;B<A;B++){D.call(C||window,this.keys[B],this.items[B],B,A)}},find:function(D,C){for(var B=0,A=this.items.length;B<A;B++){if(D.call(C||window,this.items[B],this.keys[B])){return this.items[B]}}return null},insert:function(A,B,C){if(arguments.length==2){C=arguments[1];B=this.getKey(C)}if(A>=this.length){return this.add(B,C)}this.length++;this.items.splice(A,0,C);if(typeof B!="undefined"&&B!=null){this.map[B]=C}this.keys.splice(A,0,B);this.fireEvent("add",A,C,B);return C},remove:function(A){return this.removeAt(this.indexOf(A))},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var C=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B]}this.keys.splice(A,1);this.fireEvent("remove",C,B);return C}return false},removeKey:function(A){return this.removeAt(this.indexOfKey(A))},getCount:function(){return this.length},indexOf:function(A){return this.items.indexOf(A)},indexOfKey:function(A){return this.keys.indexOf(A)},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];return typeof B!="function"||this.allowFunctions?B:null},itemAt:function(A){return this.items[A]},key:function(A){return this.map[A]},contains:function(A){return this.indexOf(A)!=-1},containsKey:function(A){return typeof this.map[A]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(I,A,H){var C=String(A).toUpperCase()=="DESC"?-1:1;H=H||function(K,J){return K-J};var G=[],B=this.keys,F=this.items;for(var D=0,E=F.length;D<E;D++){G[G.length]={key:B[D],value:F[D],index:D}}G.sort(function(K,J){var L=H(K[I],J[I])*C;if(L==0){L=(K.index<J.index?-1:1)}return L});for(var D=0,E=G.length;D<E;D++){F[D]=G[D].value;B[D]=G[D].key}this.fireEvent("sort",this)},sort:function(A,B){this._sort("value",A,B)},keySort:function(A,B){this._sort("key",A,B||function(D,C){return String(D).toUpperCase()-String(C).toUpperCase()})},getRange:function(E,A){var B=this.items;if(B.length<1){return[]}E=E||0;A=Math.min(typeof A=="undefined"?this.length-1:A,this.length-1);var D=[];if(E<=A){for(var C=E;C<=A;C++){D[D.length]=B[C]}}else{for(var C=E;C>=A;C--){D[D.length]=B[C]}}return D},filter:function(C,B,D,A){if(Ext.isEmpty(B,false)){return this.clone()}B=this.createValueMatcher(B,D,A);return this.filterBy(function(E){return E&&B.test(E[C])})},filterBy:function(F,E){var G=new Ext.util.MixedCollection();G.getKey=this.getKey;var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){if(F.call(E||this,D[C],B[C])){G.add(B[C],D[C])}}return G},findIndex:function(C,B,E,D,A){if(Ext.isEmpty(B,false)){return -1}B=this.createValueMatcher(B,D,A);return this.findIndexBy(function(F){return F&&B.test(F[C])},null,E)},findIndexBy:function(F,E,G){var B=this.keys,D=this.items;for(var C=(G||0),A=D.length;C<A;C++){if(F.call(E||this,D[C],B[C])){return C}}if(typeof G=="number"&&G>0){for(var C=0;C<G;C++){if(F.call(E||this,D[C],B[C])){return C}}}return -1},createValueMatcher:function(B,C,A){if(!B.exec){B=String(B);B=new RegExp((C===true?"":"^")+Ext.escapeRe(B),A?"":"i")}return B},clone:function(){var E=new Ext.util.MixedCollection();var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){E.add(B[C],D[C])}E.getKey=this.getKey;return E}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;
+Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty;var pad=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return"\""+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+"\""}return"\""+s+"\""};var encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return"\""+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+"\""};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(typeof o=="string"){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(json){return eval("("+json+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;
+Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g;return{ellipsis:function(value,len){if(value&&value.length>len){return value.substr(0,len-3)+"..."}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,"\"").replace(/&amp;/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split(".");var whole=ps[0];var sub=ps[1]?"."+ps[1]:".00";var r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1"+","+"$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"")},stripScriptsRe:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,stripScripts:function(v){return !v?v:String(v).replace(this.stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),nl2br:function(v){return v===undefined||v===null?"":v.replace(/\n/g,"<br/>")}}}();
+Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var P=this.html;P=["<tpl>",P,"</tpl>"].join("");var O=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var N=/^<tpl\b[^>]*?for="(.*?)"/;var L=/^<tpl\b[^>]*?if="(.*?)"/;var J=/^<tpl\b[^>]*?exec="(.*?)"/;var C,B=0;var G=[];while(C=P.match(O)){var M=C[0].match(N);var K=C[0].match(L);var I=C[0].match(J);var E=null,H=null,D=null;var A=M&&M[1]?M[1]:"";if(K){E=K&&K[1]?K[1]:null;if(E){H=new Function("values","parent","xindex","xcount","with(values){ return "+(Ext.util.Format.htmlDecode(E))+"; }")}}if(I){E=I&&I[1]?I[1]:null;if(E){D=new Function("values","parent","xindex","xcount","with(values){ "+(Ext.util.Format.htmlDecode(E))+"; }")}}if(A){switch(A){case".":A=new Function("values","parent","with(values){ return values; }");break;case"..":A=new Function("values","parent","with(values){ return parent; }");break;default:A=new Function("values","parent","with(values){ return "+A+"; }")}}G.push({id:B,target:A,exec:D,test:H,body:C[1]||""});P=P.replace(C[0],"{xtpl"+B+"}");++B}for(var F=G.length-1;F>=0;--F){this.compileTpl(G[F])}this.master=G[G.length-1];this.tpls=G};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(A,H,G,D,C){var J=this.tpls[A];if(J.test&&!J.test.call(this,H,G,D,C)){return""}if(J.exec&&J.exec.call(this,H,G,D,C)){return""}var I=J.target?J.target.call(this,H,G):H;G=J.target?H:G;if(J.target&&Ext.isArray(I)){var B=[];for(var E=0,F=I.length;E<F;E++){B[B.length]=J.compiled.call(this,I[E],G,E+1,F)}return B.join("")}return J.compiled.call(this,I,G,D,C)},compileTpl:function(tpl){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format="this.call(\""+format.substr(5)+"\", ";args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"};var codeFn=function(m,code){return"'"+sep+"("+code+")"+sep+"'"};var body;if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(A){return this.master.compiled.call(this,A,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(A){A=Ext.getDom(A);return new Ext.XTemplate(A.value||A.innerHTML)};
+Ext.util.CSS=function(){var D=null;var C=document;var B=/(-[a-z])/gi;var A=function(E,F){return F.charAt(1).toUpperCase()};return{createStyleSheet:function(G,J){var F;var E=C.getElementsByTagName("head")[0];var I=C.createElement("style");I.setAttribute("type","text/css");if(J){I.setAttribute("id",J)}if(Ext.isIE){E.appendChild(I);F=I.styleSheet;F.cssText=G}else{try{I.appendChild(C.createTextNode(G))}catch(H){I.cssText=G}E.appendChild(I);F=I.styleSheet?I.styleSheet:(I.sheet||C.styleSheets[C.styleSheets.length-1])}this.cacheStyleSheet(F);return F},removeStyleSheet:function(F){var E=C.getElementById(F);if(E){E.parentNode.removeChild(E)}},swapStyleSheet:function(G,E){this.removeStyleSheet(G);var F=C.createElement("link");F.setAttribute("rel","stylesheet");F.setAttribute("type","text/css");F.setAttribute("id",G);F.setAttribute("href",E);C.getElementsByTagName("head")[0].appendChild(F)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(F){if(!D){D={}}try{var H=F.cssRules||F.rules;for(var E=H.length-1;E>=0;--E){D[H[E].selectorText]=H[E]}}catch(G){}},getRules:function(F){if(D==null||F){D={};var H=C.styleSheets;for(var G=0,E=H.length;G<E;G++){try{this.cacheStyleSheet(H[G])}catch(I){}}}return D},getRule:function(E,G){var F=this.getRules(G);if(!Ext.isArray(E)){return F[E]}for(var H=0;H<E.length;H++){if(F[E[H]]){return F[E[H]]}}return null},updateRule:function(E,H,G){if(!Ext.isArray(E)){var I=this.getRule(E);if(I){I.style[H.replace(B,A)]=G;return true}}else{for(var F=0;F<E.length;F++){if(this.updateRule(E[F],H,G)){return true}}}return false}}}();
+Ext.util.ClickRepeater=function(B,A){this.el=Ext.get(B);this.el.unselectable();Ext.apply(this,A);this.addEvents("mousedown","click","mouseup");this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(C){if(this.preventDefault){C.preventDefault()}if(this.stopDefault){C.stopEvent()}},this)}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this)},easeOutExpo:function(B,A,D,C){return(B==C)?A+D:D*(-Math.pow(2,-10*B/C)+1)+A},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});
+Ext.KeyNav=function(B,A){this.el=Ext.get(B);Ext.apply(this,A);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(Ext.isSafari2&&B&&A>=37&&A<=40){C.stopEvent()}},relay:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(B&&this[B]){if(this.doRelay(C,this[B],B)!==true){C[this.defaultEventAction]()}}},doRelay:function(C,B,A){return B.call(this.scope||this,C)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.un("keydown",this.relay)}else{this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay)}this.disabled=true}}};
+Ext.KeyMap=function(C,B,A){this.el=Ext.get(C);this.eventName=A||"keydown";this.bindings=[];if(B){this.addBinding(B)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(D){if(Ext.isArray(D)){for(var F=0,H=D.length;F<H;F++){this.addBinding(D[F])}return }var N=D.key,C=D.shift,A=D.ctrl,G=D.alt,J=D.fn||D.handler,M=D.scope;if(D.stopEvent){this.stopEvent=D.stopEvent}if(typeof N=="string"){var K=[];var I=N.toUpperCase();for(var E=0,H=I.length;E<H;E++){K.push(I.charCodeAt(E))}N=K}var B=Ext.isArray(N);var L=function(R){if((!C||R.shiftKey)&&(!A||R.ctrlKey)&&(!G||R.altKey)){var P=R.getKey();if(B){for(var Q=0,O=N.length;Q<O;Q++){if(N[Q]==P){if(this.stopEvent){R.stopEvent()}J.call(M||window,P,R);return }}}else{if(P==N){if(this.stopEvent){R.stopEvent()}J.call(M||window,P,R)}}}};this.bindings.push(L)},on:function(B,D,C){var G,A,E,F;if(typeof B=="object"&&!Ext.isArray(B)){G=B.key;A=B.shift;E=B.ctrl;F=B.alt}else{G=B}this.addBinding({key:G,shift:A,ctrl:E,alt:F,fn:D,scope:C})},handleKeyDown:function(D){if(this.enabled){var B=this.bindings;for(var C=0,A=B.length;C<A;C++){B[C].call(this,D)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}}};
+Ext.util.TextMetrics=function(){var A;return{measure:function(B,C,D){if(!A){A=Ext.util.TextMetrics.Instance(B,D)}A.bind(B);A.setFixedWidth(D||"auto");return A.getSize(C)},createInstance:function(B,C){return Ext.util.TextMetrics.Instance(B,C)}}}();Ext.util.TextMetrics.Instance=function(B,D){var C=new Ext.Element(document.createElement("div"));document.body.appendChild(C.dom);C.position("absolute");C.setLeftTop(-1000,-1000);C.hide();if(D){C.setWidth(D)}var A={getSize:function(F){C.update(F);var E=C.getSize();C.update("");return E},bind:function(E){C.setStyle(Ext.fly(E).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(E){C.setWidth(E)},getWidth:function(E){C.dom.style.width="auto";return this.getSize(E).width},getHeight:function(E){return this.getSize(E).height}};A.bind(B);return A};Ext.Element.measureText=Ext.util.TextMetrics.measure;
+(function(){var A=Ext.EventManager;var B=Ext.lib.Dom;Ext.dd.DragDrop=function(E,C,D){if(E){this.init(E,C,D)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(H,F,M){if(typeof F=="number"){F={left:F,right:F,top:F,bottom:F}}F=F||this.defaultPadding;var J=Ext.get(this.getEl()).getBox();var C=Ext.get(H);var L=C.getScroll();var I,D=C.dom;if(D==document.body){I={x:L.left,y:L.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var K=C.getXY();I={x:K[0]+L.left,y:K[1]+L.top,width:D.clientWidth,height:D.clientHeight}}var G=J.y-I.y;var E=J.x-I.x;this.resetConstraints();this.setXConstraint(E-(F.left||0),I.width-E-J.width-(F.right||0),this.xTickSize);this.setYConstraint(G-(F.top||0),I.height-G-J.height-(F.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(E,C,D){this.initTarget(E,C,D);A.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(E,C,D){this.config=D||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof E!=="string"){E=Ext.id(E)}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E]}else{if(!F&&0!==F){this.padding=[E,C,E,C]}else{this.padding=[E,C,F,D]}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){return }var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H)},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1]},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C)},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C]}this.DDM.removeDDFromGroup(this,C)},setDragElId:function(C){this.dragElId=C},setHandleElId:function(C){if(typeof C!=="string"){C=Ext.id(C)}this.handleElId=C;this.DDM.regHandle(this.id,C)},setOuterHandleElId:function(C){if(typeof C!=="string"){C=Ext.id(C)}A.on(C,"mousedown",this.handleMouseDown,this);this.setHandleElId(C);this.hasOuterHandles=true},unreg:function(){A.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(E,D){if(this.primaryButtonOnly&&E.button!=0){return }if(this.isLocked()){return }this.DDM.refreshCache(this.groups);var C=new Ext.lib.Point(Ext.lib.Event.getPageX(E),Ext.lib.Event.getPageY(E));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(C,this)){}else{if(this.clickValidator(E)){this.setStartPosition();this.b4MouseDown(E);this.onMouseDown(E);this.DDM.handleMouseDown(E,this);this.DDM.stopEvent(E)}else{}}},clickValidator:function(D){var C=D.getTarget();return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)))},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D},addInvalidHandleId:function(C){if(typeof C!=="string"){C=Ext.id(C)}this.invalidHandleIds[C]=C},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C)},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D]},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=Ext.id(C)}delete this.invalidHandleIds[C]},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E]}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase()}catch(G){H=F.nodeName}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!Ext.fly(F).hasClass(this.invalidHandleClasses[D])}return E},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(E,D,C){this.leftConstraint=E;this.rightConstraint=D;this.minX=this.initPageX-E;this.maxX=this.initPageX+D;if(C){this.setXTicks(this.initPageX,C)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(C,E,D){this.topConstraint=C;this.bottomConstraint=E;this.minY=this.initPageY-C;this.maxY=this.initPageY+E;if(D){this.setYTicks(this.initPageY,D)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(I,F){if(!F){return I}else{if(F[0]>=I){return F[0]}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E]}}return F[F.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var A=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue}F[D].apply(F,C)}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true)},_onResize:function(B){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(C,B){if(!this.initialized){this.init()}if(!this.ids[B]){this.ids[B]={}}this.ids[B][C.id]=C},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={}}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id]}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id]}}delete this.handleIds[C.id]},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={}}this.handleIds[C][B]=B},isDragDrop:function(B){return(this.getDDById(B))?true:false},getRelated:function(F,C){var E=[];for(var D in F.groups){for(j in this.ids[D]){var B=this.ids[D][j];if(!this.isTypeOfDD(B)){continue}if(!C||B.isTarget){E[E.length]=B}}}return E},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true}}return false},isTypeOfDD:function(B){return(B&&B.__ygDragDrop)},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B])},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C]}}return null},handleMouseDown:function(D,C){if(Ext.QuickTips){Ext.QuickTips.disable()}this.currentTarget=D.getTarget();this.dragCurrent=C;var B=C.getEl();this.startX=D.getPageX();this.startY=D.getPageY();this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=Ext.dd.DDM;E.startDrag(E.startX,E.startY)},this.clickTimeThresh)},startDrag:function(B,C){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(B,C);this.dragCurrent.startDrag(B,C)}this.dragThreshMet=true},handleMouseUp:function(B){if(Ext.QuickTips){Ext.QuickTips.enable()}if(!this.dragCurrent){return }clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(B,true)}else{}this.stopDrag(B);this.stopEvent(B)},stopEvent:function(B){if(this.stopPropagation){B.stopPropagation()}if(this.preventDefault){B.preventDefault()}},stopDrag:function(B){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(B);this.dragCurrent.endDrag(B)}this.dragCurrent.onMouseUp(B)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(D){if(!this.dragCurrent){return true}if(Ext.isIE&&(D.button!==0&&D.button!==1&&D.button!==2)){this.stopEvent(D);return this.handleMouseUp(D)}if(!this.dragThreshMet){var C=Math.abs(this.startX-D.getPageX());var B=Math.abs(this.startY-D.getPageY());if(C>this.clickPixelThresh||B>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(D);this.dragCurrent.onDrag(D);if(!this.dragCurrent.moveOnly){this.fireEvents(D,false)}}this.stopEvent(D);return true},fireEvents:function(K,L){var N=this.dragCurrent;if(!N||N.isLocked()){return }var O=K.getPoint();var B=[];var E=[];var I=[];var G=[];var D=[];for(var F in this.dragOvers){var C=this.dragOvers[F];if(!this.isTypeOfDD(C)){continue}if(!this.isOverTarget(O,C,this.mode)){E.push(C)}B[F]=true;delete this.dragOvers[F]}for(var M in N.groups){if("string"!=typeof M){continue}for(F in this.ids[M]){var H=this.ids[M][F];if(!this.isTypeOfDD(H)){continue}if(H.isTarget&&!H.isLocked()&&H!=N){if(this.isOverTarget(O,H,this.mode)){if(L){G.push(H)}else{if(!B[H.id]){D.push(H)}else{I.push(H)}this.dragOvers[H.id]=H}}}}}if(this.mode){if(E.length){N.b4DragOut(K,E);N.onDragOut(K,E)}if(D.length){N.onDragEnter(K,D)}if(I.length){N.b4DragOver(K,I);N.onDragOver(K,I)}if(G.length){N.b4DragDrop(K,G);N.onDragDrop(K,G)}}else{var J=0;for(F=0,J=E.length;F<J;++F){N.b4DragOut(K,E[F].id);N.onDragOut(K,E[F].id)}for(F=0,J=D.length;F<J;++F){N.onDragEnter(K,D[F].id)}for(F=0,J=I.length;F<J;++F){N.b4DragOver(K,I[F].id);N.onDragOver(K,I[F].id)}for(F=0,J=G.length;F<J;++F){N.b4DragDrop(K,G[F].id);N.onDragDrop(K,G[F].id)}}if(L&&!G.length){N.onInvalidDrop(K)}},getBestMatch:function(D){var F=null;var C=D.length;if(C==1){F=D[0]}else{for(var E=0;E<C;++E){var B=D[E];if(B.cursorIsOver){F=B;break}else{if(!F||F.overlap.getArea()<B.overlap.getArea()){F=B}}}}return F},refreshCache:function(C){for(var B in C){if("string"!=typeof B){continue}for(var D in this.ids[B]){var E=this.ids[B][D];if(this.isTypeOfDD(E)){var F=this.getLocation(E);if(F){this.locationCache[E.id]=F}else{delete this.locationCache[E.id]}}}}},verifyEl:function(C){if(C){var B;if(Ext.isIE){try{B=C.offsetParent}catch(D){}}else{B=C.offsetParent}if(B){return true}}return false},getLocation:function(G){if(!this.isTypeOfDD(G)){return null}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=Ext.lib.Dom.getXY(E)}catch(H){}if(!J){return null}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new Ext.lib.Region(M,B,I,F)},isOverTarget:function(J,B,D){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F}if(!F){return false}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||!I.getTargetCoord||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver}B.overlap=null;var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();var E=new Ext.lib.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver}else{return false}},_onUnload:function(C,B){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var B in this.elementCache){delete this.elementCache[B]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(Ext.getDom(C))}return B},getElement:function(B){return Ext.getDom(B)},getCss:function(C){var B=Ext.getDom(C);return(B)?B.style:null},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style},getPosX:function(B){return Ext.lib.Dom.getX(B)},getPosY:function(B){return Ext.lib.Dom.getY(B)},swapNode:function(D,B){if(D.swapNode){D.swapNode(B)}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B)}else{if(B==D.nextSibling){E.insertBefore(B,D)}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C)}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft}else{if(C){D=C.scrollTop;B=C.scrollLeft}else{}}return{top:D,left:B}},getStyle:function(C,B){return Ext.fly(C).getStyle(B)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(B,D){var C=Ext.lib.Dom.getXY(D);Ext.lib.Dom.setXY(B,C)},numericSort:function(C,B){return(C-B)},_timeoutCount:0,_addListeners:function(){var B=Ext.dd.DDM;if(Ext.lib.Event&&document){B._onLoad()}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true}else{C=C.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(C,A,B){if(C){this.init(C,A,B)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D)},setDelta:function(B,A){this.deltaX=B;this.deltaY=A},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B)},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);var B=C.dom?C:Ext.fly(C,"_dd");if(!this.deltaSetXY){var H=[E.x,E.y];B.setXY(H);var D=B.getLeft(true);var A=B.getTop(true);this.deltaSetXY=[D-E.x,A-E.y]}else{B.setLeftTop(E.x+this.deltaSetXY[0],E.y+this.deltaSetXY[1])}this.cachePosition(E.x,E.y);this.autoScroll(E.x,E.y,C.offsetHeight,C.offsetWidth);return E},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A}else{var C=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1]}},autoScroll:function(J,I,E,K){if(this.scroll){var L=Ext.lib.Dom.getViewHeight();var B=Ext.lib.Dom.getViewWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A)}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A)}if(M>B&&F<C){window.scrollTo(D+A,N)}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N)}}},getTargetCoord:function(C,B){var A=C-this.deltaX;var D=B-this.deltaY;if(this.constrainX){if(A<this.minX){A=this.minX}if(A>this.maxX){A=this.maxX}}if(this.constrainY){if(D<this.minY){D=this.minY}if(D>this.maxY){D=this.maxY}}A=this.getTick(A,this.xTicks);D=this.getTick(D,this.yTicks);return{x:A,y:D}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(A){this.autoOffset(A.getPageX(),A.getPageY())},b4Drag:function(A){this.setDragElPos(A.getPageX(),A.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this;var A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame()},50);return }var D=this.getDragEl();if(!D){D=document.createElement("div");D.id=this.dragElId;var C=D.style;C.position="absolute";C.visibility="hidden";C.cursor="move";C.border="2px solid #aaa";C.zIndex=999;A.insertBefore(D,A.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2))}this.setDragElPos(E,D);Ext.fly(A).show()},_resizeProxy:function(){if(this.resizeFrame){var A=this.getEl();Ext.fly(this.getDragEl()).setSize(A.offsetWidth,A.offsetHeight)}},b4MouseDown:function(B){var A=B.getPageX();var C=B.getPageY();this.autoOffset(A,C);this.setDragElPos(A,C)},b4StartDrag:function(A,B){this.showFrame(A,B)},b4EndDrag:function(A){Ext.fly(this.getDragEl()).hide()},endDrag:function(C){var B=this.getEl();var A=this.getDragEl();A.style.visibility="";this.beforeMove();B.style.visibility="hidden";Ext.dd.DDM.moveToEl(B,A);A.style.visibility="hidden";B.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{toString:function(){return("DDTarget "+this.id)}});
+Ext.dd.DragTracker=function(A){Ext.apply(this,A);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}};Ext.extend(Ext.dd.DragTracker,Ext.util.Observable,{active:false,tolerance:5,autoStart:false,initEl:function(A){this.el=Ext.get(A);A.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(C,B){if(this.fireEvent("mousedown",this,C)!==false&&this.onBeforeStart(C)!==false){this.startXY=this.lastXY=C.getXY();this.dragTarget=this.delegate?B:this.el.dom;C.preventDefault();var A=Ext.getDoc();A.on("mouseup",this.onMouseUp,this);A.on("mousemove",this.onMouseMove,this);A.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(D,C){D.preventDefault();var B=D.getXY(),A=this.startXY;this.lastXY=B;if(!this.active){if(Math.abs(A[0]-B[0])>this.tolerance||Math.abs(A[1]-B[1])>this.tolerance){this.triggerStart()}else{return }}this.fireEvent("mousemove",this,D);this.onDrag(D);this.fireEvent("drag",this,D)},onMouseUp:function(B){var A=Ext.getDoc();A.un("mousemove",this.onMouseMove,this);A.un("mouseup",this.onMouseUp,this);A.un("selectstart",this.stopSelect,this);B.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,B);this.onEnd(B);this.fireEvent("dragend",this,B)},triggerStart:function(A){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(A){A.stopEvent();return false},onBeforeStart:function(A){},onStart:function(A){},onDrag:function(A){},onEnd:function(A){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(A){return A?this.constrainModes[A].call(this,this.lastXY):this.lastXY},getOffset:function(C){var B=this.getXY(C);var A=this.startXY;return[A[0]-B[0],A[1]-B[1]]},constrainModes:{"point":function(B){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var A=this.dragRegion;A.left=B[0];A.top=B[1];A.right=B[0];A.bottom=B[1];A.constrainTo(this.elRegion);return[A.left,A.top]}}});
+Ext.dd.ScrollManager=function(){var C=Ext.dd.DragDropMgr;var E={};var B=null;var H={};var G=function(K){B=null;A()};var I=function(){if(C.dragCurrent){C.refreshCache(C.dragCurrent.groups)}};var D=function(){if(C.dragCurrent){var K=Ext.dd.ScrollManager;var L=H.el.ddScrollConfig?H.el.ddScrollConfig.increment:K.increment;if(!K.animate){if(H.el.scroll(H.dir,L)){I()}}else{H.el.scroll(H.dir,L,true,K.animDuration,I)}}};var A=function(){if(H.id){clearInterval(H.id)}H.id=0;H.el=null;H.dir=""};var F=function(L,K){A();H.el=L;H.dir=K;var M=(L.ddScrollConfig&&L.ddScrollConfig.frequency)?L.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;H.id=setInterval(D,M)};var J=function(N,P){if(P||!C.dragCurrent){return }var Q=Ext.dd.ScrollManager;if(!B||B!=C.dragCurrent){B=C.dragCurrent;Q.refreshCache()}var R=Ext.lib.Event.getXY(N);var S=new Ext.lib.Point(R[0],R[1]);for(var L in E){var M=E[L],K=M._region;var O=M.ddScrollConfig?M.ddScrollConfig:Q;if(K&&K.contains(S)&&M.isScrollable()){if(K.bottom-S.y<=O.vthresh){if(H.el!=M){F(M,"down")}return }else{if(K.right-S.x<=O.hthresh){if(H.el!=M){F(M,"left")}return }else{if(S.y-K.top<=O.vthresh){if(H.el!=M){F(M,"up")}return }else{if(S.x-K.left<=O.hthresh){if(H.el!=M){F(M,"right")}return }}}}}}A()};C.fireEvents=C.fireEvents.createSequence(J,C);C.stopDrag=C.stopDrag.createSequence(G,C);return{register:function(M){if(Ext.isArray(M)){for(var L=0,K=M.length;L<K;L++){this.register(M[L])}}else{M=Ext.get(M);E[M.id]=M}},unregister:function(M){if(Ext.isArray(M)){for(var L=0,K=M.length;L<K;L++){this.unregister(M[L])}}else{M=Ext.get(M);delete E[M.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var K in E){if(typeof E[K]=="object"){E[K]._region=E[K].getRegion()}}}}}();
+Ext.dd.Registry=function(){var D={};var B={};var A=0;var C=function(F,E){if(typeof F=="string"){return F}var G=F.id;if(!G&&E!==false){G="extdd-"+(++A);F.id=G}return G};return{register:function(H,I){I=I||{};if(typeof H=="string"){H=document.getElementById(H)}I.ddel=H;D[C(H)]=I;if(I.isHandle!==false){B[I.ddel.id]=I}if(I.handles){var G=I.handles;for(var F=0,E=G.length;F<E;F++){B[C(G[F])]=I}}},unregister:function(H){var J=C(H,false);var I=D[J];if(I){delete D[J];if(I.handles){var G=I.handles;for(var F=0,E=G.length;F<E;F++){delete B[C(G[F],false)]}}}},getHandle:function(E){if(typeof E!="string"){E=E.id}return B[E]},getHandleFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?B[E.id]:null},getTarget:function(E){if(typeof E!="string"){E=E.id}return D[E]},getTargetFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?D[E.id]||B[E.id]:null}}}();
+Ext.dd.StatusProxy=function(A){Ext.apply(this,A);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!A||A.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(A){A=A||this.dropNotAllowed;if(this.dropStatus!=A){this.el.replaceClass(this.dropStatus,A);this.dropStatus=A}},reset:function(A){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(A){this.ghost.update("")}},update:function(A){if(typeof A=="string"){this.ghost.update(A)}else{this.ghost.update("");A.style.margin="0";this.ghost.dom.appendChild(A)}var B=this.ghost.dom.firstChild;if(B){Ext.fly(B).setStyle(Ext.isIE?"styleFloat":"cssFloat","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(A){this.el.hide();if(A){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(B,C,A){this.callback=C;this.scope=A;if(B&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:B,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null}};
+Ext.dd.DragSource=function(B,A){this.el=Ext.get(B);if(!this.dragData){this.dragData={}}Ext.apply(this,A);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(A){return this.dragData},onDragEnter:function(C,D){var B=Ext.dd.DragDropMgr.getDDById(D);this.cachedTarget=B;if(this.beforeDragEnter(B,C,D)!==false){if(B.isNotifyTarget){var A=B.notifyEnter(this,C,this.dragData);this.proxy.setStatus(A)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(B,C,D)}}},beforeDragEnter:function(B,A,C){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(C,D){var B=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(D);if(this.beforeDragOver(B,C,D)!==false){if(B.isNotifyTarget){var A=B.notifyOver(this,C,this.dragData);this.proxy.setStatus(A)}if(this.afterDragOver){this.afterDragOver(B,C,D)}}},beforeDragOver:function(B,A,C){return true},onDragOut:function(B,C){var A=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(C);if(this.beforeDragOut(A,B,C)!==false){if(A.isNotifyTarget){A.notifyOut(this,B,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(A,B,C)}}this.cachedTarget=null},beforeDragOut:function(B,A,C){return true},onDragDrop:function(B,C){var A=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(C);if(this.beforeDragDrop(A,B,C)!==false){if(A.isNotifyTarget){if(A.notifyDrop(this,B,this.dragData)){this.onValidDrop(A,B,C)}else{this.onInvalidDrop(A,B,C)}}else{this.onValidDrop(A,B,C)}if(this.afterDragDrop){this.afterDragDrop(A,B,C)}}delete this.cachedTarget},beforeDragDrop:function(B,A,C){return true},onValidDrop:function(B,A,C){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(B,A,C)}},getRepairXY:function(B,A){return this.el.getXY()},onInvalidDrop:function(B,A,C){this.beforeInvalidDrop(B,A,C);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,A,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(A,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(A,C)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(B,A,C){return true},handleMouseDown:function(B){if(this.dragging){return }var A=this.getDragData(B);if(A&&this.onBeforeDrag(A,B)!==false){this.dragData=A;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(A,B){return true},onStartDrag:Ext.emptyFn,startDrag:function(A,B){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(A,B);this.proxy.show()},onInitDrag:function(A,C){var B=this.el.dom.cloneNode(true);B.id=Ext.id();this.proxy.update(B);this.onStartDrag(A,C);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(A){},endDrag:function(A){this.onEndDrag(this.dragData,A)},onEndDrag:function(A,B){},autoOffset:function(A,B){this.setDelta(-12,-20)}});
+Ext.dd.DropTarget=function(B,A){this.el=Ext.get(B);Ext.apply(this,A);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(A,C,B){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(A,C,B){return this.dropAllowed},notifyOut:function(A,C,B){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(A,C,B){return false}});
+Ext.dd.DragZone=function(B,A){Ext.dd.DragZone.superclass.constructor.call(this,B,A);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(A){return Ext.dd.Registry.getHandleFromEvent(A)},onInitDrag:function(A,B){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(A,B);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(A){return Ext.Element.fly(this.dragData.ddel).getXY()}});
+Ext.dd.DropZone=function(B,A){Ext.dd.DropZone.superclass.constructor.call(this,B,A)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(A){return Ext.dd.Registry.getTargetFromEvent(A)},onNodeEnter:function(D,A,C,B){},onNodeOver:function(D,A,C,B){return this.dropAllowed},onNodeOut:function(D,A,C,B){},onNodeDrop:function(D,A,C,B){return false},onContainerOver:function(A,C,B){return this.dropNotAllowed},onContainerDrop:function(A,C,B){return false},notifyEnter:function(A,C,B){return this.dropNotAllowed},notifyOver:function(A,C,B){var D=this.getTargetFromEvent(C);if(!D){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,C,B);this.lastOverNode=null}return this.onContainerOver(A,C,B)}if(this.lastOverNode!=D){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,C,B)}this.onNodeEnter(D,A,C,B);this.lastOverNode=D}return this.onNodeOver(D,A,C,B)},notifyOut:function(A,C,B){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,C,B);this.lastOverNode=null}},notifyDrop:function(A,C,B){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,A,C,B);this.lastOverNode=null}var D=this.getTargetFromEvent(C);return D?this.onNodeDrop(D,A,C,B):this.onContainerDrop(A,C,B)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});
+Ext.data.SortTypes={none:function(A){return A},stripTagsRE:/<\/?[^>]+>/gi,asText:function(A){return String(A).replace(this.stripTagsRE,"")},asUCText:function(A){return String(A).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(A){return String(A).toUpperCase()},asDate:function(A){if(!A){return 0}if(Ext.isDate(A)){return A.getTime()}return Date.parse(String(A))},asFloat:function(A){var B=parseFloat(String(A).replace(/,/g,""));if(isNaN(B)){B=0}return B},asInt:function(A){var B=parseInt(String(A).replace(/,/g,""));if(isNaN(B)){B=0}return B}};
+Ext.data.Record=function(A,B){this.id=(B||B===0)?B:++Ext.data.Record.AUTO_ID;this.data=A};Ext.data.Record.create=function(E){var C=Ext.extend(Ext.data.Record,{});var D=C.prototype;D.fields=new Ext.util.MixedCollection(false,function(F){return F.name});for(var B=0,A=E.length;B<A;B++){D.fields.add(new Ext.data.Field(E[B]))}C.getField=function(F){return D.fields.get(F)};return C};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(A){this.store=A},set:function(A,B){if(String(this.data[A])==String(B)){return }this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[A]=="undefined"){this.modified[A]=this.data[A]}this.data[A]=B;if(!this.editing&&this.store){this.store.afterEdit(this)}},get:function(A){return this.data[A]},beginEdit:function(){this.editing=true;this.modified={}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}},reject:function(B){var A=this.modified;for(var C in A){if(typeof A[C]!="function"){this.data[C]=A[C]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store&&B!==true){this.store.afterReject(this)}},commit:function(A){this.dirty=false;delete this.modified;this.editing=false;if(this.store&&A!==true){this.store.afterCommit(this)}},getChanges:function(){var A=this.modified,B={};for(var C in A){if(A.hasOwnProperty(C)){B[C]=this.data[C]}}return B},hasError:function(){return this.error!=null},clearError:function(){this.error=null},copy:function(A){return new this.constructor(Ext.apply({},this.data),A||this.id)},isModified:function(A){return !!(this.modified&&this.modified.hasOwnProperty(A))}};
+Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var A=0,B;B=arguments[A];A++){this.add(B)}},unregister:function(){for(var A=0,B;B=arguments[A];A++){this.remove(this.lookup(B))}},lookup:function(A){return typeof A=="object"?A:this.get(A)},getKey:function(A){return A.storeId||A.id}});
+Ext.data.Store=function(A){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(B){return B.id};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir"};if(A&&A.data){this.inlineData=A.data;delete A.data}Ext.apply(this,A);if(this.url&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url})}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this)}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","beforeload","load","loadexception");if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}Ext.data.Store.superclass.constructor.call(this);if(this.storeId||this.id){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,destroy:function(){if(this.id){Ext.StoreMgr.unregister(this)}this.data=null;this.purgeListeners()},add:function(B){B=[].concat(B);if(B.length<1){return }for(var D=0,A=B.length;D<A;D++){B[D].join(this)}var C=this.data.length;this.data.addAll(B);if(this.snapshot){this.snapshot.addAll(B)}this.fireEvent("add",this,B,C)},addSorted:function(A){var B=this.findInsertIndex(A);this.insert(B,A)},remove:function(A){var B=this.data.indexOf(A);this.data.removeAt(B);if(this.pruneModifiedRecords){this.modified.remove(A)}if(this.snapshot){this.snapshot.remove(A)}this.fireEvent("remove",this,A,B)},removeAll:function(){this.data.clear();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},insert:function(C,B){B=[].concat(B);for(var D=0,A=B.length;D<A;D++){this.data.insert(C,B[D]);B[D].join(this)}this.fireEvent("add",this,B,C)},indexOf:function(A){return this.data.indexOf(A)},indexOfId:function(A){return this.data.indexOfKey(A)},getById:function(A){return this.data.key(A)},getAt:function(A){return this.data.itemAt(A)},getRange:function(B,A){return this.data.getRange(B,A)},storeOptions:function(A){A=Ext.apply({},A);delete A.callback;delete A.scope;this.lastOptions=A},load:function(B){B=B||{};if(this.fireEvent("beforeload",this,B)!==false){this.storeOptions(B);var C=Ext.apply(B.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var A=this.paramNames;C[A["sort"]]=this.sortInfo.field;C[A["dir"]]=this.sortInfo.direction}this.proxy.load(C,this.reader,this.loadRecords,this,B);return true}else{return false}},reload:function(A){this.load(Ext.applyIf(A||{},this.lastOptions))},loadRecords:function(G,B,F){if(!G||F===false){if(F!==false){this.fireEvent("load",this,[],B)}if(B.callback){B.callback.call(B.scope||this,[],B,false)}return }var E=G.records,D=G.totalRecords||E.length;if(!B||B.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var C=0,A=E.length;C<A;C++){E[C].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.data.clear();this.data.addAll(E);this.totalLength=D;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(D,this.data.length+E.length);this.add(E)}this.fireEvent("load",this,E,B);if(B.callback){B.callback.call(B.scope||this,E,B,true)}},loadData:function(C,A){var B=this.reader.readRecords(C);this.loadRecords(B,{add:A},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if(this.sortInfo&&!this.remoteSort){var A=this.sortInfo,B=A.field;this.sortData(B,A.direction)}},sortData:function(C,D){D=D||"ASC";var A=this.fields.get(C).sortType;var B=function(F,E){var H=A(F.data[C]),G=A(E.data[C]);return H>G?1:(H<G?-1:0)};this.data.sort(D,B);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(D,B)}},setDefaultSort:function(B,A){A=A?A.toUpperCase():"ASC";this.sortInfo={field:B,direction:A};this.sortToggle[B]=A},sort:function(E,C){var D=this.fields.get(E);if(!D){return false}if(!C){if(this.sortInfo&&this.sortInfo.field==D.name){C=(this.sortToggle[D.name]||"ASC").toggle("ASC","DESC")}else{C=D.sortDir}}var B=(this.sortToggle)?this.sortToggle[D.name]:null;var A=(this.sortInfo)?this.sortInfo:null;this.sortToggle[D.name]=C;this.sortInfo={field:D.name,direction:C};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{if(!this.load(this.lastOptions)){if(B){this.sortToggle[D.name]=B}if(A){this.sortInfo=A}}}},each:function(B,A){this.data.each(B,A)},getModifiedRecords:function(){return this.modified},createFilterFn:function(C,B,D,A){if(Ext.isEmpty(B,false)){return false}B=this.data.createValueMatcher(B,D,A);return function(E){return B.test(E.data[C])}},sum:function(E,F,A){var C=this.data.items,B=0;F=F||0;A=(A||A===0)?A:C.length-1;for(var D=F;D<=A;D++){B+=(C[D].data[E]||0)}return B},filter:function(D,C,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.filterBy(B):this.clearFilter()},filterBy:function(B,A){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(B,A||this);this.fireEvent("datachanged",this)},query:function(D,C,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.queryBy(B):this.data.clone()},queryBy:function(B,A){var C=this.snapshot||this.data;return C.filterBy(B,A||this)},find:function(D,C,F,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.data.findIndexBy(B,null,F):-1},findBy:function(B,A,C){return this.data.findIndexBy(B,A,C)},collect:function(G,H,B){var F=(B===true&&this.snapshot)?this.snapshot.items:this.data.items;var I,J,A=[],C={};for(var D=0,E=F.length;D<E;D++){I=F[D].data[G];J=String(I);if((H||!Ext.isEmpty(I))&&!C[J]){C[J]=true;A[A.length]=I}}return A},clearFilter:function(A){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(A!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return this.snapshot&&this.snapshot!=this.data},afterEdit:function(A){if(this.modified.indexOf(A)==-1){this.modified.push(A)}this.fireEvent("update",this,A,Ext.data.Record.EDIT)},afterReject:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.REJECT)},afterCommit:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.COMMIT)},commitChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].commit()}},rejectChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].reject()}},onMetaChange:function(B,A,C){this.recordType=A;this.fields=A.prototype.fields;delete this.snapshot;this.sortInfo=B.sortInfo;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(A){this.suspendEvents();var C=this.data.clone();this.data.add(A);this.applySort();var B=this.data.indexOf(A);this.data=C;this.resumeEvents();return B}});
+Ext.data.SimpleStore=function(A){Ext.data.SimpleStore.superclass.constructor.call(this,Ext.apply(A,{reader:new Ext.data.ArrayReader({id:A.id},Ext.data.Record.create(A.fields))}))};Ext.extend(Ext.data.SimpleStore,Ext.data.Store,{loadData:function(E,B){if(this.expandData===true){var D=[];for(var C=0,A=E.length;C<A;C++){D[D.length]=[E[C]]}E=D}Ext.data.SimpleStore.superclass.loadData.call(this,E,B)}});
+Ext.data.JsonStore=function(A){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(A,{proxy:A.proxy||(!A.data?new Ext.data.HttpProxy({url:A.url}):undefined),reader:new Ext.data.JsonReader(A,A.fields)}))};Ext.extend(Ext.data.JsonStore,Ext.data.Store);
+Ext.data.Field=function(D){if(typeof D=="string"){D={name:D}}Ext.apply(this,D);if(!this.type){this.type="auto"}var C=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=C[this.sortType]}if(!this.sortType){switch(this.type){case"string":this.sortType=C.asUCString;break;case"date":this.sortType=C.asDate;break;default:this.sortType=C.none}}var E=/[\$,%]/g;if(!this.convert){var B,A=this.dateFormat;switch(this.type){case"":case"auto":case undefined:B=function(F){return F};break;case"string":B=function(F){return(F===undefined||F===null)?"":String(F)};break;case"int":B=function(F){return F!==undefined&&F!==null&&F!==""?parseInt(String(F).replace(E,""),10):""};break;case"float":B=function(F){return F!==undefined&&F!==null&&F!==""?parseFloat(String(F).replace(E,""),10):""};break;case"bool":case"boolean":B=function(F){return F===true||F==="true"||F==1};break;case"date":B=function(G){if(!G){return""}if(Ext.isDate(G)){return G}if(A){if(A=="timestamp"){return new Date(G*1000)}if(A=="time"){return new Date(parseInt(G,10))}return Date.parseDate(G,A)}var F=Date.parse(G);return F?new Date(F):null};break}this.convert=B}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};
+Ext.data.DataReader=function(A,B){this.meta=A;this.recordType=Ext.isArray(B)?Ext.data.Record.create(B):B};Ext.data.DataReader.prototype={};
+Ext.data.DataProxy=function(){this.addEvents("beforeload","load");Ext.data.DataProxy.superclass.constructor.call(this)};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);
+Ext.data.MemoryProxy=function(A){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=A};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(F,C,G,D,B){F=F||{};var A;try{A=C.readRecords(this.data)}catch(E){this.fireEvent("loadexception",this,B,null,E);G.call(D,null,B,false);return }G.call(D,A,B,true)},update:function(B,A){}});
+Ext.data.HttpProxy=function(A){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},load:function(E,B,F,C,A){if(this.fireEvent("beforeload",this,E)!==false){var D={params:E||{},request:{callback:F,scope:C,arg:A},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Ext.applyIf(D,this.conn);if(this.activeRequest){Ext.Ajax.abort(this.activeRequest)}this.activeRequest=Ext.Ajax.request(D)}else{this.conn.request(D)}}else{F.call(C||this,null,A,false)}},loadResponse:function(E,D,B){delete this.activeRequest;if(!D){this.fireEvent("loadexception",this,E,B);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }var A;try{A=E.reader.read(B)}catch(C){this.fireEvent("loadexception",this,E,B,C);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }this.fireEvent("load",this,E,E.request.arg);E.request.callback.call(E.request.scope,A,E.request.arg,true)},update:function(A){},updateResponse:function(A){}});
+Ext.data.ScriptTagProxy=function(A){Ext.data.ScriptTagProxy.superclass.constructor.call(this);Ext.apply(this,A);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(E,F,H,I,J){if(this.fireEvent("beforeload",this,E)!==false){var C=Ext.urlEncode(Ext.apply(E,this.extraParams));var B=this.url;B+=(B.indexOf("?")!=-1?"&":"?")+C;if(this.nocache){B+="&_dc="+(new Date().getTime())}var A=++Ext.data.ScriptTagProxy.TRANS_ID;var K={id:A,cb:"stcCallback"+A,scriptId:"stcScript"+A,params:E,arg:J,url:B,callback:H,scope:I,reader:F};var D=this;window[K.cb]=function(L){D.handleResponse(L,K)};B+=String.format("&{0}={1}",this.callbackParam,K.cb);if(this.autoAbort!==false){this.abort()}K.timeoutId=this.handleFailure.defer(this.timeout,this,[K]);var G=document.createElement("script");G.setAttribute("src",B);G.setAttribute("type","text/javascript");G.setAttribute("id",K.scriptId);this.head.appendChild(G);this.trans=K}else{H.call(I||this,null,J,false)}},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(B,A){this.head.removeChild(document.getElementById(B.scriptId));clearTimeout(B.timeoutId);if(A){window[B.cb]=undefined;try{delete window[B.cb]}catch(C){}}else{window[B.cb]=function(){window[B.cb]=undefined;try{delete window[B.cb]}catch(D){}}}},handleResponse:function(D,B){this.trans=false;this.destroyTrans(B,true);var A;try{A=B.reader.readRecords(D)}catch(C){this.fireEvent("loadexception",this,D,B.arg,C);B.callback.call(B.scope||window,null,B.arg,false);return }this.fireEvent("load",this,D,B.arg);B.callback.call(B.scope||window,A,B.arg,true)},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false)}});
+Ext.data.JsonReader=function(A,B){A=A||{};Ext.data.JsonReader.superclass.constructor.call(this,A,B||A.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(response){var json=response.responseText;var o=eval("("+json+")");if(!o){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(o)},onMetaChange:function(A,C,B){},simpleAccess:function(B,A){return B[A]},getJsonAccessor:function(){var A=/[\[\.]/;return function(C){try{return(A.test(C))?new Function("obj","return obj."+C):function(D){return D[C]}}catch(B){}return Ext.emptyFn}}(),readRecords:function(K){this.jsonData=K;if(K.metaData){delete this.ef;this.meta=K.metaData;this.recordType=Ext.data.Record.create(K.metaData.fields);this.onMetaChange(this.meta,this.recordType,K)}var H=this.meta,A=this.recordType,R=A.prototype.fields,F=R.items,E=R.length;if(!this.ef){if(H.totalProperty){this.getTotal=this.getJsonAccessor(H.totalProperty)}if(H.successProperty){this.getSuccess=this.getJsonAccessor(H.successProperty)}this.getRoot=H.root?this.getJsonAccessor(H.root):function(U){return U};if(H.id){var Q=this.getJsonAccessor(H.id);this.getId=function(V){var U=Q(V);return(U===undefined||U==="")?null:U}}else{this.getId=function(){return null}}this.ef=[];for(var O=0;O<E;O++){R=F[O];var T=(R.mapping!==undefined&&R.mapping!==null)?R.mapping:R.name;this.ef[O]=this.getJsonAccessor(T)}}var M=this.getRoot(K),S=M.length,I=S,D=true;if(H.totalProperty){var G=parseInt(this.getTotal(K),10);if(!isNaN(G)){I=G}}if(H.successProperty){var G=this.getSuccess(K);if(G===false||G==="false"){D=false}}var P=[];for(var O=0;O<S;O++){var L=M[O];var B={};var J=this.getId(L);for(var N=0;N<E;N++){R=F[N];var G=this.ef[N](L);B[R.name]=R.convert((G!==undefined)?G:R.defaultValue,L)}var C=new A(B,J);C.json=L;P[O]=C}return{success:D,records:P,totalRecords:I}}});
+Ext.data.XmlReader=function(A,B){A=A||{};Ext.data.XmlReader.superclass.constructor.call(this,A,B||A.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(A){var B=A.responseXML;if(!B){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(B)},readRecords:function(T){this.xmlData=T;var N=T.documentElement||T;var I=Ext.DomQuery;var B=this.recordType,L=B.prototype.fields;var D=this.meta.id;var G=0,E=true;if(this.meta.totalRecords){G=I.selectNumber(this.meta.totalRecords,N,0)}if(this.meta.success){var K=I.selectValue(this.meta.success,N,true);E=K!==false&&K!=="false"}var Q=[];var U=I.select(this.meta.record,N);for(var P=0,R=U.length;P<R;P++){var M=U[P];var A={};var J=D?I.selectValue(D,M):undefined;for(var O=0,H=L.length;O<H;O++){var S=L.items[O];var F=I.selectValue(S.mapping||S.name,M,S.defaultValue);F=S.convert(F,M);A[S.name]=F}var C=new B(A,J);C.node=M;Q[Q.length]=C}return{success:E,records:Q,totalRecords:G||Q.length}}});
+Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(C){var B=this.meta?this.meta.id:null;var G=this.recordType,K=G.prototype.fields;var E=[];var M=C;for(var I=0;I<M.length;I++){var D=M[I];var O={};var A=((B||B===0)&&D[B]!==undefined&&D[B]!==""?D[B]:null);for(var H=0,P=K.length;H<P;H++){var L=K.items[H];var F=L.mapping!==undefined&&L.mapping!==null?L.mapping:H;var N=D[F]!==undefined?D[F]:L.defaultValue;N=L.convert(N,D);O[L.name]=N}var J=new G(O,A);J.json=D;E[E.length]=J}return{records:E,totalRecords:E.length}}});
+Ext.data.Tree=function(A){this.nodeHash={};this.root=null;if(A){this.setRootNode(A)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)};Ext.extend(Ext.data.Tree,Ext.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(A){this.root=A;A.ownerTree=this;A.isRoot=true;this.registerNode(A);return A},getNodeById:function(A){return this.nodeHash[A]},registerNode:function(A){this.nodeHash[A.id]=A},unregisterNode:function(A){delete this.nodeHash[A.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=function(A){this.attributes=A||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"ynode-");this.attributes.id=this.id}this.childNodes=[];if(!this.childNodes.indexOf){this.childNodes.indexOf=function(D){for(var C=0,B=this.length;C<B;C++){if(this[C]==D){return C}}return -1}}this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({"append":true,"remove":true,"move":true,"insert":true,"beforeappend":true,"beforeremove":true,"beforemove":true,"beforeinsert":true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)};Ext.extend(Ext.data.Node,Ext.util.Observable,{fireEvent:function(B){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var A=this.getOwnerTree();if(A){if(A.proxyNodeEvent.apply(A,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(A){this.firstChild=A},setLastChild:function(A){this.lastChild=A},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(E){var F=false;if(Ext.isArray(E)){F=E}else{if(arguments.length>1){F=arguments}}if(F){for(var D=0,A=F.length;D<A;D++){this.appendChild(F[D])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,E)===false){return false}var B=this.childNodes.length;var C=E.parentNode;if(C){if(E.fireEvent("beforemove",E.getOwnerTree(),E,C,this,B)===false){return false}C.removeChild(E)}B=this.childNodes.length;if(B==0){this.setFirstChild(E)}this.childNodes.push(E);E.parentNode=this;var G=this.childNodes[B-1];if(G){E.previousSibling=G;G.nextSibling=E}else{E.previousSibling=null}E.nextSibling=null;this.setLastChild(E);E.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,E,B);if(C){E.fireEvent("move",this.ownerTree,E,C,this,B)}return E}},removeChild:function(B){var A=this.childNodes.indexOf(B);if(A==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,B)===false){return false}this.childNodes.splice(A,1);if(B.previousSibling){B.previousSibling.nextSibling=B.nextSibling}if(B.nextSibling){B.nextSibling.previousSibling=B.previousSibling}if(this.firstChild==B){this.setFirstChild(B.nextSibling)}if(this.lastChild==B){this.setLastChild(B.previousSibling)}B.setOwnerTree(null);B.parentNode=null;B.previousSibling=null;B.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,B);return B},insertBefore:function(D,A){if(!A){return this.appendChild(D)}if(D==A){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,D,A)===false){return false}var B=this.childNodes.indexOf(A);var C=D.parentNode;var E=B;if(C==this&&this.childNodes.indexOf(D)<B){E--}if(C){if(D.fireEvent("beforemove",D.getOwnerTree(),D,C,this,B,A)===false){return false}C.removeChild(D)}if(E==0){this.setFirstChild(D)}this.childNodes.splice(E,0,D);D.parentNode=this;var F=this.childNodes[E-1];if(F){D.previousSibling=F;F.nextSibling=D}else{D.previousSibling=null}D.nextSibling=A;A.previousSibling=D;D.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,D,A);if(C){D.fireEvent("move",this.ownerTree,D,C,this,E,A)}return D},remove:function(){this.parentNode.removeChild(this);return this},item:function(A){return this.childNodes[A]},replaceChild:function(A,B){this.insertBefore(A,B);this.removeChild(B);return B},indexOf:function(A){return this.childNodes.indexOf(A)},getOwnerTree:function(){if(!this.ownerTree){var A=this;while(A){if(A.ownerTree){this.ownerTree=A.ownerTree;break}A=A.parentNode}}return this.ownerTree},getDepth:function(){var B=0;var A=this;while(A.parentNode){++B;A=A.parentNode}return B},setOwnerTree:function(B){if(B!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=B;var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].setOwnerTree(B)}if(B){B.registerNode(this)}}},getPath:function(B){B=B||"id";var D=this.parentNode;var A=[this.attributes[B]];while(D){A.unshift(D.attributes[B]);D=D.parentNode}var C=this.getOwnerTree().pathSeparator;return C+A.join(C)},bubble:function(C,B,A){var D=this;while(D){if(C.apply(B||D,A||[D])===false){break}D=D.parentNode}},cascade:function(F,E,B){if(F.apply(E||this,B||[this])!==false){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].cascade(F,E,B)}}},eachChild:function(F,E,B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){if(F.apply(E||this,B||[D[C]])===false){break}}},findChild:function(D,E){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){if(C[B].attributes[D]==E){return C[B]}}return null},findChildBy:function(E,D){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){if(E.call(D||C[B],C[B])===true){return C[B]}}return null},sort:function(E,D){var C=this.childNodes;var A=C.length;if(A>0){var F=D?function(){E.apply(D,arguments)}:E;C.sort(F);for(var B=0;B<A;B++){var G=C[B];G.previousSibling=C[B-1];G.nextSibling=C[B+1];if(B==0){this.setFirstChild(G)}if(B==A-1){this.setLastChild(G)}}}},contains:function(A){return A.isAncestor(this)},isAncestor:function(A){var B=this.parentNode;while(B){if(B==A){return true}B=B.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});
+Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{remoteGroup:false,groupOnSort:false,clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy}this.reload()}else{this.applySort();this.fireEvent("datachanged",this)}},groupBy:function(C,B){if(this.groupField==C&&!B){return }this.groupField=C;if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}this.baseParams["groupBy"]=C}if(this.groupOnSort){this.sort(C);return }if(this.remoteGroup){this.reload()}else{var A=this.sortInfo||{};if(A.field!=C){this.applySort()}else{this.sortData(C)}this.fireEvent("datachanged",this)}},applySort:function(){Ext.data.GroupingStore.superclass.applySort.call(this);if(!this.groupOnSort&&!this.remoteGroup){var A=this.getGroupState();if(A&&A!=this.sortInfo.field){this.sortData(this.groupField)}}},applyGrouping:function(A){if(this.groupField!==false){this.groupBy(this.groupField,true);return true}else{if(A===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});
+Ext.ComponentMgr=function(){var B=new Ext.util.MixedCollection();var A={};return{register:function(C){B.add(C)},unregister:function(C){B.remove(C)},get:function(C){return B.get(C)},onAvailable:function(E,D,C){B.on("add",function(F,G){if(G.id==E){D.call(C||G,G);B.un("add",D,C)}})},all:B,registerType:function(D,C){A[D]=C;C.xtype=D},create:function(C,D){return new A[C.xtype||D](C)}}}();Ext.reg=Ext.ComponentMgr.registerType;
+Ext.Component=function(B){B=B||{};if(B.initialConfig){if(B.isAction){this.baseAction=B}B=B.initialConfig}else{if(B.tagName||B.dom||typeof B=="string"){B={applyTo:B,id:B.id||B}}}this.initialConfig=B;Ext.apply(this,B);this.addEvents("disable","enable","beforeshow","show","beforehide","hide","beforerender","render","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var C=0,A=this.plugins.length;C<A;C++){this.plugins[C]=this.initPlugin(this.plugins[C])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState(B)}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,hidden:false,disabled:false,rendered:false,ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(A){A.init(this);return A},initComponent:Ext.emptyFn,render:function(B,A){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!B&&this.el){this.el=Ext.get(this.el);B=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(B);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(A!==undefined){if(typeof A=="number"){A=this.container.dom.childNodes[A]}else{A=Ext.getDom(A)}}this.onRender(this.container,A||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide()}if(this.disabled){this.disable()}if(this.stateful!==false){this.initStateEvents()}}return this},initState:function(A){if(Ext.state.Manager){var B=Ext.state.Manager.get(this.stateId||this.id);if(B){if(this.fireEvent("beforestaterestore",this,B)!==false){this.applyState(B);this.fireEvent("staterestore",this,B)}}}},initStateEvents:function(){if(this.stateEvents){for(var A=0,B;B=this.stateEvents[A];A++){this.on(B,this.saveState,this,{delay:100})}}},applyState:function(B,A){if(B){Ext.apply(this,B)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager){var A=this.getState();if(this.fireEvent("beforestatesave",this,A)!==false){Ext.state.Manager.set(this.stateId||this.id,A);this.fireEvent("statesave",this,A)}}},applyToMarkup:function(A){this.allowDomMove=false;this.el=Ext.get(A);this.render(this.el.dom.parentNode)},addClass:function(A){if(this.el){this.el.addClass(A)}else{this.cls=this.cls?this.cls+" "+A:A}},removeClass:function(A){if(this.el){this.el.removeClass(A)}else{if(this.cls){this.cls=this.cls.split(" ").remove(A).join(" ")}}},onRender:function(B,A){if(this.autoEl){if(typeof this.autoEl=="string"){this.el=document.createElement(this.autoEl)}else{var C=document.createElement("div");Ext.DomHelper.overwrite(C,this.autoEl);this.el=C.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){B.dom.insertBefore(this.el.dom,A)}if(this.overCls){this.el.addClassOnOver(this.overCls)}}},getAutoCreate:function(){var A=typeof this.autoCreate=="object"?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!A.id){A.id=this.id}return A},afterRender:Ext.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove()}}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners()}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(B,A){if(A){this.focus.defer(typeof A=="number"?A:10,this,[B,false]);return }if(this.rendered){this.el.focus();if(B===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(){if(this.rendered){this.onDisable()}this.disabled=true;this.fireEvent("disable",this);return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(A){this[A?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(typeof this.autoRender=="boolean"?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){if(this.hideParent){this.container.removeClass("x-hide-"+this.hideMode)}else{this.getActionEl().removeClass("x-hide-"+this.hideMode)}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide()}this.fireEvent("hide",this)}return this},onHide:function(){if(this.hideParent){this.container.addClass("x-hide-"+this.hideMode)}else{this.getActionEl().addClass("x-hide-"+this.hideMode)}},setVisible:function(A){if(A){this.show()}else{this.hide()}return this},isVisible:function(){return this.rendered&&this.getActionEl().isVisible()},cloneConfig:function(B){B=B||{};var C=B.id||Ext.id();var A=Ext.applyIf(B,this.initialConfig);A.id=C;return new this.constructor(A)},getXType:function(){return this.constructor.xtype},isXType:function(B,A){return !A?("/"+this.getXTypes()+"/").indexOf("/"+B+"/")!=-1:this.constructor.xtype==B},getXTypes:function(){var A=this.constructor;if(!A.xtypes){var C=[],B=this;while(B&&B.constructor.xtype){C.unshift(B.constructor.xtype);B=B.constructor.superclass}A.xtypeChain=C;A.xtypes=C.join("/")}return A.xtypes},findParentBy:function(A){for(var B=this.ownerCt;(B!=null)&&!A(B,this);B=B.ownerCt){}return B||null},findParentByType:function(A){return typeof A=="function"?this.findParentBy(function(B){return B.constructor===A}):this.findParentBy(function(B){return B.constructor.xtype===A})},mon:function(E,B,D,C,A){if(!this.mons){this.mons=[];this.on("beforedestroy",function(){for(var H=0,G=this.mons.length;H<G;H++){var F=this.mons[H];F.item.un(F.ename,F.fn,F.scope)}},this)}this.mons.push({item:E,ename:B,fn:D,scope:C});E.on(B,D,C,A)}});Ext.reg("component",Ext.Component);
+Ext.Action=function(A){this.initialConfig=A;this.items=[]};Ext.Action.prototype={isAction:true,setText:function(A){this.initialConfig.text=A;this.callEach("setText",[A])},getText:function(){return this.initialConfig.text},setIconClass:function(A){this.initialConfig.iconCls=A;this.callEach("setIconClass",[A])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(A){this.initialConfig.disabled=A;this.callEach("setDisabled",[A])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(A){this.initialConfig.hidden=A;this.callEach("setVisible",[!A])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(B,A){this.initialConfig.handler=B;this.initialConfig.scope=A;this.callEach("setHandler",[B,A])},each:function(B,A){Ext.each(this.items,B,A)},callEach:function(E,B){var D=this.items;for(var C=0,A=D.length;C<A;C++){D[C][E].apply(D[C],B)}},addComponent:function(A){this.items.push(A);A.on("destroy",this.removeComponent,this)},removeComponent:function(A){this.items.remove(A)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}};
+(function(){Ext.Layer=function(D,C){D=D||{};var E=Ext.DomHelper;var G=D.parentEl,F=G?Ext.getDom(G):document.body;if(C){this.dom=Ext.getDom(C)}if(!this.dom){var H=D.dh||{tag:"div",cls:"x-layer"};this.dom=E.append(F,H)}if(D.cls){this.addClass(D.cls)}this.constrain=D.constrain!==false;this.visibilityMode=Ext.Element.VISIBILITY;if(D.id){this.id=this.dom.id=D.id}else{this.id=Ext.id(this.dom)}this.zindex=D.zindex||this.getZIndex();this.position("absolute",this.zindex);if(D.shadow){this.shadowOffset=D.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:D.shadow})}else{this.shadowOffset=0}this.useShim=D.shim!==false&&Ext.useShims;this.useDisplay=D.useDisplay;this.hide()};var A=Ext.Element.prototype;var B=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt(this.getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var D=B.shift();if(!D){D=this.createShim();D.enableDisplayMode("block");D.dom.style.display="none";D.dom.style.visibility="visible"}var C=this.dom.parentNode;if(D.dom.parentNode!=C){C.insertBefore(D.dom,this.dom)}D.setStyle("z-index",this.getZIndex()-2);this.shim=D;return D},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);B.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(C){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(C){this.sync(true)}}},sync:function(C){var I=this.shadow;if(!this.updating&&this.isVisible()&&(I||this.useShim)){var F=this.getShim();var H=this.getWidth(),E=this.getHeight();var D=this.getLeft(true),J=this.getTop(true);if(I&&!this.shadowDisabled){if(C&&!I.isVisible()){I.show(this)}else{I.realign(D,J,H,E)}if(F){if(C){F.show()}var G=I.adjusts,K=F.dom.style;K.left=(Math.min(D,D+G.l))+"px";K.top=(Math.min(J,J+G.t))+"px";K.width=(H+G.w)+"px";K.height=(E+G.h)+"px"}}else{if(F){if(C){F.show()}F.setSize(H,E);F.setLeftTop(D,J)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);Ext.Element.uncache(this.id)},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(C){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var G=Ext.lib.Dom.getViewWidth(),C=Ext.lib.Dom.getViewHeight();var L=Ext.getDoc().getScroll();var K=this.getXY();var H=K[0],F=K[1];var I=this.dom.offsetWidth+this.shadowOffset,D=this.dom.offsetHeight+this.shadowOffset;var E=false;if((H+I)>G+L.left){H=G-I-this.shadowOffset;E=true}if((F+D)>C+L.top){F=C-D-this.shadowOffset;E=true}if(H<L.left){H=L.left;E=true}if(F<L.top){F=L.top;E=true}if(E){if(this.avoidY){var J=this.avoidY;if(F<=J&&(F+D)>=J){F=J-D-5}}K=[H,F];this.storeXY(K);A.setXY.call(this,K);this.sync()}}},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){A.setXY.call(this,this.lastXY)}else{if(this.lastLT){A.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(E,D,G,H,F){if(E){this.showAction()}if(D&&E){var C=function(){this.sync(true);if(H){H()}}.createDelegate(this);A.setVisible.call(this,true,true,G,C,F)}else{if(!E){this.hideUnders(true)}var C=H;if(D){C=function(){this.hideAction();if(H){H()}}.createDelegate(this)}A.setVisible.call(this,E,D,G,C,F);if(E){this.sync(true)}else{if(!D){this.hideAction()}}}},storeXY:function(C){delete this.lastLT;this.lastXY=C},storeLeftTop:function(D,C){delete this.lastXY;this.lastLT=[D,C]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(C){this.storeLeftTop(C,this.getTop(true));A.setLeft.apply(this,arguments);this.sync()},setTop:function(C){this.storeLeftTop(this.getLeft(true),C);A.setTop.apply(this,arguments);this.sync()},setLeftTop:function(D,C){this.storeLeftTop(D,C);A.setLeftTop.apply(this,arguments);this.sync()},setXY:function(F,D,G,H,E){this.fixDisplay();this.beforeAction();this.storeXY(F);var C=this.createCB(H);A.setXY.call(this,F,D,G,C,E);if(!D){C()}},createCB:function(D){var C=this;return function(){C.constrainXY();C.sync(true);if(D){D()}}},setX:function(C,D,F,G,E){this.setXY([C,this.getY()],D,F,G,E)},setY:function(G,C,E,F,D){this.setXY([this.getX(),G],C,E,F,D)},setSize:function(E,F,D,H,I,G){this.beforeAction();var C=this.createCB(I);A.setSize.call(this,E,F,D,H,C,G);if(!D){C()}},setWidth:function(E,D,G,H,F){this.beforeAction();var C=this.createCB(H);A.setWidth.call(this,E,D,G,C,F);if(!D){C()}},setHeight:function(E,D,G,H,F){this.beforeAction();var C=this.createCB(H);A.setHeight.call(this,E,D,G,C,F);if(!D){C()}},setBounds:function(J,H,K,D,I,F,G,E){this.beforeAction();var C=this.createCB(G);if(!I){this.storeXY([J,H]);A.setXY.call(this,[J,H]);A.setSize.call(this,K,D,I,F,C,E);C()}else{A.setBounds.call(this,J,H,K,D,I,F,C,E)}return this},setZIndex:function(C){this.zindex=C;this.setStyle("z-index",C+2);if(this.shadow){this.shadow.setZIndex(C+1)}if(this.shim){this.shim.setStyle("z-index",C)}}})})();
+Ext.Shadow=function(C){Ext.apply(this,C);if(typeof this.mode!="string"){this.mode=this.defaultMode}var D=this.offset,B={h:0};var A=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":B.w=0;B.l=B.t=D;B.t-=1;if(Ext.isIE){B.l-=this.offset+A;B.t-=this.offset+A;B.w-=A;B.h-=A;B.t+=1}break;case"sides":B.w=(D*2);B.l=-D;B.t=D-1;if(Ext.isIE){B.l-=(this.offset-A);B.t-=this.offset+A;B.l+=1;B.w-=(this.offset-A)*2;B.w-=A+1;B.h-=1}break;case"frame":B.w=B.h=(D*2);B.l=B.t=-D;B.t+=1;B.h-=2;if(Ext.isIE){B.l-=(this.offset-A);B.t-=(this.offset-A);B.l+=1;B.w-=(this.offset+A+1);B.h-=(this.offset+A);B.h+=1}break}this.adjusts=B};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(A){A=Ext.get(A);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=A.dom){this.el.insertBefore(A)}}this.el.setStyle("z-index",this.zIndex||parseInt(A.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(A.getLeft(true),A.getTop(true),A.getWidth(),A.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(A,M,L,D){if(!this.el){return }var I=this.adjusts,G=this.el.dom,N=G.style;var E=0;N.left=(A+I.l)+"px";N.top=(M+I.t)+"px";var K=(L+I.w),C=(D+I.h),F=K+"px",J=C+"px";if(N.width!=F||N.height!=J){N.width=F;N.height=J;if(!Ext.isIE){var H=G.childNodes;var B=Math.max(0,(K-12))+"px";H[0].childNodes[1].style.width=B;H[1].childNodes[1].style.width=B;H[2].childNodes[1].style.width=B;H[1].style.height=Math.max(0,(C-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(A){this.zIndex=A;if(this.el){this.el.setStyle("z-index",A)}}};Ext.Shadow.Pool=function(){var B=[];var A=Ext.isIE?"<div class=\"x-ie-shadow\"></div>":"<div class=\"x-shadow\"><div class=\"xst\"><div class=\"xstl\"></div><div class=\"xstc\"></div><div class=\"xstr\"></div></div><div class=\"xsc\"><div class=\"xsml\"></div><div class=\"xsmc\"></div><div class=\"xsmr\"></div></div><div class=\"xsb\"><div class=\"xsbl\"></div><div class=\"xsbc\"></div><div class=\"xsbr\"></div></div></div>";return{pull:function(){var C=B.shift();if(!C){C=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,A));C.autoBoxAdjust=false}return C},push:function(C){B.push(C)}}}();
+Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(B,D){if(typeof B=="object"){D=B.height;B=B.width}if(!this.boxReady){this.width=B;this.height=D;return this}if(this.lastSize&&this.lastSize.width==B&&this.lastSize.height==D){return this}this.lastSize={width:B,height:D};var C=this.adjustSize(B,D);var F=C.width,A=C.height;if(F!==undefined||A!==undefined){var E=this.getResizeEl();if(!this.deferHeight&&F!==undefined&&A!==undefined){E.setSize(F,A)}else{if(!this.deferHeight&&A!==undefined){E.setHeight(A)}else{if(F!==undefined){E.setWidth(F)}}}this.onResize(F,A,B,D);this.fireEvent("resize",this,F,A,B,D)}return this},setWidth:function(A){return this.setSize(A)},setHeight:function(A){return this.setSize(undefined,A)},getSize:function(){return this.el.getSize()},getPosition:function(A){if(A===true){return[this.el.getLeft(true),this.el.getTop(true)]}return this.xy||this.el.getXY()},getBox:function(A){var B=this.el.getSize();if(A===true){B.x=this.el.getLeft(true);B.y=this.el.getTop(true)}else{var C=this.xy||this.el.getXY();B.x=C[0];B.y=C[1]}return B},updateBox:function(A){this.setSize(A.width,A.height);this.setPagePosition(A.x,A.y);return this},getResizeEl:function(){return this.resizeEl||this.el},getPositionEl:function(){return this.positionEl||this.el},setPosition:function(A,F){if(A&&typeof A[1]=="number"){F=A[1];A=A[0]}this.x=A;this.y=F;if(!this.boxReady){return this}var B=this.adjustPosition(A,F);var E=B.x,D=B.y;var C=this.getPositionEl();if(E!==undefined||D!==undefined){if(E!==undefined&&D!==undefined){C.setLeftTop(E,D)}else{if(E!==undefined){C.setLeft(E)}else{if(D!==undefined){C.setTop(D)}}}this.onPosition(E,D);this.fireEvent("move",this,E,D)}return this},setPagePosition:function(A,C){if(A&&typeof A[1]=="number"){C=A[1];A=A[0]}this.pageX=A;this.pageY=C;if(!this.boxReady){return }if(A===undefined||C===undefined){return }var B=this.el.translatePoints(A,C);this.setPosition(B.left,B.top);return this},onRender:function(B,A){Ext.BoxComponent.superclass.onRender.call(this,B,A);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.el.getWidth(),this.autoHeight?undefined:this.el.getHeight());return this},onResize:function(D,B,A,C){},onPosition:function(A,B){},adjustSize:function(A,B){if(this.autoWidth){A="auto"}if(this.autoHeight){B="auto"}return{width:A,height:B}},adjustPosition:function(A,B){return{x:A,y:B}}});Ext.reg("box",Ext.BoxComponent);
+Ext.SplitBar=function(C,E,B,D,A){this.el=Ext.get(C,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(E,true);this.orientation=B||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!A){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(A).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=D||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=D||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(A,E){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var C=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var D=C-this.activeMinSize;var B=Math.max(this.activeMaxSize-C,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?D:B,this.placement==Ext.SplitBar.LEFT?B:D);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?D:B,this.placement==Ext.SplitBar.TOP?B:D)}this.dragSpecs.startSize=C;this.dragSpecs.startPoint=[A,E];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,A,E)},onEndProxyDrag:function(C){Ext.get(this.proxy).setDisplayed(false);var B=Ext.lib.Event.getXY(C);if(this.overlay){this.overlay.remove();delete this.overlay}var A;if(this.orientation==Ext.SplitBar.HORIZONTAL){A=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?B[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-B[0])}else{A=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?B[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-B[1])}A=Math.min(Math.max(A,this.activeMinSize),this.activeMaxSize);if(A!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,A)!==false){this.adapter.setElementSize(this,A);this.fireEvent("moved",this,A);this.fireEvent("resize",this,A)}}},getAdapter:function(){return this.adapter},setAdapter:function(A){this.adapter=A;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(A){this.minSize=A},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(A){this.maxSize=A},setCurrentSize:function(B){var A=this.animate;this.animate=false;this.adapter.setElementSize(this,B);this.animate=A},destroy:function(A){if(this.shim){this.shim.remove()}this.dd.unreg();Ext.removeNode(this.proxy);if(A){this.el.remove()}}});Ext.SplitBar.createProxy=function(B){var C=new Ext.Element(document.createElement("div"));C.unselectable();var A="x-splitbar-proxy";C.addClass(A+" "+(B==Ext.SplitBar.HORIZONTAL?A+"-h":A+"-v"));document.body.appendChild(C.dom);return C.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(A){},getElementSize:function(A){if(A.orientation==Ext.SplitBar.HORIZONTAL){return A.resizingEl.getWidth()}else{return A.resizingEl.getHeight()}},setElementSize:function(B,A,C){if(B.orientation==Ext.SplitBar.HORIZONTAL){if(!B.animate){B.resizingEl.setWidth(A);if(C){C(B,A)}}else{B.resizingEl.setWidth(A,true,0.1,C,"easeOut")}}else{if(!B.animate){B.resizingEl.setHeight(A);if(C){C(B,A)}}else{B.resizingEl.setHeight(A,true,0.1,C,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(A){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(A)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(A){this.basic.init(A)},getElementSize:function(A){return this.basic.getElementSize(A)},setElementSize:function(B,A,C){this.basic.setElementSize(B,A,this.moveSplitter.createDelegate(this,[B]))},moveSplitter:function(A){var B=Ext.SplitBar;switch(A.placement){case B.LEFT:A.el.setX(A.resizingEl.getRight());break;case B.RIGHT:A.el.setStyle("right",(this.container.getWidth()-A.resizingEl.getLeft())+"px");break;case B.TOP:A.el.setY(A.resizingEl.getBottom());break;case B.BOTTOM:A.el.setY(A.resizingEl.getTop()-A.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;
+Ext.Container=Ext.extend(Ext.BoxComponent,{autoDestroy:true,defaultType:"panel",initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var A=this.items;if(A){delete this.items;if(Ext.isArray(A)){this.add.apply(this,A)}else{this.add(A)}}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(A){if(this.layout&&this.layout!=A){this.layout.setContainer(null)}this.initItems();this.layout=A;A.setContainer(this)},render:function(){Ext.Container.superclass.render.apply(this,arguments);if(this.layout){if(typeof this.layout=="string"){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var A=this.activeItem;delete this.activeItem;this.layout.setActiveItem(A);return }}if(!this.ownerCt){this.doLayout()}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(A){return A.itemId||A.id},add:function(C){if(!this.items){this.initItems()}var B=arguments,A=B.length;if(A>1){for(var D=0;D<A;D++){this.add(B[D])}return }var F=this.lookupComponent(this.applyDefaults(C));var E=this.items.length;if(this.fireEvent("beforeadd",this,F,E)!==false&&this.onBeforeAdd(F)!==false){this.items.add(F);F.ownerCt=this;this.fireEvent("add",this,F,E)}return F},insert:function(D,C){if(!this.items){this.initItems()}var B=arguments,A=B.length;if(A>2){for(var E=A-1;E>=1;--E){this.insert(D,B[E])}return }var F=this.lookupComponent(this.applyDefaults(C));if(F.ownerCt==this&&this.items.indexOf(F)<D){--D}if(this.fireEvent("beforeadd",this,F,D)!==false&&this.onBeforeAdd(F)!==false){this.items.insert(D,F);F.ownerCt=this;this.fireEvent("add",this,F,D)}return F},applyDefaults:function(A){if(this.defaults){if(typeof A=="string"){A=Ext.ComponentMgr.get(A);Ext.apply(A,this.defaults)}else{if(!A.events){Ext.applyIf(A,this.defaults)}else{Ext.apply(A,this.defaults)}}}return A},onBeforeAdd:function(A){if(A.ownerCt){A.ownerCt.remove(A,false)}if(this.hideBorders===true){A.border=(A.border===true)}},remove:function(A,B){var C=this.getComponent(A);if(C&&this.fireEvent("beforeremove",this,C)!==false){this.items.remove(C);delete C.ownerCt;if(B===true||(B!==false&&this.autoDestroy)){C.destroy()}if(this.layout&&this.layout.activeItem==C){delete this.layout.activeItem}this.fireEvent("remove",this,C)}return C},getComponent:function(A){if(typeof A=="object"){return A}return this.items.get(A)},lookupComponent:function(A){if(typeof A=="string"){return Ext.ComponentMgr.get(A)}else{if(!A.events){return this.createComponent(A)}}return A},createComponent:function(A){return Ext.ComponentMgr.create(A,this.defaultType)},doLayout:function(D){if(this.rendered&&this.layout){this.layout.layout()}if(D!==false&&this.items){var C=this.items.items;for(var B=0,A=C.length;B<A;B++){var E=C[B];if(E.doLayout){E.doLayout()}}}},getLayout:function(){if(!this.layout){var A=new Ext.layout.ContainerLayout(this.layoutConfig);this.setLayout(A)}return this.layout},beforeDestroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items)}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}if(this.layout&&this.layout.destroy){this.layout.destroy()}Ext.Container.superclass.beforeDestroy.call(this)},bubble:function(C,B,A){var D=this;while(D){if(C.apply(B||D,A||[D])===false){break}D=D.ownerCt}},cascade:function(F,E,B){if(F.apply(E||this,B||[this])!==false){if(this.items){var D=this.items.items;for(var C=0,A=D.length;C<A;C++){if(D[C].cascade){D[C].cascade(F,E,B)}else{F.apply(E||D[C],B||[D[C]])}}}}},findById:function(C){var A,B=this;this.cascade(function(D){if(B!=D&&D.id===C){A=D;return false}});return A||null},findByType:function(A){return typeof A=="function"?this.findBy(function(B){return B.constructor===A}):this.findBy(function(B){return B.constructor.xtype===A})},find:function(B,A){return this.findBy(function(C){return C[B]===A})},findBy:function(D,C){var A=[],B=this;this.cascade(function(E){if(B!=E&&D.call(C||E,E,B)===true){A.push(E)}});return A}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);
+Ext.layout.ContainerLayout=function(A){Ext.apply(this,A)};Ext.layout.ContainerLayout.prototype={monitorResize:false,activeItem:null,layout:function(){var A=this.container.getLayoutTarget();this.onLayout(this.container,A);this.container.fireEvent("afterlayout",this.container,this)},onLayout:function(A,B){this.renderAll(A,B)},isValidParent:function(C,B){var A=C.getPositionEl?C.getPositionEl():C.getEl();return A.dom.parentNode==B.dom},renderAll:function(D,E){var B=D.items.items;for(var C=0,A=B.length;C<A;C++){var F=B[C];if(F&&(!F.rendered||!this.isValidParent(F,E))){this.renderItem(F,C,E)}}},renderItem:function(D,A,C){if(D&&!D.rendered){D.render(C,A);if(this.extraCls){var B=D.getPositionEl?D.getPositionEl():D;B.addClass(this.extraCls)}if(this.renderHidden&&D!=this.activeItem){D.hide()}}else{if(D&&!this.isValidParent(D,C)){if(this.extraCls){D.addClass(this.extraCls)}if(typeof A=="number"){A=C.dom.childNodes[A]}C.dom.insertBefore(D.getEl().dom,A||null);if(this.renderHidden&&D!=this.activeItem){D.hide()}}}},onResize:function(){if(this.container.collapsed){return }var A=this.container.bufferResize;if(A){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.layout,this);this.resizeBuffer=typeof A=="number"?A:100}this.resizeTask.delay(this.resizeBuffer)}else{this.layout()}},setContainer:function(A){if(this.monitorResize&&A!=this.container){if(this.container){this.container.un("resize",this.onResize,this)}if(A){A.on("resize",this.onResize,this)}}this.container=A},parseMargins:function(B){var C=B.split(" ");var A=C.length;if(A==1){C[1]=C[0];C[2]=C[0];C[3]=C[0]}if(A==2){C[2]=C[0];C[3]=C[1]}return{top:parseInt(C[0],10)||0,right:parseInt(C[1],10)||0,bottom:parseInt(C[2],10)||0,left:parseInt(C[3],10)||0}},destroy:Ext.emptyFn};Ext.Container.LAYOUTS["auto"]=Ext.layout.ContainerLayout;
+Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,onLayout:function(A,B){Ext.layout.FitLayout.superclass.onLayout.call(this,A,B);if(!this.container.collapsed){this.setItemSize(this.activeItem||A.items.itemAt(0),B.getStyleSize())}},setItemSize:function(B,A){if(B&&A.height>0){B.setSize(A)}}});Ext.Container.LAYOUTS["fit"]=Ext.layout.FitLayout;
+Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,renderHidden:true,setActiveItem:function(A){A=this.container.getComponent(A);if(this.activeItem!=A){if(this.activeItem){this.activeItem.hide()}this.activeItem=A;A.show();this.layout()}},renderAll:function(A,B){if(this.deferredRender){this.renderItem(this.activeItem,undefined,B)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,A,B)}}});Ext.Container.LAYOUTS["card"]=Ext.layout.CardLayout;
+Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,getAnchorViewSize:function(A,B){return B.dom==document.body?B.getViewSize():B.getStyleSize()},onLayout:function(F,I){Ext.layout.AnchorLayout.superclass.onLayout.call(this,F,I);var O=this.getAnchorViewSize(F,I);var M=O.width,E=O.height;if(M<20||E<20){return }var B,K;if(F.anchorSize){if(typeof F.anchorSize=="number"){B=F.anchorSize}else{B=F.anchorSize.width;K=F.anchorSize.height}}else{B=F.initialConfig.width;K=F.initialConfig.height}var H=F.items.items,G=H.length,D,J,L,C,A;for(D=0;D<G;D++){J=H[D];if(J.anchor){L=J.anchorSpec;if(!L){var N=J.anchor.split(" ");J.anchorSpec=L={right:this.parseAnchor(N[0],J.initialConfig.width,B),bottom:this.parseAnchor(N[1],J.initialConfig.height,K)}}C=L.right?this.adjustWidthAnchor(L.right(M),J):undefined;A=L.bottom?this.adjustHeightAnchor(L.bottom(E),J):undefined;if(C||A){J.setSize(C||undefined,A||undefined)}}}},parseAnchor:function(B,F,A){if(B&&B!="none"){var D;if(/^(r|right|b|bottom)$/i.test(B)){var E=A-F;return function(G){if(G!==D){D=G;return G-E}}}else{if(B.indexOf("%")!=-1){var C=parseFloat(B.replace("%",""))*0.01;return function(G){if(G!==D){D=G;return Math.floor(G*C)}}}else{B=parseInt(B,10);if(!isNaN(B)){return function(G){if(G!==D){D=G;return G+B}}}}}}return false},adjustWidthAnchor:function(B,A){return B},adjustHeightAnchor:function(B,A){return B}});Ext.Container.LAYOUTS["anchor"]=Ext.layout.AnchorLayout;
+Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,extraCls:"x-column",scrollOffset:0,isValidParent:function(B,A){return B.getEl().dom.parentNode==this.innerCt.dom},onLayout:function(C,F){var D=C.items.items,E=D.length,G,A;if(!this.innerCt){F.addClass("x-column-layout-ct");this.innerCt=F.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}this.renderAll(C,this.innerCt);var J=Ext.isIE&&F.dom!=Ext.getBody().dom?F.getStyleSize():F.getViewSize();if(J.width<1&&J.height<1){return }var H=J.width-F.getPadding("lr")-this.scrollOffset,B=J.height-F.getPadding("tb"),I=H;this.innerCt.setWidth(H);for(A=0;A<E;A++){G=D[A];if(!G.columnWidth){I-=(G.getSize().width+G.getEl().getMargins("lr"))}}I=I<0?0:I;for(A=0;A<E;A++){G=D[A];if(G.columnWidth){G.setSize(Math.floor(G.columnWidth*I)-G.getEl().getMargins("lr"))}}}});Ext.Container.LAYOUTS["column"]=Ext.layout.ColumnLayout;
+Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,onLayout:function(B,X){var C;if(!this.rendered){X.position();X.addClass("x-border-layout-ct");var M=B.items.items;C=[];for(var Q=0,R=M.length;Q<R;Q++){var U=M[Q];var F=U.region;if(U.collapsed){C.push(U)}U.collapsed=false;if(!U.rendered){U.cls=U.cls?U.cls+" x-border-panel":"x-border-panel";U.render(X,Q)}this[F]=F!="center"&&U.split?new Ext.layout.BorderLayout.SplitRegion(this,U.initialConfig,F):new Ext.layout.BorderLayout.Region(this,U.initialConfig,F);this[F].render(X,U)}this.rendered=true}var L=X.getViewSize();if(L.width<20||L.height<20){if(C){this.restoreCollapsed=C}return }else{if(this.restoreCollapsed){C=this.restoreCollapsed;delete this.restoreCollapsed}}var J=L.width,S=L.height;var I=J,P=S,G=0,H=0;var N=this.north,K=this.south,E=this.west,T=this.east,U=this.center;if(!U){throw"No center region defined in BorderLayout "+B.id}if(N&&N.isVisible()){var W=N.getSize();var O=N.getMargins();W.width=J-(O.left+O.right);W.x=O.left;W.y=O.top;G=W.height+W.y+O.bottom;P-=G;N.applyLayout(W)}if(K&&K.isVisible()){var W=K.getSize();var O=K.getMargins();W.width=J-(O.left+O.right);W.x=O.left;var V=(W.height+O.top+O.bottom);W.y=S-V+O.top;P-=V;K.applyLayout(W)}if(E&&E.isVisible()){var W=E.getSize();var O=E.getMargins();W.height=P-(O.top+O.bottom);W.x=O.left;W.y=G+O.top;var A=(W.width+O.left+O.right);H+=A;I-=A;E.applyLayout(W)}if(T&&T.isVisible()){var W=T.getSize();var O=T.getMargins();W.height=P-(O.top+O.bottom);var A=(W.width+O.left+O.right);W.x=J-A+O.left;W.y=G+O.top;I-=A;T.applyLayout(W)}var O=U.getMargins();var D={x:H+O.left,y:G+O.top,width:I-(O.left+O.right),height:P-(O.top+O.bottom)};U.applyLayout(D);if(C){for(var Q=0,R=C.length;Q<R;Q++){C[Q].collapse(false)}}if(Ext.isIE&&Ext.isStrict){X.repaint()}},destroy:function(){var B=["north","south","east","west"];for(var A=0;A<B.length;A++){var C=this[B[A]];if(C&&C.split){C.split.destroy(true)}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(B,A,C){Ext.apply(this,A);this.layout=B;this.position=C;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},C=="north"||C=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},isCollapsed:false,render:function(B,C){this.panel=C;C.el.enableDisplayMode();this.targetEl=B;this.el=C.el;var A=C.getState,D=this.position;C.getState=function(){return Ext.apply(A.call(C)||{},this.state)}.createDelegate(this);if(D!="center"){C.allowQueuedExpand=false;C.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible){C.collapseEl="el";C.slideAnchor=this.getSlideAnchor()}if(C.tools&&C.tools.toggle){C.tools.toggle.addClass("x-tool-collapse-"+D);C.tools.toggle.addClassOnOver("x-tool-collapse-"+D+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var B=new Ext.Template("<div class=\"x-tool x-tool-{id}\">&#160;</div>");B.disableFormats=true;B.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=B}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{var A=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);A.addClassOnOver("x-tool-expand-"+this.position+"-over");A.on("click",this.onExpandClick,this,{stopEvent:true});if(this.floatable!==false){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.collapseClick,this)}}}return this.collapsedEl},onExpandClick:function(A){if(this.isSlid){this.afterSlideIn();this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(A){this.panel.collapse()},beforeCollapse:function(B,A){this.lastAnim=A;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();this.panel.el.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(A){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(A){var B=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,B.getHeight())}else{this.panel.setSize(B.getWidth(),undefined)}B.hide();B.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",100)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",1);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(A){if(this.isSlid){A.stopPropagation();this.slideIn()}else{A.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(A){this.panel=A},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(A){var B=this.getCollapsedEl();B.setLeftTop(A.x,A.y);B.setSize(A.width,A.height)},applyLayout:function(A){if(this.isCollapsed){this.applyLayoutCollapsed(A)}else{this.panel.setPosition(A.x,A.y);this.panel.setSize(A.width,A.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var A=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={"mouseout":function(B){if(!B.within(this.el,true)){A.delay(500)}},"mouseover":function(B){A.cancel()},scope:this}}this.el.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return }this.isSlid=true;var A=this.panel.tools;if(A&&A.toggle){A.toggle.hide()}this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,this.collapsedEl.getHeight())}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",102);if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var A=this.panel.tools;if(A&&A.toggle){A.toggle.show()}},slideIn:function(A){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(A);return }this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(A)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(A){if(!A.within(this.el)){this.slideIn()}},anchors:{"west":"left","east":"right","north":"top","south":"bottom"},sanchors:{"west":"l","east":"r","north":"t","south":"b"},canchors:{"west":"tl-tr","east":"tr-tl","north":"tl-bl","south":"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var A=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var B=this.collapsedEl,A=this.cmargins;switch(this.position){case"west":return[-(A.right+B.getWidth()+A.left),0];break;case"east":return[A.right+B.getWidth()+A.left,0];break;case"north":return[0,-(A.top+A.bottom+B.getHeight())];break;case"south":return[0,A.top+A.bottom+B.getHeight()];break}}};Ext.layout.BorderLayout.SplitRegion=function(B,A,C){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,B,A,C);this.applyLayout=this.applyFns[C]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(C){if(this.isCollapsed){return this.applyLayoutCollapsed(C)}var D=this.splitEl.dom,B=D.style;this.panel.setPosition(C.x,C.y);var A=D.offsetWidth;B.left=(C.x+C.width-A)+"px";B.top=(C.y)+"px";B.height=Math.max(0,C.height)+"px";this.panel.setSize(C.width-A,C.height)},east:function(C){if(this.isCollapsed){return this.applyLayoutCollapsed(C)}var D=this.splitEl.dom,B=D.style;var A=D.offsetWidth;this.panel.setPosition(C.x+A,C.y);B.left=(C.x)+"px";B.top=(C.y)+"px";B.height=Math.max(0,C.height)+"px";this.panel.setSize(C.width-A,C.height)},north:function(C){if(this.isCollapsed){return this.applyLayoutCollapsed(C)}var D=this.splitEl.dom,B=D.style;var A=D.offsetHeight;this.panel.setPosition(C.x,C.y);B.left=(C.x)+"px";B.top=(C.y+C.height-A)+"px";B.width=Math.max(0,C.width)+"px";this.panel.setSize(C.width,C.height-A)},south:function(C){if(this.isCollapsed){return this.applyLayoutCollapsed(C)}var D=this.splitEl.dom,B=D.style;var A=D.offsetHeight;this.panel.setPosition(C.x,C.y+A);B.left=(C.x)+"px";B.top=(C.y)+"px";B.width=Math.max(0,C.width)+"px";this.panel.setSize(C.width,C.height-A)}},render:function(A,C){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,A,C);var D=this.position;this.splitEl=A.createChild({cls:"x-layout-split x-layout-split-"+D,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+D,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var B=this.splitSettings[D];this.split=new Ext.SplitBar(this.splitEl.dom,C.el,B.orientation);this.split.placement=B.placement;this.split.getMaximumSize=this[B.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[B.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[B.maxProp];if(C.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var A=this.panel.getSize();if(this.position=="north"||this.position=="south"){A.height+=this.splitEl.dom.offsetHeight}else{A.width+=this.splitEl.dom.offsetWidth}return A},getHMaxSize:function(){var B=this.maxSize||10000;var A=this.layout.center;return Math.min(B,(this.el.getWidth()+A.el.getWidth())-A.getMinWidth())},getVMaxSize:function(){var B=this.maxSize||10000;var A=this.layout.center;return Math.min(B,(this.el.getHeight()+A.el.getHeight())-A.getMinHeight())},onSplitMove:function(B,A){var C=this.panel.getSize();this.lastSplitSize=A;if(this.position=="north"||this.position=="south"){this.panel.setSize(C.width,A);this.state.height=A}else{this.panel.setSize(A,C.height);this.state.width=A}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split}});Ext.Container.LAYOUTS["border"]=Ext.layout.BorderLayout;
+Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",getAnchorViewSize:function(A,B){return A.body.getStyleSize()},setContainer:function(B){Ext.layout.FormLayout.superclass.setContainer.call(this,B);if(B.labelAlign){B.addClass("x-form-label-"+B.labelAlign)}if(B.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;";this.labelAdjust=0}else{this.labelSeparator=B.labelSeparator||this.labelSeparator;B.labelWidth=B.labelWidth||100;if(typeof B.labelWidth=="number"){var C=(typeof B.labelPad=="number"?B.labelPad:5);this.labelAdjust=B.labelWidth+C;this.labelStyle="width:"+B.labelWidth+"px;";this.elementStyle="padding-left:"+(B.labelWidth+C)+"px"}if(B.labelAlign=="top"){this.labelStyle="width:auto;";this.labelAdjust=0;this.elementStyle="padding-left:0;"}}if(!this.fieldTpl){var A=new Ext.Template("<div class=\"x-form-item {5}\" tabIndex=\"-1\">","<label for=\"{0}\" style=\"{2}\" class=\"x-form-item-label\">{1}{4}</label>","<div class=\"x-form-element\" id=\"x-form-el-{0}\" style=\"{3}\">","</div><div class=\"{6}\"></div>","</div>");A.disableFormats=true;A.compile();Ext.layout.FormLayout.prototype.fieldTpl=A}},renderItem:function(D,A,C){if(D&&!D.rendered&&D.isFormField&&D.inputType!="hidden"){var B=[D.id,D.fieldLabel,D.labelStyle||this.labelStyle||"",this.elementStyle||"",typeof D.labelSeparator=="undefined"?this.labelSeparator:D.labelSeparator,(D.itemCls||this.container.itemCls||"")+(D.hideLabel?" x-hide-label":""),D.clearCls||"x-form-clear-left"];if(typeof A=="number"){A=C.dom.childNodes[A]||null}if(A){this.fieldTpl.insertBefore(A,B)}else{this.fieldTpl.append(C,B)}D.render("x-form-el-"+D.id)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},adjustWidthAnchor:function(B,A){return B-(A.isFormField?(A.hideLabel?0:this.labelAdjust):0)},isValidParent:function(B,A){return true}});Ext.Container.LAYOUTS["form"]=Ext.layout.FormLayout;
+Ext.layout.Accordion=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,renderItem:function(A){if(this.animate===false){A.animCollapse=false}A.collapsible=true;if(this.autoWidth){A.autoWidth=true}if(this.titleCollapse){A.titleCollapse=true}if(this.hideCollapseTool){A.hideCollapseTool=true}if(this.collapseFirst!==undefined){A.collapseFirst=this.collapseFirst}if(!this.activeItem&&!A.collapsed){this.activeItem=A}else{if(this.activeItem){A.collapsed=true}}Ext.layout.Accordion.superclass.renderItem.apply(this,arguments);A.header.addClass("x-accordion-hd");A.on("beforeexpand",this.beforeExpand,this)},beforeExpand:function(C,B){var A=this.activeItem;if(A){if(this.sequence){delete this.activeItem;if(!A.collapsed){A.collapse({callback:function(){C.expand(B||true)},scope:this});return false}}else{A.collapse(this.animate)}}this.activeItem=C;if(this.activeOnTop){C.el.dom.parentNode.insertBefore(C.el.dom,C.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(F,E){if(this.fill&&F){var B=this.container.items.items;var D=0;for(var C=0,A=B.length;C<A;C++){var G=B[C];if(G!=F){D+=(G.getSize().height-G.bwrap.getHeight())}}E.height-=D;F.setSize(E)}}});Ext.Container.LAYOUTS["accordion"]=Ext.layout.Accordion;
+Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,setContainer:function(A){Ext.layout.TableLayout.superclass.setContainer.call(this,A);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(C,E){var D=C.items.items,A=D.length,F,B;if(!this.table){E.addClass("x-table-layout-ct");this.table=E.createChild({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},null,true);this.renderAll(C,E)}},getRow:function(A){var B=this.table.tBodies[0].childNodes[A];if(!B){B=document.createElement("tr");this.table.tBodies[0].appendChild(B)}return B},getNextCell:function(H){var A=this.getNextNonSpan(this.currentColumn,this.currentRow);var E=this.currentColumn=A[0],D=this.currentRow=A[1];for(var G=D;G<D+(H.rowspan||1);G++){if(!this.cells[G]){this.cells[G]=[]}for(var C=E;C<E+(H.colspan||1);C++){this.cells[G][C]=true}}var F=document.createElement("td");if(H.cellId){F.id=H.cellId}var B="x-table-layout-cell";if(H.cellCls){B+=" "+H.cellCls}F.className=B;if(H.colspan){F.colSpan=H.colspan}if(H.rowspan){F.rowSpan=H.rowspan}this.getRow(D).appendChild(F);return F},getNextNonSpan:function(A,C){var B=this.columns;while((B&&A>=B)||(this.cells[C]&&this.cells[C][A])){if(B&&A>=B){C++;A=0}else{A++}}return[A,C]},renderItem:function(C,A,B){if(C&&!C.rendered){C.render(this.getNextCell(C))}},isValidParent:function(B,A){return true}});Ext.Container.LAYOUTS["table"]=Ext.layout.TableLayout;
+Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",isForm:false,setContainer:function(A){Ext.layout.AbsoluteLayout.superclass.setContainer.call(this,A);if(A.isXType("form")){this.isForm=true}},onLayout:function(A,B){if(this.isForm){A.body.position()}else{B.position()}Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,A,B)},getAnchorViewSize:function(A,B){return this.isForm?A.body.getStyleSize():Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize.call(this,A,B)},isValidParent:function(B,A){return this.isForm?true:Ext.layout.AbsoluteLayout.superclass.isValidParent.call(this,B,A)},adjustWidthAnchor:function(B,A){return B?B-A.getPosition(true)[0]:B},adjustHeightAnchor:function(B,A){return B?B-A.getPosition(true)[1]:B}});Ext.Container.LAYOUTS["absolute"]=Ext.layout.AbsoluteLayout;
+Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(A,B){this.fireEvent("resize",this,A,B,A,B)}});Ext.reg("viewport",Ext.Viewport);
+Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.tbar){this.elements+=",tbar";if(typeof this.tbar=="object"){this.topToolbar=this.tbar}delete this.tbar}if(this.bbar){this.elements+=",bbar";if(typeof this.bbar=="object"){this.bottomToolbar=this.bbar}delete this.bbar}if(this.header===true){this.elements+=",header";delete this.header}else{if(this.title&&this.header!==false){this.elements+=",header"}}if(this.footer===true){this.elements+=",footer";delete this.footer}if(this.buttons){var C=this.buttons;this.buttons=[];for(var B=0,A=C.length;B<A;B++){if(C[B].render){C[B].ownerCt=this;this.buttons.push(C[B])}else{this.addButton(C[B])}}}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createElement:function(A,C){if(this[A]){C.appendChild(this[A].dom);return }if(A==="bwrap"||this.elements.indexOf(A)!=-1){if(this[A+"Cfg"]){this[A]=Ext.fly(C).createChild(this[A+"Cfg"])}else{var B=document.createElement("div");B.className=this[A+"Cls"];this[A]=Ext.get(C.appendChild(B))}}},onRender:function(H,G){Ext.Panel.superclass.onRender.call(this,H,G);this.createClasses();if(this.el){this.el.addClass(this.baseCls);this.header=this.el.down("."+this.headerCls);this.bwrap=this.el.down("."+this.bwrapCls);var M=this.bwrap?this.bwrap:this.el;this.tbar=M.down("."+this.tbarCls);this.body=M.down("."+this.bodyCls);this.bbar=M.down("."+this.bbarCls);this.footer=M.down("."+this.footerCls);this.fromMarkup=true}else{this.el=H.createChild({id:this.id,cls:this.baseCls},G)}var A=this.el,K=A.dom;if(this.cls){this.el.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){A.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",K.firstChild.firstChild.firstChild);this.createElement("bwrap",K);var O=this.bwrap.dom;var E=K.childNodes[1],B=K.childNodes[2];O.appendChild(E);O.appendChild(B);var P=O.firstChild.firstChild.firstChild;this.createElement("tbar",P);this.createElement("body",P);this.createElement("bbar",P);this.createElement("footer",O.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}}else{this.createElement("header",K);this.createElement("bwrap",K);var O=this.bwrap.dom;this.createElement("tbar",O);this.createElement("body",O);this.createElement("bbar",O);this.createElement("footer",O);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}if(this.bodyStyle){this.body.applyStyles(this.bodyStyle)}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML="<span class=\""+this.headerTextCls+"\">"+this.header.dom.innerHTML+"</span>";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible){this.tools=this.tools?this.tools.slice(0):[];if(!this.hideCollapseTool){this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.titleCollapse&&this.header){this.header.on("click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}}if(this.tools){var J=this.tools;this.tools={};this.addTool.apply(this,J)}else{this.tools={}}if(this.buttons&&this.buttons.length>0){var D=this.footer.createChild({cls:"x-panel-btns-ct",cn:{cls:"x-panel-btns x-panel-btns-"+this.buttonAlign,html:"<table cellspacing=\"0\"><tbody><tr></tr></tbody></table><div class=\"x-clear\"></div>"}},null,true);var L=D.getElementsByTagName("tr")[0];for(var F=0,I=this.buttons.length;F<I;F++){var N=this.buttons[F];var C=document.createElement("td");C.className="x-panel-btn-td";N.render(L.appendChild(C))}}if(this.tbar&&this.topToolbar){if(Ext.isArray(this.topToolbar)){this.topToolbar=new Ext.Toolbar(this.topToolbar)}this.topToolbar.render(this.tbar);this.topToolbar.ownerCt=this}if(this.bbar&&this.bottomToolbar){if(Ext.isArray(this.bottomToolbar)){this.bottomToolbar=new Ext.Toolbar(this.bottomToolbar)}this.bottomToolbar.render(this.bbar);this.bottomToolbar.ownerCt=this}},setIconClass:function(B){var A=this.iconCls;this.iconCls=B;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(A,this.iconCls)}else{var D=this.header.dom;var C=D.firstChild&&String(D.firstChild.tagName).toLowerCase()=="img"?D.firstChild:null;if(C){Ext.fly(C).replaceClass(A,this.iconCls)}else{Ext.DomHelper.insertBefore(D.firstChild,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}},makeFloating:function(A){this.floating=true;this.el=new Ext.Layer(typeof A=="object"?A:{shadow:this.shadow!==undefined?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined},this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},addButton:function(A,D,C){var E={handler:D,scope:C,minWidth:this.minButtonWidth,hideParent:true};if(typeof A=="string"){E.text=A}else{Ext.apply(E,A)}var B=new Ext.Button(E);B.ownerCt=this;if(!this.buttons){this.buttons=[]}this.buttons.push(B);return B},addTool:function(){if(!this[this.toolTarget]){return }if(!this.toolTemplate){var F=new Ext.Template("<div class=\"x-tool x-tool-{id}\">&#160;</div>");F.disableFormats=true;F.compile();Ext.Panel.prototype.toolTemplate=F}for(var E=0,C=arguments,B=C.length;E<B;E++){var A=C[E],G="x-tool-"+A.id+"-over";var D=this.toolTemplate.insertFirst((A.align!=="left")?this[this.toolTarget]:this[this.toolTarget].child("span"),A,true);this.tools[A.id]=D;D.enableDisplayMode("block");D.on("click",this.createToolHandler(D,A,G,this));if(A.on){D.on(A.on)}if(A.hidden){D.hide()}if(A.qtip){if(typeof A.qtip=="object"){Ext.QuickTips.register(Ext.apply({target:D.id},A.qtip))}else{D.dom.qtip=A.qtip}}D.addClassOnOver(G)}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(C,A,D,B){return function(E){C.removeClass(D);E.stopEvent();if(A.handler){A.handler.call(A.scope||C,E,C,B)}}},afterRender:function(){if(this.fromMarkup&&this.height===undefined&&!this.autoHeight){this.height=this.el.getHeight()}if(this.floating&&!this.hidden&&!this.initHidden){this.el.show()}if(this.title){this.setTitle(this.title)}this.setAutoScroll();if(this.html){this.body.update(typeof this.html=="object"?Ext.DomHelper.markup(this.html):this.html);delete this.html}if(this.contentEl){var A=Ext.getDom(this.contentEl);Ext.fly(A).removeClass(["x-hidden","x-hide-display"]);this.body.dom.appendChild(A)}if(this.collapsed){this.collapsed=false;this.collapse(false)}Ext.Panel.superclass.afterRender.call(this);this.initEvents()},setAutoScroll:function(){if(this.rendered&&this.autoScroll){var A=this.body||this.el;if(A){A.setOverflow("auto")}}},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,typeof this.draggable=="boolean"?null:this.draggable)},beforeEffect:function(){if(this.floating){this.el.beforeAction()}this.el.addClass("x-panel-animated")},afterEffect:function(){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(B,A,C){var D={scope:C,block:true};if(B===true){D.callback=A;return D}else{if(!B.callback){D.callback=A}else{D.callback=function(){A.call(C);Ext.callback(B.callback,B.scope)}}}return Ext.applyIf(D,B)},collapse:function(B){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,B)===false){return }var A=B===true||(B!==false&&this.animCollapse);this.beforeEffect();this.onCollapse(A,B);return this},onCollapse:function(A,B){if(A){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(B||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide();this.afterCollapse()}},afterCollapse:function(){this.collapsed=true;this.el.addClass(this.collapsedCls);this.afterEffect();this.fireEvent("collapse",this)},expand:function(B){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,B)===false){return }var A=B===true||(B!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect();this.onExpand(A,B);return this},onExpand:function(A,B){if(A){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(B||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show();this.afterExpand()}},afterExpand:function(){this.collapsed=false;this.afterEffect();this.fireEvent("expand",this)},toggleCollapse:function(A){this[this.collapsed?"expand":"collapse"](A);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(A,B){if(A!==undefined||B!==undefined){if(!this.collapsed){if(typeof A=="number"){this.body.setWidth(this.adjustBodyWidth(A-this.getFrameWidth()))}else{if(A=="auto"){this.body.setWidth(A)}}if(typeof B=="number"){this.body.setHeight(this.adjustBodyHeight(B-this.getFrameHeight()))}else{if(B=="auto"){this.body.setHeight(B)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:A,height:B};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height);this.doLayout()},this,{single:true})}}this.fireEvent("bodyresize",this,A,B)}this.syncShadow()},adjustBodyHeight:function(A){return A},adjustBodyWidth:function(A){return A},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var B=this.el.getFrameWidth("lr");if(this.frame){var A=this.bwrap.dom.firstChild;B+=(Ext.fly(A).getFrameWidth("l")+Ext.fly(A.firstChild).getFrameWidth("r"));var C=this.bwrap.dom.firstChild.firstChild.firstChild;B+=Ext.fly(C).getFrameWidth("lr")}return B},getFrameHeight:function(){var A=this.el.getFrameWidth("tb");A+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){var C=this.el.dom.firstChild;var D=this.bwrap.dom.lastChild;A+=(C.offsetHeight+D.offsetHeight);var B=this.bwrap.dom.firstChild.firstChild.firstChild;A+=Ext.fly(B).getFrameWidth("tb")}else{A+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return A},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.getSize().height-this.getFrameHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},setTitle:function(B,A){this.title=B;if(this.header&&this.headerAsText){this.header.child("span").update(B)}if(A){this.setIconClass(A)}this.fireEvent("titlechange",this,B);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var A=this.body.getUpdater();A.update.apply(A,arguments);return this},beforeDestroy:function(){Ext.Element.uncache(this.header,this.tbar,this.bbar,this.footer,this.body);if(this.tools){for(var B in this.tools){Ext.destroy(this.tools[B])}}if(this.buttons){for(var A in this.buttons){Ext.destroy(this.buttons[A])}}Ext.destroy(this.topToolbar,this.bottomToolbar);Ext.Panel.superclass.beforeDestroy.call(this)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(A,E,B){var D=document.createElement("div");D.className="x-panel-ghost "+(A?A:"");if(this.header){D.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(D.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());D.style.width=this.el.dom.offsetWidth+"px";if(!B){this.container.dom.appendChild(D)}else{Ext.getDom(B).appendChild(D)}if(E!==false&&this.el.useShim!==false){var C=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},D);C.show();return C}else{return new Ext.Element(D)}},doAutoLoad:function(){this.body.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})}});Ext.reg("panel",Ext.Panel);
+Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,closeAction:"close",elements:"header,body",collapsible:false,initHidden:true,monitorResize:true,frame:true,floating:true,initComponent:function(){Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore")},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox())},onRender:function(B,A){Ext.Window.superclass.onRender.call(this,B,A);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide()}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction});this.resizer.window=this;this.resizer.on("beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.initTools();this.el.on("mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);this.hidden=true;if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var A=this.getKeyMap();A.on(27,this.onEsc,this);A.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(){this[this.closeAction]()},beforeDestroy:function(){Ext.destroy(this.resizer,this.dd,this.proxy,this.mask);Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true});this.header.on("dblclick",this.toggleMaximize,this)}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var A=this.proxy.getBox();this.proxy.hide();this.window.handleResize(A);return A},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(B){var A=this.resizeBox;if(A.x!=B.x||A.y!=B.y){this.updateBox(B)}else{this.setSize(B)}this.focus();this.updateHandles();this.saveState();if(this.layout){this.doLayout()}this.fireEvent("resize",this,B.width,B.height)},focus:function(){var C=this.focusEl,A=this.defaultButton,B=typeof A;if(B!="undefined"){if(B=="number"){C=this.buttons[A]}else{if(B=="string"){C=Ext.getCmp(A)}else{C=A}}}C.focus.defer(10,C)},setAnimateTarget:function(A){A=Ext.get(A);this.animateTarget=A},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var A=this.el.getAlignToXY(this.container,"c-c");var B=this.el.translatePoints(A[0],A[1]);this.x=this.x===undefined?B.left:this.x;this.y=this.y===undefined?B.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(C,A,B){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return }if(this.fireEvent("beforeshow",this)===false){return }if(A){this.on("show",A,B,{single:true})}this.hidden=false;if(C!==undefined){this.setAnimateTarget(C)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}},afterShow:function(){this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();if(this.layout){this.doLayout()}if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var A=this.getBox(false);A.callback=this.afterShow;A.scope=this;A.duration=0.25;A.easing="easeNone";A.opacity=0.5;A.block=true;this.el.setStyle("display","none");this.proxy.shift(A)},hide:function(C,A,B){if(this.activeGhost){this.hide.defer(100,this,[C,A,B]);return }if(this.hidden||this.fireEvent("beforehide",this)===false){return }if(A){this.on("hide",A,B,{single:true})}this.hidden=true;if(C!==undefined){this.setAnimateTarget(C)}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.keyMap){this.keyMap.disable()}this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var B=this.getBox(false);this.proxy.setBox(B);this.el.hide();var A=this.animateTarget.getBox();A.callback=this.afterHide;A.scope=this;A.duration=0.25;A.easing="easeNone";A.block=true;A.opacity=0;this.proxy.shift(A)},onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var A=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var B;if(this.constrain){B={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var A=this.getSize();B={right:-(A.width-100),bottom:-(A.height-25)}}var C=this.el.getConstrainToXY(this.container,true,B);if(C){this.setPosition(C[0],C[1])}}},ghost:function(A){var C=this.createGhost(A);var B=this.getBox(true);C.setLeftTop(B.x,B.y);C.setWidth(B.width);this.el.hide();this.activeGhost=C;return C},unghost:function(B,A){if(B!==false){this.el.show();this.focus();if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}}if(A!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this)},close:function(){if(this.fireEvent("beforeclose",this)!==false){this.hide(null,function(){this.fireEvent("close",this);this.destroy()},this)}},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}},restore:function(){if(this.maximized){this.el.removeClass("x-window-maximized");this.tools.restore.hide();this.tools.maximize.show();this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible){this.tools.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}},toggleMaximize:function(){this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var A=this.container.getViewSize();this.setSize(A.width,A.height)},setZIndex:function(A){if(this.modal){this.mask.setStyle("z-index",A)}this.el.setZIndex(++A);A+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++A)}this.lastZIndex=A},alignTo:function(B,A,C){var D=this.el.getAlignToXY(B,A,C);this.setPagePosition(D[0],D[1]);return this},anchorTo:function(C,G,D,B,F){var E=function(){this.alignTo(C,G,D)};Ext.EventManager.onWindowResize(E,this);var A=typeof B;if(A!="undefined"){Ext.EventManager.on(window,"scroll",E,this,{buffer:A=="number"?B:50})}E.call(this);this[F]=E;return this},toFront:function(){if(this.manager.bringToFront(this)){this.focus()}return this},setActive:function(A){if(A){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var A=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(A[0],A[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(A){this.win=A;Ext.Window.DD.superclass.constructor.call(this,A.el.id,"WindowDD-"+A.id);this.setHandleElId(A.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var A=this.win;this.proxy=A.ghost();if(A.constrain!==false){var C=A.el.shadowOffset;this.constrainTo(A.container,{right:C,left:C,bottom:C})}else{if(A.constrainHeader!==false){var B=this.proxy.getSize();this.constrainTo(A.container,{right:-(B.width-this.headerOffsets[0]),bottom:-(B.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(A){this.alignElWithMouse(this.proxy,A.getPageX(),A.getPageY())},endDrag:function(A){this.win.unghost();this.win.saveState()}});
+Ext.WindowGroup=function(){var F={};var D=[];var E=null;var C=function(I,H){return(!I._lastAccess||I._lastAccess<H._lastAccess)?-1:1};var G=function(){var J=D,H=J.length;if(H>0){J.sort(C);var I=J[0].manager.zseed;for(var K=0;K<H;K++){var L=J[K];if(L&&!L.hidden){L.setZIndex(I+(K*10))}}}A()};var B=function(H){if(H!=E){if(E){E.setActive(false)}E=H;if(H){H.setActive(true)}}};var A=function(){for(var H=D.length-1;H>=0;--H){if(!D[H].hidden){B(D[H]);return }}B(null)};return{zseed:9000,register:function(H){F[H.id]=H;D.push(H);H.on("hide",A)},unregister:function(H){delete F[H.id];H.un("hide",A);D.remove(H)},get:function(H){return typeof H=="object"?H:F[H]},bringToFront:function(H){H=this.get(H);if(H!=E){H._lastAccess=new Date().getTime();G();return true}return false},sendToBack:function(H){H=this.get(H);H._lastAccess=-(new Date().getTime());G();return H},hideAll:function(){for(var H in F){if(F[H]&&typeof F[H]!="function"&&F[H].isVisible()){F[H].hide()}}},getActive:function(){return E},getBy:function(J,I){var K=[];for(var H=D.length-1;H>=0;--H){var L=D[H];if(J.call(I||L,L)!==false){K.push(L)}}return K},each:function(I,H){for(var J in F){if(F[J]&&typeof F[J]!="function"){if(I.call(H||F[J],F[J])===false){return }}}}}};Ext.WindowMgr=new Ext.WindowGroup();
+Ext.dd.PanelProxy=function(A,B){this.panel=A;this.id=this.panel.id+"-ddproxy";Ext.apply(this,B)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(B,C,A){this.hide();if(typeof C=="function"){C.call(A||this)}},moveProxy:function(A,B){if(this.proxy){A.insertBefore(this.proxy.dom,B)}}};Ext.Panel.DD=function(B,A){this.panel=B;this.dragData={panel:B};this.proxy=new Ext.dd.PanelProxy(B,A);Ext.Panel.DD.superclass.constructor.call(this,B.el,A);var C=B.header;if(C){this.setHandleElId(C.id)}(C?C:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(A,B){this.proxy.show()},b4MouseDown:function(B){var A=B.getPageX();var C=B.getPageY();this.autoOffset(A,C)},onInitDrag:function(A,B){this.onStartDrag(A,B);return true},createFrame:Ext.emptyFn,getDragEl:function(A){return this.proxy.ghost.dom},endDrag:function(A){this.proxy.hide();this.panel.saveState()},autoOffset:function(A,B){A-=this.startPageX;B-=this.startPageY;this.setDelta(A,B)}});
+Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(B,A){return typeof this.state[B]=="undefined"?A:this.state[B]},clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null)},set:function(A,B){this.state[A]=B;this.fireEvent("statechange",this,A,B)},decodeValue:function(A){var J=/^(a|n|d|b|s|o)\:(.*)$/;var C=J.exec(unescape(A));if(!C||!C[1]){return }var F=C[1];var H=C[2];switch(F){case"n":return parseFloat(H);case"d":return new Date(Date.parse(H));case"b":return(H=="1");case"a":var G=[];var I=H.split("^");for(var B=0,D=I.length;B<D;B++){G.push(this.decodeValue(I[B]))}return G;case"o":var G={};var I=H.split("^");for(var B=0,D=I.length;B<D;B++){var E=I[B].split("=");G[E[0]]=this.decodeValue(E[1])}return G;default:return H}},encodeValue:function(C){var B;if(typeof C=="number"){B="n:"+C}else{if(typeof C=="boolean"){B="b:"+(C?"1":"0")}else{if(Ext.isDate(C)){B="d:"+C.toGMTString()}else{if(Ext.isArray(C)){var F="";for(var E=0,A=C.length;E<A;E++){F+=this.encodeValue(C[E]);if(E!=A-1){F+="^"}}B="a:"+F}else{if(typeof C=="object"){var F="";for(var D in C){if(typeof C[D]!="function"&&C[D]!==undefined){F+=D+"="+this.encodeValue(C[D])+"^"}}B="o:"+F.substring(0,F.length-1)}else{B="s:"+C}}}}}return escape(B)}});
+Ext.state.Manager=function(){var A=new Ext.state.Provider();return{setProvider:function(B){A=B},get:function(C,B){return A.get(C,B)},set:function(B,C){A.set(B,C)},clear:function(B){A.clear(B)},getProvider:function(){return A}}}();
+Ext.state.CookieProvider=function(A){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,A);this.state=this.readCookies()};Ext.extend(Ext.state.CookieProvider,Ext.state.Provider,{set:function(A,B){if(typeof B=="undefined"||B===null){this.clear(A);return }this.setCookie(A,B);Ext.state.CookieProvider.superclass.set.call(this,A,B)},clear:function(A){this.clearCookie(A);Ext.state.CookieProvider.superclass.clear.call(this,A)},readCookies:function(){var C={};var F=document.cookie+";";var B=/\s?(.*?)=(.*?);/g;var E;while((E=B.exec(F))!=null){var A=E[1];var D=E[2];if(A&&A.substring(0,3)=="ys-"){C[A.substr(3)]=this.decodeValue(D)}}return C},setCookie:function(A,B){document.cookie="ys-"+A+"="+this.encodeValue(B)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(A){document.cookie="ys-"+A+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});
+Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(typeof this.tpl=="string"){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","selectionchange","beforeselect");this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},onRender:function(){if(!this.el){this.el=document.createElement("div");this.el.id=this.id}Ext.DataView.superclass.onRender.apply(this,arguments)},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.el.on({"mouseover":this.onMouseOver,"mouseout":this.onMouseOut,scope:this})}if(this.store){this.setStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);this.el.update("");var A=this.store.getRange();if(A.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){this.el.update(this.emptyText)}this.hasSkippedEmptyText=true;this.all.clear();return }this.tpl.overwrite(this.el,this.collectData(A,0));this.all.fill(Ext.query(this.itemSelector,this.el.dom));this.updateIndexes(0)},prepareData:function(A){return A},collectData:function(B,E){var D=[];for(var C=0,A=B.length;C<A;C++){D[D.length]=this.prepareData(B[C].data,E+C,B[C])}return D},bufferRender:function(A){var B=document.createElement("div");this.tpl.overwrite(B,this.collectData(A));return Ext.query(this.itemSelector,B)},onUpdate:function(F,A){var B=this.store.indexOf(A);var E=this.isSelected(B);var C=this.all.elements[B];var D=this.bufferRender([A],B)[0];this.all.replaceElement(B,D,true);if(E){this.selected.replaceElement(C,D);this.all.item(B).addClass(this.selectedClass)}this.updateIndexes(B,B)},onAdd:function(E,C,D){if(this.all.getCount()==0){this.refresh();return }var B=this.bufferRender(C,D),F,A=this.all.elements;if(D<this.all.getCount()){F=this.all.item(D).insertSibling(B,"before",true);A.splice.apply(A,[D,0].concat(B))}else{F=this.all.last().insertSibling(B,"after",true);A.push.apply(A,B)}this.updateIndexes(D)},onRemove:function(C,A,B){this.deselect(B);this.all.removeElement(B,true);this.updateIndexes(B)},refreshNode:function(A){this.onUpdate(this.store,this.store.getAt(A))},updateIndexes:function(D,C){var B=this.all.elements;D=D||0;C=C||((C===0)?0:(B.length-1));for(var A=D;A<=C;A++){B[A].viewIndex=A}},setStore:function(A,B){if(!B&&this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.refresh,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(A){A=Ext.StoreMgr.lookup(A);A.on("beforeload",this.onBeforeLoad,this);A.on("datachanged",this.refresh,this);A.on("add",this.onAdd,this);A.on("remove",this.onRemove,this);A.on("update",this.onUpdate,this);A.on("clear",this.refresh,this)}this.store=A;if(A){this.refresh()}},findItemFromChild:function(A){return Ext.fly(A).findParent(this.itemSelector,this.el)},onClick:function(C){var B=C.getTarget(this.itemSelector,this.el);if(B){var A=this.indexOf(B);if(this.onItemClick(B,A,C)!==false){this.fireEvent("click",this,A,B,C)}}else{if(this.fireEvent("containerclick",this,C)!==false){this.clearSelections()}}},onContextMenu:function(B){var A=B.getTarget(this.itemSelector,this.el);if(A){this.fireEvent("contextmenu",this,this.indexOf(A),A,B)}},onDblClick:function(B){var A=B.getTarget(this.itemSelector,this.el);if(A){this.fireEvent("dblclick",this,this.indexOf(A),A,B)}},onMouseOver:function(B){var A=B.getTarget(this.itemSelector,this.el);if(A&&A!==this.lastItem){this.lastItem=A;Ext.fly(A).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(A),A,B)}},onMouseOut:function(A){if(this.lastItem){if(!A.within(this.lastItem,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,A);delete this.lastItem}}},onItemClick:function(B,A,C){if(this.fireEvent("beforeclick",this,A,B,C)===false){return false}if(this.multiSelect){this.doMultiSelection(B,A,C);C.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(B,A,C);C.preventDefault()}}return true},doSingleSelection:function(B,A,C){if(C.ctrlKey&&this.isSelected(A)){this.deselect(A)}else{this.select(A,false)}},doMultiSelection:function(C,A,D){if(D.shiftKey&&this.last!==false){var B=this.last;this.selectRange(B,A,D.ctrlKey);this.last=B}else{if((D.ctrlKey||this.simpleSelect)&&this.isSelected(A)){this.deselect(A)}else{this.select(A,D.ctrlKey||D.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var B=[],D=this.selected.elements;for(var C=0,A=D.length;C<A;C++){B.push(D[C].viewIndex)}return B},getSelectedRecords:function(){var D=[],C=this.selected.elements;for(var B=0,A=C.length;B<A;B++){D[D.length]=this.store.getAt(C[B].viewIndex)}return D},getRecords:function(B){var E=[],D=B;for(var C=0,A=D.length;C<A;C++){E[E.length]=this.store.getAt(D[C].viewIndex)}return E},getRecord:function(A){return this.store.getAt(A.viewIndex)},clearSelections:function(A,B){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){if(!B){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!A){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(A){return this.selected.contains(this.getNode(A))},deselect:function(A){if(this.isSelected(A)){A=this.getNode(A);this.selected.removeElement(A);if(this.last==A.viewIndex){this.last=false}Ext.fly(A).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(D,F,B){if(Ext.isArray(D)){if(!F){this.clearSelections(true)}for(var C=0,A=D.length;C<A;C++){this.select(D[C],true,true)}if(!B){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var E=this.getNode(D);if(!F){this.clearSelections(true)}if(E&&!this.isSelected(E)){if(this.fireEvent("beforeselect",this,E,this.selected.elements)!==false){Ext.fly(E).addClass(this.selectedClass);this.selected.add(E);this.last=E.viewIndex;if(!B){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(C,A,B){if(!B){this.clearSelections(true)}this.select(this.getNodes(C,A),true)},getNode:function(A){if(typeof A=="string"){return document.getElementById(A)}else{if(typeof A=="number"){return this.all.elements[A]}}return A},getNodes:function(E,A){var D=this.all.elements;E=E||0;A=typeof A=="undefined"?Math.max(D.length-1,0):A;var B=[],C;if(E<=A){for(C=E;C<=A&&D[C];C++){B.push(D[C])}}else{for(C=E;C>=A&&D[C];C--){B.push(D[C])}}return B},indexOf:function(A){A=this.getNode(A);if(typeof A.viewIndex=="number"){return A.viewIndex}return this.all.indexOf(A)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.el.update("<div class=\"loading-indicator\">"+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){Ext.DataView.superclass.onDestroy.call(this);this.setStore(null)}});Ext.reg("dataview",Ext.DataView);
+Ext.ColorPalette=function(A){Ext.ColorPalette.superclass.constructor.call(this,A);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}};Ext.extend(Ext.ColorPalette,Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(B,A){var C=this.tpl||new Ext.XTemplate("<tpl for=\".\"><a href=\"#\" class=\"color-{.}\" hidefocus=\"on\"><em><span style=\"background:#{.}\" unselectable=\"on\">&#160;</span></em></a></tpl>");var D=document.createElement("div");D.className=this.itemCls;C.overwrite(D,this.colors);B.dom.insertBefore(D,A);this.el=Ext.get(D);this.el.on(this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.el.on("click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var A=this.value;this.value=null;this.select(A)}},handleClick:function(B,A){B.preventDefault();if(!this.disabled){var C=A.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(C.toUpperCase())}},select:function(A){A=A.replace("#","");if(A!=this.value||this.allowReselect){var B=this.el;if(this.value){B.child("a.color-"+this.value).removeClass("x-color-palette-sel")}B.child("a.color-"+A).addClass("x-color-palette-sel");this.value=A;this.fireEvent("select",this,A)}}});Ext.reg("colorpalette",Ext.ColorPalette);
+Ext.DatePicker=Ext.extend(Ext.Component,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",constrainToViewport:true,monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime():new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var A=this.disabledDates;var C="(?:";for(var B=0;B<A.length;B++){C+=A[B];if(B!=A.length-1){C+="|"}}this.disabledDatesRE=new RegExp(C+")")}},setDisabledDates:function(A){if(Ext.isArray(A)){this.disabledDates=A;this.disabledDatesRE=null}else{this.disabledDatesRE=A}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(A){this.disabledDays=A;this.update(this.value,true)},setMinDate:function(A){this.minDate=A;this.update(this.value,true)},setMaxDate:function(A){this.maxDate=A;this.update(this.value,true)},setValue:function(B){var A=this.value;this.value=B.clearTime(true);if(this.el){this.update(this.value)}},getValue:function(){return this.value},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(A,F){var C=["<table cellspacing=\"0\">","<tr><td class=\"x-date-left\"><a href=\"#\" title=\"",this.prevText,"\">&#160;</a></td><td class=\"x-date-middle\" align=\"center\"></td><td class=\"x-date-right\"><a href=\"#\" title=\"",this.nextText,"\">&#160;</a></td></tr>","<tr><td colspan=\"3\"><table class=\"x-date-inner\" cellspacing=\"0\"><thead><tr>"];var E=this.dayNames;for(var D=0;D<7;D++){var G=this.startDay+D;if(G>6){G=G-7}C.push("<th><span>",E[G].substr(0,1),"</span></th>")}C[C.length]="</tr></thead><tbody><tr>";for(var D=0;D<42;D++){if(D%7==0&&D!=0){C[C.length]="</tr><tr>"}C[C.length]="<td><a href=\"#\" hidefocus=\"on\" class=\"x-date-date\" tabIndex=\"1\"><em><span></span></em></a></td>"}C.push("</tr></tbody></table></td></tr>",this.showToday?"<tr><td colspan=\"3\" class=\"x-date-bottom\" align=\"center\"></td></tr>":"","</table><div class=\"x-date-mp\"></div>");var B=document.createElement("div");B.className="x-date-picker";B.innerHTML=C.join("");A.dom.insertBefore(B,F);this.el=Ext.get(B);this.eventEl=Ext.get(B.firstChild);new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");var I=new Ext.KeyNav(this.eventEl,{"left":function(J){J.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},"right":function(J){J.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},"up":function(J){J.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},"down":function(J){J.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},"pageUp":function(J){this.showNextMonth()},"pageDown":function(J){this.showPrevMonth()},"enter":function(J){J.stopPropagation();return true},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.on("click",this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var H=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,H),tooltip:String.format(this.todayTip,H),handler:this.selectToday,scope:this})}if(Ext.isIE){this.el.repaint()}this.update(this.value)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var A=["<table border=\"0\" cellspacing=\"0\">"];for(var B=0;B<6;B++){A.push("<tr><td class=\"x-date-mp-month\"><a href=\"#\">",this.monthNames[B].substr(0,3),"</a></td>","<td class=\"x-date-mp-month x-date-mp-sep\"><a href=\"#\">",this.monthNames[B+6].substr(0,3),"</a></td>",B==0?"<td class=\"x-date-mp-ybtn\" align=\"center\"><a class=\"x-date-mp-prev\"></a></td><td class=\"x-date-mp-ybtn\" align=\"center\"><a class=\"x-date-mp-next\"></a></td></tr>":"<td class=\"x-date-mp-year\"><a href=\"#\"></a></td><td class=\"x-date-mp-year\"><a href=\"#\"></a></td></tr>")}A.push("<tr class=\"x-date-mp-btns\"><td colspan=\"4\"><button type=\"button\" class=\"x-date-mp-ok\">",this.okText,"</button><button type=\"button\" class=\"x-date-mp-cancel\">",this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(A.join(""));this.monthPicker.on("click",this.onMonthClick,this);this.monthPicker.on("dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(C,D,E){E+=1;if((E%2)==0){C.dom.xmonth=5+Math.round(E*0.5)}else{C.dom.xmonth=Math.round((E-1)*0.5)}})}},showMonthPicker:function(){this.createMonthPicker();var A=this.el.getSize();this.monthPicker.setSize(A);this.monthPicker.child("table").setSize(A);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})},updateMPYear:function(E){this.mpyear=E;var C=this.mpYears.elements;for(var B=1;B<=10;B++){var D=C[B-1],A;if((B%2)==0){A=E+Math.round(B*0.5);D.firstChild.innerHTML=A;D.xyear=A}else{A=E-(5-Math.round(B*0.5));D.firstChild.innerHTML=A;D.xyear=A}this.mpYears.item(B-1)[A==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(A){this.mpMonths.each(function(B,C,D){B[B.dom.xmonth==A?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(A){},onMonthClick:function(D,B){D.stopEvent();var C=new Ext.Element(B),A;if(C.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(C.is("button.x-date-mp-ok")){var E=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(E.getMonth()!=this.mpSelMonth){E=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(E);this.hideMonthPicker()}else{if(A=C.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelMonth=A.dom.xmonth}else{if(A=C.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelYear=A.dom.xyear}else{if(C.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(C.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(D,B){D.stopEvent();var C=new Ext.Element(B),A;if(A=C.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,A.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if(A=C.up("td.x-date-mp-year",2)){this.update(new Date(A.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(A){if(this.monthPicker){if(A===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(A){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(A){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(A){var B=A.getWheelDelta();if(B>0){this.showPrevMonth();A.stopEvent()}else{if(B<0){this.showNextMonth();A.stopEvent()}}},handleDateClick:function(B,A){B.stopEvent();if(A.dateValue&&!Ext.fly(A.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(A.dateValue));this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(a,U){var A=this.activeDate;this.activeDate=a;if(!U&&A&&this.el){var K=a.getTime();if(A.getMonth()==a.getMonth()&&A.getFullYear()==a.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(d){if(d.dom.firstChild.dateValue==K){d.addClass("x-date-selected");setTimeout(function(){try{d.dom.firstChild.focus()}catch(f){}},50);return false}});return }}var G=a.getDaysInMonth();var L=a.getFirstDateOfMonth();var D=L.getDay()-this.startDay;if(D<=this.startDay){D+=7}var V=a.add("mo",-1);var E=V.getDaysInMonth()-D;var C=this.cells.elements;var M=this.textNodes;G+=D;var R=86400000;var X=(new Date(V.getFullYear(),V.getMonth(),E)).clearTime();var W=new Date().clearTime().getTime();var P=a.clearTime().getTime();var O=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var S=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var Z=this.disabledDatesRE;var N=this.disabledDatesText;var c=this.disabledDays?this.disabledDays.join(""):false;var Y=this.disabledDaysText;var T=this.format;if(this.showToday){var I=new Date().clearTime();var B=(I<O||I>S||(Z&&T&&Z.test(I.dateFormat(T)))||(c&&c.indexOf(I.getDay())!=-1));this.todayBtn.setDisabled(B);this.todayKeyListener[B?"disable":"enable"]()}var H=function(g,d){d.title="";var e=X.getTime();d.firstChild.dateValue=e;if(e==W){d.className+=" x-date-today";d.title=g.todayText}if(e==P){d.className+=" x-date-selected";setTimeout(function(){try{d.firstChild.focus()}catch(h){}},50)}if(e<O){d.className=" x-date-disabled";d.title=g.minText;return }if(e>S){d.className=" x-date-disabled";d.title=g.maxText;return }if(c){if(c.indexOf(X.getDay())!=-1){d.title=Y;d.className=" x-date-disabled"}}if(Z&&T){var f=X.dateFormat(T);if(Z.test(f)){d.title=N.replace("%0",f);d.className=" x-date-disabled"}}};var Q=0;for(;Q<D;Q++){M[Q].innerHTML=(++E);X.setDate(X.getDate()+1);C[Q].className="x-date-prevday";H(this,C[Q])}for(;Q<G;Q++){intDay=Q-D+1;M[Q].innerHTML=(intDay);X.setDate(X.getDate()+1);C[Q].className="x-date-active";H(this,C[Q])}var b=0;for(;Q<42;Q++){M[Q].innerHTML=(++b);X.setDate(X.getDate()+1);C[Q].className="x-date-nextday";H(this,C[Q])}this.mbtn.setText(this.monthNames[a.getMonth()]+" "+a.getFullYear());if(!this.internalRender){var F=this.el.dom.firstChild;var J=F.offsetWidth;this.el.setWidth(J+this.el.getBorderWidth("lr"));Ext.fly(F).setWidth(J);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){F.rows[0].cells[1].style.width=(J-(F.rows[0].cells[0].offsetWidth+F.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[a])}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.mbtn,this.todayBtn)}}});Ext.reg("datepicker",Ext.DatePicker);
+Ext.TabPanel=Ext.extend(Ext.Panel,{monitorResize:true,deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:null,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout({deferredRender:this.deferredRender}));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},render:function(){Ext.TabPanel.superclass.render.apply(this,arguments);if(this.activeTab!==undefined){var A=this.activeTab;delete this.activeTab;this.setActiveTab(A)}},onRender:function(C,A){Ext.TabPanel.superclass.onRender.call(this,C,A);if(this.plain){var F=this.tabPosition=="top"?"header":"footer";this[F].addClass("x-tab-panel-"+F+"-plain")}var B=this[this.stripTarget];this.stripWrap=B.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var E=(this.tabPosition=="bottom"?this.stripWrap:null);this.stripSpacer=B.createChild({cls:"x-tab-strip-spacer"},E);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge"});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var D=new Ext.Template("<li class=\"{cls}\" id=\"{id}\"><a class=\"x-tab-strip-close\" onclick=\"return false;\"></a>","<a class=\"x-tab-right\" href=\"#\" onclick=\"return false;\"><em class=\"x-tab-left\">","<span class=\"x-tab-strip-inner\"><span class=\"x-tab-strip-text {iconCls}\">{text}</span></span>","</em></a></li>");D.disableFormats=true;D.compile();Ext.TabPanel.prototype.itemTpl=D}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.on("add",this.onAdd,this);this.on("remove",this.onRemove,this);this.strip.on("mousedown",this.onStripMouseDown,this);this.strip.on("contextmenu",this.onStripContextMenu,this);if(this.enableTabScroll){this.strip.on("mousewheel",this.onWheel,this)}},findTargets:function(C){var B=null;var A=C.getTarget("li",this.strip);if(A){B=this.getComponent(A.id.split(this.idDelimiter)[1]);if(B.disabled){return{close:null,item:null,el:null}}}return{close:C.getTarget(".x-tab-strip-close",this.strip),item:B,el:A}},onStripMouseDown:function(B){if(B.button!=0){return }B.preventDefault();var A=this.findTargets(B);if(A.close){this.remove(A.item);return }if(A.item&&A.item!=this.activeTab){this.setActiveTab(A.item)}},onStripContextMenu:function(B){B.preventDefault();var A=this.findTargets(B);if(A.item){this.fireEvent("contextmenu",this,A.item,B)}},readTabs:function(D){if(D===true){this.items.each(function(G){this.remove(G)},this)}var C=this.el.query(this.autoTabSelector);for(var B=0,A=C.length;B<A;B++){var E=C[B];var F=E.getAttribute("title");E.removeAttribute("title");this.add({title:F,el:E})}},initTab:function(D,B){var E=this.strip.dom.childNodes[B];var A=D.closable?"x-tab-strip-closable":"";if(D.disabled){A+=" x-item-disabled"}if(D.iconCls){A+=" x-tab-with-icon"}if(D.tabCls){A+=" "+D.tabCls}var F={id:this.id+this.idDelimiter+D.getItemId(),text:D.title,cls:A,iconCls:D.iconCls||""};var C=E?this.itemTpl.insertBefore(E,F):this.itemTpl.append(this.strip,F);Ext.fly(C).addClassOnOver("x-tab-strip-over");if(D.tabTip){Ext.fly(C).child("span.x-tab-strip-text",true).qtip=D.tabTip}D.on("disable",this.onItemDisabled,this);D.on("enable",this.onItemEnabled,this);D.on("titlechange",this.onItemTitleChanged,this);D.on("beforeshow",this.onBeforeShowItem,this)},onAdd:function(C,B,A){this.initTab(B,A);if(this.items.getCount()==1){this.syncSize()}this.delegateUpdates()},onBeforeAdd:function(B){var A=B.events?(this.items.containsKey(B.getItemId())?B:null):this.items.get(B);if(A){this.setActiveTab(B);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var C=B.elements;B.elements=C?C.replace(",header",""):C;B.border=(B.border===true)},onRemove:function(C,B){Ext.removeNode(this.getTabEl(B));this.stack.remove(B);B.un("disable",this.onItemDisabled,this);B.un("enable",this.onItemEnabled,this);B.un("titlechange",this.onItemTitleChanged,this);B.un("beforeshow",this.onBeforeShowItem,this);if(B==this.activeTab){var A=this.stack.next();if(A){this.setActiveTab(A)}else{this.setActiveTab(0)}}this.delegateUpdates()},onBeforeShowItem:function(A){if(A!=this.activeTab){this.setActiveTab(A);return false}},onItemDisabled:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).addClass("x-item-disabled")}this.stack.remove(B)},onItemEnabled:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).removeClass("x-item-disabled")}},onItemTitleChanged:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).child("span.x-tab-strip-text",true).innerHTML=B.title}},getTabEl:function(A){var B=(typeof A==="number")?this.items.items[A].getItemId():A.getItemId();return document.getElementById(this.id+this.idDelimiter+B)},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(B){B=this.getComponent(B);var A=this.getTabEl(B);if(A){A.style.display="none";this.delegateUpdates()}this.stack.remove(B)},unhideTabStripItem:function(B){B=this.getComponent(B);var A=this.getTabEl(B);if(A){A.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return }if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var G=this.items.length;var B=this.tabPosition!="bottom"?"header":"footer";var C=this[B].dom.offsetWidth;var A=this[B].dom.clientWidth;if(!this.resizeTabs||G<1||!A){return }var I=Math.max(Math.min(Math.floor((A-4)/G)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=I;var K=this.stripWrap.dom.getElementsByTagName("li");for(var E=0,H=K.length-1;E<H;E++){var J=K[E];var L=J.childNodes[1].firstChild.firstChild;var F=J.offsetWidth;var D=L.offsetWidth;L.style.width=(I-(F-D))+"px"}},adjustBodyWidth:function(A){if(this.header){this.header.setWidth(A)}if(this.footer){this.footer.setWidth(A)}return A},setActiveTab:function(C){C=this.getComponent(C);if(!C||this.fireEvent("beforetabchange",this,C,this.activeTab)===false){return }if(!this.rendered){this.activeTab=C;return }if(this.activeTab!=C){if(this.activeTab){var A=this.getTabEl(this.activeTab);if(A){Ext.fly(A).removeClass("x-tab-strip-active")}this.activeTab.fireEvent("deactivate",this.activeTab)}var B=this.getTabEl(C);Ext.fly(B).addClass("x-tab-strip-active");this.activeTab=C;this.stack.add(C);this.layout.setActiveItem(C);if(this.layoutOnTabChange&&C.doLayout){C.doLayout()}if(this.scrolling){this.scrollToTab(C,this.animScroll)}C.fireEvent("activate",C);this.fireEvent("tabchange",this,C)}},getActiveTab:function(){return this.activeTab||null},getItem:function(A){return this.getComponent(A)},autoScrollTabs:function(){var G=this.items.length;var D=this.header.dom.offsetWidth;var C=this.header.dom.clientWidth;var F=this.stripWrap;var E=F.dom;var B=E.offsetWidth;var H=this.getScrollPos();var A=this.edge.getOffsetsTo(this.stripWrap)[0]+H;if(!this.enableTabScroll||G<1||B<20){return }if(A<=C){E.scrollLeft=0;F.setWidth(C);if(this.scrolling){this.scrolling=false;this.header.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir){E.style.marginLeft="";E.style.marginRight=""}}}else{if(!this.scrolling){this.header.addClass("x-tab-scrolling");if(Ext.isAir){E.style.marginLeft="18px";E.style.marginRight="18px"}}C-=F.getMargins("lr");F.setWidth(C>20?C:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(H>(A-C)){E.scrollLeft=A-C}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){var C=this.stripWrap.dom.offsetHeight;var A=this.header.insertFirst({cls:"x-tab-scroller-left"});A.setHeight(C);A.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(A,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=A;var B=this.header.insertFirst({cls:"x-tab-scroller-right"});B.setHeight(C);B.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(B,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=B},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(E,A){if(!E){return }var C=this.getTabEl(E);var G=this.getScrollPos(),D=this.getScrollArea();var F=Ext.fly(C).getOffsetsTo(this.stripWrap)[0]+G;var B=F+C.offsetWidth;if(F<G){this.scrollTo(F,A)}else{if(B>(G+D)){this.scrollTo(B-D,A)}}},scrollTo:function(B,A){this.stripWrap.scrollTo("left",B,A?this.getScrollAnim():false);if(!A){this.updateScrollButtons()}},onWheel:function(D){var E=D.getWheelDelta()*this.wheelIncrement*-1;D.stopEvent();var F=this.getScrollPos();var C=F+E;var A=this.getScrollWidth()-this.getScrollArea();var B=Math.max(0,Math.min(A,C));if(B!=F){this.scrollTo(B,false)}},onScrollRight:function(){var A=this.getScrollWidth()-this.getScrollArea();var C=this.getScrollPos();var B=Math.min(A,C+this.getScrollIncrement());if(B!=C){this.scrollTo(B,this.animScroll)}},onScrollLeft:function(){var B=this.getScrollPos();var A=Math.max(0,B-this.getScrollIncrement());if(A!=B){this.scrollTo(A,this.animScroll)}},updateScrollButtons:function(){var A=this.getScrollPos();this.scrollLeft[A==0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[A>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var A=[];return{add:function(B){A.push(B);if(A.length>10){A.shift()}},remove:function(E){var D=[];for(var C=0,B=A.length;C<B;C++){if(A[C]!=E){D.push(A[C])}}A=D},next:function(){return A.pop()}}};
+Ext.Button=Ext.extend(Ext.Component,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(typeof this.toggleGroup==="string"){this.enableToggle=true}},onRender:function(C,A){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"x-btn-wrap\"><tbody><tr>","<td class=\"x-btn-left\"><i>&#160;</i></td><td class=\"x-btn-center\"><em unselectable=\"on\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></em></td><td class=\"x-btn-right\"><i>&#160;</i></td>","</tr></tbody></table>")}this.template=Ext.Button.buttonTemplate}var B,E=[this.text||"&#160;",this.type];if(A){B=this.template.insertBefore(A,E,true)}else{B=this.template.append(C,E,true)}var D=B.child(this.buttonSelector);D.on("focus",this.onFocus,this);D.on("blur",this.onBlur,this);this.initButtonEl(B,D);if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu")}Ext.ButtonToggleMgr.register(this)},initButtonEl:function(B,C){this.el=B;B.addClass("x-btn");if(this.icon){C.setStyle("background-image","url("+this.icon+")")}if(this.iconCls){C.addClass(this.iconCls);if(!this.cls){B.addClass(this.text?"x-btn-text-icon":"x-btn-icon")}}if(this.tabIndex!==undefined){C.dom.tabIndex=this.tabIndex}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:C.id},this.tooltip))}else{C.dom[this.tooltipType]=this.tooltip}}if(this.pressed){this.el.addClass("x-btn-pressed")}if(this.handleMouseEvents){B.on("mouseover",this.onMouseOver,this);B.on("mousedown",this.onMouseDown,this)}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}if(this.id){this.el.dom.id=this.el.id=this.id}if(this.repeat){var A=new Ext.util.ClickRepeater(B,typeof this.repeat=="object"?this.repeat:{});A.on("click",this.onClick,this)}B.on(this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);if(Ext.isIE6){this.autoWidth.defer(1,this)}else{this.autoWidth()}},setIconClass:function(A){if(this.el){this.el.child(this.buttonSelector).replaceClass(this.iconCls,A)}this.iconCls=A},beforeDestroy:function(){if(this.rendered){var A=this.el.child(this.buttonSelector);if(A){A.removeAllListeners()}}if(this.menu){Ext.destroy(this.menu)}},onDestroy:function(){if(this.rendered){Ext.ButtonToggleMgr.unregister(this)}},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var A=this.el.child(this.buttonSelector);if(A&&A.getWidth()>20){A.clip();A.setWidth(Ext.util.TextMetrics.measure(A,this.text).width+A.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(B,A){this.handler=B;this.scope=A},setText:function(A){this.text=A;if(this.el){this.el.child("td.x-btn-center "+this.buttonSelector).update(A)}this.autoWidth()},getText:function(){return this.text},toggle:function(A){A=A===undefined?!this.pressed:A;if(A!=this.pressed){if(A){this.el.addClass("x-btn-pressed");this.pressed=true;this.fireEvent("toggle",this,true)}else{this.el.removeClass("x-btn-pressed");this.pressed=false;this.fireEvent("toggle",this,false)}if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,A)}}},focus:function(){this.el.child(this.buttonSelector).focus()},onDisable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.addClass(this.disabledClass)}this.el.dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.removeClass(this.disabledClass)}this.el.dom.disabled=false}this.disabled=false},showMenu:function(){if(this.menu){this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.menu){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.isVisible()},onClick:function(A){if(A){A.preventDefault()}if(A.button!=0){return }if(!this.disabled){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,A);if(this.handler){this.handler.call(this.scope||this,this,A)}}},isMenuTriggerOver:function(B,A){return this.menu&&!A},isMenuTriggerOut:function(B,A){return this.menu&&!A},onMouseOver:function(B){if(!this.disabled){var A=B.within(this.el,true);if(!A){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){Ext.getDoc().on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,B)}if(this.isMenuTriggerOver(B,A)){this.fireEvent("menutriggerover",this,this.menu,B)}}},monitorMouseOver:function(A){if(A.target!=this.el.dom&&!A.within(this.el)){if(this.monitoringMouseOver){Ext.getDoc().un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(A)}},onMouseOut:function(B){var A=B.within(this.el)&&B.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,B);if(this.isMenuTriggerOut(B,A)){this.fireEvent("menutriggerout",this,this.menu,B)}},onFocus:function(A){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(A){this.el.removeClass("x-btn-focus")},getClickEl:function(B,A){return this.el},onMouseDown:function(A){if(!this.disabled&&A.button==0){this.getClickEl(A).addClass("x-btn-click");Ext.getDoc().on("mouseup",this.onMouseUp,this)}},onMouseUp:function(A){if(A.button==0){this.getClickEl(A,true).removeClass("x-btn-click");Ext.getDoc().un("mouseup",this.onMouseUp,this)}},onMenuShow:function(A){this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)},onMenuHide:function(A){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu)},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var A={};function B(E,G){if(G){var F=A[E.toggleGroup];for(var D=0,C=F.length;D<C;D++){if(F[D]!=E){F[D].toggle(false)}}}}return{register:function(C){if(!C.toggleGroup){return }var D=A[C.toggleGroup];if(!D){D=A[C.toggleGroup]=[]}D.push(C);C.on("toggle",B)},unregister:function(C){if(!C.toggleGroup){return }var D=A[C.toggleGroup];if(D){D.remove(C);C.un("toggle",B)}}}}();
+Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"button:last",initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(D,A){var B=new Ext.Template("<table cellspacing=\"0\" class=\"x-btn-menu-wrap x-btn\"><tr><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-text-wrap\"><tbody>","<tr><td class=\"x-btn-left\"><i>&#160;</i></td><td class=\"x-btn-center\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></td></tr>","</tbody></table></td><td>","<table cellspacing=\"0\" class=\"x-btn-wrap x-btn-menu-arrow-wrap\"><tbody>","<tr><td class=\"x-btn-center\"><button class=\"x-btn-menu-arrow-el\" type=\"button\">&#160;</button></td><td class=\"x-btn-right\"><i>&#160;</i></td></tr>","</tbody></table></td></tr></table>");var C,F=[this.text||"&#160;",this.type];if(A){C=B.insertBefore(A,F,true)}else{C=B.append(D,F,true)}var E=C.child(this.buttonSelector);this.initButtonEl(C,E);this.arrowBtnTable=C.child("table:last");if(this.arrowTooltip){C.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},autoWidth:function(){if(this.el){var C=this.el.child("table:first");var B=this.el.child("table:last");this.el.setWidth("auto");C.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var A=this.el.child(this.buttonSelector);if(A&&A.getWidth()>20){A.clip();A.setWidth(Ext.util.TextMetrics.measure(A,this.text).width+A.getFrameWidth("lr"))}}if(this.minWidth){if((C.getWidth()+B.getWidth())<this.minWidth){C.setWidth(this.minWidth-B.getWidth())}}this.el.setWidth(C.getWidth()+B.getWidth())}},setArrowHandler:function(B,A){this.arrowHandler=B;this.scope=A},onClick:function(A){A.preventDefault();if(!this.disabled){if(A.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,A);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,A)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,A);if(this.handler){this.handler.call(this.scope||this,this,A)}}}},getClickEl:function(B,A){if(!A){return(this.lastClickEl=B.getTarget("table",10,true))}return this.lastClickEl},onDisable:function(){if(this.el){if(!Ext.isIE6){this.el.addClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=true;this.el.child(this.arrowSelector).dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6){this.el.removeClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=false;this.el.child(this.arrowSelector).dom.disabled=false}this.disabled=false},isMenuTriggerOver:function(A){return this.menu&&A.within(this.arrowBtnTable)&&!A.within(this.arrowBtnTable,true)},isMenuTriggerOut:function(B,A){return this.menu&&!B.within(this.arrowBtnTable)},onDestroy:function(){Ext.destroy(this.arrowBtnTable);Ext.SplitButton.superclass.onDestroy.call(this)}});Ext.MenuButton=Ext.SplitButton;Ext.reg("splitbutton",Ext.SplitButton);
+Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(A){if(A&&this.showText===true){var B="";if(this.prependText){B+=this.prependText}B+=A.text;return B}return undefined},setActiveItem:function(C,A){if(typeof C!="object"){C=this.menu.items.get(C)}if(C){if(!this.rendered){this.text=this.getItemText(C);this.iconCls=C.iconCls}else{var B=this.getItemText(C);if(B){this.setText(B)}this.setIconClass(C.iconCls)}this.activeItem=C;if(!C.checked){C.setChecked(true,true)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!A){this.fireEvent("change",this,C)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var D;for(var B=0,A=this.itemCount;B<A;B++){var C=this.items[B];C.group=C.group||this.id;C.itemIndex=B;C.checkHandler=this.checkHandler;C.scope=this;C.checked=C.checked||false;this.menu.items.push(C);if(C.checked){D=C}}this.setActiveItem(D,true);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this)},checkHandler:function(A,B){if(B){this.setActiveItem(A)}},toggleSelected:function(){this.menu.render();var C,A;for(var B=1;B<this.itemCount;B++){C=(this.activeItem.itemIndex+B)%this.itemCount;A=this.menu.items.itemAt(C);if(!A.disabled){A.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);
+Ext.Toolbar=function(A){if(Ext.isArray(A)){A={buttons:A}}Ext.Toolbar.superclass.constructor.call(this,A)};(function(){var A=Ext.Toolbar;Ext.extend(A,Ext.BoxComponent,{trackMenus:true,initComponent:function(){A.superclass.initComponent.call(this);if(this.items){this.buttons=this.items}this.items=new Ext.util.MixedCollection(false,function(B){return B.itemId||B.id||Ext.id()})},autoCreate:{cls:"x-toolbar x-small-editor",html:"<table cellspacing=\"0\"><tr></tr></table>"},onRender:function(C,B){this.el=C.createChild(Ext.apply({id:this.id},this.autoCreate),B);this.tr=this.el.child("tr",true)},afterRender:function(){A.superclass.afterRender.call(this);if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons}},add:function(){var C=arguments,B=C.length;for(var D=0;D<B;D++){var E=C[D];if(E.isFormField){this.addField(E)}else{if(E.render){this.addItem(E)}else{if(typeof E=="string"){if(E=="separator"||E=="-"){this.addSeparator()}else{if(E==" "){this.addSpacer()}else{if(E=="->"){this.addFill()}else{this.addText(E)}}}}else{if(E.tagName){this.addElement(E)}else{if(typeof E=="object"){if(E.xtype){this.addField(Ext.ComponentMgr.create(E,"button"))}else{this.addButton(E)}}}}}}}},addSeparator:function(){return this.addItem(new A.Separator())},addSpacer:function(){return this.addItem(new A.Spacer())},addFill:function(){return this.addItem(new A.Fill())},addElement:function(B){return this.addItem(new A.Item(B))},addItem:function(B){var C=this.nextBlock();this.initMenuTracking(B);B.render(C);this.items.add(B);return B},addButton:function(D){if(Ext.isArray(D)){var F=[];for(var E=0,C=D.length;E<C;E++){F.push(this.addButton(D[E]))}return F}var B=D;if(!(D instanceof A.Button)){B=D.split?new A.SplitButton(D):new A.Button(D)}var G=this.nextBlock();this.initMenuTracking(B);B.render(G);this.items.add(B);return B},initMenuTracking:function(B){if(this.trackMenus&&B.menu){B.on({"menutriggerover":this.onButtonTriggerOver,"menushow":this.onButtonMenuShow,"menuhide":this.onButtonMenuHide,scope:this})}},addText:function(B){return this.addItem(new A.TextItem(B))},insertButton:function(C,F){if(Ext.isArray(F)){var E=[];for(var D=0,B=F.length;D<B;D++){E.push(this.insertButton(C+D,F[D]))}return E}if(!(F instanceof A.Button)){F=new A.Button(F)}var G=document.createElement("td");this.tr.insertBefore(G,this.tr.childNodes[C]);this.initMenuTracking(F);F.render(G);this.items.insert(C,F);return F},addDom:function(C,B){var E=this.nextBlock();Ext.DomHelper.overwrite(E,C);var D=new A.Item(E.firstChild);D.render(E);this.items.add(D);return D},addField:function(C){var D=this.nextBlock();C.render(D);var B=new A.Item(D.firstChild);B.render(D);this.items.add(C);return B},nextBlock:function(){var B=document.createElement("td");this.tr.appendChild(B);return B},onDestroy:function(){Ext.Toolbar.superclass.onDestroy.call(this);if(this.rendered){if(this.items){Ext.destroy.apply(Ext,this.items.items)}Ext.Element.uncache(this.tr)}},onDisable:function(){this.items.each(function(B){if(B.disable){B.disable()}})},onEnable:function(){this.items.each(function(B){if(B.enable){B.enable()}})},onButtonTriggerOver:function(B){if(this.activeMenuBtn&&this.activeMenuBtn!=B){this.activeMenuBtn.hideMenu();B.showMenu();this.activeMenuBtn=B}},onButtonMenuShow:function(B){this.activeMenuBtn=B},onButtonMenuHide:function(B){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);A.Item=function(B){this.el=Ext.getDom(B);this.id=Ext.id(this.el);this.hidden=false};A.Item.prototype={getEl:function(){return this.el},render:function(B){this.td=B;B.appendChild(this.el)},destroy:function(){if(this.td&&this.td.parentNode){this.td.parentNode.removeChild(this.td)}},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"},setVisible:function(B){if(B){this.show()}else{this.hide()}},focus:function(){Ext.fly(this.el).focus()},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false}};Ext.reg("tbitem",A.Item);A.Separator=function(){var B=document.createElement("span");B.className="ytb-sep";A.Separator.superclass.constructor.call(this,B)};Ext.extend(A.Separator,A.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbseparator",A.Separator);A.Spacer=function(){var B=document.createElement("div");B.className="ytb-spacer";A.Spacer.superclass.constructor.call(this,B)};Ext.extend(A.Spacer,A.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbspacer",A.Spacer);A.Fill=Ext.extend(A.Spacer,{render:function(B){B.style.width="100%";A.Fill.superclass.render.call(this,B)}});Ext.reg("tbfill",A.Fill);A.TextItem=function(B){var C=document.createElement("span");C.className="ytb-text";C.innerHTML=B.text?B.text:B;A.TextItem.superclass.constructor.call(this,C)};Ext.extend(A.TextItem,A.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbtext",A.TextItem);A.Button=Ext.extend(Ext.Button,{hideParent:true,onDestroy:function(){A.Button.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbbutton",A.Button);A.SplitButton=Ext.extend(Ext.SplitButton,{hideParent:true,onDestroy:function(){A.SplitButton.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbsplit",A.SplitButton);A.MenuButton=A.SplitButton})();
+Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",paramNames:{start:"start",limit:"limit"},initComponent:function(){this.addEvents("change","beforechange");Ext.PagingToolbar.superclass.initComponent.call(this);this.cursor=0;this.bind(this.store)},onRender:function(B,A){Ext.PagingToolbar.superclass.onRender.call(this,B,A);this.first=this.addButton({tooltip:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-tbar-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select()});this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,iconCls:"x-tbar-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom).createChild({cls:"x-paging-info"})}if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayEl){var A=this.store.getCount();var B=A==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+A,this.store.getTotalCount());this.displayEl.update(B)}},onLoad:function(A,C,F){if(!this.rendered){this.dsLoaded=[A,C,F];return }this.cursor=F.params?F.params[this.paramNames.start]:0;var E=this.getPageData(),B=E.activePage,D=E.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,E.pages);this.field.dom.value=B;this.first.setDisabled(B==1);this.prev.setDisabled(B==1);this.next.setDisabled(B==D);this.last.setDisabled(B==D);this.loading.enable();this.updateInfo();this.fireEvent("change",this,E)},getPageData:function(){var A=this.store.getTotalCount();return{total:A,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:A<this.pageSize?1:Math.ceil(A/this.pageSize)}},onLoadError:function(){if(!this.rendered){return }this.loading.enable()},readPage:function(C){var A=this.field.dom.value,B;if(!A||isNaN(B=parseInt(A,10))){this.field.dom.value=C.activePage;return false}return B},onPagingKeydown:function(D){var B=D.getKey(),E=this.getPageData(),C;if(B==D.RETURN){D.stopEvent();C=this.readPage(E);if(C!==false){C=Math.min(Math.max(1,C),E.pages)-1;this.doLoad(C*this.pageSize)}}else{if(B==D.HOME||B==D.END){D.stopEvent();C=B==D.HOME?1:E.pages;this.field.dom.value=C}else{if(B==D.UP||B==D.PAGEUP||B==D.DOWN||B==D.PAGEDOWN){D.stopEvent();if(C=this.readPage(E)){var A=D.shiftKey?10:1;if(B==D.DOWN||B==D.PAGEDOWN){A*=-1}C+=A;if(C>=1&C<=E.pages){this.field.dom.value=C}}}}}},beforeLoad:function(){if(this.rendered&&this.loading){this.loading.disable()}},doLoad:function(C){var B={},A=this.paramNames;B[A.start]=C;B[A.limit]=this.pageSize;if(this.fireEvent("beforechange",this,B)!==false){this.store.load({params:B})}},changePage:function(A){this.doLoad(((A-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onClick:function(E){var B=this.store;switch(E){case"first":this.doLoad(0);break;case"prev":this.doLoad(Math.max(0,this.cursor-this.pageSize));break;case"next":this.doLoad(this.cursor+this.pageSize);break;case"last":var D=B.getTotalCount();var A=D%this.pageSize;var C=A?(D-A):D-this.pageSize;this.doLoad(C);break;case"refresh":this.doLoad(this.cursor);break}},unbind:function(A){A=Ext.StoreMgr.lookup(A);A.un("beforeload",this.beforeLoad,this);A.un("load",this.onLoad,this);A.un("loadexception",this.onLoadError,this);this.store=undefined},bind:function(A){A=Ext.StoreMgr.lookup(A);A.on("beforeload",this.beforeLoad,this);A.on("load",this.onLoad,this);A.on("loadexception",this.onLoadError,this);this.store=A}});Ext.reg("paging",Ext.PagingToolbar);
+Ext.Resizable=function(D,E){this.el=Ext.get(D);if(E&&E.wrap){E.resizeChild=this.el;this.el=this.el.wrap(typeof E.wrap=="object"?E.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=E.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(E.resizeChild.getPositioning());E.resizeChild.clearPositioning();if(!E.width||!E.height){var F=E.resizeChild.getSize();this.el.setSize(F.width,F.height)}if(E.pinned&&!E.adjustments){E.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,E);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var I=this.el.getStyle("position");if(I!="absolute"&&I!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var M=this.handles.split(/\s*?[,;]\s*?| /);var C=Ext.Resizable.positions;for(var H=0,J=M.length;H<J;H++){if(M[H]&&C[M[H]]){var L=C[M[H]];this[L]=new Ext.Resizable.Handle(this,L,this.disableTrackOver,this.transparent)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var B=this.resizeChild;var K=this.west,G=this.east,A=this.north,M=this.south;if(B&&(K||A)){B.position("relative");B.setLeft(K?K.el.getWidth():0);B.setTop(A?A.el.getHeight():0)}this.adjustments=[(G?-G.el.getWidth():0)+(K?-K.el.getWidth():0),(A?-A.el.getHeight():0)+(M?-M.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id)}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)};Ext.extend(Ext.Resizable,Ext.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:0.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:"easeOutStrong",widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,resizeTo:function(B,A){this.el.setSize(B,A);this.updateChildSize();this.fireEvent("resize",this,B,A,null)},startSizing:function(C,B){this.fireEvent("beforeresize",this,C);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this)}this.overlay.setStyle("cursor",B.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=C.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var A=Ext.get(this.constrainTo);this.resizeRegion=A.getRegion().adjust(A.getFrameWidth("t"),A.getFrameWidth("l"),-A.getFrameWidth("b"),-A.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(A,B){if(this.enabled){B.stopEvent();this.activeHandle=A;this.startSizing(B,A)}},onMouseUp:function(B){var A=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,A.width,A.height,B)},updateChildSize:function(){if(this.resizeChild){var C=this.el;var D=this.resizeChild;var B=this.adjustments;if(C.dom.offsetWidth){var A=C.getSize(true);D.setSize(A.width+B[0],A.height+B[1])}if(Ext.isIE){setTimeout(function(){if(C.dom.offsetWidth){var E=C.getSize(true);D.setSize(E.width+B[0],E.height+B[1])}},10)}}},snap:function(C,E,B){if(!E||!C){return C}var D=C;var A=C%E;if(A>0){if(A>(E/2)){D=C+(E-A)}else{D=C-A}}return Math.max(B,D)},resizeElement:function(){var A=this.proxy.getBox();if(this.updateBox){this.el.setBox(A,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(A.width,A.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}return A},constrain:function(B,C,A,D){if(B-C<A){C=B-A}else{if(B-C>D){C=D-B}}return C},onMouseMove:function(S){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(S.getPoint())){return }var Q=this.curSize||this.startBox;var I=this.startBox.x,H=this.startBox.y;var C=I,B=H;var J=Q.width,R=Q.height;var D=J,L=R;var K=this.minWidth,T=this.minHeight;var P=this.maxWidth,W=this.maxHeight;var F=this.widthIncrement;var A=this.heightIncrement;var U=S.getXY();var O=-(this.startPoint[0]-Math.max(this.minX,U[0]));var M=-(this.startPoint[1]-Math.max(this.minY,U[1]));var G=this.activeHandle.position;switch(G){case"east":J+=O;J=Math.min(Math.max(K,J),P);break;case"south":R+=M;R=Math.min(Math.max(T,R),W);break;case"southeast":J+=O;R+=M;J=Math.min(Math.max(K,J),P);R=Math.min(Math.max(T,R),W);break;case"north":M=this.constrain(R,M,T,W);H+=M;R-=M;break;case"west":O=this.constrain(J,O,K,P);I+=O;J-=O;break;case"northeast":J+=O;J=Math.min(Math.max(K,J),P);M=this.constrain(R,M,T,W);H+=M;R-=M;break;case"northwest":O=this.constrain(J,O,K,P);M=this.constrain(R,M,T,W);H+=M;R-=M;I+=O;J-=O;break;case"southwest":O=this.constrain(J,O,K,P);R+=M;R=Math.min(Math.max(T,R),W);I+=O;J-=O;break}var N=this.snap(J,F,K);var V=this.snap(R,A,T);if(N!=J||V!=R){switch(G){case"northeast":H-=V-R;break;case"north":H-=V-R;break;case"southwest":I-=N-J;break;case"west":I-=N-J;break;case"northwest":I-=N-J;H-=V-R;break}J=N;R=V}if(this.preserveRatio){switch(G){case"southeast":case"east":R=L*(J/D);R=Math.min(Math.max(T,R),W);J=D*(R/L);break;case"south":J=D*(R/L);J=Math.min(Math.max(K,J),P);R=L*(J/D);break;case"northeast":J=D*(R/L);J=Math.min(Math.max(K,J),P);R=L*(J/D);break;case"north":var X=J;J=D*(R/L);J=Math.min(Math.max(K,J),P);R=L*(J/D);I+=(X-J)/2;break;case"southwest":R=L*(J/D);R=Math.min(Math.max(T,R),W);var X=J;J=D*(R/L);I+=X-J;break;case"west":var E=R;R=L*(J/D);R=Math.min(Math.max(T,R),W);H+=(E-R)/2;var X=J;J=D*(R/L);I+=X-J;break;case"northwest":var X=J;var E=R;R=L*(J/D);R=Math.min(Math.max(T,R),W);J=D*(R/L);H+=E-R;I+=X-J;break}}this.proxy.setBounds(I,H,J,R);if(this.dynamic){this.resizeElement()}}catch(S){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(C){this.proxy.remove();if(this.overlay){this.overlay.removeAllListeners();this.overlay.remove()}var D=Ext.Resizable.positions;for(var A in D){if(typeof D[A]!="function"&&this[D[A]]){var B=this[D[A]];B.el.removeAllListeners();B.el.remove()}}if(C){this.el.update("");this.el.remove()}},syncHandleHeight:function(){var A=this.el.getHeight(true);if(this.west){this.west.el.setHeight(A)}if(this.east){this.east.el.setHeight(A)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=function(C,E,B,D){if(!this.tpl){var A=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});A.compile();Ext.Resizable.Handle.prototype.tpl=A}this.position=E;this.rz=C;this.el=this.tpl.append(C.el.dom,[this.position],true);this.el.unselectable();if(D){this.el.setOpacity(0)}this.el.on("mousedown",this.onMouseDown,this);if(!B){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this)}};Ext.Resizable.Handle.prototype={afterResize:function(A){},onMouseDown:function(A){this.rz.onMouseDown(this,A)},onMouseOver:function(A){this.rz.handleOver(this,A)},onMouseOut:function(A){this.rz.handleOut(this,A)}};
+Ext.Editor=function(B,A){this.field=B;Ext.Editor.superclass.constructor.call(this,A)};Ext.extend(Ext.Editor,Ext.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:false,cancelOnEsc:false,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(B,A){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:B,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.field.render(this.el);if(Ext.isGecko){this.field.el.dom.setAttribute("autocomplete","off")}this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(["keydown","keypress"])}this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1})}},onSpecialKey:function(C,B){var A=B.getKey();if(this.completeOnEnter&&A==B.ENTER){B.stopEvent();this.completeEdit()}else{if(this.cancelOnEsc&&A==B.ESC){this.cancelEdit()}else{this.fireEvent("specialkey",C,B)}}if(this.field.triggerBlur&&(A==B.ENTER||A==B.ESC||A==B.TAB)){this.field.triggerBlur()}},startEdit:function(B,C){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(B);var A=C!==undefined?C:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,A)===false){return }this.startValue=A;this.field.setValue(A);this.doAutoSize();this.el.alignTo(this.boundEl,this.alignment);this.editing=true;this.show()},doAutoSize:function(){if(this.autoSize){var A=this.boundEl.getSize();switch(this.autoSize){case"width":this.setSize(A.width,"");break;case"height":this.setSize("",A.height);break;default:this.setSize(A.width,A.height)}}},setSize:function(A,B){delete this.field.lastSize;this.field.setSize(A,B);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(A,B)}this.el.sync()}},realign:function(){this.el.alignTo(this.boundEl,this.alignment)},completeEdit:function(A){if(!this.editing){return }var B=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){B=this.startValue;this.cancelEdit(true)}if(String(B)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return }if(this.fireEvent("beforecomplete",this,B,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(B)}if(A!==true){this.hide()}this.fireEvent("complete",this,B,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show();if(Ext.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this)}else{this.field.focus()}this.fireEvent("startedit",this.boundEl,this.startValue)},deferredFocus:function(){if(this.editing){this.field.focus()}},cancelEdit:function(A){if(this.editing){var B=this.getValue();this.setValue(this.startValue);if(A!==true){this.hide()}this.fireEvent("canceledit",this,B,this.startValue)}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return }this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(A){this.field.setValue(A)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){this.field.destroy();this.field=null}});Ext.reg("editor",Ext.Editor);
+Ext.MessageBox=function(){var R,B,N,Q;var G,J,P,A,K,M,H,F;var O,S,L,C="";var D=function(U){if(R.isVisible()){R.hide();Ext.callback(B.fn,B.scope||window,[U,S.dom.value],1)}};var T=function(){if(B&&B.cls){R.el.removeClass(B.cls)}K.reset()};var E=function(W,U,V){if(B&&B.closable!==false){R.hide()}if(V){V.stopEvent()}};var I=function(U){var W=0;if(!U){O["ok"].hide();O["cancel"].hide();O["yes"].hide();O["no"].hide();return W}R.footer.dom.style.display="";for(var V in O){if(typeof O[V]!="function"){if(U[V]){O[V].show();O[V].setText(typeof U[V]=="string"?U[V]:Ext.MessageBox.buttonText[V]);W+=O[V].el.getWidth()+15}else{O[V].hide()}}}return W};return{getDialog:function(U){if(!R){R=new Ext.Window({autoCreate:true,title:U,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(B&&B.buttons&&B.buttons.no&&!B.buttons.cancel){D("no")}else{D("cancel")}}});O={};var V=this.buttonText;O["ok"]=R.addButton(V["ok"],D.createCallback("ok"));O["yes"]=R.addButton(V["yes"],D.createCallback("yes"));O["no"]=R.addButton(V["no"],D.createCallback("no"));O["cancel"]=R.addButton(V["cancel"],D.createCallback("cancel"));O["ok"].hideMode=O["yes"].hideMode=O["no"].hideMode=O["cancel"].hideMode="offsets";R.render(document.body);R.getEl().addClass("x-window-dlg");N=R.mask;G=R.body.createChild({html:"<div class=\"ext-mb-icon\"></div><div class=\"ext-mb-content\"><span class=\"ext-mb-text\"></span><br /><div class=\"ext-mb-fix-cursor\"><input type=\"text\" class=\"ext-mb-input\" /><textarea class=\"ext-mb-textarea\"></textarea></div></div>"});H=Ext.get(G.dom.firstChild);var W=G.dom.childNodes[1];J=Ext.get(W.firstChild);P=Ext.get(W.childNodes[2].firstChild);P.enableDisplayMode();P.addKeyListener([10,13],function(){if(R.isVisible()&&B&&B.buttons){if(B.buttons.ok){D("ok")}else{if(B.buttons.yes){D("yes")}}}});A=Ext.get(W.childNodes[2].childNodes[1]);A.enableDisplayMode();K=new Ext.ProgressBar({renderTo:G});G.createChild({cls:"x-clear"})}return R},updateText:function(X){if(!R.isVisible()&&!B.width){R.setSize(this.maxWidth,100)}J.update(X||"&#160;");var V=C!=""?(H.getWidth()+H.getMargins("lr")):0;var Z=J.getWidth()+J.getMargins("lr");var W=R.getFrameWidth("lr");var Y=R.body.getFrameWidth("lr");if(Ext.isIE&&V>0){V+=3}var U=Math.max(Math.min(B.width||V+Z+W+Y,this.maxWidth),Math.max(B.minWidth||this.minWidth,L||0));if(B.prompt===true){S.setWidth(U-V-W-Y)}if(B.progress===true||B.wait===true){K.setSize(U-V-W-Y)}R.setSize(U,"auto").center();return this},updateProgress:function(V,U,W){K.updateProgress(V,U);if(W){this.updateText(W)}return this},isVisible:function(){return R&&R.isVisible()},hide:function(){if(this.isVisible()){R.hide();T()}return this},show:function(X){if(this.isVisible()){this.hide()}B=X;var Y=this.getDialog(B.title||"&#160;");Y.setTitle(B.title||"&#160;");var U=(B.closable!==false&&B.progress!==true&&B.wait!==true);Y.tools.close.setDisplayed(U);S=P;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){P.hide();A.show();A.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);S=A}else{P.show();A.hide()}}else{P.hide();A.hide()}S.dom.value=B.value||"";if(B.prompt){Y.focusEl=S}else{var W=B.buttons;var V=null;if(W&&W.ok){V=O["ok"]}else{if(W&&W.yes){V=O["yes"]}}if(V){Y.focusEl=V}}if(B.iconCls){Y.setIconClass(B.iconCls)}this.setIcon(B.icon);L=I(B.buttons);K.setVisible(B.progress===true||B.wait===true);this.updateProgress(0,B.progressText);this.updateText(B.msg);if(B.cls){Y.el.addClass(B.cls)}Y.proxyDrag=B.proxyDrag===true;Y.modal=B.modal!==false;Y.mask=B.modal!==false?N:false;if(!Y.isVisible()){document.body.appendChild(R.el.dom);Y.setAnimateTarget(B.animEl);Y.show(B.animEl)}Y.on("show",function(){if(U===true){Y.keyMap.enable()}else{Y.keyMap.disable()}},this,{single:true});if(B.wait===true){K.wait(B.waitConfig)}return this},setIcon:function(U){if(U&&U!=""){H.removeClass("x-hidden");H.replaceClass(C,U);C=U}else{H.replaceClass(C,"x-hidden");C=""}return this},progress:function(W,V,U){this.show({title:W,msg:V,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:U});return this},wait:function(W,V,U){this.show({title:V,msg:W,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:U});return this},alert:function(X,W,V,U){this.show({title:X,msg:W,buttons:this.OK,fn:V,scope:U});return this},confirm:function(X,W,V,U){this.show({title:X,msg:W,buttons:this.YESNO,fn:V,scope:U,icon:this.QUESTION});return this},prompt:function(Z,Y,W,V,U,X){this.show({title:Z,msg:Y,buttons:this.OKCANCEL,fn:W,minWidth:250,scope:V,prompt:true,multiline:U,value:X});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;
+Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this.hide,scope:this})}},showAt:function(A){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){A=this.el.adjustForConstraints(A)}this.setPagePosition(A[0],A[1])},doAutoWidth:function(){var A=this.body.getTextWidth();if(this.title){A=Math.max(A,this.header.child("span").getTextWidth(this.title))}A+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr");this.setWidth(A.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(A,B){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(A,B||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.Tip.DD=function(B,A){Ext.apply(this,A);this.tip=B;Ext.Tip.DD.superclass.constructor.call(this,B.el.id,"WindowDD-"+B.id);this.setHandleElId(B.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(A){this.tip.el.enableShadow(true)}});
+Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,mouseOffset:[15,18],trackMouse:false,constrainPosition:true,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget()},initTarget:function(){if(this.target){this.target=Ext.get(this.target);this.target.on("mouseover",this.onTargetOver,this);this.target.on("mouseout",this.onTargetOut,this);this.target.on("mousemove",this.onMouseMove,this)}},onMouseMove:function(A){this.targetXY=A.getXY();if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}},getTargetXY:function(){return[this.targetXY[0]+this.mouseOffset[0],this.targetXY[1]+this.mouseOffset[1]]},onTargetOver:function(A){if(this.disabled||A.within(this.target.dom,true)){return }this.clearTimer("hide");this.targetXY=A.getXY();this.delayShow()},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(A){if(this.disabled||A.within(this.target.dom,true)){return }this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();Ext.ToolTip.superclass.hide.call(this)},show:function(){this.showAt(this.getTargetXY())},showAt:function(A){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,A);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}},clearTimer:function(A){A=A+"Timer";clearTimeout(this[A]);delete this[A]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(A){if(this.autoHide!==false&&!A.within(this.el.dom)){this.disable();this.enable.defer(100,this)}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(A,D){var C=this.targetXY[1],B=this.getSize().height;if(this.constrainPosition&&D<=C&&(D+B)>=C){D=C-B-5}return{x:A,y:D}},onDestroy:function(){Ext.ToolTip.superclass.onDestroy.call(this);if(this.target){this.target.un("mouseover",this.onTargetOver,this);this.target.un("mouseout",this.onTargetOut,this);this.target.un("mousemove",this.onMouseMove,this)}}});
+Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(D){var F=Ext.isArray(D)?D:arguments;for(var E=0,A=F.length;E<A;E++){var H=F[E];var G=H.target;if(G){if(Ext.isArray(G)){for(var C=0,B=G.length;C<B;C++){this.targets[Ext.id(G[C])]=H}}else{this.targets[Ext.id(G)]=H}}}},unregister:function(A){delete this.targets[Ext.id(A)]},onTargetOver:function(G){if(this.disabled){return }this.targetXY=G.getXY();var C=G.getTarget();if(!C||C.nodeType!==1||C==document||C==document.body){return }if(this.activeTarget&&C==this.activeTarget.el){this.clearTimer("hide");this.show();return }if(C&&this.targets[C.id]){this.activeTarget=this.targets[C.id];this.activeTarget.el=C;this.delayShow();return }var E,F=Ext.fly(C),B=this.tagConfig;var D=B.namespace;if(this.interceptTitles&&C.title){E=C.title;C.qtip=E;C.removeAttribute("title");G.preventDefault()}else{E=C.qtip||F.getAttributeNS(D,B.attribute)}if(E){var A=F.getAttributeNS(D,B.hide);this.activeTarget={el:C,text:E,width:F.getAttributeNS(D,B.width),autoHide:A!="user"&&A!=="false",title:F.getAttributeNS(D,B.title),cls:F.getAttributeNS(D,B.cls),align:F.getAttributeNS(D,B.align)};this.delayShow()}},onTargetOut:function(A){this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(B){var A=this.activeTarget;if(A){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=A}if(A.width){this.setWidth(A.width);this.body.setWidth(this.adjustBodyWidth(A.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(A.title||"");this.body.update(A.text);this.autoHide=A.autoHide;this.dismissDelay=A.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(A.cls){this.el.addClass(A.cls);this.lastCls=A.cls}if(A.align){B=this.el.getAlignToXY(A.el,A.align);this.constrainPosition=false}else{this.constrainPosition=true}}Ext.QuickTip.superclass.showAt.call(this,B)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});
+Ext.QuickTips=function(){var B,A=[];return{init:function(C){if(!B){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(C)});return }B=new Ext.QuickTip({elements:"header,body"});if(C!==false){B.render(Ext.getBody())}}},enable:function(){if(B){A.pop();if(A.length<1){B.enable()}}},disable:function(){if(B){B.disable()}A.push(1)},isEnabled:function(){return B!==undefined&&!B.disabled},getQuickTip:function(){return B},register:function(){B.register.apply(B,arguments)},unregister:function(){B.unregister.apply(B,arguments)},tips:function(){B.register.apply(B,arguments)}}}();
+Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var A=this.loader;if(!A){A=new Ext.tree.TreeLoader({dataUrl:this.dataUrl})}else{if(typeof A=="object"&&!A.load){A=new Ext.tree.TreeLoader(A)}}this.loader=A;this.nodeHash={};if(this.root){this.setRootNode(this.root)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(C,B,A,G,F,E,D){if(C=="collapse"||C=="expand"||C=="beforecollapse"||C=="beforeexpand"||C=="move"||C=="beforemove"){C=C+"node"}return this.fireEvent(C,B,A,G,F,E,D)},getRootNode:function(){return this.root},setRootNode:function(B){if(!B.render){B=this.loader.createNode(B)}this.root=B;B.ownerTree=this;B.isRoot=true;this.registerNode(B);if(!this.rootVisible){var A=B.attributes.uiProvider;B.ui=A?new A(B):new Ext.tree.RootTreeNodeUI(B)}return B},getNodeById:function(A){return this.nodeHash[A]},registerNode:function(A){this.nodeHash[A.id]=A},unregisterNode:function(A){delete this.nodeHash[A.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(A){var B=A.parentNode;if(B){if(B.expandedChild&&B.expandedChild.parentNode==B){B.expandedChild.collapse()}B.expandedChild=A}},getChecked:function(A,B){B=B||this.root;var C=[];var D=function(){if(this.attributes.checked){C.push(!A?this:(A=="id"?this.id:this.attributes[A]))}};B.cascade(D);return C},getEl:function(){return this.el},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(F,A,G){A=A||"id";var D=F.split(this.pathSeparator);var C=this.root;if(C.attributes[A]!=D[1]){if(G){G(false,null)}return }var B=1;var E=function(){if(++B==D.length){if(G){G(true,C)}return }var H=C.findChild(A,D[B]);if(!H){if(G){G(false,C)}return }C=H;H.expand(false,false,E)};C.expand(false,false,E)},selectPath:function(E,A,F){A=A||"id";var C=E.split(this.pathSeparator);var B=C.pop();if(C.length>0){var D=function(H,G){if(H&&G){var I=G.findChild(A,B);if(I){I.select();if(F){F(true,I)}}else{if(F){F(false,I)}}}else{if(F){F(false,I)}}};this.expandPath(C.join(this.pathSeparator),A,D)}else{this.root.select();if(F){F(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(B,A){Ext.tree.TreePanel.superclass.onRender.call(this,B,A);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.root.render();if(!this.rootVisible){this.root.renderChildren()}},onDestroy:function(){if(this.rendered){this.body.removeAllListeners();Ext.dd.ScrollManager.unregister(this.body);if(this.dropZone){this.dropZone.unreg()}if(this.dragZone){this.dragZone.unreg()}}this.root.destroy();this.nodeHash=null;Ext.tree.TreePanel.superclass.onDestroy.call(this)}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);
+Ext.tree.TreeEventModel=function(A){this.tree=A;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var A=this.tree.getTreeEl();A.on("click",this.delegateClick,this);if(this.tree.trackMouseOver!==false){A.on("mouseover",this.delegateOver,this);A.on("mouseout",this.delegateOut,this)}A.on("dblclick",this.delegateDblClick,this);A.on("contextmenu",this.delegateContextMenu,this)},getNode:function(B){var A;if(A=B.getTarget(".x-tree-node-el",10)){var C=Ext.fly(A,"_treeEvents").getAttributeNS("ext","tree-node-id");if(C){return this.tree.getNodeById(C)}}return null},getNodeTarget:function(B){var A=B.getTarget(".x-tree-node-icon",1);if(!A){A=B.getTarget(".x-tree-node-el",6)}return A},delegateOut:function(B,A){if(!this.beforeEvent(B)){return }if(B.getTarget(".x-tree-ec-icon",1)){var C=this.getNode(B);this.onIconOut(B,C);if(C==this.lastEcOver){delete this.lastEcOver}}if((A=this.getNodeTarget(B))&&!B.within(A,true)){this.onNodeOut(B,this.getNode(B))}},delegateOver:function(B,A){if(!this.beforeEvent(B)){return }if(this.lastEcOver){this.onIconOut(B,this.lastEcOver);delete this.lastEcOver}if(B.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(B);this.onIconOver(B,this.lastEcOver)}if(A=this.getNodeTarget(B)){this.onNodeOver(B,this.getNode(B))}},delegateClick:function(B,A){if(!this.beforeEvent(B)){return }if(B.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(B,this.getNode(B))}else{if(B.getTarget(".x-tree-ec-icon",1)){this.onIconClick(B,this.getNode(B))}else{if(this.getNodeTarget(B)){this.onNodeClick(B,this.getNode(B))}}}},delegateDblClick:function(B,A){if(this.beforeEvent(B)&&this.getNodeTarget(B)){this.onNodeDblClick(B,this.getNode(B))}},delegateContextMenu:function(B,A){if(this.beforeEvent(B)&&this.getNodeTarget(B)){this.onNodeContextMenu(B,this.getNode(B))}},onNodeClick:function(B,A){A.ui.onClick(B)},onNodeOver:function(B,A){A.ui.onOver(B)},onNodeOut:function(B,A){A.ui.onOut(B)},onIconOver:function(B,A){A.ui.addClass("x-tree-ec-over")},onIconOut:function(B,A){A.ui.removeClass("x-tree-ec-over")},onIconClick:function(B,A){A.ui.ecClick(B)},onCheckboxClick:function(B,A){A.ui.onCheckChange(B)},onNodeDblClick:function(B,A){A.ui.onDblClick(B)},onNodeContextMenu:function(B,A){A.ui.onContextMenu(B)},beforeEvent:function(A){if(this.disabled){A.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};
+Ext.tree.DefaultSelectionModel=function(A){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,A);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this)},onNodeClick:function(A,B){this.select(A)},select:function(B){var A=this.selNode;if(A!=B&&this.fireEvent("beforeselect",this,B,A)!==false){if(A){A.ui.onSelectedChange(false)}this.selNode=B;B.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,B,A)}return B},unselect:function(A){if(this.selNode==A){this.clearSelections()}},clearSelections:function(){var A=this.selNode;if(A){A.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null)}return A},getSelectedNode:function(){return this.selNode},isSelected:function(A){return this.selNode==A},selectPrevious:function(){var A=this.selNode||this.lastSelNode;if(!A){return null}var C=A.previousSibling;if(C){if(!C.isExpanded()||C.childNodes.length<1){return this.select(C)}else{var B=C.lastChild;while(B&&B.isExpanded()&&B.childNodes.length>0){B=B.lastChild}return this.select(B)}}else{if(A.parentNode&&(this.tree.rootVisible||!A.parentNode.isRoot)){return this.select(A.parentNode)}}return null},selectNext:function(){var B=this.selNode||this.lastSelNode;if(!B){return null}if(B.firstChild&&B.isExpanded()){return this.select(B.firstChild)}else{if(B.nextSibling){return this.select(B.nextSibling)}else{if(B.parentNode){var A=null;B.parentNode.bubble(function(){if(this.nextSibling){A=this.getOwnerTree().selModel.select(this.nextSibling);return false}});return A}}}return null},onKeyDown:function(C){var B=this.selNode||this.lastSelNode;var D=this;if(!B){return }var A=C.getKey();switch(A){case C.DOWN:C.stopEvent();this.selectNext();break;case C.UP:C.stopEvent();this.selectPrevious();break;case C.RIGHT:C.preventDefault();if(B.hasChildNodes()){if(!B.isExpanded()){B.expand()}else{if(B.firstChild){this.select(B.firstChild,C)}}}break;case C.LEFT:C.preventDefault();if(B.hasChildNodes()&&B.isExpanded()){B.collapse()}else{if(B.parentNode&&(this.tree.rootVisible||B.parentNode!=this.tree.getRootNode())){this.select(B.parentNode,C)}}break}}});Ext.tree.MultiSelectionModel=function(A){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,A);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(A){this.tree=A;A.getTreeEl().on("keydown",this.onKeyDown,this);A.on("click",this.onNodeClick,this)},onNodeClick:function(A,B){this.select(A,B,B.ctrlKey)},select:function(A,C,B){if(B!==true){this.clearSelections(true)}if(this.isSelected(A)){this.lastSelNode=A;return A}this.selNodes.push(A);this.selMap[A.id]=A;this.lastSelNode=A;A.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return A},unselect:function(B){if(this.selMap[B.id]){B.ui.onSelectedChange(false);var C=this.selNodes;var A=C.indexOf(B);if(A!=-1){this.selNodes.splice(A,1)}delete this.selMap[B.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(B){var D=this.selNodes;if(D.length>0){for(var C=0,A=D.length;C<A;C++){D[C].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(B!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(A){return this.selMap[A.id]?true:false},getSelectedNodes:function(){return this.selNodes},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});
+Ext.tree.TreeNode=function(A){A=A||{};if(typeof A=="string"){A={text:A}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,A);this.expanded=A.expanded===true;this.isTarget=A.isTarget!==false;this.draggable=A.draggable!==false&&A.allowDrag!==false;this.allowChildren=A.allowChildren!==false&&A.allowDrop!==false;this.text=A.text;this.disabled=A.disabled===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered");var B=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new B(this)};Ext.extend(Ext.tree.TreeNode,Ext.data.Node,{preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var A;return this.loader||((A=this.getOwnerTree())&&A.loader?A.loader:new Ext.tree.TreeLoader())},setFirstChild:function(A){var B=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,A);if(this.childrenRendered&&B&&A!=B){B.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(B){var A=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,B);if(this.childrenRendered&&A&&B!=A){A.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(B){if(!B.render&&!Ext.isArray(B)){B=this.getLoader().createNode(B)}var A=Ext.tree.TreeNode.superclass.appendChild.call(this,B);if(A&&this.childrenRendered){A.render()}this.ui.updateExpandIcon();return A},removeChild:function(A){this.ownerTree.getSelectionModel().unselect(A);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(this.childrenRendered){A.ui.remove()}if(this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}return A},insertBefore:function(C,A){if(!C.render){C=this.getLoader().createNode(C)}var B=Ext.tree.TreeNode.superclass.insertBefore.apply(this,arguments);if(B&&A&&this.childrenRendered){C.render()}this.ui.updateExpandIcon();return B},setText:function(B){var A=this.text;this.text=B;this.attributes.text=B;if(this.rendered){this.ui.onTextChange(this,B,A)}this.fireEvent("textchange",this,B,A)},select:function(){this.getOwnerTree().getSelectionModel().select(this)},unselect:function(){this.getOwnerTree().getSelectionModel().unselect(this)},isSelected:function(){return this.getOwnerTree().getSelectionModel().isSelected(this)},expand:function(A,B,C){if(!this.expanded){if(this.fireEvent("beforeexpand",this,A,B)===false){return }if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&B!==false)||B){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof C=="function"){C(this)}if(A===true){this.expandChildNodes(true)}}.createDelegate(this));return }else{this.ui.expand();this.fireEvent("expand",this);if(typeof C=="function"){C(this)}}}else{if(typeof C=="function"){C(this)}}if(A===true){this.expandChildNodes(true)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(B,E){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,B,E)===false){return }this.expanded=false;if((this.getOwnerTree().animate&&E!==false)||E){this.ui.animCollapse(function(){this.fireEvent("collapse",this);if(B===true){this.collapseChildNodes(true)}}.createDelegate(this));return }else{this.ui.collapse();this.fireEvent("collapse",this)}}if(B===true){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].collapse(true,false)}}},delayedExpand:function(A){if(!this.expandProcId){this.expandProcId=this.expand.defer(A,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(B){var A=this.getOwnerTree();A.expandPath(this.parentNode.getPath(),false,function(){var C=A.getNodeById(this.id);A.getTreeEl().scrollChildIntoView(C.ui.anchor);Ext.callback(B)}.createDelegate(this))},expandChildNodes:function(B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].expand(B)}},collapseChildNodes:function(B){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].collapse(B)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(B){if(B!==false){this.fireEvent("beforechildrenrendered",this)}var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].render(true)}this.childrenRendered=true},sort:function(E,D){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var C=this.childNodes;for(var B=0,A=C.length;B<A;B++){C[B].render(true)}}},render:function(A){this.ui.render(A);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(B,E){if(E){this.ui.childIndent=null}this.ui.renderIndent();if(B===true&&this.childrenRendered){var D=this.childNodes;for(var C=0,A=D.length;C<A;C++){D[C].renderIndent(true,E)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(){if(this.childNodes){for(var B=0,A=this.childNodes.length;B<A;B++){this.childNodes[B].destroy()}this.childNodes=null}if(this.ui.destroy){this.ui.destroy()}}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;
+Ext.tree.AsyncTreeNode=function(A){this.loaded=A&&A.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(B,D,F){if(this.loading){var E;var C=function(){if(!this.loading){clearInterval(E);this.expand(B,D,F)}}.createDelegate(this);E=setInterval(C,200);return }if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return }this.loading=true;this.ui.beforeLoad(this);var A=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(A){A.load(this,this.loadComplete.createDelegate(this,[B,D,F]));return }}Ext.tree.AsyncTreeNode.superclass.expand.call(this,B,D,F)},isLoading:function(){return this.loading},loadComplete:function(A,B,C){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(A,B,C)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(A){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild)}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,A)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;
+Ext.tree.TreeNodeUI=function(A){this.node=A;this.rendered=false;this.animating=false;this.wasLeaf=true;this.ecc="x-tree-ec-icon x-tree-elbow";this.emptyIcon=Ext.BLANK_IMAGE_URL};Ext.tree.TreeNodeUI.prototype={removeChild:function(A){if(this.rendered){this.ctNode.removeChild(A.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(B,C,A){if(this.rendered){this.textNode.innerHTML=C}},onDisableChange:function(A,B){this.disabled=B;if(this.checkbox){this.checkbox.disabled=B}if(B){this.addClass("x-tree-node-disabled")}else{this.removeClass("x-tree-node-disabled")}},onSelectedChange:function(A){if(A){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(A,G,E,F,D,B){this.childIndent=null;if(this.rendered){var H=F.ui.getContainer();if(!H){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return }var C=B?B.ui.getEl():null;if(C){H.insertBefore(this.wrap,C)}else{H.appendChild(this.wrap)}this.node.renderIndent(true)}},addClass:function(A){if(this.elNode){Ext.fly(this.elNode).addClass(A)}},removeClass:function(A){if(this.elNode){Ext.fly(this.elNode).removeClass(A)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.addClass("x-tree-node-disabled");if(this.checkbox){this.checkbox.disabled=true}}if(this.node.hidden){this.hide()}var B=this.node.getOwnerTree();var A=B.enableDD||B.enableDrag||B.enableDrop;if(A&&(!this.node.isRoot||B.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(A){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){A.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,A)}},onClick:function(B){if(this.dropping){B.stopEvent();return }if(this.fireEvent("beforeclick",this.node,B)!==false){var A=B.getTarget("a");if(!this.disabled&&this.node.attributes.href&&A){this.fireEvent("click",this.node,B);return }else{if(A&&B.ctrlKey){B.stopEvent()}}B.preventDefault();if(this.disabled){return }if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,B)}else{B.stopEvent()}},onDblClick:function(A){A.preventDefault();if(this.disabled){return }if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,A)},onOver:function(A){this.addClass("x-tree-node-over")},onOut:function(A){this.removeClass("x-tree-node-over")},onCheckChange:function(){var A=this.checkbox.checked;this.checkbox.defaultChecked=A;this.node.attributes.checked=A;this.fireEvent("checkchange",this.node,A)},ecClick:function(A){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(C){}}else{if(!Ext.isIE){try{var B=this.node.getOwnerTree().getTreeEl().dom;var A=B.scrollLeft;this.anchor.focus();B.scrollLeft=A}catch(C){}}}},toggleCheck:function(B){var A=this.checkbox;if(A){A.checked=(B===undefined?!A.checked:B);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(A){}},animExpand:function(B){var A=Ext.get(this.ctNode);A.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(B);return }this.animating=true;this.updateExpandIcon();A.slideIn("t",{callback:function(){this.animating=false;Ext.callback(B)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var A=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(A.hlColor||"C3DAF9",{endColor:A.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(B){var A=Ext.get(this.ctNode);A.enableDisplayMode("block");A.stopFx();this.animating=true;this.updateExpandIcon();A.slideOut("t",{callback:function(){this.animating=false;Ext.callback(B)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(A){A.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(B){var D=this.node,A=D.attributes;var C=D.parentNode?D.parentNode.ui.getContainer():D.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(D,A,C,B);if(A.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",A.qtip);if(A.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",A.qtipTitle)}}else{this.textNode.setAttribute("ext:qtip",A.qtip);if(A.qtipTitle){this.textNode.setAttribute("ext:qtitle",A.qtipTitle)}}}else{if(A.qtipCfg){A.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(A.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(B===true){C.appendChild(this.wrap)}}},renderElements:function(D,I,H,J){this.indentMarkup=D.parentNode?D.parentNode.ui.getChildIndent():"";var E=typeof I.checked=="boolean";var B=I.href?I.href:Ext.isGecko?"":"#";var C=["<li class=\"x-tree-node\"><div ext:tree-node-id=\"",D.id,"\" class=\"x-tree-node-el x-tree-node-leaf x-unselectable ",I.cls,"\" unselectable=\"on\">","<span class=\"x-tree-node-indent\">",this.indentMarkup,"</span>","<img src=\"",this.emptyIcon,"\" class=\"x-tree-ec-icon x-tree-elbow\" />","<img src=\"",I.icon||this.emptyIcon,"\" class=\"x-tree-node-icon",(I.icon?" x-tree-node-inline-icon":""),(I.iconCls?" "+I.iconCls:""),"\" unselectable=\"on\" />",E?("<input class=\"x-tree-node-cb\" type=\"checkbox\" "+(I.checked?"checked=\"checked\" />":"/>")):"","<a hidefocus=\"on\" class=\"x-tree-node-anchor\" href=\"",B,"\" tabIndex=\"1\" ",I.hrefTarget?" target=\""+I.hrefTarget+"\"":"","><span unselectable=\"on\">",D.text,"</span></a></div>","<ul class=\"x-tree-node-ct\" style=\"display:none;\"></ul>","</li>"].join("");var A;if(J!==true&&D.nextSibling&&(A=D.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",A,C)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",H,C)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var G=this.elNode.childNodes;this.indentNode=G[0];this.ecNode=G[1];this.iconNode=G[2];var F=3;if(E){this.checkbox=G[3];this.checkbox.defaultChecked=this.checkbox.checked;F++}this.anchor=G[F];this.textNode=G[F].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var E=this.node,D,C;var A=E.isLast()?"x-tree-elbow-end":"x-tree-elbow";if(E.isExpandable()){if(E.expanded){A+="-minus";D="x-tree-node-collapsed";C="x-tree-node-expanded"}else{A+="-plus";D="x-tree-node-expanded";C="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=D||this.c2!=C){Ext.fly(this.elNode).replaceClass(D,C);this.c1=D;this.c2=C}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true}}var B="x-tree-ec-icon "+A;if(this.ecc!=B){this.ecNode.className=B;this.ecc=B}}},getChildIndent:function(){if(!this.childIndent){var A=[];var B=this.node;while(B){if(!B.isRoot||(B.isRoot&&B.ownerTree.rootVisible)){if(!B.isLast()){A.unshift("<img src=\""+this.emptyIcon+"\" class=\"x-tree-elbow-line\" />")}else{A.unshift("<img src=\""+this.emptyIcon+"\" class=\"x-tree-icon\" />")}}B=B.parentNode}this.childIndent=A.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var A="";var B=this.node.parentNode;if(B){A=B.ui.getChildIndent()}if(this.indentMarkup!=A){this.indentNode.innerHTML=A;this.indentMarkup=A}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}delete this.elNode;delete this.ctNode;delete this.indentNode;delete this.ecNode;delete this.iconNode;delete this.checkbox;delete this.anchor;delete this.textNode;Ext.removeNode(this.ctNode)}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var A=this.node.ownerTree.innerCt.dom;this.node.expanded=true;A.innerHTML="<div class=\"x-tree-root-node\"></div>";this.wrap=this.ctNode=A.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});
+Ext.tree.TreeLoader=function(A){this.baseParams={};Ext.apply(this,A);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this)};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,load:function(A,B){if(this.clearOnLoad){while(A.firstChild){A.removeChild(A.firstChild)}}if(this.doPreload(A)){if(typeof B=="function"){B()}}else{if(this.dataUrl||this.url){this.requestData(A,B)}}},doPreload:function(D){if(D.attributes.children){if(D.childNodes.length<1){var C=D.attributes.children;D.beginUpdate();for(var B=0,A=C.length;B<A;B++){var E=D.appendChild(this.createNode(C[B]));if(this.preloadChildren){this.doPreload(E)}}D.endUpdate()}return true}else{return false}},getParams:function(D){var A=[],C=this.baseParams;for(var B in C){if(typeof C[B]!="function"){A.push(encodeURIComponent(B),"=",encodeURIComponent(C[B]),"&")}}A.push("node=",encodeURIComponent(D.id));return A.join("")},requestData:function(A,B){if(this.fireEvent("beforeload",this,A,B)!==false){this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:B,node:A},params:this.getParams(A)})}else{if(typeof B=="function"){B()}}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false){attr.loader=this}if(typeof attr.uiProvider=="string"){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(response,node,callback){var json=response.responseText;try{var o=eval("("+json+")");node.beginUpdate();for(var i=0,len=o.length;i<len;i++){var n=this.createNode(o[i]);if(n){node.appendChild(n)}}node.endUpdate();if(typeof callback=="function"){callback(this,node)}}catch(e){this.handleFailure(response)}},handleResponse:function(B){this.transId=false;var A=B.argument;this.processResponse(B,A.node,A.callback);this.fireEvent("load",this,A.node,B)},handleFailure:function(B){this.transId=false;var A=B.argument;this.fireEvent("loadexception",this,A.node,B);if(typeof A.callback=="function"){A.callback(this,A.node)}}});
+Ext.tree.TreeFilter=function(A,B){this.tree=A;this.filtered={};Ext.apply(this,B)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(D,A,B){A=A||"text";var C;if(typeof D=="string"){var E=D.length;if(E==0&&this.clearBlank){this.clear();return }D=D.toLowerCase();C=function(F){return F.attributes[A].substr(0,E).toLowerCase()==D}}else{if(D.exec){C=function(F){return D.test(F.attributes[A])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(C,null,B)},filterBy:function(D,C,B){B=B||this.tree.root;if(this.autoClear){this.clear()}var A=this.filtered,H=this.reverse;var E=function(J){if(J==B){return true}if(A[J.id]){return false}var I=D.call(C||J,J);if(!I||H){A[J.id]=J;J.ui.hide();return false}return true};B.cascade(E);if(this.remove){for(var G in A){if(typeof G!="function"){var F=A[G];if(F&&F.parentNode){F.parentNode.removeChild(F)}}}}},clear:function(){var B=this.tree;var A=this.filtered;for(var D in A){if(typeof D!="function"){var C=A[D];if(C){C.ui.show()}}}this.filtered={}}};
+Ext.tree.TreeSorter=function(B,C){Ext.apply(this,C);B.on("beforechildrenrendered",this.doSort,this);B.on("append",this.updateSort,this);B.on("insert",this.updateSort,this);B.on("textchange",this.updateSortParent,this);var E=this.dir&&this.dir.toLowerCase()=="desc";var F=this.property||"text";var G=this.sortType;var A=this.folderSort;var D=this.caseSensitive===true;var H=this.leafAttr||"leaf";this.sortFn=function(J,I){if(A){if(J.attributes[H]&&!I.attributes[H]){return 1}if(!J.attributes[H]&&I.attributes[H]){return -1}}var L=G?G(J):(D?J.attributes[F]:J.attributes[F].toUpperCase());var K=G?G(I):(D?I.attributes[F]:I.attributes[F].toUpperCase());if(L<K){return E?+1:-1}else{if(L>K){return E?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(A){A.sort(this.sortFn)},compareNodes:function(B,A){return(B.text.toUpperCase()>A.text.toUpperCase()?1:-1)},updateSort:function(A,B){if(B.childrenRendered){this.doSort.defer(1,this,[B])}},updateSortParent:function(A){var B=A.parentNode;if(B&&B.childrenRendered){this.doSort.defer(1,this,[B])}}};
+if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(A,B){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Ext.tree.TreeDropZone.superclass.constructor.call(this,A.innerCt,B);this.tree=A;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(A){if(A.hasChildNodes()&&!A.isExpanded()){A.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(A){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[A])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(A,I,G,D,C){if(!A||!C){return false}var E=A.node;var F=C.node;if(!(E&&E.isTarget&&I)){return false}if(I=="append"&&E.allowChildren===false){return false}if((I=="above"||I=="below")&&(E.parentNode&&E.parentNode.allowChildren===false)){return false}if(F&&(E==F||F.contains(E))){return false}var B=this.dragOverData;B.tree=this.tree;B.target=E;B.data=C;B.point=I;B.source=G;B.rawEvent=D;B.dropNode=F;B.cancel=false;var H=this.tree.fireEvent("nodedragover",B);return B.cancel===false&&H!==false},getDropPoint:function(E,D,I){var J=D.node;if(J.isRoot){return J.allowChildren!==false?"append":false}var B=D.ddel;var K=Ext.lib.Dom.getY(B),G=K+B.offsetHeight;var F=Ext.lib.Event.getPageY(E);var H=J.allowChildren===false||J.isLeaf();if(this.appendOnly||J.parentNode.allowChildren===false){return H?false:"append"}var C=false;if(!this.allowParentInsert){C=J.hasChildNodes()&&J.isExpanded()}var A=(G-K)/(H?2:3);if(F>=K&&F<(K+A)){return"above"}else{if(!C&&(H||F>=G-A&&F<=G)){return"below"}else{return"append"}}},onNodeEnter:function(D,A,C,B){this.cancelExpand()},onNodeOver:function(B,G,F,E){var I=this.getDropPoint(F,B,G);var C=B.node;if(!this.expandProcId&&I=="append"&&C.hasChildNodes()&&!B.node.isExpanded()){this.queueExpand(C)}else{if(I!="append"){this.cancelExpand()}}var D=this.dropNotAllowed;if(this.isValidDropPoint(B,I,G,F,E)){if(I){var A=B.ddel;var H;if(I=="above"){D=B.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";H="x-tree-drag-insert-above"}else{if(I=="below"){D=B.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";H="x-tree-drag-insert-below"}else{D="x-tree-drop-ok-append";H="x-tree-drag-append"}}if(this.lastInsertClass!=H){Ext.fly(A).replaceClass(this.lastInsertClass,H);this.lastInsertClass=H}}}return D},onNodeOut:function(D,A,C,B){this.cancelExpand();this.removeDropIndicators(D)},onNodeDrop:function(C,I,E,D){var H=this.getDropPoint(E,C,I);var F=C.node;F.ui.startDrop();if(!this.isValidDropPoint(C,H,I,E,D)){F.ui.endDrop();return false}var G=D.node||(I.getTreeNode?I.getTreeNode(D,F,H,E):null);var B={tree:this.tree,target:F,data:D,point:H,source:I,rawEvent:E,dropNode:G,cancel:!G,dropStatus:false};var A=this.tree.fireEvent("beforenodedrop",B);if(A===false||B.cancel===true||!B.dropNode){F.ui.endDrop();return B.dropStatus}F=B.target;if(H=="append"&&!F.isExpanded()){F.expand(false,null,function(){this.completeDrop(B)}.createDelegate(this))}else{this.completeDrop(B)}return true},completeDrop:function(G){var D=G.dropNode,E=G.point,C=G.target;if(!Ext.isArray(D)){D=[D]}var F;for(var B=0,A=D.length;B<A;B++){F=D[B];if(E=="above"){C.parentNode.insertBefore(F,C)}else{if(E=="below"){C.parentNode.insertBefore(F,C.nextSibling)}else{C.appendChild(F)}}}F.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){F.ui.highlight()}C.ui.endDrop();this.tree.fireEvent("nodedrop",G)},afterNodeMoved:function(A,C,E,D,B){if(Ext.enableFx&&this.tree.hlDrop){B.ui.focus();B.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,D,C,A,E)},getTree:function(){return this.tree},removeDropIndicators:function(B){if(B&&B.ddel){var A=B.ddel;Ext.fly(A).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(B,A,C){this.cancelExpand();return true},afterRepair:function(A){if(A&&Ext.enableFx){A.node.ui.highlight()}this.hideProxy()}})};
+if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(A,B){Ext.tree.TreeDragZone.superclass.constructor.call(this,A.getTreeEl(),B);this.tree=A};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(A,B){var C=A.node;return C&&C.draggable&&!C.disabled},onInitDrag:function(B){var A=this.dragData;this.tree.getSelectionModel().select(A.node);this.tree.eventModel.disable();this.proxy.update("");A.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,A.node,B)},getRepairXY:function(B,A){return A.node.ui.getDDRepairXY()},onEndDrag:function(A,B){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,A.node,B)},onValidDrop:function(A,B,C){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,A,B);this.hideProxy()},beforeInvalidDrop:function(A,C){var B=this.tree.getSelectionModel();B.clearSelections();B.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})};
+Ext.tree.TreeEditor=function(A,C,B){C=C||{};var D=C.events?C:new Ext.form.TextField(C);Ext.tree.TreeEditor.superclass.constructor.call(this,D,B);this.tree=A;if(!A.rendered){A.on("render",this.initEditor,this)}else{this.initEditor(A)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(A){A.on("beforeclick",this.beforeNodeClick,this);A.on("dblclick",this.onNodeDblClick,this);this.on("complete",this.updateNode,this);this.on("beforestartedit",this.fitToTree,this);this.on("startedit",this.bindScroll,this,{delay:10});this.on("specialkey",this.onSpecialKey,this)},fitToTree:function(B,C){var E=this.tree.getTreeEl().dom,D=C.dom;if(E.scrollLeft>D.offsetLeft){E.scrollLeft=D.offsetLeft}var A=Math.min(this.maxWidth,(E.clientWidth>20?E.clientWidth:E.offsetWidth)-Math.max(0,D.offsetLeft-E.scrollLeft)-5);this.setSize(A,"")},triggerEdit:function(A,B){this.completeEdit();if(A.attributes.editable!==false){this.editNode=A;if(this.tree.autoScroll){A.ui.getEl().scrollIntoView(this.tree.body)}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[A.ui.textNode,A.text]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(A,B){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(A)){B.stopEvent();return this.triggerEdit(A)}},onNodeDblClick:function(A,B){clearTimeout(this.autoEditTimer)},updateNode:function(A,B){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(B)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(C,B){var A=B.getKey();if(A==B.ESC){B.stopEvent();this.cancelEdit()}else{if(A==B.ENTER&&!B.hasModifier()){B.stopEvent();this.completeEdit()}}}});
+Ext.menu.Menu=function(A){if(Ext.isArray(A)){A={items:A}}Ext.apply(this,A);this.id=this.id||Ext.id();this.addEvents("beforeshow","beforehide","show","hide","click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);Ext.menu.Menu.superclass.constructor.call(this);var B=this.items;this.items=new Ext.util.MixedCollection();if(B){this.add.apply(this,B)}};Ext.extend(Ext.menu.Menu,Ext.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,hidden:true,createEl:function(){return new Ext.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body,zindex:15000})},render:function(){if(this.el){return }var B=this.el=this.createEl();if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}if(this.plain){B.addClass("x-menu-plain")}if(this.cls){B.addClass(this.cls)}this.focusEl=B.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"});var A=B.createChild({tag:"ul",cls:"x-menu-list"});A.on("click",this.onClick,this);A.on("mouseover",this.onMouseOver,this);A.on("mouseout",this.onMouseOut,this);this.items.each(function(D){var C=document.createElement("li");C.className="x-menu-list-item";A.dom.appendChild(C);D.render(C,this)},this);this.ul=A;this.autoWidth()},autoWidth:function(){var D=this.el,C=this.ul;if(!D){return }var A=this.width;if(A){D.setWidth(A)}else{if(Ext.isIE){D.setWidth(this.minWidth);var B=D.dom.offsetWidth;D.setWidth(C.getWidth()+D.getFrameWidth("lr"))}}},delayAutoWidth:function(){if(this.el){if(!this.awTask){this.awTask=new Ext.util.DelayedTask(this.autoWidth,this)}this.awTask.delay(20)}},findTargetItem:function(B){var A=B.getTarget(".x-menu-list-item",this.ul,true);if(A&&A.menuItemId){return this.items.get(A.menuItemId)}},onClick:function(B){var A;if(A=this.findTargetItem(B)){if(A.menu&&this.ignoreParentClicks){A.expandMenu()}else{A.onClick(B);this.fireEvent("click",this,A,B)}}},setActiveItem:function(A,B){if(A!=this.activeItem){if(this.activeItem){this.activeItem.deactivate()}this.activeItem=A;A.activate(B)}else{if(B){A.expandMenu()}}},tryActivate:function(F,E){var B=this.items;for(var C=F,A=B.length;C>=0&&C<A;C+=E){var D=B.get(C);if(!D.disabled&&D.canActivate){this.setActiveItem(D,false);return D}}return false},onMouseOver:function(B){var A;if(A=this.findTargetItem(B)){if(A.canActivate&&!A.disabled){this.setActiveItem(A,true)}}this.over=true;this.fireEvent("mouseover",this,B,A)},onMouseOut:function(B){var A;if(A=this.findTargetItem(B)){if(A==this.activeItem&&A.shouldDeactivate(B)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,B,A)},isVisible:function(){return this.el&&!this.hidden},show:function(B,C,A){this.parentMenu=A;if(!this.el){this.render()}this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(B,C||this.defaultAlign),A,false)},showAt:function(C,B,A){this.parentMenu=B;if(!this.el){this.render()}if(A!==false){this.fireEvent("beforeshow",this);C=this.el.adjustForConstraints(C)}this.el.setXY(C);this.el.show();this.hidden=false;this.focus();this.fireEvent("show",this)},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(A){if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate();this.activeItem=null}this.el.hide();this.hidden=true;this.fireEvent("hide",this)}if(A===true&&this.parentMenu){this.parentMenu.hide(true)}},add:function(){var B=arguments,A=B.length,E;for(var C=0;C<A;C++){var D=B[C];if(D.render){E=this.addItem(D)}else{if(typeof D=="string"){if(D=="separator"||D=="-"){E=this.addSeparator()}else{E=this.addText(D)}}else{if(D.tagName||D.el){E=this.addElement(D)}else{if(typeof D=="object"){Ext.applyIf(D,this.defaults);E=this.addMenuItem(D)}}}}}return E},getEl:function(){if(!this.el){this.render()}return this.el},addSeparator:function(){return this.addItem(new Ext.menu.Separator())},addElement:function(A){return this.addItem(new Ext.menu.BaseItem(A))},addItem:function(B){this.items.add(B);if(this.ul){var A=document.createElement("li");A.className="x-menu-list-item";this.ul.dom.appendChild(A);B.render(A,this);this.delayAutoWidth()}return B},addMenuItem:function(A){if(!(A instanceof Ext.menu.Item)){if(typeof A.checked=="boolean"){A=new Ext.menu.CheckItem(A)}else{A=new Ext.menu.Item(A)}}return this.addItem(A)},addText:function(A){return this.addItem(new Ext.menu.TextItem(A))},insert:function(B,C){this.items.insert(B,C);if(this.ul){var A=document.createElement("li");A.className="x-menu-list-item";this.ul.dom.insertBefore(A,this.ul.dom.childNodes[B]);C.render(A,this);this.delayAutoWidth()}return C},remove:function(A){this.items.removeKey(A.id);A.destroy()},removeAll:function(){if(this.items){var A;while(A=this.items.first()){this.remove(A)}}},destroy:function(){this.beforeDestroy();Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}this.removeAll();if(this.ul){this.ul.removeAllListeners()}if(this.el){this.el.destroy()}},beforeDestroy:Ext.emptyFn});Ext.menu.MenuNav=function(A){Ext.menu.MenuNav.superclass.constructor.call(this,A.el);this.scope=this.menu=A};Ext.extend(Ext.menu.MenuNav,Ext.KeyNav,{doRelay:function(C,B){var A=C.getKey();if(!this.menu.activeItem&&C.isNavKeyPress()&&A!=C.SPACE&&A!=C.RETURN){this.menu.tryActivate(0,1);return false}return B.call(this.scope||this,C,this.menu)},up:function(B,A){if(!A.tryActivate(A.items.indexOf(A.activeItem)-1,-1)){A.tryActivate(A.items.length-1,-1)}},down:function(B,A){if(!A.tryActivate(A.items.indexOf(A.activeItem)+1,1)){A.tryActivate(0,1)}},right:function(B,A){if(A.activeItem){A.activeItem.expandMenu(true)}},left:function(B,A){A.hide();if(A.parentMenu&&A.parentMenu.activeItem){A.parentMenu.activeItem.activate()}},enter:function(B,A){if(A.activeItem){B.stopPropagation();A.activeItem.onClick(B);A.fireEvent("click",this,A.activeItem);return true}}});
+Ext.menu.MenuMgr=function(){var F,D,C={},A=false,K=new Date();function M(){F={};D=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(D.length>0){H()}})}function H(){if(D&&D.length>0){var N=D.clone();N.each(function(O){O.hide()})}}function E(N){D.remove(N);if(D.length<1){Ext.getDoc().un("mousedown",L);A=false}}function J(N){var O=D.last();K=new Date();D.add(N);if(!A){Ext.getDoc().on("mousedown",L);A=true}if(N.parentMenu){N.getEl().setZIndex(parseInt(N.parentMenu.getEl().getStyle("z-index"),10)+3);N.parentMenu.activeChild=N}else{if(O&&O.isVisible()){N.getEl().setZIndex(parseInt(O.getEl().getStyle("z-index"),10)+3)}}}function B(N){if(N.activeChild){N.activeChild.hide()}if(N.autoHideTimer){clearTimeout(N.autoHideTimer);delete N.autoHideTimer}}function G(N){var O=N.parentMenu;if(!O&&!N.allowOtherMenus){H()}else{if(O&&O.activeChild){O.activeChild.hide()}}}function L(N){if(K.getElapsed()>50&&D.length>0&&!N.getTarget(".x-menu")){H()}}function I(O,R){if(R){var Q=C[O.group];for(var P=0,N=Q.length;P<N;P++){if(Q[P]!=O){Q[P].setChecked(false)}}}}return{hideAll:function(){H()},register:function(O){if(!F){M()}F[O.id]=O;O.on("beforehide",B);O.on("hide",E);O.on("beforeshow",G);O.on("show",J);var N=O.group;if(N&&O.events["checkchange"]){if(!C[N]){C[N]=[]}C[N].push(O);O.on("checkchange",onCheck)}},get:function(N){if(typeof N=="string"){if(!F){return null}return F[N]}else{if(N.events){return N}else{if(typeof N.length=="number"){return new Ext.menu.Menu({items:N})}else{return new Ext.menu.Menu(N)}}}},unregister:function(O){delete F[O.id];O.un("beforehide",B);O.un("hide",E);O.un("beforeshow",G);O.un("show",J);var N=O.group;if(N&&O.events["checkchange"]){C[N].remove(O);O.un("checkchange",onCheck)}},registerCheckable:function(N){var O=N.group;if(O){if(!C[O]){C[O]=[]}C[O].push(N);N.on("beforecheckchange",I)}},unregisterCheckable:function(N){var O=N.group;if(O){C[O].remove(N);N.un("beforecheckchange",I)}},getCheckedItem:function(P){var Q=C[P];if(Q){for(var O=0,N=Q.length;O<N;O++){if(Q[O].checked){return Q[O]}}}return null},setCheckedItem:function(P,R){var Q=C[P];if(Q){for(var O=0,N=Q.length;O<N;O++){if(Q[O].id==R){Q[O].setChecked(true)}}}return null}}}();
+Ext.menu.BaseItem=function(A){Ext.menu.BaseItem.superclass.constructor.call(this,A);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}};Ext.extend(Ext.menu.BaseItem,Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,hideDelay:100,ctype:"Ext.menu.BaseItem",actionMode:"container",render:function(A,B){this.parentMenu=B;Ext.menu.BaseItem.superclass.render.call(this,A);this.container.menuItemId=this.id},onRender:function(B,A){this.el=Ext.get(this.el);B.dom.appendChild(this.el.dom)},setHandler:function(B,A){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=B,this.scope=A)},onClick:function(A){if(!this.disabled&&this.fireEvent("click",this,A)!==false&&this.parentMenu.fireEvent("itemclick",this,A)!==false){this.handleClick(A)}else{A.stopEvent()}},activate:function(){if(this.disabled){return false}var A=this.container;A.addClass(this.activeClass);this.region=A.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(A){return !this.region||!this.region.contains(A.getPoint())},handleClick:function(A){if(this.hideOnClick){this.parentMenu.hide.defer(this.hideDelay,this.parentMenu,[true])}},expandMenu:function(A){},hideMenu:function(){}});
+Ext.menu.TextItem=function(A){if(typeof A=="string"){A={text:A}}Ext.menu.TextItem.superclass.constructor.call(this,A)};Ext.extend(Ext.menu.TextItem,Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",onRender:function(){var A=document.createElement("span");A.className=this.itemCls;A.innerHTML=this.text;this.el=A;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});
+Ext.menu.Separator=function(A){Ext.menu.Separator.superclass.constructor.call(this,A)};Ext.extend(Ext.menu.Separator,Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,onRender:function(A){var B=document.createElement("span");B.className=this.itemCls;B.innerHTML="&#160;";this.el=B;A.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});
+Ext.menu.Item=function(A){Ext.menu.Item.superclass.constructor.call(this,A);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}};Ext.extend(Ext.menu.Item,Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Ext.menu.Item",onRender:function(B,A){var C=document.createElement("a");C.hideFocus=true;C.unselectable="on";C.href=this.href||"#";if(this.hrefTarget){C.target=this.hrefTarget}C.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");C.innerHTML=String.format("<img src=\"{0}\" class=\"x-menu-item-icon {2}\" />{1}",this.icon||Ext.BLANK_IMAGE_URL,this.itemText||this.text,this.iconCls||"");this.el=C;Ext.menu.Item.superclass.onRender.call(this,B,A)},setText:function(A){this.text=A;if(this.rendered){this.el.update(String.format("<img src=\"{0}\" class=\"x-menu-item-icon {2}\">{1}",this.icon||Ext.BLANK_IMAGE_URL,this.text,this.iconCls||""));this.parentMenu.autoWidth()}},setIconClass:function(A){var B=this.iconCls;this.iconCls=A;if(this.rendered){this.el.child("img.x-menu-item-icon").replaceClass(B,this.iconCls)}},handleClick:function(A){if(!this.href){A.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(A){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(A){this.expandMenu()}}return true},shouldDeactivate:function(A){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,A)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(A.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(A){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[A])}else{if(this.menu.isVisible()&&A){this.menu.tryActivate(0,1)}}}},deferExpand:function(A){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(A){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});
+Ext.menu.CheckItem=function(A){Ext.menu.CheckItem.superclass.constructor.call(this,A);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)};Ext.extend(Ext.menu.CheckItem,Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",onRender:function(A){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(B,A){if(this.checked!=B&&this.fireEvent("beforecheckchange",this,B)!==false){if(this.container){this.container[B?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=B;if(A!==true){this.fireEvent("checkchange",this,B)}}},handleClick:function(A){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});
+Ext.menu.Adapter=function(B,A){Ext.menu.Adapter.superclass.constructor.call(this,A);this.component=B};Ext.extend(Ext.menu.Adapter,Ext.menu.BaseItem,{canActivate:true,onRender:function(B,A){this.component.render(B);this.el=this.component.getEl()},activate:function(){if(this.disabled){return false}this.component.focus();this.fireEvent("activate",this);return true},deactivate:function(){this.fireEvent("deactivate",this)},disable:function(){this.component.disable();Ext.menu.Adapter.superclass.disable.call(this)},enable:function(){this.component.enable();Ext.menu.Adapter.superclass.enable.call(this)}});
+Ext.menu.DateItem=function(A){Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(A),A);this.picker=this.component;this.addEvents("select");this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(B,A){this.fireEvent("select",this,A,B);Ext.menu.DateItem.superclass.handleClick.call(this)}});
+Ext.menu.ColorItem=function(A){Ext.menu.ColorItem.superclass.constructor.call(this,new Ext.ColorPalette(A),A);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on("select",this.selectHandler,this.scope)}};Ext.extend(Ext.menu.ColorItem,Ext.menu.Adapter);
+Ext.menu.DateMenu=function(A){Ext.menu.DateMenu.superclass.constructor.call(this,A);this.plain=true;var B=new Ext.menu.DateItem(A);this.add(B);this.picker=B.picker;this.relayEvents(B,["select"]);this.on("beforeshow",function(){if(this.picker){this.picker.hideMonthPicker(true)}},this)};Ext.extend(Ext.menu.DateMenu,Ext.menu.Menu,{cls:"x-date-menu",beforeDestroy:function(){this.picker.destroy()}});
+Ext.menu.ColorMenu=function(A){Ext.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var B=new Ext.menu.ColorItem(A);this.add(B);this.palette=B.palette;this.relayEvents(B,["select"])};Ext.extend(Ext.menu.ColorMenu,Ext.menu.Menu);
+Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,isFormField:true,hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||"")},onRender:function(C,A){Ext.form.Field.superclass.onRender.call(this,C,A);if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=this.name||this.id}if(this.inputType){B.type=this.inputType}this.el=C.createChild(B,A)}var D=this.el.dom.type;if(D){if(D=="password"){D="text"}this.el.addClass("x-form-"+D)}if(this.readOnly){this.el.dom.readOnly=true}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(this.el.dom.value.length>0&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled){return false}return String(this.getValue())!==String(this.originalValue)},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(A){if(A.isSpecialKey()){this.fireEvent("specialkey",this,A)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.el.on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);var A=this.inEditor&&Ext.isWindows&&Ext.isGecko?{buffer:10}:null;this.el.on("blur",this.onBlur,this,A);this.originalValue=this.getValue()},onFocus:function(){if(!Ext.isOpera&&this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(!Ext.isOpera&&this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate()}var A=this.getValue();if(String(A)!==String(this.startValue)){this.fireEvent("change",this,A,this.startValue)}this.fireEvent("blur",this)},isValid:function(A){if(this.disabled){return true}var C=this.preventMark;this.preventMark=A===true;var B=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=C;return B},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(A){return A},validateValue:function(A){return true},markInvalid:function(C){if(!this.rendered||this.preventMark){return }this.el.addClass(this.invalidClass);C=C||this.invalidText;switch(this.msgTarget){case"qtip":this.el.dom.qtip=C;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=C;break;case"under":if(!this.errorEl){var B=this.getErrorCt();if(!B){this.el.dom.title=C;break}this.errorEl=B.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(B.getWidth(true)-20)}this.errorEl.update(C);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){var B=this.getErrorCt();if(!B){this.el.dom.title=C;break}this.errorIcon=B.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=C;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:var A=Ext.getDom(this.msgTarget);A.innerHTML=C;A.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,C)},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},clearInvalid:function(){if(!this.rendered||this.preventMark){return }this.el.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";break;case"title":this.el.dom.title="";break;case"under":if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}break;case"side":if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}break;default:var A=Ext.getDom(this.msgTarget);A.innerHTML="";A.style.display="none";break}this.fireEvent("valid",this)},getRawValue:function(){var A=this.rendered?this.el.getValue():Ext.value(this.value,"");if(A===this.emptyText){A=""}return A},getValue:function(){if(!this.rendered){return this.value}var A=this.el.getValue();if(A===this.emptyText||A===undefined){A=""}return A},setRawValue:function(A){return this.el.dom.value=(A===null||A===undefined?"":A)},setValue:function(A){this.value=A;if(this.rendered){this.el.dom.value=(A===null||A===undefined?"":A);this.validate()}},adjustSize:function(A,C){var B=Ext.form.Field.superclass.adjustSize.call(this,A,C);B.width=this.adjustWidth(this.el.dom.tagName,B.width);return B},adjustWidth:function(A,B){A=A.toLowerCase();if(typeof B=="number"&&!Ext.isSafari){if(Ext.isIE&&(A=="input"||A=="textarea")){if(A=="input"&&!Ext.isStrict){return this.inEditor?B:B-3}if(A=="input"&&Ext.isStrict){return B-(Ext.isIE6?4:1)}if(A=="textarea"&&Ext.isStrict){return B-2}}else{if(Ext.isOpera&&Ext.isStrict){if(A=="input"){return B+2}if(A=="textarea"){return B-2}}}}return B}});Ext.form.MessageTargets={"qtip":{mark:function(A){this.el.dom.qtip=msg;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(A){this.el.dom.qtip=""}},"title":{mark:function(A){this.el.dom.title=msg},clear:function(A){this.el.dom.title=""}},"under":{mark:function(B){if(!this.errorEl){var A=this.getErrorCt();if(!A){this.el.dom.title=msg;return }this.errorEl=A.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(A.getWidth(true)-20)}this.errorEl.update(msg);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this)},clear:function(A){if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}else{this.el.dom.title=""}}},"side":{mark:function(B){if(!this.errorIcon){var A=this.getErrorCt();if(!A){this.el.dom.title=msg;return }this.errorIcon=A.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=msg;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this)},clear:function(A){if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}else{this.el.dom.title=""}}},"around":{mark:function(A){},clear:function(A){}}};Ext.form.Field.msgFx={normal:{show:function(A,B){A.setDisplayed("block")},hide:function(A,B){A.setDisplayed(false).update("")}},slide:{show:function(A,B){A.slideIn("t",{stopFx:true})},hide:function(A,B){A.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(A,B){A.fixDisplay();A.alignTo(B.el,"tl-tr");A.slideIn("l",{stopFx:true})},hide:function(A,B){A.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);
+Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.el.on("keyup",this.filterValidation,this)}else{if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);this.el.on("mousedown",function(){if(!this.hasFocus){this.el.on("mouseup",function(A){A.preventDefault()},this,{single:true})}},this);if(this.emptyText){this.on("blur",this.postBlur,this);this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.el.on("keypress",this.filterKeys,this)}if(this.grow){this.el.on("keyup",this.onKeyUpBuffered,this,{buffer:50});this.el.on("click",this.autoSize,this)}if(this.enableKeyEvents){this.el.on("keyup",this.onKeyUp,this);this.el.on("keydown",this.onKeyDown,this);this.el.on("keypress",this.onKeyPress,this)}},processValue:function(A){if(this.stripCharsRe){var B=A.replace(this.stripCharsRe,"");if(B!==A){this.setRawValue(B);return B}}return A},filterValidation:function(A){if(!A.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onKeyUpBuffered:function(A){if(!A.isNavKeyPress()){this.autoSize()}},onKeyUp:function(A){this.fireEvent("keyup",this,A)},onKeyDown:function(A){this.fireEvent("keydown",this,A)},onKeyPress:function(A){this.fireEvent("keypress",this,A)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue("")}this.el.removeClass(this.emptyClass)}if(this.selectOnFocus){this.el.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(B){if(B.ctrlKey){return }var A=B.getKey();if(Ext.isGecko&&(B.isNavKeyPress()||A==B.BACKSPACE||(A==B.DELETE&&B.button==-1))){return }var D=B.getCharCode(),C=String.fromCharCode(D);if(!Ext.isGecko&&B.isSpecialKey()&&!C){return }if(!this.maskRe.test(C)){B.stopEvent()}},setValue:function(A){if(this.emptyText&&this.el&&A!==undefined&&A!==null&&A!==""){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize()},validateValue:function(A){if(A.length<1||A===this.emptyText){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(A.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(A.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}if(this.vtype){var C=Ext.form.VTypes;if(!C[this.vtype](A,this)){this.markInvalid(this.vtypeText||C[this.vtype+"Text"]);return false}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){this.markInvalid(B);return false}}if(this.regex&&!this.regex.test(A)){this.markInvalid(this.regexText);return false}return true},selectText:function(E,A){var C=this.getRawValue();if(C.length>0){E=E===undefined?0:E;A=A===undefined?C.length:A;var D=this.el.dom;if(D.setSelectionRange){D.setSelectionRange(E,A)}else{if(D.createTextRange){var B=D.createTextRange();B.moveStart("character",E);B.moveEnd("character",A-C.length);B.select()}}}},autoSize:function(){if(!this.grow||!this.rendered){return }if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var C=this.el;var B=C.dom.value;var D=document.createElement("div");D.appendChild(document.createTextNode(B));B=D.innerHTML;D=null;B+="&#160;";var A=Math.min(this.growMax,Math.max(this.metrics.getWidth(B)+10,this.growMin));this.el.setWidth(A);this.fireEvent("autosize",this,A)}});Ext.reg("textfield",Ext.form.TextField);
+Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,onResize:function(A,B){Ext.form.TriggerField.superclass.onResize.call(this,A,B);if(typeof A=="number"){this.el.setWidth(this.adjustWidth("input",A-this.trigger.getWidth()))}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(B,A){Ext.form.TriggerField.superclass.onRender.call(this,B,A);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);var A;if(Ext.isIE&&this.el.getY()!=(A=this.trigger.getY())){this.el.position();this.el.setY(A)}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}if(this.wrap){this.wrap.remove()}Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.el.on("keydown",this.checkTab,this)}}},checkTab:function(A){if(A.getKey()==A.TAB){this.triggerBlur()}},onBlur:function(){},mimicBlur:function(A){if(!this.wrap.contains(A.target)&&this.validateBlur(A)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);if(this.monitorTab){this.el.un("keydown",this.checkTab,this)}this.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");Ext.form.TriggerField.superclass.onBlur.call(this)},beforeBlur:Ext.emptyFn,validateBlur:function(A){return true},onDisable:function(){Ext.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass(this.disabledClass);this.el.removeClass(this.disabledClass)}},onEnable:function(){Ext.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass(this.disabledClass)}},onShow:function(){if(this.wrap){this.wrap.dom.style.display="";this.wrap.dom.style.visibility="visible"}},onHide:function(){this.wrap.dom.style.display="none"},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(A){return this.triggers[A]},initTrigger:function(){var A=this.trigger.select(".x-form-trigger",true);this.wrap.setStyle("overflow","hidden");var B=this;A.each(function(D,F,C){D.hide=function(){var G=B.wrap.getWidth();this.dom.style.display="none";B.el.setWidth(G-B.trigger.getWidth())};D.show=function(){var G=B.wrap.getWidth();this.dom.style.display="";B.el.setWidth(G-B.trigger.getWidth())};var E="Trigger"+(C+1);if(this["hide"+E]){D.dom.style.display="none"}D.on("click",this["on"+E+"Click"],this,{preventDefault:true});D.addClassOnOver("x-form-trigger-over");D.addClassOnClick("x-form-trigger-click")},this);this.triggers=A.elements},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);
+Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",growPad:0,enterIsSpecial:false,preventScrollbars:false,onRender:function(B,A){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,B,A);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){if(this.textSizeEl){Ext.removeNode(this.textSizeEl)}Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(A){if(A.isSpecialKey()&&(this.enterIsSpecial||(A.getKey()!=A.ENTER||A.hasModifier()))){this.fireEvent("specialkey",this,A)}},onKeyUp:function(A){if(!A.isNavKeyPress()||A.getKey()==A.ENTER){this.autoSize()}Ext.form.TextArea.superclass.onKeyUp.call(this,A)},autoSize:function(){if(!this.grow||!this.textSizeEl){return }var C=this.el;var A=C.dom.value;var D=this.textSizeEl;D.innerHTML="";D.appendChild(document.createTextNode(A));A=D.innerHTML;Ext.fly(D).setWidth(this.el.getWidth());if(A.length<1){A="&#160;&#160;"}else{if(Ext.isIE){A=A.replace(/\n/g,"<p>&#160;</p>")}A+=this.growAppend}D.innerHTML=A;var B=Math.min(this.growMax,Math.max(D.offsetHeight,this.growMin)+this.growPad);if(B!=this.lastHeight){this.lastHeight=B;this.el.setHeight(B);this.fireEvent("autosize",this,B)}}});Ext.reg("textarea",Ext.form.TextArea);
+Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){Ext.form.NumberField.superclass.initEvents.call(this);var B=this.baseChars+"";if(this.allowDecimals){B+=this.decimalSeparator}if(this.allowNegative){B+="-"}this.stripCharsRe=new RegExp("[^"+B+"]","gi");var A=function(D){var C=D.getKey();if(!Ext.isIE&&(D.isSpecialKey()||C==D.BACKSPACE||C==D.DELETE)){return }var E=D.getCharCode();if(B.indexOf(String.fromCharCode(E))===-1){D.stopEvent()}};this.el.on("keypress",A,this)},validateValue:function(B){if(!Ext.form.NumberField.superclass.validateValue.call(this,B)){return false}if(B.length<1){return true}B=String(B).replace(this.decimalSeparator,".");if(isNaN(B)){this.markInvalid(String.format(this.nanText,B));return false}var A=this.parseValue(B);if(A<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false}if(A>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false}return true},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(A){A=typeof A=="number"?A:parseFloat(String(A).replace(this.decimalSeparator,"."));A=isNaN(A)?"":String(A).replace(".",this.decimalSeparator);Ext.form.NumberField.superclass.setValue.call(this,A)},parseValue:function(A){A=parseFloat(String(A).replace(this.decimalSeparator,"."));return isNaN(A)?"":A},fixPrecision:function(B){var A=isNaN(B);if(!this.allowDecimals||this.decimalPrecision==-1||A||!B){return A?"":B}return parseFloat(parseFloat(B).toFixed(this.decimalPrecision))},beforeBlur:function(){var A=this.parseValue(this.getRawValue());if(A){this.setValue(this.fixPrecision(A))}}});Ext.reg("numberfield",Ext.form.NumberField);
+Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}this.ddMatch=null;this.initDisabledDays()},initDisabledDays:function(){if(this.disabledDates){var A=this.disabledDates;var C="(?:";for(var B=0;B<A.length;B++){C+=A[B];if(B!=A.length-1){C+="|"}}this.disabledDatesRE=new RegExp(C+")")}},setDisabledDates:function(A){this.disabledDates=A;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(A){this.disabledDays=A;if(this.menu){this.menu.picker.setDisabledDays(A)}},setMinValue:function(A){this.minValue=(typeof A=="string"?this.parseDate(A):A);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(A){this.maxValue=(typeof A=="string"?this.parseDate(A):A);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},validateValue:function(E){E=this.formatDate(E);if(!Ext.form.DateField.superclass.validateValue.call(this,E)){return false}if(E.length<1){return true}var C=E;E=this.parseDate(E);if(!E){this.markInvalid(String.format(this.invalidText,C,this.format));return false}var F=E.getTime();if(this.minValue&&F<this.minValue.getTime()){this.markInvalid(String.format(this.minText,this.formatDate(this.minValue)));return false}if(this.maxValue&&F>this.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false}if(this.disabledDays){var A=E.getDay();for(var B=0;B<this.disabledDays.length;B++){if(A===this.disabledDays[B]){this.markInvalid(this.disabledDaysText);return false}}}var D=this.formatDate(E);if(this.ddMatch&&this.ddMatch.test(D)){this.markInvalid(String.format(this.disabledDatesText,D));return false}return true},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(A){Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(A)))},parseDate:function(D){if(!D||Ext.isDate(D)){return D}var B=Date.parseDate(D,this.format);if(!B&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|")}for(var C=0,A=this.altFormatsArray.length;C<A&&!B;C++){B=Date.parseDate(D,this.altFormatsArray[C])}}return B},onDestroy:function(){if(this.menu){this.menu.destroy()}if(this.wrap){this.wrap.remove()}Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(A){return Ext.isDate(A)?A.dateFormat(this.format):A},menuListeners:{select:function(A,B){this.setValue(B)},show:function(){this.onFocus()},hide:function(){this.focus.defer(10,this);var A=this.menuListeners;this.menu.un("select",A.select,this);this.menu.un("show",A.show,this);this.menu.un("hide",A.hide,this)}},onTriggerClick:function(){if(this.disabled){return }if(this.menu==null){this.menu=new Ext.menu.DateMenu()}Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.ddMatch,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.on(Ext.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?")},beforeBlur:function(){var A=this.parseDate(this.getRawValue());if(A){this.setValue(A)}}});Ext.reg("datefield",Ext.form.DateField);
+Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,editable:true,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){this.allowDomMove=false;var C=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=C.name}if(!this.store){this.mode="local";var G=[],D=C.options;for(var B=0,A=D.length;B<A;B++){var F=D[B];var E=(Ext.isIE?F.getAttributeNode("value").specified:F.hasAttribute("value"))?F.value:F.text;if(F.selected){this.value=E}G.push([E,F.text])}this.store=new Ext.data.SimpleStore({"id":0,fields:["value","text"],data:G});this.valueField="value";this.displayField="text"}C.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(C,this.autoCreate||this.defaultAutoCreate);Ext.removeNode(C);this.render(this.el.parentNode)}else{Ext.removeNode(C)}}else{if(Ext.isArray(this.store)){if(Ext.isArray(this.store[0])){this.store=new Ext.data.SimpleStore({fields:["value","text"],data:this.store});this.valueField="value"}else{this.store=new Ext.data.SimpleStore({fields:["text"],data:this.store,expandData:true});this.valueField="text"}this.displayField="text";this.mode="local"}}this.selectedIndex=-1;if(this.mode=="local"){if(this.initialConfig.queryDelay===undefined){this.queryDelay=10}if(this.initialConfig.minChars===undefined){this.minChars=0}}},onRender:function(B,A){Ext.form.ComboBox.superclass.onRender.call(this,B,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},"before",true);this.el.dom.removeAttribute("name")}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}if(!this.editable){this.editable=true;this.setEditable(false)}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:""}},initList:function(){if(!this.list){var A="x-combo-list";this.list=new Ext.Layer({shadow:this.shadow,cls:[A,this.listClass].join(" "),constrain:false});var B=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(B);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:A+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:A+"-inner"});this.innerList.on("mouseover",this.onViewOver,this);this.innerList.on("mousemove",this.onViewMove,this);this.innerList.setWidth(B-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:A+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl="<tpl for=\".\"><div class=\""+A+"-item\">{"+this.displayField+"}</div></tpl>"}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+A+"-item"});this.view.on("click",this.onViewClick,this);this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.resizer.on("resize",function(E,C,D){this.maxHeight=D-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=C;this.innerList.setWidth(C-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},bindStore:function(A,B){if(this.store&&!B){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.collapse,this);if(!A){this.store=null;if(this.view){this.view.setStore(null)}}}if(A){this.store=Ext.StoreMgr.lookup(A);this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.collapse,this);if(this.view){this.view.setStore(A)}}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{"up":function(A){this.inKeyMode=true;this.selectPrev()},"down":function(A){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},"enter":function(A){this.onViewClick();this.delayedCheck=true;this.unsetDelayCheck.defer(10,this)},"esc":function(A){this.collapse()},"tab":function(A){this.onViewClick(false);return true},scope:this,doRelay:function(C,B,A){if(A=="down"||this.scope.isExpanded()){return Ext.KeyNav.prototype.doRelay.apply(this,arguments)}return true},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this)}if(this.forceSelection){this.on("blur",this.doForce,this)}},onDestroy:function(){if(this.view){this.view.el.removeAllListeners();this.view.el.remove();this.view.purgeListeners()}if(this.list){this.list.destroy()}this.bindStore(null);Ext.form.ComboBox.superclass.onDestroy.call(this)},unsetDelayCheck:function(){delete this.delayedCheck},fireKey:function(A){if(A.isNavKeyPress()&&!this.isExpanded()&&!this.delayedCheck){this.fireEvent("specialkey",this,A)}},onResize:function(A,B){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var C=Math.max(A,this.minListWidth);this.list.setWidth(C);this.innerList.setWidth(C-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},setEditable:function(A){if(A==this.editable){return }this.editable=A;if(!A){this.el.dom.setAttribute("readOnly",true);this.el.on("mousedown",this.onTriggerClick,this);this.el.addClass("x-combo-noedit")}else{this.el.dom.setAttribute("readOnly",false);this.el.un("mousedown",this.onTriggerClick,this);this.el.removeClass("x-combo-noedit")}},onBeforeLoad:function(){if(!this.hasFocus){return }this.innerList.update(this.loadingText?"<div class=\"loading-indicator\">"+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return }if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(!this.selectByValue(this.value,true)){this.select(0,true)}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.onEmptyResults()}},onTypeAhead:function(){if(this.store.getCount()>0){var B=this.store.getAt(0);var C=B.data[this.displayField];var A=C.length;var D=this.getRawValue().length;if(D!=A){this.setRawValue(C);this.selectText(D,C.length)}}},onSelect:function(A,B){if(this.fireEvent("beforeselect",this,A,B)!==false){this.setValue(A.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,A,B)}},getValue:function(){if(this.valueField){return typeof this.value!="undefined"?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(A){var C=A;if(this.valueField){var B=this.findRecord(this.valueField,A);if(B){C=B.data[this.displayField]}else{if(this.valueNotFoundText!==undefined){C=this.valueNotFoundText}}}this.lastSelectionText=C;if(this.hiddenField){this.hiddenField.value=A}Ext.form.ComboBox.superclass.setValue.call(this,C);this.value=A},findRecord:function(C,B){var A;if(this.store.getCount()>0){this.store.each(function(D){if(D.data[C]==B){A=D;return false}})}return A},onViewMove:function(B,A){this.inKeyMode=false},onViewOver:function(D,B){if(this.inKeyMode){return }var C=this.view.findItemFromChild(B);if(C){var A=this.view.indexOf(C);this.select(A,false)}},onViewClick:function(B){var A=this.view.getSelectedIndexes()[0];var C=this.store.getAt(A);if(C){this.onSelect(C,A)}if(B!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var B=this.innerList.dom;var E=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight;var C=Math.max(B.clientHeight,B.offsetHeight,B.scrollHeight);var A=this.getPosition()[1]-Ext.getBody().getScroll().top;var F=Ext.lib.Dom.getViewHeight()-A-this.getSize().height;var D=Math.max(A,F,this.minHeight||0)-this.list.shadowOffset-E-5;C=Math.min(C,D,this.maxHeight);this.innerList.setHeight(C);this.list.beginUpdate();this.list.setHeight(C+E);this.list.alignTo(this.wrap,this.listAlign);this.list.endUpdate()},onEmptyResults:function(){this.collapse()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(A,C){if(A!==undefined&&A!==null){var B=this.findRecord(this.valueField||this.displayField,A);if(B){this.select(this.store.indexOf(B),C);return true}}return false},select:function(A,C){this.selectedIndex=A;this.view.select(A);if(C!==false){var B=this.view.getNode(A);if(B){this.innerList.scrollChildIntoView(B,false)}}},selectNext:function(){var A=this.store.getCount();if(A>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<A-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var A=this.store.getCount();if(A>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!=0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(A){if(this.editable!==false&&!A.isSpecialKey()){this.lastKey=A.getKey();this.dqTask.delay(this.queryDelay)}},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?"":this.lastSelectionText;this.applyEmptyText()}},doQuery:function(C,B){if(C===undefined||C===null){C=""}var A={query:C,forceAll:B,combo:this,cancel:false};if(this.fireEvent("beforequery",A)===false||A.cancel){return false}C=A.query;B=A.forceAll;if(B===true||(C.length>=this.minChars)){if(this.lastQuery!==C){this.lastQuery=C;if(this.mode=="local"){this.selectedIndex=-1;if(B){this.store.clearFilter()}else{this.store.filter(this.displayField,C)}this.onLoad()}else{this.store.baseParams[this.queryParam]=C;this.store.load({params:this.getParams(C)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(A){var B={};if(this.pageSize){B.start=0;B.limit=this.pageSize}return B},collapse:function(){if(!this.isExpanded()){return }this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(A){if(!A.within(this.wrap)&&!A.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return }this.list.alignTo(this.wrap,this.listAlign);this.list.show();this.innerList.setOverflow("auto");Ext.getDoc().on("mousewheel",this.collapseIf,this);Ext.getDoc().on("mousedown",this.collapseIf,this);this.fireEvent("expand",this)},onTriggerClick:function(){if(this.disabled){return }if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);
+Ext.form.Checkbox=Ext.extend(Ext.form.Field,{checkedCls:"x-form-check-checked",focusCls:"x-form-check-focus",overCls:"x-form-check-over",mouseDownCls:"x-form-check-down",tabIndex:0,checked:false,defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},baseCls:"x-form-check",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.initCheckEvents()},initCheckEvents:function(){this.innerWrap.removeAllListeners();this.innerWrap.addClassOnOver(this.overCls);this.innerWrap.addClassOnClick(this.mouseDownCls);this.innerWrap.on("click",this.onClick,this);this.innerWrap.on("keyup",this.onKeyUp,this)},onRender:function(B,A){Ext.form.Checkbox.superclass.onRender.call(this,B,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.el.addClass("x-hidden");this.innerWrap=this.el.wrap({tabIndex:this.tabIndex,cls:this.baseCls+"-wrap-inner"});this.wrap=this.innerWrap.wrap({cls:this.baseCls+"-wrap"});if(this.boxLabel){this.labelEl=this.innerWrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}this.imageEl=this.innerWrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:this.baseCls},this.el);if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}this.originalValue=this.checked},onDestroy:function(){if(this.rendered){Ext.destroy(this.imageEl,this.labelEl,this.innerWrap,this.wrap)}Ext.form.Checkbox.superclass.onDestroy.call(this)},onFocus:function(A){Ext.form.Checkbox.superclass.onFocus.call(this,A);this.el.addClass(this.focusCls)},onBlur:function(A){Ext.form.Checkbox.superclass.onBlur.call(this,A);this.el.removeClass(this.focusCls)},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},onKeyUp:function(A){if(A.getKey()==Ext.EventObject.SPACE){this.onClick(A)}},onClick:function(A){if(!this.disabled&&!this.readOnly){this.toggleValue()}A.stopEvent()},onEnable:function(){Ext.form.Checkbox.superclass.onEnable.call(this);this.initCheckEvents()},onDisable:function(){Ext.form.Checkbox.superclass.onDisable.call(this);this.innerWrap.removeAllListeners()},toggleValue:function(){this.setValue(!this.checked)},getResizeEl:function(){if(!this.resizeEl){this.resizeEl=Ext.isSafari?this.wrap:(this.wrap.up(".x-form-element",5)||this.wrap)}return this.resizeEl},getPositionEl:function(){return this.wrap},getActionEl:function(){return this.wrap},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,initValue:Ext.emptyFn,getValue:function(){if(this.rendered){return this.el.dom.checked}return false},setValue:function(A){var B=this.checked;this.checked=(A===true||A==="true"||A=="1"||String(A).toLowerCase()=="on");if(this.el&&this.el.dom){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}this.wrap[this.checked?"addClass":"removeClass"](this.checkedCls);if(B!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}}});Ext.reg("checkbox",Ext.form.Checkbox);
+Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",onRender:function(H,F){if(!this.el){var M={cls:this.groupCls,layout:"column",border:false,renderTo:H};var A={defaultType:this.defaultType,layout:"form",border:false,defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(M,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var E=0,J=this.items.length;E<J;E++){Ext.applyIf(this.items[E],A)}}else{var D,K=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var I=[];for(var E=0;E<this.columns;E++){I.push((100/this.columns)*0.01)}this.columns=I}D=this.columns.length;for(var E=0;E<D;E++){var B=Ext.apply({items:[]},A);B[this.columns[E]<=1?"columnWidth":"width"]=this.columns[E];if(this.defaults){B.defaults=Ext.apply(B.defaults||{},this.defaults)}K.push(B)}if(this.vertical){var O=Math.ceil(this.items.length/D),L=0;for(var E=0,J=this.items.length;E<J;E++){if(E>0&&E%O==0){L++}if(this.items[E].fieldLabel){this.items[E].hideLabel=false}K[L].items.push(this.items[E])}}else{for(var E=0,J=this.items.length;E<J;E++){var N=E%D;if(this.items[E].fieldLabel){this.items[E].hideLabel=false}K[N].items.push(this.items[E])}}Ext.apply(M,{layoutConfig:{columns:D},items:K})}this.panel=new Ext.Panel(M);this.el=this.panel.getEl();if(this.forId&&this.itemCls){var C=this.el.up(this.itemCls).child("label",true);if(C){C.setAttribute("htmlFor",this.forId)}}var G=this.panel.findBy(function(P){return P.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(G)}Ext.form.CheckboxGroup.superclass.onRender.call(this,H,F)},validateValue:function(A){if(!this.allowBlank){var B=true;this.items.each(function(C){if(C.checked){return B=false}},this);if(B){this.markInvalid(this.blankText);return false}}return true},onDisable:function(){this.items.each(function(A){A.disable()})},onEnable:function(){this.items.each(function(A){A.enable()})},onResize:function(A,B){this.panel.setSize(A,B);this.panel.doLayout()},reset:function(){Ext.form.CheckboxGroup.superclass.reset.call(this);this.items.each(function(A){if(A.reset){A.reset()}},this)},initValue:Ext.emptyFn,getValue:Ext.emptyFn,getRawValue:Ext.emptyFn,setValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);
+Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",baseCls:"x-form-radio",getGroupValue:function(){var A=this.getParent().child("input[name="+this.el.dom.name+"]:checked",true);return A?A.value:null},getParent:function(){return this.el.up("form")||Ext.getBody()},toggleValue:function(){if(!this.checked){var A=this.getParent().select("input[name="+this.el.dom.name+"]");A.each(function(B){if(B.dom.id==this.id){this.setValue(true)}else{Ext.getCmp(B.dom.id).setValue(false)}},this)}},setValue:function(A){if(typeof A=="boolean"){Ext.form.Radio.superclass.setValue.call(this,A)}else{var B=this.getParent().child("input[name="+this.el.dom.name+"][value="+A+"]",true);if(B&&!B.checked){Ext.getCmp(B.id).toggleValue()}}},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("radio",Ext.form.Radio);
+Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group"});Ext.reg("radiogroup",Ext.form.RadioGroup);
+Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);
+Ext.form.BasicForm=function(B,A){Ext.apply(this,A);this.items=new Ext.util.MixedCollection(false,function(C){return C.id||(C.id=Ext.id())});this.addEvents("beforeaction","actionfailed","actioncomplete");if(B){this.initEl(B)}Ext.form.BasicForm.superclass.constructor.call(this)};Ext.extend(Ext.form.BasicForm,Ext.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,initEl:function(A){this.el=Ext.get(A);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(A){A.stopEvent()},destroy:function(){this.items.each(function(A){Ext.destroy(A)});if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},isValid:function(){var A=true;this.items.each(function(B){if(!B.validate()){A=false}});return A},isDirty:function(){var A=false;this.items.each(function(B){if(B.isDirty()){A=true;return false}});return A},doAction:function(B,A){if(typeof B=="string"){B=new Ext.form.Action.ACTION_TYPES[B](this,A)}if(this.fireEvent("beforeaction",this,B)!==false){this.beforeAction(B);B.run.defer(100,B)}return this},submit:function(B){if(this.standardSubmit){var A=this.isValid();if(A){this.el.dom.submit()}return A}this.doAction("submit",B);return this},load:function(A){this.doAction("load",A);return this},updateRecord:function(B){B.beginEdit();var A=B.fields;A.each(function(C){var D=this.findField(C.name);if(D){B.set(C.name,D.getValue())}},this);B.endEdit();return this},loadRecord:function(A){this.setValues(A.data);return this},beforeAction:function(A){var B=A.options;if(B.waitMsg){if(this.waitMsgTarget===true){this.el.mask(B.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(B.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(B.waitMsg,B.waitTitle||this.waitTitle||"Please Wait...")}}}},afterAction:function(A,C){this.activeAction=null;var B=A.options;if(B.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(C){if(B.reset){this.reset()}Ext.callback(B.success,B.scope,[this,A]);this.fireEvent("actioncomplete",this,A)}else{Ext.callback(B.failure,B.scope,[this,A]);this.fireEvent("actionfailed",this,A)}},findField:function(B){var A=this.items.get(B);if(!A){this.items.each(function(C){if(C.isFormField&&(C.dataIndex==B||C.id==B||C.getName()==B)){A=C;return false}})}return A||null},markInvalid:function(G){if(Ext.isArray(G)){for(var C=0,A=G.length;C<A;C++){var B=G[C];var D=this.findField(B.id);if(D){D.markInvalid(B.msg)}}}else{var E,F;for(F in G){if(typeof G[F]!="function"&&(E=this.findField(F))){E.markInvalid(G[F])}}}return this},setValues:function(C){if(Ext.isArray(C)){for(var D=0,A=C.length;D<A;D++){var B=C[D];var E=this.findField(B.id);if(E){E.setValue(B.value);if(this.trackResetOnLoad){E.originalValue=E.getValue()}}}}else{var F,G;for(G in C){if(typeof C[G]!="function"&&(F=this.findField(G))){F.setValue(C[G]);if(this.trackResetOnLoad){F.originalValue=F.getValue()}}}}return this},getValues:function(B){var A=Ext.lib.Ajax.serializeForm(this.el.dom);if(B===true){return A}return Ext.urlDecode(A)},clearInvalid:function(){this.items.each(function(A){A.clearInvalid()});return this},reset:function(){this.items.each(function(A){A.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(A){this.items.remove(A);return this},render:function(){this.items.each(function(A){if(A.isFormField&&!A.rendered&&document.getElementById(A.id)){A.applyToMarkup(A.id)}});return this},applyToFields:function(A){this.items.each(function(B){Ext.apply(B,A)});return this},applyIfToFields:function(A){this.items.each(function(B){Ext.applyIf(B,A)});return this}});Ext.BasicForm=Ext.form.BasicForm;
+Ext.FormPanel=Ext.extend(Ext.Panel,{buttonAlign:"center",minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}Ext.FormPanel.superclass.initComponent.call(this);this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){delete this.initialConfig.listeners;return new Ext.form.BasicForm(null,this.initialConfig)},initFields:function(){var C=this.form;var A=this;var B=function(D){if(D.isFormField){C.add(D)}else{if(D.doLayout&&D!=A){Ext.applyIf(D,{labelAlign:D.ownerCt.labelAlign,labelWidth:D.ownerCt.labelWidth,itemCls:D.ownerCt.itemCls});if(D.items){D.items.each(B)}}}};this.items.each(B)},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(B,A){this.initFields();Ext.FormPanel.superclass.onRender.call(this,B,A);this.form.initEl(this.body)},beforeDestroy:function(){Ext.FormPanel.superclass.beforeDestroy.call(this);this.stopMonitoring();Ext.destroy(this.form)},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.items.on("remove",this.onRemove,this);this.items.on("add",this.onAdd,this);if(this.monitorValid){this.startMonitoring()}},onAdd:function(A,B){if(B.isFormField){this.form.add(B)}},onRemove:function(A){if(A.isFormField){Ext.destroy(A.container.up(".x-form-item"));this.form.remove(A)}},startMonitoring:function(){if(!this.bound){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){if(!this.bound){return false}var D=true;this.form.items.each(function(E){if(!E.isValid(true)){D=false;return false}});if(this.buttons){for(var C=0,A=this.buttons.length;C<A;C++){var B=this.buttons[C];if(B.formBind===true&&B.disabled===D){B.setDisabled(!D)}}}this.fireEvent("clientvalidation",this,D)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;
+Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",onRender:function(B,A){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className="x-fieldset-header"}}Ext.form.FieldSet.superclass.onRender.call(this,B,A);if(this.checkboxToggle){var C=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(C);this.checkbox.dom.checked=!this.collapsed;this.checkbox.on("click",this.onCheckClick,this)}},onCollapse:function(A,B){if(this.checkbox){this.checkbox.dom.checked=false}this.afterCollapse()},onExpand:function(A,B){if(this.checkbox){this.checkbox.dom.checked=true}this.afterExpand()},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});Ext.reg("fieldset",Ext.form.FieldSet);
+Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http:/"+"/",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange")},createFontOptions:function(){var D=[],B=this.fontFamilies,C,F;for(var E=0,A=B.length;E<A;E++){C=B[E];F=C.toLowerCase();D.push("<option value=\"",F,"\" style=\"font-family:",C,";\"",(this.defaultFont==F?" selected=\"true\">":">"),C,"</option>")}return D.join("")},createToolbar:function(D){var A=Ext.QuickTips&&Ext.QuickTips.isEnabled();function C(G,E,F){return{itemId:G,cls:"x-btn-icon x-edit-"+G,enableToggle:E!==false,scope:D,handler:F||D.relayBtnCmd,clickEvent:"mousedown",tooltip:A?D.buttonTips[G]||undefined:undefined,tabIndex:-1}}var B=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild});B.el.on("click",function(E){E.preventDefault()});if(this.enableFont&&!Ext.isSafari2){this.fontSelect=B.el.createChild({tag:"select",cls:"x-font-select",html:this.createFontOptions()});this.fontSelect.on("change",function(){var E=this.fontSelect.dom.value;this.relayCmd("fontname",E);this.deferFocus()},this);B.add(this.fontSelect.dom,"-")}if(this.enableFormat){B.add(C("bold"),C("italic"),C("underline"))}if(this.enableFontSize){B.add("-",C("increasefontsize",false,this.adjustFont),C("decreasefontsize",false,this.adjustFont))}if(this.enableColors){B.add("-",{itemId:"forecolor",cls:"x-btn-icon x-edit-forecolor",clickEvent:"mousedown",tooltip:A?D.buttonTips["forecolor"]||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,selectHandler:function(F,E){this.execCmd("forecolor",Ext.isSafari||Ext.isIE?"#"+E:E);this.deferFocus()},scope:this,clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon x-edit-backcolor",clickEvent:"mousedown",tooltip:A?D.buttonTips["backcolor"]||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,selectHandler:function(F,E){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",E);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isSafari||Ext.isIE?"#"+E:E);this.deferFocus()}},scope:this,clickEvent:"mousedown"})})}if(this.enableAlignments){B.add("-",C("justifyleft"),C("justifycenter"),C("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){B.add("-",C("createlink",false,this.createLink))}if(this.enableLists){B.add("-",C("insertorderedlist"),C("insertunorderedlist"))}if(this.enableSourceEdit){B.add("-",C("sourceedit",true,function(E){this.toggleSourceEdit(E.pressed)}))}}this.tb=B},getDocMarkup:function(){return"<html><head><style type=\"text/css\">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>"},getEditorBody:function(){return this.doc.body||this.doc.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(B,A){Ext.form.HtmlEditor.superclass.onRender.call(this,B,A);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.tb.items.each(function(E){if(E.itemId!="sourceedit"){E.disable()}});var C=document.createElement("iframe");C.name=Ext.id();C.frameBorder="0";C.src=Ext.isIE?Ext.SSL_SECURE_URL:"javascript:;";this.wrap.dom.appendChild(C);this.iframe=C;this.initFrame();if(this.autoMonitorDesignMode!==false){this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})}if(!this.width){var D=this.el.getSize();this.setSize(D.width,this.height||D.height)}},initFrame:function(){this.doc=this.getDoc();this.win=this.getWin();this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A={run:function(){if(this.doc.body||this.doc.readyState=="complete"){Ext.TaskMgr.stop(A);this.doc.designMode="on";this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(A)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var A=this.getDoc();if(!A){return }if(!A.editorInitialized||String(A.designMode).toLowerCase()!="on"){this.initFrame()}}},onResize:function(B,C){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof B=="number"){var D=B-this.wrap.getFrameWidth("lr");this.el.setWidth(this.adjustWidth("textarea",D));this.iframe.style.width=D+"px"}if(typeof C=="number"){var A=C-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(this.adjustWidth("textarea",A));this.iframe.style.height=A+"px";if(this.doc){this.getEditorBody().style.height=(A-(this.iframePad*2))+"px"}}}},toggleSourceEdit:function(A){if(A===undefined){A=!this.sourceEditMode}this.sourceEditMode=A===true;var C=this.tb.items.get("sourceedit");if(C.pressed!==this.sourceEditMode){C.toggle(this.sourceEditMode);return }if(this.sourceEditMode){this.tb.items.each(function(D){if(D.itemId!="sourceedit"){D.disable()}});this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus()}else{if(this.initialized){this.tb.items.each(function(D){D.enable()})}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus()}var B=this.lastSize;if(B){delete this.lastSize;this.setSize(B)}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!="http:/"+"/"){this.relayCmd("createlink",A)}},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(A){Ext.form.HtmlEditor.superclass.setValue.call(this,A);this.pushValue()},cleanHtml:function(A){A=String(A);if(A.length>5){if(Ext.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}}if(A=="&nbsp;"){A=""}return A},syncValue:function(){if(this.initialized){var D=this.getEditorBody();var C=D.innerHTML;if(Ext.isSafari){var B=D.getAttribute("style");var A=B.match(/text-align:(.*?);/i);if(A&&A[1]){C="<div style=\""+A[0]+"\">"+C+"</div>"}}C=this.cleanHtml(C);if(this.fireEvent("beforesync",this,C)!==false){this.el.dom.value=C;this.fireEvent("sync",this,C)}}},pushValue:function(){if(this.initialized){var A=this.el.dom.value;if(!this.activated&&A.length<1){A="&nbsp;"}if(this.fireEvent("beforepush",this,A)!==false){this.getEditorBody().innerHTML=A;this.fireEvent("push",this,A)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){var B=this.getEditorBody();var A=this.el.getStyles("font-size","font-family","background-image","background-repeat");A["background-attachment"]="fixed";B.bgProperties="fixed";Ext.DomHelper.applyStyles(B,A);if(this.doc){try{Ext.EventManager.removeAll(this.doc)}catch(C){}}this.doc=this.getDoc();Ext.EventManager.on(this.doc,{"mousedown":this.onEditorEvent,"dblclick":this.onEditorEvent,"click":this.onEditorEvent,"keyup":this.onEditorEvent,buffer:100,scope:this});if(Ext.isGecko){Ext.EventManager.on(this.doc,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isSafari||Ext.isOpera){Ext.EventManager.on(this.doc,"keydown",this.fixKeys,this)}this.initialized=true;this.fireEvent("initialize",this);this.doc.editorInitialized=true;this.pushValue()},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy()}}A.destroy()});this.wrap.dom.innerHTML="";this.wrap.remove()}},onFirstFocus:function(){this.activated=true;this.tb.items.each(function(D){D.enable()});if(Ext.isGecko){this.win.focus();var A=this.win.getSelection();if(!A.focusNode||A.focusNode.nodeType!=3){var B=A.getRangeAt(0);B.selectNodeContents(this.getEditorBody());B.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(C){}}this.fireEvent("activate",this)},adjustFont:function(B){var C=B.itemId=="increasefontsize"?1:-1;var A=parseInt(this.doc.queryCommandValue("FontSize")||2,10);if(Ext.isSafari3||Ext.isAir){if(A<=10){A=1+C}else{if(A<=13){A=2+C}else{if(A<=16){A=3+C}else{if(A<=18){A=4+C}else{if(A<=24){A=5+C}else{A=6+C}}}}}A=A.constrain(1,6)}else{if(Ext.isSafari){C*=2}A=Math.max(1,A+C)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",A)},onEditorEvent:function(A){this.updateToolbar()},updateToolbar:function(){if(!this.activated){this.onFirstFocus();return }var B=this.tb.items.map,C=this.doc;if(this.enableFont&&!Ext.isSafari2){var A=(this.doc.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(A!=this.fontSelect.dom.value){this.fontSelect.dom.value=A}}if(this.enableFormat){B.bold.toggle(C.queryCommandState("bold"));B.italic.toggle(C.queryCommandState("italic"));B.underline.toggle(C.queryCommandState("underline"))}if(this.enableAlignments){B.justifyleft.toggle(C.queryCommandState("justifyleft"));B.justifycenter.toggle(C.queryCommandState("justifycenter"));B.justifyright.toggle(C.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){B.insertorderedlist.toggle(C.queryCommandState("insertorderedlist"));B.insertunorderedlist.toggle(C.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(A){this.relayCmd(A.itemId)},relayCmd:function(B,A){(function(){this.focus();this.execCmd(B,A);this.updateToolbar()}).defer(10,this)},execCmd:function(B,A){this.doc.execCommand(B,false,A===undefined?null:A);this.syncValue()},applyCommand:function(B){if(B.ctrlKey){var C=B.getCharCode(),A;if(C>0){C=String.fromCharCode(C);switch(C){case"b":A="bold";break;case"i":A="italic";break;case"u":A="underline";break}if(A){this.win.focus();this.execCmd(A);this.deferFocus();B.preventDefault()}}}},insertAtCursor:function(B){if(!this.activated){return }if(Ext.isIE){this.win.focus();var A=this.doc.selection.createRange();if(A){A.collapse(true);A.pasteHTML(B);this.syncValue();this.deferFocus()}}else{if(Ext.isGecko||Ext.isOpera){this.win.focus();this.execCmd("InsertHTML",B);this.deferFocus()}else{if(Ext.isSafari){this.execCmd("InsertText",B);this.deferFocus()}}}},fixKeys:function(){if(Ext.isIE){return function(D){var A=D.getKey(),B;if(A==D.TAB){D.stopEvent();B=this.doc.selection.createRange();if(B){B.collapse(true);B.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(A==D.ENTER){B=this.doc.selection.createRange();if(B){var C=B.parentElement();if(!C||C.tagName.toLowerCase()!="li"){D.stopEvent();B.pasteHTML("<br />");B.collapse(false);B.select()}}}}}}else{if(Ext.isOpera){return function(B){var A=B.getKey();if(A==B.TAB){B.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isSafari){return function(B){var A=B.getKey();if(A==B.TAB){B.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);
+Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:null,maxValue:null,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initComponent:function(){Ext.form.TimeField.superclass.initComponent.call(this);if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}if(!this.store){var B=this.parseDate(this.minValue);if(!B){B=new Date(this.initDate).clearTime()}var A=this.parseDate(this.maxValue);if(!A){A=new Date(this.initDate).clearTime().add("mi",(24*60)-1)}var C=[];while(B<=A){C.push([B.dateFormat(this.format)]);B=B.add("mi",this.increment)}this.store=new Ext.data.SimpleStore({fields:["text"],data:C});this.displayField="text"}},getValue:function(){var A=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(A))||""},setValue:function(A){Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(A)))},validateValue:Ext.form.DateField.prototype.validateValue,parseDate:Ext.form.DateField.prototype.parseDate,formatDate:Ext.form.DateField.prototype.formatDate,beforeBlur:function(){var A=this.parseDate(this.getRawValue());if(A){this.setValue(A.dateFormat(this.format))}}});Ext.reg("timefield",Ext.form.TimeField);
+Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(B,A){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("htmlFor",this.forId)}}Ext.form.Label.superclass.onRender.call(this,B,A)},setText:function(A,B){this.text=A;if(this.rendered){this.el.dom.innerHTML=B!==false?Ext.util.Format.htmlEncode(A):A}return this}});Ext.reg("label",Ext.form.Label);
+Ext.form.Action=function(B,A){this.form=B;this.options=A||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(A){},success:function(A){},handleResponse:function(A){},failure:function(A){this.response=A;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(A){this.response=A;if(!A.responseText){return true}this.result=this.handleResponse(A);return this.result},getUrl:function(C){var A=this.options.url||this.form.url||this.form.el.dom.action;if(C){var B=this.getParams();if(B){A+=(A.indexOf("?")!=-1?"&":"?")+B}}return A},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var A=this.form.baseParams;var B=this.options.params;if(B){if(typeof B=="object"){B=Ext.urlEncode(Ext.applyIf(B,A))}else{if(typeof B=="string"&&A){B+="&"+Ext.urlEncode(A)}}}else{if(A){B=Ext.urlEncode(A)}}return B},createCallback:function(A){var A=A||{};return{success:this.success,failure:this.failure,scope:this,timeout:(A.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(B,A){Ext.form.Action.Submit.superclass.constructor.call(this,B,A)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var B=this.options;var C=this.getMethod();var A=C=="GET";if(B.clientValidation===false||this.form.isValid()){Ext.Ajax.request(Ext.apply(this.createCallback(B),{form:this.form.el.dom,url:this.getUrl(A),method:C,headers:B.headers,params:!A?this.getParams():null,isUpload:this.form.fileUpload}))}else{if(B.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(B){var A=this.processResponse(B);if(A===true||A.success){this.form.afterAction(this,true);return }if(A.errors){this.form.markInvalid(A.errors);this.failureType=Ext.form.Action.SERVER_INVALID}this.form.afterAction(this,false)},handleResponse:function(C){if(this.form.errorReader){var B=this.form.errorReader.read(C);var F=[];if(B.records){for(var D=0,A=B.records.length;D<A;D++){var E=B.records[D];F[D]=E.data}}if(F.length<1){F=null}return{success:B.success,errors:F}}return Ext.decode(C.responseText)}});Ext.form.Action.Load=function(B,A){Ext.form.Action.Load.superclass.constructor.call(this,B,A);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(B){var A=this.processResponse(B);if(A===true||!A.success||!A.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return }this.form.clearInvalid();this.form.setValues(A.data);this.form.afterAction(this,true)},handleResponse:function(B){if(this.form.reader){var A=this.form.reader.read(B);var C=A.records&&A.records[0]?A.records[0].data:null;return{success:A.success,data:C}}return Ext.decode(B.responseText)}});Ext.form.Action.ACTION_TYPES={"load":Ext.form.Action.Load,"submit":Ext.form.Action.Submit};
+Ext.form.VTypes=function(){var C=/^[a-zA-Z_]+$/;var D=/^[a-zA-Z0-9_]+$/;var B=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;var A=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{"email":function(E){return B.test(E)},"emailText":"This field should be an e-mail address in the format \"user@domain.com\"","emailMask":/[a-z0-9_\.\-@]/i,"url":function(E){return A.test(E)},"urlText":"This field should be a URL in the format \"http:/"+"/www.domain.com\"","alpha":function(E){return C.test(E)},"alphaText":"This field should only contain letters and _","alphaMask":/[a-z_]/i,"alphanum":function(E){return D.test(E)},"alphanumText":"This field should only contain letters, numbers and _","alphanumMask":/[a-z0-9_]/i}}();
+Ext.grid.GridPanel=Ext.extend(Ext.Panel,{ddText:"{0} selected row{1}",minColumnWidth:25,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableHdMenu:true,stripeRows:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,deferRowRender:true,rendered:false,viewReady:false,stateEvents:["columnmove","columnresize","sortchange"],initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","bodyscroll","columnresize","columnmove","sortchange")},onRender:function(C,A){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var D=this.body;this.el.addClass("x-grid-panel");var B=this.getView();B.init(this);D.on("mousedown",this.onMouseDown,this);D.on("click",this.onClick,this);D.on("dblclick",this.onDblClick,this);D.on("contextmenu",this.onContextMenu,this);D.on("keydown",this.onKeyDown,this);this.relayEvents(D,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);this.view.render()},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.colModel.on("hiddenchange",this.saveState,this,{delay:100})},applyState:function(F){var B=this.colModel;var E=F.columns;if(E){for(var C=0,A=E.length;C<A;C++){var D=E[C];var H=B.getColumnById(D.id);if(H){H.hidden=D.hidden;H.width=D.width;var G=B.getIndexById(D.id);if(G!=C){B.moveColumn(G,C)}}}}if(F.sort){this.store[this.store.remoteSort?"setDefaultSort":"sort"](F.sort.field,F.sort.direction)}},getState:function(){var C={columns:[]};for(var B=0,D;D=this.colModel.config[B];B++){C.columns[B]={id:D.id,width:D.width};if(D.hidden){C.columns[B].hidden=true}}var A=this.store.getSortState();if(A){C.sort=A}return C},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);this.view.layout();if(this.deferRowRender){this.view.afterRender.defer(10,this.view)}else{this.view.afterRender()}this.viewReady=true},reconfigure:function(A,B){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:A},this.initialConfig.loadMask))}this.view.bind(A,B);this.store=A;this.colModel=B;if(this.rendered){this.view.refresh(true)}},onKeyDown:function(A){this.fireEvent("keydown",A)},onDestroy:function(){if(this.rendered){if(this.loadMask){this.loadMask.destroy()}var A=this.body;A.removeAllListeners();this.view.destroy();A.update("")}this.colModel.purgeListeners();Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(C,E){this.fireEvent(C,E);var D=E.getTarget();var B=this.view;var G=B.findHeaderIndex(D);if(G!==false){this.fireEvent("header"+C,this,G,E)}else{var F=B.findRowIndex(D);var A=B.findCellIndex(D);if(F!==false){this.fireEvent("row"+C,this,F,E);if(A!==false){this.fireEvent("cell"+C,this,F,A,E)}}}},onClick:function(A){this.processEvent("click",A)},onMouseDown:function(A){this.processEvent("mousedown",A)},onContextMenu:function(B,A){this.processEvent("contextmenu",B)},onDblClick:function(A){this.processEvent("dblclick",A)},walkCells:function(J,C,B,E,I){var H=this.colModel,F=H.getColumnCount();var A=this.store,G=A.getCount(),D=true;if(B<0){if(C<0){J--;D=false}while(J>=0){if(!D){C=F-1}D=false;while(C>=0){if(E.call(I||this,J,C,H)===true){return[J,C]}C--}J--}}else{if(C>=F){J++;D=false}while(J<G){if(!D){C=0}D=false;while(C<F){if(E.call(I||this,J,C,H)===true){return[J,C]}C++}J++}}return null},getSelections:function(){return this.selModel.getSelections()},onResize:function(){Ext.grid.GridPanel.superclass.onResize.apply(this,arguments);if(this.viewReady){this.view.layout()}},getGridEl:function(){return this.body},stopEditing:function(){},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var A=this.selModel.getCount();return String.format(this.ddText,A,A==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);
+Ext.grid.GridView=function(A){Ext.apply(this,A);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)};Ext.extend(Ext.grid.GridView,Ext.util.Observable,{deferEmptyText:true,scrollOffset:19,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",cellSelectorDepth:4,rowSelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",initTemplates:function(){var C=this.templates||{};if(!C.master){C.master=new Ext.Template("<div class=\"x-grid3\" hidefocus=\"true\">","<div class=\"x-grid3-viewport\">","<div class=\"x-grid3-header\"><div class=\"x-grid3-header-inner\"><div class=\"x-grid3-header-offset\">{header}</div></div><div class=\"x-clear\"></div></div>","<div class=\"x-grid3-scroller\"><div class=\"x-grid3-body\">{body}</div><a href=\"#\" class=\"x-grid3-focus\" tabIndex=\"-1\"></a></div>","</div>","<div class=\"x-grid3-resize-marker\">&#160;</div>","<div class=\"x-grid3-resize-proxy\">&#160;</div>","</div>")}if(!C.header){C.header=new Ext.Template("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"{tstyle}\">","<thead><tr class=\"x-grid3-hd-row\">{cells}</tr></thead>","</table>")}if(!C.hcell){C.hcell=new Ext.Template("<td class=\"x-grid3-hd x-grid3-cell x-grid3-td-{id}\" style=\"{style}\"><div {tooltip} {attr} class=\"x-grid3-hd-inner x-grid3-hd-{id}\" unselectable=\"on\" style=\"{istyle}\">",this.grid.enableHdMenu?"<a class=\"x-grid3-hd-btn\" href=\"#\"></a>":"","{value}<img class=\"x-grid3-sort-icon\" src=\"",Ext.BLANK_IMAGE_URL,"\" />","</div></td>")}if(!C.body){C.body=new Ext.Template("{rows}")}if(!C.row){C.row=new Ext.Template("<div class=\"x-grid3-row {alt}\" style=\"{tstyle}\"><table class=\"x-grid3-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"{tstyle}\">","<tbody><tr>{cells}</tr>",(this.enableRowBody?"<tr class=\"x-grid3-row-body-tr\" style=\"{bodyStyle}\"><td colspan=\"{cols}\" class=\"x-grid3-body-cell\" tabIndex=\"0\" hidefocus=\"on\"><div class=\"x-grid3-row-body\">{body}</div></td></tr>":""),"</tbody></table></div>")}if(!C.cell){C.cell=new Ext.Template("<td class=\"x-grid3-col x-grid3-cell x-grid3-td-{id} {css}\" style=\"{style}\" tabIndex=\"0\" {cellAttr}>","<div class=\"x-grid3-cell-inner x-grid3-col-{id}\" unselectable=\"on\" {attr}>{value}</div>","</td>")}for(var A in C){var B=C[A];if(B&&typeof B.compile=="function"&&!B.compiled){B.disableFormats=true;B.compile()}}this.templates=C;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(A){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=A;return this._flyweight},getEditorParent:function(A){return this.scroller.dom},initElements:function(){var C=Ext.Element;var B=this.grid.getGridEl().dom.firstChild;var A=B.childNodes;this.el=new C(B);this.mainWrap=new C(A[0]);this.mainHd=new C(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new C(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new C(this.scroller.dom.firstChild);this.focusEl=new C(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new C(A[1]);this.resizeProxy=new C(A[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(A){if(!A){return false}return this.fly(A).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(C,B){var A=this.findCell(C);if(A&&(!B||this.fly(A).hasClass(B))){return this.getCellIndex(A)}return false},getCellIndex:function(B){if(B){var A=B.className.match(this.colRe);if(A&&A[1]){return this.cm.getIndexById(A[1])}}return false},findHeaderCell:function(B){var A=this.findCell(B);return A&&this.fly(A).hasClass(this.hdCls)?A:null},findHeaderIndex:function(A){return this.findCellIndex(A,this.hdCls)},findRow:function(A){if(!A){return false}return this.fly(A).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(A){var B=this.findRow(A);return B?B.rowIndex:false},getRow:function(A){return this.getRows()[A]},getCell:function(B,A){return this.getRow(B).getElementsByTagName("td")[A]},getHeaderCell:function(A){return this.mainHd.dom.getElementsByTagName("td")[A]},addRowClass:function(C,A){var B=this.getRow(C);if(B){this.fly(B).addClass(A)}},removeRowClass:function(C,A){var B=this.getRow(C);if(B){this.fly(B).removeClass(A)}},removeRow:function(A){Ext.removeNode(this.getRow(A));this.focusRow(A)},removeRows:function(C,A){var B=this.mainBody.dom;for(var D=C;D<=A;D++){Ext.removeNode(B.childNodes[C])}this.focusRow(C)},getScrollState:function(){var A=this.scroller.dom;return{left:A.scrollLeft,top:A.scrollTop}},restoreScroll:function(A){var B=this.scroller.dom;B.scrollLeft=A.left;B.scrollTop=A.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var A=this.scroller.dom;this.grid.fireEvent("bodyscroll",A.scrollLeft,A.scrollTop)},syncHeaderScroll:function(){var A=this.scroller.dom;this.innerHd.scrollLeft=A.scrollLeft;this.innerHd.scrollLeft=A.scrollLeft},updateSortIcon:function(B,A){var D=this.sortClasses;var C=this.mainHd.select("td").removeClass(D);C.item(B).addClass(D[A=="DESC"?1:0])},updateAllColumnWidths:function(){var D=this.getTotalWidth();var H=this.cm.getColumnCount();var F=[];for(var B=0;B<H;B++){F[B]=this.getColumnWidth(B)}this.innerHd.firstChild.firstChild.style.width=D;for(var B=0;B<H;B++){var C=this.getHeaderCell(B);C.style.width=F[B]}var G=this.getRows();for(var B=0,E=G.length;B<E;B++){G[B].style.width=D;G[B].firstChild.style.width=D;var I=G[B].firstChild.rows[0];for(var A=0;A<H;A++){I.childNodes[A].style.width=F[A]}}this.onAllColumnWidthsUpdated(F,D)},updateColumnWidth:function(D,G){var B=this.getColumnWidth(D);var C=this.getTotalWidth();this.innerHd.firstChild.firstChild.style.width=C;var H=this.getHeaderCell(D);H.style.width=B;var F=this.getRows();for(var E=0,A=F.length;E<A;E++){F[E].style.width=C;F[E].firstChild.style.width=C;F[E].firstChild.rows[0].childNodes[D].style.width=B}this.onColumnWidthUpdated(D,B,C)},updateColumnHidden:function(C,F){var B=this.getTotalWidth();this.innerHd.firstChild.firstChild.style.width=B;var H=F?"none":"";var G=this.getHeaderCell(C);G.style.display=H;var E=this.getRows();for(var D=0,A=E.length;D<A;D++){E[D].style.width=B;E[D].firstChild.style.width=B;E[D].firstChild.rows[0].childNodes[C].style.display=H}this.onColumnHiddenUpdated(C,F,B);delete this.lastViewWidth;this.layout()},doRender:function(E,G,M,A,L,Q){var B=this.templates,D=B.cell,F=B.row,H=L-1;var C="width:"+this.getTotalWidth()+";";var T=[],N,U,O={},I={tstyle:C},K;for(var P=0,S=G.length;P<S;P++){K=G[P];N=[];var J=(P+A);for(var R=0;R<L;R++){U=E[R];O.id=U.id;O.css=R==0?"x-grid3-cell-first ":(R==H?"x-grid3-cell-last ":"");O.attr=O.cellAttr="";O.value=U.renderer(K.data[U.name],O,K,J,R,M);O.style=U.style;if(O.value==undefined||O.value===""){O.value="&#160;"}if(K.dirty&&typeof K.modified[U.name]!=="undefined"){O.css+=" x-grid3-dirty-cell"}N[N.length]=D.apply(O)}var V=[];if(Q&&((J+1)%2==0)){V[0]="x-grid3-row-alt"}if(K.dirty){V[1]=" x-grid3-dirty-row"}I.cols=L;if(this.getRowClass){V[2]=this.getRowClass(K,J,I,M)}I.alt=V.join(" ");I.cells=N.join("");T[T.length]=F.apply(I)}return T.join("")},processRows:function(E,D){if(this.ds.getCount()<1){return }D=D||!this.grid.stripeRows;E=E||0;var I=this.getRows();var F=" x-grid3-row-alt ";for(var B=E,C=I.length;B<C;B++){var H=I[B];H.rowIndex=B;if(!D){var A=((B+1)%2==0);var G=(" "+H.className+" ").indexOf(F)!=-1;if(A==G){continue}if(A){H.className+=" x-grid3-row-alt"}else{H.className=H.className.replace("x-grid3-row-alt","")}}}},afterRender:function(){this.mainBody.dom.innerHTML=this.renderRows();this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}},renderUI:function(){var D=this.renderHeaders();var A=this.templates.body.apply({rows:""});var B=this.templates.master.apply({body:A,header:D});var C=this.grid;C.getGridEl().dom.innerHTML=B;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on("mouseover",this.handleHdOver,this);this.mainHd.on("mouseout",this.handleHdOut,this);this.mainHd.on("mousemove",this.handleHdMove,this);this.scroller.on("scroll",this.syncScroll,this);if(C.enableColumnResize!==false){this.splitone=new Ext.grid.GridView.SplitDragZone(C,this.mainHd.dom)}if(C.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(C,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(C,this.mainHd.dom)}if(C.enableHdMenu!==false){if(C.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:C.id+"-hcols-menu"});this.colMenu.on("beforeshow",this.beforeColMenuShow,this);this.colMenu.on("itemclick",this.handleHdMenuClick,this)}this.hmenu=new Ext.menu.Menu({id:C.id+"-hctx"});this.hmenu.add({id:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{id:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(C.enableColumnHide!==false){this.hmenu.add("-",{id:"columns",text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(C.enableDragDrop||C.enableDrag){this.dragZone=new Ext.grid.GridDragZone(C,{ddGroup:C.ddGroup||"GridDD"})}this.updateHeaderSortState()},layout:function(){if(!this.mainBody){return }var C=this.grid;var F=C.getGridEl();var A=F.getSize(true);var B=A.width;if(B<20||A.height<20){return }if(C.autoHeight){this.scroller.dom.style.overflow="visible"}else{this.el.setSize(A.width,A.height);var E=this.mainHd.getHeight();var D=A.height-(E);this.scroller.setSize(B,D);if(this.innerHd){this.innerHd.style.width=(B)+"px"}}if(this.forceFit){if(this.lastViewWidth!=B){this.fitColumns(false,false);this.lastViewWidth=B}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(B,D)},onLayout:function(A,B){},onColumnWidthUpdated:function(C,A,B){},onAllColumnWidthsUpdated:function(A,B){},onColumnHiddenUpdated:function(B,C,A){},updateColumnText:function(A,B){},afterMove:function(A){},init:function(A){this.grid=A;this.initTemplates();this.initData(A.store,A.colModel);this.initUI(A)},getColumnId:function(A){return this.cm.getColumnId(A)},renderHeaders:function(){var C=this.cm,F=this.templates;var E=F.hcell;var B=[],H=[],G={};for(var D=0,A=C.getColumnCount();D<A;D++){G.id=C.getColumnId(D);G.value=C.getColumnHeader(D)||"";G.style=this.getColumnStyle(D,true);G.tooltip=this.getColumnTooltip(D);if(C.config[D].align=="right"){G.istyle="padding-right:16px"}else{delete G.istyle}B[B.length]=E.apply(G)}return F.header.apply({cells:B.join(""),tstyle:"width:"+this.getTotalWidth()+";"})},getColumnTooltip:function(A){var B=this.cm.getColumnTooltip(A);if(B){if(Ext.QuickTips.isEnabled()){return"ext:qtip=\""+B+"\""}else{return"title=\""+B+"\""}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders()},focusRow:function(A){this.focusCell(A,0,false)},focusCell:function(D,A,C){D=Math.min(D,Math.max(0,this.getRows().length-1));var B=this.ensureVisible(D,A,C);this.focusEl.setXY(B||this.scroller.getXY());if(Ext.isGecko){this.focusEl.focus()}else{this.focusEl.focus.defer(1,this.focusEl)}},ensureVisible:function(P,E,D){if(typeof P!="number"){P=P.rowIndex}if(!this.ds){return }if(P<0||P>=this.ds.getCount()){return }E=(E!==undefined?E:0);var I=this.getRow(P),F;if(!(D===false&&E===0)){while(this.cm.isHidden(E)){E++}F=this.getCell(P,E)}if(!I){return }var L=this.scroller.dom;var O=0;var C=I,M=this.el.dom;while(C&&C!=M){O+=C.offsetTop;C=C.offsetParent}O-=this.mainHd.dom.offsetHeight;var N=O+I.offsetHeight;var A=L.clientHeight;var M=parseInt(L.scrollTop,10);var K=M+A;if(O<M){L.scrollTop=O}else{if(N>K){L.scrollTop=N-A}}if(D!==false){var J=parseInt(F.offsetLeft,10);var H=J+F.offsetWidth;var G=parseInt(L.scrollLeft,10);var B=G+L.clientWidth;if(J<G){L.scrollLeft=J}else{if(H>B){L.scrollLeft=H-L.clientWidth}}}return F?Ext.fly(F).getXY():[L.scrollLeft+this.el.getX(),Ext.fly(I).getY()]},insertRows:function(A,F,C,E){if(!E&&F===0&&C>=A.getCount()-1){this.refresh()}else{if(!E){this.fireEvent("beforerowsinserted",this,F,C)}var B=this.renderRows(F,C);var D=this.getRow(F);if(D){Ext.DomHelper.insertHtml("beforeBegin",D,B)}else{Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,B)}if(!E){this.fireEvent("rowsinserted",this,F,C);this.processRows(F)}}this.focusRow(F)},deleteRows:function(A,C,B){if(A.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,C,B);this.removeRows(C,B);this.processRows(C);this.fireEvent("rowsdeleted",this,C,B)}},getColumnStyle:function(A,C){var B=!C?(this.cm.config[A].css||""):"";B+="width:"+this.getColumnWidth(A)+";";if(this.cm.isHidden(A)){B+="display:none;"}var D=this.cm.config[A].align;if(D){B+="text-align:"+D+";"}return B},getColumnWidth:function(B){var A=this.cm.getColumnWidth(B);if(typeof A=="number"){return(Ext.isBorderBox?A:(A-this.borderWidth>0?A-this.borderWidth:0))+"px"}return A},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(D,G,E){var F=this.cm,S,L,O;var R=F.getTotalWidth(false);var J=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(J<20){return }var B=J-R;if(B===0){return false}var A=F.getColumnCount(true);var P=A-(typeof E=="number"?1:0);if(P===0){P=1;E=undefined}var K=F.getColumnCount();var I=[];var N=0;var M=0;var H;for(O=0;O<K;O++){if(!F.isHidden(O)&&!F.isFixed(O)&&O!==E){H=F.getColumnWidth(O);I.push(O);N=O;I.push(H);M+=H}}var C=(J-F.getTotalWidth())/M;while(I.length){H=I.pop();O=I.pop();F.setColumnWidth(O,Math.max(this.grid.minColumnWidth,Math.floor(H+H*C)),true)}if((R=F.getTotalWidth(false))>J){var Q=P!=A?E:N;F.setColumnWidth(Q,Math.max(1,F.getColumnWidth(Q)-(R-J)),true)}if(D!==true){this.updateAllColumnWidths()}return true},autoExpand:function(B){var G=this.grid,A=this.cm;if(!this.userResized&&G.autoExpandColumn){var D=A.getTotalWidth(false);var H=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(D!=H){var F=A.getIndexById(G.autoExpandColumn);var E=A.getColumnWidth(F);var C=Math.min(Math.max(((H-D)+E),G.autoExpandMin),G.autoExpandMax);if(C!=E){A.setColumnWidth(F,C,true);if(B!==true){this.updateColumnWidth(F,C)}}}}},getColumnData:function(){var D=[],A=this.cm,E=A.getColumnCount();for(var C=0;C<E;C++){var B=A.getDataIndex(C);D[C]={name:(typeof B=="undefined"?this.ds.fields.get(C).name:B),renderer:A.getRenderer(C),id:A.getColumnId(C),style:this.getColumnStyle(C)}}return D},renderRows:function(H,C){var D=this.grid,F=D.colModel,A=D.store,I=D.stripeRows;var G=F.getColumnCount();if(A.getCount()<1){return""}var E=this.getColumnData();H=H||0;C=typeof C=="undefined"?A.getCount()-1:C;var B=A.getRange(H,C);return this.doRender(E,B,A,H,G,I)},renderBody:function(){var A=this.renderRows();return this.templates.body.apply({rows:A})},refreshRow:function(B){var D=this.ds,C;if(typeof B=="number"){C=B;B=D.getAt(C)}else{C=D.indexOf(B)}var A=[];this.insertRows(D,C,C,true);this.getRow(C).rowIndex=C;this.onRemove(D,B,C+1,true);this.fireEvent("rowupdated",this,C,B)},refresh:function(B){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var A=this.renderBody();this.mainBody.update(A);if(B===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update("<div class=\"x-grid-empty\">"+this.emptyText+"</div>")}},updateHeaderSortState:function(){var B=this.ds.getSortState();if(!B){return }if(!this.sortState||(this.sortState.field!=B.field||this.sortState.direction!=B.direction)){this.grid.fireEvent("sortchange",this.grid,B)}this.sortState=B;var C=this.cm.findColumnIndex(B.field);if(C!=-1){var A=B.direction;this.updateSortIcon(C,A)}},destroy:function(){if(this.colMenu){this.colMenu.removeAll();Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.getEl().remove();delete this.colMenu}if(this.hmenu){this.hmenu.removeAll();Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.getEl().remove();delete this.hmenu}if(this.grid.enableColumnMove){var C=Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id];if(C){for(var A in C){if(!C[A].config.isTarget&&C[A].dragElId){var B=C[A].dragElId;C[A].unreg();Ext.get(B).remove()}else{if(C[A].config.isTarget){C[A].proxyTop.remove();C[A].proxyBottom.remove();C[A].unreg()}}if(Ext.dd.DDM.locationCache[A]){delete Ext.dd.DDM.locationCache[A]}}delete Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id]}}Ext.destroy(this.resizeMarker,this.resizeProxy);if(this.dragZone){this.dragZone.unreg()}this.initData(null,null);Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){this.fitColumns(true,true)}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(B,A){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this)}if(B){B.on("load",this.onLoad,this);B.on("datachanged",this.onDataChange,this);B.on("add",this.onAdd,this);B.on("remove",this.onRemove,this);B.on("update",this.onUpdate,this);B.on("clear",this.onClear,this)}this.ds=B;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this);this.cm.un("columnlockchange",this.onColumnLock,this)}if(A){delete this.lastViewWidth;A.on("configchange",this.onColConfigChange,this);A.on("widthchange",this.onColWidthChange,this);A.on("headerchange",this.onHeaderChange,this);A.on("hiddenchange",this.onHiddenChange,this);A.on("columnmoved",this.onColumnMove,this);A.on("columnlockchange",this.onColumnLock,this)}this.cm=A},onDataChange:function(){this.refresh();this.updateHeaderSortState()},onClear:function(){this.refresh()},onUpdate:function(B,A){this.refreshRow(A)},onAdd:function(C,A,B){this.insertRows(C,B,B+(A.length-1))},onRemove:function(D,A,B,C){if(C!==true){this.fireEvent("beforerowremoved",this,B,A)}this.removeRow(B);if(C!==true){this.processRows(B);this.applyEmptyText();this.fireEvent("rowremoved",this,B,A)}},onLoad:function(){this.scrollToTop()},onColWidthChange:function(A,B,C){this.updateColumnWidth(B,C)},onHeaderChange:function(A,B,C){this.updateHeaders()},onHiddenChange:function(A,B,C){this.updateColumnHidden(B,C)},onColumnMove:function(A,D,B){this.indexMap=null;var C=this.getScrollState();this.refresh(true);this.restoreScroll(C);this.afterMove(B)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(A){A.on("headerclick",this.onHeaderClick,this);if(A.trackMouseOver){A.on("mouseover",this.onRowOver,this);A.on("mouseout",this.onRowOut,this)}},initEvents:function(){},onHeaderClick:function(B,A){if(this.headersDisabled||!this.cm.isSortable(A)){return }B.stopEditing(true);B.store.sort(this.cm.getDataIndex(A))},onRowOver:function(B,A){var C;if((C=this.findRowIndex(A))!==false){this.addRowClass(C,"x-grid3-row-over")}},onRowOut:function(B,A){var C;if((C=this.findRowIndex(A))!==false&&C!==this.findRowIndex(B.getRelatedTarget())){this.removeRowClass(C,"x-grid3-row-over")}},handleWheel:function(A){A.stopPropagation()},onRowSelect:function(A){this.addRowClass(A,"x-grid3-row-selected")},onRowDeselect:function(A){this.removeRowClass(A,"x-grid3-row-selected")},onCellSelect:function(C,B){var A=this.getCell(C,B);if(A){this.fly(A).addClass("x-grid3-cell-selected")}},onCellDeselect:function(C,B){var A=this.getCell(C,B);if(A){this.fly(A).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(C,B){this.userResized=true;var A=this.grid.colModel;A.setColumnWidth(C,B,true);if(this.forceFit){this.fitColumns(true,false,C);this.updateAllColumnWidths()}else{this.updateColumnWidth(C,B)}this.grid.fireEvent("columnresize",C,B)},handleHdMenuClick:function(C){var B=this.hdCtxIndex;var A=this.cm,D=this.ds;switch(C.id){case"asc":D.sort(A.getDataIndex(B),"ASC");break;case"desc":D.sort(A.getDataIndex(B),"DESC");break;default:B=A.getIndexById(C.id.substr(4));if(B!=-1){if(C.checked&&A.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}A.setHidden(B,C.checked)}}return true},isHideableColumn:function(A){return !A.hidden&&!A.fixed},beforeColMenuShow:function(){var A=this.cm,C=A.getColumnCount();this.colMenu.removeAll();for(var B=0;B<C;B++){if(A.config[B].fixed!==true&&A.config[B].hideable!==false){this.colMenu.add(new Ext.menu.CheckItem({id:"col-"+A.getColumnId(B),text:A.getColumnHeader(B),checked:!A.isHidden(B),hideOnClick:false,disabled:A.config[B].hideable===false}))}}},handleHdDown:function(F,D){if(Ext.fly(D).hasClass("x-grid3-hd-btn")){F.stopEvent();var E=this.findHeaderCell(D);Ext.fly(E).addClass("x-grid3-hd-menu-open");var C=this.getCellIndex(E);this.hdCtxIndex=C;var B=this.hmenu.items,A=this.cm;B.get("asc").setDisabled(!A.isSortable(C));B.get("desc").setDisabled(!A.isSortable(C));this.hmenu.on("hide",function(){Ext.fly(E).removeClass("x-grid3-hd-menu-open")},this,{single:true});this.hmenu.show(D,"tl-bl?")}},handleHdOver:function(D,A){var C=this.findHeaderCell(A);if(C&&!this.headersDisabled){this.activeHd=C;this.activeHdIndex=this.getCellIndex(C);var B=this.fly(C);this.activeHdRegion=B.getRegion();if(!this.cm.isMenuDisabled(this.activeHdIndex)){B.addClass("x-grid3-hd-over");this.activeHdBtn=B.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(C.firstChild.offsetHeight-1)+"px"}}}},handleHdMove:function(F,D){if(this.activeHd&&!this.headersDisabled){var B=this.splitHandleWidth||5;var E=this.activeHdRegion;var A=F.getPageX();var C=this.activeHd.style;if(A-E.left<=B&&this.cm.isResizable(this.activeHdIndex-1)){C.cursor=Ext.isAir?"move":Ext.isSafari?"e-resize":"col-resize"}else{if(E.right-A<=(!this.activeHdBtn?B:2)&&this.cm.isResizable(this.activeHdIndex)){C.cursor=Ext.isAir?"move":Ext.isSafari?"w-resize":"col-resize"}else{C.cursor=""}}}},handleHdOut:function(C,A){var B=this.findHeaderCell(A);if(B&&(!Ext.isIE||!C.within(B,true))){this.activeHd=null;this.fly(B).removeClass("x-grid3-hd-over");B.style.cursor=""}},hasRows:function(){var A=this.mainBody.dom.firstChild;return A&&A.className!="x-grid-empty"},bind:function(A,B){this.initData(A,B)}});Ext.grid.GridView.SplitDragZone=function(A,B){this.grid=A;this.view=A.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,B,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5};Ext.extend(Ext.grid.GridView.SplitDragZone,Ext.dd.DDProxy,{b4StartDrag:function(A,E){this.view.headersDisabled=true;var D=this.view.mainWrap.getHeight();this.marker.setHeight(D);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(D);var B=this.cm.getColumnWidth(this.cellIndex);var C=Math.max(B-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(C,1000);this.setYConstraint(0,0);this.minX=A-C;this.maxX=A+1000;this.startPos=A;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,A,E)},handleMouseDown:function(A){var H=this.view.findHeaderCell(A.getTarget());if(H){var K=this.view.fly(H).getXY(),E=K[0],D=K[1];var I=A.getXY(),C=I[0],B=I[1];var G=H.offsetWidth,F=false;if((C-E)<=this.hw){F=-1}else{if((E+G)-C<=this.hw){F=0}}if(F!==false){this.cm=this.grid.colModel;var J=this.view.getCellIndex(H);if(F==-1){if(J+F<0){return }while(this.cm.isHidden(J+F)){--F;if(J+F<0){return }}}this.cellIndex=J+F;this.split=H.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(A)}}}},endDrag:function(D){this.marker.hide();var A=this.view;var B=Math.max(this.minX,D.getPageX());var C=B-this.startPos;A.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+C);setTimeout(function(){A.headersDisabled=false},50)},autoOffset:function(){this.setDelta(0,0)}});
+Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",gidSeed:1000,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var A=this.grid.getSelectionModel();A.on(A.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate("<div id=\"{groupId}\" class=\"x-grid-group {cls}\">","<div id=\"{groupId}-hd\" class=\"x-grid-group-hd\" style=\"{style}\"><div>",this.groupTextTpl,"</div></div>","<div id=\"{groupId}-bd\" class=\"x-grid-group-body\">")}this.startGroup.compile();this.endGroup="</div></div>"},findGroup:function(A){return Ext.fly(A).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(){if(this.enableGrouping&&!this.ignoreAdd){var A=this.getScrollState();this.refresh();this.restoreScroll(A)}else{if(!this.enableGrouping){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(E,A,B,D){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var C=document.getElementById(A._groupId);if(C&&C.childNodes[1].childNodes.length<1){Ext.removeNode(C)}this.applyEmptyText()},refreshRow:function(A){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var C=this.getGroupField();var B=this.hmenu.items.get("groupBy");if(B){B.setDisabled(this.cm.config[this.hdCtxIndex].groupable===false)}var A=this.hmenu.items.get("showGroups");if(A){A.setDisabled(!C&&this.cm.config[this.hdCtxIndex].groupable===false);A.setChecked(!!C,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{id:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({id:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},onGroupByClick:function(){this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.beforeMenuShow()},onShowGroupsClick:function(A,B){if(B){this.onGroupByClick()}else{this.grid.store.clearGrouping()}},toggleGroup:function(C,B){this.grid.stopEditing(true);C=Ext.getDom(C);var A=Ext.fly(C);B=B!==undefined?B:A.hasClass("x-grid-group-collapsed");this.state[A.dom.id]=B;A[B?"removeClass":"addClass"]("x-grid-group-collapsed")},toggleAllGroups:function(C){var B=this.getGroups();for(var D=0,A=B.length;D<A;D++){this.toggleGroup(B[D],C)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},interceptMouse:function(B){var A=B.getTarget(".x-grid-group-hd",this.mainBody);if(A){B.stopEvent();this.toggleGroup(A.parentNode)}},getGroup:function(A,D,F,G,B,E){var C=F?F(A,{},D,G,B,E):String(A);if(C===""){C=this.cm.config[B].emptyGroupText||this.emptyGroupText}return C},getGroupField:function(){return this.grid.store.getGroupState()},renderRows:function(){var A=this.getGroupField();var D=!!A;if(this.hideGroupedColumn){var B=this.cm.findColumnIndex(A);if(!D&&this.lastGroupField!==undefined){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(D&&this.lastGroupField===undefined){this.lastGroupField=A;this.cm.setHidden(B,true)}else{if(D&&this.lastGroupField!==undefined&&A!==this.lastGroupField){this.mainBody.update("");var C=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(C,false);this.lastGroupField=A;this.cm.setHidden(B,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(D,G,P,A,O,R){if(G.length<1){return""}var Y=this.getGroupField();var N=this.cm.findColumnIndex(Y);this.enableGrouping=!!Y;if(!this.enableGrouping||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var H="width:"+this.getTotalWidth()+";";var Q=this.grid.getGridEl().id;var F=this.cm.config[N];var B=F.groupRenderer||F.renderer;var S=this.showGroupName?(F.groupName||F.header)+": ":"";var X=[],K,T,U,M;for(T=0,U=G.length;T<U;T++){var J=A+T;var L=G[T],E=L.data[Y],V=this.getGroup(E,L,B,J,N,P);if(!K||K.group!=V){M=Q+"-gp-"+Y+"-"+Ext.util.Format.htmlEncode(V);var C=typeof this.state[M]!=="undefined"?!this.state[M]:this.startCollapsed;var I=C?"x-grid-group-collapsed":"";K={group:V,gvalue:E,text:S+V,groupId:M,startRow:J,rs:[L],cls:I,style:H};X.push(K)}else{K.rs.push(L)}L._groupId=M}var W=[];for(T=0,U=X.length;T<U;T++){var V=X[T];this.doGroupStart(W,V,D,P,O);W[W.length]=Ext.grid.GroupingView.superclass.doRender.call(this,D,V.rs,P,V.startRow,O,R);this.doGroupEnd(W,V,D,P,O)}return W.join("")},getGroupId:function(F){var D=this.grid.getGridEl().id;var C=this.getGroupField();var E=this.cm.findColumnIndex(C);var B=this.cm.config[E];var G=B.groupRenderer||B.renderer;var A=this.getGroup(F,{data:{}},G,0,E,this.ds);return D+"-gp-"+C+"-"+Ext.util.Format.htmlEncode(F)},doGroupStart:function(A,D,B,E,C){A[A.length]=this.startGroup.apply(D)},doGroupEnd:function(A,D,B,E,C){A[A.length]=this.endGroup},getRows:function(){if(!this.enableGrouping){return Ext.grid.GroupingView.superclass.getRows.call(this)}var G=[];var F,C=this.getGroups();for(var E=0,A=C.length;E<A;E++){F=C[E].childNodes[1].childNodes;for(var D=0,B=F.length;D<B;D++){G[G.length]=F[D]}}return G},updateGroupWidths:function(){if(!this.enableGrouping||!this.hasRows()){return }var C=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.scrollOffset)+"px";var B=this.getGroups();for(var D=0,A=B.length;D<A;D++){B[D].firstChild.style.width=C}},onColumnWidthUpdated:function(C,A,B){this.updateGroupWidths()},onAllColumnWidthsUpdated:function(A,B){this.updateGroupWidths()},onColumnHiddenUpdated:function(B,C,A){this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(D,C){if(!this.enableGrouping){return }var B=this.getRow(C);if(B&&!B.offsetParent){var A=this.findGroup(B);this.toggleGroup(A,true)}},groupByText:"Group By This Field",showGroupsText:"Show in Groups"});Ext.grid.GroupingView.GROUP_ID=1000;
+Ext.grid.HeaderDragZone=function(A,C,B){this.grid=A;this.view=A.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,C);if(B){this.setHandleElId(Ext.id(C));this.setOuterHandleElId(Ext.id(B))}this.scroll=false};Ext.extend(Ext.grid.HeaderDragZone,Ext.dd.DragZone,{maxDragWidth:120,getDragData:function(C){var A=Ext.lib.Event.getTarget(C);var B=this.view.findHeaderCell(A);if(B){return{ddel:B.firstChild,header:B}}return false},onInitDrag:function(A){this.view.headersDisabled=true;var B=this.dragData.ddel.cloneNode(true);B.id=Ext.id();B.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(B);return true},afterValidDrop:function(){var A=this.view;setTimeout(function(){A.headersDisabled=false},50)},afterInvalidDrop:function(){var A=this.view;setTimeout(function(){A.headersDisabled=false},50)}});Ext.grid.HeaderDropZone=function(A,C,B){this.grid=A;this.view=A.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,A.getGridEl().dom)};Ext.extend(Ext.grid.HeaderDropZone,Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,getTargetFromEvent:function(C){var A=Ext.lib.Event.getTarget(C);var B=this.view.findCellIndex(A);if(B!==false){return this.view.getHeaderCell(B)}},nextVisible:function(C){var B=this.view,A=this.grid.colModel;C=C.nextSibling;while(C){if(!A.isHidden(B.getCellIndex(C))){return C}C=C.nextSibling}return null},prevVisible:function(C){var B=this.view,A=this.grid.colModel;C=C.prevSibling;while(C){if(!A.isHidden(B.getCellIndex(C))){return C}C=C.prevSibling}return null},positionIndicator:function(D,B,E){var H=Ext.lib.Event.getPageX(E);var A=Ext.lib.Dom.getRegion(B.firstChild);var I,K,G=A.top+this.proxyOffsets[1];if((A.right-H)<=(A.right-A.left)/2){I=A.right+this.view.borderWidth;K="after"}else{I=A.left;K="before"}var F=this.view.getCellIndex(D);var J=this.view.getCellIndex(B);if(this.grid.colModel.isFixed(J)){return false}var C=this.grid.colModel.isLocked(J);if(K=="after"){J++}if(F<J){J--}if(F==J&&(C==this.grid.colModel.isLocked(F))){return false}I+=this.proxyOffsets[0];this.proxyTop.setLeftTop(I,G);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(I,G+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return K},onNodeEnter:function(D,A,C,B){if(B.header!=D){this.positionIndicator(B.header,D,C)}},onNodeOver:function(E,B,D,C){var A=false;if(C.header!=E){A=this.positionIndicator(C.header,E,D)}if(!A){this.proxyTop.hide();this.proxyBottom.hide()}return A?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(D,A,C,B){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(B,K,F,D){var E=D.header;if(E!=B){var I=this.grid.colModel;var H=Ext.lib.Event.getPageX(F);var A=Ext.lib.Dom.getRegion(B.firstChild);var L=(A.right-H)<=((A.right-A.left)/2)?"after":"before";var G=this.view.getCellIndex(E);var J=this.view.getCellIndex(B);var C=I.isLocked(J);if(L=="after"){J++}if(G<J){J--}if(G==J&&(C==I.isLocked(G))){return false}I.setLocked(G,C,true);I.moveColumn(G,J);this.grid.fireEvent("columnmove",G,J);return true}return false}});Ext.grid.GridView.ColumnDragZone=function(A,B){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,A,B,null);this.proxy.el.addClass("x-grid3-col-dd")};Ext.extend(Ext.grid.GridView.ColumnDragZone,Ext.grid.HeaderDragZone,{handleMouseDown:function(A){},callHandleMouseDown:function(A){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,A)}});
+Ext.grid.SplitDragZone=function(A,C,B){this.grid=A;this.view=A.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,C,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(C));this.setOuterHandleElId(Ext.id(B));this.scroll=false};Ext.extend(Ext.grid.SplitDragZone,Ext.dd.DDProxy,{fly:Ext.Element.fly,b4StartDrag:function(A,D){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var B=this.cm.getColumnWidth(this.cellIndex);var C=Math.max(B-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(C,1000);this.setYConstraint(0,0);this.minX=A-C;this.maxX=A+1000;this.startPos=A;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,A,D)},handleMouseDown:function(B){ev=Ext.EventObject.setEvent(B);var A=this.fly(ev.getTarget());if(A.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(A.dom);this.split=A.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(C){this.view.headersDisabled=false;var A=Math.max(this.minX,Ext.lib.Event.getPageX(C));var B=A-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+B)},autoOffset:function(){this.setDelta(0,0)}});
+Ext.grid.GridDragZone=function(B,A){this.view=B.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,A);if(this.view.lockedBody){this.setHandleElId(Ext.id(this.view.mainBody.dom));this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))}this.scroll=false;this.grid=B;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(B){var A=Ext.lib.Event.getTarget(B);var D=this.view.findRowIndex(A);if(D!==false){var C=this.grid.selModel;if(!C.isSelected(D)||B.hasModifier()){C.handleMouseDown(this.grid,D,B)}return{grid:this.grid,ddel:this.ddel,rowIndex:D,selections:C.getSelections()}}return false},onInitDrag:function(B){var A=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(B,A){return false},onEndDrag:function(A,B){},onValidDrop:function(A,B,C){this.hideProxy()},beforeInvalidDrop:function(A,B){}});
+Ext.grid.ColumnModel=function(A){this.defaultWidth=100;this.defaultSortable=false;if(A.columns){Ext.apply(this,A);this.setConfig(A.columns,true)}else{this.setConfig(A,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","columnlockchange","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.ColumnModel,Ext.util.Observable,{getColumnId:function(A){return this.config[A].id},setConfig:function(C,B){if(!B){delete this.totalWidth;for(var D=0,A=this.config.length;D<A;D++){var E=this.config[D];if(E.editor){E.editor.destroy()}}}this.config=C;this.lookup={};for(var D=0,A=C.length;D<A;D++){var E=C[D];if(typeof E.renderer=="string"){E.renderer=Ext.util.Format[E.renderer]}if(typeof E.id=="undefined"){E.id=D}if(E.editor&&E.editor.isFormField){E.editor=new Ext.grid.GridEditor(E.editor)}this.lookup[E.id]=E}if(!B){this.fireEvent("configchange",this)}},getColumnById:function(A){return this.lookup[A]},getIndexById:function(C){for(var B=0,A=this.config.length;B<A;B++){if(this.config[B].id==C){return B}}return -1},moveColumn:function(C,A){var B=this.config[C];this.config.splice(C,1);this.config.splice(A,0,B);this.dataMap=null;this.fireEvent("columnmoved",this,C,A)},isLocked:function(A){return this.config[A].locked===true},setLocked:function(B,C,A){if(this.isLocked(B)==C){return }this.config[B].locked=C;if(!A){this.fireEvent("columnlockchange",this,B,C)}},getTotalLockedWidth:function(){var A=0;for(var B=0;B<this.config.length;B++){if(this.isLocked(B)&&!this.isHidden(B)){this.totalWidth+=this.getColumnWidth(B)}}return A},getLockedCount:function(){for(var B=0,A=this.config.length;B<A;B++){if(!this.isLocked(B)){return B}}},getColumnCount:function(C){if(C===true){var D=0;for(var B=0,A=this.config.length;B<A;B++){if(!this.isHidden(B)){D++}}return D}return this.config.length},getColumnsBy:function(D,C){var E=[];for(var B=0,A=this.config.length;B<A;B++){var F=this.config[B];if(D.call(C||this,F,B)===true){E[E.length]=F}}return E},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable}return this.config[A].sortable},isMenuDisabled:function(A){return !!this.config[A].menuDisabled},getRenderer:function(A){if(!this.config[A].renderer){return Ext.grid.ColumnModel.defaultRenderer}return this.config[A].renderer},setRenderer:function(A,B){this.config[A].renderer=B},getColumnWidth:function(A){return this.config[A].width||this.defaultWidth},setColumnWidth:function(B,C,A){this.config[B].width=C;this.totalWidth=null;if(!A){this.fireEvent("widthchange",this,B,C)}},getTotalWidth:function(B){if(!this.totalWidth){this.totalWidth=0;for(var C=0,A=this.config.length;C<A;C++){if(B||!this.isHidden(C)){this.totalWidth+=this.getColumnWidth(C)}}}return this.totalWidth},getColumnHeader:function(A){return this.config[A].header},setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B)},getColumnTooltip:function(A){return this.config[A].tooltip},setColumnTooltip:function(A,B){this.config[A].tooltip=B},getDataIndex:function(A){return this.config[A].dataIndex},setDataIndex:function(A,B){this.config[A].dataIndex=B},findColumnIndex:function(C){var D=this.config;for(var B=0,A=D.length;B<A;B++){if(D[B].dataIndex==C){return B}}return -1},isCellEditable:function(A,B){return(this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false},getCellEditor:function(A,B){return this.config[A].editor},setEditable:function(A,B){this.config[A].editable=B},isHidden:function(A){return this.config[A].hidden},isFixed:function(A){return this.config[A].fixed},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true},setHidden:function(A,B){var C=this.config[A];if(C.hidden!==B){C.hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B)}},setEditor:function(A,B){this.config[A].editor=B}});Ext.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="string"&&A.length<1){return"&#160;"}return A};Ext.grid.DefaultColumnModel=Ext.grid.ColumnModel;
+Ext.grid.AbstractSelectionModel=function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.AbstractSelectionModel,Ext.util.Observable,{init:function(A){this.grid=A;this.initEvents()},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked}});
+Ext.grid.RowSelectionModel=function(A){Ext.apply(this,A);this.selections=new Ext.util.MixedCollection(false,function(B){return B.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("rowmousedown",this.handleMouseDown,this)}else{this.grid.on("rowclick",function(B,D,C){if(C.button===0&&!C.shiftKey&&!C.ctrlKey){this.selectRow(D,false);B.view.focusRow(D)}},this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{"up":function(C){if(!C.shiftKey){this.selectPrevious(C.shiftKey)}else{if(this.last!==false&&this.lastActive!==false){var B=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(B!==false){this.last=B}}else{this.selectFirstRow()}}},"down":function(C){if(!C.shiftKey){this.selectNext(C.shiftKey)}else{if(this.last!==false&&this.lastActive!==false){var B=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(B!==false){this.last=B}}else{this.selectFirstRow()}}},scope:this});var A=this.grid.view;A.on("refresh",this.onRefresh,this);A.on("rowupdated",this.onRowUpdated,this);A.on("rowremoved",this.onRemove,this)},onRefresh:function(){var F=this.grid.store,B;var D=this.getSelections();this.clearSelections(true);for(var C=0,A=D.length;C<A;C++){var E=D[C];if((B=F.indexOfId(E.id))!=-1){this.selectRow(B,true)}}if(D.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}},onRemove:function(A,B,C){if(this.selections.remove(C)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(A,B,C){if(this.isSelected(C)){A.onRowSelect(B)}},selectRecords:function(B,E){if(!E){this.clearSelections()}var D=this.grid.store;for(var C=0,A=B.length;C<A;C++){this.selectRow(D.indexOf(B[C]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(A){this.selectRow(this.grid.store.getCount()-1,A)},selectNext:function(A){if(this.hasNext()){this.selectRow(this.last+1,A);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(A){if(this.hasPrevious()){this.selectRow(this.last-1,A);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(E,D){var C=this.getSelections();for(var B=0,A=C.length;B<A;B++){if(E.call(D||this,C[B],B)===false){return false}}return true},clearSelections:function(A){if(this.locked){return }if(A!==true){var C=this.grid.store;var B=this.selections;B.each(function(D){this.deselectRow(C.indexOfId(D.id))},this);B.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.locked){return }this.selections.clear();for(var B=0,A=this.grid.store.getCount();B<A;B++){this.selectRow(B,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(A){var B=typeof A=="number"?this.grid.store.getAt(A):A;return(B&&this.selections.key(B.id)?true:false)},isIdSelected:function(A){return(this.selections.key(A)?true:false)},handleMouseDown:function(D,F,E){if(E.button!==0||this.isLocked()){return }var A=this.grid.getView();if(E.shiftKey&&this.last!==false){var C=this.last;this.selectRange(C,F,E.ctrlKey);this.last=C;A.focusRow(F)}else{var B=this.isSelected(F);if(E.ctrlKey&&B){this.deselectRow(F)}else{if(!B||this.getCount()>1){this.selectRow(F,E.ctrlKey||E.shiftKey);A.focusRow(F)}}}},selectRows:function(C,D){if(!D){this.clearSelections()}for(var B=0,A=C.length;B<A;B++){this.selectRow(C[B],true)}},selectRange:function(B,A,D){if(this.locked){return }if(!D){this.clearSelections()}if(B<=A){for(var C=B;C<=A;C++){this.selectRow(C,true)}}else{for(var C=B;C>=A;C--){this.selectRow(C,true)}}},deselectRange:function(C,B,A){if(this.locked){return }for(var D=C;D<=B;D++){this.deselectRow(D,A)}},selectRow:function(B,D,A){if(this.locked||(B<0||B>=this.grid.store.getCount())||this.isSelected(B)){return }var C=this.grid.store.getAt(B);if(C&&this.fireEvent("beforerowselect",this,B,D,C)!==false){if(!D||this.singleSelect){this.clearSelections()}this.selections.add(C);this.last=this.lastActive=B;if(!A){this.grid.getView().onRowSelect(B)}this.fireEvent("rowselect",this,B,C);this.fireEvent("selectionchange",this)}},deselectRow:function(B,A){if(this.locked){return }if(this.last==B){this.last=false}if(this.lastActive==B){this.lastActive=false}var C=this.grid.store.getAt(B);if(C){this.selections.remove(C);if(!A){this.grid.getView().onRowDeselect(B)}this.fireEvent("rowdeselect",this,B,C);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(C,B,A){return !A.isHidden(B)&&A.isCellEditable(B,C)},onEditorKey:function(F,E){var C=E.getKey(),G,D=this.grid,B=D.activeEditor;var A=E.shiftKey;if(C==E.TAB){E.stopEvent();B.completeEdit();if(A){G=D.walkCells(B.row,B.col-1,-1,this.acceptsNav,this)}else{G=D.walkCells(B.row,B.col+1,1,this.acceptsNav,this)}}else{if(C==E.ENTER){E.stopEvent();B.completeEdit();if(this.moveEditorOnEnter!==false){if(A){G=D.walkCells(B.row-1,B.col,-1,this.acceptsNav,this)}else{G=D.walkCells(B.row+1,B.col,1,this.acceptsNav,this)}}}else{if(C==E.ESC){B.cancelEdit()}}}if(G){D.startEditing(G[0],G[1])}}});
+Ext.grid.CellSelectionModel=function(A){Ext.apply(this,A);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.CellSelectionModel,Ext.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.getGridEl().on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.handleKeyDown,this);var A=this.grid.view;A.on("refresh",this.onViewChange,this);A.on("rowupdated",this.onRowUpdated,this);A.on("beforerowremoved",this.clearSelections,this);A.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(A){this.select(A.row,A.column,false,true,A.record)},onRowUpdated:function(A,B,C){if(this.selection&&this.selection.record==C){A.onCellSelect(B,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(B){var A=this.selection;if(A){if(B!==true){this.grid.view.onCellDeselect(A.cell[0],A.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(B,D,A,C){if(C.button!==0||this.isLocked()){return }this.select(D,A)},select:function(F,C,B,E,D){if(this.fireEvent("beforecellselect",this,F,C)!==false){this.clearSelections();D=D||this.grid.store.getAt(F);this.selection={record:D,cell:[F,C]};if(!B){var A=this.grid.getView();A.onCellSelect(F,C);if(E!==true){A.focusCell(F,C)}}this.fireEvent("cellselect",this,F,C);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(C,B,A){return !A.isHidden(B)},handleKeyDown:function(F){if(!F.isNavKeyPress()){return }var E=this.grid,J=this.selection;if(!J){F.stopEvent();var I=E.walkCells(0,0,1,this.isSelectable,this);if(I){this.select(I[0],I[1])}return }var B=this;var H=function(M,K,L){return E.walkCells(M,K,L,B.isSelectable,B)};var C=F.getKey(),A=J.cell[0],G=J.cell[1];var D;switch(C){case F.TAB:if(F.shiftKey){D=H(A,G-1,-1)}else{D=H(A,G+1,1)}break;case F.DOWN:D=H(A+1,G,1);break;case F.UP:D=H(A-1,G,-1);break;case F.RIGHT:D=H(A,G+1,1);break;case F.LEFT:D=H(A,G-1,-1);break;case F.ENTER:if(E.isEditor&&!E.editing){E.startEditing(A,G);F.stopEvent();return }break}if(D){this.select(D[0],D[1]);F.stopEvent()}},acceptsNav:function(C,B,A){return !A.isHidden(B)&&A.isCellEditable(B,C)},onEditorKey:function(E,D){var B=D.getKey(),F,C=this.grid,A=C.activeEditor;if(B==D.TAB){if(D.shiftKey){F=C.walkCells(A.row,A.col-1,-1,this.acceptsNav,this)}else{F=C.walkCells(A.row,A.col+1,1,this.acceptsNav,this)}D.stopEvent()}else{if(B==D.ENTER){A.completeEdit();D.stopEvent()}else{if(B==D.ESC){D.stopEvent();A.cancelEdit()}}}if(F){C.startEditing(F[0],F[1])}}});
+Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.on("bodyscroll",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{if(this.clicksToEdit=="auto"&&this.view.mainBody){this.view.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}this.getGridEl().addClass("xedit-grid")},onCellDblClick:function(B,C,A){this.startEditing(C,A)},onAutoEditClick:function(C,B){if(C.button!==0){return }var E=this.view.findRowIndex(B);var A=this.view.findCellIndex(B);if(E!==false&&A!==false){this.stopEditing();if(this.selModel.getSelectedCell){var D=this.selModel.getSelectedCell();if(D&&D.cell[0]===E&&D.cell[1]===A){this.startEditing(E,A)}}else{if(this.selModel.isSelected(E)){this.startEditing(E,A)}}}},onEditComplete:function(B,D,A){this.editing=false;this.activeEditor=null;B.un("specialkey",this.selModel.onEditorKey,this.selModel);var C=B.record;var F=this.colModel.getDataIndex(B.col);D=this.postEditValue(D,A,C,F);if(String(D)!==String(A)){var E={grid:this,record:C,field:F,originalValue:A,value:D,row:B.row,column:B.col,cancel:false};if(this.fireEvent("validateedit",E)!==false&&!E.cancel){C.set(F,E.value);delete E.cancel;this.fireEvent("afteredit",E)}}this.view.focusCell(B.row,B.col)},startEditing:function(F,B){this.stopEditing();if(this.colModel.isCellEditable(B,F)){this.view.ensureVisible(F,B,true);var C=this.store.getAt(F);var E=this.colModel.getDataIndex(B);var D={grid:this,record:C,field:E,value:C.data[E],row:F,column:B,cancel:false};if(this.fireEvent("beforeedit",D)!==false&&!D.cancel){this.editing=true;var A=this.colModel.getCellEditor(B,F);if(!A.rendered){A.render(this.view.getEditorParent(A))}(function(){A.row=F;A.col=B;A.record=C;A.on("complete",this.onEditComplete,this,{single:true});A.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=A;var G=this.preEditValue(C,E);A.startEdit(this.view.getCell(F,B).firstChild,G)}).defer(50,this)}}},preEditValue:function(A,C){var B=A.data[C];return this.autoEncode&&typeof B=="string"?Ext.util.Format.htmlDecode(B):B},postEditValue:function(C,A,B,D){return this.autoEncode&&typeof C=="string"?Ext.util.Format.htmlEncode(C):C},stopEditing:function(A){if(this.activeEditor){this.activeEditor[A===true?"cancelEdit":"completeEdit"]()}this.activeEditor=null},onDestroy:function(){if(this.rendered){var C=this.colModel.config;for(var B=0,A=C.length;B<A;B++){var D=C[B];Ext.destroy(D.editor)}}Ext.grid.EditorGridPanel.superclass.onDestroy.call(this)}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);
+Ext.grid.GridEditor=function(B,A){Ext.grid.GridEditor.superclass.constructor.call(this,B,A);B.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});
+Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=function(A,B){this.grid=A;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(B){this.setSource(B)}Ext.grid.PropertyStore.superclass.constructor.call(this)};Ext.extend(Ext.grid.PropertyStore,Ext.util.Observable,{setSource:function(C){this.source=C;this.store.removeAll();var B=[];for(var A in C){if(this.isEditableValue(C[A])){B.push(new Ext.grid.PropertyRecord({name:A,value:C[A]},A))}}this.store.loadRecords({records:B},{},true)},onUpdate:function(E,A,D){if(D==Ext.data.Record.EDIT){var B=A.data["value"];var C=A.modified["value"];if(this.grid.fireEvent("beforepropertychange",this.source,A.id,B,C)!==false){this.source[A.id]=B;A.commit();this.grid.fireEvent("propertychange",this.source,A.id,B,C)}else{A.reject()}}},getProperty:function(A){return this.store.getAt(A)},isEditableValue:function(A){if(Ext.isDate(A)){return true}else{if(typeof A=="object"||typeof A=="function"){return false}}return true},setValue:function(B,A){this.source[B]=A;this.store.getById(B).set("value",A)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=function(C,B){this.grid=C;var D=Ext.grid;D.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=B;this.bselect=Ext.DomHelper.append(document.body,{tag:"select",cls:"x-grid-editor x-hide-display",children:[{tag:"option",value:"true",html:"true"},{tag:"option",value:"false",html:"false"}]});var E=Ext.form;var A=new E.Field({el:this.bselect,bselect:this.bselect,autoShow:true,getValue:function(){return this.bselect.value=="true"}});this.editors={"date":new D.GridEditor(new E.DateField({selectOnFocus:true})),"string":new D.GridEditor(new E.TextField({selectOnFocus:true})),"number":new D.GridEditor(new E.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new D.GridEditor(A)};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)};Ext.extend(Ext.grid.PropertyColumnModel,Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",renderDate:function(A){return A.dateFormat(this.dateFormat)},renderBool:function(A){return A?"true":"false"},isCellEditable:function(A,B){return A==1},getRenderer:function(A){return A==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(A){return this.getPropertyName(A)},renderCell:function(A){var B=A;if(Ext.isDate(A)){B=this.renderDate(A)}else{if(typeof A=="boolean"){B=this.renderBool(A)}}return Ext.util.Format.htmlEncode(B)},getPropertyName:function(B){var A=this.grid.propertyNames;return A&&A[B]?A[B]:B},getCellEditor:function(A,E){var B=this.store.getProperty(E);var D=B.data["name"],C=B.data["value"];if(this.grid.customEditors[D]){return this.grid.customEditors[D]}if(Ext.isDate(C)){return this.editors["date"]}else{if(typeof C=="number"){return this.editors["number"]}else{if(typeof C=="boolean"){return this.editors["boolean"]}else{return this.editors["string"]}}}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customEditors=this.customEditors||{};this.lastEditRow=null;var B=new Ext.grid.PropertyStore(this);this.propStore=B;var A=new Ext.grid.PropertyColumnModel(this,B);B.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=A;this.ds=B.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.selModel.on("beforecellselect",function(E,D,C){if(C===0){this.startEditing.defer(200,this,[D,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(A){this.propStore.setSource(A)},getSource:function(){return this.propStore.getSource()}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);
+Ext.grid.RowNumberer=function(A){Ext.apply(this,A);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}};Ext.grid.RowNumberer.prototype={header:"",width:23,sortable:false,fixed:true,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(B,C,A,D){if(this.rowspan){C.cellAttr="rowspan=\""+this.rowspan+"\""}return D+1}};
+Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:"<div class=\"x-grid3-hd-checker\">&#160;</div>",width:20,sortable:false,menuDisabled:true,fixed:true,dataIndex:"",id:"checker",initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var A=this.grid.getView();A.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(A.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},onMouseDown:function(C,B){if(C.button===0&&B.className=="x-grid3-row-checker"){C.stopEvent();var D=C.getTarget(".x-grid3-row");if(D){var A=D.rowIndex;if(this.isSelected(A)){this.deselectRow(A)}else{this.selectRow(A,true)}}}},onHdMouseDown:function(C,A){if(A.className=="x-grid3-hd-checker"){C.stopEvent();var B=Ext.fly(A.parentNode);var D=B.hasClass("x-grid3-hd-checker-on");if(D){B.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{B.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(B,C,A){return"<div class=\"x-grid3-row-checker\">&#160;</div>"}});
+Ext.LoadMask=function(C,B){this.el=Ext.get(C);Ext.apply(this,B);if(this.store){this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,false)}else{var A=this.el.getUpdater();A.showLoadIndicator=false;A.on("beforeupdate",this.onBeforeLoad,this);A.on("update",this.onLoad,this);A.on("failure",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.onLoad,this)}else{var A=this.el.getUpdater();A.un("beforeupdate",this.onBeforeLoad,this);A.un("update",this.onLoad,this);A.un("failure",this.onLoad,this)}}};
+Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(D,A){Ext.ProgressBar.superclass.onRender.call(this,D,A);var C=new Ext.Template("<div class=\"{cls}-wrap\">","<div class=\"{cls}-inner\">","<div class=\"{cls}-bar\">","<div class=\"{cls}-text\">","<div>&#160;</div>","</div>","</div>","<div class=\"{cls}-text {cls}-text-back\">","<div>&#160;</div>","</div>","</div>","</div>");if(A){this.el=C.insertBefore(A,{cls:this.baseCls},true)}else{this.el=C.append(D,{cls:this.baseCls},true)}if(this.id){this.el.dom.id=this.id}var B=this.el.dom.firstChild;this.progressBar=Ext.get(B.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var E=Ext.get(B.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,E.dom.firstChild]);this.textEl.setWidth(B.offsetWidth)}this.progressBar.setHeight(B.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(B,C){this.value=B||0;if(C){this.updateText(C)}if(this.rendered){var A=Math.floor(B*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(A);if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(A)}}this.fireEvent("update",this,B,C);return this},wait:function(B){if(!this.waitTimer){var A=this;B=B||{};this.updateText(B.text);this.waitTimer=Ext.TaskMgr.start({run:function(C){var D=B.increment||10;this.updateProgress(((((C+D)%D)+1)*(100/D))*0.01)},interval:B.interval||1000,duration:B.duration,onStop:function(){if(B.fn){B.fn.apply(B.scope||this)}this.reset()},scope:A})}return this},isWaiting:function(){return this.waitTimer!=null},updateText:function(A){this.text=A||"&#160;";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(A,C){Ext.ProgressBar.superclass.setSize.call(this,A,C);if(this.textTopEl){var B=this.el.dom.firstChild;this.textEl.setSize(B.offsetWidth,B.offsetHeight)}this.syncProgressBar();return this},reset:function(A){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}if(A===true){this.hide()}return this}});Ext.reg("progress",Ext.ProgressBar);
+Ext.Slider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,initComponent:function(){if(this.value===undefined){this.value=this.minValue}Ext.Slider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.vertical){Ext.apply(this,Ext.Slider.Vertical)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{cls:"x-slider-thumb"},{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.Slider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.thumb=this.innerEl.first();this.halfThumb=(this.vertical?this.thumb.getHeight():this.thumb.getWidth())/2;this.focusEl=this.thumb.next();this.initEvents()},initEvents:function(){this.thumb.addClassOnOver("x-slider-thumb-over");this.mon(this.el,"mousedown",this.onMouseDown,this);this.mon(this.el,"keydown",this.onKeyDown,this);this.focusEl.swallowEvent("click",true);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(this.thumb);this.on("beforedestroy",this.tracker.destroy,this.tracker)},onMouseDown:function(B){if(this.disabled){return }if(this.clickToChange&&B.target!=this.thumb.dom){var A=this.innerEl.translatePoints(B.getXY());this.onClickChange(A)}this.focus()},onClickChange:function(A){if(A.top>this.clickRange[0]&&A.top<this.clickRange[1]){this.setValue(Math.round(this.reverseValue(A.left)),undefined,true)}},onKeyDown:function(B){if(this.disabled){B.preventDefault();return }var A=B.getKey();switch(A){case B.UP:case B.RIGHT:B.stopEvent();if(B.ctrlKey){this.setValue(this.maxValue,undefined,true)}else{this.setValue(this.value+this.keyIncrement,undefined,true)}break;case B.DOWN:case B.LEFT:B.stopEvent();if(B.ctrlKey){this.setValue(this.minValue,undefined,true)}else{this.setValue(this.value-this.keyIncrement,undefined,true)}break;default:B.preventDefault()}},doSnap:function(B){if(!this.increment||this.increment==1||!B){return B}var D=B,C=this.increment;var A=B%C;if(A>0){if(A>(C/2)){D=B+(C-A)}else{D=B-A}}return D.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.Slider.superclass.afterRender.apply(this,arguments);if(this.value!==undefined){var A=this.normalizeValue(this.value);if(A!==this.value){delete this.value;this.setValue(A,false)}else{this.moveThumb(this.translateValue(A),false)}}},getRatio:function(){var A=this.innerEl.getWidth();var B=this.maxValue-this.minValue;return B==0?A:(A/B)},normalizeValue:function(A){if(typeof A!="number"){A=parseInt(A)}A=Math.round(A);A=this.doSnap(A);A=A.constrain(this.minValue,this.maxValue);return A},setValue:function(B,A,C){B=this.normalizeValue(B);if(B!==this.value&&this.fireEvent("beforechange",this,B,this.value)!==false){this.value=B;this.moveThumb(this.translateValue(B),A!==false);this.fireEvent("change",this,B);if(C){this.fireEvent("changecomplete",this,B)}}},translateValue:function(A){var B=this.getRatio();return(A*B)-(this.minValue*B)-this.halfThumb},reverseValue:function(B){var A=this.getRatio();return(B+this.halfThumb+(this.minValue*A))/A},moveThumb:function(B,A){if(!A||this.animate===false){this.thumb.setLeft(B)}else{this.thumb.shift({left:B,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onBeforeDragStart:function(A){return !this.disabled},onDragStart:function(A){this.thumb.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.fireEvent("dragstart",this,A)},onDrag:function(A){var B=this.innerEl.translatePoints(this.tracker.getXY());this.setValue(Math.round(this.reverseValue(B.left)),false);this.fireEvent("drag",this,A)},onDragEnd:function(A){this.thumb.removeClass("x-slider-thumb-drag");this.dragging=false;this.fireEvent("dragend",this,A);if(this.dragStartValue!=this.value){this.fireEvent("changecomplete",this,this.value)}},onResize:function(A,B){this.innerEl.setWidth(A-(this.el.getPadding("l")+this.endEl.getPadding("r")));this.syncThumb()},syncThumb:function(){if(this.rendered){this.moveThumb(this.translateValue(this.value))}},getValue:function(){return this.value}});Ext.reg("slider",Ext.Slider);Ext.Slider.Vertical={onResize:function(A,B){this.innerEl.setHeight(B-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var B=this.innerEl.getHeight();var A=this.maxValue-this.minValue;return B/A},moveThumb:function(B,A){if(!A||this.animate===false){this.thumb.setBottom(B)}else{this.thumb.shift({bottom:B,stopFx:true,duration:0.35})}},onDrag:function(B){var C=this.innerEl.translatePoints(this.tracker.getXY());var A=this.innerEl.getHeight()-C.top;this.setValue(Math.round(A/this.getRatio()),false);this.fireEvent("drag",this,B)},onClickChange:function(B){if(B.left>this.clickRange[0]&&B.left<this.clickRange[1]){var A=this.innerEl.getHeight()-B.top;this.setValue(Math.round(A/this.getRatio()),undefined,true)}}};
+Ext.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5000,activeThreadId:0,initComponent:function(){if(this.statusAlign=="right"){this.cls+=" x-status-right"}Ext.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.StatusBar.superclass.afterRender.call(this);var A=this.statusAlign=="right",B=Ext.get(this.nextBlock());if(A){this.tr.appendChild(B.dom)}else{B.insertBefore(this.tr.firstChild)}this.statusEl=B.createChild({cls:"x-status-text "+(this.iconCls||this.defaultIconCls||""),html:this.text||this.defaultText||""});this.statusEl.unselectable();this.spacerEl=B.insertSibling({tag:"td",style:"width:100%",cn:[{cls:"ytb-spacer"}]},A?"before":"after")},setStatus:function(C){C=C||{};if(typeof C=="string"){C={text:C}}if(C.text!==undefined){this.setText(C.text)}if(C.iconCls!==undefined){this.setIcon(C.iconCls)}if(C.clear){var D=C.clear,B=this.autoClear,A={useDefaults:true,anim:true};if(typeof D=="object"){D=Ext.applyIf(D,A);if(D.wait){B=D.wait}}else{if(typeof D=="number"){B=D;D=A}else{if(typeof D=="boolean"){D=A}}}D.threadId=this.activeThreadId;this.clearStatus.defer(B,this,[D])}return this},clearStatus:function(C){C=C||{};if(C.threadId&&C.threadId!==this.activeThreadId){return this}var B=C.useDefaults?this.defaultText:"",A=C.useDefaults?(this.defaultIconCls?this.defaultIconCls:""):"";if(C.anim){this.statusEl.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:B,iconCls:A});this.statusEl.show()}})}else{this.statusEl.hide();this.setStatus({text:B,iconCls:A});this.statusEl.show()}return this},setText:function(A){this.activeThreadId++;this.text=A||"";if(this.rendered){this.statusEl.update(this.text)}return this},getText:function(){return this.text},setIcon:function(A){this.activeThreadId++;A=A||"";if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null}if(A.length>0){this.statusEl.addClass(A);this.currIconCls=A}}else{this.currIconCls=A}return this},showBusy:function(A){if(typeof A=="string"){A={text:A}}A=Ext.applyIf(A||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(A)}});Ext.reg("statusbar",Ext.StatusBar);
+Ext.History=(function(){var E,C;var J=false;var D;function F(){var K=top.location.href,L=K.indexOf("#");return L>=0?K.substr(L+1):null}function A(){C.value=D}function G(K){D=K;Ext.History.fireEvent("change",K)}function H(L){var K=["<html><body><div id=\"state\">",L,"</div></body></html>"].join("");try{var N=E.contentWindow.document;N.open();N.write(K);N.close();return true}catch(M){return false}}function B(){if(!E.contentWindow||!E.contentWindow.document){setTimeout(B,10);return }var N=E.contentWindow.document;var L=N.getElementById("state");var K=L?L.innerText:null;var M=F();setInterval(function(){N=E.contentWindow.document;L=N.getElementById("state");var P=L?L.innerText:null;var O=F();if(P!==K){K=P;G(K);top.location.hash=K;M=K;A()}else{if(O!==M){M=O;H(O)}}},50);J=true;Ext.History.fireEvent("ready",Ext.History)}function I(){D=C.value;if(Ext.isIE){B()}else{var K=F();setInterval(function(){var L=F();if(L!==K){K=L;G(K);A()}},50);J=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(L,K){if(J){Ext.callback(L,K,[this]);return }if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(L,K)});return }C=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){E=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(L){this.on("ready",L,K,{single:true})}I()},add:function(K,L){if(L!==false){if(this.getToken()==K){return true}}if(Ext.isIE){return H(K)}else{top.location.hash=K;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return J?D:F()}}})();Ext.apply(Ext.History,new Ext.util.Observable());
diff --git a/deluge/ui/web/docs/template/resources/ext-base.js b/deluge/ui/web/docs/template/resources/ext-base.js
new file mode 100644
index 0000000..b68f63d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/ext-base.js
@@ -0,0 +1,10 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+Ext={version:"2.2"};window["undefined"]=window["undefined"];Ext.apply=function(C,D,B){if(B){Ext.apply(C,B)}if(C&&D&&typeof D=="object"){for(var A in D){C[A]=D[A]}}return C};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isSafari=(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isGecko=!isSafari&&ua.indexOf("gecko")>-1,isGecko3=!isSafari&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return }var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+" == \"undefined\"){"+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7,isIE7:isIE7,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A)}},createDelegate:function(C,B,A){var D=this;return function(){var F=B||arguments;if(A===true){F=Array.prototype.slice.call(arguments,0);F=F.concat(B)}else{if(typeof A=="number"){F=Array.prototype.slice.call(arguments,0);var E=[A,0].concat(B);Array.prototype.splice.apply(F,E)}}return D.apply(C||window,F)}},defer:function(C,E,B,A){var D=this.createDelegate(E,B,A);if(C){return setTimeout(D,C)}D();return 0},createSequence:function(B,A){if(typeof B!="function"){return this}var C=this;return function(){var D=C.apply(this||window,arguments);B.apply(A||this||window,arguments);return D}},createInterceptor:function(B,A){if(typeof B!="function"){return this}var C=this;return function(){B.target=this;B.method=C;if(B.apply(A||this||window,arguments)===false){return }return C.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1")},leftPad:function(D,B,C){var A=new String(D);if(!C){C=" "}while(A.length<B){A=C+A}return A.toString()},format:function(B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}});String.prototype.toggle=function(B,A){return this==B?A:B};String.prototype.trim=function(){var A=/^\s+|\s+$/g;return function(){return this.replace(A,"")}}();Ext.applyIf(Number.prototype,{constrain:function(B,A){return Math.min(Math.max(this,B),A)}});Ext.applyIf(Array.prototype,{indexOf:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]==C){return B}}return -1},remove:function(B){var A=this.indexOf(B);if(A!=-1){this.splice(A,1)}return this}});Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime())};
+(function(){var B;Ext.lib.Dom={getViewWidth:function(E){return E?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(E){return E?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(E,this.getViewportHeight())},getDocumentWidth:function(){var E=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(E,this.getViewportWidth())},getViewportHeight:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientHeight:document.body.clientHeight}else{return self.innerHeight}},getViewportWidth:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientWidth:document.body.clientWidth}else{return self.innerWidth}},isAncestor:function(F,G){F=Ext.getDom(F);G=Ext.getDom(G);if(!F||!G){return false}if(F.contains&&!Ext.isSafari){return F.contains(G)}else{if(F.compareDocumentPosition){return !!(F.compareDocumentPosition(G)&16)}else{var E=G.parentNode;while(E){if(E==F){return true}else{if(!E.tagName||E.tagName.toUpperCase()=="HTML"){return false}}E=E.parentNode}return false}}},getRegion:function(E){return Ext.lib.Region.getRegion(E)},getY:function(E){return this.getXY(E)[1]},getX:function(E){return this.getXY(E)[0]},getXY:function(G){var F,K,M,N,J=(document.body||document.documentElement);G=Ext.getDom(G);if(G==J){return[0,0]}if(G.getBoundingClientRect){M=G.getBoundingClientRect();N=C(document).getScroll();return[M.left+N.left,M.top+N.top]}var O=0,L=0;F=G;var E=C(G).getStyle("position")=="absolute";while(F){O+=F.offsetLeft;L+=F.offsetTop;if(!E&&C(F).getStyle("position")=="absolute"){E=true}if(Ext.isGecko){K=C(F);var P=parseInt(K.getStyle("borderTopWidth"),10)||0;var H=parseInt(K.getStyle("borderLeftWidth"),10)||0;O+=H;L+=P;if(F!=G&&K.getStyle("overflow")!="visible"){O+=H;L+=P}}F=F.offsetParent}if(Ext.isSafari&&E){O-=J.offsetLeft;L-=J.offsetTop}if(Ext.isGecko&&!E){var I=C(J);O+=parseInt(I.getStyle("borderLeftWidth"),10)||0;L+=parseInt(I.getStyle("borderTopWidth"),10)||0}F=G.parentNode;while(F&&F!=J){if(!Ext.isOpera||(F.tagName!="TR"&&C(F).getStyle("display")!="inline")){O-=F.scrollLeft;L-=F.scrollTop}F=F.parentNode}return[O,L]},setXY:function(E,F){E=Ext.fly(E,"_setXY");E.position();var G=E.translatePoints(F);if(F[0]!==false){E.dom.style.left=G.left+"px"}if(F[1]!==false){E.dom.style.top=G.top+"px"}},setX:function(F,E){this.setXY(F,[E,false])},setY:function(E,F){this.setXY(E,[false,F])}};Ext.lib.Event=function(){var F=false;var G=[];var K=[];var I=0;var H=[];var E=0;var J=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var L=this;var M=function(){L._tryPreloadAttach()};this._interval=setInterval(M,this.POLL_INTERVAL)}},onAvailable:function(N,L,O,M){H.push({id:N,fn:L,obj:O,override:M,checkReady:false});I=this.POLL_RETRYS;this.startInterval()},addListener:function(Q,M,P){Q=Ext.getDom(Q);if(!Q||!P){return false}if("unload"==M){K[K.length]=[Q,M,P];return true}var O=function(R){return typeof Ext!="undefined"?P(Ext.lib.Event.getEvent(R)):false};var L=[Q,M,P,O];var N=G.length;G[N]=L;this.doAdd(Q,M,O,false);return true},removeListener:function(S,O,R){var Q,N;S=Ext.getDom(S);if(!R){return this.purgeElement(S,false,O)}if("unload"==O){for(Q=0,N=K.length;Q<N;Q++){var M=K[Q];if(M&&M[0]==S&&M[1]==O&&M[2]==R){K.splice(Q,1);return true}}return false}var L=null;var P=arguments[3];if("undefined"==typeof P){P=this._getCacheIndex(S,O,R)}if(P>=0){L=G[P]}if(!S||!L){return false}this.doRemove(S,O,L[this.WFN],false);delete G[P][this.WFN];delete G[P][this.FN];G.splice(P,1);return true},getTarget:function(N,M){N=N.browserEvent||N;var L=N.target||N.srcElement;return this.resolveTextNode(L)},resolveTextNode:function(L){if(Ext.isSafari&&L&&3==L.nodeType){return L.parentNode}else{return L}},getPageX:function(M){M=M.browserEvent||M;var L=M.pageX;if(!L&&0!==L){L=M.clientX||0;if(Ext.isIE){L+=this.getScroll()[1]}}return L},getPageY:function(L){L=L.browserEvent||L;var M=L.pageY;if(!M&&0!==M){M=L.clientY||0;if(Ext.isIE){M+=this.getScroll()[0]}}return M},getXY:function(L){L=L.browserEvent||L;return[this.getPageX(L),this.getPageY(L)]},getRelatedTarget:function(M){M=M.browserEvent||M;var L=M.relatedTarget;if(!L){if(M.type=="mouseout"){L=M.toElement}else{if(M.type=="mouseover"){L=M.fromElement}}}return this.resolveTextNode(L)},getTime:function(N){N=N.browserEvent||N;if(!N.time){var M=new Date().getTime();try{N.time=M}catch(L){this.lastError=L;return M}}return N.time},stopEvent:function(L){this.stopPropagation(L);this.preventDefault(L)},stopPropagation:function(L){L=L.browserEvent||L;if(L.stopPropagation){L.stopPropagation()}else{L.cancelBubble=true}},preventDefault:function(L){L=L.browserEvent||L;if(L.preventDefault){L.preventDefault()}else{L.returnValue=false}},getEvent:function(M){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break}N=N.caller}}return L},getCharCode:function(L){L=L.browserEvent||L;return L.charCode||L.keyCode||0},_getCacheIndex:function(Q,N,P){for(var O=0,M=G.length;O<M;++O){var L=G[O];if(L&&L[this.FN]==P&&L[this.EL]==Q&&L[this.TYPE]==N){return O}}return -1},elCache:{},getEl:function(L){return document.getElementById(L)},clearCache:function(){},_load:function(M){F=true;var L=Ext.lib.Event;if(Ext.isIE){L.doRemove(window,"load",L._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var R=!F;if(!R){R=(I>0)}var Q=[];for(var M=0,L=H.length;M<L;++M){var P=H[M];if(P){var O=this.getEl(P.id);if(O){if(!P.checkReady||F||O.nextSibling||(document&&document.body)){var N=O;if(P.override){if(P.override===true){N=P.obj}else{N=P.override}}P.fn.call(N,P.obj);H[M]=null}}else{Q.push(P)}}}I=(Q.length===0)?0:I-1;if(R){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(P,Q,N){var R=this.getListeners(P,N);if(R){for(var O=0,L=R.length;O<L;++O){var M=R[O];this.removeListener(P,M.type,M.fn)}}if(Q&&P&&P.childNodes){for(O=0,L=P.childNodes.length;O<L;++O){this.purgeElement(P.childNodes[O],Q,N)}}},getListeners:function(M,R){var P=[],L;if(!R){L=[G,K]}else{if(R=="unload"){L=[K]}else{L=[G]}}for(var O=0;O<L.length;++O){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===M&&(!R||R===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.ADJ_SCOPE],index:Q})}}}}return(P.length)?P:null},_unload:function(S){var R=Ext.lib.Event,P,O,M,L,N;for(P=0,L=K.length;P<L;++P){M=K[P];if(M){var Q=window;if(M[R.ADJ_SCOPE]){if(M[R.ADJ_SCOPE]===true){Q=M[R.OBJ]}else{Q=M[R.ADJ_SCOPE]}}M[R.FN].call(Q,R.getEvent(S),M[R.OBJ]);K[P]=null;M=null;Q=null}}K=null;if(G&&G.length>0){O=G.length;while(O){N=O-1;M=G[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N)}O=O-1}M=null;R.clearCache()}R.doRemove(window,"unload",R._unload)},getScroll:function(){var L=document.documentElement,M=document.body;if(L&&(L.scrollTop||L.scrollLeft)){return[L.scrollTop,L.scrollLeft]}else{if(M){return[M.scrollTop,M.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(O,M,N,L){O.addEventListener(M,N,(L))}}else{if(window.attachEvent){return function(O,M,N,L){O.attachEvent("on"+M,N)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(O,M,N,L){O.removeEventListener(M,N,(L))}}else{if(window.detachEvent){return function(N,L,M){N.detachEvent("on"+L,M)}}else{return function(){}}}}()}}();var D=Ext.lib.Event;D.on=D.addListener;D.un=D.removeListener;if(document&&document.body){D._load()}else{D.doAdd(window,"load",D._load)}D.doAdd(window,"unload",D._unload);D._tryPreloadAttach();Ext.lib.Ajax={request:function(K,I,E,J,F){if(F){var G=F.headers;if(G){for(var H in G){if(G.hasOwnProperty(H)){this.initHeader(H,G[H],false)}}}if(F.xmlData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}K=(K?K:(F.method?F.method:"POST"));J=F.xmlData}else{if(F.jsonData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","application/json",false)}K=(K?K:(F.method?F.method:"POST"));J=typeof F.jsonData=="object"?Ext.encode(F.jsonData):F.jsonData}}}return this.asyncRequest(K,I,E,J)},serializeForm:function(F){if(typeof F=="string"){F=(document.getElementById(F)||document.forms[F])}var G,E,H,J,K="",M=false;for(var L=0;L<F.elements.length;L++){G=F.elements[L];J=F.elements[L].disabled;E=F.elements[L].name;H=F.elements[L].value;if(!J&&E){switch(G.type){case"select-one":case"select-multiple":for(var I=0;I<G.options.length;I++){if(G.options[I].selected){if(Ext.isIE){K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].attributes["value"].specified?G.options[I].value:G.options[I].text)+"&"}else{K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].hasAttribute("value")?G.options[I].value:G.options[I].text)+"&"}}}break;case"radio":case"checkbox":if(G.checked){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(M==false){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";M=true}break;default:K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";break}}}K=K.substr(0,K.length-1);return K},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(E){this.activeX.unshift(E)},setDefaultPostHeader:function(E){this.useDefaultHeader=E},setDefaultXhrHeader:function(E){this.useDefaultXhrHeader=E},setPollingInterval:function(E){if(typeof E=="number"&&isFinite(E)){this.pollInterval=E}},createXhrObject:function(I){var H,E;try{E=new XMLHttpRequest();H={conn:E,tId:I}}catch(G){for(var F=0;F<this.activeX.length;++F){try{E=new ActiveXObject(this.activeX[F]);H={conn:E,tId:I};break}catch(G){}}}finally{return H}},getConnectionObject:function(){var F;var G=this.transactionId;try{F=this.createXhrObject(G);if(F){this.transactionId++}}catch(E){}finally{return F}},asyncRequest:function(I,F,H,E){var G=this.getConnectionObject();if(!G){return null}else{G.conn.open(I,F,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(E&&this.useDefaultHeader&&(!this.hasHeaders||!this.headers["Content-Type"])){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(G)}this.handleReadyState(G,H);G.conn.send(E||null);return G}},handleReadyState:function(F,G){var E=this;if(G&&G.timeout){this.timeout[F.tId]=window.setTimeout(function(){E.abort(F,G,true)},G.timeout)}this.poll[F.tId]=window.setInterval(function(){if(F.conn&&F.conn.readyState==4){window.clearInterval(E.poll[F.tId]);delete E.poll[F.tId];if(G&&G.timeout){window.clearTimeout(E.timeout[F.tId]);delete E.timeout[F.tId]}E.handleTransactionResponse(F,G)}},this.pollInterval)},handleTransactionResponse:function(I,J,E){if(!J){this.releaseObject(I);return }var G,F;try{if(I.conn.status!==undefined&&I.conn.status!=0){G=I.conn.status}else{G=13030}}catch(H){G=13030}if(G>=200&&G<300){F=this.createResponseObject(I,J.argument);if(J.success){if(!J.scope){J.success(F)}else{J.success.apply(J.scope,[F])}}}else{switch(G){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:F=this.createExceptionObject(I.tId,J.argument,(E?E:false));if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}break;default:F=this.createResponseObject(I,J.argument);if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}}}this.releaseObject(I);F=null},createResponseObject:function(E,K){var H={};var M={};try{var G=E.conn.getAllResponseHeaders();var J=G.split("\n");for(var I=0;I<J.length;I++){var F=J[I].indexOf(":");if(F!=-1){M[J[I].substring(0,F)]=J[I].substring(F+2)}}}catch(L){}H.tId=E.tId;H.status=E.conn.status;H.statusText=E.conn.statusText;H.getResponseHeader=M;H.getAllResponseHeaders=G;H.responseText=E.conn.responseText;H.responseXML=E.conn.responseXML;if(typeof K!==undefined){H.argument=K}return H},createExceptionObject:function(L,H,E){var J=0;var K="communication failure";var G=-1;var F="transaction aborted";var I={};I.tId=L;if(E){I.status=G;I.statusText=F}else{I.status=J;I.statusText=K}if(H){I.argument=H}return I},initHeader:function(E,H,G){var F=(G)?this.defaultHeaders:this.headers;if(F[E]===undefined){F[E]=H}else{F[E]=H+","+F[E]}if(G){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(E){if(this.hasDefaultHeaders){for(var F in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(F)){E.conn.setRequestHeader(F,this.defaultHeaders[F])}}}if(this.hasHeaders){for(var F in this.headers){if(this.headers.hasOwnProperty(F)){E.conn.setRequestHeader(F,this.headers[F])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(F,G,E){if(this.isCallInProgress(F)){F.conn.abort();window.clearInterval(this.poll[F.tId]);delete this.poll[F.tId];if(E){delete this.timeout[F.tId]}this.handleTransactionResponse(F,G,true);return true}else{return false}},isCallInProgress:function(E){if(E.conn){return E.conn.readyState!=4&&E.conn.readyState!=0}else{return false}},releaseObject:function(E){E.conn=null;E=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(G,H,E,F){this.top=G;this[1]=G;this.right=H;this.bottom=E;this.left=F;this[0]=F};Ext.lib.Region.prototype={contains:function(E){return(E.left>=this.left&&E.right<=this.right&&E.top>=this.top&&E.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(I){var G=Math.max(this.top,I.top);var H=Math.min(this.right,I.right);var E=Math.min(this.bottom,I.bottom);var F=Math.max(this.left,I.left);if(E>=G&&H>=F){return new Ext.lib.Region(G,H,E,F)}else{return null}},union:function(I){var G=Math.min(this.top,I.top);var H=Math.max(this.right,I.right);var E=Math.max(this.bottom,I.bottom);var F=Math.min(this.left,I.left);return new Ext.lib.Region(G,H,E,F)},constrainTo:function(E){this.top=this.top.constrain(E.top,E.bottom);this.bottom=this.bottom.constrain(E.top,E.bottom);this.left=this.left.constrain(E.left,E.right);this.right=this.right.constrain(E.left,E.right);return this},adjust:function(G,F,E,H){this.top+=G;this.left+=F;this.right+=H;this.bottom+=E;return this}};Ext.lib.Region.getRegion=function(H){var J=Ext.lib.Dom.getXY(H);var G=J[1];var I=J[0]+H.offsetWidth;var E=J[1]+H.offsetHeight;var F=J[0];return new Ext.lib.Region(G,I,E,F)};Ext.lib.Point=function(E,F){if(Ext.isArray(E)){F=E[1];E=E[0]}this.x=this.right=this.left=this[0]=E;this.y=this.top=this.bottom=this[1]=F};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.Scroll)},motion:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.Motion)},color:function(H,F,I,J,E,G){return this.run(H,F,I,J,E,G,Ext.lib.ColorAnim)},run:function(I,F,K,L,E,H,G){G=G||Ext.lib.AnimBase;if(typeof L=="string"){L=Ext.lib.Easing[L]}var J=new G(I,F,K,L);J.animateX(function(){Ext.callback(E,H)});return J}};function C(E){if(!B){B=new Ext.Element.Flyweight()}B.dom=E;return B}if(Ext.isIE){function A(){var E=Function.prototype;delete E.createSequence;delete E.defer;delete E.createDelegate;delete E.createCallback;delete E.createInterceptor;window.detachEvent("onunload",A)}window.attachEvent("onunload",A)}Ext.lib.AnimBase=function(F,E,G,H){if(F){this.init(F,E,G,H)}};Ext.lib.AnimBase.prototype={toString:function(){var E=this.getEl();var F=E.id||E.tagName;return("Anim "+F)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(E,G,F){return this.method(this.currentFrame,G,F-G,this.totalFrames)},setAttribute:function(E,G,F){if(this.patterns.noNegatives.test(E)){G=(G>0)?G:0}Ext.fly(this.getEl(),"_anim").setStyle(E,G+F)},getAttribute:function(E){var G=this.getEl();var I=C(G).getStyle(E);if(I!=="auto"&&!this.patterns.offsetUnit.test(I)){return parseFloat(I)}var F=this.patterns.offsetAttribute.exec(E)||[];var J=!!(F[3]);var H=!!(F[2]);if(H||(C(G).getStyle("position")=="absolute"&&J)){I=G["offset"+F[0].charAt(0).toUpperCase()+F[0].substr(1)]}else{I=0}return I},getDefaultUnit:function(E){if(this.patterns.defaultUnit.test(E)){return"px"}return""},animateX:function(G,E){var F=function(){this.onComplete.removeListener(F);if(typeof G=="function"){G.call(E||this,this)}};this.onComplete.addListener(F,this);this.animate()},setRuntimeAttribute:function(F){var K;var G;var H=this.attributes;this.runtimeAttributes[F]={};var J=function(L){return(typeof L!=="undefined")};if(!J(H[F]["to"])&&!J(H[F]["by"])){return false}K=(J(H[F]["from"]))?H[F]["from"]:this.getAttribute(F);if(J(H[F]["to"])){G=H[F]["to"]}else{if(J(H[F]["by"])){if(K.constructor==Array){G=[];for(var I=0,E=K.length;I<E;++I){G[I]=K[I]+H[F]["by"][I]}}else{G=K+H[F]["by"]}}}this.runtimeAttributes[F].start=K;this.runtimeAttributes[F].end=G;this.runtimeAttributes[F].unit=(J(H[F].unit))?H[F]["unit"]:this.getDefaultUnit(F)},init:function(G,L,K,E){var F=false;var H=null;var J=0;G=Ext.getDom(G);this.attributes=L||{};this.duration=K||1;this.method=E||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return G};this.isAnimated=function(){return F};this.getStartTime=function(){return H};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(O){if(O){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var N=function(){this.onStart.fire();this.runtimeAttributes={};for(var O in this.attributes){this.setRuntimeAttribute(O)}F=true;J=0;H=new Date()};var M=function(){var Q={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};Q.toString=function(){return("duration: "+Q.duration+", currentFrame: "+Q.currentFrame)};this.onTween.fire(Q);var P=this.runtimeAttributes;for(var O in P){this.setAttribute(O,this.doMethod(O,P[O].start,P[O].end),P[O].unit)}J+=1};var I=function(){var O=(new Date()-H)/1000;var P={duration:O,frames:J,fps:J/O};P.toString=function(){return("duration: "+P.duration+", frames: "+P.frames+", fps: "+P.fps)};F=false;J=0;this.onComplete.fire(P)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(N);this._onTween.addListener(M);this._onComplete.addListener(I)}};Ext.lib.AnimMgr=new function(){var G=null;var F=[];var E=0;this.fps=1000;this.delay=1;this.registerElement=function(J){F[F.length]=J;E+=1;J._onStart.fire();this.start()};this.unRegister=function(K,J){K._onComplete.fire();J=J||I(K);if(J!=-1){F.splice(J,1)}E-=1;if(E<=0){this.stop()}};this.start=function(){if(G===null){G=setInterval(this.run,this.delay)}};this.stop=function(L){if(!L){clearInterval(G);for(var K=0,J=F.length;K<J;++K){if(F[0].isAnimated()){this.unRegister(F[0],0)}}F=[];G=null;E=0}else{this.unRegister(L)}};this.run=function(){for(var L=0,J=F.length;L<J;++L){var K=F[L];if(!K||!K.isAnimated()){continue}if(K.currentFrame<K.totalFrames||K.totalFrames===null){K.currentFrame+=1;if(K.useSeconds){H(K)}K._onTween.fire()}else{Ext.lib.AnimMgr.stop(K,L)}}};var I=function(L){for(var K=0,J=F.length;K<J;++K){if(F[K]==L){return K}}return -1};var H=function(K){var N=K.totalFrames;var M=K.currentFrame;var L=(K.currentFrame*K.duration*1000/K.totalFrames);var J=(new Date()-K.getStartTime());var O=0;if(J<K.duration*1000){O=Math.round((J/L-1)*K.currentFrame)}else{O=N-(M+1)}if(O>0&&isFinite(O)){if(K.currentFrame+O>=N){O=N-(M+1)}K.currentFrame+=O}}};Ext.lib.Bezier=new function(){this.getPosition=function(I,H){var J=I.length;var G=[];for(var F=0;F<J;++F){G[F]=[I[F][0],I[F][1]]}for(var E=1;E<J;++E){for(F=0;F<J-E;++F){G[F][0]=(1-H)*G[F][0]+H*G[parseInt(F+1,10)][0];G[F][1]=(1-H)*G[F][1]+H*G[parseInt(F+1,10)][1]}}return[G[0][0],G[0][1]]}};(function(){Ext.lib.ColorAnim=function(I,H,J,K){Ext.lib.ColorAnim.superclass.constructor.call(this,I,H,J,K)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var F=Ext.lib;var G=F.ColorAnim.superclass;var E=F.ColorAnim.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("ColorAnim "+I)};E.patterns.color=/color$/i;E.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;E.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;E.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;E.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;E.parseColor=function(H){if(H.length==3){return H}var I=this.patterns.hex.exec(H);if(I&&I.length==4){return[parseInt(I[1],16),parseInt(I[2],16),parseInt(I[3],16)]}I=this.patterns.rgb.exec(H);if(I&&I.length==4){return[parseInt(I[1],10),parseInt(I[2],10),parseInt(I[3],10)]}I=this.patterns.hex3.exec(H);if(I&&I.length==4){return[parseInt(I[1]+I[1],16),parseInt(I[2]+I[2],16),parseInt(I[3]+I[3],16)]}return null};E.getAttribute=function(H){var J=this.getEl();if(this.patterns.color.test(H)){var K=C(J).getStyle(H);if(this.patterns.transparent.test(K)){var I=J.parentNode;K=C(I).getStyle(H);while(I&&this.patterns.transparent.test(K)){I=I.parentNode;K=C(I).getStyle(H);if(I.tagName.toUpperCase()=="HTML"){K="#fff"}}}}else{K=G.getAttribute.call(this,H)}return K};E.doMethod=function(I,M,J){var L;if(this.patterns.color.test(I)){L=[];for(var K=0,H=M.length;K<H;++K){L[K]=G.doMethod.call(this,I,M[K],J[K])}L="rgb("+Math.floor(L[0])+","+Math.floor(L[1])+","+Math.floor(L[2])+")"}else{L=G.doMethod.call(this,I,M,J)}return L};E.setRuntimeAttribute=function(I){G.setRuntimeAttribute.call(this,I);if(this.patterns.color.test(I)){var K=this.attributes;var M=this.parseColor(this.runtimeAttributes[I].start);var J=this.parseColor(this.runtimeAttributes[I].end);if(typeof K[I]["to"]==="undefined"&&typeof K[I]["by"]!=="undefined"){J=this.parseColor(K[I].by);for(var L=0,H=M.length;L<H;++L){J[L]=M[L]+J[L]}}this.runtimeAttributes[I].start=M;this.runtimeAttributes[I].end=J}}})();Ext.lib.Easing={easeNone:function(F,E,H,G){return H*F/G+E},easeIn:function(F,E,H,G){return H*(F/=G)*F+E},easeOut:function(F,E,H,G){return -H*(F/=G)*(F-2)+E},easeBoth:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F+E}return -H/2*((--F)*(F-2)-1)+E},easeInStrong:function(F,E,H,G){return H*(F/=G)*F*F*F+E},easeOutStrong:function(F,E,H,G){return -H*((F=F/G-1)*F*F*F-1)+E},easeBothStrong:function(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F+E}return -H/2*((F-=2)*F*F*F-2)+E},elasticIn:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return -(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E},elasticOut:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}return F*Math.pow(2,-10*G)*Math.sin((G*J-H)*(2*Math.PI)/I)+K+E},elasticBoth:function(G,E,K,J,F,I){if(G==0){return E}if((G/=J/2)==2){return E+K}if(!I){I=J*(0.3*1.5)}if(!F||F<Math.abs(K)){F=K;var H=I/4}else{var H=I/(2*Math.PI)*Math.asin(K/F)}if(G<1){return -0.5*(F*Math.pow(2,10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I))+E}return F*Math.pow(2,-10*(G-=1))*Math.sin((G*J-H)*(2*Math.PI)/I)*0.5+K+E},backIn:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*(F/=H)*F*((G+1)*F-G)+E},backOut:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}return I*((F=F/H-1)*F*((G+1)*F+G)+1)+E},backBoth:function(F,E,I,H,G){if(typeof G=="undefined"){G=1.70158}if((F/=H/2)<1){return I/2*(F*F*(((G*=(1.525))+1)*F-G))+E}return I/2*((F-=2)*F*(((G*=(1.525))+1)*F+G)+2)+E},bounceIn:function(F,E,H,G){return H-Ext.lib.Easing.bounceOut(G-F,0,H,G)+E},bounceOut:function(F,E,H,G){if((F/=G)<(1/2.75)){return H*(7.5625*F*F)+E}else{if(F<(2/2.75)){return H*(7.5625*(F-=(1.5/2.75))*F+0.75)+E}else{if(F<(2.5/2.75)){return H*(7.5625*(F-=(2.25/2.75))*F+0.9375)+E}}}return H*(7.5625*(F-=(2.625/2.75))*F+0.984375)+E},bounceBoth:function(F,E,H,G){if(F<G/2){return Ext.lib.Easing.bounceIn(F*2,0,H,G)*0.5+E}return Ext.lib.Easing.bounceOut(F*2-G,0,H,G)*0.5+H*0.5+E}};(function(){Ext.lib.Motion=function(K,J,L,M){if(K){Ext.lib.Motion.superclass.constructor.call(this,K,J,L,M)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var H=Ext.lib;var I=H.Motion.superclass;var F=H.Motion.prototype;F.toString=function(){var J=this.getEl();var K=J.id||J.tagName;return("Motion "+K)};F.patterns.points=/^points$/i;F.setAttribute=function(J,L,K){if(this.patterns.points.test(J)){K=K||"px";I.setAttribute.call(this,"left",L[0],K);I.setAttribute.call(this,"top",L[1],K)}else{I.setAttribute.call(this,J,L,K)}};F.getAttribute=function(J){if(this.patterns.points.test(J)){var K=[I.getAttribute.call(this,"left"),I.getAttribute.call(this,"top")]}else{K=I.getAttribute.call(this,J)}return K};F.doMethod=function(J,N,K){var M=null;if(this.patterns.points.test(J)){var L=this.method(this.currentFrame,0,100,this.totalFrames)/100;M=H.Bezier.getPosition(this.runtimeAttributes[J],L)}else{M=I.doMethod.call(this,J,N,K)}return M};F.setRuntimeAttribute=function(S){if(this.patterns.points.test(S)){var K=this.getEl();var M=this.attributes;var J;var O=M["points"]["control"]||[];var L;var P,R;if(O.length>0&&!Ext.isArray(O[0])){O=[O]}else{var N=[];for(P=0,R=O.length;P<R;++P){N[P]=O[P]}O=N}Ext.fly(K,"_anim").position();if(G(M["points"]["from"])){Ext.lib.Dom.setXY(K,M["points"]["from"])}else{Ext.lib.Dom.setXY(K,Ext.lib.Dom.getXY(K))}J=this.getAttribute("points");if(G(M["points"]["to"])){L=E.call(this,M["points"]["to"],J);var Q=Ext.lib.Dom.getXY(this.getEl());for(P=0,R=O.length;P<R;++P){O[P]=E.call(this,O[P],J)}}else{if(G(M["points"]["by"])){L=[J[0]+M["points"]["by"][0],J[1]+M["points"]["by"][1]];for(P=0,R=O.length;P<R;++P){O[P]=[J[0]+O[P][0],J[1]+O[P][1]]}}}this.runtimeAttributes[S]=[J];if(O.length>0){this.runtimeAttributes[S]=this.runtimeAttributes[S].concat(O)}this.runtimeAttributes[S][this.runtimeAttributes[S].length]=L}else{I.setRuntimeAttribute.call(this,S)}};var E=function(J,L){var K=Ext.lib.Dom.getXY(this.getEl());J=[J[0]-K[0]+L[0],J[1]-K[1]+L[1]];return J};var G=function(J){return(typeof J!=="undefined")}})();(function(){Ext.lib.Scroll=function(I,H,J,K){if(I){Ext.lib.Scroll.superclass.constructor.call(this,I,H,J,K)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var F=Ext.lib;var G=F.Scroll.superclass;var E=F.Scroll.prototype;E.toString=function(){var H=this.getEl();var I=H.id||H.tagName;return("Scroll "+I)};E.doMethod=function(H,K,I){var J=null;if(H=="scroll"){J=[this.method(this.currentFrame,K[0],I[0]-K[0],this.totalFrames),this.method(this.currentFrame,K[1],I[1]-K[1],this.totalFrames)]}else{J=G.doMethod.call(this,H,K,I)}return J};E.getAttribute=function(H){var J=null;var I=this.getEl();if(H=="scroll"){J=[I.scrollLeft,I.scrollTop]}else{J=G.getAttribute.call(this,H)}return J};E.setAttribute=function(H,K,J){var I=this.getEl();if(H=="scroll"){I.scrollLeft=K[0];I.scrollTop=K[1]}else{G.setAttribute.call(this,H,K,J)}}})()})();
diff --git a/deluge/ui/web/docs/template/resources/extanim32.gif b/deluge/ui/web/docs/template/resources/extanim32.gif
new file mode 100644
index 0000000..effe7c9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/extanim32.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/extanim64.gif b/deluge/ui/web/docs/template/resources/extanim64.gif
new file mode 100644
index 0000000..07a6862
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/extanim64.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/extjs.gif b/deluge/ui/web/docs/template/resources/extjs.gif
new file mode 100644
index 0000000..724796d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/extjs.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/fav.gif b/deluge/ui/web/docs/template/resources/fav.gif
new file mode 100644
index 0000000..abe3cf0
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/fav.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/folder.gif b/deluge/ui/web/docs/template/resources/folder.gif
new file mode 100644
index 0000000..2064442
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/folder.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/folder_open.gif b/deluge/ui/web/docs/template/resources/folder_open.gif
new file mode 100644
index 0000000..ba4c657
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/folder_open.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/form.png b/deluge/ui/web/docs/template/resources/form.png
new file mode 100644
index 0000000..f0945cf
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/form.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/forum.gif b/deluge/ui/web/docs/template/resources/forum.gif
new file mode 100644
index 0000000..21d7268
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/forum.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/hd-bg.gif b/deluge/ui/web/docs/template/resources/hd-bg.gif
new file mode 100644
index 0000000..310102a
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/hd-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/hide-inherited.gif b/deluge/ui/web/docs/template/resources/hide-inherited.gif
new file mode 100644
index 0000000..eae8e54
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/hide-inherited.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/icon-grid.gif b/deluge/ui/web/docs/template/resources/icon-grid.gif
new file mode 100644
index 0000000..6b64286
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/icon-grid.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/corners-blue.gif b/deluge/ui/web/docs/template/resources/images/default/box/corners-blue.gif
new file mode 100644
index 0000000..fa419b5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/corners-blue.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/corners.gif b/deluge/ui/web/docs/template/resources/images/default/box/corners.gif
new file mode 100644
index 0000000..8aa8cae
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/corners.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/l-blue.gif b/deluge/ui/web/docs/template/resources/images/default/box/l-blue.gif
new file mode 100644
index 0000000..5ed7f00
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/l-blue.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/l.gif b/deluge/ui/web/docs/template/resources/images/default/box/l.gif
new file mode 100644
index 0000000..0160f97
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/l.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/r-blue.gif b/deluge/ui/web/docs/template/resources/images/default/box/r-blue.gif
new file mode 100644
index 0000000..3ea5cae
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/r-blue.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/r.gif b/deluge/ui/web/docs/template/resources/images/default/box/r.gif
new file mode 100644
index 0000000..34237f6
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/r.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/tb-blue.gif b/deluge/ui/web/docs/template/resources/images/default/box/tb-blue.gif
new file mode 100644
index 0000000..562fecc
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/tb-blue.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/box/tb.gif b/deluge/ui/web/docs/template/resources/images/default/box/tb.gif
new file mode 100644
index 0000000..435889b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/box/tb.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/button/btn-arrow.gif b/deluge/ui/web/docs/template/resources/images/default/button/btn-arrow.gif
new file mode 100644
index 0000000..f90d5df
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/button/btn-arrow.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/button/btn-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/button/btn-sprite.gif
new file mode 100644
index 0000000..b52e0ce
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/button/btn-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/dd/drop-add.gif b/deluge/ui/web/docs/template/resources/images/default/dd/drop-add.gif
new file mode 100644
index 0000000..b22cd14
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/dd/drop-add.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/dd/drop-no.gif b/deluge/ui/web/docs/template/resources/images/default/dd/drop-no.gif
new file mode 100644
index 0000000..08d0833
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/dd/drop-no.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/dd/drop-yes.gif b/deluge/ui/web/docs/template/resources/images/default/dd/drop-yes.gif
new file mode 100644
index 0000000..8aacb30
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/dd/drop-yes.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/editor/tb-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/editor/tb-sprite.gif
new file mode 100644
index 0000000..fb70577
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/editor/tb-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/checkbox.gif b/deluge/ui/web/docs/template/resources/images/default/form/checkbox.gif
new file mode 100644
index 0000000..835b346
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/checkbox.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.gif b/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.gif
new file mode 100644
index 0000000..da78d45
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.psd b/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.psd
new file mode 100644
index 0000000..f637fa5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/clear-trigger.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.gif b/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.gif
new file mode 100644
index 0000000..25ef7b3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.psd b/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.psd
new file mode 100644
index 0000000..74883b2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/date-trigger.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/error-tip-corners.gif b/deluge/ui/web/docs/template/resources/images/default/form/error-tip-corners.gif
new file mode 100644
index 0000000..6ea4c38
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/error-tip-corners.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/exclamation.gif b/deluge/ui/web/docs/template/resources/images/default/form/exclamation.gif
new file mode 100644
index 0000000..ea31a30
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/exclamation.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/radio.gif b/deluge/ui/web/docs/template/resources/images/default/form/radio.gif
new file mode 100644
index 0000000..36bb91d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/radio.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.gif b/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.gif
new file mode 100644
index 0000000..db8802b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.psd b/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.psd
new file mode 100644
index 0000000..b11f273
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/search-trigger.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/text-bg.gif b/deluge/ui/web/docs/template/resources/images/default/form/text-bg.gif
new file mode 100644
index 0000000..4179607
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/text-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/trigger-tpl.gif b/deluge/ui/web/docs/template/resources/images/default/form/trigger-tpl.gif
new file mode 100644
index 0000000..e3701a3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/trigger-tpl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/trigger.gif b/deluge/ui/web/docs/template/resources/images/default/form/trigger.gif
new file mode 100644
index 0000000..b220bbe
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/trigger.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/form/trigger.psd b/deluge/ui/web/docs/template/resources/images/default/form/trigger.psd
new file mode 100644
index 0000000..1f1ed64
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/form/trigger.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/gradient-bg.gif b/deluge/ui/web/docs/template/resources/images/default/gradient-bg.gif
new file mode 100644
index 0000000..8134e49
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/gradient-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/arrow-left-white.gif b/deluge/ui/web/docs/template/resources/images/default/grid/arrow-left-white.gif
new file mode 100644
index 0000000..63088f5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/arrow-left-white.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/arrow-right-white.gif b/deluge/ui/web/docs/template/resources/images/default/grid/arrow-right-white.gif
new file mode 100644
index 0000000..e9e0678
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/arrow-right-white.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/col-move-bottom.gif b/deluge/ui/web/docs/template/resources/images/default/grid/col-move-bottom.gif
new file mode 100644
index 0000000..cc1e473
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/col-move-bottom.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/col-move-top.gif b/deluge/ui/web/docs/template/resources/images/default/grid/col-move-top.gif
new file mode 100644
index 0000000..58ff32c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/col-move-top.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/columns.gif b/deluge/ui/web/docs/template/resources/images/default/grid/columns.gif
new file mode 100644
index 0000000..2d3a823
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/columns.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/dirty.gif b/deluge/ui/web/docs/template/resources/images/default/grid/dirty.gif
new file mode 100644
index 0000000..4f217a4
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/dirty.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/done.gif b/deluge/ui/web/docs/template/resources/images/default/grid/done.gif
new file mode 100644
index 0000000..a937cb2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/done.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/drop-no.gif b/deluge/ui/web/docs/template/resources/images/default/grid/drop-no.gif
new file mode 100644
index 0000000..31a332b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/drop-no.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/drop-yes.gif b/deluge/ui/web/docs/template/resources/images/default/grid/drop-yes.gif
new file mode 100644
index 0000000..926010e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/drop-yes.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/footer-bg.gif b/deluge/ui/web/docs/template/resources/images/default/grid/footer-bg.gif
new file mode 100644
index 0000000..126120f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/footer-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-hd.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-hd.gif
new file mode 100644
index 0000000..862094e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-hd.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-split.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-split.gif
new file mode 100644
index 0000000..5286f58
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-blue-split.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-hrow.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-hrow.gif
new file mode 100644
index 0000000..6374104
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-hrow.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-loading.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-loading.gif
new file mode 100644
index 0000000..d112c54
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-loading.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-split.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-split.gif
new file mode 100644
index 0000000..c76a16e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-split.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid-vista-hd.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid-vista-hd.gif
new file mode 100644
index 0000000..d097263
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid-vista-hd.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hd-btn.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hd-btn.gif
new file mode 100644
index 0000000..2112607
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hd-btn.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow-over.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow-over.gif
new file mode 100644
index 0000000..f9c07af
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow-over.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow.gif
new file mode 100644
index 0000000..8d459a3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-hrow.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-bg.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-bg.gif
new file mode 100644
index 0000000..0b4d6ca
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-sel-bg.gif b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-sel-bg.gif
new file mode 100644
index 0000000..1dfe9a6
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/grid3-special-col-sel-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/group-by.gif b/deluge/ui/web/docs/template/resources/images/default/grid/group-by.gif
new file mode 100644
index 0000000..d6075bb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/group-by.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/group-expand-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/grid/group-expand-sprite.gif
new file mode 100644
index 0000000..9c1653b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/group-expand-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hd-pop.gif b/deluge/ui/web/docs/template/resources/images/default/grid/hd-pop.gif
new file mode 100644
index 0000000..eb8ba79
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hd-pop.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-asc.gif b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-asc.gif
new file mode 100644
index 0000000..8917e0e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-asc.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-desc.gif b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-desc.gif
new file mode 100644
index 0000000..f26b7c2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-desc.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.gif b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.gif
new file mode 100644
index 0000000..1596126
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.png b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.png
new file mode 100644
index 0000000..8b81e7f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-lock.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.gif b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.gif
new file mode 100644
index 0000000..af59cf9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.png b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.png
new file mode 100644
index 0000000..9dd5df3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/hmenu-unlock.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/invalid_line.gif b/deluge/ui/web/docs/template/resources/images/default/grid/invalid_line.gif
new file mode 100644
index 0000000..fb7e0f3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/invalid_line.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/loading.gif b/deluge/ui/web/docs/template/resources/images/default/grid/loading.gif
new file mode 100644
index 0000000..e846e1d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/loading.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/mso-hd.gif b/deluge/ui/web/docs/template/resources/images/default/grid/mso-hd.gif
new file mode 100644
index 0000000..669f3cf
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/mso-hd.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/nowait.gif b/deluge/ui/web/docs/template/resources/images/default/grid/nowait.gif
new file mode 100644
index 0000000..4c5862c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/nowait.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-first-disabled.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-first-disabled.gif
new file mode 100644
index 0000000..1e02c41
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-first-disabled.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-first.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-first.gif
new file mode 100644
index 0000000..d84f41a
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-first.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-last-disabled.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-last-disabled.gif
new file mode 100644
index 0000000..8697067
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-last-disabled.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-last.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-last.gif
new file mode 100644
index 0000000..3df5c2b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-last.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-next-disabled.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-next-disabled.gif
new file mode 100644
index 0000000..90a7756
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-next-disabled.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-next.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-next.gif
new file mode 100644
index 0000000..9601635
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-next.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-prev-disabled.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-prev-disabled.gif
new file mode 100644
index 0000000..37154d6
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-prev-disabled.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/page-prev.gif b/deluge/ui/web/docs/template/resources/images/default/grid/page-prev.gif
new file mode 100644
index 0000000..eb70cf8
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/page-prev.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/pick-button.gif b/deluge/ui/web/docs/template/resources/images/default/grid/pick-button.gif
new file mode 100644
index 0000000..6957924
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/pick-button.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/refresh.gif b/deluge/ui/web/docs/template/resources/images/default/grid/refresh.gif
new file mode 100644
index 0000000..110f684
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/refresh.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/row-check-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/grid/row-check-sprite.gif
new file mode 100644
index 0000000..6101164
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/row-check-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/row-expand-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/grid/row-expand-sprite.gif
new file mode 100644
index 0000000..6f4d874
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/row-expand-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/row-over.gif b/deluge/ui/web/docs/template/resources/images/default/grid/row-over.gif
new file mode 100644
index 0000000..b288e38
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/row-over.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/row-sel.gif b/deluge/ui/web/docs/template/resources/images/default/grid/row-sel.gif
new file mode 100644
index 0000000..98209e6
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/row-sel.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/sort_asc.gif b/deluge/ui/web/docs/template/resources/images/default/grid/sort_asc.gif
new file mode 100644
index 0000000..67a2a4c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/sort_asc.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/sort_desc.gif b/deluge/ui/web/docs/template/resources/images/default/grid/sort_desc.gif
new file mode 100644
index 0000000..34db47c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/sort_desc.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/grid/wait.gif b/deluge/ui/web/docs/template/resources/images/default/grid/wait.gif
new file mode 100644
index 0000000..471c1a4
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/grid/wait.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/collapse.gif b/deluge/ui/web/docs/template/resources/images/default/layout/collapse.gif
new file mode 100644
index 0000000..d87b0a9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/collapse.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/expand.gif b/deluge/ui/web/docs/template/resources/images/default/layout/expand.gif
new file mode 100644
index 0000000..7b6e1c1
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/expand.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/gradient-bg.gif b/deluge/ui/web/docs/template/resources/images/default/layout/gradient-bg.gif
new file mode 100644
index 0000000..8134e49
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/gradient-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/mini-bottom.gif b/deluge/ui/web/docs/template/resources/images/default/layout/mini-bottom.gif
new file mode 100644
index 0000000..c18f9e3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/mini-bottom.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/mini-left.gif b/deluge/ui/web/docs/template/resources/images/default/layout/mini-left.gif
new file mode 100644
index 0000000..99f7993
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/mini-left.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/mini-right.gif b/deluge/ui/web/docs/template/resources/images/default/layout/mini-right.gif
new file mode 100644
index 0000000..5b13c5a
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/mini-right.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/mini-top.gif b/deluge/ui/web/docs/template/resources/images/default/layout/mini-top.gif
new file mode 100644
index 0000000..a4ca2bb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/mini-top.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/ns-collapse.gif b/deluge/ui/web/docs/template/resources/images/default/layout/ns-collapse.gif
new file mode 100644
index 0000000..df2a77e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/ns-collapse.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/ns-expand.gif b/deluge/ui/web/docs/template/resources/images/default/layout/ns-expand.gif
new file mode 100644
index 0000000..77ab9da
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/ns-expand.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/panel-close.gif b/deluge/ui/web/docs/template/resources/images/default/layout/panel-close.gif
new file mode 100644
index 0000000..2bdd623
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/panel-close.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-bg.gif b/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-bg.gif
new file mode 100644
index 0000000..d1daef5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-light-bg.gif b/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-light-bg.gif
new file mode 100644
index 0000000..8c2c83d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/panel-title-light-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/stick.gif b/deluge/ui/web/docs/template/resources/images/default/layout/stick.gif
new file mode 100644
index 0000000..5a1e8ba
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/stick.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/stuck.gif b/deluge/ui/web/docs/template/resources/images/default/layout/stuck.gif
new file mode 100644
index 0000000..0a8de4d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/stuck.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/tab-close-on.gif b/deluge/ui/web/docs/template/resources/images/default/layout/tab-close-on.gif
new file mode 100644
index 0000000..eacea39
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/tab-close-on.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/layout/tab-close.gif b/deluge/ui/web/docs/template/resources/images/default/layout/tab-close.gif
new file mode 100644
index 0000000..45db61e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/layout/tab-close.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/checked.gif b/deluge/ui/web/docs/template/resources/images/default/menu/checked.gif
new file mode 100644
index 0000000..fad5893
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/checked.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/group-checked.gif b/deluge/ui/web/docs/template/resources/images/default/menu/group-checked.gif
new file mode 100644
index 0000000..d30b3e5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/group-checked.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/item-over.gif b/deluge/ui/web/docs/template/resources/images/default/menu/item-over.gif
new file mode 100644
index 0000000..0167839
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/item-over.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/menu-parent.gif b/deluge/ui/web/docs/template/resources/images/default/menu/menu-parent.gif
new file mode 100644
index 0000000..1e37562
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/menu-parent.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/menu.gif b/deluge/ui/web/docs/template/resources/images/default/menu/menu.gif
new file mode 100644
index 0000000..30a2c4b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/menu.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/menu/unchecked.gif b/deluge/ui/web/docs/template/resources/images/default/menu/unchecked.gif
new file mode 100644
index 0000000..43823e5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/menu/unchecked.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/corners-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/panel/corners-sprite.gif
new file mode 100644
index 0000000..aa0d0ed
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/corners-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/left-right.gif b/deluge/ui/web/docs/template/resources/images/default/panel/left-right.gif
new file mode 100644
index 0000000..9fae2d5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/left-right.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/light-hd.gif b/deluge/ui/web/docs/template/resources/images/default/panel/light-hd.gif
new file mode 100644
index 0000000..58d6747
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/light-hd.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprite-tpl.gif b/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprite-tpl.gif
new file mode 100644
index 0000000..e647867
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprite-tpl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprites.gif b/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprites.gif
new file mode 100644
index 0000000..cca91e8
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/tool-sprites.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/tools-sprites-trans.gif b/deluge/ui/web/docs/template/resources/images/default/panel/tools-sprites-trans.gif
new file mode 100644
index 0000000..e58bf20
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/tools-sprites-trans.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.gif b/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.gif
new file mode 100644
index 0000000..be6c50e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.png b/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.png
new file mode 100644
index 0000000..578ffb6
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/top-bottom.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/white-corners-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/panel/white-corners-sprite.gif
new file mode 100644
index 0000000..22d4bba
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/white-corners-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/white-left-right.gif b/deluge/ui/web/docs/template/resources/images/default/panel/white-left-right.gif
new file mode 100644
index 0000000..d82c337
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/white-left-right.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/panel/white-top-bottom.gif b/deluge/ui/web/docs/template/resources/images/default/panel/white-top-bottom.gif
new file mode 100644
index 0000000..fe7dd1c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/panel/white-top-bottom.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/progress/progress-bg.gif b/deluge/ui/web/docs/template/resources/images/default/progress/progress-bg.gif
new file mode 100644
index 0000000..1c1abeb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/progress/progress-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/qtip/bg.gif b/deluge/ui/web/docs/template/resources/images/default/qtip/bg.gif
new file mode 100644
index 0000000..43488af
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/qtip/bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/qtip/close.gif b/deluge/ui/web/docs/template/resources/images/default/qtip/close.gif
new file mode 100644
index 0000000..69ab915
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/qtip/close.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/qtip/tip-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/qtip/tip-sprite.gif
new file mode 100644
index 0000000..9810aca
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/qtip/tip-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/s.gif b/deluge/ui/web/docs/template/resources/images/default/s.gif
new file mode 100644
index 0000000..1d11fa9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/s.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shadow-c.png b/deluge/ui/web/docs/template/resources/images/default/shadow-c.png
new file mode 100644
index 0000000..d435f80
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shadow-c.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shadow-c.psd b/deluge/ui/web/docs/template/resources/images/default/shadow-c.psd
new file mode 100644
index 0000000..28bbe69
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shadow-c.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shadow-lr.png b/deluge/ui/web/docs/template/resources/images/default/shadow-lr.png
new file mode 100644
index 0000000..bb88b6f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shadow-lr.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shadow.png b/deluge/ui/web/docs/template/resources/images/default/shadow.png
new file mode 100644
index 0000000..75c0eba
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shadow.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/blue-loading.gif b/deluge/ui/web/docs/template/resources/images/default/shared/blue-loading.gif
new file mode 100644
index 0000000..3bbf639
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/blue-loading.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/calendar.gif b/deluge/ui/web/docs/template/resources/images/default/shared/calendar.gif
new file mode 100644
index 0000000..133cf23
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/calendar.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/glass-bg.gif b/deluge/ui/web/docs/template/resources/images/default/shared/glass-bg.gif
new file mode 100644
index 0000000..26fbbae
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/glass-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/hd-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/shared/hd-sprite.gif
new file mode 100644
index 0000000..42da1ea
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/hd-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/large-loading.gif b/deluge/ui/web/docs/template/resources/images/default/shared/large-loading.gif
new file mode 100644
index 0000000..b36b555
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/large-loading.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/left-btn.gif b/deluge/ui/web/docs/template/resources/images/default/shared/left-btn.gif
new file mode 100644
index 0000000..a0ddd9e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/left-btn.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/loading-balls.gif b/deluge/ui/web/docs/template/resources/images/default/shared/loading-balls.gif
new file mode 100644
index 0000000..9ce214b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/loading-balls.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/right-btn.gif b/deluge/ui/web/docs/template/resources/images/default/shared/right-btn.gif
new file mode 100644
index 0000000..dee63e2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/right-btn.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/shared/warning.gif b/deluge/ui/web/docs/template/resources/images/default/shared/warning.gif
new file mode 100644
index 0000000..806d4bc
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/shared/warning.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle-dark.gif
new file mode 100644
index 0000000..b5486c1
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle.gif
new file mode 100644
index 0000000..00ba835
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/e-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle-dark.gif
new file mode 100644
index 0000000..04e5ecf
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle.gif
new file mode 100644
index 0000000..09405c7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/ne-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle-dark.gif
new file mode 100644
index 0000000..6e49d69
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle.gif
new file mode 100644
index 0000000..2fcea8a
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/nw-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle-dark.gif
new file mode 100644
index 0000000..4eb5f0f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle.gif
new file mode 100644
index 0000000..bf069c2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/s-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle-dark.gif
new file mode 100644
index 0000000..c4c1087
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle.gif
new file mode 100644
index 0000000..972055e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/se-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/square.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/square.gif
new file mode 100644
index 0000000..14ce6f7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/square.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle-dark.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle-dark.gif
new file mode 100644
index 0000000..77224b0
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle-dark.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle.gif b/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle.gif
new file mode 100644
index 0000000..3ca0ed9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/sizer/sw-handle.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/slider/slider-bg.png b/deluge/ui/web/docs/template/resources/images/default/slider/slider-bg.png
new file mode 100644
index 0000000..9999194
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/slider/slider-bg.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/slider/slider-thumb.png b/deluge/ui/web/docs/template/resources/images/default/slider/slider-thumb.png
new file mode 100644
index 0000000..cd654a4
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/slider/slider-thumb.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-bg.png b/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-bg.png
new file mode 100644
index 0000000..121450c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-bg.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-thumb.png b/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-thumb.png
new file mode 100644
index 0000000..7b3d725
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/slider/slider-v-thumb.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-left.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-left.gif
new file mode 100644
index 0000000..9f2f6d1
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-left.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-right.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-right.gif
new file mode 100644
index 0000000..4c5e7e3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/scroll-right.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/scroller-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/scroller-bg.gif
new file mode 100644
index 0000000..099b90d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/scroller-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-left-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644
index 0000000..188bf94
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-left-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-right-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644
index 0000000..e1f5e3c
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-inactive-right-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-left-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-left-bg.gif
new file mode 100644
index 0000000..e695186
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-left-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-right-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-right-bg.gif
new file mode 100644
index 0000000..dde7968
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-btm-right-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-close.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-close.gif
new file mode 100644
index 0000000..e699878
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-close.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.gif
new file mode 100644
index 0000000..34f1333
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.png b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.png
new file mode 100644
index 0000000..fa8ab3f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-bg.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-btm-bg.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-btm-bg.gif
new file mode 100644
index 0000000..5eaba1e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tab-strip-btm-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tabs/tabs-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/tabs/tabs-sprite.gif
new file mode 100644
index 0000000..e969fb0
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tabs/tabs-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/bg.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/bg.gif
new file mode 100644
index 0000000..0b085bf
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow-light.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow-light.gif
new file mode 100644
index 0000000..b0e24b5
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow-light.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow.gif
new file mode 100644
index 0000000..8acb460
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-arrow.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-over-bg.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-over-bg.gif
new file mode 100644
index 0000000..ee2dd98
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/btn-over-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/gray-bg.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/gray-bg.gif
new file mode 100644
index 0000000..bd49438
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/gray-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-bg.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-bg.gif
new file mode 100644
index 0000000..4969e4e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-btn-sprite.gif b/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-btn-sprite.gif
new file mode 100644
index 0000000..19bbef3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/toolbar/tb-btn-sprite.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/arrows.gif b/deluge/ui/web/docs/template/resources/images/default/tree/arrows.gif
new file mode 100644
index 0000000..f8ff7b8
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/arrows.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-add.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-add.gif
new file mode 100644
index 0000000..b22cd14
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-add.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-between.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-between.gif
new file mode 100644
index 0000000..5c6c09d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-between.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-no.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-no.gif
new file mode 100644
index 0000000..9d9c6a9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-no.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-over.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-over.gif
new file mode 100644
index 0000000..30d1ca7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-over.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-under.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-under.gif
new file mode 100644
index 0000000..85f66b1
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-under.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/drop-yes.gif b/deluge/ui/web/docs/template/resources/images/default/tree/drop-yes.gif
new file mode 100644
index 0000000..8aacb30
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/drop-yes.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus-nl.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus-nl.gif
new file mode 100644
index 0000000..928779e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus-nl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus.gif
new file mode 100644
index 0000000..9a8d727
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-minus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus-nl.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus-nl.gif
new file mode 100644
index 0000000..9f7f698
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus-nl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus.gif
new file mode 100644
index 0000000..5943a01
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end-plus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end.gif
new file mode 100644
index 0000000..f24ddee
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-end.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-line.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-line.gif
new file mode 100644
index 0000000..75e6da4
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-line.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus-nl.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus-nl.gif
new file mode 100644
index 0000000..928779e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus-nl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus.gif
new file mode 100644
index 0000000..97dcc71
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-minus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus-nl.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus-nl.gif
new file mode 100644
index 0000000..9f7f698
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus-nl.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus.gif
new file mode 100644
index 0000000..698de47
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow-plus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/elbow.gif b/deluge/ui/web/docs/template/resources/images/default/tree/elbow.gif
new file mode 100644
index 0000000..b8f4208
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/elbow.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/folder-open.gif b/deluge/ui/web/docs/template/resources/images/default/tree/folder-open.gif
new file mode 100644
index 0000000..56ba737
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/folder-open.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/folder.gif b/deluge/ui/web/docs/template/resources/images/default/tree/folder.gif
new file mode 100644
index 0000000..20412f7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/folder.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/leaf.gif b/deluge/ui/web/docs/template/resources/images/default/tree/leaf.gif
new file mode 100644
index 0000000..445769d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/leaf.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/loading.gif b/deluge/ui/web/docs/template/resources/images/default/tree/loading.gif
new file mode 100644
index 0000000..e846e1d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/loading.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/tree/s.gif b/deluge/ui/web/docs/template/resources/images/default/tree/s.gif
new file mode 100644
index 0000000..1d11fa9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/tree/s.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/icon-error.gif b/deluge/ui/web/docs/template/resources/images/default/window/icon-error.gif
new file mode 100644
index 0000000..397b655
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/icon-error.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/icon-info.gif b/deluge/ui/web/docs/template/resources/images/default/window/icon-info.gif
new file mode 100644
index 0000000..58281c3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/icon-info.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/icon-question.gif b/deluge/ui/web/docs/template/resources/images/default/window/icon-question.gif
new file mode 100644
index 0000000..08abd82
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/icon-question.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/icon-warning.gif b/deluge/ui/web/docs/template/resources/images/default/window/icon-warning.gif
new file mode 100644
index 0000000..27ff98b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/icon-warning.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/left-corners.png b/deluge/ui/web/docs/template/resources/images/default/window/left-corners.png
new file mode 100644
index 0000000..18e215d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/left-corners.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/left-corners.psd b/deluge/ui/web/docs/template/resources/images/default/window/left-corners.psd
new file mode 100644
index 0000000..3d7f062
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/left-corners.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/left-right.png b/deluge/ui/web/docs/template/resources/images/default/window/left-right.png
new file mode 100644
index 0000000..97d04f3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/left-right.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/left-right.psd b/deluge/ui/web/docs/template/resources/images/default/window/left-right.psd
new file mode 100644
index 0000000..f490c5e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/left-right.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/right-corners.png b/deluge/ui/web/docs/template/resources/images/default/window/right-corners.png
new file mode 100644
index 0000000..101118b
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/right-corners.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/right-corners.psd b/deluge/ui/web/docs/template/resources/images/default/window/right-corners.psd
new file mode 100644
index 0000000..86d5095
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/right-corners.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.png b/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.png
new file mode 100644
index 0000000..a739234
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.png
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.psd b/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.psd
new file mode 100644
index 0000000..d2b2302
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/images/default/window/top-bottom.psd
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/inherited.gif b/deluge/ui/web/docs/template/resources/inherited.gif
new file mode 100644
index 0000000..63039d9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/inherited.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/member-collapsed.gif b/deluge/ui/web/docs/template/resources/member-collapsed.gif
new file mode 100644
index 0000000..16bce1d
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/member-collapsed.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/member-expanded.gif b/deluge/ui/web/docs/template/resources/member-expanded.gif
new file mode 100644
index 0000000..d72c132
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/member-expanded.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/member-hover.gif b/deluge/ui/web/docs/template/resources/member-hover.gif
new file mode 100644
index 0000000..9b53390
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/member-hover.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/method.gif b/deluge/ui/web/docs/template/resources/method.gif
new file mode 100644
index 0000000..af74265
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/method.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/minus.gif b/deluge/ui/web/docs/template/resources/minus.gif
new file mode 100644
index 0000000..2c63585
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/minus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/pkg-closed.gif b/deluge/ui/web/docs/template/resources/pkg-closed.gif
new file mode 100644
index 0000000..71139cb
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/pkg-closed.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/pkg-open.gif b/deluge/ui/web/docs/template/resources/pkg-open.gif
new file mode 100644
index 0000000..ffd18a3
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/pkg-open.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/pkg.gif b/deluge/ui/web/docs/template/resources/pkg.gif
new file mode 100644
index 0000000..d3d3448
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/pkg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/plus.gif b/deluge/ui/web/docs/template/resources/plus.gif
new file mode 100644
index 0000000..c09f82e
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/plus.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/prettify/prettify.css b/deluge/ui/web/docs/template/resources/prettify/prettify.css
new file mode 100644
index 0000000..0f1ed75
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/prettify/prettify.css
@@ -0,0 +1 @@
+.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}pre.prettyprint{padding:2px;border:1px solid #888}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}} \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/prettify/prettify.js b/deluge/ui/web/docs/template/resources/prettify/prettify.js
new file mode 100644
index 0000000..f8f4f7f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/prettify/prettify.js
@@ -0,0 +1,25 @@
+function _pr_isIE6(){var F=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);_pr_isIE6=function(){return F};return F}var aa="break continue do else for if return while ",ba="auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile ",ca="catch class delete false import new operator private protected public this throw true try ",da="alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",
+ea="boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",fa="as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",ga="debugger eval export function get null set undefined var with Infinity NaN ",ha="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",
+ia="and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",ja="alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",ka="case done elif esac eval fi function in local set then until ",la="a",ma="z",na="A",oa="Z",pa="!",qa="!=",ra="!==",s="#",sa="%",Ha="%=",v="&",Ia="&&",Ja="&&=",Ka="&=",La=
+"(",Ma="*",Na="*=",Oa="+=",Pa=",",Qa="-=",Ra="->",w="/",Sa="/=",Ta=":",Ua="::",y=";",z="<",Va="<<",Wa="<<=",Xa="<=",Ya="=",Za="==",$a="===",A=">",ab=">=",bb=">>",cb=">>=",db=">>>",eb=">>>=",fb="?",C="@",gb="[",hb="^",ib="^=",jb="^^",kb="^^=",lb="{",mb="|",nb="|=",ob="||",pb="||=",qb="~",rb="break",sb="case",tb="continue",ub="delete",vb="do",wb="else",xb="finally",yb="instanceof",zb="return",Ab="throw",Bb="try",Cb="typeof",Db="(?:(?:(?:^|[^0-9.])\\.{1,3})|(?:(?:^|[^\\+])\\+)|(?:(?:^|[^\\-])-)",Eb=
+"|\\b",Fb="\\$1",Gb="|^)\\s*$",Hb="&amp;",Ib="&lt;",Jb="&gt;",Kb="&quot;",Lb="&#",Mb="x",Nb="'",G='"',Ob=" ",Pb="XMP",Qb="</",Rb='="',H="PRE",Sb='<!DOCTYPE foo PUBLIC "foo bar">\n<foo />',I="",Tb="\t",Ub="\n",Vb="nocode",Wb=' $1="$2$3$4"',J="pln",O="com",Xb="dec",P="src",Q="tag",R="atv",S="pun",Yb="<>/=",X="atn",Zb=" \t\r\n",Y="str",$b="'\"",ac="'\"`",bc="\"'",cc=" \r\n",Z="lit",dc="123456789",ec=".",fc="kwd",gc="typ",$="</span>",hc='<span class="',ic='">',jc="$1&nbsp;",kc="<br />",lc="console",mc=
+"cannot override language handler %s",nc="default-code",oc="default-markup",pc="html",qc="htm",rc="xhtml",sc="xml",tc="xsl",uc="c",vc="cc",wc="cpp",xc="cs",yc="cxx",zc="cyc",Ac="java",Bc="bsh",Cc="csh",Dc="sh",Ec="cv",Fc="py",Gc="perl",Hc="pl",Ic="pm",Jc="rb",Kc="js",Lc="pre",Mc="code",Nc="xmp",Oc="prettyprint",Pc="class",Qc="br",Rc="\r\n";(function(){function F(b){b=b.split(/ /g);var a={};for(var c=b.length;--c>=0;){var d=b[c];if(d)a[d]=null}return a}var K=aa,Sc=K+ba,T=Sc+ca,ta=T+da,ua=T+ea,Tc=ua+
+fa,va=T+ga,wa=ha,xa=K+ia,ya=K+ja,za=K+ka,Uc=ta+Tc+va+wa+xa+ya+za;function Vc(b){return b>=la&&b<=ma||b>=na&&b<=oa}function D(b,a,c,d){b.unshift(c,d||0);try{a.splice.apply(a,b)}finally{b.splice(0,2)}}var Wc=(function(){var b=[pa,qa,ra,s,sa,Ha,v,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,w,Sa,Ta,Ua,y,z,Va,Wa,Xa,Ya,Za,$a,A,ab,bb,cb,db,eb,fb,C,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb],a=Db;for(var c=0;c<b.length;++c){var d=b[c];a+=Vc(d.charAt(0))?Eb+d:mb+d.replace(/([^=<>:&])/g,Fb)}a+=
+Gb;return new RegExp(a)})(),Aa=/&/g,Ba=/</g,Ca=/>/g,Xc=/\"/g;function Yc(b){return b.replace(Aa,Hb).replace(Ba,Ib).replace(Ca,Jb).replace(Xc,Kb)}function U(b){return b.replace(Aa,Hb).replace(Ba,Ib).replace(Ca,Jb)}var Zc=/&lt;/g,$c=/&gt;/g,ad=/&apos;/g,bd=/&quot;/g,cd=/&amp;/g,dd=/&nbsp;/g;function ed(b){var a=b.indexOf(v);if(a<0)return b;for(--a;(a=b.indexOf(Lb,a+1))>=0;){var c=b.indexOf(y,a);if(c>=0){var d=b.substring(a+3,c),g=10;if(d&&d.charAt(0)===Mb){d=d.substring(1);g=16}var e=parseInt(d,g);
+if(!isNaN(e))b=b.substring(0,a)+String.fromCharCode(e)+b.substring(c+1)}}return b.replace(Zc,z).replace($c,A).replace(ad,Nb).replace(bd,G).replace(cd,v).replace(dd,Ob)}function Da(b){return Pb===b.tagName}function L(b,a){switch(b.nodeType){case 1:var c=b.tagName.toLowerCase();a.push(z,c);for(var d=0;d<b.attributes.length;++d){var g=b.attributes[d];if(!g.specified)continue;a.push(Ob);L(g,a)}a.push(A);for(var e=b.firstChild;e;e=e.nextSibling)L(e,a);if(b.firstChild||!/^(?:br|link|img)$/.test(c))a.push(Qb,
+c,A);break;case 2:a.push(b.name.toLowerCase(),Rb,Yc(b.value),G);break;case 3:case 4:a.push(U(b.nodeValue));break}}var V=null;function fd(b){if(null===V){var a=document.createElement(H);a.appendChild(document.createTextNode(Sb));V=!/</.test(a.innerHTML)}if(V){var c=b.innerHTML;if(Da(b))c=U(c);return c}var d=[];for(var g=b.firstChild;g;g=g.nextSibling)L(g,d);return d.join(I)}function gd(b){var a=0;return function(c){var d=null,g=0;for(var e=0,h=c.length;e<h;++e){var f=c.charAt(e);switch(f){case Tb:if(!d)d=
+[];d.push(c.substring(g,e));var i=b-a%b;a+=i;for(;i>=0;i-=" ".length)d.push(" ".substring(0,i));g=e+1;break;case Ub:a=0;break;default:++a}}if(!d)return c;d.push(c.substring(g));return d.join(I)}}var hd=/(?:[^<]+|<!--[\s\S]*?--\>|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g,id=/^<!--/,jd=/^<\[CDATA\[/,kd=/^<br\b/i,Ea=/^<(\/?)([a-zA-Z]+)/;function ld(b){var a=b.match(hd),c=[],d=0,g=[];if(a)for(var e=0,h=a.length;e<h;++e){var f=a[e];if(f.length>1&&f.charAt(0)===z){if(id.test(f))continue;
+if(jd.test(f)){c.push(f.substring(9,f.length-3));d+=f.length-12}else if(kd.test(f)){c.push(Ub);++d}else if(f.indexOf(Vb)>=0&&!!f.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,Wb).match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var i=f.match(Ea)[2],j=1;end_tag_loop:for(var m=e+1;m<h;++m){var o=a[m].match(Ea);if(o&&o[2]===i)if(o[1]===w){if(--j===0)break end_tag_loop}else++j}if(m<h){g.push(d,a.slice(e,m+1).join(I));e=m}else g.push(d,f)}else g.push(d,f)}else{var k=ed(f);c.push(k);d+=k.length}}return{source:c.join(I),
+tags:g}}function E(b,a){var c={};(function(){var e=b.concat(a);for(var h=e.length;--h>=0;){var f=e[h],i=f[3];if(i)for(var j=i.length;--j>=0;)c[i.charAt(j)]=f}})();var d=a.length,g=/\S/;return function(e,h){h=h||0;var f=[h,J],i=I,j=0,m=e;while(m.length){var o,k=null,p,l=c[m.charAt(0)];if(l){p=m.match(l[1]);k=p[0];o=l[0]}else{for(var n=0;n<d;++n){l=a[n];var q=l[2];if(q&&!q.test(i))continue;p=m.match(l[1]);if(p){k=p[0];o=l[0];break}}if(!k){o=J;k=m.substring(0,1)}}f.push(h+j,o);j+=k.length;m=m.substring(k.length);
+if(o!==O&&g.test(k))i=k}return f}}var md=E([],[[J,/^[^<]+/,null],[Xb,/^<!\w[^>]*(?:>|$)/,null],[O,/^<!--[\s\S]*?(?:--\>|$)/,null],[P,/^<\?[\s\S]*?(?:\?>|$)/,null],[P,/^<%[\s\S]*?(?:%>|$)/,null],[P,/^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i,null],[Q,/^<\/?\w[^<>]*>/,null]]);function nd(b){var a=md(b);for(var c=0;c<a.length;c+=2)if(a[c+1]===P){var d,g;d=a[c];g=c+2<a.length?a[c+2]:b.length;var e=b.substring(d,g),h=e.match(/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/);if(h)a.splice(c,2,d,Q,d+h[1].length,
+P,d+h[1].length+(h[2]||I).length,Q)}return a}var od=E([[R,/^\'[^\']*(?:\'|$)/,null,Nb],[R,/^\"[^\"]*(?:\"|$)/,null,G],[S,/^[<>\/=]+/,null,Yb]],[[Q,/^[\w:\-]+/,/^</],[R,/^[\w\-]+/,/^=/],[X,/^[\w:\-]+/,null],[J,/^\s+/,null,Zb]]);function pd(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d===Q){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=b.substring(g,e),f=od(h,g);D(f,a,c,2);c+=f.length-2}}return a}function u(b){var a=[],c=[];if(b.tripleQuotedStrings)a.push([Y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
+null,$b]);else if(b.multiLineStrings)a.push([Y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,ac]);else a.push([Y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,bc]);c.push([J,/^(?:[^\'\"\`\/\#]+)/,null,cc]);if(b.hashComments)a.push([O,/^#[^\r\n]*/,null,s]);if(b.cStyleComments){c.push([O,/^\/\/[^\r\n]*/,null]);c.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(b.regexLiterals)c.push([Y,/^\/(?=[^\/*])(?:[^\/\x5B\x5C]|\x5C[\s\S]|\x5B(?:[^\x5C\x5D]|\x5C[\s\S])*(?:\x5D|$))+(?:\/|$)/,
+Wc]);var d=F(b.keywords);b=null;var g=E(a,c),e=E([],[[J,/^\s+/,null,cc],[J,/^[a-z_$@][a-z_$@0-9]*/i,null],[Z,/^0x[a-f0-9]+[a-z]/i,null],[Z,/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,null,dc],[S,/^[^\s\w\.$@]+/,null]]);function h(f,i){for(var j=0;j<i.length;j+=2){var m=i[j+1];if(m===J){var o,k,p,l;o=i[j];k=j+2<i.length?i[j+2]:f.length;p=f.substring(o,k);l=e(p,o);for(var n=0,q=l.length;n<q;n+=2){var r=l[n+1];if(r===J){var B=l[n],M=n+2<q?l[n+2]:p.length,x=f.substring(B,M);if(x===ec)l[n+
+1]=S;else if(x in d)l[n+1]=fc;else if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(x))l[n+1]=x.charAt(0)===C?Z:gc}}D(l,i,j,2);j+=l.length-2}}return i}return function(f){var i=g(f);i=h(f,i);return i}}var W=u({keywords:Uc,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function qd(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d===P){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=W(b.substring(g,e));for(var f=0,i=h.length;f<i;f+=2)h[f]+=g;D(h,a,c,2);c+=h.length-2}}return a}
+function rd(b,a){var c=false;for(var d=0;d<a.length;d+=2){var g=a[d+1],e,h;if(g===X){e=a[d];h=d+2<a.length?a[d+2]:b.length;c=/^on|^style$/i.test(b.substring(e,h))}else if(g===R){if(c){e=a[d];h=d+2<a.length?a[d+2]:b.length;var f=b.substring(e,h),i=f.length,j=i>=2&&/^[\"\']/.test(f)&&f.charAt(0)===f.charAt(i-1),m,o,k;if(j){o=e+1;k=h-1;m=f}else{o=e+1;k=h-1;m=f.substring(1,f.length-1)}var p=W(m);for(var l=0,n=p.length;l<n;l+=2)p[l]+=o;if(j){p.push(k,R);D(p,a,d+2,0)}else D(p,a,d,2)}c=false}}return a}function sd(b){var a=
+nd(b);a=pd(b,a);a=qd(b,a);a=rd(b,a);return a}function td(b,a,c){var d=[],g=0,e=null,h=null,f=0,i=0,j=gd(8),m=/([\r\n ]) /g,o=/(^| ) /gm,k=/\r\n?|\n/g,p=/[ \r\n]$/,l=true;function n(r){if(r>g){if(e&&e!==h){d.push($);e=null}if(!e&&h){e=h;d.push(hc,e,ic)}var B=U(j(b.substring(g,r))).replace(l?o:m,jc);l=p.test(B);d.push(B.replace(k,kc));g=r}}while(true){var q;q=f<a.length?(i<c.length?a[f]<=c[i]:true):false;if(q){n(a[f]);if(e){d.push($);e=null}d.push(a[f+1]);f+=2}else if(i<c.length){n(c[i]);h=c[i+1];i+=
+2}else break}n(b.length);if(e)d.push($);return d.join(I)}var N={};function t(b,a){for(var c=a.length;--c>=0;){var d=a[c];if(!N.hasOwnProperty(d))N[d]=b;else if(lc in window)console.log(mc,d)}}t(W,[nc]);t(sd,[oc,pc,qc,rc,sc,tc]);t(u({keywords:ta,hashComments:true,cStyleComments:true}),[uc,vc,wc,xc,yc,zc]);t(u({keywords:ua,cStyleComments:true}),[Ac]);t(u({keywords:za,hashComments:true,multiLineStrings:true}),[Bc,Cc,Dc]);t(u({keywords:xa,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),
+[Ec,Fc]);t(u({keywords:wa,hashComments:true,multiLineStrings:true,regexLiterals:true}),[Gc,Hc,Ic]);t(u({keywords:ya,hashComments:true,multiLineStrings:true,regexLiterals:true}),[Jc]);t(u({keywords:va,cStyleComments:true,regexLiterals:true}),[Kc]);function Fa(b,a){try{var c=ld(b),d=c.source,g=c.tags;if(!N.hasOwnProperty(a))a=/^\s*</.test(d)?oc:nc;var e=N[a].call({},d);return td(d,g,e)}catch(h){if(lc in window){console.log(h);console.trace()}return b}}function ud(b){var a=_pr_isIE6(),c=[document.getElementsByTagName(Lc),
+document.getElementsByTagName(Mc),document.getElementsByTagName(Nc)],d=[];for(var g=0;g<c.length;++g)for(var e=0;e<c[g].length;++e)d.push(c[g][e]);c=null;var h=0;function f(){var i=(new Date).getTime()+250;for(;h<d.length&&(new Date).getTime()<i;h++){var j=d[h];if(j.className&&j.className.indexOf(Oc)>=0){var m=j.className.match(/\blang-(\w+)\b/);if(m)m=m[1];var o=false;for(var k=j.parentNode;k;k=k.parentNode)if((k.tagName===Lc||k.tagName===Mc||k.tagName===Nc)&&k.className&&k.className.indexOf(Oc)>=
+0){o=true;break}if(!o){var p=fd(j);p=p.replace(/(?:\r\n?|\n)$/,I);var l=Fa(p,m);if(!Da(j))j.innerHTML=l;else{var n=document.createElement(H);for(var q=0;q<j.attributes.length;++q){var r=j.attributes[q];if(r.specified){var B=r.name.toLowerCase();if(B===Pc)n.className=r.value;else n.setAttribute(r.name,r.value)}}n.innerHTML=l;j.parentNode.replaceChild(n,j);j=n}if(a&&j.tagName===H){var M=j.getElementsByTagName(Qc);for(var x=M.length;--x>=0;){var Ga=M[x];Ga.parentNode.replaceChild(document.createTextNode(Rc),
+Ga)}}}}}if(h<d.length)setTimeout(f,250);else if(b)b()}f()}window.PR_normalizedHtml=L;window.prettyPrintOne=Fa;window.prettyPrint=ud;window.PR={createSimpleLexer:E,registerLangHandler:t,sourceDecorator:u,PR_ATTRIB_NAME:X,PR_ATTRIB_VALUE:R,PR_COMMENT:O,PR_DECLARATION:Xb,PR_KEYWORD:fc,PR_LITERAL:Z,PR_NOCODE:Vb,PR_PLAIN:J,PR_PUNCTUATION:S,PR_SOURCE:P,PR_STRING:Y,PR_TAG:Q,PR_TYPE:gc}})();
diff --git a/deluge/ui/web/docs/template/resources/print.css b/deluge/ui/web/docs/template/resources/print.css
new file mode 100644
index 0000000..53ea597
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/print.css
@@ -0,0 +1,206 @@
+body {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ color: #000000;
+ background-color:#FFFFFF;
+ margin: 0px;
+ padding: 10px;
+}
+.body-wrap{
+ width:95%;
+}
+.list {list-style:inside square;margin-bottom:10px;}
+.list li{padding:2px;}
+body, td, th {
+ font-size: 13px;
+}
+code {
+ font-family: "Lucida Console", "Courier New", Courier, monospace;
+ font-size: 12px;
+}
+pre {
+ font-family: "Lucida Console", "Courier New", Courier, monospace;
+ font-size: 12px;
+}
+th {
+ text-align: left;
+ font-weight: bold;
+ vertical-align: bottom;
+ color:black;
+ padding:3px;
+ font-weight:bold;
+ border:1px solid #cccccc;
+ border-collapse: collapse;
+}
+.top-tools{
+ display:none;
+}
+table {
+ background-color: white;
+}
+a {
+ color: #083772;
+}
+a:link {
+ color: #083772;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #1e4e8f;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+ color: #0000CC;
+}
+
+a:active {
+ text-decoration: none;
+ color: #1e4e8f;
+}
+
+/* Headings */
+h1, h2, h3, h4, h5, h6 {
+ font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
+ font-weight: bold;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ letter-spacing: 1px;
+ width: 90%;
+}
+
+h1 {
+ font-size: 18px;
+}
+
+h2 {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 18px;
+ padding-top: 20px;
+ padding-bottom: 5px;
+}
+
+h3 {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 16px;
+}
+
+h4 {
+ font-size: 12px;
+ color: #666666;
+}
+
+h5 {
+ font-size: 11px;
+}
+
+.label {
+ font-weight: bold;
+ padding-right: 15px;
+}
+.description{
+ margin: 10px 0px;
+}
+.member-table{
+ width:100%;
+ margin-bottom:10px;
+}
+.member-table td{
+ padding:2px;
+ vertical-align:top;
+ padding-right:15px;
+}
+body .alt{
+ background:#f1f1f1;
+}
+.member-table td.micon{
+ width:20px;
+ padding:0px;
+ border-left:1px solid #bbbbbb;
+}
+.member-table td.msource{
+ border-right:1px solid #bbbbbb;
+ width:100px;
+}
+.mlink{
+ font-weight:bold;
+}
+.member-table td.inherited{
+ background-image: url(inherited.gif);
+ background-position:2px 2px;
+ background-repeat: no-repeat;
+}
+.member-table td.mdesc{
+ padding-top:0px;
+}
+.member-table td.micon,.member-table td.mdesc,.member-table td.msource{
+ border-bottom:1px solid #bbbbbb;
+}
+.optional{
+ color:#555555;
+}
+
+pre {
+ background: #F8F8F8;
+ border: 1px solid #e8e8e8;
+ border-left-width: 8px;
+ padding: 0.8em;
+ margin: 1em ;
+ margin-right: 0;
+}
+pre {
+ font-size: 12px !important;
+ line-height:14px !important;
+ padding:5px;
+ margin-left:0;
+}
+.detail-wrap{
+ border:1px solid #bbbbbb;
+ border-bottom:0px none;
+}
+.mdetail-head{
+ margin-top:10px;
+}
+.mdetail{
+ padding:7px;
+ border-bottom:1px solid #bbbbbb;
+}
+.mdetail h3{
+ margin: 5px 0px;
+ font-size:14px;
+ color:#083772;
+}
+.mdetail-desc{
+ margin:8px;
+}
+.mdetail-def{
+ font-style: italic;
+ font-size: 12px;
+ margin-top:10px;
+ margin-left:8px;
+ display:block;
+}
+.sub-desc{
+ margin:5px;
+ margin-left:16px;
+}
+.mdetail-params{
+ margin-top:10px;
+}
+.mdetail-params strong{
+ font-weight:bold;
+ display: block;
+ margin-bottom:3px;
+}
+.mdetail-params ul{
+ list-style: inside;
+ list-style-type: disc;
+ margin-left:12px;
+}
+.mdetail-params li{
+ list-style: inside;
+ list-style-type: disc;
+} \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/print.gif b/deluge/ui/web/docs/template/resources/print.gif
new file mode 100644
index 0000000..b8a48cc
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/print.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/prop.gif b/deluge/ui/web/docs/template/resources/prop.gif
new file mode 100644
index 0000000..9d99a99
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/prop.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/reset.css b/deluge/ui/web/docs/template/resources/reset.css
new file mode 100644
index 0000000..16180f7
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/reset.css
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 0.11.0
+*/
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';} \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/resources/s.gif b/deluge/ui/web/docs/template/resources/s.gif
new file mode 100644
index 0000000..1d11fa9
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/s.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/static.gif b/deluge/ui/web/docs/template/resources/static.gif
new file mode 100644
index 0000000..3599698
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/static.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/style.css b/deluge/ui/web/docs/template/resources/style.css
new file mode 100644
index 0000000..da14f55
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/style.css
@@ -0,0 +1,360 @@
+.body-wrap {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ color: #222;
+ background-color:#FFFFFF;
+ margin: 0px;
+ padding: 10px;
+ position:relative;
+}
+.body-wrap {
+ width:95%;
+}
+
+.body-wrap ul.list {
+ margin-left:20px;
+ margin-bottom:10px;
+}
+.body-wrap ul.list li {
+ list-style:inside square;
+ padding:2px;
+}
+.body-wrap .description p {
+ margin:8px 3px !important;
+}
+.body-wrap .description h4{
+ color:#083772;
+ border-bottom:1px dashed #ccc;
+ margin:8px 0;
+ padding-bottom:3px;
+}
+.body-wrap, .body-wrap td, .body-wrap th {
+ font-size: 13px;
+}
+.body-wrap code {
+ font-family: "Lucida Console", "Courier New", Courier, monospace;
+ font-size: 12px;
+}
+.body-wrap pre {
+ font-family: "Lucida Console", "Courier New", Courier, monospace;
+ font-size: 12px;
+}
+.body-wrap th {
+ text-align: left;
+ vertical-align:middle;
+ border-right:1px solid #d0d0d0;
+ border-top:1px solid #eee;
+ border-left:1px solid #eee;
+ background: #f9f9f9 url(../resources/images/default/grid/grid3-hrow.gif) repeat-x 0 top;
+ padding:3px;
+}
+.body-wrap .msource-header {
+ border-right: 0 none;
+}
+.body-wrap .top-tools{
+ font-size:11px;
+ text-align:right;
+}
+.body-wrap table {
+ background-color: white;
+}
+.body-wrap a {
+ color: #083772;
+}
+.body-wrap a:link {
+ color: #083772;
+ text-decoration: none;
+}
+
+.body-wrap a:visited {
+ color: #1e4e8f;
+ text-decoration: none;
+}
+
+.body-wrap a:hover {
+ text-decoration: underline;
+ color: #0000CC;
+}
+
+.body-wrap a:active {
+ text-decoration: none;
+ color: #1e4e8f;
+}
+
+/* Headings */
+.body-wrap h1, .body-wrap h2, .body-wrap h3, .body-wrap h4, .body-wrap h5, .body-wrap h6 {
+ font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
+ font-weight: bold;
+ margin:3px 300px 3px 0;
+ letter-spacing: 1px;
+ width: 90%;
+}
+
+.body-wrap h1 {
+ font-size: 18px;
+}
+
+.body-wrap h2 {
+ font-weight: bold;
+ font-size: 15px;
+ padding-top: 20px;
+ padding-bottom: 5px;
+}
+
+.body-wrap h3 {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 16px;
+}
+
+.body-wrap h4 {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 14px;
+}
+
+.body-wrap h5 {
+ font-size: 11px;
+}
+
+.body-wrap .label {
+ font-weight: bold;
+ padding:3px 15px 3px 0;
+ color:#333;
+}
+
+.body-wrap .hd-info {
+ color:#333;
+ padding:3px;
+}
+.body-wrap .hd-info a {
+
+}
+.body-wrap .description{
+ margin: 10px 0px;
+}
+.body-wrap .member-table{
+ width:100%;
+ margin-bottom:10px;
+}
+.body-wrap .member-table td{
+ padding:4px;
+ vertical-align:top;
+ padding-right:15px;
+}
+.body-wrap .member-table td.sig {
+ padding-left:7px;
+}
+.body-wrap .alt{
+ /*background:#f1f1f1;*/
+}
+.body-wrap .member-table td.micon{
+ width:16px;
+ padding:0px;
+ background: #f9f9f9 url(expand-bg.gif) repeat-y top right;
+ border-right:1px solid #d0d0d0;
+}
+.body-wrap .member-table td.micon a {
+ display:block;
+ height:1px;
+ width:1px;
+ overflow:hidden;
+ cursor:default;
+}
+.body-wrap .member-table .expandable td.micon a {
+ display:block;
+ width:98%;
+ height:30px;
+ text-decoration:none !important;
+ -moz-outline:none;
+ outline:none;
+}
+
+.body-wrap .member-table td.msource{
+ width:100px;
+}
+.mlink{
+ font-weight:bold;
+}
+
+.member-table {
+ border:1px solid #d0d0d0;
+}
+.member-table tr.inherited td.msource{
+ background-image: url(inherited.gif);
+ background-position:2px 4px;
+ background-repeat: no-repeat;
+ padding-left:18px;
+}
+.member-table .mdesc{
+ padding:5px 0;
+ color:#444;
+}
+.member-table td.micon,.member-table td.sig,.member-table td.msource{
+ border-top:1px solid #d0d0d0;
+}
+.body-wrap .optional{
+ color:#444 !important;
+}
+
+.body-wrap pre {
+ background: #F8F8F8;
+ border: 1px dotted #ccc;
+ margin: 1em ;
+ margin-right: 0;
+ font-size: 12px;
+ line-height:14px;
+ padding:7px;
+ margin-left:0;
+}
+.detail-wrap{
+
+}
+.mdetail-head{
+ margin-top:10px;
+}
+.mdetail{
+ padding:7px;
+ border-top:1px dotted #ccc;
+}
+.mdetail h3{
+ margin: 5px 0px;
+ font-size:14px;
+ color:#083772;
+}
+.mdetail-desc{
+ margin:8px;
+}
+.mdetail-def{
+ font-style: italic;
+ font-size: 12px;
+ margin-top:10px;
+ margin-left:8px;
+ display:block;
+}
+.sub-desc{
+ margin:5px;
+ margin-left:16px;
+}
+.mdetail-params{
+ margin-top:10px;
+}
+.mdetail-params strong{
+ display: block;
+ margin-bottom:3px;
+ font-size:11px;
+ font-weight:bold;
+ color:#555;
+}
+
+.mdetail-params ul{
+ list-style: inside;
+ list-style-type: circle;
+ margin:12px;
+}
+.mdetail-params li{
+ list-style: inside;
+ list-style-type: circle;
+}
+pre code{
+ font-size:12px !important;
+ color:#000;
+ line-height:16px !important;
+}
+pre code b{
+ font-weight: normal;
+ color: #800080;
+}
+pre code em{
+ font-weight: normal;
+ color: #008080;
+ background-color:#eee;
+}
+pre code i,pre code i b,pre code i em{
+ font-weight: normal;
+ font-style: normal;
+ color: #999;
+}
+
+.body-wrap .inheritance {
+ margin-top:20px;
+ float:right;
+ width:210px;
+}
+.body-wrap .inheritance pre {
+ text-align:left;
+ border: 0 none;
+ margin: 0;
+ font-size: 11px;
+ line-height:18px !important;
+ background:transparent url(block-bottom.gif) no-repeat left bottom;
+ padding:0 8px 5px!important;
+}
+
+.body-wrap .inheritance pre img {
+ vertical-align:middle;
+ margin-right:3px;
+}
+
+.expandable .micon a {
+ background: transparent url(member-collapsed.gif) no-repeat 5px 6px;
+ cursor:pointer;
+}
+
+.expandable td.micon:hover a {
+ background: transparent url(member-hover.gif) no-repeat 5px 6px;
+ cursor:pointer;
+}
+.body-wrap .member-table .expanded td.micon{
+ background: #f9f9f9 url(expand-bg-over.gif) repeat-y top right;
+}
+.body-wrap .member-table .expanded td.micon a {
+ background: transparent url(member-expanded.gif) no-repeat 5px 6px;
+ cursor:pointer;
+}
+
+.mdesc .long {
+ display:none;
+}
+.mdesc .long .mdetail-params {
+ font-size:12px;
+ padding-left:12px;
+}
+.expanded .mdesc .short {
+ display:none;
+}
+
+.expanded .mdesc .long {
+ display: block;
+}
+
+.full-details .expandable .micon a {
+ height:1px !important;
+ width:1px !important;
+ overflow:hidden;
+ cursor:default;
+}
+
+.full-details .mdesc .short {
+ display:none !important;
+}
+
+.full-details .mdesc .long {
+ display: block !important;
+}
+
+.full-details .body-wrap .member-table .expanded td.micon{
+ background: #f9f9f9 url(expand-bg.gif) repeat-y top right;
+}
+
+div.hr {
+ height:1px;
+ background:#ccc;
+ margin: 5px 0;
+ overflow:hidden;
+ line-height:1px;
+}
+
+
+.expanded .mdesc .long {
+ line-height:18px;
+}
diff --git a/deluge/ui/web/docs/template/resources/tabs.gif b/deluge/ui/web/docs/template/resources/tabs.gif
new file mode 100644
index 0000000..759de0f
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/tabs.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/tree-bg.gif b/deluge/ui/web/docs/template/resources/tree-bg.gif
new file mode 100644
index 0000000..00fac63
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/tree-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/wel-bg.gif b/deluge/ui/web/docs/template/resources/wel-bg.gif
new file mode 100644
index 0000000..9036602
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/wel-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/welcome-bg.gif b/deluge/ui/web/docs/template/resources/welcome-bg.gif
new file mode 100644
index 0000000..24b1ab2
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/welcome-bg.gif
Binary files differ
diff --git a/deluge/ui/web/docs/template/resources/welcome.css b/deluge/ui/web/docs/template/resources/welcome.css
new file mode 100644
index 0000000..d5b9a21
--- /dev/null
+++ b/deluge/ui/web/docs/template/resources/welcome.css
@@ -0,0 +1,25 @@
+body{
+ background:url(welcome-bg.gif) top left;
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ color: #000000;
+ margin: 0px;
+ font-size:13px;
+ padding-bottom:15px;
+}
+a {
+ color: #083772;
+}
+a:link {
+ color: #083772;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #1e4e8f;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+ color: #0000CC;
+} \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/source-wrap.html b/deluge/ui/web/docs/template/source-wrap.html
new file mode 100644
index 0000000..b6437eb
--- /dev/null
+++ b/deluge/ui/web/docs/template/source-wrap.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">###SOURCE###</pre>
+</body>
+</html> \ No newline at end of file
diff --git a/deluge/ui/web/docs/template/template.xml b/deluge/ui/web/docs/template/template.xml
new file mode 100644
index 0000000..f29c808
--- /dev/null
+++ b/deluge/ui/web/docs/template/template.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<template>
+ <classTemplate tpl="tpl/class.xsl" targetDir="output"/>
+ <treeTemplate tpl="tpl/tree.xsl" targetFile="output/tree.js"/>
+ <source targetDir="source" wrapper="source-wrap.html"/>
+ <resources>
+ <copy src="index.html" dst="index.html"/>
+ <copy src="welcome.html" dst="welcome.html"/>
+ <copy src="resources" dst="resources"/>
+ </resources>
+</template>
diff --git a/deluge/ui/web/docs/template/tpl/class.xsl b/deluge/ui/web/docs/template/tpl/class.xsl
new file mode 100644
index 0000000..75ee17e
--- /dev/null
+++ b/deluge/ui/web/docs/template/tpl/class.xsl
@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xsl:stylesheet [
+ <!ENTITY nbsp "&#160;">
+]>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ext="http://www.extjs.com">
+<xsl:output method="html" indent="no"/>
+ <xsl:template match="/docClass">
+ <div class="body-wrap">
+ <div class="top-tools">
+ <a class="inner-link" href="#{className}-props">
+ <img src="resources/images/default/s.gif" class="item-icon icon-prop"/>Properties</a><xsl:text>&#x0D;</xsl:text>
+ <a class="inner-link" href="#{className}-methods">
+ <img src="resources/images/default/s.gif" class="item-icon icon-method"/>Methods</a><xsl:text>&#x0D;</xsl:text>
+ <a class="inner-link" href="#{className}-events">
+ <img src="resources/images/default/s.gif" class="item-icon icon-event"/>Events</a><xsl:text>&#x0D;</xsl:text>
+ <xsl:if test="cfgs">
+ <a class="inner-link" href="#{className}-configs">
+ <img src="resources/images/default/s.gif" class="item-icon icon-config"/>Config Options</a><xsl:text>&#x0D;</xsl:text>
+ </xsl:if>
+ <a class="bookmark" href="../docs/?class={className}">
+ <img src="resources/images/default/s.gif" class="item-icon icon-fav"/>Direct Link</a><xsl:text>&#x0D;</xsl:text>
+ </div>
+ <xsl:if test="superClasses">
+ <xsl:call-template name="super-classes"/>
+ </xsl:if>
+ <h1>Class <a href="source/{href}"><xsl:value-of select="className"/></a></h1>
+ <table cellspacing="0">
+ <tr>
+ <td class="label">Package:</td>
+ <td class="hd-info">
+ <xsl:choose>
+ <xsl:when test="packageName!=''"><xsl:value-of select="packageName"/></xsl:when>
+ <xsl:otherwise>Global</xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/{href}"><xsl:value-of select="definedIn"/></a></td></tr>
+ <tr><td class="label">Class:</td><td class="hd-info"><a href="source/{href}"><xsl:value-of select="shortClassName"/></a></td></tr>
+ <xsl:if test="subClasses">
+ <xsl:call-template name="sub-classes"/>
+ </xsl:if>
+ <tr>
+ <td class="label">Extends:</td><td class="hd-info">
+ <xsl:choose>
+ <xsl:when test="superClasses">
+ <a href="output/{superClasses[last()]/className}.html" ext:cls="{superClasses[last()]/className}" ext:member=""><xsl:value-of select="superClasses[last()]/shortClassName"/></a>
+ </xsl:when>
+ <xsl:otherwise>Object</xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <xsl:call-template name="class-custom-tags"/>
+ </table>
+ <div class="description">
+ <xsl:value-of select="description" disable-output-escaping="yes"/>
+ <xsl:if test="singleton='true'"><br/><br/><i>This class is a singleton and cannot be created directly.</i></xsl:if>
+ </div>
+ <div class="hr"> </div>
+
+ <!--Configs-->
+ <xsl:if test="cfgs">
+ <a id="{className}-configs"> </a>
+ <h2>Config Options</h2>
+ <table cellspacing="0" class="member-table">
+ <tbody>
+ <tr>
+ <th colspan="2" class="sig-header">Config Options</th>
+ <th class="msource-header">Defined By</th>
+ </tr>
+ <xsl:for-each select="cfgs">
+ <xsl:variable name="inherited">
+ <xsl:if test="/docClass/className!=className">inherited</xsl:if>
+ </xsl:variable>
+ <xsl:variable name="cls">
+ <xsl:if test="description/hasShort='true'">expandable</xsl:if>
+ </xsl:variable>
+ <tr class="config-row {$cls} {$inherited}">
+ <td class="micon"><a href="#expand" class="exi">&nbsp;</a></td>
+ <td class="sig">
+ <a id="{className}-{name}"/>
+ <b><a href="source/{href}"><xsl:value-of select="name"/></a></b> : <xsl:value-of select="type"/>
+ <div class="mdesc">
+ <xsl:choose>
+ <xsl:when test="description/hasShort='true'">
+ <div class="short"><xsl:value-of select="description/shortDescr"/></div>
+ <div class="long"><xsl:value-of select="description/longDescr" disable-output-escaping="yes"/><xsl:call-template name="custom-tags"/></div>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="description/longDescr" disable-output-escaping="yes"/><xsl:call-template name="custom-tags"/></xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </td>
+ <xsl:call-template name="msource">
+ <xsl:with-param name="inherited" select="$inherited='inherited'"/>
+ </xsl:call-template>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:if>
+
+ <!--Properties-->
+ <a id="{className}-props"> </a>
+ <h2>Public Properties</h2>
+ <xsl:choose>
+ <xsl:when test="properties">
+ <table cellspacing="0" class="member-table">
+ <tbody>
+ <tr>
+ <th colspan="2" class="sig-header">Property</th>
+ <th class="msource-header">Defined By</th>
+ </tr>
+ <xsl:for-each select="properties">
+ <xsl:variable name="inherited">
+ <xsl:if test="/docClass/className!=className">inherited</xsl:if>
+ </xsl:variable>
+ <xsl:variable name="cls">
+ <xsl:if test="description/hasShort='true'">expandable</xsl:if>
+ </xsl:variable>
+ <tr class="property-row {$cls} {$inherited}">
+ <td class="micon"><a href="#expand" class="exi">&nbsp;</a></td>
+ <td class="sig">
+ <a id="{className}-{name}"/>
+ <b><a href="source/{href}"><xsl:value-of select="name"/></a></b> : <xsl:value-of select="type"/>
+ <div class="mdesc">
+ <xsl:choose>
+ <xsl:when test="description/hasShort='true'">
+ <div class="short"><xsl:value-of select="description/shortDescr"/></div>
+ <div class="long"><xsl:value-of select="description/longDescr" disable-output-escaping="yes"/><xsl:call-template name="custom-tags"/></div>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="description/longDescr" disable-output-escaping="yes"/><xsl:call-template name="custom-tags"/></xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </td>
+ <xsl:call-template name="msource">
+ <xsl:with-param name="inherited" select="$inherited='inherited'"/>
+ </xsl:call-template>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise><div class="no-members">This class has no public properties.</div></xsl:otherwise>
+ </xsl:choose>
+
+ <!--Methods-->
+ <a id="{className}-methods"> </a>
+ <h2>Public Methods</h2>
+ <xsl:choose>
+ <xsl:when test="methods">
+ <table cellspacing="0" class="member-table">
+ <tbody>
+ <tr>
+ <th colspan="2" class="sig-header">Method</th>
+ <th class="msource-header">Defined By</th>
+ </tr>
+ <xsl:if test="hasConstructor='true'">
+ <xsl:call-template name="constructor"/>
+ </xsl:if>
+ <xsl:for-each select="methods">
+ <xsl:variable name="inherited">
+ <xsl:if test="/docClass/className!=className">inherited</xsl:if>
+ </xsl:variable>
+ <tr class="method-row expandable {$inherited}">
+ <td class="micon"><a href="#expand" class="exi">&nbsp;</a></td>
+ <td class="sig">
+ <a id="{className}-{name}"/>
+ <b><a href="source/{href}"><xsl:value-of select="name"/></a></b>
+ <xsl:call-template name="method-params"/>:
+ <xsl:choose>
+ <xsl:when test="returnType"><xsl:value-of select="returnType"/></xsl:when>
+ <xsl:otherwise>void</xsl:otherwise>
+ </xsl:choose>
+ <div class="mdesc">
+ <xsl:call-template name="custom-tags"/>
+ <div class="short">
+ <xsl:call-template name="check-if-static"/>
+ <xsl:value-of select="description/shortDescr"/>
+ </div>
+ <div class="long">
+ <xsl:call-template name="check-if-static"/>
+ <xsl:value-of select="description/longDescr" disable-output-escaping="yes"/>
+ <xsl:call-template name="method-params-details"/>
+ </div>
+ </div>
+ </td>
+ <xsl:call-template name="msource">
+ <xsl:with-param name="inherited" select="$inherited='inherited'"/>
+ </xsl:call-template>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise><div class="no-members">This class has no public methods.</div></xsl:otherwise>
+ </xsl:choose>
+
+ <!--Events-->
+ <a id="{className}-events"> </a>
+ <h2>Public Events</h2>
+ <xsl:choose>
+ <xsl:when test="events">
+ <table cellspacing="0" class="member-table">
+ <tbody>
+ <tr>
+ <th colspan="2" class="sig-header">Event</th>
+ <th class="msource-header">Defined By</th>
+ </tr>
+ <xsl:for-each select="events">
+ <xsl:variable name="inherited">
+ <xsl:if test="/docClass/className!=className">inherited</xsl:if>
+ </xsl:variable>
+ <tr class="method-row expandable {$inherited}">
+ <td class="micon"><a href="#expand" class="exi">&nbsp;</a></td>
+ <td class="sig">
+ <a id="{className}-{name}"/>
+ <b><a href="source/{href}"><xsl:value-of select="name"/></a></b> :
+ <xsl:call-template name="method-params"/>
+ <div class="mdesc">
+ <div class="short"><xsl:value-of select="description/shortDescr"/></div>
+ <div class="long">
+ <xsl:value-of select="description/longDescr" disable-output-escaping="yes"/>
+ <div class="mdetail-params">
+ <strong style="font-weight: normal;">Listeners will be called with the following arguments:</strong>
+ <ul>
+ <xsl:if test="count(params)=0">
+ <li>None.</li>
+ </xsl:if>
+ <xsl:for-each select="params">
+ <li>
+ <code><xsl:value-of select="name"/></code> : <xsl:value-of select="type"/>
+ <div class="sub-desc">
+ <xsl:value-of select="description" disable-output-escaping="yes"/>
+ </div>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ <xsl:call-template name="custom-tags"/>
+ </div>
+ </div>
+ </td>
+ <xsl:call-template name="msource">
+ <xsl:with-param name="inherited" select="$inherited='inherited'"/>
+ </xsl:call-template>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise><div class="no-members">This class has no public events.</div></xsl:otherwise>
+ </xsl:choose>
+
+ </div>
+ </xsl:template>
+
+ <!-- Right column with link to parent class -->
+ <xsl:template name="msource">
+ <xsl:param name="inherited"/>
+ <td class="msource">
+ <xsl:choose>
+ <xsl:when test="$inherited">
+ <a href="output/{className}.html#{name}" ext:member="#{name}" ext:cls="{className}">
+ <xsl:value-of select="shortClassName"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="shortClassName"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </xsl:template>
+
+ <xsl:template name="constructor">
+ <tr class="method-row expandable">
+ <td class="micon"><a href="#expand" class="exi">&nbsp;</a></td>
+ <td class="sig">
+ <a id="{className}-{shortClassName}"/>
+ <b><a href="source/{href}"><xsl:value-of select="shortClassName"/></a></b>
+ <xsl:call-template name="method-params"/>
+ <div class="mdesc">
+ <div class="short"><xsl:value-of select="constructorDescription/shortDescr"/></div>
+ <div class="long">
+ <xsl:value-of select="constructorDescription/longDescr" disable-output-escaping="yes"/>
+ <xsl:call-template name="method-params-details"/>
+ <xsl:call-template name="custom-tags"/>
+ </div>
+ </div>
+ </td>
+ <xsl:call-template name="msource">
+ <xsl:with-param name="inherited" select="false()"/>
+ </xsl:call-template>
+ </tr>
+ </xsl:template>
+
+ <!-- Method Parameters in short-->
+ <xsl:template name="method-params">(<xsl:if test="count(params)&gt;0">&nbsp;</xsl:if><xsl:for-each select="params">
+ <xsl:choose>
+ <xsl:when test="optional='true'"><span title="Optional" class="optional">[<code><xsl:value-of select="type"/>&nbsp;<xsl:value-of select="name"/></code>]</span></xsl:when>
+ <xsl:otherwise><code><xsl:value-of select="type"/>&nbsp;<xsl:value-of select="name"/></code></xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="position()!=last()">,&nbsp;</xsl:if>
+ </xsl:for-each><xsl:if test="count(params)&gt;0">&nbsp;</xsl:if>)
+ </xsl:template>
+
+
+
+ <!-- Method Parameters processing-->
+ <xsl:template name="method-params-details">
+ <div class="mdetail-params">
+ <strong>Parameters:</strong>
+ <ul>
+ <xsl:if test="count(params)=0">
+ <li>None.</li>
+ </xsl:if>
+ <xsl:for-each select="params">
+ <li>
+ <code><xsl:value-of select="name"/></code> : <xsl:value-of select="type"/>
+ <div class="sub-desc"><xsl:value-of select="description" disable-output-escaping="yes"/></div>
+ </li>
+ </xsl:for-each></ul>
+ <strong>Returns:</strong>
+ <ul>
+ <li>
+ <xsl:choose>
+ <xsl:when test="returnType">
+ <code><xsl:value-of select="returnType"/></code>
+ <div class="sub-desc"><xsl:value-of select="returnDescription"/></div>
+ </xsl:when>
+ <xsl:otherwise>void</xsl:otherwise>
+ </xsl:choose>
+ </li>
+ </ul>
+ </div>
+ </xsl:template>
+
+ <!-- Shows <static> if item is static-->
+ <xsl:template name="check-if-static">
+ <xsl:if test="isStatic='true'">&lt;static&gt;&nbsp;</xsl:if>
+ </xsl:template>
+
+ <!-- Shows inheritance tree in the right side -->
+ <xsl:template name="super-classes">
+ <div class="inheritance res-block">
+ <pre class="res-block-inner">
+ <xsl:for-each select="superClasses">
+ <a href="output/{className}.html" ext:member="" ext:cls="{className}"><xsl:value-of select="shortClassName"/></a><xsl:text>&#x0D;</xsl:text>
+ <xsl:call-template name="spacer">
+ <xsl:with-param name="n" select="position()"/>
+ </xsl:call-template>
+ <img src="resources/elbow-end.gif"/>
+ </xsl:for-each>
+ <xsl:value-of select="shortClassName"/>
+ </pre>
+ </div>
+ </xsl:template>
+
+ <!-- Recursive template generates "n" number of space elements -->
+ <xsl:template name="spacer">
+ <xsl:param name="n"/>
+ <xsl:if test="$n&gt;0">
+ <xsl:text>&nbsp;&nbsp;</xsl:text>
+ <xsl:call-template name="spacer">
+ <xsl:with-param name="n" select="$n - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Shows subclasses -->
+ <xsl:template name="sub-classes">
+ <tr>
+ <td class="label">Subclasses:</td>
+ <td class="hd-info">
+ <xsl:for-each select="subClasses">
+ <a href="output/{className}.html" ext:cls="{className}"><xsl:value-of select="shortClassName"/></a>
+ <xsl:if test="position()!=last()"><xsl:text>,&#x0D;</xsl:text></xsl:if>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template name="class-custom-tags">
+ <xsl:if test="customTags">
+ <xsl:for-each select="customTags">
+ <tr>
+ <td class="label"><xsl:value-of select="title"/>:</td>
+ <td class="hd-info"><xsl:value-of select="value" disable-output-escaping="yes"/></td>
+ </tr>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="custom-tags">
+ <xsl:if test="customTags">
+ <table>
+ <xsl:for-each select="customTags">
+ <tr>
+ <td class="label"><xsl:value-of select="title"/>:</td>
+ <td class="hd-info"><xsl:value-of select="value" disable-output-escaping="yes"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/deluge/ui/web/docs/template/tpl/tree.xsl b/deluge/ui/web/docs/template/tpl/tree.xsl
new file mode 100644
index 0000000..8085eda
--- /dev/null
+++ b/deluge/ui/web/docs/template/tpl/tree.xsl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <xsl:template match="/">
+ Docs.classData ={"id":"apidocs","iconCls":"icon-docs","text":"API Documentation","singleClickExpand":true,"children":[<xsl:apply-templates/>]};
+ Docs.icons = {
+ <xsl:for-each select="//classes">
+ <xsl:variable name="icon">
+ <xsl:choose>
+ <xsl:when test="singleton='true'">icon-static</xsl:when>
+ <xsl:when test="component='true'">icon-cmp</xsl:when>
+ <xsl:otherwise>icon-cls</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ "<xsl:value-of select="className"/>":"<xsl:value-of select="$icon"/>"
+ <xsl:if test="position()!=last()">,</xsl:if>
+ </xsl:for-each>};
+ </xsl:template>
+
+ <xsl:template match="treePackage|packages">
+ <xsl:for-each select="packages">
+ {"id":"pkg-<xsl:value-of select="@fullName"/>","text":"<xsl:value-of select="@name"/>","iconCls":"icon-pkg","cls":"package","singleClickExpand":true, children:[<xsl:apply-templates select="."/>]}
+ <xsl:if test="position()!=last()">,</xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(packages)!=0 and count(classes)!=0">,</xsl:if>
+ <xsl:for-each select="classes">
+ <xsl:variable name="icon">
+ <xsl:choose>
+ <xsl:when test="singleton='true'">icon-static</xsl:when>
+ <xsl:when test="component='true'">icon-cmp</xsl:when>
+ <xsl:otherwise>icon-cls</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ {"href":"output/<xsl:value-of select="className"/>.html","text":"<xsl:value-of select="shortClassName"/>","id":"<xsl:value-of select="className"/>","isClass":true,"iconCls":"<xsl:value-of select="$icon"/>","cls":"cls","leaf":true}
+ <xsl:if test="position()!=last()">,</xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!--suppress default templates-->
+ <xsl:template match="*"/>
+
+
+</xsl:stylesheet>
+
diff --git a/deluge/ui/web/docs/template/welcome.html b/deluge/ui/web/docs/template/welcome.html
new file mode 100644
index 0000000..e5e76c1
--- /dev/null
+++ b/deluge/ui/web/docs/template/welcome.html
@@ -0,0 +1,47 @@
+<div id="welcome">
+ <div class="col">
+ <div id="search">
+ </div>
+ </div>
+ <div class="col-last">
+ <div class="res-block">
+ <div class="res-block-inner">
+ <h3>Additional Resources</h3>
+ <ul>
+ <li><a href="http://deluge-torrent.org/docs/" target="_blank">Deluge API Docs</a></li>
+ <li><a href="http://www.extjs.com/deploy/dev/docs/" target="_blank">Ext 3.1 API Docs</a></li>
+ <li><a href="http://www.extjs.com/deploy/dev/examples/samples.html" target="_blank">Ext 3.1 Samples</a></li>
+ <li><a href="http://extjs.com/learn" target="_blank">Ext Learning Center</a></li>
+ <li><a href="http://extjs.com/learn/Ext_FAQ" target="_blank">FAQ</a></li>
+ <li><a href="http://extjs.com/learn/Tutorials" target="_blank">Tutorials</a></li>
+ <li><a href="http://extjs.com/learn/Ext_Manual" target="_blank">Ext Community Manual</a></li>
+ <li><a href="http://extjs.com/blog" target="_blank">Ext JS Blog</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="res-block">
+ <div class="res-block-inner">
+ <h3>Support</h3>
+ <ul>
+ <li><a href="http://forum.deluge-torrent.org" target="_blank">Deluge Community Forums</a></li>
+ <li><a href="http://extjs.com/forum" target="_blank">Ext Community Forums</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="res-block">
+ <div class="res-block-inner">
+ <h3>Icon Legend</h3>
+ <ul id="legend" style="list-style:none;margin-left:0;">
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-pkg">Package</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-cls">Class</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-static">Singleton</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-cmp">Component</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-method">Method</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-prop">Property</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Option</li>
+ <li><img src="resources/images/default/s.gif" class="item-icon icon-event">Event</li>
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/deluge/ui/web/js/deluge-all-debug.js b/deluge/ui/web/js/deluge-all-debug.js
deleted file mode 100644
index 67bb83a..0000000
--- a/deluge/ui/web/js/deluge-all-debug.js
+++ /dev/null
@@ -1,9969 +0,0 @@
-/**
- * Deluge.add.Window.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.add');
-
-/**
- * @class Deluge.add.Window
- * @extends Ext.Window
- * Base class for an add Window
- */
-Deluge.add.Window = Ext.extend(Ext.Window, {
- initComponent: function () {
- Deluge.add.Window.superclass.initComponent.call(this);
- this.addEvents('beforeadd', 'add', 'addfailed');
- },
-
- /**
- * Create an id for the torrent before we have any info about it.
- */
- createTorrentId: function () {
- return new Date().getTime().toString();
- },
-});
-/**
- * Deluge.add.AddWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.namespace('Deluge.add');
-
-// This override allows file upload buttons to contain icons
-Ext.override(Ext.ux.form.FileUploadField, {
- onRender: function (ct, position) {
- Ext.ux.form.FileUploadField.superclass.onRender.call(
- this,
- ct,
- position
- );
-
- this.wrap = this.el.wrap({ cls: 'x-form-field-wrap x-form-file-wrap' });
- this.el.addClass('x-form-file-text');
- this.el.dom.removeAttribute('name');
- this.createFileInput();
-
- var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
- text: this.buttonText,
- });
- this.button = new Ext.Button(
- Ext.apply(btnCfg, {
- renderTo: this.wrap,
- cls:
- 'x-form-file-btn' +
- (btnCfg.iconCls ? ' x-btn-text-icon' : ''),
- })
- );
-
- if (this.buttonOnly) {
- this.el.hide();
- this.wrap.setWidth(this.button.getEl().getWidth());
- }
-
- this.bindListeners();
- this.resizeEl = this.positionEl = this.wrap;
- },
-});
-
-Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
- title: _('Add Torrents'),
- layout: 'border',
- width: 470,
- height: 450,
- bodyStyle: 'padding: 10px 5px;',
- buttonAlign: 'right',
- closeAction: 'hide',
- closable: true,
- plain: true,
- iconCls: 'x-deluge-add-window-icon',
-
- initComponent: function () {
- Deluge.add.AddWindow.superclass.initComponent.call(this);
-
- this.addButton(_('Cancel'), this.onCancelClick, this);
- this.addButton(_('Add'), this.onAddClick, this);
-
- this.list = new Ext.list.ListView({
- store: new Ext.data.SimpleStore({
- fields: [
- { name: 'info_hash', mapping: 1 },
- { name: 'text', mapping: 2 },
- ],
- id: 0,
- }),
- columns: [
- {
- id: 'torrent',
- width: 150,
- sortable: true,
- dataIndex: 'text',
- tpl: new Ext.XTemplate(
- '<div class="x-deluge-add-torrent-name">{text:htmlEncode}</div>'
- ),
- },
- ],
- stripeRows: true,
- singleSelect: true,
- listeners: {
- selectionchange: {
- fn: this.onSelect,
- scope: this,
- },
- },
- hideHeaders: true,
- autoExpandColumn: 'torrent',
- height: '100%',
- autoScroll: true,
- });
-
- this.add({
- region: 'center',
- items: [this.list],
- border: false,
- bbar: new Ext.Toolbar({
- items: [
- {
- id: 'fileUploadForm',
- xtype: 'form',
- layout: 'fit',
- baseCls: 'x-plain',
- fileUpload: true,
- items: [
- {
- buttonOnly: true,
- xtype: 'fileuploadfield',
- id: 'torrentFile',
- name: 'file',
- multiple: true,
- buttonCfg: {
- iconCls: 'x-deluge-add-file',
- text: _('File'),
- },
- listeners: {
- scope: this,
- fileselected: this.onFileSelected,
- },
- },
- ],
- },
- {
- text: _('Url'),
- iconCls: 'icon-add-url',
- handler: this.onUrl,
- scope: this,
- },
- {
- text: _('Infohash'),
- iconCls: 'icon-magnet-add',
- hidden: true,
- disabled: true,
- },
- '->',
- {
- text: _('Remove'),
- iconCls: 'icon-remove',
- handler: this.onRemove,
- scope: this,
- },
- ],
- }),
- });
-
- this.fileUploadForm = Ext.getCmp('fileUploadForm').getForm();
- this.optionsPanel = this.add(new Deluge.add.OptionsPanel());
- this.on('hide', this.onHide, this);
- this.on('show', this.onShow, this);
- },
-
- clear: function () {
- this.list.getStore().removeAll();
- this.optionsPanel.clear();
- // Reset upload form so handler fires when a canceled file is reselected
- this.fileUploadForm.reset();
- },
-
- onAddClick: function () {
- var torrents = [];
- if (!this.list) return;
- this.list.getStore().each(function (r) {
- var id = r.get('info_hash');
- torrents.push({
- path: this.optionsPanel.getFilename(id),
- options: this.optionsPanel.getOptions(id),
- });
- }, this);
-
- deluge.client.web.add_torrents(torrents, {
- success: function (result) {},
- });
- this.clear();
- this.hide();
- },
-
- onCancelClick: function () {
- this.clear();
- this.hide();
- },
-
- onFile: function () {
- if (!this.file) this.file = new Deluge.add.FileWindow();
- this.file.show();
- },
-
- onHide: function () {
- this.optionsPanel.setActiveTab(0);
- this.optionsPanel.files.setDisabled(true);
- this.optionsPanel.form.setDisabled(true);
- },
-
- onRemove: function () {
- if (!this.list.getSelectionCount()) return;
- var torrent = this.list.getSelectedRecords()[0];
- if (!torrent) return;
- this.list.getStore().remove(torrent);
- this.optionsPanel.clear();
-
- if (this.torrents && this.torrents[torrent.id])
- delete this.torrents[torrent.id];
- },
-
- onSelect: function (list, selections) {
- if (selections.length) {
- var record = this.list.getRecord(selections[0]);
- this.optionsPanel.setTorrent(record.get('info_hash'));
- } else {
- this.optionsPanel.files.setDisabled(true);
- this.optionsPanel.form.setDisabled(true);
- }
- },
-
- onShow: function () {
- if (!this.url) {
- this.url = new Deluge.add.UrlWindow();
- this.url.on('beforeadd', this.onTorrentBeforeAdd, this);
- this.url.on('add', this.onTorrentAdd, this);
- this.url.on('addfailed', this.onTorrentAddFailed, this);
- }
-
- this.optionsPanel.form.getDefaults();
- },
-
- onFileSelected: function () {
- if (this.fileUploadForm.isValid()) {
- var torrentIds = [];
- var files = this.fileUploadForm.findField('torrentFile').value;
- var randomId = this.createTorrentId();
- Array.prototype.forEach.call(
- files,
- function (file, i) {
- // Append index for batch of unique torrentIds.
- var torrentId = randomId + i.toString();
- torrentIds.push(torrentId);
- this.onTorrentBeforeAdd(torrentId, file.name);
- }.bind(this)
- );
- this.fileUploadForm.submit({
- url: deluge.config.base + 'upload',
- waitMsg: _('Uploading your torrent...'),
- success: this.onUploadSuccess,
- failure: this.onUploadFailure,
- scope: this,
- torrentIds: torrentIds,
- });
- }
- },
-
- onUploadSuccess: function (fp, upload) {
- if (!upload.result.success) {
- this.clear();
- return;
- }
-
- upload.result.files.forEach(
- function (filename, i) {
- deluge.client.web.get_torrent_info(filename, {
- success: this.onGotInfo,
- scope: this,
- filename: filename,
- torrentId: upload.options.torrentIds[i],
- });
- }.bind(this)
- );
- this.fileUploadForm.reset();
- },
-
- onUploadFailure: function (form, action) {
- this.hide();
- Ext.MessageBox.show({
- title: _('Error'),
- msg: _('Failed to upload torrent'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- this.fireEvent('addfailed', this.torrentId);
- },
-
- onGotInfo: function (info, obj, response, request) {
- info.filename = request.options.filename;
- torrentId = request.options.torrentId;
- this.onTorrentAdd(torrentId, info);
- },
-
- onTorrentBeforeAdd: function (torrentId, text) {
- var store = this.list.getStore();
- store.loadData([[torrentId, null, text]], true);
- },
-
- onTorrentAdd: function (torrentId, info) {
- var r = this.list.getStore().getById(torrentId);
- if (!info) {
- Ext.MessageBox.show({
- title: _('Error'),
- msg: _('Not a valid torrent'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- this.list.getStore().remove(r);
- } else {
- r.set('info_hash', info['info_hash']);
- r.set('text', info['name']);
- this.list.getStore().commitChanges();
- this.optionsPanel.addTorrent(info);
- this.list.select(r);
- }
- },
-
- onTorrentAddFailed: function (torrentId) {
- var store = this.list.getStore();
- var torrentRecord = store.getById(torrentId);
- if (torrentRecord) {
- store.remove(torrentRecord);
- }
- },
-
- onUrl: function (button, event) {
- this.url.show();
- },
-});
-/**
- * Deluge.add.FilesTab.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.add');
-
-/**
- * @class Deluge.add.FilesTab
- * @extends Ext.ux.tree.TreeGrid
- */
-Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
- layout: 'fit',
- title: _('Files'),
-
- autoScroll: false,
- animate: false,
- border: false,
- disabled: true,
- rootVisible: false,
-
- columns: [
- {
- header: _('Filename'),
- width: 295,
- dataIndex: 'filename',
- tpl: new Ext.XTemplate('{filename:htmlEncode}'),
- },
- {
- header: _('Size'),
- width: 60,
- dataIndex: 'size',
- tpl: new Ext.XTemplate('{size:this.fsize}', {
- fsize: function (v) {
- return fsize(v);
- },
- }),
- },
- {
- header: _('Download'),
- width: 65,
- dataIndex: 'download',
- tpl: new Ext.XTemplate('{download:this.format}', {
- format: function (v) {
- return (
- '<div rel="chkbox" class="x-grid3-check-col' +
- (v ? '-on' : '') +
- '"> </div>'
- );
- },
- }),
- },
- ],
-
- initComponent: function () {
- Deluge.add.FilesTab.superclass.initComponent.call(this);
- this.on('click', this.onNodeClick, this);
- },
-
- clearFiles: function () {
- var root = this.getRootNode();
- if (!root.hasChildNodes()) return;
- root.cascade(function (node) {
- if (!node.parentNode || !node.getOwnerTree()) return;
- node.remove();
- });
- },
-
- setDownload: function (node, value, suppress) {
- node.attributes.download = value;
- node.ui.updateColumns();
-
- if (node.isLeaf()) {
- if (!suppress) {
- return this.fireEvent('fileschecked', [node], value, !value);
- }
- } else {
- var nodes = [node];
- node.cascade(function (n) {
- n.attributes.download = value;
- n.ui.updateColumns();
- nodes.push(n);
- }, this);
- if (!suppress) {
- return this.fireEvent('fileschecked', nodes, value, !value);
- }
- }
- },
-
- onNodeClick: function (node, e) {
- var el = new Ext.Element(e.target);
- if (el.getAttribute('rel') == 'chkbox') {
- this.setDownload(node, !node.attributes.download);
- }
- },
-});
-/**
- * Deluge.add.Infohash.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Ext.deluge.add');
-/**
- * Deluge.add.OptionsPanel.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.add');
-
-Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
- torrents: {},
-
- // layout options
- region: 'south',
- border: false,
- activeTab: 0,
- height: 265,
-
- initComponent: function () {
- Deluge.add.OptionsPanel.superclass.initComponent.call(this);
- this.files = this.add(new Deluge.add.FilesTab());
- this.form = this.add(new Deluge.add.OptionsTab());
-
- this.files.on('fileschecked', this.onFilesChecked, this);
- },
-
- addTorrent: function (torrent) {
- this.torrents[torrent['info_hash']] = torrent;
- var fileIndexes = {};
- this.walkFileTree(
- torrent['files_tree'],
- function (filename, type, entry, parent) {
- if (type != 'file') return;
- fileIndexes[entry.index] = entry.download;
- },
- this
- );
-
- var priorities = [];
- Ext.each(Ext.keys(fileIndexes), function (index) {
- priorities[index] = fileIndexes[index];
- });
-
- var oldId = this.form.optionsManager.changeId(
- torrent['info_hash'],
- true
- );
- this.form.optionsManager.setDefault('file_priorities', priorities);
- this.form.optionsManager.changeId(oldId, true);
- },
-
- clear: function () {
- this.files.clearFiles();
- this.form.optionsManager.resetAll();
- },
-
- getFilename: function (torrentId) {
- return this.torrents[torrentId]['filename'];
- },
-
- getOptions: function (torrentId) {
- var oldId = this.form.optionsManager.changeId(torrentId, true);
- var options = this.form.optionsManager.get();
- this.form.optionsManager.changeId(oldId, true);
- Ext.each(options['file_priorities'], function (priority, index) {
- options['file_priorities'][index] = priority ? 1 : 0;
- });
- return options;
- },
-
- setTorrent: function (torrentId) {
- if (!torrentId) return;
-
- this.torrentId = torrentId;
- this.form.optionsManager.changeId(torrentId);
-
- this.files.clearFiles();
- var root = this.files.getRootNode();
- var priorities = this.form.optionsManager.get('file_priorities');
-
- this.form.setDisabled(false);
-
- if (this.torrents[torrentId]['files_tree']) {
- this.walkFileTree(
- this.torrents[torrentId]['files_tree'],
- function (filename, type, entry, parentNode) {
- var node = new Ext.tree.TreeNode({
- download: entry.index ? priorities[entry.index] : true,
- filename: filename,
- fileindex: entry.index,
- leaf: type != 'dir',
- size: entry.length,
- });
- parentNode.appendChild(node);
- if (type == 'dir') return node;
- },
- this,
- root
- );
- root.firstChild.expand();
- this.files.setDisabled(false);
- this.files.show();
- } else {
- // Files tab is empty so show options tab
- this.form.show();
- this.files.setDisabled(true);
- }
- },
-
- walkFileTree: function (files, callback, scope, parentNode) {
- for (var filename in files.contents) {
- var entry = files.contents[filename];
- var type = entry.type;
-
- if (scope) {
- var ret = callback.apply(scope, [
- filename,
- type,
- entry,
- parentNode,
- ]);
- } else {
- var ret = callback(filename, type, entry, parentNode);
- }
-
- if (type == 'dir') this.walkFileTree(entry, callback, scope, ret);
- }
- },
-
- onFilesChecked: function (nodes, newValue, oldValue) {
- Ext.each(
- nodes,
- function (node) {
- if (node.attributes.fileindex < 0) return;
- var priorities =
- this.form.optionsManager.get('file_priorities');
- priorities[node.attributes.fileindex] = newValue;
- this.form.optionsManager.update('file_priorities', priorities);
- },
- this
- );
- },
-});
-/**
- * Deluge.add.OptionsPanel.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.add');
-
-/**
- * @class Deluge.add.OptionsTab
- * @extends Ext.form.FormPanel
- */
-Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
- title: _('Options'),
- height: 170,
- border: false,
- bodyStyle: 'padding: 5px',
- disabled: true,
- labelWidth: 1,
-
- initComponent: function () {
- Deluge.add.OptionsTab.superclass.initComponent.call(this);
-
- this.optionsManager = new Deluge.MultiOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- title: _('Download Folder'),
- border: false,
- autoHeight: true,
- defaultType: 'textfield',
- labelWidth: 1,
- fieldLabel: '',
- style: 'padding: 5px 0; margin-bottom: 0;',
- });
- this.optionsManager.bind(
- 'download_location',
- fieldset.add({
- fieldLabel: '',
- name: 'download_location',
- anchor: '95%',
- labelSeparator: '',
- })
- );
- var fieldset = this.add({
- xtype: 'fieldset',
- title: _('Move Completed Folder'),
- border: false,
- autoHeight: true,
- defaultType: 'togglefield',
- labelWidth: 1,
- fieldLabel: '',
- style: 'padding: 5px 0; margin-bottom: 0;',
- });
- var field = fieldset.add({
- fieldLabel: '',
- name: 'move_completed_path',
- anchor: '98%',
- });
- this.optionsManager.bind('move_completed', field.toggle);
- this.optionsManager.bind('move_completed_path', field.input);
-
- var panel = this.add({
- border: false,
- layout: 'column',
- defaultType: 'fieldset',
- });
-
- fieldset = panel.add({
- title: _('Bandwidth'),
- border: false,
- autoHeight: true,
- bodyStyle: 'padding: 2px 5px',
- labelWidth: 105,
- width: 200,
- defaultType: 'spinnerfield',
- style: 'padding-right: 10px;',
- });
- this.optionsManager.bind(
- 'max_download_speed',
- fieldset.add({
- fieldLabel: _('Max Down Speed'),
- name: 'max_download_speed',
- width: 60,
- })
- );
- this.optionsManager.bind(
- 'max_upload_speed',
- fieldset.add({
- fieldLabel: _('Max Up Speed'),
- name: 'max_upload_speed',
- width: 60,
- })
- );
- this.optionsManager.bind(
- 'max_connections',
- fieldset.add({
- fieldLabel: _('Max Connections'),
- name: 'max_connections',
- width: 60,
- })
- );
- this.optionsManager.bind(
- 'max_upload_slots',
- fieldset.add({
- fieldLabel: _('Max Upload Slots'),
- name: 'max_upload_slots',
- width: 60,
- })
- );
-
- fieldset = panel.add({
- // title: _('General'),
- border: false,
- autoHeight: true,
- defaultType: 'checkbox',
- });
- this.optionsManager.bind(
- 'add_paused',
- fieldset.add({
- name: 'add_paused',
- boxLabel: _('Add In Paused State'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- this.optionsManager.bind(
- 'prioritize_first_last_pieces',
- fieldset.add({
- name: 'prioritize_first_last_pieces',
- boxLabel: _('Prioritize First/Last Pieces'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- this.optionsManager.bind(
- 'sequential_download',
- fieldset.add({
- name: 'sequential_download',
- boxLabel: _('Sequential Download'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- this.optionsManager.bind(
- 'seed_mode',
- fieldset.add({
- name: 'seed_mode',
- boxLabel: _('Skip File Hash Check'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- this.optionsManager.bind(
- 'super_seeding',
- fieldset.add({
- name: 'super_seeding',
- boxLabel: _('Super Seed'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- this.optionsManager.bind(
- 'pre_allocate_storage',
- fieldset.add({
- name: 'pre_allocate_storage',
- boxLabel: _('Preallocate Disk Space'),
- fieldLabel: '',
- labelSeparator: '',
- })
- );
- },
-
- getDefaults: function () {
- var keys = [
- 'add_paused',
- 'pre_allocate_storage',
- 'download_location',
- 'max_connections_per_torrent',
- 'max_download_speed_per_torrent',
- 'move_completed',
- 'move_completed_path',
- 'max_upload_slots_per_torrent',
- 'max_upload_speed_per_torrent',
- 'prioritize_first_last_pieces',
- 'sequential_download',
- ];
-
- deluge.client.core.get_config_values(keys, {
- success: function (config) {
- var options = {
- file_priorities: [],
- add_paused: config.add_paused,
- sequential_download: config.sequential_download,
- pre_allocate_storage: config.pre_allocate_storage,
- download_location: config.download_location,
- move_completed: config.move_completed,
- move_completed_path: config.move_completed_path,
- max_connections: config.max_connections_per_torrent,
- max_download_speed: config.max_download_speed_per_torrent,
- max_upload_slots: config.max_upload_slots_per_torrent,
- max_upload_speed: config.max_upload_speed_per_torrent,
- prioritize_first_last_pieces:
- config.prioritize_first_last_pieces,
- seed_mode: false,
- super_seeding: false,
- };
- this.optionsManager.options = options;
- this.optionsManager.resetAll();
- },
- scope: this,
- });
- },
-});
-/**
- * Deluge.add.UrlWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.namespace('Deluge.add');
-Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
- title: _('Add from Url'),
- modal: true,
- plain: true,
- layout: 'fit',
- width: 350,
- height: 155,
-
- buttonAlign: 'center',
- closeAction: 'hide',
- bodyStyle: 'padding: 10px 5px;',
- iconCls: 'x-deluge-add-url-window-icon',
-
- initComponent: function () {
- Deluge.add.UrlWindow.superclass.initComponent.call(this);
- this.addButton(_('Add'), this.onAddClick, this);
-
- var form = this.add({
- xtype: 'form',
- defaultType: 'textfield',
- baseCls: 'x-plain',
- labelWidth: 55,
- });
-
- this.urlField = form.add({
- fieldLabel: _('Url'),
- id: 'url',
- name: 'url',
- width: '97%',
- });
- this.urlField.on('specialkey', this.onAdd, this);
-
- this.cookieField = form.add({
- fieldLabel: _('Cookies'),
- id: 'cookies',
- name: 'cookies',
- width: '97%',
- });
- this.cookieField.on('specialkey', this.onAdd, this);
- },
-
- onAddClick: function (field, e) {
- if (
- (field.id == 'url' || field.id == 'cookies') &&
- e.getKey() != e.ENTER
- )
- return;
-
- var field = this.urlField;
- var url = field.getValue();
- var cookies = this.cookieField.getValue();
- var torrentId = this.createTorrentId();
-
- if (url.indexOf('magnet:?') == 0 && url.indexOf('xt=urn:btih') > -1) {
- deluge.client.web.get_magnet_info(url, {
- success: this.onGotInfo,
- scope: this,
- filename: url,
- torrentId: torrentId,
- });
- } else {
- deluge.client.web.download_torrent_from_url(url, cookies, {
- success: this.onDownload,
- failure: this.onDownloadFailed,
- scope: this,
- torrentId: torrentId,
- });
- }
-
- this.hide();
- this.urlField.setValue('');
- this.fireEvent('beforeadd', torrentId, url);
- },
-
- onDownload: function (filename, obj, resp, req) {
- deluge.client.web.get_torrent_info(filename, {
- success: this.onGotInfo,
- failure: this.onDownloadFailed,
- scope: this,
- filename: filename,
- torrentId: req.options.torrentId,
- });
- },
-
- onDownloadFailed: function (obj, resp, req) {
- Ext.MessageBox.show({
- title: _('Error'),
- msg: _('Failed to download torrent'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- this.fireEvent('addfailed', req.options.torrentId);
- },
-
- onGotInfo: function (info, obj, response, request) {
- info['filename'] = request.options.filename;
- this.fireEvent('add', request.options.torrentId, info);
- },
-});
-/**
- * Deluge.data.SortTypes.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.data');
-
-/**
- * Common sort functions that can be used for data Stores.
- *
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- *
- * @class Deluge.data.SortTypes
- * @singleton
- */
-Deluge.data.SortTypes = {
- // prettier-ignore
- asIPAddress: function(value) {
- var d = value.match(
- /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/
- );
- return ((+d[1] * 256 + (+d[2])) * 256 + (+d[3])) * 256 + (+d[4]);
- },
-
- asQueuePosition: function (value) {
- return value > -1 ? value : Number.MAX_VALUE;
- },
-
- asName: function (value) {
- return String(value).toLowerCase();
- },
-};
-/**
- * Deluge.data.PeerRecord.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.data');
-
-/**
- * Deluge.data.Peer record
- *
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- *
- * @class Deluge.data.Peer
- * @extends Ext.data.Record
- * @constructor
- * @param {Object} data The peer data
- */
-Deluge.data.Peer = Ext.data.Record.create([
- {
- name: 'country',
- type: 'string',
- },
- {
- name: 'ip',
- type: 'string',
- sortType: Deluge.data.SortTypes.asIPAddress,
- },
- {
- name: 'client',
- type: 'string',
- },
- {
- name: 'progress',
- type: 'float',
- },
- {
- name: 'down_speed',
- type: 'int',
- },
- {
- name: 'up_speed',
- type: 'int',
- },
- {
- name: 'seed',
- type: 'int',
- },
-]);
-/**
- * Deluge.data.TorrentRecord.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.data');
-
-/**
- * Deluge.data.Torrent record
- *
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- *
- * @class Deluge.data.Torrent
- * @extends Ext.data.Record
- * @constructor
- * @param {Object} data The torrents data
- */
-Deluge.data.Torrent = Ext.data.Record.create([
- {
- name: 'queue',
- type: 'int',
- },
- {
- name: 'name',
- type: 'string',
- sortType: Deluge.data.SortTypes.asName,
- },
- {
- name: 'total_wanted',
- type: 'int',
- },
- {
- name: 'state',
- type: 'string',
- },
- {
- name: 'progress',
- type: 'int',
- },
- {
- name: 'num_seeds',
- type: 'int',
- },
- {
- name: 'total_seeds',
- type: 'int',
- },
- {
- name: 'num_peers',
- type: 'int',
- },
- {
- name: 'total_peers',
- type: 'int',
- },
- {
- name: 'download_payload_rate',
- type: 'int',
- },
- {
- name: 'upload_payload_rate',
- type: 'int',
- },
- {
- name: 'eta',
- type: 'int',
- },
- {
- name: 'ratio',
- type: 'float',
- },
- {
- name: 'distributed_copies',
- type: 'float',
- },
- {
- name: 'time_added',
- type: 'int',
- },
- {
- name: 'tracker_host',
- type: 'string',
- },
- {
- name: 'save_path',
- type: 'string',
- },
- {
- name: 'total_done',
- type: 'int',
- },
- {
- name: 'total_uploaded',
- type: 'int',
- },
- {
- name: 'total_remaining',
- type: 'int',
- },
- {
- name: 'max_download_speed',
- type: 'int',
- },
- {
- name: 'max_upload_speed',
- type: 'int',
- },
- {
- name: 'seeds_peers_ratio',
- type: 'float',
- },
- {
- name: 'time_since_transfer',
- type: 'int',
- },
-]);
-/**
- * Deluge.details.DetailsPanel.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.details');
-
-/**
- * @class Deluge.details.DetailsPanel
- */
-Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
- id: 'torrentDetails',
- activeTab: 0,
-
- initComponent: function () {
- Deluge.details.DetailsPanel.superclass.initComponent.call(this);
- this.add(new Deluge.details.StatusTab());
- this.add(new Deluge.details.DetailsTab());
- this.add(new Deluge.details.FilesTab());
- this.add(new Deluge.details.PeersTab());
- this.add(new Deluge.details.OptionsTab());
- },
-
- clear: function () {
- this.items.each(function (panel) {
- if (panel.clear) {
- panel.clear.defer(100, panel);
- panel.disable();
- }
- });
- },
-
- update: function (tab) {
- var torrent = deluge.torrents.getSelected();
- if (!torrent) {
- this.clear();
- return;
- }
-
- this.items.each(function (tab) {
- if (tab.disabled) tab.enable();
- });
-
- tab = tab || this.getActiveTab();
- if (tab.update) tab.update(torrent.id);
- },
-
- /* Event Handlers */
-
- // We need to add the events in onRender since Deluge.Torrents has not been created yet.
- onRender: function (ct, position) {
- Deluge.details.DetailsPanel.superclass.onRender.call(
- this,
- ct,
- position
- );
- deluge.events.on('disconnect', this.clear, this);
- deluge.torrents.on('rowclick', this.onTorrentsClick, this);
- this.on('tabchange', this.onTabChange, this);
-
- deluge.torrents.getSelectionModel().on(
- 'selectionchange',
- function (selModel) {
- if (!selModel.hasSelection()) this.clear();
- },
- this
- );
- },
-
- onTabChange: function (panel, tab) {
- this.update(tab);
- },
-
- onTorrentsClick: function (grid, rowIndex, e) {
- this.update();
- },
-});
-/**
- * Deluge.Details.Details.js
- * The details tab displayed in the details panel.
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
- title: _('Details'),
-
- fields: {},
- autoScroll: true,
- queuedItems: {},
-
- oldData: {},
-
- initComponent: function () {
- Deluge.details.DetailsTab.superclass.initComponent.call(this);
- this.addItem('torrent_name', _('Name:'));
- this.addItem('hash', _('Hash:'));
- this.addItem('path', _('Download Folder:'));
- this.addItem('size', _('Total Size:'));
- this.addItem('files', _('Total Files:'));
- this.addItem('comment', _('Comment:'));
- this.addItem('status', _('Status:'));
- this.addItem('tracker', _('Tracker:'));
- this.addItem('creator', _('Created By:'));
- },
-
- onRender: function (ct, position) {
- Deluge.details.DetailsTab.superclass.onRender.call(this, ct, position);
- this.body.setStyle('padding', '10px');
- this.dl = Ext.DomHelper.append(this.body, { tag: 'dl' }, true);
-
- for (var id in this.queuedItems) {
- this.doAddItem(id, this.queuedItems[id]);
- }
- },
-
- addItem: function (id, label) {
- if (!this.rendered) {
- this.queuedItems[id] = label;
- } else {
- this.doAddItem(id, label);
- }
- },
-
- // private
- doAddItem: function (id, label) {
- Ext.DomHelper.append(this.dl, { tag: 'dt', cls: id, html: label });
- this.fields[id] = Ext.DomHelper.append(
- this.dl,
- { tag: 'dd', cls: id, html: '' },
- true
- );
- },
-
- clear: function () {
- if (!this.fields) return;
- for (var k in this.fields) {
- this.fields[k].dom.innerHTML = '';
- }
- this.oldData = {};
- },
-
- update: function (torrentId) {
- deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Details, {
- success: this.onRequestComplete,
- scope: this,
- torrentId: torrentId,
- });
- },
-
- onRequestComplete: function (torrent, request, response, options) {
- var data = {
- torrent_name: torrent.name,
- hash: options.options.torrentId,
- path: torrent.download_location,
- size: fsize(torrent.total_size),
- files: torrent.num_files,
- status: torrent.message,
- tracker: torrent.tracker_host,
- comment: torrent.comment,
- creator: torrent.creator,
- };
-
- for (var field in this.fields) {
- if (!Ext.isDefined(data[field])) continue; // This is a field we are not responsible for.
- if (data[field] == this.oldData[field]) continue;
- this.fields[field].dom.innerHTML = Ext.util.Format.htmlEncode(
- data[field]
- );
- }
- this.oldData = data;
- },
-});
-/**
- * Deluge.details.FilesTab.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
- title: _('Files'),
-
- rootVisible: false,
-
- columns: [
- {
- header: _('Filename'),
- width: 330,
- dataIndex: 'filename',
- tpl: new Ext.XTemplate('{filename:htmlEncode}'),
- },
- {
- header: _('Size'),
- width: 150,
- dataIndex: 'size',
- tpl: new Ext.XTemplate('{size:this.fsize}', {
- fsize: function (v) {
- return fsize(v);
- },
- }),
- },
- {
- xtype: 'tgrendercolumn',
- header: _('Progress'),
- width: 150,
- dataIndex: 'progress',
- renderer: function (v) {
- var progress = v * 100;
- return Deluge.progressBar(
- progress,
- this.col.width,
- progress.toFixed(2) + '%',
- 0
- );
- },
- },
- {
- header: _('Priority'),
- width: 150,
- dataIndex: 'priority',
- tpl: new Ext.XTemplate(
- '<tpl if="!isNaN(priority)">' +
- '<div class="{priority:this.getClass}">' +
- '{priority:this.getName}' +
- '</div></tpl>',
- {
- getClass: function (v) {
- return FILE_PRIORITY_CSS[v];
- },
-
- getName: function (v) {
- return _(FILE_PRIORITY[v]);
- },
- }
- ),
- },
- ],
-
- selModel: new Ext.tree.MultiSelectionModel(),
-
- initComponent: function () {
- Deluge.details.FilesTab.superclass.initComponent.call(this);
- this.setRootNode(new Ext.tree.TreeNode({ text: _('Files') }));
- },
-
- clear: function () {
- var root = this.getRootNode();
- if (!root.hasChildNodes()) return;
- root.cascade(function (node) {
- var parentNode = node.parentNode;
- if (!parentNode) return;
- if (!parentNode.ownerTree) return;
- parentNode.removeChild(node);
- });
- },
-
- createFileTree: function (files) {
- function walk(files, parentNode) {
- for (var file in files.contents) {
- var item = files.contents[file];
- if (item.type == 'dir') {
- walk(
- item,
- parentNode.appendChild(
- new Ext.tree.TreeNode({
- text: file,
- filename: file,
- size: item.size,
- progress: item.progress,
- priority: item.priority,
- })
- )
- );
- } else {
- parentNode.appendChild(
- new Ext.tree.TreeNode({
- text: file,
- filename: file,
- fileIndex: item.index,
- size: item.size,
- progress: item.progress,
- priority: item.priority,
- leaf: true,
- iconCls: 'x-deluge-file',
- uiProvider: Ext.ux.tree.TreeGridNodeUI,
- })
- );
- }
- }
- }
- var root = this.getRootNode();
- walk(files, root);
- root.firstChild.expand();
- },
-
- update: function (torrentId) {
- if (this.torrentId != torrentId) {
- this.clear();
- this.torrentId = torrentId;
- }
-
- deluge.client.web.get_torrent_files(torrentId, {
- success: this.onRequestComplete,
- scope: this,
- torrentId: torrentId,
- });
- },
-
- updateFileTree: function (files) {
- function walk(files, parentNode) {
- for (var file in files.contents) {
- var item = files.contents[file];
- var node = parentNode.findChild('filename', file);
- node.attributes.size = item.size;
- node.attributes.progress = item.progress;
- node.attributes.priority = item.priority;
- node.ui.updateColumns();
- if (item.type == 'dir') {
- walk(item, node);
- }
- }
- }
- walk(files, this.getRootNode());
- },
-
- onRender: function (ct, position) {
- Deluge.details.FilesTab.superclass.onRender.call(this, ct, position);
- deluge.menus.filePriorities.on('itemclick', this.onItemClick, this);
- this.on('contextmenu', this.onContextMenu, this);
- this.sorter = new Ext.tree.TreeSorter(this, {
- folderSort: true,
- });
- },
-
- onContextMenu: function (node, e) {
- e.stopEvent();
- var selModel = this.getSelectionModel();
- if (selModel.getSelectedNodes().length < 2) {
- selModel.clearSelections();
- node.select();
- }
- deluge.menus.filePriorities.showAt(e.getPoint());
- },
-
- onItemClick: function (baseItem, e) {
- switch (baseItem.id) {
- case 'expandAll':
- this.expandAll();
- break;
- default:
- var indexes = {};
- var walk = function (node) {
- if (Ext.isEmpty(node.attributes.fileIndex)) return;
- indexes[node.attributes.fileIndex] =
- node.attributes.priority;
- };
- this.getRootNode().cascade(walk);
-
- var nodes = this.getSelectionModel().getSelectedNodes();
- Ext.each(nodes, function (node) {
- if (!node.isLeaf()) {
- var setPriorities = function (node) {
- if (Ext.isEmpty(node.attributes.fileIndex)) return;
- indexes[node.attributes.fileIndex] =
- baseItem.filePriority;
- };
- node.cascade(setPriorities);
- } else if (!Ext.isEmpty(node.attributes.fileIndex)) {
- indexes[node.attributes.fileIndex] =
- baseItem.filePriority;
- return;
- }
- });
-
- var priorities = new Array(Ext.keys(indexes).length);
- for (var index in indexes) {
- priorities[index] = indexes[index];
- }
-
- deluge.client.core.set_torrent_options(
- [this.torrentId],
- { file_priorities: priorities },
- {
- success: function () {
- Ext.each(nodes, function (node) {
- node.setColumnValue(3, baseItem.filePriority);
- });
- },
- scope: this,
- }
- );
- break;
- }
- },
-
- onRequestComplete: function (files, options) {
- if (!this.getRootNode().hasChildNodes()) {
- this.createFileTree(files);
- } else {
- this.updateFileTree(files);
- }
- },
-});
-/**
- * Deluge.details.OptionsTab.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
- constructor: function (config) {
- config = Ext.apply(
- {
- autoScroll: true,
- bodyStyle: 'padding: 5px;',
- border: false,
- cls: 'x-deluge-options',
- defaults: {
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- },
- deferredRender: false,
- layout: 'column',
- title: _('Options'),
- },
- config
- );
- Deluge.details.OptionsTab.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.details.OptionsTab.superclass.initComponent.call(this);
-
- (this.fieldsets = {}), (this.fields = {});
- this.optionsManager = new Deluge.MultiOptionsManager({
- options: {
- max_download_speed: -1,
- max_upload_speed: -1,
- max_connections: -1,
- max_upload_slots: -1,
- auto_managed: false,
- stop_at_ratio: false,
- stop_ratio: 2.0,
- remove_at_ratio: false,
- move_completed: false,
- move_completed_path: '',
- private: false,
- prioritize_first_last: false,
- super_seeding: false,
- },
- });
-
- /*
- * Bandwidth Options
- */
- this.fieldsets.bandwidth = this.add({
- xtype: 'fieldset',
- defaultType: 'spinnerfield',
- bodyStyle: 'padding: 5px',
-
- layout: 'table',
- layoutConfig: { columns: 3 },
- labelWidth: 150,
-
- style: 'margin-left: 10px; margin-right: 5px; padding: 5px',
- title: _('Bandwidth'),
- width: 250,
- });
-
- /*
- * Max Download Speed
- */
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('Max Download Speed:'),
- forId: 'max_download_speed',
- cls: 'x-deluge-options-label',
- });
- this.fields.max_download_speed = this.fieldsets.bandwidth.add({
- id: 'max_download_speed',
- name: 'max_download_speed',
- width: 70,
- strategy: {
- xtype: 'number',
- decimalPrecision: 1,
- minValue: -1,
- maxValue: 99999,
- },
- });
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('KiB/s'),
- style: 'margin-left: 10px',
- });
-
- /*
- * Max Upload Speed
- */
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('Max Upload Speed:'),
- forId: 'max_upload_speed',
- cls: 'x-deluge-options-label',
- });
- this.fields.max_upload_speed = this.fieldsets.bandwidth.add({
- id: 'max_upload_speed',
- name: 'max_upload_speed',
- width: 70,
- value: -1,
- strategy: {
- xtype: 'number',
- decimalPrecision: 1,
- minValue: -1,
- maxValue: 99999,
- },
- });
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('KiB/s'),
- style: 'margin-left: 10px',
- });
-
- /*
- * Max Connections
- */
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('Max Connections:'),
- forId: 'max_connections',
- cls: 'x-deluge-options-label',
- });
- this.fields.max_connections = this.fieldsets.bandwidth.add({
- id: 'max_connections',
- name: 'max_connections',
- width: 70,
- value: -1,
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- },
- colspan: 2,
- });
-
- /*
- * Max Upload Slots
- */
- this.fieldsets.bandwidth.add({
- xtype: 'label',
- text: _('Max Upload Slots:'),
- forId: 'max_upload_slots',
- cls: 'x-deluge-options-label',
- });
- this.fields.max_upload_slots = this.fieldsets.bandwidth.add({
- id: 'max_upload_slots',
- name: 'max_upload_slots',
- width: 70,
- value: -1,
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- },
- colspan: 2,
- });
-
- /*
- * Queue Options
- */
- this.fieldsets.queue = this.add({
- xtype: 'fieldset',
- title: _('Queue'),
- style: 'margin-left: 5px; margin-right: 5px; padding: 5px',
- width: 210,
-
- layout: 'table',
- layoutConfig: { columns: 2 },
- labelWidth: 0,
-
- defaults: {
- fieldLabel: '',
- labelSeparator: '',
- },
- });
-
- this.fields.auto_managed = this.fieldsets.queue.add({
- xtype: 'checkbox',
- fieldLabel: '',
- labelSeparator: '',
- name: 'is_auto_managed',
- boxLabel: _('Auto Managed'),
- width: 200,
- colspan: 2,
- });
-
- this.fields.stop_at_ratio = this.fieldsets.queue.add({
- fieldLabel: '',
- labelSeparator: '',
- id: 'stop_at_ratio',
- width: 120,
- boxLabel: _('Stop seed at ratio:'),
- handler: this.onStopRatioChecked,
- scope: this,
- });
-
- this.fields.stop_ratio = this.fieldsets.queue.add({
- xtype: 'spinnerfield',
- id: 'stop_ratio',
- name: 'stop_ratio',
- disabled: true,
- width: 50,
- value: 2.0,
- strategy: {
- xtype: 'number',
- minValue: -1,
- maxValue: 99999,
- incrementValue: 0.1,
- alternateIncrementValue: 1,
- decimalPrecision: 1,
- },
- });
-
- this.fields.remove_at_ratio = this.fieldsets.queue.add({
- fieldLabel: '',
- labelSeparator: '',
- id: 'remove_at_ratio',
- ctCls: 'x-deluge-indent-checkbox',
- bodyStyle: 'padding-left: 10px',
- boxLabel: _('Remove at ratio'),
- disabled: true,
- colspan: 2,
- });
-
- this.fields.move_completed = this.fieldsets.queue.add({
- fieldLabel: '',
- labelSeparator: '',
- id: 'move_completed',
- boxLabel: _('Move Completed:'),
- colspan: 2,
- handler: this.onMoveCompletedChecked,
- scope: this,
- });
-
- this.fields.move_completed_path = this.fieldsets.queue.add({
- xtype: 'textfield',
- fieldLabel: '',
- id: 'move_completed_path',
- colspan: 3,
- bodyStyle: 'margin-left: 20px',
- width: 180,
- disabled: true,
- });
-
- /*
- * General Options
- */
- this.rightColumn = this.add({
- border: false,
- autoHeight: true,
- style: 'margin-left: 5px',
- width: 210,
- });
-
- this.fieldsets.general = this.rightColumn.add({
- xtype: 'fieldset',
- autoHeight: true,
- defaultType: 'checkbox',
- title: _('General'),
- layout: 'form',
- });
-
- this.fields['private'] = this.fieldsets.general.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Private'),
- id: 'private',
- disabled: true,
- });
-
- this.fields.prioritize_first_last = this.fieldsets.general.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Prioritize First/Last'),
- id: 'prioritize_first_last',
- });
-
- this.fields.super_seeding = this.fieldsets.general.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Super Seeding'),
- id: 'super_seeding',
- });
-
- // Bind the fields so the options manager can manage them.
- for (var id in this.fields) {
- this.optionsManager.bind(id, this.fields[id]);
- }
-
- /*
- * Buttons
- */
- this.buttonPanel = this.rightColumn.add({
- layout: 'hbox',
- xtype: 'panel',
- border: false,
- });
-
- /*
- * Edit Trackers button
- */
- this.buttonPanel.add({
- id: 'edit_trackers',
- xtype: 'button',
- text: _('Edit Trackers'),
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-edit-trackers',
- border: false,
- width: 100,
- handler: this.onEditTrackers,
- scope: this,
- });
-
- /*
- * Apply button
- */
- this.buttonPanel.add({
- id: 'apply',
- xtype: 'button',
- text: _('Apply'),
- style: 'margin-left: 10px;',
- border: false,
- width: 100,
- handler: this.onApply,
- scope: this,
- });
- },
-
- onRender: function (ct, position) {
- Deluge.details.OptionsTab.superclass.onRender.call(this, ct, position);
-
- // This is another hack I think, so keep an eye out here when upgrading.
- this.layout = new Ext.layout.ColumnLayout();
- this.layout.setContainer(this);
- this.doLayout();
- },
-
- clear: function () {
- if (this.torrentId == null) return;
- this.torrentId = null;
- this.optionsManager.changeId(null);
- },
-
- reset: function () {
- if (this.torrentId) this.optionsManager.reset();
- },
-
- update: function (torrentId) {
- if (this.torrentId && !torrentId) this.clear(); // we want to clear the pane if we get a null torrent torrentIds
-
- if (!torrentId) return; // We do not care about null torrentIds.
-
- if (this.torrentId != torrentId) {
- this.torrentId = torrentId;
- this.optionsManager.changeId(torrentId);
- }
- deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Options, {
- success: this.onRequestComplete,
- scope: this,
- });
- },
-
- onApply: function () {
- var changed = this.optionsManager.getDirty();
- deluge.client.core.set_torrent_options([this.torrentId], changed, {
- success: function () {
- this.optionsManager.commit();
- },
- scope: this,
- });
- },
-
- onEditTrackers: function () {
- deluge.editTrackers.show();
- },
-
- onMoveCompletedChecked: function (checkbox, checked) {
- this.fields.move_completed_path.setDisabled(!checked);
-
- if (!checked) return;
- this.fields.move_completed_path.focus();
- },
-
- onStopRatioChecked: function (checkbox, checked) {
- this.fields.remove_at_ratio.setDisabled(!checked);
- this.fields.stop_ratio.setDisabled(!checked);
- },
-
- onRequestComplete: function (torrent, options) {
- this.fields['private'].setValue(torrent['private']);
- this.fields['private'].setDisabled(true);
- delete torrent['private'];
- torrent['auto_managed'] = torrent['is_auto_managed'];
- torrent['prioritize_first_last_pieces'] =
- torrent['prioritize_first_last'];
- this.optionsManager.setDefault(torrent);
- var stop_at_ratio = this.optionsManager.get('stop_at_ratio');
- this.fields.remove_at_ratio.setDisabled(!stop_at_ratio);
- this.fields.stop_ratio.setDisabled(!stop_at_ratio);
- this.fields.move_completed_path.setDisabled(
- !this.optionsManager.get('move_completed')
- );
- },
-});
-/**
- * Deluge.details.PeersTab.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-(function () {
- function flagRenderer(value) {
- if (!value.replace(' ', '').replace(' ', '')) {
- return '';
- }
- return String.format(
- '<img alt="{1}" title="{1}" src="{0}flag/{1}" />',
- deluge.config.base,
- value
- );
- }
- function peerAddressRenderer(value, p, record) {
- var seed =
- record.data['seed'] == 1024 ? 'x-deluge-seed' : 'x-deluge-peer';
- // Modify display of IPv6 to include brackets
- var peer_ip = value.split(':');
- if (peer_ip.length > 2) {
- var port = peer_ip.pop();
- var ip = peer_ip.join(':');
- value = '[' + ip + ']:' + port;
- }
- return String.format('<div class="{0}">{1}</div>', seed, value);
- }
- function peerProgressRenderer(value) {
- var progress = (value * 100).toFixed(0);
- return Deluge.progressBar(progress, this.width - 8, progress + '%');
- }
-
- Deluge.details.PeersTab = Ext.extend(Ext.grid.GridPanel, {
- // fast way to figure out if we have a peer already.
- peers: {},
-
- constructor: function (config) {
- config = Ext.apply(
- {
- title: _('Peers'),
- cls: 'x-deluge-peers',
- store: new Ext.data.Store({
- reader: new Ext.data.JsonReader(
- {
- idProperty: 'ip',
- root: 'peers',
- },
- Deluge.data.Peer
- ),
- }),
- columns: [
- {
- header: '&nbsp;',
- width: 30,
- sortable: true,
- renderer: flagRenderer,
- dataIndex: 'country',
- },
- {
- header: _('Address'),
- width: 125,
- sortable: true,
- renderer: peerAddressRenderer,
- dataIndex: 'ip',
- },
- {
- header: _('Client'),
- width: 125,
- sortable: true,
- renderer: 'htmlEncode',
- dataIndex: 'client',
- },
- {
- header: _('Progress'),
- width: 150,
- sortable: true,
- renderer: peerProgressRenderer,
- dataIndex: 'progress',
- },
- {
- header: _('Down Speed'),
- width: 100,
- sortable: true,
- renderer: fspeed,
- dataIndex: 'down_speed',
- },
- {
- header: _('Up Speed'),
- width: 100,
- sortable: true,
- renderer: fspeed,
- dataIndex: 'up_speed',
- },
- ],
- stripeRows: true,
- deferredRender: false,
- autoScroll: true,
- },
- config
- );
- Deluge.details.PeersTab.superclass.constructor.call(this, config);
- },
-
- clear: function () {
- this.getStore().removeAll();
- this.peers = {};
- },
-
- update: function (torrentId) {
- deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Peers, {
- success: this.onRequestComplete,
- scope: this,
- });
- },
-
- onRequestComplete: function (torrent, options) {
- if (!torrent) return;
-
- var store = this.getStore();
- var newPeers = [];
- var addresses = {};
-
- // Go through the peers updating and creating peer records
- Ext.each(
- torrent.peers,
- function (peer) {
- if (this.peers[peer.ip]) {
- var record = store.getById(peer.ip);
- record.beginEdit();
- for (var k in peer) {
- if (record.get(k) != peer[k]) {
- record.set(k, peer[k]);
- }
- }
- record.endEdit();
- } else {
- this.peers[peer.ip] = 1;
- newPeers.push(new Deluge.data.Peer(peer, peer.ip));
- }
- addresses[peer.ip] = 1;
- },
- this
- );
- store.add(newPeers);
-
- // Remove any peers that should not be left in the store.
- store.each(function (record) {
- if (!addresses[record.id]) {
- store.remove(record);
- delete this.peers[record.id];
- }
- }, this);
- store.commitChanges();
-
- var sortState = store.getSortState();
- if (!sortState) return;
- store.sort(sortState.field, sortState.direction);
- },
- });
-})();
-/**
- * Deluge.details.StatusTab.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.details');
-
-/**
- * @class Deluge.details.StatusTab
- * @extends Ext.Panel
- */
-Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
- title: _('Status'),
- autoScroll: true,
-
- onRender: function (ct, position) {
- Deluge.details.StatusTab.superclass.onRender.call(this, ct, position);
-
- this.progressBar = this.add({
- xtype: 'progress',
- cls: 'x-deluge-status-progressbar',
- });
-
- this.status = this.add({
- cls: 'x-deluge-status',
- id: 'deluge-details-status',
-
- border: false,
- width: 1000,
- listeners: {
- render: {
- fn: function (panel) {
- panel.load({
- url: deluge.config.base + 'render/tab_status.html',
- text: _('Loading') + '...',
- });
- panel
- .getUpdater()
- .on('update', this.onPanelUpdate, this);
- },
- scope: this,
- },
- },
- });
- },
-
- clear: function () {
- this.progressBar.updateProgress(0, ' ');
- for (var k in this.fields) {
- this.fields[k].innerHTML = '';
- }
- },
-
- update: function (torrentId) {
- if (!this.fields) this.getFields();
- deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Status, {
- success: this.onRequestComplete,
- scope: this,
- });
- },
-
- onPanelUpdate: function (el, response) {
- this.fields = {};
- Ext.each(
- Ext.query('dd', this.status.body.dom),
- function (field) {
- this.fields[field.className] = field;
- },
- this
- );
- },
-
- onRequestComplete: function (status) {
- seeds =
- status.total_seeds > -1
- ? status.num_seeds + ' (' + status.total_seeds + ')'
- : status.num_seeds;
- peers =
- status.total_peers > -1
- ? status.num_peers + ' (' + status.total_peers + ')'
- : status.num_peers;
- last_seen_complete =
- status.last_seen_complete > 0.0
- ? fdate(status.last_seen_complete)
- : 'Never';
- completed_time =
- status.completed_time > 0.0 ? fdate(status.completed_time) : '';
-
- var data = {
- downloaded: fsize(status.total_done, true),
- uploaded: fsize(status.total_uploaded, true),
- share: status.ratio == -1 ? '&infin;' : status.ratio.toFixed(3),
- announce: ftime(status.next_announce),
- tracker_status: status.tracker_status,
- downspeed: status.download_payload_rate
- ? fspeed(status.download_payload_rate)
- : '0.0 KiB/s',
- upspeed: status.upload_payload_rate
- ? fspeed(status.upload_payload_rate)
- : '0.0 KiB/s',
- eta: status.eta < 0 ? '&infin;' : ftime(status.eta),
- pieces: status.num_pieces + ' (' + fsize(status.piece_length) + ')',
- seeds: seeds,
- peers: peers,
- avail: status.distributed_copies.toFixed(3),
- active_time: ftime(status.active_time),
- seeding_time: ftime(status.seeding_time),
- seed_rank: status.seed_rank,
- time_added: fdate(status.time_added),
- last_seen_complete: last_seen_complete,
- completed_time: completed_time,
- time_since_transfer: ftime(status.time_since_transfer),
- };
- data.auto_managed = _(status.is_auto_managed ? 'True' : 'False');
-
- var translate_tracker_status = {
- Error: _('Error'),
- Warning: _('Warning'),
- 'Announce OK': _('Announce OK'),
- 'Announce Sent': _('Announce Sent'),
- };
- for (var key in translate_tracker_status) {
- if (data.tracker_status.indexOf(key) != -1) {
- data.tracker_status = data.tracker_status.replace(
- key,
- translate_tracker_status[key]
- );
- break;
- }
- }
-
- data.downloaded +=
- ' (' +
- (status.total_payload_download
- ? fsize(status.total_payload_download)
- : '0.0 KiB') +
- ')';
- data.uploaded +=
- ' (' +
- (status.total_payload_upload
- ? fsize(status.total_payload_upload)
- : '0.0 KiB') +
- ')';
-
- for (var field in this.fields) {
- this.fields[field].innerHTML = data[field];
- }
- var text = status.state + ' ' + status.progress.toFixed(2) + '%';
- this.progressBar.updateProgress(status.progress / 100.0, text);
- },
-});
-/**
- * Deluge.preferences.BandwidthPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Bandwidth
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
- constructor: function (config) {
- config = Ext.apply(
- {
- border: false,
- title: _('Bandwidth'),
- header: false,
- layout: 'form',
- labelWidth: 10,
- },
- config
- );
- Deluge.preferences.Bandwidth.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.preferences.Bandwidth.superclass.initComponent.call(this);
-
- var om = deluge.preferences.getOptionsManager();
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Global Bandwidth Usage'),
- labelWidth: 200,
- defaultType: 'spinnerfield',
- defaults: {
- minValue: -1,
- maxValue: 99999,
- },
- style: 'margin-bottom: 0px; padding-bottom: 0px;',
- autoHeight: true,
- });
- om.bind(
- 'max_connections_global',
- fieldset.add({
- name: 'max_connections_global',
- fieldLabel: _('Maximum Connections:'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_upload_slots_global',
- fieldset.add({
- name: 'max_upload_slots_global',
- fieldLabel: _('Maximum Upload Slots'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_download_speed',
- fieldset.add({
- name: 'max_download_speed',
- fieldLabel: _('Maximum Download Speed (KiB/s):'),
- labelSeparator: '',
- width: 80,
- value: -1.0,
- decimalPrecision: 1,
- })
- );
- om.bind(
- 'max_upload_speed',
- fieldset.add({
- name: 'max_upload_speed',
- fieldLabel: _('Maximum Upload Speed (KiB/s):'),
- labelSeparator: '',
- width: 80,
- value: -1.0,
- decimalPrecision: 1,
- })
- );
- om.bind(
- 'max_half_open_connections',
- fieldset.add({
- name: 'max_half_open_connections',
- fieldLabel: _('Maximum Half-Open Connections:'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_connections_per_second',
- fieldset.add({
- name: 'max_connections_per_second',
- fieldLabel: _('Maximum Connection Attempts per Second:'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: '',
- defaultType: 'checkbox',
- style: 'padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;',
- autoHeight: true,
- });
- om.bind(
- 'ignore_limits_on_local_network',
- fieldset.add({
- name: 'ignore_limits_on_local_network',
- height: 22,
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Ignore limits on local network'),
- })
- );
- om.bind(
- 'rate_limit_ip_overhead',
- fieldset.add({
- name: 'rate_limit_ip_overhead',
- height: 22,
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Rate limit IP overhead'),
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Per Torrent Bandwidth Usage'),
- style: 'margin-bottom: 0px; padding-bottom: 0px;',
- defaultType: 'spinnerfield',
- labelWidth: 200,
- defaults: {
- minValue: -1,
- maxValue: 99999,
- },
- autoHeight: true,
- });
- om.bind(
- 'max_connections_per_torrent',
- fieldset.add({
- name: 'max_connections_per_torrent',
- fieldLabel: _('Maximum Connections:'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_upload_slots_per_torrent',
- fieldset.add({
- name: 'max_upload_slots_per_torrent',
- fieldLabel: _('Maximum Upload Slots:'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_download_speed_per_torrent',
- fieldset.add({
- name: 'max_download_speed_per_torrent',
- fieldLabel: _('Maximum Download Speed (KiB/s):'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- om.bind(
- 'max_upload_speed_per_torrent',
- fieldset.add({
- name: 'max_upload_speed_per_torrent',
- fieldLabel: _('Maximum Upload Speed (KiB/s):'),
- labelSeparator: '',
- width: 80,
- value: -1,
- decimalPrecision: 0,
- })
- );
- },
-});
-/**
- * Deluge.preferences.CachePage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Cache
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
- border: false,
- title: _('Cache'),
- header: false,
- layout: 'form',
-
- initComponent: function () {
- Deluge.preferences.Cache.superclass.initComponent.call(this);
-
- var om = deluge.preferences.getOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Settings'),
- autoHeight: true,
- labelWidth: 180,
- defaultType: 'spinnerfield',
- defaults: {
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 999999,
- },
- });
- om.bind(
- 'cache_size',
- fieldset.add({
- fieldLabel: _('Cache Size (16 KiB Blocks):'),
- labelSeparator: '',
- name: 'cache_size',
- width: 60,
- value: 512,
- })
- );
- om.bind(
- 'cache_expiry',
- fieldset.add({
- fieldLabel: _('Cache Expiry (seconds):'),
- labelSeparator: '',
- name: 'cache_expiry',
- width: 60,
- value: 60,
- })
- );
- },
-});
-/**
- * Deluge.preferences.DaemonPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Daemon
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
- border: false,
- title: _('Daemon'),
- header: false,
- layout: 'form',
-
- initComponent: function () {
- Deluge.preferences.Daemon.superclass.initComponent.call(this);
-
- var om = deluge.preferences.getOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Port'),
- autoHeight: true,
- defaultType: 'spinnerfield',
- });
- om.bind(
- 'daemon_port',
- fieldset.add({
- fieldLabel: _('Daemon port:'),
- labelSeparator: '',
- name: 'daemon_port',
- value: 58846,
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Connections'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- om.bind(
- 'allow_remote',
- fieldset.add({
- fieldLabel: '',
- height: 22,
- labelSeparator: '',
- boxLabel: _('Allow Remote Connections'),
- name: 'allow_remote',
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Other'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- om.bind(
- 'new_release_check',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 40,
- boxLabel: _('Periodically check the website for new releases'),
- id: 'new_release_check',
- })
- );
- },
-});
-/**
- * Deluge.preferences.DownloadsPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Downloads
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
- constructor: function (config) {
- config = Ext.apply(
- {
- border: false,
- title: _('Downloads'),
- header: false,
- layout: 'form',
- autoHeight: true,
- width: 320,
- },
- config
- );
- Deluge.preferences.Downloads.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.preferences.Downloads.superclass.initComponent.call(this);
-
- var optMan = deluge.preferences.getOptionsManager();
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Folders'),
- labelWidth: 150,
- defaultType: 'togglefield',
- autoHeight: true,
- labelAlign: 'top',
- width: 300,
- style: 'margin-bottom: 5px; padding-bottom: 5px;',
- });
-
- optMan.bind(
- 'download_location',
- fieldset.add({
- xtype: 'textfield',
- name: 'download_location',
- fieldLabel: _('Download to:'),
- labelSeparator: '',
- width: 280,
- })
- );
-
- var field = fieldset.add({
- name: 'move_completed_path',
- fieldLabel: _('Move completed to:'),
- labelSeparator: '',
- width: 280,
- });
- optMan.bind('move_completed', field.toggle);
- optMan.bind('move_completed_path', field.input);
-
- field = fieldset.add({
- name: 'torrentfiles_location',
- fieldLabel: _('Copy of .torrent files to:'),
- labelSeparator: '',
- width: 280,
- });
- optMan.bind('copy_torrent_file', field.toggle);
- optMan.bind('torrentfiles_location', field.input);
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Options'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- style: 'margin-bottom: 0; padding-bottom: 0;',
- width: 280,
- });
- optMan.bind(
- 'prioritize_first_last_pieces',
- fieldset.add({
- name: 'prioritize_first_last_pieces',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Prioritize first and last pieces of torrent'),
- })
- );
- optMan.bind(
- 'sequential_download',
- fieldset.add({
- name: 'sequential_download',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Sequential download'),
- })
- );
- optMan.bind(
- 'add_paused',
- fieldset.add({
- name: 'add_paused',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Add torrents in Paused state'),
- })
- );
- optMan.bind(
- 'pre_allocate_storage',
- fieldset.add({
- name: 'pre_allocate_storage',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Pre-allocate disk space'),
- })
- );
- },
-});
-/**
- * Deluge.preferences.EncryptionPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Encryption
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
- border: false,
- title: _('Encryption'),
- header: false,
-
- initComponent: function () {
- Deluge.preferences.Encryption.superclass.initComponent.call(this);
-
- var optMan = deluge.preferences.getOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Settings'),
- header: false,
- autoHeight: true,
- defaultType: 'combo',
- width: 300,
- });
- optMan.bind(
- 'enc_in_policy',
- fieldset.add({
- fieldLabel: _('Incoming:'),
- labelSeparator: '',
- mode: 'local',
- width: 150,
- store: new Ext.data.ArrayStore({
- fields: ['id', 'text'],
- data: [
- [0, _('Forced')],
- [1, _('Enabled')],
- [2, _('Disabled')],
- ],
- }),
- editable: false,
- triggerAction: 'all',
- valueField: 'id',
- displayField: 'text',
- })
- );
- optMan.bind(
- 'enc_out_policy',
- fieldset.add({
- fieldLabel: _('Outgoing:'),
- labelSeparator: '',
- mode: 'local',
- width: 150,
- store: new Ext.data.SimpleStore({
- fields: ['id', 'text'],
- data: [
- [0, _('Forced')],
- [1, _('Enabled')],
- [2, _('Disabled')],
- ],
- }),
- editable: false,
- triggerAction: 'all',
- valueField: 'id',
- displayField: 'text',
- })
- );
- optMan.bind(
- 'enc_level',
- fieldset.add({
- fieldLabel: _('Level:'),
- labelSeparator: '',
- mode: 'local',
- width: 150,
- store: new Ext.data.SimpleStore({
- fields: ['id', 'text'],
- data: [
- [0, _('Handshake')],
- [1, _('Full Stream')],
- [2, _('Either')],
- ],
- }),
- editable: false,
- triggerAction: 'all',
- valueField: 'id',
- displayField: 'text',
- })
- );
- },
-});
-/**
- * Deluge.preferences.InstallPluginWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.InstallPluginWindow
- * @extends Ext.Window
- */
-Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
- title: _('Install Plugin'),
- layout: 'fit',
- height: 115,
- width: 350,
- constrainHeader: true,
- bodyStyle: 'padding: 10px 5px;',
- buttonAlign: 'center',
- closeAction: 'hide',
- iconCls: 'x-deluge-install-plugin',
- modal: true,
- plain: true,
-
- initComponent: function () {
- Deluge.preferences.InstallPluginWindow.superclass.initComponent.call(
- this
- );
- this.addButton(_('Install'), this.onInstall, this);
-
- this.form = this.add({
- xtype: 'form',
- baseCls: 'x-plain',
- labelWidth: 70,
- autoHeight: true,
- fileUpload: true,
- items: [
- {
- xtype: 'fileuploadfield',
- width: 240,
- emptyText: _('Select an egg'),
- fieldLabel: _('Plugin Egg'),
- name: 'file',
- buttonCfg: {
- text: _('Browse...'),
- },
- },
- ],
- });
- },
-
- onInstall: function (field, e) {
- this.form.getForm().submit({
- url: deluge.config.base + 'upload',
- waitMsg: _('Uploading your plugin...'),
- success: this.onUploadSuccess,
- scope: this,
- });
- },
-
- onUploadPlugin: function (info, obj, response, request) {
- this.fireEvent('pluginadded');
- },
-
- onUploadSuccess: function (fp, upload) {
- this.hide();
- if (upload.result.success) {
- var filename = this.form.getForm().getFieldValues().file;
- filename = filename.split('\\').slice(-1)[0];
- var path = upload.result.files[0];
- this.form.getForm().setValues({ file: '' });
- deluge.client.web.upload_plugin(filename, path, {
- success: this.onUploadPlugin,
- scope: this,
- filename: filename,
- });
- }
- },
-});
-/**
- * Deluge.preferences.InterfacePage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Interface
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
- border: false,
- title: _('Interface'),
- header: false,
- layout: 'form',
-
- initComponent: function () {
- Deluge.preferences.Interface.superclass.initComponent.call(this);
-
- var om = (this.optionsManager = new Deluge.OptionsManager());
- this.on('show', this.onPageShow, this);
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Interface'),
- style: 'margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- defaults: {
- height: 17,
- fieldLabel: '',
- labelSeparator: '',
- },
- });
- om.bind(
- 'show_session_speed',
- fieldset.add({
- name: 'show_session_speed',
- boxLabel: _('Show session speed in titlebar'),
- })
- );
- om.bind(
- 'sidebar_show_zero',
- fieldset.add({
- name: 'sidebar_show_zero',
- boxLabel: _('Show filters with zero torrents'),
- })
- );
- om.bind(
- 'sidebar_multiple_filters',
- fieldset.add({
- name: 'sidebar_multiple_filters',
- boxLabel: _('Allow the use of multiple filters at once'),
- })
- );
-
- var languagePanel = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Language'),
- style: 'margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- this.language = om.bind(
- 'language',
- languagePanel.add({
- xtype: 'combo',
- labelSeparator: '',
- name: 'language',
- mode: 'local',
- width: 200,
- store: new Ext.data.ArrayStore({
- fields: ['id', 'text'],
- }),
- editable: false,
- triggerAction: 'all',
- valueField: 'id',
- displayField: 'text',
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('WebUI Password'),
- style: 'margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px',
- autoHeight: true,
- labelWidth: 100,
- defaultType: 'textfield',
- defaults: {
- width: 100,
- inputType: 'password',
- labelStyle: 'padding-left: 5px',
- height: 20,
- labelSeparator: '',
- },
- });
-
- this.oldPassword = fieldset.add({
- name: 'old_password',
- fieldLabel: _('Old:'),
- });
- this.newPassword = fieldset.add({
- name: 'new_password',
- fieldLabel: _('New:'),
- });
- this.confirmPassword = fieldset.add({
- name: 'confirm_password',
- fieldLabel: _('Confirm:'),
- });
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Server'),
- style: 'padding-top: 5px; margin-bottom: 0px; padding-bottom: 5px',
- autoHeight: true,
- labelWidth: 100,
- defaultType: 'spinnerfield',
- defaults: {
- labelSeparator: '',
- labelStyle: 'padding-left: 5px',
- height: 20,
- width: 80,
- },
- });
- om.bind(
- 'session_timeout',
- fieldset.add({
- name: 'session_timeout',
- fieldLabel: _('Session Timeout:'),
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
- om.bind(
- 'port',
- fieldset.add({
- name: 'port',
- fieldLabel: _('Port:'),
- decimalPrecision: 0,
- minValue: 1,
- maxValue: 65535,
- })
- );
- this.httpsField = om.bind(
- 'https',
- fieldset.add({
- xtype: 'checkbox',
- name: 'https',
- hideLabel: true,
- width: 300,
- style: 'margin-left: 5px',
- boxLabel: _(
- 'Enable SSL (paths relative to Deluge config folder)'
- ),
- })
- );
- this.httpsField.on('check', this.onSSLCheck, this);
- this.pkeyField = om.bind(
- 'pkey',
- fieldset.add({
- xtype: 'textfield',
- disabled: true,
- name: 'pkey',
- width: 180,
- fieldLabel: _('Private Key:'),
- })
- );
- this.certField = om.bind(
- 'cert',
- fieldset.add({
- xtype: 'textfield',
- disabled: true,
- name: 'cert',
- width: 180,
- fieldLabel: _('Certificate:'),
- })
- );
- },
-
- onApply: function () {
- var changed = this.optionsManager.getDirty();
- if (!Ext.isObjectEmpty(changed)) {
- deluge.client.web.set_config(changed, {
- success: this.onSetConfig,
- scope: this,
- });
-
- for (var key in deluge.config) {
- deluge.config[key] = this.optionsManager.get(key);
- }
- if ('language' in changed) {
- Ext.Msg.show({
- title: _('WebUI Language Changed'),
- msg: _(
- 'Do you want to refresh the page now to use the new language?'
- ),
- buttons: {
- yes: _('Refresh'),
- no: _('Close'),
- },
- multiline: false,
- fn: function (btnText) {
- if (btnText === 'yes') location.reload();
- },
- icon: Ext.MessageBox.QUESTION,
- });
- }
- }
- if (this.oldPassword.getValue() || this.newPassword.getValue()) {
- this.onPasswordChange();
- }
- },
-
- onOk: function () {
- this.onApply();
- },
-
- onGotConfig: function (config) {
- this.optionsManager.set(config);
- },
-
- onGotLanguages: function (info, obj, response, request) {
- info.unshift(['', _('System Default')]);
- this.language.store.loadData(info);
- this.language.setValue(this.optionsManager.get('language'));
- },
-
- onPasswordChange: function () {
- var newPassword = this.newPassword.getValue();
- if (newPassword != this.confirmPassword.getValue()) {
- Ext.MessageBox.show({
- title: _('Invalid Password'),
- msg: _("Your passwords don't match!"),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- return;
- }
-
- var oldPassword = this.oldPassword.getValue();
- deluge.client.auth.change_password(oldPassword, newPassword, {
- success: function (result) {
- if (!result) {
- Ext.MessageBox.show({
- title: _('Password'),
- msg: _('Your old password was incorrect!'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- this.oldPassword.setValue('');
- } else {
- Ext.MessageBox.show({
- title: _('Change Successful'),
- msg: _('Your password was successfully changed!'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.INFO,
- iconCls: 'x-deluge-icon-info',
- });
- this.oldPassword.setValue('');
- this.newPassword.setValue('');
- this.confirmPassword.setValue('');
- }
- },
- scope: this,
- });
- },
-
- onSetConfig: function () {
- this.optionsManager.commit();
- },
-
- onPageShow: function () {
- deluge.client.web.get_config({
- success: this.onGotConfig,
- scope: this,
- });
- deluge.client.webutils.get_languages({
- success: this.onGotLanguages,
- scope: this,
- });
- },
-
- onSSLCheck: function (e, checked) {
- this.pkeyField.setDisabled(!checked);
- this.certField.setDisabled(!checked);
- },
-});
-/**
- * Deluge.preferences.NetworkPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-// custom Vtype for vtype:'IPAddress'
-Ext.apply(Ext.form.VTypes, {
- IPAddress: function (v) {
- return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v);
- },
- IPAddressText: 'Must be a numeric IP address',
- IPAddressMask: /[\d\.]/i,
-});
-
-/**
- * @class Deluge.preferences.Network
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
- border: false,
- layout: 'form',
- title: _('Network'),
- header: false,
-
- initComponent: function () {
- Deluge.preferences.Network.superclass.initComponent.call(this);
- var optMan = deluge.preferences.getOptionsManager();
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Incoming Address'),
- style: 'margin-bottom: 5px; padding-bottom: 0px;',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'textfield',
- });
- optMan.bind(
- 'listen_interface',
- fieldset.add({
- name: 'listen_interface',
- fieldLabel: '',
- labelSeparator: '',
- width: 200,
- vtype: 'IPAddress',
- })
- );
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Incoming Port'),
- style: 'margin-bottom: 5px; padding-bottom: 0px;',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- optMan.bind(
- 'random_port',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Use Random Port'),
- name: 'random_port',
- height: 22,
- listeners: {
- check: {
- fn: function (e, checked) {
- this.listenPort.setDisabled(checked);
- },
- scope: this,
- },
- },
- })
- );
-
- this.listenPort = fieldset.add({
- xtype: 'spinnerfield',
- name: 'listen_port',
- fieldLabel: '',
- labelSeparator: '',
- width: 75,
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: 0,
- maxValue: 65535,
- },
- });
- optMan.bind('listen_ports', this.listenPort);
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Outgoing Interface'),
- style: 'margin-bottom: 5px; padding-bottom: 0px;',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'textfield',
- });
- optMan.bind(
- 'outgoing_interface',
- fieldset.add({
- name: 'outgoing_interface',
- fieldLabel: '',
- labelSeparator: '',
- width: 40,
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Outgoing Ports'),
- style: 'margin-bottom: 5px; padding-bottom: 0px;',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- optMan.bind(
- 'random_outgoing_ports',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Use Random Ports'),
- name: 'random_outgoing_ports',
- height: 22,
- listeners: {
- check: {
- fn: function (e, checked) {
- this.outgoingPorts.setDisabled(checked);
- },
- scope: this,
- },
- },
- })
- );
- this.outgoingPorts = fieldset.add({
- xtype: 'spinnergroup',
- name: 'outgoing_ports',
- fieldLabel: '',
- labelSeparator: '',
- colCfg: {
- labelWidth: 40,
- style: 'margin-right: 10px;',
- },
- items: [
- {
- fieldLabel: _('From:'),
- labelSeparator: '',
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: 0,
- maxValue: 65535,
- },
- },
- {
- fieldLabel: _('To:'),
- labelSeparator: '',
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: 0,
- maxValue: 65535,
- },
- },
- ],
- });
- optMan.bind('outgoing_ports', this.outgoingPorts);
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Network Extras'),
- autoHeight: true,
- layout: 'table',
- layoutConfig: {
- columns: 3,
- },
- defaultType: 'checkbox',
- });
- optMan.bind(
- 'upnp',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('UPnP'),
- name: 'upnp',
- })
- );
- optMan.bind(
- 'natpmp',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('NAT-PMP'),
- ctCls: 'x-deluge-indent-checkbox',
- name: 'natpmp',
- })
- );
- optMan.bind(
- 'utpex',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('Peer Exchange'),
- ctCls: 'x-deluge-indent-checkbox',
- name: 'utpex',
- })
- );
- optMan.bind(
- 'lsd',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('LSD'),
- name: 'lsd',
- })
- );
- optMan.bind(
- 'dht',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- boxLabel: _('DHT'),
- ctCls: 'x-deluge-indent-checkbox',
- name: 'dht',
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Type Of Service'),
- style: 'margin-bottom: 5px; padding-bottom: 0px;',
- bodyStyle: 'margin: 0px; padding: 0px',
- autoHeight: true,
- defaultType: 'textfield',
- });
- optMan.bind(
- 'peer_tos',
- fieldset.add({
- name: 'peer_tos',
- fieldLabel: _('Peer TOS Byte:'),
- labelSeparator: '',
- width: 40,
- })
- );
- },
-});
-/**
- * Deluge.preferences.OtherPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Other
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
- constructor: function (config) {
- config = Ext.apply(
- {
- border: false,
- title: _('Other'),
- header: false,
- layout: 'form',
- },
- config
- );
- Deluge.preferences.Other.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.preferences.Other.superclass.initComponent.call(this);
-
- var optMan = deluge.preferences.getOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Updates'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- optMan.bind(
- 'new_release_check',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 22,
- name: 'new_release_check',
- boxLabel: _('Be alerted about new releases'),
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('System Information'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- fieldset.add({
- xtype: 'panel',
- border: false,
- bodyCfg: {
- html: _(
- 'Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent.'
- ),
- },
- });
- optMan.bind(
- 'send_info',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Yes, please send anonymous statistics'),
- name: 'send_info',
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('GeoIP Database'),
- autoHeight: true,
- labelWidth: 80,
- defaultType: 'textfield',
- });
- optMan.bind(
- 'geoip_db_location',
- fieldset.add({
- name: 'geoip_db_location',
- fieldLabel: _('Path:'),
- labelSeparator: '',
- width: 200,
- })
- );
- },
-});
-/**
- * Deluge.preferences.PluginsPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Plugins
- * @extends Ext.Panel
- */
-Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
- layout: 'border',
- title: _('Plugins'),
- header: false,
- border: false,
- cls: 'x-deluge-plugins',
-
- pluginTemplate: new Ext.Template(
- '<dl class="singleline">' +
- '<dt>' +
- _('Author:') +
- '</dt><dd>{author}</dd>' +
- '<dt>' +
- _('Version:') +
- '</dt><dd>{version}</dd>' +
- '<dt>' +
- _('Author Email:') +
- '</dt><dd>{email}</dd>' +
- '<dt>' +
- _('Homepage:') +
- '</dt><dd>{homepage}</dd>' +
- '<dt>' +
- _('Details:') +
- '</dt><dd style="white-space:normal">{details}</dd>' +
- '</dl>'
- ),
-
- initComponent: function () {
- Deluge.preferences.Plugins.superclass.initComponent.call(this);
- this.defaultValues = {
- version: '',
- email: '',
- homepage: '',
- details: '',
- };
- this.pluginTemplate.compile();
-
- var checkboxRenderer = function (v, p, record) {
- p.css += ' x-grid3-check-col-td';
- return (
- '<div class="x-grid3-check-col' + (v ? '-on' : '') + '"> </div>'
- );
- };
-
- this.list = this.add({
- xtype: 'listview',
- store: new Ext.data.ArrayStore({
- fields: [
- { name: 'enabled', mapping: 0 },
- { name: 'plugin', mapping: 1, sortType: 'asUCString' },
- ],
- }),
- columns: [
- {
- id: 'enabled',
- header: _('Enabled'),
- width: 0.2,
- sortable: true,
- tpl: new Ext.XTemplate('{enabled:this.getCheckbox}', {
- getCheckbox: function (v) {
- return (
- '<div class="x-grid3-check-col' +
- (v ? '-on' : '') +
- '" rel="chkbox"> </div>'
- );
- },
- }),
- dataIndex: 'enabled',
- },
- {
- id: 'plugin',
- header: _('Plugin'),
- width: 0.8,
- sortable: true,
- dataIndex: 'plugin',
- },
- ],
- singleSelect: true,
- autoExpandColumn: 'plugin',
- listeners: {
- selectionchange: { fn: this.onPluginSelect, scope: this },
- },
- });
-
- this.panel = this.add({
- region: 'center',
- autoScroll: true,
- items: [this.list],
- bbar: new Ext.Toolbar({
- items: [
- {
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-install-plugin',
- text: _('Install'),
- handler: this.onInstallPluginWindow,
- scope: this,
- },
- '->',
- {
- cls: 'x-btn-text-icon',
- text: _('Find More'),
- iconCls: 'x-deluge-find-more',
- handler: this.onFindMorePlugins,
- scope: this,
- },
- ],
- }),
- });
-
- var pp = (this.pluginInfo = this.add({
- xtype: 'panel',
- border: false,
- height: 100,
- region: 'south',
- padding: '5',
- autoScroll: true,
- bodyCfg: {
- style: 'white-space: nowrap',
- },
- }));
-
- this.pluginInfo.on('render', this.onPluginInfoRender, this);
- this.list.on('click', this.onNodeClick, this);
- deluge.preferences.on('show', this.onPreferencesShow, this);
- deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this);
- deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this);
- },
-
- disablePlugin: function (plugin) {
- deluge.client.core.disable_plugin(plugin);
- },
-
- enablePlugin: function (plugin) {
- deluge.client.core.enable_plugin(plugin);
- },
-
- setInfo: function (plugin) {
- if (!this.pluginInfo.rendered) return;
- var values = plugin || this.defaultValues;
- this.pluginInfo.body.dom.innerHTML = this.pluginTemplate.apply(values);
- },
-
- updatePlugins: function () {
- var onGotAvailablePlugins = function (plugins) {
- this.availablePlugins = plugins.sort(function (a, b) {
- return a.toLowerCase().localeCompare(b.toLowerCase());
- });
-
- deluge.client.core.get_enabled_plugins({
- success: onGotEnabledPlugins,
- scope: this,
- });
- };
-
- var onGotEnabledPlugins = function (plugins) {
- this.enabledPlugins = plugins;
- this.onGotPlugins();
- };
-
- deluge.client.core.get_available_plugins({
- success: onGotAvailablePlugins,
- scope: this,
- });
- },
-
- updatePluginsGrid: function () {
- var plugins = [];
- Ext.each(
- this.availablePlugins,
- function (plugin) {
- if (this.enabledPlugins.indexOf(plugin) > -1) {
- plugins.push([true, plugin]);
- } else {
- plugins.push([false, plugin]);
- }
- },
- this
- );
- this.list.getStore().loadData(plugins);
- },
-
- onNodeClick: function (dv, index, node, e) {
- var el = new Ext.Element(e.target);
- if (el.getAttribute('rel') != 'chkbox') return;
-
- var r = dv.getStore().getAt(index);
- if (r.get('plugin') == 'WebUi') return;
- r.set('enabled', !r.get('enabled'));
- r.commit();
- if (r.get('enabled')) {
- this.enablePlugin(r.get('plugin'));
- } else {
- this.disablePlugin(r.get('plugin'));
- }
- },
-
- onFindMorePlugins: function () {
- window.open('http://dev.deluge-torrent.org/wiki/Plugins');
- },
-
- onGotPlugins: function () {
- this.setInfo();
- this.updatePluginsGrid();
- },
-
- onGotPluginInfo: function (info) {
- var values = {
- author: info['Author'],
- version: info['Version'],
- email: info['Author-email'],
- homepage: info['Home-page'],
- details: info['Description'],
- };
- this.setInfo(values);
- delete info;
- },
-
- onInstallPluginWindow: function () {
- if (!this.installWindow) {
- this.installWindow = new Deluge.preferences.InstallPluginWindow();
- this.installWindow.on('pluginadded', this.onPluginInstall, this);
- }
- this.installWindow.show();
- },
-
- onPluginEnabled: function (pluginName) {
- var index = this.list.getStore().find('plugin', pluginName);
- if (index == -1) return;
- var plugin = this.list.getStore().getAt(index);
- plugin.set('enabled', true);
- plugin.commit();
- },
-
- onPluginDisabled: function (pluginName) {
- var index = this.list.getStore().find('plugin', pluginName);
- if (index == -1) return;
- var plugin = this.list.getStore().getAt(index);
- plugin.set('enabled', false);
- plugin.commit();
- },
-
- onPluginInstall: function () {
- this.updatePlugins();
- },
-
- onPluginSelect: function (dv, selections) {
- if (selections.length == 0) return;
- var r = dv.getRecords(selections)[0];
- deluge.client.web.get_plugin_info(r.get('plugin'), {
- success: this.onGotPluginInfo,
- scope: this,
- });
- },
-
- onPreferencesShow: function () {
- this.updatePlugins();
- },
-
- onPluginInfoRender: function (ct, position) {
- this.setInfo();
- },
-});
-/**
- * Deluge.preferences.PreferencesWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-PreferencesRecord = Ext.data.Record.create([{ name: 'name', type: 'string' }]);
-
-/**
- * @class Deluge.preferences.PreferencesWindow
- * @extends Ext.Window
- */
-Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
- /**
- * @property {String} currentPage The currently selected page.
- */
- currentPage: null,
-
- title: _('Preferences'),
- layout: 'border',
- width: 485,
- height: 500,
- border: false,
- constrainHeader: true,
- buttonAlign: 'right',
- closeAction: 'hide',
- closable: true,
- iconCls: 'x-deluge-preferences',
- plain: true,
- resizable: false,
-
- pages: {},
-
- initComponent: function () {
- Deluge.preferences.PreferencesWindow.superclass.initComponent.call(
- this
- );
-
- this.list = new Ext.list.ListView({
- store: new Ext.data.Store(),
- columns: [
- {
- id: 'name',
- dataIndex: 'name',
- },
- ],
- singleSelect: true,
- listeners: {
- selectionchange: {
- fn: this.onPageSelect,
- scope: this,
- },
- },
- hideHeaders: true,
- autoExpandColumn: 'name',
- deferredRender: false,
- autoScroll: true,
- collapsible: true,
- });
- this.add({
- region: 'west',
- items: [this.list],
- width: 120,
- margins: '0 5 0 0',
- cmargins: '0 5 0 0',
- });
-
- this.configPanel = this.add({
- type: 'container',
- autoDestroy: false,
- region: 'center',
- layout: 'card',
- layoutConfig: {
- deferredRender: true,
- },
- autoScroll: true,
- width: 300,
- });
-
- this.addButton(_('Close'), this.onClose, this);
- this.addButton(_('Apply'), this.onApply, this);
- this.addButton(_('OK'), this.onOk, this);
-
- this.optionsManager = new Deluge.OptionsManager();
- this.on('afterrender', this.onAfterRender, this);
- this.on('show', this.onShow, this);
-
- this.initPages();
- },
-
- initPages: function () {
- deluge.preferences = this;
- this.addPage(new Deluge.preferences.Downloads());
- this.addPage(new Deluge.preferences.Network());
- this.addPage(new Deluge.preferences.Encryption());
- this.addPage(new Deluge.preferences.Bandwidth());
- this.addPage(new Deluge.preferences.Interface());
- this.addPage(new Deluge.preferences.Other());
- this.addPage(new Deluge.preferences.Daemon());
- this.addPage(new Deluge.preferences.Queue());
- this.addPage(new Deluge.preferences.Proxy());
- this.addPage(new Deluge.preferences.Cache());
- this.addPage(new Deluge.preferences.Plugins());
- },
-
- onApply: function (e) {
- var changed = this.optionsManager.getDirty();
- if (!Ext.isObjectEmpty(changed)) {
- // Workaround for only displaying single listen port but still pass array to core.
- if ('listen_ports' in changed) {
- changed.listen_ports = [
- changed.listen_ports,
- changed.listen_ports,
- ];
- }
- deluge.client.core.set_config(changed, {
- success: this.onSetConfig,
- scope: this,
- });
- }
-
- for (var page in this.pages) {
- if (this.pages[page].onApply) this.pages[page].onApply();
- }
- },
-
- /**
- * Return the options manager for the preferences window.
- * @returns {Deluge.OptionsManager} the options manager
- */
- getOptionsManager: function () {
- return this.optionsManager;
- },
-
- /**
- * Adds a page to the preferences window.
- * @param {Mixed} page
- */
- addPage: function (page) {
- var store = this.list.getStore();
- var name = page.title;
- store.add([new PreferencesRecord({ name: name })]);
- page['bodyStyle'] = 'padding: 5px';
- page.preferences = this;
- this.pages[name] = this.configPanel.add(page);
- this.pages[name].index = -1;
- return this.pages[name];
- },
-
- /**
- * Removes a preferences page from the window.
- * @param {mixed} name
- */
- removePage: function (page) {
- var name = page.title;
- var store = this.list.getStore();
- store.removeAt(store.find('name', name));
- this.configPanel.remove(page);
- delete this.pages[page.title];
- },
-
- /**
- * Select which preferences page is displayed.
- * @param {String} page The page name to change to
- */
- selectPage: function (page) {
- if (this.pages[page].index < 0) {
- this.pages[page].index = this.configPanel.items.indexOf(
- this.pages[page]
- );
- }
- this.list.select(this.pages[page].index);
- },
-
- // private
- doSelectPage: function (page) {
- if (this.pages[page].index < 0) {
- this.pages[page].index = this.configPanel.items.indexOf(
- this.pages[page]
- );
- }
- this.configPanel.getLayout().setActiveItem(this.pages[page].index);
- this.currentPage = page;
- },
-
- // private
- onGotConfig: function (config) {
- this.getOptionsManager().set(config);
- },
-
- // private
- onPageSelect: function (list, selections) {
- var r = list.getRecord(selections[0]);
- this.doSelectPage(r.get('name'));
- },
-
- // private
- onSetConfig: function () {
- this.getOptionsManager().commit();
- },
-
- // private
- onAfterRender: function () {
- if (!this.list.getSelectionCount()) {
- this.list.select(0);
- }
- this.configPanel.getLayout().setActiveItem(0);
- },
-
- // private
- onShow: function () {
- if (!deluge.client.core) return;
- deluge.client.core.get_config({
- success: this.onGotConfig,
- scope: this,
- });
- },
-
- // private
- onClose: function () {
- this.hide();
- },
-
- // private
- onOk: function () {
- var changed = this.optionsManager.getDirty();
- if (!Ext.isObjectEmpty(changed)) {
- deluge.client.core.set_config(changed, {
- success: this.onSetConfig,
- scope: this,
- });
- }
-
- for (var page in this.pages) {
- if (this.pages[page].onOk) this.pages[page].onOk();
- }
-
- this.hide();
- },
-});
-/**
- * Deluge.preferences.ProxyField.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.ProxyField
- * @extends Ext.form.FieldSet
- */
-Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
- border: false,
- autoHeight: true,
- labelWidth: 70,
-
- initComponent: function () {
- Deluge.preferences.ProxyField.superclass.initComponent.call(this);
- this.proxyType = this.add({
- xtype: 'combo',
- fieldLabel: _('Type:'),
- labelSeparator: '',
- name: 'proxytype',
- mode: 'local',
- width: 150,
- store: new Ext.data.ArrayStore({
- fields: ['id', 'text'],
- data: [
- [0, _('None')],
- [1, _('Socks4')],
- [2, _('Socks5')],
- [3, _('Socks5 Auth')],
- [4, _('HTTP')],
- [5, _('HTTP Auth')],
- [6, _('I2P')],
- ],
- }),
- editable: false,
- triggerAction: 'all',
- valueField: 'id',
- displayField: 'text',
- });
- this.proxyType.on('change', this.onFieldChange, this);
- this.proxyType.on('select', this.onTypeSelect, this);
-
- this.hostname = this.add({
- xtype: 'textfield',
- name: 'hostname',
- fieldLabel: _('Host:'),
- labelSeparator: '',
- width: 220,
- });
- this.hostname.on('change', this.onFieldChange, this);
-
- this.port = this.add({
- xtype: 'spinnerfield',
- name: 'port',
- fieldLabel: _('Port:'),
- labelSeparator: '',
- width: 80,
- decimalPrecision: 0,
- minValue: 0,
- maxValue: 65535,
- });
- this.port.on('change', this.onFieldChange, this);
-
- this.username = this.add({
- xtype: 'textfield',
- name: 'username',
- fieldLabel: _('Username:'),
- labelSeparator: '',
- width: 220,
- });
- this.username.on('change', this.onFieldChange, this);
-
- this.password = this.add({
- xtype: 'textfield',
- name: 'password',
- fieldLabel: _('Password:'),
- labelSeparator: '',
- inputType: 'password',
- width: 220,
- });
- this.password.on('change', this.onFieldChange, this);
-
- this.proxy_host_resolve = this.add({
- xtype: 'checkbox',
- name: 'proxy_host_resolve',
- fieldLabel: '',
- boxLabel: _('Proxy Hostnames'),
- width: 220,
- });
- this.proxy_host_resolve.on('change', this.onFieldChange, this);
-
- this.proxy_peer_conn = this.add({
- xtype: 'checkbox',
- name: 'proxy_peer_conn',
- fieldLabel: '',
- boxLabel: _('Proxy Peers'),
- width: 220,
- });
- this.proxy_peer_conn.on('change', this.onFieldChange, this);
-
- this.proxy_tracker_conn = this.add({
- xtype: 'checkbox',
- name: 'proxy_tracker_conn',
- fieldLabel: '',
- boxLabel: _('Proxy Trackers'),
- width: 220,
- });
- this.proxy_tracker_conn.on('change', this.onFieldChange, this);
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Force Proxy'),
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- style: 'padding-left: 0px; margin-top: 10px',
- });
-
- this.force_proxy = fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 20,
- name: 'force_proxy',
- boxLabel: _('Force Use of Proxy'),
- });
- this.force_proxy.on('change', this.onFieldChange, this);
-
- this.anonymous_mode = fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 20,
- name: 'anonymous_mode',
- boxLabel: _('Hide Client Identity'),
- });
- this.anonymous_mode.on('change', this.onFieldChange, this);
-
- this.setting = false;
- },
-
- getName: function () {
- return this.initialConfig.name;
- },
-
- getValue: function () {
- return {
- type: this.proxyType.getValue(),
- hostname: this.hostname.getValue(),
- port: Number(this.port.getValue()),
- username: this.username.getValue(),
- password: this.password.getValue(),
- proxy_hostnames: this.proxy_host_resolve.getValue(),
- proxy_peer_connections: this.proxy_peer_conn.getValue(),
- proxy_tracker_connections: this.proxy_tracker_conn.getValue(),
- force_proxy: this.force_proxy.getValue(),
- anonymous_mode: this.anonymous_mode.getValue(),
- };
- },
-
- // Set the values of the proxies
- setValue: function (value) {
- this.setting = true;
- this.proxyType.setValue(value['type']);
- var index = this.proxyType.getStore().find('id', value['type']);
- var record = this.proxyType.getStore().getAt(index);
-
- this.hostname.setValue(value['hostname']);
- this.port.setValue(value['port']);
- this.username.setValue(value['username']);
- this.password.setValue(value['password']);
- this.proxy_host_resolve.setValue(value['proxy_hostnames']);
- this.proxy_peer_conn.setValue(value['proxy_peer_connections']);
- this.proxy_tracker_conn.setValue(value['proxy_tracker_connections']);
- this.force_proxy.setValue(value['force_proxy']);
- this.anonymous_mode.setValue(value['anonymous_mode']);
-
- this.onTypeSelect(this.type, record, index);
- this.setting = false;
- },
-
- onFieldChange: function (field, newValue, oldValue) {
- if (this.setting) return;
- var newValues = this.getValue();
- var oldValues = Ext.apply({}, newValues);
- oldValues[field.getName()] = oldValue;
-
- this.fireEvent('change', this, newValues, oldValues);
- },
-
- onTypeSelect: function (combo, record, index) {
- var typeId = record.get('id');
- if (typeId > 0) {
- this.hostname.show();
- this.port.show();
- this.proxy_peer_conn.show();
- this.proxy_tracker_conn.show();
- if (typeId > 1 && typeId < 6) {
- this.proxy_host_resolve.show();
- } else {
- this.proxy_host_resolve.hide();
- }
- } else {
- this.hostname.hide();
- this.port.hide();
- this.proxy_host_resolve.hide();
- this.proxy_peer_conn.hide();
- this.proxy_tracker_conn.hide();
- }
-
- if (typeId == 3 || typeId == 5) {
- this.username.show();
- this.password.show();
- } else {
- this.username.hide();
- this.password.hide();
- }
- },
-});
-/**
- * Deluge.preferences.ProxyPage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Proxy
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
- constructor: function (config) {
- config = Ext.apply(
- {
- border: false,
- title: _('Proxy'),
- header: false,
- layout: 'form',
- autoScroll: true,
- },
- config
- );
- Deluge.preferences.Proxy.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.preferences.Proxy.superclass.initComponent.call(this);
- this.proxy = this.add(
- new Deluge.preferences.ProxyField({
- title: _('Proxy'),
- name: 'proxy',
- })
- );
- this.proxy.on('change', this.onProxyChange, this);
- deluge.preferences.getOptionsManager().bind('proxy', this.proxy);
- },
-
- getValue: function () {
- return {
- proxy: this.proxy.getValue(),
- };
- },
-
- setValue: function (value) {
- for (var proxy in value) {
- this[proxy].setValue(value[proxy]);
- }
- },
-
- onProxyChange: function (field, newValue, oldValue) {
- var newValues = this.getValue();
- var oldValues = Ext.apply({}, newValues);
- oldValues[field.getName()] = oldValue;
-
- this.fireEvent('change', this, newValues, oldValues);
- },
-});
-/**
- * Deluge.preferences.QueuePage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge.preferences');
-
-/**
- * @class Deluge.preferences.Queue
- * @extends Ext.form.FormPanel
- */
-Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
- border: false,
- title: _('Queue'),
- header: false,
- layout: 'form',
-
- initComponent: function () {
- Deluge.preferences.Queue.superclass.initComponent.call(this);
-
- var om = deluge.preferences.getOptionsManager();
-
- var fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('New Torrents'),
- style: 'padding-top: 5px; margin-bottom: 0px;',
- autoHeight: true,
- labelWidth: 1,
- defaultType: 'checkbox',
- });
- om.bind(
- 'queue_new_to_top',
- fieldset.add({
- fieldLabel: '',
- labelSeparator: '',
- height: 22,
- boxLabel: _('Queue to top'),
- name: 'queue_new_to_top',
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Active Torrents'),
- autoHeight: true,
- labelWidth: 150,
- defaultType: 'spinnerfield',
- style: 'padding-top: 5px; margin-bottom: 0px',
- });
- om.bind(
- 'max_active_limit',
- fieldset.add({
- fieldLabel: _('Total:'),
- labelSeparator: '',
- name: 'max_active_limit',
- value: 8,
- width: 80,
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
- om.bind(
- 'max_active_downloading',
- fieldset.add({
- fieldLabel: _('Downloading:'),
- labelSeparator: '',
- name: 'max_active_downloading',
- value: 3,
- width: 80,
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
- om.bind(
- 'max_active_seeding',
- fieldset.add({
- fieldLabel: _('Seeding:'),
- labelSeparator: '',
- name: 'max_active_seeding',
- value: 5,
- width: 80,
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
- om.bind(
- 'dont_count_slow_torrents',
- fieldset.add({
- xtype: 'checkbox',
- name: 'dont_count_slow_torrents',
- height: 22,
- hideLabel: true,
- boxLabel: _('Ignore slow torrents'),
- })
- );
- om.bind(
- 'auto_manage_prefer_seeds',
- fieldset.add({
- xtype: 'checkbox',
- name: 'auto_manage_prefer_seeds',
- hideLabel: true,
- boxLabel: _('Prefer seeding torrents'),
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- title: _('Seeding Rotation'),
- autoHeight: true,
- labelWidth: 150,
- defaultType: 'spinnerfield',
- style: 'padding-top: 5px; margin-bottom: 0px',
- });
- om.bind(
- 'share_ratio_limit',
- fieldset.add({
- fieldLabel: _('Share Ratio:'),
- labelSeparator: '',
- name: 'share_ratio_limit',
- value: 8,
- width: 80,
- incrementValue: 0.1,
- minValue: -1,
- maxValue: 99999,
- alternateIncrementValue: 1,
- decimalPrecision: 2,
- })
- );
- om.bind(
- 'seed_time_ratio_limit',
- fieldset.add({
- fieldLabel: _('Time Ratio:'),
- labelSeparator: '',
- name: 'seed_time_ratio_limit',
- value: 3,
- width: 80,
- incrementValue: 0.1,
- minValue: -1,
- maxValue: 99999,
- alternateIncrementValue: 1,
- decimalPrecision: 2,
- })
- );
- om.bind(
- 'seed_time_limit',
- fieldset.add({
- fieldLabel: _('Time (m):'),
- labelSeparator: '',
- name: 'seed_time_limit',
- value: 5,
- width: 80,
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 99999,
- })
- );
-
- fieldset = this.add({
- xtype: 'fieldset',
- border: false,
- autoHeight: true,
- style: 'padding-top: 5px; margin-bottom: 0px',
- title: _('Share Ratio Reached'),
-
- layout: 'table',
- layoutConfig: { columns: 2 },
- labelWidth: 0,
- defaultType: 'checkbox',
-
- defaults: {
- fieldLabel: '',
- labelSeparator: '',
- },
- });
- this.stopAtRatio = fieldset.add({
- name: 'stop_seed_at_ratio',
- boxLabel: _('Share Ratio:'),
- });
- this.stopAtRatio.on('check', this.onStopRatioCheck, this);
- om.bind('stop_seed_at_ratio', this.stopAtRatio);
-
- this.stopRatio = fieldset.add({
- xtype: 'spinnerfield',
- name: 'stop_seed_ratio',
- ctCls: 'x-deluge-indent-checkbox',
- disabled: true,
- value: '2.0',
- width: 60,
- incrementValue: 0.1,
- minValue: -1,
- maxValue: 99999,
- alternateIncrementValue: 1,
- decimalPrecision: 2,
- });
- om.bind('stop_seed_ratio', this.stopRatio);
-
- this.removeAtRatio = fieldset.add({
- xtype: 'radiogroup',
- columns: 1,
- colspan: 2,
- disabled: true,
- style: 'margin-left: 10px',
- items: [
- {
- boxLabel: _('Pause torrent'),
- name: 'at_ratio',
- inputValue: false,
- checked: true,
- },
- {
- boxLabel: _('Remove torrent'),
- name: 'at_ratio',
- inputValue: true,
- },
- ],
- });
- om.bind('remove_seed_at_ratio', this.removeAtRatio);
- },
-
- onStopRatioCheck: function (e, checked) {
- this.stopRatio.setDisabled(!checked);
- this.removeAtRatio.setDisabled(!checked);
- },
-});
-/**
- * Deluge.StatusbarMenu.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * Menu that handles setting the statusbar limits correctly.
- * @class Deluge.StatusbarMenu
- * @extends Ext.menu.Menu
- */
-Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
- initComponent: function () {
- Deluge.StatusbarMenu.superclass.initComponent.call(this);
- this.otherWin = new Deluge.OtherLimitWindow(
- this.initialConfig.otherWin || {}
- );
-
- this.items.each(function (item) {
- if (item.getXType() != 'menucheckitem') return;
- if (item.value == 'other') {
- item.on('click', this.onOtherClicked, this);
- } else {
- item.on('checkchange', this.onLimitChanged, this);
- }
- }, this);
- },
-
- setValue: function (value) {
- var beenSet = false;
- // set the new value
- this.value = value = value == 0 ? -1 : value;
-
- var other = null;
- // uncheck all items
- this.items.each(function (item) {
- if (item.setChecked) {
- item.suspendEvents();
- if (item.value == value) {
- item.setChecked(true);
- beenSet = true;
- } else {
- item.setChecked(false);
- }
- item.resumeEvents();
- }
-
- if (item.value == 'other') other = item;
- });
-
- if (beenSet) return;
-
- other.suspendEvents();
- other.setChecked(true);
- other.resumeEvents();
- },
-
- onLimitChanged: function (item, checked) {
- if (!checked || item.value == 'other') return; // We do not care about unchecked or other.
- var config = {};
- config[item.group] = item.value;
- deluge.client.core.set_config(config, {
- success: function () {
- deluge.ui.update();
- },
- });
- },
-
- onOtherClicked: function (item, e) {
- this.otherWin.group = item.group;
- this.otherWin.setValue(this.value);
- this.otherWin.show();
- },
-});
-/**
- * Deluge.OptionsManager.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge');
-
-/**
- * @class Deluge.OptionsManager
- * @extends Ext.util.Observable
- * A class that can be used to manage options throughout the ui.
- * @constructor
- * Creates a new OptionsManager
- * @param {Object} config Configuration options
- */
-Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
- constructor: function (config) {
- config = config || {};
- this.binds = {};
- this.changed = {};
- this.options = (config && config['options']) || {};
- this.focused = null;
-
- this.addEvents({
- /**
- * @event add
- * Fires when an option is added
- */
- add: true,
-
- /**
- * @event changed
- * Fires when an option is changed
- * @param {String} option The changed option
- * @param {Mixed} value The options new value
- * @param {Mixed} oldValue The options old value
- */
- changed: true,
-
- /**
- * @event reset
- * Fires when the options are reset
- */
- reset: true,
- });
- this.on('changed', this.onChange, this);
-
- Deluge.OptionsManager.superclass.constructor.call(this);
- },
-
- /**
- * Add a set of default options and values to the options manager
- * @param {Object} options The default options.
- */
- addOptions: function (options) {
- this.options = Ext.applyIf(this.options, options);
- },
-
- /**
- * Binds a form field to the specified option.
- * @param {String} option
- * @param {Ext.form.Field} field
- */
- bind: function (option, field) {
- this.binds[option] = this.binds[option] || [];
- this.binds[option].push(field);
- field._doption = option;
-
- field.on('focus', this.onFieldFocus, this);
- field.on('blur', this.onFieldBlur, this);
- field.on('change', this.onFieldChange, this);
- field.on('check', this.onFieldChange, this);
- field.on('spin', this.onFieldChange, this);
- return field;
- },
-
- /**
- * Changes all the changed values to be the default values
- */
- commit: function () {
- this.options = Ext.apply(this.options, this.changed);
- this.reset();
- },
-
- /**
- * Converts the value so it matches the originals type
- * @param {Mixed} oldValue The original value
- * @param {Mixed} value The new value to convert
- */
- convertValueType: function (oldValue, value) {
- if (Ext.type(oldValue) != Ext.type(value)) {
- switch (Ext.type(oldValue)) {
- case 'string':
- value = String(value);
- break;
- case 'number':
- value = Number(value);
- break;
- case 'boolean':
- if (Ext.type(value) == 'string') {
- value = value.toLowerCase();
- value =
- value == 'true' || value == '1' || value == 'on'
- ? true
- : false;
- } else {
- value = Boolean(value);
- }
- break;
- }
- }
- return value;
- },
-
- /**
- * Get the value for an option or options.
- * @param {String} [option] A single option or an array of options to return.
- * @returns {Object} the options value.
- */
- get: function () {
- if (arguments.length == 1) {
- var option = arguments[0];
- return this.isDirty(option)
- ? this.changed[option]
- : this.options[option];
- } else {
- var options = {};
- Ext.each(
- arguments,
- function (option) {
- if (!this.has(option)) return;
- options[option] = this.isDirty(option)
- ? this.changed[option]
- : this.options[option];
- },
- this
- );
- return options;
- }
- },
-
- /**
- * Get the default value for an option or options.
- * @param {String|Array} [option] A single option or an array of options to return.
- * @returns {Object} the value of the option
- */
- getDefault: function (option) {
- return this.options[option];
- },
-
- /**
- * Returns the dirty (changed) values.
- * @returns {Object} the changed options
- */
- getDirty: function () {
- return this.changed;
- },
-
- /**
- * @param {String} [option] The option to check
- * @returns {Boolean} true if the option has been changed from the default.
- */
- isDirty: function (option) {
- return !Ext.isEmpty(this.changed[option]);
- },
-
- /**
- * Check to see if an option exists in the options manager
- * @param {String} option
- * @returns {Boolean} true if the option exists, else false.
- */
- has: function (option) {
- return this.options[option];
- },
-
- /**
- * Reset the options back to the default values.
- */
- reset: function () {
- this.changed = {};
- },
-
- /**
- * Sets the value of specified option(s) for the passed in id.
- * @param {String} option
- * @param {Object} value The value for the option
- */
- set: function (option, value) {
- if (option === undefined) {
- return;
- } else if (typeof option == 'object') {
- var options = option;
- this.options = Ext.apply(this.options, options);
- for (var option in options) {
- this.onChange(option, options[option]);
- }
- } else {
- this.options[option] = value;
- this.onChange(option, value);
- }
- },
-
- /**
- * Update the value for the specified option and id.
- * @param {String/Object} option or options to update
- * @param {Object} [value];
- */
- update: function (option, value) {
- if (option === undefined) {
- return;
- } else if (value === undefined) {
- for (var key in option) {
- this.update(key, option[key]);
- }
- } else {
- var defaultValue = this.getDefault(option);
- value = this.convertValueType(defaultValue, value);
-
- var oldValue = this.get(option);
- if (oldValue == value) return;
-
- if (defaultValue == value) {
- if (this.isDirty(option)) delete this.changed[option];
- this.fireEvent('changed', option, value, oldValue);
- return;
- }
-
- this.changed[option] = value;
- this.fireEvent('changed', option, value, oldValue);
- }
- },
-
- /**
- * Lets the option manager know when a field is blurred so if a value
- * so value changing operations can continue on that field.
- */
- onFieldBlur: function (field, event) {
- if (this.focused == field) {
- this.focused = null;
- }
- },
-
- /**
- * Stops a form fields value from being blocked by the change functions
- * @param {Ext.form.Field} field
- * @private
- */
- onFieldChange: function (field, event) {
- if (field.field) field = field.field; // fix for spinners
- this.update(field._doption, field.getValue());
- },
-
- /**
- * Lets the option manager know when a field is focused so if a value changing
- * operation is performed it will not change the value of the field.
- */
- onFieldFocus: function (field, event) {
- this.focused = field;
- },
-
- onChange: function (option, newValue, oldValue) {
- // If we don't have a bind there's nothing to do.
- if (Ext.isEmpty(this.binds[option])) return;
- Ext.each(
- this.binds[option],
- function (bind) {
- // The field is currently focused so we do not want to change it.
- if (bind == this.focused) return;
- // Set the form field to the new value.
- bind.setValue(newValue);
- },
- this
- );
- },
-});
-/**
- * Deluge.AboutWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.namespace('Deluge.about');
-
-/**
- * @class Deluge.about.AboutWindow
- * @extends Ext.Window
- */
-Deluge.about.AboutWindow = Ext.extend(Ext.Window, {
- id: 'AboutWindow',
- title: _('About Deluge'),
- height: 330,
- width: 270,
- iconCls: 'x-deluge-main-panel',
- resizable: false,
- plain: true,
- layout: {
- type: 'vbox',
- align: 'center',
- },
- buttonAlign: 'center',
-
- initComponent: function () {
- Deluge.about.AboutWindow.superclass.initComponent.call(this);
- this.addEvents({
- build_ready: true,
- });
-
- var self = this;
- var libtorrent = function () {
- deluge.client.core.get_libtorrent_version({
- success: function (lt_version) {
- comment += '<br/>' + _('libtorrent:') + ' ' + lt_version;
- Ext.getCmp('about_comment').setText(comment, false);
- self.fireEvent('build_ready');
- },
- });
- };
-
- var client_version = deluge.version;
-
- var comment =
- _(
- 'A peer-to-peer file sharing program\nutilizing the BitTorrent protocol.'
- ).replace('\n', '<br/>') +
- '<br/><br/>' +
- _('Client:') +
- ' ' +
- client_version +
- '<br/>';
- deluge.client.web.connected({
- success: function (connected) {
- if (connected) {
- deluge.client.daemon.get_version({
- success: function (server_version) {
- comment +=
- _('Server:') + ' ' + server_version + '<br/>';
- libtorrent();
- },
- });
- } else {
- this.fireEvent('build_ready');
- }
- },
- failure: function () {
- this.fireEvent('build_ready');
- },
- scope: this,
- });
-
- this.add([
- {
- xtype: 'box',
- style: 'padding-top: 5px',
- height: 80,
- width: 240,
- cls: 'x-deluge-logo',
- hideLabel: true,
- },
- {
- xtype: 'label',
- style: 'padding-top: 10px; font-weight: bold; font-size: 16px;',
- text: _('Deluge') + ' ' + client_version,
- },
- {
- xtype: 'label',
- id: 'about_comment',
- style: 'padding-top: 10px; text-align:center; font-size: 12px;',
- html: comment,
- },
- {
- xtype: 'label',
- style: 'padding-top: 10px; font-size: 10px;',
- text: _('Copyright 2007-2018 Deluge Team'),
- },
- {
- xtype: 'label',
- style: 'padding-top: 5px; font-size: 12px;',
- html: '<a href="https://deluge-torrent.org" target="_blank">deluge-torrent.org</a>',
- },
- ]);
- this.addButton(_('Close'), this.onCloseClick, this);
- },
-
- show: function () {
- this.on('build_ready', function () {
- Deluge.about.AboutWindow.superclass.show.call(this);
- });
- },
-
- onCloseClick: function () {
- this.close();
- },
-});
-
-Ext.namespace('Deluge');
-
-Deluge.About = function () {
- new Deluge.about.AboutWindow().show();
-};
-/**
- * Deluge.AddConnectionWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.AddConnectionWindow
- * @extends Ext.Window
- */
-Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
- title: _('Add Connection'),
- iconCls: 'x-deluge-add-window-icon',
-
- layout: 'fit',
- width: 300,
- height: 195,
- constrainHeader: true,
- bodyStyle: 'padding: 10px 5px;',
- closeAction: 'hide',
-
- initComponent: function () {
- Deluge.AddConnectionWindow.superclass.initComponent.call(this);
-
- this.addEvents('hostadded');
-
- this.addButton(_('Close'), this.hide, this);
- this.addButton(_('Add'), this.onAddClick, this);
-
- this.on('hide', this.onHide, this);
-
- this.form = this.add({
- xtype: 'form',
- defaultType: 'textfield',
- baseCls: 'x-plain',
- labelWidth: 60,
- items: [
- {
- fieldLabel: _('Host:'),
- labelSeparator: '',
- name: 'host',
- anchor: '75%',
- value: '',
- },
- {
- xtype: 'spinnerfield',
- fieldLabel: _('Port:'),
- labelSeparator: '',
- name: 'port',
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: -1,
- maxValue: 65535,
- },
- value: '58846',
- anchor: '40%',
- },
- {
- fieldLabel: _('Username:'),
- labelSeparator: '',
- name: 'username',
- anchor: '75%',
- value: '',
- },
- {
- fieldLabel: _('Password:'),
- labelSeparator: '',
- anchor: '75%',
- name: 'password',
- inputType: 'password',
- value: '',
- },
- ],
- });
- },
-
- onAddClick: function () {
- var values = this.form.getForm().getValues();
- deluge.client.web.add_host(
- values.host,
- Number(values.port),
- values.username,
- values.password,
- {
- success: function (result) {
- if (!result[0]) {
- Ext.MessageBox.show({
- title: _('Error'),
- msg: String.format(
- _('Unable to add host: {0}'),
- result[1]
- ),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- } else {
- this.fireEvent('hostadded');
- }
- this.hide();
- },
- scope: this,
- }
- );
- },
-
- onHide: function () {
- this.form.getForm().reset();
- },
-});
-/**
- * Deluge.AddTrackerWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-// Custom VType validator for tracker urls
-var trackerUrlTest =
- /(((^https?)|(^udp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
-Ext.apply(Ext.form.VTypes, {
- trackerUrl: function (val, field) {
- return trackerUrlTest.test(val);
- },
- trackerUrlText: 'Not a valid tracker url',
-});
-
-/**
- * @class Deluge.AddTrackerWindow
- * @extends Ext.Window
- */
-Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
- title: _('Add Tracker'),
- layout: 'fit',
- width: 375,
- height: 150,
- plain: true,
- closable: true,
- resizable: false,
- constrainHeader: true,
- bodyStyle: 'padding: 5px',
- buttonAlign: 'right',
- closeAction: 'hide',
- iconCls: 'x-deluge-edit-trackers',
-
- initComponent: function () {
- Deluge.AddTrackerWindow.superclass.initComponent.call(this);
-
- this.addButton(_('Cancel'), this.onCancelClick, this);
- this.addButton(_('Add'), this.onAddClick, this);
- this.addEvents('add');
-
- this.form = this.add({
- xtype: 'form',
- defaultType: 'textarea',
- baseCls: 'x-plain',
- labelWidth: 55,
- items: [
- {
- fieldLabel: _('Trackers:'),
- labelSeparator: '',
- name: 'trackers',
- anchor: '100%',
- },
- ],
- });
- },
-
- onAddClick: function () {
- var trackers = this.form.getForm().findField('trackers').getValue();
- trackers = trackers.split('\n');
-
- var cleaned = [];
- Ext.each(
- trackers,
- function (tracker) {
- if (Ext.form.VTypes.trackerUrl(tracker)) {
- cleaned.push(tracker);
- }
- },
- this
- );
- this.fireEvent('add', cleaned);
- this.hide();
- this.form.getForm().findField('trackers').setValue('');
- },
-
- onCancelClick: function () {
- this.form.getForm().findField('trackers').setValue('');
- this.hide();
- },
-});
-/**
- * Deluge.Client.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Ext.ux.util');
-
-/**
- * A class that connects to a json-rpc resource and adds the available
- * methods as functions to the class instance.
- * @class Ext.ux.util.RpcClient
- * @namespace Ext.ux.util
- */
-Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
- _components: [],
-
- _methods: [],
-
- _requests: {},
-
- _url: null,
-
- _optionKeys: ['scope', 'success', 'failure'],
-
- /**
- * @event connected
- * Fires when the client has retrieved the list of methods from the server.
- * @param {Ext.ux.util.RpcClient} this
- */
- constructor: function (config) {
- Ext.ux.util.RpcClient.superclass.constructor.call(this, config);
- this._url = config.url || null;
- this._id = 0;
-
- this.addEvents(
- // raw events
- 'connected',
- 'error'
- );
- this.reloadMethods();
- },
-
- reloadMethods: function () {
- this._execute('system.listMethods', {
- success: this._setMethods,
- scope: this,
- });
- },
-
- _execute: function (method, options) {
- options = options || {};
- options.params = options.params || [];
- options.id = this._id;
-
- var request = Ext.encode({
- method: method,
- params: options.params,
- id: options.id,
- });
- this._id++;
-
- return Ext.Ajax.request({
- url: this._url,
- method: 'POST',
- success: this._onSuccess,
- failure: this._onFailure,
- scope: this,
- jsonData: request,
- options: options,
- });
- },
-
- _onFailure: function (response, requestOptions) {
- var options = requestOptions.options;
- errorObj = {
- id: options.id,
- result: null,
- error: {
- msg: 'HTTP: ' + response.status + ' ' + response.statusText,
- code: 255,
- },
- };
-
- this.fireEvent('error', errorObj, response, requestOptions);
-
- if (Ext.type(options.failure) != 'function') return;
- if (options.scope) {
- options.failure.call(
- options.scope,
- errorObj,
- response,
- requestOptions
- );
- } else {
- options.failure(errorObj, response, requestOptions);
- }
- },
-
- _onSuccess: function (response, requestOptions) {
- var responseObj = Ext.decode(response.responseText);
- var options = requestOptions.options;
- if (responseObj.error) {
- this.fireEvent('error', responseObj, response, requestOptions);
-
- if (Ext.type(options.failure) != 'function') return;
- if (options.scope) {
- options.failure.call(
- options.scope,
- responseObj,
- response,
- requestOptions
- );
- } else {
- options.failure(responseObj, response, requestOptions);
- }
- } else {
- if (Ext.type(options.success) != 'function') return;
- if (options.scope) {
- options.success.call(
- options.scope,
- responseObj.result,
- responseObj,
- response,
- requestOptions
- );
- } else {
- options.success(
- responseObj.result,
- responseObj,
- response,
- requestOptions
- );
- }
- }
- },
-
- _parseArgs: function (args) {
- var params = [];
- Ext.each(args, function (arg) {
- params.push(arg);
- });
-
- var options = params[params.length - 1];
- if (Ext.type(options) == 'object') {
- var keys = Ext.keys(options),
- isOption = false;
-
- Ext.each(this._optionKeys, function (key) {
- if (keys.indexOf(key) > -1) isOption = true;
- });
-
- if (isOption) {
- params.remove(options);
- } else {
- options = {};
- }
- } else {
- options = {};
- }
- options.params = params;
- return options;
- },
-
- _setMethods: function (methods) {
- var components = {},
- self = this;
-
- Ext.each(methods, function (method) {
- var parts = method.split('.');
- var component = components[parts[0]] || {};
-
- var fn = function () {
- var options = self._parseArgs(arguments);
- return self._execute(method, options);
- };
- component[parts[1]] = fn;
- components[parts[0]] = component;
- });
-
- for (var name in components) {
- self[name] = components[name];
- }
- Ext.each(
- this._components,
- function (component) {
- if (!component in components) {
- delete this[component];
- }
- },
- this
- );
- this._components = Ext.keys(components);
- this.fireEvent('connected', this);
- },
-});
-/**
- * Deluge.ConnectionManager.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Deluge.ConnectionManager = Ext.extend(Ext.Window, {
- layout: 'fit',
- width: 300,
- height: 220,
- bodyStyle: 'padding: 10px 5px;',
- buttonAlign: 'right',
- closeAction: 'hide',
- closable: true,
- plain: true,
- constrainHeader: true,
- title: _('Connection Manager'),
- iconCls: 'x-deluge-connect-window-icon',
-
- initComponent: function () {
- Deluge.ConnectionManager.superclass.initComponent.call(this);
- this.on('hide', this.onHide, this);
- this.on('show', this.onShow, this);
-
- deluge.events.on('login', this.onLogin, this);
- deluge.events.on('logout', this.onLogout, this);
-
- this.addButton(_('Close'), this.onClose, this);
- this.addButton(_('Connect'), this.onConnect, this);
-
- this.list = new Ext.list.ListView({
- store: new Ext.data.ArrayStore({
- fields: [
- { name: 'status', mapping: 4 },
- { name: 'host', mapping: 1 },
- { name: 'port', mapping: 2 },
- { name: 'user', mapping: 3 },
- { name: 'version', mapping: 5 },
- ],
- id: 0,
- }),
- columns: [
- {
- header: _('Status'),
- width: 0.24,
- sortable: true,
- tpl: new Ext.XTemplate(
- '<tpl if="status == \'Online\'">',
- _('Online'),
- '</tpl>',
- '<tpl if="status == \'Offline\'">',
- _('Offline'),
- '</tpl>',
- '<tpl if="status == \'Connected\'">',
- _('Connected'),
- '</tpl>'
- ),
- dataIndex: 'status',
- },
- {
- id: 'host',
- header: _('Host'),
- width: 0.51,
- sortable: true,
- tpl: '{user}@{host}:{port}',
- dataIndex: 'host',
- },
- {
- header: _('Version'),
- width: 0.25,
- sortable: true,
- tpl: '<tpl if="version">{version}</tpl>',
- dataIndex: 'version',
- },
- ],
- singleSelect: true,
- listeners: {
- selectionchange: { fn: this.onSelectionChanged, scope: this },
- },
- });
-
- this.panel = this.add({
- autoScroll: true,
- items: [this.list],
- bbar: new Ext.Toolbar({
- buttons: [
- {
- id: 'cm-add',
- cls: 'x-btn-text-icon',
- text: _('Add'),
- iconCls: 'icon-add',
- handler: this.onAddClick,
- scope: this,
- },
- {
- id: 'cm-edit',
- cls: 'x-btn-text-icon',
- text: _('Edit'),
- iconCls: 'icon-edit',
- handler: this.onEditClick,
- scope: this,
- },
- {
- id: 'cm-remove',
- cls: 'x-btn-text-icon',
- text: _('Remove'),
- iconCls: 'icon-remove',
- handler: this.onRemoveClick,
- disabled: true,
- scope: this,
- },
- '->',
- {
- id: 'cm-stop',
- cls: 'x-btn-text-icon',
- text: _('Stop Daemon'),
- iconCls: 'icon-error',
- handler: this.onStopClick,
- disabled: true,
- scope: this,
- },
- ],
- }),
- });
- this.update = this.update.createDelegate(this);
- },
-
- /**
- * Check to see if the the web interface is currently connected
- * to a Deluge Daemon and show the Connection Manager if not.
- */
- checkConnected: function () {
- deluge.client.web.connected({
- success: function (connected) {
- if (connected) {
- deluge.events.fire('connect');
- } else {
- this.show();
- }
- },
- scope: this,
- });
- },
-
- disconnect: function (show) {
- deluge.events.fire('disconnect');
- if (show) {
- if (this.isVisible()) return;
- this.show();
- }
- },
-
- loadHosts: function () {
- deluge.client.web.get_hosts({
- success: this.onGetHosts,
- scope: this,
- });
- },
-
- update: function () {
- this.list.getStore().each(function (r) {
- deluge.client.web.get_host_status(r.id, {
- success: this.onGetHostStatus,
- scope: this,
- });
- }, this);
- },
-
- /**
- * Updates the buttons in the Connection Manager UI according to the
- * passed in records host state.
- * @param {Ext.data.Record} record The hosts record to update the UI for
- */
- updateButtons: function (record) {
- var button = this.buttons[1],
- status = record.get('status');
-
- // Update the Connect/Disconnect button
- button.enable();
- if (status.toLowerCase() == 'connected') {
- button.setText(_('Disconnect'));
- } else {
- button.setText(_('Connect'));
- if (status.toLowerCase() != 'online') button.disable();
- }
-
- // Update the Stop/Start Daemon button
- if (
- status.toLowerCase() == 'connected' ||
- status.toLowerCase() == 'online'
- ) {
- this.stopHostButton.enable();
- this.stopHostButton.setText(_('Stop Daemon'));
- } else {
- if (
- record.get('host') == '127.0.0.1' ||
- record.get('host') == 'localhost'
- ) {
- this.stopHostButton.enable();
- this.stopHostButton.setText(_('Start Daemon'));
- } else {
- this.stopHostButton.disable();
- }
- }
- },
-
- // private
- onAddClick: function (button, e) {
- if (!this.addWindow) {
- this.addWindow = new Deluge.AddConnectionWindow();
- this.addWindow.on('hostadded', this.onHostChange, this);
- }
- this.addWindow.show();
- },
-
- // private
- onEditClick: function (button, e) {
- var connection = this.list.getSelectedRecords()[0];
- if (!connection) return;
-
- if (!this.editWindow) {
- this.editWindow = new Deluge.EditConnectionWindow();
- this.editWindow.on('hostedited', this.onHostChange, this);
- }
- this.editWindow.show(connection);
- },
-
- // private
- onHostChange: function () {
- this.loadHosts();
- },
-
- // private
- onClose: function (e) {
- this.hide();
- },
-
- // private
- onConnect: function (e) {
- var selected = this.list.getSelectedRecords()[0];
- if (!selected) return;
-
- var me = this;
- var disconnect = function () {
- deluge.client.web.disconnect({
- success: function (result) {
- this.update(this);
- deluge.events.fire('disconnect');
- },
- scope: me,
- });
- };
-
- if (selected.get('status').toLowerCase() == 'connected') {
- disconnect();
- } else {
- if (
- this.list
- .getStore()
- .find('status', 'Connected', 0, false, false) > -1
- ) {
- disconnect();
- }
-
- var id = selected.id;
- deluge.client.web.connect(id, {
- success: function (methods) {
- deluge.client.reloadMethods();
- deluge.client.on(
- 'connected',
- function (e) {
- deluge.events.fire('connect');
- },
- this,
- { single: true }
- );
- },
- });
- this.hide();
- }
- },
-
- // private
- onGetHosts: function (hosts) {
- this.list.getStore().loadData(hosts);
- Ext.each(
- hosts,
- function (host) {
- deluge.client.web.get_host_status(host[0], {
- success: this.onGetHostStatus,
- scope: this,
- });
- },
- this
- );
- },
-
- // private
- onGetHostStatus: function (host) {
- var record = this.list.getStore().getById(host[0]);
- record.set('status', host[1]);
- record.set('version', host[2]);
- record.commit();
- var selected = this.list.getSelectedRecords()[0];
- if (!selected) return;
- if (selected == record) this.updateButtons(record);
- },
-
- // private
- onHide: function () {
- if (this.running) window.clearInterval(this.running);
- },
-
- // private
- onLogin: function () {
- if (deluge.config.first_login) {
- Ext.MessageBox.confirm(
- _('Change Default Password'),
- _(
- 'We recommend changing the default password.<br><br>Would you like to change it now?'
- ),
- function (res) {
- this.checkConnected();
- if (res == 'yes') {
- deluge.preferences.show();
- deluge.preferences.selectPage('Interface');
- }
- deluge.client.web.set_config({ first_login: false });
- },
- this
- );
- } else {
- this.checkConnected();
- }
- },
-
- // private
- onLogout: function () {
- this.disconnect();
- if (!this.hidden && this.rendered) {
- this.hide();
- }
- },
-
- // private
- onRemoveClick: function (button) {
- var connection = this.list.getSelectedRecords()[0];
- if (!connection) return;
-
- deluge.client.web.remove_host(connection.id, {
- success: function (result) {
- if (!result) {
- Ext.MessageBox.show({
- title: _('Error'),
- msg: result[1],
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- } else {
- this.list.getStore().remove(connection);
- }
- },
- scope: this,
- });
- },
-
- // private
- onSelectionChanged: function (list, selections) {
- if (selections[0]) {
- this.editHostButton.enable();
- this.removeHostButton.enable();
- this.stopHostButton.enable();
- this.stopHostButton.setText(_('Stop Daemon'));
- this.updateButtons(this.list.getRecord(selections[0]));
- } else {
- this.editHostButton.disable();
- this.removeHostButton.disable();
- this.stopHostButton.disable();
- }
- },
-
- // FIXME: Find out why this is being fired twice
- // private
- onShow: function () {
- if (!this.addHostButton) {
- var bbar = this.panel.getBottomToolbar();
- this.addHostButton = bbar.items.get('cm-add');
- this.editHostButton = bbar.items.get('cm-edit');
- this.removeHostButton = bbar.items.get('cm-remove');
- this.stopHostButton = bbar.items.get('cm-stop');
- }
- this.loadHosts();
- if (this.running) return;
- this.running = window.setInterval(this.update, 2000, this);
- },
-
- // private
- onStopClick: function (button, e) {
- var connection = this.list.getSelectedRecords()[0];
- if (!connection) return;
-
- if (connection.get('status') == 'Offline') {
- // This means we need to start the daemon
- deluge.client.web.start_daemon(connection.get('port'));
- } else {
- // This means we need to stop the daemon
- deluge.client.web.stop_daemon(connection.id, {
- success: function (result) {
- if (!result[0]) {
- Ext.MessageBox.show({
- title: _('Error'),
- msg: result[1],
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- }
- },
- });
- }
- },
-});
-/*
- * Deluge.CopyMagnet.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This program 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, or (at your option)
- * any later version.
- *
- * This program 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 this program. If not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- *
- * In addition, as a special exception, the copyright holders give
- * permission to link the code of portions of this program with the OpenSSL
- * library.
- * You must obey the GNU General Public License in all respects for all of
- * the code used other than OpenSSL. If you modify file(s) with this
- * exception, you may extend this exception to your version of the file(s),
- * but you are not obligated to do so. If you do not wish to do so, delete
- * this exception statement from your version. If you delete this exception
- * statement from all source files in the program, then also delete it here.
- */
-Deluge.CopyMagnet = Ext.extend(Ext.Window, {
- title: _('Copy Magnet URI'),
- width: 375,
- closeAction: 'hide',
- iconCls: 'icon-magnet-copy',
-
- initComponent: function () {
- Deluge.CopyMagnet.superclass.initComponent.call(this);
- form = this.add({
- xtype: 'form',
- defaultType: 'textfield',
- hideLabels: true,
- });
- this.magnetURI = form.add({
- name: 'URI',
- anchor: '100%',
- });
- this.addButton(_('Close'), this.onClose, this);
- this.addButton(_('Copy'), this.onCopy, this);
- },
- show: function (a) {
- Deluge.CopyMagnet.superclass.show.call(this);
- var torrent = deluge.torrents.getSelected();
- deluge.client.core.get_magnet_uri(torrent.id, {
- success: this.onRequestComplete,
- scope: this,
- });
- },
- onRequestComplete: function (uri) {
- this.magnetURI.setValue(uri);
- },
- onCopy: function () {
- this.magnetURI.focus();
- this.magnetURI.el.dom.select();
- document.execCommand('copy');
- },
- onClose: function () {
- this.hide();
- },
-});
-
-deluge.copyMagnetWindow = new Deluge.CopyMagnet();
-/**
- * Deluge.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-// Setup the state manager
-Ext.state.Manager.setProvider(
- new Ext.state.CookieProvider({
- /**
- * By default, cookies will expire after 7 days. Provide
- * an expiry date 10 years in the future to approximate
- * a cookie that does not expire.
- */
- expires: new Date(
- new Date().getTime() + 1000 * 60 * 60 * 24 * 365 * 10
- ),
- })
-);
-
-// Add some additional functions to ext and setup some of the
-// configurable parameters
-Ext.apply(Ext, {
- isObjectEmpty: function (obj) {
- for (var i in obj) {
- return false;
- }
- return true;
- },
-
- areObjectsEqual: function (obj1, obj2) {
- var equal = true;
- if (!obj1 || !obj2) return false;
- for (var i in obj1) {
- if (obj1[i] != obj2[i]) {
- equal = false;
- }
- }
- return equal;
- },
-
- keys: function (obj) {
- var keys = [];
- for (var i in obj)
- if (obj.hasOwnProperty(i)) {
- keys.push(i);
- }
- return keys;
- },
-
- values: function (obj) {
- var values = [];
- for (var i in obj) {
- if (obj.hasOwnProperty(i)) {
- values.push(obj[i]);
- }
- }
- return values;
- },
-
- splat: function (obj) {
- var type = Ext.type(obj);
- return type ? (type != 'array' ? [obj] : obj) : [];
- },
-});
-Ext.getKeys = Ext.keys;
-Ext.BLANK_IMAGE_URL = deluge.config.base + 'images/s.gif';
-Ext.USE_NATIVE_JSON = true;
-
-// Create the Deluge namespace
-Ext.apply(Deluge, {
- // private
- pluginStore: {},
-
- // private
- progressTpl:
- '<div class="x-progress-wrap x-progress-renderered">' +
- '<div class="x-progress-inner">' +
- '<div style="width: {2}px" class="x-progress-bar">' +
- '<div style="z-index: 99; width: {3}px" class="x-progress-text">' +
- '<div style="width: {1}px;">{0}</div>' +
- '</div>' +
- '</div>' +
- '<div class="x-progress-text x-progress-text-back">' +
- '<div style="width: {1}px;">{0}</div>' +
- '</div>' +
- '</div>' +
- '</div>',
-
- /**
- * A method to create a progress bar that can be used by renderers
- * to display a bar within a grid or tree.
- * @param {Number} progress The bars progress
- * @param {Number} width The width of the bar
- * @param {String} text The text to display on the bar
- * @param {Number} modified Amount to subtract from the width allowing for fixes
- */
- progressBar: function (progress, width, text, modifier) {
- modifier = Ext.value(modifier, 10);
- var progressWidth = ((width / 100.0) * progress).toFixed(0);
- var barWidth = progressWidth - 1;
- var textWidth =
- progressWidth - modifier > 0 ? progressWidth - modifier : 0;
- return String.format(
- Deluge.progressTpl,
- text,
- width,
- barWidth,
- textWidth
- );
- },
-
- /**
- * Constructs a new instance of the specified plugin.
- * @param {String} name The plugin name to create
- */
- createPlugin: function (name) {
- return new Deluge.pluginStore[name]();
- },
-
- /**
- * Check to see if a plugin has been registered.
- * @param {String} name The plugin name to check
- */
- hasPlugin: function (name) {
- return Deluge.pluginStore[name] ? true : false;
- },
-
- /**
- * Register a plugin with the Deluge interface.
- * @param {String} name The plugin name to register
- * @param {Plugin} plugin The plugin to register
- */
- registerPlugin: function (name, plugin) {
- Deluge.pluginStore[name] = plugin;
- },
-});
-
-// Setup a space for plugins to insert themselves
-deluge.plugins = {};
-
-// Hinting for gettext_gen.py
-// _('Skip')
-// _('Low')
-// _('Normal')
-// _('High')
-// _('Mixed')
-FILE_PRIORITY = {
- 0: 'Skip',
- 1: 'Low',
- 2: 'Low',
- 3: 'Low',
- 4: 'Normal',
- 5: 'High',
- 6: 'High',
- 7: 'High',
- 9: 'Mixed',
- Skip: 0,
- Low: 1,
- Normal: 4,
- High: 7,
- Mixed: 9,
-};
-
-FILE_PRIORITY_CSS = {
- 0: 'x-no-download',
- 1: 'x-low-download',
- 2: 'x-low-download',
- 3: 'x-low-download',
- 4: 'x-normal-download',
- 5: 'x-high-download',
- 6: 'x-high-download',
- 7: 'x-high-download',
- 9: 'x-mixed-download',
-};
-/**
- * Deluge.EditConnectionWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.EditConnectionWindow
- * @extends Ext.Window
- */
-Deluge.EditConnectionWindow = Ext.extend(Ext.Window, {
- title: _('Edit Connection'),
- iconCls: 'x-deluge-add-window-icon',
-
- layout: 'fit',
- width: 300,
- height: 195,
- constrainHeader: true,
- bodyStyle: 'padding: 10px 5px;',
- closeAction: 'hide',
-
- initComponent: function () {
- Deluge.EditConnectionWindow.superclass.initComponent.call(this);
-
- this.addEvents('hostedited');
-
- this.addButton(_('Close'), this.hide, this);
- this.addButton(_('Edit'), this.onEditClick, this);
-
- this.on('hide', this.onHide, this);
-
- this.form = this.add({
- xtype: 'form',
- defaultType: 'textfield',
- baseCls: 'x-plain',
- labelWidth: 60,
- items: [
- {
- fieldLabel: _('Host:'),
- labelSeparator: '',
- name: 'host',
- anchor: '75%',
- value: '',
- },
- {
- xtype: 'spinnerfield',
- fieldLabel: _('Port:'),
- labelSeparator: '',
- name: 'port',
- strategy: {
- xtype: 'number',
- decimalPrecision: 0,
- minValue: 0,
- maxValue: 65535,
- },
- anchor: '40%',
- value: 58846,
- },
- {
- fieldLabel: _('Username:'),
- labelSeparator: '',
- name: 'username',
- anchor: '75%',
- value: '',
- },
- {
- fieldLabel: _('Password:'),
- labelSeparator: '',
- anchor: '75%',
- name: 'password',
- inputType: 'password',
- value: '',
- },
- ],
- });
- },
-
- show: function (connection) {
- Deluge.EditConnectionWindow.superclass.show.call(this);
-
- this.form.getForm().findField('host').setValue(connection.get('host'));
- this.form.getForm().findField('port').setValue(connection.get('port'));
- this.form
- .getForm()
- .findField('username')
- .setValue(connection.get('user'));
- this.host_id = connection.id;
- },
-
- onEditClick: function () {
- var values = this.form.getForm().getValues();
- deluge.client.web.edit_host(
- this.host_id,
- values.host,
- Number(values.port),
- values.username,
- values.password,
- {
- success: function (result) {
- if (!result) {
- console.log(result);
- Ext.MessageBox.show({
- title: _('Error'),
- msg: String.format(_('Unable to edit host')),
- buttons: Ext.MessageBox.OK,
- modal: false,
- icon: Ext.MessageBox.ERROR,
- iconCls: 'x-deluge-icon-error',
- });
- } else {
- this.fireEvent('hostedited');
- }
- this.hide();
- },
- scope: this,
- }
- );
- },
-
- onHide: function () {
- this.form.getForm().reset();
- },
-});
-/**
- * Deluge.EditTrackerWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.EditTrackerWindow
- * @extends Ext.Window
- */
-Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
- title: _('Edit Tracker'),
- layout: 'fit',
- width: 375,
- height: 110,
- plain: true,
- closable: true,
- resizable: false,
- constrainHeader: true,
- bodyStyle: 'padding: 5px',
- buttonAlign: 'right',
- closeAction: 'hide',
- iconCls: 'x-deluge-edit-trackers',
-
- initComponent: function () {
- Deluge.EditTrackerWindow.superclass.initComponent.call(this);
-
- this.addButton(_('Cancel'), this.onCancelClick, this);
- this.addButton(_('Save'), this.onSaveClick, this);
- this.on('hide', this.onHide, this);
-
- this.form = this.add({
- xtype: 'form',
- defaultType: 'textfield',
- baseCls: 'x-plain',
- labelWidth: 55,
- items: [
- {
- fieldLabel: _('Tracker:'),
- labelSeparator: '',
- name: 'tracker',
- anchor: '100%',
- },
- ],
- });
- },
-
- show: function (record) {
- Deluge.EditTrackerWindow.superclass.show.call(this);
-
- this.record = record;
- this.form.getForm().findField('tracker').setValue(record.data['url']);
- },
-
- onCancelClick: function () {
- this.hide();
- },
-
- onHide: function () {
- this.form.getForm().findField('tracker').setValue('');
- },
-
- onSaveClick: function () {
- var url = this.form.getForm().findField('tracker').getValue();
- this.record.set('url', url);
- this.record.commit();
- this.hide();
- },
-});
-/**
- * Deluge.EditTrackers.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.EditTrackersWindow
- * @extends Ext.Window
- */
-Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
- title: _('Edit Trackers'),
- layout: 'fit',
- width: 350,
- height: 220,
- plain: true,
- closable: true,
- resizable: true,
- constrainHeader: true,
-
- bodyStyle: 'padding: 5px',
- buttonAlign: 'right',
- closeAction: 'hide',
- iconCls: 'x-deluge-edit-trackers',
-
- initComponent: function () {
- Deluge.EditTrackersWindow.superclass.initComponent.call(this);
-
- this.addButton(_('Cancel'), this.onCancelClick, this);
- this.addButton(_('OK'), this.onOkClick, this);
- this.addEvents('save');
-
- this.on('show', this.onShow, this);
- this.on('save', this.onSave, this);
-
- this.addWindow = new Deluge.AddTrackerWindow();
- this.addWindow.on('add', this.onAddTrackers, this);
- this.editWindow = new Deluge.EditTrackerWindow();
-
- this.list = new Ext.list.ListView({
- store: new Ext.data.JsonStore({
- root: 'trackers',
- fields: ['tier', 'url'],
- }),
- columns: [
- {
- header: _('Tier'),
- width: 0.1,
- dataIndex: 'tier',
- },
- {
- header: _('Tracker'),
- width: 0.9,
- dataIndex: 'url',
- tpl: new Ext.XTemplate('{url:htmlEncode}'),
- },
- ],
- columnSort: {
- sortClasses: ['', ''],
- },
- stripeRows: true,
- singleSelect: true,
- listeners: {
- dblclick: { fn: this.onListNodeDblClicked, scope: this },
- selectionchange: { fn: this.onSelect, scope: this },
- },
- });
-
- this.panel = this.add({
- items: [this.list],
- autoScroll: true,
- bbar: new Ext.Toolbar({
- items: [
- {
- text: _('Up'),
- iconCls: 'icon-up',
- handler: this.onUpClick,
- scope: this,
- },
- {
- text: _('Down'),
- iconCls: 'icon-down',
- handler: this.onDownClick,
- scope: this,
- },
- '->',
- {
- text: _('Add'),
- iconCls: 'icon-add',
- handler: this.onAddClick,
- scope: this,
- },
- {
- text: _('Edit'),
- iconCls: 'icon-edit-trackers',
- handler: this.onEditClick,
- scope: this,
- },
- {
- text: _('Remove'),
- iconCls: 'icon-remove',
- handler: this.onRemoveClick,
- scope: this,
- },
- ],
- }),
- });
- },
-
- onAddClick: function () {
- this.addWindow.show();
- },
-
- onAddTrackers: function (trackers) {
- var store = this.list.getStore();
- Ext.each(
- trackers,
- function (tracker) {
- var duplicate = false,
- heightestTier = -1;
- store.each(function (record) {
- if (record.get('tier') > heightestTier) {
- heightestTier = record.get('tier');
- }
- if (tracker == record.get('tracker')) {
- duplicate = true;
- return false;
- }
- }, this);
- if (duplicate) return;
- store.add(
- new store.recordType({
- tier: heightestTier + 1,
- url: tracker,
- })
- );
- },
- this
- );
- },
-
- onCancelClick: function () {
- this.hide();
- },
-
- onEditClick: function () {
- var selected = this.list.getSelectedRecords()[0];
- if (!selected) return;
- this.editWindow.show(selected);
- },
-
- onHide: function () {
- this.list.getStore().removeAll();
- },
-
- onListNodeDblClicked: function (list, index, node, e) {
- this.editWindow.show(this.list.getRecord(node));
- },
-
- onOkClick: function () {
- var trackers = [];
- this.list.getStore().each(function (record) {
- trackers.push({
- tier: record.get('tier'),
- url: record.get('url'),
- });
- }, this);
-
- deluge.client.core.set_torrent_trackers(this.torrentId, trackers, {
- failure: this.onSaveFail,
- scope: this,
- });
-
- this.hide();
- },
-
- onRemoveClick: function () {
- // Remove from the grid
- var selected = this.list.getSelectedRecords()[0];
- if (!selected) return;
- this.list.getStore().remove(selected);
- },
-
- onRequestComplete: function (status) {
- this.list.getStore().loadData(status);
- this.list.getStore().sort('tier', 'ASC');
- },
-
- onSaveFail: function () {},
-
- onSelect: function (list) {
- if (list.getSelectionCount()) {
- this.panel.getBottomToolbar().items.get(4).enable();
- }
- },
-
- onShow: function () {
- this.panel.getBottomToolbar().items.get(4).disable();
- var r = deluge.torrents.getSelected();
- this.torrentId = r.id;
- deluge.client.core.get_torrent_status(r.id, ['trackers'], {
- success: this.onRequestComplete,
- scope: this,
- });
- },
-
- onDownClick: function () {
- var r = this.list.getSelectedRecords()[0];
- if (!r) return;
-
- r.set('tier', r.get('tier') + 1);
- r.store.sort('tier', 'ASC');
- r.store.commitChanges();
-
- this.list.select(r.store.indexOf(r));
- },
-
- onUpClick: function () {
- var r = this.list.getSelectedRecords()[0];
- if (!r) return;
-
- if (r.get('tier') == 0) return;
- r.set('tier', r.get('tier') - 1);
- r.store.sort('tier', 'ASC');
- r.store.commitChanges();
-
- this.list.select(r.store.indexOf(r));
- },
-});
-/**
- * Deluge.EventsManager.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * @class Deluge.EventsManager
- * @extends Ext.util.Observable
- * <p>Deluge.EventsManager is instantated as <tt>deluge.events</tt> and can be used by components of the UI to fire global events</p>
- * Class for holding global events that occur within the UI.
- */
-Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
- constructor: function () {
- this.toRegister = [];
- this.on('login', this.onLogin, this);
- Deluge.EventsManager.superclass.constructor.call(this);
- },
-
- /**
- * Append an event handler to this object.
- */
- addListener: function (eventName, fn, scope, o) {
- this.addEvents(eventName);
- if (/[A-Z]/.test(eventName.substring(0, 1))) {
- if (!deluge.client) {
- this.toRegister.push(eventName);
- } else {
- deluge.client.web.register_event_listener(eventName);
- }
- }
- Deluge.EventsManager.superclass.addListener.call(
- this,
- eventName,
- fn,
- scope,
- o
- );
- },
-
- getEvents: function () {
- deluge.client.web.get_events({
- success: this.onGetEventsSuccess,
- failure: this.onGetEventsFailure,
- scope: this,
- });
- },
-
- /**
- * Starts the EventsManagerManager checking for events.
- */
- start: function () {
- Ext.each(this.toRegister, function (eventName) {
- deluge.client.web.register_event_listener(eventName);
- });
- this.running = true;
- this.errorCount = 0;
- this.getEvents();
- },
-
- /**
- * Stops the EventsManagerManager checking for events.
- */
- stop: function () {
- this.running = false;
- },
-
- // private
- onLogin: function () {
- this.start();
- },
-
- onGetEventsSuccess: function (events) {
- if (!this.running) return;
- if (events) {
- Ext.each(
- events,
- function (event) {
- var name = event[0],
- args = event[1];
- args.splice(0, 0, name);
- this.fireEvent.apply(this, args);
- },
- this
- );
- }
- this.getEvents();
- },
-
- // private
- onGetEventsFailure: function (result, error) {
- // the request timed out or we had a communication failure
- if (!this.running) return;
- if (!error.isTimeout && this.errorCount++ >= 3) {
- this.stop();
- return;
- }
- this.getEvents();
- },
-});
-
-/**
- * Appends an event handler to this object (shorthand for {@link #addListener})
- * @method
- */
-Deluge.EventsManager.prototype.on = Deluge.EventsManager.prototype.addListener;
-
-/**
- * Fires the specified event with the passed parameters (minus the
- * event name).
- * @method
- */
-Deluge.EventsManager.prototype.fire = Deluge.EventsManager.prototype.fireEvent;
-deluge.events = new Deluge.EventsManager();
-/**
- * Deluge.FileBrowser.js
- *
- * Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.namespace('Deluge');
-Deluge.FileBrowser = Ext.extend(Ext.Window, {
- title: _('File Browser'),
-
- width: 500,
- height: 400,
-
- initComponent: function () {
- Deluge.FileBrowser.superclass.initComponent.call(this);
-
- this.add({
- xtype: 'toolbar',
- items: [
- {
- text: _('Back'),
- iconCls: 'icon-back',
- },
- {
- text: _('Forward'),
- iconCls: 'icon-forward',
- },
- {
- text: _('Up'),
- iconCls: 'icon-up',
- },
- {
- text: _('Home'),
- iconCls: 'icon-home',
- },
- ],
- });
- },
-});
-/**
- * Deluge.FilterPanel.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.FilterPanel
- * @extends Ext.list.ListView
- */
-Deluge.FilterPanel = Ext.extend(Ext.Panel, {
- autoScroll: true,
-
- border: false,
-
- show_zero: null,
-
- initComponent: function () {
- Deluge.FilterPanel.superclass.initComponent.call(this);
- this.filterType = this.initialConfig.filter;
- var title = '';
- if (this.filterType == 'state') {
- title = _('States');
- } else if (this.filterType == 'tracker_host') {
- title = _('Trackers');
- } else if (this.filterType == 'owner') {
- title = _('Owner');
- } else if (this.filterType == 'label') {
- title = _('Labels');
- } else {
- (title = this.filterType.replace('_', ' ')),
- (parts = title.split(' ')),
- (title = '');
- Ext.each(parts, function (p) {
- fl = p.substring(0, 1).toUpperCase();
- title += fl + p.substring(1) + ' ';
- });
- }
- this.setTitle(_(title));
-
- if (Deluge.FilterPanel.templates[this.filterType]) {
- var tpl = Deluge.FilterPanel.templates[this.filterType];
- } else {
- var tpl =
- '<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>';
- }
-
- this.list = this.add({
- xtype: 'listview',
- singleSelect: true,
- hideHeaders: true,
- reserveScrollOffset: true,
- store: new Ext.data.ArrayStore({
- idIndex: 0,
- fields: ['filter', 'count'],
- }),
- columns: [
- {
- id: 'filter',
- sortable: false,
- tpl: tpl,
- dataIndex: 'filter',
- },
- ],
- });
- this.relayEvents(this.list, ['selectionchange']);
- },
-
- /**
- * Return the currently selected filter state
- * @returns {String} the current filter state
- */
- getState: function () {
- if (!this.list.getSelectionCount()) return;
-
- var state = this.list.getSelectedRecords()[0];
- if (!state) return;
- if (state.id == 'All') return;
- return state.id;
- },
-
- /**
- * Return the current states in the filter
- */
- getStates: function () {
- return this.states;
- },
-
- /**
- * Return the Store for the ListView of the FilterPanel
- * @returns {Ext.data.Store} the ListView store
- */
- getStore: function () {
- return this.list.getStore();
- },
-
- /**
- * Update the states in the FilterPanel
- */
- updateStates: function (states) {
- this.states = {};
- Ext.each(
- states,
- function (state) {
- this.states[state[0]] = state[1];
- },
- this
- );
-
- var show_zero =
- this.show_zero == null
- ? deluge.config.sidebar_show_zero
- : this.show_zero;
- if (!show_zero) {
- var newStates = [];
- Ext.each(states, function (state) {
- if (state[1] > 0 || state[0] == 'All') {
- newStates.push(state);
- }
- });
- states = newStates;
- }
-
- var store = this.getStore();
- var filters = {};
- Ext.each(
- states,
- function (s, i) {
- var record = store.getById(s[0]);
- if (!record) {
- record = new store.recordType({
- filter: s[0],
- count: s[1],
- });
- record.id = s[0];
- store.insert(i, record);
- }
- record.beginEdit();
- record.set('filter', _(s[0]));
- record.set('count', s[1]);
- record.endEdit();
- filters[s[0]] = true;
- },
- this
- );
-
- store.each(function (record) {
- if (filters[record.id]) return;
- store.remove(record);
- var selected = this.list.getSelectedRecords()[0];
- if (!selected) return;
- if (selected.id == record.id) {
- this.list.select(0);
- }
- }, this);
-
- store.commitChanges();
-
- if (!this.list.getSelectionCount()) {
- this.list.select(0);
- }
- },
-});
-
-Deluge.FilterPanel.templates = {
- tracker_host:
- '<div class="x-deluge-filter" style="background-image: url(' +
- deluge.config.base +
- 'tracker/{filter});">{filter:htmlEncode} ({count})</div>',
-};
-/**
- * Deluge.Formatters.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * A collection of functions for string formatting values.
- * @class Deluge.Formatters
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- * @singleton
- */
-Deluge.Formatters = (function () {
- var charToEntity = {
- '&': '&amp;',
- '>': '&gt;',
- '<': '&lt;',
- '"': '&quot;',
- "'": '&#39;',
- };
-
- var charToEntityRegex = new RegExp(
- '(' + Object.keys(charToEntity).join('|') + ')',
- 'g'
- );
- var htmlEncodeReplaceFn = function (match, capture) {
- return charToEntity[capture];
- };
-
- /**
- * Formats a date string in the date representation of the current locale,
- * based on the systems timezone.
- *
- * @param {Number} timestamp time in seconds since the Epoch.
- * @return {String} a string in the date representation of the current locale
- * or "" if seconds < 0.
- */
- return (Formatters = {
- date: function (timestamp) {
- function zeroPad(num, count) {
- var numZeropad = num + '';
- while (numZeropad.length < count) {
- numZeropad = '0' + numZeropad;
- }
- return numZeropad;
- }
- timestamp = timestamp * 1000;
- var date = new Date(timestamp);
- return String.format(
- '{0}/{1}/{2} {3}:{4}:{5}',
- zeroPad(date.getDate(), 2),
- zeroPad(date.getMonth() + 1, 2),
- date.getFullYear(),
- zeroPad(date.getHours(), 2),
- zeroPad(date.getMinutes(), 2),
- zeroPad(date.getSeconds(), 2)
- );
- },
-
- /**
- * Formats the bytes value into a string with KiB, MiB or GiB units.
- *
- * @param {Number} bytes the filesize in bytes
- * @param {Boolean} showZero pass in true to displays 0 values
- * @return {String} formatted string with KiB, MiB or GiB units.
- */
- size: function (bytes, showZero) {
- if (!bytes && !showZero) return '';
- bytes = bytes / 1024.0;
-
- if (bytes < 1024) {
- return bytes.toFixed(1) + ' KiB';
- } else {
- bytes = bytes / 1024;
- }
-
- if (bytes < 1024) {
- return bytes.toFixed(1) + ' MiB';
- } else {
- bytes = bytes / 1024;
- }
-
- return bytes.toFixed(1) + ' GiB';
- },
-
- /**
- * Formats the bytes value into a string with K, M or G units.
- *
- * @param {Number} bytes the filesize in bytes
- * @param {Boolean} showZero pass in true to displays 0 values
- * @return {String} formatted string with K, M or G units.
- */
- sizeShort: function (bytes, showZero) {
- if (!bytes && !showZero) return '';
- bytes = bytes / 1024.0;
-
- if (bytes < 1024) {
- return bytes.toFixed(1) + ' K';
- } else {
- bytes = bytes / 1024;
- }
-
- if (bytes < 1024) {
- return bytes.toFixed(1) + ' M';
- } else {
- bytes = bytes / 1024;
- }
-
- return bytes.toFixed(1) + ' G';
- },
-
- /**
- * Formats a string to display a transfer speed utilizing {@link #size}
- *
- * @param {Number} bytes the number of bytes per second
- * @param {Boolean} showZero pass in true to displays 0 values
- * @return {String} formatted string with KiB, MiB or GiB units.
- */
- speed: function (bytes, showZero) {
- return !bytes && !showZero ? '' : fsize(bytes, showZero) + '/s';
- },
-
- /**
- * Formats a string to show time in a human readable form.
- *
- * @param {Number} time the number of seconds
- * @return {String} a formatted time string. will return '' if seconds == 0
- */
- timeRemaining: function (time) {
- if (time <= 0) {
- return '&infin;';
- }
- time = time.toFixed(0);
- if (time < 60) {
- return time + 's';
- } else {
- time = time / 60;
- }
-
- if (time < 60) {
- var minutes = Math.floor(time);
- var seconds = Math.round(60 * (time - minutes));
- if (seconds > 0) {
- return minutes + 'm ' + seconds + 's';
- } else {
- return minutes + 'm';
- }
- } else {
- time = time / 60;
- }
-
- if (time < 24) {
- var hours = Math.floor(time);
- var minutes = Math.round(60 * (time - hours));
- if (minutes > 0) {
- return hours + 'h ' + minutes + 'm';
- } else {
- return hours + 'h';
- }
- } else {
- time = time / 24;
- }
-
- var days = Math.floor(time);
- var hours = Math.round(24 * (time - days));
- if (hours > 0) {
- return days + 'd ' + hours + 'h';
- } else {
- return days + 'd';
- }
- },
-
- /**
- * Simply returns the value untouched, for when no formatting is required.
- *
- * @param {Mixed} value the value to be displayed
- * @return the untouched value.
- */
- plain: function (value) {
- return value;
- },
-
- cssClassEscape: function (value) {
- return value.toLowerCase().replace('.', '_');
- },
-
- htmlEncode: function (value) {
- return !value
- ? value
- : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
- },
- });
-})();
-var fsize = Deluge.Formatters.size;
-var fsize_short = Deluge.Formatters.sizeShort;
-var fspeed = Deluge.Formatters.speed;
-var ftime = Deluge.Formatters.timeRemaining;
-var fdate = Deluge.Formatters.date;
-var fplain = Deluge.Formatters.plain;
-Ext.util.Format.cssClassEscape = Deluge.Formatters.cssClassEscape;
-Ext.util.Format.htmlEncode = Deluge.Formatters.htmlEncode;
-/**
- * Deluge.Keys.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * @description The torrent status keys that are commonly used around the UI.
- * @class Deluge.Keys
- * @singleton
- */
-Deluge.Keys = {
- /**
- * Keys that are used within the torrent grid.
- * <pre>['queue', 'name', 'total_wanted', 'state', 'progress', 'num_seeds',
- * 'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate',
- * 'upload_payload_rate', 'eta', 'ratio', 'distributed_copies',
- * 'is_auto_managed', 'time_added', 'tracker_host', 'download_location', 'last_seen_complete',
- * 'total_done', 'total_uploaded', 'max_download_speed', 'max_upload_speed',
- * 'seeds_peers_ratio', 'total_remaining', 'completed_time', 'time_since_transfer']</pre>
- */
- Grid: [
- 'queue',
- 'name',
- 'total_wanted',
- 'state',
- 'progress',
- 'num_seeds',
- 'total_seeds',
- 'num_peers',
- 'total_peers',
- 'download_payload_rate',
- 'upload_payload_rate',
- 'eta',
- 'ratio',
- 'distributed_copies',
- 'is_auto_managed',
- 'time_added',
- 'tracker_host',
- 'download_location',
- 'last_seen_complete',
- 'total_done',
- 'total_uploaded',
- 'max_download_speed',
- 'max_upload_speed',
- 'seeds_peers_ratio',
- 'total_remaining',
- 'completed_time',
- 'time_since_transfer',
- ],
-
- /**
- * Keys used in the status tab of the statistics panel.
- * These get updated to include the keys in {@link #Grid}.
- * <pre>['total_done', 'total_payload_download', 'total_uploaded',
- * 'total_payload_upload', 'next_announce', 'tracker_status', 'num_pieces',
- * 'piece_length', 'is_auto_managed', 'active_time', 'seeding_time', 'time_since_transfer',
- * 'seed_rank', 'last_seen_complete', 'completed_time', 'owner', 'public', 'shared']</pre>
- */
- Status: [
- 'total_done',
- 'total_payload_download',
- 'total_uploaded',
- 'total_payload_upload',
- 'next_announce',
- 'tracker_status',
- 'num_pieces',
- 'piece_length',
- 'is_auto_managed',
- 'active_time',
- 'seeding_time',
- 'time_since_transfer',
- 'seed_rank',
- 'last_seen_complete',
- 'completed_time',
- 'owner',
- 'public',
- 'shared',
- ],
-
- /**
- * Keys used in the files tab of the statistics panel.
- * <pre>['files', 'file_progress', 'file_priorities']</pre>
- */
- Files: ['files', 'file_progress', 'file_priorities'],
-
- /**
- * Keys used in the peers tab of the statistics panel.
- * <pre>['peers']</pre>
- */
- Peers: ['peers'],
-
- /**
- * Keys used in the details tab of the statistics panel.
- */
- Details: [
- 'name',
- 'download_location',
- 'total_size',
- 'num_files',
- 'message',
- 'tracker_host',
- 'comment',
- 'creator',
- ],
-
- /**
- * Keys used in the options tab of the statistics panel.
- * <pre>['max_download_speed', 'max_upload_speed', 'max_connections', 'max_upload_slots',
- * 'is_auto_managed', 'stop_at_ratio', 'stop_ratio', 'remove_at_ratio', 'private',
- * 'prioritize_first_last']</pre>
- */
- Options: [
- 'max_download_speed',
- 'max_upload_speed',
- 'max_connections',
- 'max_upload_slots',
- 'is_auto_managed',
- 'stop_at_ratio',
- 'stop_ratio',
- 'remove_at_ratio',
- 'private',
- 'prioritize_first_last',
- 'move_completed',
- 'move_completed_path',
- 'super_seeding',
- ],
-};
-
-// Merge the grid and status keys together as the status keys contain all the
-// grid ones.
-Ext.each(Deluge.Keys.Grid, function (key) {
- Deluge.Keys.Status.push(key);
-});
-/**
- * Deluge.LoginWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Deluge.LoginWindow = Ext.extend(Ext.Window, {
- firstShow: true,
- bodyStyle: 'padding: 10px 5px;',
- buttonAlign: 'center',
- closable: false,
- closeAction: 'hide',
- iconCls: 'x-deluge-login-window-icon',
- layout: 'fit',
- modal: true,
- plain: true,
- resizable: false,
- title: _('Login'),
- width: 300,
- height: 120,
-
- initComponent: function () {
- Deluge.LoginWindow.superclass.initComponent.call(this);
- this.on('show', this.onShow, this);
-
- this.addButton({
- text: _('Login'),
- handler: this.onLogin,
- scope: this,
- });
-
- this.form = this.add({
- xtype: 'form',
- baseCls: 'x-plain',
- labelWidth: 120,
- labelAlign: 'right',
- defaults: { width: 110 },
- defaultType: 'textfield',
- });
-
- this.passwordField = this.form.add({
- xtype: 'textfield',
- fieldLabel: _('Password:'),
- labelSeparator: '',
- grow: true,
- growMin: '110',
- growMax: '145',
- id: '_password',
- name: 'password',
- inputType: 'password',
- });
- this.passwordField.on('specialkey', this.onSpecialKey, this);
- },
-
- logout: function () {
- deluge.events.fire('logout');
- deluge.client.auth.delete_session({
- success: function (result) {
- this.show(true);
- },
- scope: this,
- });
- },
-
- show: function (skipCheck) {
- if (this.firstShow) {
- deluge.client.on('error', this.onClientError, this);
- this.firstShow = false;
- }
-
- if (skipCheck) {
- return Deluge.LoginWindow.superclass.show.call(this);
- }
-
- deluge.client.auth.check_session({
- success: function (result) {
- if (result) {
- deluge.events.fire('login');
- } else {
- this.show(true);
- }
- },
- failure: function (result) {
- this.show(true);
- },
- scope: this,
- });
- },
-
- onSpecialKey: function (field, e) {
- if (e.getKey() == 13) this.onLogin();
- },
-
- onLogin: function () {
- var passwordField = this.passwordField;
- deluge.client.auth.login(passwordField.getValue(), {
- success: function (result) {
- if (result) {
- deluge.events.fire('login');
- this.hide();
- passwordField.setRawValue('');
- } else {
- Ext.MessageBox.show({
- title: _('Login Failed'),
- msg: _('You entered an incorrect password'),
- buttons: Ext.MessageBox.OK,
- modal: false,
- fn: function () {
- passwordField.focus(true, 10);
- },
- icon: Ext.MessageBox.WARNING,
- iconCls: 'x-deluge-icon-warning',
- });
- }
- },
- scope: this,
- });
- },
-
- onClientError: function (errorObj, response, requestOptions) {
- if (errorObj.error.code == 1) {
- deluge.events.fire('logout');
- this.show(true);
- }
- },
-
- onShow: function () {
- this.passwordField.focus(true, 300);
- },
-});
-/**
- * Deluge.Menus.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-deluge.menus = {
- onTorrentActionSetOpt: function (item, e) {
- var ids = deluge.torrents.getSelectedIds();
- var action = item.initialConfig.torrentAction;
- var opts = {};
- opts[action[0]] = action[1];
- deluge.client.core.set_torrent_options(ids, opts);
- },
-
- onTorrentActionMethod: function (item, e) {
- var ids = deluge.torrents.getSelectedIds();
- var action = item.initialConfig.torrentAction;
- deluge.client.core[action](ids, {
- success: function () {
- deluge.ui.update();
- },
- });
- },
-
- onTorrentActionShow: function (item, e) {
- var ids = deluge.torrents.getSelectedIds();
- var action = item.initialConfig.torrentAction;
- switch (action) {
- case 'copy_magnet':
- deluge.copyMagnetWindow.show();
- break;
- case 'edit_trackers':
- deluge.editTrackers.show();
- break;
- case 'remove':
- deluge.removeWindow.show(ids);
- break;
- case 'move':
- deluge.moveStorage.show(ids);
- break;
- }
- },
-};
-
-deluge.menus.torrent = new Ext.menu.Menu({
- id: 'torrentMenu',
- items: [
- {
- torrentAction: 'pause_torrent',
- text: _('Pause'),
- iconCls: 'icon-pause',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'resume_torrent',
- text: _('Resume'),
- iconCls: 'icon-resume',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- '-',
- {
- text: _('Options'),
- iconCls: 'icon-options',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- text: _('D/L Speed Limit'),
- iconCls: 'x-deluge-downloading',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: ['max_download_speed', 5],
- text: _('5 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_download_speed', 10],
- text: _('10 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_download_speed', 30],
- text: _('30 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_download_speed', 80],
- text: _('80 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_download_speed', 300],
- text: _('300 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_download_speed', -1],
- text: _('Unlimited'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- ],
- }),
- },
- {
- text: _('U/L Speed Limit'),
- iconCls: 'x-deluge-seeding',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: ['max_upload_speed', 5],
- text: _('5 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_speed', 10],
- text: _('10 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_speed', 30],
- text: _('30 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_speed', 80],
- text: _('80 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_speed', 300],
- text: _('300 KiB/s'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_speed', -1],
- text: _('Unlimited'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- ],
- }),
- },
- {
- text: _('Connection Limit'),
- iconCls: 'x-deluge-connections',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: ['max_connections', 50],
- text: '50',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_connections', 100],
- text: '100',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_connections', 200],
- text: '200',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_connections', 300],
- text: '300',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_connections', 500],
- text: '500',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_connections', -1],
- text: _('Unlimited'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- ],
- }),
- },
- {
- text: _('Upload Slot Limit'),
- iconCls: 'icon-upload-slots',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: ['max_upload_slots', 0],
- text: '0',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_slots', 1],
- text: '1',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_slots', 2],
- text: '2',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_slots', 3],
- text: '3',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_slots', 5],
- text: '5',
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['max_upload_slots', -1],
- text: _('Unlimited'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- ],
- }),
- },
- {
- id: 'auto_managed',
- text: _('Auto Managed'),
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: ['auto_managed', true],
- text: _('On'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- {
- torrentAction: ['auto_managed', false],
- text: _('Off'),
- handler: deluge.menus.onTorrentActionSetOpt,
- scope: deluge.menus,
- },
- ],
- }),
- },
- ],
- }),
- },
- '-',
- {
- text: _('Queue'),
- iconCls: 'icon-queue',
- hideOnClick: false,
- menu: new Ext.menu.Menu({
- items: [
- {
- torrentAction: 'queue_top',
- text: _('Top'),
- iconCls: 'icon-top',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'queue_up',
- text: _('Up'),
- iconCls: 'icon-up',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'queue_down',
- text: _('Down'),
- iconCls: 'icon-down',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'queue_bottom',
- text: _('Bottom'),
- iconCls: 'icon-bottom',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- ],
- }),
- },
- '-',
- {
- torrentAction: 'copy_magnet',
- text: _('Copy Magnet URI'),
- iconCls: 'icon-magnet-copy',
- handler: deluge.menus.onTorrentActionShow,
- scope: deluge.menus,
- },
- {
- torrentAction: 'force_reannounce',
- text: _('Update Tracker'),
- iconCls: 'icon-update-tracker',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'edit_trackers',
- text: _('Edit Trackers'),
- iconCls: 'icon-edit-trackers',
- handler: deluge.menus.onTorrentActionShow,
- scope: deluge.menus,
- },
- '-',
- {
- torrentAction: 'remove',
- text: _('Remove Torrent'),
- iconCls: 'icon-remove',
- handler: deluge.menus.onTorrentActionShow,
- scope: deluge.menus,
- },
- '-',
- {
- torrentAction: 'force_recheck',
- text: _('Force Recheck'),
- iconCls: 'icon-recheck',
- handler: deluge.menus.onTorrentActionMethod,
- scope: deluge.menus,
- },
- {
- torrentAction: 'move',
- text: _('Move Download Folder'),
- iconCls: 'icon-move',
- handler: deluge.menus.onTorrentActionShow,
- scope: deluge.menus,
- },
- ],
-});
-
-deluge.menus.filePriorities = new Ext.menu.Menu({
- id: 'filePrioritiesMenu',
- items: [
- {
- id: 'expandAll',
- text: _('Expand All'),
- iconCls: 'icon-expand-all',
- },
- '-',
- {
- id: 'skip',
- text: _('Skip'),
- iconCls: 'icon-do-not-download',
- filePriority: FILE_PRIORITY['Skip'],
- },
- {
- id: 'low',
- text: _('Low'),
- iconCls: 'icon-low',
- filePriority: FILE_PRIORITY['Low'],
- },
- {
- id: 'normal',
- text: _('Normal'),
- iconCls: 'icon-normal',
- filePriority: FILE_PRIORITY['Normal'],
- },
- {
- id: 'high',
- text: _('High'),
- iconCls: 'icon-high',
- filePriority: FILE_PRIORITY['High'],
- },
- ],
-});
-/**
- * Deluge.MoveStorage.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.namespace('Deluge');
-Deluge.MoveStorage = Ext.extend(Ext.Window, {
- constructor: function (config) {
- config = Ext.apply(
- {
- title: _('Move Download Folder'),
- width: 375,
- height: 110,
- layout: 'fit',
- buttonAlign: 'right',
- closeAction: 'hide',
- closable: true,
- iconCls: 'x-deluge-move-storage',
- plain: true,
- constrainHeader: true,
- resizable: false,
- },
- config
- );
- Deluge.MoveStorage.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.MoveStorage.superclass.initComponent.call(this);
-
- this.addButton(_('Cancel'), this.onCancel, this);
- this.addButton(_('Move'), this.onMove, this);
-
- this.form = this.add({
- xtype: 'form',
- border: false,
- defaultType: 'textfield',
- width: 300,
- bodyStyle: 'padding: 5px',
- });
-
- this.moveLocation = this.form.add({
- fieldLabel: _('Download Folder'),
- name: 'location',
- width: 240,
- });
- //this.form.add({
- // xtype: 'button',
- // text: _('Browse'),
- // handler: function() {
- // if (!this.fileBrowser) {
- // this.fileBrowser = new Deluge.FileBrowser();
- // }
- // this.fileBrowser.show();
- // },
- // scope: this
- //});
- },
-
- hide: function () {
- Deluge.MoveStorage.superclass.hide.call(this);
- this.torrentIds = null;
- },
-
- show: function (torrentIds) {
- Deluge.MoveStorage.superclass.show.call(this);
- this.torrentIds = torrentIds;
- },
-
- onCancel: function () {
- this.hide();
- },
-
- onMove: function () {
- var dest = this.moveLocation.getValue();
- deluge.client.core.move_storage(this.torrentIds, dest);
- this.hide();
- },
-});
-deluge.moveStorage = new Deluge.MoveStorage();
-/**
- * Deluge.MultiOptionsManager.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * @description A class that can be used to manage options throughout the ui.
- * @namespace Deluge
- * @class Deluge.MultiOptionsManager
- * @extends Deluge.OptionsManager
- */
-Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
- constructor: function (config) {
- this.currentId = null;
- this.stored = {};
- Deluge.MultiOptionsManager.superclass.constructor.call(this, config);
- },
-
- /**
- * Changes bound fields to use the specified id.
- * @param {String} id
- */
- changeId: function (id, dontUpdateBinds) {
- var oldId = this.currentId;
- this.currentId = id;
- if (!dontUpdateBinds) {
- for (var option in this.options) {
- if (!this.binds[option]) continue;
- Ext.each(
- this.binds[option],
- function (bind) {
- bind.setValue(this.get(option));
- },
- this
- );
- }
- }
- return oldId;
- },
-
- /**
- * Changes all the changed values to be the default values
- * @param {String} id
- */
- commit: function () {
- this.stored[this.currentId] = Ext.apply(
- this.stored[this.currentId],
- this.changed[this.currentId]
- );
- this.reset();
- },
-
- /**
- * Get the value for an option
- * @param {String/Array} option A single option or an array of options to return.
- * @returns {Object} the options value.
- */
- get: function () {
- if (arguments.length == 1) {
- var option = arguments[0];
- return this.isDirty(option)
- ? this.changed[this.currentId][option]
- : this.getDefault(option);
- } else if (arguments.length == 0) {
- var options = {};
- for (var option in this.options) {
- options[option] = this.isDirty(option)
- ? this.changed[this.currentId][option]
- : this.getDefault(option);
- }
- return options;
- } else {
- var options = {};
- Ext.each(
- arguments,
- function (option) {
- options[option] = this.isDirty(option)
- ? this.changed[this.currentId][option]
- : this.getDefault(option);
- },
- this
- );
- return options;
- }
- },
-
- /**
- * Get the default value for an option.
- * @param {String} option A single option.
- * @returns {Object} the value of the option
- */
- getDefault: function (option) {
- return this.has(option)
- ? this.stored[this.currentId][option]
- : this.options[option];
- },
-
- /**
- * Returns the dirty (changed) values.
- * @returns {Object} the changed options
- */
- getDirty: function () {
- return this.changed[this.currentId] ? this.changed[this.currentId] : {};
- },
-
- /**
- * Check to see if the option has been changed.
- * @param {String} option
- * @returns {Boolean} true if the option has been changed, else false.
- */
- isDirty: function (option) {
- return (
- this.changed[this.currentId] &&
- !Ext.isEmpty(this.changed[this.currentId][option])
- );
- },
-
- /**
- * Check to see if an id has had an option set to something other than the
- * default value.
- * @param {String} option
- * @returns {Boolean} true if the id has an option, else false.
- */
- has: function (option) {
- return (
- this.stored[this.currentId] &&
- !Ext.isEmpty(this.stored[this.currentId][option])
- );
- },
-
- /**
- * Reset the options back to the default values for the specified id.
- */
- reset: function () {
- if (this.changed[this.currentId]) delete this.changed[this.currentId];
- if (this.stored[this.currentId]) delete this.stored[this.currentId];
- },
-
- /**
- * Reset the options back to their defaults for all ids.
- */
- resetAll: function () {
- this.changed = {};
- this.stored = {};
- this.changeId(null);
- },
-
- /**
- * Sets the value of specified option for the passed in id.
- * @param {String} id
- * @param {String} option
- * @param {Object} value The value for the option
- */
- setDefault: function (option, value) {
- if (option === undefined) {
- return;
- } else if (value === undefined) {
- for (var key in option) {
- this.setDefault(key, option[key]);
- }
- } else {
- var oldValue = this.getDefault(option);
- value = this.convertValueType(oldValue, value);
-
- // If the value is the same as the old value there is
- // no point in setting it again.
- if (oldValue == value) return;
-
- // Store the new default
- if (!this.stored[this.currentId]) this.stored[this.currentId] = {};
- this.stored[this.currentId][option] = value;
-
- if (!this.isDirty(option)) {
- this.fireEvent('changed', option, value, oldValue);
- }
- }
- },
-
- /**
- * Update the value for the specified option and id.
- * @param {String} id
- * @param {String/Object} option or options to update
- * @param {Object} [value];
- */
- update: function (option, value) {
- if (option === undefined) {
- return;
- } else if (value === undefined) {
- for (var key in option) {
- this.update(key, option[key]);
- }
- } else {
- if (!this.changed[this.currentId])
- this.changed[this.currentId] = {};
-
- var defaultValue = this.getDefault(option);
- value = this.convertValueType(defaultValue, value);
-
- var oldValue = this.get(option);
- if (oldValue == value) return;
-
- if (defaultValue == value) {
- if (this.isDirty(option))
- delete this.changed[this.currentId][option];
- this.fireEvent('changed', option, value, oldValue);
- return;
- } else {
- this.changed[this.currentId][option] = value;
- this.fireEvent('changed', option, value, oldValue);
- }
- }
- },
-});
-/**
- * Deluge.OtherLimitWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.OtherLimitWindow
- * @extends Ext.Window
- */
-Deluge.OtherLimitWindow = Ext.extend(Ext.Window, {
- layout: 'fit',
- width: 210,
- height: 100,
- constrainHeader: true,
- closeAction: 'hide',
-
- initComponent: function () {
- Deluge.OtherLimitWindow.superclass.initComponent.call(this);
- this.form = this.add({
- xtype: 'form',
- baseCls: 'x-plain',
- bodyStyle: 'padding: 5px',
- layout: 'hbox',
- layoutConfig: {
- pack: 'start',
- },
- items: [
- {
- xtype: 'spinnerfield',
- name: 'limit',
- },
- ],
- });
- if (this.initialConfig.unit) {
- this.form.add({
- border: false,
- baseCls: 'x-plain',
- bodyStyle: 'padding: 5px',
- html: this.initialConfig.unit,
- });
- } else {
- this.setSize(180, 100);
- }
-
- this.addButton(_('Cancel'), this.onCancelClick, this);
- this.addButton(_('OK'), this.onOkClick, this);
- this.afterMethod('show', this.doFocusField, this);
- },
-
- setValue: function (value) {
- this.form.getForm().setValues({ limit: value });
- },
-
- onCancelClick: function () {
- this.form.getForm().reset();
- this.hide();
- },
-
- onOkClick: function () {
- var config = {};
- config[this.group] = this.form.getForm().getValues().limit;
- deluge.client.core.set_config(config, {
- success: function () {
- deluge.ui.update();
- },
- });
- this.hide();
- },
-
- doFocusField: function () {
- this.form.getForm().findField('limit').focus(true, 10);
- },
-});
-/**
- * Deluge.Plugin.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Deluge');
-
-/**
- * @class Deluge.Plugin
- * @extends Ext.util.Observable
- */
-Deluge.Plugin = Ext.extend(Ext.util.Observable, {
- /**
- * The plugins name
- * @property name
- * @type {String}
- */
- name: null,
-
- constructor: function (config) {
- this.isDelugePlugin = true;
- this.addEvents({
- /**
- * @event enabled
- * @param {Plugin} plugin the plugin instance
- */
- enabled: true,
-
- /**
- * @event disabled
- * @param {Plugin} plugin the plugin instance
- */
- disabled: true,
- });
- Deluge.Plugin.superclass.constructor.call(this, config);
- },
-
- /**
- * Disables the plugin, firing the "{@link #disabled}" event and
- * then executing the plugins clean up method onDisabled.
- */
- disable: function () {
- this.fireEvent('disabled', this);
- if (this.onDisable) this.onDisable();
- },
-
- /**
- * Enables the plugin, firing the "{@link #enabled}" event and
- * then executes the plugins setup method, onEnabled.
- */
- enable: function () {
- deluge.client.reloadMethods();
- this.fireEvent('enable', this);
- if (this.onEnable) this.onEnable();
- },
-
- registerTorrentStatus: function (key, header, options) {
- options = options || {};
- var cc = options.colCfg || {},
- sc = options.storeCfg || {};
- sc = Ext.apply(sc, { name: key });
- deluge.torrents.meta.fields.push(sc);
- deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);
-
- cc = Ext.apply(cc, {
- header: header,
- dataIndex: key,
- });
- var cols = deluge.torrents.columns.slice(0);
- cols.push(cc);
- deluge.torrents.colModel.setConfig(cols);
- deluge.torrents.columns = cols;
-
- Deluge.Keys.Grid.push(key);
- deluge.torrents.getView().refresh(true);
- },
-
- deregisterTorrentStatus: function (key) {
- var fields = [];
- Ext.each(deluge.torrents.meta.fields, function (field) {
- if (field.name != key) fields.push(field);
- });
- deluge.torrents.meta.fields = fields;
- deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);
-
- var cols = [];
- Ext.each(deluge.torrents.columns, function (col) {
- if (col.dataIndex != key) cols.push(col);
- });
- deluge.torrents.colModel.setConfig(cols);
- deluge.torrents.columns = cols;
-
- var keys = [];
- Ext.each(Deluge.Keys.Grid, function (k) {
- if (k == key) keys.push(k);
- });
- Deluge.Keys.Grid = keys;
- deluge.torrents.getView().refresh(true);
- },
-});
-
-Ext.ns('Deluge.plugins');
-/**
- * Deluge.RemoveWindow.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * @class Deluge.RemoveWindow
- * @extends Ext.Window
- */
-Deluge.RemoveWindow = Ext.extend(Ext.Window, {
- title: _('Remove Torrent'),
- layout: 'fit',
- width: 350,
- height: 100,
- constrainHeader: true,
- buttonAlign: 'right',
- closeAction: 'hide',
- closable: true,
- iconCls: 'x-deluge-remove-window-icon',
- plain: true,
-
- bodyStyle: 'padding: 5px; padding-left: 10px;',
- html: 'Are you sure you wish to remove the torrent (s)?',
-
- initComponent: function () {
- Deluge.RemoveWindow.superclass.initComponent.call(this);
- this.addButton(_('Cancel'), this.onCancel, this);
- this.addButton(_('Remove With Data'), this.onRemoveData, this);
- this.addButton(_('Remove Torrent'), this.onRemove, this);
- },
-
- remove: function (removeData) {
- deluge.client.core.remove_torrents(this.torrentIds, removeData, {
- success: function (result) {
- if (result == true) {
- console.log(
- 'Error(s) occured when trying to delete torrent(s).'
- );
- }
- this.onRemoved(this.torrentIds);
- },
- scope: this,
- torrentIds: this.torrentIds,
- });
- },
-
- show: function (ids) {
- Deluge.RemoveWindow.superclass.show.call(this);
- this.torrentIds = ids;
- },
-
- onCancel: function () {
- this.hide();
- this.torrentIds = null;
- },
-
- onRemove: function () {
- this.remove(false);
- },
-
- onRemoveData: function () {
- this.remove(true);
- },
-
- onRemoved: function (torrentIds) {
- deluge.events.fire('torrentsRemoved', torrentIds);
- this.hide();
- deluge.ui.update();
- },
-});
-
-deluge.removeWindow = new Deluge.RemoveWindow();
-/**
- * Deluge.Sidebar.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-// These are just so gen_gettext.py will pick up the strings
-// _('State')
-// _('Tracker Host')
-
-/**
- * @class Deluge.Sidebar
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- */
-Deluge.Sidebar = Ext.extend(Ext.Panel, {
- // private
- panels: {},
-
- // private
- selected: null,
-
- constructor: function (config) {
- config = Ext.apply(
- {
- id: 'sidebar',
- region: 'west',
- cls: 'deluge-sidebar',
- title: _('Filters'),
- layout: 'accordion',
- split: true,
- width: 200,
- minSize: 100,
- collapsible: true,
- },
- config
- );
- Deluge.Sidebar.superclass.constructor.call(this, config);
- },
-
- // private
- initComponent: function () {
- Deluge.Sidebar.superclass.initComponent.call(this);
- deluge.events.on('disconnect', this.onDisconnect, this);
- },
-
- createFilter: function (filter, states) {
- var panel = new Deluge.FilterPanel({
- filter: filter,
- });
- panel.on('selectionchange', function (view, nodes) {
- deluge.ui.update();
- });
- this.add(panel);
-
- this.doLayout();
- this.panels[filter] = panel;
-
- panel.header.on('click', function (header) {
- if (!deluge.config.sidebar_multiple_filters) {
- deluge.ui.update();
- }
- if (!panel.list.getSelectionCount()) {
- panel.list.select(0);
- }
- });
- this.fireEvent('filtercreate', this, panel);
-
- panel.updateStates(states);
- this.fireEvent('afterfiltercreate', this, panel);
- },
-
- getFilter: function (filter) {
- return this.panels[filter];
- },
-
- getFilterStates: function () {
- var states = {};
-
- if (deluge.config.sidebar_multiple_filters) {
- // Grab the filters from each of the filter panels
- this.items.each(function (panel) {
- var state = panel.getState();
- if (state == null) return;
- states[panel.filterType] = state;
- }, this);
- } else {
- var panel = this.getLayout().activeItem;
- if (panel) {
- var state = panel.getState();
- if (!state == null) return;
- states[panel.filterType] = state;
- }
- }
-
- return states;
- },
-
- hasFilter: function (filter) {
- return this.panels[filter] ? true : false;
- },
-
- // private
- onDisconnect: function () {
- for (var filter in this.panels) {
- this.remove(this.panels[filter]);
- }
- this.panels = {};
- this.selected = null;
- },
-
- onFilterSelect: function (selModel, rowIndex, record) {
- deluge.ui.update();
- },
-
- update: function (filters) {
- for (var filter in filters) {
- var states = filters[filter];
- if (Ext.getKeys(this.panels).indexOf(filter) > -1) {
- this.panels[filter].updateStates(states);
- } else {
- this.createFilter(filter, states);
- }
- }
-
- // Perform a cleanup of fitlers that are not enabled any more.
- Ext.each(
- Ext.keys(this.panels),
- function (filter) {
- if (Ext.keys(filters).indexOf(filter) == -1) {
- // We need to remove the panel
- this.remove(this.panels[filter]);
- this.doLayout();
- delete this.panels[filter];
- }
- },
- this
- );
- },
-});
-/**
- * Deluge.Statusbar.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Deluge');
-
-Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
- constructor: function (config) {
- config = Ext.apply(
- {
- id: 'deluge-statusbar',
- defaultIconCls: 'x-deluge-statusbar x-not-connected',
- defaultText: _('Not Connected'),
- },
- config
- );
- Deluge.Statusbar.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.Statusbar.superclass.initComponent.call(this);
-
- deluge.events.on('connect', this.onConnect, this);
- deluge.events.on('disconnect', this.onDisconnect, this);
- },
-
- createButtons: function () {
- this.buttons = this.add(
- {
- id: 'statusbar-connections',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-connections',
- tooltip: _('Connections'),
- menu: new Deluge.StatusbarMenu({
- items: [
- {
- text: '50',
- value: '50',
- group: 'max_connections_global',
- checked: false,
- },
- {
- text: '100',
- value: '100',
- group: 'max_connections_global',
- checked: false,
- },
- {
- text: '200',
- value: '200',
- group: 'max_connections_global',
- checked: false,
- },
- {
- text: '300',
- value: '300',
- group: 'max_connections_global',
- checked: false,
- },
- {
- text: '500',
- value: '500',
- group: 'max_connections_global',
- checked: false,
- },
- {
- text: _('Unlimited'),
- value: '-1',
- group: 'max_connections_global',
- checked: false,
- },
- '-',
- {
- text: _('Other'),
- value: 'other',
- group: 'max_connections_global',
- checked: false,
- },
- ],
- otherWin: {
- title: _('Set Maximum Connections'),
- },
- }),
- },
- '-',
- {
- id: 'statusbar-downspeed',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-downloading',
- tooltip: _('Download Speed'),
- menu: new Deluge.StatusbarMenu({
- items: [
- {
- value: '5',
- text: _('5 KiB/s'),
- group: 'max_download_speed',
- checked: false,
- },
- {
- value: '10',
- text: _('10 KiB/s'),
- group: 'max_download_speed',
- checked: false,
- },
- {
- value: '30',
- text: _('30 KiB/s'),
- group: 'max_download_speed',
- checked: false,
- },
- {
- value: '80',
- text: _('80 KiB/s'),
- group: 'max_download_speed',
- checked: false,
- },
- {
- value: '300',
- text: _('300 KiB/s'),
- group: 'max_download_speed',
- checked: false,
- },
- {
- value: '-1',
- text: _('Unlimited'),
- group: 'max_download_speed',
- checked: false,
- },
- '-',
- {
- value: 'other',
- text: _('Other'),
- group: 'max_download_speed',
- checked: false,
- },
- ],
- otherWin: {
- title: _('Set Maximum Download Speed'),
- unit: _('KiB/s'),
- },
- }),
- },
- '-',
- {
- id: 'statusbar-upspeed',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-seeding',
- tooltip: _('Upload Speed'),
- menu: new Deluge.StatusbarMenu({
- items: [
- {
- value: '5',
- text: _('5 KiB/s'),
- group: 'max_upload_speed',
- checked: false,
- },
- {
- value: '10',
- text: _('10 KiB/s'),
- group: 'max_upload_speed',
- checked: false,
- },
- {
- value: '30',
- text: _('30 KiB/s'),
- group: 'max_upload_speed',
- checked: false,
- },
- {
- value: '80',
- text: _('80 KiB/s'),
- group: 'max_upload_speed',
- checked: false,
- },
- {
- value: '300',
- text: _('300 KiB/s'),
- group: 'max_upload_speed',
- checked: false,
- },
- {
- value: '-1',
- text: _('Unlimited'),
- group: 'max_upload_speed',
- checked: false,
- },
- '-',
- {
- value: 'other',
- text: _('Other'),
- group: 'max_upload_speed',
- checked: false,
- },
- ],
- otherWin: {
- title: _('Set Maximum Upload Speed'),
- unit: _('KiB/s'),
- },
- }),
- },
- '-',
- {
- id: 'statusbar-traffic',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-traffic',
- tooltip: _('Protocol Traffic Download/Upload'),
- handler: function () {
- deluge.preferences.show();
- deluge.preferences.selectPage('Network');
- },
- },
- '-',
- {
- id: 'statusbar-externalip',
- text: ' ',
- cls: 'x-btn-text',
- tooltip: _('External IP Address'),
- },
- '-',
- {
- id: 'statusbar-dht',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-dht',
- tooltip: _('DHT Nodes'),
- },
- '-',
- {
- id: 'statusbar-freespace',
- text: ' ',
- cls: 'x-btn-text-icon',
- iconCls: 'x-deluge-freespace',
- tooltip: _('Freespace in download folder'),
- handler: function () {
- deluge.preferences.show();
- deluge.preferences.selectPage('Downloads');
- },
- }
- );
- this.created = true;
- },
-
- onConnect: function () {
- this.setStatus({
- iconCls: 'x-connected',
- text: '',
- });
- if (!this.created) {
- this.createButtons();
- } else {
- Ext.each(this.buttons, function (item) {
- item.show();
- item.enable();
- });
- }
- this.doLayout();
- },
-
- onDisconnect: function () {
- this.clearStatus({ useDefaults: true });
- Ext.each(this.buttons, function (item) {
- item.hide();
- item.disable();
- });
- this.doLayout();
- },
-
- update: function (stats) {
- if (!stats) return;
-
- function addSpeed(val) {
- return val + ' KiB/s';
- }
-
- var updateStat = function (name, config) {
- var item = this.items.get('statusbar-' + name);
- if (config.limit.value > 0) {
- var value = config.value.formatter
- ? config.value.formatter(config.value.value, true)
- : config.value.value;
- var limit = config.limit.formatter
- ? config.limit.formatter(config.limit.value, true)
- : config.limit.value;
- var str = String.format(config.format, value, limit);
- } else {
- var str = config.value.formatter
- ? config.value.formatter(config.value.value, true)
- : config.value.value;
- }
- item.setText(str);
-
- if (!item.menu) return;
- item.menu.setValue(config.limit.value);
- }.createDelegate(this);
-
- updateStat('connections', {
- value: { value: stats.num_connections },
- limit: { value: stats.max_num_connections },
- format: '{0} ({1})',
- });
-
- updateStat('downspeed', {
- value: {
- value: stats.download_rate,
- formatter: Deluge.Formatters.speed,
- },
- limit: {
- value: stats.max_download,
- formatter: addSpeed,
- },
- format: '{0} ({1})',
- });
-
- updateStat('upspeed', {
- value: {
- value: stats.upload_rate,
- formatter: Deluge.Formatters.speed,
- },
- limit: {
- value: stats.max_upload,
- formatter: addSpeed,
- },
- format: '{0} ({1})',
- });
-
- updateStat('traffic', {
- value: {
- value: stats.download_protocol_rate,
- formatter: Deluge.Formatters.speed,
- },
- limit: {
- value: stats.upload_protocol_rate,
- formatter: Deluge.Formatters.speed,
- },
- format: '{0}/{1}',
- });
-
- this.items.get('statusbar-dht').setText(stats.dht_nodes);
- this.items
- .get('statusbar-freespace')
- .setText(
- stats.free_space >= 0 ? fsize(stats.free_space) : _('Error')
- );
- this.items
- .get('statusbar-externalip')
- .setText(
- String.format(
- _('<b>IP</b> {0}'),
- stats.external_ip ? stats.external_ip : _('n/a')
- )
- );
- },
-});
-/**
- * Deluge.Toolbar.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * An extension of the <tt>Ext.Toolbar</tt> class that provides an extensible toolbar for Deluge.
- * @class Deluge.Toolbar
- * @extends Ext.Toolbar
- */
-Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
- constructor: function (config) {
- config = Ext.apply(
- {
- items: [
- {
- id: 'tbar-deluge-text',
- text: _('Deluge'),
- iconCls: 'x-deluge-main-panel',
- handler: this.onAboutClick,
- },
- new Ext.Toolbar.Separator(),
- {
- id: 'create',
- disabled: true,
- hidden: true,
- text: _('Create'),
- iconCls: 'icon-create',
- handler: this.onTorrentAction,
- },
- {
- id: 'add',
- disabled: true,
- text: _('Add'),
- iconCls: 'icon-add',
- handler: this.onTorrentAdd,
- },
- {
- id: 'remove',
- disabled: true,
- text: _('Remove'),
- iconCls: 'icon-remove',
- handler: this.onTorrentAction,
- },
- new Ext.Toolbar.Separator(),
- {
- id: 'pause',
- disabled: true,
- text: _('Pause'),
- iconCls: 'icon-pause',
- handler: this.onTorrentAction,
- },
- {
- id: 'resume',
- disabled: true,
- text: _('Resume'),
- iconCls: 'icon-resume',
- handler: this.onTorrentAction,
- },
- new Ext.Toolbar.Separator(),
- {
- id: 'up',
- cls: 'x-btn-text-icon',
- disabled: true,
- text: _('Up'),
- iconCls: 'icon-up',
- handler: this.onTorrentAction,
- },
- {
- id: 'down',
- disabled: true,
- text: _('Down'),
- iconCls: 'icon-down',
- handler: this.onTorrentAction,
- },
- new Ext.Toolbar.Separator(),
- {
- id: 'preferences',
- text: _('Preferences'),
- iconCls: 'x-deluge-preferences',
- handler: this.onPreferencesClick,
- scope: this,
- },
- {
- id: 'connectionman',
- text: _('Connection Manager'),
- iconCls: 'x-deluge-connection-manager',
- handler: this.onConnectionManagerClick,
- scope: this,
- },
- '->',
- {
- id: 'help',
- iconCls: 'icon-help',
- text: _('Help'),
- handler: this.onHelpClick,
- scope: this,
- },
- {
- id: 'logout',
- iconCls: 'icon-logout',
- disabled: true,
- text: _('Logout'),
- handler: this.onLogout,
- scope: this,
- },
- ],
- },
- config
- );
- Deluge.Toolbar.superclass.constructor.call(this, config);
- },
-
- connectedButtons: ['add', 'remove', 'pause', 'resume', 'up', 'down'],
-
- initComponent: function () {
- Deluge.Toolbar.superclass.initComponent.call(this);
- deluge.events.on('connect', this.onConnect, this);
- deluge.events.on('login', this.onLogin, this);
- },
-
- onConnect: function () {
- Ext.each(
- this.connectedButtons,
- function (buttonId) {
- this.items.get(buttonId).enable();
- },
- this
- );
- },
-
- onDisconnect: function () {
- Ext.each(
- this.connectedButtons,
- function (buttonId) {
- this.items.get(buttonId).disable();
- },
- this
- );
- },
-
- onLogin: function () {
- this.items.get('logout').enable();
- },
-
- onLogout: function () {
- this.items.get('logout').disable();
- deluge.login.logout();
- },
-
- onConnectionManagerClick: function () {
- deluge.connectionManager.show();
- },
-
- onHelpClick: function () {
- window.open('http://dev.deluge-torrent.org/wiki/UserGuide');
- },
-
- onAboutClick: function () {
- var about = new Deluge.about.AboutWindow();
- about.show();
- },
-
- onPreferencesClick: function () {
- deluge.preferences.show();
- },
-
- onTorrentAction: function (item) {
- var selection = deluge.torrents.getSelections();
- var ids = [];
- Ext.each(selection, function (record) {
- ids.push(record.id);
- });
-
- switch (item.id) {
- case 'remove':
- deluge.removeWindow.show(ids);
- break;
- case 'pause':
- case 'resume':
- deluge.client.core[item.id + '_torrent'](ids, {
- success: function () {
- deluge.ui.update();
- },
- });
- break;
- case 'up':
- case 'down':
- deluge.client.core['queue_' + item.id](ids, {
- success: function () {
- deluge.ui.update();
- },
- });
- break;
- }
- },
-
- onTorrentAdd: function () {
- deluge.add.show();
- },
-});
-/**
- * Deluge.TorrentGrid.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-(function () {
- /* Renderers for the Torrent Grid */
- function queueRenderer(value) {
- return value == -1 ? '' : value + 1;
- }
- function torrentNameRenderer(value, p, r) {
- return String.format(
- '<div class="torrent-name x-deluge-{0}">{1}</div>',
- r.data['state'].toLowerCase(),
- Ext.util.Format.htmlEncode(value)
- );
- }
- function torrentSpeedRenderer(value) {
- if (!value) return;
- return fspeed(value);
- }
- function torrentLimitRenderer(value) {
- if (value == -1) return '';
- return fspeed(value * 1024.0);
- }
- function torrentProgressRenderer(value, p, r) {
- value = new Number(value);
- var progress = value;
- var text = _(r.data['state']) + ' ' + value.toFixed(2) + '%';
- if (this.style) {
- var style = this.style;
- } else {
- var style = p.style;
- }
- var width = new Number(style.match(/\w+:\s*(\d+)\w+/)[1]);
- return Deluge.progressBar(value, width - 8, text);
- }
- function seedsRenderer(value, p, r) {
- if (r.data['total_seeds'] > -1) {
- return String.format('{0} ({1})', value, r.data['total_seeds']);
- } else {
- return value;
- }
- }
- function peersRenderer(value, p, r) {
- if (r.data['total_peers'] > -1) {
- return String.format('{0} ({1})', value, r.data['total_peers']);
- } else {
- return value;
- }
- }
- function availRenderer(value, p, r) {
- return value < 0 ? '&infin;' : parseFloat(new Number(value).toFixed(3));
- }
- function trackerRenderer(value, p, r) {
- return String.format(
- '<div style="background: url(' +
- deluge.config.base +
- 'tracker/{0}) no-repeat; padding-left: 20px;">{0}</div>',
- Ext.util.Format.htmlEncode(value)
- );
- }
-
- function etaSorter(eta) {
- if (eta === 0) return Number.MAX_VALUE;
- if (eta <= -1) return Number.MAX_SAFE_INTEGER;
- return eta;
- }
-
- function dateOrNever(date) {
- return date > 0.0 ? fdate(date) : _('Never');
- }
-
- function timeOrInf(time) {
- if (time === 0) return '';
- if (time <= -1) return '&infin;';
- return ftime(time);
- }
-
- /**
- * Deluge.TorrentGrid Class
- *
- * @author Damien Churchill <damoxc@gmail.com>
- * @version 1.3
- *
- * @class Deluge.TorrentGrid
- * @extends Ext.grid.GridPanel
- * @constructor
- * @param {Object} config Configuration options
- */
- Deluge.TorrentGrid = Ext.extend(Ext.grid.GridPanel, {
- // object to store contained torrent ids
- torrents: {},
-
- columns: [
- {
- id: 'queue',
- header: '#',
- width: 30,
- sortable: true,
- renderer: queueRenderer,
- dataIndex: 'queue',
- },
- {
- id: 'name',
- header: _('Name'),
- width: 150,
- sortable: true,
- renderer: torrentNameRenderer,
- dataIndex: 'name',
- },
- {
- header: _('Size'),
- width: 75,
- sortable: true,
- renderer: fsize,
- dataIndex: 'total_wanted',
- },
- {
- header: _('Progress'),
- width: 150,
- sortable: true,
- renderer: torrentProgressRenderer,
- dataIndex: 'progress',
- },
- {
- header: _('Seeds'),
- hidden: true,
- width: 60,
- sortable: true,
- renderer: seedsRenderer,
- dataIndex: 'num_seeds',
- },
- {
- header: _('Peers'),
- hidden: true,
- width: 60,
- sortable: true,
- renderer: peersRenderer,
- dataIndex: 'num_peers',
- },
- {
- header: _('Down Speed'),
- width: 80,
- sortable: true,
- renderer: torrentSpeedRenderer,
- dataIndex: 'download_payload_rate',
- },
- {
- header: _('Up Speed'),
- width: 80,
- sortable: true,
- renderer: torrentSpeedRenderer,
- dataIndex: 'upload_payload_rate',
- },
- {
- header: _('ETA'),
- width: 60,
- sortable: true,
- renderer: timeOrInf,
- dataIndex: 'eta',
- },
- {
- header: _('Ratio'),
- hidden: true,
- width: 60,
- sortable: true,
- renderer: availRenderer,
- dataIndex: 'ratio',
- },
- {
- header: _('Avail'),
- hidden: true,
- width: 60,
- sortable: true,
- renderer: availRenderer,
- dataIndex: 'distributed_copies',
- },
- {
- header: _('Added'),
- hidden: true,
- width: 80,
- sortable: true,
- renderer: fdate,
- dataIndex: 'time_added',
- },
- {
- header: _('Complete Seen'),
- hidden: true,
- width: 80,
- sortable: true,
- renderer: dateOrNever,
- dataIndex: 'last_seen_complete',
- },
- {
- header: _('Completed'),
- hidden: true,
- width: 80,
- sortable: true,
- renderer: dateOrNever,
- dataIndex: 'completed_time',
- },
- {
- header: _('Tracker'),
- hidden: true,
- width: 120,
- sortable: true,
- renderer: trackerRenderer,
- dataIndex: 'tracker_host',
- },
- {
- header: _('Download Folder'),
- hidden: true,
- width: 120,
- sortable: true,
- renderer: fplain,
- dataIndex: 'download_location',
- },
- {
- header: _('Owner'),
- width: 80,
- sortable: true,
- renderer: fplain,
- dataIndex: 'owner',
- },
- {
- header: _('Public'),
- hidden: true,
- width: 80,
- sortable: true,
- renderer: fplain,
- dataIndex: 'public',
- },
- {
- header: _('Shared'),
- hidden: true,
- width: 80,
- sortable: true,
- renderer: fplain,
- dataIndex: 'shared',
- },
- {
- header: _('Downloaded'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: fsize,
- dataIndex: 'total_done',
- },
- {
- header: _('Uploaded'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: fsize,
- dataIndex: 'total_uploaded',
- },
- {
- header: _('Remaining'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: fsize,
- dataIndex: 'total_remaining',
- },
- {
- header: _('Down Limit'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: torrentLimitRenderer,
- dataIndex: 'max_download_speed',
- },
- {
- header: _('Up Limit'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: torrentLimitRenderer,
- dataIndex: 'max_upload_speed',
- },
- {
- header: _('Seeds:Peers'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: availRenderer,
- dataIndex: 'seeds_peers_ratio',
- },
- {
- header: _('Last Transfer'),
- hidden: true,
- width: 75,
- sortable: true,
- renderer: ftime,
- dataIndex: 'time_since_transfer',
- },
- ],
-
- meta: {
- root: 'torrents',
- idProperty: 'id',
- fields: [
- {
- name: 'queue',
- sortType: Deluge.data.SortTypes.asQueuePosition,
- },
- { name: 'name', sortType: Deluge.data.SortTypes.asName },
- { name: 'total_wanted', type: 'int' },
- { name: 'state' },
- { name: 'progress', type: 'float' },
- { name: 'num_seeds', type: 'int' },
- { name: 'total_seeds', type: 'int' },
- { name: 'num_peers', type: 'int' },
- { name: 'total_peers', type: 'int' },
- { name: 'download_payload_rate', type: 'int' },
- { name: 'upload_payload_rate', type: 'int' },
- { name: 'eta', type: 'int', sortType: etaSorter },
- { name: 'ratio', type: 'float' },
- { name: 'distributed_copies', type: 'float' },
- { name: 'time_added', type: 'int' },
- { name: 'last_seen_complete', type: 'int' },
- { name: 'completed_time', type: 'int' },
- { name: 'tracker_host' },
- { name: 'download_location' },
- { name: 'total_done', type: 'int' },
- { name: 'total_uploaded', type: 'int' },
- { name: 'total_remaining', type: 'int' },
- { name: 'max_download_speed', type: 'int' },
- { name: 'max_upload_speed', type: 'int' },
- { name: 'seeds_peers_ratio', type: 'float' },
- { name: 'time_since_transfer', type: 'int' },
- ],
- },
-
- keys: [
- {
- key: 'a',
- ctrl: true,
- stopEvent: true,
- handler: function () {
- deluge.torrents.getSelectionModel().selectAll();
- },
- },
- {
- key: [46],
- stopEvent: true,
- handler: function () {
- ids = deluge.torrents.getSelectedIds();
- deluge.removeWindow.show(ids);
- },
- },
- ],
-
- constructor: function (config) {
- config = Ext.apply(
- {
- id: 'torrentGrid',
- store: new Ext.data.JsonStore(this.meta),
- columns: this.columns,
- keys: this.keys,
- region: 'center',
- cls: 'deluge-torrents',
- stripeRows: true,
- autoExpandColumn: 'name',
- autoExpandMin: 150,
- deferredRender: false,
- autoScroll: true,
- stateful: true,
- view: new Ext.ux.grid.BufferView({
- rowHeight: 26,
- scrollDelay: false,
- }),
- },
- config
- );
- Deluge.TorrentGrid.superclass.constructor.call(this, config);
- },
-
- initComponent: function () {
- Deluge.TorrentGrid.superclass.initComponent.call(this);
- deluge.events.on('torrentsRemoved', this.onTorrentsRemoved, this);
- deluge.events.on('disconnect', this.onDisconnect, this);
-
- this.on('rowcontextmenu', function (grid, rowIndex, e) {
- e.stopEvent();
- var selection = grid.getSelectionModel();
- if (!selection.isSelected(rowIndex)) {
- selection.selectRow(rowIndex);
- }
- deluge.menus.torrent.showAt(e.getPoint());
- });
- },
-
- /**
- * Returns the record representing the torrent at the specified index.
- *
- * @param index {int} The row index of the torrent you wish to retrieve.
- * @return {Ext.data.Record} The record representing the torrent.
- */
- getTorrent: function (index) {
- return this.getStore().getAt(index);
- },
-
- /**
- * Returns the currently selected record.
- * @ return {Array/Ext.data.Record} The record(s) representing the rows
- */
- getSelected: function () {
- return this.getSelectionModel().getSelected();
- },
-
- /**
- * Returns the currently selected records.
- */
- getSelections: function () {
- return this.getSelectionModel().getSelections();
- },
-
- /**
- * Return the currently selected torrent id.
- * @return {String} The currently selected id.
- */
- getSelectedId: function () {
- return this.getSelectionModel().getSelected().id;
- },
-
- /**
- * Return the currently selected torrent ids.
- * @return {Array} The currently selected ids.
- */
- getSelectedIds: function () {
- var ids = [];
- Ext.each(this.getSelectionModel().getSelections(), function (r) {
- ids.push(r.id);
- });
- return ids;
- },
-
- update: function (torrents, wipe) {
- var store = this.getStore();
-
- // Need to perform a complete reload of the torrent grid.
- if (wipe) {
- store.removeAll();
- this.torrents = {};
- }
-
- var newTorrents = [];
-
- // Update and add any new torrents.
- for (var t in torrents) {
- var torrent = torrents[t];
-
- if (this.torrents[t]) {
- var record = store.getById(t);
- record.beginEdit();
- for (var k in torrent) {
- if (record.get(k) != torrent[k]) {
- record.set(k, torrent[k]);
- }
- }
- record.endEdit();
- } else {
- var record = new Deluge.data.Torrent(torrent);
- record.id = t;
- this.torrents[t] = 1;
- newTorrents.push(record);
- }
- }
- store.add(newTorrents);
-
- // Remove any torrents that should not be in the store.
- store.each(function (record) {
- if (!torrents[record.id]) {
- store.remove(record);
- delete this.torrents[record.id];
- }
- }, this);
- store.commitChanges();
-
- var sortState = store.getSortState();
- if (!sortState) return;
- store.sort(sortState.field, sortState.direction);
- },
-
- // private
- onDisconnect: function () {
- this.getStore().removeAll();
- this.torrents = {};
- },
-
- // private
- onTorrentsRemoved: function (torrentIds) {
- var selModel = this.getSelectionModel();
- Ext.each(
- torrentIds,
- function (torrentId) {
- var record = this.getStore().getById(torrentId);
- if (selModel.isSelected(record)) {
- selModel.deselectRow(this.getStore().indexOf(record));
- }
- this.getStore().remove(record);
- delete this.torrents[torrentId];
- },
- this
- );
- },
- });
- deluge.torrents = new Deluge.TorrentGrid();
-})();
-/**
- * Deluge.UI.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/** Dummy translation arrays so Torrent states are available for gettext.js and Translators.
- *
- * All entries in deluge.common.TORRENT_STATE should be added here.
- *
- * No need to import these, just simply use the `_()` function around a status variable.
- */
-var TORRENT_STATE_TRANSLATION = [
- _('All'),
- _('Active'),
- _('Allocating'),
- _('Checking'),
- _('Downloading'),
- _('Seeding'),
- _('Paused'),
- _('Checking'),
- _('Queued'),
- _('Error'),
-];
-
-/**
- * @static
- * @class Deluge.UI
- * The controller for the whole interface, that ties all the components
- * together and handles the 2 second poll.
- */
-deluge.ui = {
- errorCount: 0,
-
- filters: null,
-
- /**
- * @description Create all the interface components, the json-rpc client
- * and set up various events that the UI will utilise.
- */
- initialize: function () {
- deluge.add = new Deluge.add.AddWindow();
- deluge.details = new Deluge.details.DetailsPanel();
- deluge.connectionManager = new Deluge.ConnectionManager();
- deluge.editTrackers = new Deluge.EditTrackersWindow();
- deluge.login = new Deluge.LoginWindow();
- deluge.preferences = new Deluge.preferences.PreferencesWindow();
- deluge.sidebar = new Deluge.Sidebar();
- deluge.statusbar = new Deluge.Statusbar();
- deluge.toolbar = new Deluge.Toolbar();
-
- this.detailsPanel = new Ext.Panel({
- id: 'detailsPanel',
- cls: 'detailsPanel',
- region: 'south',
- split: true,
- height: 215,
- minSize: 100,
- collapsible: true,
- layout: 'fit',
- items: [deluge.details],
- });
-
- this.MainPanel = new Ext.Panel({
- id: 'mainPanel',
- iconCls: 'x-deluge-main-panel',
- layout: 'border',
- border: false,
- tbar: deluge.toolbar,
- items: [deluge.sidebar, this.detailsPanel, deluge.torrents],
- bbar: deluge.statusbar,
- });
-
- this.Viewport = new Ext.Viewport({
- layout: 'fit',
- items: [this.MainPanel],
- });
-
- deluge.events.on('connect', this.onConnect, this);
- deluge.events.on('disconnect', this.onDisconnect, this);
- deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this);
- deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this);
- deluge.client = new Ext.ux.util.RpcClient({
- url: deluge.config.base + 'json',
- });
-
- // enable all the already active plugins
- for (var plugin in Deluge.pluginStore) {
- plugin = Deluge.createPlugin(plugin);
- plugin.enable();
- deluge.plugins[plugin.name] = plugin;
- }
-
- // Initialize quicktips so all the tooltip configs start working.
- Ext.QuickTips.init();
-
- deluge.client.on(
- 'connected',
- function (e) {
- deluge.login.show();
- },
- this,
- { single: true }
- );
-
- this.update = this.update.createDelegate(this);
- this.checkConnection = this.checkConnection.createDelegate(this);
-
- this.originalTitle = document.title;
- },
-
- checkConnection: function () {
- deluge.client.web.connected({
- success: this.onConnectionSuccess,
- failure: this.onConnectionError,
- scope: this,
- });
- },
-
- update: function () {
- var filters = deluge.sidebar.getFilterStates();
- this.oldFilters = this.filters;
- this.filters = filters;
-
- deluge.client.web.update_ui(Deluge.Keys.Grid, filters, {
- success: this.onUpdate,
- failure: this.onUpdateError,
- scope: this,
- });
- deluge.details.update();
- },
-
- onConnectionError: function (error) {},
-
- onConnectionSuccess: function (result) {
- deluge.statusbar.setStatus({
- iconCls: 'x-deluge-statusbar icon-ok',
- text: _('Connection restored'),
- });
- clearInterval(this.checking);
- if (!result) {
- deluge.connectionManager.show();
- }
- },
-
- onUpdateError: function (error) {
- if (this.errorCount == 2) {
- Ext.MessageBox.show({
- title: _('Lost Connection'),
- msg: _('The connection to the webserver has been lost!'),
- buttons: Ext.MessageBox.OK,
- icon: Ext.MessageBox.ERROR,
- });
- deluge.events.fire('disconnect');
- deluge.statusbar.setStatus({
- text: _('Lost connection to webserver'),
- });
- this.checking = setInterval(this.checkConnection, 2000);
- }
- this.errorCount++;
- },
-
- /**
- * @static
- * @private
- * Updates the various components in the interface.
- */
- onUpdate: function (data) {
- if (!data['connected']) {
- deluge.connectionManager.disconnect(true);
- return;
- }
-
- if (deluge.config.show_session_speed) {
- document.title =
- 'D: ' +
- fsize_short(data['stats'].download_rate, true) +
- ' U: ' +
- fsize_short(data['stats'].upload_rate, true) +
- ' - ' +
- this.originalTitle;
- }
- if (Ext.areObjectsEqual(this.filters, this.oldFilters)) {
- deluge.torrents.update(data['torrents']);
- } else {
- deluge.torrents.update(data['torrents'], true);
- }
- deluge.statusbar.update(data['stats']);
- deluge.sidebar.update(data['filters']);
- this.errorCount = 0;
- },
-
- /**
- * @static
- * @private
- * Start the Deluge UI polling the server and update the interface.
- */
- onConnect: function () {
- if (!this.running) {
- this.running = setInterval(this.update, 2000);
- this.update();
- }
- deluge.client.web.get_plugins({
- success: this.onGotPlugins,
- scope: this,
- });
- },
-
- /**
- * @static
- * @private
- */
- onDisconnect: function () {
- this.stop();
- },
-
- onGotPlugins: function (plugins) {
- Ext.each(
- plugins.enabled_plugins,
- function (plugin) {
- if (deluge.plugins[plugin]) return;
- deluge.client.web.get_plugin_resources(plugin, {
- success: this.onGotPluginResources,
- scope: this,
- });
- },
- this
- );
- },
-
- onPluginEnabled: function (pluginName) {
- if (deluge.plugins[pluginName]) {
- deluge.plugins[pluginName].enable();
- } else {
- deluge.client.web.get_plugin_resources(pluginName, {
- success: this.onGotPluginResources,
- scope: this,
- });
- }
- },
-
- onGotPluginResources: function (resources) {
- var scripts = Deluge.debug
- ? resources.debug_scripts
- : resources.scripts;
- Ext.each(
- scripts,
- function (script) {
- Ext.ux.JSLoader({
- url: deluge.config.base + script,
- onLoad: this.onPluginLoaded,
- pluginName: resources.name,
- });
- },
- this
- );
- },
-
- onPluginDisabled: function (pluginName) {
- if (deluge.plugins[pluginName]) deluge.plugins[pluginName].disable();
- },
-
- onPluginLoaded: function (options) {
- // This could happen if the plugin has multiple scripts
- if (!Deluge.hasPlugin(options.pluginName)) return;
-
- // Enable the plugin
- plugin = Deluge.createPlugin(options.pluginName);
- plugin.enable();
- deluge.plugins[plugin.name] = plugin;
- },
-
- /**
- * @static
- * Stop the Deluge UI polling the server and clear the interface.
- */
- stop: function () {
- if (this.running) {
- clearInterval(this.running);
- this.running = false;
- deluge.torrents.getStore().removeAll();
- }
- },
-};
-
-Ext.onReady(function (e) {
- deluge.ui.initialize();
-});
diff --git a/deluge/ui/web/js/deluge-all.js b/deluge/ui/web/js/deluge-all.js
deleted file mode 100644
index f9fd796..0000000
--- a/deluge/ui/web/js/deluge-all.js
+++ /dev/null
@@ -1,291 +0,0 @@
-Ext.ns("Deluge.add");Deluge.add.Window=Ext.extend(Ext.Window,{initComponent:function(){Deluge.add.Window.superclass.initComponent.call(this);this.addEvents("beforeadd","add","addfailed")},createTorrentId:function(){return(new Date).getTime().toString()}});Ext.namespace("Deluge.add");
-Ext.override(Ext.ux.form.FileUploadField,{onRender:function(a,b){Ext.ux.form.FileUploadField.superclass.onRender.call(this,a,b);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.createFileInput();var c=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(c,{renderTo:this.wrap,cls:"x-form-file-btn"+(c.iconCls?" x-btn-text-icon":"")}));this.buttonOnly&&(this.el.hide(),
-this.wrap.setWidth(this.button.getEl().getWidth()));this.bindListeners();this.resizeEl=this.positionEl=this.wrap}});
-Deluge.add.AddWindow=Ext.extend(Deluge.add.Window,{title:_("Add Torrents"),layout:"border",width:470,height:450,bodyStyle:"padding: 10px 5px;",buttonAlign:"right",closeAction:"hide",closable:!0,plain:!0,iconCls:"x-deluge-add-window-icon",initComponent:function(){Deluge.add.AddWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("Add"),this.onAddClick,this);this.list=new Ext.list.ListView({store:new Ext.data.SimpleStore({fields:[{name:"info_hash",
-mapping:1},{name:"text",mapping:2}],id:0}),columns:[{id:"torrent",width:150,sortable:!0,dataIndex:"text",tpl:new Ext.XTemplate('<div class="x-deluge-add-torrent-name">{text:htmlEncode}</div>')}],stripeRows:!0,singleSelect:!0,listeners:{selectionchange:{fn:this.onSelect,scope:this}},hideHeaders:!0,autoExpandColumn:"torrent",height:"100%",autoScroll:!0});this.add({region:"center",items:[this.list],border:!1,bbar:new Ext.Toolbar({items:[{id:"fileUploadForm",xtype:"form",layout:"fit",baseCls:"x-plain",
-fileUpload:!0,items:[{buttonOnly:!0,xtype:"fileuploadfield",id:"torrentFile",name:"file",multiple:!0,buttonCfg:{iconCls:"x-deluge-add-file",text:_("File")},listeners:{scope:this,fileselected:this.onFileSelected}}]},{text:_("Url"),iconCls:"icon-add-url",handler:this.onUrl,scope:this},{text:_("Infohash"),iconCls:"icon-magnet-add",hidden:!0,disabled:!0},"->",{text:_("Remove"),iconCls:"icon-remove",handler:this.onRemove,scope:this}]})});this.fileUploadForm=Ext.getCmp("fileUploadForm").getForm();this.optionsPanel=
-this.add(new Deluge.add.OptionsPanel);this.on("hide",this.onHide,this);this.on("show",this.onShow,this)},clear:function(){this.list.getStore().removeAll();this.optionsPanel.clear();this.fileUploadForm.reset()},onAddClick:function(){var a=[];this.list&&(this.list.getStore().each(function(b){b=b.get("info_hash");a.push({path:this.optionsPanel.getFilename(b),options:this.optionsPanel.getOptions(b)})},this),deluge.client.web.add_torrents(a,{success:function(a){}}),this.clear(),this.hide())},onCancelClick:function(){this.clear();
-this.hide()},onFile:function(){this.file||(this.file=new Deluge.add.FileWindow);this.file.show()},onHide:function(){this.optionsPanel.setActiveTab(0);this.optionsPanel.files.setDisabled(!0);this.optionsPanel.form.setDisabled(!0)},onRemove:function(){if(this.list.getSelectionCount()){var a=this.list.getSelectedRecords()[0];a&&(this.list.getStore().remove(a),this.optionsPanel.clear(),this.torrents&&this.torrents[a.id]&&delete this.torrents[a.id])}},onSelect:function(a,b){if(b.length){var c=this.list.getRecord(b[0]);
-this.optionsPanel.setTorrent(c.get("info_hash"))}else this.optionsPanel.files.setDisabled(!0),this.optionsPanel.form.setDisabled(!0)},onShow:function(){this.url||(this.url=new Deluge.add.UrlWindow,this.url.on("beforeadd",this.onTorrentBeforeAdd,this),this.url.on("add",this.onTorrentAdd,this),this.url.on("addfailed",this.onTorrentAddFailed,this));this.optionsPanel.form.getDefaults()},onFileSelected:function(){if(this.fileUploadForm.isValid()){var a=[],b=this.fileUploadForm.findField("torrentFile").value,
-c=this.createTorrentId();Array.prototype.forEach.call(b,function(b,f){var g=c+f.toString();a.push(g);this.onTorrentBeforeAdd(g,b.name)}.bind(this));this.fileUploadForm.submit({url:deluge.config.base+"upload",waitMsg:_("Uploading your torrent..."),success:this.onUploadSuccess,failure:this.onUploadFailure,scope:this,torrentIds:a})}},onUploadSuccess:function(a,b){b.result.success?(b.result.files.forEach(function(a,d){deluge.client.web.get_torrent_info(a,{success:this.onGotInfo,scope:this,filename:a,
-torrentId:b.options.torrentIds[d]})}.bind(this)),this.fileUploadForm.reset()):this.clear()},onUploadFailure:function(a,b){this.hide();Ext.MessageBox.show({title:_("Error"),msg:_("Failed to upload torrent"),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});this.fireEvent("addfailed",this.torrentId)},onGotInfo:function(a,b,c,d){a.filename=d.options.filename;torrentId=d.options.torrentId;this.onTorrentAdd(torrentId,a)},onTorrentBeforeAdd:function(a,b){this.list.getStore().loadData([[a,
-null,b]],!0)},onTorrentAdd:function(a,b){var c=this.list.getStore().getById(a);b?(c.set("info_hash",b.info_hash),c.set("text",b.name),this.list.getStore().commitChanges(),this.optionsPanel.addTorrent(b),this.list.select(c)):(Ext.MessageBox.show({title:_("Error"),msg:_("Not a valid torrent"),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"}),this.list.getStore().remove(c))},onTorrentAddFailed:function(a){var b=this.list.getStore();(a=b.getById(a))&&b.remove(a)},
-onUrl:function(a,b){this.url.show()}});Ext.ns("Deluge.add");
-Deluge.add.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{layout:"fit",title:_("Files"),autoScroll:!1,animate:!1,border:!1,disabled:!0,rootVisible:!1,columns:[{header:_("Filename"),width:295,dataIndex:"filename",tpl:new Ext.XTemplate("{filename:htmlEncode}")},{header:_("Size"),width:60,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{header:_("Download"),width:65,dataIndex:"download",tpl:new Ext.XTemplate("{download:this.format}",{format:function(a){return'<div rel="chkbox" class="x-grid3-check-col'+
-(a?"-on":"")+'"> </div>'}})}],initComponent:function(){Deluge.add.FilesTab.superclass.initComponent.call(this);this.on("click",this.onNodeClick,this)},clearFiles:function(){var a=this.getRootNode();a.hasChildNodes()&&a.cascade(function(a){a.parentNode&&a.getOwnerTree()&&a.remove()})},setDownload:function(a,b,c){a.attributes.download=b;a.ui.updateColumns();if(a.isLeaf()){if(!c)return this.fireEvent("fileschecked",[a],b,!b)}else{var d=[a];a.cascade(function(a){a.attributes.download=b;a.ui.updateColumns();
-d.push(a)},this);if(!c)return this.fireEvent("fileschecked",d,b,!b)}},onNodeClick:function(a,b){"chkbox"==(new Ext.Element(b.target)).getAttribute("rel")&&this.setDownload(a,!a.attributes.download)}});Ext.namespace("Ext.deluge.add");Ext.ns("Deluge.add");
-Deluge.add.OptionsPanel=Ext.extend(Ext.TabPanel,{torrents:{},region:"south",border:!1,activeTab:0,height:265,initComponent:function(){Deluge.add.OptionsPanel.superclass.initComponent.call(this);this.files=this.add(new Deluge.add.FilesTab);this.form=this.add(new Deluge.add.OptionsTab);this.files.on("fileschecked",this.onFilesChecked,this)},addTorrent:function(a){this.torrents[a.info_hash]=a;var b={};this.walkFileTree(a.files_tree,function(a,c,g,e){"file"==c&&(b[g.index]=g.download)},this);var c=[];
-Ext.each(Ext.keys(b),function(a){c[a]=b[a]});a=this.form.optionsManager.changeId(a.info_hash,!0);this.form.optionsManager.setDefault("file_priorities",c);this.form.optionsManager.changeId(a,!0)},clear:function(){this.files.clearFiles();this.form.optionsManager.resetAll()},getFilename:function(a){return this.torrents[a].filename},getOptions:function(a){a=this.form.optionsManager.changeId(a,!0);var b=this.form.optionsManager.get();this.form.optionsManager.changeId(a,!0);Ext.each(b.file_priorities,function(a,
-d){b.file_priorities[d]=a?1:0});return b},setTorrent:function(a){if(a){this.torrentId=a;this.form.optionsManager.changeId(a);this.files.clearFiles();var b=this.files.getRootNode(),c=this.form.optionsManager.get("file_priorities");this.form.setDisabled(!1);this.torrents[a].files_tree?(this.walkFileTree(this.torrents[a].files_tree,function(a,b,g,e){a=new Ext.tree.TreeNode({download:g.index?c[g.index]:!0,filename:a,fileindex:g.index,leaf:"dir"!=b,size:g.length});e.appendChild(a);if("dir"==b)return a},
-this,b),b.firstChild.expand(),this.files.setDisabled(!1),this.files.show()):(this.form.show(),this.files.setDisabled(!0))}},walkFileTree:function(a,b,c,d){for(var f in a.contents){var g=a.contents[f],e=g.type,l=c?b.apply(c,[f,e,g,d]):b(f,e,g,d);"dir"==e&&this.walkFileTree(g,b,c,l)}},onFilesChecked:function(a,b,c){Ext.each(a,function(a){if(!(0>a.attributes.fileindex)){var c=this.form.optionsManager.get("file_priorities");c[a.attributes.fileindex]=b;this.form.optionsManager.update("file_priorities",
-c)}},this)}});Ext.ns("Deluge.add");
-Deluge.add.OptionsTab=Ext.extend(Ext.form.FormPanel,{title:_("Options"),height:170,border:!1,bodyStyle:"padding: 5px",disabled:!0,labelWidth:1,initComponent:function(){Deluge.add.OptionsTab.superclass.initComponent.call(this);this.optionsManager=new Deluge.MultiOptionsManager;var a=this.add({xtype:"fieldset",title:_("Download Folder"),border:!1,autoHeight:!0,defaultType:"textfield",labelWidth:1,fieldLabel:"",style:"padding: 5px 0; margin-bottom: 0;"});this.optionsManager.bind("download_location",a.add({fieldLabel:"",
-name:"download_location",anchor:"95%",labelSeparator:""}));a=this.add({xtype:"fieldset",title:_("Move Completed Folder"),border:!1,autoHeight:!0,defaultType:"togglefield",labelWidth:1,fieldLabel:"",style:"padding: 5px 0; margin-bottom: 0;"});a=a.add({fieldLabel:"",name:"move_completed_path",anchor:"98%"});this.optionsManager.bind("move_completed",a.toggle);this.optionsManager.bind("move_completed_path",a.input);var b=this.add({border:!1,layout:"column",defaultType:"fieldset"}),a=b.add({title:_("Bandwidth"),
-border:!1,autoHeight:!0,bodyStyle:"padding: 2px 5px",labelWidth:105,width:200,defaultType:"spinnerfield",style:"padding-right: 10px;"});this.optionsManager.bind("max_download_speed",a.add({fieldLabel:_("Max Down Speed"),name:"max_download_speed",width:60}));this.optionsManager.bind("max_upload_speed",a.add({fieldLabel:_("Max Up Speed"),name:"max_upload_speed",width:60}));this.optionsManager.bind("max_connections",a.add({fieldLabel:_("Max Connections"),name:"max_connections",width:60}));this.optionsManager.bind("max_upload_slots",
-a.add({fieldLabel:_("Max Upload Slots"),name:"max_upload_slots",width:60}));a=b.add({border:!1,autoHeight:!0,defaultType:"checkbox"});this.optionsManager.bind("add_paused",a.add({name:"add_paused",boxLabel:_("Add In Paused State"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("prioritize_first_last_pieces",a.add({name:"prioritize_first_last_pieces",boxLabel:_("Prioritize First/Last Pieces"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("sequential_download",a.add({name:"sequential_download",
-boxLabel:_("Sequential Download"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("seed_mode",a.add({name:"seed_mode",boxLabel:_("Skip File Hash Check"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("super_seeding",a.add({name:"super_seeding",boxLabel:_("Super Seed"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("pre_allocate_storage",a.add({name:"pre_allocate_storage",boxLabel:_("Preallocate Disk Space"),fieldLabel:"",labelSeparator:""}))},getDefaults:function(){deluge.client.core.get_config_values("add_paused pre_allocate_storage download_location max_connections_per_torrent max_download_speed_per_torrent move_completed move_completed_path max_upload_slots_per_torrent max_upload_speed_per_torrent prioritize_first_last_pieces sequential_download".split(" "),
-{success:function(a){this.optionsManager.options={file_priorities:[],add_paused:a.add_paused,sequential_download:a.sequential_download,pre_allocate_storage:a.pre_allocate_storage,download_location:a.download_location,move_completed:a.move_completed,move_completed_path:a.move_completed_path,max_connections:a.max_connections_per_torrent,max_download_speed:a.max_download_speed_per_torrent,max_upload_slots:a.max_upload_slots_per_torrent,max_upload_speed:a.max_upload_speed_per_torrent,prioritize_first_last_pieces:a.prioritize_first_last_pieces,
-seed_mode:!1,super_seeding:!1};this.optionsManager.resetAll()},scope:this})}});Ext.namespace("Deluge.add");
-Deluge.add.UrlWindow=Ext.extend(Deluge.add.Window,{title:_("Add from Url"),modal:!0,plain:!0,layout:"fit",width:350,height:155,buttonAlign:"center",closeAction:"hide",bodyStyle:"padding: 10px 5px;",iconCls:"x-deluge-add-url-window-icon",initComponent:function(){Deluge.add.UrlWindow.superclass.initComponent.call(this);this.addButton(_("Add"),this.onAddClick,this);var a=this.add({xtype:"form",defaultType:"textfield",baseCls:"x-plain",labelWidth:55});this.urlField=a.add({fieldLabel:_("Url"),id:"url",
-name:"url",width:"97%"});this.urlField.on("specialkey",this.onAdd,this);this.cookieField=a.add({fieldLabel:_("Cookies"),id:"cookies",name:"cookies",width:"97%"});this.cookieField.on("specialkey",this.onAdd,this)},onAddClick:function(a,b){if(!(("url"==a.id||"cookies"==a.id)&&b.getKey()!=b.ENTER)){a=this.urlField;var c=a.getValue(),d=this.cookieField.getValue(),f=this.createTorrentId();0==c.indexOf("magnet:?")&&-1<c.indexOf("xt=urn:btih")?deluge.client.web.get_magnet_info(c,{success:this.onGotInfo,
-scope:this,filename:c,torrentId:f}):deluge.client.web.download_torrent_from_url(c,d,{success:this.onDownload,failure:this.onDownloadFailed,scope:this,torrentId:f});this.hide();this.urlField.setValue("");this.fireEvent("beforeadd",f,c)}},onDownload:function(a,b,c,d){deluge.client.web.get_torrent_info(a,{success:this.onGotInfo,failure:this.onDownloadFailed,scope:this,filename:a,torrentId:d.options.torrentId})},onDownloadFailed:function(a,b,c){Ext.MessageBox.show({title:_("Error"),msg:_("Failed to download torrent"),
-buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});this.fireEvent("addfailed",c.options.torrentId)},onGotInfo:function(a,b,c,d){a.filename=d.options.filename;this.fireEvent("add",d.options.torrentId,a)}});Ext.namespace("Deluge.data");Deluge.data.SortTypes={asIPAddress:function(a){a=a.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);return 256*(256*(256*+a[1]+ +a[2])+ +a[3])+ +a[4]},asQueuePosition:function(a){return-1<a?a:Number.MAX_VALUE},asName:function(a){return String(a).toLowerCase()}};
-Ext.namespace("Deluge.data");Deluge.data.Peer=Ext.data.Record.create([{name:"country",type:"string"},{name:"ip",type:"string",sortType:Deluge.data.SortTypes.asIPAddress},{name:"client",type:"string"},{name:"progress",type:"float"},{name:"down_speed",type:"int"},{name:"up_speed",type:"int"},{name:"seed",type:"int"}]);Ext.namespace("Deluge.data");
-Deluge.data.Torrent=Ext.data.Record.create([{name:"queue",type:"int"},{name:"name",type:"string",sortType:Deluge.data.SortTypes.asName},{name:"total_wanted",type:"int"},{name:"state",type:"string"},{name:"progress",type:"int"},{name:"num_seeds",type:"int"},{name:"total_seeds",type:"int"},{name:"num_peers",type:"int"},{name:"total_peers",type:"int"},{name:"download_payload_rate",type:"int"},{name:"upload_payload_rate",type:"int"},{name:"eta",type:"int"},{name:"ratio",type:"float"},{name:"distributed_copies",
-type:"float"},{name:"time_added",type:"int"},{name:"tracker_host",type:"string"},{name:"save_path",type:"string"},{name:"total_done",type:"int"},{name:"total_uploaded",type:"int"},{name:"total_remaining",type:"int"},{name:"max_download_speed",type:"int"},{name:"max_upload_speed",type:"int"},{name:"seeds_peers_ratio",type:"float"},{name:"time_since_transfer",type:"int"}]);Ext.namespace("Deluge.details");
-Deluge.details.DetailsPanel=Ext.extend(Ext.TabPanel,{id:"torrentDetails",activeTab:0,initComponent:function(){Deluge.details.DetailsPanel.superclass.initComponent.call(this);this.add(new Deluge.details.StatusTab);this.add(new Deluge.details.DetailsTab);this.add(new Deluge.details.FilesTab);this.add(new Deluge.details.PeersTab);this.add(new Deluge.details.OptionsTab)},clear:function(){this.items.each(function(a){a.clear&&(a.clear.defer(100,a),a.disable())})},update:function(a){var b=deluge.torrents.getSelected();
-b?(this.items.each(function(a){a.disabled&&a.enable()}),a=a||this.getActiveTab(),a.update&&a.update(b.id)):this.clear()},onRender:function(a,b){Deluge.details.DetailsPanel.superclass.onRender.call(this,a,b);deluge.events.on("disconnect",this.clear,this);deluge.torrents.on("rowclick",this.onTorrentsClick,this);this.on("tabchange",this.onTabChange,this);deluge.torrents.getSelectionModel().on("selectionchange",function(a){a.hasSelection()||this.clear()},this)},onTabChange:function(a,b){this.update(b)},
-onTorrentsClick:function(a,b,c){this.update()}});
-Deluge.details.DetailsTab=Ext.extend(Ext.Panel,{title:_("Details"),fields:{},autoScroll:!0,queuedItems:{},oldData:{},initComponent:function(){Deluge.details.DetailsTab.superclass.initComponent.call(this);this.addItem("torrent_name",_("Name:"));this.addItem("hash",_("Hash:"));this.addItem("path",_("Download Folder:"));this.addItem("size",_("Total Size:"));this.addItem("files",_("Total Files:"));this.addItem("comment",_("Comment:"));this.addItem("status",_("Status:"));this.addItem("tracker",_("Tracker:"));
-this.addItem("creator",_("Created By:"))},onRender:function(a,b){Deluge.details.DetailsTab.superclass.onRender.call(this,a,b);this.body.setStyle("padding","10px");this.dl=Ext.DomHelper.append(this.body,{tag:"dl"},!0);for(var c in this.queuedItems)this.doAddItem(c,this.queuedItems[c])},addItem:function(a,b){this.rendered?this.doAddItem(a,b):this.queuedItems[a]=b},doAddItem:function(a,b){Ext.DomHelper.append(this.dl,{tag:"dt",cls:a,html:b});this.fields[a]=Ext.DomHelper.append(this.dl,{tag:"dd",cls:a,
-html:""},!0)},clear:function(){if(this.fields){for(var a in this.fields)this.fields[a].dom.innerHTML="";this.oldData={}}},update:function(a){deluge.client.web.get_torrent_status(a,Deluge.Keys.Details,{success:this.onRequestComplete,scope:this,torrentId:a})},onRequestComplete:function(a,b,c,d){a={torrent_name:a.name,hash:d.options.torrentId,path:a.download_location,size:fsize(a.total_size),files:a.num_files,status:a.message,tracker:a.tracker_host,comment:a.comment,creator:a.creator};for(var f in this.fields)Ext.isDefined(a[f])&&
-a[f]!=this.oldData[f]&&(this.fields[f].dom.innerHTML=Ext.util.Format.htmlEncode(a[f]));this.oldData=a}});
-Deluge.details.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{title:_("Files"),rootVisible:!1,columns:[{header:_("Filename"),width:330,dataIndex:"filename",tpl:new Ext.XTemplate("{filename:htmlEncode}")},{header:_("Size"),width:150,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{xtype:"tgrendercolumn",header:_("Progress"),width:150,dataIndex:"progress",renderer:function(a){a*=100;return Deluge.progressBar(a,this.col.width,a.toFixed(2)+"%",0)}},{header:_("Priority"),
-width:150,dataIndex:"priority",tpl:new Ext.XTemplate('<tpl if="!isNaN(priority)"><div class="{priority:this.getClass}">{priority:this.getName}</div></tpl>',{getClass:function(a){return FILE_PRIORITY_CSS[a]},getName:function(a){return _(FILE_PRIORITY[a])}})}],selModel:new Ext.tree.MultiSelectionModel,initComponent:function(){Deluge.details.FilesTab.superclass.initComponent.call(this);this.setRootNode(new Ext.tree.TreeNode({text:_("Files")}))},clear:function(){var a=this.getRootNode();a.hasChildNodes()&&
-a.cascade(function(a){var c=a.parentNode;c&&c.ownerTree&&c.removeChild(a)})},createFileTree:function(a){function b(a,c){for(var g in a.contents){var e=a.contents[g];"dir"==e.type?b(e,c.appendChild(new Ext.tree.TreeNode({text:g,filename:g,size:e.size,progress:e.progress,priority:e.priority}))):c.appendChild(new Ext.tree.TreeNode({text:g,filename:g,fileIndex:e.index,size:e.size,progress:e.progress,priority:e.priority,leaf:!0,iconCls:"x-deluge-file",uiProvider:Ext.ux.tree.TreeGridNodeUI}))}}var c=this.getRootNode();
-b(a,c);c.firstChild.expand()},update:function(a){this.torrentId!=a&&(this.clear(),this.torrentId=a);deluge.client.web.get_torrent_files(a,{success:this.onRequestComplete,scope:this,torrentId:a})},updateFileTree:function(a){function b(a,d){for(var f in a.contents){var g=a.contents[f],e=d.findChild("filename",f);e.attributes.size=g.size;e.attributes.progress=g.progress;e.attributes.priority=g.priority;e.ui.updateColumns();"dir"==g.type&&b(g,e)}}b(a,this.getRootNode())},onRender:function(a,b){Deluge.details.FilesTab.superclass.onRender.call(this,
-a,b);deluge.menus.filePriorities.on("itemclick",this.onItemClick,this);this.on("contextmenu",this.onContextMenu,this);this.sorter=new Ext.tree.TreeSorter(this,{folderSort:!0})},onContextMenu:function(a,b){b.stopEvent();var c=this.getSelectionModel();2>c.getSelectedNodes().length&&(c.clearSelections(),a.select());deluge.menus.filePriorities.showAt(b.getPoint())},onItemClick:function(a,b){switch(a.id){case "expandAll":this.expandAll();break;default:var c={};this.getRootNode().cascade(function(a){Ext.isEmpty(a.attributes.fileIndex)||
-(c[a.attributes.fileIndex]=a.attributes.priority)});var d=this.getSelectionModel().getSelectedNodes();Ext.each(d,function(b){b.isLeaf()?Ext.isEmpty(b.attributes.fileIndex)||(c[b.attributes.fileIndex]=a.filePriority):b.cascade(function(b){Ext.isEmpty(b.attributes.fileIndex)||(c[b.attributes.fileIndex]=a.filePriority)})});var f=Array(Ext.keys(c).length),g;for(g in c)f[g]=c[g];deluge.client.core.set_torrent_options([this.torrentId],{file_priorities:f},{success:function(){Ext.each(d,function(b){b.setColumnValue(3,
-a.filePriority)})},scope:this})}},onRequestComplete:function(a,b){this.getRootNode().hasChildNodes()?this.updateFileTree(a):this.createFileTree(a)}});
-Deluge.details.OptionsTab=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({autoScroll:!0,bodyStyle:"padding: 5px;",border:!1,cls:"x-deluge-options",defaults:{autoHeight:!0,labelWidth:1,defaultType:"checkbox"},deferredRender:!1,layout:"column",title:_("Options")},a);Deluge.details.OptionsTab.superclass.constructor.call(this,a)},initComponent:function(){Deluge.details.OptionsTab.superclass.initComponent.call(this);this.fieldsets={};this.fields={};this.optionsManager=new Deluge.MultiOptionsManager({options:{max_download_speed:-1,
-max_upload_speed:-1,max_connections:-1,max_upload_slots:-1,auto_managed:!1,stop_at_ratio:!1,stop_ratio:2,remove_at_ratio:!1,move_completed:!1,move_completed_path:"","private":!1,prioritize_first_last:!1,super_seeding:!1}});this.fieldsets.bandwidth=this.add({xtype:"fieldset",defaultType:"spinnerfield",bodyStyle:"padding: 5px",layout:"table",layoutConfig:{columns:3},labelWidth:150,style:"margin-left: 10px; margin-right: 5px; padding: 5px",title:_("Bandwidth"),width:250});this.fieldsets.bandwidth.add({xtype:"label",
-text:_("Max Download Speed:"),forId:"max_download_speed",cls:"x-deluge-options-label"});this.fields.max_download_speed=this.fieldsets.bandwidth.add({id:"max_download_speed",name:"max_download_speed",width:70,strategy:{xtype:"number",decimalPrecision:1,minValue:-1,maxValue:99999}});this.fieldsets.bandwidth.add({xtype:"label",text:_("KiB/s"),style:"margin-left: 10px"});this.fieldsets.bandwidth.add({xtype:"label",text:_("Max Upload Speed:"),forId:"max_upload_speed",cls:"x-deluge-options-label"});this.fields.max_upload_speed=
-this.fieldsets.bandwidth.add({id:"max_upload_speed",name:"max_upload_speed",width:70,value:-1,strategy:{xtype:"number",decimalPrecision:1,minValue:-1,maxValue:99999}});this.fieldsets.bandwidth.add({xtype:"label",text:_("KiB/s"),style:"margin-left: 10px"});this.fieldsets.bandwidth.add({xtype:"label",text:_("Max Connections:"),forId:"max_connections",cls:"x-deluge-options-label"});this.fields.max_connections=this.fieldsets.bandwidth.add({id:"max_connections",name:"max_connections",width:70,value:-1,
-strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999},colspan:2});this.fieldsets.bandwidth.add({xtype:"label",text:_("Max Upload Slots:"),forId:"max_upload_slots",cls:"x-deluge-options-label"});this.fields.max_upload_slots=this.fieldsets.bandwidth.add({id:"max_upload_slots",name:"max_upload_slots",width:70,value:-1,strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:99999},colspan:2});this.fieldsets.queue=this.add({xtype:"fieldset",title:_("Queue"),style:"margin-left: 5px; margin-right: 5px; padding: 5px",
-width:210,layout:"table",layoutConfig:{columns:2},labelWidth:0,defaults:{fieldLabel:"",labelSeparator:""}});this.fields.auto_managed=this.fieldsets.queue.add({xtype:"checkbox",fieldLabel:"",labelSeparator:"",name:"is_auto_managed",boxLabel:_("Auto Managed"),width:200,colspan:2});this.fields.stop_at_ratio=this.fieldsets.queue.add({fieldLabel:"",labelSeparator:"",id:"stop_at_ratio",width:120,boxLabel:_("Stop seed at ratio:"),handler:this.onStopRatioChecked,scope:this});this.fields.stop_ratio=this.fieldsets.queue.add({xtype:"spinnerfield",
-id:"stop_ratio",name:"stop_ratio",disabled:!0,width:50,value:2,strategy:{xtype:"number",minValue:-1,maxValue:99999,incrementValue:0.1,alternateIncrementValue:1,decimalPrecision:1}});this.fields.remove_at_ratio=this.fieldsets.queue.add({fieldLabel:"",labelSeparator:"",id:"remove_at_ratio",ctCls:"x-deluge-indent-checkbox",bodyStyle:"padding-left: 10px",boxLabel:_("Remove at ratio"),disabled:!0,colspan:2});this.fields.move_completed=this.fieldsets.queue.add({fieldLabel:"",labelSeparator:"",id:"move_completed",
-boxLabel:_("Move Completed:"),colspan:2,handler:this.onMoveCompletedChecked,scope:this});this.fields.move_completed_path=this.fieldsets.queue.add({xtype:"textfield",fieldLabel:"",id:"move_completed_path",colspan:3,bodyStyle:"margin-left: 20px",width:180,disabled:!0});this.rightColumn=this.add({border:!1,autoHeight:!0,style:"margin-left: 5px",width:210});this.fieldsets.general=this.rightColumn.add({xtype:"fieldset",autoHeight:!0,defaultType:"checkbox",title:_("General"),layout:"form"});this.fields["private"]=
-this.fieldsets.general.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Private"),id:"private",disabled:!0});this.fields.prioritize_first_last=this.fieldsets.general.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Prioritize First/Last"),id:"prioritize_first_last"});this.fields.super_seeding=this.fieldsets.general.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Super Seeding"),id:"super_seeding"});for(var a in this.fields)this.optionsManager.bind(a,this.fields[a]);this.buttonPanel=this.rightColumn.add({layout:"hbox",
-xtype:"panel",border:!1});this.buttonPanel.add({id:"edit_trackers",xtype:"button",text:_("Edit Trackers"),cls:"x-btn-text-icon",iconCls:"x-deluge-edit-trackers",border:!1,width:100,handler:this.onEditTrackers,scope:this});this.buttonPanel.add({id:"apply",xtype:"button",text:_("Apply"),style:"margin-left: 10px;",border:!1,width:100,handler:this.onApply,scope:this})},onRender:function(a,b){Deluge.details.OptionsTab.superclass.onRender.call(this,a,b);this.layout=new Ext.layout.ColumnLayout;this.layout.setContainer(this);
-this.doLayout()},clear:function(){null!=this.torrentId&&(this.torrentId=null,this.optionsManager.changeId(null))},reset:function(){this.torrentId&&this.optionsManager.reset()},update:function(a){this.torrentId&&!a&&this.clear();a&&(this.torrentId!=a&&(this.torrentId=a,this.optionsManager.changeId(a)),deluge.client.web.get_torrent_status(a,Deluge.Keys.Options,{success:this.onRequestComplete,scope:this}))},onApply:function(){var a=this.optionsManager.getDirty();deluge.client.core.set_torrent_options([this.torrentId],
-a,{success:function(){this.optionsManager.commit()},scope:this})},onEditTrackers:function(){deluge.editTrackers.show()},onMoveCompletedChecked:function(a,b){this.fields.move_completed_path.setDisabled(!b);b&&this.fields.move_completed_path.focus()},onStopRatioChecked:function(a,b){this.fields.remove_at_ratio.setDisabled(!b);this.fields.stop_ratio.setDisabled(!b)},onRequestComplete:function(a,b){this.fields["private"].setValue(a["private"]);this.fields["private"].setDisabled(!0);delete a["private"];
-a.auto_managed=a.is_auto_managed;a.prioritize_first_last_pieces=a.prioritize_first_last;this.optionsManager.setDefault(a);var c=this.optionsManager.get("stop_at_ratio");this.fields.remove_at_ratio.setDisabled(!c);this.fields.stop_ratio.setDisabled(!c);this.fields.move_completed_path.setDisabled(!this.optionsManager.get("move_completed"))}});
-(function(){function a(a){return!a.replace(" ","").replace(" ","")?"":String.format('<img alt="{1}" title="{1}" src="{0}flag/{1}" />',deluge.config.base,a)}function b(a,b,c){b=1024==c.data.seed?"x-deluge-seed":"x-deluge-peer";c=a.split(":");2<c.length&&(a=c.pop(),a="["+c.join(":")+"]:"+a);return String.format('<div class="{0}">{1}</div>',b,a)}function c(a){a=(100*a).toFixed(0);return Deluge.progressBar(a,this.width-8,a+"%")}Deluge.details.PeersTab=Ext.extend(Ext.grid.GridPanel,{peers:{},constructor:function(d){d=
-Ext.apply({title:_("Peers"),cls:"x-deluge-peers",store:new Ext.data.Store({reader:new Ext.data.JsonReader({idProperty:"ip",root:"peers"},Deluge.data.Peer)}),columns:[{header:"&nbsp;",width:30,sortable:!0,renderer:a,dataIndex:"country"},{header:_("Address"),width:125,sortable:!0,renderer:b,dataIndex:"ip"},{header:_("Client"),width:125,sortable:!0,renderer:"htmlEncode",dataIndex:"client"},{header:_("Progress"),width:150,sortable:!0,renderer:c,dataIndex:"progress"},{header:_("Down Speed"),width:100,
-sortable:!0,renderer:fspeed,dataIndex:"down_speed"},{header:_("Up Speed"),width:100,sortable:!0,renderer:fspeed,dataIndex:"up_speed"}],stripeRows:!0,deferredRender:!1,autoScroll:!0},d);Deluge.details.PeersTab.superclass.constructor.call(this,d)},clear:function(){this.getStore().removeAll();this.peers={}},update:function(a){deluge.client.web.get_torrent_status(a,Deluge.Keys.Peers,{success:this.onRequestComplete,scope:this})},onRequestComplete:function(a,b){if(a){var c=this.getStore(),e=[],l={};Ext.each(a.peers,
-function(a){if(this.peers[a.ip]){var b=c.getById(a.ip);b.beginEdit();for(var d in a)b.get(d)!=a[d]&&b.set(d,a[d]);b.endEdit()}else this.peers[a.ip]=1,e.push(new Deluge.data.Peer(a,a.ip));l[a.ip]=1},this);c.add(e);c.each(function(a){l[a.id]||(c.remove(a),delete this.peers[a.id])},this);c.commitChanges();var h=c.getSortState();h&&c.sort(h.field,h.direction)}}})})();Ext.ns("Deluge.details");
-Deluge.details.StatusTab=Ext.extend(Ext.Panel,{title:_("Status"),autoScroll:!0,onRender:function(a,b){Deluge.details.StatusTab.superclass.onRender.call(this,a,b);this.progressBar=this.add({xtype:"progress",cls:"x-deluge-status-progressbar"});this.status=this.add({cls:"x-deluge-status",id:"deluge-details-status",border:!1,width:1E3,listeners:{render:{fn:function(a){a.load({url:deluge.config.base+"render/tab_status.html",text:_("Loading")+"..."});a.getUpdater().on("update",this.onPanelUpdate,this)},
-scope:this}}})},clear:function(){this.progressBar.updateProgress(0," ");for(var a in this.fields)this.fields[a].innerHTML=""},update:function(a){this.fields||this.getFields();deluge.client.web.get_torrent_status(a,Deluge.Keys.Status,{success:this.onRequestComplete,scope:this})},onPanelUpdate:function(a,b){this.fields={};Ext.each(Ext.query("dd",this.status.body.dom),function(a){this.fields[a.className]=a},this)},onRequestComplete:function(a){seeds=-1<a.total_seeds?a.num_seeds+" ("+a.total_seeds+")":
-a.num_seeds;peers=-1<a.total_peers?a.num_peers+" ("+a.total_peers+")":a.num_peers;last_seen_complete=0<a.last_seen_complete?fdate(a.last_seen_complete):"Never";completed_time=0<a.completed_time?fdate(a.completed_time):"";var b={downloaded:fsize(a.total_done,!0),uploaded:fsize(a.total_uploaded,!0),share:-1==a.ratio?"&infin;":a.ratio.toFixed(3),announce:ftime(a.next_announce),tracker_status:a.tracker_status,downspeed:a.download_payload_rate?fspeed(a.download_payload_rate):"0.0 KiB/s",upspeed:a.upload_payload_rate?
-fspeed(a.upload_payload_rate):"0.0 KiB/s",eta:0>a.eta?"&infin;":ftime(a.eta),pieces:a.num_pieces+" ("+fsize(a.piece_length)+")",seeds:seeds,peers:peers,avail:a.distributed_copies.toFixed(3),active_time:ftime(a.active_time),seeding_time:ftime(a.seeding_time),seed_rank:a.seed_rank,time_added:fdate(a.time_added),last_seen_complete:last_seen_complete,completed_time:completed_time,time_since_transfer:ftime(a.time_since_transfer)};b.auto_managed=_(a.is_auto_managed?"True":"False");var c={Error:_("Error"),
-Warning:_("Warning"),"Announce OK":_("Announce OK"),"Announce Sent":_("Announce Sent")},d;for(d in c)if(-1!=b.tracker_status.indexOf(d)){b.tracker_status=b.tracker_status.replace(d,c[d]);break}b.downloaded+=" ("+(a.total_payload_download?fsize(a.total_payload_download):"0.0 KiB")+")";b.uploaded+=" ("+(a.total_payload_upload?fsize(a.total_payload_upload):"0.0 KiB")+")";for(var f in this.fields)this.fields[f].innerHTML=b[f];b=a.state+" "+a.progress.toFixed(2)+"%";this.progressBar.updateProgress(a.progress/
-100,b)}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Bandwidth=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({border:!1,title:_("Bandwidth"),header:!1,layout:"form",labelWidth:10},a);Deluge.preferences.Bandwidth.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Bandwidth.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Global Bandwidth Usage"),labelWidth:200,defaultType:"spinnerfield",defaults:{minValue:-1,
-maxValue:99999},style:"margin-bottom: 0px; padding-bottom: 0px;",autoHeight:!0});a.bind("max_connections_global",b.add({name:"max_connections_global",fieldLabel:_("Maximum Connections:"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_upload_slots_global",b.add({name:"max_upload_slots_global",fieldLabel:_("Maximum Upload Slots"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_download_speed",b.add({name:"max_download_speed",fieldLabel:_("Maximum Download Speed (KiB/s):"),
-labelSeparator:"",width:80,value:-1,decimalPrecision:1}));a.bind("max_upload_speed",b.add({name:"max_upload_speed",fieldLabel:_("Maximum Upload Speed (KiB/s):"),labelSeparator:"",width:80,value:-1,decimalPrecision:1}));a.bind("max_half_open_connections",b.add({name:"max_half_open_connections",fieldLabel:_("Maximum Half-Open Connections:"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_connections_per_second",b.add({name:"max_connections_per_second",fieldLabel:_("Maximum Connection Attempts per Second:"),
-labelSeparator:"",width:80,value:-1,decimalPrecision:0}));b=this.add({xtype:"fieldset",border:!1,title:"",defaultType:"checkbox",style:"padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;",autoHeight:!0});a.bind("ignore_limits_on_local_network",b.add({name:"ignore_limits_on_local_network",height:22,fieldLabel:"",labelSeparator:"",boxLabel:_("Ignore limits on local network")}));a.bind("rate_limit_ip_overhead",b.add({name:"rate_limit_ip_overhead",height:22,fieldLabel:"",labelSeparator:"",
-boxLabel:_("Rate limit IP overhead")}));b=this.add({xtype:"fieldset",border:!1,title:_("Per Torrent Bandwidth Usage"),style:"margin-bottom: 0px; padding-bottom: 0px;",defaultType:"spinnerfield",labelWidth:200,defaults:{minValue:-1,maxValue:99999},autoHeight:!0});a.bind("max_connections_per_torrent",b.add({name:"max_connections_per_torrent",fieldLabel:_("Maximum Connections:"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_upload_slots_per_torrent",b.add({name:"max_upload_slots_per_torrent",
-fieldLabel:_("Maximum Upload Slots:"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_download_speed_per_torrent",b.add({name:"max_download_speed_per_torrent",fieldLabel:_("Maximum Download Speed (KiB/s):"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}));a.bind("max_upload_speed_per_torrent",b.add({name:"max_upload_speed_per_torrent",fieldLabel:_("Maximum Upload Speed (KiB/s):"),labelSeparator:"",width:80,value:-1,decimalPrecision:0}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Cache=Ext.extend(Ext.form.FormPanel,{border:!1,title:_("Cache"),header:!1,layout:"form",initComponent:function(){Deluge.preferences.Cache.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Settings"),autoHeight:!0,labelWidth:180,defaultType:"spinnerfield",defaults:{decimalPrecision:0,minValue:-1,maxValue:999999}});a.bind("cache_size",b.add({fieldLabel:_("Cache Size (16 KiB Blocks):"),labelSeparator:"",
-name:"cache_size",width:60,value:512}));a.bind("cache_expiry",b.add({fieldLabel:_("Cache Expiry (seconds):"),labelSeparator:"",name:"cache_expiry",width:60,value:60}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Daemon=Ext.extend(Ext.form.FormPanel,{border:!1,title:_("Daemon"),header:!1,layout:"form",initComponent:function(){Deluge.preferences.Daemon.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Port"),autoHeight:!0,defaultType:"spinnerfield"});a.bind("daemon_port",b.add({fieldLabel:_("Daemon port:"),labelSeparator:"",name:"daemon_port",value:58846,decimalPrecision:0,minValue:-1,maxValue:99999}));b=this.add({xtype:"fieldset",
-border:!1,title:_("Connections"),autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("allow_remote",b.add({fieldLabel:"",height:22,labelSeparator:"",boxLabel:_("Allow Remote Connections"),name:"allow_remote"}));b=this.add({xtype:"fieldset",border:!1,title:_("Other"),autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("new_release_check",b.add({fieldLabel:"",labelSeparator:"",height:40,boxLabel:_("Periodically check the website for new releases"),id:"new_release_check"}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Downloads=Ext.extend(Ext.FormPanel,{constructor:function(a){a=Ext.apply({border:!1,title:_("Downloads"),header:!1,layout:"form",autoHeight:!0,width:320},a);Deluge.preferences.Downloads.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Downloads.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Folders"),labelWidth:150,defaultType:"togglefield",autoHeight:!0,labelAlign:"top",
-width:300,style:"margin-bottom: 5px; padding-bottom: 5px;"});a.bind("download_location",b.add({xtype:"textfield",name:"download_location",fieldLabel:_("Download to:"),labelSeparator:"",width:280}));var c=b.add({name:"move_completed_path",fieldLabel:_("Move completed to:"),labelSeparator:"",width:280});a.bind("move_completed",c.toggle);a.bind("move_completed_path",c.input);c=b.add({name:"torrentfiles_location",fieldLabel:_("Copy of .torrent files to:"),labelSeparator:"",width:280});a.bind("copy_torrent_file",
-c.toggle);a.bind("torrentfiles_location",c.input);b=this.add({xtype:"fieldset",border:!1,title:_("Options"),autoHeight:!0,labelWidth:1,defaultType:"checkbox",style:"margin-bottom: 0; padding-bottom: 0;",width:280});a.bind("prioritize_first_last_pieces",b.add({name:"prioritize_first_last_pieces",labelSeparator:"",height:22,boxLabel:_("Prioritize first and last pieces of torrent")}));a.bind("sequential_download",b.add({name:"sequential_download",labelSeparator:"",height:22,boxLabel:_("Sequential download")}));
-a.bind("add_paused",b.add({name:"add_paused",labelSeparator:"",height:22,boxLabel:_("Add torrents in Paused state")}));a.bind("pre_allocate_storage",b.add({name:"pre_allocate_storage",labelSeparator:"",height:22,boxLabel:_("Pre-allocate disk space")}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Encryption=Ext.extend(Ext.form.FormPanel,{border:!1,title:_("Encryption"),header:!1,initComponent:function(){Deluge.preferences.Encryption.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Settings"),header:!1,autoHeight:!0,defaultType:"combo",width:300});a.bind("enc_in_policy",b.add({fieldLabel:_("Incoming:"),labelSeparator:"",mode:"local",width:150,store:new Ext.data.ArrayStore({fields:["id","text"],
-data:[[0,_("Forced")],[1,_("Enabled")],[2,_("Disabled")]]}),editable:!1,triggerAction:"all",valueField:"id",displayField:"text"}));a.bind("enc_out_policy",b.add({fieldLabel:_("Outgoing:"),labelSeparator:"",mode:"local",width:150,store:new Ext.data.SimpleStore({fields:["id","text"],data:[[0,_("Forced")],[1,_("Enabled")],[2,_("Disabled")]]}),editable:!1,triggerAction:"all",valueField:"id",displayField:"text"}));a.bind("enc_level",b.add({fieldLabel:_("Level:"),labelSeparator:"",mode:"local",width:150,
-store:new Ext.data.SimpleStore({fields:["id","text"],data:[[0,_("Handshake")],[1,_("Full Stream")],[2,_("Either")]]}),editable:!1,triggerAction:"all",valueField:"id",displayField:"text"}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.InstallPluginWindow=Ext.extend(Ext.Window,{title:_("Install Plugin"),layout:"fit",height:115,width:350,constrainHeader:!0,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closeAction:"hide",iconCls:"x-deluge-install-plugin",modal:!0,plain:!0,initComponent:function(){Deluge.preferences.InstallPluginWindow.superclass.initComponent.call(this);this.addButton(_("Install"),this.onInstall,this);this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:70,autoHeight:!0,fileUpload:!0,
-items:[{xtype:"fileuploadfield",width:240,emptyText:_("Select an egg"),fieldLabel:_("Plugin Egg"),name:"file",buttonCfg:{text:_("Browse...")}}]})},onInstall:function(a,b){this.form.getForm().submit({url:deluge.config.base+"upload",waitMsg:_("Uploading your plugin..."),success:this.onUploadSuccess,scope:this})},onUploadPlugin:function(a,b,c,d){this.fireEvent("pluginadded")},onUploadSuccess:function(a,b){this.hide();if(b.result.success){var c=this.form.getForm().getFieldValues().file,c=c.split("\\").slice(-1)[0],
-d=b.result.files[0];this.form.getForm().setValues({file:""});deluge.client.web.upload_plugin(c,d,{success:this.onUploadPlugin,scope:this,filename:c})}}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Interface=Ext.extend(Ext.form.FormPanel,{border:!1,title:_("Interface"),header:!1,layout:"form",initComponent:function(){Deluge.preferences.Interface.superclass.initComponent.call(this);var a=this.optionsManager=new Deluge.OptionsManager;this.on("show",this.onPageShow,this);var b=this.add({xtype:"fieldset",border:!1,title:_("Interface"),style:"margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px",autoHeight:!0,labelWidth:1,defaultType:"checkbox",defaults:{height:17,fieldLabel:"",
-labelSeparator:""}});a.bind("show_session_speed",b.add({name:"show_session_speed",boxLabel:_("Show session speed in titlebar")}));a.bind("sidebar_show_zero",b.add({name:"sidebar_show_zero",boxLabel:_("Show filters with zero torrents")}));a.bind("sidebar_multiple_filters",b.add({name:"sidebar_multiple_filters",boxLabel:_("Allow the use of multiple filters at once")}));b=this.add({xtype:"fieldset",border:!1,title:_("Language"),style:"margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px",autoHeight:!0,
-labelWidth:1,defaultType:"checkbox"});this.language=a.bind("language",b.add({xtype:"combo",labelSeparator:"",name:"language",mode:"local",width:200,store:new Ext.data.ArrayStore({fields:["id","text"]}),editable:!1,triggerAction:"all",valueField:"id",displayField:"text"}));b=this.add({xtype:"fieldset",border:!1,title:_("WebUI Password"),style:"margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px",autoHeight:!0,labelWidth:100,defaultType:"textfield",defaults:{width:100,inputType:"password",labelStyle:"padding-left: 5px",
-height:20,labelSeparator:""}});this.oldPassword=b.add({name:"old_password",fieldLabel:_("Old:")});this.newPassword=b.add({name:"new_password",fieldLabel:_("New:")});this.confirmPassword=b.add({name:"confirm_password",fieldLabel:_("Confirm:")});b=this.add({xtype:"fieldset",border:!1,title:_("Server"),style:"padding-top: 5px; margin-bottom: 0px; padding-bottom: 5px",autoHeight:!0,labelWidth:100,defaultType:"spinnerfield",defaults:{labelSeparator:"",labelStyle:"padding-left: 5px",height:20,width:80}});
-a.bind("session_timeout",b.add({name:"session_timeout",fieldLabel:_("Session Timeout:"),decimalPrecision:0,minValue:-1,maxValue:99999}));a.bind("port",b.add({name:"port",fieldLabel:_("Port:"),decimalPrecision:0,minValue:1,maxValue:65535}));this.httpsField=a.bind("https",b.add({xtype:"checkbox",name:"https",hideLabel:!0,width:300,style:"margin-left: 5px",boxLabel:_("Enable SSL (paths relative to Deluge config folder)")}));this.httpsField.on("check",this.onSSLCheck,this);this.pkeyField=a.bind("pkey",
-b.add({xtype:"textfield",disabled:!0,name:"pkey",width:180,fieldLabel:_("Private Key:")}));this.certField=a.bind("cert",b.add({xtype:"textfield",disabled:!0,name:"cert",width:180,fieldLabel:_("Certificate:")}))},onApply:function(){var a=this.optionsManager.getDirty();if(!Ext.isObjectEmpty(a)){deluge.client.web.set_config(a,{success:this.onSetConfig,scope:this});for(var b in deluge.config)deluge.config[b]=this.optionsManager.get(b);"language"in a&&Ext.Msg.show({title:_("WebUI Language Changed"),msg:_("Do you want to refresh the page now to use the new language?"),
-buttons:{yes:_("Refresh"),no:_("Close")},multiline:!1,fn:function(a){"yes"===a&&location.reload()},icon:Ext.MessageBox.QUESTION})}if(this.oldPassword.getValue()||this.newPassword.getValue())this.onPasswordChange()},onOk:function(){this.onApply()},onGotConfig:function(a){this.optionsManager.set(a)},onGotLanguages:function(a,b,c,d){a.unshift(["",_("System Default")]);this.language.store.loadData(a);this.language.setValue(this.optionsManager.get("language"))},onPasswordChange:function(){var a=this.newPassword.getValue();
-if(a!=this.confirmPassword.getValue())Ext.MessageBox.show({title:_("Invalid Password"),msg:_("Your passwords don't match!"),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});else{var b=this.oldPassword.getValue();deluge.client.auth.change_password(b,a,{success:function(a){a?(Ext.MessageBox.show({title:_("Change Successful"),msg:_("Your password was successfully changed!"),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.INFO,iconCls:"x-deluge-icon-info"}),
-this.oldPassword.setValue(""),this.newPassword.setValue(""),this.confirmPassword.setValue("")):(Ext.MessageBox.show({title:_("Password"),msg:_("Your old password was incorrect!"),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"}),this.oldPassword.setValue(""))},scope:this})}},onSetConfig:function(){this.optionsManager.commit()},onPageShow:function(){deluge.client.web.get_config({success:this.onGotConfig,scope:this});deluge.client.webutils.get_languages({success:this.onGotLanguages,
-scope:this})},onSSLCheck:function(a,b){this.pkeyField.setDisabled(!b);this.certField.setDisabled(!b)}});Ext.namespace("Deluge.preferences");Ext.apply(Ext.form.VTypes,{IPAddress:function(a){return/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(a)},IPAddressText:"Must be a numeric IP address",IPAddressMask:/[\d\.]/i});
-Deluge.preferences.Network=Ext.extend(Ext.form.FormPanel,{border:!1,layout:"form",title:_("Network"),header:!1,initComponent:function(){Deluge.preferences.Network.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Incoming Address"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:!0,labelWidth:1,defaultType:"textfield"});a.bind("listen_interface",b.add({name:"listen_interface",fieldLabel:"",labelSeparator:"",
-width:200,vtype:"IPAddress"}));var b=this.add({xtype:"fieldset",border:!1,title:_("Incoming Port"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("random_port",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Port"),name:"random_port",height:22,listeners:{check:{fn:function(a,b){this.listenPort.setDisabled(b)},scope:this}}}));this.listenPort=b.add({xtype:"spinnerfield",name:"listen_port",fieldLabel:"",labelSeparator:"",width:75,
-strategy:{xtype:"number",decimalPrecision:0,minValue:0,maxValue:65535}});a.bind("listen_ports",this.listenPort);b=this.add({xtype:"fieldset",border:!1,title:_("Outgoing Interface"),style:"margin-bottom: 5px; padding-bottom: 0px;",autoHeight:!0,labelWidth:1,defaultType:"textfield"});a.bind("outgoing_interface",b.add({name:"outgoing_interface",fieldLabel:"",labelSeparator:"",width:40}));b=this.add({xtype:"fieldset",border:!1,title:_("Outgoing Ports"),style:"margin-bottom: 5px; padding-bottom: 0px;",
-autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("random_outgoing_ports",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Use Random Ports"),name:"random_outgoing_ports",height:22,listeners:{check:{fn:function(a,b){this.outgoingPorts.setDisabled(b)},scope:this}}}));this.outgoingPorts=b.add({xtype:"spinnergroup",name:"outgoing_ports",fieldLabel:"",labelSeparator:"",colCfg:{labelWidth:40,style:"margin-right: 10px;"},items:[{fieldLabel:_("From:"),labelSeparator:"",strategy:{xtype:"number",
-decimalPrecision:0,minValue:0,maxValue:65535}},{fieldLabel:_("To:"),labelSeparator:"",strategy:{xtype:"number",decimalPrecision:0,minValue:0,maxValue:65535}}]});a.bind("outgoing_ports",this.outgoingPorts);b=this.add({xtype:"fieldset",border:!1,title:_("Network Extras"),autoHeight:!0,layout:"table",layoutConfig:{columns:3},defaultType:"checkbox"});a.bind("upnp",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("UPnP"),name:"upnp"}));a.bind("natpmp",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("NAT-PMP"),
-ctCls:"x-deluge-indent-checkbox",name:"natpmp"}));a.bind("utpex",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("Peer Exchange"),ctCls:"x-deluge-indent-checkbox",name:"utpex"}));a.bind("lsd",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("LSD"),name:"lsd"}));a.bind("dht",b.add({fieldLabel:"",labelSeparator:"",boxLabel:_("DHT"),ctCls:"x-deluge-indent-checkbox",name:"dht"}));b=this.add({xtype:"fieldset",border:!1,title:_("Type Of Service"),style:"margin-bottom: 5px; padding-bottom: 0px;",bodyStyle:"margin: 0px; padding: 0px",
-autoHeight:!0,defaultType:"textfield"});a.bind("peer_tos",b.add({name:"peer_tos",fieldLabel:_("Peer TOS Byte:"),labelSeparator:"",width:40}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Other=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({border:!1,title:_("Other"),header:!1,layout:"form"},a);Deluge.preferences.Other.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Other.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("Updates"),autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("new_release_check",b.add({fieldLabel:"",labelSeparator:"",
-height:22,name:"new_release_check",boxLabel:_("Be alerted about new releases")}));b=this.add({xtype:"fieldset",border:!1,title:_("System Information"),autoHeight:!0,labelWidth:1,defaultType:"checkbox"});b.add({xtype:"panel",border:!1,bodyCfg:{html:_("Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent.")}});a.bind("send_info",b.add({fieldLabel:"",labelSeparator:"",height:22,boxLabel:_("Yes, please send anonymous statistics"),
-name:"send_info"}));b=this.add({xtype:"fieldset",border:!1,title:_("GeoIP Database"),autoHeight:!0,labelWidth:80,defaultType:"textfield"});a.bind("geoip_db_location",b.add({name:"geoip_db_location",fieldLabel:_("Path:"),labelSeparator:"",width:200}))}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Plugins=Ext.extend(Ext.Panel,{layout:"border",title:_("Plugins"),header:!1,border:!1,cls:"x-deluge-plugins",pluginTemplate:new Ext.Template('<dl class="singleline"><dt>'+_("Author:")+"</dt><dd>{author}</dd><dt>"+_("Version:")+"</dt><dd>{version}</dd><dt>"+_("Author Email:")+"</dt><dd>{email}</dd><dt>"+_("Homepage:")+"</dt><dd>{homepage}</dd><dt>"+_("Details:")+'</dt><dd style="white-space:normal">{details}</dd></dl>'),initComponent:function(){Deluge.preferences.Plugins.superclass.initComponent.call(this);
-this.defaultValues={version:"",email:"",homepage:"",details:""};this.pluginTemplate.compile();this.list=this.add({xtype:"listview",store:new Ext.data.ArrayStore({fields:[{name:"enabled",mapping:0},{name:"plugin",mapping:1,sortType:"asUCString"}]}),columns:[{id:"enabled",header:_("Enabled"),width:0.2,sortable:!0,tpl:new Ext.XTemplate("{enabled:this.getCheckbox}",{getCheckbox:function(a){return'<div class="x-grid3-check-col'+(a?"-on":"")+'" rel="chkbox"> </div>'}}),dataIndex:"enabled"},{id:"plugin",
-header:_("Plugin"),width:0.8,sortable:!0,dataIndex:"plugin"}],singleSelect:!0,autoExpandColumn:"plugin",listeners:{selectionchange:{fn:this.onPluginSelect,scope:this}}});this.panel=this.add({region:"center",autoScroll:!0,items:[this.list],bbar:new Ext.Toolbar({items:[{cls:"x-btn-text-icon",iconCls:"x-deluge-install-plugin",text:_("Install"),handler:this.onInstallPluginWindow,scope:this},"->",{cls:"x-btn-text-icon",text:_("Find More"),iconCls:"x-deluge-find-more",handler:this.onFindMorePlugins,scope:this}]})});
-this.pluginInfo=this.add({xtype:"panel",border:!1,height:100,region:"south",padding:"5",autoScroll:!0,bodyCfg:{style:"white-space: nowrap"}});this.pluginInfo.on("render",this.onPluginInfoRender,this);this.list.on("click",this.onNodeClick,this);deluge.preferences.on("show",this.onPreferencesShow,this);deluge.events.on("PluginDisabledEvent",this.onPluginDisabled,this);deluge.events.on("PluginEnabledEvent",this.onPluginEnabled,this)},disablePlugin:function(a){deluge.client.core.disable_plugin(a)},enablePlugin:function(a){deluge.client.core.enable_plugin(a)},
-setInfo:function(a){this.pluginInfo.rendered&&(this.pluginInfo.body.dom.innerHTML=this.pluginTemplate.apply(a||this.defaultValues))},updatePlugins:function(){var a=function(a){this.enabledPlugins=a;this.onGotPlugins()};deluge.client.core.get_available_plugins({success:function(b){this.availablePlugins=b.sort(function(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())});deluge.client.core.get_enabled_plugins({success:a,scope:this})},scope:this})},updatePluginsGrid:function(){var a=[];Ext.each(this.availablePlugins,
-function(b){-1<this.enabledPlugins.indexOf(b)?a.push([!0,b]):a.push([!1,b])},this);this.list.getStore().loadData(a)},onNodeClick:function(a,b,c,d){"chkbox"==(new Ext.Element(d.target)).getAttribute("rel")&&(a=a.getStore().getAt(b),"WebUi"!=a.get("plugin")&&(a.set("enabled",!a.get("enabled")),a.commit(),a.get("enabled")?this.enablePlugin(a.get("plugin")):this.disablePlugin(a.get("plugin"))))},onFindMorePlugins:function(){window.open("http://dev.deluge-torrent.org/wiki/Plugins")},onGotPlugins:function(){this.setInfo();
-this.updatePluginsGrid()},onGotPluginInfo:function(a){this.setInfo({author:a.Author,version:a.Version,email:a["Author-email"],homepage:a["Home-page"],details:a.Description});delete a},onInstallPluginWindow:function(){this.installWindow||(this.installWindow=new Deluge.preferences.InstallPluginWindow,this.installWindow.on("pluginadded",this.onPluginInstall,this));this.installWindow.show()},onPluginEnabled:function(a){a=this.list.getStore().find("plugin",a);-1!=a&&(a=this.list.getStore().getAt(a),a.set("enabled",
-!0),a.commit())},onPluginDisabled:function(a){a=this.list.getStore().find("plugin",a);-1!=a&&(a=this.list.getStore().getAt(a),a.set("enabled",!1),a.commit())},onPluginInstall:function(){this.updatePlugins()},onPluginSelect:function(a,b){if(0!=b.length){var c=a.getRecords(b)[0];deluge.client.web.get_plugin_info(c.get("plugin"),{success:this.onGotPluginInfo,scope:this})}},onPreferencesShow:function(){this.updatePlugins()},onPluginInfoRender:function(a,b){this.setInfo()}});Ext.namespace("Deluge.preferences");
-PreferencesRecord=Ext.data.Record.create([{name:"name",type:"string"}]);
-Deluge.preferences.PreferencesWindow=Ext.extend(Ext.Window,{currentPage:null,title:_("Preferences"),layout:"border",width:485,height:500,border:!1,constrainHeader:!0,buttonAlign:"right",closeAction:"hide",closable:!0,iconCls:"x-deluge-preferences",plain:!0,resizable:!1,pages:{},initComponent:function(){Deluge.preferences.PreferencesWindow.superclass.initComponent.call(this);this.list=new Ext.list.ListView({store:new Ext.data.Store,columns:[{id:"name",dataIndex:"name"}],singleSelect:!0,listeners:{selectionchange:{fn:this.onPageSelect,
-scope:this}},hideHeaders:!0,autoExpandColumn:"name",deferredRender:!1,autoScroll:!0,collapsible:!0});this.add({region:"west",items:[this.list],width:120,margins:"0 5 0 0",cmargins:"0 5 0 0"});this.configPanel=this.add({type:"container",autoDestroy:!1,region:"center",layout:"card",layoutConfig:{deferredRender:!0},autoScroll:!0,width:300});this.addButton(_("Close"),this.onClose,this);this.addButton(_("Apply"),this.onApply,this);this.addButton(_("OK"),this.onOk,this);this.optionsManager=new Deluge.OptionsManager;
-this.on("afterrender",this.onAfterRender,this);this.on("show",this.onShow,this);this.initPages()},initPages:function(){deluge.preferences=this;this.addPage(new Deluge.preferences.Downloads);this.addPage(new Deluge.preferences.Network);this.addPage(new Deluge.preferences.Encryption);this.addPage(new Deluge.preferences.Bandwidth);this.addPage(new Deluge.preferences.Interface);this.addPage(new Deluge.preferences.Other);this.addPage(new Deluge.preferences.Daemon);this.addPage(new Deluge.preferences.Queue);
-this.addPage(new Deluge.preferences.Proxy);this.addPage(new Deluge.preferences.Cache);this.addPage(new Deluge.preferences.Plugins)},onApply:function(a){a=this.optionsManager.getDirty();Ext.isObjectEmpty(a)||("listen_ports"in a&&(a.listen_ports=[a.listen_ports,a.listen_ports]),deluge.client.core.set_config(a,{success:this.onSetConfig,scope:this}));for(var b in this.pages)if(this.pages[b].onApply)this.pages[b].onApply()},getOptionsManager:function(){return this.optionsManager},addPage:function(a){var b=
-this.list.getStore(),c=a.title;b.add([new PreferencesRecord({name:c})]);a.bodyStyle="padding: 5px";a.preferences=this;this.pages[c]=this.configPanel.add(a);this.pages[c].index=-1;return this.pages[c]},removePage:function(a){var b=a.title,c=this.list.getStore();c.removeAt(c.find("name",b));this.configPanel.remove(a);delete this.pages[a.title]},selectPage:function(a){0>this.pages[a].index&&(this.pages[a].index=this.configPanel.items.indexOf(this.pages[a]));this.list.select(this.pages[a].index)},doSelectPage:function(a){0>
-this.pages[a].index&&(this.pages[a].index=this.configPanel.items.indexOf(this.pages[a]));this.configPanel.getLayout().setActiveItem(this.pages[a].index);this.currentPage=a},onGotConfig:function(a){this.getOptionsManager().set(a)},onPageSelect:function(a,b){var c=a.getRecord(b[0]);this.doSelectPage(c.get("name"))},onSetConfig:function(){this.getOptionsManager().commit()},onAfterRender:function(){this.list.getSelectionCount()||this.list.select(0);this.configPanel.getLayout().setActiveItem(0)},onShow:function(){deluge.client.core&&
-deluge.client.core.get_config({success:this.onGotConfig,scope:this})},onClose:function(){this.hide()},onOk:function(){var a=this.optionsManager.getDirty();Ext.isObjectEmpty(a)||deluge.client.core.set_config(a,{success:this.onSetConfig,scope:this});for(var b in this.pages)if(this.pages[b].onOk)this.pages[b].onOk();this.hide()}});Ext.ns("Deluge.preferences");
-Deluge.preferences.ProxyField=Ext.extend(Ext.form.FieldSet,{border:!1,autoHeight:!0,labelWidth:70,initComponent:function(){Deluge.preferences.ProxyField.superclass.initComponent.call(this);this.proxyType=this.add({xtype:"combo",fieldLabel:_("Type:"),labelSeparator:"",name:"proxytype",mode:"local",width:150,store:new Ext.data.ArrayStore({fields:["id","text"],data:[[0,_("None")],[1,_("Socks4")],[2,_("Socks5")],[3,_("Socks5 Auth")],[4,_("HTTP")],[5,_("HTTP Auth")],[6,_("I2P")]]}),editable:!1,triggerAction:"all",
-valueField:"id",displayField:"text"});this.proxyType.on("change",this.onFieldChange,this);this.proxyType.on("select",this.onTypeSelect,this);this.hostname=this.add({xtype:"textfield",name:"hostname",fieldLabel:_("Host:"),labelSeparator:"",width:220});this.hostname.on("change",this.onFieldChange,this);this.port=this.add({xtype:"spinnerfield",name:"port",fieldLabel:_("Port:"),labelSeparator:"",width:80,decimalPrecision:0,minValue:0,maxValue:65535});this.port.on("change",this.onFieldChange,this);this.username=
-this.add({xtype:"textfield",name:"username",fieldLabel:_("Username:"),labelSeparator:"",width:220});this.username.on("change",this.onFieldChange,this);this.password=this.add({xtype:"textfield",name:"password",fieldLabel:_("Password:"),labelSeparator:"",inputType:"password",width:220});this.password.on("change",this.onFieldChange,this);this.proxy_host_resolve=this.add({xtype:"checkbox",name:"proxy_host_resolve",fieldLabel:"",boxLabel:_("Proxy Hostnames"),width:220});this.proxy_host_resolve.on("change",
-this.onFieldChange,this);this.proxy_peer_conn=this.add({xtype:"checkbox",name:"proxy_peer_conn",fieldLabel:"",boxLabel:_("Proxy Peers"),width:220});this.proxy_peer_conn.on("change",this.onFieldChange,this);this.proxy_tracker_conn=this.add({xtype:"checkbox",name:"proxy_tracker_conn",fieldLabel:"",boxLabel:_("Proxy Trackers"),width:220});this.proxy_tracker_conn.on("change",this.onFieldChange,this);var a=this.add({xtype:"fieldset",border:!1,title:_("Force Proxy"),autoHeight:!0,labelWidth:1,defaultType:"checkbox",
-style:"padding-left: 0px; margin-top: 10px"});this.force_proxy=a.add({fieldLabel:"",labelSeparator:"",height:20,name:"force_proxy",boxLabel:_("Force Use of Proxy")});this.force_proxy.on("change",this.onFieldChange,this);this.anonymous_mode=a.add({fieldLabel:"",labelSeparator:"",height:20,name:"anonymous_mode",boxLabel:_("Hide Client Identity")});this.anonymous_mode.on("change",this.onFieldChange,this);this.setting=!1},getName:function(){return this.initialConfig.name},getValue:function(){return{type:this.proxyType.getValue(),
-hostname:this.hostname.getValue(),port:Number(this.port.getValue()),username:this.username.getValue(),password:this.password.getValue(),proxy_hostnames:this.proxy_host_resolve.getValue(),proxy_peer_connections:this.proxy_peer_conn.getValue(),proxy_tracker_connections:this.proxy_tracker_conn.getValue(),force_proxy:this.force_proxy.getValue(),anonymous_mode:this.anonymous_mode.getValue()}},setValue:function(a){this.setting=!0;this.proxyType.setValue(a.type);var b=this.proxyType.getStore().find("id",
-a.type),c=this.proxyType.getStore().getAt(b);this.hostname.setValue(a.hostname);this.port.setValue(a.port);this.username.setValue(a.username);this.password.setValue(a.password);this.proxy_host_resolve.setValue(a.proxy_hostnames);this.proxy_peer_conn.setValue(a.proxy_peer_connections);this.proxy_tracker_conn.setValue(a.proxy_tracker_connections);this.force_proxy.setValue(a.force_proxy);this.anonymous_mode.setValue(a.anonymous_mode);this.onTypeSelect(this.type,c,b);this.setting=!1},onFieldChange:function(a,
-b,c){if(!this.setting){b=this.getValue();var d=Ext.apply({},b);d[a.getName()]=c;this.fireEvent("change",this,b,d)}},onTypeSelect:function(a,b,c){a=b.get("id");0<a?(this.hostname.show(),this.port.show(),this.proxy_peer_conn.show(),this.proxy_tracker_conn.show(),1<a&&6>a?this.proxy_host_resolve.show():this.proxy_host_resolve.hide()):(this.hostname.hide(),this.port.hide(),this.proxy_host_resolve.hide(),this.proxy_peer_conn.hide(),this.proxy_tracker_conn.hide());3==a||5==a?(this.username.show(),this.password.show()):
-(this.username.hide(),this.password.hide())}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Proxy=Ext.extend(Ext.form.FormPanel,{constructor:function(a){a=Ext.apply({border:!1,title:_("Proxy"),header:!1,layout:"form",autoScroll:!0},a);Deluge.preferences.Proxy.superclass.constructor.call(this,a)},initComponent:function(){Deluge.preferences.Proxy.superclass.initComponent.call(this);this.proxy=this.add(new Deluge.preferences.ProxyField({title:_("Proxy"),name:"proxy"}));this.proxy.on("change",this.onProxyChange,this);deluge.preferences.getOptionsManager().bind("proxy",this.proxy)},
-getValue:function(){return{proxy:this.proxy.getValue()}},setValue:function(a){for(var b in a)this[b].setValue(a[b])},onProxyChange:function(a,b,c){b=this.getValue();var d=Ext.apply({},b);d[a.getName()]=c;this.fireEvent("change",this,b,d)}});Ext.namespace("Deluge.preferences");
-Deluge.preferences.Queue=Ext.extend(Ext.form.FormPanel,{border:!1,title:_("Queue"),header:!1,layout:"form",initComponent:function(){Deluge.preferences.Queue.superclass.initComponent.call(this);var a=deluge.preferences.getOptionsManager(),b=this.add({xtype:"fieldset",border:!1,title:_("New Torrents"),style:"padding-top: 5px; margin-bottom: 0px;",autoHeight:!0,labelWidth:1,defaultType:"checkbox"});a.bind("queue_new_to_top",b.add({fieldLabel:"",labelSeparator:"",height:22,boxLabel:_("Queue to top"),
-name:"queue_new_to_top"}));b=this.add({xtype:"fieldset",border:!1,title:_("Active Torrents"),autoHeight:!0,labelWidth:150,defaultType:"spinnerfield",style:"padding-top: 5px; margin-bottom: 0px"});a.bind("max_active_limit",b.add({fieldLabel:_("Total:"),labelSeparator:"",name:"max_active_limit",value:8,width:80,decimalPrecision:0,minValue:-1,maxValue:99999}));a.bind("max_active_downloading",b.add({fieldLabel:_("Downloading:"),labelSeparator:"",name:"max_active_downloading",value:3,width:80,decimalPrecision:0,
-minValue:-1,maxValue:99999}));a.bind("max_active_seeding",b.add({fieldLabel:_("Seeding:"),labelSeparator:"",name:"max_active_seeding",value:5,width:80,decimalPrecision:0,minValue:-1,maxValue:99999}));a.bind("dont_count_slow_torrents",b.add({xtype:"checkbox",name:"dont_count_slow_torrents",height:22,hideLabel:!0,boxLabel:_("Ignore slow torrents")}));a.bind("auto_manage_prefer_seeds",b.add({xtype:"checkbox",name:"auto_manage_prefer_seeds",hideLabel:!0,boxLabel:_("Prefer seeding torrents")}));b=this.add({xtype:"fieldset",
-border:!1,title:_("Seeding Rotation"),autoHeight:!0,labelWidth:150,defaultType:"spinnerfield",style:"padding-top: 5px; margin-bottom: 0px"});a.bind("share_ratio_limit",b.add({fieldLabel:_("Share Ratio:"),labelSeparator:"",name:"share_ratio_limit",value:8,width:80,incrementValue:0.1,minValue:-1,maxValue:99999,alternateIncrementValue:1,decimalPrecision:2}));a.bind("seed_time_ratio_limit",b.add({fieldLabel:_("Time Ratio:"),labelSeparator:"",name:"seed_time_ratio_limit",value:3,width:80,incrementValue:0.1,
-minValue:-1,maxValue:99999,alternateIncrementValue:1,decimalPrecision:2}));a.bind("seed_time_limit",b.add({fieldLabel:_("Time (m):"),labelSeparator:"",name:"seed_time_limit",value:5,width:80,decimalPrecision:0,minValue:-1,maxValue:99999}));b=this.add({xtype:"fieldset",border:!1,autoHeight:!0,style:"padding-top: 5px; margin-bottom: 0px",title:_("Share Ratio Reached"),layout:"table",layoutConfig:{columns:2},labelWidth:0,defaultType:"checkbox",defaults:{fieldLabel:"",labelSeparator:""}});this.stopAtRatio=
-b.add({name:"stop_seed_at_ratio",boxLabel:_("Share Ratio:")});this.stopAtRatio.on("check",this.onStopRatioCheck,this);a.bind("stop_seed_at_ratio",this.stopAtRatio);this.stopRatio=b.add({xtype:"spinnerfield",name:"stop_seed_ratio",ctCls:"x-deluge-indent-checkbox",disabled:!0,value:"2.0",width:60,incrementValue:0.1,minValue:-1,maxValue:99999,alternateIncrementValue:1,decimalPrecision:2});a.bind("stop_seed_ratio",this.stopRatio);this.removeAtRatio=b.add({xtype:"radiogroup",columns:1,colspan:2,disabled:!0,
-style:"margin-left: 10px",items:[{boxLabel:_("Pause torrent"),name:"at_ratio",inputValue:!1,checked:!0},{boxLabel:_("Remove torrent"),name:"at_ratio",inputValue:!0}]});a.bind("remove_seed_at_ratio",this.removeAtRatio)},onStopRatioCheck:function(a,b){this.stopRatio.setDisabled(!b);this.removeAtRatio.setDisabled(!b)}});Ext.ns("Deluge");
-Deluge.StatusbarMenu=Ext.extend(Ext.menu.Menu,{initComponent:function(){Deluge.StatusbarMenu.superclass.initComponent.call(this);this.otherWin=new Deluge.OtherLimitWindow(this.initialConfig.otherWin||{});this.items.each(function(a){if("menucheckitem"==a.getXType())if("other"==a.value)a.on("click",this.onOtherClicked,this);else a.on("checkchange",this.onLimitChanged,this)},this)},setValue:function(a){var b=!1;this.value=a=0==a?-1:a;var c=null;this.items.each(function(d){d.setChecked&&(d.suspendEvents(),
-d.value==a?(d.setChecked(!0),b=!0):d.setChecked(!1),d.resumeEvents());"other"==d.value&&(c=d)});b||(c.suspendEvents(),c.setChecked(!0),c.resumeEvents())},onLimitChanged:function(a,b){if(b&&"other"!=a.value){var c={};c[a.group]=a.value;deluge.client.core.set_config(c,{success:function(){deluge.ui.update()}})}},onOtherClicked:function(a,b){this.otherWin.group=a.group;this.otherWin.setValue(this.value);this.otherWin.show()}});Ext.namespace("Deluge");
-Deluge.OptionsManager=Ext.extend(Ext.util.Observable,{constructor:function(a){a=a||{};this.binds={};this.changed={};this.options=a&&a.options||{};this.focused=null;this.addEvents({add:!0,changed:!0,reset:!0});this.on("changed",this.onChange,this);Deluge.OptionsManager.superclass.constructor.call(this)},addOptions:function(a){this.options=Ext.applyIf(this.options,a)},bind:function(a,b){this.binds[a]=this.binds[a]||[];this.binds[a].push(b);b._doption=a;b.on("focus",this.onFieldFocus,this);b.on("blur",
-this.onFieldBlur,this);b.on("change",this.onFieldChange,this);b.on("check",this.onFieldChange,this);b.on("spin",this.onFieldChange,this);return b},commit:function(){this.options=Ext.apply(this.options,this.changed);this.reset()},convertValueType:function(a,b){if(Ext.type(a)!=Ext.type(b))switch(Ext.type(a)){case "string":b=String(b);break;case "number":b=Number(b);break;case "boolean":"string"==Ext.type(b)?(b=b.toLowerCase(),b="true"==b||"1"==b||"on"==b?!0:!1):b=Boolean(b)}return b},get:function(){if(1==
-arguments.length){var a=arguments[0];return this.isDirty(a)?this.changed[a]:this.options[a]}var b={};Ext.each(arguments,function(a){this.has(a)&&(b[a]=this.isDirty(a)?this.changed[a]:this.options[a])},this);return b},getDefault:function(a){return this.options[a]},getDirty:function(){return this.changed},isDirty:function(a){return!Ext.isEmpty(this.changed[a])},has:function(a){return this.options[a]},reset:function(){this.changed={}},set:function(a,b){if(void 0!==a)if("object"==typeof a){var c=a;this.options=
-Ext.apply(this.options,c);for(a in c)this.onChange(a,c[a])}else this.options[a]=b,this.onChange(a,b)},update:function(a,b){if(void 0!==a)if(void 0===b)for(var c in a)this.update(c,a[c]);else{c=this.getDefault(a);b=this.convertValueType(c,b);var d=this.get(a);d!=b&&(c==b?this.isDirty(a)&&delete this.changed[a]:this.changed[a]=b,this.fireEvent("changed",a,b,d))}},onFieldBlur:function(a,b){this.focused==a&&(this.focused=null)},onFieldChange:function(a,b){a.field&&(a=a.field);this.update(a._doption,a.getValue())},
-onFieldFocus:function(a,b){this.focused=a},onChange:function(a,b,c){Ext.isEmpty(this.binds[a])||Ext.each(this.binds[a],function(a){a!=this.focused&&a.setValue(b)},this)}});Ext.namespace("Deluge.about");
-Deluge.about.AboutWindow=Ext.extend(Ext.Window,{id:"AboutWindow",title:_("About Deluge"),height:330,width:270,iconCls:"x-deluge-main-panel",resizable:!1,plain:!0,layout:{type:"vbox",align:"center"},buttonAlign:"center",initComponent:function(){Deluge.about.AboutWindow.superclass.initComponent.call(this);this.addEvents({build_ready:!0});var a=this,b=function(){deluge.client.core.get_libtorrent_version({success:function(b){d+="<br/>"+_("libtorrent:")+" "+b;Ext.getCmp("about_comment").setText(d,!1);
-a.fireEvent("build_ready")}})},c=deluge.version,d=_("A peer-to-peer file sharing program\nutilizing the BitTorrent protocol.").replace("\n","<br/>")+"<br/><br/>"+_("Client:")+" "+c+"<br/>";deluge.client.web.connected({success:function(a){a?deluge.client.daemon.get_version({success:function(a){d+=_("Server:")+" "+a+"<br/>";b()}}):this.fireEvent("build_ready")},failure:function(){this.fireEvent("build_ready")},scope:this});this.add([{xtype:"box",style:"padding-top: 5px",height:80,width:240,cls:"x-deluge-logo",
-hideLabel:!0},{xtype:"label",style:"padding-top: 10px; font-weight: bold; font-size: 16px;",text:_("Deluge")+" "+c},{xtype:"label",id:"about_comment",style:"padding-top: 10px; text-align:center; font-size: 12px;",html:d},{xtype:"label",style:"padding-top: 10px; font-size: 10px;",text:_("Copyright 2007-2018 Deluge Team")},{xtype:"label",style:"padding-top: 5px; font-size: 12px;",html:'<a href="https://deluge-torrent.org" target="_blank">deluge-torrent.org</a>'}]);this.addButton(_("Close"),this.onCloseClick,
-this)},show:function(){this.on("build_ready",function(){Deluge.about.AboutWindow.superclass.show.call(this)})},onCloseClick:function(){this.close()}});Ext.namespace("Deluge");Deluge.About=function(){(new Deluge.about.AboutWindow).show()};Ext.ns("Deluge");
-Deluge.AddConnectionWindow=Ext.extend(Ext.Window,{title:_("Add Connection"),iconCls:"x-deluge-add-window-icon",layout:"fit",width:300,height:195,constrainHeader:!0,bodyStyle:"padding: 10px 5px;",closeAction:"hide",initComponent:function(){Deluge.AddConnectionWindow.superclass.initComponent.call(this);this.addEvents("hostadded");this.addButton(_("Close"),this.hide,this);this.addButton(_("Add"),this.onAddClick,this);this.on("hide",this.onHide,this);this.form=this.add({xtype:"form",defaultType:"textfield",
-baseCls:"x-plain",labelWidth:60,items:[{fieldLabel:_("Host:"),labelSeparator:"",name:"host",anchor:"75%",value:""},{xtype:"spinnerfield",fieldLabel:_("Port:"),labelSeparator:"",name:"port",strategy:{xtype:"number",decimalPrecision:0,minValue:-1,maxValue:65535},value:"58846",anchor:"40%"},{fieldLabel:_("Username:"),labelSeparator:"",name:"username",anchor:"75%",value:""},{fieldLabel:_("Password:"),labelSeparator:"",anchor:"75%",name:"password",inputType:"password",value:""}]})},onAddClick:function(){var a=
-this.form.getForm().getValues();deluge.client.web.add_host(a.host,Number(a.port),a.username,a.password,{success:function(a){a[0]?this.fireEvent("hostadded"):Ext.MessageBox.show({title:_("Error"),msg:String.format(_("Unable to add host: {0}"),a[1]),buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"});this.hide()},scope:this})},onHide:function(){this.form.getForm().reset()}});Ext.ns("Deluge");var trackerUrlTest=/(((^https?)|(^udp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
-Ext.apply(Ext.form.VTypes,{trackerUrl:function(a,b){return trackerUrlTest.test(a)},trackerUrlText:"Not a valid tracker url"});
-Deluge.AddTrackerWindow=Ext.extend(Ext.Window,{title:_("Add Tracker"),layout:"fit",width:375,height:150,plain:!0,closable:!0,resizable:!1,constrainHeader:!0,bodyStyle:"padding: 5px",buttonAlign:"right",closeAction:"hide",iconCls:"x-deluge-edit-trackers",initComponent:function(){Deluge.AddTrackerWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("Add"),this.onAddClick,this);this.addEvents("add");this.form=this.add({xtype:"form",defaultType:"textarea",
-baseCls:"x-plain",labelWidth:55,items:[{fieldLabel:_("Trackers:"),labelSeparator:"",name:"trackers",anchor:"100%"}]})},onAddClick:function(){var a=this.form.getForm().findField("trackers").getValue(),a=a.split("\n"),b=[];Ext.each(a,function(a){Ext.form.VTypes.trackerUrl(a)&&b.push(a)},this);this.fireEvent("add",b);this.hide();this.form.getForm().findField("trackers").setValue("")},onCancelClick:function(){this.form.getForm().findField("trackers").setValue("");this.hide()}});Ext.namespace("Ext.ux.util");
-Ext.ux.util.RpcClient=Ext.extend(Ext.util.Observable,{_components:[],_methods:[],_requests:{},_url:null,_optionKeys:["scope","success","failure"],constructor:function(a){Ext.ux.util.RpcClient.superclass.constructor.call(this,a);this._url=a.url||null;this._id=0;this.addEvents("connected","error");this.reloadMethods()},reloadMethods:function(){this._execute("system.listMethods",{success:this._setMethods,scope:this})},_execute:function(a,b){b=b||{};b.params=b.params||[];b.id=this._id;var c=Ext.encode({method:a,
-params:b.params,id:b.id});this._id++;return Ext.Ajax.request({url:this._url,method:"POST",success:this._onSuccess,failure:this._onFailure,scope:this,jsonData:c,options:b})},_onFailure:function(a,b){var c=b.options;errorObj={id:c.id,result:null,error:{msg:"HTTP: "+a.status+" "+a.statusText,code:255}};this.fireEvent("error",errorObj,a,b);"function"==Ext.type(c.failure)&&(c.scope?c.failure.call(c.scope,errorObj,a,b):c.failure(errorObj,a,b))},_onSuccess:function(a,b){var c=Ext.decode(a.responseText),
-d=b.options;c.error?(this.fireEvent("error",c,a,b),"function"==Ext.type(d.failure)&&(d.scope?d.failure.call(d.scope,c,a,b):d.failure(c,a,b))):"function"==Ext.type(d.success)&&(d.scope?d.success.call(d.scope,c.result,c,a,b):d.success(c.result,c,a,b))},_parseArgs:function(a){var b=[];Ext.each(a,function(a){b.push(a)});a=b[b.length-1];if("object"==Ext.type(a)){var c=Ext.keys(a),d=!1;Ext.each(this._optionKeys,function(a){-1<c.indexOf(a)&&(d=!0)});d?b.remove(a):a={}}else a={};a.params=b;return a},_setMethods:function(a){var b=
-{},c=this;Ext.each(a,function(a){var d=a.split("."),e=b[d[0]]||{};e[d[1]]=function(){var b=c._parseArgs(arguments);return c._execute(a,b)};b[d[0]]=e});for(var d in b)c[d]=b[d];Ext.each(this._components,function(a){!a in b&&delete this[a]},this);this._components=Ext.keys(b);this.fireEvent("connected",this)}});
-Deluge.ConnectionManager=Ext.extend(Ext.Window,{layout:"fit",width:300,height:220,bodyStyle:"padding: 10px 5px;",buttonAlign:"right",closeAction:"hide",closable:!0,plain:!0,constrainHeader:!0,title:_("Connection Manager"),iconCls:"x-deluge-connect-window-icon",initComponent:function(){Deluge.ConnectionManager.superclass.initComponent.call(this);this.on("hide",this.onHide,this);this.on("show",this.onShow,this);deluge.events.on("login",this.onLogin,this);deluge.events.on("logout",this.onLogout,this);
-this.addButton(_("Close"),this.onClose,this);this.addButton(_("Connect"),this.onConnect,this);this.list=new Ext.list.ListView({store:new Ext.data.ArrayStore({fields:[{name:"status",mapping:4},{name:"host",mapping:1},{name:"port",mapping:2},{name:"user",mapping:3},{name:"version",mapping:5}],id:0}),columns:[{header:_("Status"),width:0.24,sortable:!0,tpl:new Ext.XTemplate("<tpl if=\"status == 'Online'\">",_("Online"),"</tpl>","<tpl if=\"status == 'Offline'\">",_("Offline"),"</tpl>","<tpl if=\"status == 'Connected'\">",
-_("Connected"),"</tpl>"),dataIndex:"status"},{id:"host",header:_("Host"),width:0.51,sortable:!0,tpl:"{user}@{host}:{port}",dataIndex:"host"},{header:_("Version"),width:0.25,sortable:!0,tpl:'<tpl if="version">{version}</tpl>',dataIndex:"version"}],singleSelect:!0,listeners:{selectionchange:{fn:this.onSelectionChanged,scope:this}}});this.panel=this.add({autoScroll:!0,items:[this.list],bbar:new Ext.Toolbar({buttons:[{id:"cm-add",cls:"x-btn-text-icon",text:_("Add"),iconCls:"icon-add",handler:this.onAddClick,
-scope:this},{id:"cm-edit",cls:"x-btn-text-icon",text:_("Edit"),iconCls:"icon-edit",handler:this.onEditClick,scope:this},{id:"cm-remove",cls:"x-btn-text-icon",text:_("Remove"),iconCls:"icon-remove",handler:this.onRemoveClick,disabled:!0,scope:this},"->",{id:"cm-stop",cls:"x-btn-text-icon",text:_("Stop Daemon"),iconCls:"icon-error",handler:this.onStopClick,disabled:!0,scope:this}]})});this.update=this.update.createDelegate(this)},checkConnected:function(){deluge.client.web.connected({success:function(a){a?
-deluge.events.fire("connect"):this.show()},scope:this})},disconnect:function(a){deluge.events.fire("disconnect");a&&!this.isVisible()&&this.show()},loadHosts:function(){deluge.client.web.get_hosts({success:this.onGetHosts,scope:this})},update:function(){this.list.getStore().each(function(a){deluge.client.web.get_host_status(a.id,{success:this.onGetHostStatus,scope:this})},this)},updateButtons:function(a){var b=this.buttons[1],c=a.get("status");b.enable();"connected"==c.toLowerCase()?b.setText(_("Disconnect")):
-(b.setText(_("Connect")),"online"!=c.toLowerCase()&&b.disable());"connected"==c.toLowerCase()||"online"==c.toLowerCase()?(this.stopHostButton.enable(),this.stopHostButton.setText(_("Stop Daemon"))):"127.0.0.1"==a.get("host")||"localhost"==a.get("host")?(this.stopHostButton.enable(),this.stopHostButton.setText(_("Start Daemon"))):this.stopHostButton.disable()},onAddClick:function(a,b){this.addWindow||(this.addWindow=new Deluge.AddConnectionWindow,this.addWindow.on("hostadded",this.onHostChange,this));
-this.addWindow.show()},onEditClick:function(a,b){var c=this.list.getSelectedRecords()[0];c&&(this.editWindow||(this.editWindow=new Deluge.EditConnectionWindow,this.editWindow.on("hostedited",this.onHostChange,this)),this.editWindow.show(c))},onHostChange:function(){this.loadHosts()},onClose:function(a){this.hide()},onConnect:function(a){if(a=this.list.getSelectedRecords()[0]){var b=this,c=function(){deluge.client.web.disconnect({success:function(a){this.update(this);deluge.events.fire("disconnect")},
-scope:b})};"connected"==a.get("status").toLowerCase()?c():(-1<this.list.getStore().find("status","Connected",0,!1,!1)&&c(),deluge.client.web.connect(a.id,{success:function(a){deluge.client.reloadMethods();deluge.client.on("connected",function(a){deluge.events.fire("connect")},this,{single:!0})}}),this.hide())}},onGetHosts:function(a){this.list.getStore().loadData(a);Ext.each(a,function(a){deluge.client.web.get_host_status(a[0],{success:this.onGetHostStatus,scope:this})},this)},onGetHostStatus:function(a){var b=
-this.list.getStore().getById(a[0]);b.set("status",a[1]);b.set("version",a[2]);b.commit();(a=this.list.getSelectedRecords()[0])&&a==b&&this.updateButtons(b)},onHide:function(){this.running&&window.clearInterval(this.running)},onLogin:function(){deluge.config.first_login?Ext.MessageBox.confirm(_("Change Default Password"),_("We recommend changing the default password.<br><br>Would you like to change it now?"),function(a){this.checkConnected();"yes"==a&&(deluge.preferences.show(),deluge.preferences.selectPage("Interface"));
-deluge.client.web.set_config({first_login:!1})},this):this.checkConnected()},onLogout:function(){this.disconnect();!this.hidden&&this.rendered&&this.hide()},onRemoveClick:function(a){var b=this.list.getSelectedRecords()[0];b&&deluge.client.web.remove_host(b.id,{success:function(a){a?this.list.getStore().remove(b):Ext.MessageBox.show({title:_("Error"),msg:a[1],buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"})},scope:this})},onSelectionChanged:function(a,b){b[0]?
-(this.editHostButton.enable(),this.removeHostButton.enable(),this.stopHostButton.enable(),this.stopHostButton.setText(_("Stop Daemon")),this.updateButtons(this.list.getRecord(b[0]))):(this.editHostButton.disable(),this.removeHostButton.disable(),this.stopHostButton.disable())},onShow:function(){if(!this.addHostButton){var a=this.panel.getBottomToolbar();this.addHostButton=a.items.get("cm-add");this.editHostButton=a.items.get("cm-edit");this.removeHostButton=a.items.get("cm-remove");this.stopHostButton=
-a.items.get("cm-stop")}this.loadHosts();this.running||(this.running=window.setInterval(this.update,2E3,this))},onStopClick:function(a,b){var c=this.list.getSelectedRecords()[0];c&&("Offline"==c.get("status")?deluge.client.web.start_daemon(c.get("port")):deluge.client.web.stop_daemon(c.id,{success:function(a){a[0]||Ext.MessageBox.show({title:_("Error"),msg:a[1],buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"})}}))}});
-Deluge.CopyMagnet=Ext.extend(Ext.Window,{title:_("Copy Magnet URI"),width:375,closeAction:"hide",iconCls:"icon-magnet-copy",initComponent:function(){Deluge.CopyMagnet.superclass.initComponent.call(this);form=this.add({xtype:"form",defaultType:"textfield",hideLabels:!0});this.magnetURI=form.add({name:"URI",anchor:"100%"});this.addButton(_("Close"),this.onClose,this);this.addButton(_("Copy"),this.onCopy,this)},show:function(a){Deluge.CopyMagnet.superclass.show.call(this);a=deluge.torrents.getSelected();
-deluge.client.core.get_magnet_uri(a.id,{success:this.onRequestComplete,scope:this})},onRequestComplete:function(a){this.magnetURI.setValue(a)},onCopy:function(){this.magnetURI.focus();this.magnetURI.el.dom.select();document.execCommand("copy")},onClose:function(){this.hide()}});deluge.copyMagnetWindow=new Deluge.CopyMagnet;Ext.state.Manager.setProvider(new Ext.state.CookieProvider({expires:new Date((new Date).getTime()+31536E7)}));
-Ext.apply(Ext,{isObjectEmpty:function(a){for(var b in a)return!1;return!0},areObjectsEqual:function(a,b){var c=!0;if(!a||!b)return!1;for(var d in a)a[d]!=b[d]&&(c=!1);return c},keys:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b},values:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},splat:function(a){var b=Ext.type(a);return b?"array"!=b?[a]:a:[]}});Ext.getKeys=Ext.keys;Ext.BLANK_IMAGE_URL=deluge.config.base+"images/s.gif";
-Ext.USE_NATIVE_JSON=!0;
-Ext.apply(Deluge,{pluginStore:{},progressTpl:'<div class="x-progress-wrap x-progress-renderered"><div class="x-progress-inner"><div style="width: {2}px" class="x-progress-bar"><div style="z-index: 99; width: {3}px" class="x-progress-text"><div style="width: {1}px;">{0}</div></div></div><div class="x-progress-text x-progress-text-back"><div style="width: {1}px;">{0}</div></div></div></div>',progressBar:function(a,b,c,d){d=Ext.value(d,10);a=(b/100*a).toFixed(0);return String.format(Deluge.progressTpl,c,
-b,a-1,0<a-d?a-d:0)},createPlugin:function(a){return new Deluge.pluginStore[a]},hasPlugin:function(a){return Deluge.pluginStore[a]?!0:!1},registerPlugin:function(a,b){Deluge.pluginStore[a]=b}});deluge.plugins={};FILE_PRIORITY={"0":"Skip",1:"Low",2:"Low",3:"Low",4:"Normal",5:"High",6:"High",7:"High",9:"Mixed",Skip:0,Low:1,Normal:4,High:7,Mixed:9};
-FILE_PRIORITY_CSS={"0":"x-no-download",1:"x-low-download",2:"x-low-download",3:"x-low-download",4:"x-normal-download",5:"x-high-download",6:"x-high-download",7:"x-high-download",9:"x-mixed-download"};Ext.ns("Deluge");
-Deluge.EditConnectionWindow=Ext.extend(Ext.Window,{title:_("Edit Connection"),iconCls:"x-deluge-add-window-icon",layout:"fit",width:300,height:195,constrainHeader:!0,bodyStyle:"padding: 10px 5px;",closeAction:"hide",initComponent:function(){Deluge.EditConnectionWindow.superclass.initComponent.call(this);this.addEvents("hostedited");this.addButton(_("Close"),this.hide,this);this.addButton(_("Edit"),this.onEditClick,this);this.on("hide",this.onHide,this);this.form=this.add({xtype:"form",defaultType:"textfield",
-baseCls:"x-plain",labelWidth:60,items:[{fieldLabel:_("Host:"),labelSeparator:"",name:"host",anchor:"75%",value:""},{xtype:"spinnerfield",fieldLabel:_("Port:"),labelSeparator:"",name:"port",strategy:{xtype:"number",decimalPrecision:0,minValue:0,maxValue:65535},anchor:"40%",value:58846},{fieldLabel:_("Username:"),labelSeparator:"",name:"username",anchor:"75%",value:""},{fieldLabel:_("Password:"),labelSeparator:"",anchor:"75%",name:"password",inputType:"password",value:""}]})},show:function(a){Deluge.EditConnectionWindow.superclass.show.call(this);
-this.form.getForm().findField("host").setValue(a.get("host"));this.form.getForm().findField("port").setValue(a.get("port"));this.form.getForm().findField("username").setValue(a.get("user"));this.host_id=a.id},onEditClick:function(){var a=this.form.getForm().getValues();deluge.client.web.edit_host(this.host_id,a.host,Number(a.port),a.username,a.password,{success:function(a){a?this.fireEvent("hostedited"):(console.log(a),Ext.MessageBox.show({title:_("Error"),msg:String.format(_("Unable to edit host")),
-buttons:Ext.MessageBox.OK,modal:!1,icon:Ext.MessageBox.ERROR,iconCls:"x-deluge-icon-error"}));this.hide()},scope:this})},onHide:function(){this.form.getForm().reset()}});Ext.ns("Deluge");
-Deluge.EditTrackerWindow=Ext.extend(Ext.Window,{title:_("Edit Tracker"),layout:"fit",width:375,height:110,plain:!0,closable:!0,resizable:!1,constrainHeader:!0,bodyStyle:"padding: 5px",buttonAlign:"right",closeAction:"hide",iconCls:"x-deluge-edit-trackers",initComponent:function(){Deluge.EditTrackerWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("Save"),this.onSaveClick,this);this.on("hide",this.onHide,this);this.form=this.add({xtype:"form",
-defaultType:"textfield",baseCls:"x-plain",labelWidth:55,items:[{fieldLabel:_("Tracker:"),labelSeparator:"",name:"tracker",anchor:"100%"}]})},show:function(a){Deluge.EditTrackerWindow.superclass.show.call(this);this.record=a;this.form.getForm().findField("tracker").setValue(a.data.url)},onCancelClick:function(){this.hide()},onHide:function(){this.form.getForm().findField("tracker").setValue("")},onSaveClick:function(){var a=this.form.getForm().findField("tracker").getValue();this.record.set("url",
-a);this.record.commit();this.hide()}});Ext.ns("Deluge");
-Deluge.EditTrackersWindow=Ext.extend(Ext.Window,{title:_("Edit Trackers"),layout:"fit",width:350,height:220,plain:!0,closable:!0,resizable:!0,constrainHeader:!0,bodyStyle:"padding: 5px",buttonAlign:"right",closeAction:"hide",iconCls:"x-deluge-edit-trackers",initComponent:function(){Deluge.EditTrackersWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("OK"),this.onOkClick,this);this.addEvents("save");this.on("show",this.onShow,this);this.on("save",
-this.onSave,this);this.addWindow=new Deluge.AddTrackerWindow;this.addWindow.on("add",this.onAddTrackers,this);this.editWindow=new Deluge.EditTrackerWindow;this.list=new Ext.list.ListView({store:new Ext.data.JsonStore({root:"trackers",fields:["tier","url"]}),columns:[{header:_("Tier"),width:0.1,dataIndex:"tier"},{header:_("Tracker"),width:0.9,dataIndex:"url",tpl:new Ext.XTemplate("{url:htmlEncode}")}],columnSort:{sortClasses:["",""]},stripeRows:!0,singleSelect:!0,listeners:{dblclick:{fn:this.onListNodeDblClicked,
-scope:this},selectionchange:{fn:this.onSelect,scope:this}}});this.panel=this.add({items:[this.list],autoScroll:!0,bbar:new Ext.Toolbar({items:[{text:_("Up"),iconCls:"icon-up",handler:this.onUpClick,scope:this},{text:_("Down"),iconCls:"icon-down",handler:this.onDownClick,scope:this},"->",{text:_("Add"),iconCls:"icon-add",handler:this.onAddClick,scope:this},{text:_("Edit"),iconCls:"icon-edit-trackers",handler:this.onEditClick,scope:this},{text:_("Remove"),iconCls:"icon-remove",handler:this.onRemoveClick,
-scope:this}]})})},onAddClick:function(){this.addWindow.show()},onAddTrackers:function(a){var b=this.list.getStore();Ext.each(a,function(a){var d=!1,f=-1;b.each(function(b){b.get("tier")>f&&(f=b.get("tier"));if(a==b.get("tracker"))return d=!0,!1},this);d||b.add(new b.recordType({tier:f+1,url:a}))},this)},onCancelClick:function(){this.hide()},onEditClick:function(){var a=this.list.getSelectedRecords()[0];a&&this.editWindow.show(a)},onHide:function(){this.list.getStore().removeAll()},onListNodeDblClicked:function(a,
-b,c,d){this.editWindow.show(this.list.getRecord(c))},onOkClick:function(){var a=[];this.list.getStore().each(function(b){a.push({tier:b.get("tier"),url:b.get("url")})},this);deluge.client.core.set_torrent_trackers(this.torrentId,a,{failure:this.onSaveFail,scope:this});this.hide()},onRemoveClick:function(){var a=this.list.getSelectedRecords()[0];a&&this.list.getStore().remove(a)},onRequestComplete:function(a){this.list.getStore().loadData(a);this.list.getStore().sort("tier","ASC")},onSaveFail:function(){},
-onSelect:function(a){a.getSelectionCount()&&this.panel.getBottomToolbar().items.get(4).enable()},onShow:function(){this.panel.getBottomToolbar().items.get(4).disable();var a=deluge.torrents.getSelected();this.torrentId=a.id;deluge.client.core.get_torrent_status(a.id,["trackers"],{success:this.onRequestComplete,scope:this})},onDownClick:function(){var a=this.list.getSelectedRecords()[0];a&&(a.set("tier",a.get("tier")+1),a.store.sort("tier","ASC"),a.store.commitChanges(),this.list.select(a.store.indexOf(a)))},
-onUpClick:function(){var a=this.list.getSelectedRecords()[0];a&&0!=a.get("tier")&&(a.set("tier",a.get("tier")-1),a.store.sort("tier","ASC"),a.store.commitChanges(),this.list.select(a.store.indexOf(a)))}});
-Deluge.EventsManager=Ext.extend(Ext.util.Observable,{constructor:function(){this.toRegister=[];this.on("login",this.onLogin,this);Deluge.EventsManager.superclass.constructor.call(this)},addListener:function(a,b,c,d){this.addEvents(a);/[A-Z]/.test(a.substring(0,1))&&(deluge.client?deluge.client.web.register_event_listener(a):this.toRegister.push(a));Deluge.EventsManager.superclass.addListener.call(this,a,b,c,d)},getEvents:function(){deluge.client.web.get_events({success:this.onGetEventsSuccess,failure:this.onGetEventsFailure,
-scope:this})},start:function(){Ext.each(this.toRegister,function(a){deluge.client.web.register_event_listener(a)});this.running=!0;this.errorCount=0;this.getEvents()},stop:function(){this.running=!1},onLogin:function(){this.start()},onGetEventsSuccess:function(a){this.running&&(a&&Ext.each(a,function(a){var c=a[1];c.splice(0,0,a[0]);this.fireEvent.apply(this,c)},this),this.getEvents())},onGetEventsFailure:function(a,b){this.running&&(!b.isTimeout&&3<=this.errorCount++?this.stop():this.getEvents())}});
-Deluge.EventsManager.prototype.on=Deluge.EventsManager.prototype.addListener;Deluge.EventsManager.prototype.fire=Deluge.EventsManager.prototype.fireEvent;deluge.events=new Deluge.EventsManager;Ext.namespace("Deluge");
-Deluge.FileBrowser=Ext.extend(Ext.Window,{title:_("File Browser"),width:500,height:400,initComponent:function(){Deluge.FileBrowser.superclass.initComponent.call(this);this.add({xtype:"toolbar",items:[{text:_("Back"),iconCls:"icon-back"},{text:_("Forward"),iconCls:"icon-forward"},{text:_("Up"),iconCls:"icon-up"},{text:_("Home"),iconCls:"icon-home"}]})}});Ext.ns("Deluge");
-Deluge.FilterPanel=Ext.extend(Ext.Panel,{autoScroll:!0,border:!1,show_zero:null,initComponent:function(){Deluge.FilterPanel.superclass.initComponent.call(this);this.filterType=this.initialConfig.filter;var a="";"state"==this.filterType?a=_("States"):"tracker_host"==this.filterType?a=_("Trackers"):"owner"==this.filterType?a=_("Owner"):"label"==this.filterType?a=_("Labels"):(a=this.filterType.replace("_"," "),parts=a.split(" "),a="",Ext.each(parts,function(b){fl=b.substring(0,1).toUpperCase();a+=fl+
-b.substring(1)+" "}));this.setTitle(_(a));var b=Deluge.FilterPanel.templates[this.filterType]?Deluge.FilterPanel.templates[this.filterType]:'<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>';this.list=this.add({xtype:"listview",singleSelect:!0,hideHeaders:!0,reserveScrollOffset:!0,store:new Ext.data.ArrayStore({idIndex:0,fields:["filter","count"]}),columns:[{id:"filter",sortable:!1,tpl:b,dataIndex:"filter"}]});this.relayEvents(this.list,["selectionchange"])},getState:function(){if(this.list.getSelectionCount()){var a=
-this.list.getSelectedRecords()[0];if(a&&"All"!=a.id)return a.id}},getStates:function(){return this.states},getStore:function(){return this.list.getStore()},updateStates:function(a){this.states={};Ext.each(a,function(a){this.states[a[0]]=a[1]},this);if(!(null==this.show_zero?deluge.config.sidebar_show_zero:this.show_zero)){var b=[];Ext.each(a,function(a){(0<a[1]||"All"==a[0])&&b.push(a)});a=b}var c=this.getStore(),d={};Ext.each(a,function(a,b){var e=c.getById(a[0]);e||(e=new c.recordType({filter:a[0],
-count:a[1]}),e.id=a[0],c.insert(b,e));e.beginEdit();e.set("filter",_(a[0]));e.set("count",a[1]);e.endEdit();d[a[0]]=!0},this);c.each(function(a){if(!d[a.id]){c.remove(a);var b=this.list.getSelectedRecords()[0];b&&b.id==a.id&&this.list.select(0)}},this);c.commitChanges();this.list.getSelectionCount()||this.list.select(0)}});Deluge.FilterPanel.templates={tracker_host:'<div class="x-deluge-filter" style="background-image: url('+deluge.config.base+'tracker/{filter});">{filter:htmlEncode} ({count})</div>'};
-Deluge.Formatters=function(){var a={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#39;"},b=RegExp("("+Object.keys(a).join("|")+")","g"),c=function(b,c){return a[c]};return Formatters={date:function(a){function b(a,c){for(var d=a+"";d.length<c;)d="0"+d;return d}a=new Date(1E3*a);return String.format("{0}/{1}/{2} {3}:{4}:{5}",b(a.getDate(),2),b(a.getMonth()+1,2),a.getFullYear(),b(a.getHours(),2),b(a.getMinutes(),2),b(a.getSeconds(),2))},size:function(a,b){if(!a&&!b)return"";a/=1024;if(1024>a)return a.toFixed(1)+
-" KiB";a/=1024;return 1024>a?a.toFixed(1)+" MiB":(a/1024).toFixed(1)+" GiB"},sizeShort:function(a,b){if(!a&&!b)return"";a/=1024;if(1024>a)return a.toFixed(1)+" K";a/=1024;return 1024>a?a.toFixed(1)+" M":(a/1024).toFixed(1)+" G"},speed:function(a,b){return!a&&!b?"":fsize(a,b)+"/s"},timeRemaining:function(a){if(0>=a)return"&infin;";a=a.toFixed(0);if(60>a)return a+"s";a/=60;if(60>a){var b=Math.floor(a);a=Math.round(60*(a-b));return 0<a?b+"m "+a+"s":b+"m"}a/=60;if(24>a){var c=Math.floor(a),b=Math.round(60*
-(a-c));return 0<b?c+"h "+b+"m":c+"h"}a/=24;b=Math.floor(a);c=Math.round(24*(a-b));return 0<c?b+"d "+c+"h":b+"d"},plain:function(a){return a},cssClassEscape:function(a){return a.toLowerCase().replace(".","_")},htmlEncode:function(a){return!a?a:String(a).replace(b,c)}}}();var fsize=Deluge.Formatters.size,fsize_short=Deluge.Formatters.sizeShort,fspeed=Deluge.Formatters.speed,ftime=Deluge.Formatters.timeRemaining,fdate=Deluge.Formatters.date,fplain=Deluge.Formatters.plain;
-Ext.util.Format.cssClassEscape=Deluge.Formatters.cssClassEscape;Ext.util.Format.htmlEncode=Deluge.Formatters.htmlEncode;
-Deluge.Keys={Grid:"queue name total_wanted state progress num_seeds total_seeds num_peers total_peers download_payload_rate upload_payload_rate eta ratio distributed_copies is_auto_managed time_added tracker_host download_location last_seen_complete total_done total_uploaded max_download_speed max_upload_speed seeds_peers_ratio total_remaining completed_time time_since_transfer".split(" "),Status:"total_done total_payload_download total_uploaded total_payload_upload next_announce tracker_status num_pieces piece_length is_auto_managed active_time seeding_time time_since_transfer seed_rank last_seen_complete completed_time owner public shared".split(" "),
-Files:["files","file_progress","file_priorities"],Peers:["peers"],Details:"name download_location total_size num_files message tracker_host comment creator".split(" "),Options:"max_download_speed max_upload_speed max_connections max_upload_slots is_auto_managed stop_at_ratio stop_ratio remove_at_ratio private prioritize_first_last move_completed move_completed_path super_seeding".split(" ")};Ext.each(Deluge.Keys.Grid,function(a){Deluge.Keys.Status.push(a)});
-Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:!0,bodyStyle:"padding: 10px 5px;",buttonAlign:"center",closable:!1,closeAction:"hide",iconCls:"x-deluge-login-window-icon",layout:"fit",modal:!0,plain:!0,resizable:!1,title:_("Login"),width:300,height:120,initComponent:function(){Deluge.LoginWindow.superclass.initComponent.call(this);this.on("show",this.onShow,this);this.addButton({text:_("Login"),handler:this.onLogin,scope:this});this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:120,
-labelAlign:"right",defaults:{width:110},defaultType:"textfield"});this.passwordField=this.form.add({xtype:"textfield",fieldLabel:_("Password:"),labelSeparator:"",grow:!0,growMin:"110",growMax:"145",id:"_password",name:"password",inputType:"password"});this.passwordField.on("specialkey",this.onSpecialKey,this)},logout:function(){deluge.events.fire("logout");deluge.client.auth.delete_session({success:function(a){this.show(!0)},scope:this})},show:function(a){this.firstShow&&(deluge.client.on("error",
-this.onClientError,this),this.firstShow=!1);if(a)return Deluge.LoginWindow.superclass.show.call(this);deluge.client.auth.check_session({success:function(a){a?deluge.events.fire("login"):this.show(!0)},failure:function(a){this.show(!0)},scope:this})},onSpecialKey:function(a,b){if(13==b.getKey())this.onLogin()},onLogin:function(){var a=this.passwordField;deluge.client.auth.login(a.getValue(),{success:function(b){b?(deluge.events.fire("login"),this.hide(),a.setRawValue("")):Ext.MessageBox.show({title:_("Login Failed"),
-msg:_("You entered an incorrect password"),buttons:Ext.MessageBox.OK,modal:!1,fn:function(){a.focus(!0,10)},icon:Ext.MessageBox.WARNING,iconCls:"x-deluge-icon-warning"})},scope:this})},onClientError:function(a,b,c){1==a.error.code&&(deluge.events.fire("logout"),this.show(!0))},onShow:function(){this.passwordField.focus(!0,300)}});
-deluge.menus={onTorrentActionSetOpt:function(a,b){var c=deluge.torrents.getSelectedIds(),d=a.initialConfig.torrentAction,f={};f[d[0]]=d[1];deluge.client.core.set_torrent_options(c,f)},onTorrentActionMethod:function(a,b){var c=deluge.torrents.getSelectedIds();deluge.client.core[a.initialConfig.torrentAction](c,{success:function(){deluge.ui.update()}})},onTorrentActionShow:function(a,b){var c=deluge.torrents.getSelectedIds();switch(a.initialConfig.torrentAction){case "copy_magnet":deluge.copyMagnetWindow.show();
-break;case "edit_trackers":deluge.editTrackers.show();break;case "remove":deluge.removeWindow.show(c);break;case "move":deluge.moveStorage.show(c)}}};
-deluge.menus.torrent=new Ext.menu.Menu({id:"torrentMenu",items:[{torrentAction:"pause_torrent",text:_("Pause"),iconCls:"icon-pause",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},{torrentAction:"resume_torrent",text:_("Resume"),iconCls:"icon-resume",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},"-",{text:_("Options"),iconCls:"icon-options",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{text:_("D/L Speed Limit"),iconCls:"x-deluge-downloading",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:["max_download_speed",
-5],text:_("5 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_download_speed",10],text:_("10 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_download_speed",30],text:_("30 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_download_speed",80],text:_("80 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_download_speed",300],text:_("300 KiB/s"),
-handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_download_speed",-1],text:_("Unlimited"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus}]})},{text:_("U/L Speed Limit"),iconCls:"x-deluge-seeding",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:["max_upload_speed",5],text:_("5 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_speed",10],text:_("10 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,
-scope:deluge.menus},{torrentAction:["max_upload_speed",30],text:_("30 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_speed",80],text:_("80 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_speed",300],text:_("300 KiB/s"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_speed",-1],text:_("Unlimited"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus}]})},
-{text:_("Connection Limit"),iconCls:"x-deluge-connections",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:["max_connections",50],text:"50",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_connections",100],text:"100",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_connections",200],text:"200",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_connections",300],text:"300",handler:deluge.menus.onTorrentActionSetOpt,
-scope:deluge.menus},{torrentAction:["max_connections",500],text:"500",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_connections",-1],text:_("Unlimited"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus}]})},{text:_("Upload Slot Limit"),iconCls:"icon-upload-slots",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:["max_upload_slots",0],text:"0",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_slots",
-1],text:"1",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_slots",2],text:"2",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_slots",3],text:"3",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_slots",5],text:"5",handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["max_upload_slots",-1],text:_("Unlimited"),handler:deluge.menus.onTorrentActionSetOpt,
-scope:deluge.menus}]})},{id:"auto_managed",text:_("Auto Managed"),hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:["auto_managed",!0],text:_("On"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus},{torrentAction:["auto_managed",!1],text:_("Off"),handler:deluge.menus.onTorrentActionSetOpt,scope:deluge.menus}]})}]})},"-",{text:_("Queue"),iconCls:"icon-queue",hideOnClick:!1,menu:new Ext.menu.Menu({items:[{torrentAction:"queue_top",text:_("Top"),iconCls:"icon-top",handler:deluge.menus.onTorrentActionMethod,
-scope:deluge.menus},{torrentAction:"queue_up",text:_("Up"),iconCls:"icon-up",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},{torrentAction:"queue_down",text:_("Down"),iconCls:"icon-down",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},{torrentAction:"queue_bottom",text:_("Bottom"),iconCls:"icon-bottom",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus}]})},"-",{torrentAction:"copy_magnet",text:_("Copy Magnet URI"),iconCls:"icon-magnet-copy",handler:deluge.menus.onTorrentActionShow,
-scope:deluge.menus},{torrentAction:"force_reannounce",text:_("Update Tracker"),iconCls:"icon-update-tracker",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},{torrentAction:"edit_trackers",text:_("Edit Trackers"),iconCls:"icon-edit-trackers",handler:deluge.menus.onTorrentActionShow,scope:deluge.menus},"-",{torrentAction:"remove",text:_("Remove Torrent"),iconCls:"icon-remove",handler:deluge.menus.onTorrentActionShow,scope:deluge.menus},"-",{torrentAction:"force_recheck",text:_("Force Recheck"),
-iconCls:"icon-recheck",handler:deluge.menus.onTorrentActionMethod,scope:deluge.menus},{torrentAction:"move",text:_("Move Download Folder"),iconCls:"icon-move",handler:deluge.menus.onTorrentActionShow,scope:deluge.menus}]});
-deluge.menus.filePriorities=new Ext.menu.Menu({id:"filePrioritiesMenu",items:[{id:"expandAll",text:_("Expand All"),iconCls:"icon-expand-all"},"-",{id:"skip",text:_("Skip"),iconCls:"icon-do-not-download",filePriority:FILE_PRIORITY.Skip},{id:"low",text:_("Low"),iconCls:"icon-low",filePriority:FILE_PRIORITY.Low},{id:"normal",text:_("Normal"),iconCls:"icon-normal",filePriority:FILE_PRIORITY.Normal},{id:"high",text:_("High"),iconCls:"icon-high",filePriority:FILE_PRIORITY.High}]});Ext.namespace("Deluge");
-Deluge.MoveStorage=Ext.extend(Ext.Window,{constructor:function(a){a=Ext.apply({title:_("Move Download Folder"),width:375,height:110,layout:"fit",buttonAlign:"right",closeAction:"hide",closable:!0,iconCls:"x-deluge-move-storage",plain:!0,constrainHeader:!0,resizable:!1},a);Deluge.MoveStorage.superclass.constructor.call(this,a)},initComponent:function(){Deluge.MoveStorage.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancel,this);this.addButton(_("Move"),this.onMove,this);this.form=
-this.add({xtype:"form",border:!1,defaultType:"textfield",width:300,bodyStyle:"padding: 5px"});this.moveLocation=this.form.add({fieldLabel:_("Download Folder"),name:"location",width:240})},hide:function(){Deluge.MoveStorage.superclass.hide.call(this);this.torrentIds=null},show:function(a){Deluge.MoveStorage.superclass.show.call(this);this.torrentIds=a},onCancel:function(){this.hide()},onMove:function(){var a=this.moveLocation.getValue();deluge.client.core.move_storage(this.torrentIds,a);this.hide()}});
-deluge.moveStorage=new Deluge.MoveStorage;
-Deluge.MultiOptionsManager=Ext.extend(Deluge.OptionsManager,{constructor:function(a){this.currentId=null;this.stored={};Deluge.MultiOptionsManager.superclass.constructor.call(this,a)},changeId:function(a,b){var c=this.currentId;this.currentId=a;if(!b)for(var d in this.options)this.binds[d]&&Ext.each(this.binds[d],function(a){a.setValue(this.get(d))},this);return c},commit:function(){this.stored[this.currentId]=Ext.apply(this.stored[this.currentId],this.changed[this.currentId]);this.reset()},get:function(){if(1==
-arguments.length){var a=arguments[0];return this.isDirty(a)?this.changed[this.currentId][a]:this.getDefault(a)}if(0==arguments.length){var b={};for(a in this.options)b[a]=this.isDirty(a)?this.changed[this.currentId][a]:this.getDefault(a)}else b={},Ext.each(arguments,function(a){b[a]=this.isDirty(a)?this.changed[this.currentId][a]:this.getDefault(a)},this);return b},getDefault:function(a){return this.has(a)?this.stored[this.currentId][a]:this.options[a]},getDirty:function(){return this.changed[this.currentId]?
-this.changed[this.currentId]:{}},isDirty:function(a){return this.changed[this.currentId]&&!Ext.isEmpty(this.changed[this.currentId][a])},has:function(a){return this.stored[this.currentId]&&!Ext.isEmpty(this.stored[this.currentId][a])},reset:function(){this.changed[this.currentId]&&delete this.changed[this.currentId];this.stored[this.currentId]&&delete this.stored[this.currentId]},resetAll:function(){this.changed={};this.stored={};this.changeId(null)},setDefault:function(a,b){if(void 0!==a)if(void 0===
-b)for(var c in a)this.setDefault(c,a[c]);else c=this.getDefault(a),b=this.convertValueType(c,b),c!=b&&(this.stored[this.currentId]||(this.stored[this.currentId]={}),this.stored[this.currentId][a]=b,this.isDirty(a)||this.fireEvent("changed",a,b,c))},update:function(a,b){if(void 0!==a)if(void 0===b)for(var c in a)this.update(c,a[c]);else{this.changed[this.currentId]||(this.changed[this.currentId]={});c=this.getDefault(a);b=this.convertValueType(c,b);var d=this.get(a);d!=b&&(c==b?this.isDirty(a)&&delete this.changed[this.currentId][a]:
-this.changed[this.currentId][a]=b,this.fireEvent("changed",a,b,d))}}});Ext.ns("Deluge");
-Deluge.OtherLimitWindow=Ext.extend(Ext.Window,{layout:"fit",width:210,height:100,constrainHeader:!0,closeAction:"hide",initComponent:function(){Deluge.OtherLimitWindow.superclass.initComponent.call(this);this.form=this.add({xtype:"form",baseCls:"x-plain",bodyStyle:"padding: 5px",layout:"hbox",layoutConfig:{pack:"start"},items:[{xtype:"spinnerfield",name:"limit"}]});this.initialConfig.unit?this.form.add({border:!1,baseCls:"x-plain",bodyStyle:"padding: 5px",html:this.initialConfig.unit}):this.setSize(180,
-100);this.addButton(_("Cancel"),this.onCancelClick,this);this.addButton(_("OK"),this.onOkClick,this);this.afterMethod("show",this.doFocusField,this)},setValue:function(a){this.form.getForm().setValues({limit:a})},onCancelClick:function(){this.form.getForm().reset();this.hide()},onOkClick:function(){var a={};a[this.group]=this.form.getForm().getValues().limit;deluge.client.core.set_config(a,{success:function(){deluge.ui.update()}});this.hide()},doFocusField:function(){this.form.getForm().findField("limit").focus(!0,
-10)}});Ext.ns("Deluge");
-Deluge.Plugin=Ext.extend(Ext.util.Observable,{name:null,constructor:function(a){this.isDelugePlugin=!0;this.addEvents({enabled:!0,disabled:!0});Deluge.Plugin.superclass.constructor.call(this,a)},disable:function(){this.fireEvent("disabled",this);if(this.onDisable)this.onDisable()},enable:function(){deluge.client.reloadMethods();this.fireEvent("enable",this);if(this.onEnable)this.onEnable()},registerTorrentStatus:function(a,b,c){c=c||{};var d=c.colCfg||{};c=c.storeCfg||{};c=Ext.apply(c,{name:a});deluge.torrents.meta.fields.push(c);
-deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);d=Ext.apply(d,{header:b,dataIndex:a});b=deluge.torrents.columns.slice(0);b.push(d);deluge.torrents.colModel.setConfig(b);deluge.torrents.columns=b;Deluge.Keys.Grid.push(a);deluge.torrents.getView().refresh(!0)},deregisterTorrentStatus:function(a){var b=[];Ext.each(deluge.torrents.meta.fields,function(c){c.name!=a&&b.push(c)});deluge.torrents.meta.fields=b;deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);var c=
-[];Ext.each(deluge.torrents.columns,function(b){b.dataIndex!=a&&c.push(b)});deluge.torrents.colModel.setConfig(c);deluge.torrents.columns=c;var d=[];Ext.each(Deluge.Keys.Grid,function(b){b==a&&d.push(b)});Deluge.Keys.Grid=d;deluge.torrents.getView().refresh(!0)}});Ext.ns("Deluge.plugins");
-Deluge.RemoveWindow=Ext.extend(Ext.Window,{title:_("Remove Torrent"),layout:"fit",width:350,height:100,constrainHeader:!0,buttonAlign:"right",closeAction:"hide",closable:!0,iconCls:"x-deluge-remove-window-icon",plain:!0,bodyStyle:"padding: 5px; padding-left: 10px;",html:"Are you sure you wish to remove the torrent (s)?",initComponent:function(){Deluge.RemoveWindow.superclass.initComponent.call(this);this.addButton(_("Cancel"),this.onCancel,this);this.addButton(_("Remove With Data"),this.onRemoveData,
-this);this.addButton(_("Remove Torrent"),this.onRemove,this)},remove:function(a){deluge.client.core.remove_torrents(this.torrentIds,a,{success:function(a){!0==a&&console.log("Error(s) occured when trying to delete torrent(s).");this.onRemoved(this.torrentIds)},scope:this,torrentIds:this.torrentIds})},show:function(a){Deluge.RemoveWindow.superclass.show.call(this);this.torrentIds=a},onCancel:function(){this.hide();this.torrentIds=null},onRemove:function(){this.remove(!1)},onRemoveData:function(){this.remove(!0)},
-onRemoved:function(a){deluge.events.fire("torrentsRemoved",a);this.hide();deluge.ui.update()}});deluge.removeWindow=new Deluge.RemoveWindow;
-Deluge.Sidebar=Ext.extend(Ext.Panel,{panels:{},selected:null,constructor:function(a){a=Ext.apply({id:"sidebar",region:"west",cls:"deluge-sidebar",title:_("Filters"),layout:"accordion",split:!0,width:200,minSize:100,collapsible:!0},a);Deluge.Sidebar.superclass.constructor.call(this,a)},initComponent:function(){Deluge.Sidebar.superclass.initComponent.call(this);deluge.events.on("disconnect",this.onDisconnect,this)},createFilter:function(a,b){var c=new Deluge.FilterPanel({filter:a});c.on("selectionchange",
-function(a,b){deluge.ui.update()});this.add(c);this.doLayout();this.panels[a]=c;c.header.on("click",function(a){deluge.config.sidebar_multiple_filters||deluge.ui.update();c.list.getSelectionCount()||c.list.select(0)});this.fireEvent("filtercreate",this,c);c.updateStates(b);this.fireEvent("afterfiltercreate",this,c)},getFilter:function(a){return this.panels[a]},getFilterStates:function(){var a={};if(deluge.config.sidebar_multiple_filters)this.items.each(function(b){var c=b.getState();null!=c&&(a[b.filterType]=
-c)},this);else{var b=this.getLayout().activeItem;if(b){var c=b.getState();if(null==!c)return;a[b.filterType]=c}}return a},hasFilter:function(a){return this.panels[a]?!0:!1},onDisconnect:function(){for(var a in this.panels)this.remove(this.panels[a]);this.panels={};this.selected=null},onFilterSelect:function(a,b,c){deluge.ui.update()},update:function(a){for(var b in a){var c=a[b];-1<Ext.getKeys(this.panels).indexOf(b)?this.panels[b].updateStates(c):this.createFilter(b,c)}Ext.each(Ext.keys(this.panels),
-function(b){-1==Ext.keys(a).indexOf(b)&&(this.remove(this.panels[b]),this.doLayout(),delete this.panels[b])},this)}});Ext.namespace("Deluge");
-Deluge.Statusbar=Ext.extend(Ext.ux.StatusBar,{constructor:function(a){a=Ext.apply({id:"deluge-statusbar",defaultIconCls:"x-deluge-statusbar x-not-connected",defaultText:_("Not Connected")},a);Deluge.Statusbar.superclass.constructor.call(this,a)},initComponent:function(){Deluge.Statusbar.superclass.initComponent.call(this);deluge.events.on("connect",this.onConnect,this);deluge.events.on("disconnect",this.onDisconnect,this)},createButtons:function(){this.buttons=this.add({id:"statusbar-connections",
-text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-connections",tooltip:_("Connections"),menu:new Deluge.StatusbarMenu({items:[{text:"50",value:"50",group:"max_connections_global",checked:!1},{text:"100",value:"100",group:"max_connections_global",checked:!1},{text:"200",value:"200",group:"max_connections_global",checked:!1},{text:"300",value:"300",group:"max_connections_global",checked:!1},{text:"500",value:"500",group:"max_connections_global",checked:!1},{text:_("Unlimited"),value:"-1",group:"max_connections_global",
-checked:!1},"-",{text:_("Other"),value:"other",group:"max_connections_global",checked:!1}],otherWin:{title:_("Set Maximum Connections")}})},"-",{id:"statusbar-downspeed",text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-downloading",tooltip:_("Download Speed"),menu:new Deluge.StatusbarMenu({items:[{value:"5",text:_("5 KiB/s"),group:"max_download_speed",checked:!1},{value:"10",text:_("10 KiB/s"),group:"max_download_speed",checked:!1},{value:"30",text:_("30 KiB/s"),group:"max_download_speed",checked:!1},
-{value:"80",text:_("80 KiB/s"),group:"max_download_speed",checked:!1},{value:"300",text:_("300 KiB/s"),group:"max_download_speed",checked:!1},{value:"-1",text:_("Unlimited"),group:"max_download_speed",checked:!1},"-",{value:"other",text:_("Other"),group:"max_download_speed",checked:!1}],otherWin:{title:_("Set Maximum Download Speed"),unit:_("KiB/s")}})},"-",{id:"statusbar-upspeed",text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-seeding",tooltip:_("Upload Speed"),menu:new Deluge.StatusbarMenu({items:[{value:"5",
-text:_("5 KiB/s"),group:"max_upload_speed",checked:!1},{value:"10",text:_("10 KiB/s"),group:"max_upload_speed",checked:!1},{value:"30",text:_("30 KiB/s"),group:"max_upload_speed",checked:!1},{value:"80",text:_("80 KiB/s"),group:"max_upload_speed",checked:!1},{value:"300",text:_("300 KiB/s"),group:"max_upload_speed",checked:!1},{value:"-1",text:_("Unlimited"),group:"max_upload_speed",checked:!1},"-",{value:"other",text:_("Other"),group:"max_upload_speed",checked:!1}],otherWin:{title:_("Set Maximum Upload Speed"),
-unit:_("KiB/s")}})},"-",{id:"statusbar-traffic",text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-traffic",tooltip:_("Protocol Traffic Download/Upload"),handler:function(){deluge.preferences.show();deluge.preferences.selectPage("Network")}},"-",{id:"statusbar-externalip",text:" ",cls:"x-btn-text",tooltip:_("External IP Address")},"-",{id:"statusbar-dht",text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-dht",tooltip:_("DHT Nodes")},"-",{id:"statusbar-freespace",text:" ",cls:"x-btn-text-icon",iconCls:"x-deluge-freespace",
-tooltip:_("Freespace in download folder"),handler:function(){deluge.preferences.show();deluge.preferences.selectPage("Downloads")}});this.created=!0},onConnect:function(){this.setStatus({iconCls:"x-connected",text:""});this.created?Ext.each(this.buttons,function(a){a.show();a.enable()}):this.createButtons();this.doLayout()},onDisconnect:function(){this.clearStatus({useDefaults:!0});Ext.each(this.buttons,function(a){a.hide();a.disable()});this.doLayout()},update:function(a){function b(a){return a+
-" KiB/s"}if(a){var c=function(a,b){var c=this.items.get("statusbar-"+a);if(0<b.limit.value)var e=b.value.formatter?b.value.formatter(b.value.value,!0):b.value.value,l=b.limit.formatter?b.limit.formatter(b.limit.value,!0):b.limit.value,e=String.format(b.format,e,l);else e=b.value.formatter?b.value.formatter(b.value.value,!0):b.value.value;c.setText(e);c.menu&&c.menu.setValue(b.limit.value)}.createDelegate(this);c("connections",{value:{value:a.num_connections},limit:{value:a.max_num_connections},format:"{0} ({1})"});
-c("downspeed",{value:{value:a.download_rate,formatter:Deluge.Formatters.speed},limit:{value:a.max_download,formatter:b},format:"{0} ({1})"});c("upspeed",{value:{value:a.upload_rate,formatter:Deluge.Formatters.speed},limit:{value:a.max_upload,formatter:b},format:"{0} ({1})"});c("traffic",{value:{value:a.download_protocol_rate,formatter:Deluge.Formatters.speed},limit:{value:a.upload_protocol_rate,formatter:Deluge.Formatters.speed},format:"{0}/{1}"});this.items.get("statusbar-dht").setText(a.dht_nodes);
-this.items.get("statusbar-freespace").setText(0<=a.free_space?fsize(a.free_space):_("Error"));this.items.get("statusbar-externalip").setText(String.format(_("<b>IP</b> {0}"),a.external_ip?a.external_ip:_("n/a")))}}});
-Deluge.Toolbar=Ext.extend(Ext.Toolbar,{constructor:function(a){a=Ext.apply({items:[{id:"tbar-deluge-text",text:_("Deluge"),iconCls:"x-deluge-main-panel",handler:this.onAboutClick},new Ext.Toolbar.Separator,{id:"create",disabled:!0,hidden:!0,text:_("Create"),iconCls:"icon-create",handler:this.onTorrentAction},{id:"add",disabled:!0,text:_("Add"),iconCls:"icon-add",handler:this.onTorrentAdd},{id:"remove",disabled:!0,text:_("Remove"),iconCls:"icon-remove",handler:this.onTorrentAction},new Ext.Toolbar.Separator,
-{id:"pause",disabled:!0,text:_("Pause"),iconCls:"icon-pause",handler:this.onTorrentAction},{id:"resume",disabled:!0,text:_("Resume"),iconCls:"icon-resume",handler:this.onTorrentAction},new Ext.Toolbar.Separator,{id:"up",cls:"x-btn-text-icon",disabled:!0,text:_("Up"),iconCls:"icon-up",handler:this.onTorrentAction},{id:"down",disabled:!0,text:_("Down"),iconCls:"icon-down",handler:this.onTorrentAction},new Ext.Toolbar.Separator,{id:"preferences",text:_("Preferences"),iconCls:"x-deluge-preferences",handler:this.onPreferencesClick,
-scope:this},{id:"connectionman",text:_("Connection Manager"),iconCls:"x-deluge-connection-manager",handler:this.onConnectionManagerClick,scope:this},"->",{id:"help",iconCls:"icon-help",text:_("Help"),handler:this.onHelpClick,scope:this},{id:"logout",iconCls:"icon-logout",disabled:!0,text:_("Logout"),handler:this.onLogout,scope:this}]},a);Deluge.Toolbar.superclass.constructor.call(this,a)},connectedButtons:"add remove pause resume up down".split(" "),initComponent:function(){Deluge.Toolbar.superclass.initComponent.call(this);
-deluge.events.on("connect",this.onConnect,this);deluge.events.on("login",this.onLogin,this)},onConnect:function(){Ext.each(this.connectedButtons,function(a){this.items.get(a).enable()},this)},onDisconnect:function(){Ext.each(this.connectedButtons,function(a){this.items.get(a).disable()},this)},onLogin:function(){this.items.get("logout").enable()},onLogout:function(){this.items.get("logout").disable();deluge.login.logout()},onConnectionManagerClick:function(){deluge.connectionManager.show()},onHelpClick:function(){window.open("http://dev.deluge-torrent.org/wiki/UserGuide")},
-onAboutClick:function(){(new Deluge.about.AboutWindow).show()},onPreferencesClick:function(){deluge.preferences.show()},onTorrentAction:function(a){var b=deluge.torrents.getSelections(),c=[];Ext.each(b,function(a){c.push(a.id)});switch(a.id){case "remove":deluge.removeWindow.show(c);break;case "pause":case "resume":deluge.client.core[a.id+"_torrent"](c,{success:function(){deluge.ui.update()}});break;case "up":case "down":deluge.client.core["queue_"+a.id](c,{success:function(){deluge.ui.update()}})}},
-onTorrentAdd:function(){deluge.add.show()}});
-(function(){function a(a){if(a)return fspeed(a)}function b(a){return-1==a?"":fspeed(1024*a)}function c(a,b,c){return 0>a?"&infin;":parseFloat((new Number(a)).toFixed(3))}function d(a){return 0<a?fdate(a):_("Never")}Deluge.TorrentGrid=Ext.extend(Ext.grid.GridPanel,{torrents:{},columns:[{id:"queue",header:"#",width:30,sortable:!0,renderer:function(a){return-1==a?"":a+1},dataIndex:"queue"},{id:"name",header:_("Name"),width:150,sortable:!0,renderer:function(a,b,c){return String.format('<div class="torrent-name x-deluge-{0}">{1}</div>',
-c.data.state.toLowerCase(),Ext.util.Format.htmlEncode(a))},dataIndex:"name"},{header:_("Size"),width:75,sortable:!0,renderer:fsize,dataIndex:"total_wanted"},{header:_("Progress"),width:150,sortable:!0,renderer:function(a,b,c){a=new Number(a);c=_(c.data.state)+" "+a.toFixed(2)+"%";b=new Number((this.style?this.style:b.style).match(/\w+:\s*(\d+)\w+/)[1]);return Deluge.progressBar(a,b-8,c)},dataIndex:"progress"},{header:_("Seeds"),hidden:!0,width:60,sortable:!0,renderer:function(a,b,c){return-1<c.data.total_seeds?
-String.format("{0} ({1})",a,c.data.total_seeds):a},dataIndex:"num_seeds"},{header:_("Peers"),hidden:!0,width:60,sortable:!0,renderer:function(a,b,c){return-1<c.data.total_peers?String.format("{0} ({1})",a,c.data.total_peers):a},dataIndex:"num_peers"},{header:_("Down Speed"),width:80,sortable:!0,renderer:a,dataIndex:"download_payload_rate"},{header:_("Up Speed"),width:80,sortable:!0,renderer:a,dataIndex:"upload_payload_rate"},{header:_("ETA"),width:60,sortable:!0,renderer:function(a){return 0===a?
-"":-1>=a?"&infin;":ftime(a)},dataIndex:"eta"},{header:_("Ratio"),hidden:!0,width:60,sortable:!0,renderer:c,dataIndex:"ratio"},{header:_("Avail"),hidden:!0,width:60,sortable:!0,renderer:c,dataIndex:"distributed_copies"},{header:_("Added"),hidden:!0,width:80,sortable:!0,renderer:fdate,dataIndex:"time_added"},{header:_("Complete Seen"),hidden:!0,width:80,sortable:!0,renderer:d,dataIndex:"last_seen_complete"},{header:_("Completed"),hidden:!0,width:80,sortable:!0,renderer:d,dataIndex:"completed_time"},
-{header:_("Tracker"),hidden:!0,width:120,sortable:!0,renderer:function(a,b,c){return String.format('<div style="background: url('+deluge.config.base+'tracker/{0}) no-repeat; padding-left: 20px;">{0}</div>',Ext.util.Format.htmlEncode(a))},dataIndex:"tracker_host"},{header:_("Download Folder"),hidden:!0,width:120,sortable:!0,renderer:fplain,dataIndex:"download_location"},{header:_("Owner"),width:80,sortable:!0,renderer:fplain,dataIndex:"owner"},{header:_("Public"),hidden:!0,width:80,sortable:!0,renderer:fplain,
-dataIndex:"public"},{header:_("Shared"),hidden:!0,width:80,sortable:!0,renderer:fplain,dataIndex:"shared"},{header:_("Downloaded"),hidden:!0,width:75,sortable:!0,renderer:fsize,dataIndex:"total_done"},{header:_("Uploaded"),hidden:!0,width:75,sortable:!0,renderer:fsize,dataIndex:"total_uploaded"},{header:_("Remaining"),hidden:!0,width:75,sortable:!0,renderer:fsize,dataIndex:"total_remaining"},{header:_("Down Limit"),hidden:!0,width:75,sortable:!0,renderer:b,dataIndex:"max_download_speed"},{header:_("Up Limit"),
-hidden:!0,width:75,sortable:!0,renderer:b,dataIndex:"max_upload_speed"},{header:_("Seeds:Peers"),hidden:!0,width:75,sortable:!0,renderer:c,dataIndex:"seeds_peers_ratio"},{header:_("Last Transfer"),hidden:!0,width:75,sortable:!0,renderer:ftime,dataIndex:"time_since_transfer"}],meta:{root:"torrents",idProperty:"id",fields:[{name:"queue",sortType:Deluge.data.SortTypes.asQueuePosition},{name:"name",sortType:Deluge.data.SortTypes.asName},{name:"total_wanted",type:"int"},{name:"state"},{name:"progress",
-type:"float"},{name:"num_seeds",type:"int"},{name:"total_seeds",type:"int"},{name:"num_peers",type:"int"},{name:"total_peers",type:"int"},{name:"download_payload_rate",type:"int"},{name:"upload_payload_rate",type:"int"},{name:"eta",type:"int",sortType:function(a){return 0===a?Number.MAX_VALUE:-1>=a?Number.MAX_SAFE_INTEGER:a}},{name:"ratio",type:"float"},{name:"distributed_copies",type:"float"},{name:"time_added",type:"int"},{name:"last_seen_complete",type:"int"},{name:"completed_time",type:"int"},
-{name:"tracker_host"},{name:"download_location"},{name:"total_done",type:"int"},{name:"total_uploaded",type:"int"},{name:"total_remaining",type:"int"},{name:"max_download_speed",type:"int"},{name:"max_upload_speed",type:"int"},{name:"seeds_peers_ratio",type:"float"},{name:"time_since_transfer",type:"int"}]},keys:[{key:"a",ctrl:!0,stopEvent:!0,handler:function(){deluge.torrents.getSelectionModel().selectAll()}},{key:[46],stopEvent:!0,handler:function(){ids=deluge.torrents.getSelectedIds();deluge.removeWindow.show(ids)}}],
-constructor:function(a){a=Ext.apply({id:"torrentGrid",store:new Ext.data.JsonStore(this.meta),columns:this.columns,keys:this.keys,region:"center",cls:"deluge-torrents",stripeRows:!0,autoExpandColumn:"name",autoExpandMin:150,deferredRender:!1,autoScroll:!0,stateful:!0,view:new Ext.ux.grid.BufferView({rowHeight:26,scrollDelay:!1})},a);Deluge.TorrentGrid.superclass.constructor.call(this,a)},initComponent:function(){Deluge.TorrentGrid.superclass.initComponent.call(this);deluge.events.on("torrentsRemoved",
-this.onTorrentsRemoved,this);deluge.events.on("disconnect",this.onDisconnect,this);this.on("rowcontextmenu",function(a,b,c){c.stopEvent();a=a.getSelectionModel();a.isSelected(b)||a.selectRow(b);deluge.menus.torrent.showAt(c.getPoint())})},getTorrent:function(a){return this.getStore().getAt(a)},getSelected:function(){return this.getSelectionModel().getSelected()},getSelections:function(){return this.getSelectionModel().getSelections()},getSelectedId:function(){return this.getSelectionModel().getSelected().id},
-getSelectedIds:function(){var a=[];Ext.each(this.getSelectionModel().getSelections(),function(b){a.push(b.id)});return a},update:function(a,b){var c=this.getStore();b&&(c.removeAll(),this.torrents={});var d=[],h;for(h in a){var m=a[h];if(this.torrents[h]){var k=c.getById(h);k.beginEdit();for(var n in m)k.get(n)!=m[n]&&k.set(n,m[n]);k.endEdit()}else k=new Deluge.data.Torrent(m),k.id=h,this.torrents[h]=1,d.push(k)}c.add(d);c.each(function(b){a[b.id]||(c.remove(b),delete this.torrents[b.id])},this);
-c.commitChanges();(d=c.getSortState())&&c.sort(d.field,d.direction)},onDisconnect:function(){this.getStore().removeAll();this.torrents={}},onTorrentsRemoved:function(a){var b=this.getSelectionModel();Ext.each(a,function(a){var c=this.getStore().getById(a);b.isSelected(c)&&b.deselectRow(this.getStore().indexOf(c));this.getStore().remove(c);delete this.torrents[a]},this)}});deluge.torrents=new Deluge.TorrentGrid})();
-var TORRENT_STATE_TRANSLATION=[_("All"),_("Active"),_("Allocating"),_("Checking"),_("Downloading"),_("Seeding"),_("Paused"),_("Checking"),_("Queued"),_("Error")];
-deluge.ui={errorCount:0,filters:null,initialize:function(){deluge.add=new Deluge.add.AddWindow;deluge.details=new Deluge.details.DetailsPanel;deluge.connectionManager=new Deluge.ConnectionManager;deluge.editTrackers=new Deluge.EditTrackersWindow;deluge.login=new Deluge.LoginWindow;deluge.preferences=new Deluge.preferences.PreferencesWindow;deluge.sidebar=new Deluge.Sidebar;deluge.statusbar=new Deluge.Statusbar;deluge.toolbar=new Deluge.Toolbar;this.detailsPanel=new Ext.Panel({id:"detailsPanel",cls:"detailsPanel",
-region:"south",split:!0,height:215,minSize:100,collapsible:!0,layout:"fit",items:[deluge.details]});this.MainPanel=new Ext.Panel({id:"mainPanel",iconCls:"x-deluge-main-panel",layout:"border",border:!1,tbar:deluge.toolbar,items:[deluge.sidebar,this.detailsPanel,deluge.torrents],bbar:deluge.statusbar});this.Viewport=new Ext.Viewport({layout:"fit",items:[this.MainPanel]});deluge.events.on("connect",this.onConnect,this);deluge.events.on("disconnect",this.onDisconnect,this);deluge.events.on("PluginDisabledEvent",
-this.onPluginDisabled,this);deluge.events.on("PluginEnabledEvent",this.onPluginEnabled,this);deluge.client=new Ext.ux.util.RpcClient({url:deluge.config.base+"json"});for(var a in Deluge.pluginStore)a=Deluge.createPlugin(a),a.enable(),deluge.plugins[a.name]=a;Ext.QuickTips.init();deluge.client.on("connected",function(a){deluge.login.show()},this,{single:!0});this.update=this.update.createDelegate(this);this.checkConnection=this.checkConnection.createDelegate(this);this.originalTitle=document.title},
-checkConnection:function(){deluge.client.web.connected({success:this.onConnectionSuccess,failure:this.onConnectionError,scope:this})},update:function(){var a=deluge.sidebar.getFilterStates();this.oldFilters=this.filters;this.filters=a;deluge.client.web.update_ui(Deluge.Keys.Grid,a,{success:this.onUpdate,failure:this.onUpdateError,scope:this});deluge.details.update()},onConnectionError:function(a){},onConnectionSuccess:function(a){deluge.statusbar.setStatus({iconCls:"x-deluge-statusbar icon-ok",text:_("Connection restored")});
-clearInterval(this.checking);a||deluge.connectionManager.show()},onUpdateError:function(a){2==this.errorCount&&(Ext.MessageBox.show({title:_("Lost Connection"),msg:_("The connection to the webserver has been lost!"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.ERROR}),deluge.events.fire("disconnect"),deluge.statusbar.setStatus({text:_("Lost connection to webserver")}),this.checking=setInterval(this.checkConnection,2E3));this.errorCount++},onUpdate:function(a){a.connected?(deluge.config.show_session_speed&&
-(document.title="D: "+fsize_short(a.stats.download_rate,!0)+" U: "+fsize_short(a.stats.upload_rate,!0)+" - "+this.originalTitle),Ext.areObjectsEqual(this.filters,this.oldFilters)?deluge.torrents.update(a.torrents):deluge.torrents.update(a.torrents,!0),deluge.statusbar.update(a.stats),deluge.sidebar.update(a.filters),this.errorCount=0):deluge.connectionManager.disconnect(!0)},onConnect:function(){this.running||(this.running=setInterval(this.update,2E3),this.update());deluge.client.web.get_plugins({success:this.onGotPlugins,
-scope:this})},onDisconnect:function(){this.stop()},onGotPlugins:function(a){Ext.each(a.enabled_plugins,function(a){deluge.plugins[a]||deluge.client.web.get_plugin_resources(a,{success:this.onGotPluginResources,scope:this})},this)},onPluginEnabled:function(a){deluge.plugins[a]?deluge.plugins[a].enable():deluge.client.web.get_plugin_resources(a,{success:this.onGotPluginResources,scope:this})},onGotPluginResources:function(a){Ext.each(Deluge.debug?a.debug_scripts:a.scripts,function(b){Ext.ux.JSLoader({url:deluge.config.base+
-b,onLoad:this.onPluginLoaded,pluginName:a.name})},this)},onPluginDisabled:function(a){deluge.plugins[a]&&deluge.plugins[a].disable()},onPluginLoaded:function(a){Deluge.hasPlugin(a.pluginName)&&(plugin=Deluge.createPlugin(a.pluginName),plugin.enable(),deluge.plugins[plugin.name]=plugin)},stop:function(){this.running&&(clearInterval(this.running),this.running=!1,deluge.torrents.getStore().removeAll())}};Ext.onReady(function(a){deluge.ui.initialize()});
diff --git a/deluge/ui/web/js/deluge-all/ConnectionManager.js b/deluge/ui/web/js/deluge-all/ConnectionManager.js
index 5261726..2e61e22 100644
--- a/deluge/ui/web/js/deluge-all/ConnectionManager.js
+++ b/deluge/ui/web/js/deluge-all/ConnectionManager.js
@@ -162,13 +162,23 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
},
update: function () {
+ this.updating = setTimeout(this.update, 2000);
this.list.getStore().each(function (r) {
deluge.client.web.get_host_status(r.id, {
- success: this.onGetHostStatus,
+ success: this.onUpdate,
scope: this,
});
}, this);
},
+ onUpdate: function (host) {
+ if (!this.isVisible()) return;
+ this.onGetHostStatus(host);
+
+ if (this.updating) {
+ clearTimeout(this.updating);
+ }
+ this.updating = setTimeout(this.update, 2000);
+ },
/**
* Updates the buttons in the Connection Manager UI according to the
@@ -312,7 +322,10 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
// private
onHide: function () {
- if (this.running) window.clearInterval(this.running);
+ if (this.updating) {
+ window.clearTimeout(this.updating);
+ this.updating = undefined;
+ }
},
// private
@@ -396,8 +409,8 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
this.stopHostButton = bbar.items.get('cm-stop');
}
this.loadHosts();
- if (this.running) return;
- this.running = window.setInterval(this.update, 2000, this);
+ if (this.updating) return;
+ this.updating = window.setTimeout(this.update, 2000);
},
// private
diff --git a/deluge/ui/web/js/deluge-all/Sidebar.js b/deluge/ui/web/js/deluge-all/Sidebar.js
index eb08a89..a6512b2 100644
--- a/deluge/ui/web/js/deluge-all/Sidebar.js
+++ b/deluge/ui/web/js/deluge-all/Sidebar.js
@@ -60,14 +60,16 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
this.doLayout();
this.panels[filter] = panel;
- panel.header.on('click', function (header) {
- if (!deluge.config.sidebar_multiple_filters) {
- deluge.ui.update();
- }
- if (!panel.list.getSelectionCount()) {
- panel.list.select(0);
- }
- });
+ if (panel.header) {
+ panel.header.on('click', function (header) {
+ if (!deluge.config.sidebar_multiple_filters) {
+ deluge.ui.update();
+ }
+ if (!panel.list.getSelectionCount()) {
+ panel.list.select(0);
+ }
+ });
+ }
this.fireEvent('filtercreate', this, panel);
panel.updateStates(states);
diff --git a/deluge/ui/web/js/deluge-all/UI.js b/deluge/ui/web/js/deluge-all/UI.js
index cc877d5..f7edc84 100644
--- a/deluge/ui/web/js/deluge-all/UI.js
+++ b/deluge/ui/web/js/deluge-all/UI.js
@@ -134,14 +134,24 @@ deluge.ui = {
deluge.details.update();
},
- onConnectionError: function (error) {},
+ onConnectionError: function (error) {
+ if (this.checking) {
+ clearTimeout(this.checking);
+ }
+ this.checking = setTimeout(this.checkConnection, 2000);
+ },
onConnectionSuccess: function (result) {
+ if (this.checking) {
+ clearTimeout(this.checking);
+ this.checking = undefined;
+ }
+ this.running = setTimeout(this.update, 2000);
+ this.update();
deluge.statusbar.setStatus({
iconCls: 'x-deluge-statusbar icon-ok',
text: _('Connection restored'),
});
- clearInterval(this.checking);
if (!result) {
deluge.connectionManager.show();
}
@@ -159,9 +169,13 @@ deluge.ui = {
deluge.statusbar.setStatus({
text: _('Lost connection to webserver'),
});
- this.checking = setInterval(this.checkConnection, 2000);
+ this.checking = setTimeout(this.checkConnection, 2000);
}
this.errorCount++;
+ if (this.running) {
+ clearTimeout(this.running);
+ this.running = undefined;
+ }
},
/**
@@ -170,10 +184,15 @@ deluge.ui = {
* Updates the various components in the interface.
*/
onUpdate: function (data) {
+ if (this.running) {
+ clearTimeout(this.running);
+ this.running = undefined;
+ }
if (!data['connected']) {
deluge.connectionManager.disconnect(true);
return;
}
+ this.running = setTimeout(this.update, 2000);
if (deluge.config.show_session_speed) {
document.title =
@@ -201,7 +220,7 @@ deluge.ui = {
*/
onConnect: function () {
if (!this.running) {
- this.running = setInterval(this.update, 2000);
+ this.running = setTimeout(this.update, 2000);
this.update();
}
deluge.client.web.get_plugins({
@@ -280,8 +299,8 @@ deluge.ui = {
*/
stop: function () {
if (this.running) {
- clearInterval(this.running);
- this.running = false;
+ clearTimeout(this.running);
+ this.running = undefined;
deluge.torrents.getStore().removeAll();
}
},
diff --git a/deluge/ui/web/js/deluge-all/details/FilesTab.js b/deluge/ui/web/js/deluge-all/details/FilesTab.js
index 60de832..36ef968 100644
--- a/deluge/ui/web/js/deluge-all/details/FilesTab.js
+++ b/deluge/ui/web/js/deluge-all/details/FilesTab.js
@@ -214,7 +214,9 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
{
success: function () {
Ext.each(nodes, function (node) {
- node.setColumnValue(3, baseItem.filePriority);
+ node.attributes.priority =
+ baseItem.filePriority;
+ node.ui.updateColumns();
});
},
scope: this,
diff --git a/deluge/ui/web/js/deluge-all/details/OptionsTab.js b/deluge/ui/web/js/deluge-all/details/OptionsTab.js
index 7e59cba..f8a08be 100644
--- a/deluge/ui/web/js/deluge-all/details/OptionsTab.js
+++ b/deluge/ui/web/js/deluge-all/details/OptionsTab.js
@@ -86,7 +86,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 1,
minValue: -1,
- maxValue: 99999,
+ maxValue: 9999999,
},
});
this.fieldsets.bandwidth.add({
@@ -113,7 +113,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 1,
minValue: -1,
- maxValue: 99999,
+ maxValue: 9999999,
},
});
this.fieldsets.bandwidth.add({
diff --git a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
index 8c32da5..563dedd 100644
--- a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js
@@ -40,7 +40,7 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
defaultType: 'spinnerfield',
defaults: {
minValue: -1,
- maxValue: 99999,
+ maxValue: 9999999,
},
style: 'margin-bottom: 0px; padding-bottom: 0px;',
autoHeight: true,
diff --git a/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js b/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js
index 1787826..da205c2 100644
--- a/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js
@@ -40,7 +40,7 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
value: 58846,
decimalPrecision: 0,
minValue: -1,
- maxValue: 99999,
+ maxValue: 65535,
})
);
diff --git a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
index b6b76eb..1b710f2 100644
--- a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
+++ b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js
@@ -140,7 +140,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
fieldLabel: _('Session Timeout:'),
decimalPrecision: 0,
minValue: -1,
- maxValue: 99999,
+ maxValue: Number.MAX_SAFE_INTEGER || Number.MAX_VALUE,
})
);
om.bind(
diff --git a/deluge/ui/web/js/extjs/ext-extensions-debug.js b/deluge/ui/web/js/extjs/ext-extensions-debug.js
deleted file mode 100644
index 8a05e61..0000000
--- a/deluge/ui/web/js/extjs/ext-extensions-debug.js
+++ /dev/null
@@ -1,2927 +0,0 @@
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-Ext.ns('Ext.ux.form');
-
-/**
- * @class Ext.ux.form.FileUploadField
- * @extends Ext.form.TextField
- * Creates a file upload field.
- * @xtype fileuploadfield
- */
-Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
- /**
- * @cfg {String} buttonText The button text to display on the upload button (defaults to
- * 'Browse...'). Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text
- * value will be used instead if available.
- */
- buttonText: 'Browse...',
- /**
- * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible
- * text field (defaults to false). If true, all inherited TextField members will still be available.
- */
- buttonOnly: false,
- /**
- * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field
- * (defaults to 3). Note that this only applies if {@link #buttonOnly} = false.
- */
- buttonOffset: 3,
-
- /**
- * @cfg {Boolean} multiple True to select more than one file. (defaults to false).
- * Note that this only applies if the HTML doc is using HTML5.
- */
- multiple: false,
-
- /**
- * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.
- */
-
- // private
- readOnly: true,
-
- /**
- * @hide
- * @method autoSize
- */
- autoSize: Ext.emptyFn,
-
- // private
- initComponent: function () {
- Ext.ux.form.FileUploadField.superclass.initComponent.call(this);
-
- this.addEvents(
- /**
- * @event fileselected
- * Fires when the underlying file input field's value has changed from the user
- * selecting a new file from the system file selection dialog.
- * @param {Ext.ux.form.FileUploadField} this
- * @param {String} value The file value returned by the underlying file input field
- */
- 'fileselected'
- );
- },
-
- // private
- onRender: function (ct, position) {
- Ext.ux.form.FileUploadField.superclass.onRender.call(
- this,
- ct,
- position
- );
-
- this.wrap = this.el.wrap({ cls: 'x-form-field-wrap x-form-file-wrap' });
- this.el.addClass('x-form-file-text');
- this.el.dom.removeAttribute('name');
- this.createFileInput();
-
- var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
- text: this.buttonText,
- });
- this.button = new Ext.Button(
- Ext.apply(btnCfg, {
- renderTo: this.wrap,
- cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : ''),
- })
- );
-
- if (this.buttonOnly) {
- this.el.hide();
- this.wrap.setWidth(this.button.getEl().getWidth());
- }
-
- this.bindListeners();
- this.resizeEl = this.positionEl = this.wrap;
- },
-
- bindListeners: function () {
- this.fileInput.on({
- scope: this,
- mouseenter: function () {
- this.button.addClass(['x-btn-over', 'x-btn-focus']);
- },
- mouseleave: function () {
- this.button.removeClass([
- 'x-btn-over',
- 'x-btn-focus',
- 'x-btn-click',
- ]);
- },
- mousedown: function () {
- this.button.addClass('x-btn-click');
- },
- mouseup: function () {
- this.button.removeClass([
- 'x-btn-over',
- 'x-btn-focus',
- 'x-btn-click',
- ]);
- },
- change: function () {
- var value = this.fileInput.dom.files;
- // Fallback to value.
- if (!value) value = this.fileInput.dom.value;
- this.setValue(value);
- this.fireEvent('fileselected', this, value);
- },
- });
- },
-
- createFileInput: function () {
- this.fileInput = this.wrap.createChild({
- id: this.getFileInputId(),
- name: this.name || this.getId(),
- cls: 'x-form-file',
- tag: 'input',
- type: 'file',
- size: 1,
- });
- this.fileInput.dom.multiple = this.multiple;
- },
-
- reset: function () {
- if (this.rendered) {
- this.fileInput.remove();
- this.createFileInput();
- this.bindListeners();
- }
- Ext.ux.form.FileUploadField.superclass.reset.call(this);
- },
-
- // private
- getFileInputId: function () {
- return this.id + '-file';
- },
-
- // private
- onResize: function (w, h) {
- Ext.ux.form.FileUploadField.superclass.onResize.call(this, w, h);
-
- this.wrap.setWidth(w);
-
- if (!this.buttonOnly) {
- var w =
- this.wrap.getWidth() -
- this.button.getEl().getWidth() -
- this.buttonOffset;
- this.el.setWidth(w);
- }
- },
-
- // private
- onDestroy: function () {
- Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);
- Ext.destroy(this.fileInput, this.button, this.wrap);
- },
-
- onDisable: function () {
- Ext.ux.form.FileUploadField.superclass.onDisable.call(this);
- this.doDisable(true);
- },
-
- onEnable: function () {
- Ext.ux.form.FileUploadField.superclass.onEnable.call(this);
- this.doDisable(false);
- },
-
- // private
- doDisable: function (disabled) {
- this.fileInput.dom.disabled = disabled;
- this.button.setDisabled(disabled);
- },
-
- // private
- preFocus: Ext.emptyFn,
-
- // private
- alignErrorIcon: function () {
- this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
- },
-});
-
-Ext.reg('fileuploadfield', Ext.ux.form.FileUploadField);
-
-// backwards compat
-Ext.form.FileUploadField = Ext.ux.form.FileUploadField;
-/**
- * Ext.ux.form.RadioGroup.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-// Allow radiogroups to be treated as a single form element.
-Ext.override(Ext.form.RadioGroup, {
- afterRender: function () {
- this.items.each(function (i) {
- this.relayEvents(i, ['check']);
- }, this);
- if (this.lazyValue) {
- this.setValue(this.value);
- delete this.value;
- delete this.lazyValue;
- }
- Ext.form.RadioGroup.superclass.afterRender.call(this);
- },
-
- getName: function () {
- return this.items.first().getName();
- },
-
- getValue: function () {
- return this.items.first().getGroupValue();
- },
-
- setValue: function (v) {
- if (!this.items.each) {
- this.value = v;
- this.lazyValue = true;
- return;
- }
- this.items.each(function (item) {
- if (item.rendered) {
- var checked = item.el.getValue() == String(v);
- item.el.dom.checked = checked;
- item.el.dom.defaultChecked = checked;
- item.wrap[checked ? 'addClass' : 'removeClass'](
- item.checkedCls
- );
- }
- });
- },
-});
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-Ext.ns('Ext.ux.form');
-
-/**
- * @class Ext.ux.form.SpinnerField
- * @extends Ext.form.NumberField
- * Creates a field utilizing Ext.ux.Spinner
- * @xtype spinnerfield
- */
-Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, {
- actionMode: 'wrap',
- deferHeight: true,
- autoSize: Ext.emptyFn,
- onBlur: Ext.emptyFn,
- adjustSize: Ext.BoxComponent.prototype.adjustSize,
-
- constructor: function (config) {
- var spinnerConfig = Ext.copyTo(
- {},
- config,
- 'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass'
- );
-
- var spl = (this.spinner = new Ext.ux.Spinner(spinnerConfig));
-
- var plugins = config.plugins
- ? Ext.isArray(config.plugins)
- ? config.plugins.push(spl)
- : [config.plugins, spl]
- : spl;
-
- Ext.ux.form.SpinnerField.superclass.constructor.call(
- this,
- Ext.apply(config, { plugins: plugins })
- );
- },
-
- // private
- getResizeEl: function () {
- return this.wrap;
- },
-
- // private
- getPositionEl: function () {
- return this.wrap;
- },
-
- // private
- alignErrorIcon: function () {
- if (this.wrap) {
- this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
- }
- },
-
- validateBlur: function () {
- return true;
- },
-});
-
-Ext.reg('spinnerfield', Ext.ux.form.SpinnerField);
-
-//backwards compat
-Ext.form.SpinnerField = Ext.ux.form.SpinnerField;
-/**
- * Ext.ux.form.SpinnerField.js
- *
- * Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.override(Ext.ux.form.SpinnerField, {
- onBlur: Ext.form.Field.prototype.onBlur,
-});
-/**
- * Ext.ux.form.SpinnerGroup.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.ns('Ext.ux.form');
-
-/**
- *
- */
-Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
- // private
- defaultType: 'spinnerfield',
- anchor: '98%',
-
- // private
- groupCls: 'x-form-spinner-group',
-
- colCfg: {},
-
- // private
- onRender: function (ct, position) {
- if (!this.el) {
- var panelCfg = {
- cls: this.groupCls,
- layout: 'column',
- border: false,
- renderTo: ct,
- };
- var colCfg = Ext.apply(
- {
- defaultType: this.defaultType,
- layout: 'form',
- border: false,
- labelWidth: 60,
- defaults: {
- hideLabel: true,
- anchor: '60%',
- },
- },
- this.colCfg
- );
-
- if (this.items[0].items) {
- // The container has standard ColumnLayout configs, so pass them in directly
-
- Ext.apply(panelCfg, {
- layoutConfig: { columns: this.items.length },
- defaults: this.defaults,
- items: this.items,
- });
- for (var i = 0, len = this.items.length; i < len; i++) {
- Ext.applyIf(this.items[i], colCfg);
- }
- } else {
- // The container has field item configs, so we have to generate the column
- // panels first then move the items into the columns as needed.
-
- var numCols,
- cols = [];
-
- if (typeof this.columns == 'string') {
- // 'auto' so create a col per item
- this.columns = this.items.length;
- }
- if (!Ext.isArray(this.columns)) {
- var cs = [];
- for (var i = 0; i < this.columns; i++) {
- cs.push((100 / this.columns) * 0.01); // distribute by even %
- }
- this.columns = cs;
- }
-
- numCols = this.columns.length;
-
- // Generate the column configs with the correct width setting
- for (var i = 0; i < numCols; i++) {
- var cc = Ext.apply({ items: [] }, colCfg);
- cc[this.columns[i] <= 1 ? 'columnWidth' : 'width'] =
- this.columns[i];
- if (this.defaults) {
- cc.defaults = Ext.apply(
- cc.defaults || {},
- this.defaults
- );
- }
- cols.push(cc);
- }
-
- // Distribute the original items into the columns
- if (this.vertical) {
- var rows = Math.ceil(this.items.length / numCols),
- ri = 0;
- for (var i = 0, len = this.items.length; i < len; i++) {
- if (i > 0 && i % rows == 0) {
- ri++;
- }
- if (this.items[i].fieldLabel) {
- this.items[i].hideLabel = false;
- }
- cols[ri].items.push(this.items[i]);
- }
- } else {
- for (var i = 0, len = this.items.length; i < len; i++) {
- var ci = i % numCols;
- if (this.items[i].fieldLabel) {
- this.items[i].hideLabel = false;
- }
- cols[ci].items.push(this.items[i]);
- }
- }
-
- Ext.apply(panelCfg, {
- layoutConfig: { columns: numCols },
- items: cols,
- });
- }
-
- this.panel = new Ext.Panel(panelCfg);
- this.el = this.panel.getEl();
-
- if (this.forId && this.itemCls) {
- var l = this.el.up(this.itemCls).child('label', true);
- if (l) {
- l.setAttribute('htmlFor', this.forId);
- }
- }
-
- var fields = this.panel.findBy(function (c) {
- return c.isFormField;
- }, this);
-
- this.items = new Ext.util.MixedCollection();
- this.items.addAll(fields);
-
- this.items.each(function (field) {
- field.on('spin', this.onFieldChange, this);
- field.on('change', this.onFieldChange, this);
- }, this);
-
- if (this.lazyValueSet) {
- this.setValue(this.value);
- delete this.value;
- delete this.lazyValueSet;
- }
-
- if (this.lazyRawValueSet) {
- this.setRawValue(this.rawValue);
- delete this.rawValue;
- delete this.lazyRawValueSet;
- }
- }
-
- Ext.ux.form.SpinnerGroup.superclass.onRender.call(this, ct, position);
- },
-
- onFieldChange: function (spinner) {
- this.fireEvent('change', this, this.getValue());
- },
-
- initValue: Ext.emptyFn,
-
- getValue: function () {
- var value = [this.items.getCount()];
- this.items.each(function (item, i) {
- value[i] = Number(item.getValue());
- });
- return value;
- },
-
- getRawValue: function () {
- var value = [this.items.getCount()];
- this.items.each(function (item, i) {
- value[i] = Number(item.getRawValue());
- });
- return value;
- },
-
- setValue: function (value) {
- if (!this.rendered) {
- this.value = value;
- this.lazyValueSet = true;
- } else {
- this.items.each(function (item, i) {
- item.setValue(value[i]);
- });
- }
- },
-
- setRawValue: function (value) {
- if (!this.rendered) {
- this.rawValue = value;
- this.lazyRawValueSet = true;
- } else {
- this.items.each(function (item, i) {
- item.setRawValue(value[i]);
- });
- }
- },
-});
-Ext.reg('spinnergroup', Ext.ux.form.SpinnerGroup);
-/**
- * Ext.ux.form.ToggleField.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-Ext.namespace('Ext.ux.form');
-
-/**
- * Ext.ux.form.ToggleField class
- *
- * @author Damien Churchill
- * @version v0.1
- *
- * @class Ext.ux.form.ToggleField
- * @extends Ext.form.TriggerField
- */
-Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
- cls: 'x-toggle-field',
-
- initComponent: function () {
- Ext.ux.form.ToggleField.superclass.initComponent.call(this);
-
- this.toggle = new Ext.form.Checkbox();
- this.toggle.on('check', this.onToggleCheck, this);
-
- this.input = new Ext.form.TextField({
- disabled: true,
- });
- },
-
- onRender: function (ct, position) {
- if (!this.el) {
- this.panel = new Ext.Panel({
- cls: this.groupCls,
- layout: 'table',
- layoutConfig: {
- columns: 2,
- },
- border: false,
- renderTo: ct,
- });
- this.panel.ownerCt = this;
- this.el = this.panel.getEl();
-
- this.panel.add(this.toggle);
- this.panel.add(this.input);
- this.panel.doLayout();
-
- this.toggle.getEl().parent().setStyle('padding-right', '10px');
- }
- Ext.ux.form.ToggleField.superclass.onRender.call(this, ct, position);
- },
-
- // private
- onResize: function (w, h) {
- this.panel.setSize(w, h);
- this.panel.doLayout();
-
- // we substract 10 for the padding :-)
- var inputWidth = w - this.toggle.getSize().width - 25;
- this.input.setSize(inputWidth, h);
- },
-
- onToggleCheck: function (toggle, checked) {
- this.input.setDisabled(!checked);
- },
-});
-Ext.reg('togglefield', Ext.ux.form.ToggleField);
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-Ext.ns('Ext.ux.grid');
-
-/**
- * @class Ext.ux.grid.BufferView
- * @extends Ext.grid.GridView
- * A custom GridView which renders rows on an as-needed basis.
- */
-Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
- /**
- * @cfg {Number} rowHeight
- * The height of a row in the grid.
- */
- rowHeight: 19,
-
- /**
- * @cfg {Number} borderHeight
- * The combined height of border-top and border-bottom of a row.
- */
- borderHeight: 2,
-
- /**
- * @cfg {Boolean/Number} scrollDelay
- * The number of milliseconds before rendering rows out of the visible
- * viewing area. Defaults to 100. Rows will render immediately with a config
- * of false.
- */
- scrollDelay: 100,
-
- /**
- * @cfg {Number} cacheSize
- * The number of rows to look forward and backwards from the currently viewable
- * area. The cache applies only to rows that have been rendered already.
- */
- cacheSize: 20,
-
- /**
- * @cfg {Number} cleanDelay
- * The number of milliseconds to buffer cleaning of extra rows not in the
- * cache.
- */
- cleanDelay: 500,
-
- initTemplates: function () {
- Ext.ux.grid.BufferView.superclass.initTemplates.call(this);
- var ts = this.templates;
- // empty div to act as a place holder for a row
- ts.rowHolder = new Ext.Template(
- '<div class="x-grid3-row {alt}" style="{tstyle}"></div>'
- );
- ts.rowHolder.disableFormats = true;
- ts.rowHolder.compile();
-
- ts.rowBody = new Ext.Template(
- '<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
- '<tbody><tr>{cells}</tr>',
- this.enableRowBody
- ? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>'
- : '',
- '</tbody></table>'
- );
- ts.rowBody.disableFormats = true;
- ts.rowBody.compile();
- },
-
- getStyleRowHeight: function () {
- return Ext.isBorderBox
- ? this.rowHeight + this.borderHeight
- : this.rowHeight;
- },
-
- getCalculatedRowHeight: function () {
- return this.rowHeight + this.borderHeight;
- },
-
- getVisibleRowCount: function () {
- var rh = this.getCalculatedRowHeight(),
- visibleHeight = this.scroller.dom.clientHeight;
- return visibleHeight < 1 ? 0 : Math.ceil(visibleHeight / rh);
- },
-
- getVisibleRows: function () {
- var count = this.getVisibleRowCount(),
- sc = this.scroller.dom.scrollTop,
- start =
- sc === 0
- ? 0
- : Math.floor(sc / this.getCalculatedRowHeight()) - 1;
- return {
- first: Math.max(start, 0),
- last: Math.min(start + count + 2, this.ds.getCount() - 1),
- };
- },
-
- doRender: function (cs, rs, ds, startRow, colCount, stripe, onlyBody) {
- var ts = this.templates,
- ct = ts.cell,
- rt = ts.row,
- rb = ts.rowBody,
- last = colCount - 1,
- rh = this.getStyleRowHeight(),
- vr = this.getVisibleRows(),
- tstyle = 'width:' + this.getTotalWidth() + ';height:' + rh + 'px;',
- // buffers
- buf = [],
- cb,
- c,
- p = {},
- rp = { tstyle: tstyle },
- r;
- for (var j = 0, len = rs.length; j < len; j++) {
- r = rs[j];
- cb = [];
- var rowIndex = j + startRow,
- visible = rowIndex >= vr.first && rowIndex <= vr.last;
- if (visible) {
- for (var i = 0; i < colCount; i++) {
- c = cs[i];
- p.id = c.id;
- p.css =
- i === 0
- ? 'x-grid3-cell-first '
- : i == last
- ? 'x-grid3-cell-last '
- : '';
- p.attr = p.cellAttr = '';
- p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
- p.style = c.style;
- if (p.value === undefined || p.value === '') {
- p.value = '&#160;';
- }
- if (r.dirty && typeof r.modified[c.name] !== 'undefined') {
- p.css += ' x-grid3-dirty-cell';
- }
- cb[cb.length] = ct.apply(p);
- }
- }
- var alt = [];
- if (stripe && (rowIndex + 1) % 2 === 0) {
- alt[0] = 'x-grid3-row-alt';
- }
- if (r.dirty) {
- alt[1] = ' x-grid3-dirty-row';
- }
- rp.cols = colCount;
- if (this.getRowClass) {
- alt[2] = this.getRowClass(r, rowIndex, rp, ds);
- }
- rp.alt = alt.join(' ');
- rp.cells = cb.join('');
- buf[buf.length] = !visible
- ? ts.rowHolder.apply(rp)
- : onlyBody
- ? rb.apply(rp)
- : rt.apply(rp);
- }
- return buf.join('');
- },
-
- isRowRendered: function (index) {
- var row = this.getRow(index);
- return row && row.childNodes.length > 0;
- },
-
- syncScroll: function () {
- Ext.ux.grid.BufferView.superclass.syncScroll.apply(this, arguments);
- this.update();
- },
-
- // a (optionally) buffered method to update contents of gridview
- update: function () {
- if (this.scrollDelay) {
- if (!this.renderTask) {
- this.renderTask = new Ext.util.DelayedTask(this.doUpdate, this);
- }
- this.renderTask.delay(this.scrollDelay);
- } else {
- this.doUpdate();
- }
- },
-
- onRemove: function (ds, record, index, isUpdate) {
- Ext.ux.grid.BufferView.superclass.onRemove.apply(this, arguments);
- if (isUpdate !== true) {
- this.update();
- }
- },
-
- doUpdate: function () {
- if (this.getVisibleRowCount() > 0) {
- var g = this.grid,
- cm = g.colModel,
- ds = g.store,
- cs = this.getColumnData(),
- vr = this.getVisibleRows(),
- row;
- for (var i = vr.first; i <= vr.last; i++) {
- // if row is NOT rendered and is visible, render it
- if (!this.isRowRendered(i) && (row = this.getRow(i))) {
- var html = this.doRender(
- cs,
- [ds.getAt(i)],
- ds,
- i,
- cm.getColumnCount(),
- g.stripeRows,
- true
- );
- row.innerHTML = html;
- }
- }
- this.clean();
- }
- },
-
- // a buffered method to clean rows
- clean: function () {
- if (!this.cleanTask) {
- this.cleanTask = new Ext.util.DelayedTask(this.doClean, this);
- }
- this.cleanTask.delay(this.cleanDelay);
- },
-
- doClean: function () {
- if (this.getVisibleRowCount() > 0) {
- var vr = this.getVisibleRows();
- vr.first -= this.cacheSize;
- vr.last += this.cacheSize;
-
- var i = 0,
- rows = this.getRows();
- // if first is less than 0, all rows have been rendered
- // so lets clean the end...
- if (vr.first <= 0) {
- i = vr.last + 1;
- }
- for (var len = this.ds.getCount(); i < len; i++) {
- // if current row is outside of first and last and
- // has content, update the innerHTML to nothing
- if ((i < vr.first || i > vr.last) && rows[i].innerHTML) {
- rows[i].innerHTML = '';
- }
- }
- }
- },
-
- removeTask: function (name) {
- var task = this[name];
- if (task && task.cancel) {
- task.cancel();
- this[name] = null;
- }
- },
-
- destroy: function () {
- this.removeTask('cleanTask');
- this.removeTask('renderTask');
- Ext.ux.grid.BufferView.superclass.destroy.call(this);
- },
-
- layout: function () {
- Ext.ux.grid.BufferView.superclass.layout.call(this);
- this.update();
- },
-});
-/**
- * Ext.ux.layout.FormLayoutFix.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-// Taken from http://extjs.com/forum/showthread.php?t=75273
-// remove spaces for hidden elements and make show(), hide(), enable() and disable() act on
-// the label. don't use hideLabel with this.
-Ext.override(Ext.layout.FormLayout, {
- renderItem: function (c, position, target) {
- if (
- c &&
- !c.rendered &&
- (c.isFormField || c.fieldLabel) &&
- c.inputType != 'hidden'
- ) {
- var args = this.getTemplateArgs(c);
- if (typeof position == 'number') {
- position = target.dom.childNodes[position] || null;
- }
- if (position) {
- c.formItem = this.fieldTpl.insertBefore(position, args, true);
- } else {
- c.formItem = this.fieldTpl.append(target, args, true);
- }
- c.actionMode = 'formItem';
- c.render('x-form-el-' + c.id);
- c.container = c.formItem;
- c.actionMode = 'container';
- } else {
- Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
- }
- },
-});
-/**
- * Ext.ux.tree.MultiSelectionModelFix.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-/**
- * This enhances the MSM to allow for shift selecting in tree grids etc.
- * @author Damien Churchill <damoxc@gmail.com>
- */
-Ext.override(Ext.tree.MultiSelectionModel, {
- onNodeClick: function (node, e) {
- if (e.ctrlKey && this.isSelected(node)) {
- this.unselect(node);
- } else if (e.shiftKey && !this.isSelected(node)) {
- var parentNode = node.parentNode;
- // We can only shift select files in the same node
- if (this.lastSelNode.parentNode.id != parentNode.id) return;
-
- // Get the node indexes
- var fi = parentNode.indexOf(node),
- li = parentNode.indexOf(this.lastSelNode);
-
- // Select the last clicked node and wipe old selections
- this.select(this.lastSelNode, e, false, true);
-
- // Swap the values if required
- if (fi > li) {
- (fi = fi + li), (li = fi - li), (fi = fi - li);
- }
-
- // Select all the nodes
- parentNode.eachChild(function (n) {
- var i = parentNode.indexOf(n);
- if (fi < i && i < li) {
- this.select(n, e, true, true);
- }
- }, this);
-
- // Select the clicked node
- this.select(node, e, true);
- } else {
- this.select(node, e, e.ctrlKey);
- }
- },
-
- select: function (node, e, keepExisting, suppressEvent) {
- if (keepExisting !== true) {
- this.clearSelections(true);
- }
- if (this.isSelected(node)) {
- this.lastSelNode = node;
- return node;
- }
- this.selNodes.push(node);
- this.selMap[node.id] = node;
- this.lastSelNode = node;
- node.ui.onSelectedChange(true);
- if (suppressEvent !== true) {
- this.fireEvent('selectionchange', this, this.selNodes);
- }
- return node;
- },
-});
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-Ext.ns('Ext.ux.tree');
-
-/**
- * @class Ext.ux.tree.TreeGrid
- * @extends Ext.tree.TreePanel
- *
- * @xtype treegrid
- */
-Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
- rootVisible: false,
- useArrows: true,
- lines: false,
- borderWidth: Ext.isBorderBox ? 0 : 2, // the combined left/right border for each cell
- cls: 'x-treegrid',
-
- columnResize: true,
- enableSort: true,
- reserveScrollOffset: true,
- enableHdMenu: true,
-
- columnsText: 'Columns',
-
- initComponent: function () {
- if (!this.root) {
- this.root = new Ext.tree.AsyncTreeNode({ text: 'Root' });
- }
-
- // initialize the loader
- var l = this.loader;
- if (!l) {
- l = new Ext.ux.tree.TreeGridLoader({
- dataUrl: this.dataUrl,
- requestMethod: this.requestMethod,
- store: this.store,
- });
- } else if (Ext.isObject(l) && !l.load) {
- l = new Ext.ux.tree.TreeGridLoader(l);
- }
- this.loader = l;
-
- Ext.ux.tree.TreeGrid.superclass.initComponent.call(this);
-
- this.initColumns();
-
- if (this.enableSort) {
- this.treeGridSorter = new Ext.ux.tree.TreeGridSorter(
- this,
- this.enableSort
- );
- }
-
- if (this.columnResize) {
- this.colResizer = new Ext.tree.ColumnResizer(this.columnResize);
- this.colResizer.init(this);
- }
-
- var c = this.columns;
- if (!this.internalTpl) {
- this.internalTpl = new Ext.XTemplate(
- '<div class="x-grid3-header">',
- '<div class="x-treegrid-header-inner">',
- '<div class="x-grid3-header-offset">',
- '<table style="table-layout: fixed;" cellspacing="0" cellpadding="0" border="0"><colgroup><tpl for="columns"><col /></tpl></colgroup>',
- '<thead><tr class="x-grid3-hd-row">',
- '<tpl for="columns">',
- '<td class="x-grid3-hd x-grid3-cell x-treegrid-hd" style="text-align: {align};" id="',
- this.id,
- '-xlhd-{#}">',
- '<div class="x-grid3-hd-inner x-treegrid-hd-inner" unselectable="on">',
- this.enableHdMenu
- ? '<a class="x-grid3-hd-btn" href="#"></a>'
- : '',
- '{header}<img class="x-grid3-sort-icon" src="',
- Ext.BLANK_IMAGE_URL,
- '" />',
- '</div>',
- '</td></tpl>',
- '</tr></thead>',
- '</table>',
- '</div></div>',
- '</div>',
- '<div class="x-treegrid-root-node">',
- '<table class="x-treegrid-root-table" cellpadding="0" cellspacing="0" style="table-layout: fixed;"></table>',
- '</div>'
- );
- }
-
- if (!this.colgroupTpl) {
- this.colgroupTpl = new Ext.XTemplate(
- '<colgroup><tpl for="columns"><col style="width: {width}px"/></tpl></colgroup>'
- );
- }
- },
-
- initColumns: function () {
- var cs = this.columns,
- len = cs.length,
- columns = [],
- i,
- c;
-
- for (i = 0; i < len; i++) {
- c = cs[i];
- if (!c.isColumn) {
- c.xtype = c.xtype
- ? /^tg/.test(c.xtype)
- ? c.xtype
- : 'tg' + c.xtype
- : 'tgcolumn';
- c = Ext.create(c);
- }
- c.init(this);
- columns.push(c);
-
- if (this.enableSort !== false && c.sortable !== false) {
- c.sortable = true;
- this.enableSort = true;
- }
- }
-
- this.columns = columns;
- },
-
- onRender: function () {
- Ext.tree.TreePanel.superclass.onRender.apply(this, arguments);
-
- this.el.addClass('x-treegrid');
-
- this.outerCt = this.body.createChild({
- cls:
- 'x-tree-root-ct x-treegrid-ct ' +
- (this.useArrows
- ? 'x-tree-arrows'
- : this.lines
- ? 'x-tree-lines'
- : 'x-tree-no-lines'),
- });
-
- this.internalTpl.overwrite(this.outerCt, { columns: this.columns });
-
- this.mainHd = Ext.get(this.outerCt.dom.firstChild);
- this.innerHd = Ext.get(this.mainHd.dom.firstChild);
- this.innerBody = Ext.get(this.outerCt.dom.lastChild);
- this.innerCt = Ext.get(this.innerBody.dom.firstChild);
-
- this.colgroupTpl.insertFirst(this.innerCt, { columns: this.columns });
-
- if (this.hideHeaders) {
- this.el.child('.x-grid3-header').setDisplayed('none');
- } else if (this.enableHdMenu !== false) {
- this.hmenu = new Ext.menu.Menu({ id: this.id + '-hctx' });
- if (this.enableColumnHide !== false) {
- this.colMenu = new Ext.menu.Menu({
- id: this.id + '-hcols-menu',
- });
- this.colMenu.on({
- scope: this,
- beforeshow: this.beforeColMenuShow,
- itemclick: this.handleHdMenuClick,
- });
- this.hmenu.add({
- itemId: 'columns',
- hideOnClick: false,
- text: this.columnsText,
- menu: this.colMenu,
- iconCls: 'x-cols-icon',
- });
- }
- this.hmenu.on('itemclick', this.handleHdMenuClick, this);
- }
- },
-
- setRootNode: function (node) {
- node.attributes.uiProvider = Ext.ux.tree.TreeGridRootNodeUI;
- node = Ext.ux.tree.TreeGrid.superclass.setRootNode.call(this, node);
- if (this.innerCt) {
- this.colgroupTpl.insertFirst(this.innerCt, {
- columns: this.columns,
- });
- }
- return node;
- },
-
- clearInnerCt: function () {
- if (Ext.isIE) {
- var dom = this.innerCt.dom;
- while (dom.firstChild) {
- dom.removeChild(dom.firstChild);
- }
- } else {
- Ext.ux.tree.TreeGrid.superclass.clearInnerCt.call(this);
- }
- },
-
- initEvents: function () {
- Ext.ux.tree.TreeGrid.superclass.initEvents.apply(this, arguments);
-
- this.mon(this.innerBody, 'scroll', this.syncScroll, this);
- this.mon(this.innerHd, 'click', this.handleHdDown, this);
- this.mon(this.mainHd, {
- scope: this,
- mouseover: this.handleHdOver,
- mouseout: this.handleHdOut,
- });
- },
-
- onResize: function (w, h) {
- Ext.ux.tree.TreeGrid.superclass.onResize.apply(this, arguments);
-
- var bd = this.innerBody.dom;
- var hd = this.innerHd.dom;
-
- if (!bd) {
- return;
- }
-
- if (Ext.isNumber(h)) {
- bd.style.height =
- this.body.getHeight(true) - hd.offsetHeight + 'px';
- }
-
- if (Ext.isNumber(w)) {
- var sw = Ext.num(this.scrollOffset, Ext.getScrollBarWidth());
- if (
- this.reserveScrollOffset ||
- bd.offsetWidth - bd.clientWidth > 10
- ) {
- this.setScrollOffset(sw);
- } else {
- var me = this;
- setTimeout(function () {
- me.setScrollOffset(
- bd.offsetWidth - bd.clientWidth > 10 ? sw : 0
- );
- }, 10);
- }
- }
- },
-
- updateColumnWidths: function () {
- var cols = this.columns,
- colCount = cols.length,
- groups = this.outerCt.query('colgroup'),
- groupCount = groups.length,
- c,
- g,
- i,
- j;
-
- for (i = 0; i < colCount; i++) {
- c = cols[i];
- for (j = 0; j < groupCount; j++) {
- g = groups[j];
- g.childNodes[i].style.width = (c.hidden ? 0 : c.width) + 'px';
- }
- }
-
- for (
- i = 0, groups = this.innerHd.query('td'), len = groups.length;
- i < len;
- i++
- ) {
- c = Ext.fly(groups[i]);
- if (cols[i] && cols[i].hidden) {
- c.addClass('x-treegrid-hd-hidden');
- } else {
- c.removeClass('x-treegrid-hd-hidden');
- }
- }
-
- var tcw = this.getTotalColumnWidth();
- Ext.fly(this.innerHd.dom.firstChild).setWidth(
- tcw + (this.scrollOffset || 0)
- );
- this.outerCt.select('table').setWidth(tcw);
- this.syncHeaderScroll();
- },
-
- getVisibleColumns: function () {
- var columns = [],
- cs = this.columns,
- len = cs.length,
- i;
-
- for (i = 0; i < len; i++) {
- if (!cs[i].hidden) {
- columns.push(cs[i]);
- }
- }
- return columns;
- },
-
- getTotalColumnWidth: function () {
- var total = 0;
- for (
- var i = 0, cs = this.getVisibleColumns(), len = cs.length;
- i < len;
- i++
- ) {
- total += cs[i].width;
- }
- return total;
- },
-
- setScrollOffset: function (scrollOffset) {
- this.scrollOffset = scrollOffset;
- this.updateColumnWidths();
- },
-
- // private
- handleHdDown: function (e, t) {
- var hd = e.getTarget('.x-treegrid-hd');
-
- if (hd && Ext.fly(t).hasClass('x-grid3-hd-btn')) {
- var ms = this.hmenu.items,
- cs = this.columns,
- index = this.findHeaderIndex(hd),
- c = cs[index],
- sort = c.sortable;
-
- e.stopEvent();
- Ext.fly(hd).addClass('x-grid3-hd-menu-open');
- this.hdCtxIndex = index;
-
- this.fireEvent('headerbuttonclick', ms, c, hd, index);
-
- this.hmenu.on(
- 'hide',
- function () {
- Ext.fly(hd).removeClass('x-grid3-hd-menu-open');
- },
- this,
- { single: true }
- );
-
- this.hmenu.show(t, 'tl-bl?');
- } else if (hd) {
- var index = this.findHeaderIndex(hd);
- this.fireEvent('headerclick', this.columns[index], hd, index);
- }
- },
-
- // private
- handleHdOver: function (e, t) {
- var hd = e.getTarget('.x-treegrid-hd');
- if (hd && !this.headersDisabled) {
- index = this.findHeaderIndex(hd);
- this.activeHdRef = t;
- this.activeHdIndex = index;
- var el = Ext.get(hd);
- this.activeHdRegion = el.getRegion();
- el.addClass('x-grid3-hd-over');
- this.activeHdBtn = el.child('.x-grid3-hd-btn');
- if (this.activeHdBtn) {
- this.activeHdBtn.dom.style.height =
- hd.firstChild.offsetHeight - 1 + 'px';
- }
- }
- },
-
- // private
- handleHdOut: function (e, t) {
- var hd = e.getTarget('.x-treegrid-hd');
- if (hd && (!Ext.isIE || !e.within(hd, true))) {
- this.activeHdRef = null;
- Ext.fly(hd).removeClass('x-grid3-hd-over');
- hd.style.cursor = '';
- }
- },
-
- findHeaderIndex: function (hd) {
- hd = hd.dom || hd;
- var cs = hd.parentNode.childNodes;
- for (var i = 0, c; (c = cs[i]); i++) {
- if (c == hd) {
- return i;
- }
- }
- return -1;
- },
-
- // private
- beforeColMenuShow: function () {
- var cols = this.columns,
- colCount = cols.length,
- i,
- c;
- this.colMenu.removeAll();
- for (i = 1; i < colCount; i++) {
- c = cols[i];
- if (c.hideable !== false) {
- this.colMenu.add(
- new Ext.menu.CheckItem({
- itemId: 'col-' + i,
- text: c.header,
- checked: !c.hidden,
- hideOnClick: false,
- disabled: c.hideable === false,
- })
- );
- }
- }
- },
-
- // private
- handleHdMenuClick: function (item) {
- var index = this.hdCtxIndex,
- id = item.getItemId();
-
- if (
- this.fireEvent(
- 'headermenuclick',
- this.columns[index],
- id,
- index
- ) !== false
- ) {
- index = id.substr(4);
- if (index > 0 && this.columns[index]) {
- this.setColumnVisible(index, !item.checked);
- }
- }
-
- return true;
- },
-
- setColumnVisible: function (index, visible) {
- this.columns[index].hidden = !visible;
- this.updateColumnWidths();
- },
-
- /**
- * Scrolls the grid to the top
- */
- scrollToTop: function () {
- this.innerBody.dom.scrollTop = 0;
- this.innerBody.dom.scrollLeft = 0;
- },
-
- // private
- syncScroll: function () {
- this.syncHeaderScroll();
- var mb = this.innerBody.dom;
- this.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop);
- },
-
- // private
- syncHeaderScroll: function () {
- var mb = this.innerBody.dom;
- this.innerHd.dom.scrollLeft = mb.scrollLeft;
- this.innerHd.dom.scrollLeft = mb.scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore)
- },
-
- registerNode: function (n) {
- Ext.ux.tree.TreeGrid.superclass.registerNode.call(this, n);
- if (!n.uiProvider && !n.isRoot && !n.ui.isTreeGridNodeUI) {
- n.ui = new Ext.ux.tree.TreeGridNodeUI(n);
- }
- },
-});
-
-Ext.reg('treegrid', Ext.ux.tree.TreeGrid);
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/**
- * @class Ext.tree.ColumnResizer
- * @extends Ext.util.Observable
- */
-Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, {
- /**
- * @cfg {Number} minWidth The minimum width the column can be dragged to.
- * Defaults to <tt>14</tt>.
- */
- minWidth: 14,
-
- constructor: function (config) {
- Ext.apply(this, config);
- Ext.tree.ColumnResizer.superclass.constructor.call(this);
- },
-
- init: function (tree) {
- this.tree = tree;
- tree.on('render', this.initEvents, this);
- },
-
- initEvents: function (tree) {
- tree.mon(tree.innerHd, 'mousemove', this.handleHdMove, this);
- this.tracker = new Ext.dd.DragTracker({
- onBeforeStart: this.onBeforeStart.createDelegate(this),
- onStart: this.onStart.createDelegate(this),
- onDrag: this.onDrag.createDelegate(this),
- onEnd: this.onEnd.createDelegate(this),
- tolerance: 3,
- autoStart: 300,
- });
- this.tracker.initEl(tree.innerHd);
- tree.on('beforedestroy', this.tracker.destroy, this.tracker);
- },
-
- handleHdMove: function (e, t) {
- var hw = 5,
- x = e.getPageX(),
- hd = e.getTarget('.x-treegrid-hd', 3, true);
-
- if (hd) {
- var r = hd.getRegion(),
- ss = hd.dom.style,
- pn = hd.dom.parentNode;
-
- if (x - r.left <= hw && hd.dom !== pn.firstChild) {
- var ps = hd.dom.previousSibling;
- while (ps && Ext.fly(ps).hasClass('x-treegrid-hd-hidden')) {
- ps = ps.previousSibling;
- }
- if (ps) {
- this.activeHd = Ext.get(ps);
- ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';
- }
- } else if (r.right - x <= hw) {
- var ns = hd.dom;
- while (ns && Ext.fly(ns).hasClass('x-treegrid-hd-hidden')) {
- ns = ns.previousSibling;
- }
- if (ns) {
- this.activeHd = Ext.get(ns);
- ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';
- }
- } else {
- delete this.activeHd;
- ss.cursor = '';
- }
- }
- },
-
- onBeforeStart: function (e) {
- this.dragHd = this.activeHd;
- return !!this.dragHd;
- },
-
- onStart: function (e) {
- this.dragHeadersDisabled = this.tree.headersDisabled;
- this.tree.headersDisabled = true;
- this.proxy = this.tree.body.createChild({ cls: 'x-treegrid-resizer' });
- this.proxy.setHeight(this.tree.body.getHeight());
-
- var x = this.tracker.getXY()[0];
-
- this.hdX = this.dragHd.getX();
- this.hdIndex = this.tree.findHeaderIndex(this.dragHd);
-
- this.proxy.setX(this.hdX);
- this.proxy.setWidth(x - this.hdX);
-
- this.maxWidth =
- this.tree.outerCt.getWidth() -
- this.tree.innerBody.translatePoints(this.hdX).left;
- },
-
- onDrag: function (e) {
- var cursorX = this.tracker.getXY()[0];
- this.proxy.setWidth(
- (cursorX - this.hdX).constrain(this.minWidth, this.maxWidth)
- );
- },
-
- onEnd: function (e) {
- var nw = this.proxy.getWidth(),
- tree = this.tree,
- disabled = this.dragHeadersDisabled;
-
- this.proxy.remove();
- delete this.dragHd;
-
- tree.columns[this.hdIndex].width = nw;
- tree.updateColumnWidths();
-
- setTimeout(function () {
- tree.headersDisabled = disabled;
- }, 100);
- },
-});
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-(function () {
- Ext.override(Ext.list.Column, {
- init: function () {
- var types = Ext.data.Types,
- st = this.sortType;
-
- if (this.type) {
- if (Ext.isString(this.type)) {
- this.type =
- Ext.data.Types[this.type.toUpperCase()] || types.AUTO;
- }
- } else {
- this.type = types.AUTO;
- }
-
- // named sortTypes are supported, here we look them up
- if (Ext.isString(st)) {
- this.sortType = Ext.data.SortTypes[st];
- } else if (Ext.isEmpty(st)) {
- this.sortType = this.type.sortType;
- }
- },
- });
-
- Ext.tree.Column = Ext.extend(Ext.list.Column, {});
- Ext.tree.NumberColumn = Ext.extend(Ext.list.NumberColumn, {});
- Ext.tree.DateColumn = Ext.extend(Ext.list.DateColumn, {});
- Ext.tree.BooleanColumn = Ext.extend(Ext.list.BooleanColumn, {});
-
- Ext.reg('tgcolumn', Ext.tree.Column);
- Ext.reg('tgnumbercolumn', Ext.tree.NumberColumn);
- Ext.reg('tgdatecolumn', Ext.tree.DateColumn);
- Ext.reg('tgbooleancolumn', Ext.tree.BooleanColumn);
-})();
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/**
- * @class Ext.ux.tree.TreeGridLoader
- * @extends Ext.tree.TreeLoader
- */
-Ext.ux.tree.TreeGridLoader = Ext.extend(Ext.tree.TreeLoader, {
- createNode: function (attr) {
- if (!attr.uiProvider) {
- attr.uiProvider = Ext.ux.tree.TreeGridNodeUI;
- }
- return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
- },
-});
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/**
- * @class Ext.ux.tree.TreeGridNodeUI
- * @extends Ext.tree.TreeNodeUI
- */
-Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
- isTreeGridNodeUI: true,
-
- renderElements: function (n, a, targetNode, bulkRender) {
- var t = n.getOwnerTree(),
- cols = t.columns,
- c = cols[0],
- i,
- buf,
- len;
-
- this.indentMarkup = n.parentNode
- ? n.parentNode.ui.getChildIndent()
- : '';
-
- buf = [
- '<tbody class="x-tree-node">',
- '<tr ext:tree-node-id="',
- n.id,
- '" class="x-tree-node-el x-tree-node-leaf ',
- a.cls,
- '">',
- '<td class="x-treegrid-col">',
- '<span class="x-tree-node-indent">',
- this.indentMarkup,
- '</span>',
- '<img src="',
- this.emptyIcon,
- '" class="x-tree-ec-icon x-tree-elbow" />',
- '<img src="',
- a.icon || this.emptyIcon,
- '" class="x-tree-node-icon',
- a.icon ? ' x-tree-node-inline-icon' : '',
- a.iconCls ? ' ' + a.iconCls : '',
- '" unselectable="on" />',
- '<a hidefocus="on" class="x-tree-node-anchor" href="',
- a.href ? a.href : '#',
- '" tabIndex="1" ',
- a.hrefTarget ? ' target="' + a.hrefTarget + '"' : '',
- '>',
- '<span unselectable="on">',
- c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text,
- '</span></a>',
- '</td>',
- ];
-
- for (i = 1, len = cols.length; i < len; i++) {
- c = cols[i];
- buf.push(
- '<td class="x-treegrid-col ',
- c.cls ? c.cls : '',
- '">',
- '<div unselectable="on" class="x-treegrid-text"',
- c.align ? ' style="text-align: ' + c.align + ';"' : '',
- '>',
- c.tpl ? c.tpl.apply(a) : a[c.dataIndex],
- '</div>',
- '</td>'
- );
- }
-
- buf.push(
- '</tr><tr class="x-tree-node-ct"><td colspan="',
- cols.length,
- '">',
- '<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ',
- t.innerCt.getWidth(),
- 'px;"><colgroup>'
- );
- for (i = 0, len = cols.length; i < len; i++) {
- buf.push(
- '<col style="width: ',
- cols[i].hidden ? 0 : cols[i].width,
- 'px;" />'
- );
- }
- buf.push('</colgroup></table></td></tr></tbody>');
-
- if (bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()) {
- this.wrap = Ext.DomHelper.insertHtml(
- 'beforeBegin',
- n.nextSibling.ui.getEl(),
- buf.join('')
- );
- } else {
- this.wrap = Ext.DomHelper.insertHtml(
- 'beforeEnd',
- targetNode,
- buf.join('')
- );
- }
-
- this.elNode = this.wrap.childNodes[0];
- this.ctNode = this.wrap.childNodes[1].firstChild.firstChild;
- var cs = this.elNode.firstChild.childNodes;
- this.indentNode = cs[0];
- this.ecNode = cs[1];
- this.iconNode = cs[2];
- this.anchor = cs[3];
- this.textNode = cs[3].firstChild;
- },
-
- // private
- animExpand: function (cb) {
- this.ctNode.style.display = '';
- Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb);
- },
-});
-
-Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
- isTreeGridNodeUI: true,
-
- // private
- render: function () {
- if (!this.rendered) {
- this.wrap = this.ctNode = this.node.ownerTree.innerCt.dom;
- this.node.expanded = true;
- }
-
- if (Ext.isWebKit) {
- // weird table-layout: fixed issue in webkit
- var ct = this.ctNode;
- ct.style.tableLayout = null;
- (function () {
- ct.style.tableLayout = 'fixed';
- }.defer(1));
- }
- },
-
- destroy: function () {
- if (this.elNode) {
- Ext.dd.Registry.unregister(this.elNode.id);
- }
- delete this.node;
- },
-
- collapse: Ext.emptyFn,
- expand: Ext.emptyFn,
-});
-/**
- * Ext.ux.tree.TreeGridNodeUIFix.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
- *
- * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
- * the additional special exception to link portions of this program with the OpenSSL library.
- * See LICENSE for more details.
- */
-
-Ext.override(Ext.ux.tree.TreeGridNodeUI, {
- updateColumns: function () {
- if (!this.rendered) return;
-
- var a = this.node.attributes,
- t = this.node.getOwnerTree(),
- cols = t.columns,
- c = cols[0];
-
- // Update the first column
- this.anchor.firstChild.innerHTML = c.tpl
- ? c.tpl.apply(a)
- : a[c.dataIndex] || c.text;
-
- // Update the remaining columns
- for (i = 1, len = cols.length; i < len; i++) {
- c = cols[i];
- this.elNode.childNodes[i].firstChild.innerHTML = c.tpl
- ? c.tpl.apply(a)
- : a[c.dataIndex] || c.text;
- }
- },
-});
-Ext.tree.RenderColumn = Ext.extend(Ext.tree.Column, {
- constructor: function (c) {
- c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
- c.tpl.format = c.renderer;
- c.tpl.col = this;
- Ext.tree.RenderColumn.superclass.constructor.call(this, c);
- },
-});
-Ext.reg('tgrendercolumn', Ext.tree.RenderColumn);
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-Ext.ns('Ext.ux.tree');
-
-/**
- * @class Ext.ux.tree.TreeGridSorter
- * @extends Ext.tree.TreeSorter
- * Provides sorting of nodes in a {@link Ext.ux.tree.TreeGrid}. The TreeGridSorter automatically monitors events on the
- * associated TreeGrid that might affect the tree's sort order (beforechildrenrendered, append, insert and textchange).
- * Example usage:<br />
- * <pre><code>
- new Ext.ux.tree.TreeGridSorter(myTreeGrid, {
- folderSort: true,
- dir: "desc",
- sortType: function(node) {
- // sort by a custom, typed attribute:
- return parseInt(node.id, 10);
- }
- });
- </code></pre>
- * @constructor
- * @param {TreeGrid} tree
- * @param {Object} config
- */
-Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
- /**
- * @cfg {Array} sortClasses The CSS classes applied to a header when it is sorted. (defaults to <tt>['sort-asc', 'sort-desc']</tt>)
- */
- sortClasses: ['sort-asc', 'sort-desc'],
- /**
- * @cfg {String} sortAscText The text displayed in the 'Sort Ascending' menu item (defaults to <tt>'Sort Ascending'</tt>)
- */
- sortAscText: 'Sort Ascending',
- /**
- * @cfg {String} sortDescText The text displayed in the 'Sort Descending' menu item (defaults to <tt>'Sort Descending'</tt>)
- */
- sortDescText: 'Sort Descending',
-
- constructor: function (tree, config) {
- if (!Ext.isObject(config)) {
- config = {
- property: tree.columns[0].dataIndex || 'text',
- folderSort: true,
- };
- }
-
- Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(
- this,
- arguments
- );
-
- this.tree = tree;
- tree.on('headerclick', this.onHeaderClick, this);
- tree.ddAppendOnly = true;
-
- var me = this;
- this.defaultSortFn = function (n1, n2) {
- var desc = me.dir && me.dir.toLowerCase() == 'desc',
- prop = me.property || 'text',
- sortType = me.sortType,
- caseSensitive = me.caseSensitive === true,
- leafAttr = me.leafAttr || 'leaf',
- attr1 = n1.attributes,
- attr2 = n2.attributes;
-
- if (me.folderSort) {
- if (attr1[leafAttr] && !attr2[leafAttr]) {
- return 1;
- }
- if (!attr1[leafAttr] && attr2[leafAttr]) {
- return -1;
- }
- }
- var prop1 = attr1[prop],
- prop2 = attr2[prop],
- v1 = sortType
- ? sortType(prop1)
- : caseSensitive
- ? prop1
- : prop1.toUpperCase();
- v2 = sortType
- ? sortType(prop2)
- : caseSensitive
- ? prop2
- : prop2.toUpperCase();
-
- if (v1 < v2) {
- return desc ? +1 : -1;
- } else if (v1 > v2) {
- return desc ? -1 : +1;
- } else {
- return 0;
- }
- };
-
- tree.on('afterrender', this.onAfterTreeRender, this, { single: true });
- tree.on('headermenuclick', this.onHeaderMenuClick, this);
- },
-
- onAfterTreeRender: function () {
- if (this.tree.hmenu) {
- this.tree.hmenu.insert(
- 0,
- {
- itemId: 'asc',
- text: this.sortAscText,
- cls: 'xg-hmenu-sort-asc',
- },
- {
- itemId: 'desc',
- text: this.sortDescText,
- cls: 'xg-hmenu-sort-desc',
- }
- );
- }
- this.updateSortIcon(0, 'asc');
- },
-
- onHeaderMenuClick: function (c, id, index) {
- if (id === 'asc' || id === 'desc') {
- this.onHeaderClick(c, null, index);
- return false;
- }
- },
-
- onHeaderClick: function (c, el, i) {
- if (c && !this.tree.headersDisabled) {
- var me = this;
-
- me.property = c.dataIndex;
- me.dir = c.dir = c.dir === 'desc' ? 'asc' : 'desc';
- me.sortType = c.sortType;
- me.caseSensitive === Ext.isBoolean(c.caseSensitive)
- ? c.caseSensitive
- : this.caseSensitive;
- me.sortFn = c.sortFn || this.defaultSortFn;
-
- this.tree.root.cascade(function (n) {
- if (!n.isLeaf()) {
- me.updateSort(me.tree, n);
- }
- });
-
- this.updateSortIcon(i, c.dir);
- }
- },
-
- // private
- updateSortIcon: function (col, dir) {
- var sc = this.sortClasses,
- hds = this.tree.innerHd.select('td').removeClass(sc);
- hds.item(col).addClass(sc[dir == 'desc' ? 1 : 0]);
- },
-});
-Ext.ux.JSLoader = function (options) {
- Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index] = {
- url: options.url,
- success: true,
- jsLoadObj: null,
- options: options,
- onLoad: options.onLoad || Ext.emptyFn,
- onError: options.onError || Ext.ux.JSLoader.stdError,
- scope: options.scope || this,
- };
-
- Ext.Ajax.request({
- url: options.url,
- scriptIndex: Ext.ux.JSLoader.index,
- success: function (response, options) {
- var script = Ext.ux.JSLoader.scripts[options.scriptIndex];
- try {
- eval(response.responseText);
- } catch (e) {
- script.success = false;
- script.onError(script.options, e);
- }
- if (script.success) {
- script.onLoad.call(script.scope, script.options);
- }
- },
- failure: function (response, options) {
- var script = Ext.ux.JSLoader.scripts[options.scriptIndex];
- script.success = false;
- script.onError(script.options, response.status);
- },
- });
-};
-Ext.ux.JSLoader.index = 0;
-Ext.ux.JSLoader.scripts = [];
-Ext.ux.JSLoader.stdError = function (options, e) {
- window.alert(
- 'Error loading script:\n\n' + options.url + '\n\nstatus: ' + e
- );
-};
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/**
- * @class Ext.ux.Spinner
- * @extends Ext.util.Observable
- * Creates a Spinner control utilized by Ext.ux.form.SpinnerField
- */
-Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
- incrementValue: 1,
- alternateIncrementValue: 5,
- triggerClass: 'x-form-spinner-trigger',
- splitterClass: 'x-form-spinner-splitter',
- alternateKey: Ext.EventObject.shiftKey,
- defaultValue: 0,
- accelerate: false,
-
- constructor: function (config) {
- Ext.ux.Spinner.superclass.constructor.call(this, config);
- Ext.apply(this, config);
- this.mimicing = false;
- },
-
- init: function (field) {
- this.field = field;
-
- field.afterMethod('onRender', this.doRender, this);
- field.afterMethod('onEnable', this.doEnable, this);
- field.afterMethod('onDisable', this.doDisable, this);
- field.afterMethod('afterRender', this.doAfterRender, this);
- field.afterMethod('onResize', this.doResize, this);
- field.afterMethod('onFocus', this.doFocus, this);
- field.beforeMethod('onDestroy', this.doDestroy, this);
- },
-
- doRender: function (ct, position) {
- var el = (this.el = this.field.getEl());
- var f = this.field;
-
- if (!f.wrap) {
- f.wrap = this.wrap = el.wrap({
- cls: 'x-form-field-wrap',
- });
- } else {
- this.wrap = f.wrap.addClass('x-form-field-wrap');
- }
-
- this.trigger = this.wrap.createChild({
- tag: 'img',
- src: Ext.BLANK_IMAGE_URL,
- cls: 'x-form-trigger ' + this.triggerClass,
- });
-
- if (!f.width) {
- this.wrap.setWidth(el.getWidth() + this.trigger.getWidth());
- }
-
- this.splitter = this.wrap.createChild({
- tag: 'div',
- cls: this.splitterClass,
- style: 'width:13px; height:2px;',
- });
- this.splitter
- .setRight(Ext.isIE ? 1 : 2)
- .setTop(10)
- .show();
-
- this.proxy = this.trigger.createProxy('', this.splitter, true);
- this.proxy.addClass('x-form-spinner-proxy');
- this.proxy.setStyle('left', '0px');
- this.proxy.setSize(14, 1);
- this.proxy.hide();
- this.dd = new Ext.dd.DDProxy(this.splitter.dom.id, 'SpinnerDrag', {
- dragElId: this.proxy.id,
- });
-
- this.initTrigger();
- this.initSpinner();
- },
-
- doAfterRender: function () {
- var y;
- if (Ext.isIE && this.el.getY() != (y = this.trigger.getY())) {
- this.el.position();
- this.el.setY(y);
- }
- },
-
- doEnable: function () {
- if (this.wrap) {
- this.disabled = false;
- this.wrap.removeClass(this.field.disabledClass);
- }
- },
-
- doDisable: function () {
- if (this.wrap) {
- this.disabled = true;
- this.wrap.addClass(this.field.disabledClass);
- this.el.removeClass(this.field.disabledClass);
- }
- },
-
- doResize: function (w, h) {
- if (typeof w == 'number') {
- this.el.setWidth(w - this.trigger.getWidth());
- }
- this.wrap.setWidth(this.el.getWidth() + this.trigger.getWidth());
- },
-
- doFocus: function () {
- if (!this.mimicing) {
- this.wrap.addClass('x-trigger-wrap-focus');
- this.mimicing = true;
- Ext.get(Ext.isIE ? document.body : document).on(
- 'mousedown',
- this.mimicBlur,
- this,
- {
- delay: 10,
- }
- );
- this.el.on('keydown', this.checkTab, this);
- }
- },
-
- // private
- checkTab: function (e) {
- if (e.getKey() == e.TAB) {
- this.triggerBlur();
- }
- },
-
- // private
- mimicBlur: function (e) {
- if (!this.wrap.contains(e.target) && this.field.validateBlur(e)) {
- this.triggerBlur();
- }
- },
-
- // private
- triggerBlur: function () {
- this.mimicing = false;
- Ext.get(Ext.isIE ? document.body : document).un(
- 'mousedown',
- this.mimicBlur,
- this
- );
- this.el.un('keydown', this.checkTab, this);
- this.field.beforeBlur();
- this.wrap.removeClass('x-trigger-wrap-focus');
- this.field.onBlur.call(this.field);
- },
-
- initTrigger: function () {
- this.trigger.addClassOnOver('x-form-trigger-over');
- this.trigger.addClassOnClick('x-form-trigger-click');
- },
-
- initSpinner: function () {
- this.field.addEvents({
- spin: true,
- spinup: true,
- spindown: true,
- });
-
- this.keyNav = new Ext.KeyNav(this.el, {
- up: function (e) {
- e.preventDefault();
- this.onSpinUp();
- },
-
- down: function (e) {
- e.preventDefault();
- this.onSpinDown();
- },
-
- pageUp: function (e) {
- e.preventDefault();
- this.onSpinUpAlternate();
- },
-
- pageDown: function (e) {
- e.preventDefault();
- this.onSpinDownAlternate();
- },
-
- scope: this,
- });
-
- this.repeater = new Ext.util.ClickRepeater(this.trigger, {
- accelerate: this.accelerate,
- });
- this.field.mon(this.repeater, 'click', this.onTriggerClick, this, {
- preventDefault: true,
- });
-
- this.field.mon(this.trigger, {
- mouseover: this.onMouseOver,
- mouseout: this.onMouseOut,
- mousemove: this.onMouseMove,
- mousedown: this.onMouseDown,
- mouseup: this.onMouseUp,
- scope: this,
- preventDefault: true,
- });
-
- this.field.mon(this.wrap, 'mousewheel', this.handleMouseWheel, this);
-
- this.dd.setXConstraint(0, 0, 10);
- this.dd.setYConstraint(1500, 1500, 10);
- this.dd.endDrag = this.endDrag.createDelegate(this);
- this.dd.startDrag = this.startDrag.createDelegate(this);
- this.dd.onDrag = this.onDrag.createDelegate(this);
- },
-
- onMouseOver: function () {
- if (this.disabled) {
- return;
- }
- var middle = this.getMiddle();
- this.tmpHoverClass =
- Ext.EventObject.getPageY() < middle
- ? 'x-form-spinner-overup'
- : 'x-form-spinner-overdown';
- this.trigger.addClass(this.tmpHoverClass);
- },
-
- //private
- onMouseOut: function () {
- this.trigger.removeClass(this.tmpHoverClass);
- },
-
- //private
- onMouseMove: function () {
- if (this.disabled) {
- return;
- }
- var middle = this.getMiddle();
- if (
- (Ext.EventObject.getPageY() > middle &&
- this.tmpHoverClass == 'x-form-spinner-overup') ||
- (Ext.EventObject.getPageY() < middle &&
- this.tmpHoverClass == 'x-form-spinner-overdown')
- ) {
- }
- },
-
- //private
- onMouseDown: function () {
- if (this.disabled) {
- return;
- }
- var middle = this.getMiddle();
- this.tmpClickClass =
- Ext.EventObject.getPageY() < middle
- ? 'x-form-spinner-clickup'
- : 'x-form-spinner-clickdown';
- this.trigger.addClass(this.tmpClickClass);
- },
-
- //private
- onMouseUp: function () {
- this.trigger.removeClass(this.tmpClickClass);
- },
-
- //private
- onTriggerClick: function () {
- if (this.disabled || this.el.dom.readOnly) {
- return;
- }
- var middle = this.getMiddle();
- var ud = Ext.EventObject.getPageY() < middle ? 'Up' : 'Down';
- this['onSpin' + ud]();
- },
-
- //private
- getMiddle: function () {
- var t = this.trigger.getTop();
- var h = this.trigger.getHeight();
- var middle = t + h / 2;
- return middle;
- },
-
- //private
- //checks if control is allowed to spin
- isSpinnable: function () {
- if (this.disabled || this.el.dom.readOnly) {
- Ext.EventObject.preventDefault(); //prevent scrolling when disabled/readonly
- return false;
- }
- return true;
- },
-
- handleMouseWheel: function (e) {
- //disable scrolling when not focused
- if (this.wrap.hasClass('x-trigger-wrap-focus') == false) {
- return;
- }
-
- var delta = e.getWheelDelta();
- if (delta > 0) {
- this.onSpinUp();
- e.stopEvent();
- } else if (delta < 0) {
- this.onSpinDown();
- e.stopEvent();
- }
- },
-
- //private
- startDrag: function () {
- this.proxy.show();
- this._previousY = Ext.fly(this.dd.getDragEl()).getTop();
- },
-
- //private
- endDrag: function () {
- this.proxy.hide();
- },
-
- //private
- onDrag: function () {
- if (this.disabled) {
- return;
- }
- var y = Ext.fly(this.dd.getDragEl()).getTop();
- var ud = '';
-
- if (this._previousY > y) {
- ud = 'Up';
- } //up
- if (this._previousY < y) {
- ud = 'Down';
- } //down
- if (ud != '') {
- this['onSpin' + ud]();
- }
-
- this._previousY = y;
- },
-
- //private
- onSpinUp: function () {
- if (this.isSpinnable() == false) {
- return;
- }
- if (Ext.EventObject.shiftKey == true) {
- this.onSpinUpAlternate();
- return;
- } else {
- this.spin(false, false);
- }
- this.field.fireEvent('spin', this);
- this.field.fireEvent('spinup', this);
- },
-
- //private
- onSpinDown: function () {
- if (this.isSpinnable() == false) {
- return;
- }
- if (Ext.EventObject.shiftKey == true) {
- this.onSpinDownAlternate();
- return;
- } else {
- this.spin(true, false);
- }
- this.field.fireEvent('spin', this);
- this.field.fireEvent('spindown', this);
- },
-
- //private
- onSpinUpAlternate: function () {
- if (this.isSpinnable() == false) {
- return;
- }
- this.spin(false, true);
- this.field.fireEvent('spin', this);
- this.field.fireEvent('spinup', this);
- },
-
- //private
- onSpinDownAlternate: function () {
- if (this.isSpinnable() == false) {
- return;
- }
- this.spin(true, true);
- this.field.fireEvent('spin', this);
- this.field.fireEvent('spindown', this);
- },
-
- spin: function (down, alternate) {
- var v = parseFloat(this.field.getValue());
- var incr =
- alternate == true
- ? this.alternateIncrementValue
- : this.incrementValue;
- down == true ? (v -= incr) : (v += incr);
-
- v = isNaN(v) ? this.defaultValue : v;
- v = this.fixBoundries(v);
- this.field.setRawValue(v);
- },
-
- fixBoundries: function (value) {
- var v = value;
-
- if (this.field.minValue != undefined && v < this.field.minValue) {
- v = this.field.minValue;
- }
- if (this.field.maxValue != undefined && v > this.field.maxValue) {
- v = this.field.maxValue;
- }
-
- return this.fixPrecision(v);
- },
-
- // private
- fixPrecision: function (value) {
- var nan = isNaN(value);
- if (
- !this.field.allowDecimals ||
- this.field.decimalPrecision == -1 ||
- nan ||
- !value
- ) {
- return nan ? '' : value;
- }
- return parseFloat(
- parseFloat(value).toFixed(this.field.decimalPrecision)
- );
- },
-
- doDestroy: function () {
- if (this.trigger) {
- this.trigger.remove();
- }
- if (this.wrap) {
- this.wrap.remove();
- delete this.field.wrap;
- }
-
- if (this.splitter) {
- this.splitter.remove();
- }
-
- if (this.dd) {
- this.dd.unreg();
- this.dd = null;
- }
-
- if (this.proxy) {
- this.proxy.remove();
- }
-
- if (this.repeater) {
- this.repeater.purgeListeners();
- }
- if (this.mimicing) {
- Ext.get(Ext.isIE ? document.body : document).un(
- 'mousedown',
- this.mimicBlur,
- this
- );
- }
- },
-});
-
-//backwards compat
-Ext.form.Spinner = Ext.ux.Spinner;
-/**
- * Ext JS Library 3.4.0
- * Copyright(c) 2006-2011 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/**
- * @class Ext.ux.StatusBar
- * <p>Basic status bar component that can be used as the bottom toolbar of any {@link Ext.Panel}. In addition to
- * supporting the standard {@link Ext.Toolbar} interface for adding buttons, menus and other items, the StatusBar
- * provides a greedy status element that can be aligned to either side and has convenient methods for setting the
- * status text and icon. You can also indicate that something is processing using the {@link #showBusy} method.</p>
- * <pre><code>
-new Ext.Panel({
- title: 'StatusBar',
- // etc.
- bbar: new Ext.ux.StatusBar({
- id: 'my-status',
-
- // defaults to use when the status is cleared:
- defaultText: 'Default status text',
- defaultIconCls: 'default-icon',
-
- // values to set initially:
- text: 'Ready',
- iconCls: 'ready-icon',
-
- // any standard Toolbar items:
- items: [{
- text: 'A Button'
- }, '-', 'Plain Text']
- })
-});
-
-// Update the status bar later in code:
-var sb = Ext.getCmp('my-status');
-sb.setStatus({
- text: 'OK',
- iconCls: 'ok-icon',
- clear: true // auto-clear after a set interval
-});
-
-// Set the status bar to show that something is processing:
-sb.showBusy();
-
-// processing....
-
-sb.clearStatus(); // once completeed
-</code></pre>
- * @extends Ext.Toolbar
- * @constructor
- * Creates a new StatusBar
- * @param {Object/Array} config A config object
- */
-Ext.ux.StatusBar = Ext.extend(Ext.Toolbar, {
- /**
- * @cfg {String} statusAlign
- * The alignment of the status element within the overall StatusBar layout. When the StatusBar is rendered,
- * it creates an internal div containing the status text and icon. Any additional Toolbar items added in the
- * StatusBar's {@link #items} config, or added via {@link #add} or any of the supported add* methods, will be
- * rendered, in added order, to the opposite side. The status element is greedy, so it will automatically
- * expand to take up all sapce left over by any other items. Example usage:
- * <pre><code>
-// Create a left-aligned status bar containing a button,
-// separator and text item that will be right-aligned (default):
-new Ext.Panel({
- title: 'StatusBar',
- // etc.
- bbar: new Ext.ux.StatusBar({
- defaultText: 'Default status text',
- id: 'status-id',
- items: [{
- text: 'A Button'
- }, '-', 'Plain Text']
- })
-});
-
-// By adding the statusAlign config, this will create the
-// exact same toolbar, except the status and toolbar item
-// layout will be reversed from the previous example:
-new Ext.Panel({
- title: 'StatusBar',
- // etc.
- bbar: new Ext.ux.StatusBar({
- defaultText: 'Default status text',
- id: 'status-id',
- statusAlign: 'right',
- items: [{
- text: 'A Button'
- }, '-', 'Plain Text']
- })
-});
-</code></pre>
- */
- /**
- * @cfg {String} defaultText
- * The default {@link #text} value. This will be used anytime the status bar is cleared with the
- * <tt>useDefaults:true</tt> option (defaults to '').
- */
- /**
- * @cfg {String} defaultIconCls
- * The default {@link #iconCls} value (see the iconCls docs for additional details about customizing the icon).
- * This will be used anytime the status bar is cleared with the <tt>useDefaults:true</tt> option (defaults to '').
- */
- /**
- * @cfg {String} text
- * A string that will be <b>initially</b> set as the status message. This string
- * will be set as innerHTML (html tags are accepted) for the toolbar item.
- * If not specified, the value set for <code>{@link #defaultText}</code>
- * will be used.
- */
- /**
- * @cfg {String} iconCls
- * A CSS class that will be <b>initially</b> set as the status bar icon and is
- * expected to provide a background image (defaults to '').
- * Example usage:<pre><code>
-// Example CSS rule:
-.x-statusbar .x-status-custom {
- padding-left: 25px;
- background: transparent url(images/custom-icon.gif) no-repeat 3px 2px;
-}
-
-// Setting a default icon:
-var sb = new Ext.ux.StatusBar({
- defaultIconCls: 'x-status-custom'
-});
-
-// Changing the icon:
-sb.setStatus({
- text: 'New status',
- iconCls: 'x-status-custom'
-});
-</code></pre>
- */
-
- /**
- * @cfg {String} cls
- * The base class applied to the containing element for this component on render (defaults to 'x-statusbar')
- */
- cls: 'x-statusbar',
- /**
- * @cfg {String} busyIconCls
- * The default <code>{@link #iconCls}</code> applied when calling
- * <code>{@link #showBusy}</code> (defaults to <tt>'x-status-busy'</tt>).
- * It can be overridden at any time by passing the <code>iconCls</code>
- * argument into <code>{@link #showBusy}</code>.
- */
- busyIconCls: 'x-status-busy',
- /**
- * @cfg {String} busyText
- * The default <code>{@link #text}</code> applied when calling
- * <code>{@link #showBusy}</code> (defaults to <tt>'Loading...'</tt>).
- * It can be overridden at any time by passing the <code>text</code>
- * argument into <code>{@link #showBusy}</code>.
- */
- busyText: 'Loading...',
- /**
- * @cfg {Number} autoClear
- * The number of milliseconds to wait after setting the status via
- * <code>{@link #setStatus}</code> before automatically clearing the status
- * text and icon (defaults to <tt>5000</tt>). Note that this only applies
- * when passing the <tt>clear</tt> argument to <code>{@link #setStatus}</code>
- * since that is the only way to defer clearing the status. This can
- * be overridden by specifying a different <tt>wait</tt> value in
- * <code>{@link #setStatus}</code>. Calls to <code>{@link #clearStatus}</code>
- * always clear the status bar immediately and ignore this value.
- */
- autoClear: 5000,
-
- /**
- * @cfg {String} emptyText
- * The text string to use if no text has been set. Defaults to
- * <tt>'&nbsp;'</tt>). If there are no other items in the toolbar using
- * an empty string (<tt>''</tt>) for this value would end up in the toolbar
- * height collapsing since the empty string will not maintain the toolbar
- * height. Use <tt>''</tt> if the toolbar should collapse in height
- * vertically when no text is specified and there are no other items in
- * the toolbar.
- */
- emptyText: '&nbsp;',
-
- // private
- activeThreadId: 0,
-
- // private
- initComponent: function () {
- if (this.statusAlign == 'right') {
- this.cls += ' x-status-right';
- }
- Ext.ux.StatusBar.superclass.initComponent.call(this);
- },
-
- // private
- afterRender: function () {
- Ext.ux.StatusBar.superclass.afterRender.call(this);
-
- var right = this.statusAlign == 'right';
- this.currIconCls = this.iconCls || this.defaultIconCls;
- this.statusEl = new Ext.Toolbar.TextItem({
- cls: 'x-status-text ' + (this.currIconCls || ''),
- text: this.text || this.defaultText || '',
- });
-
- if (right) {
- this.add('->');
- this.add(this.statusEl);
- } else {
- this.insert(0, this.statusEl);
- this.insert(1, '->');
- }
- this.doLayout();
- },
-
- /**
- * Sets the status {@link #text} and/or {@link #iconCls}. Also supports automatically clearing the
- * status that was set after a specified interval.
- * @param {Object/String} config A config object specifying what status to set, or a string assumed
- * to be the status text (and all other options are defaulted as explained below). A config
- * object containing any or all of the following properties can be passed:<ul>
- * <li><tt>text</tt> {String} : (optional) The status text to display. If not specified, any current
- * status text will remain unchanged.</li>
- * <li><tt>iconCls</tt> {String} : (optional) The CSS class used to customize the status icon (see
- * {@link #iconCls} for details). If not specified, any current iconCls will remain unchanged.</li>
- * <li><tt>clear</tt> {Boolean/Number/Object} : (optional) Allows you to set an internal callback that will
- * automatically clear the status text and iconCls after a specified amount of time has passed. If clear is not
- * specified, the new status will not be auto-cleared and will stay until updated again or cleared using
- * {@link #clearStatus}. If <tt>true</tt> is passed, the status will be cleared using {@link #autoClear},
- * {@link #defaultText} and {@link #defaultIconCls} via a fade out animation. If a numeric value is passed,
- * it will be used as the callback interval (in milliseconds), overriding the {@link #autoClear} value.
- * All other options will be defaulted as with the boolean option. To customize any other options,
- * you can pass an object in the format:<ul>
- * <li><tt>wait</tt> {Number} : (optional) The number of milliseconds to wait before clearing
- * (defaults to {@link #autoClear}).</li>
- * <li><tt>anim</tt> {Number} : (optional) False to clear the status immediately once the callback
- * executes (defaults to true which fades the status out).</li>
- * <li><tt>useDefaults</tt> {Number} : (optional) False to completely clear the status text and iconCls
- * (defaults to true which uses {@link #defaultText} and {@link #defaultIconCls}).</li>
- * </ul></li></ul>
- * Example usage:<pre><code>
-// Simple call to update the text
-statusBar.setStatus('New status');
-
-// Set the status and icon, auto-clearing with default options:
-statusBar.setStatus({
- text: 'New status',
- iconCls: 'x-status-custom',
- clear: true
-});
-
-// Auto-clear with custom options:
-statusBar.setStatus({
- text: 'New status',
- iconCls: 'x-status-custom',
- clear: {
- wait: 8000,
- anim: false,
- useDefaults: false
- }
-});
-</code></pre>
- * @return {Ext.ux.StatusBar} this
- */
- setStatus: function (o) {
- o = o || {};
-
- if (typeof o == 'string') {
- o = { text: o };
- }
- if (o.text !== undefined) {
- this.setText(o.text);
- }
- if (o.iconCls !== undefined) {
- this.setIcon(o.iconCls);
- }
-
- if (o.clear) {
- var c = o.clear,
- wait = this.autoClear,
- defaults = { useDefaults: true, anim: true };
-
- if (typeof c == 'object') {
- c = Ext.applyIf(c, defaults);
- if (c.wait) {
- wait = c.wait;
- }
- } else if (typeof c == 'number') {
- wait = c;
- c = defaults;
- } else if (typeof c == 'boolean') {
- c = defaults;
- }
-
- c.threadId = this.activeThreadId;
- this.clearStatus.defer(wait, this, [c]);
- }
- return this;
- },
-
- /**
- * Clears the status {@link #text} and {@link #iconCls}. Also supports clearing via an optional fade out animation.
- * @param {Object} config (optional) A config object containing any or all of the following properties. If this
- * object is not specified the status will be cleared using the defaults below:<ul>
- * <li><tt>anim</tt> {Boolean} : (optional) True to clear the status by fading out the status element (defaults
- * to false which clears immediately).</li>
- * <li><tt>useDefaults</tt> {Boolean} : (optional) True to reset the text and icon using {@link #defaultText} and
- * {@link #defaultIconCls} (defaults to false which sets the text to '' and removes any existing icon class).</li>
- * </ul>
- * @return {Ext.ux.StatusBar} this
- */
- clearStatus: function (o) {
- o = o || {};
-
- if (o.threadId && o.threadId !== this.activeThreadId) {
- // this means the current call was made internally, but a newer
- // thread has set a message since this call was deferred. Since
- // we don't want to overwrite a newer message just ignore.
- return this;
- }
-
- var text = o.useDefaults ? this.defaultText : this.emptyText,
- iconCls = o.useDefaults
- ? this.defaultIconCls
- ? this.defaultIconCls
- : ''
- : '';
-
- if (o.anim) {
- // animate the statusEl Ext.Element
- this.statusEl.el.fadeOut({
- remove: false,
- useDisplay: true,
- scope: this,
- callback: function () {
- this.setStatus({
- text: text,
- iconCls: iconCls,
- });
-
- this.statusEl.el.show();
- },
- });
- } else {
- // hide/show the el to avoid jumpy text or icon
- this.statusEl.hide();
- this.setStatus({
- text: text,
- iconCls: iconCls,
- });
- this.statusEl.show();
- }
- return this;
- },
-
- /**
- * Convenience method for setting the status text directly. For more flexible options see {@link #setStatus}.
- * @param {String} text (optional) The text to set (defaults to '')
- * @return {Ext.ux.StatusBar} this
- */
- setText: function (text) {
- this.activeThreadId++;
- this.text = text || '';
- if (this.rendered) {
- this.statusEl.setText(this.text);
- }
- return this;
- },
-
- /**
- * Returns the current status text.
- * @return {String} The status text
- */
- getText: function () {
- return this.text;
- },
-
- /**
- * Convenience method for setting the status icon directly. For more flexible options see {@link #setStatus}.
- * See {@link #iconCls} for complete details about customizing the icon.
- * @param {String} iconCls (optional) The icon class to set (defaults to '', and any current icon class is removed)
- * @return {Ext.ux.StatusBar} this
- */
- setIcon: function (cls) {
- this.activeThreadId++;
- cls = cls || '';
-
- if (this.rendered) {
- if (this.currIconCls) {
- this.statusEl.removeClass(this.currIconCls);
- this.currIconCls = null;
- }
- if (cls.length > 0) {
- this.statusEl.addClass(cls);
- this.currIconCls = cls;
- }
- } else {
- this.currIconCls = cls;
- }
- return this;
- },
-
- /**
- * Convenience method for setting the status text and icon to special values that are pre-configured to indicate
- * a "busy" state, usually for loading or processing activities.
- * @param {Object/String} config (optional) A config object in the same format supported by {@link #setStatus}, or a
- * string to use as the status text (in which case all other options for setStatus will be defaulted). Use the
- * <tt>text</tt> and/or <tt>iconCls</tt> properties on the config to override the default {@link #busyText}
- * and {@link #busyIconCls} settings. If the config argument is not specified, {@link #busyText} and
- * {@link #busyIconCls} will be used in conjunction with all of the default options for {@link #setStatus}.
- * @return {Ext.ux.StatusBar} this
- */
- showBusy: function (o) {
- if (typeof o == 'string') {
- o = { text: o };
- }
- o = Ext.applyIf(o || {}, {
- text: this.busyText,
- iconCls: this.busyIconCls,
- });
- return this.setStatus(o);
- },
-});
-Ext.reg('statusbar', Ext.ux.StatusBar);
diff --git a/deluge/ui/web/js/extjs/ext-extensions.js b/deluge/ui/web/js/extjs/ext-extensions.js
deleted file mode 100644
index e6cb62c..0000000
--- a/deluge/ui/web/js/extjs/ext-extensions.js
+++ /dev/null
@@ -1,84 +0,0 @@
-Ext.ns("Ext.ux.form");
-Ext.ux.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:"Browse...",buttonOnly:!1,buttonOffset:3,multiple:!1,readOnly:!0,autoSize:Ext.emptyFn,initComponent:function(){Ext.ux.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected")},onRender:function(a,b){Ext.ux.form.FileUploadField.superclass.onRender.call(this,a,b);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.createFileInput();
-var c=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(c,{renderTo:this.wrap,cls:"x-form-file-btn"+(c.iconCls?" x-btn-icon":"")}));this.buttonOnly&&(this.el.hide(),this.wrap.setWidth(this.button.getEl().getWidth()));this.bindListeners();this.resizeEl=this.positionEl=this.wrap},bindListeners:function(){this.fileInput.on({scope:this,mouseenter:function(){this.button.addClass(["x-btn-over","x-btn-focus"])},mouseleave:function(){this.button.removeClass(["x-btn-over",
-"x-btn-focus","x-btn-click"])},mousedown:function(){this.button.addClass("x-btn-click")},mouseup:function(){this.button.removeClass(["x-btn-over","x-btn-focus","x-btn-click"])},change:function(){var a=this.fileInput.dom.files;a||(a=this.fileInput.dom.value);this.setValue(a);this.fireEvent("fileselected",this,a)}})},createFileInput:function(){this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:"x-form-file",tag:"input",type:"file",size:1});this.fileInput.dom.multiple=
-this.multiple},reset:function(){this.rendered&&(this.fileInput.remove(),this.createFileInput(),this.bindListeners());Ext.ux.form.FileUploadField.superclass.reset.call(this)},getFileInputId:function(){return this.id+"-file"},onResize:function(a,b){Ext.ux.form.FileUploadField.superclass.onResize.call(this,a,b);this.wrap.setWidth(a);this.buttonOnly||(a=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset,this.el.setWidth(a))},onDestroy:function(){Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);
-Ext.destroy(this.fileInput,this.button,this.wrap)},onDisable:function(){Ext.ux.form.FileUploadField.superclass.onDisable.call(this);this.doDisable(!0)},onEnable:function(){Ext.ux.form.FileUploadField.superclass.onEnable.call(this);this.doDisable(!1)},doDisable:function(a){this.fileInput.dom.disabled=a;this.button.setDisabled(a)},preFocus:Ext.emptyFn,alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}});Ext.reg("fileuploadfield",Ext.ux.form.FileUploadField);
-Ext.form.FileUploadField=Ext.ux.form.FileUploadField;
-Ext.override(Ext.form.RadioGroup,{afterRender:function(){this.items.each(function(a){this.relayEvents(a,["check"])},this);this.lazyValue&&(this.setValue(this.value),delete this.value,delete this.lazyValue);Ext.form.RadioGroup.superclass.afterRender.call(this)},getName:function(){return this.items.first().getName()},getValue:function(){return this.items.first().getGroupValue()},setValue:function(a){this.items.each?this.items.each(function(b){if(b.rendered){var c=b.el.getValue()==String(a);b.el.dom.checked=
-c;b.el.dom.defaultChecked=c;b.wrap[c?"addClass":"removeClass"](b.checkedCls)}}):(this.value=a,this.lazyValue=!0)}});Ext.ns("Ext.ux.form");
-Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:!0,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(a){var b=Ext.copyTo({},a,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass"),b=this.spinner=new Ext.ux.Spinner(b),b=a.plugins?Ext.isArray(a.plugins)?a.plugins.push(b):[a.plugins,b]:b;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(a,{plugins:b}))},
-getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.wrap&&this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},validateBlur:function(){return!0}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.override(Ext.ux.form.SpinnerField,{onBlur:Ext.form.Field.prototype.onBlur});Ext.ns("Ext.ux.form");
-Ext.ux.form.SpinnerGroup=Ext.extend(Ext.form.CheckboxGroup,{defaultType:"spinnerfield",anchor:"98%",groupCls:"x-form-spinner-group",colCfg:{},onRender:function(a,b){if(!this.el){var c={cls:this.groupCls,layout:"column",border:!1,renderTo:a},d=Ext.apply({defaultType:this.defaultType,layout:"form",border:!1,labelWidth:60,defaults:{hideLabel:!0,anchor:"60%"}},this.colCfg);if(this.items[0].items){Ext.apply(c,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=
-0,g=this.items.length;e<g;e++)Ext.applyIf(this.items[e],d)}else{var f,h=[];"string"==typeof this.columns&&(this.columns=this.items.length);if(!Ext.isArray(this.columns)){f=[];for(e=0;e<this.columns;e++)f.push(0.01*(100/this.columns));this.columns=f}f=this.columns.length;for(e=0;e<f;e++)g=Ext.apply({items:[]},d),g[1>=this.columns[e]?"columnWidth":"width"]=this.columns[e],this.defaults&&(g.defaults=Ext.apply(g.defaults||{},this.defaults)),h.push(g);if(this.vertical)for(var d=Math.ceil(this.items.length/
-f),k=0,e=0,g=this.items.length;e<g;e++)0<e&&0==e%d&&k++,this.items[e].fieldLabel&&(this.items[e].hideLabel=!1),h[k].items.push(this.items[e]);else{e=0;for(g=this.items.length;e<g;e++)d=e%f,this.items[e].fieldLabel&&(this.items[e].hideLabel=!1),h[d].items.push(this.items[e])}Ext.apply(c,{layoutConfig:{columns:f},items:h})}this.panel=new Ext.Panel(c);this.el=this.panel.getEl();this.forId&&this.itemCls&&(c=this.el.up(this.itemCls).child("label",!0))&&c.setAttribute("htmlFor",this.forId);c=this.panel.findBy(function(a){return a.isFormField},
-this);this.items=new Ext.util.MixedCollection;this.items.addAll(c);this.items.each(function(a){a.on("spin",this.onFieldChange,this);a.on("change",this.onFieldChange,this)},this);this.lazyValueSet&&(this.setValue(this.value),delete this.value,delete this.lazyValueSet);this.lazyRawValueSet&&(this.setRawValue(this.rawValue),delete this.rawValue,delete this.lazyRawValueSet)}Ext.ux.form.SpinnerGroup.superclass.onRender.call(this,a,b)},onFieldChange:function(a){this.fireEvent("change",this,this.getValue())},
-initValue:Ext.emptyFn,getValue:function(){var a=[this.items.getCount()];this.items.each(function(b,c){a[c]=Number(b.getValue())});return a},getRawValue:function(){var a=[this.items.getCount()];this.items.each(function(b,c){a[c]=Number(b.getRawValue())});return a},setValue:function(a){this.rendered?this.items.each(function(b,c){b.setValue(a[c])}):(this.value=a,this.lazyValueSet=!0)},setRawValue:function(a){this.rendered?this.items.each(function(b,c){b.setRawValue(a[c])}):(this.rawValue=a,this.lazyRawValueSet=
-!0)}});Ext.reg("spinnergroup",Ext.ux.form.SpinnerGroup);Ext.namespace("Ext.ux.form");
-Ext.ux.form.ToggleField=Ext.extend(Ext.form.Field,{cls:"x-toggle-field",initComponent:function(){Ext.ux.form.ToggleField.superclass.initComponent.call(this);this.toggle=new Ext.form.Checkbox;this.toggle.on("check",this.onToggleCheck,this);this.input=new Ext.form.TextField({disabled:!0})},onRender:function(a,b){this.el||(this.panel=new Ext.Panel({cls:this.groupCls,layout:"table",layoutConfig:{columns:2},border:!1,renderTo:a}),this.panel.ownerCt=this,this.el=this.panel.getEl(),this.panel.add(this.toggle),
-this.panel.add(this.input),this.panel.doLayout(),this.toggle.getEl().parent().setStyle("padding-right","10px"));Ext.ux.form.ToggleField.superclass.onRender.call(this,a,b)},onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout();var c=a-this.toggle.getSize().width-25;this.input.setSize(c,b)},onToggleCheck:function(a,b){this.input.setDisabled(!b)}});Ext.reg("togglefield",Ext.ux.form.ToggleField);Ext.ns("Ext.ux.grid");
-Ext.ux.grid.BufferView=Ext.extend(Ext.grid.GridView,{rowHeight:19,borderHeight:2,scrollDelay:100,cacheSize:20,cleanDelay:500,initTemplates:function(){Ext.ux.grid.BufferView.superclass.initTemplates.call(this);var a=this.templates;a.rowHolder=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"></div>');a.rowHolder.disableFormats=!0;a.rowHolder.compile();a.rowBody=new Ext.Template('<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",
-this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':"","</tbody></table>");a.rowBody.disableFormats=!0;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?this.rowHeight+this.borderHeight:this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var a=this.getCalculatedRowHeight(),
-b=this.scroller.dom.clientHeight;return 1>b?0:Math.ceil(b/a)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,b=0===b?0:Math.floor(b/this.getCalculatedRowHeight())-1;return{first:Math.max(b,0),last:Math.min(b+a+2,this.ds.getCount()-1)}},doRender:function(a,b,c,d,e,g,f){for(var h=this.templates,k=h.cell,l=h.row,t=h.rowBody,p=e-1,u=this.getStyleRowHeight(),y=this.getVisibleRows(),x=[],n,m={},q={tstyle:"width:"+this.getTotalWidth()+";height:"+u+"px;"},r,w=0,A=
-b.length;w<A;w++){r=b[w];var u=[],v=w+d,z=v>=y.first&&v<=y.last;if(z)for(var s=0;s<e;s++){n=a[s];m.id=n.id;m.css=0===s?"x-grid3-cell-first ":s==p?"x-grid3-cell-last ":"";m.attr=m.cellAttr="";m.value=n.renderer(r.data[n.name],m,r,v,s,c);m.style=n.style;if(void 0===m.value||""===m.value)m.value="&#160;";r.dirty&&"undefined"!==typeof r.modified[n.name]&&(m.css+=" x-grid3-dirty-cell");u[u.length]=k.apply(m)}n=[];g&&0===(v+1)%2&&(n[0]="x-grid3-row-alt");r.dirty&&(n[1]=" x-grid3-dirty-row");q.cols=e;this.getRowClass&&
-(n[2]=this.getRowClass(r,v,q,c));q.alt=n.join(" ");q.cells=u.join("");x[x.length]=!z?h.rowHolder.apply(q):f?t.apply(q):l.apply(q)}return x.join("")},isRowRendered:function(a){return(a=this.getRow(a))&&0<a.childNodes.length},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update()},update:function(){this.scrollDelay?(this.renderTask||(this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this)),this.renderTask.delay(this.scrollDelay)):this.doUpdate()},
-onRemove:function(a,b,c,d){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);!0!==d&&this.update()},doUpdate:function(){if(0<this.getVisibleRowCount()){for(var a=this.grid,b=a.colModel,c=a.store,d=this.getColumnData(),e=this.getVisibleRows(),g,f=e.first;f<=e.last;f++)if(!this.isRowRendered(f)&&(g=this.getRow(f))){var h=this.doRender(d,[c.getAt(f)],c,f,b.getColumnCount(),a.stripeRows,!0);g.innerHTML=h}this.clean()}},clean:function(){this.cleanTask||(this.cleanTask=new Ext.util.DelayedTask(this.doClean,
-this));this.cleanTask.delay(this.cleanDelay)},doClean:function(){if(0<this.getVisibleRowCount()){var a=this.getVisibleRows();a.first-=this.cacheSize;a.last+=this.cacheSize;var b=0,c=this.getRows();0>=a.first&&(b=a.last+1);for(var d=this.ds.getCount();b<d;b++)if((b<a.first||b>a.last)&&c[b].innerHTML)c[b].innerHTML=""}},removeTask:function(a){var b=this[a];b&&b.cancel&&(b.cancel(),this[a]=null)},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)},
-layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}});
-Ext.override(Ext.layout.FormLayout,{renderItem:function(a,b,c){if(a&&!a.rendered&&(a.isFormField||a.fieldLabel)&&"hidden"!=a.inputType){var d=this.getTemplateArgs(a);"number"==typeof b&&(b=c.dom.childNodes[b]||null);a.formItem=b?this.fieldTpl.insertBefore(b,d,!0):this.fieldTpl.append(c,d,!0);a.actionMode="formItem";a.render("x-form-el-"+a.id);a.container=a.formItem;a.actionMode="container"}else Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}});
-Ext.override(Ext.tree.MultiSelectionModel,{onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a))this.unselect(a);else if(b.shiftKey&&!this.isSelected(a)){var c=a.parentNode;if(this.lastSelNode.parentNode.id==c.id){var d=c.indexOf(a),e=c.indexOf(this.lastSelNode);this.select(this.lastSelNode,b,!1,!0);d>e&&(d+=e,e=d-e,d-=e);c.eachChild(function(a){var f=c.indexOf(a);d<f&&f<e&&this.select(a,b,!0,!0)},this);this.select(a,b,!0)}}else this.select(a,b,b.ctrlKey)},select:function(a,b,c,d){!0!==c&&this.clearSelections(!0);
-if(this.isSelected(a))return this.lastSelNode=a;this.selNodes.push(a);this.lastSelNode=this.selMap[a.id]=a;a.ui.onSelectedChange(!0);!0!==d&&this.fireEvent("selectionchange",this,this.selNodes);return a}});Ext.ns("Ext.ux.tree");
-Ext.ux.tree.TreeGrid=Ext.extend(Ext.tree.TreePanel,{rootVisible:!1,useArrows:!0,lines:!1,borderWidth:Ext.isBorderBox?0:2,cls:"x-treegrid",columnResize:!0,enableSort:!0,reserveScrollOffset:!0,enableHdMenu:!0,columnsText:"Columns",initComponent:function(){this.root||(this.root=new Ext.tree.AsyncTreeNode({text:"Root"}));var a=this.loader;a?Ext.isObject(a)&&!a.load&&(a=new Ext.ux.tree.TreeGridLoader(a)):a=new Ext.ux.tree.TreeGridLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod,store:this.store});
-this.loader=a;Ext.ux.tree.TreeGrid.superclass.initComponent.call(this);this.initColumns();this.enableSort&&(this.treeGridSorter=new Ext.ux.tree.TreeGridSorter(this,this.enableSort));this.columnResize&&(this.colResizer=new Ext.tree.ColumnResizer(this.columnResize),this.colResizer.init(this));this.internalTpl||(this.internalTpl=new Ext.XTemplate('<div class="x-grid3-header">','<div class="x-treegrid-header-inner">','<div class="x-grid3-header-offset">','<table style="table-layout: fixed;" cellspacing="0" cellpadding="0" border="0"><colgroup><tpl for="columns"><col /></tpl></colgroup>',
-'<thead><tr class="x-grid3-hd-row">','<tpl for="columns">','<td class="x-grid3-hd x-grid3-cell x-treegrid-hd" style="text-align: {align};" id="',this.id,'-xlhd-{#}">','<div class="x-grid3-hd-inner x-treegrid-hd-inner" unselectable="on">',this.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{header}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td></tpl>","</tr></thead>","</table>","</div></div>","</div>",'<div class="x-treegrid-root-node">','<table class="x-treegrid-root-table" cellpadding="0" cellspacing="0" style="table-layout: fixed;"></table>',
-"</div>"));this.colgroupTpl||(this.colgroupTpl=new Ext.XTemplate('<colgroup><tpl for="columns"><col style="width: {width}px"/></tpl></colgroup>'))},initColumns:function(){var a=this.columns,b=a.length,c=[],d,e;for(d=0;d<b;d++)e=a[d],e.isColumn||(e.xtype=e.xtype?/^tg/.test(e.xtype)?e.xtype:"tg"+e.xtype:"tgcolumn",e=Ext.create(e)),e.init(this),c.push(e),!1!==this.enableSort&&!1!==e.sortable&&(this.enableSort=e.sortable=!0);this.columns=c},onRender:function(){Ext.tree.TreePanel.superclass.onRender.apply(this,
-arguments);this.el.addClass("x-treegrid");this.outerCt=this.body.createChild({cls:"x-tree-root-ct x-treegrid-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")});this.internalTpl.overwrite(this.outerCt,{columns:this.columns});this.mainHd=Ext.get(this.outerCt.dom.firstChild);this.innerHd=Ext.get(this.mainHd.dom.firstChild);this.innerBody=Ext.get(this.outerCt.dom.lastChild);this.innerCt=Ext.get(this.innerBody.dom.firstChild);this.colgroupTpl.insertFirst(this.innerCt,{columns:this.columns});
-this.hideHeaders?this.el.child(".x-grid3-header").setDisplayed("none"):!1!==this.enableHdMenu&&(this.hmenu=new Ext.menu.Menu({id:this.id+"-hctx"}),!1!==this.enableColumnHide&&(this.colMenu=new Ext.menu.Menu({id:this.id+"-hcols-menu"}),this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick}),this.hmenu.add({itemId:"columns",hideOnClick:!1,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})),this.hmenu.on("itemclick",this.handleHdMenuClick,this))},
-setRootNode:function(a){a.attributes.uiProvider=Ext.ux.tree.TreeGridRootNodeUI;a=Ext.ux.tree.TreeGrid.superclass.setRootNode.call(this,a);this.innerCt&&this.colgroupTpl.insertFirst(this.innerCt,{columns:this.columns});return a},clearInnerCt:function(){if(Ext.isIE)for(var a=this.innerCt.dom;a.firstChild;)a.removeChild(a.firstChild);else Ext.ux.tree.TreeGrid.superclass.clearInnerCt.call(this)},initEvents:function(){Ext.ux.tree.TreeGrid.superclass.initEvents.apply(this,arguments);this.mon(this.innerBody,
-"scroll",this.syncScroll,this);this.mon(this.innerHd,"click",this.handleHdDown,this);this.mon(this.mainHd,{scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut})},onResize:function(a,b){Ext.ux.tree.TreeGrid.superclass.onResize.apply(this,arguments);var c=this.innerBody.dom,d=this.innerHd.dom;if(c&&(Ext.isNumber(b)&&(c.style.height=this.body.getHeight(!0)-d.offsetHeight+"px"),Ext.isNumber(a))){var e=Ext.num(this.scrollOffset,Ext.getScrollBarWidth());if(this.reserveScrollOffset||10<c.offsetWidth-
-c.clientWidth)this.setScrollOffset(e);else{var g=this;setTimeout(function(){g.setScrollOffset(10<c.offsetWidth-c.clientWidth?e:0)},10)}}},updateColumnWidths:function(){var a=this.columns,b=a.length,c=this.outerCt.query("colgroup"),d=c.length,e,g,f,h;for(f=0;f<b;f++){e=a[f];for(h=0;h<d;h++)g=c[h],g.childNodes[f].style.width=(e.hidden?0:e.width)+"px"}f=0;c=this.innerHd.query("td");for(len=c.length;f<len;f++)e=Ext.fly(c[f]),a[f]&&a[f].hidden?e.addClass("x-treegrid-hd-hidden"):e.removeClass("x-treegrid-hd-hidden");
-a=this.getTotalColumnWidth();Ext.fly(this.innerHd.dom.firstChild).setWidth(a+(this.scrollOffset||0));this.outerCt.select("table").setWidth(a);this.syncHeaderScroll()},getVisibleColumns:function(){var a=[],b=this.columns,c=b.length,d;for(d=0;d<c;d++)b[d].hidden||a.push(b[d]);return a},getTotalColumnWidth:function(){for(var a=0,b=0,c=this.getVisibleColumns(),d=c.length;b<d;b++)a+=c[b].width;return a},setScrollOffset:function(a){this.scrollOffset=a;this.updateColumnWidths()},handleHdDown:function(a,
-b){var c=a.getTarget(".x-treegrid-hd");if(c&&Ext.fly(b).hasClass("x-grid3-hd-btn")){var d=this.hmenu.items,e=this.columns,g=this.findHeaderIndex(c),e=e[g];a.stopEvent();Ext.fly(c).addClass("x-grid3-hd-menu-open");this.hdCtxIndex=g;this.fireEvent("headerbuttonclick",d,e,c,g);this.hmenu.on("hide",function(){Ext.fly(c).removeClass("x-grid3-hd-menu-open")},this,{single:!0});this.hmenu.show(b,"tl-bl?")}else c&&(g=this.findHeaderIndex(c),this.fireEvent("headerclick",this.columns[g],c,g))},handleHdOver:function(a,
-b){var c=a.getTarget(".x-treegrid-hd");if(c&&!this.headersDisabled){index=this.findHeaderIndex(c);this.activeHdRef=b;this.activeHdIndex=index;var d=Ext.get(c);this.activeHdRegion=d.getRegion();d.addClass("x-grid3-hd-over");if(this.activeHdBtn=d.child(".x-grid3-hd-btn"))this.activeHdBtn.dom.style.height=c.firstChild.offsetHeight-1+"px"}},handleHdOut:function(a,b){var c=a.getTarget(".x-treegrid-hd");if(c&&(!Ext.isIE||!a.within(c,!0)))this.activeHdRef=null,Ext.fly(c).removeClass("x-grid3-hd-over"),c.style.cursor=
-""},findHeaderIndex:function(a){a=a.dom||a;for(var b=a.parentNode.childNodes,c=0,d;d=b[c];c++)if(d==a)return c;return-1},beforeColMenuShow:function(){var a=this.columns,b=a.length,c,d;this.colMenu.removeAll();for(c=1;c<b;c++)d=a[c],!1!==d.hideable&&this.colMenu.add(new Ext.menu.CheckItem({itemId:"col-"+c,text:d.header,checked:!d.hidden,hideOnClick:!1,disabled:!1===d.hideable}))},handleHdMenuClick:function(a){var b=this.hdCtxIndex,c=a.getItemId();!1!==this.fireEvent("headermenuclick",this.columns[b],
-c,b)&&(b=c.substr(4),0<b&&this.columns[b]&&this.setColumnVisible(b,!a.checked));return!0},setColumnVisible:function(a,b){this.columns[a].hidden=!b;this.updateColumnWidths()},scrollToTop:function(){this.innerBody.dom.scrollTop=0;this.innerBody.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.innerBody.dom;this.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerBody.dom;this.innerHd.dom.scrollLeft=a.scrollLeft;this.innerHd.dom.scrollLeft=
-a.scrollLeft},registerNode:function(a){Ext.ux.tree.TreeGrid.superclass.registerNode.call(this,a);!a.uiProvider&&(!a.isRoot&&!a.ui.isTreeGridNodeUI)&&(a.ui=new Ext.ux.tree.TreeGridNodeUI(a))}});Ext.reg("treegrid",Ext.ux.tree.TreeGrid);
-Ext.tree.ColumnResizer=Ext.extend(Ext.util.Observable,{minWidth:14,constructor:function(a){Ext.apply(this,a);Ext.tree.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.tree=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),
-tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(a,b){var c=a.getPageX(),d=a.getTarget(".x-treegrid-hd",3,!0);if(d){var e=d.getRegion(),g=d.dom.style,f=d.dom.parentNode;if(5>=c-e.left&&d.dom!==f.firstChild){for(c=d.dom.previousSibling;c&&Ext.fly(c).hasClass("x-treegrid-hd-hidden");)c=c.previousSibling;c&&(this.activeHd=Ext.get(c),g.cursor=Ext.isWebKit?"e-resize":"col-resize")}else if(5>=e.right-c){for(c=d.dom;c&&
-Ext.fly(c).hasClass("x-treegrid-hd-hidden");)c=c.previousSibling;c&&(this.activeHd=Ext.get(c),g.cursor=Ext.isWebKit?"w-resize":"col-resize")}else delete this.activeHd,g.cursor=""}},onBeforeStart:function(a){this.dragHd=this.activeHd;return!!this.dragHd},onStart:function(a){this.dragHeadersDisabled=this.tree.headersDisabled;this.tree.headersDisabled=!0;this.proxy=this.tree.body.createChild({cls:"x-treegrid-resizer"});this.proxy.setHeight(this.tree.body.getHeight());a=this.tracker.getXY()[0];this.hdX=
-this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(a-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left},onDrag:function(a){a=this.tracker.getXY()[0];this.proxy.setWidth((a-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(a){a=this.proxy.getWidth();var b=this.tree,c=this.dragHeadersDisabled;this.proxy.remove();delete this.dragHd;b.columns[this.hdIndex].width=a;b.updateColumnWidths();
-setTimeout(function(){b.headersDisabled=c},100)}});
-(function(){Ext.override(Ext.list.Column,{init:function(){var a=Ext.data.Types,b=this.sortType;this.type?Ext.isString(this.type)&&(this.type=Ext.data.Types[this.type.toUpperCase()]||a.AUTO):this.type=a.AUTO;Ext.isString(b)?this.sortType=Ext.data.SortTypes[b]:Ext.isEmpty(b)&&(this.sortType=this.type.sortType)}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=Ext.extend(Ext.list.BooleanColumn,
-{});Ext.reg("tgcolumn",Ext.tree.Column);Ext.reg("tgnumbercolumn",Ext.tree.NumberColumn);Ext.reg("tgdatecolumn",Ext.tree.DateColumn);Ext.reg("tgbooleancolumn",Ext.tree.BooleanColumn)})();Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(a){a.uiProvider||(a.uiProvider=Ext.ux.tree.TreeGridNodeUI);return Ext.tree.TreeLoader.prototype.createNode.call(this,a)}});
-Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,renderElements:function(a,b,c,d){var e=a.getOwnerTree(),g=e.columns,f=g[0],h,k,l;this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";k=['<tbody class="x-tree-node">','<tr ext:tree-node-id="',a.id,'" class="x-tree-node-el x-tree-node-leaf ',b.cls,'">','<td class="x-treegrid-col">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />',
-'<img src="',b.icon||this.emptyIcon,'" class="x-tree-node-icon',b.icon?" x-tree-node-inline-icon":"",b.iconCls?" "+b.iconCls:"",'" unselectable="on" />','<a hidefocus="on" class="x-tree-node-anchor" href="',b.href?b.href:"#",'" tabIndex="1" ',b.hrefTarget?' target="'+b.hrefTarget+'"':"",">",'<span unselectable="on">',f.tpl?f.tpl.apply(b):b[f.dataIndex]||f.text,"</span></a>","</td>"];h=1;for(l=g.length;h<l;h++)f=g[h],k.push('<td class="x-treegrid-col ',f.cls?f.cls:"",'">','<div unselectable="on" class="x-treegrid-text"',
-f.align?' style="text-align: '+f.align+';"':"",">",f.tpl?f.tpl.apply(b):b[f.dataIndex],"</div>","</td>");k.push('</tr><tr class="x-tree-node-ct"><td colspan="',g.length,'">','<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ',e.innerCt.getWidth(),'px;"><colgroup>');h=0;for(l=g.length;h<l;h++)k.push('<col style="width: ',g[h].hidden?0:g[h].width,'px;" />');k.push("</colgroup></table></td></tr></tbody>");!0!==d&&a.nextSibling&&
-a.nextSibling.ui.getEl()?this.wrap=Ext.DomHelper.insertHtml("beforeBegin",a.nextSibling.ui.getEl(),k.join("")):this.wrap=Ext.DomHelper.insertHtml("beforeEnd",c,k.join(""));this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;a=this.elNode.firstChild.childNodes;this.indentNode=a[0];this.ecNode=a[1];this.iconNode=a[2];this.anchor=a[3];this.textNode=a[3].firstChild},animExpand:function(a){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this,
-a)}});Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,render:function(){this.rendered||(this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom,this.node.expanded=!0);if(Ext.isWebKit){var a=this.ctNode;a.style.tableLayout=null;(function(){a.style.tableLayout="fixed"}).defer(1)}},destroy:function(){this.elNode&&Ext.dd.Registry.unregister(this.elNode.id);delete this.node},collapse:Ext.emptyFn,expand:Ext.emptyFn});
-Ext.override(Ext.ux.tree.TreeGridNodeUI,{updateColumns:function(){if(this.rendered){var a=this.node.attributes,b=this.node.getOwnerTree().columns,c=b[0];this.anchor.firstChild.innerHTML=c.tpl?c.tpl.apply(a):a[c.dataIndex]||c.text;i=1;for(len=b.length;i<len;i++)c=b[i],this.elNode.childNodes[i].firstChild.innerHTML=c.tpl?c.tpl.apply(a):a[c.dataIndex]||c.text}}});
-Ext.tree.RenderColumn=Ext.extend(Ext.tree.Column,{constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+":this.format}");a.tpl.format=a.renderer;a.tpl.col=this;Ext.tree.RenderColumn.superclass.constructor.call(this,a)}});Ext.reg("tgrendercolumn",Ext.tree.RenderColumn);Ext.ns("Ext.ux.tree");
-Ext.ux.tree.TreeGridSorter=Ext.extend(Ext.tree.TreeSorter,{sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",constructor:function(a,b){Ext.isObject(b)||(b={property:a.columns[0].dataIndex||"text",folderSort:!0});Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(this,arguments);this.tree=a;a.on("headerclick",this.onHeaderClick,this);a.ddAppendOnly=!0;var c=this;this.defaultSortFn=function(a,b){var g=c.dir&&"desc"==c.dir.toLowerCase(),f=c.property||
-"text",h=c.sortType,k=!0===c.caseSensitive,l=c.leafAttr||"leaf",t=a.attributes,p=b.attributes;if(c.folderSort){if(t[l]&&!p[l])return 1;if(!t[l]&&p[l])return-1}l=t[f];f=p[f];p=h?h(l):k?l:l.toUpperCase();v2=h?h(f):k?f:f.toUpperCase();return p<v2?g?1:-1:p>v2?g?-1:1:0};a.on("afterrender",this.onAfterTreeRender,this,{single:!0});a.on("headermenuclick",this.onHeaderMenuClick,this)},onAfterTreeRender:function(){this.tree.hmenu&&this.tree.hmenu.insert(0,{itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},
-{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});this.updateSortIcon(0,"asc")},onHeaderMenuClick:function(a,b,c){if("asc"===b||"desc"===b)return this.onHeaderClick(a,null,c),!1},onHeaderClick:function(a,b,c){if(a&&!this.tree.headersDisabled){var d=this;d.property=a.dataIndex;d.dir=a.dir="desc"===a.dir?"asc":"desc";d.sortType=a.sortType;d.caseSensitive===Ext.isBoolean(a.caseSensitive)?a.caseSensitive:this.caseSensitive;d.sortFn=a.sortFn||this.defaultSortFn;this.tree.root.cascade(function(a){a.isLeaf()||
-d.updateSort(d.tree,a)});this.updateSortIcon(c,a.dir)}},updateSortIcon:function(a,b){var c=this.sortClasses;this.tree.innerHd.select("td").removeClass(c).item(a).addClass(c["desc"==b?1:0])}});
-Ext.ux.JSLoader=function(a){Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index]={url:a.url,success:!0,jsLoadObj:null,options:a,onLoad:a.onLoad||Ext.emptyFn,onError:a.onError||Ext.ux.JSLoader.stdError,scope:a.scope||this};Ext.Ajax.request({url:a.url,scriptIndex:Ext.ux.JSLoader.index,success:function(a,c){var d=Ext.ux.JSLoader.scripts[c.scriptIndex];try{eval(a.responseText)}catch(e){d.success=!1,d.onError(d.options,e)}d.success&&d.onLoad.call(d.scope,d.options)},failure:function(a,c){var d=Ext.ux.JSLoader.scripts[c.scriptIndex];
-d.success=!1;d.onError(d.options,a.status)}})};Ext.ux.JSLoader.index=0;Ext.ux.JSLoader.scripts=[];Ext.ux.JSLoader.stdError=function(a,b){window.alert("Error loading script:\n\n"+a.url+"\n\nstatus: "+b)};
-Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:!1,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);Ext.apply(this,a);this.mimicing=!1},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable,
-this);a.afterMethod("afterRender",this.doAfterRender,this);a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(a,b){var c=this.el=this.field.getEl(),d=this.field;d.wrap?this.wrap=d.wrap.addClass("x-form-field-wrap"):d.wrap=this.wrap=c.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});d.width||this.wrap.setWidth(c.getWidth()+
-this.trigger.getWidth());this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.setRight(Ext.isIE?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,!0);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var a;
-if(Ext.isIE&&this.el.getY()!=(a=this.trigger.getY()))this.el.position(),this.el.setY(a)},doEnable:function(){this.wrap&&(this.disabled=!1,this.wrap.removeClass(this.field.disabledClass))},doDisable:function(){this.wrap&&(this.disabled=!0,this.wrap.addClass(this.field.disabledClass),this.el.removeClass(this.field.disabledClass))},doResize:function(a,b){"number"==typeof a&&this.el.setWidth(a-this.trigger.getWidth());this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){this.mimicing||
-(this.wrap.addClass("x-trigger-wrap-focus"),this.mimicing=!0,Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10}),this.el.on("keydown",this.checkTab,this))},checkTab:function(a){a.getKey()==a.TAB&&this.triggerBlur()},mimicBlur:function(a){!this.wrap.contains(a.target)&&this.field.validateBlur(a)&&this.triggerBlur()},triggerBlur:function(){this.mimicing=!1;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,
-this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:!0,spinup:!0,spindown:!0});this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp()},down:function(a){a.preventDefault();this.onSpinDown()},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate()},
-pageDown:function(a){a.preventDefault();this.onSpinDownAlternate()},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:!0});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:!0});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);
-this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(!this.disabled){var a=this.getMiddle();this.tmpHoverClass=Ext.EventObject.getPageY()<a?"x-form-spinner-overup":"x-form-spinner-overdown";this.trigger.addClass(this.tmpHoverClass)}},onMouseOut:function(){this.trigger.removeClass(this.tmpHoverClass)},onMouseMove:function(){if(!this.disabled){var a=
-this.getMiddle();Ext.EventObject.getPageY()>a&&"x-form-spinner-overup"==this.tmpHoverClass||Ext.EventObject.getPageY()}},onMouseDown:function(){if(!this.disabled){var a=this.getMiddle();this.tmpClickClass=Ext.EventObject.getPageY()<a?"x-form-spinner-clickup":"x-form-spinner-clickdown";this.trigger.addClass(this.tmpClickClass)}},onMouseUp:function(){this.trigger.removeClass(this.tmpClickClass)},onTriggerClick:function(){if(!this.disabled&&!this.el.dom.readOnly){var a=this.getMiddle();this["onSpin"+
-(Ext.EventObject.getPageY()<a?"Up":"Down")]()}},getMiddle:function(){var a=this.trigger.getTop(),b=this.trigger.getHeight();return a+b/2},isSpinnable:function(){return this.disabled||this.el.dom.readOnly?(Ext.EventObject.preventDefault(),!1):!0},handleMouseWheel:function(a){if(!1!=this.wrap.hasClass("x-trigger-wrap-focus")){var b=a.getWheelDelta();0<b?(this.onSpinUp(),a.stopEvent()):0>b&&(this.onSpinDown(),a.stopEvent())}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()},
-endDrag:function(){this.proxy.hide()},onDrag:function(){if(!this.disabled){var a=Ext.fly(this.dd.getDragEl()).getTop(),b="";this._previousY>a&&(b="Up");this._previousY<a&&(b="Down");if(""!=b)this["onSpin"+b]();this._previousY=a}},onSpinUp:function(){if(!1!=this.isSpinnable())if(!0==Ext.EventObject.shiftKey)this.onSpinUpAlternate();else this.spin(!1,!1),this.field.fireEvent("spin",this),this.field.fireEvent("spinup",this)},onSpinDown:function(){if(!1!=this.isSpinnable())if(!0==Ext.EventObject.shiftKey)this.onSpinDownAlternate();
-else this.spin(!0,!1),this.field.fireEvent("spin",this),this.field.fireEvent("spindown",this)},onSpinUpAlternate:function(){!1!=this.isSpinnable()&&(this.spin(!1,!0),this.field.fireEvent("spin",this),this.field.fireEvent("spinup",this))},onSpinDownAlternate:function(){!1!=this.isSpinnable()&&(this.spin(!0,!0),this.field.fireEvent("spin",this),this.field.fireEvent("spindown",this))},spin:function(a,b){var c=parseFloat(this.field.getValue()),d=!0==b?this.alternateIncrementValue:this.incrementValue;
-!0==a?c-=d:c+=d;c=isNaN(c)?this.defaultValue:c;c=this.fixBoundries(c);this.field.setRawValue(c)},fixBoundries:function(a){void 0!=this.field.minValue&&a<this.field.minValue&&(a=this.field.minValue);void 0!=this.field.maxValue&&a>this.field.maxValue&&(a=this.field.maxValue);return this.fixPrecision(a)},fixPrecision:function(a){var b=isNaN(a);return!this.field.allowDecimals||-1==this.field.decimalPrecision||b||!a?b?"":a:parseFloat(parseFloat(a).toFixed(this.field.decimalPrecision))},doDestroy:function(){this.trigger&&
-this.trigger.remove();this.wrap&&(this.wrap.remove(),delete this.field.wrap);this.splitter&&this.splitter.remove();this.dd&&(this.dd.unreg(),this.dd=null);this.proxy&&this.proxy.remove();this.repeater&&this.repeater.purgeListeners();this.mimicing&&Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this)}});Ext.form.Spinner=Ext.ux.Spinner;
-Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5E3,emptyText:"&nbsp;",activeThreadId:0,initComponent:function(){"right"==this.statusAlign&&(this.cls+=" x-status-right");Ext.ux.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var a="right"==this.statusAlign;this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:"x-status-text "+
-(this.currIconCls||""),text:this.text||this.defaultText||""});a?(this.add("->"),this.add(this.statusEl)):(this.insert(0,this.statusEl),this.insert(1,"->"));this.doLayout()},setStatus:function(a){a=a||{};"string"==typeof a&&(a={text:a});void 0!==a.text&&this.setText(a.text);void 0!==a.iconCls&&this.setIcon(a.iconCls);if(a.clear){a=a.clear;var b=this.autoClear,c={useDefaults:!0,anim:!0};"object"==typeof a?(a=Ext.applyIf(a,c),a.wait&&(b=a.wait)):"number"==typeof a?(b=a,a=c):"boolean"==typeof a&&(a=c);
-a.threadId=this.activeThreadId;this.clearStatus.defer(b,this,[a])}return this},clearStatus:function(a){a=a||{};if(a.threadId&&a.threadId!==this.activeThreadId)return this;var b=a.useDefaults?this.defaultText:this.emptyText,c=a.useDefaults?this.defaultIconCls?this.defaultIconCls:"":"";a.anim?this.statusEl.el.fadeOut({remove:!1,useDisplay:!0,scope:this,callback:function(){this.setStatus({text:b,iconCls:c});this.statusEl.el.show()}}):(this.statusEl.hide(),this.setStatus({text:b,iconCls:c}),this.statusEl.show());
-return this},setText:function(a){this.activeThreadId++;this.text=a||"";this.rendered&&this.statusEl.setText(this.text);return this},getText:function(){return this.text},setIcon:function(a){this.activeThreadId++;a=a||"";this.rendered?(this.currIconCls&&(this.statusEl.removeClass(this.currIconCls),this.currIconCls=null),0<a.length&&(this.statusEl.addClass(a),this.currIconCls=a)):this.currIconCls=a;return this},showBusy:function(a){"string"==typeof a&&(a={text:a});a=Ext.applyIf(a||{},{text:this.busyText,
-iconCls:this.busyIconCls});return this.setStatus(a)}});Ext.reg("statusbar",Ext.ux.StatusBar);
diff --git a/deluge/ui/web/js/gettext.js b/deluge/ui/web/js/gettext.js
deleted file mode 100644
index 559577a..0000000
--- a/deluge/ui/web/js/gettext.js
+++ /dev/null
@@ -1,326 +0,0 @@
-GetText={maps:{},add:function(string,translation){this.maps[string]=translation},get:function(string){if (this.maps[string]){string=this.maps[string]} return string}};function _(string){return GetText.get(string)}GetText.add('10 KiB/s','${escape(_("10 KiB/s"))}')
-GetText.add('30 KiB/s','${escape(_("30 KiB/s"))}')
-GetText.add('300 KiB/s','${escape(_("300 KiB/s"))}')
-GetText.add('5 KiB/s','${escape(_("5 KiB/s"))}')
-GetText.add('80 KiB/s','${escape(_("80 KiB/s"))}')
-GetText.add('<b>IP</b> {0}','${escape(_("<b>IP</b> {0}"))}')
-GetText.add('About Deluge','${escape(_("About Deluge"))}')
-GetText.add('Active','${escape(_("Active"))}')
-GetText.add('Active Torrents','${escape(_("Active Torrents"))}')
-GetText.add('Add','${escape(_("Add"))}')
-GetText.add('Add Connection','${escape(_("Add Connection"))}')
-GetText.add('Add In Paused State','${escape(_("Add In Paused State"))}')
-GetText.add('Add Torrents','${escape(_("Add Torrents"))}')
-GetText.add('Add Tracker','${escape(_("Add Tracker"))}')
-GetText.add('Add from Url','${escape(_("Add from Url"))}')
-GetText.add('Add torrents in Paused state','${escape(_("Add torrents in Paused state"))}')
-GetText.add('Added','${escape(_("Added"))}')
-GetText.add('Address','${escape(_("Address"))}')
-GetText.add('All','${escape(_("All"))}')
-GetText.add('Allocating','${escape(_("Allocating"))}')
-GetText.add('Allow Remote Connections','${escape(_("Allow Remote Connections"))}')
-GetText.add('Allow the use of multiple filters at once','${escape(_("Allow the use of multiple filters at once"))}')
-GetText.add('Announce OK','${escape(_("Announce OK"))}')
-GetText.add('Announce Sent','${escape(_("Announce Sent"))}')
-GetText.add('Apply','${escape(_("Apply"))}')
-GetText.add('Author Email:','${escape(_("Author Email:"))}')
-GetText.add('Author:','${escape(_("Author:"))}')
-GetText.add('Auto Managed','${escape(_("Auto Managed"))}')
-GetText.add('Avail','${escape(_("Avail"))}')
-GetText.add('Back','${escape(_("Back"))}')
-GetText.add('Bandwidth','${escape(_("Bandwidth"))}')
-GetText.add('Be alerted about new releases','${escape(_("Be alerted about new releases"))}')
-GetText.add('Bottom','${escape(_("Bottom"))}')
-GetText.add('Browse','${escape(_("Browse"))}')
-GetText.add('Browse...','${escape(_("Browse..."))}')
-GetText.add('Cache','${escape(_("Cache"))}')
-GetText.add('Cache Expiry (seconds):','${escape(_("Cache Expiry (seconds):"))}')
-GetText.add('Cache Size (16 KiB Blocks):','${escape(_("Cache Size (16 KiB Blocks):"))}')
-GetText.add('Cancel','${escape(_("Cancel"))}')
-GetText.add('Certificate:','${escape(_("Certificate:"))}')
-GetText.add('Change Default Password','${escape(_("Change Default Password"))}')
-GetText.add('Change Successful','${escape(_("Change Successful"))}')
-GetText.add('Checking','${escape(_("Checking"))}')
-GetText.add('Client','${escape(_("Client"))}')
-GetText.add('Client:','${escape(_("Client:"))}')
-GetText.add('Close','${escape(_("Close"))}')
-GetText.add('Comment:','${escape(_("Comment:"))}')
-GetText.add('Complete Seen','${escape(_("Complete Seen"))}')
-GetText.add('Completed','${escape(_("Completed"))}')
-GetText.add('Confirm:','${escape(_("Confirm:"))}')
-GetText.add('Connect','${escape(_("Connect"))}')
-GetText.add('Connected','${escape(_("Connected"))}')
-GetText.add('Connection Limit','${escape(_("Connection Limit"))}')
-GetText.add('Connection Manager','${escape(_("Connection Manager"))}')
-GetText.add('Connection restored','${escape(_("Connection restored"))}')
-GetText.add('Connections','${escape(_("Connections"))}')
-GetText.add('Cookies','${escape(_("Cookies"))}')
-GetText.add('Copy','${escape(_("Copy"))}')
-GetText.add('Copy Magnet URI','${escape(_("Copy Magnet URI"))}')
-GetText.add('Copy of .torrent files to:','${escape(_("Copy of .torrent files to:"))}')
-GetText.add('Copyright 2007-2018 Deluge Team','${escape(_("Copyright 2007-2018 Deluge Team"))}')
-GetText.add('Create','${escape(_("Create"))}')
-GetText.add('Created By:','${escape(_("Created By:"))}')
-GetText.add('D/L Speed Limit','${escape(_("D/L Speed Limit"))}')
-GetText.add('DHT','${escape(_("DHT"))}')
-GetText.add('DHT Nodes','${escape(_("DHT Nodes"))}')
-GetText.add('Daemon','${escape(_("Daemon"))}')
-GetText.add('Daemon port:','${escape(_("Daemon port:"))}')
-GetText.add('Deluge','${escape(_("Deluge"))}')
-GetText.add('Details','${escape(_("Details"))}')
-GetText.add('Details:','${escape(_("Details:"))}')
-GetText.add('Disabled','${escape(_("Disabled"))}')
-GetText.add('Disconnect','${escape(_("Disconnect"))}')
-GetText.add('Down','${escape(_("Down"))}')
-GetText.add('Down Limit','${escape(_("Down Limit"))}')
-GetText.add('Down Speed','${escape(_("Down Speed"))}')
-GetText.add('Download','${escape(_("Download"))}')
-GetText.add('Download Folder','${escape(_("Download Folder"))}')
-GetText.add('Download Folder:','${escape(_("Download Folder:"))}')
-GetText.add('Download Speed','${escape(_("Download Speed"))}')
-GetText.add('Download to:','${escape(_("Download to:"))}')
-GetText.add('Downloaded','${escape(_("Downloaded"))}')
-GetText.add('Downloading','${escape(_("Downloading"))}')
-GetText.add('Downloading:','${escape(_("Downloading:"))}')
-GetText.add('Downloads','${escape(_("Downloads"))}')
-GetText.add('ETA','${escape(_("ETA"))}')
-GetText.add('Edit','${escape(_("Edit"))}')
-GetText.add('Edit Connection','${escape(_("Edit Connection"))}')
-GetText.add('Edit Tracker','${escape(_("Edit Tracker"))}')
-GetText.add('Edit Trackers','${escape(_("Edit Trackers"))}')
-GetText.add('Either','${escape(_("Either"))}')
-GetText.add('Enabled','${escape(_("Enabled"))}')
-GetText.add('Encryption','${escape(_("Encryption"))}')
-GetText.add('Error','${escape(_("Error"))}')
-GetText.add('Expand All','${escape(_("Expand All"))}')
-GetText.add('External IP Address','${escape(_("External IP Address"))}')
-GetText.add('Failed to download torrent','${escape(_("Failed to download torrent"))}')
-GetText.add('Failed to upload torrent','${escape(_("Failed to upload torrent"))}')
-GetText.add('File','${escape(_("File"))}')
-GetText.add('File Browser','${escape(_("File Browser"))}')
-GetText.add('Filename','${escape(_("Filename"))}')
-GetText.add('Files','${escape(_("Files"))}')
-GetText.add('Filters','${escape(_("Filters"))}')
-GetText.add('Find More','${escape(_("Find More"))}')
-GetText.add('Folders','${escape(_("Folders"))}')
-GetText.add('Force Proxy','${escape(_("Force Proxy"))}')
-GetText.add('Force Recheck','${escape(_("Force Recheck"))}')
-GetText.add('Force Use of Proxy','${escape(_("Force Use of Proxy"))}')
-GetText.add('Forced','${escape(_("Forced"))}')
-GetText.add('Forward','${escape(_("Forward"))}')
-GetText.add('Freespace in download folder','${escape(_("Freespace in download folder"))}')
-GetText.add('From:','${escape(_("From:"))}')
-GetText.add('Full Stream','${escape(_("Full Stream"))}')
-GetText.add('General','${escape(_("General"))}')
-GetText.add('GeoIP Database','${escape(_("GeoIP Database"))}')
-GetText.add('Global Bandwidth Usage','${escape(_("Global Bandwidth Usage"))}')
-GetText.add('HTTP','${escape(_("HTTP"))}')
-GetText.add('HTTP Auth','${escape(_("HTTP Auth"))}')
-GetText.add('Handshake','${escape(_("Handshake"))}')
-GetText.add('Hash:','${escape(_("Hash:"))}')
-GetText.add('Help','${escape(_("Help"))}')
-GetText.add('Hide Client Identity','${escape(_("Hide Client Identity"))}')
-GetText.add('High','${escape(_("High"))}')
-GetText.add('Home','${escape(_("Home"))}')
-GetText.add('Homepage:','${escape(_("Homepage:"))}')
-GetText.add('Host','${escape(_("Host"))}')
-GetText.add('Host:','${escape(_("Host:"))}')
-GetText.add('I2P','${escape(_("I2P"))}')
-GetText.add('Ignore limits on local network','${escape(_("Ignore limits on local network"))}')
-GetText.add('Ignore slow torrents','${escape(_("Ignore slow torrents"))}')
-GetText.add('Incoming Address','${escape(_("Incoming Address"))}')
-GetText.add('Incoming Port','${escape(_("Incoming Port"))}')
-GetText.add('Incoming:','${escape(_("Incoming:"))}')
-GetText.add('Infohash','${escape(_("Infohash"))}')
-GetText.add('Install','${escape(_("Install"))}')
-GetText.add('Install Plugin','${escape(_("Install Plugin"))}')
-GetText.add('Interface','${escape(_("Interface"))}')
-GetText.add('Invalid Password','${escape(_("Invalid Password"))}')
-GetText.add('KiB/s','${escape(_("KiB/s"))}')
-GetText.add('LSD','${escape(_("LSD"))}')
-GetText.add('Labels','${escape(_("Labels"))}')
-GetText.add('Language','${escape(_("Language"))}')
-GetText.add('Last Transfer','${escape(_("Last Transfer"))}')
-GetText.add('Level:','${escape(_("Level:"))}')
-GetText.add('Loading','${escape(_("Loading"))}')
-GetText.add('Login','${escape(_("Login"))}')
-GetText.add('Login Failed','${escape(_("Login Failed"))}')
-GetText.add('Logout','${escape(_("Logout"))}')
-GetText.add('Lost Connection','${escape(_("Lost Connection"))}')
-GetText.add('Lost connection to webserver','${escape(_("Lost connection to webserver"))}')
-GetText.add('Low','${escape(_("Low"))}')
-GetText.add('Max Connections','${escape(_("Max Connections"))}')
-GetText.add('Max Connections:','${escape(_("Max Connections:"))}')
-GetText.add('Max Down Speed','${escape(_("Max Down Speed"))}')
-GetText.add('Max Download Speed:','${escape(_("Max Download Speed:"))}')
-GetText.add('Max Up Speed','${escape(_("Max Up Speed"))}')
-GetText.add('Max Upload Slots','${escape(_("Max Upload Slots"))}')
-GetText.add('Max Upload Slots:','${escape(_("Max Upload Slots:"))}')
-GetText.add('Max Upload Speed:','${escape(_("Max Upload Speed:"))}')
-GetText.add('Maximum Connection Attempts per Second:','${escape(_("Maximum Connection Attempts per Second:"))}')
-GetText.add('Maximum Connections:','${escape(_("Maximum Connections:"))}')
-GetText.add('Maximum Download Speed (KiB/s):','${escape(_("Maximum Download Speed (KiB/s):"))}')
-GetText.add('Maximum Half-Open Connections:','${escape(_("Maximum Half-Open Connections:"))}')
-GetText.add('Maximum Upload Slots','${escape(_("Maximum Upload Slots"))}')
-GetText.add('Maximum Upload Slots:','${escape(_("Maximum Upload Slots:"))}')
-GetText.add('Maximum Upload Speed (KiB/s):','${escape(_("Maximum Upload Speed (KiB/s):"))}')
-GetText.add('Mixed','${escape(_("Mixed"))}')
-GetText.add('Move','${escape(_("Move"))}')
-GetText.add('Move Completed Folder','${escape(_("Move Completed Folder"))}')
-GetText.add('Move Completed:','${escape(_("Move Completed:"))}')
-GetText.add('Move Download Folder','${escape(_("Move Download Folder"))}')
-GetText.add('Move completed to:','${escape(_("Move completed to:"))}')
-GetText.add('NAT-PMP','${escape(_("NAT-PMP"))}')
-GetText.add('Name','${escape(_("Name"))}')
-GetText.add('Name:','${escape(_("Name:"))}')
-GetText.add('Network','${escape(_("Network"))}')
-GetText.add('Network Extras','${escape(_("Network Extras"))}')
-GetText.add('Never','${escape(_("Never"))}')
-GetText.add('New Torrents','${escape(_("New Torrents"))}')
-GetText.add('New:','${escape(_("New:"))}')
-GetText.add('None','${escape(_("None"))}')
-GetText.add('Normal','${escape(_("Normal"))}')
-GetText.add('Not Connected','${escape(_("Not Connected"))}')
-GetText.add('Not a valid torrent','${escape(_("Not a valid torrent"))}')
-GetText.add('OK','${escape(_("OK"))}')
-GetText.add('Off','${escape(_("Off"))}')
-GetText.add('Offline','${escape(_("Offline"))}')
-GetText.add('Old:','${escape(_("Old:"))}')
-GetText.add('On','${escape(_("On"))}')
-GetText.add('Online','${escape(_("Online"))}')
-GetText.add('Options','${escape(_("Options"))}')
-GetText.add('Other','${escape(_("Other"))}')
-GetText.add('Outgoing Interface','${escape(_("Outgoing Interface"))}')
-GetText.add('Outgoing Ports','${escape(_("Outgoing Ports"))}')
-GetText.add('Outgoing:','${escape(_("Outgoing:"))}')
-GetText.add('Owner','${escape(_("Owner"))}')
-GetText.add('Password','${escape(_("Password"))}')
-GetText.add('Password:','${escape(_("Password:"))}')
-GetText.add('Path:','${escape(_("Path:"))}')
-GetText.add('Pause','${escape(_("Pause"))}')
-GetText.add('Pause torrent','${escape(_("Pause torrent"))}')
-GetText.add('Paused','${escape(_("Paused"))}')
-GetText.add('Peer Exchange','${escape(_("Peer Exchange"))}')
-GetText.add('Peer TOS Byte:','${escape(_("Peer TOS Byte:"))}')
-GetText.add('Peers','${escape(_("Peers"))}')
-GetText.add('Per Torrent Bandwidth Usage','${escape(_("Per Torrent Bandwidth Usage"))}')
-GetText.add('Periodically check the website for new releases','${escape(_("Periodically check the website for new releases"))}')
-GetText.add('Plugin','${escape(_("Plugin"))}')
-GetText.add('Plugin Egg','${escape(_("Plugin Egg"))}')
-GetText.add('Plugins','${escape(_("Plugins"))}')
-GetText.add('Port','${escape(_("Port"))}')
-GetText.add('Port:','${escape(_("Port:"))}')
-GetText.add('Pre-allocate disk space','${escape(_("Pre-allocate disk space"))}')
-GetText.add('Preallocate Disk Space','${escape(_("Preallocate Disk Space"))}')
-GetText.add('Prefer seeding torrents','${escape(_("Prefer seeding torrents"))}')
-GetText.add('Preferences','${escape(_("Preferences"))}')
-GetText.add('Prioritize First/Last','${escape(_("Prioritize First/Last"))}')
-GetText.add('Prioritize First/Last Pieces','${escape(_("Prioritize First/Last Pieces"))}')
-GetText.add('Prioritize first and last pieces of torrent','${escape(_("Prioritize first and last pieces of torrent"))}')
-GetText.add('Priority','${escape(_("Priority"))}')
-GetText.add('Private','${escape(_("Private"))}')
-GetText.add('Private Key:','${escape(_("Private Key:"))}')
-GetText.add('Progress','${escape(_("Progress"))}')
-GetText.add('Protocol Traffic Download/Upload','${escape(_("Protocol Traffic Download/Upload"))}')
-GetText.add('Proxy','${escape(_("Proxy"))}')
-GetText.add('Proxy Hostnames','${escape(_("Proxy Hostnames"))}')
-GetText.add('Proxy Peers','${escape(_("Proxy Peers"))}')
-GetText.add('Proxy Trackers','${escape(_("Proxy Trackers"))}')
-GetText.add('Public','${escape(_("Public"))}')
-GetText.add('Queue','${escape(_("Queue"))}')
-GetText.add('Queue to top','${escape(_("Queue to top"))}')
-GetText.add('Queued','${escape(_("Queued"))}')
-GetText.add('Rate limit IP overhead','${escape(_("Rate limit IP overhead"))}')
-GetText.add('Ratio','${escape(_("Ratio"))}')
-GetText.add('Refresh','${escape(_("Refresh"))}')
-GetText.add('Remaining','${escape(_("Remaining"))}')
-GetText.add('Remove','${escape(_("Remove"))}')
-GetText.add('Remove Torrent','${escape(_("Remove Torrent"))}')
-GetText.add('Remove With Data','${escape(_("Remove With Data"))}')
-GetText.add('Remove at ratio','${escape(_("Remove at ratio"))}')
-GetText.add('Remove torrent','${escape(_("Remove torrent"))}')
-GetText.add('Resume','${escape(_("Resume"))}')
-GetText.add('Save','${escape(_("Save"))}')
-GetText.add('Seeding','${escape(_("Seeding"))}')
-GetText.add('Seeding Rotation','${escape(_("Seeding Rotation"))}')
-GetText.add('Seeding:','${escape(_("Seeding:"))}')
-GetText.add('Seeds','${escape(_("Seeds"))}')
-GetText.add('Seeds:Peers','${escape(_("Seeds:Peers"))}')
-GetText.add('Select an egg','${escape(_("Select an egg"))}')
-GetText.add('Sequential Download','${escape(_("Sequential Download"))}')
-GetText.add('Sequential download','${escape(_("Sequential download"))}')
-GetText.add('Server','${escape(_("Server"))}')
-GetText.add('Server:','${escape(_("Server:"))}')
-GetText.add('Session Timeout:','${escape(_("Session Timeout:"))}')
-GetText.add('Set Maximum Connections','${escape(_("Set Maximum Connections"))}')
-GetText.add('Set Maximum Download Speed','${escape(_("Set Maximum Download Speed"))}')
-GetText.add('Set Maximum Upload Speed','${escape(_("Set Maximum Upload Speed"))}')
-GetText.add('Settings','${escape(_("Settings"))}')
-GetText.add('Share Ratio Reached','${escape(_("Share Ratio Reached"))}')
-GetText.add('Share Ratio:','${escape(_("Share Ratio:"))}')
-GetText.add('Shared','${escape(_("Shared"))}')
-GetText.add('Show filters with zero torrents','${escape(_("Show filters with zero torrents"))}')
-GetText.add('Show session speed in titlebar','${escape(_("Show session speed in titlebar"))}')
-GetText.add('Size','${escape(_("Size"))}')
-GetText.add('Skip','${escape(_("Skip"))}')
-GetText.add('Skip File Hash Check','${escape(_("Skip File Hash Check"))}')
-GetText.add('Socks4','${escape(_("Socks4"))}')
-GetText.add('Socks5','${escape(_("Socks5"))}')
-GetText.add('Socks5 Auth','${escape(_("Socks5 Auth"))}')
-GetText.add('Start Daemon','${escape(_("Start Daemon"))}')
-GetText.add('State','${escape(_("State"))}')
-GetText.add('States','${escape(_("States"))}')
-GetText.add('Status','${escape(_("Status"))}')
-GetText.add('Status:','${escape(_("Status:"))}')
-GetText.add('Stop Daemon','${escape(_("Stop Daemon"))}')
-GetText.add('Stop seed at ratio:','${escape(_("Stop seed at ratio:"))}')
-GetText.add('Super Seed','${escape(_("Super Seed"))}')
-GetText.add('Super Seeding','${escape(_("Super Seeding"))}')
-GetText.add('System Default','${escape(_("System Default"))}')
-GetText.add('System Information','${escape(_("System Information"))}')
-GetText.add('The connection to the webserver has been lost!','${escape(_("The connection to the webserver has been lost!"))}')
-GetText.add('Tier','${escape(_("Tier"))}')
-GetText.add('Time (m):','${escape(_("Time (m):"))}')
-GetText.add('Time Ratio:','${escape(_("Time Ratio:"))}')
-GetText.add('To:','${escape(_("To:"))}')
-GetText.add('Top','${escape(_("Top"))}')
-GetText.add('Total Files:','${escape(_("Total Files:"))}')
-GetText.add('Total Size:','${escape(_("Total Size:"))}')
-GetText.add('Total:','${escape(_("Total:"))}')
-GetText.add('Tracker','${escape(_("Tracker"))}')
-GetText.add('Tracker Host','${escape(_("Tracker Host"))}')
-GetText.add('Tracker:','${escape(_("Tracker:"))}')
-GetText.add('Trackers','${escape(_("Trackers"))}')
-GetText.add('Trackers:','${escape(_("Trackers:"))}')
-GetText.add('Type Of Service','${escape(_("Type Of Service"))}')
-GetText.add('Type:','${escape(_("Type:"))}')
-GetText.add('U/L Speed Limit','${escape(_("U/L Speed Limit"))}')
-GetText.add('UPnP','${escape(_("UPnP"))}')
-GetText.add('Unable to add host: {0}','${escape(_("Unable to add host: {0}"))}')
-GetText.add('Unable to edit host','${escape(_("Unable to edit host"))}')
-GetText.add('Unlimited','${escape(_("Unlimited"))}')
-GetText.add('Up','${escape(_("Up"))}')
-GetText.add('Up Limit','${escape(_("Up Limit"))}')
-GetText.add('Up Speed','${escape(_("Up Speed"))}')
-GetText.add('Update Tracker','${escape(_("Update Tracker"))}')
-GetText.add('Updates','${escape(_("Updates"))}')
-GetText.add('Upload Slot Limit','${escape(_("Upload Slot Limit"))}')
-GetText.add('Upload Speed','${escape(_("Upload Speed"))}')
-GetText.add('Uploaded','${escape(_("Uploaded"))}')
-GetText.add('Uploading your plugin...','${escape(_("Uploading your plugin..."))}')
-GetText.add('Uploading your torrent...','${escape(_("Uploading your torrent..."))}')
-GetText.add('Url','${escape(_("Url"))}')
-GetText.add('Use Random Port','${escape(_("Use Random Port"))}')
-GetText.add('Use Random Ports','${escape(_("Use Random Ports"))}')
-GetText.add('Username:','${escape(_("Username:"))}')
-GetText.add('Version','${escape(_("Version"))}')
-GetText.add('Version:','${escape(_("Version:"))}')
-GetText.add('Warning','${escape(_("Warning"))}')
-GetText.add('WebUI Language Changed','${escape(_("WebUI Language Changed"))}')
-GetText.add('WebUI Password','${escape(_("WebUI Password"))}')
-GetText.add('Yes, please send anonymous statistics','${escape(_("Yes, please send anonymous statistics"))}')
-GetText.add('You entered an incorrect password','${escape(_("You entered an incorrect password"))}')
-GetText.add('Your old password was incorrect!','${escape(_("Your old password was incorrect!"))}')
-GetText.add('Your password was successfully changed!','${escape(_("Your password was successfully changed!"))}')
-GetText.add('libtorrent:','${escape(_("libtorrent:"))}')
-GetText.add('n/a','${escape(_("n/a"))}')
diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py
index f391a78..77c1ddf 100644
--- a/deluge/ui/web/server.py
+++ b/deluge/ui/web/server.py
@@ -73,6 +73,20 @@ def rpath(*paths):
return common.resource_filename('deluge.ui.web', os.path.join(*paths))
+def absolute_base_url(base):
+ """Returns base as absolute URL for links"""
+ if not base:
+ base = '/'
+
+ if not base.startswith('/'):
+ base = '/' + base
+
+ if not base.endswith('/'):
+ base += '/'
+
+ return base
+
+
class GetText(resource.Resource):
def render(self, request):
request.setHeader(b'content-type', b'text/javascript; encoding=utf-8')
@@ -127,14 +141,12 @@ class Upload(resource.Resource):
request.setHeader(b'content-type', b'text/html')
request.setResponseCode(http.OK)
- return json.dumps({'success': bool(filenames), 'files': filenames}).encode(
- 'utf8'
- )
+ return json.dumps({'success': bool(filenames), 'files': filenames}).encode()
class Render(resource.Resource):
def __init__(self):
- resource.Resource.__init__(self)
+ super().__init__()
# Make a list of all the template files to check requests against.
self.template_files = fnmatch.filter(os.listdir(rpath('render')), '*.html')
@@ -163,7 +175,7 @@ class Render(resource.Resource):
class Tracker(resource.Resource):
def __init__(self):
- resource.Resource.__init__(self)
+ super().__init__()
try:
self.tracker_icons = component.get('TrackerIcons')
except KeyError:
@@ -178,7 +190,7 @@ class Tracker(resource.Resource):
request.setHeader(
b'cache-control', b'public, must-revalidate, max-age=86400'
)
- request.setHeader(b'content-type', icon.get_mimetype().encode('utf8'))
+ request.setHeader(b'content-type', icon.get_mimetype().encode())
request.setResponseCode(http.OK)
request.write(icon.get_data())
request.finish()
@@ -198,7 +210,7 @@ class Flag(resource.Resource):
return self
def render(self, request):
- flag = request.country.decode('utf-8').lower() + '.png'
+ flag = request.country.decode().lower() + '.png'
path = ('ui', 'data', 'pixmaps', 'flags', flag)
filename = common.resource_filename('deluge', os.path.join(*path))
if os.path.exists(filename):
@@ -447,7 +459,6 @@ class Themes(static.File):
class TopLevel(resource.Resource):
-
__stylesheets = [
'css/ext-all-notheme.css',
'css/ext-extensions.css',
@@ -455,7 +466,7 @@ class TopLevel(resource.Resource):
]
def __init__(self):
- resource.Resource.__init__(self)
+ super().__init__()
self.putChild(b'css', LookupResource('Css', rpath('css')))
if os.path.isfile(rpath('js', 'gettext.js')):
@@ -475,7 +486,8 @@ class TopLevel(resource.Resource):
self.putChild(
b'ui_images',
LookupResource(
- 'UI_Images', common.resource_filename('deluge.ui.data', 'pixmaps')
+ 'UI_Images',
+ common.resource_filename('deluge.ui', os.path.join('data', 'pixmaps')),
),
)
@@ -558,30 +570,21 @@ class TopLevel(resource.Resource):
self.__scripts.remove(script)
self.__debug_scripts.remove(script)
- def getChild(self, path, request): # NOQA: N802
- if not path:
- return self
- else:
- return resource.Resource.getChild(self, path, request)
-
def getChildWithDefault(self, path, request): # NOQA: N802
# Calculate the request base
- header = request.getHeader(b'x-deluge-base')
- base = header.decode('utf-8') if header else component.get('DelugeWeb').base
-
- # validate the base parameter
- if not base:
- base = '/'
+ header = request.getHeader('x-deluge-base')
+ config_base = component.get('DelugeWeb').base
+ base = header if header else config_base
- if base[0] != '/':
- base = '/' + base
+ first_request = not hasattr(request, 'base')
+ request.base = absolute_base_url(base).encode()
- if base[-1] != '/':
- base += '/'
+ base_resource = first_request and path.decode() == config_base.strip('/')
- request.base = base.encode('utf-8')
+ if not path or base_resource:
+ return self
- return resource.Resource.getChildWithDefault(self, path, request)
+ return super().getChildWithDefault(path, request)
def render(self, request):
uri_true = ('true', 'yes', 'on', '1')
@@ -653,7 +656,7 @@ class DelugeWeb(component.Component):
reactor). If False shares the process and twisted reactor from WebUI plugin or tests.
"""
- component.Component.__init__(self, 'DelugeWeb', depend=['Web'])
+ super().__init__('DelugeWeb', depend=['Web'])
self.config = configmanager.ConfigManager(
'web.conf', defaults=CONFIG_DEFAULTS, file_version=2
)
@@ -680,10 +683,6 @@ class DelugeWeb(component.Component):
elif options.no_ssl:
self.https = False
- if self.base != '/':
- # Strip away slashes and serve on the base path as well as root path
- self.top_level.putChild(self.base.strip('/'), self.top_level)
-
setup_translation()
# Remove twisted version number from 'server' http-header for security reasons
diff --git a/deluge/ui/web/web.py b/deluge/ui/web/web.py
index f855bd0..ae428c7 100644
--- a/deluge/ui/web/web.py
+++ b/deluge/ui/web/web.py
@@ -17,7 +17,6 @@ log = logging.getLogger(__name__)
class Web(UI):
-
cmd_description = """Web-based user interface (http://localhost:8112)"""
def __init__(self, *args, **kwargs):