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

Do minor code refactoring

This commit is contained in:
chylex 2016-05-08 14:59:01 +02:00
parent 5f79b286f1
commit 3a66fa28ab
8 changed files with 14 additions and 23 deletions

View File

@ -60,8 +60,6 @@ public bool Lock(){
if (foundProcess.ProcessName == currentProcess.ProcessName){
lockingProcess = foundProcess;
}
currentProcess.Close();
}
}catch(ArgumentException){}

View File

@ -9,7 +9,7 @@
namespace TweetDck.Configuration{
[Serializable]
sealed class UserConfig{
private static readonly IFormatter Formatter = new BinaryFormatter(){
private static readonly IFormatter Formatter = new BinaryFormatter{
Binder = new SerializationCompatibilityHandler()
};

View File

@ -21,7 +21,6 @@ private static UserConfig Config{
public string UpdateInstallerPath { get; private set; }
private readonly ChromiumWebBrowser browser;
private readonly TweetDeckBridge bridge;
private readonly FormNotification notification;
private FormSettings currentFormSettings;
@ -35,7 +34,7 @@ public FormBrowser(){
Text = Program.BrandName;
bridge = new TweetDeckBridge(this);
TweetDeckBridge bridge = new TweetDeckBridge(this);
browser = new ChromiumWebBrowser("https://tweetdeck.twitter.com/"){
MenuHandler = new ContextMenuBrowser(this),

View File

@ -45,17 +45,11 @@ public override bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser b
switch((int)commandId){
case MenuSettings:
form.InvokeSafe(() => {
form.OpenSettings();
});
form.InvokeSafe(form.OpenSettings);
return true;
case MenuAbout:
form.InvokeSafe(() => {
form.OpenAbout();
});
form.InvokeSafe(form.OpenAbout);
return true;
case MenuMute:

View File

@ -117,7 +117,7 @@ private static bool BeginMigration(MigrationDecision decision, Action<Exception>
if (decision == MigrationDecision.MigratePurge){
// update the lnk files wherever possible (desktop icons, pinned taskbar, start menu)
foreach(string location in GetLnkDirectories()){
if (location == string.Empty)continue;
if (string.IsNullOrEmpty(location))continue;
string linkFile = Path.Combine(location,"TweetDeck.lnk");

View File

@ -117,7 +117,7 @@
//
var app = $("body").children(".js-app");
new MutationObserver(function(mutations){
new MutationObserver(function(){
if (isInitialized && app.hasClass("is-hidden")){
isInitialized = false;
}
@ -143,7 +143,7 @@
});
//
// Block: Force popup notification settings
// Block: Force popup notification settings.
//
TD.controller.notifications.hasNotifications = function(){
return true;
@ -154,7 +154,7 @@
};
//
// Block: Hook into links to bypass default open function
// Block: Hook into links to bypass default open function.
//
(function(){
var urlWait = false;
@ -261,7 +261,7 @@
};*/
//
// Block: Hook into mp4 video element clicking
// Block: Hook into mp4 video element clicking.
//
$(document.body).delegate("video.js-media-gif","click",function(e){
var src = $(this).attr("src");
@ -296,7 +296,7 @@
$TD.clickUploadImage(Math.floor(buttonPos.left),Math.floor(buttonPos.top));
};
$(".js-app").delegate(".js-compose-text","paste",function(e){
$(".js-app").delegate(".js-compose-text","paste",function(){
lastPasteElement = $(this);
$TD.tryPasteImage();
});
@ -345,7 +345,7 @@
})();
//
// Block: Inject custom CSS and layout into the page
// Block: Inject custom CSS and layout into the page.
//
(function(){
var style = document.createElement("style");

View File

@ -4,7 +4,7 @@
//
var bubbleParents = function(element, tag, callback){
do{
if (element.tagName == "A"){
if (element.tagName === "A"){
callback(element);
return true;
}

View File

@ -96,7 +96,7 @@
};
//
// Function: Runs an update check and updates all DOM elements appropriately
// Function: Runs an update check and updates all DOM elements appropriately.
//
var runUpdateCheck = function(){
clearTimeout(updateCheckTimeoutID);
@ -107,7 +107,7 @@
$.getJSON("https://api.github.com/repos/chylex/"+$TD.brandName+"/releases/latest",function(response){
var tagName = response.tag_name;
if (tagName != $TD.versionTag && tagName != $TD.dismissedVersionTag && response.assets.length > 0){
if (tagName !== $TD.versionTag && tagName !== $TD.dismissedVersionTag && response.assets.length > 0){
createUpdateNotificationElement(tagName,response.assets[0].browser_download_url);
}
});