Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • trisquel/package-helpers
  • aklis/package-helpers
  • leny2010/package-helpers
  • fr33domlover/package-helpers
  • Legimet/package-helpers
  • ralphtheninja/package-helpers
  • damo22/package-helpers
  • wherrfrye/package-helpers
  • habs/package-helpers
  • pehjota/package-helpers
  • kpengboy/package-helpers
  • alvaro/package-helpers
  • salman/package-helpers
  • pabloyoyoista/package-helpers
  • mixalis/package-helpers
  • jorgesumle/package-helpers
  • a_slacker_here/package-helpers
  • chaosmonk/package-helpers
  • Beformed/package-helpers
  • dknight/package-helpers
  • proninyaroslav/package-helpers
  • adfeno/package-helpers
  • snd/package-helpers
  • davidpgil/package-helpers
  • diopon/package-helpers
  • ruben/package-helpers
  • bandali/package-helpers
  • joshaspinall/package-helpers
  • GNUtoo/package-helpers
  • Ark74/package-helpers
  • dragestil/package-helpers
  • bill-auger/package-helpers
  • andi89gi/package-helpers
  • Fikar/package-helpers
  • davidl/package-helpers
  • jas/package-helpers
  • parodper/package-helpers
  • David_Hedlund/package-helpers
  • dinomug/package-helpers
  • bf/package-helpers
  • hartkemd/package-helpers
  • del111/package-helpers
  • jxself/package-helpers
  • JacobK/package-helpers
