diff --git a/Playground.doap b/Playground.doap index 92dac46..d89884a 100644 --- a/Playground.doap +++ b/Playground.doap @@ -4,12 +4,10 @@ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:gnome="http://api.gnome.org/doap-extensions#" - xmlns="http://usefulinc.com/ns/doap#" -> + xmlns="http://usefulinc.com/ns/doap#"> Playhouse A playground for HTML/CSS/JavaScript - Something clever. + Playhouse make it easy to prototype, teach, design, learn and build Web things. @@ -18,7 +16,7 @@ Sonny Piers - + @@ -27,9 +25,7 @@ - + sonny diff --git a/README.md b/README.md index 5288331..73cc28f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,46 @@ + + # Playhouse A playground for HTML/CSS/JavaScript ![screenshot](data/screenshot.png) -This is a work in progress. + + +## About + +Playhouse make it easy to prototype, teach, design, learn and build Web things. + +Features: + +- HTML/CSS/JavaScript editors +- live Web preview +- standard keyboard shortcuts +- Developer Tools +- Dark/light mode support + +## Tips an tricks + +### How can I use a library? + +Use https://unpkg.com/ and dynamic imports in the `JavaScript` panel. + +```js +// Example of loading a library that supports ES modules +import("https://unpkg.com/date-fns@2.29.3/esm/index.js?module") + .then((datefns) => { + console.log(datefns.add(new Date(), { days: 2 })); + }) + .catch(console.error); + +// Example of loading a library that registers on the global object +import("https://unpkg.com/jquery@3.6.1/dist/jquery.js") + .then(() => { + $("p").hide(); + }) + .catch(console.error); +``` ## Development diff --git a/data/meson.build b/data/meson.build index bb2cd34..0bf3111 100644 --- a/data/meson.build +++ b/data/meson.build @@ -14,14 +14,6 @@ if desktop_utils.found() ) endif -appstream_file = i18n.merge_file( - 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') -) - service_conf = configuration_data() service_conf.set('bindir', bindir) configure_file( @@ -31,6 +23,21 @@ configure_file( install_dir: join_paths(get_option('datadir'), 'dbus-1/services') ) +appstream_file = i18n.merge_file( + 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') +) + +appstream_cli = find_program('appstreamcli', required: false) +if appstream_cli.found() + test('Validate metainfo file', appstream_cli, + args: ['validate', '--override=release-time-missing=info', '--no-net', appstream_file] + ) +endif + appstream_util = find_program('appstream-util', required: false) if appstream_util.found() test('Validate appstream file', appstream_util, diff --git a/data/re.sonny.Playhouse.metainfo.xml b/data/re.sonny.Playhouse.metainfo.xml index cd58054..4e9b62e 100644 --- a/data/re.sonny.Playhouse.metainfo.xml +++ b/data/re.sonny.Playhouse.metainfo.xml @@ -4,20 +4,33 @@ re.sonny.Playhouse.desktop Playhouse Sonny Piers - sonny@fastmail.net + sonnyp@gnome.org CC0-1.0 GPL-3.0 A playground for HTML/CSS/JavaScript re.sonny.Playhouse -

Something clever

+

Playhouse make it easy to prototype, teach, design, learn and build Web things.

+
    +
  • HTML/CSS/JavaScript editors
  • +
  • live Web preview
  • +
  • standard keyboard shortcuts
  • +
  • Developer Tools
  • +
  • Dark/light mode support
  • +
https://playhouse.sonny.re https://playhouse.sonny.re/feedback https://playhouse.sonny.re/donate https://playhouse.sonny.re/translate + + + https://raw.githubusercontent.com/sonnyp/Playhouse/main/data/screenshot.png + + + HiDpiIcon diff --git a/data/screenshot.png b/data/screenshot.png index e473b55..44cfb15 100644 Binary files a/data/screenshot.png and b/data/screenshot.png differ diff --git a/meson.build b/meson.build index 9ed24e0..35ece7d 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('Playhouse', - version: '0.1.0', + version: '1.0', meson_version: '>= 0.59.0', license: 'GPL-3.0-only' ) diff --git a/src/Devtools.js b/src/Devtools.js index 297139f..c8fe39a 100644 --- a/src/Devtools.js +++ b/src/Devtools.js @@ -44,13 +44,13 @@ export default function Devtools({ web_view, window, builder }) { return true; } - ["attach", "bring-to-front", "detach", "open-window", "closed"].forEach( - (event) => { - inspector.connect(event, () => { - console.log(event); - }); - }, - ); + // ["attach", "bring-to-front", "detach", "open-window", "closed"].forEach( + // (event) => { + // inspector.connect(event, () => { + // console.log(event); + // }); + // }, + // ); inspector.connect("attach", enableInspector); inspector.connect("open-window", enableInspector); diff --git a/src/ShortcutsWindow.blp b/src/ShortcutsWindow.blp index 90d6453..348cee6 100644 --- a/src/ShortcutsWindow.blp +++ b/src/ShortcutsWindow.blp @@ -5,6 +5,20 @@ ShortcutsWindow shortcuts_window { ShortcutsSection { ShortcutsGroup { + ShortcutsShortcut { + accelerator: "I"; + title: _("Toggle Developer Tools"); + } + + ShortcutsShortcut { + accelerator: "Z"; + title: _("Undo"); + } + ShortcutsShortcut { + accelerator: "Z"; + title: _("Redo"); + } + ShortcutsShortcut { accelerator: "question"; title: _("Keyboard Shortcuts"); diff --git a/src/window.blp b/src/window.blp index 37b0818..ccaa92d 100644 --- a/src/window.blp +++ b/src/window.blp @@ -150,7 +150,7 @@ Adw.ApplicationWindow window { } } - ScrolledWindow panel_javascript { + ScrolledWindow { name: "panel_javascript"; .GtkSourceView source_view_javascript { buffer: .GtkSourceBuffer {};