diff --git a/Core/Handling/TweetDeckBridge.cs b/Core/Handling/TweetDeckBridge.cs index f6d3089b..bef057d7 100644 --- a/Core/Handling/TweetDeckBridge.cs +++ b/Core/Handling/TweetDeckBridge.cs @@ -155,6 +155,19 @@ public void OpenBrowser(string url){ BrowserUtils.OpenExternalBrowser(url); } + public void Alert(string type, string contents){ + MessageBoxIcon icon; + + switch(type){ + case "error": icon = MessageBoxIcon.Error; break; + case "warning": icon = MessageBoxIcon.Warning; break; + case "info": icon = MessageBoxIcon.Information; break; + default: icon = MessageBoxIcon.None; break; + } + + MessageBox.Show(contents, Program.BrandName+" Browser Message", MessageBoxButtons.OK, icon); + } + public void Log(string data){ System.Diagnostics.Debug.WriteLine(data); } diff --git a/Resources/Scripts/plugins.js b/Resources/Scripts/plugins.js index 6f3fde40..134f00a0 100644 --- a/Resources/Scripts/plugins.js +++ b/Resources/Scripts/plugins.js @@ -11,7 +11,7 @@ obj = eval("("+contents+")"); }catch(err){ if (!(onFailure && onFailure(err.message))){ - alert("Problem loading '"+fileName+"' file for '"+identifier+"' plugin, the JavaScript syntax is invalid: "+err.message); + $TD.alert("warning", "Problem loading '"+fileName+"' file for '"+identifier+"' plugin, the JavaScript syntax is invalid: "+err.message); } return; @@ -20,7 +20,7 @@ onSuccess && onSuccess(obj); }).catch(err => { if (!(onFailure && onFailure(err))){ - alert("Problem loading '"+fileName+"' file for '"+identifier+"' plugin: "+err); + $TD.alert("warning", "Problem loading '"+fileName+"' file for '"+identifier+"' plugin: "+err); } }); }; @@ -36,7 +36,7 @@ continueLoading(token, identifier, fileNameUser, onSuccess, onFailure); }).catch(err => { if (!(onFailure && onFailure(err))){ - alert("Problem generating '"+fileNameUser+"' file for '"+identifier+"' plugin: "+err); + $TD.alert("warning", "Problem generating '"+fileNameUser+"' file for '"+identifier+"' plugin: "+err); } }); } @@ -45,7 +45,7 @@ } }).catch(err => { if (!(onFailure && onFailure(err))){ - alert("Problem checking '"+fileNameUser+"' file for '"+identifier+"' plugin: "+err); + $TD.alert("warning", "Problem checking '"+fileNameUser+"' file for '"+identifier+"' plugin: "+err); } }); };