44 results
Show changes
Showing
with 884 additions and 865 deletions
#!/bin/sh
# Copyright (C) 2021, Trisquel GNU/Linux developers <trisquel-devel@listas.trisquel.info>
# Copyright (C) 2012-2014, Benjamin Drung <bdrung@debian.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
COMMAND="${0%/*}/trisquel-distro-info"
. "${0%/*}/shunit2-helper-functions.sh"
testAll() {
local result="toutanis
belenos
flidas
etiona"
local pattern=$(echo $result | sed "s/ /\\\\|/g")
success "--date 2019-07-07 --all | grep -w \"$pattern\"" "$result"
success "-a | grep -w \"$pattern\"" "$result"
}
testDevel() {
success "--date 2019-01-10 --devel" "etiona"
success "--date 2017-05-10 -d --codename" "flidas"
}
testLatest() {
success "--date 2014-01-10 --latest" "belenos"
success "--date 2015-05-10 -l --codename" "belenos"
}
testLTS() {
success "--lts --date=2013-05-10" "toutanis"
}
testStable() {
success "--date=2014-01-10 -c --stable" "toutanis"
success "--date=2019-01-10 -s" "flidas"
}
testSupported() {
local result="belenos
flidas
etiona"
success "--date=2018-05-10 --supported" "$result"
}
testUnsupported() {
local result="dwyn"
success "--date=2011-01-10 --unsupported" "$result"
}
testFullname() {
success "--date=2013-08-10 --fullname --lts" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis"'
success "--date=2013-08-10 --fullname --lts -y" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -152'
success "--date=2013-08-10 --fullname --lts --days" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -152'
success "--date=2013-08-10 --fullname --lts -ycreated" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -667'
success "--date=2013-08-10 --fullname --lts --days=created" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -667'
success "--date=2013-08-10 --fullname --lts -yrelease" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -152'
success "--date=2013-08-10 --fullname --lts --days=release" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" -152'
success "--date=2013-08-10 --fullname --lts -yeol" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" 1357'
success "--date=2013-08-10 --fullname --lts --days=eol" \
'Trisquel GNU/Linux 6.0 LTS "Toutanis" 1357'
}
testRelease() {
success "--date=2013-08-10 --lts --release" "6.0 LTS"
success "--date=2013-08-10 --lts --release -ycreated" \
"6.0 LTS -667"
success "--date=2013-08-10 --lts --release --days=created" \
"6.0 LTS -667"
success "--date=2013-08-10 --lts --release --days" \
"6.0 LTS -152"
success "--date=2013-08-10 --lts --release -y" \
"6.0 LTS -152"
success "--date=2013-08-10 --lts --release --days=release" \
"6.0 LTS -152"
success "--date=2013-08-10 --lts --release -yrelease" \
"6.0 LTS -152"
success "--date=2013-08-10 --lts --release --days=eol" \
"6.0 LTS 1357"
success "--date=2013-08-10 --lts --release -yeol" \
"6.0 LTS 1357"
success "--date=2013-11-10 -r --stable" "6.0 LTS"
}
testSeries() {
success "-r --series etiona" "9.0 LTS"
}
testCombinedShortform() {
success "-fs --date=2013-08-10" 'Trisquel GNU/Linux 6.0 LTS "Toutanis"'
}
testReleaseDate() {
success "--date 2013-08-10 -s" "toutanis"
success "--date 2016-11-03 -d" "flidas"
success "--date 2018-04-18 -s" "flidas"
success "--date 2020-10-16 -d" "nabia"
}
testHelp() {
local help='Usage: trisquel-distro-info [options]
Options:
-h --help show this help message and exit
--date=DATE date for calculating the version (default: today)
--series=SERIES series to calculate the version for
-y[MILESTONE] additionally, display days until milestone
--days=[MILESTONE] (created, release, eol)
-a --all list all known versions
-d --devel latest development version
-s --stable latest stable version
--lts latest long term support (LTS) version
--supported list of all supported versions (including development)
--unsupported list of all unsupported stable versions
-c --codename print the codename (default)
-f --fullname print the full name
-r --release print the release version
See trisquel-distro-info(1) for more info.'
success "--help" "$help"
success "-h" "$help"
}
testExactlyOne() {
local result='trisquel-distro-info: You have to select exactly one of --all, --devel, --latest, --lts, --stable, --supported, --series, --unsupported.'
failure "" "$result"
failure "--date=2013-08-10 -sad" "$result"
}
testUnrecognizedOption() {
failure "--bar" "trisquel-distro-info: unrecognized option \`--bar'"
failure "-z" "trisquel-distro-info: unrecognized option \`-z'"
failure "--testing" "trisquel-distro-info: unrecognized option \`--testing'"
failure "--oldstable" "trisquel-distro-info: unrecognized option \`--oldstable'"
}
testUnrecognizedArguments() {
failure "foo" "trisquel-distro-info: unrecognized arguments: foo"
failure "foo --all bar" "trisquel-distro-info: unrecognized arguments: foo bar"
}
testMissingArgumentDate() {
failure "--date" "trisquel-distro-info: option \`--date' requires an argument DATE"
}
testMissingArgumentSeries() {
failure "--series" "trisquel-distro-info: option \`--series' requires an argument SERIES"
}
testDistributionDataOutdated() {
local future_year=$(expr $(date +"%Y" --date=now) + 7)
local outdated_e="Distribution data outdated.
Please check for an update for distro-info-data. See /usr/share/doc/distro-info-data/README.Debian for details."
failure "--date 1970-10-03 --lts" "trisquel-distro-info: $outdated_e"
failure "--date ${future_year}-10-03 -s" "trisquel-distro-info: $outdated_e"
failure "--date ${future_year}-10-03 -d" "trisquel-distro-info: $outdated_e"
failure "--date ${future_year}-10-03 -l" "trisquel-distro-info: $outdated_e"
}
testInvalidDate() {
failure "--date fail -s" "trisquel-distro-info: invalid date \`fail'"
failure "--date=2010-02-30 -d" "trisquel-distro-info: invalid date \`2010-02-30'"
}
testInvalidSeries() {
failure "--series wr0ng" "trisquel-distro-info: invalid distribution series \`wr0ng'"
}
testMultipleDates() {
failure "--date 2007-06-05 -s --date 2004-03-02" "trisquel-distro-info: Date specified multiple times."
}
testMultipleSeries() {
failure "--series flidas --series etiona" "trisquel-distro-info: series requested multiple times."
}
testUnknownSeries() {
failure "--series foobar" "trisquel-distro-info: unknown distribution series \`foobar'"
}
testDays() {
# day after belenos released
date=2014-11-04
success "--date=$date --lts" "belenos"
success "--date=$date --lts --days=created" "-383"
success "--date=$date --lts --days=created -c" "belenos -383"
success "--date=$date --lts --days=created -f" "Trisquel GNU/Linux 7.0 LTS \"Belenos\" -383"
success "--date=$date --lts --days=created -r" "7.0 LTS -383"
success "--date=$date --lts --days=release" "-1"
success "--date=$date --lts --days=release -c" "belenos -1"
success "--date=$date --lts --days=release -f" "Trisquel GNU/Linux 7.0 LTS \"Belenos\" -1"
success "--date=$date --lts --days=release -r" "7.0 LTS -1"
success "--date=$date --lts --days" "-1"
success "--date=$date --lts --days -c" "belenos -1"
success "--date=$date --lts --days -f" "Trisquel GNU/Linux 7.0 LTS \"Belenos\" -1"
success "--date=$date --lts --days -r" "7.0 LTS -1"
success "--date=$date --lts --days=eol" "1633"
success "--date=$date --lts --days=eol -c" "belenos 1633"
success "--date=$date --lts --days=eol -f" "Trisquel GNU/Linux 7.0 LTS \"Belenos\" 1633"
success "--date=$date --lts --days=eol -r" "7.0 LTS 1633"
# date flidas released
date=2018-04-18
success "--date=$date --lts" "flidas"
success "--date=$date --lts --days=created" "-909"
success "--date=$date --lts --days=created -c" "flidas -909"
success "--date=$date --lts --days=created -f" "Trisquel GNU/Linux 8.0 LTS \"Flidas\" -909"
success "--date=$date --lts --days=created -r" "8.0 LTS -909"
success "--date=$date --lts --days=release" "0"
success "--date=$date --lts --days=release -c" "flidas 0"
success "--date=$date --lts --days=release -f" "Trisquel GNU/Linux 8.0 LTS \"Flidas\" 0"
success "--date=$date --lts --days=release -r" "8.0 LTS 0"
success "--date=$date --lts --days" "0"
success "--date=$date --lts --days -c" "flidas 0"
success "--date=$date --lts --days -f" "Trisquel GNU/Linux 8.0 LTS \"Flidas\" 0"
success "--date=$date --lts --days -r" "8.0 LTS 0"
success "--date=$date --lts --days=eol" "1099"
success "--date=$date --lts --days=eol -c" "flidas 1099"
success "--date=$date --lts --days=eol -f" "Trisquel GNU/Linux 8.0 LTS \"Flidas\" 1099"
success "--date=$date --lts --days=eol -r" "8.0 LTS 1099"
# day before etiona was released
date=2020-10-15
success "--devel --date=$date" "nabia"
success "--devel --date=$date --days=created" "-364"
success "--devel --date=$date --days=created -c" "nabia -364"
success "--devel --date=$date --days=created -r" "10.0 LTS -364"
success "--devel --date=$date --days=created -f" "Trisquel GNU/Linux 10.0 LTS \"Nabia\" -364"
success "--devel --date=$date --days" "427"
success "--devel --date=$date --days -c" "nabia 427"
success "--devel --date=$date --days -r" "10.0 LTS 427"
success "--devel --date=$date --days -f" "Trisquel GNU/Linux 10.0 LTS \"Nabia\" 427"
success "--devel --date=$date --days=release" "427"
success "--devel --date=$date --days=release -c" "nabia 427"
success "--devel --date=$date --days=release -r" "10.0 LTS 427"
success "--devel --date=$date --days=release -f" "Trisquel GNU/Linux 10.0 LTS \"Nabia\" 427"
success "--devel --date=$date --days=eol" "1687"
success "--devel --date=$date --days=eol -c" "nabia 1687"
success "--devel --date=$date --days=eol -r" "10.0 LTS 1687"
success "--devel --date=$date --days=eol -f" "Trisquel GNU/Linux 10.0 LTS \"Nabia\" 1687"
}
. shunit2
#!/usr/bin/perl
# Copyright (C) 2011-2012, Stefano Rivera <stefanor@debian.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use strict;
use warnings;
use Test::Simple tests => 28;
use lib '.';
use Debian::DistroInfo;
sub unique {
my ($needles, $haystack) = @_;
my $unique = 0;
my %hash = ();
@hash{@$haystack}=();
for my $needle (@$needles) {
$unique++ if not exists($hash{$needle});
}
return $unique;
}
sub symmetric_difference {
my ($a, $b) = @_;
return unique($a, $b) + unique($b, $a);
}
my @all = ();
my @returned = ();
# Test our helpers:
@all = ('a', 'b', 'c');
@returned = ('a', 'b', 'c');
ok(unique(\@all, \@returned) == 0, 'unique: Matching lists');
ok(symmetric_difference(\@all, \@returned) == 0,
'symmetric_difference: Matching lists');
@returned = ('a', 'b');
ok(unique(\@all, \@returned) == 1, 'unique: 1 Unique Item');
ok(unique(\@returned, \@all) == 0, 'unique: 1 Unique Item in the haystack');
ok(symmetric_difference(\@all, \@returned) == 1,
'symmetric_difference: 1 Unique Item');
# Test DistroInfo:
my @expected = ();
my $date = Debian::DistroInfo::convert_date('2011-01-10');
my $deb = DebianDistroInfo->new();
@all = ('buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge',
'etch', 'lenny', 'squeeze', 'sid', 'experimental');
@returned = $deb->all($date);
ok(unique(\@all, \@returned) == 0, 'Debian all');
ok($deb->devel($date) eq 'sid', 'Debian devel');
ok($deb->old($date) eq 'etch', 'Debian oldstable');
ok($deb->stable($date) eq 'lenny', 'Debian stable');
ok($deb->testing($date) eq 'squeeze', 'Debian testing');
ok($deb->valid('sid'), 'Debian valid');
ok($deb->valid('stable'), 'Debian valid');
ok(!$deb->valid('foobar'), 'Debian invalid');
@expected = ('lenny', 'squeeze', 'sid', 'experimental');
@returned = $deb->supported($date);
ok(symmetric_difference(\@expected, \@returned) == 0,
'Debian supported');
@expected = ('buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge',
'etch');
@returned = $deb->unsupported($date);
ok(symmetric_difference(\@expected, \@returned) == 0,
'Debian unsupported');
ok(!defined($deb->codename('foo')), 'Debian codename, invalid');
ok($deb->codename('testing', $date) eq $deb->testing($date),
'Debian codename');
my $tris = TrisquelDistroInfo->new();
@all = ('robur',
'dwyn',
'awen',
'taranis',
'slaine',
'dagda');
@returned = $tris->all($date);
ok(unique(\@all, \@returned) == 0, 'Trisquel GNU/Linux all');
ok($tris->devel($date) eq 'dagda', 'Trisquel GNU/Linux devel');
ok($tris->lts($date) eq 'taranis', 'Trisquel GNU/Linux LTS');
ok($tris->stable($date) eq 'taranis', 'Trisquel GNU/Linux stable');
ok($tris->valid('taranis'), 'Trisquel GNU/Linux valid');
ok(!$tris->valid(42), 'Trisquel GNU/Linux invalid');
ok($tris->is_lts('taranis'), 'Trisquel GNU/Linux is_lts');
ok(!$tris->is_lts(42), 'Trisquel GNU/Linux !is_lts');
ok(!$tris->is_lts('awen'), 'Trisquel GNU/Linux !is_lts');
#@expected = ('robur', 'awen', 'taranis');
@expected = ('robur', 'awen', 'taranis', 'slaine', 'dagda');
@returned = $tris->supported($date);
ok(symmetric_difference(\@expected, \@returned) == 0,
'Trisquel GNU/Linux supported');
@expected = ('dwyn');
@returned = $tris->unsupported($date);
ok(symmetric_difference(\@expected, \@returned) == 0,
'Trisquel GNU/Linux unsupported');
# vi: set et sta sw=4 ts=4:
# test_distro_info.py - Test suite for distro_info
#
# Copyright (C) 2021, Trisquel GNU/Linux developers <trisquel-devel@listas.trisquel.info>
# Copyright (C) 2011, Benjamin Drung <bdrung@debian.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""Test suite for distro_info"""
import datetime
from distro_info_test import unittest
from distro_info import DebianDistroInfo, TrisquelDistroInfo
class DebianDistroInfoTestCase(unittest.TestCase): # pylint: disable=too-many-public-methods
"""TestCase object for distro_info.DebianDistroInfo"""
def setUp(self): # pylint: disable=invalid-name
self._distro_info = DebianDistroInfo()
self._date = datetime.date(2011, 1, 10)
def test_all(self):
"""Test: List all known Debian distributions."""
all_distros = set(["buzz", "rex", "bo", "hamm", "slink", "potato",
"woody", "sarge", "etch", "lenny", "squeeze", "sid",
"experimental"])
self.assertEqual(all_distros - set(self._distro_info.all), set())
def test_devel(self):
"""Test: Get latest development Debian distribution."""
self.assertEqual(self._distro_info.devel(self._date), "sid")
def test_old(self):
"""Test: Get old (stable) Debian distribution."""
self.assertEqual(self._distro_info.old(self._date), "etch")
def test_stable(self):
"""Test: Get latest stable Debian distribution."""
self.assertEqual(self._distro_info.stable(self._date), "lenny")
def test_supported(self):
"""Test: List all supported Debian distribution."""
self.assertEqual(self._distro_info.supported(self._date),
["lenny", "squeeze", "sid", "experimental"])
def test_testing(self):
"""Test: Get latest testing Debian distribution."""
self.assertEqual(self._distro_info.testing(self._date), "squeeze")
def test_valid(self):
"""Test: Check for valid Debian distribution."""
self.assertTrue(self._distro_info.valid("sid"))
self.assertTrue(self._distro_info.valid("stable"))
self.assertFalse(self._distro_info.valid("foobar"))
def test_unsupported(self):
"""Test: List all unsupported Debian distribution."""
unsupported = ["buzz", "rex", "bo", "hamm", "slink", "potato", "woody",
"sarge", "etch"]
self.assertEqual(self._distro_info.unsupported(self._date), unsupported)
def test_codename(self):
"""Test: Codename decoding"""
self.assertIsNone(self._distro_info.codename('foobar'))
self.assertEqual(self._distro_info.codename('testing', self._date),
self._distro_info.testing(self._date))
def test_codename_result(self):
"""Test: Check result set to codename."""
self.assertEqual(self._distro_info.old(self._date, "codename"), "etch")
self.assertEqual(self._distro_info.devel(self._date, result="codename"),
"sid")
def test_fullname(self):
"""Test: Check result set to fullname."""
self.assertEqual(self._distro_info.stable(self._date, "fullname"),
'Debian 5.0 "Lenny"')
result = self._distro_info.testing(self._date, result="fullname")
self.assertEqual(result, 'Debian 6.0 "Squeeze"')
def test_release(self):
"""Test: Check result set to release."""
self.assertEqual(self._distro_info.devel(self._date, "release"), "")
self.assertEqual(self._distro_info.testing(self._date, "release"),
"6.0")
self.assertEqual(self._distro_info.stable(self._date, result="release"),
"5.0")
class TrisquelDistroInfoTestCase(unittest.TestCase): # pylint: disable=too-many-public-methods
"""TestCase object for distro_info.TrisquelDistroInfo"""
def setUp(self): # pylint: disable=invalid-name
self._distro_info = TrisquelDistroInfo()
self._date = datetime.date(2011, 1, 10)
def test_all(self):
"""Test: List all known Trisquel distributions."""
all_distros = set(["robur",
"dwyn",
"awen",
"taranis",
"slaine",
"dagda",
"brigantia",
"toutanis",
"belenos",
"flidas",
"etiona",
"nabia"])
self.assertEqual(all_distros - set(self._distro_info.all), set())
def test_devel(self):
"""Test: Get latest development Trisquel distribution."""
self.assertEqual(self._distro_info.devel(self._date), "dagda")
def test_lts(self):
"""Test: Get latest long term support (LTS) Trisquel distribution."""
self.assertEqual(self._distro_info.lts(self._date), "taranis")
def test_stable(self):
"""Test: Get latest stable Trisquel distribution."""
self.assertEqual(self._distro_info.stable(self._date), "taranis")
def test_supported(self):
"""Test: List all supported Trisquel distribution."""
supported = ["robur", "awen", "taranis", "slaine", "dagda"]
self.assertEqual(self._distro_info.supported(self._date), supported)
def test_unsupported(self):
"""Test: List all unsupported Trisquel distributions."""
unsupported = ["dwyn"]
self.assertEqual(self._distro_info.unsupported(self._date), unsupported)
def test_current_unsupported(self):
"""Test: List all unsupported Trisquel distributions today."""
unsupported = set(["robur",
"dwyn"])
self.assertEqual(unsupported -
set(self._distro_info.unsupported()), set())
def test_valid(self):
"""Test: Check for valid Trisquel distribution."""
self.assertTrue(self._distro_info.valid("taranis"))
self.assertFalse(self._distro_info.valid("42"))
def test_is_lts(self):
"""Test: Check if Trisquel distribution is an LTS."""
self.assertTrue(self._distro_info.is_lts("taranis"))
self.assertFalse(self._distro_info.is_lts("42"))
self.assertFalse(self._distro_info.is_lts("warty"))
def test_codename(self):
"""Test: Check result set to codename."""
self.assertEqual(self._distro_info.lts(self._date, "codename"), "taranis")
self.assertEqual(self._distro_info.devel(self._date, result="codename"),
"dagda")
def test_fullname(self):
"""Test: Check result set to fullname."""
self.assertEqual(self._distro_info.stable(self._date, "fullname"),
'Trisquel 4.0 LTS "Taranis"')
self.assertEqual(self._distro_info.lts(self._date, result="fullname"),
'Trisquel 4.0 LTS "Taranis"')
def test_release(self):
"""Test: Check result set to release."""
self.assertEqual(self._distro_info.devel(self._date, "release"),
"5.0")
self.assertEqual(self._distro_info.lts(self._date, result="release"),
"4.0 LTS")
# Copyright © 2008 Ian Jackson <ijackson@chiark.greenend.org.uk>
# Copyright © 2008 Canonical, Ltd.
# written by Colin Watson <cjwatson@ubuntu.com>
# Copyright © 2008 James Westby <jw+debian@jameswestby.net>
# Copyright © 2009 Raphaël Hertzog <hertzog@debian.org>
# Copyright © 2022 Ruben Rodriguez <ruben@trisquel.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -11,59 +16,85 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
package Dpkg::Vendor::Trisquel;
use strict;
use warnings;
our $VERSION = "0.01";
our $VERSION = '0.01';
use base qw(Dpkg::Vendor::Default);
use Dpkg::ErrorHandling;
use Dpkg::Gettext;
use Dpkg::Control::Types;
use Dpkg::Vendor::Ubuntu;
use parent qw(Dpkg::Vendor::Debian);
=encoding utf8
=head1 NAME
Dpkg::Vendor::Trisquel - Trisquel vendor object
Dpkg::Vendor::Trisquel - Trisquel vendor class
=head1 DESCRIPTION
This vendor object customize the behaviour of dpkg scripts
for Debian specific actions.
This vendor class customizes the behaviour of dpkg scripts for Trisquel
specific behavior and policies.
=cut
sub run_hook {
my ($self, $hook, @params) = @_;
if ($hook eq "keyrings") {
return ('/usr/share/keyrings/trisquel-archive-keyring.gpg')
} elsif ($hook eq "register-custom-fields") {
return (
[ "register", "Dm-Upload-Allowed",
CTRL_INFO_SRC | CTRL_INDEX_SRC | CTRL_PKG_SRC ],
[ "insert_after", CTRL_INDEX_SRC, "Uploaders", "Dm-Upload-Allowed" ],
[ "insert_after", CTRL_PKG_SRC, "Uploaders", "Dm-Upload-Allowed" ],
);
} elsif ($hook eq "extend-patch-header") {
my ($textref, $ch_info) = @params;
if ($ch_info->{'Closes'}) {
foreach my $bug (split(/\s+/, $ch_info->{'Closes'})) {
$$textref .= "Bug-Debian: http://bugs.debian.org/$bug\n";
}
}
if ($hook eq 'package-keyrings') {
return ($self->SUPER::run_hook($hook),
'/usr/share/keyrings/trisquel-archive-keyring.gpg');
} elsif ($hook eq 'archive-keyrings') {
return ($self->SUPER::run_hook($hook),
'/usr/share/keyrings/trisquel-archive-keyring.gpg');
} elsif ($hook eq 'archive-keyrings-historic') {
return ($self->SUPER::run_hook($hook),
'/usr/share/keyrings/trisquel-archive-removed-keys.gpg');
} elsif ($hook eq 'update-buildflags') {
my $flags = shift @params;
# Run the Debian hook to add hardening flags
$self->SUPER::run_hook($hook, $flags);
require Dpkg::BuildOptions;
my $build_opts = Dpkg::BuildOptions->new();
if (!$build_opts->has('noopt')) {
require Dpkg::Arch;
my $b = Dpkg::Vendor::Ubuntu::find_launchpad_closes($ch_info->{'Changes'});
foreach my $bug (@$b) {
$$textref .= "Bug-Ubuntu: https://bugs.launchpad.net/bugs/$bug\n";
my $arch = Dpkg::Arch::get_host_arch();
if (Dpkg::Arch::debarch_eq($arch, 'ppc64el')) {
for my $flag (qw(CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS GCJFLAGS
FFLAGS FCFLAGS)) {
my $value = $flags->get($flag);
$value =~ s/-O[0-9]/-O3/;
$flags->set($flag, $value);
}
}
}
# Per https://wiki.ubuntu.com/DistCompilerFlags
$flags->prepend('LDFLAGS', '-Wl,-Bsymbolic-functions');
} else {
return $self->SUPER::run_hook($hook, @params);
}
# Default return value for unknown/unimplemented hooks
return;
}
=head1 CHANGES
=head2 Version 0.xx
This is a private module.
=cut
1;
diff -Nru finish-install-2.104+11.0trisquel0/finish-install.d/10update-initramfs finish-install-2.104+11.0trisquel0/finish-install.d/10update-initramfs
--- finish-install-2.104+11.0trisquel0/finish-install.d/10update-initramfs 2018-08-10 14:21:58.000000000 -0500
+++ finish-install-2.104+11.0trisquel0/finish-install.d/10update-initramfs 2022-12-18 17:56:21.817264252 -0600
@@ -4,7 +4,11 @@
# update-initramfs to make sure one can type the passphrase
# (see #694156, workaround for #696773):
/bin/in-target \
- /bin/sh -c "dpkg-query -s cryptsetup >/dev/null 2>&1 && dpkg-query -s console-setup >/dev/null 2>&1"
+ /bin/sh -c "dpkg-query -s console-setup >/dev/null 2>&1"
+
+#Fix bug keyboard not using the selected layout.
+/bin/in-target \
+ dpkg-reconfigure -f noninteractive keyboard-configuration
if [ $? = 0 ]; then
echo "Encrypted LVM detected, refreshing initramfs"
Extension built by Ruben Rodriguez using pieces of torbutton as a template
Copyright (c) 2014, Ruben Rodriguez <ruben@gnu.org>
Copyright (c) 2013, The Tor Project, Inc.
Copyright (c) 2006 Scott Squires, Oleg Ivanov
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
content abrowserhome chrome/content/
locale abrowserhome af chrome/locale/es/
locale abrowserhome ak chrome/locale/en/
component {a364a9c0-2960-11e4-8c21-0800200c9a66} components/aboutAbrowser.js
contract @mozilla.org/network/protocol/about;1?what=startpage {a364a9c0-2960-11e4-8c21-0800200c9a66}
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
%aboutHomeDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&abouthome.pageTitle;</title>
<link rel="icon" type="image/png" id="favicon"
href="chrome://branding/content/icon32.png"/>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://browser/content/abouthome/aboutHome.css"/>
<style>
label{
position:relative;
bottom:2px;
left:2px;
}
#addonsform form{
position:relative;
left:10px;
}
em {
color:#600
}
a{
color:#004998
}
#addonsform{
background-color:#fff;
font-size:14px;
padding:10px 25px 20px 25px;
border-radius: 5px;
box-shadow: 0 0px 2px hsla(0,0%,0%,.3) inset;
}
.block-side-margin {
min-width: 16px;
-moz-box-flex: 1;
}
#block-horizontal-margin {
display: -moz-box;
-moz-box-flex: 1;
}
ul li {
list-style:none;
float:left;
}
ul li a{
font-weight:bold;
text-shadow:0px 1px 0px #fff;
padding:5px 10px 5px 10px;
border-radius:3px;
margin:5px;
color:#888;
background:#dcdcdc;
box-shadow: 0px 2px 0 #ccc ;
}
ul li a:hover{
color:#666;
background:#ccc;
box-shadow: 0px 2px 0 #aaa;
}
.titlelink{
font-weight:bold;
color: #678;
text-shadow: 0px 1px 0px white;
}
#footer{
min-height:50px;
display: -moz-box;
-moz-box-align: center;
-moz-box-pack: center;
width: 100%;
background-color: hsla(0,0%,0%,.03);
border-top: 1px solid hsla(0,0%,0%,.03);
box-shadow: 0 -1px 2px hsla(0,0%,0%,.1) inset, 0 -1px 0 hsla(0,0%,100%,.25);
}
#searchLogoContainer{
color:#888;
text-shadow: 0 1px 0 #fff;
}
</style>
<script type="text/javascript">
<![CDATA[
Components.utils.import("resource://gre/modules/AddonManager.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
function flip(sel){
var id = sel.id;
var addonObj=-1;
AddonManager.getAddonByID(id, function(addon) {
addonObj=addon;
});
var thread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread;
while (addonObj == null || addonObj == -1)
thread.processNextEvent(true);
addonObj.userDisabled = addonObj.isActive;
if ( addonObj.operationsRequiringRestart != 0)
alert("This change will be applied when you restart Abrowser");
}
function languagesettings(sel){
if (sel.checked)
Services.prefs.setCharPref(sel.id,sel.value);
else
Services.prefs.clearUserPref(sel.id);
}
function fontsettings(sel){
if (sel.checked)
Services.prefs.setIntPref(sel.id,sel.value);
else
Services.prefs.clearUserPref(sel.id);
}
function jssettings(sel){
if (sel.checked){
Services.prefs.setBoolPref(sel.id, !sel.checked);}
else
Services.prefs.clearUserPref(sel.id);
}
function prepare(){
srchsvc = Components.classes["@mozilla.org/browser/search-service;1"].getService(Components.interfaces.nsIBrowserSearchService);
currentEngine = srchsvc.defaultEngine.name;
document.getElementById("searchLogoContainer").innerHTML=currentEngine+":";
/*try {
Services.prefs.getCharPref("extensions.abrowserhome.intl.accept_languages");
}catch(err){
Services.prefs.setCharPref("intl.accept_languages","en-US, en");
Services.prefs.setCharPref("extensions.abrowserhome.intl.accept_languages","en-US, en");
}
try {
Services.prefs.getIntPref("extensions.abrowserhome.browser.display.use_document_fonts");
}catch(err){
Services.prefs.setIntPref("browser.display.use_document_fonts",0);
Services.prefs.setIntPref("extensions.abrowserhome.browser.display.use_document_fonts",0);
}*/
var f = document.createElement("form");
var extensions=[
["jid1-KtlZuoiikVfFew@jetpack","Block execution of non-free <a target=\"_blank\" href=\"http://www.gnu.org/software/librejs/\">JavaScript</a> <em>(experimental)</em>"],
["spyblock@gnu.org","Block privacy <a target=\"_blank\" href=\"https://easylist.adblockplus.org\">trackers</a>"],
["torproxy@trisquel","Use <a target=\"_blank\" href=\"https://www.torproject.org/about/overview.html.en#overview\">Tor</a> when in Private Mode"],
["https-everywhere@eff.org","Get redirected to <a target=\"_blank\" href=\"https://www.eff.org/https-everywhere/faq\">HTTPS</a> when possible"],
]
for (var i=0; i<extensions.length; ++i) {
var ex=extensions[i][0];
var tmp = document.createElement("input");
tmp.setAttribute('type',"checkbox");
tmp.setAttribute('id', ex);
tmp.setAttribute('onclick','flip(this);');
var label = document.createElement("label");
label.htmlFor = ex ;
label.id = ex+'label';
label.appendChild(document.createTextNode(''));
f.appendChild(tmp);
f.appendChild(label);
document.getElementById("addonsform").appendChild(f);
}
var tmp = document.createElement("input");
tmp.setAttribute('type',"checkbox");
tmp.setAttribute('id', "intl.accept_languages");
tmp.setAttribute('value', "en-US, en");
tmp.setAttribute('onclick','languagesettings(this);');
value=Services.prefs.getCharPref("intl.accept_languages");
tmp.checked=(value=="en-US, en");
var label = document.createElement("label");
label.htmlFor = "intl.accept_languages" ;
label.id = "intl.accept_languageslabel";
label.appendChild(document.createTextNode("Request pages in English"));
f.appendChild(tmp);
f.appendChild(label);
f.appendChild(document.createElement("br"));
document.getElementById("addonsform").appendChild(f);
var tmp = document.createElement("input");
tmp.setAttribute('type',"checkbox");
tmp.setAttribute('id', "browser.display.use_document_fonts");
tmp.setAttribute('value', 0);
tmp.setAttribute('onclick','fontsettings(this);');
value=Services.prefs.getIntPref("browser.display.use_document_fonts");
tmp.checked=(value==0);
var label = document.createElement("label");
label.htmlFor = "browser.display.use_document_fonts" ;
label.id = "browser.display.use_document_fontslabel";
label.appendChild(document.createTextNode("Use system fonts"));
f.appendChild(tmp);
f.appendChild(label);
f.appendChild(document.createElement("br"));
document.getElementById("addonsform").appendChild(f);
var tmp = document.createElement("input");
tmp.setAttribute('type',"checkbox");
tmp.setAttribute('id', "javascript.enabled");
tmp.setAttribute('value', 0);
tmp.setAttribute('onclick','jssettings(this);');
value=Services.prefs.getBoolPref("javascript.enabled");
tmp.checked=(value==0);
var label = document.createElement("label");
label.htmlFor = "javascript.enabled" ;
label.id = "javascript.enabledlabel";
label.appendChild(document.createTextNode("Disable JavaScript"));
f.appendChild(tmp);
f.appendChild(label);
f.appendChild(document.createElement("br"));
document.getElementById("addonsform").appendChild(f);
for (var i=0; i<extensions.length; ++i) {
var ex=extensions[i][0];
var addonObj=-1;
AddonManager.getAddonByID(ex, function(addon) {
addonObj=addon;
});
var thread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread;
while ( addonObj == -1)
thread.processNextEvent(true);
if ( addonObj != null){
document.getElementById(ex).checked = addonObj.isActive;
//document.getElementById(ex+'label').innerHTML = addonObj.name;
document.getElementById(ex+'label').innerHTML = extensions[i][1]+"<br/>";
}else{
document.getElementById(ex).style.display='none';
document.getElementById(ex+'label').style.display='none';
}
}
}
function onSearchSubmit(){
srchsvc = Components.classes["@mozilla.org/browser/search-service;1"].getService(Components.interfaces.nsIBrowserSearchService);
currentEngine = srchsvc.defaultEngine;
var selectedText=document.getElementById("searchText").value;
submission = currentEngine.getSubmission(selectedText,null);
window.location = submission.uri.spec;
}
]]>
</script>
</head>
<body dir="&locale.dir;" onload="prepare();">
<div class="spacer"/>
<div id="topSection">
<img src="chrome://branding/content/about-logo.png"/>
<br/>
<br/>
<div id="searchContainer">
<form name="searchForm" id="searchForm" onsubmit="onSearchSubmit(); return false">
<div id="searchLogoContainer"></div>
<input type="text" name="q" value="" id="searchText" maxlength="256"
autofocus="autofocus" dir="auto"/>
<input id="searchSubmit" type="submit" value="&abouthome.searchEngineButton.label;"/>
</form>
</div>
</div>
<div class="spacer"/>
<div id="block-horizontal-margin">
<div class="block-side-margin"></div>
<div id="addonsform">
<!--<h3>Enabled privacy features:</h3>-->
<p><a target="_blank" href="https://trisquel.info/browser">Abrowser</a> protects your <a target="_blank" href="http://www.gnu.org/philosophy/free-sw.html">freedom</a> and your privacy!<br/><small>For a browser with an even bigger focus on privacy, <a href="apt:icecat">install GNU IceCat</a></small></p>
</div>
<div class="block-side-margin"></div>
</div>
<div class="spacer"/>
<div id="footer">
<p ><a class="titlelink" href="https://trisquel.info">Trisquel GNU/Linux</a></p>
<ul style="font-size:0.8em">
<li><a href="https://trisquel.info/forum">Forum</a></li>
<li><a href="https://trisquel.info/wiki">Wiki</a></li>
<li><a href="http://store.trisquel.info/">Store</a></li>
<li><a href="https://trisquel.info/donate">Donate</a></li>
</ul>
</div>
</body>
</html>
<!ENTITY aboutAbrowser.title "About Abrowser">
<!ENTITY aboutAbrowser.title "Acerca de Abrowser">
/*
Copyright (c) 2014, Ruben Rodriguez <ruben@gnu.org>
Copyright (c) 2013, The Tor Project, Inc.
Copyright (c) 2006 Scott Squires, Oleg Ivanov
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
// Module specific constants
const kMODULE_NAME = "about:abrowser";
const kMODULE_CONTRACTID = "@mozilla.org/network/protocol/about;1?what=abrowser";
const kMODULE_CID = Components.ID("a364a9c0-2960-11e4-8c21-0800200c9a66");
const kAboutAbrowserURL = "chrome://abrowserhome/content/aboutAbrowser/aboutAbrowser.xhtml";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function AboutAbrowser()
{
}
AboutAbrowser.prototype =
{
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
// nsIClassInfo implementation:
classDescription: kMODULE_NAME,
classID: kMODULE_CID,
contractID: kMODULE_CONTRACTID,
// nsIAboutModule implementation:
newChannel: function(aURI)
{
let ioSvc = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
let channel = ioSvc.newChannel(kAboutAbrowserURL, null, null);
channel.originalURI = aURI;
return channel;
},
getURIFlags: function(aURI)
{
return Ci.nsIAboutModule.ALLOW_SCRIPT;
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutAbrowser]);
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:name>AbrowserHome</em:name>
<em:creator>Ruben Rodriguez</em:creator>
<em:id>aboutabrowser@trisquel.info</em:id>
<em:version>1.0</em:version>
<em:updateURL>https://127.0.0.1/</em:updateURL>
<!-- <em:updateKey></em:updateKey> -->
<!-- firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>30.0</em:minVersion>
<em:maxVersion>10000.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
html {
font: message-box;
......@@ -40,8 +35,8 @@ a {
}
#brandLogo {
height: 420px;
width: 150px;
height: 150px;
width: 420px;
margin: 22px auto 31px;
background-image: url("chrome://branding/content/about-logo.png");
background-size: 420px 150px;
......@@ -49,90 +44,105 @@ a {
background-repeat: no-repeat;
}
#searchForm,
#searchIconAndTextContainer,
#snippets {
width: 470px;
}
#searchForm {
#searchIconAndTextContainer {
display: -moz-box;
height: 36px;
position: relative;
}
#searchLogoContainer {
display: -moz-box;
-moz-box-align: center;
padding-top: 2px;
-moz-padding-end: 8px;
}
#searchLogoContainer[hidden] {
display: none;
}
#searchEngineLogo {
display: inline-block;
height: 28px;
width: 70px;
min-width: 70px;
#searchIcon {
border: 1px transparent;
padding: 0;
margin: 0;
width: 36px;
height: 36px;
background: url("chrome://browser/skin/search-indicator-magnifying-glass.svg") center center no-repeat;
position: absolute;
}
#searchText {
margin-left: 0;
-moz-box-flex: 1;
padding: 6px 8px;
padding-top: 6px;
padding-bottom: 6px;
padding-inline-start: 34px;
padding-inline-end: 8px;
background: hsla(0,0%,100%,.9) padding-box;
border: 1px solid;
border-radius: 2px 0 0 2px;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
box-shadow: 0 1px 0 hsla(210,65%,9%,.02) inset,
0 0 2px hsla(210,65%,9%,.1) inset,
0 1px 0 hsla(0,0%,100%,.2);
border-radius: 2.5px 0 0 2.5px;
color: inherit;
unicode-bidi: plaintext;
}
#searchText:dir(rtl) {
border-radius: 0 2px 2px 0;
}
#searchText:-moz-dir(rtl) {
border-radius: 0 2.5px 2.5px 0;
#searchText[aria-expanded="true"] {
border-radius: 2px 0 0 0;
}
#searchText[aria-expanded="true"]:dir(rtl) {
border-radius: 0 2px 0 0;
}
#searchText[keepfocus],
#searchText:focus,
#searchText[autofocus] {
border-color: hsla(206,100%,60%,.6) hsla(206,76%,52%,.6) hsla(204,100%,40%,.6);
}
#searchSubmit {
-moz-margin-start: -1px;
background: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.1)) padding-box;
padding: 0 9px;
margin-inline-start: -1px;
color: transparent;
background: url("chrome://browser/skin/search-arrow-go.svg") center center no-repeat, linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.1)) padding-box;
-moz-context-properties: fill;
fill: #616366;
padding: 0;
border: 1px solid;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2);
-moz-border-start: 1px solid transparent;
border-radius: 0 2.5px 2.5px 0;
border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2) transparent;
border-radius: 0 2px 2px 0;
box-shadow: 0 0 2px hsla(0,0%,100%,.5) inset,
0 1px 0 hsla(0,0%,100%,.2);
cursor: pointer;
transition-property: background-color, border-color, box-shadow;
transition-duration: 150ms;
width: 50px;
}
#searchSubmit:-moz-dir(rtl) {
border-radius: 2.5px 0 0 2.5px;
#searchSubmit:dir(rtl) {
transform: scaleX(-1);
}
#searchText:focus + #searchSubmit,
#searchText[keepfocus] + #searchSubmit,
#searchText + #searchSubmit:hover,
#searchText[autofocus] + #searchSubmit {
border-color: #59b5fc #45a3e7 #3294d5;
color: white;
}
#searchText:focus + #searchSubmit,
#searchText[keepfocus] + #searchSubmit,
#searchText[autofocus] + #searchSubmit {
background-image: linear-gradient(#4cb1ff, #1793e5);
background-image: url("chrome://browser/skin/search-arrow-go.svg"), linear-gradient(#4cb1ff, #1793e5);
fill: white;
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
0 0 0 1px hsla(0,0%,100%,.1) inset,
0 1px 0 hsla(210,54%,20%,.03);
}
#searchText + #searchSubmit:hover {
background-image: linear-gradient(#66bdff, #0d9eff);
background-image: url("chrome://browser/skin/search-arrow-go.svg"), linear-gradient(#66bdff, #0d9eff);
fill: white;
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
0 0 0 1px hsla(0,0%,100%,.1) inset,
0 1px 0 hsla(210,54%,20%,.03),
......@@ -150,19 +160,19 @@ a {
#rightsSnippet {
display: block;
min-height: 38px;
background: 30px center no-repeat;
background: 0 center no-repeat;
padding: 6px 0;
-moz-padding-start: 79px;
padding-inline-start: 49px;
}
#rightsSnippet[hidden] {
display: none;
}
#defaultSnippet1:-moz-dir(rtl),
#defaultSnippet2:-moz-dir(rtl),
#rightsSnippet:-moz-dir(rtl) {
background-position: right 30px center;
#defaultSnippet1:dir(rtl),
#defaultSnippet2:dir(rtl),
#rightsSnippet:dir(rtl) {
background-position: right 0 center;
}
#defaultSnippet1 {
......@@ -217,7 +227,7 @@ body[narrow] #launcher[session] {
white-space: normal;
background: transparent padding-box;
border: 1px solid transparent;
border-radius: 2.5px;
border-radius: 2px;
color: #525c66;
font-size: 75%;
cursor: pointer;
......@@ -299,10 +309,6 @@ body[narrow] #restorePreviousSession {
content: url("chrome://browser/content/abouthome/history.png");
}
#apps::before {
content: url("chrome://browser/content/abouthome/apps.png");
}
#addons::before {
content: url("chrome://browser/content/abouthome/addons.png");
}
......@@ -322,10 +328,10 @@ body[narrow] #restorePreviousSession {
display: inline-block; /* display on same line as text label */
vertical-align: middle;
margin-bottom: 0;
-moz-margin-end: 8px;
margin-inline-end: 8px;
}
#restorePreviousSession:-moz-dir(rtl)::before {
#restorePreviousSession:dir(rtl)::before {
transform: scaleX(-1);
}
......@@ -339,21 +345,21 @@ body[narrow] #restorePreviousSession::before {
display: block;
position: relative; /* pin wordmark to edge of document, not of viewport */
-moz-box-ordinal-group: 0;
opacity: .5;
opacity: .2;
transition: opacity 150ms;
}
#aboutMozilla:hover {
opacity: 1;
opacity: .6;
}
#aboutMozilla::before {
content: url("chrome://browser/content/abouthome/mozilla.png");
content: url("chrome://browser/content/abouthome/mozilla.svg");
display: block;
position: absolute;
top: 12px;
right: 12px;
width: 69px;
offset-inline-end: 12px;
width: 67px;
height: 19px;
}
......@@ -362,9 +368,6 @@ body[narrow] #restorePreviousSession::before {
* rather than upscaling the original-size ones (bug 818940).
*/
@media not all and (max-resolution: 1dppx) {
#brandLogo {
background-image: url("chrome://branding/content/about-logo@2x.png");
}
#defaultSnippet1,
#defaultSnippet2,
......@@ -380,12 +383,15 @@ body[narrow] #restorePreviousSession::before {
background-image: url("chrome://browser/content/abouthome/snippet2@2x.png");
}
.launchButton::before,
#aboutMozilla::before {
.launchButton::before {
transform: scale(.5);
transform-origin: 0 0;
}
.launchButton:dir(rtl)::before {
transform: scale(.5) translateX(32px);
}
#downloads::before {
content: url("chrome://browser/content/abouthome/downloads@2x.png");
}
......@@ -398,10 +404,6 @@ body[narrow] #restorePreviousSession::before {
content: url("chrome://browser/content/abouthome/history@2x.png");
}
#apps::before {
content: url("chrome://browser/content/abouthome/apps@2x.png");
}
#addons::before {
content: url("chrome://browser/content/abouthome/addons@2x.png");
}
......@@ -422,8 +424,8 @@ body[narrow] #restorePreviousSession::before {
content: url("chrome://browser/content/abouthome/restore@2x.png");
}
#aboutMozilla::before {
content: url("chrome://browser/content/abouthome/mozilla@2x.png");
#restorePreviousSession:dir(rtl)::before {
transform: scale(-0.5, 0.5) translateX(24px);
transform-origin: top center;
}
}
......@@ -2,158 +2,37 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const SEARCH_ENGINES = {
"Google": {
// This is the "2x" image designed for OS X retina resolution, Windows at 192dpi, etc.;
// it will be scaled down as necessary on lower-dpi displays.
image: "data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAAIwAAAA4CAYAAAAvmxBdAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ" +
"bWFnZVJlYWR5ccllPAAAGrFJREFUeNrtfHt4VdW172+utZOASLJ5+Ba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yPn1Bn5ShWtYAJsyEve+OPgC7Hzmgx3USDtejQedlbtDX7h" +
"0Ns6HChV5LcvP7rpb1+qx/690dHrtewL05c2c7ZLtrM91fOpDGjXyvT9+WYBPQAg3NPcey1n4vVt" +
"FUJSIfGNjJZNy2ekkqzpazIJOefSoTaA9q1VY+5Wbvs9NAoYVBkFh5Sesi9lJ/u6lt5+WETpoi2M" +
"PpZU/k9szmKGtVGRWBjQ6g3zP78pxfSGKb+tJ4LPAsi31S/+uXCUlVZmCIc+DlI15L4Cpr/1FA1d" +
"0VLqAilzgcCGChdQc5eoTXqpkNS66hv1YLsUElURiG1sOZj7lunf3v3fwlBKjRfX9EjEHKcscV98" +
"D40zRKIqgEpz4yvTVnfjU/VbmL/r4yhwTTbPCNsZNi8g50/OnvbCsXu5wQqVURCBuOb7seu98n7A" +
"/L23Tc8NX8mW6pL73UoOhYPH/GJv/I7Dzlqbg5pRUG1q++A//+Ng+4f9gDlATVzLHfErZiHioKrn" +
"H37uhgeG597sdYnIYeeszypQqQawre9dHNbd0Yj9/5KnfsB8DJpuXXj8Q+ryj3dUZglD1Uz3MsWv" +
"HX7uh1fv6QGHn7upAmrWQpEV2zSt+bVptamw+6C9VaP/hcoHrvkABgydUjPLywy6Oboh6HW6PgLj" +
"LYqStqYRQHKDMQflMhXOQrnata27tvGvufrEn8ZBfmdPP2AO7NpmAAw85B8qTyjKlt1svAHTjPGL" +
"k4w0jAcTAyllnBoh9Kxw/tEdS8cuT0WyH4vX1PYD5qMBzQDE2eFDxz09zsscWuwVHX6a8YwaFAiM" +
"NAkHr4vdUdf82rQN6JwnSl4N4vAxeKdxP2A+mjXuKTvcXcY9TdOnyxPk4zKZ/vbRAqe75C3QfZZY" +
"0P/y6/7299z+H4QrdGsoib8JAAAAAElFTkSuQmCC"
}
};
"use strict";
/* import-globals-from ../contentSearchUI.js */
// The process of adding a new default snippet involves:
// * add a new entity to aboutHome.dtd
// * add a <span/> for it in aboutHome.xhtml
// * add an entry here in the proper ordering (based on spans)
// The <a/> part of the snippet will be linked to the corresponding url.
const DEFAULT_SNIPPETS_URLS = [ "" ];
const DEFAULT_SNIPPETS_URLS = [];
const SNIPPETS_UPDATE_INTERVAL_MS = 86400000; // 1 Day.
const SNIPPETS_UPDATE_INTERVAL_MS = 14400000; // 4 hours.
// IndexedDB storage constants.
const DATABASE_NAME = "abouthome";
const DATABASE_VERSION = 1;
const DATABASE_STORAGE = "persistent";
const SNIPPETS_OBJECTSTORE_NAME = "snippets";
var searchText;
// This global tracks if the page has been set up before, to prevent double inits
let gInitialized = false;
let gObserver = new MutationObserver(function (mutations) {
var gInitialized = false;
var gObserver = new MutationObserver(function(mutations) {
for (let mutation of mutations) {
if (mutation.attributeName == "searchEngineName") {
setupSearchEngine();
// The addition of the restore session button changes our width:
if (mutation.attributeName == "session") {
fitToWidth();
}
if (mutation.attributeName == "snippetsVersion") {
if (!gInitialized) {
// ensureSnippetsMapThen(loadSnippets);
ensureSnippetsMapThen(loadSnippets);
gInitialized = true;
}
return;
......@@ -161,15 +40,17 @@ let gObserver = new MutationObserver(function (mutations) {
}
});
window.addEventListener("pageshow", function () {
window.addEventListener("pageshow", function() {
// Delay search engine setup, cause browser.js::BrowserOnAboutPageLoad runs
// later and may use asynchronous getters.
window.gObserver.observe(document.documentElement, { attributes: true });
window.gObserver.observe(document.getElementById("launcher"), { attributes: true });
fitToWidth();
setupSearch();
window.addEventListener("resize", fitToWidth);
// Ask chrome to update snippets.
var event = new CustomEvent("AboutHomeLoad", {bubbles:true});
var event = new CustomEvent("AboutHomeLoad", {bubbles: true});
document.dispatchEvent(event);
});
......@@ -178,11 +59,39 @@ window.addEventListener("pagehide", function() {
window.removeEventListener("resize", fitToWidth);
});
window.addEventListener("keypress", ev => {
if (ev.defaultPrevented) {
return;
}
// don't focus the search-box on keypress if something other than the
// body or document element has focus - don't want to steal input from other elements
// Make an exception for <a> and <button> elements (and input[type=button|submit])
// which don't usefully take keypresses anyway.
// (except space, which is handled below)
if (document.activeElement && document.activeElement != document.body &&
document.activeElement != document.documentElement &&
!["a", "button"].includes(document.activeElement.localName) &&
!document.activeElement.matches("input:-moz-any([type=button],[type=submit])")) {
return;
}
let modifiers = ev.ctrlKey + ev.altKey + ev.metaKey;
// ignore Ctrl/Cmd/Alt, but not Shift
// also ignore Tab, Insert, PageUp, etc., and Space
if (modifiers != 0 || ev.charCode == 0 || ev.charCode == 32)
return;
searchText.focus();
// need to send the first keypress outside the search-box manually to it
searchText.value += ev.key;
});
// This object has the same interface as Map and is used to store and retrieve
// the snippets data. It is lazily initialized by ensureSnippetsMapThen(), so
// be sure its callback returned before trying to use it.
let gSnippetsMap;
let gSnippetsMapCallbacks = [];
var gSnippetsMap;
var gSnippetsMapCallbacks = [];
/**
* Ensure the snippets map is properly initialized.
......@@ -192,9 +101,7 @@ let gSnippetsMapCallbacks = [];
* @note Snippets should never directly manage the underlying storage, since
* it may change inadvertently.
*/
function ensureSnippetsMapThen(aCallback)
{
return;
function ensureSnippetsMapThen(aCallback) {
if (gSnippetsMap) {
aCallback(gSnippetsMap);
return;
......@@ -207,7 +114,7 @@ return;
return;
}
let invokeCallbacks = function () {
let invokeCallbacks = function() {
if (!gSnippetsMap) {
gSnippetsMap = Object.freeze(new Map());
}
......@@ -218,43 +125,52 @@ return;
gSnippetsMapCallbacks.length = 0;
}
let openRequest = indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION,
storage: DATABASE_STORAGE});
openRequest.onerror = function (event) {
openRequest.onerror = function(event) {
// Try to delete the old database so that we can start this process over
// next time.
indexedDB.deleteDatabase(DATABASE_NAME);
invokeCallbacks();
};
openRequest.onupgradeneeded = function (event) {
openRequest.onupgradeneeded = function(event) {
let db = event.target.result;
if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {
db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);
}
}
openRequest.onsuccess = function (event) {
openRequest.onsuccess = function(event) {
let db = event.target.result;
db.onerror = function (event) {
db.onerror = function() {
invokeCallbacks();
}
db.onversionchange = function (event) {
event.target.close();
db.onversionchange = function(versionChangeEvent) {
versionChangeEvent.target.close();
invokeCallbacks();
}
let cache = new Map();
let cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)
.objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();
cursorRequest.onerror = function (event) {
let cursorRequest;
try {
cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)
.objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();
} catch (ex) {
console.error(ex);
invokeCallbacks();
return;
}
cursorRequest.onsuccess = function(event) {
let cursor = event.target.result;
cursorRequest.onerror = function() {
invokeCallbacks();
}
cursorRequest.onsuccess = function(cursorRequestEvent) {
let cursor = cursorRequestEvent.target.result;
// Populate the cache from the persistent storage.
if (cursor) {
......@@ -265,24 +181,24 @@ return;
// The cache has been filled up, create the snippets map.
gSnippetsMap = Object.freeze({
get: function (aKey) cache.get(aKey),
set: function (aKey, aValue) {
get: (aKey) => cache.get(aKey),
set(aKey, aValue) {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey);
return cache.set(aKey, aValue);
},
has: function (aKey) cache.has(aKey),
delete: function (aKey) {
has: (aKey) => cache.has(aKey),
delete(aKey) {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey);
return cache.delete(aKey);
},
clear: function () {
clear() {
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
.objectStore(SNIPPETS_OBJECTSTORE_NAME).clear();
return cache.clear();
},
get size() cache.size
get size() { return cache.size; },
});
setTimeout(invokeCallbacks, 0);
......@@ -290,61 +206,39 @@ return;
}
}
function onSearchSubmit(aEvent)
{
let searchTerms = document.getElementById("searchText").value;
let engineName = document.documentElement.getAttribute("searchEngineName");
if (engineName && searchTerms.length > 0) {
// Send an event that will perform a search and Firefox Health Report will
// record that a search from about:home has occurred.
let eventData = JSON.stringify({
engineName: engineName,
searchTerms: searchTerms
});
let event = new CustomEvent("AboutHomeSearchEvent", {detail: eventData});
document.dispatchEvent(event);
}
aEvent.preventDefault();
function onSearchSubmit(aEvent) {
gContentSearchController.search(aEvent);
}
function setupSearchEngine()
{
var gContentSearchController;
function setupSearch() {
// Set submit button label for when CSS background are disabled (e.g.
// high contrast mode).
document.getElementById("searchSubmit").value =
document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0";
// The "autofocus" attribute doesn't focus the form element
// immediately when the element is first drawn, so the
// attribute is also used for styling when the page first loads.
let searchText = document.getElementById("searchText");
searchText.addEventListener("blur", function searchText_onBlur() {
searchText.removeEventListener("blur", searchText_onBlur);
searchText = document.getElementById("searchText");
searchText.addEventListener("blur", function() {
searchText.removeAttribute("autofocus");
});
let searchEngineName = document.documentElement.getAttribute("searchEngineName");
let searchEngineInfo = SEARCH_ENGINES[searchEngineName];
let logoElt = document.getElementById("searchEngineLogo");
// Add search engine logo.
if (searchEngineInfo && searchEngineInfo.image) {
logoElt.parentNode.hidden = false;
logoElt.src = searchEngineInfo.image;
logoElt.alt = searchEngineName;
searchText.placeholder = "";
}
else {
logoElt.parentNode.hidden = true;
searchText.placeholder = searchEngineName;
}
}, {once: true});
if (!gContentSearchController) {
gContentSearchController =
new ContentSearchUIController(searchText, searchText.parentNode,
"abouthome", "homepage");
}
}
/**
* Inform the test harness that we're done loading the page.
*/
function loadSucceeded()
{
var event = new CustomEvent("AboutHomeLoadSnippetsSucceeded", {bubbles:true});
function loadCompleted() {
var event = new CustomEvent("AboutHomeLoadSnippetsCompleted", {bubbles: true});
document.dispatchEvent(event);
}
......@@ -352,14 +246,12 @@ function loadSucceeded()
* Update the local snippets from the remote storage, then show them through
* showSnippets.
*/
function loadSnippets()
{
return;
function loadSnippets() {
if (!gSnippetsMap)
throw new Error("Snippets map has not properly been initialized");
// Allow tests to modify the snippets map before using it.
var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles:true});
var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles: true});
document.dispatchEvent(event);
// Check cached snippets version.
......@@ -378,32 +270,28 @@ return;
if (updateURL && shouldUpdate) {
// Try to update from network.
let xhr = new XMLHttpRequest();
try {
xhr.open("GET", updateURL, true);
} catch (ex) {
showSnippets();
loadSucceeded();
return;
}
xhr.timeout = 5000;
// Even if fetching should fail we don't want to spam the server, thus
// set the last update time regardless its results. Will retry tomorrow.
gSnippetsMap.set("snippets-last-update", Date.now());
xhr.onerror = function (event) {
showSnippets();
};
xhr.onload = function (event)
{
xhr.onloadend = function() {
if (xhr.status == 200) {
gSnippetsMap.set("snippets", xhr.responseText);
gSnippetsMap.set("snippets-cached-version", currentVersion);
}
showSnippets();
loadSucceeded();
loadCompleted();
};
xhr.send(null);
try {
xhr.open("GET", updateURL, true);
xhr.send(null);
} catch (ex) {
showSnippets();
loadCompleted();
}
} else {
showSnippets();
loadSucceeded();
loadCompleted();
}
}
......@@ -413,10 +301,8 @@ return;
* @note: snippets should never invoke showSnippets(), or they may cause
* a "too much recursion" exception.
*/
let _snippetsShown = false;
function showSnippets()
{
return;
var _snippetsShown = false;
function showSnippets() {
let snippetsElt = document.getElementById("snippets");
// Show about:rights notification, if needed.
......@@ -445,12 +331,13 @@ return;
if (snippets) {
// Injecting snippets can throw if they're invalid XML.
try {
// eslint-disable-next-line no-unsanitized/property
snippetsElt.innerHTML = snippets;
// Scripts injected by innerHTML are inactive, so we have to relocate them
// through DOM manipulation to activate their contents.
Array.forEach(snippetsElt.getElementsByTagName("script"), function(elt) {
let relocatedScript = document.createElement("script");
relocatedScript.type = "text/javascript;version=1.8";
relocatedScript.type = "text/javascript";
relocatedScript.text = elt.text;
elt.parentNode.replaceChild(relocatedScript, elt);
});
......@@ -466,9 +353,7 @@ return;
/**
* Clear snippets element contents and show default snippets.
*/
function showDefaultSnippets()
{
return;
function showDefaultSnippets() {
// Clear eventual contents...
let snippetsElt = document.getElementById("snippets");
snippetsElt.innerHTML = "";
......@@ -493,7 +378,7 @@ return;
}
function fitToWidth() {
if (window.scrollMaxX) {
if (document.documentElement.scrollWidth > window.innerWidth) {
document.body.setAttribute("narrow", "true");
} else if (document.body.hasAttribute("narrow")) {
document.body.removeAttribute("narrow");
......
......@@ -24,94 +24,41 @@
<link rel="icon" type="image/png" id="favicon"
href="chrome://branding/content/icon32.png"/>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://browser/content/contentSearchUI.css"/>
<link rel="stylesheet" type="text/css" media="all" defer="defer"
href="chrome://browser/content/abouthome/aboutHome.css"/>
<style>
label{
position:relative;
bottom:2px;
left:2px;
}
em {
color:#600
}
a{
color:#004998
}
.block-side-margin {
min-width: 16px;
-moz-box-flex: 1;
}
#block-horizontal-margin {
display: -moz-box;
-moz-box-flex: 1;
}
ul li {
list-style:none;
background:#ddd;
border-radius:3px;
padding:3px 5px 3px 5px;
margin:5px;
box-shadow: 0px 2px 0 #ccc ;
float:left;
}
ul li a{
font-weight:bold;
color:#666;
text-shadow:0px 1px 0px #fff;
}
.titlelink {
font-weight:bold;
color:#56728C;
text-shadow:0px 1px 0px #fff;
}
#footer{
min-height:100px;
}
</style>
<script type="text/javascript"
src="chrome://browser/content/abouthome/aboutHome.js"/>
<script type="text/javascript"
src="chrome://browser/content/contentSearchUI.js"/>
</head>
<body dir="&locale.dir;">
<div class="spacer"/>
<div id="topSection">
<img src="chrome://branding/content/about-logo.png"/>
<div id="searchContainer">
<form name="searchForm" id="searchForm" action="https://duckduckgo.com/">
<input type="hidden" name="t" value="trisquel"/>
<input type="text" name="q" value="" id="searchText" maxlength="256"
autofocus="autofocus"/>
<input id="searchSubmit" type="submit" value="&abouthome.searchEngineButton.label;"/>
</form>
<div id="brandLogo"></div>
<div id="searchIconAndTextContainer">
<div id="searchIcon"/>
<input type="text" name="q" value="" id="searchText" maxlength="256"
aria-label="&contentSearchInput.label;" autofocus="autofocus"/>
<input id="searchSubmit" type="button" onclick="onSearchSubmit(event)"
title="&contentSearchSubmit.tooltip;"/>
</div>
</div>
<div class="spacer"/>
<div id="footer" style=" display: -moz-box; -moz-box-align: center; -moz-box-pack: center; width: 100%; background-color: hsla(0,0%,0%,.03); border-top: 1px solid hsla(0,0%,0%,.03); box-shadow: 0 2px 5px hsla(0,0%,0%,.1) inset, 0 -1px 0 hsla(0,0%,100%,.25);">
<p ><a class="titlelink" href="https://trisquel.info">Trisquel GNU/Linux</a>:</p>
<ul style="font-size:0.8em">
<li><a href="https://trisquel.info/forum">Forum</a></li>
<li><a href="https://trisquel.info/wiki">Wiki</a></li>
<li><a href="http://store.trisquel.info/">Store</a></li>
<li><a href="https://trisquel.info/donate">Donate</a></li>
</ul>
</div>
<div id="launcher">
<button class="launchButton" id="downloads">&abouthome.downloadsButton.label;</button>
<button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button>
<button class="launchButton" id="history">&abouthome.historyButton.label;</button>
<button class="launchButton" id="addons">&abouthome.addonsButton.label;</button>
<button class="launchButton" id="sync">&abouthome.syncButton.label;</button>
<button class="launchButton" id="settings">&abouthome.preferencesButtonUnix.label;</button>
<div id="restorePreviousSessionSeparator"/>
<button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button>
</div>
</body>
</html>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 134 38">
<path d="M54.2,21.8c0,3.2-1.6,5.2-4.1,5.2s-3.9-2.2-3.9-5.1,1.5-4.9,3.9-4.9S54.2,18.4,54.2,21.8Zm61.1,3.5a1.7,1.7,0,0,0,2,1.9c1.7,0,3.5-1.2,3.6-4l-2.4-.2C116.8,23,115.3,23.4,115.3,25.3ZM134,0V38H0V0ZM39.2,26.6H37V19a5.4,5.4,0,0,0-5.7-5.8,5.6,5.6,0,0,0-5.4,3.6,5.4,5.4,0,0,0-5.4-3.6,5.5,5.5,0,0,0-5.1,2.8V13.6h-7v3.6h2.2v9.4H8.4v3.6H18.6V26.6H15.4V20.8c0-2.3.9-3.9,3.2-3.9s2.8,1.1,2.8,4v9.4h7V26.6H26.2V20.8c0-2.3.9-3.9,3.2-3.9s2.8,1.1,2.8,4v9.4h7Zm19.9-4.7c0-4.6-2.9-8.7-8.9-8.7s-8.9,4-8.9,8.9,3.5,8.4,8.7,8.4S59.1,27.2,59.1,21.9Zm18.7,2.5L74,24l-.8,2.6H67.9l9.2-10.5-.4-2.5H62.1l-.6,5.8,3.4.4.7-2.6h5.2L61.8,27.7l.5,2.5H76.8Zm8.5-.1h-5v6h5Zm0-10.7h-5v6h5ZM94,30.2l7.2-25.4H96.6L89.4,30.2Zm9.7,0,7.2-25.4h-4.7L99,30.2Zm23.8-.4V27.3h-.7c-.8,0-1.1-.3-1.1-1.3V18.9c0-3.8-3-5.6-6.6-5.6a16,16,0,0,0-7.1,1.5l-.6,3.8,3.8.4.5-1.9a5.2,5.2,0,0,1,2.5-.5c2.7,0,2.7,2,2.7,3.7v.6h-2.7c-3.8,0-7.7,1-7.7,5.1s2.7,4.8,5.1,4.8a6,6,0,0,0,5.3-3.3,3.4,3.4,0,0,0,3.6,3.3A6.4,6.4,0,0,0,127.5,29.8Z"/>
</svg>
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MOZ_UPDATER=
MOZ_ANDROID_ANR_REPORTER=
MOZ_ANDROID_GCM_SENDERID=965234145045
MOZ_MMA_GCM_SENDERID=242693410970
ANDROID_PACKAGE_NAME=org.gnu.abrowser
MOZ_APP_DISPLAYNAME="Abrowser"
MOZ_ANDROID_SHARED_ID=org.gnu.abrowser.sharedID
helpers/DATA/firefox/android/branding/content/about.png

18.1 KiB

helpers/DATA/firefox/android/branding/content/favicon32.png

2.67 KiB