diff --git a/Core/FormBrowser.cs b/Core/FormBrowser.cs index 04671cd9..bc0b028e 100644 --- a/Core/FormBrowser.cs +++ b/Core/FormBrowser.cs @@ -147,6 +147,10 @@ private void Browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){ if (e.Frame.IsMain && BrowserUtils.IsTweetDeckWebsite(e.Frame)){ ScriptLoader.ExecuteFile(e.Frame, "code.js"); + #if DEBUG + ScriptLoader.ExecuteFile(e.Frame, "debug.js"); + #endif + if (plugins.HasAnyPlugin(PluginEnvironment.Browser)){ ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginBrowserScriptFile); ScriptLoader.ExecuteFile(e.Frame, PluginManager.PluginGlobalScriptFile); diff --git a/Resources/Scripts/debug.js b/Resources/Scripts/debug.js new file mode 100644 index 00000000..b4005d1a --- /dev/null +++ b/Resources/Scripts/debug.js @@ -0,0 +1,19 @@ +(function($, $TD, TD){ + $(document).keydown(function(e){ + + // ============================== + // F4 key - simulate notification + // ============================== + + if (e.keyCode === 115){ + var col = TD.controller.columnManager.getAllOrdered()[0]; + + $.publish("/notifications/new",[{ + column: col, + items: [ + col.updateArray[Math.floor(Math.random()*col.updateArray.length)] + ] + }]); + } + }); +})($, $TD, TD); diff --git a/TweetDck.csproj b/TweetDck.csproj index 4c18f967..5f4990dd 100644 --- a/TweetDck.csproj +++ b/TweetDck.csproj @@ -313,6 +313,7 @@ </ItemGroup> <ItemGroup> <Content Include="Resources\Scripts\code.js" /> + <Content Include="Resources\Scripts\debug.js" /> <Content Include="Resources\Scripts\notification.js" /> <Content Include="Resources\Scripts\plugins.browser.js" /> <Content Include="Resources\Scripts\plugins.js" /> diff --git a/_postbuild.bat b/_postbuild.bat index 44a2bbb8..6eb32f41 100644 --- a/_postbuild.bat +++ b/_postbuild.bat @@ -2,6 +2,7 @@ del "bin\x86\Release\*.xml" del "bin\x86\Release\devtools_resources.pak" del "bin\x86\Release\d3dcompiler_43.dll" del "bin\x86\Release\widevinecdmadapter.dll" +del "bin\x86\Release\Scripts\debug.js" del "bin\x86\Release\TweetDuck.Browser.exe" ren "bin\x86\Release\CefSharp.BrowserSubprocess.exe" "TweetDuck.Browser.exe" \ No newline at end of file diff --git a/bld/gen_full.iss b/bld/gen_full.iss index 87d55f1c..be088d7b 100644 --- a/bld/gen_full.iss +++ b/bld/gen_full.iss @@ -39,7 +39,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll,debug.js" [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable diff --git a/bld/gen_port.iss b/bld/gen_port.iss index 8d9cc8fb..170a2fb5 100644 --- a/bld/gen_port.iss +++ b/bld/gen_port.iss @@ -36,7 +36,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll,debug.js" [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec diff --git a/bld/gen_upd.iss b/bld/gen_upd.iss index 85accc50..d77a5557 100644 --- a/bld/gen_upd.iss +++ b/bld/gen_upd.iss @@ -41,7 +41,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.dll,*.pak,*.bin,*.dat" +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.dll,*.pak,*.bin,*.dat,debug.js" [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable