1
0
Fork 0
mirror of https://github.com/Oreolek/TrackMeNot-Chrome.git synced 2024-06-26 03:41:00 +03:00

gpl warnings and options saves

This commit is contained in:
Alexander Yakovlev 2016-12-03 14:43:25 +07:00
parent f0111467e2
commit c920a3cc7f
8 changed files with 102 additions and 25 deletions

View file

@ -1,3 +1,19 @@
/*******************************************************************************
This file is part of TrackMeNot (Chrome version).
TrackMeNot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.
TrackMeNot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TrackMeNot. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
if(!TRACKMENOT) var TRACKMENOT = {};
TRACKMENOT.editor = function () {

View file

@ -1,3 +1,19 @@
/*******************************************************************************
This file is part of TrackMeNot (Chrome version).
TrackMeNot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.
TrackMeNot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TrackMeNot. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
if(!TRACKMENOT) var TRACKMENOT = {};
TRACKMENOT.Menus = function() {

View file

@ -68,9 +68,12 @@ function TMNSetOptionsMenu( ) {
$("#trackmenot-opt-burstMode").prop('checked',options.burstMode);
$("#trackmenot-opt-save-logs").prop('checked',options.saveLogs);
$("#trackmenot-opt-disable-logs").prop('checked',options.disableLogs);
$("#trackmenot-opt-userss").prop('checked',options.useRss);
$("#trackmenot-use-userlist").prop('checked',options.useUserList);
$("#trackmenot-seed").val(feedList);
$("#trackmenot-blacklist").val(kw_black_list);
$("#trackmenot-userlist").val(options.userList);
$("#trackmenot-use-blacklist").prop('checked', options.use_black_list);
$("#trackmenot-use-dhslist").prop('checked', options.use_dhs_list);
@ -206,11 +209,14 @@ function saveOptions() {
var options = {};
options.enabled = $("#trackmenot-opt-enabled").is(':checked');
console.log("Saved Enabled: "+options.enabled );
options.useTab = $("#trackmenot-opt-useTab").is(':checked');
options.useTab = $("#trackmenot-opt-useTab").is(':checked');
options.burstMode = $("#trackmenot-opt-burstMode").is(':checked');
options.disableLogs = $("#trackmenot-opt-disable-logs").is(':checked');
options.useRss = $("#trackmenot-opt-userss").is(':checked');
options.useUserList = $("#trackmenot-use-userlist").is(':checked');
options.saveLogs = $("#trackmenot-opt-save-logs").is(':checked');
options.userList = $("#trackmenot-userlist").val();
options.timeout = $("#trackmenot-opt-timeout").val();
setFrequencyMenu(options.timeout);

View file

@ -226,7 +226,7 @@
<table width="100%" BGCOLOR=#F0F0F0 >
<tr>
<td width="20%">
<input type="checkbox" id="trackmenot-use-wordlist" />Use list <br>
<input type="checkbox" id="trackmenot-use-userlist" />Use list <br>
</td>
<td>
<input title="Word list" size=70 type="text" id="trackmenot-userlist">

View file

@ -1,3 +1,19 @@
/*******************************************************************************
This file is part of TrackMeNot (Chrome version).
TrackMeNot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.
TrackMeNot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TrackMeNot. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
self.port.on("TMNStopLoading", function() {
window.back();
});

View file

@ -11,12 +11,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
along with TrackMeNot. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
if(!TRACKMENOT) var TRACKMENOT = {};
TRACKMENOT.TMNInjected = function() {
var debug_script = true;
@ -277,8 +276,6 @@ TRACKMENOT.TMNInjected = function() {
},timers[2]);
}
function getElementsByAttrValue(dom,nodeType,attrName,nodeValue) {
var outlines = dom.getElementsByTagName(nodeType);
for (var i = 0; i<outlines.length;i++) {
@ -288,15 +285,10 @@ TRACKMENOT.TMNInjected = function() {
return null;
}
function getElement(doc,aID){
return (doc.getElementById) ? doc.getElementById(aID): doc.all[aID];
}
function getQuerySuggestion() {
var suggestFilter = suggest_filters[engine];
var searchTable = getElement(document,suggestFilter[0]);
@ -315,18 +307,17 @@ TRACKMENOT.TMNInjected = function() {
return suggestElts.slice();
}
function getCommonWords(searchValue, nextQuery) {
var searched = searchValue.split(' ');
var tosearch = nextQuery.split(' ');
var result = [];
result = result.concat(
searched.filter(
function(x) {
return (tosearch.indexOf(x) >= 0);
}
)
);
searched.filter(
function(x) {
return (tosearch.indexOf(x) >= 0);
}
)
);
return result;
}

View file

@ -31,6 +31,9 @@ TRACKMENOT.TMNSearch = function() {
var incQueries = [];
var searchEngines = "google";
var engine = 'google';
var useRss = true;
var useUserList = false;
var userList = [];
var TMNQueries = {};
var branch = "extensions.trackmenot.";
var feedList = 'http://www.techmeme.com/index.xml|http://rss.slashdot.org/Slashdot/slashdot|http://feeds.nytimes.com/nyt/rss/HomePage';
@ -483,7 +486,7 @@ TRACKMENOT.TMNSearch = function() {
function validateFeeds(param) {
TMNQueries.rss = [];
feedList= param.feeds;
feedList = param.feeds;
cout("Validating the feeds: "+ feedList);
var feeds = feedList.split('|');
for (var i=0;i<feeds.length;i++) {
@ -560,7 +563,7 @@ TRACKMENOT.TMNSearch = function() {
if (
!term ||
(term.length<3) ||
(queryList.indexOf(term) > 0)
(queryList.indexOf(term) > 0)
)
return false;
@ -644,7 +647,10 @@ TRACKMENOT.TMNSearch = function() {
addQuery(queryToAdd,feedObject.words);
}
//cout(feedObject.name + " : " + feedObject.words)
TMNQueries.rss.push(feedObject);
if (useRss) {
TMNQueries.rss.push(feedObject);
}
return 1;
}
@ -978,6 +984,9 @@ TRACKMENOT.TMNSearch = function() {
options.kw_black_list = kwBlackList.join(",");
options.saveLogs= saveLogs;
options.disableLogs = disableLogs;
options.useRss = useRss;
options.userList = userList;
options.useUserList = useUserList;
return options;
}
@ -989,6 +998,7 @@ TRACKMENOT.TMNSearch = function() {
useTab = false;
useBlackList = true;
useDHSList = false;
useRss = true;
kwBlackList= ['bomb', 'porn', 'pornographie'];
saveLogs = true;
disableLogs = false;
@ -1016,9 +1026,13 @@ TRACKMENOT.TMNSearch = function() {
TMNQueries = JSON.parse(localStorage.gen_queries);
feedList = options.feedList;
tmn_id = options.tmn_id;
useRss = options.useRss;
options.useUserList = options.useUserList;
options.userList = options.userList.split(",");
tmnLogs = JSON.parse( localStorage.logs_tmn );
engines = JSON.parse( localStorage.engines);
if (options.kw_black_list && opions.kw_black_list.length > 0) kwBlackList = options.kw_black_list.split(",");
if (options.kw_black_list && opions.kw_black_list.length > 0)
kwBlackList = options.kw_black_list.split(",");
} catch (ex) {
cout('No option recorded: '+ex);
}
@ -1227,8 +1241,10 @@ TRACKMENOT.TMNSearch = function() {
typeoffeeds.push('rss');
TMNQueries.rss = [];
var feeds = feedList.split('|');
for (var i=0;i<feeds.length;i++)
doRssFetch(feeds[i]);
if ( useRss ) {
for (var i=0;i<feeds.length;i++)
doRssFetch(feeds[i]);
}
if ( useDHSList ) {
readDHSList();

View file

@ -1,3 +1,19 @@
/*******************************************************************************
This file is part of TrackMeNot (Chrome version).
TrackMeNot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2 of the License.
TrackMeNot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with TrackMeNot. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
function updateText(text) {
document.getElementById("tmn-text").innerHTML = text;
console.log("Updating text on widget with: "+ text);