mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-18 06:15:49 +02:00
Move debug.js into the debug plugin
This commit is contained in:
parent
aef9c591e9
commit
606c9512f8
@ -155,10 +155,6 @@ private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
|
|||||||
ScriptLoader.ExecuteFile(e.Frame, "code.js");
|
ScriptLoader.ExecuteFile(e.Frame, "code.js");
|
||||||
ReinjectCustomCSS(Config.CustomBrowserCSS);
|
ReinjectCustomCSS(Config.CustomBrowserCSS);
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
ScriptLoader.ExecuteFile(e.Frame, "debug.js");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (plugins.HasAnyPlugin(PluginEnvironment.Browser)){
|
if (plugins.HasAnyPlugin(PluginEnvironment.Browser)){
|
||||||
ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginBrowserScriptFile);
|
ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginBrowserScriptFile);
|
||||||
ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginGlobalScriptFile);
|
ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginGlobalScriptFile);
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
Debug plugin
|
Debug plugin
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
- Runs several tests on startup, only included in debug configuration
|
- Enables debug functionality and tests
|
||||||
|
- Only included in debug configuration
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.0
|
1.1
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
@ -1,3 +1,56 @@
|
|||||||
enabled(){
|
enabled(){
|
||||||
|
this.isDebugging = false;
|
||||||
|
|
||||||
|
this.onKeyDown = (e) => {
|
||||||
|
// ==========================
|
||||||
|
// F4 key - toggle debug mode
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
if (e.keyCode === 115){
|
||||||
|
this.isDebugging = !this.isDebugging;
|
||||||
|
$(".app-title").first().css("background-color", this.isDebugging ? "#5A6B75" : "#292F33");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug mode handling
|
||||||
|
|
||||||
|
else if (this.isDebugging){
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// ===================================
|
||||||
|
// N key - simulate popup notification
|
||||||
|
// ===================================
|
||||||
|
|
||||||
|
if (e.keyCode === 78){
|
||||||
|
var col = TD.controller.columnManager.getAllOrdered()[0];
|
||||||
|
|
||||||
|
$.publish("/notifications/new",[{
|
||||||
|
column: col,
|
||||||
|
items: [
|
||||||
|
col.updateArray[Math.floor(Math.random()*col.updateArray.length)]
|
||||||
|
]
|
||||||
|
}]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===================================
|
||||||
|
// S key - simulate sound notification
|
||||||
|
// ===================================
|
||||||
|
|
||||||
|
else if (e.keyCode === 83){
|
||||||
|
if ($TDX.hasCustomNotificationSound){
|
||||||
|
$TD.onTweetSound();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
document.getElementById("update-sound").play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ready(){
|
||||||
|
$(document).on("keydown", this.onKeyDown);
|
||||||
|
}
|
||||||
|
|
||||||
|
disabled(){
|
||||||
|
$(document).off("keydown", this.onKeyDown);
|
||||||
}
|
}
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
(function($, $TD, $TDX, TD){
|
|
||||||
var isDebugging = false;
|
|
||||||
|
|
||||||
$(document).keydown(function(e){
|
|
||||||
|
|
||||||
// ==========================
|
|
||||||
// F4 key - toggle debug mode
|
|
||||||
// ==========================
|
|
||||||
|
|
||||||
if (e.keyCode === 115){
|
|
||||||
isDebugging = !isDebugging;
|
|
||||||
$(".app-title").first().css("background-color", isDebugging ? "#5A6B75" : "#292F33");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Debug mode handling
|
|
||||||
|
|
||||||
else if (isDebugging){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
// ===================================
|
|
||||||
// N key - simulate popup notification
|
|
||||||
// ===================================
|
|
||||||
|
|
||||||
if (e.keyCode === 78){
|
|
||||||
var col = TD.controller.columnManager.getAllOrdered()[0];
|
|
||||||
|
|
||||||
$.publish("/notifications/new",[{
|
|
||||||
column: col,
|
|
||||||
items: [
|
|
||||||
col.updateArray[Math.floor(Math.random()*col.updateArray.length)]
|
|
||||||
]
|
|
||||||
}]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================================
|
|
||||||
// S key - simulate sound notification
|
|
||||||
// ===================================
|
|
||||||
|
|
||||||
else if (e.keyCode === 83){
|
|
||||||
if ($TDX.hasCustomNotificationSound){
|
|
||||||
$TD.onTweetSound();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
document.getElementById("update-sound").play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})($, $TD, $TDX, TD);
|
|
@ -3,7 +3,6 @@ del "bin\x86\Release\*.pdb"
|
|||||||
del "bin\x86\Release\devtools_resources.pak"
|
del "bin\x86\Release\devtools_resources.pak"
|
||||||
del "bin\x86\Release\d3dcompiler_43.dll"
|
del "bin\x86\Release\d3dcompiler_43.dll"
|
||||||
del "bin\x86\Release\widevinecdmadapter.dll"
|
del "bin\x86\Release\widevinecdmadapter.dll"
|
||||||
del "bin\x86\Release\Scripts\debug.js"
|
|
||||||
|
|
||||||
del "bin\x86\Release\TweetDuck.Browser.exe"
|
del "bin\x86\Release\TweetDuck.Browser.exe"
|
||||||
ren "bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe"
|
ren "bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe"
|
@ -39,7 +39,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
|
|||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll,debug.js"
|
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll"
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
||||||
|
@ -36,7 +36,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
|||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll,debug.js"
|
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
|
||||||
|
@ -41,7 +41,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
|||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,*.dll,*.pak,*.bin,*.dat,debug.js"
|
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,*.dll,*.pak,*.bin,*.dat"
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
|
||||||
|
Loading…
Reference in New Issue
Block a user