Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Merge branch 'cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbowes committed Mar 1, 2017
2 parents a763241 + b567a8d commit d39f3d8
Show file tree
Hide file tree
Showing 111 changed files with 484 additions and 1,675 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
builds/*
chrome/content/useragentswitcher/about/about.xul
chrome/content/useragentswitcher/options/options.js
chrome/content/useragentswitcher/upgrade.js
install.rdf
94 changes: 94 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
SHELL = /bin/sh

BROWSER ?= $(if $(and $(DISPLAY),$(XDG_SESSION_ID)),xdg-open, \
$(if $(and $(COMSPEC),$(OS)),start,firefox))

CURL ?= curl
ECHO ?= echo
MARKDOWN ?= Markdown.pl
MKDIR ?= install -d -m 755
RM ?= rm -f
RMDIR ?= $(RM) -r
SED ?= sed
ZIP ?= zip -q -r -9

AMO_API_KEY ?= user:12345678:987
AMO_API_SECRET ?= 28934y23i4h32i4j23nk4j3244
AMO_DOM ?= allizom.org
JWT ?= $(strip $(shell jwtgen --api-key $(AMO_API_KEY) --api-secret $(AMO_API_SECRET)))

# Default to all locales, but it can be overridden
LINGUAS ?= *
locales = $(notdir $(wildcard $(addprefix source/locale_common/,$(addsuffix *,en $(LINGUAS)))))

ID = $(call jq,.applications.gecko.id)
VERSION = $(call jq,.version)

jq = $(shell jq -r $(1) $(if $(2),$(2),manifest.json))

out_prefix = $(if $(findstring $(firstword $(sort 2 $(words $(locales)))),2),-localized,)
out_xpi = builds/user-agent-switcher-$(VERSION)$(out_prefix).xpi
signed_xpi = $(out_xpi:.xpi=-signed.xpi)

common_files = $(addprefix chrome/content/useragentswitcher/,about/common_about.xul common_upgrade.js options/common_options.js) common_install.rdf
generated_files = $(subst common_,,$(common_files))

.PHONY: all build clean chrome distclean generate install sign-download sign-submit update-translations xpi
all build xpi: generate $(out_xpi)
generate: $(generated_files) $(wildcard docs/*.html)

clean:
$(RM) $(wildcard builds/*.xpi)
$(RM) $(wildcard config.sed)
$(RM) $(wildcard $(generated_files))

distclean: clean
$(RMDIR) $(wildcard builds)

install: sign
$(BROWSER) $(out_xpi)

sign-download:
$(CURL) -H "Authorization: JWT $(JWT)" -g -o signed.json https://$(AMO_DOMAIN)/api/v3/addons/$(ID)/versions/$(VERSION)/
$(if $(findstring true,$(call jq,.files[0].signed,signed.json)),\
$(CURL) -g -o $(signed_xpi) -H "Authorization: JWT $(JWT)" $(call jq,.files[0].download_url,signed.json),\
$(error Not signed))
$(RM) signed.json

sign-send: $(out_xpi)
$(CURL) -H "Authorization: JWT $(JWT)" -H "Content-type: multipart/form-data -XPUT -g --form "upload=@$(out_xpi)" https://addons.$(AMO_DOM)/api/v3/addons/$(ID)/versions/$(VERSION)/

dtd_files ::= $(addsuffix /useragentswitcher/useragentswitcher.dtd,$(wildcard chrome/locale/*))
update-translations: $(dtd_files)
$(dtd_files): $(addprefix chrome/locale/en-US/useragentswitcher/useragentswitcher.,dtd properties)
$(MKDIR) po
-$(foreach t,$(subst /useragentswitcher/useragentswitcher.dtd,,$@), \
moz2po -t $(dir $(t))en-US $(t) po; po2moz -t $(dir $(t))en-US po $(t);)
$(RMDIR) po

docs/index.html: README.md
$(MKDIR) $(dir $@)
$(file > $@,<title>User Agent Switcher Overview</title>)
$(file >> $@,$(shell $(MARKDOWN) $<))
-tidy -config docs/tidy.conf $@

docs/help.html: docs/HELP.md
$(MKDIR) $(dir $@)
$(file > $@,<title>User Agent Switcher Help</title>)
$(file >> $@,$(shell $(MARKDOWN) $<))
-tidy -config docs/tidy.conf $@

$(generated_files): $(common_files)
$(SED) \
-e 's/@author@/$(call jq,.author)/g' \
-e 's/@description@/$(call jq,.description)/g' \
-e 's,@home\.page@,$(call jq,.homepage_url),g' \
-e 's/@name@/$(call jq,.name)/g' \
-e 's/@id@/$(ID)/g' \
-e 's,@user\.agents\.page@,$(call jq,.useragents_download),g' \
-e 's/@version@/$(VERSION)/g' \
$(dir $@)$(addprefix common_,$(notdir $@)) > $@

$(out_xpi): chrome chrome.manifest install.rdf
$(MKDIR) builds
$(ZIP) $@ $^ license.txt $(foreach f,$(common_files),-x $(f))
3 changes: 1 addition & 2 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ Of course, I recommend you use a current version of a maintained application if
Currently my planned releases are:

* ~~0.8: My first release, separating it from the original. Maybe it should be 0.7.4, as there are no major changes, but just some annoyances I've had have been fixed (persistent settings, the name of the menu item stays the same, fix for Netflix not working with the Tech Patterns list).~~
* 0.8.1: Make this an extractionless, restartless extension. Self-signing will give way to signing from mozilla.org. No more English-only builds.
* 0.9: This should be a hybrid XPCOM/WebExtension in browsers that support it, or pure XPCOM in those that don't. Chris Pederick's list of issues and to-dos will be fixed in the WebExtensions and shared code. Not much might be different from 0.8.1 in the XPCOM code.
* 1.0: Completely separate XPCOM and WebExtension extensions. They might share the same tree or I might create a branch for the legacy extension. Doubtlessly other features and bug fixes.

## Help

* [Help](http://chrispederick.com/work/user-agent-switcher/help/)
* [Help](https://github.com/keithbowes/docs/help.html)
* [Known issues](https://github.com/keithbowes/user-agent-switcher/issues/)

## Acknowledgements
Expand Down
38 changes: 38 additions & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
content useragentswitcher chrome/content/useragentswitcher/

locale useragentswitcher be-BY chrome/locale/be-BY/useragentswitcher/
locale useragentswitcher cs-CZ chrome/locale/cs-CZ/useragentswitcher/
locale useragentswitcher da-DK chrome/locale/da-DK/useragentswitcher/
locale useragentswitcher de-DE chrome/locale/de-DE/useragentswitcher/
locale useragentswitcher en-US chrome/locale/en-US/useragentswitcher/
locale useragentswitcher es-AR chrome/locale/es-AR/useragentswitcher/
locale useragentswitcher es-ES chrome/locale/es-ES/useragentswitcher/
locale useragentswitcher eu-ES chrome/locale/eu-ES/useragentswitcher/
locale useragentswitcher fi-FI chrome/locale/fi-FI/useragentswitcher/
locale useragentswitcher fr-FR chrome/locale/fr-FR/useragentswitcher/
locale useragentswitcher fy-NL chrome/locale/fy-NL/useragentswitcher/
locale useragentswitcher he-IL chrome/locale/he-IL/useragentswitcher/
locale useragentswitcher hu-HU chrome/locale/hu-HU/useragentswitcher/
locale useragentswitcher it-IT chrome/locale/it-IT/useragentswitcher/
locale useragentswitcher ja-JP chrome/locale/ja-JP/useragentswitcher/
locale useragentswitcher ko-KR chrome/locale/ko-KR/useragentswitcher/
locale useragentswitcher lt-LT chrome/locale/lt-LT/useragentswitcher/
locale useragentswitcher mk-MK chrome/locale/mk-MK/useragentswitcher/
locale useragentswitcher nl-NL chrome/locale/nl-NL/useragentswitcher/
locale useragentswitcher pl-PL chrome/locale/pl-PL/useragentswitcher/
locale useragentswitcher pt-BR chrome/locale/pt-BR/useragentswitcher/
locale useragentswitcher pt-PT chrome/locale/pt-PT/useragentswitcher/
locale useragentswitcher ro-RO chrome/locale/ro-RO/useragentswitcher/
locale useragentswitcher ru-RU chrome/locale/ru-RU/useragentswitcher/
locale useragentswitcher sk-SK chrome/locale/sk-SK/useragentswitcher/
locale useragentswitcher tr-TR chrome/locale/tr-TR/useragentswitcher/
locale useragentswitcher uk-UA chrome/locale/uk-UA/useragentswitcher/
locale useragentswitcher zh-CN chrome/locale/zh-CN/useragentswitcher/
locale useragentswitcher zh-TW chrome/locale/zh-TW/useragentswitcher/

overlay chrome://browser/content/browser.xul chrome://useragentswitcher/content/useragentswitcher.xul
overlay chrome://navigator/content/navigator.xul chrome://useragentswitcher/content/useragentswitcher.xul
skin useragentswitcher classic/1.0 chrome/skin/classic/useragentswitcher/
style chrome://browser/content/browser.xul chrome://useragentswitcher/skin/useragentswitcher.css
style chrome://global/content/customizeToolbar.xul chrome://useragentswitcher/skin/useragentswitcher.css
style chrome://navigator/content/navigator.xul chrome://useragentswitcher/skin/useragentswitcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ separator, #useragentswitcher-about-dialog
padding-right: 35px;
}

.date
{
color: #999999;
}

.name
{
font-size: x-large;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<description class="name">@name@</description>
<description class="name">@version@</description>
</hbox>
<description class="title">&useragentswitcher.build.date;</description>
<description class="date">@build.date@</description>
<description class="title">&useragentswitcher.author;</description>
<description>@author@</description>
<description onclick="UserAgentSwitcherAbout.openURL(this)" class="url">@home.page@</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Імя прыкладання:">
<!ENTITY useragentswitcher.app.version "Версія прыкладання:">
<!ENTITY useragentswitcher.author "Аўтар">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Па змаўчанні">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Název aplikace:">
<!ENTITY useragentswitcher.app.version "Verze aplikace:">
<!ENTITY useragentswitcher.author "Autor">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Výchozí">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "App navn:">
<!ENTITY useragentswitcher.app.version "App version:">
<!ENTITY useragentswitcher.author "Forfatter">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Standard">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Programmname:">
<!ENTITY useragentswitcher.app.version "Programmversion:">
<!ENTITY useragentswitcher.author "Autor">
<!ENTITY useragentswitcher.build.date "Erstellungsdatum">
<!ENTITY useragentswitcher.copy "Kopieren">
<!ENTITY useragentswitcher.cut "Schneiden">
<!ENTITY useragentswitcher.default.user.agent "Standard">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "App Name:">
<!ENTITY useragentswitcher.app.version "App Version:">
<!ENTITY useragentswitcher.author "Author">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Default User Agent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Nombre de la Aplicación:">
<!ENTITY useragentswitcher.app.version "Versión de la Aplicación:">
<!ENTITY useragentswitcher.author "Autor">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Valores por defecto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Nombre de aplicaci&#243;n:">
<!ENTITY useragentswitcher.app.version "Version de aplicaci&#243;n:">
<!ENTITY useragentswitcher.author "Autor">
<!ENTITY useragentswitcher.build.date "Fecha de la versi&#243;n">
<!ENTITY useragentswitcher.copy "Copiar">
<!ENTITY useragentswitcher.cut "Cortar">
<!ENTITY useragentswitcher.default.user.agent "Agente de usuario predeterminado">
Expand Down
15 changes: 15 additions & 0 deletions chrome/locale/es-ES/useragentswitcher/useragentswitcher.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
useragentswitcher_defaultUserAgent=Default User Agent
useragentswitcher_deleteFolderConfirmation=\\00BFEst\\00E1 seguro de que quiere eliminar esta carpeta? (Todos los agentes de usuario en esta carpeta tambi\\00E9n ser\\00E1n eliminados.)
useragentswitcher_deleteMultipleConfirmation=\\00BFEst\\00E1 seguro de que quiere eliminar todos los agentes de usuario, carpetas y separadores seleccionados? (Todos los agentes de usuario en cualquiera de las carpetas seleccionadas tambi\\00E9n ser\\00E1n eliminados.)
useragentswitcher_deleteUserAgentConfirmation=\\00BFEst\\00E1 seguro de que quiere eliminar este agente de usuario?
useragentswitcher_editUserAgent=Editar agente de usuario
useragentswitcher_exportFileFailed=El fichero '%S' no era escribible.
useragentswitcher_exportUserAgents=Exportar agentes de usuario
useragentswitcher_importFileFailed=El fichero '%S' o bien no se encontr\\00F3 o no era legible.
useragentswitcher_importParserError=El fichero '%S' no ten\\00EDa el formato correcto.
useragentswitcher_importUserAgents=Importar agentes de usuario
useragentswitcher_newUserAgent=Nuevo agente de usuario
useragentswitcher_reset=Restablecer
useragentswitcher_resetConfirmation=\\00BFEst\\00E1 seguro de que quiere restablecer todas las opciones de User Agent Switcher incluyendo la lista de agentes de usuario?
useragentswitcher_whatsNew=You just upgraded to a new version. Would you like to see what's new?
useragentswitcher_xmlFileDescription=Ficheros XML
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Apl. Izena:">
<!ENTITY useragentswitcher.app.version "Apl. Bertsioa:">
<!ENTITY useragentswitcher.author "Egilea">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Lehenetsia">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "Ohjelman nimi:">
<!ENTITY useragentswitcher.app.version "Ohjelman versio:">
<!ENTITY useragentswitcher.author "Tekijä">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Oletus">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "App Name (nom de l&apos;application)&#160;:">
<!ENTITY useragentswitcher.app.version "App Version (version de l&apos;application):">
<!ENTITY useragentswitcher.author "Auteur">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Par défaut">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "App. Namme:">
<!ENTITY useragentswitcher.app.version "App. Ferzje">
<!ENTITY useragentswitcher.author "Auteur">
<!ENTITY useragentswitcher.build.date "Build Date">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Standert">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY useragentswitcher.app.name "שם יישום:">
<!ENTITY useragentswitcher.app.version "גירסאת יישום:">
<!ENTITY useragentswitcher.author "יוצר">
<!ENTITY useragentswitcher.build.date "תאריך בנייה">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "ברירת מחדל">
Expand Down
52 changes: 52 additions & 0 deletions chrome/locale/hu-HU/useragentswitcher/useragentswitcher.dtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!ENTITY useragentswitcher.about "Névjegy...">
<!ENTITY useragentswitcher.about.key "N">
<!ENTITY useragentswitcher.about.title "A Böngésző Azonosító Váltó névjegye">
<!ENTITY useragentswitcher.allow.empty.properties "Allow Empty Properties">
<!ENTITY useragentswitcher.allow.empty.properties.tooltip "Let empty fields override default values">
<!ENTITY useragentswitcher.app.code.name "App Code Name:">
<!ENTITY useragentswitcher.app.name "Programnév:">
<!ENTITY useragentswitcher.app.version "Programverzió:">
<!ENTITY useragentswitcher.author "Készítő">
<!ENTITY useragentswitcher.copy "Copy">
<!ENTITY useragentswitcher.cut "Cut">
<!ENTITY useragentswitcher.default.user.agent "Alapértelmezett">
<!ENTITY useragentswitcher.default.user.agent.key "A">
<!ENTITY useragentswitcher.delete "Eltávolítás...">
<!ENTITY useragentswitcher.description "Leírás:">
<!ENTITY useragentswitcher.download.user.agents "Download lists of user agents to import...">
<!ENTITY useragentswitcher.edit "Szerkesztés...">
<!ENTITY useragentswitcher.edit.user.agents "Edit User Agents...">
<!ENTITY useragentswitcher.edit.user.agents.key "B">
<!ENTITY useragentswitcher.export "Exportálás...">
<!ENTITY useragentswitcher.general "Általános">
<!ENTITY useragentswitcher.help "Súgó...">
<!ENTITY useragentswitcher.help.key "S">
<!ENTITY useragentswitcher.home.page "Honlap">
<!ENTITY useragentswitcher.import "Importálás...">
<!ENTITY useragentswitcher.import.export "Importálás/Exportálás">
<!ENTITY useragentswitcher.import.overwrite "Létező böngésző azonosítók felülírása importáláskor">
<!ENTITY useragentswitcher.menu.hide "Böngésző Azonosító Váltó menüelem elrejtése az Eszközök menüből">
<!ENTITY useragentswitcher.move.down "Mozgatás lefelé">
<!ENTITY useragentswitcher.move.up "Mozgatás felfelé">
<!ENTITY useragentswitcher.name "Böngésző Azonosító Váltó">
<!ENTITY useragentswitcher.name.key "U">
<!ENTITY useragentswitcher.name.label "Name:">
<!ENTITY useragentswitcher.new "New">
<!ENTITY useragentswitcher.new.folder "New Folder...">
<!ENTITY useragentswitcher.new.separator "New Separator">
<!ENTITY useragentswitcher.new.user.agent "New User Agent...">
<!ENTITY useragentswitcher.new.user.agent.description "The default user agent values are displayed below. Add a description and edit any of the values to create a new user agent.">
<!ENTITY useragentswitcher.options "Beállítások...">
<!ENTITY useragentswitcher.options.key "B">
<!ENTITY useragentswitcher.options.title "Böngésző Azonosító Váltó Beállítások">
<!ENTITY useragentswitcher.paste "Paste">
<!ENTITY useragentswitcher.platform "Platform:">
<!ENTITY useragentswitcher.reset.options "Alapértelmezett beállítások...">
<!ENTITY useragentswitcher.reset.on.close "Reset on close">
<!ENTITY useragentswitcher.test "Test...">
<!ENTITY useragentswitcher.test.key "T">
<!ENTITY useragentswitcher.user.agent "User Agent">
<!ENTITY useragentswitcher.user.agent.label "Böngésző azonosító:">
<!ENTITY useragentswitcher.user.agents "Böngésző azonosítók">
<!ENTITY useragentswitcher.vendor "Szállító:">
<!ENTITY useragentswitcher.vendor.sub "További szállító:">
Loading

0 comments on commit d39f3d8

Please sign in to comment.