Skip to content

Commit

Permalink
string optimize continues...
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelywcm committed Feb 21, 2009
1 parent 8418a8f commit 570d846
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 134 deletions.
10 changes: 5 additions & 5 deletions IAutoProxy.idl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "nsISupports.idl"

[scriptable, uuid(2a311a4f-f32b-472a-9fc9-f1b1529924ad)]
interface IAdblockPlusSubscription: nsISupports
interface IAutoProxySubscription: nsISupports
{
/**
* Subscription identifier, this is its URL unless the attribute external is set
Expand Down Expand Up @@ -89,7 +89,7 @@ interface IAdblockPlusSubscription: nsISupports
};

[scriptable, uuid(6e70a4b4-bef8-b0b3-25a2-62146012352b)]
interface IAdblockPlus : nsISupports
interface IAutoProxy : nsISupports
{
/**
* Number of subscriptions in the list
Expand All @@ -101,14 +101,14 @@ interface IAdblockPlus : nsISupports
*
* @param id subscription identifier
*/
IAdblockPlusSubscription getSubscription(in AString id);
IAutoProxySubscription getSubscription(in AString id);

/**
* Retrieves a subscription by its position in the list.
*
* @param index index of the subscription in the list
*/
IAdblockPlusSubscription getSubscriptionAt(in PRInt32 index);
IAutoProxySubscription getSubscriptionAt(in PRInt32 index);

/**
* Adds an external subscription or updates subscription's patterns if it
Expand Down Expand Up @@ -152,7 +152,7 @@ interface IAdblockPlus : nsISupports
void removePatterns([array, size_is(length)] in wstring patterns, in unsigned long length);

/**
* Returns the installed version of Adblock Plus.
* Returns the installed version of AutoProxy.
*/
AString getInstalledVersion();
};
2 changes: 1 addition & 1 deletion addChecksum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#############################################################################
# This is a reference script to add checksums to downloadable #
# subscriptions. The checksum will be validated by Adblock Plus on download #
# subscriptions. The checksum will be validated by AutoProxy on download #
# and checksum mismatches (broken downloads) will be rejected. #
# #
# To add a checksum to a subscription file, run the script like this: #
Expand Down
72 changes: 2 additions & 70 deletions chrome/content/about.xul
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dialog
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&dialog.title;"
id="adblockAboutWindow"
id="autoProxyAboutWindow"
windowtype="aup:about"
onload="fillInVersion()"
buttons="accept">
Expand All @@ -58,75 +58,7 @@

