diff --git a/.gitattributes b/.gitattributes index b2f2211..866cdb2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ package-lock.json -diff -data/icons/re.sonny.Webground-symbolic.svg -diff -data/icons/re.sonny.Webground.Devel.svg -diff -data/icons/re.sonny.Webground.svg -diff +data/icons/re.sonny.Playhouse-symbolic.svg -diff +data/icons/re.sonny.Playhouse.Devel.svg -diff +data/icons/re.sonny.Playhouse.svg -diff -# po/re.sonny.Webground.pot -diff +# po/re.sonny.Playhouse.pot -diff # po/*.po -diff diff --git a/.gitignore b/.gitignore index d341d73..8237608 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ install .eslintcache *~ *.compiled -Webground.flatpak +Playhouse.flatpak diff --git a/.husky/pre-commit b/.husky/pre-commit index 6daf6b9..12622ea 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,9 +1,9 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -xgettext -f po/POTFILES -o po/re.sonny.Webground.pot --no-wrap -cTRANSLATORS --from-code=UTF-8 -sed -i "s/same license as the PACKAGE package./same license as the re.sonny.Webground package./" po/re.sonny.Webground.pot -sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Webground/" po/re.sonny.Webground.pot -git add po/re.sonny.Webground.pot +xgettext -f po/POTFILES -o po/re.sonny.Playhouse.pot --no-wrap -cTRANSLATORS --from-code=UTF-8 +sed -i "s/same license as the PACKAGE package./same license as the re.sonny.Playhouse package./" po/re.sonny.Playhouse.pot +sed -i "s/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: re.sonny.Playhouse/" po/re.sonny.Playhouse.pot +git add po/re.sonny.Playhouse.pot npx lint-staged diff --git a/Webground.doap b/Playground.doap similarity index 88% rename from Webground.doap rename to Playground.doap index 5ba0550..9c1643b 100644 --- a/Webground.doap +++ b/Playground.doap @@ -6,13 +6,13 @@ xmlns:gnome="http://api.gnome.org/doap-extensions#" xmlns="http://usefulinc.com/ns/doap#" > - Webground + Playhouse A Playground for HTML/CSS/JavaScript Something clever. - - + + JavaScript diff --git a/README.md b/README.md index 4df17e6..9418efb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Webground +# Playhouse A Playground for HTML/CSS/JavaScript diff --git a/data/icons/re.sonny.Webground-symbolic.svg b/data/icons/re.sonny.Playhouse-symbolic.svg similarity index 100% rename from data/icons/re.sonny.Webground-symbolic.svg rename to data/icons/re.sonny.Playhouse-symbolic.svg diff --git a/data/icons/re.sonny.Webground.Devel.svg b/data/icons/re.sonny.Playhouse.Devel.svg similarity index 100% rename from data/icons/re.sonny.Webground.Devel.svg rename to data/icons/re.sonny.Playhouse.Devel.svg diff --git a/data/icons/re.sonny.Webground.Source.svg b/data/icons/re.sonny.Playhouse.Source.svg similarity index 99% rename from data/icons/re.sonny.Webground.Source.svg rename to data/icons/re.sonny.Playhouse.Source.svg index 6eb3c51..240f144 100644 --- a/data/icons/re.sonny.Webground.Source.svg +++ b/data/icons/re.sonny.Playhouse.Source.svg @@ -4,7 +4,7 @@ style="display:inline;enable-background:new" version="1.0" inkscape:output_extension="org.inkscape.output.svg.inkscape" - sodipodi:docname="re.sonny.Webground.Source.svg" + sodipodi:docname="re.sonny.Playhouse.Source.svg" inkscape:version="1.1-rc (52f87abb86, 2021-05-02)" sodipodi:version="0.32" id="svg11300" diff --git a/data/icons/re.sonny.Webground.png b/data/icons/re.sonny.Playhouse.png similarity index 100% rename from data/icons/re.sonny.Webground.png rename to data/icons/re.sonny.Playhouse.png diff --git a/data/icons/re.sonny.Webground.svg b/data/icons/re.sonny.Playhouse.svg similarity index 100% rename from data/icons/re.sonny.Webground.svg rename to data/icons/re.sonny.Playhouse.svg diff --git a/data/meson.build b/data/meson.build index a75c434..2b361f0 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,6 @@ desktop_file = i18n.merge_file( - input: 're.sonny.Webground.desktop', - output: 're.sonny.Webground.desktop', + input: 're.sonny.Playhouse.desktop', + output: 're.sonny.Playhouse.desktop', type: 'desktop', po_dir: '../po', install: true, @@ -15,8 +15,8 @@ if desktop_utils.found() endif appstream_file = i18n.merge_file( - input: 're.sonny.Webground.metainfo.xml', - output: 're.sonny.Webground.metainfo.xml', + input: 're.sonny.Playhouse.metainfo.xml', + output: 're.sonny.Playhouse.metainfo.xml', po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'metainfo') @@ -25,8 +25,8 @@ appstream_file = i18n.merge_file( service_conf = configuration_data() service_conf.set('bindir', bindir) configure_file( - input: 're.sonny.Webground.service', - output: 're.sonny.Webground.service', + input: 're.sonny.Playhouse.service', + output: 're.sonny.Playhouse.service', configuration: service_conf, install_dir: join_paths(get_option('datadir'), 'dbus-1/services') ) @@ -38,7 +38,7 @@ if appstream_util.found() ) endif -install_data('re.sonny.Webground.gschema.xml', +install_data('re.sonny.Playhouse.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) @@ -49,5 +49,5 @@ if compile_schemas.found() ) endif -install_data('icons/re.sonny.Webground.svg', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps')) -install_data('icons/re.sonny.Webground-symbolic.svg', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/symbolic/apps')) +install_data('icons/re.sonny.Playhouse.svg', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps')) +install_data('icons/re.sonny.Playhouse-symbolic.svg', install_dir: join_paths(get_option('datadir'), 'icons/hicolor/symbolic/apps')) diff --git a/data/re.sonny.Webground.desktop b/data/re.sonny.Playhouse.desktop similarity index 81% rename from data/re.sonny.Webground.desktop rename to data/re.sonny.Playhouse.desktop index b430071..5f815e1 100644 --- a/data/re.sonny.Webground.desktop +++ b/data/re.sonny.Playhouse.desktop @@ -1,12 +1,12 @@ [Desktop Entry] # TRANSLATORS: Don't translate -Name=Webground +Name=Playhouse Comment=A playground for Web code -Exec=re.sonny.Webground +Exec=re.sonny.Playhouse Terminal=false Type=Application Categories=WebDevelopment;Development;IDE;GNOME;GTK; -Icon=re.sonny.Webground +Icon=re.sonny.Playhouse # TRANSLATORS: Don't translate Keywords=JS Bin;CodePen;JSFiddle; DBusActivatable=true diff --git a/data/re.sonny.Webground.gschema.xml b/data/re.sonny.Playhouse.gschema.xml similarity index 80% rename from data/re.sonny.Webground.gschema.xml rename to data/re.sonny.Playhouse.gschema.xml index df4c6dc..82e5e5f 100644 --- a/data/re.sonny.Webground.gschema.xml +++ b/data/re.sonny.Playhouse.gschema.xml @@ -1,6 +1,6 @@ - - + + true diff --git a/data/re.sonny.Webground.metainfo.xml b/data/re.sonny.Playhouse.metainfo.xml similarity index 57% rename from data/re.sonny.Webground.metainfo.xml rename to data/re.sonny.Playhouse.metainfo.xml index d718f65..d3a44a4 100644 --- a/data/re.sonny.Webground.metainfo.xml +++ b/data/re.sonny.Playhouse.metainfo.xml @@ -1,21 +1,21 @@ - re.sonny.Webground - re.sonny.Webground.desktop - Webground + re.sonny.Playhouse + re.sonny.Playhouse.desktop + Playhouse Sonny Piers sonny@fastmail.net CC0-1.0 GPL-3.0 A Playground for HTML/CSS/JavaScript - re.sonny.Webground + re.sonny.Playhouse

