{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-10-21T11:02:19Z","object_id":{"id":1303,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_wires","title":"mod_wires","uri":"https:\/\/zotonic.com\/id\/1303"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"refers":{"objects":[{"created":"2026-10-21T11:02:19Z","object_id":{"id":1303,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_wires","title":"mod_wires","uri":"https:\/\/zotonic.com\/id\/1303"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-10-21T11:02:19Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-10-21T11:02:19Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-10-21T11:02:19Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":3},{"created":"2026-10-21T11:02:19Z","object_id":{"id":2583,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_user_interface_and_interaction","title":"User interface and interaction","uri":"https:\/\/zotonic.com\/id\/2583"},"seq":4},{"created":"2026-10-21T11:02:19Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":5},{"created":"2026-10-21T11:02:19Z","object_id":{"id":2673,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_javascript","title":"JavaScript","uri":"https:\/\/zotonic.com\/id\/2673"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":3096,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3096"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_wires","page_url":{"en":"https:\/\/zotonic.com\/docs\/3096\/wires","x-default":"https:\/\/zotonic.com\/docs\/3096\/wires"},"preview_url":null,"resource":{"version":22,"pivot_location_lat":null,"title":"wires","is_authoritative":true,"body":"<p>Resolve JavaScript dependencies for automatic widget loading in <a href=\"\/id\/doc_module_mod_wires\" class=\"doc-reference doc-reference-module\"><code>module#mod_wires<\/code><\/a>.\nThe widget manager uses this model when a <code>do_&lt;name&gt;<\/code> class has no registered\njQuery function yet.<\/p>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/widget\/+name<\/code><\/td><td>Resolve <code>js\/modules\/z.&lt;name&gt;.js<\/code> and return a list containing its asset descriptor.<\/td><\/tr><\/tbody><\/table>\n<p><code>+name<\/code> is a single widget name containing letters, digits, underscores or\nhyphens, without the <code>do_<\/code> prefix. Resolution uses the site&#39;s library index,\nincluding enabled modules. The descriptor contains <code>key<\/code>, a timestamped <code>url<\/code>,\n<code>type<\/code>, <code>media<\/code>, <code>rel<\/code> and <code>title<\/code>, as returned by <code>z_lib_include:assets\/3<\/code>.\nThe request payload is ignored. The model resolves the asset; it does not load\nit or initialize the widget.<\/p>\n<p>For example, load the library for <code>do_autofocus<\/code> in the browser:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-javascript\">cotonic.ready.then(() =&gt; cotonic.broker.call(\n    &#39;bridge\/origin\/model\/wires\/get\/widget\/autofocus&#39;\n)).then(response =&gt; {\n    if (response.payload.status !== &#39;ok&#39;) {\n        throw new Error(response.payload.error);\n    }\n    return z_assets.ensure(response.payload.result);\n});\n<\/code><\/pre>\n<p>Normally the widget manager performs this lookup and initializes the widget\nafter loading. The asset loader shares loaded and pending files with lib tags\nand dynamic updates.<\/p>\n<h2>Configuration and errors<\/h2>\n<p>Configuration module <code>mod_wires<\/code>, key <code>widget_autoload<\/code>, defaults to <code>true<\/code>.\nSetting it to <code>false<\/code> disables resolution through this model; explicitly\nincluded widgets continue to work.<\/p>\n<table class=\"table\"><thead><tr><th>Error<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>disabled<\/code><\/td><td>Automatic widget loading is disabled for the site.<\/td><\/tr><tr><td><code>badarg<\/code><\/td><td>The widget name is empty or contains unsupported characters.<\/td><\/tr><tr><td><code>enoent<\/code><\/td><td>The conventional library file is absent from the site library index.<\/td><\/tr><tr><td><code>unknown_path<\/code><\/td><td>The requested model path is not supported.<\/td><\/tr><\/tbody><\/table>\n<p>This read-only model has no additional ACL restriction: it exposes descriptors\nfor public library files. It does not accept arbitrary paths or URLs.<\/p>\n<p>Direct Erlang calls to <code>m_get\/3<\/code> return <code>{ok, {Assets, Rest}}<\/code> on success or\n<code>{error, Reason}<\/code> on failure. <code>Rest<\/code> contains any remaining model path segments.<\/p>","slug":"wires","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"4685e1b992db37125517c3dc3fbf22af7037f57b60bd93f49cfb8d8b5a7d1310","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_mod_wires\/src\/models\/m_wires.erl","publication_start":"2026-10-21T11:02:19Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_wires\/src\/models\/m_wires.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_wires","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-10-21T11:02:19Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_wires","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"7df977519c8cf191b758d30a0ddca1826a013903\n","erlang_module":"m_wires","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-22T13:33:29Z","title_slug":"wires"},"uri":"https:\/\/zotonic.com\/id\/3096","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/3096"}},"status":"ok"}