<description id="contributorsTitle" value="&contributors.label;"/>
<vbox id="contributorsBox">
<description value="Ahmad Zhafir - Malay translation"/>
<description value="Ahmet Serkan Tıratacı - Turkish translation"/>
<description value="Aigar Vals - Estonian translation"/>
<description value="Alexander Mihalkin - &quot;Morpeh Rus List&quot; filter subscription"/>
<description value="Antonio Urquia - Spanish translation of the Element Hiding Helper extension"/>
<description value="Ares2 - &quot;Ares' ABP Liste&quot; filter subscription"/>
<description value="Bahram Maravandi - Persian translation"/>
<description value="Baurzhan Muftakhidinov - Kazakh translation"/>
<description value="Bayarsaikhan Enkhtaivan - Mongolian translation"/>
<description value="Besmir Godole - Albanian translation of the Element Hiding Helper extension"/>
<description value="Blackdire - Chinese Simplified translation"/>
<description value="Brian Yi - &quot;Corset&quot; filter subscription"/>
<description value="Cédric Menge - &quot;Cédrics Liste&quot; filter subscription and many suggestions"/>
<description value="Claude Lespagnol aka Efdur - icons"/>
<description value="Claudio Périco - Brazilian Portuguese translation"/>
<description value="Dagobert_78 - French translation"/>
<description value="edo248 - Armenian translation"/>
<description value="Finn Sørensen - Danish translation"/>
<description value="Gárdonyi László - Hungarian translation"/>
<description value="Hatul - Hebrew translation"/>
<description value="Hrvoje Majer - Croatian translation"/>
<description value="Humberto Sartini - Brazilian Portuguese translation of the Element Hiding Helper extension"/>
<description value="Jacen - Slovak translation"/>
<description value="Jakub Tománek - Czech translation"/>
<description value="Jari Huttunen - Finnish translation of the Element Hiding Helper extension"/>
<description value="Jesús Vidal Panalés - Spanish translation"/>
<description value="jojaba - French translation"/>
<description value="Jonas Slivka - Lithuanian translation"/>
<description value="Joni Heinonen aka Akilles - Finnish translation"/>
<description value="Jose Sun - Chinese Traditional translation"/>
<description value="Kevin Keller - icons"/>
<description value="Kristján Bjarni Guðmundsson - Icelandic translation"/>
<description value="Leszek (teo) Życzkowski - Polish translation"/>
<description value="Luana Di Muzio - Italian translation"/>
<description value="Lukmanul Hakim - Indonesian translation"/>
<description value="Malte Kraus - &quot;Filter von Dr.Evil&quot; filter subscription"/>
<description value="Manuel Meixide - Galician translation"/>
<description value="Mark Heijl - Dutch translation of the Element Hiding Helper extension"/>
<description value="Mark Schlögel - German FAQ translation"/>
<description value="Mark Tyndall - British English translation"/>
<description value="Martin Srebotnjak - Slovenian translation"/>
<description value="MenetZ - &quot;ROList&quot; filter subscription"/>
<description value="Mikes Kaszmán István - Hungarian translation"/>
<description value="Moayad Mardini - Arabic translation"/>
<description value="MonztA - &quot;Filter von Dr.Evil&quot; filter subscription"/>
<description value="moZes - Frisian translation"/>
<description value="Navid Kashani - Persian translation"/>
<description value="NGUYỄN Mạnh Hùng - Vietnamese translation and &quot;Việt Nam List&quot; filter subscription"/>
<description value="Nickolay Ponomarev - start-up performance improvements"/>
<description value="Olexander Kasyanyuk - Ukrainian translation"/>
<description value="Paul Dicker - Dutch translation"/>
<description value="pirlouy - French translation and &quot;Liste FR&quot; filter subscription"/>
<description value="Premier - Japanese translation"/>
<description value="Raryel Costa Souza - Brasilian Portuguese translation"/>
<description value="Rick752 - EasyList filter subscription and many suggestions"/>
<description value="Rob Brown - Aardvark code reused in the Element Hiding Helper extension"/>
<description value="Robbie Groenewoudt - dutchblock filter subscription"/>
<description value="SiiiE - Hebrew translation"/>
<description value="srxo1978 - Spanish translation"/>
<description value="Stefan Lewitas - Swedish translation"/>
<description value="Stian Domben Bårdsen - Norwegian translation"/>
<description value="Suphanat Thitiphattharakon - Thai translation"/>
<description value="sushizang - Korean translation"/>
<description value="Thanos - Greek translation"/>
<description value="Timothy Babych - Ukrainian translation"/>
<description value="Toni Barrera - Catalan translation"/>
<description value="Tony Nguyen - Vietnamese translation"/>
<description value="ultravioletu - Romanian translation"/>
<description value="znaya - Portuguese translation"/>
<description value="WCM - Chinese and English translation"/>
<spacer height="5"/>
<description value="Wladimir Palant - Adblock Plus"/>
<description value="Henrik Aasted Sorensen - original Adblock"/>
Expand Down
4 changes: 2 additions & 2 deletions chrome/content/contents.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<!-- package description -->
<RDF:Description about="urn:mozilla:package:autoproxy"
chrome:displayName="Adblock Plus"
chrome:author="Wladimir Palant"
chrome:displayName="AutoProxy"
chrome:author="WCM"
chrome:name="autoproxy"
chrome:authorURL="http://autoproxy.org/"
chrome:extension="true"
Expand Down
14 changes: 7 additions & 7 deletions chrome/content/filterStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ var filterStorage =
this.file = getFileByPath(this.prefList.patternsfile[2]); // Try default

if (!this.file)
dump("Adblock Plus: Failed to resolve filter file location from extensions.autoproxy.patternsfile preference\n");
dump("AutoProxy: Failed to resolve filter file location from extensions.autoproxy.patternsfile preference\n");

let stream = null;
if (this.file)
Expand All @@ -374,7 +374,7 @@ var filterStorage =
stream = stream.QueryInterface(Components.interfaces.nsIUnicharLineInputStream);
}
catch (e) {
dump("Adblock Plus: Failed to read filters from file " + this.file.path + ": " + e + "\n");
dump("AutoProxy: Failed to read filters from file " + this.file.path + ": " + e + "\n");
stream = null;
}
}
Expand Down Expand Up @@ -432,7 +432,7 @@ var filterStorage =

/**
* Parses filter data from a stream. If the data contains user filters outside of filter
* groups (Adblock Plus 0.7.x data) these filters are returned - they need to be added
* groups (AutoProxy 0.7.x data) these filters are returned - they need to be added
* separately.
*/
parseIniFile: function(/**nsIUnicharLineInputStream*/ stream) /**Array of String*/
Expand Down Expand Up @@ -552,12 +552,12 @@ var filterStorage =
stream.init(fileStream, "UTF-8", 16384, Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
}
catch (e) {
dump("Adblock Plus: failed to create file " + tempFile.path + ": " + e + "\n");
dump("AutoProxy: failed to create file " + tempFile.path + ": " + e + "\n");
return;
}

const maxBufLength = 1024;
let buf = ["# Adblock Plus preferences", "version=" + this.formatVersion];
let buf = ["# AutoProxy preferences", "version=" + this.formatVersion];
let lineBreak = aup.getLineBreak();
function writeBuffer()
{
Expand All @@ -568,7 +568,7 @@ var filterStorage =
}
catch (e) {
stream.close();
dump("Adblock Plus: failed to write to file " + tempFile.path + ": " + e + "\n");
dump("AutoProxy: failed to write to file " + tempFile.path + ": " + e + "\n");
try {
tempFile.remove(false);
}
Expand Down Expand Up @@ -615,7 +615,7 @@ var filterStorage =
stream.close();
}
catch (e) {
dump("Adblock Plus: failed to close file " + tempFile.path + ": " + e + "\n");
dump("AutoProxy: failed to close file " + tempFile.path + ": " + e + "\n");
try {
tempFile.remove(false);
}
Expand Down
12 changes: 6 additions & 6 deletions chrome/content/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function importList()
lines.push(aup.normalizeFilter(line.value));
stream.close();

if (/\[Adblock(?:\s*Plus\s*([\d\.]+)?)?\]/i.test(lines[0]))
if (/\[AutoProxy\s+\d\.\d\.\d\]/i.test(lines[0]))
{
let minVersion = RegExp.$1;
let warning = "";
Expand Down Expand Up @@ -533,7 +533,7 @@ function exportList()
saveDefaultDir(picker.file.parent.QueryInterface(Components.interfaces.nsILocalFile));
let lineBreak = aup.getLineBreak();

let list = ["[Adblock]"];
let list = ["[AutoProxy]"];
let minVersion = "0";
for each (let subscription in treeView.subscriptions)
{
Expand Down Expand Up @@ -584,9 +584,9 @@ function exportList()
if (minVersion != "0")
{
if (aup.versionComparator.compare(minVersion, "0.7.1") >= 0)
list[0] = "[Adblock Plus " + minVersion + "]";
list[0] = "[AutoProxy " + minVersion + "]";
else
list[0] = "(Adblock Plus " + minVersion + " or higher required) " + list[0];
list[0] = "(AutoProxy " + minVersion + " or higher required) " + list[0];
}

list.push("");
Expand All @@ -612,7 +612,7 @@ function exportList()
}
catch (e)
{
dump("Adblock Plus: error writing to file: " + e + "\n");
dump("AutoProxy: error writing to file: " + e + "\n");
alert(aup.getString("filters_write_error"));
}
}
Expand Down Expand Up @@ -1262,7 +1262,7 @@ function showTreeTooltip(/**Event*/ event) /**Boolean*/
}

/**
* Opens About Adblock Plus dialog
* Opens About AutoProxy dialog
*/
function openAbout()
{
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/settings.xul
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<script type="application/x-javascript;version=1.7" src="settings.js"/>
<script type="application/x-javascript;version=1.7" src="findbar.js"/>

<keyset id="adblockKeys">
<keyset id="autoProxyKeys">
<key id="synchsubscription-key" key="t" modifiers="accel"/>
<key id="synchsubscriptions-key" key="t" modifiers="accel,shift" command="synchsubscriptions-command"/>
<key id="import-key" key="i" modifiers="accel" command="import-command"/>
Expand Down
4 changes: 2 additions & 2 deletions chrome/content/subscriptionClasses.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ DownloadableSubscription.prototype =
errors: 0,

/**
* Minimal Adblock Plus version required for this subscription
* Minimal AutoProxy version required for this subscription
* @type String
*/
requiredVersion: null,

/**
* Should be true if requiredVersion is higher than current Adblock Plus version
* Should be true if requiredVersion is higher than current AutoProxy version
* @type Boolean
*/
upgradeRequired: false,
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/synchronizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var synchronizer =
readFilters: function(subscription, text)
{
let lines = text.split(/[\r\n]+/);
if (!/\[Adblock(?:\s*Plus\s*([\d\.]+)?)?\]/i.test(lines[0]))
if (!/\[AutoProxy\s+\d\.\d\.\d\]/i.test(lines[0]))
{
this.setError(subscription, "synchronize_invalid_data");
return null;
Expand Down
2 changes: 1 addition & 1 deletion chrome/locale/en-US/about.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!ENTITY description "
AutoProxy allows you to decide what you don't want to see on the web.
You don't need to download all the ads and banners any more, if you
don't want them - tell Adblock Plus!
don't want them - tell AutoProxy!
">

<!ENTITY homepage.label "AutoProxy homepage:">
Expand Down
6 changes: 3 additions & 3 deletions chrome/locale/en-US/composer.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
-
- ***** END LICENSE BLOCK ***** -->

<!ENTITY dialog.title "Add Adblock Plus filter rule">
<!ENTITY dialog.title "AutoProxy filter rule">
<!ENTITY accept.label "Add filter">
<!ENTITY advanced.label "Advanced view">
<!ENTITY basic.label "Basic view">

<!ENTITY disabled.warning.beforeLink "Adblock Plus is currently disabled. You can still add filters but those will not be applied unless you ">
<!ENTITY disabled.warning.link "enable Adblock Plus">
<!ENTITY disabled.warning.beforeLink "AutoProxy is currently disabled. You can still add filters but those will not be applied unless you ">
<!ENTITY disabled.warning.link "enable AutoProxy">
<!ENTITY disabled.warning.afterLink ".">

<!ENTITY filter.label "New filter:">
Expand Down
18 changes: 9 additions & 9 deletions chrome/locale/en-US/global.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@

extensions.autoproxy@autoproxy.org.description=GFW were yesterday!

status_active_label=Adblock
status_active_label=AutoProxy
status_disabled_label=Disabled

action0_tooltip=Click to bring up context menu, middle-click to enable/disable.
action1_tooltip=Click to open/close blockable items, middle-click to enable/disable.
action2_tooltip=Click to open preferences, middle-click to enable/disable.
action3_tooltip=Click to enable/disable Adblock Plus.
action3_tooltip=Click to enable/disable AutoProxy.

active_tooltip=Adblock Plus is active.
disabled_tooltip=Adblock Plus is disabled.
whitelisted_tooltip=Adblock Plus is active but disabled on current page.
active_tooltip=AutoProxy is active.
disabled_tooltip=AutoProxy is disabled.
whitelisted_tooltip=AutoProxy is active but disabled on current page.

blocked_count_tooltip=-- out of --

no_blocking_suggestions=No blockable items on the current page
whitelisted_page=Adblock Plus has been disabled for the current page
whitelisted_page=AutoProxy has been disabled for the current page
whitelist_description=My Exception Rules
filterlist_description=My Ad Blocking Rules
invalid_description=My Invalid Rules
elemhide_description=My Element Hiding Rules
subscription_description=Filter subscription:
subscription_wrong_version=Some filters in this subscription require Adblock Plus -- to work properly!
subscription_wrong_version=Some filters in this subscription require AutoProxy -- to work properly!
subscription_source=Source:
subscription_status=Status:
subscription_status_autodownload=Updated automatically
Expand All @@ -55,11 +55,11 @@ subscription_status_lastdownload=Last download:
subscription_status_lastdownload_inprogress=Downloading...
subscription_status_lastdownload_unknown=N/A
remove_subscription_warning=Do you really wish to remove this subscription?
import_filters_wrong_version=Warning: some of the filters in this list require Adblock Plus -- to work properly. You should probably upgrade to the latest Adblock Plus release before importing this list.
import_filters_wrong_version=Warning: some of the filters in this list require AutoProxy -- to work properly. You should probably upgrade to the latest AutoProxy release before importing this list.
import_filters_warning=Do you wish to replace your current filters or append the new filters at the end of the list?
import_filters_title=Import filters
export_filters_title=Export filters
invalid_filters_file=Not a valid Adblock Plus filters file.
invalid_filters_file=Not a valid AutoProxy filters file.
filters_write_error=There was an error writing filters to the file. Make sure the file isn't write protected or hold by another program.
clearall_warning=Do you really wish to remove all filters from the list?
resethitcounts_warning=Do you really wish to reset hit counts for all filters back to zero? This operation can't be undone!
Expand Down
Loading

0 comments on commit 570d846

Please sign in to comment.