summaryrefslogtreecommitdiff
path: root/public/javascripts/admin_interface.js
AgeCommit message (Collapse)Author
26 hoursRemove unreachable image_box drag-and-drop UIerdgeist
image_interface and meta_data (admin_interface.js), the sort_images action and route, and their admin.css rules -- the old vertical image_browser sidebar this all depended on isn't rendered by any current view. related_assets.js and the star-toggle sidebar fully supersede what this did. Confirmed unreachable via full grep across app/, config/routes.rb, and admin_bundle.js before removal -- route, controller action, and JS handler were all individually real and functional, just with nothing left anywhere that could ever trigger them.
27 hoursRender asset credit inside the gallery lightbox correctlyerdgeist
GLightbox's own selector-based description feature never actually resolved a selector in three different attempts -- literal text, then a resolved-but-empty div, then apparently not firing at all against the installed (unversioned) build. Replaced with a small afterSlideLoad handler that reads a plain data-credit-selector attribute and copies the real element's HTML into the slide's description area directly, depending only on GLightbox handing back a real DOM node per slide -- a much smaller contract than trusting its own caption-resolution feature. Renamed the credit div's class from glightbox-desc, since that name is reserved by the library's own bundled CSS (display: none !important) and can't be reliably overridden from here. Also: distinguishes the credit line and the "N Bilder" caption from ordinary body text (italic, muted, matching .author_and_date's existing convention), and makes the lightbox's caption card follow the site's light/dark toggle via Canvas/CanvasText, since the library's bundled theme never adapts to it on its own.
46 hoursMake headline images explicit, add asset creditserdgeist
- related_assets gains a `headline` boolean (DB-enforced: at most one per page), replacing "first image by position" as the headline rule. A rake task backfills the current first image on every live head/draft, so nothing changes visually until an editor changes it. - The image picker sidebar gets a star toggle reflecting the flag; the TinyMCE inline-image picker's badge now reads it too, instead of assuming position 0. - No headline chosen (or none attached) now falls back to the gallery-count caption itself becoming the lightbox trigger, instead of the gallery being unreachable. - Assets gain creator, source_url, and license_key (against a new config/asset_licenses.yml dictionary). asset_credit renders a degrading attribution line, reused as a hidden per-image glightbox caption so credit is one click away for every image, not only the headline's always-visible one. - Fixed: asset thumbnails rendered unconditionally regardless of whether a real variant exists on disk. Asset#has_variant? checks file existence, not content type -- some legacy PDFs have real pre-rewrite thumbnails a content-type check would have hidden. - assets#new/edit rebuilt onto the same node_description/node_content layout as assets#show, picking up the three new fields in the process.
3 daysAdd copy-url button to assets; unified the mechanism across viewserdgeist
4 daysEmit a report-only Content-Security-Policy with nonced inline scriptserdgeist
- dark-mode restore now travels nonced, the admin constants likewise - AUTH_TOKEN deleted in favour of the csrf meta tag - new report collector at /csp_reports
5 daysAdd Trash affordances: cockpit, listing, dashboard entryerdgeist
nodes#show gains a Trash section on trashed nodes: provenance from the trash entry, a restore form whose parent picker pre-fills the old parent while it still lives, and permanent deletion. A Move-to-Trash button joins the status actions on living nodes. nodes#trashed lists trashed subtree roots with weight, provenance, and deletion; the dashboard housekeeping row links to it, and trash/destroy redirect there. Deletion from Trash now removes the whole subtree, deepest first, each node through a real destroy! so every per-node cascade runs -- amending the never-recursive rule for this one sanctioned path (both confirms state the count; the root entry carries destroyed_descendants). Bare Node#destroy still refuses children.
6 daysmanaged RRULE constructs now include week selectionerdgeist
Improve the humanizer to also understand weekly patters that an editor can manually select, on top of the single week rules. Extend template and javascript controller to reflect these changes.
7 daysRemove some remnants of legacy admin wizard interfaceerdgeist
8 daysAdd inline image insertion for page bodies, plus a headline-conflict badgeerdgeist
Custom TinyMCE toolbar button opens a picker scoped to a page's own attached images. Selecting one and a placement (full width, left, right) inserts <a class="glightbox" data-gallery="page-N"> wrapping an <img>, sharing the existing headline-image lightbox gallery. No native TinyMCE image dialog or resize handles -- placement is fixed to the three options via CSS classes only. extended_valid_elements defines a and img explicitly and symmetrically; valid_classes allows the placement classes and glightbox specifically. content_style renders placement inside the editing iframe, since ccc.css doesn't load there. A pre-save pass removes any a.glightbox left without an img, covering in-editor deletion regardless of how it happened. Alt text comes from the asset's name, escaped. A badge marks whichever attached image sits at position 0, since _headline_image.html.erb always renders that position as the page's automatic headline. Shown in the sidebar Images list and in the picker grid.
9 daysAdd a toggleable live preview panel to both editorserdgeist
Hidden by default, shares horizontal space with the body editor once opened rather than a separate section, and only requests the iframe's src on first toggle -- no preview traffic at all until someone actually wants to see it. Refreshes automatically on every successful autosave; a separate force-render button re-attempts a save-and- refresh cycle immediately, for when the normal 7-second cycle has been interrupted (a lock-lost error, a transient failure) and waiting for the next tick isn't good enough.
9 daysFix autosave bug: sync tinymce's state back to textarea before serializingerdgeist
10 daysAsset picker: attach/detach/reorder UI, read-only view, autosave fixerdgeist
Replaces nodes#edit's old Images section -- a hidden panel dumping every image asset in the system unfiltered (#image_browser) plus a raw drag-and-drop box (#image_box) -- with a small search-and-click picker built on the endpoint from the last two commits. Attaching posts immediately and appends the new thumbnail via a cloned <template> -- icons only render correctly through the Rails helper server-side, so the template holds real, pre-rendered markup for JS to clone rather than duplicating raw SVG in a JS string. Reordering is jQuery UI sortable on the small attached list only, with a dedicated drag handle rather than the whole thumbnail. Two bugs caught while click-testing, fixed here rather than shipped and patched after: the search panel never closed after attaching an image, since the success handler re-triggered focus to keep it open for attaching several in a row -- which meant it just re-populated itself forever instead of signaling "done." Fixed to close explicitly; a click-outside-closes handler was added alongside it, matching the affordance the top-bar search already has. A real, independent, pre-existing data bug surfaced during the same testing: Node#autosave!'s first-time-creation branch never carried related assets forward from whatever page was previously current -- attach an image, let autosave fire once, and it silently landed on a fresh, assetless Page row. Long-dormant, not introduced by this work, just finally exercised by something that made it visible. Fixed inside the `unless self.autosave` guard specifically -- running this on every call, not just creation, would overwrite anything attached directly to an existing autosave in between, a worse bug than the one being fixed. nodes#show gains a read-only Images section, rendered only when a page actually has attached images, so an attachment can be confirmed present without entering the edit/lock cycle -- useful on its own, and specifically useful the next time an asset bug needs investigating. Its thumbnail CSS is shared with the edit view's picker via a class (.thumbnail_list) rather than duplicated under a second name.
10 daysAdd a grouped tag+node search endpoint for the upcoming dashboarderdgeist
AdminController#dashboard_search returns tags and nodes as separate, labeled groups (via ActsAsTaggableOn::Tag.named_like and Node.editor_search) rather than the flat per-node list every existing picker returns. initSearchPicker gains a renderResults callback option that, when given, replaces the default per-node rendering entirely -- lets the dashboard render its two labeled groups without a second, parallel picker implementation. resultsHeaderHtml (the "Press Enter to see all results" hint) is now threaded through as a third argument to renderResults, so a picker with custom rendering can still show it -- previously only the default per-node branch ever did. Tags link straight to the existing /admin/nodes/tags/:tag view rather than becoming an in-place filter chip.
13 daysRework events#new with the new layout paradigmerdgeist
2026-07-08Autosave posts to its own endpoint surface lock loss immediatelyerdgeist
Previously piggybacked on the main form's action and relied on a .js.erb response to update #flash; now posts to the dedicated autosave route with an explicit _method=put override, and reacts to a 423 by stopping the timer and showing a persistent banner rather than letting the next Save discover the conflict on its own.
2026-07-08Whitespace fixeserdgeist
2026-07-08WIP: dynamic rrule builder, javascript sideerdgeist
2026-07-08Link new metadata behaviour and layout in css and javascripterdgeist
2026-07-08Whitespace fixeserdgeist
2026-07-08WIP: dynamic rrule buildererdgeist
2026-07-07Add link and lists to tinymce, wash pasted blocks clean of classeserdgeist
2026-06-27Stage 7 click-testing fixeserdgeist
- aggregate: switch to shortcode syntax [aggregate ...]; fix paragraph wrapping by excising the shortcode and its surrounding <p> before sanitize, concatenating collection output outside sanitized content - page.rb: remove aggregate XML unwrapping from rewrite_links_in_body (no longer needed with shortcode approach) - rss builders: explicit CGI.escapeHTML on title/abstract; Builder 3.3.0 does not escape when target buffer is html_safe (ActionView default) - tinymce: disable menubar and promotion nag; add code plugin, remove paste plugin (built into TinyMCE 8 core); configure via admin_interface.js directly (config/tinymce.yml affects tinymce() helper only, not tinymce.init)
2026-06-27Stage 7: Rails 7.2 → 8.1 on Ruby 3.2.11erdgeist
- Bump Rails to 8.1.3 (Ruby unchanged at 3.2.11, new gemset rails8-upgrade) - config.load_defaults 8.1; merge app:update diffs for all environment files - Remove routing-filter 0.7.0; replace with native scope '(:locale)' in routes.rb and default_url_options in ApplicationController - Delete config/initializers/routing_filter_rails71_patch.rb - Replace vendored TinyMCE 3.x (~200 files) with tinymce-rails ~> 8.3; migrate admin_interface.js from jQuery .tinymce()/advanced theme to tinymce.init(); add config/tinymce.yml; note: TinyMCE 7+ is GPL - rails-i18n ~> 8.0 added explicitly (previously indirect dependency) - awesome_nested_set, acts-as-taggable-on pinned to git main/master (gemspec activerecord < 8.1 ceiling; no functional incompatibility; repin to version once upstream releases updated gemspecs) - globalize ~> 7.0, libxml-ruby ~> 5.0, nokogiri ~> 1.18, pg ~> 1.5 - sass-rails, coffee-rails, uglifier moved from :assets group to main (Sprockets 4 convention; :assets group no longer meaningful) - Node: head, draft, lock_owner marked belongs_to optional: true - Page: node, user, editor marked belongs_to optional: true - Static assets in public/images/ and public/javascripts/ referenced via plain HTML tags; Rails 8 load_defaults raises on pipeline helpers for undeclared assets - sessions_controller_test.rb: remove stale require and dead rescue_action - users_controller_test.rb: assert button[type=submit] not input[type=submit] (Rails 8 button_to renders <button> not <input>) - test_helper.rb: node.reload after children.create! (awesome_nested_set 3.9.0 does not refresh parent in memory after callback) - 129 runs, 339 assertions, 3 failures, 0 errors — identical baseline to 7.2
2025-02-06Improve worklflowerdgeist
2025-02-05Enhance admin view by sitemaperdgeist
2009-11-16tinymce update. activated safari and paste plugin to prevent messy markup after copy and paste. hope that helps *sigh*hukl
2009-10-19page editor is initialized firsthukl
2009-10-18re-activated admin overview screen - listing 20 recent changes and 20 current drafts. more to comehukl
2009-09-13the sorter needed a seperate initializerhukl
2009-09-13conditional initializers - not sure if this actually improves anything but it seems better this wayhukl
Closes #18
2009-09-12re-enabled autosave. reduced timeout to 7 seconds which triggers only if something has actually changedhukl
2009-09-09added editing of slugs and moving of nodes. to edit a slug or move a node you edit that node, make your changes and save. the slug and parent node changes ↵hukl
get staged and are applied once that revision is published
2009-09-09huge tiny_mce update - now using the tiny_mce jquery build which allows tiny_mce to be initialized via jquery - great!hukl
2009-09-08new interface for adding nodes. still needs a bit radio button magickhukl
2009-09-05fixed two js lint warningshukl
2009-09-02final clean uphukl
2009-09-02even betterhukl
2009-09-02more refactoring - self.bite(table)hukl
2009-09-02wow - jquery sucks from time to time. it works now entirely as expected but I don't know why it didn't before *sigh*hukl
2009-09-02corresponding css and js changeshukl
2009-09-02further interface improvementshukl
2009-09-02some drag and drop refinementshukl
2009-09-02only sort images if something has actually changedhukl
2009-09-02drag out and drag back over the droppable now workshukl
2009-09-02formattinghukl
2009-09-01Added javascript goodness to add and sort and drag and drop images on pageshukl
2009-09-01slight interface changeshukl
2009-08-15made the sorting a bit smoother by adding a placeholderhukl
2009-08-09added sorting (via drag and drop) and deleting of menu items. Its not perfect though and needs more styling. I'm unsure about the proper route for the sort ↵hukl
action. Will investigate.
2009-08-08lots of new code to manage menu items - harder than expected :/hukl