1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-07 08:34:06 +02:00

Reorganize resources folder

This commit is contained in:
chylex 2021-12-22 08:28:51 +01:00
parent 86136d7692
commit e854315a81
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
71 changed files with 208 additions and 187 deletions
Browser
Resources
Content
.all.js
introduction
load.js
login
tweetdeck
add_tweetduck_to_settings_menu.jsbypass_t.co_links.jsclear_search_input.jsconfigure_first_day_of_week.jsconfigure_language_for_translations.jsdisable_clipboard_formatting.jsdisable_td_metrics.jsdrag_links_onto_columns.jsexpand_links_or_show_tooltip.jsfix_dm_input_box_focus.jsfix_horizontal_scrolling_of_column_container.jsfix_marking_dm_as_read_when_replying.jsfix_media_preview_urls.jsfix_missing_bing_translator_languages.jsfix_os_name.jsfix_scheduled_tweets_not_appearing.jsfix_youtube_previews.jsfocus_composer_after_alt_tab.jsfocus_composer_after_image_upload.jsfocus_composer_after_switching_account.js
globals
handle_extra_mouse_buttons.jshook_theme_settings.jsinject_css.jskeep_like_follow_dialogs_open.jslimit_loaded_dm_count.jsmake_retweets_lowercase.jsmiddle_click_tweet_icon_actions.jsmove_accounts_above_hashtags_in_search.jsoffline_notification.jsopen_search_externally.jsopen_search_in_first_column.jspaste_images_from_clipboard.jsperform_search.jspin_composer_icon.jsready_plugins.jsregister_composer_active_event.jsregister_global_functions.jsrestore_cleared_column.jsscreenshot_tweet.jssetup_column_type_attributes.jssetup_desktop_notifications.jssetup_link_context_menu.jssetup_sound_notifications.jssetup_tweet_context_menu.jssetup_tweetduck_account_bamboozle.jssetup_video_player.jsskip_pre_login_page.jstweetdeck.css
update
Scripts
TweetDuck.csproj

View File