Something clever

- https://webground.sonny.re - https://webground.sonny.re/feedback - https://webground.sonny.re/donate - https://webground.sonny.re/translate + https://playhouse.sonny.re + https://playhouse.sonny.re/feedback + https://playhouse.sonny.re/donate + https://playhouse.sonny.re/translate diff --git a/data/re.sonny.Playhouse.service b/data/re.sonny.Playhouse.service new file mode 100644 index 0000000..1010969 --- /dev/null +++ b/data/re.sonny.Playhouse.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=re.sonny.Playhouse +Exec=@bindir@/re.sonny.Playhouse --gapplication-service diff --git a/data/re.sonny.Webground.service b/data/re.sonny.Webground.service deleted file mode 100644 index d671cd7..0000000 --- a/data/re.sonny.Webground.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=re.sonny.Webground -Exec=@bindir@/re.sonny.Webground --gapplication-service diff --git a/meson.build b/meson.build index aedcdce..94ddbf7 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('re.sonny.Webground', +project('re.sonny.Playhouse', version: '0.1.0', meson_version: '>= 0.59.0', license: 'GPL-3.0-only' diff --git a/package-lock.json b/package-lock.json index 22eb805..b475e16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "Webground", + "name": "Playhouse", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/po/POTFILES b/po/POTFILES index 60cedea..e64e177 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,6 +1,6 @@ -data/re.sonny.Webground.desktop -data/re.sonny.Webground.gschema.xml -data/re.sonny.Webground.metainfo.xml +data/re.sonny.Playhouse.desktop +data/re.sonny.Playhouse.gschema.xml +data/re.sonny.Playhouse.metainfo.xml src/about.js src/ShortcutsWindow.ui src/window.ui diff --git a/po/re.sonny.Webground.pot b/po/re.sonny.Playground.pot similarity index 77% rename from po/re.sonny.Webground.pot rename to po/re.sonny.Playground.pot index 8210125..aed43f8 100644 --- a/po/re.sonny.Webground.pot +++ b/po/re.sonny.Playground.pot @@ -1,12 +1,12 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the re.sonny.Webground package. +# This file is distributed under the same license as the re.sonny.Playhouse package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: re.sonny.Webground\n" +"Project-Id-Version: re.sonny.Playhouse\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-01-04 00:47+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" @@ -18,24 +18,24 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #. TRANSLATORS: Don't translate -#: data/re.sonny.Webground.desktop:4 -msgid "Webground" +#: data/re.sonny.Playhouse.desktop:4 +msgid "Playhouse" msgstr "" -#: data/re.sonny.Webground.desktop:5 +#: data/re.sonny.Playhouse.desktop:5 msgid "A playground for Web code" msgstr "" #. TRANSLATORS: Don't translate -#: data/re.sonny.Webground.desktop:12 +#: data/re.sonny.Playhouse.desktop:12 msgid "JS Bin;CodePen;JSFiddle;" msgstr "" -#: data/re.sonny.Webground.metainfo.xml:10 src/about.js:9 +#: data/re.sonny.Playhouse.metainfo.xml:10 src/about.js:9 msgid "A Playground for HTML/CSS/JavaScript" msgstr "" -#: data/re.sonny.Webground.metainfo.xml:13 +#: data/re.sonny.Playhouse.metainfo.xml:13 msgid "Something clever" msgstr "" @@ -53,5 +53,5 @@ msgid "Quit" msgstr "" #: src/window.ui:165 -msgid "About Webground" +msgid "About Playhouse" msgstr "" diff --git a/po/re.sonny.Playhouse.pot b/po/re.sonny.Playhouse.pot new file mode 100644 index 0000000..7143454 --- /dev/null +++ b/po/re.sonny.Playhouse.pot @@ -0,0 +1,57 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the re.sonny.Playhouse package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: re.sonny.Playhouse\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-01-14 13:46+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. TRANSLATORS: Don't translate +#: data/re.sonny.Playhouse.desktop:4 +msgid "Playhouse" +msgstr "" + +#: data/re.sonny.Playhouse.desktop:5 +msgid "A playground for Web code" +msgstr "" + +#. TRANSLATORS: Don't translate +#: data/re.sonny.Playhouse.desktop:12 +msgid "JS Bin;CodePen;JSFiddle;" +msgstr "" + +#: data/re.sonny.Playhouse.metainfo.xml:10 src/about.js:9 +msgid "A Playground for HTML/CSS/JavaScript" +msgstr "" + +#: data/re.sonny.Playhouse.metainfo.xml:13 +msgid "Something clever" +msgstr "" + +#. TRANSLATORS: eg. 'Translator Name ' or 'Translator Name https://website.example' +#: src/about.js:19 +msgid "translator-credits" +msgstr "" + +#: src/ShortcutsWindow.ui:15 src/window.ui:161 +msgid "Keyboard Shortcuts" +msgstr "" + +#: src/ShortcutsWindow.ui:21 +msgid "Quit" +msgstr "" + +#: src/window.ui:165 +msgid "About Playhouse" +msgstr "" diff --git a/re.sonny.Webground.json b/re.sonny.Playhouse.json similarity index 91% rename from re.sonny.Webground.json rename to re.sonny.Playhouse.json index 3dea00c..cd21093 100644 --- a/re.sonny.Webground.json +++ b/re.sonny.Playhouse.json @@ -1,10 +1,10 @@ { - "app-id": "re.sonny.Webground", + "app-id": "re.sonny.Playhouse", "runtime": "org.gnome.Platform", "runtime-version": "master", "sdk": "org.gnome.Sdk", "sdk-extensions": ["org.freedesktop.Sdk.Extension.node16"], - "command": "re.sonny.Webground", + "command": "re.sonny.Playhouse", "build-options": { "append-path": "/usr/lib/sdk/node16/bin" }, @@ -30,7 +30,7 @@ ] }, { - "name": "Webground", + "name": "Playhouse", "buildsystem": "meson", "builddir": true, "sources": [ diff --git a/src/WebView.js b/src/WebView.js index f6138d5..3a1e3d5 100644 --- a/src/WebView.js +++ b/src/WebView.js @@ -1,4 +1,14 @@ export default function WebView({ web_view }) { const settings = web_view.get_settings(); settings.set_enable_developer_extras(true); + + const user_content_manager = web_view.get_user_content_manager() + + user_content_manager.connect('script-message-received::foobar', () => { + console.log('foo') + }) + + + user_content_manager.register_script_message_handler ("foobar"); + } diff --git a/src/about.js b/src/about.js index 065d440..a420144 100644 --- a/src/about.js +++ b/src/about.js @@ -10,13 +10,13 @@ export default function About({ application, datadir, version }) { copyright: "Copyright 2021 Sonny Piers", license_type: Gtk.License.GPL_3_0_ONLY, version, - website: "https://webground.sonny.re", + website: "https://playhouse.sonny.re", transient_for: application.get_active_window(), - // Prevents input on Webground when clicking on a link + // Prevents input on Playhouse when clicking on a link // modal: true, - logo_icon_name: "re.sonny.Webground", + logo_icon_name: "re.sonny.Playhouse", // TRANSLATORS: eg. 'Translator Name ' or 'Translator Name https://website.example' - translator_credits: _("translator-credits") + translator_credits: _("translator-credits"), }); // dialog.add_credit_section("Contributors", [ // // Add yourself as @@ -30,4 +30,3 @@ export default function About({ application, datadir, version }) { return { dialog }; } - diff --git a/src/application.js b/src/application.js index a1d816f..35e86cc 100644 --- a/src/application.js +++ b/src/application.js @@ -9,7 +9,7 @@ import { relativePath, loadStyleSheet } from "./util.js"; export default function Application({ version, datadir }) { const application = new Adw.Application({ - application_id: "re.sonny.Webground", + application_id: "re.sonny.Playhouse", // flags: Gio.ApplicationFlags.HANDLES_OPEN, }); @@ -17,7 +17,7 @@ export default function Application({ version, datadir }) { Window({ application, }); - }) + }); application.connect("startup", () => { loadStyleSheet(relativePath("./style.css")); @@ -39,7 +39,7 @@ export default function Application({ version, datadir }) { null, ); - application.set_option_context_description(""); + application.set_option_context_description(""); application.set_option_context_parameter_string("[URIā€¦]"); // TODO: Add examples // application.set_option_context_summary(""); diff --git a/src/main.js b/src/main.js index e6251c6..fe1694c 100644 --- a/src/main.js +++ b/src/main.js @@ -3,15 +3,15 @@ import { bindtextdomain, textdomain } from "gettext"; import Application from "./application.js"; -GLib.set_prgname("re.sonny.Webground"); -GLib.set_application_name("Webground"); +GLib.set_prgname("re.sonny.Playhouse"); +GLib.set_application_name("Playhouse"); export default function main(argv, { version, datadir }) { bindtextdomain( - "re.sonny.Webground", + "re.sonny.Playhouse", GLib.build_filenamev([datadir, "locale"]), ); - textdomain("re.sonny.Webground"); + textdomain("re.sonny.Playhouse"); const application = Application({ version, datadir }); diff --git a/src/meson.build b/src/meson.build index 1e27b6d..6ebbc63 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,4 @@ -install_subdir('.', install_dir : pkgdatadir, exclude_files: ['re.sonny.Webground', 'meson.build']) +install_subdir('.', install_dir : pkgdatadir, exclude_files: ['re.sonny.Playhouse', 'meson.build']) bin_conf = configuration_data() bin_conf.set('GJS', find_program('gjs').path()) @@ -10,8 +10,8 @@ bin_conf.set('datadir', datadir) bin_conf.set('pkgdatadir', pkgdatadir) configure_file( - input: 're.sonny.Webground', - output: 're.sonny.Webground', + input: 're.sonny.Playhouse', + output: 're.sonny.Playhouse', configuration: bin_conf, install: true, install_dir: get_option('bindir') diff --git a/src/re.sonny.Webground b/src/re.sonny.Playhouse similarity index 100% rename from src/re.sonny.Webground rename to src/re.sonny.Playhouse diff --git a/src/window.js b/src/window.js index 7b57bf4..4109ad7 100644 --- a/src/window.js +++ b/src/window.js @@ -11,8 +11,8 @@ import Devtools from "./Devtools.js"; import WebView from "./WebView.js"; const settings = new Gio.Settings({ - schema_id: "re.sonny.Webground", - path: "/re/sonny/Webground/", + schema_id: "re.sonny.Playhouse", + path: "/re/sonny/Playhouse/", }); export default function Welcome({ application }) { @@ -38,7 +38,7 @@ export default function Welcome({ application }) { const source_view_html = builder.get_object("source_view_html"); source_view_html.buffer.set_language(language_manager.get_language("html")); - source_view_html.buffer.set_text(`

Webground!

`.trim(), -1); + source_view_html.buffer.set_text(`

Playhouse!

`.trim(), -1); const source_view_css = builder.get_object("source_view_css"); source_view_css.buffer.set_language(language_manager.get_language("css")); @@ -57,11 +57,36 @@ export default function Welcome({ application }) { const button_output = builder.get_object("button_output"); const button_devtools = builder.get_object("button_devtools"); - settings.bind('show-html', button_html, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('show-css', button_css, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('show-javascript', button_javascript, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('show-output', button_output, 'active', Gio.SettingsBindFlags.DEFAULT); - settings.bind('show-devtools', button_devtools, 'active', Gio.SettingsBindFlags.DEFAULT); + settings.bind( + "show-html", + button_html, + "active", + Gio.SettingsBindFlags.DEFAULT, + ); + settings.bind( + "show-css", + button_css, + "active", + Gio.SettingsBindFlags.DEFAULT, + ); + settings.bind( + "show-javascript", + button_javascript, + "active", + Gio.SettingsBindFlags.DEFAULT, + ); + settings.bind( + "show-output", + button_output, + "active", + Gio.SettingsBindFlags.DEFAULT, + ); + settings.bind( + "show-devtools", + button_devtools, + "active", + Gio.SettingsBindFlags.DEFAULT, + ); button_html.bind_property( "active", @@ -108,7 +133,7 @@ export default function Welcome({ application }) { - Webground + Playhouse diff --git a/src/window.ui b/src/window.ui index 3eca13e..b935f0f 100644 --- a/src/window.ui +++ b/src/window.ui @@ -162,7 +162,7 @@ app.shortcuts - About Webground + About Playhouse app.about