mirror of
				https://github.com/krateng/maloja.git
				synced 2025-11-03 19:17:06 -05:00 
			
		
		
		
	Fixed week pulse view on start page
This commit is contained in:
		
							parent
							
								
									d07ca92252
								
							
						
					
					
						commit
						88cbce33e2
					
				@ -2,10 +2,18 @@
 | 
			
		||||
 | 
			
		||||
chrome.tabs.onUpdated.addListener(onTabUpdated);
 | 
			
		||||
chrome.tabs.onRemoved.addListener(onTabRemoved);
 | 
			
		||||
chrome.tabs.onActivated.addListener(onTabChanged);
 | 
			
		||||
chrome.runtime.onMessage.addListener(onPlaybackUpdate);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
var patterns = [
 | 
			
		||||
	"https://music.youtube.com",
 | 
			
		||||
	"http://music.youtube.com"
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
function onTabUpdated(tabId, changeInfo, tab) {
 | 
			
		||||
	if (changeInfo.status !== "complete") {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	console.log("Update")
 | 
			
		||||
	chrome.tabs.get(tabId,party)
 | 
			
		||||
}
 | 
			
		||||
@ -14,17 +22,10 @@ function onTabRemoved() {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onTabChanged(activeInfo) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function party(tab) {
 | 
			
		||||
 | 
			
		||||
	var patterns = [
 | 
			
		||||
		"https://music.youtube.com",
 | 
			
		||||
		"http://music.youtube.com"
 | 
			
		||||
	];
 | 
			
		||||
	
 | 
			
		||||
	importantPage = false
 | 
			
		||||
 | 
			
		||||
	for (var i=0;i<patterns.length;i++) {
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,7 @@ def instructions(keys):
 | 
			
		||||
	# pulse
 | 
			
		||||
	dt = datetime.utcnow()
 | 
			
		||||
	first_month = [dt.year-1,dt.month+1]
 | 
			
		||||
	dt_firstweek = dt - timedelta(11*7) - timedelta((6-dt.weekday()))
 | 
			
		||||
	dt_firstweek = dt - timedelta(11*7) - timedelta((tod.weekday() + 1) % 7)
 | 
			
		||||
	first_week = [dt_firstweek.year,dt_firstweek.month,dt_firstweek.day]
 | 
			
		||||
	dt_firstday = dt - timedelta(6)
 | 
			
		||||
	first_day = [dt_firstday.year,dt_firstday.month,dt_firstday.day]
 | 
			
		||||
@ -102,4 +102,3 @@ def instructions(keys):
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (replace,pushresources)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user