<commit_before>Modules.VERSION = '1.0.3';

// don't forget to change this for each add-on! See http://www.famkruithof.net/uuid/uuidgen
this.addonUUID = '9cb2c7a0-5224-11e4-916c-0800200c9a66';

this.whatsNewLastVersion = null;
this.changelog = '';

this.__defineGetter__('whatsNewURL', function() { return 'chrome://'+objPathString+'/content/whatsnew.xhtml'; });
this.__defineGetter__('whatsNewAbout', function() { return 'about:'+objPathString; });

this.whatsNewAboutAddons = function() {
	window.BrowserOpenAddonsMgr();
};

this.whatsNewChangeLog = function(m) {
	if(whatsNewLastVersion) {
		Messenger.messageBrowser(m.target, 'notifyLastVersion', whatsNewLastVersion);
		whatsNewLastVersion = null;
	}
	
	if(changelog) {
		Messenger.messageBrowser(m.target, 'changeLog', changelog);
		return;
	}
	
	xmlHttpRequest('resource://'+objPathString+'/changelog.json', function(xmlhttp) {
		if(xmlhttp.readyState == 4) {
			changelog = xmlhttp.responseText;
			whatsNewChangeLog(m);
		}
	});
};

this.whatsNewNotifyOnUpdates = function(m) {
	Prefs.notifyOnUpdates = m.data;
};

// we have to wait for Session Store to finish, otherwise our tab will be overriden by a session-restored tab
this.whatsNewOpenWhenReady = function() {
	if(typeof(whatsNewOpenWhenReady) == 'undefined') { return; }
	
	var state = JSON.parse(window.SessionStore.getBrowserState());
	// we're in a window, so "a" window should exist...
	if(state.windows.length == 0) {
		aSync(whatsNewOpenWhenReady, 500);
		return;
	}
	
	// this doesn't work in e10s yet
	//window.gBrowser.selectedTab = window.gBrowser.addTab(whatsNewAbout);
	window.gBrowser.selectedTab = window.gBrowser.addTab(whatsNewURL);
	window.gBrowser.selectedTab.loadOnStartup = true; // for Tab Mix Plus
};

this.whatsNewCheckUpdates = function(m) {
	Addon.findUpdates({
		onUpdateAvailable: function() {
			Messenger.messageBrowser(m.target, 'checkUpdates', true);
		},
		onNoUpdateAvailable: function() {
			Messenger.messageBrowser(m.target, 'checkUpdates', false);
		}
	}, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
};<commit_msg>complement previous commit<commit_after>Modules.VERSION = '1.0.4';

// don't forget to change this for each add-on! See http://www.famkruithof.net/uuid/uuidgen
this.addonUUID = '9cb2c7a0-5224-11e4-916c-0800200c9a66';

this.whatsNewLastVersion = null;
this.changelog = '';

this.__defineGetter__('whatsNewURL', function() { return 'chrome://'+objPathString+'/content/whatsnew.xhtml'; });
this.__defineGetter__('whatsNewAbout', function() { return 'about:'+objPathString; });

this.whatsNewAboutAddons = function() {
	window.BrowserOpenAddonsMgr();
};

this.whatsNewChangeLog = function(m) {
	if(whatsNewLastVersion) {
		Messenger.messageBrowser(m.target, 'notifyLastVersion', whatsNewLastVersion);
		whatsNewLastVersion = null;
	}
	
	if(changelog) {
		Messenger.messageBrowser(m.target, 'changeLog', changelog);
		return;
	}
	
	xmlHttpRequest('resource://'+objPathString+'/changelog.json', function(xmlhttp) {
		if(xmlhttp.readyState == 4) {
			changelog = xmlhttp.responseText;
			whatsNewChangeLog(m);
		}
	});
};

this.whatsNewNotifyOnUpdates = function(m) {
	Prefs.notifyOnUpdates = m.data;
};

// we have to wait for Session Store to finish, otherwise our tab will be overriden by a session-restored tab
this.whatsNewOpenWhenReady = function() {
	if(typeof(whatsNewOpenWhenReady) == 'undefined') { return; }
	
	var state = JSON.parse(window.SessionStore.getBrowserState());
	// we're in a window, so "a" window should exist...
	if(state.windows.length == 0) {
		aSync(whatsNewOpenWhenReady, 500);
		return;
	}
	
	window.gBrowser.selectedTab = window.gBrowser.addTab(whatsNewAbout);
	window.gBrowser.selectedTab.loadOnStartup = true; // for Tab Mix Plus
};

this.whatsNewCheckUpdates = function(m) {
	Addon.findUpdates({
		onUpdateAvailable: function() {
			Messenger.messageBrowser(m.target, 'checkUpdates', true);
		},
		onNoUpdateAvailable: function() {
			Messenger.messageBrowser(m.target, 'checkUpdates', false);
		}
	}, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
};
{'fraction_non_alphanumeric': 0.1422915120019797, 'fraction_numerical': 0.016332590942835932, 'mean_word_length': 5.305772230889236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1658731', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1407, 'n_words': 240}