Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
v1.2.4.2 Release
Browse files Browse the repository at this point in the history
Fixed issue for legacy layout causing duplicate buttons to show and changed "Add buttons on Youtube" text resource for settings
  • Loading branch information
Wassup789 committed Nov 20, 2017
1 parent 587ac6e commit ee0144c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"settings_editSettings_addButtons": {
"description": "The label for the enable add buttons checkbox",
"message": "Enable add buttons on YouTube"
"message": "Add buttons on YouTube"
},
"settings_editSettings_addButtonsSubs": {
"description": "The label for the view subscriptions button",
Expand Down
15 changes: 14 additions & 1 deletion js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ chrome.runtime.onInstalled.addListener(function(details){
wyn.firstLaunch();
}else if(details.reason == "update"){
var thisVersion = chrome.runtime.getManifest().version;
if(details.previousVersion != thisVersion){
// Ignore for same base version
if(details.previousVersion != thisVersion && extractBaseVersion(thisVersion) != extractBaseVersion(details.previousVersion)){
console.log("Updated from " + details.previousVersion + " to " + thisVersion);
chrome.browserAction.setBadgeText({text: "new"});

Expand Down Expand Up @@ -1543,4 +1544,16 @@ function resetChannelHasNewVideo(num, updateSettingsBadge) {

if(updateSettingsBadge)
updateBadge();
}

/**
* Extracts the base version of the extension
* Ex: 1.2.3.4 -> 1.2.3
*
* @param version The version of the extension
*/
function extractBaseVersion(version){
var arr = version.split(".");
arr.pop();
return arr.join(".");
}
5 changes: 3 additions & 2 deletions js/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,14 @@ function launchLegacy(){
$(elems[response.index]).addClass("yt-uix-button-subscribe-branded").removeClass("yt-uix-button-subscribed-branded");
});
}
}else{// For everything else
}else if(slashes.indexOf("subscription_manager") < 0){// For everything else
$(".yt-uix-overlay").each(function(){
var $this = $(this),
elem = null;
if($this.is(".channel-settings-overlay, .featured-content-picker-overlay, .settings-dialog-container") ||
$this.parents(".about-metadata-container, .channel-header-flagging-menu-container").length > 0 ||
$this.parents(".primary-header-actions").find(".ytn-btn").length > 0)
$this.parents(".primary-header-actions").find(".ytn-btn").length > 0 ||
$this.parent().find(".ytn-btn").length > 0)
return;
else{
elem = $(elemContent);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"version": "1.2.4.1",
"version": "1.2.4.2",
"permissions": [
"notifications",
"unlimitedStorage",
Expand Down

0 comments on commit ee0144c

Please sign in to comment.