From c17ad4502757538a94957f71e540d57b2ec33169 Mon Sep 17 00:00:00 2001 From: "karol@jagiello.it" <1cyfraikilkaliter> Date: Wed, 26 Jul 2017 22:23:39 +0200 Subject: [PATCH] initial --- _locales/en/messages.json | 441 ++++++++++++++ _locales/ru/messages.json | 431 ++++++++++++++ background.js | 292 +++++++++ defaults.js | 298 +++++++++ icons/128.png | Bin 0 -> 359 bytes icons/16.png | Bin 0 -> 127 bytes icons/24.png | Bin 0 -> 138 bytes icons/38.png | Bin 0 -> 158 bytes icons/48.png | Bin 0 -> 181 bytes icons/64.png | Bin 0 -> 217 bytes lib_jquery/jquery-3.2.1.min.js | 4 + manifest.json | 51 ++ options.html | 498 ++++++++++++++++ options.js | 581 ++++++++++++++++++ scripts/IO.js | 92 +++ scripts/events_chrome.js | 150 +++++ scripts/events_refresh.js | 145 +++++ scripts/events_tabs.js | 323 ++++++++++ scripts/global_variables.js | 17 + scripts/menu_tabs.js | 213 +++++++ scripts/tabs.js | 319 ++++++++++ scripts/toolbar.js | 224 +++++++ sidebar.html | 80 +++ sidebar.js | 144 +++++ theme/close.svg | 68 +++ theme/empty.png | Bin 0 -> 161 bytes theme/empty.svg | 74 +++ theme/loading.svg | 71 +++ theme/media.gif | Bin 0 -> 1614 bytes theme/media_muted.gif | Bin 0 -> 128 bytes theme/theme.css | 762 ++++++++++++++++++++++++ theme/toolbar_bookmarks.svg | 90 +++ theme/toolbar_discard.svg | 69 +++ theme/toolbar_downloads.svg | 109 ++++ theme/toolbar_extensions.svg | 71 +++ theme/toolbar_filter_clear.svg | 63 ++ theme/toolbar_filter_search_go_next.svg | 73 +++ theme/toolbar_filter_search_go_prev.svg | 73 +++ theme/toolbar_filter_title.svg | 79 +++ theme/toolbar_filter_url.svg | 79 +++ theme/toolbar_history.svg | 74 +++ theme/toolbar_move.svg | 77 +++ theme/toolbar_new.svg | 74 +++ theme/toolbar_options.svg | 86 +++ theme/toolbar_pin.svg | 71 +++ theme/toolbar_search.svg | 72 +++ theme/toolbar_settings.svg | 70 +++ theme/toolbar_tools.svg | 73 +++ theme/toolbar_undo.svg | 68 +++ 49 files changed, 6649 insertions(+) create mode 100644 _locales/en/messages.json create mode 100644 _locales/ru/messages.json create mode 100644 background.js create mode 100644 defaults.js create mode 100644 icons/128.png create mode 100644 icons/16.png create mode 100644 icons/24.png create mode 100644 icons/38.png create mode 100644 icons/48.png create mode 100644 icons/64.png create mode 100644 lib_jquery/jquery-3.2.1.min.js create mode 100644 manifest.json create mode 100644 options.html create mode 100644 options.js create mode 100644 scripts/IO.js create mode 100644 scripts/events_chrome.js create mode 100644 scripts/events_refresh.js create mode 100644 scripts/events_tabs.js create mode 100644 scripts/global_variables.js create mode 100644 scripts/menu_tabs.js create mode 100644 scripts/tabs.js create mode 100644 scripts/toolbar.js create mode 100644 sidebar.html create mode 100644 sidebar.js create mode 100644 theme/close.svg create mode 100644 theme/empty.png create mode 100644 theme/empty.svg create mode 100644 theme/loading.svg create mode 100644 theme/media.gif create mode 100644 theme/media_muted.gif create mode 100644 theme/theme.css create mode 100644 theme/toolbar_bookmarks.svg create mode 100644 theme/toolbar_discard.svg create mode 100644 theme/toolbar_downloads.svg create mode 100644 theme/toolbar_extensions.svg create mode 100644 theme/toolbar_filter_clear.svg create mode 100644 theme/toolbar_filter_search_go_next.svg create mode 100644 theme/toolbar_filter_search_go_prev.svg create mode 100644 theme/toolbar_filter_title.svg create mode 100644 theme/toolbar_filter_url.svg create mode 100644 theme/toolbar_history.svg create mode 100644 theme/toolbar_move.svg create mode 100644 theme/toolbar_new.svg create mode 100644 theme/toolbar_options.svg create mode 100644 theme/toolbar_pin.svg create mode 100644 theme/toolbar_search.svg create mode 100644 theme/toolbar_settings.svg create mode 100644 theme/toolbar_tools.svg create mode 100644 theme/toolbar_undo.svg diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..5c48ba2 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,441 @@ +{ + "extensionName": { + "message": "Tree Tabs" + }, + "extDesc": { + "message": "Manage your tabs in the sidebar!" + }, + "button_new": { + "message": "Press left mouse button to open new tab. \nPress middle mouse button to clone the active tab. \nPress right mouse button to scroll the list to the active tab." + }, + "button_pin": { + "message": "Pin / Unpin current tab" + }, + "button_undo": { + "message": "Reopen last closed" + }, + "button_move": { + "message": "Detach tab" + }, + "button_search": { + "message": "Search tabs" + }, + "button_tools": { + "message": "Tools" + }, + "filter_search_go_prev": { + "message": "Previous search result" + }, + "filter_search_go_next": { + "message": "Next search result" + }, + "button_filter_type": { + "message": "Search titles or urls" + }, + "button_bookmarks": { + "message": "Unsorted bookmarks" + }, + "button_downloads": { + "message": "Downloads" + }, + "button_history": { + "message": "History" + }, + "button_settings": { + "message": "Settings" + }, + "button_options": { + "message": "Tree Tabs settings" + }, + "button_extensions": { + "message": "Extensions" + }, + "button_discard": { + "message": "Unload tabs" + }, + "tabs_menu_expand_all": { + "message": "Expand all trees" + }, + "tabs_menu_collapse_all": { + "message": "Collapse all trees" + }, + "tabs_menu_new": { + "message": "New tab" + }, + "tabs_menu_clone": { + "message": "Duplicate" + }, + "tabs_menu_move": { + "message": "Detach" + }, + "tabs_menu_reload": { + "message": "Reload" + }, + "tabs_menu_pin": { + "message": "Pin" + }, + "tabs_menu_mute": { + "message": "Mute" + }, + "tabs_menu_unmute": { + "message": "Unmute" + }, + "tabs_menu_mute_other": { + "message": "Mute other" + }, + "tabs_menu_unmute_other": { + "message": "Unmute other" + }, + "tabs_menu_unpin": { + "message": "Unpin" + }, + "tabs_menu_close": { + "message": "Close" + }, + "tabs_menu_close_other": { + "message": "Close other" + }, + "tabs_menu_undo": { + "message": "Undo close" + }, + "tabs_menu_settings": { + "message": "Settings" + }, + "tabs_menu_discard": { + "message": "Unload" + }, + "options_vivaldi": { + "message": " Vivaldi " + }, + "opt_url_for_web_panel": { + "message": "Url for the Web Panel" + }, + "options_pinned": { + "message": " Pinned tabs bar " + }, + "options_pin_list_multi_row": { + "message": "multi row list" + }, + "option_allow_pin_close": { + "message": "allow to close pinned tabs" + }, + "options_tabs": { + "message": " Tabs " + }, + "options_skip_load": { + "message": "discard tree structure after browser's restart, this option is for those who don't use browser's session. Basically it disables loading database at startup." + }, + "options_close_with_MMB": { + "message": "close tabs with middle mouse button" + }, + "options_always_show_close": { + "message": "show close button on all tabs" + }, + "options_close_other_trees": { + "message": "automatically collapse other trees on expand" + }, + "options_promote_children": { + "message": "promote children tabs on close, if disabled, when closing the parent of a tree structure, all tabs will be closed (be careful, because undo close tab will not recover the trees structure)" + }, + "options_open_tree_on_hover": { + "message": "auto expand collapsed trees when dragging and holding for a second over them" + }, + "options_max_tree_depth": { + "message": "maximum tree depth: set it to -1 for unlimited branches, 0 for flat tabs placement (no trees), any number above 0 will be its maximum" + }, + "options_append_child_tab": { + "message": "append children tabs at the" + }, + "options_append_child_tab_top": { + "message": "top (reverse hierarchy)" + }, + "options_append_child_tab_bottom": { + "message": "bottom" + }, + "options_append_child_tab_after_limit": { + "message": "once reached tree depth, place tab on the same level, but" + }, + "options_append_child_tab_after_limit_top": { + "message": "at the top" + }, + "options_append_child_tab_after_limit_after": { + "message": "after parent" + }, + "options_append_child_tab_after_limit_bottom": { + "message": "at the bottom" + }, + "options_append_orphan_tab": { + "message": "append orphan tabs (opened from +, shortcut or bookmark)" + }, + "options_append_orphan_tab_top": { + "message": "at the top" + }, + "options_append_orphan_tab_after_active": { + "message": "after active" + }, + "options_append_orphan_tab_bottom": { + "message": "at the bottom" + }, + "options_append_orphan_tab_as_child": { + "message": "treat as active's tab child" + }, + "options_after_closing_active_tab": { + "message": "after closing active tab," + }, + "options_after_closing_active_tab_go_up": { + "message": "activate tab above" + }, + "options_after_closing_active_tab_go_down": { + "message": "activate tab below" + }, + "options_after_closing_active_tab_go_browser": { + "message": "let browser handle which tab to activate" + }, + "options_theme": { + "message": "Theme" + }, + "options_theme_tabs": { + "message": " Tabs look " + }, + "options_theme_tabs_sample_text_normal": { + "message": "Normal" + }, + "options_theme_tabs_sample_text_active_selected": { + "message": "Active and selected" + }, + "options_theme_tabs_sample_text_discarded": { + "message": "Unloaded (discarded)" + }, + "options_theme_tabs_sample_text_search_result": { + "message": "Search result" + }, + "options_theme_tabs_sample_text_search_result_higlighted": { + "message": "Search result higlighted" + }, + "options_theme_tabs_sample_text_search_result_selected": { + "message": "Search result, selected" + }, + "options_theme_tabs_sample_text_search_result_selected_active": { + "message": "Search result, selected, active" + }, + "options_toolbar": { + "message": " Toolbar " + }, + "options_available_buttons": { + "message": "Drag and drop buttons to arrange them, drop to the green box, buttons you don't want to use" + }, + "options_scrollbars": { + "message": " Scrollbars " + }, + "options_scrollbar_pin_list": { + "message": "pinned tabs bar scrollbar height" + }, + "options_scrollbar_tab_list": { + "message": "tabs list scrollbar width" + }, + "options_tabs_size": { + "message": "Tabs size" + }, + "options_add_theme_button": { + "message": "Add new" + }, + "options_remove_theme_button": { + "message": "Remove" + }, + "options_export_theme_button": { + "message": "Export" + }, + "options_import_theme_button": { + "message": "Import" + }, + "options_rename_theme_button": { + "message": "Rename" + }, + "options_there_is_a_theme_with_this_name": { + "message": "Theme with this name already exists, try a new name" + }, + "options_theme_name_cannot_be_empty": { + "message": "Theme name cannot be empty, enter some name" + }, + "options_no_theme_to_export": { + "message": "No theme to export, maybe add a new one :)" + }, + "options_loaded_theme_older_version": { + "message": "Looks like loaded theme was saved in older version of the extension, some colors or options might be missing" + }, + "options_loaded_theme_newer_version": { + "message": "Looks like loaded theme was saved in a newer version of the extension, can't load!" + }, + "options_color_theme_toolbar_background": { + "message": " toolbar background" + }, + "options_color_toolbar_border_bottom": { + "message": " toolbar borders" + }, + "options_color_button_icons": { + "message": " button icon" + }, + "options_color_button_border": { + "message": " button borders" + }, + "options_color_button_background": { + "message": " button background" + }, + "options_color_button_hover_border": { + "message": " button hover border" + }, + "options_color_button_hover_background": { + "message": " button hover background" + }, + "options_color_filter_box_background": { + "message": " searchbox background" + }, + "options_color_filter_box_border": { + "message": " searchbox borders" + }, + "options_color_filter_box_font": { + "message": " searchbox font" + }, + "options_color_filter_clear_icon": { + "message": " searchbox clear button" + }, + "options_color_pin_list_border_bottom": { + "message": " pin list separator line" + }, + "options_color_pin_list_background": { + "message": " pin list background" + }, + "options_color_tab_list_background": { + "message": " tab list background" + }, + "options_color_tab_background": { + "message": " tab background" + }, + "options_color_tab_border": { + "message": " tab border" + }, + "options_color_tab_hover_background": { + "message": " hover over tab, background" + }, + + "options_color_tab_hover_border": { + "message": " hover over tab, border" + }, + "options_color_drag_indicator": { + "message": " drag&drop indicator" + }, + "options_color_tab_title": { + "message": " tab title font" + }, + "options_color_tab_title_active": { + "message": " active tab title font" + }, + "options_color_tab_title_discarded": { + "message": " unloaded tab title font" + }, + "options_color_tab_selected_background": { + "message": " selected tab background" + }, + "options_color_tab_selected_border": { + "message": " active/selected tab border" + }, + "options_color_tab_selected_hover_border": { + "message": " hover over active/selected tab border" + }, + "options_color_tab_selected_hover_background": { + "message": " hover over active/selected tab background" + }, + "options_color_tab_filtered": { + "message": " search result" + }, + "options_color_tab_filtered_highlighted": { + "message": " search result highlighted" + }, + "options_color_tab_filtered_selected": { + "message": " search result selected" + }, + "options_color_tab_filtered_selected_active": { + "message": " search result selected active" + }, + "options_color_close_x": { + "message": " close button (x)" + }, + "options_color_close_hover_x": { + "message": " hover over close button, x color" + }, + "options_color_close_hover_border": { + "message": " hover over close button, border" + }, + "options_color_close_hover_background": { + "message": " hover over close button, background" + }, + "options_color_expand_open_border": { + "message": " open tab expand box, border" + }, + "options_color_expand_open_background": { + "message": " open tab expand box, background" + }, + "options_color_expand_closed_border": { + "message": " closed tab expand box, border" + }, + "options_color_expand_closed_background": { + "message": " closed tab expand box, background" + }, + "options_color_expand_lines": { + "message": " tree hierarchy lines" + }, + "options_color_scrollbar_thumb": { + "message": " scrollbar thumb" + }, + "options_color_scrollbar_thumb_hover": { + "message": " scrollbar thumb hover" + }, + "options_color_scrollbar_track": { + "message": " scrollbar background" + }, + "options_color_tabs_menu_background": { + "message": " background" + }, + "options_color_tabs_menu_border": { + "message": " border" + }, + "options_color_tabs_menu_hover_background": { + "message": " hover over item, background" + }, + "options_color_tabs_menu_hover_border": { + "message": " hover over item, border" + }, + "options_color_tabs_menu_font": { + "message": " font" + }, + "options_color_tabs_menu_separator": { + "message": " separator" + }, + "options_example_menu_item": { + "message": "menu item" + }, + "options_menu": { + "message": " Menu " + }, + "options_active_tab_font_bold": { + "message": "bold font for active tab" + }, + "caption_clear_filter": { + "message": "Clear search results" + }, + "caption_loading": { + "message": "Loading..." + }, + "caption_searchbox": { + "message": " Search tabs..." + }, + "options_never_show_close": { + "message": "don't show close button (option above will be ignored)" + }, + "tabs_menu_close_tree": { + "message": "Close tree" + }, + "options_faster_scroll": { + "message": "Faster scrolling" + } +} diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json new file mode 100644 index 0000000..89e69aa --- /dev/null +++ b/_locales/ru/messages.json @@ -0,0 +1,431 @@ +{ + "button_bookmarks": { + "message": "Закладки" + }, + "button_discard": { + "message": "Выгрузить все вкладки" + }, + "button_downloads": { + "message": "Загрузки" + }, + "button_extensions": { + "message": "Расширения" + }, + "button_filter_type": { + "message": "Поиск заголовков или URL-адресов" + }, + "button_history": { + "message": "История" + }, + "button_move": { + "message": "Отсоединить текущую вкладку" + }, + "button_new": { + "message": "ЛКМ - открыть новую вкладку \nСКМ - дублировать активную вкладку \nПКМ - прокрутка списка к активной вкладке" + }, + "button_options": { + "message": "Настройки Tree Tabs" + }, + "button_pin": { + "message": "Закрепить / Открепить текущую вкладку" + }, + "button_search": { + "message": "Поиск вкладок" + }, + "button_settings": { + "message": "Настройки браузера" + }, + "button_tools": { + "message": "Дополнительные инструменты" + }, + "button_undo": { + "message": "Открыть последнюю закрытую вкладку" + }, + "caption_clear_filter": { + "message": "Очистить результаты поиска" + }, + "caption_loading": { + "message": "Загрузка…" + }, + "caption_searchbox": { + "message": " Поиск вкладок…" + }, + "extDesc": { + "message": "Управляйте своими вкладками с боковой панели!" + }, + "extensionName": { + "message": "Tree Tabs" + }, + "filter_search_go_next": { + "message": "Следующий результат поиска" + }, + "filter_search_go_prev": { + "message": "Предыдущий результат поиска" + }, + "option_allow_pin_close": { + "message": "закрывать закреплённые вкладки из контекстного меню" + }, + "options_add_theme_button": { + "message": "Новая" + }, + "options_always_show_close": { + "message": "показывать кнопку закрытия на вкладках" + }, + "options_append_child_tab": { + "message": "добавлять новые дочерние вкладки" + }, + "options_append_child_tab_after_limit": { + "message": "при достижении максимальной глубины дерева, установить вкладку на том же уровне, но" + }, + "options_append_child_tab_after_limit_after": { + "message": "после родительской" + }, + "options_append_child_tab_after_limit_bottom": { + "message": "ниже предыдущей" + }, + "options_append_child_tab_after_limit_top": { + "message": "выше предыдущей" + }, + "options_append_child_tab_bottom": { + "message": "ниже предыдущих" + }, + "options_append_child_tab_top": { + "message": "выше предыдущих (обратная иерархия)" + }, + "options_append_orphan_tab": { + "message": "открывать недавно закрытые вкладки" + }, + "options_append_orphan_tab_after_active": { + "message": "после активной вкладки" + }, + "options_append_orphan_tab_as_child": { + "message": "как дочерние для активной вкладки" + }, + "options_after_closing_active_tab": { + "message": "После закрытия активной вкладки" + }, + "options_after_closing_active_tab_go_up": { + "message": "активировать вкладку выше" + }, + "options_after_closing_active_tab_go_down": { + "message": "активировать вкладку ниже" + }, + "options_after_closing_active_tab_go_browser": { + "message": "активация вкладок согласно настройкам браузера" + }, + "options_append_orphan_tab_bottom": { + "message": "в конце списка" + }, + "options_append_orphan_tab_top": { + "message": "в начале списка" + }, + "options_close_other_trees": { + "message": "автоматически сворачивать другие деревья при раскрывании дерева" + }, + "options_close_with_MMB": { + "message": "закрывать вкладки средней кнопкой мыши" + }, + "options_color_button_background": { + "message": " фон кнопки" + }, + "options_color_button_border": { + "message": " рамка кнопки" + }, + "options_color_button_hover_background": { + "message": " фон при наведении на кнопку" + }, + "options_color_button_hover_border": { + "message": " рамка при наведении на кнопку" + }, + "options_color_button_icons": { + "message": " иконка кнопки" + }, + "options_color_close_hover_background": { + "message": " фон при наведении на кнопку закрытия" + }, + "options_color_close_hover_border": { + "message": " рамка при наведении на кнопку закрытия" + }, + "options_color_close_hover_x": { + "message": " иконка при наведении на кнопку закрытия" + }, + "options_color_close_x": { + "message": " кнопка закрытия [x]" + }, + "options_color_drag_indicator": { + "message": " индикатор drag&drop" + }, + "options_color_expand_closed_background": { + "message": " фон указателя свёрнутого дерева" + }, + "options_color_expand_closed_border": { + "message": " рамка указателя свёрнутого дерева" + }, + "options_color_expand_lines": { + "message": " линии ветвей дерева" + }, + "options_color_expand_open_background": { + "message": " фон указателя раскрытого дерева" + }, + "options_color_expand_open_border": { + "message": " рамка указателя раскрытого дерева" + }, + "options_color_filter_box_background": { + "message": " фон окна поиска" + }, + "options_color_filter_box_border": { + "message": " рамка окна поиска" + }, + "options_color_filter_box_font": { + "message": " шрифт в окне поиска" + }, + "options_color_filter_clear_icon": { + "message": " кнопка очистки в окне поиска" + }, + "options_color_pin_list_background": { + "message": " фон списка закреплённых вкладок" + }, + "options_color_pin_list_border_bottom": { + "message": " разделитель списка закреплённых вкладок" + }, + "options_color_scrollbar_thumb": { + "message": " полоса прокрутки" + }, + "options_color_scrollbar_thumb_hover": { + "message": " полоса прокрутки при наведении" + }, + "options_color_scrollbar_track": { + "message": " фон полосы прокрутки" + }, + "options_color_tab_background": { + "message": " фон вкладки" + }, + "options_color_tab_border": { + "message": " рамка вкладки" + }, + "options_color_tab_filtered": { + "message": " результат поиска" + }, + "options_color_tab_filtered_highlighted": { + "message": " выделенный результат поиска" + }, + "options_color_tab_filtered_selected": { + "message": " выбранный результат поиска" + }, + "options_color_tab_filtered_selected_active": { + "message": " активный результат поиска" + }, + "options_color_tab_hover_background": { + "message": " фон при наведении на вкладку" + }, + "options_color_tab_hover_border": { + "message": " рамка при наведении на вкладку" + }, + "options_color_tab_list_background": { + "message": " фон списка вкладок" + }, + "options_color_tab_selected_background": { + "message": " фон активной вкладки" + }, + "options_color_tab_selected_border": { + "message": " рамка активной вкладки" + }, + "options_color_tab_selected_hover_background": { + "message": " фон при наведении на активную вкладку" + }, + "options_color_tab_selected_hover_border": { + "message": " рамка при наведении на активную вкладку" + }, + "options_color_tab_title": { + "message": " шрифт заголовка вкладки" + }, + "options_color_tab_title_active": { + "message": " шрифт заголовка активной вкладки" + }, + "options_color_tab_title_discarded": { + "message": " шрифт заголовка выгруженной вкладки" + }, + "options_color_tabs_menu_background": { + "message": " фон" + }, + "options_color_tabs_menu_border": { + "message": " рамка" + }, + "options_color_tabs_menu_font": { + "message": " шрифт" + }, + "options_color_tabs_menu_hover_background": { + "message": " фон при наведении на пункт" + }, + "options_color_tabs_menu_hover_border": { + "message": " рамка при наведении на пункт" + }, + "options_color_tabs_menu_separator": { + "message": " разделитель" + }, + "options_color_theme_toolbar_background": { + "message": " фон панели инструментов" + }, + "options_color_toolbar_border_bottom": { + "message": " рамка панели инструментов" + }, + "options_example_menu_item": { + "message": "пункт меню" + }, + "options_export_theme_button": { + "message": "Экспорт" + }, + "options_import_theme_button": { + "message": "Импорт" + }, + "options_loaded_theme_newer_version": { + "message": "Похоже, загружаемая тема была сохранена в более новой версии расширения; её невозможно загрузить!" + }, + "options_loaded_theme_older_version": { + "message": "Похоже, загружаемая тема была сохранена в более старой версии расширения; некоторые цвета или параметры могут отсутствовать." + }, + "options_max_tree_depth": { + "message": "максимальная глубина дерева (-1 - неограниченное количество ветвей; 0 - отключить древовидную структуру вкладок)" + }, + "options_menu": { + "message": " Контекстное меню " + }, + "options_no_theme_to_export": { + "message": "Нет темы для экспорта, можете добавить новую :)" + }, + "options_open_tree_on_hover": { + "message": "автоматически раскрывать свёрнутые деревья при перетаскивании вкладки с удерживанием курсора над ними" + }, + "options_pin_list_multi_row": { + "message": "список закреплённых вкладок в несколько строк" + }, + "options_pinned": { + "message": " Панель закреплённых вкладок " + }, + "options_promote_children": { + "message": "оставлять дочерние вкладки при закрытии родительской. (Если отключено, то при закрытии родительской вкладки все дочерние вкладки дерева будут закрыты. Будьте осторожны, так как отмена закрытия вкладки не восстановит структуру дерева)" + }, + "options_remove_theme_button": { + "message": "Удалить" + }, + "options_rename_theme_button": { + "message": "Переименовать" + }, + "options_scrollbar_pin_list": { + "message": "высота полосы прокрутки закреплённых вкладок" + }, + "options_scrollbar_tab_list": { + "message": "ширина полосы прокрутки списка вкладок" + }, + "options_scrollbars": { + "message": " Полоса прокрутки " + }, + "options_skip_load": { + "message": "отменить древовидную структуру после перезапуска браузера. Это предназначено для тех, кто не использует сохранение сессии (опция отключает загрузку базы данных при запуске браузера)" + }, + "options_tabs": { + "message": " Вкладки " + }, + "options_tabs_size": { + "message": "Размер вкладок" + }, + "options_theme": { + "message": "Тема" + }, + "options_theme_name_cannot_be_empty": { + "message": "Введите название темы." + }, + "options_theme_tabs": { + "message": " Внешний вид вкладок " + }, + "options_theme_tabs_sample_text_active_selected": { + "message": "Активная" + }, + "options_theme_tabs_sample_text_discarded": { + "message": "Выгруженная" + }, + "options_theme_tabs_sample_text_normal": { + "message": "Обычная" + }, + "options_theme_tabs_sample_text_search_result": { + "message": "Результат поиска" + }, + "options_theme_tabs_sample_text_search_result_higlighted": { + "message": "Выделенный результат поиска" + }, + "options_theme_tabs_sample_text_search_result_selected": { + "message": "Выбранный результат поиска" + }, + "options_theme_tabs_sample_text_search_result_selected_active": { + "message": "Активный результат поиска" + }, + "options_there_is_a_theme_with_this_name": { + "message": "Такое название темы уже существует, введите новое." + }, + "options_toolbar": { + "message": " Панель инструментов " + }, + "options_available_buttons": { + "message": "Настраивайте панель управления перетаскиванием элементов. Чтобы скрыть элемент, переместите его на зелёное поле." + }, + "options_vivaldi": { + "message": " Vivaldi " + }, + "opt_url_for_web_panel": { + "message": "Вставить этот URL в веб-панель" + }, + "tabs_menu_clone": { + "message": "Дублировать вкладку" + }, + "tabs_menu_close": { + "message": "Закрыть вкладку" + }, + "tabs_menu_close_other": { + "message": "Закрыть другие вкладки" + }, + "tabs_menu_collapse_all": { + "message": "Свернуть все деревья" + }, + "tabs_menu_discard": { + "message": "Выгрузить вкладку" + }, + "tabs_menu_expand_all": { + "message": "Раскрыть все деревья" + }, + "tabs_menu_move": { + "message": "Отсоединить вкладку" + }, + "tabs_menu_mute": { + "message": "Выключить звук на вкладке" + }, + "tabs_menu_mute_other": { + "message": "Выключить звук (на других)" + }, + "tabs_menu_new": { + "message": "Новая вкладка" + }, + "tabs_menu_pin": { + "message": "Закрепить вкладку" + }, + "tabs_menu_reload": { + "message": "Обновить вкладку" + }, + "tabs_menu_settings": { + "message": "Настройки Tree Tabs" + }, + "tabs_menu_undo": { + "message": "Отменить закрытие" + }, + "tabs_menu_unmute": { + "message": "Включить звук на вкладке" + }, + "tabs_menu_unmute_other": { + "message": "Включить звук (на других)" + }, + "tabs_menu_unpin": { + "message": "Открепить вкладку" + }, + "options_active_tab_font_bold": { + "message": "жирный шрифт для активной вкладки" + } +} diff --git a/background.js b/background.js new file mode 100644 index 0000000..b8458bb --- /dev/null +++ b/background.js @@ -0,0 +1,292 @@ +var opt = { + "skip_load": false, "new_open_below": false, "pin_list_multi_row": false, "close_with_MMB": true, + "always_show_close": false, "allow_pin_close": false, + "append_child_tab": "bottom", "append_child_tab_after_limit": "after", + "append_orphan_tab": "bottom", "after_closing_active_tab": "below", "close_other_trees": false, + "promote_children": true, "open_tree_on_hover": true, "max_tree_depth": -1, "never_show_close": false, "faster_scroll": false +}; +var opt_toolbar = { + "active_toolbar_tool": "", "filter_type": "url" +}; + +var hold = true, + started = false, + schedule_save = 0, + + tabs = {}, + + dt = {tabsIds: [], DropAfter: true, DropToTabId: 0, DropToIndex: 0, CameFromWindowId: 0, DroppedToWindowId: 0}, + + caption_clear_filter = chrome.i18n.getMessage("caption_clear_filter"), + caption_loading = chrome.i18n.getMessage("caption_loading"), + caption_searchbox = chrome.i18n.getMessage("caption_searchbox"); + +function Start(){ + started = true; + + // open options to set defaults + if (localStorage.getItem("themeDefault") === null){ + chrome.tabs.create({url: "options.html" }); + } + + // all variables needed to load data + var loaded_options = {}, loaded_opt_toolbar = {}; + + // set loaded options + if (localStorage.getItem("current_options") !== null){ + loaded_options = JSON.parse(localStorage["current_options"]); + } + for (var parameter in opt) { + if (loaded_options[parameter] != undefined && opt[parameter] != undefined){ + opt[parameter] = loaded_options[parameter]; + } + } + + // toolbar shelfs options (search url-title and which shelf is active) + if (localStorage.getItem("current_toolbar_options") !== null){ + loaded_opt_toolbar = JSON.parse(localStorage["current_toolbar_options"]); + } + for (var parameter in opt_toolbar) { + if (loaded_opt_toolbar[parameter] != undefined && opt_toolbar[parameter] != undefined){ + opt_toolbar[parameter] = loaded_opt_toolbar[parameter]; + } + } + + + LoadTabs(0); +} + + + +function LoadTabs(retry){ + chrome.tabs.query({windowType: "normal"}, function(qtabs){ + + // will loop forever if session restore tab is found + if (navigator.userAgent.match("Firefox") !== null){ + var halt = false; + for (var t = 0; t < qtabs.length; t++){ + if (qtabs[t].url.match("sessionrestore")){ + halt = true; + chrome.tabs.update(qtabs[t].id, { active: true }); + break; + } + } + if (halt){ + setTimeout(function(){ + LoadTabs(retry); + }, 2000); + return; + } + } + + // create current tabs object + qtabs.forEach(function(Tab){ + HashTab(Tab); + }); + + var reference_tabs = {}; + var tabs_matched = 0; + + // compare saved tabs from storage to current session tabs, but can be skipped if set in options + if (opt.skip_load == false){ + qtabs.forEach(function(Tab){ + for (var t = 0; t < 9999; t++){ + if (localStorage.getItem("t"+t) !== null){ + var LoadedTab = JSON.parse(localStorage["t"+t]); + if (LoadedTab[1] === tabs[Tab.id].h && reference_tabs[LoadedTab[0]] == undefined){ + reference_tabs[LoadedTab[0]] = Tab.id; + tabs[Tab.id].p = LoadedTab[2]; + tabs[Tab.id].n = LoadedTab[3]; + tabs[Tab.id].o = LoadedTab[4]; + tabs_matched++; + break; + } + + } else { + break; + } + + } + }); + + // replace parents tabIds to new ones, for that purpose reference_tabs was made before + for (var tabId in tabs){ + if (reference_tabs[tabs[tabId].p] != undefined){ + tabs[tabId].p = reference_tabs[tabs[tabId].p]; + } + } + } + + + // will try to find tabs for 10 times, roughly 30 seconds + if (opt.skip_load == true || retry > 10 || localStorage.getItem("t0") === null || localStorage.getItem("t_count") === null || (tabs_matched > JSON.parse(localStorage["t_count"]))){ + hold = false; + StartChromeListeners(); + PeriodicCheck(); + AutoSaveData(); + } else { + setTimeout(function(){ + LoadTabs(retry+1); + }, 3000); + } + }); +} + +// once a minute checking for missing tabs +function PeriodicCheck(){ + setTimeout(function(){ + PeriodicCheck(); + if (!hold){ + chrome.tabs.query({windowType: "normal"}, function(qtabs){ + qtabs.forEach(function(Tab){ + if (tabs[Tab.id] == undefined){ + HashTab(Tab); + setTimeout(function(){ + chrome.runtime.sendMessage({command: "recheck_tabs"}); + },300); + setTimeout(function(){ + schedule_save++; + },600); + } + }); + }); + } + },60000); +} + +// save every 2 seconds if there is anything to save obviously +function AutoSaveData(){ + setTimeout(function(){ + AutoSaveData(); + if (schedule_save > 0){ + schedule_save = 1; + } + if (!hold && schedule_save > 0 && Object.keys(tabs).length > 1){ + chrome.tabs.query({windowType: "normal"}, function(qtabs){ + localStorage["t_count"] = qtabs.length*0.5; + for (var t = 0; t < qtabs.length; t++){ + if (tabs[qtabs[t].id] != undefined && tabs[qtabs[t].id].h != undefined && tabs[qtabs[t].id].p != undefined && tabs[qtabs[t].id].n != undefined && tabs[qtabs[t].id].o != undefined){ + var Tab = JSON.stringify([qtabs[t].id, tabs[qtabs[t].id].h, tabs[qtabs[t].id].p, tabs[qtabs[t].id].n, tabs[qtabs[t].id].o]); + if (localStorage.getItem("t"+t) == null || localStorage["t"+t] !== Tab){ + localStorage["t"+t] = Tab; + } + } + } + schedule_save--; + }); + } + }, 1000); +} + +function SaveOptions(){ + localStorage["current_options"] = JSON.stringify(opt); +} +function SaveToolbarOptions(){ + localStorage["current_toolbar_options"] = JSON.stringify(opt_toolbar); +} + +function HashTab(tab){ + if (tabs[tab.id] == undefined){ + tabs[tab.id] = {h: 0, p: tab.pinned ? "pin_list" : "tab_list", n: tab.index, o: "n"}; + } + var hash = 0; + if (tab.url.length === 0){ + return 0; + } + for (var i = 0; i < tab.url.length; i++){ + hash = (hash << 5)-hash; + hash = hash+tab.url.charCodeAt(i); + hash |= 0; + } + tabs[tab.id].h = hash; +} + +// start all listeners +function StartChromeListeners(){ + chrome.tabs.onCreated.addListener(function(tab){ + HashTab(tab); + chrome.runtime.sendMessage({command: "tab_created", windowId: tab.windowId, tab: tab, tabId: tab.id}); + schedule_save++; + }); + chrome.tabs.onAttached.addListener(function(tabId, attachInfo){ + chrome.tabs.get(tabId, function(tab){ + if (tabs[tabId] == undefined){ HashTab(tab); } + chrome.runtime.sendMessage({command: "tab_attached", windowId: attachInfo.newWindowId, tab: tab, tabId: tabId}); + }); + schedule_save++; + }); + chrome.tabs.onRemoved.addListener(function(tabId, removeInfo){ + chrome.runtime.sendMessage({command: "tab_removed", windowId: removeInfo.windowId, tabId: tabId}); + delete tabs[tabId]; + schedule_save++; + }); + chrome.tabs.onDetached.addListener(function(tabId, detachInfo){ + if (tabs[tabId] == undefined){ HashTab(tab); } + chrome.runtime.sendMessage({command: "tab_removed", windowId: detachInfo.oldWindowId, tabId: tabId}); + schedule_save++; + }); + chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab){ + if (tabs[tabId] == undefined || changeInfo.url != undefined){ HashTab(tab); } + if (changeInfo.pinned == true){ tabs[tabId].p = "pin_list"; } + if (changeInfo.pinned == false){ tabs[tabId].p = "tab_list"; } + chrome.runtime.sendMessage({command: "tab_updated", windowId: tab.windowId, tab: tab, tabId: tabId, changeInfo: changeInfo}); + if (changeInfo.url != undefined || changeInfo.pinned != undefined){schedule_save++;} + }); + chrome.tabs.onMoved.addListener(function(tabId, moveInfo){ + if (tabs[tabId] == undefined){ HashTab(tab); } + chrome.runtime.sendMessage({command: "tab_moved", windowId: moveInfo.windowId, tabId: tabId, moveInfo: moveInfo}); + schedule_save++; + }); + chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId){ + chrome.tabs.get(addedTabId, function(tab){ + if (addedTabId == removedTabId){ + chrome.runtime.sendMessage({command: "tab_updated", windowId: tab.windowId, tab: tab, tabId: tab.id, changeInfo: {status: tab.status, url: tab.url, title: tab.title, audible: tab.audible, mutedInfo: tab.mutedInfo}}); + } else { + if (tabs[removedTabId]){ + tabs[addedTabId] = {h: GetHash(tab.url), p: tabs[removedTabId].p, n: tabs[removedTabId].n, o: tabs[removedTabId].o}; + } else { + HashTab(tab); + } + chrome.runtime.sendMessage({command: "tab_removed", windowId: tab.windowId, tabId: removedTabId}); + chrome.runtime.sendMessage({command: "tab_attached", windowId: tab.windowId, tab: tab, tabId: addedTabId}); + delete tabs[removedTabId]; + } + schedule_save++; + }); + }); + chrome.tabs.onActivated.addListener(function(activeInfo){ + chrome.runtime.sendMessage({command: "tab_activated", windowId: activeInfo.windowId, tabId: activeInfo.tabId}); + }); +} + +chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ + switch(message.command){ + case "background_start": + if (!started){ + Start(); + } + break; + case "reload": + window.location.reload(); + break; + case "options_save": + SaveOptions(); + break; + case "toolbar_options_save": + SaveToolbarOptions(); + break; + } +}); +function log(m){ + console.log(m); +} +chrome.runtime.onStartup.addListener(function(){ + Start(); +}); + +if (navigator.userAgent.match("Firefox") === null){ + chrome.runtime.onSuspend.addListener(function(){ + hold = true; + }); +} + diff --git a/defaults.js b/defaults.js new file mode 100644 index 0000000..63d00c8 --- /dev/null +++ b/defaults.js @@ -0,0 +1,298 @@ +var ColorsSet = { + // scrolls + "scrollbar_thumb": "#cdcdcd", + "scrollbar_thumb_hover": "#a6a6a6", + "scrollbar_track": "#e4e4e4", + + // toolbar + "toolbar_background": "#f2f2f2", + "toolbar_border_bottom": "#cccccc", + + "button_border": "#f2f2f2", + "button_background": "#f2f2f2", + + "button_hover_border": "#bebebe", + "button_hover_background": "#dcdcdc", + + "button_icons": "#808080", + + "filter_box_background": "#fafafa", + "filter_box_border": "#cccccc", + "filter_box_font": "#333333", + "filter_clear_icon": "#808080", + + + // lists + "pin_list_border_bottom": "#cccccc", + "pin_list_background": "#fafafa", + "tab_list_background": "#fafafa", + + // tabs + "tab_background": "#f2f2f2", + "tab_border": "#bebebe", + + "tab_hover_background": "#d7d7d7", + "tab_hover_border": "#878787", + + "tab_selected_background": "#e5f3fb", + "tab_selected_border": "#70c0e7", + + "tab_selected_hover_border": "#78aee5", + "tab_selected_hover_background": "#d0e2f0", + + "tab_filtered": "#e8e000", + "tab_filtered_highlighted": "#ffa500", + + "tab_filtered_selected": "#0f8079", + "tab_filtered_selected_active": "#1299a9", + + "active_font_weight": "bold", + + // tabs title + "tab_title": "#000000", + "tab_title_active": "#000000", + "tab_title_discarded": "#7e7e7e", + + // drag&drop placeholder indicator + "drag_indicator": "#339bf3", + + // close button + "close_x": "#7d7d7d", + "close_hover_x": "#fbfcfe", + + "close_hover_border": "#757676", + "close_hover_background": "#939394", + + // trees expand + "expand_open_border": "#339bf3", + "expand_open_background": "#d0e2f0", + + "expand_closed_border": "#969696", + "expand_closed_background": "#eaeaea", + + "expand_lines": "#cccccc", + + "tabs_menu_font": "#333333", + + "tabs_menu_background": "#fafafa", + "tabs_menu_border": "#bebebe", + + "tabs_menu_hover_background": "#efefef", + "tabs_menu_hover_border": "#bebebe", + + "tabs_menu_separator": "#efefef" +} + +var TabsSizeSets = [ +//0 + { + "pin_width": "22px", + "pin_height": "20px", + + "tab_height": "15px", + "tab_height_line": "17px", + + "expand_box_size": "5px", + "expand_box_top": "4px", + "expand_box_left": "3px", + + "expand_line_h_top": "7px", + "expand_line_h_width": "12px", + "expand_line_h_oc_width": "3px", + + "expand_line_v_top": "-7px", + "expand_line_v_left": "0px", + "expand_line_v_last_height": "15px", + + "title_padding_with_close": "20px", + "title_font_size": "10.5px", + + "title_padding_left": "19px", + + "drag_area_top": "6px", + "drag_area_bottom": "4px", + + "close_top": "1px", + "close_right": "1px", + "close_size": "11px", + + "favicon_size": "13px 13px", + "favicon_pos": "2px center" + + }, +//1 + { + "pin_width": "24px", + "pin_height": "22px", + + "tab_height": "17px", + "tab_height_line": "19px", + + "expand_box_size": "5px", + "expand_box_top": "5px", + "expand_box_left": "3px", + + "expand_line_h_top": "8px", + "expand_line_h_width": "12px", + "expand_line_h_oc_width": "3px", + + "expand_line_v_top": "-8px", + "expand_line_v_left": "0px", + "expand_line_v_last_height": "17px", + + "title_padding_with_close": "20px", + "title_font_size": "10.5px", + + "title_padding_left": "20px", + + "drag_area_top": "7px", + "drag_area_bottom": "5px", + + "close_top": "2px", + "close_right": "2px", + "close_size": "11px", + + "favicon_size": "14px 14px", + "favicon_pos": "3px center" + }, +//2 + { + "pin_width": "26px", + "pin_height": "24px", + + "tab_height": "19px", + "tab_height_line": "23px", + + "expand_box_size": "5px", + "expand_box_top": "6px", + "expand_box_left": "3px", + + "expand_line_h_top": "9px", + "expand_line_h_width": "12px", + "expand_line_h_oc_width": "3px", + + "expand_line_v_top": "-9px", + "expand_line_v_left": "0px", + "expand_line_v_last_height": "19px", + + "title_padding_with_close": "24px", + "title_font_size": "12px", + + "title_padding_left": "25px", + + "drag_area_top": "7px", + "drag_area_bottom": "5px", + + "close_top": "2px", + "close_right": "2px", + "close_size": "13px", + + "favicon_size": "16px 16px", + "favicon_pos": "4px center" + }, +//3 + { + "pin_width": "28px", + "pin_height": "26px", + + "tab_height": "21px", + "tab_height_line": "25px", + + "expand_box_size": "5px", + "expand_box_top": "7px", + "expand_box_left": "3px", + + "expand_line_h_top": "10px", + "expand_line_h_width": "12px", + "expand_line_h_oc_width": "3px", + + "expand_line_v_top": "-10px", + "expand_line_v_left": "0px", + "expand_line_v_last_height": "21px", + + "title_padding_with_close": "24px", + "title_font_size": "12px", + + "title_padding_left": "25px", + + "drag_area_top": "8px", + "drag_area_bottom": "5px", + + "close_top": "3px", + "close_right": "3px", + "close_size": "13px", + + "favicon_size": "16px 16px", + "favicon_pos": "4px center" + }, +//4 + { + "pin_width": "30px", + "pin_height": "28px", + + "tab_height": "23px", + "tab_height_line": "26px", + + "expand_box_size": "5px", + "expand_box_top": "8px", + "expand_box_left": "3px", + + "expand_line_h_top": "11px", + "expand_line_h_width": "12px", + "expand_line_h_oc_width": "3px", + + "expand_line_v_top": "-11px", + "expand_line_v_left": "0px", + "expand_line_v_last_height": "23px", + + "title_padding_with_close": "24px", + "title_font_size": "12.5px", + + "title_padding_left": "25px", + + "drag_area_top": "9px", + "drag_area_bottom": "6px", + + "close_top": "4px", + "close_right": "4px", + "close_size": "14px", + + "favicon_size": "16px 16px", + "favicon_pos": "4px center" + } +]; + +var CurrentThemeVersion = 1; +var TabsSizeSet = 2; +var ScrollbarPinList = 4; +var ScrollbarTabList = 16; +var ToolbarShow = true; +var ToolbarSet = $("#toolbar").html(); + + +function SaveTheme(themeName){ + var themeObj = { + "toolbar": ToolbarSet, + "ToolbarShow": ToolbarShow, + "ColorsSet": ColorsSet, + "TabsSizeSetNumber": TabsSizeSet, + "TabsSizeSet": TabsSizeSets[TabsSizeSet], + "ScrollbarPinList": ScrollbarPinList, + "ScrollbarTabList": ScrollbarTabList, + "theme_version": CurrentThemeVersion + }; + + localStorage["theme"+themeName] = JSON.stringify(themeObj); + return themeObj; +} + +if (localStorage.getItem("themeDefault") === null){ + SaveTheme("Default"); + localStorage["current_theme"] = "Default"; +} else { + var theme = JSON.parse(localStorage["themeDefault"]); + if (theme.theme_version != CurrentThemeVersion){ + SaveTheme("Default"); + } +} + diff --git a/icons/128.png b/icons/128.png new file mode 100644 index 0000000000000000000000000000000000000000..8f1c79a5a8d792e90a5dcd36c638eb53ebf5371d GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSoCO|{#S9GGLLkg|>2BR01_nk+ zPZ!6Kid%2*Y~*b);9+p=*|hNam!5@7d?z-|*v%-gV0vap^0~^7@!P`{7+4w@1Q?hc z7&sUhv2mVD@79k9tuwx-VSJbcrz(*C2G+#j6`W|My~wNixJ<^d-cqj5p8=$bff1W6 zObHVoKUBj|@Wsr^E@b&%rf2BR0prDPX zi(`n#@#L7zX=m%%q?pv$q?!Y{+3qnN`~UxcKbv6OfhOOAx3{+bcW=(P(sZ%M?QxIW h*&g#*KJE>y3@YdNtu+oXdjid2@O1TaS?83{1OU*sD;xj- literal 0 HcmV?d00001 diff --git a/icons/38.png b/icons/38.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3f101749db8ec2cdfe48ee73a31849e5f13329 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^Y9P$P1|(P5zFY^SI14-?iy0WWg+Q3`(%rg0K*0b{ z7srr@!*8!`Y0l~A5=El9>V{5)vMyN_iNZeSa^J5NwxB~O?9YC`gJYD@<);T3K0RZI@ BGll>F literal 0 HcmV?d00001 diff --git a/icons/48.png b/icons/48.png new file mode 100644 index 0000000000000000000000000000000000000000..9016744c3d23ca579eec5ef37df5aca356b61e8d GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?3oArNM~bhqvgP%z!o z#W5t~-rMU3IS(iZxH_6IIlT6=)O9`~4xOYK_2*JM9vH96nzJWc#tx{sVejtyb~B3e zc54_J%P4{buC;z=Xb}6g@15TzCm=uQkUYbWQm>Ndty6$Jh6_%80wDUpWwEM$iEx`4 QKQlmFPgg&ebxsLQ08D8)od5s; literal 0 HcmV?d00001 diff --git a/icons/64.png b/icons/64.png new file mode 100644 index 0000000000000000000000000000000000000000..19a355cdf8b3d8b3c8c72f03fb8972f97f7ff3eb GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GGLLkg|>2BR0pkTMB zi(^Q|t+zKe@*XhYU~v#mb$*uOmd@IxQFNsC?JJf^KW|j8Ke_YT2cTLA=sA10HX?NY z599Q-889)11~(_oELH}F0>1qdg3qNs-yjN;vS{}OGi$E1&$%T2f_V*0g26$bOHdom aGce)byjr4M(nI73NX*mK&t;ucLK6TbPB~cs literal 0 HcmV?d00001 diff --git a/lib_jquery/jquery-3.2.1.min.js b/lib_jquery/jquery-3.2.1.min.js new file mode 100644 index 0000000..644d35e --- /dev/null +++ b/lib_jquery/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + + + + + + + + + + diff --git a/options.js b/options.js new file mode 100644 index 0000000..5e0fc03 --- /dev/null +++ b/options.js @@ -0,0 +1,581 @@ +// ********** OPTIONS *************** + +var bg; +if (navigator.userAgent.match("Firefox") !== null){ + bg = browser.extension.getBackgroundPage(); +} else { + bg = chrome.extension.getBackgroundPage(); +} + +var themes = []; +var theme = {}; + +document.addEventListener("DOMContentLoaded", function(){ + document.title = "Tree Tabs"; + + if (bg.opt == undefined){ + setTimeout(function(){ + location.reload(); + }, 3000); + } + + if (localStorage.getItem("themes") != null){ + themes = JSON.parse(localStorage["themes"]); + } + if (localStorage.getItem("current_theme") != null){ + LoadTheme(localStorage["current_theme"]); + } + + GetOptions(); + RefreshFields(); + SetEvents(); +}); + + +// AppendCSSSheets from theme +function AppendCSSSheets(theme){ + var css_variables = ""; + for (var css_variable in theme.TabsSizeSet){ + css_variables = css_variables + "--" + css_variable + ":" + theme.TabsSizeSet[css_variable] + ";"; + } + + for (var css_variable in theme.ColorsSet){ + ColorsSet[css_variable] = theme.ColorsSet[css_variable]; + if ($("#"+css_variable)[0]) $("#"+css_variable)[0].value = theme.ColorsSet[css_variable]; + css_variables = css_variables + "--" + css_variable + ":" + theme.ColorsSet[css_variable] + ";"; + } + + // remove previous css rules in css sheet 0 + for (var r = 0; r < document.styleSheets[0].cssRules.length; r++){ + if (document.styleSheets[0].cssRules[r].cssText.match("--pin_width") !== null){ + document.styleSheets[0].deleteRule(r); + } + if (document.styleSheets[0].cssRules[r].cssText.match("::-webkit-scrollbar") !== null){ + document.styleSheets[0].deleteRule(r); + } + } + document.styleSheets[0].insertRule("body { "+css_variables+" }", 0); + + // scrollbars + if (navigator.userAgent.match("Firefox") === null){ + document.styleSheets[0].insertRule("::-webkit-scrollbar { width:"+theme.ScrollbarTabList+"px; height:"+theme.ScrollbarPinList+"px; }", 3); + } +} + +function LoadTheme(themeName){ + var theme = JSON.parse(localStorage["theme"+themeName]); + + TabsSizeSet = theme.TabsSizeSetNumber; + + // append toolbar from theme + $("#toolbar").html(theme.toolbar); + + AppendCSSSheets(theme); + + $("#button_filter_type").addClass("url").removeClass("title"); + + // expand toolbar options + ToolbarShow = $("#show_toolbar")[0].checked = theme.ToolbarShow; + $("#field_show_toolbar").css({"height": $("#show_toolbar")[0].checked ? "" : "6"}); + ToolbarShow ? $("#options_available_buttons, #toolbar, #toolbar_colors").show() : $("#options_available_buttons, #toolbar, #toolbar_colors").hide(); + + // append example tabs + $("#pin_list, #tab_list").html(""); + // pins + AppendTab({tab: {id: "p0", pinned: true}, Append: true}); + AppendTab({tab: {id: "p1", pinned: true, active: true}, Append: true}); + + // tabs + AppendTab({tab: {id: "t2", pinned: false}, Append: true}); + $("#tab_titlet2")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_normal"); + + AppendTab({tab: {id: "t3", pinned: false, active: true}, Append: true, ParentId: "t2"}); + $("#tab_titlet3")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_active_selected"); + $(".tab#t3").addClass("c selected"); + + + AppendTab({tab: {id: "t5", pinned: false, discarded: true}, Append: true}); + $("#tab_titlet5")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_discarded"); + + AppendTab({tab: {id: "t6", pinned: false}, Append: true}); + $("#tab_titlet6")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_search_result"); + $(".tab#t6").addClass("filtered"); + + + AppendTab({tab: {id: "t7", pinned: false}, Append: true}); + $("#tab_titlet7")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_search_result_higlighted"); + $(".tab#t7").addClass("filtered highlighted_search"); + + + AppendTab({tab: {id: "t8", pinned: false}, Append: true}); + $("#tab_titlet8")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_search_result_selected"); + $(".tab#t8").addClass("selected filtered"); + + + + AppendTab({tab: {id: "t9", pinned: false}, Append: true}); + $("#tab_titlet9")[0].textContent = chrome.i18n.getMessage("options_theme_tabs_sample_text_search_result_selected_active"); + $(".tab#t9").addClass("active selected filtered"); + + // drag&drop indicator + $(".drag_entered_bottom").first().addClass("highlighted_drop_target"); + + // toolbar events + $("#toolbar_tools, #toolbar_search").addClass("hidden"); + $(".on").removeClass("on"); + + ScrollbarPinList = $("#scrollbar_pin_list")[0].value = theme.ScrollbarPinList; + ScrollbarTabList = $("#scrollbar_tab_list")[0].value = theme.ScrollbarTabList; + + $("#active_tab_font_bold")[0].checked = theme.ColorsSet.active_font_weight == "normal" ? false : true; + $("#body").css({"background-color": "transparent"}); + +} + + +// document events +function GetOptions(){ + // get language labels + $(".label").each(function(){ + $(this).text(chrome.i18n.getMessage(this.id)); + }); + // get language for color pick labels + $(".cpl").each(function(){ + $(this).text(chrome.i18n.getMessage(this.id)); + }); + // get language for menu labels + $(".menu_item").each(function(){ + $(this).text(chrome.i18n.getMessage("options_example_menu_item")); + }); + + // get checkboxes from saved states + $(".opt_checkbox").each(function(){ + $(this)[0].checked = bg.opt[this.id]; + }); + $(".set_button").each(function(){ + $(this)[0].textContent = chrome.i18n.getMessage(this.id); + }); + + // get language dropdown menus + $(".bg_opt_drop_down_menu").each(function(){ + $(this)[0].textContent = chrome.i18n.getMessage(this.id); + }); + + + // get options for append child tab + for (var i = 0; i < $("#append_child_tab")[0].options.length; i++){ + if ($("#append_child_tab")[0].options[i].value === bg.opt.append_child_tab){ + $("#append_child_tab")[0].selectedIndex = i; + break; + } + } + + // get options for append child tab after limit + for (var i = 0; i < $("#append_child_tab_after_limit")[0].options.length; i++){ + if ($("#append_child_tab_after_limit")[0].options[i].value === bg.opt.append_child_tab_after_limit){ + $("#append_child_tab_after_limit")[0].selectedIndex = i; + break; + } + } + + // get options for append orphan tab + for (var i = 0; i < $("#append_orphan_tab")[0].options.length; i++){ + if ($("#append_orphan_tab")[0].options[i].value === bg.opt.append_orphan_tab){ + $("#append_orphan_tab")[0].selectedIndex = i; + break; + } + } + + // get options for action after closing active tab + for (var i = 0; i < $("#after_closing_active_tab")[0].options.length; i++){ + if ($("#after_closing_active_tab")[0].options[i].value === bg.opt.after_closing_active_tab){ + $("#after_closing_active_tab")[0].selectedIndex = i; + break; + } + } + + // get options for tabs tree depth option + $("#max_tree_depth")[0].value = bg.opt.max_tree_depth; + + // append themes to dropdown menu + for (var i = 0; i < themes.length; i++){ + var t_list = document.getElementById("theme_list"); + var theme_name = document.createElement("option"); + theme_name.value = themes[i]; + theme_name.text = themes[i]; + t_list.add(theme_name); + } + + // select current theme in dropdown list + for (var i = 0; i < $("#theme_list")[0].options.length; i++){ + if ($("#theme_list")[0].options[i].value === localStorage["current_theme"]){ + $("#theme_list")[0].selectedIndex = i; + break; + } + } +} + + +function ExportTheme(filename) { + var themeObj = { + "ToolbarShow": ToolbarShow, + "ColorsSet": ColorsSet, + "TabsSizeSetNumber": TabsSizeSet, + "TabsSizeSet": TabsSizeSets[TabsSizeSet], + "ScrollbarPinList": ScrollbarPinList, + "ScrollbarTabList": ScrollbarTabList, + "theme_name": $("#theme_list").val(), + "theme_version": CurrentThemeVersion, + "toolbar": ToolbarSet + }; + var data = JSON.stringify(themeObj); + var body = document.getElementById("body"); + var link = document.createElement("a"); + link.target = "_blank"; + link.download = filename; + link.href = "data:text/csv;charset=utf-8," + encodeURIComponent(data); + body.appendChild(link); + link.click(); + link.remove(); +} + + +function ImportTheme(){ + var file = document.getElementById("import_theme"); + var fr = new FileReader(); + if (file.files[0] == undefined) return; + fr.readAsText(file.files[0]); + fr.onload = function(){ + var data = fr.result; + var themeObj = JSON.parse(data); + + if (themeObj.theme_version > CurrentThemeVersion){ + alert(chrome.i18n.getMessage("options_loaded_theme_newer_version")); + } + if (themeObj.theme_version < CurrentThemeVersion){ + alert(chrome.i18n.getMessage("options_loaded_theme_older_version")); + } + + if (themeObj.theme_version <= CurrentThemeVersion){ + for (var val in ColorsSet){ + ColorsSet[val] = themeObj.ColorsSet[val]; + } + + ToolbarShow = themeObj.ToolbarShow; + TabsSizeSet = themeObj.TabsSizeSetNumber; + ScrollbarPinList = themeObj.ScrollbarPinList; + ScrollbarTabList = themeObj.ScrollbarTabList; + + $("#toolbar").html(themeObj.toolbar); + ToolbarSet = themeObj.toolbar; + + if (themes.indexOf(themeObj.theme_name) != -1){ + themeObj.theme_name = themeObj.theme_name + "(1)"; + } + + themes.push(themeObj.theme_name); + + SaveTheme(themeObj.theme_name); + var t_list = document.getElementById("theme_list"); + var theme_name = document.createElement("option"); + theme_name.value = themeObj.theme_name; + theme_name.text = theme_name.value; + t_list.add(theme_name); + + $("#theme_list")[0].selectedIndex = $("#theme_list")[0].options.length-1; + + localStorage["themes"] = JSON.stringify(themes); + localStorage["current_theme"] = themeObj.theme_name; + LoadTheme(themeObj.theme_name); + RefreshFields(); + } + } + +} + + + +// document events +function SetEvents(){ + + // import theme preset button + $(document).on("click", "#options_import_theme_button", function(event){ + $("#import_theme").click(); + }); + $(document).on("change", "#import_theme", function(event){ + ImportTheme(); + }); + + // export theme preset button + $(document).on("click", "#options_export_theme_button", function(event){ + if ($("#theme_list")[0].options.length == 0){ + alert(chrome.i18n.getMessage("options_no_theme_to_export")); + } else { + ExportTheme($("#theme_list").val() + ".tt_theme"); + } + }); + + + // rename theme preset button + $(document).on("click", "#options_rename_theme_button", function(event){ + + if (themes.indexOf($("#new_theme_name")[0].value) != -1){ + alert(chrome.i18n.getMessage("options_there_is_a_theme_with_this_name")); + return; + } + + if ($("#new_theme_name")[0].value == ""){ + alert(chrome.i18n.getMessage("options_theme_name_cannot_be_empty")); + return; + } + + + localStorage["theme"+($("#new_theme_name")[0].value)] = localStorage["theme"+($("#theme_list").val())]; + localStorage.removeItem("theme"+($("#theme_list").val())); + + var t_list = document.getElementById("theme_list"); + + themes[themes.indexOf(t_list.options[t_list.selectedIndex].value)] = $("#new_theme_name")[0].value; + t_list.options[t_list.selectedIndex].value = t_list.options[t_list.selectedIndex].text = $("#new_theme_name")[0].value; + localStorage["themes"] = JSON.stringify(themes); + localStorage["current_theme"] = $("#theme_list").val(); + }); + + + + // set checkbox options on/off and save + $(document).on("click", ".bg_opt", function(event){ + bg.opt[this.id] = $(this)[0].checked ? true : false; + chrome.runtime.sendMessage({command: "options_save"}); + }); + + // set dropdown menu options + $("#append_child_tab, #append_child_tab_after_limit, #after_closing_active_tab, #append_orphan_tab").change(function(){ + bg.opt[this.id] = $(this).val(); + chrome.runtime.sendMessage({command: "options_save"}); + }); + + + // set tabs tree depth option + $(document).on("input", "#max_tree_depth", function(event){ + bg.opt.max_tree_depth = $(this)[0].value; + chrome.runtime.sendMessage({command: "options_save"}); + }); + + + // set toolbar on/off and show/hide all toolbar options + $(document).on("click", "#show_toolbar", function(event){ + ToolbarShow = $("#show_toolbar")[0].checked ? true : false; + SaveTheme($("#theme_list").val()); + $("#field_show_toolbar").css({"height": $("#show_toolbar")[0].checked ? "" : "6"}); + ToolbarShow ? $("#options_available_buttons, #toolbar, #toolbar_colors").show() : $("#options_available_buttons, #toolbar, #toolbar_colors").hide(); + }); + + + // block system dragging + $(document).bind("drop dragover", function(event){ + event.preventDefault(); + }); + + var dragged_button; + $(document).on("mousedown", ".button", function(event){ + if ($(this).is("#button_filter_type, #filter_search_go_prev, #filter_search_go_next")){ + return; + } + $(this).attr("draggable", "true"); + dragged_button = this; + }); + + // set dragged button node + $(document).on("dragstart", ".button", function(event){ + event.originalEvent.dataTransfer.setData(" "," "); + event.originalEvent.dataTransfer.setDragImage(document.getElementById("DragImage"), 0, 0); + }); + + // remove draggable attribute to clean html which will be saved in the toolbar + $(document).on("mouseleave", ".button", function(event){ + $(".button").removeAttr("draggable"); + }); + + // save toolbar + $(document).on("dragend", ".button", function(event){ + ToolbarSet = $("#toolbar").html(); + SaveTheme($("#theme_list").val()); + }); + + + // drag&drop buttons to lists + $(document).on("dragenter", "#toolbar_main, #toolbar_tools, #toolbar_unused_buttons", function(event){ + if ($(dragged_button).is("#button_tools, #button_search") && $(this).is("#toolbar_tools")){ + return; + } + if (dragged_button.parentNode.id != this.id){ + $("#"+dragged_button.id).appendTo($(this)); + } + }); + + // move (flip) buttons + $(document).on("dragenter", ".button", function(event){ + if ($(dragged_button).is("#button_tools, #button_search") && $(this).parent().is("#toolbar_tools")){ + return; + } + if ($(this).parent().is("#toolbar_search, #toolbar_search_buttons")){ + return; + } + if ( $(this).index() <= $("#"+dragged_button.id).index()){ + $("#"+dragged_button.id).insertBefore($(this)); + } else { + $("#"+dragged_button.id).insertAfter($(this)); + } + }); + + // add new theme preset button + $(document).on("click", "#options_add_theme_button", function(event){ + if (themes.indexOf($("#new_theme_name")[0].value) != -1){ + alert(chrome.i18n.getMessage("options_there_is_a_theme_with_this_name")); + return; + } + + if ($("#new_theme_name")[0].value == ""){ + alert(chrome.i18n.getMessage("options_theme_name_cannot_be_empty")); + return; + } + + LoadTheme("Default"); + themes.push($("#new_theme_name")[0].value); + var t_list = document.getElementById("theme_list"); + var theme_name = document.createElement("option"); + theme_name.value = $("#new_theme_name")[0].value; + theme_name.text = theme_name.value; + t_list.add(theme_name); + + $("#theme_list")[0].selectedIndex = $("#theme_list")[0].options.length-1; + SaveTheme(theme_name.value); + localStorage["themes"] = JSON.stringify(themes); + localStorage["current_theme"] = $("#theme_list").val(); + RefreshFields(); + }); + + // remove theme preset button + $(document).on("click", "#options_remove_theme_button", function(event){ + if ($("#theme_list")[0].options.length == 0){ + localStorage["current_theme"] = "Default"; + return; + } + + themes.splice(themes.indexOf($("#theme_list").val()), 1); + localStorage["themes"] = JSON.stringify(themes); + + localStorage.removeItem("theme"+($("#theme_list").val())); + var x = document.getElementById("theme_list"); + x.remove(x.selectedIndex); + + localStorage["current_theme"] = ($("#theme_list")[0].options.length > 0) ? $("#theme_list").val() : "Default"; + LoadTheme(localStorage["current_theme"]); + RefreshFields(); + }); + + // select theme from list + $("#theme_list").change(function(){ + localStorage["current_theme"] = $(this).val(); + LoadTheme($(this).val()); + }); + + + // change colors with color pickers + $(document).on("input", ".cp", function(event){ + ColorsSet[this.id] = $(this)[0].value; + AppendCSSSheets(SaveTheme($("#theme_list").val())); + }); + + // set scrollbar sizes + $(document).on("input", "#scrollbar_pin_list, #scrollbar_tab_list", function(event){ + ScrollbarPinList = $("#scrollbar_pin_list")[0].value; + ScrollbarTabList = $("#scrollbar_tab_list")[0].value; + SaveTheme($("#theme_list").val()); + document.styleSheets[0].addRule("::-webkit-scrollbar", "width:"+ScrollbarTabList+"px; height:"+ScrollbarPinList+"px;"); + }); + + + // change tabs size preset(up) + $(document).on("click", "#options_tabs_size_up", function(event){ + if (TabsSizeSet < TabsSizeSets.length-1){ + TabsSizeSet++; + AppendCSSSheets(SaveTheme($("#theme_list").val())); + } + }); + + // change tabs size preset(down) + $(document).on("click", "#options_tabs_size_down", function(event){ + if (TabsSizeSet > 0){ + TabsSizeSet--; + AppendCSSSheets(SaveTheme($("#theme_list").val())); + } + }); + + // change active_tab_font_bold + $(document).on("click", "#active_tab_font_bold", function(event){ + ColorsSet.active_font_weight = $(this)[0].checked ? "bold" : "normal"; + AppendCSSSheets(SaveTheme($("#theme_list").val())); + }); + + // show close button on hover + $(document).on("mouseenter", ".close", function(event){ + $(this).addClass("close_hover"); + }); + $(document).on("mouseleave", ".close", function(event){ + $(".close_hover").removeClass("close_hover"); + }); + + // tabs on hover + $(document).on("mouseover", ".tab_header", function(event){ + $(this).addClass("tab_header_hover").addClass("close_show"); + }); + + $(document).on("mouseleave", ".tab_header", function(event){ + $(this).removeClass("tab_header_hover").removeClass("close_show"); + }); + + $(document).on("click", "#button_tools, #button_search", function(event){ + if (event.button != 0){ + return; + } + if ($(this).is(".on")){ + $("#button_tools, #button_search").removeClass("on"); + $("#toolbar_tools, #toolbar_search").addClass("hidden"); + } else { + $(this).addClass("on"); + if ($(this).is("#button_tools")){ + $("#button_search").removeClass("on"); + $("#toolbar_search").addClass("hidden"); + $("#toolbar_tools").removeClass("hidden"); + } else { + $("#button_tools").removeClass("on"); + $("#toolbar_tools").addClass("hidden"); + $("#toolbar_search").removeClass("hidden"); + } + } + }); + +} + +// shrink or expand theme field +function RefreshFields(){ + if ($("#theme_list")[0].options.length == 0){ + $("#field_theme").css({"height": "45px"}); + } else { + $("#field_theme").css({"height": ""}); + } + if (navigator.userAgent.match("Firefox") !== null){ + $("#field_scrollbars").hide(); + } else { + $("#faster_scroll_for_firefox").hide(); + } + if (navigator.userAgent.match("Vivaldi") !== null){ + $("#url_for_web_panel").val(chrome.runtime.getURL("sidebar.html")); + $("#url_for_web_panel").prop("readonly", true); + $("#url_for_web_panel").select(); + } else{ + $("#field_vivaldi").hide(); + } +} \ No newline at end of file diff --git a/scripts/IO.js b/scripts/IO.js new file mode 100644 index 0000000..678e69c --- /dev/null +++ b/scripts/IO.js @@ -0,0 +1,92 @@ +// ********** KEYBOARD AND MOUSE *************** + +function SetIOEvents(){ + + // scroll horizontally on pin list + $("#pin_list").bind("mousewheel DOMMouseScroll", function(event) { + event = event.originalEvent; + var delta = event.wheelDelta > 0 || event.detail < 0 ? -1 : 1; + var multiplier = 1; + for (var t = 1; t < 20; t++){ + setTimeout(function(){ + $("#pin_list").scrollLeft($("#pin_list").scrollLeft()+(delta*multiplier)); + }, t); + multiplier++; + } + multiplier = 20; + for (var t = 21; t < 40; t++){ + setTimeout(function(){ + $("#pin_list").scrollLeft($("#pin_list").scrollLeft()+(delta*multiplier)); + }, t); + multiplier--; + } + + }); + + // this is for faster scrolling in firefox, for some reason its default scrolling is slow + if (bg.opt.faster_scroll){ + $("#tab_list").bind("mousewheel DOMMouseScroll", function(event) { + event = event.originalEvent; + var delta = event.wheelDelta > 0 || event.detail < 0 ? -1.5 : 1.5; + var multiplier = 1; + for (var t = 1; t < 40; t++){ + setTimeout(function(){ + $("#tab_list").scrollTop($("#tab_list").scrollTop()+(delta*multiplier)); + }, t); + multiplier++; + } + multiplier = 40; + for (var t = 41; t < 80; t++){ + setTimeout(function(){ + $("#tab_list").scrollTop($("#tab_list").scrollTop()+(delta*multiplier)); + }, t); + multiplier--; + } + }); + } + + // catch keyboard keys + $(document).keydown(function(event){ + if (MouseHoverOver == "pin_list"){ + // ctrl+a to select all + if (event.ctrlKey && event.which == 65){ + $(".pin").addClass("selected"); + } + // ctrl+i to invert selection + if (event.ctrlKey && event.which == 73){ + $(".pin").toggleClass("selected"); + } + } + if (MouseHoverOver == "tab_list"){ + // ctrl+a to select all + if (event.ctrlKey && event.which == 65){ + $(".tab").addClass("selected"); + } + // ctrl+i to invert selection + if (event.ctrlKey && event.which == 73){ + $(".tab").toggleClass("selected"); + } + } + RefreshGUI(); + }); + + $(document).on("dragenter", "#toolbar", function(event){ // set mouse over id + MouseHoverOver = this.id; + }); + $(document).on("mouseenter", "#pin_list, #tab_list, #toolbar", function(event){ // set mouse over id + MouseHoverOver = this.id; + }); + $(document).on("mouseleave", window, function(event){ + MouseHoverOver = ""; + }); + + // remove middle mouse and set hiding menu + document.body.onmousedown = function(event){ + if (event.button == 1 && bg.opt.close_with_MMB == true){ + event.preventDefault(); + } + if (event.button == 0 && !$(event.target).is(".menu_item")){ + $(".menu").hide(0); + } + }; +} diff --git a/scripts/events_chrome.js b/scripts/events_chrome.js new file mode 100644 index 0000000..8101edc --- /dev/null +++ b/scripts/events_chrome.js @@ -0,0 +1,150 @@ +// ********** CHROME EVENTS *************** + +chrome.commands.onCommand.addListener(function(command) { + chrome.windows.getLastFocused({windowTypes: ["normal"]}, function(window) { + if (CurrentWindowId == window.id){ + if (command == "goto_tab_above"){ + ActivatePrevTab(); + } + if (command == "goto_tab_below"){ + ActivateNextTab(); + } + } + }); +}); + +chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ + if (message.command == "reload"){ + window.location.reload(); + } + if (message.command == "recheck_tabs"){ + schedule_update_data++; + } + if (message.command == "drag_end"){ + DropTargetsSendToBack(); + } + + + if (message.windowId == CurrentWindowId){ + switch(message.command){ + case "tab_created": + + // if set to treat unparented tabs as active tab's child + if (bg.opt.append_orphan_tab == "as_child" && message.tab.openerTabId == undefined){ + message.tab.openerTabId = $(".active")[0].id; + } + // child case + if (message.tab.openerTabId){ + + // append to tree + if (bg.opt.max_tree_depth < 0 || (bg.opt.max_tree_depth > 0 && $("#"+message.tab.openerTabId).parents(".tab").length < bg.opt.max_tree_depth)){ + if (bg.opt.append_child_tab == "top"){ + AppendTab({ tab: message.tab, ParentId: message.tab.openerTabId, Append: false }); + } + if (bg.opt.append_child_tab == "bottom"){ + AppendTab({ tab: message.tab, ParentId: message.tab.openerTabId, Append: true }); + } + } + + // if reached depth limit of the tree + if (bg.opt.max_tree_depth > 0 && $("#"+message.tab.openerTabId).parents(".tab").length >= bg.opt.max_tree_depth){ + if (bg.opt.append_child_tab_after_limit == "after"){ + AppendTab({ tab: message.tab, InsertAfterId: message.tab.openerTabId, Append: true }); + } + if (bg.opt.append_child_tab_after_limit == "top"){ + AppendTab({ tab: message.tab, ParentId: $("#"+message.tab.openerTabId).parent().parent()[0].id, Append: false }); + } + if (bg.opt.append_child_tab_after_limit == "bottom"){ + AppendTab({ tab: message.tab, ParentId: $("#"+message.tab.openerTabId).parent().parent()[0].id, Append: true }); + } + } + + // place tabs flat, (should I merge it with orphans case?) + if (bg.opt.max_tree_depth == 0){ + if (bg.opt.append_child_tab_after_limit == "after"){ + AppendTab({ tab: message.tab, InsertAfterId: message.tab.openerTabId, Append: false }); + } + if (bg.opt.append_child_tab_after_limit == "top"){ + AppendTab({ tab: message.tab, Append: false }); + } + if (bg.opt.append_child_tab_after_limit == "bottom"){ + AppendTab({ tab: message.tab, Append: true }); + } + } + // orphan case + } else { + if (bg.opt.append_orphan_tab == "after_active"){ + AppendTab({ tab: message.tab, InsertAfterId: $(".active")[0].id, Append: false }); + } + if (bg.opt.append_orphan_tab == "top"){ + AppendTab({ tab: message.tab, Append: false }); + } + if (bg.opt.append_orphan_tab == "bottom"){ + AppendTab({ tab: message.tab, Append: true }); + } + } + if ($("#"+message.tab.openerTabId).is(".c")){ + $("#"+message.tab.openerTabId).removeClass("c").addClass("o"); + } + RefreshExpandStates(); + schedule_update_data++; + RefreshGUI(); + break; + case "tab_attached": + AppendTab({ tab: message.tab, ParentId: bg.tabs[message.tabId].p, Append: true}); + if ($("#"+message.tabId).parent().children().eq(bg.dt.DropToIndex)){ + if (bg.dt.DropAfter){ + $("#"+message.tabId).insertAfter($("#"+message.tabId).parent().children().eq(bg.dt.DropToIndex)); + } else { + $("#"+message.tabId).insertBefore($("#"+message.tabId).parent().children().eq(bg.dt.DropToIndex)); + } + } + RefreshExpandStates(); + setTimeout(function(){ + DropTargetsSendToBack(); + schedule_update_data++; + },300); + RefreshGUI(); + break; + case "tab_removed": + if (bg.opt.promote_children && $("#"+message.tabId).is(".tab")){ + $("#ch"+message.tabId).children().insertAfter($("#"+message.tabId)); + } else { + $("#"+message.tabId).find(".tab").each(function(){ + chrome.tabs.remove(parseInt(this.id)); + }); + } + RemoveTabFromList(message.tabId); + RefreshExpandStates(); + setTimeout(function(){ schedule_update_data++; },300); + RefreshGUI(); + break; + case "tab_activated": + setTimeout(function(){ SetActiveTab(message.tabId); },100); + break; + case "tab_updated": + if (message.changeInfo.favIconUrl != undefined || message.changeInfo.url != undefined){ + setTimeout(function(){ GetFaviconAndTitle(message.tabId); },100); + } + if (message.changeInfo.title != undefined){ + setTimeout(function(){ GetFaviconAndTitle(message.tabId); },1000); + } + + if (message.changeInfo.audible != undefined || message.changeInfo.mutedInfo != undefined){ + RefreshMediaIcon(message.tabId); + } + if (message.changeInfo.discarded != undefined){ + RefreshDiscarded(message.tabId); + } + if (message.changeInfo.pinned != undefined && DragNode == undefined){ + if ((message.tab.pinned && $("#"+message.tabId).is(".tab")) || (!message.tab.pinned && $("#"+message.tabId).is(".pin"))){ + SetTabClass({ id: message.tabId, pin: message.tab.pinned }); + schedule_update_data++; + } + RefreshExpandStates(); + } + break; + } + } + +}); \ No newline at end of file diff --git a/scripts/events_refresh.js b/scripts/events_refresh.js new file mode 100644 index 0000000..2cf9443 --- /dev/null +++ b/scripts/events_refresh.js @@ -0,0 +1,145 @@ +// ********** REFRESH GUI *************** + +function SetTRefreshEvents(){ + $(window).on("resize", function(event){ + RefreshGUI(); + }); + + // click on media icon + $(document).on("mousedown", ".tab_mediaicon", function(event){ + event.stopPropagation(); + if (event.button == 0 && $(this).parent().parent().is(".audible, .muted")){ + chrome.tabs.get(parseInt(this.parentNode.parentNode.id), function(tab){ + chrome.tabs.update(tab.id, {muted:!tab.mutedInfo.muted}); + }); + } + }); +} + +function RefreshGUI() { + if ($("#toolbar").children().length > 0) { + if ($("#button_tools, #button_search").is(".on")) { + $("#toolbar").css({ "height": 53 }); + } else { + $("#toolbar").css({ "height": 26 }); + } + } else { + $("#toolbar").css({ "height": 0 }); + } + if ($("#pin_list").children().length == 0) { + $("#pin_list").addClass("hidden"); + } else { + $("#pin_list").removeClass("hidden"); + } + $("#tab_list").css({ "height": $(window).height() - $("#pin_list").outerHeight() - $("#toolbar").outerHeight() }); +} + +// set discarded class +function RefreshDiscarded(tabId) { + if ($("#" + tabId).length > 0) { + chrome.tabs.get(parseInt(tabId), function(tab) { + if (tab.discarded) { + $("#" + tabId).addClass("discarded"); + } else { + $("#" + tabId).removeClass("discarded"); + } + }); + } +} + +// change media icon +function RefreshMediaIcon(tabId) { + if ($("#" + tabId).length > 0 && bg.tabs[tabId]) { + chrome.tabs.get(parseInt(tabId), function(tab) { + if (tab) { + if (tab.mutedInfo.muted) { + $("#" + tabId).removeClass("audible").addClass("muted"); + } + if (!tab.mutedInfo.muted && tab.audible) { + $("#" + tabId).removeClass("muted").addClass("audible"); + } + if (!tab.mutedInfo.muted && !tab.audible) { + $("#" + tabId).removeClass("audible").removeClass("muted"); + } + } + }); + } +} + + +// Vivaldi does not have changeInfo.audible listener, this is my own implementation, hopefully this will not affect performance too much +function VivaldiRefreshMediaIcons() { + chrome.tabs.query({currentWindow: true}, function(tabs){ + $(".audible, .muted").removeClass("audible").removeClass("muted"); + tabs.forEach(function(Tab){ + if (Tab.audible) { + $("#" + Tab.id).addClass("audible"); + } + if (Tab.mutedInfo.muted) { + $("#" + Tab.id).addClass("muted"); + } + }); + }); + setTimeout(function() { + VivaldiRefreshMediaIcons(); + }, 1400); +} + + +function GetFaviconAndTitle(tabId) { + if ($("#" + tabId).length > 0 && bg.tabs[tabId]) { + chrome.tabs.get(parseInt(tabId), function(tab) { + + if (tab && tab.status == "complete") { + $("#" + tabId).removeClass("loading"); + var title = tab.title ? tab.title : tab.url; + // change title + $("#tab_title" + tab.id)[0].textContent = title; + $("#tab_header" + tab.id).attr("title", title); + + // compatibility with various Tab suspender extensions + if (tab.favIconUrl != undefined && tab.favIconUrl.match("data:image/png;base64") != null) { + $("#tab_header" + tab.id).css({ "background-image": "url(" + tab.favIconUrl + ")" }); + } else { + // case for internal pages, favicons don't have access, but can be loaded from url + if (tab.url.match("opera://|vivaldi://|browser://|chrome://|chrome-extension://|about:") != null) { + $("#tab_header" + tab.id).css({ "background-image": "url(chrome://favicon/" + tab.url + ")" }); + } else { + // change favicon + var img = new Image(); + img.src = tab.favIconUrl; + img.onload = function() { + $("#tab_header" + tab.id).css({ "background-image": "url(" + tab.favIconUrl + ")" }); + }; + img.onerror = function() { + $("#tab_header" + tab.id).css({ "background-image": "url(chrome://favicon/" + tab.url + ")" }); + } + } + } + } + if (tab && tab.status == "loading") { + $("#" + tabId).addClass("loading"); + var title = tab.title ? tab.title : bg.caption_loading; + $("#tab_title" + tab.id)[0].textContent = title; + $("#tab_header" + tab.id).attr("title", title); + setTimeout(function() { + if ($("#" + tabId).length != 0) GetFaviconAndTitle(tabId); + }, 1000); + } + }); + } +} + +// refresh open closed trees states +function RefreshExpandStates() { + $(".children").each(function() { + if ($(this).children().length > 0) { + $(this).parent().removeClass("n"); + if ($(this).parent().is(":not(.o, .c)")) { + $(this).parent().addClass("o"); + } + } else { + $(this).parent().removeClass("o").removeClass("c").addClass("n"); + } + }); +} \ No newline at end of file diff --git a/scripts/events_tabs.js b/scripts/events_tabs.js new file mode 100644 index 0000000..f71ea7d --- /dev/null +++ b/scripts/events_tabs.js @@ -0,0 +1,323 @@ +// ********** TABS EVENTS *************** + +function SetTabEvents() { + // double click to create tab + $(document).on("dblclick", "#tab_list, #pin_list, .expand", function(event) { + if (event.button == 0 && $(this).parent().is(".n")) { + chrome.tabs.create({}); + } + if (event.button == 0 && event.target.id == "tab_list") { + chrome.tabs.create({}); + } + if (event.button == 0 && event.target.id == "pin_list") { + chrome.tabs.create({ pinned: true }); + } + }); + + $(document).on("mouseenter", ".close", function(event) { + $(this).addClass("close_hover"); + }); + + $(document).on("mouseleave", ".close", function(event) { + $(".close_hover").removeClass("close_hover"); + }); + + $(document).on("mouseover", ".tab_header", function(event) { + $(this).addClass("tab_header_hover"); + + if (bg.opt.always_show_close == false) { + $(this).addClass("close_show"); + } + }); + + $(document).on("mouseleave", ".tab_header", function(event) { + $(this).removeClass("tab_header_hover"); + + if (bg.opt.always_show_close == false) { + $(this).removeClass("close_show"); + } + }); + + // PREVENT THE DEFAULT BROWSER DROP ACTION + $(document).bind("drop dragover", function(event) { + event.preventDefault(); + }); + + + // bring to front drop zones + $(document).on("dragover", ".tab_header", function(event) { + DropTargetsSendToFront(); + }); + + // SET DRAG SOURCE + $(document).on("dragstart", ".tab_header", function(event) { + event.stopPropagation(); + bg.dt.tabsIds.splice(0, bg.dt.tabsIds.length); + + event.originalEvent.dataTransfer.setData("null", "null"); + event.originalEvent.dataTransfer.setDragImage(document.getElementById("DragImage"), 0, 0); + + DragNode = $(this).parent()[0]; + $(".close").removeClass("show"); + $(".tab_header_hover").removeClass("tab_header_hover"); + $(this).parent().addClass("tab_header_hover"); + + if ($(this).parent().is(":not(.selected)")) { + $(".selected").addClass("frozen").removeClass("selected"); + $(this).parent().addClass("temporary").addClass("selected"); + } + + $(".selected").each(function() { + bg.dt.tabsIds.push(parseInt(this.id)); + if ($("#ch" + this.id).children().length > 0) { + $($("#ch" + this.id).find(".tab")).each(function() { + bg.dt.tabsIds.push(parseInt(this.id)); + }); + } + }); + bg.dt.CameFromWindowId = CurrentWindowId; + }); + + // SET DROP TARGET + $(document).on("dragenter", ".drag_entered_top, .drag_entered_bottom, .drag_enter_center", function(event) { + event.stopPropagation(); + if ($(".selected").find($(this)).length > 0) return; + $(".highlighted_drop_target").removeClass("highlighted_drop_target"); + $(this).addClass("highlighted_drop_target"); + }); + + $(document).on("dragenter", ".drag_enter_center", function(event) { + timeout = false; + setTimeout(function() { timeout = true; }, 1800); + }); + $(document).on("dragleave", ".drag_enter_center", function(event) { + timeout = false; + }); + $(document).on("dragover", ".drag_enter_center", function(event) { + if (timeout && bg.opt.open_tree_on_hover && $(this).parent().is(".c")) { + $(this).parent().addClass("o").removeClass("c"); + timeout = false; + } + }); + + + $(document).on("dragend", ".tab_header", function(event) { + if (bg.dt.CameFromWindowId == CurrentWindowId && bg.dt.DroppedToWindowId == 0) { + DetachTabs(bg.dt.tabsIds); + } + + if (bg.dt.CameFromWindowId == CurrentWindowId && bg.dt.DroppedToWindowId != CurrentWindowId && bg.dt.DroppedToWindowId != 0) { + bg.tabs[bg.dt.tabsIds[0]].p = bg.dt.DropToTabId; + bg.tabs[bg.dt.tabsIds[0]].n = bg.dt.DropToIndex; + chrome.tabs.move(bg.dt.tabsIds, { windowId: bg.dt.DroppedToWindowId, index: -1 }); + } + + if (bg.dt.CameFromWindowId == CurrentWindowId && bg.dt.DroppedToWindowId == CurrentWindowId) { + if ($(".highlighted_drop_target").parent().is(".pin")) { + $(".selected").each(function() { + SetTabClass({ id: this.id, pin: true }); + + if ($(".highlighted_drop_target").is(".drag_entered_top")) { + $(this).insertBefore($(".highlighted_drop_target").parent()); + } else { + $(this).insertAfter($(".highlighted_drop_target").parent()); + } + }); + } + + if ($(".highlighted_drop_target").parent().is(".tab")) { + $(".selected").each(function() { + SetTabClass({ id: this.id, pin: false }); + }); + if ($(".highlighted_drop_target").is(".drag_entered_top")) { + $(".selected").insertBefore($(".highlighted_drop_target").parent()); + + } + if ($(".highlighted_drop_target").is(".drag_entered_bottom")) { + $(".selected").insertAfter($(".highlighted_drop_target").parent()); + } + if (($(".highlighted_drop_target").is(".drag_enter_center") && $("#" + DragNode.id).parent()[0].id != "ch" + $(".highlighted_drop_target")[0].id.substr(2))) { + if (bg.opt.append_at_end) { + $("#ch" + $(".highlighted_drop_target")[0].id.substr(2)).append($(".selected")); + } else { + $("#ch" + $(".highlighted_drop_target")[0].id.substr(2)).prepend($(".selected")); + } + } + } + } + + RefreshExpandStates(); + + setTimeout(function() { + timeout = false; + DragNode = undefined; + schedule_update_data++; + DropTargetsSendToBack(); + }, 500); + $(".highlighted_drop_target").removeClass("highlighted_drop_target"); + $(".tab_header_hover").removeClass("tab_header_hover"); + $(".frozen").addClass("selected").removeClass("frozen"); + $(".temporary").removeClass("selected").removeClass("temporary"); + chrome.runtime.sendMessage({command: "drag_end"}); + }); + + + $(document).on("click", ".exp_box", function(event) { + event.stopPropagation(); + if (event.button == 0) { + if ($(this).parent().parent().is(".o")) { + $(this).parent().parent().removeClass("o").addClass("c"); + if (bg.tabs[$(this).parent().parent()[0].id]) { + bg.tabs[$(this).parent().parent()[0].id].o = "c"; + } + } else { + if ($(this).parent().parent().is(".c")) { + if (bg.opt.close_other_trees) { + $(".o").removeClass("o").addClass("c"); + $(this).parents(".tab").each(function() { + $(this).removeClass("n").removeClass("c").addClass("o"); + if (bg.tabs[this.id]) { + bg.tabs[this.id].o = "o"; + } + }); + $(".c").each(function() { + if (bg.tabs[this.id]) { + bg.tabs[this.id].o = "c"; + } + }); + } + $(this).parent().parent().removeClass("c").addClass("o"); + if (bg.tabs[$(this).parent().parent()[0].id]) { + bg.tabs[$(this).parent().parent()[0].id].o = "o"; + } + } + } + bg.schedule_save++; + } + }); + + // SELECT OR CLOSE TAB/PIN + $(document).on("mousedown", ".tab, .pin", function(event) { + DropTargetsSendToBack(); + event.stopPropagation(); + if (event.button == 0) { + + // SET SELECTION WITH SHIFT + if (event.shiftKey) { + $(".pin, .tab").removeClass("selected").removeClass("frozen").removeClass("temporary"); + if ($(this).index() >= $(".active").index()) { + $(".active").nextUntil($(this), ":visible").add($(".active")).add($(this)).addClass("selected"); + } else { + $(".active").prevUntil($(this), ":visible").add($(".active")).add($(this)).addClass("selected"); + } + } + + // TOGGLE SELECTION WITH CTRL + if (event.ctrlKey) { + $(this).toggleClass("selected"); + } + } + + // CLOSE TAB + if ( + (($(this).is(".tab") && $(event.target).is(":not(.expand)")) && ((event.button == 1 && bg.opt.close_with_MMB == true) || (event.button == 0 && $(event.target).is(".close, .close_img")))) + || + ($(this).is(".pin") && event.button == 1 && bg.opt.close_with_MMB == true && bg.opt.allow_pin_close == true) + ) { + if ($(this).is(".active") && bg.opt.after_closing_active_tab != "browser") { + var tabId; + var Prev = $(this).prev(); + var Next = $(this).next(); + + // if in root, seek for closest, in order set in options, first next then prev, or prev then next + if ($(this).parent().is("#pin_list, #tab_list, .children")) { + if (bg.opt.after_closing_active_tab == "above") { + if (Prev[0]) { + tabId = Prev[0].id; + } else { + if (Next[0]) { + tabId = Next[0].id; + } + } + } + if (bg.opt.after_closing_active_tab == "below") { + if (Next[0]) { + tabId = Next[0].id; + } else { + if (Prev[0]) { + tabId = Prev[0].id; + } + } + } + } + + // if no tabs left in the tree, go to parent + if (tabId == undefined && $(this).parent().parent().is(".tab")) { + tabId = $(this).parent().parent()[0].id; + } + + // if found a matching condition a new tab will be activated + if (tabId) { + SetActiveTab(tabId); + chrome.tabs.update(parseInt(tabId), { active: true }); + } + + } + + if ($("#" + this.id).is(".pin")) { + $("#" + this.id).remove(); + chrome.tabs.update(parseInt(this.id), { pinned: false }); + } + + chrome.tabs.remove(parseInt(this.id)); + } + }); + + // single click to activate tab + $(document).on("click", ".tab_header", function(event) { + event.stopPropagation(); + if (!event.shiftKey && !event.ctrlKey && $(event.target).is(":not(.close, .close_img, .expand, .tab_mediaicon)")) { + SetActiveTab($(this).parent()[0].id); + chrome.tabs.update(parseInt($(this).parent()[0].id), { active: true }); + } + }); + + + // set bg.dt to detach tabs when drag ends outside the window + $(document).on("dragleave", "body", function(event) { + bg.dt.DroppedToWindowId = 0; + }); + // set bg.dt to attach tabs when drag ends inside the window + $(document).on("dragover", "*", function(event) { + bg.dt.DroppedToWindowId = CurrentWindowId; + }); + $(document).on("drag", ".tab_header", function(event) { + event.stopPropagation(); + bg.dt.DroppedToWindowId = CurrentWindowId; + }); + $(document).on("drop", "#pin_list, #tab_list", function(event) { + bg.dt.DroppedToWindowId = CurrentWindowId; + }); + + // set bg.dt to attach tabs and append them to tabId + $(document).on("drop", ".drag_enter_center", function(event) { + event.stopPropagation(); + bg.dt.DroppedToWindowId = CurrentWindowId; + bg.dt.DropToTabId = $(this).parent()[0].id; + }); + + // set bg.dt to attach tabs and move them above or below highligted tab + $(document).on("drop", ".drag_entered_top, .drag_entered_bottom", function(event) { + event.stopPropagation(); + bg.dt.DroppedToWindowId = CurrentWindowId; + if ($(this).parent().parent().is("#tab_list, #pin_list")){ + bg.dt.DropToTabId = $(this).parent().parent()[0].id; + } else { + bg.dt.DropToTabId = $(this).parent().parent().parent()[0].id; + } + + bg.dt.DropToIndex = $(this).parent().index(); + bg.dt.DropAfter = $(this).is(".drag_entered_bottom") ? true : false; + }); + +} \ No newline at end of file diff --git a/scripts/global_variables.js b/scripts/global_variables.js new file mode 100644 index 0000000..fb981a9 --- /dev/null +++ b/scripts/global_variables.js @@ -0,0 +1,17 @@ +// ********** GLOBAL VARIABLES *************** + +var bg; +if (navigator.userAgent.match("Firefox") !== null){ + bg = browser.extension.getBackgroundPage(); +} else { + bg = chrome.extension.getBackgroundPage(); +} + +var MouseHoverOver = ""; +var DragNode; +var DropTargetsInFront = false; +var timeout = false; +var menuTabId = 0; +var CurrentWindowId = 0; +var SearchIndex = 0; +var schedule_update_data = 0; diff --git a/scripts/menu_tabs.js b/scripts/menu_tabs.js new file mode 100644 index 0000000..32ceead --- /dev/null +++ b/scripts/menu_tabs.js @@ -0,0 +1,213 @@ +// ********** TABS MENU *************** + +function SetMenu() { + // set menu labels + $(".menu_item").each(function() { + $(this).text(chrome.i18n.getMessage(this.id)); + }); + + // trigger action when the contexmenu is about to be shown + $(document).bind("contextmenu", function(event) { + event.preventDefault(); + }); + + // show menu + $(document).on("mousedown", "#pin_list, #tab_list, .tab, .pin", function(event) { + event.stopPropagation(); + if (event.button == 2) { + $(".menu").hide(0); + + if ($(this).is(".tab, .pin")) { + menuTabId = parseInt($(this)[0].id); + } else { + menuTabId = parseInt($(".active")[0].id); + } + if ($("#" + menuTabId).is(".pin")) { + $("#tabs_menu_pin").text(chrome.i18n.getMessage("tabs_menu_unpin")); + $("#tabs_menu_close").prev().css({ "display": "none" }); + $("#tabs_menu_close_other").css({ "display": "none" }); + + $("#tabs_menu_expand_all, #tabs_menu_collapse_all").css({ "display": "none" }); + $("#tabs_menu_collapse_all").next().css({ "display": "none" }); + + if (!bg.opt.allow_pin_close) { + $("#tabs_menu_close").css({ "display": "none" }); + } + } else { + $("#tabs_menu_pin").text(chrome.i18n.getMessage("tabs_menu_pin")); + $("#tabs_menu_close").prev().css({ "display": "" }); + $("#tabs_menu_close, #tabs_menu_close_other").css({ "display": "" }); + + $("#tabs_menu_expand_all, #tabs_menu_collapse_all").css({ "display": "" }); + $("#tabs_menu_collapse_all").next().css({ "display": "" }); + } + + if ($("#" + menuTabId).is(".o, .c")) { + $("#tabs_menu_close_tree").css({ "display": "" }); + } else { + $("#tabs_menu_close_tree").css({ "display": "none" }); + } + + // MUTE TABS + if ($("#" + menuTabId).is(".muted")) { + $("#tabs_menu_mute").css({ "display": "none" }); + $("#tabs_menu_unmute").css({ "display": "" }); + } else { + $("#tabs_menu_mute").css({ "display": "" }); + $("#tabs_menu_unmute").css({ "display": "none" }); + } + + + // APPEND TABS TO BG.DATA ARRAY + bg.dt.tabsIds = $("#" + menuTabId).is(".selected") ? $(".tab.selected:visible").map(function() { return parseInt(this.id); }).toArray() : [menuTabId]; + + // show contextmenu with correct size position + if ($("#tabs_menu").outerWidth() > $(window).width() - 10) { + $("#tabs_menu").css({ "width": $(window).width() - 10 }); + } else { + $("#tabs_menu").css({ "width": "" }); + } + var x = event.pageX >= $(window).width() - $("#tabs_menu").outerWidth() ? $(window).width() - $("#tabs_menu").outerWidth() : event.pageX; + var y = event.pageY >= $(window).height() - $("#tabs_menu").outerHeight() - 10 ? $(window).height() - $("#tabs_menu").outerHeight() - 10 : event.pageY; + $("#tabs_menu").css({ "display": "block", "top": y - 15, "left": x - 5 }); + } + }); + + // hide menu + $(document).on("mousedown", "body", function(event) { + if (event.button != 2) { + $(".menu").hide(300); + } + }); + + $(document).on("mouseleave", "body", function(event) { + $(".menu").hide(300); + }); + + // if the menu element is clicked + $(document).on("mousedown", "#tabs_menu li", function(event) { + if (event.button != 0) { + return; + } + event.stopPropagation(); + switch ($(this).attr("data-action")) { + case "tab_new": + chrome.tabs.create({}); + break; + case "tab_clone": + if ($("#" + menuTabId).is(".selected")) { + $(".selected:visible").each(function() { + chrome.tabs.duplicate(parseInt(this.id)); + }); + } else { + chrome.tabs.duplicate(menuTabId); + } + break; + case "tab_move": + if ($("#" + menuTabId).is(".selected")) { + DetachTabs($(".selected:visible").map(function() { return parseInt(this.id); }).toArray()); + } else { + DetachTabs([menuTabId]); + } + break; + case "tab_reload": + if ($("#" + menuTabId).is(".selected")) { + $(".selected:visible").each(function() { + chrome.tabs.reload(parseInt(this.id)); + }); + } else { + chrome.tabs.reload(menuTabId); + } + break; + case "tab_pin": + if ($("#" + menuTabId).is(".selected")) { + $(".selected:visible").each(function() { + chrome.tabs.update(parseInt(this.id), { pinned: ($("#" + menuTabId).is(".pin") ? false : true) }); + }); + } else { + chrome.tabs.update(menuTabId, { pinned: ($("#" + menuTabId).is(".pin") ? false : true) }); + } + break; + case "tab_mute": + if ($("#" + menuTabId).is(".selected")) { + $(".selected:visible").each(function() { + chrome.tabs.get(parseInt(this.id), function(tab) { + chrome.tabs.update(tab.id, { muted: true }); + }); + }); + } else { + chrome.tabs.get(menuTabId, function(tab) { + chrome.tabs.update(tab.id, { muted: true }); + }); + } + break; + case "tab_unmute": + if ($("#" + menuTabId).is(".selected")) { + $(".selected:visible").each(function() { + chrome.tabs.get(parseInt(this.id), function(tab) { + chrome.tabs.update(tab.id, { muted: false }); + }); + }); + } else { + chrome.tabs.get(menuTabId, function(tab) { + chrome.tabs.update(tab.id, { muted: false }); + }); + } + break; + case "tab_mute_other": + if ($("#" + menuTabId).is(".selected")) { + $(".tab:visible:not(.selected)").each(function() { + chrome.tabs.update(parseInt(this.id), { muted: true }); + }); + } else { + $(".tab:visible:not(#" + menuTabId + ")").each(function() { + chrome.tabs.update(parseInt(this.id), { muted: true }); + }); + } + break; + case "tab_unmute_other": + if ($("#" + menuTabId).is(".selected")) { + $(".tab:visible:not(.selected)").each(function() { + chrome.tabs.update(parseInt(this.id), { muted: false }); + }); + } else { + $(".tab:visible:not(#" + menuTabId + ")").each(function() { + chrome.tabs.update(parseInt(this.id), { muted: false }); + }); + } + break; + case "tab_close": + CloseTabs($("#" + menuTabId).is(".selected") ? $(".selected:visible").map(function() { return parseInt(this.id); }).toArray() : [menuTabId]); + break; + case "tab_close_tree": + CloseTabs($("#" + menuTabId).find(".tab").map(function() { return parseInt(this.id); }).toArray()); + CloseTabs([menuTabId]); + break; + case "tab_close_other": + CloseTabs($(".tab:visible:not(#" + menuTabId + ")").map(function() { return parseInt(this.id); }).toArray()); + break; + case "tab_undo_close": + chrome.sessions.getRecentlyClosed(null, function(sessions) { + if (sessions.length > 0) { + chrome.sessions.restore(null, function() {}); + } + }); + break; + case "tab_discard": + DiscardTabs(bg.dt.tabsIds); + break; + case "tab_settings": + chrome.tabs.create({ "url": "options.html" }); + break; + case "tab_expand_all": + $(".tab.c").addClass("o").removeClass("c"); + schedule_update_data++; + break; + case "tab_collapse_all": + $(".tab.o").addClass("c").removeClass("o"); + schedule_update_data++; + break; + } + $(".menu").hide(0); + }); +} \ No newline at end of file diff --git a/scripts/tabs.js b/scripts/tabs.js new file mode 100644 index 0000000..0b61728 --- /dev/null +++ b/scripts/tabs.js @@ -0,0 +1,319 @@ +// ********** TABS FUNCTIONS *************** + +function UpdateData(){ + setTimeout(function(){ + // changed it from 1 to 2 if there are some more changes queued, just in case if something did not catch in the first loop + if (schedule_update_data > 1){ + schedule_update_data = 2; + } + if (schedule_update_data > 0){ + $(".pin").each(function(){ + if (bg.tabs[this.id]){ + bg.tabs[this.id].p = "pin_list"; + bg.tabs[this.id].n = $(this).index(); + bg.tabs[this.id].o = "n"; + } + }); + $(".tab").each(function(){ + if (bg.tabs[this.id]){ + bg.tabs[this.id].n = $(this).index(); + if ($(this).parent().parent()[0].id){ + bg.tabs[this.id].p = $(this).parent().parent()[0].id; + } else { + bg.tabs[this.id].p = "tab_list"; + } + if ($(this).is(".n")){ + bg.tabs[this.id].o = "n"; + } else { + if ($(this).is(".c")){ + bg.tabs[this.id].o = "c"; + } else { + bg.tabs[this.id].o = "o"; + } + } + } + }); + bg.schedule_save++; + schedule_update_data--; + } else { + } + UpdateData(); + },2000); +} + +function AppendTab(p){ + if ($("#"+p.tab.id).length > 0){ + GetFaviconAndTitle(p.tab.id); + return; + } + + var div_tab = document.createElement("div"); + div_tab.id = p.tab.id; + div_tab.className = p.tab.pinned ? "pin" : "tab n"; + div_tab.innerHTML = + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + "
"+ + + + (bg.opt.never_show_close ? "" : + ("
") + )+ + + + "
"+ + "
"+ + "
"; + + + if (($("#"+p.InsertAfterId).is(".pin") && p.tab.pinned) || ($("#"+p.InsertAfterId).is(".tab") && !p.tab.pinned)){ + $("#"+p.InsertAfterId).parent()[0].append(div_tab); + $("#"+p.tab.id).insertAfter($("#"+p.InsertAfterId)); + p.ParentId = undefined; + } else { + p.InsertAfterId = undefined; + } + + if ($("#"+p.ParentId).length > 0 && $("#"+p.ParentId).is(".tab") && !p.tab.pinned){ + if ($("#ch"+p.ParentId).children().length == 0){ + $("#"+p.ParentId).addClass("o").removeClass("n").removeClass("c"); + } + if (p.Append){ + $("#ch"+p.ParentId).append(div_tab); + } + if (!p.Append){ + $("#ch"+p.ParentId).prepend(div_tab); + } + } else { + p.ParentId = undefined; + } + + if (p.InsertAfterId == undefined && p.ParentId == undefined){ + if (p.Append){ + $(p.tab.pinned ? "#pin_list" : "#tab_list").append(div_tab); + } + if (!p.Append){ + $(p.tab.pinned ? "#pin_list" : "#tab_list").prepend(div_tab); + } + } + + + if (bg.opt.always_show_close){ + $("#tab_header"+p.tab.id).addClass("close_show"); + } + GetFaviconAndTitle(p.tab.id); + RefreshMediaIcon(p.tab.id); + + if (p.tab.discarded){ + $("#"+p.tab.id).addClass("discarded"); + } + if (p.tab.active){ + SetActiveTab(p.tab.id); + } +} + +function RemoveTabFromList(tabId){ + if ($("#"+tabId).length > 0){ + $("#"+tabId).remove(); + } +} + +function SetTabClass(p){ + if (p.pin){ + $("#pin_list").append($("#"+p.id)); + // flatten out children + if ($("#ch"+p.id).children().length > 0){ + $($("#"+p.id).children().find(".pin, .tab").get().reverse()).each(function(){ + $(this).removeClass("tab").removeClass("n").removeClass("o").removeClass("c").addClass("pin"); + $(this).insertAfter($("#"+p.id)); + chrome.tabs.update(parseInt(this.id), {pinned: true}); + }); + } + $("#"+p.id).removeClass("tab").removeClass("n").removeClass("o").removeClass("c").addClass("pin"); + } else { + $("#tab_list").prepend($("#"+p.id)); + + $("#"+p.id).removeClass("pin").addClass("tab"); + RefreshExpandStates(); + } + chrome.tabs.update(parseInt(p.id), {pinned: p.pin}); + RefreshGUI(); +} + +function SetActiveTab(tabId){ + if ($("#"+tabId).length > 0){ + $(".active").removeClass("active").removeClass("selected"); + $(".pin, .tab").removeClass("active").removeClass("selected").removeClass("frozen").removeClass("temporary").removeClass("tab_header_hover"); + $(".highlighted_drop_target").removeClass("highlighted_drop_target"); + $("#"+tabId).addClass("active").addClass("selected"); + ScrollToTab(tabId); + } +} + +function ScrollToTab(tabId){ + if ($("#"+tabId).length == 0){ + return false; + } + if ($("#"+tabId).is(":not(:visible)")){ + $("#"+tabId).parents(".tab").removeClass("c").addClass("o"); + } + + if ($("#"+tabId).is(".pin")){ + if ($("#"+tabId).position().left+$("#"+tabId).outerWidth() > $("#pin_list").innerWidth()){ + $("#pin_list").scrollLeft($("#pin_list").scrollLeft()+$("#"+tabId).position().left+$("#"+tabId).outerWidth()-$("#pin_list").innerWidth()); + } else { + if ($("#"+tabId).position().left < 0){ + $("#pin_list").scrollLeft($("#pin_list").scrollLeft()+$("#"+tabId).position().left); + } + } + } + if ($("#"+tabId).is(".tab")){ + if ($("#"+tabId).offset().top - $("#tab_list").offset().top < 0){ + $("#tab_list").scrollTop($("#tab_list").scrollTop() + $("#"+tabId).offset().top - $("#tab_list").offset().top); + } else { + if ($("#"+tabId).offset().top - $("#tab_list").offset().top > $("#tab_list").innerHeight() - $(".tab_header").outerHeight()){ + $("#tab_list").scrollTop($("#tab_list").scrollTop() + $("#"+tabId).offset().top - $("#tab_list").offset().top - $("#tab_list").innerHeight() + $(".tab_header").outerHeight() + 4); + } + } + } +} + +function DetachTabs(tabsIds){ + chrome.windows.get(CurrentWindowId, {populate : true}, function(window){ + if (window.tabs.length == 1){ + return; + } + chrome.windows.create({state:window.state}, function(new_window){ + chrome.tabs.move(tabsIds[0], {windowId: new_window.id, index:-1}); + chrome.tabs.remove(new_window.tabs[0].id, null); + for (var i = 1; i < tabsIds.length; i++){ + chrome.tabs.move(tabsIds[i], {windowId: new_window.id, index:-1}); + } + }) + }); +} + +// find and select tabs +function FindTab(input){ + $(".filtered").removeClass("filtered").removeClass("selected"); + $(".highlighted_search").removeClass("highlighted_search"); + if (input.length == 0){ + $("#filter_box")[0].value = ""; + return; + } + SearchIndex = 0; + chrome.tabs.query({windowId: CurrentWindowId, pinned: false}, function(tabs){ + tabs.forEach(function(Tab){ + if (bg.opt_toolbar.filter_type == "url" && Tab.url.toLowerCase().match(input.toLowerCase())){ + $("#"+Tab.id).addClass("filtered").addClass("selected"); + } + if (bg.opt_toolbar.filter_type == "title" && Tab.title.toLowerCase().match(input.toLowerCase())){ + $("#"+Tab.id).addClass("filtered").addClass("selected"); + } + }); + }); +} + +function CloseTabs(tabsIds){ + tabsIds.forEach(function(tabId) { + if ($("#"+tabId).is(".pin") && bg.opt.allow_pin_close){ + $("#"+tabId).remove(); + chrome.tabs.update(tabId, {pinned: false}); + } + if ($("#"+tabId).is(".tab")){ + $("#"+tabId).remove(); + } + }); + setTimeout(function(){ + chrome.tabs.remove(tabsIds, null); + },100); +} + + +function DiscardTabs(tabsIds){ + var delay = 400; + if ($("#"+tabsIds[0]).is(".discarded")){ + delay = 5; + } else { + chrome.tabs.discard(tabsIds[0]); + } + tabsIds.splice(0, 1); + if (tabsIds.length > 0){ + setTimeout(function(){ + DiscardTabs(tabsIds); + },delay); + } +} + + +function ActivateNextTab(){ + if ($(".active").is(".pin")){ + if ($(".active").next()[0]){ + chrome.tabs.update(parseInt($(".active").next()[0].id), { active: true }); + } + } + + if ($(".active").is(".tab")){ + if ($(".active").children().last().children()[0]){ + chrome.tabs.update(parseInt($(".active").children().last().children()[0].id), { active: true }); + } else { + if ($(".active").next()[0]){ + chrome.tabs.update(parseInt($(".active").next()[0].id), { active: true }); + } else { + if ($(".active").parent().parent().next().is(".tab")){ + chrome.tabs.update(parseInt($(".active").parent().parent().next()[0].id), { active: true }); + } else { + if ($(".active").parents(".tab").eq(-2).next().is(".tab")){ + chrome.tabs.update(parseInt($(".active").parents(".tab").eq(-2).next()[0].id), { active: true }); + } + } + + + } + } + } +} + +function ActivatePrevTab(){ + if ($(".active").is(".pin")){ + if ($(".active").prev()[0]){ + chrome.tabs.update(parseInt($(".active").prev()[0].id), { active: true }); + } + } + + if ($(".active").is(".tab")){ + if ($(".active").prev().find(".tab").length > 0){ + chrome.tabs.update(parseInt($(".active").prev().find(".tab").last()[0].id), { active: true }); + } else { + if ($(".active").prev()[0]){ + chrome.tabs.update(parseInt($(".active").prev()[0].id), { active: true }); + } else { + if ($(".active").parent().is(".children")){ + chrome.tabs.update(parseInt($(".active").parent().parent()[0].id), { active: true }); + } + } + } + + } + +} + +function DropTargetsSendToFront(){ + if (DropTargetsInFront == false){ + $(".drop_target").show(); + DropTargetsInFront = true; + } +} +function DropTargetsSendToBack(){ + if (DropTargetsInFront){ + $(".drop_target").hide(); + DropTargetsInFront = false; + } +} \ No newline at end of file diff --git a/scripts/toolbar.js b/scripts/toolbar.js new file mode 100644 index 0000000..cee7551 --- /dev/null +++ b/scripts/toolbar.js @@ -0,0 +1,224 @@ +// ********** TOOLBAR *************** + +function SaveToolbarOptions(){ + chrome.runtime.sendMessage({command: "toolbar_options_save"}); +} + +function SetToolbarEvents(){ + // tools and search buttons toggle + $(document).on("mousedown", "#button_tools, #button_search", function(event){ + if (event.button != 0){ + return; + } + if ($(this).is(".on")){ + $("#button_tools, #button_search").removeClass("on"); + $("#toolbar_tools, #toolbar_search").addClass("hidden"); + bg.opt_toolbar.active_toolbar_tool = ""; + } else { + $(this).addClass("on"); + if ($(this).is("#button_tools")){ + $("#button_search").removeClass("on"); + $("#toolbar_search").addClass("hidden"); + $("#toolbar_tools").removeClass("hidden"); + bg.opt_toolbar.active_toolbar_tool = "tools"; + } else { + $("#button_tools").removeClass("on"); + $("#toolbar_tools").addClass("hidden"); + $("#toolbar_search").removeClass("hidden"); + bg.opt_toolbar.active_toolbar_tool = "search"; + } + } + RefreshGUI(); + SaveToolbarOptions(); + }); + + + // go to previous search result + $(document).on("mousedown", "#filter_search_go_prev", function(event){ + if (event.button != 0){ + return; + } + if (SearchIndex == 0){ + SearchIndex = $(".tab.filtered").length-1; + } else { + SearchIndex--; + } + $(".highlighted_search").removeClass("highlighted_search"); + $($(".tab.filtered")[SearchIndex]).addClass("highlighted_search"); + ScrollToTab($(".tab.filtered")[SearchIndex].id); + }); + + // go to next search result + $(document).on("mousedown", "#filter_search_go_next", function(event){ + if (event.button != 0){ + return; + } + if (SearchIndex == $(".tab.filtered").length-1){ + SearchIndex = 0; + } else { + SearchIndex++; + } + $(".highlighted_search").removeClass("highlighted_search"); + $($(".tab.filtered")[SearchIndex]).addClass("highlighted_search"); + ScrollToTab($(".tab.filtered")[SearchIndex].id); + }); + + + // new tab + $(document).on("mousedown", "#button_new", function(event){ + if (event.button == 0){ + chrome.tabs.create({}); + } + if (event.button == 1){ + chrome.tabs.query({windowId: CurrentWindowId, active: true}, function(tabs){ + chrome.tabs.duplicate(tabs[0].id, function(tab){ + setTimeout(function(){ + $("#"+tab.id).insertAfter($(".active")[0]); + }, 300); + }); + }); + } + if (event.button == 2){ + chrome.tabs.query({windowId: CurrentWindowId, active: true}, function(tabs){ + ScrollToTab(tabs[0].id); + }); + } + }); + // pin tab + $(document).on("mousedown", "#button_pin", function(event){ + if (event.button != 0){ + return; + } + $(".selected:visible").each(function(){ + chrome.tabs.update(parseInt(this.id), { pinned: ($(this).is(".pin") ? false : true) }); + }); + }); + // undo close + $(document).on("mousedown", "#button_undo", function(event){ + if (event.button != 0){ + return; + } + chrome.sessions.getRecentlyClosed( null, function(sessions){ + if (sessions.length > 0){ + chrome.sessions.restore(null, function(){}); + } + }); + }); + // move tab to new window (detach) + $(document).on("mousedown", "#button_move", function(event){ + if (event.button != 0){ + return; + } + var tabsArr = []; + $(".selected:visible").each(function(){ + tabsArr.push(parseInt(this.id)); + if ($("#ch"+this.id).children().length > 0){ + $($("#ch"+this.id).find(".tab")).each(function(){ + tabsArr.push(parseInt(this.id)); + }); + } + }); + DetachTabs(tabsArr); + }); + // move tab to new window (detach) + $(document).on("mousedown", "#repeat_search", function(event){ + if (event.button != 0){ + return; + } + FindTab($("#filter_box")[0].value); + }); + // filter on input + $("#filter_box").on("input", function(){ + if ($("#filter_box")[0].value == ""){ + $("#button_filter_clear").css({"opacity": "0"}).attr("title", ""); + } else { + $("#button_filter_clear").css({"opacity": "1"}); + $("#button_filter_clear").attr("title", bg.caption_clear_filter); + } + FindTab($("#filter_box")[0].value); + }); + // change filtering type + $(document).on("mousedown", "#button_filter_type", function(event){ + if (event.button != 0){ + return; + } + $("#button_filter_type").toggleClass("url").toggleClass("title"); + if (bg.opt_toolbar.filter_type == "url"){ + bg.opt_toolbar.filter_type = "title"; + } else { + bg.opt_toolbar.filter_type = "url"; + } + FindTab($("#filter_box")[0].value); + SaveToolbarOptions(); + }); + // clear filter button + $(document).on("mousedown", "#button_filter_clear", function(event){ + if (event.button != 0){ + return; + } + $("#button_filter_clear").css({"opacity": "0"}).attr("title", ""); + FindTab(""); + }); + // sort tabs + $(document).on("mousedown", "#button_sort", function(event){ + if (event.button != 0){ + return; + } + SortTabs(); + }); + // bookmarks + $(document).on("mousedown", "#button_bookmarks", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "chrome://bookmarks/"}); + }); + // downloads + $(document).on("mousedown", "#button_downloads", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "chrome://downloads/"}); + }); + // history + $(document).on("mousedown", "#button_history", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "chrome://history/"}); + }); + // extensions + $(document).on("mousedown", "#button_extensions", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "chrome://extensions"}); + }); + // settings + $(document).on("mousedown", "#button_settings", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "chrome://settings/"}); + }); + // vertical tabs options + $(document).on("mousedown", "#button_options", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.create({url: "options.html" }); + }); + // discard tabs + $(document).on("mousedown", "#button_discard", function(event){ + if (event.button != 0){ + return; + } + chrome.tabs.query({windowId: CurrentWindowId, pinned: false}, function(tabs){ + var tabsIds = []; + tabs.forEach(function(Tab){ + tabsIds.push(Tab.id); + }); + DiscardTabs(tabsIds); + }); + }); +} \ No newline at end of file diff --git a/sidebar.html b/sidebar.html new file mode 100644 index 0000000..08e60e2 --- /dev/null +++ b/sidebar.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + diff --git a/sidebar.js b/sidebar.js new file mode 100644 index 0000000..996a560 --- /dev/null +++ b/sidebar.js @@ -0,0 +1,144 @@ +document.addEventListener("DOMContentLoaded", Initialize(), false); + +function Initialize(){ + if (bg.hold){ + setTimeout(function(){ Initialize(); },500); + chrome.runtime.sendMessage({command: "background_start"}); + } else { + + var theme = { + "ToolbarShow": false, + "ScrollbarPinList": 4, + "ScrollbarTabList": 16 + }; + + if (localStorage.getItem("current_theme") != null && localStorage["theme"+localStorage["current_theme"]] != null){ + theme = JSON.parse(localStorage["theme"+localStorage["current_theme"]]); + + $("#toolbar").html(theme.toolbar); + + var css_variables = ""; + for (var css_variable in theme.ColorsSet){ + css_variables = css_variables + "--" + css_variable + ":" + theme.ColorsSet[css_variable] + ";"; + } + for (var css_variable in theme.TabsSizeSet){ + css_variables = css_variables + "--" + css_variable + ":" + theme.TabsSizeSet[css_variable] + ";"; + } + + document.styleSheets[0].insertRule("body { "+css_variables+" }", 0); + } + + if (navigator.userAgent.match("Firefox") === null){ + document.styleSheets[0].insertRule("::-webkit-scrollbar { width:"+theme.ScrollbarTabList+"px; height:"+theme.ScrollbarPinList+"px; }", 0); + } else { + // I have no idea what is going on in latest build, but why top position for various things is different in firefox????? + if (theme.TabsSizeSetNumber > 1){ + document.styleSheets[1].insertRule(".tab_header>.tab_title { margin-top: -1.5px; }", document.styleSheets[1].cssRules.length); + } + // document.styleSheets[1].insertRule("#toolbar_main { top: 1px; height: 25px; }", document.styleSheets[1].cssRules.length); + // document.styleSheets[1].insertRule(".button_img { position: relative; top: -1px; left: -1px; }", document.styleSheets[1].cssRules.length); + } + + chrome.tabs.query({currentWindow: true}, function(tabs){ + CurrentWindowId = tabs[0].windowId; + + + if (bg.opt.pin_list_multi_row){ + $("#pin_list").css({"white-space": "normal", "overflow-x": "hidden"}); + } + + + if (theme.ToolbarShow == true){ + if (bg.opt_toolbar.filter_type == "url"){ + $("#button_filter_type").addClass("url"); + } else { + $("#button_filter_type").addClass("title"); + } + $(".button").each(function(){ + $(this).attr("title", chrome.i18n.getMessage(this.id)); + }); + $("#filter_box").attr("placeholder", bg.caption_searchbox); + $("#filter_box").css({"opacity": 1}); + + $(".on").removeClass("on"); + $("#toolbar_tools, #toolbar_search").removeClass("hidden"); + + if (bg.opt_toolbar.active_toolbar_tool == ""){ + $("#toolbar_tools, #toolbar_search").addClass("hidden"); + } + if (bg.opt_toolbar.active_toolbar_tool == "tools" && $("#button_tools").length != 0){ + $("#toolbar_search").addClass("hidden"); + $("#button_tools").addClass("on"); + } + if (bg.opt_toolbar.active_toolbar_tool == "search" && $("#button_search").length != 0){ + $("#toolbar_tools").addClass("hidden"); + $("#button_search").addClass("on"); + } + $("#toolbar_separator").remove(); + $("#toolbar_unused_buttons").remove(); + } else { + $("#toolbar").children().remove(); + } + + + tabs.forEach(function(Tab){ + AppendTab({ + tab: Tab, + Append: true + }); + }); + + tabs.forEach(function(Tab){ + if (bg.tabs[Tab.id] && !Tab.pinned){ + $("#"+Tab.id).addClass(bg.tabs[Tab.id].o); + if ($("#"+bg.tabs[Tab.id].p).length > 0 && $("#"+bg.tabs[Tab.id].p).is(".tab") && $("#"+Tab.id).find( $("#ch"+bg.tabs[Tab.id].p)).length == 0){ + $("#ch"+bg.tabs[Tab.id].p).append($("#"+Tab.id)); + } + } + }); + + tabs.forEach(function(Tab){ + if ($("#"+Tab.id)[0] && $("#"+Tab.id).parent().children().eq(bg.tabs[Tab.id].n)[0]){ + if ($("#"+Tab.id).index() > bg.tabs[Tab.id].n){ + $("#"+Tab.id).insertBefore($("#"+Tab.id).parent().children().eq(bg.tabs[Tab.id].n)); + } else { + $("#"+Tab.id).insertAfter($("#"+Tab.id).parent().children().eq(bg.tabs[Tab.id].n)); + } + } + }); + tabs.forEach(function(Tab){ + if ($("#"+Tab.id)[0] && $("#"+Tab.id).parent().children().eq(bg.tabs[Tab.id].n)[0]){ + if ($("#"+Tab.id).index() < bg.tabs[Tab.id].n){ + $("#"+Tab.id).insertAfter($("#"+Tab.id).parent().children().eq(bg.tabs[Tab.id].n)); + } + } + }); + delete theme; + + SetIOEvents(); + SetToolbarEvents(); + SetTRefreshEvents(); + SetTabEvents(); + SetMenu(); + RefreshGUI(); + RefreshExpandStates(); + UpdateData(); + + // Scroll to active tab + setTimeout(function(){ ScrollToTab($(".active")[0].id); },100); + + + + if (navigator.userAgent.match("Vivaldi") !== null){ + VivaldiRefreshMediaIcons(); + } + + }); + } + +} + + +function log(m){ + bg.log(m); +} \ No newline at end of file diff --git a/theme/close.svg b/theme/close.svg new file mode 100644 index 0000000..b190883 --- /dev/null +++ b/theme/close.svg @@ -0,0 +1,68 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/empty.png b/theme/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..bbc51162028014d458be67b81abddc26d28f3557 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkNU+2; zq9n1jBqP6wAurwW(}8V3K|4F!$q5U@G-eb$(h~UZe%!z^iRVZE@rM5_yo!ey z{ + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/theme/loading.svg b/theme/loading.svg new file mode 100644 index 0000000..10ed4ea --- /dev/null +++ b/theme/loading.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/theme/media.gif b/theme/media.gif new file mode 100644 index 0000000000000000000000000000000000000000..9bd28f02b120a1dedf9a32aa714b1f55b3f8a4cc GIT binary patch literal 1614 zcmZ?wbhEHbV!Yr=_Jaz<}a^Za>$MU}whwS0gq%F%|o+Emi^PU`5j* zr{NO#FNNpByrio~XP)NuUhK(`*{ZQ{!kY!l7TgNuM74ySfdyy@C(sgal?{dtOsKLD zCx`-Nbz4|Om1LMT8alPFU9U~av_dlnqEZH^@?N9B!vhk*Zkt$lUK2>0qgI*FRhjB- z>xI>51r)dDx^B=A3S|)bsJm#_!r)y-$>FNl+(S4>&;wBt=&pYgIGvcbrt~qE$=_6M zi{tdWs^Q{_)lu?rN3Gszp;{U~!Es)Cs>Z@8cNZ*M6m=H69*~=WVdQ>{f$x-r(iVmc z!Km#Mud4FB$mHUij5T5jh823eN`O3JFwLQ(Ab}@Z^CQ#3ROXYlv8ApkF~I~(G@uw2 z1o}bLyO&XBhKu2G?wO(C;G}{jTpU%h8x1*%-+EfDKJdV~AVqX;#;SD?KcYJT9Eu-U zozw)mdlnvFI!#p|`g*OXM`9pKC^9iX(iFFb%SKyfhXpf~i`B5jA}CeC(u$DS&T9-d zDVfv2enGdFD33D$z0C&nIM7;0V+TX_)M^DrY}SfHA_|h2Ij8V7X8L8$%fKE*z(_?4 zo+aXG@i#kN+T02zQYTW0O_?mDHR95(n>IW!z#9HUr&K1OBbk74zy@+AX7Gd3B{wukJ@)*->O3K!^I*lD<2;}z z^iYyFtW-oRV!Yr=_IpvRW~yOR$O%$taLO~=hrt>E DUBM!= literal 0 HcmV?d00001 diff --git a/theme/theme.css b/theme/theme.css new file mode 100644 index 0000000..9640060 --- /dev/null +++ b/theme/theme.css @@ -0,0 +1,762 @@ +::-webkit-scrollbar-thumb { + background-color: var(--scrollbar_thumb, #cdcdcd); +} + +::-webkit-scrollbar-thumb:hover { + background-color: var(--scrollbar_thumb_hover, #a6a6a6); +} + +::-webkit-scrollbar-track { + background-color: var(--scrollbar_track, #e4e4e4); +} + +body { + background-color: var(--tab_list_background, #fafafa); +} +/* DO NOT REPEAT BACKGROUND IMAGES */ + +div { + background-repeat: no-repeat; +} + + +/* HIDE OVERFLOW */ + +#toolbar, +#toolbar_search, +#toolbar_tools, +#tabs_menu { + overflow: hidden; +} + + +/* AUTO SIZE */ + +#tab_list, +#pin_list { + width: auto; + height: auto; +} + + +/* WIDTH: 100% */ + +#toolbar, +#toolbar_main, +#toolbar_search, +#toolbar_tools { + width: 100%; +} + + +/* POSITION: RELATIVE */ + +#toolbar, +#toolbar_separator, +#filter_box, +#button_filter_clear, +.button, +#pin_list, +#tab_list, +.pin, +.tab { + position: relative; +} + + +/* POSITION: ABSOLUTE */ + +.tab_mediaicon, +#tabs_menu, +.toolbar_int { + position: absolute; +} + + +/* PLACEMENT HORIZONTAL */ + +#toolbar_search_input_box, +#toolbar_search_buttons, +#filter_box, +#button_filter_clear, +.button, +.tab_mediaicon, +.pin { + display: inline-block; + vertical-align: top; +} + + +/* PLACEMENT VERTICAL */ + +#toolbar, +#pin_list, +#tab_list, +.tab { + display: vinline-block; +} + + +/* HIDE */ + +.hidden { + position: absolute; + top: -1000px; + left: -1000px; + width: 0px; + height: 0px; + border: none; + margin: 0px; + overflow: hidden; + margin: 0px; +} + +#pin_list.hidden { + margin-bottom: -2px; +} + + +/* TOOLBAR */ + +.toolbar { + padding-top: 1px; + background-color: var(--toolbar_background, #f2f2f2); +} + +.toolbar_int { + border-bottom: 1px solid var(--toolbar_border_bottom, #cccccc); +} + +#toolbar_main { + top: 0px; + height: 26px; +} + +#toolbar_search, +#toolbar_tools { + top: 27px; + height: 26px; +} + +#toolbar_separator { + top: 54px; + height: 15px; + width: 100%; + background-color: white; +} + +#toolbar_unused_buttons { + top: 69px; + height: 26px; + width: 100%; + background-color: #b8ffbf; +} + +.button { + z-index: 100; + width: 22px; + height: 22px; + bottom: -1px; + left: 1px; + margin-right: 1px; +} + +.button:not(.on) { + background-color: var(--button_background, #f2f2f2); + border: 1px solid var(--button_border, #f2f2f2); +} + +.button:hover:not(.on) { + background-color: var(--button_hover_background, #dcdcdc); + border: 1px solid var(--button_hover_border, #bebebe); +} + +.button.on { + height: 24px; + background-color: var(--toolbar_background, #f2f2f2); + border: 1px solid var(--toolbar_border_bottom, #cccccc); + border-bottom: 1px solid var(--toolbar_background, #f2f2f2); +} + +.button_img { + width: 22px; + height: 22px; + background-size: 22px 22px; + background-position: 0px 0px; + background-color: var(--button_icons, #808080); +} + + +/* TOOLBAR BUTTONS */ + +#button_bookmarks>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_bookmarks.svg); + mask-image: url(../theme/toolbar_bookmarks.svg); +} + +#button_options>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_options.svg); + mask-image: url(../theme/toolbar_options.svg); +} + +#button_settings>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_settings.svg); + mask-image: url(../theme/toolbar_settings.svg); +} + +#button_move .button_img { + -webkit-mask-box-image: url(../theme/toolbar_move.svg); + mask-image: url(../theme/toolbar_move.svg); +} + +#button_pin>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_pin.svg); + mask-image: url(../theme/toolbar_pin.svg); +} + +#button_history>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_history.svg); + mask-image: url(../theme/toolbar_history.svg); +} + +#button_undo>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_undo.svg); + mask-image: url(../theme/toolbar_undo.svg); +} + +#button_downloads>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_downloads.svg); + mask-image: url(../theme/toolbar_downloads.svg); +} + +#button_extensions>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_extensions.svg); + mask-image: url(../theme/toolbar_extensions.svg); +} + +#button_discard>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_discard.svg); + mask-image: url(../theme/toolbar_discard.svg); +} + +#button_new>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_new.svg); + mask-image: url(../theme/toolbar_new.svg); +} + +#button_tools>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_tools.svg); + mask-image: url(../theme/toolbar_tools.svg); +} + +#button_search>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_search.svg); + mask-image: url(../theme/toolbar_search.svg); +} + + +/* TOOLBAR SEARCHBOX */ + +#button_filter_type.url>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_filter_url.svg); + mask-image: url(../theme/toolbar_filter_url.svg); +} + +#button_filter_type.title>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_filter_title.svg); + mask-image: url(../theme/toolbar_filter_title.svg); +} + +#filter_search_go_prev, +#filter_search_go_next { + width: 16px; +} + +#filter_search_go_prev>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_filter_search_go_prev.svg); + mask-image: url(../theme/toolbar_filter_search_go_prev.svg); + width: 16px; + background-size: 16px 22px; +} + +#filter_search_go_next>.button_img { + -webkit-mask-box-image: url(../theme/toolbar_filter_search_go_next.svg); + mask-image: url(../theme/toolbar_filter_search_go_next.svg); + width: 16px; + background-size: 16px 22px; +} + +#toolbar_search_input_box { + position: relative; + top: 0px; + left: 2px; + height: 25px; + width: calc(100% - 67px); + overflow: hidden; +} + +#filter_box { + top: 2px; + padding-left: 6px; + width: calc(100% - 10px); + height: 18px; + background-color: var(--filter_box_background, #fafafa); + border: solid 1px var(--filter_box_border, #cccccc); + color: var(--filter_box_font, #808080); +} + +#filter_box:focus { + outline: none; +} + +#button_filter_clear { + -webkit-mask-box-image: url(../theme/toolbar_filter_clear.svg); + mask-image: url(../theme/toolbar_filter_clear.svg); + top: 6px; + right: 17px; + width: 16px; + height: 16px; + background-color: var(--filter_clear_icon, #808080); +} + +#toolbar_search_buttons { + position: relative; + left: 2px; + height: 24px; + width: 30px; +} + + +/* LISTS */ + +#pin_list { + height: auto; + overflow-x: auto; + overflow-y: hidden; + padding-right: 2px; + padding-bottom: 1px; + background-color: var(--pin_list_background, #fafafa); + border-bottom: 1px solid var(--pin_list_border_bottom, #cccccc); +} + +#tab_list { + overflow-x: hidden; + overflow-y: auto; + z-index: 100; + background-color: var(--tab_list_background, #fafafa); +} + + +/* PINS AND TABS */ + +.tab_header { + border: 1px solid var(--tab_border, #bebebe); + background-color: var(--tab_background, #f2f2f2); +} + +.tab_header.tab_header_hover { + border: 1px solid var(--tab_hover_border, #878787); + background-color: var(--tab_hover_background, #d7d7d7); +} + +.selected>.tab_header { + border: 1px solid var(--tab_selected_border, #70c0e7); + background-color: var(--tab_selected_background, #e5f3fb); +} + +.selected>.tab_header.tab_header_hover { + border: 1px solid var(--tab_selected_hover_border, #78aee5); + background-color: var(--tab_selected_hover_background, #d0e2f0); +} + + +/* TABS */ + +.tab_header>.tab_title { + z-index: 5; + font-family: Arial, Helvetica, "Nimbus Sans L", "Liberation Sans", FreeSans, Sans-serif; + white-space: nowrap; + text-overflow: ellipsis; + width: auto; + overflow: hidden; + padding-right: 3px; + padding-left: var(--title_padding_left, 25px); + color: var(--tab_title, #000000); + font-size: var(--title_font_size, 12px); +} + +.tab.active>.tab_header>.tab_title { + font-weight: var(--active_font_weight, bold); + color: var(--tab_title_active, #000000); +} + +.tab.discarded>.tab_header>.tab_title { + color: var(--tab_title_discarded, #7e7e7e); +} + +.tab.filtered>.tab_header { + background-color: var(--tab_filtered, #e8e000); +} + +.tab.selected.filtered>.tab_header { + background-color: var(--tab_filtered_selected, #0f8079); +} + +.tab.selected.active.filtered>.tab_header { + background-color: var(--tab_filtered_selected_active, #1299a9); +} + +.tab.filtered.highlighted_search>.tab_header { + background-color: var(--tab_filtered_highlighted, #ffa500); +} + +.tab { + position: relative; + display: vinline-block; + left: 0px; + height: auto; + width: auto; + border-top: 1px solid transparent; +} + +.tab>.tab_header { + /* tab size is here, all the rest is automatically calculated, adjust line-height to fix title vertical position */ + z-index: 10; + position: relative; + top: 0px; + left: 13px; + height: var(--tab_height, 19px); + line-height: var(--tab_height_line, 22px); + width: calc(100% - 16px); + background-image: url(../theme/empty.svg); + background-size: var(--favicon_size, 16px 16px); + background-position: var(--favicon_pos, 4px center); +} + + +.drop_target { + display: none; + position: absolute; +} + +.tab>.drop_target { + left: 13px; + width: calc(100% - 14px); +} + +.tab>.drag_enter_center { + z-index: 11; + top: -1px; + height: calc(var(--tab_height, 21px) + 2px); + border: 1px solid transparent; +} + +.tab>.drag_enter_center.highlighted_drop_target { + border: 1px solid var(--drag_indicator, #339bf3); +} + +.tab>.drag_entered_top { + z-index: 15; + top: -1px; + height: var(--drag_area_top, 7px); + border-top: 1px solid transparent; +} +.tab>.drag_entered_top.highlighted_drop_target { + border-top: 1px solid var(--drag_indicator, #339bf3); +} + +.tab>.drag_entered_bottom { + z-index: 20; + bottom: -1px; + height: var(--drag_area_bottom, 5px); + border-bottom: 1px solid transparent; +} +.tab>.drag_entered_bottom.highlighted_drop_target { + bottom: -1px; + border-bottom: 1px solid var(--drag_indicator, #339bf3); +} + +.children>.tab:last-child>.drag_entered_bottom { + z-index: 19; + bottom: 3px; + border-bottom: 1px solid transparent; +} +.children>.tab:last-child>.drag_entered_bottom.highlighted_drop_target { + bottom: -1px; + height: calc(var(--drag_area_bottom, 9px) + 4px); + border-bottom: 1px solid var(--drag_indicator, #339bf3); +} + +/* #tab_list>.tab:first-child { + margin-top: 4px; +} */ +#tab_list>.tab:last-child { + margin-bottom: 12px; +} + + +/* TABS CHILDREN */ + +.children>.tab>.tab_header { + left: 13px; +} + +.children { + position: relative; + padding-left: 6px; +} + +.o>.children { + height: auto; +} + +.c>.children { + display: none; + height: 0px; +} + +.expand { + z-index: 200; + position: absolute; + top: 1px; + left: 0px; + height: 100%; + width: 16px; +} + +.exp_box { + position: absolute; + top: var(--expand_box_top, 6px); + left: var(--expand_box_left, 3px); + height: var(--expand_box_size, 5px); + width: var(--expand_box_size, 5px); +} + +.c>.expand>.exp_box { + border: 1px solid var(--expand_closed_border, #969696); + background-color: var(--expand_closed_background, #eaeaea); +} + +.o>.expand>.exp_box { + border: 1px solid var(--expand_open_border, #339bf3); + background-color: var(--expand_open_background, #d0e2f0); +} + +.children>.o>.expand>.exp_line_h, +.children>.c>.expand>.exp_line_h { + position: absolute; + top: var(--expand_line_h_top, 9px); + left: 1px; + height: 1px; + width: var(--expand_line_h_oc_width, 3px); + border-top: 1px solid var(--expand_lines, #cccccc); +} + +.children>.tab:not(.o):not(.c)>.expand>.exp_line_h { + position: absolute; + top: var(--expand_line_h_top, 9px); + left: 1px; + height: 1px; + width: var(--expand_line_h_width, 12px); + border-top: 1px solid var(--expand_lines, #cccccc); +} + +.children>.tab:not(:last-child)>.expand>.exp_line_v { + position: absolute; + top: var(--expand_line_v_top, -9px); + left: var(--expand_line_v_left, 0px); + height: calc(100% + 1px); + width: 1px; + border-left: 1px solid var(--expand_lines, #cccccc); +} + +.children>.tab:last-child>.expand>.exp_line_v { + position: absolute; + top: var(--expand_line_v_top, -9px); + left: var(--expand_line_v_left, 0px); + height: var(--expand_line_v_last_height, 19px); + width: 1px; + border-left: 1px solid var(--expand_lines, #cccccc); +} + + +/* PINS */ + +.pin { + /* pin size is here, all the rest is automatically calculated */ + top: 1px; + left: 1px; + height: var(--pin_height, 24px); + width: var(--pin_width, 26px); + /* border: 1px solid red; */ +} + +.pin>.tab_header>.tab_title, +.pin>.expand { + display: none; +} + +.pin>.tab_header { + background-image: url(../theme/empty.svg); + background-size: var(--favicon_size, 16px 16px); + background-position: center; + height: calc(100% - 3px); + width: calc(100% - 3px); +} + +.pin>.drag_entered_top { + z-index: 20; + position: absolute; + top: 1px; + left: -1px; + height: calc(100% - 4px); + width: 50%; + border-left: 1px solid transparent; +} + +.pin>.drag_entered_top.highlighted_drop_target { + border-left: 1px solid var(--drag_indicator, #339bf3); +} + +.pin>.drag_entered_bottom { + z-index: 21; + position: absolute; + top: 1px; + left: calc(50% - 2px); + height: calc(100% - 4px); + width: 50%; + border-left: 1px solid transparent; +} + +.pin>.drag_entered_bottom.highlighted_drop_target { + border-right: 1px solid var(--drag_indicator, #339bf3); +} + +.pin>.drag_enter_center { + z-index: 2; + position: absolute; + top: 0px; + height: 0px; + width: 0px; + /* border: 1px solid yellow; */ +} + + +/* MEDIA */ + +.tab_mediaicon { + z-index: 999; + bottom: 0px; + left: 2px; + height: 0px; + width: 0px; + background-size: 0px 0px; +} + +.audible>.tab_header>.tab_mediaicon { + height: 10px; + width: 10px; + background-image: url(../theme/media.gif); + background-size: 10px 10px; +} + +.muted>.tab_header>.tab_mediaicon { + height: 10px; + width: 10px; + background-image: url(../theme/media_muted.gif); + background-size: 10px 10px; +} + + +/* LOADING FAVICON */ + +.loading>.tab_header { + background-image: url(../theme/loading.svg); +} + + +/* CLOSE BUTTON */ + +.close { + border: 1px solid transparent; + z-index: 998; + display: none; + position: absolute; + top: var(--close_top, 2px); + right: var(--close_right, 2px); + height: var(--close_size, 13px); + width: var(--close_size, 13px); + background-size: var(--close_size, 13px) var(--close_size, 13px); +} + +.close_img { + z-index: -999; + position: absolute; + top: 0px; + left: 0px; + height: 100%; + width: 100%; + background-color: var(--close_x, #7d7d7d); + -webkit-mask-box-image: url(../theme/close.svg); + mask-image: url(../theme/close.svg); + mask-size: 100%; + mask-position: center, center; +} + +.close_show>.tab_title { + padding-right: var(--title_padding_with_close, 24px); +} + +.close_show>.close { + display: inline-block; +} + +.close_show>.close_hover>.close_img { + top: 0px; + background-color: var(--close_hover_x, #fbfcfe); +} + +.close_show>.close_hover { + border: 1px solid var(--close_hover_border, #757676); + background-color: var(--close_hover_background, #939394); +} + +.pin>.tab_header>.close { + display: none; + z-index: -999; +} + + +/* MENU */ + +#tabs_menu { + display: none; + word-wrap: normal; + white-space: initial; + z-index: 1000; + font-family: Arial, Helvetica, "Nimbus Sans L", "Liberation Sans", FreeSans, Sans-serif; + font-size: 12px; + border: 1px solid var(--tabs_menu_border, #bebebe); + padding: 0; + background: var(--tabs_menu_background, #fafafa); + color: var(--tabs_menu_font, #333333); +} + +#tabs_menu li { + padding: 3px 8px; + cursor: pointer; + list-style-type: none; +} + +#tabs_menu li:hover { + padding: 2px 7px; + border: 1px solid var(--tabs_menu_hover_border, #bebebe); + background-color: var(--tabs_menu_hover_background, #efefef); +} + +#tabs_menu .separator { + height: 1px; + width: 80%; + background-color: var(--tabs_menu_separator, #efefef); + margin: 0 auto; +} \ No newline at end of file diff --git a/theme/toolbar_bookmarks.svg b/theme/toolbar_bookmarks.svg new file mode 100644 index 0000000..03fe53f --- /dev/null +++ b/theme/toolbar_bookmarks.svg @@ -0,0 +1,90 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/theme/toolbar_discard.svg b/theme/toolbar_discard.svg new file mode 100644 index 0000000..e1c7f3e --- /dev/null +++ b/theme/toolbar_discard.svg @@ -0,0 +1,69 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/toolbar_downloads.svg b/theme/toolbar_downloads.svg new file mode 100644 index 0000000..f5e569e --- /dev/null +++ b/theme/toolbar_downloads.svg @@ -0,0 +1,109 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/theme/toolbar_extensions.svg b/theme/toolbar_extensions.svg new file mode 100644 index 0000000..c3742fa --- /dev/null +++ b/theme/toolbar_extensions.svg @@ -0,0 +1,71 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/toolbar_filter_clear.svg b/theme/toolbar_filter_clear.svg new file mode 100644 index 0000000..993b364 --- /dev/null +++ b/theme/toolbar_filter_clear.svg @@ -0,0 +1,63 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/toolbar_filter_search_go_next.svg b/theme/toolbar_filter_search_go_next.svg new file mode 100644 index 0000000..4f0db4a --- /dev/null +++ b/theme/toolbar_filter_search_go_next.svg @@ -0,0 +1,73 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/theme/toolbar_filter_search_go_prev.svg b/theme/toolbar_filter_search_go_prev.svg new file mode 100644 index 0000000..2f96345 --- /dev/null +++ b/theme/toolbar_filter_search_go_prev.svg @@ -0,0 +1,73 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/theme/toolbar_filter_title.svg b/theme/toolbar_filter_title.svg new file mode 100644 index 0000000..d18664e --- /dev/null +++ b/theme/toolbar_filter_title.svg @@ -0,0 +1,79 @@ + + + + + + + + image/svg+xml + + + + + + + + + title + diff --git a/theme/toolbar_filter_url.svg b/theme/toolbar_filter_url.svg new file mode 100644 index 0000000..4297f1d --- /dev/null +++ b/theme/toolbar_filter_url.svg @@ -0,0 +1,79 @@ + + + + + + + + image/svg+xml + + + + + + + + + url + diff --git a/theme/toolbar_history.svg b/theme/toolbar_history.svg new file mode 100644 index 0000000..ef8c137 --- /dev/null +++ b/theme/toolbar_history.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/theme/toolbar_move.svg b/theme/toolbar_move.svg new file mode 100644 index 0000000..45482e8 --- /dev/null +++ b/theme/toolbar_move.svg @@ -0,0 +1,77 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/theme/toolbar_new.svg b/theme/toolbar_new.svg new file mode 100644 index 0000000..f2d41da --- /dev/null +++ b/theme/toolbar_new.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/theme/toolbar_options.svg b/theme/toolbar_options.svg new file mode 100644 index 0000000..a819c30 --- /dev/null +++ b/theme/toolbar_options.svg @@ -0,0 +1,86 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/theme/toolbar_pin.svg b/theme/toolbar_pin.svg new file mode 100644 index 0000000..e01e632 --- /dev/null +++ b/theme/toolbar_pin.svg @@ -0,0 +1,71 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/toolbar_search.svg b/theme/toolbar_search.svg new file mode 100644 index 0000000..2afb604 --- /dev/null +++ b/theme/toolbar_search.svg @@ -0,0 +1,72 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/theme/toolbar_settings.svg b/theme/toolbar_settings.svg new file mode 100644 index 0000000..b182e07 --- /dev/null +++ b/theme/toolbar_settings.svg @@ -0,0 +1,70 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/theme/toolbar_tools.svg b/theme/toolbar_tools.svg new file mode 100644 index 0000000..46e8dc0 --- /dev/null +++ b/theme/toolbar_tools.svg @@ -0,0 +1,73 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/theme/toolbar_undo.svg b/theme/toolbar_undo.svg new file mode 100644 index 0000000..13c0e28 --- /dev/null +++ b/theme/toolbar_undo.svg @@ -0,0 +1,68 @@ + + + + + + + + image/svg+xml + + + + + + + + +