From c6937523ec89e9ef5d3008f0b2758ffc9ed16513 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Mon, 7 Jun 2021 12:39:32 -0400 Subject: [PATCH] Rename project to chorizo --- .gitignore | 2 +- Makefile | 41 +++++----- README | 82 ++++++++----------- lariza.ini => chorizo.ini | 4 +- ...riza-config.5.scd => chorizo-config.5.scd} | 12 +-- ...lariza-usage.1.scd => chorizo-usage.1.scd} | 28 +++---- man/chorizo.1.scd | 71 ++++++++++++++++ man/lariza.1.scd | 68 --------------- src/browser.c | 26 +++--- user-scripts/hints.js | 72 ++++++++-------- 10 files changed, 201 insertions(+), 205 deletions(-) rename lariza.ini => chorizo.ini (50%) rename man/{lariza-config.5.scd => chorizo-config.5.scd} (91%) rename man/{lariza-usage.1.scd => chorizo-usage.1.scd} (73%) create mode 100644 man/chorizo.1.scd delete mode 100644 man/lariza.1.scd diff --git a/.gitignore b/.gitignore index 3af3cda..55b2592 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -lariza +chorizo *.so darkreader.js *.1 diff --git a/Makefile b/Makefile index 1efcf02..9b139a7 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ datadir = $(prefix)/share .PHONY: man clean uninstall install -all: man lariza extensions darkreader +all: man chorizo extensions darkreader man: for i in man/*.scd; do \ @@ -18,19 +18,20 @@ man: scdoc < $$i > $$(echo "$$i" | rev | cut -f 2- -d '.' | rev); \ done -lariza: +chorizo: $(CC) $(CFLAGS) $(LDFLAGS) \ - -D__NAME__=\"lariza\" \ - -D__NAME_UPPERCASE__=\"LARIZA\" \ - -o lariza src/*.c \ + -D__NAME__=\"chorizo\" \ + -D__NAME_UPPERCASE__=\"CHORIZO\" \ + -DVERSION=\"v21.01\" \ + -o chorizo src/*.c \ `pkg-config --cflags --libs gtk+-3.0 glib-2.0 webkit2gtk-4.0` extensions: for i in extensions/*.c; do \ outp=$$(echo "$$i" | sed 's/\$\.c/.so/g'); \ $(CC) $(CFLAGS) $(LDFLAGS) \ - -D__NAME__=\"lariza\" \ - -D__NAME_UPPERCASE__=\"LARIZA\" \ + -D__NAME__=\"chorizo\" \ + -D__NAME_UPPERCASE__=\"CHORIZO\" \ -shared -o $$outp -fPIC $$i \ `pkg-config --cflags --libs glib-2.0 webkit2gtk-4.0`; \ done @@ -38,23 +39,23 @@ extensions: install: all mkdir -p $(DESTDIR)$(bindir) \ $(DESTDIR)$(mandir) \ - $(DESTDIR)$(libdir)/lariza/web_extensions \ - $(DESTDIR)$(datadir)/lariza/user-scripts + $(DESTDIR)$(libdir)/chorizo/web_extensions \ + $(DESTDIR)$(datadir)/chorizo/user-scripts - cp lariza $(DESTDIR)$(bindir)/lariza + cp chorizo $(DESTDIR)$(bindir)/chorizo cp man/*.1 $(DESTDIR)$(mandir)/man1/ cp man/*.5 $(DESTDIR)$(mandir)/man5/ - cp lariza.ini $(DESTDIR)/etc/lariza.ini - cp -r extensions/*.so $(DESTDIR)$(libdir)/lariza/web_extensions/ - cp -r user-scripts/* $(DESTDIR)$(datadir)/lariza/user-scripts/ + cp chorizo.ini $(DESTDIR)/etc/chorizo.ini + cp -r extensions/*.so $(DESTDIR)$(libdir)/chorizo/web_extensions/ + cp -r user-scripts/* $(DESTDIR)$(datadir)/chorizo/user-scripts/ uninstall: - rm -rf $(DESTDIR)$(bindir)/lariza \ - $(DESTDIR)$(libdir)/lariza \ - $(DESTDIR)$(mandir)/man1/lariza* \ - $(DESTDIR)$(mandir)/man5/lariza* \ - $(DESTDIR)$(datadir)/lariza \ - $(DESTDIR)/lariza.ini + rm -rf $(DESTDIR)$(bindir)/chorizo \ + $(DESTDIR)$(libdir)/chorizo \ + $(DESTDIR)$(mandir)/man1/chorizo* \ + $(DESTDIR)$(mandir)/man5/chorizo* \ + $(DESTDIR)$(datadir)/chorizo \ + $(DESTDIR)/chorizo.ini reinstall: uninstall install @@ -66,4 +67,4 @@ darkreader: >> user-scripts/darkreader.js clean: - rm -f lariza we_adblock.so + rm -f chorizo we_adblock.so diff --git a/README b/README index cc0145e..7b0509a 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ - _ _ - | | __ _ _ __(_)______ _ - | |/ _` | '__| |_ / _` | - | | (_| | | | |/ / (_| | - |_|\__,_|_| |_/___\__,_| - https://sr.ht/~armaan/lariza + _ _ + ___| |__ ___ _ __(_)_______ + / __| '_ \ / _ \| '__| |_ / _ \ + | (__| | | | (_) | | | |/ / (_) | + \___|_| |_|\___/|_| |_/___\___/ + https://sr.ht/~armaan/chorizo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -11,15 +11,21 @@ A simple web browser using GTK+ 3, GLib and WebKit2GTK+. Features: - A WebKit2 viewport - - An input box to change the URI or to search the current page - - Built-in download manager - - Indicator for web feeds + - An input box to change the URI, search the current page, or + search the web + - Tab management - Full keyboard control + - An ini configuration file + - Built-in download manager + - Web feeds indicator - Global content zoom - Cooperative instances using FIFOs - Certificate trust store - User script support - - Extension support + - Extensions + +Refer to the manpages chorizo(1), chorizo-usage(1), and +chorizo-config(5), for more information. Installation ------------ @@ -29,58 +35,42 @@ The following C libraries are required: - GTK+ 3 - WebKit2 API for GTK+ 3 -lariza expects to be run on a POSIX-ish operating system. +To generate the manpages, scdoc is required. This isn't necesary on +release tarballs. + +chorizo expects to be run on a POSIX-ish operating system. -To build the program and install it to /usr/local: +To build and install the program: $ make # make install -To use bundled web extensions, they must be copied or symlinked to the -appropriate path. Please refer to the manpage. - - -Running -------- - -You simply invoke the main program: - - $ lariza - -Refer to the manpage for all options. - Background information ---------------------- - What lariza is and what it's not +What chorizo is and what it's not - lariza does what I need. It won't do other things. I'm open for + chorizo does what I need. It won't do other things. I'm open for contributions but please don't be upset if I turn them down -- which might happen if it's a feature that I simply don't need. - lariza does not compete with powerful browsers like dwb or luakit, nor - with monstrous applications like Firefox or Chromium. + chorizo does not compete with powerful browsers like dwb or luakit, nor + with monstrous applications like Firefox or Chromium. Because under + the hood chorizo is powered by WebKit, however, it is on par with + browsers like Safari for page rendering features. - About the name +How is chorizo related to lariza? - "lariza" stems from a german sentence: + chorizo is a fork of the lariza browser by Peter Hofmann. I wanted + to take it in a slightly different direction (mostly just adding + features not considered to be in the spirit of lariza), so I forked + it. The name was changed in order to reduce confusion between the + two browsers as they grew apart. The versioning scheme was also + changed from being calendar-based to following the semantic + versioning scheme. - Alle anderen waren mir zu anstrengend. - l a r i z a - - That phrase basically means: "It was too tiresome to deal with any - other browser." I couldn't find a simple browser that does just what I - need. Most of them are utterly bloated, others lack essential - functions. Thus, I was forced to write scripts and tools and stuff to - deal with these issues. That is what was tiresome. I don't want to - work around bugs or nonsensical behavior anymore. - - So, I wrote my own browser^W WebKit GUI. WebKit does all the dirty - work. Copyright --------- -MIT License, see the LICENSE file for more information. - -This codebase is a fork of the original lariza browser by Peter Hofmann. \ No newline at end of file +MIT License, see the LICENSE file for more information. \ No newline at end of file diff --git a/lariza.ini b/chorizo.ini similarity index 50% rename from lariza.ini rename to chorizo.ini index 92d8572..5f56a50 100644 --- a/lariza.ini +++ b/chorizo.ini @@ -1,5 +1,5 @@ -# lariza browser example configuration file. A full list of options -# can be found in lariza-config(5). +# chorizo browser example configuration file. A full list of options +# can be found in chorizo-config(5). # [browser] # homepage=https://duckduckgo.com diff --git a/man/lariza-config.5.scd b/man/chorizo-config.5.scd similarity index 91% rename from man/lariza-config.5.scd rename to man/chorizo-config.5.scd index 9bcd477..5b178fc 100644 --- a/man/lariza-config.5.scd +++ b/man/chorizo-config.5.scd @@ -1,12 +1,12 @@ -lariza-config(5) +chorizo-config(5) # NAME -_lariza.ini_ - configuration file for *lariza*(1) +_chorizo.ini_ - configuration file for *chorizo*(1) # DESCRIPTION -_lariza.ini_ is the system configuration file for the lariza browser. The syntax -is the standard GTK ini format. An example is provided at _/etc/lariza.ini_, and -user configuration should go in _~/.config/lariza/lariza.ini_, or your +_chorizo.ini_ is the system configuration file for the chorizo browser. The syntax +is the standard GTK ini format. An example is provided at _/etc/chorizo.ini_, and +user configuration should go in _~/.config/chorizo/chorizo.ini_, or your equivalent as set by $XDG_CONFIG_DIR. Settings must go under the relevant subsection. @@ -31,7 +31,7 @@ subsection. *history_file*++ Type: string++ Default: none++ - File that lariza should save history to. + File that chorizo should save history to. *homepage*++ Type: string++ diff --git a/man/lariza-usage.1.scd b/man/chorizo-usage.1.scd similarity index 73% rename from man/lariza-usage.1.scd rename to man/chorizo-usage.1.scd index 38c0334..1f73629 100644 --- a/man/lariza-usage.1.scd +++ b/man/chorizo-usage.1.scd @@ -1,30 +1,30 @@ -lariza-usage(1) +chorizo-usage(1) # NAME -lariza-usage - extended usage hints +chorizo-usage - extended usage hints # DESCRIPTION -*lariza* is a simple web browser using GTK+ 3, GLib and WebKit2GTK+. This +*chorizo* is a simple web browser using GTK+ 3, GLib and WebKit2GTK+. This manpage contains additional hints and pointers regarding its usage. # KEYBINDINGS AND CONFIGURATION -For this information, please refer to *lariza-configuration*(1). +For this information, please refer to *chorizo-configuration*(1). # DOWNLOAD MANAGER Open the download manager using the appropriate hotkey. A new window listing your downloads will appear. Clicking on an item will remove it from the list and **if needed** cancel the download. -There's no file manager integration, nor does *lariza* delete, overwrite or +There's no file manager integration, nor does *chorizo* delete, overwrite or resume downloads. If a file already exists, it won't be touched. Instead, the new file name will have a suffix such as *.1*, *.2*, *.3*, and so on. # USER-SUPPLIED JAVASCRIPT FILES After a page has been successfully loaded, the directory -_~/.local/share/lariza/user-scripts_ will be scanned and each file in it ending +_~/.local/share/chorizo/user-scripts_ will be scanned and each file in it ending with *.js* will be run as a JavaScript file in the context of said page. -*lariza* comes with the following scripts: +*chorizo* comes with the following scripts: *hints.js* Press *f* (open link in current window) or *F* (open in new window) to @@ -41,15 +41,15 @@ Those bundled scripts are automatically installed on *make install*. To use them, though, make sure to link them to the directory mentioned above. # WEB EXTENSIONS -On startup, WebKit checks _~/.local/share/lariza/web_extensions_ for any *.so* +On startup, WebKit checks _~/.local/share/chorizo/web_extensions_ for any *.so* files. See this blog post for further information on these extensions. -*lariza* comes with the following extensions: +*chorizo* comes with the following extensions: *we_adblock.so* - Generic adblock. Reads patterns from the file _~/.config/lariza/adblock_. Each + Generic adblock. Reads patterns from the file _~/.config/chorizo/adblock_. Each line can contain a regular expression. These expressions match case-insensitive and partially, i.e.*\*foo.\** is the same as *.\*FOO.\** and you can use anchors like *^https?://...*. Please refer to @@ -61,21 +61,21 @@ this blog post for further information on these extensions. to the directory mentioned above. # TRUSTED CERTIFICATES -By default, *lariza* trusts whatever CAs are trusted by WebKit. If you wish to +By default, *chorizo* trusts whatever CAs are trusted by WebKit. If you wish to trust additional certificates, such as self-signed certificates, the first thing you should do is try to add the appropriate CAs to your system-wide store. If you wish to add simple exceptions, you can grab the certificate and store it -in the directory _~/.local/share/lariza/certs_. The filename must be equal to +in the directory _~/.local/share/chorizo/certs_. The filename must be equal to the hostname: $ echo | openssl s_client -connect foo.de:443 | openssl x509 >foo.de -This tells *lariza* to trust the given certificate when connecting to host +This tells *chorizo* to trust the given certificate when connecting to host *foo.de*. Note: This is NOT equal to certificate pinning. WebKit ignores user-specified certificates if the server's certificate can be validated by any system-wide CA. # SEE ALSO -*lariza*(1), *lariza-config*(1) +*chorizo*(1), *chorizo-config*(1) diff --git a/man/chorizo.1.scd b/man/chorizo.1.scd new file mode 100644 index 0000000..8f6e7b3 --- /dev/null +++ b/man/chorizo.1.scd @@ -0,0 +1,71 @@ +chorizo(1) + +# NAME +chorizo - simple web browser + +# SYNOPSIS +*chorizo* - [-C] [_URI ..._] + +# DESCRIPTION +*chorizo* is a simple web browser using GTK+ 3, GLib and WebKit2GTK+. + +# OPTIONS +In addition to the standard arguments of GTK+ 3, *chorizo* knows about the +following options: + +*-C* + Disables cooperative instances. + +*-v* + Print version and exit. + +After these options there can be any number of URIs specified to open. + +# ENVIRONMENT +In addition to the standard variables of GTK+ 3, *chorizo* knows about the +following environment variable: + +*CHORIZO_FIFO_SUFFIX* + Cooperative instances are implemented using a named pipe in the file + system. The name of this pipe usually is (at least on modern systems following + XDG standards: /var/run/user/$UID/chorizo.fifo-$CHORIZO_FIFO_SUFFIX + + *$UID* is the id of your user. *$CHORIZO_FIFO_SUFFIX* defaults to *main*. If you + change this variable, you can launch several independent cooperative instances + of *chorizo*. + +# FILES +XDG variables will be used to construct these paths. +*~/.config/chorizo/chorizo.ini* + Configuration file. See *chorizo-config*(5). + +*~/.config/chorizo/adblock* + Adblock patterns. See *chorizo-usage*(1). + +*~/.local/share/chorizo/certs* + Directory where trusted certificates are stored. See *chorizo-usage*(1). + +~/.local/share/chorizo/user-scripts + Directory to store user-supplied JavaScript snippets. See *chorizo-usage*(1). + +~/.local/share/chorizo/web_extensions + Sets the directory where WebKit will look for web extensions. See + *chorizo-usage*(1). + +~/.cache/chorizo + +~/.cache/webkitgtk + +~/.local/share/webkitgtk + WebKitGTK will dump its caches and local storage here. It is probably wise to + clean those directories regularly or to mount them as *tmpfs*(5). + +# LICENSE +*chorizo* is released under the MIT license. See the accompanying LICENSE file. + +# HISTORY +chorizo is a fork of the lariza browser by Peter Hofmann. The project was +started in June 2014. This fork is maintained by Armaan Bhojwani. + +# SEE ALSO +*chorizo-usage*(1), *chorizo-config*(5) diff --git a/man/lariza.1.scd b/man/lariza.1.scd deleted file mode 100644 index bd2a4e2..0000000 --- a/man/lariza.1.scd +++ /dev/null @@ -1,68 +0,0 @@ -lariza(1) - -# NAME -lariza - simple web browser - -# SYNOPSIS -*lariza* - [-C] [_URI ..._] - -# DESCRIPTION -*lariza* is a simple web browser using GTK+ 3, GLib and WebKit2GTK+. - -# OPTIONS -In addition to the standard arguments of GTK+ 3, *lariza* knows about the -following options: - -*-C* - Disables cooperative instances. - -After these options there can be any number of URIs specified to open. - -# ENVIRONMENT -In addition to the standard variables of GTK+ 3, *lariza* knows about the -following environment variable: - -*LARIZA_FIFO_SUFFIX* - Cooperative instances are implemented using a named pipe in the file - system. The name of this pipe usually is (at least on modern systems following - XDG standards: /var/run/user/$UID/lariza.fifo-$LARIZA_FIFO_SUFFIX - - *$UID* is the id of your user. *$LARIZA_FIFO_SUFFIX* defaults to *main*. If you - change this variable, you can launch several independent cooperative instances - of *lariza*. - -# FILES -XDG variables will be used to construct these paths. -*~/.config/lariza/lariza.ini* - Configuration file. See *lariza-config*(5). - -*~/.config/lariza/adblock* - Adblock patterns. See *lariza-usage*(1). - -*~/.local/share/lariza/certs* - Directory where trusted certificates are stored. See *lariza-usage*(1). - -~/.local/share/lariza/user-scripts - Directory to store user-supplied JavaScript snippets. See *lariza-usage*(1). - -~/.local/share/lariza/web_extensions - Sets the directory where WebKit will look for web extensions. See - *lariza-usage*(1). - -~/.cache/lariza - -~/.cache/webkitgtk - -~/.local/share/webkitgtk - WebKitGTK will dump its caches and local storage here. It is probably wise to - clean those directories regularly or to mount them as *tmpfs*(5). - -# LICENSE -*lariza* is released under the MIT license. See the accompanying LICENSE file. - -# HISTORY -lariza was originally written by Peter Hofmann. The project was started in June -2014. This fork is maintained by Armaan Bhojwani. - -# SEE ALSO -*lariza-usage*(1), *lariza-config*(5) diff --git a/src/browser.c b/src/browser.c index 58d9275..1d38e10 100644 --- a/src/browser.c +++ b/src/browser.c @@ -214,7 +214,7 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show, G_CALLBACK(key_tablabel), c); /* For easy access, store a reference to our label. */ - g_object_set_data(G_OBJECT(evbox), "lariza-tab-label", c->tablabel); + g_object_set_data(G_OBJECT(evbox), "chorizo-tab-label", c->tablabel); /* This only shows the event box and the label inside, nothing else. * Needed because the evbox/label is "internal" to the notebook and @@ -1025,7 +1025,7 @@ mainwindow_title(gint idx) return; widg = gtk_notebook_get_tab_label(GTK_NOTEBOOK(mw.notebook), child); - tablabel = (GtkWidget *)g_object_get_data(G_OBJECT(widg), "lariza-tab-label"); + tablabel = (GtkWidget *)g_object_get_data(G_OBJECT(widg), "chorizo-tab-label"); text = gtk_label_get_text(GTK_LABEL(tablabel)); gtk_window_set_title(GTK_WINDOW(mw.win), text); } @@ -1145,18 +1145,17 @@ GKeyFile * get_ini(void) { GKeyFileFlags flags = G_KEY_FILE_NONE; - g_autoptr(GError) error = NULL; config = g_key_file_new(); // Load user config if (!g_key_file_load_from_file(config, g_build_filename(g_get_user_config_dir(), - __NAME__, "lariza.ini", - NULL), flags, &error)) { + __NAME__, "chorizo.ini", + NULL), flags, NULL)) { // Load global config - if (!g_key_file_load_from_file(config, "/etc/lariza.ini", flags, - &error)) { - fprintf(stderr, "Could not load lariza.ini: %s", error->message); + if (!g_key_file_load_from_file(config, "/etc/chorizo.ini", flags, + NULL)) { + fprintf(stderr, "Could not load chorizo.ini"); } } return config; @@ -1167,20 +1166,23 @@ main(int argc, char **argv) { int opt, i; - gtk_init(&argc, &argv); - get_config(); - - while ((opt = getopt(argc, argv, "C")) != -1) { + while ((opt = getopt(argc, argv, "Cv")) != -1) { switch (opt) { case 'C': cfg.cooperative_instances = FALSE; break; + case 'v': + printf("%s %s\n", __NAME__, VERSION); + exit(0); default: fprintf(stderr, "Usage: "__NAME__" [OPTION]... [URI]...\n"); exit(EXIT_FAILURE); } } + gtk_init(&argc, &argv); + get_config(); + if (cfg.cooperative_instances) cooperation_setup(); diff --git a/user-scripts/hints.js b/user-scripts/hints.js index 0db5349..01fc640 100644 --- a/user-scripts/hints.js +++ b/user-scripts/hints.js @@ -1,5 +1,5 @@ -// This is NOT a core component of lariza, but an optional user script. -// Please refer to lariza.usage(1) for more information on user scripts. +// This is NOT a core component of chorizo, but an optional user script. +// Please refer to chorizo.usage(1) for more information on user scripts. // Press "f" (open link in current window) or "F" (open in new window) // to activate link hints. After typing the characters for one of them, @@ -9,7 +9,7 @@ // flaws. For more background on this topic, see this blog post: // https://www.uninformativ.de/blog/postings/2020-02-24/0/POSTING-en.html -// Based on the following, but modified for lariza and personal taste: +// Based on the following, but modified for chorizo and personal taste: // // easy links for surf // christian hahn , sep 2010 @@ -32,7 +32,7 @@ function update_highlights_or_abort() var col_sel, col_unsel; var longest_id = 0; - if (document.lariza_hints.state === "follow_new") + if (document.chorizo_hints.state === "follow_new") { col_unsel = "#DAFFAD"; col_sel = "#FF5D00"; @@ -43,21 +43,21 @@ function update_highlights_or_abort() col_sel = "#33FF00"; } - for (var id in document.lariza_hints.labels) + for (var id in document.chorizo_hints.labels) { - var label = document.lariza_hints.labels[id]; + var label = document.chorizo_hints.labels[id]; var bgcol = col_unsel; longest_id = Math.max(longest_id, id.length); - if (document.lariza_hints.box.value !== "") + if (document.chorizo_hints.box.value !== "") { - submatch = id.match("^" + document.lariza_hints.box.value); + submatch = id.match("^" + document.chorizo_hints.box.value); if (submatch !== null) { var href_suffix = ""; var box_shadow_inner = "#B00000"; - if (id === document.lariza_hints.box.value) + if (id === document.chorizo_hints.box.value) { bgcol = col_sel; box_shadow_inner = "red"; @@ -91,16 +91,16 @@ function update_highlights_or_abort() label.span.style.backgroundColor = bgcol; } - if (document.lariza_hints.box.value.length > longest_id) + if (document.chorizo_hints.box.value.length > longest_id) set_state("inactive"); } function open_match() { - var choice = document.lariza_hints.box.value; - var was_state = document.lariza_hints.state; + var choice = document.chorizo_hints.box.value; + var was_state = document.chorizo_hints.state; - var elem = document.lariza_hints.labels[choice].elem; + var elem = document.chorizo_hints.labels[choice].elem; set_state("inactive"); /* Nukes labels. */ if (elem) @@ -153,20 +153,20 @@ function set_state(new_state) { console.log("[hints] New state: " + new_state); - document.lariza_hints.state = new_state; + document.chorizo_hints.state = new_state; - if (document.lariza_hints.state === "inactive") + if (document.chorizo_hints.state === "inactive") { nuke_labels(); // Removing our box causes unwanted scrolling. Just hide it. - document.lariza_hints.box.blur(); - document.lariza_hints.box.value = ""; - document.lariza_hints.box.style.visibility = "hidden"; + document.chorizo_hints.box.blur(); + document.chorizo_hints.box.value = ""; + document.chorizo_hints.box.style.visibility = "hidden"; } else { - if (document.lariza_hints.labels === null) + if (document.chorizo_hints.labels === null) create_labels(); // What a terrible hack. @@ -176,11 +176,11 @@ function set_state(new_state) // input element is currently focused. So ... yup, we install an // invisible text box (opacity 0) and focus it while follow mode // is active. - var box = document.lariza_hints.box; + var box = document.chorizo_hints.box; if (box === null) { - document.lariza_hints.box = document.createElement("input"); - box = document.lariza_hints.box; + document.chorizo_hints.box = document.createElement("input"); + box = document.chorizo_hints.box; box.addEventListener("keydown", on_box_key); box.addEventListener("input", on_box_input); @@ -190,7 +190,7 @@ function set_state(new_state) box.style.top = "0px"; box.type = "text"; - box.setAttribute("lariza_input_box", "yes"); + box.setAttribute("chorizo_input_box", "yes"); document.body.appendChild(box); } @@ -204,12 +204,12 @@ function set_state(new_state) function create_labels() { - document.lariza_hints.labels = new Object(); + document.chorizo_hints.labels = new Object(); var selector = "a[href]:not([href=''])"; - if (document.lariza_hints.state !== "follow_new") + if (document.chorizo_hints.state !== "follow_new") { - selector += ", input:not([type=hidden]):not([lariza_input_box=yes])"; + selector += ", input:not([type=hidden]):not([chorizo_input_box=yes])"; selector += ", textarea, select, button"; } @@ -242,7 +242,7 @@ function create_labels() span.style.visibility = "hidden"; span.style.zIndex = "2147483647"; // Max for WebKit according to luakit - document.lariza_hints.labels[label_id] = { + document.chorizo_hints.labels[label_id] = { "elem": elem, "span": span, "parent_style": null, @@ -272,9 +272,9 @@ function create_labels() function nuke_labels() { - for (var id in document.lariza_hints.labels) + for (var id in document.chorizo_hints.labels) { - var label = document.lariza_hints.labels[id]; + var label = document.chorizo_hints.labels[id]; reset_parent_style(label); @@ -285,7 +285,7 @@ function nuke_labels() label.elem.parentNode.removeChild(label.span); } - document.lariza_hints.labels = null; + document.chorizo_hints.labels = null; } function on_box_input(e) @@ -319,7 +319,7 @@ function on_window_key(e) return; } - if (document.lariza_hints.state === "inactive") + if (document.chorizo_hints.state === "inactive") { if (e.key === key_follow) set_state("follow"); @@ -328,12 +328,12 @@ function on_window_key(e) } } -if (document.lariza_hints === undefined) +if (document.chorizo_hints === undefined) { - document.lariza_hints = new Object(); - document.lariza_hints.box = null; - document.lariza_hints.labels = null; - document.lariza_hints.state = "inactive"; + document.chorizo_hints = new Object(); + document.chorizo_hints.box = null; + document.chorizo_hints.labels = null; + document.chorizo_hints.state = "inactive"; document.addEventListener("keyup", on_window_key); -- 2.39.2