@ -1,5 +1,5 @@
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using CefSharp;
using TweetDuck.Utils;
using TweetLib.Core.Browser;
@ -40,18 +40,33 @@ public static bool RunFile(IFrame frame, string file) {
return script != null;
}
public static void RunBootstrap(IFrame frame, string moduleNamespace, string stylesheetName) {
public static void RunBootstrap(IFrame frame, string moduleNamespace) {
string script = Program.Resources.Load("bootstrap.js");
if (script == null) {
return;
}
string path = Path.Combine(Program.ResourcesPath, moduleNamespace);
string[] moduleNames = new DirectoryInfo(path).GetFiles().Select(o => Path.GetFileNameWithoutExtension(o.Name)).ToArray();
var files = new DirectoryInfo(path).GetFiles();
script = script.Replace("{namespace}", moduleNamespace);
script = script.Replace("{modules}", string.Join("|", moduleNames));
script = script.Replace("{stylesheet}", stylesheetName);
var moduleNames = new List<string>();
var stylesheetNames = new List<string>();
foreach (var file in files) {
var ext = Path.GetExtension(file.Name);
var targetList = ext switch {
".js" => moduleNames,
".css" => stylesheetNames,
_ => null
};
targetList?.Add(Path.GetFileNameWithoutExtension(file.Name));
}
script = script.Replace("{{namespace}}", moduleNamespace);
script = script.Replace("{{modules}}", string.Join("|", moduleNames));
script = script.Replace("{{stylesheets}}", string.Join("|", stylesheetNames));
RunScript(frame, script, "bootstrap");
}

View File

@ -24,7 +24,7 @@ sealed class TweetDeckBrowser : IDisposable {
private static UserConfig Config => Program.Config.User;
private const string ErrorUrl = "http://td/error";
private const string NamespaceFeatures = "features";
private const string NamespaceTweetDeck = "tweetdeck";
public bool Ready { get; private set; }
@ -149,7 +149,7 @@ private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) {
if (frame.IsMain) {
if (TwitterUrls.IsTweetDeck(url)) {
UpdateProperties();
CefScriptExecutor.RunBootstrap(frame, NamespaceFeatures, "tweetdeck.css");
CefScriptExecutor.RunBootstrap(frame, NamespaceTweetDeck);
TweetDeckBridge.ResetStaticProperties();
@ -158,14 +158,14 @@ private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e) {
}
if (Config.FirstRun) {
CefScriptExecutor.RunBootstrap(frame, "introduction", "introduction.css");
CefScriptExecutor.RunBootstrap(frame, "introduction");
}
}
else if (TwitterUrls.IsTwitter(url)) {
CefScriptExecutor.RunBootstrap(frame, "login", "login.css");
CefScriptExecutor.RunBootstrap(frame, "login");
}
CefScriptExecutor.RunBootstrap(frame, "update", "update.css");
CefScriptExecutor.RunBootstrap(frame, "update");
}
if (url == ErrorUrl) {
@ -232,7 +232,7 @@ public void ReloadToTweetDeck() {
}
public void OnModulesLoaded(string moduleNamespace) {
if (moduleNamespace == NamespaceFeatures) {
if (moduleNamespace == NamespaceTweetDeck) {
ReinjectCustomCSS(Config.CustomBrowserCSS);
Config_SoundNotificationInfoChanged(null, EventArgs.Empty);
}

View File

@ -4,56 +4,56 @@
* Imports all root modules and global functions to mark them as used.
*/
import add_tweetduck_to_settings_menu from "./features/add_tweetduck_to_settings_menu.js";
import bypass_tco_links from "./features/bypass_t.co_links.js";
import clear_search_input from "./features/clear_search_input.js";
import configure_first_day_of_week from "./features/configure_first_day_of_week.js";
import configure_language_for_translations from "./features/configure_language_for_translations.js";
import disable_clipboard_formatting from "./features/disable_clipboard_formatting.js";
import disable_td_metrics from "./features/disable_td_metrics.js";
import drag_links_onto_columns from "./features/drag_links_onto_columns.js";
import expand_links_or_show_tooltip from "./features/expand_links_or_show_tooltip.js";
import fix_dm_input_box_focus from "./features/fix_dm_input_box_focus.js";
import fix_horizontal_scrolling_of_column_container from "./features/fix_horizontal_scrolling_of_column_container.js";
import fix_marking_dm_as_read_when_replying from "./features/fix_marking_dm_as_read_when_replying.js";
import fix_media_preview_urls from "./features/fix_media_preview_urls.js";
import fix_missing_bing_translator_languages from "./features/fix_missing_bing_translator_languages.js";
import fix_os_name from "./features/fix_os_name.js";
import fix_scheduled_tweets_not_appearing from "./features/fix_scheduled_tweets_not_appearing.js";
import fix_youtube_previews from "./features/fix_youtube_previews.js";
import focus_composer_after_alt_tab from "./features/focus_composer_after_alt_tab.js";
import focus_composer_after_image_upload from "./features/focus_composer_after_image_upload.js";
import focus_composer_after_switching_account from "./features/focus_composer_after_switching_account.js";
import handle_extra_mouse_buttons from "./features/handle_extra_mouse_buttons.js";
import hook_theme_settings from "./features/hook_theme_settings.js";
import inject_css from "./features/inject_css.js";
import keep_like_follow_dialogs_open from "./features/keep_like_follow_dialogs_open.js";
import limit_loaded_dm_count from "./features/limit_loaded_dm_count.js";
import make_retweets_lowercase from "./features/make_retweets_lowercase.js";
import middle_click_tweet_icon_actions from "./features/middle_click_tweet_icon_actions.js";
import move_accounts_above_hashtags_in_search from "./features/move_accounts_above_hashtags_in_search.js";
import offline_notification from "./features/offline_notification.js";
import open_search_externally from "./features/open_search_externally.js";
import open_search_in_first_column from "./features/open_search_in_first_column.js";
import paste_images_from_clipboard from "./features/paste_images_from_clipboard.js";
import perform_search from "./features/perform_search.js";
import pin_composer_icon from "./features/pin_composer_icon.js";
import ready_plugins from "./features/ready_plugins.js";
import register_composer_active_event from "./features/register_composer_active_event.js";
import register_global_functions from "./features/register_global_functions.js";
import restore_cleared_column from "./features/restore_cleared_column.js";
import screenshot_tweet from "./features/screenshot_tweet.js";
import setup_column_type_attributes from "./features/setup_column_type_attributes.js";
import setup_desktop_notifications from "./features/setup_desktop_notifications.js";
import setup_link_context_menu from "./features/setup_link_context_menu.js";
import setup_sound_notifications from "./features/setup_sound_notifications.js";
import setup_tweet_context_menu from "./features/setup_tweet_context_menu.js";
import setup_tweetduck_account_bamboozle from "./features/setup_tweetduck_account_bamboozle.js";
import setup_video_player from "./features/setup_video_player.js";
import skip_pre_login_page from "./features/skip_pre_login_page.js";
import show_introduction from "./introduction/show_introduction.js";
import introduction from "./introduction/introduction.js";
import hide_cookie_bar from "./login/hide_cookie_bar.js";
import check_updates from "./update/check_updates.js";
import add_tweetduck_to_settings_menu from "./tweetdeck/add_tweetduck_to_settings_menu.js";
import bypass_tco_links from "./tweetdeck/bypass_t.co_links.js";
import clear_search_input from "./tweetdeck/clear_search_input.js";
import configure_first_day_of_week from "./tweetdeck/configure_first_day_of_week.js";
import configure_language_for_translations from "./tweetdeck/configure_language_for_translations.js";
import disable_clipboard_formatting from "./tweetdeck/disable_clipboard_formatting.js";
import disable_td_metrics from "./tweetdeck/disable_td_metrics.js";
import drag_links_onto_columns from "./tweetdeck/drag_links_onto_columns.js";
import expand_links_or_show_tooltip from "./tweetdeck/expand_links_or_show_tooltip.js";
import fix_dm_input_box_focus from "./tweetdeck/fix_dm_input_box_focus.js";
import fix_horizontal_scrolling_of_column_container from "./tweetdeck/fix_horizontal_scrolling_of_column_container.js";
import fix_marking_dm_as_read_when_replying from "./tweetdeck/fix_marking_dm_as_read_when_replying.js";
import fix_media_preview_urls from "./tweetdeck/fix_media_preview_urls.js";
import fix_missing_bing_translator_languages from "./tweetdeck/fix_missing_bing_translator_languages.js";
import fix_os_name from "./tweetdeck/fix_os_name.js";
import fix_scheduled_tweets_not_appearing from "./tweetdeck/fix_scheduled_tweets_not_appearing.js";
import fix_youtube_previews from "./tweetdeck/fix_youtube_previews.js";
import focus_composer_after_alt_tab from "./tweetdeck/focus_composer_after_alt_tab.js";
import focus_composer_after_image_upload from "./tweetdeck/focus_composer_after_image_upload.js";
import focus_composer_after_switching_account from "./tweetdeck/focus_composer_after_switching_account.js";
import handle_extra_mouse_buttons from "./tweetdeck/handle_extra_mouse_buttons.js";
import hook_theme_settings from "./tweetdeck/hook_theme_settings.js";
import inject_css from "./tweetdeck/inject_css.js";
import keep_like_follow_dialogs_open from "./tweetdeck/keep_like_follow_dialogs_open.js";
import limit_loaded_dm_count from "./tweetdeck/limit_loaded_dm_count.js";
import make_retweets_lowercase from "./tweetdeck/make_retweets_lowercase.js";
import middle_click_tweet_icon_actions from "./tweetdeck/middle_click_tweet_icon_actions.js";
import move_accounts_above_hashtags_in_search from "./tweetdeck/move_accounts_above_hashtags_in_search.js";
import offline_notification from "./tweetdeck/offline_notification.js";
import open_search_externally from "./tweetdeck/open_search_externally.js";
import open_search_in_first_column from "./tweetdeck/open_search_in_first_column.js";
import paste_images_from_clipboard from "./tweetdeck/paste_images_from_clipboard.js";
import perform_search from "./tweetdeck/perform_search.js";
import pin_composer_icon from "./tweetdeck/pin_composer_icon.js";
import ready_plugins from "./tweetdeck/ready_plugins.js";
import register_composer_active_event from "./tweetdeck/register_composer_active_event.js";
import register_global_functions from "./tweetdeck/register_global_functions.js";
import restore_cleared_column from "./tweetdeck/restore_cleared_column.js";
import screenshot_tweet from "./tweetdeck/screenshot_tweet.js";
import setup_column_type_attributes from "./tweetdeck/setup_column_type_attributes.js";
import setup_desktop_notifications from "./tweetdeck/setup_desktop_notifications.js";
import setup_link_context_menu from "./tweetdeck/setup_link_context_menu.js";
import setup_sound_notifications from "./tweetdeck/setup_sound_notifications.js";
import setup_tweet_context_menu from "./tweetdeck/setup_tweet_context_menu.js";
import setup_tweetduck_account_bamboozle from "./tweetdeck/setup_tweetduck_account_bamboozle.js";
import setup_video_player from "./tweetdeck/setup_video_player.js";
import skip_pre_login_page from "./tweetdeck/skip_pre_login_page.js";
import update from "./update/update.js";
const globalFunctions = [
window.TDGF_applyROT13,

View File

@ -62,7 +62,7 @@ export default function() {
dialog.fadeOut(200, function() {
$TD.onIntroductionClosed(showGuide);
document.getElementById("tweetduck-styles-introduction").remove();
document.getElementById("tweetduck-styles-introduction-introduction").remove();
dialog.remove();
});
});

View File

@ -27,8 +27,8 @@
const modules = script.getAttribute("data-modules").split("|");
let successes = 0;
for (const feature of modules) {
if (await loadModule(`./${namespace}/${feature}.js`)) {
for (const module of modules) {
if (await loadModule(`./${namespace}/${module}.js`)) {
++successes;
}
}

View File

@ -1,7 +1,7 @@
import { $TD } from "../api/bridge.js";
import { TD } from "../api/td.js";
import { checkPropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* @property {string[]} eventNames

View File

@ -1,7 +1,7 @@
import { $TDX } from "../api/bridge.js";
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Sets language for automatic translations.

View File

@ -1,7 +1,7 @@
import { $TDX } from "../api/bridge.js";
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { runAfterFunction } from "../globals/patch_functions.js";
import { runAfterFunction } from "./globals/patch_functions.js";
function focusDmInput() {
document.querySelector(".js-reply-tweetbox").focus();

View File

@ -1,8 +1,8 @@
import { $ } from "../api/jquery.js";
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { runAfterFunction } from "../globals/patch_functions.js";
import { prioritizeNewestEvent } from "../globals/prioritize_newest_event.js";
import { runAfterFunction } from "./globals/patch_functions.js";
import { prioritizeNewestEvent } from "./globals/prioritize_newest_event.js";
/**
* Fixes broken horizontal scrolling of column container when holding Shift.

View File

@ -1,6 +1,6 @@
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
const formatRegex = /\?.*format=(\w+)/;

View File

@ -1,6 +1,6 @@
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Adds missing languages for Bing Translator (Bengali, Icelandic, Tagalog, Tamil, Telugu, Urdu).

View File

@ -1,7 +1,7 @@
import { $ } from "../api/jquery.js";
import { onAppReady } from "../api/ready.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { prioritizeNewestEvent } from "../globals/prioritize_newest_event.js";
import { replaceFunction } from "./globals/patch_functions.js";
import { prioritizeNewestEvent } from "./globals/prioritize_newest_event.js";
/**
* Refocuses composer input after Alt+Tab.

View File

@ -1,4 +1,4 @@
import { TD } from "../api/td.js";
import { TD } from "../../api/td.js";
/**
* Returns an object containing data about the column below the cursor.

View File

@ -1,5 +1,5 @@
import { TD } from "../api/td.js";
import { crashDebug } from "../api/utils.js";
import { TD } from "../../api/td.js";
import { crashDebug } from "../../api/utils.js";
/**
* Injects custom HTML into mustache templates.

View File

@ -1,4 +1,4 @@
import { crashDebug } from "../api/utils.js";
import { crashDebug } from "../../api/utils.js";
/**
* @callback FunctionReplacementCallback

View File

@ -1,4 +1,4 @@
import { getEvents } from "../api/jquery.js";
import { getEvents } from "../../api/jquery.js";
/**
* Pushes the newest jQuery event to the beginning of the event handler list, so that it runs before anything else.

View File

@ -1,5 +1,5 @@
import { TD } from "../api/td.js";
import { checkPropertyExists, noop } from "../api/utils.js";
import { TD } from "../../api/td.js";
import { checkPropertyExists, noop } from "../../api/utils.js";
function isSupported() {
return checkPropertyExists(TD, "controller", "columnManager", "getAll");

View File

@ -1,8 +1,8 @@
import { $TD } from "../api/bridge.js";
import { $ } from "../api/jquery.js";
import { isAppReady, onAppReady } from "../api/ready.js";
import { TD } from "../api/td.js";
import { checkPropertyExists } from "../api/utils.js";
import { $TD } from "../../api/bridge.js";
import { $ } from "../../api/jquery.js";
import { isAppReady, onAppReady } from "../../api/ready.js";
import { TD } from "../../api/td.js";
import { checkPropertyExists } from "../../api/utils.js";
function isSupported() {
return checkPropertyExists(TD, "ui", "updates", "showDetailView") &&

View File

@ -1,6 +1,6 @@
import { $ } from "../api/jquery.js";
import { getHoveredColumn } from "../globals/get_hovered_column.js";
import { getHoveredTweet } from "../globals/get_hovered_tweet.js";
import { getHoveredColumn } from "./globals/get_hovered_column.js";
import { getHoveredTweet } from "./globals/get_hovered_tweet.js";
const tryClickSelector = function(selector, parent) {
return $(selector, parent).click().length;

View File

@ -2,8 +2,8 @@ import { $TD } from "../api/bridge.js";
import { onAppReady } from "../api/ready.js";
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { getClassStyleProperty } from "../globals/get_class_style_property.js";
import { runAfterFunction } from "../globals/patch_functions.js";
import { getClassStyleProperty } from "./globals/get_class_style_property.js";
import { runAfterFunction } from "./globals/patch_functions.js";
function refreshSettings() {
const doc = document.documentElement;

View File

@ -2,7 +2,7 @@
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Limits amount of loaded DMs to avoid massive lag from re-opening them several times.

View File

@ -1,7 +1,7 @@
import { TD } from "../api/td.js";
import { checkPropertyExists } from "../api/utils.js";
import { injectMustache } from "../globals/inject_mustache.js";
import { runAfterFunction } from "../globals/patch_functions.js";
import { injectMustache } from "./globals/inject_mustache.js";
import { runAfterFunction } from "./globals/patch_functions.js";
/**
* Makes texts saying 'Retweet' lowercase.

View File

@ -1,7 +1,7 @@
import { $TD } from "../api/bridge.js";
import { $, $$ } from "../api/jquery.js";
import { onAppReady } from "../api/ready.js";
import { prioritizeNewestEvent } from "../globals/prioritize_newest_event.js";
import { prioritizeNewestEvent } from "./globals/prioritize_newest_event.js";
const openSearchExternally = function(event, input) {
$TD.openBrowser("https://twitter.com/search/?q=" + encodeURIComponent(input.val() || ""));

View File

@ -1,11 +1,11 @@
import { registerPropertyUpdateCallback, triggerPropertiesUpdated } from "../api/bridge.js";
import { applyROT13 } from "../globals/apply_rot13.js";
import { getColumnName } from "../globals/get_column_name.js";
import { injectMustache } from "../globals/inject_mustache.js";
import { prioritizeNewestEvent } from "../globals/prioritize_newest_event.js";
import { reloadBrowser } from "../globals/reload_browser.js";
import { reloadColumns } from "../globals/reload_columns.js";
import { showTweetDetail } from "../globals/show_tweet_detail.js";
import { applyROT13 } from "./globals/apply_rot13.js";
import { getColumnName } from "./globals/get_column_name.js";
import { injectMustache } from "./globals/inject_mustache.js";
import { prioritizeNewestEvent } from "./globals/prioritize_newest_event.js";
import { reloadBrowser } from "./globals/reload_browser.js";
import { reloadColumns } from "./globals/reload_columns.js";
import { showTweetDetail } from "./globals/show_tweet_detail.js";
export default function() {
window.jQuery = window.$;

View File

@ -1,7 +1,7 @@
import { $ } from "../api/jquery.js";
import { TD } from "../api/td.js";
import { checkPropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Allows restoring cleared columns by holding Shift.

View File

@ -1,7 +1,7 @@
import { $TD } from "../api/bridge.js";
import { $ } from "../api/jquery.js";
import { getClassStyleProperty } from "../globals/get_class_style_property.js";
import { getHoveredTweet } from "../globals/get_hovered_tweet.js";
import { getClassStyleProperty } from "./globals/get_class_style_property.js";
import { getHoveredTweet } from "./globals/get_hovered_tweet.js";
export default function() {
/**

View File

@ -2,8 +2,8 @@ import { $TD, $TDX } from "../api/bridge.js";
import { $ } from "../api/jquery.js";
import { TD } from "../api/td.js";
import { checkPropertyExists, ensurePropertyExists } from "../api/utils.js";
import { getColumnName } from "../globals/get_column_name.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { getColumnName } from "./globals/get_column_name.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Event callback for a new tweet.

View File

@ -1,5 +1,5 @@
import { $TD } from "../api/bridge.js";
import { getHoveredTweet } from "../globals/get_hovered_tweet.js";
import { getHoveredTweet } from "./globals/get_hovered_tweet.js";
/**
* @this HTMLAnchorElement

View File

@ -1,5 +1,5 @@
import { $TDX } from "../api/bridge.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Adds support for sound notification settings.

View File

@ -1,7 +1,7 @@
import { $TD } from "../api/bridge.js";
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { getHoveredTweet } from "../globals/get_hovered_tweet.js";
import { getHoveredTweet } from "./globals/get_hovered_tweet.js";
function processMedia(chirp) {
return chirp.getMedia().filter(item => !item.isAnimatedGif).map(item => item.entity.media_url_https + ":small").join(";");

View File

@ -1,6 +1,6 @@
import { TD } from "../api/td.js";
import { checkPropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Replaces displayed name and avatar of the official TweetDuck account.

View File

@ -1,9 +1,9 @@
import { $TD } from "../api/bridge.js";
import { TD } from "../api/td.js";
import { checkPropertyExists, noop } from "../api/utils.js";
import { getHoveredTweet } from "../globals/get_hovered_tweet.js";
import { injectMustache } from "../globals/inject_mustache.js";
import { replaceFunction, runAfterFunction } from "../globals/patch_functions.js";
import { getHoveredTweet } from "./globals/get_hovered_tweet.js";
import { injectMustache } from "./globals/inject_mustache.js";
import { replaceFunction, runAfterFunction } from "./globals/patch_functions.js";
/**
* @param {HTMLElement} ele

View File

@ -1,6 +1,6 @@
import { TD } from "../api/td.js";
import { ensurePropertyExists } from "../api/utils.js";
import { replaceFunction } from "../globals/patch_functions.js";
import { replaceFunction } from "./globals/patch_functions.js";
/**
* Skips the pre-login page so that users immediately see the login page.

View File

@ -1,18 +1,24 @@
(function() {
document.documentElement.id = "tduck";
const namespace = "{{namespace}}";
const modules = "{{modules}}";
const stylesheets = "{{stylesheets}}".split("|").filter(name => name.length);
const script = document.createElement("script");
script.async = false;
script.type = "text/javascript";
script.id = "tweetduck-bootstrap-{namespace}";
script.src = "td://resources/load.js";
script.setAttribute("data-namespace", "{namespace}");
script.setAttribute("data-modules", "{modules}");
script.setAttribute("data-namespace", namespace);
script.setAttribute("data-modules", modules);
document.head.appendChild(script);
const style = document.createElement("link");
style.id = "tweetduck-styles-{namespace}";
style.rel = "stylesheet";
style.href = "td://resources/styles/{stylesheet}";
document.head.appendChild(style);
for (const stylesheet of stylesheets) {
const style = document.createElement("link");
style.id = `tweetduck-styles-${namespace}-${stylesheet}`;
style.rel = "stylesheet";
style.href = `td://resources/${namespace}/${stylesheet}.css`;
document.head.appendChild(style);
}
})();

View File

@ -94,7 +94,7 @@
}
onModulesLoaded(namespace){
if (namespace !== "features") {
if (namespace !== "tweetdeck") {
return;
}
window.TDPF_getColumnName = window.TDGF_getColumnName;

View File

@ -322,10 +322,6 @@
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Resources\Content\styles\introduction.css" />
<None Include="Resources\Content\styles\tweetdeck.css" />
<None Include="Resources\Content\styles\login.css" />
<None Include="Resources\Content\styles\update.css" />
<None Include="Resources\Images\avatar.png" />
<None Include="Resources\Images\icon-muted.ico" />
<None Include="Resources\Images\icon-small.ico" />
@ -390,73 +386,77 @@
<ItemGroup>
<Content Include="Resources\Content\.all.js" />
<Content Include="Resources\Content\api\bridge.js" />
<Content Include="Resources\Content\api\ready.js" />
<Content Include="Resources\Content\api\jquery.js" />
<Content Include="Resources\Content\api\ready.js" />
<Content Include="Resources\Content\api\td.js" />
<Content Include="Resources\Content\api\utils.js" />
<Content Include="Resources\Content\introduction\show_introduction.js" />
<Content Include="Resources\Content\introduction\introduction.css" />
<Content Include="Resources\Content\introduction\introduction.js" />
<Content Include="Resources\Content\load.js" />
<Content Include="Resources\Content\features\perform_search.js" />
<Content Include="Resources\Content\features\screenshot_tweet.js" />
<Content Include="Resources\Content\features\bypass_t.co_links.js" />
<Content Include="Resources\Content\features\clear_search_input.js" />
<Content Include="Resources\Content\features\configure_language_for_translations.js" />
<Content Include="Resources\Content\features\disable_clipboard_formatting.js" />
<Content Include="Resources\Content\features\disable_td_metrics.js" />
<Content Include="Resources\Content\features\drag_links_onto_columns.js" />
<Content Include="Resources\Content\features\expand_links_or_show_tooltip.js" />
<Content Include="Resources\Content\features\fix_dm_input_box_focus.js" />
<Content Include="Resources\Content\features\fix_horizontal_scrolling_of_column_container.js" />
<Content Include="Resources\Content\features\fix_marking_dm_as_read_when_replying.js" />
<Content Include="Resources\Content\features\fix_media_preview_urls.js" />
<Content Include="Resources\Content\features\fix_missing_bing_translator_languages.js" />
<Content Include="Resources\Content\features\fix_os_name.js" />
<Content Include="Resources\Content\features\fix_scheduled_tweets_not_appearing.js" />
<Content Include="Resources\Content\features\fix_youtube_previews.js" />
<Content Include="Resources\Content\features\focus_composer_after_alt_tab.js" />
<Content Include="Resources\Content\features\focus_composer_after_image_upload.js" />
<Content Include="Resources\Content\features\focus_composer_after_switching_account.js" />
<Content Include="Resources\Content\features\keep_like_follow_dialogs_open.js" />
<Content Include="Resources\Content\features\limit_loaded_dm_count.js" />
<Content Include="Resources\Content\features\middle_click_tweet_icon_actions.js" />
<Content Include="Resources\Content\features\move_accounts_above_hashtags_in_search.js" />
<Content Include="Resources\Content\features\offline_notification.js" />
<Content Include="Resources\Content\features\open_search_in_first_column.js" />
<Content Include="Resources\Content\features\paste_images_from_clipboard.js" />
<Content Include="Resources\Content\features\ready_plugins.js" />
<Content Include="Resources\Content\features\make_retweets_lowercase.js" />
<Content Include="Resources\Content\features\register_global_functions.js" />
<Content Include="Resources\Content\features\restore_cleared_column.js" />
<Content Include="Resources\Content\features\open_search_externally.js" />
<Content Include="Resources\Content\features\setup_column_type_attributes.js" />
<Content Include="Resources\Content\features\register_composer_active_event.js" />
<Content Include="Resources\Content\features\inject_css.js" />
<Content Include="Resources\Content\features\setup_desktop_notifications.js" />
<Content Include="Resources\Content\features\setup_link_context_menu.js" />
<Content Include="Resources\Content\features\setup_sound_notifications.js" />
<Content Include="Resources\Content\features\add_tweetduck_to_settings_menu.js" />
<Content Include="Resources\Content\features\hook_theme_settings.js" />
<Content Include="Resources\Content\features\setup_tweetduck_account_bamboozle.js" />
<Content Include="Resources\Content\features\setup_tweet_context_menu.js" />
<Content Include="Resources\Content\features\setup_video_player.js" />
<Content Include="Resources\Content\features\configure_first_day_of_week.js" />
<Content Include="Resources\Content\features\skip_pre_login_page.js" />
<Content Include="Resources\Content\features\handle_extra_mouse_buttons.js" />
<Content Include="Resources\Content\features\pin_composer_icon.js" />
<Content Include="Resources\Content\globals\reload_browser.js" />
<Content Include="Resources\Content\globals\apply_rot13.js" />
<Content Include="Resources\Content\globals\get_class_style_property.js" />
<Content Include="Resources\Content\globals\get_column_name.js" />
<Content Include="Resources\Content\globals\get_hovered_column.js" />
<Content Include="Resources\Content\globals\get_hovered_tweet.js" />
<Content Include="Resources\Content\globals\inject_mustache.js" />
<Content Include="Resources\Content\globals\patch_functions.js" />
<Content Include="Resources\Content\globals\prioritize_newest_event.js" />
<Content Include="Resources\Content\globals\reload_columns.js" />
<Content Include="Resources\Content\globals\show_tweet_detail.js" />
<Content Include="Resources\Content\login\hide_cookie_bar.js" />
<Content Include="Resources\Content\login\login.css" />
<Content Include="Resources\Content\login\setup_document_attributes.js" />
<Content Include="Resources\Content\update\check_updates.js" />
<Content Include="Resources\Content\tweetdeck\add_tweetduck_to_settings_menu.js" />
<Content Include="Resources\Content\tweetdeck\bypass_t.co_links.js" />
<Content Include="Resources\Content\tweetdeck\clear_search_input.js" />
<Content Include="Resources\Content\tweetdeck\configure_first_day_of_week.js" />
<Content Include="Resources\Content\tweetdeck\configure_language_for_translations.js" />
<Content Include="Resources\Content\tweetdeck\disable_clipboard_formatting.js" />
<Content Include="Resources\Content\tweetdeck\disable_td_metrics.js" />
<Content Include="Resources\Content\tweetdeck\drag_links_onto_columns.js" />
<Content Include="Resources\Content\tweetdeck\expand_links_or_show_tooltip.js" />
<Content Include="Resources\Content\tweetdeck\fix_dm_input_box_focus.js" />
<Content Include="Resources\Content\tweetdeck\fix_horizontal_scrolling_of_column_container.js" />
<Content Include="Resources\Content\tweetdeck\fix_marking_dm_as_read_when_replying.js" />
<Content Include="Resources\Content\tweetdeck\fix_media_preview_urls.js" />
<Content Include="Resources\Content\tweetdeck\fix_missing_bing_translator_languages.js" />
<Content Include="Resources\Content\tweetdeck\fix_os_name.js" />
<Content Include="Resources\Content\tweetdeck\fix_scheduled_tweets_not_appearing.js" />
<Content Include="Resources\Content\tweetdeck\fix_youtube_previews.js" />
<Content Include="Resources\Content\tweetdeck\focus_composer_after_alt_tab.js" />
<Content Include="Resources\Content\tweetdeck\focus_composer_after_image_upload.js" />
<Content Include="Resources\Content\tweetdeck\focus_composer_after_switching_account.js" />
<Content Include="Resources\Content\tweetdeck\globals\apply_rot13.js" />
<Content Include="Resources\Content\tweetdeck\globals\get_class_style_property.js" />
<Content Include="Resources\Content\tweetdeck\globals\get_column_name.js" />
<Content Include="Resources\Content\tweetdeck\globals\get_hovered_column.js" />
<Content Include="Resources\Content\tweetdeck\globals\get_hovered_tweet.js" />
<Content Include="Resources\Content\tweetdeck\globals\inject_mustache.js" />
<Content Include="Resources\Content\tweetdeck\globals\patch_functions.js" />
<Content Include="Resources\Content\tweetdeck\globals\prioritize_newest_event.js" />
<Content Include="Resources\Content\tweetdeck\globals\reload_browser.js" />
<Content Include="Resources\Content\tweetdeck\globals\reload_columns.js" />
<Content Include="Resources\Content\tweetdeck\globals\show_tweet_detail.js" />
<Content Include="Resources\Content\tweetdeck\handle_extra_mouse_buttons.js" />
<Content Include="Resources\Content\tweetdeck\hook_theme_settings.js" />
<Content Include="Resources\Content\tweetdeck\inject_css.js" />
<Content Include="Resources\Content\tweetdeck\keep_like_follow_dialogs_open.js" />
<Content Include="Resources\Content\tweetdeck\limit_loaded_dm_count.js" />
<Content Include="Resources\Content\tweetdeck\make_retweets_lowercase.js" />
<Content Include="Resources\Content\tweetdeck\middle_click_tweet_icon_actions.js" />
<Content Include="Resources\Content\tweetdeck\move_accounts_above_hashtags_in_search.js" />
<Content Include="Resources\Content\tweetdeck\offline_notification.js" />
<Content Include="Resources\Content\tweetdeck\open_search_externally.js" />
<Content Include="Resources\Content\tweetdeck\open_search_in_first_column.js" />
<Content Include="Resources\Content\tweetdeck\paste_images_from_clipboard.js" />
<Content Include="Resources\Content\tweetdeck\perform_search.js" />
<Content Include="Resources\Content\tweetdeck\pin_composer_icon.js" />
<Content Include="Resources\Content\tweetdeck\ready_plugins.js" />
<Content Include="Resources\Content\tweetdeck\register_composer_active_event.js" />
<Content Include="Resources\Content\tweetdeck\register_global_functions.js" />
<Content Include="Resources\Content\tweetdeck\restore_cleared_column.js" />
<Content Include="Resources\Content\tweetdeck\screenshot_tweet.js" />
<Content Include="Resources\Content\tweetdeck\setup_column_type_attributes.js" />
<Content Include="Resources\Content\tweetdeck\setup_desktop_notifications.js" />
<Content Include="Resources\Content\tweetdeck\setup_link_context_menu.js" />
<Content Include="Resources\Content\tweetdeck\setup_sound_notifications.js" />
<Content Include="Resources\Content\tweetdeck\setup_tweetduck_account_bamboozle.js" />
<Content Include="Resources\Content\tweetdeck\setup_tweet_context_menu.js" />
<Content Include="Resources\Content\tweetdeck\setup_video_player.js" />
<Content Include="Resources\Content\tweetdeck\skip_pre_login_page.js" />
<Content Include="Resources\Content\tweetdeck\tweetdeck.css" />
<Content Include="Resources\Content\update\update.js" />
<Content Include="Resources\Content\update\update.css" />
<Content Include="Resources\Scripts\bootstrap.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />