Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Inlay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
Inlay
Commits
680cebcb
Commit
680cebcb
authored
1 year ago
by
Rich Lott / Artful Robot
Browse files
Options
Downloads
Patches
Plain Diff
Use type=module for <script> tags; may be necessary and should not hurt
parent
33426c10
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Inlay/Page/Demo.php
+2
-1
2 additions, 1 deletion
CRM/Inlay/Page/Demo.php
Civi/Api4/Action/Inlay/CreateBundle.php
+6
-4
6 additions, 4 deletions
Civi/Api4/Action/Inlay/CreateBundle.php
ang/inlay/Inlays.js
+1
-1
1 addition, 1 deletion
ang/inlay/Inlays.js
with
9 additions
and
6 deletions
CRM/Inlay/Page/Demo.php
+
2
−
1
View file @
680cebcb
<?php
use
CRM_Inlay_ExtensionUtil
as
E
;
class
CRM_Inlay_Page_Demo
extends
CRM_Core_Page
{
...
...
@@ -27,7 +28,7 @@ class CRM_Inlay_Page_Demo extends CRM_Core_Page {
$editUrl
=
str_replace
(
'{id}'
,
$inlay
->
getID
(),
$inlay
->
getInstanceEditURLTemplate
());
$this
->
assign
(
'editUrl'
,
CRM_Utils_System
::
url
(
$editUrl
));
$cacheBuster
=
time
();
$this
->
assign
(
'scriptTag'
,
"<script src=
\"
{
$inlay
->
getBundleUrl
()
}
?nocache=
$cacheBuster
\"
data-inlay-id=
\"
{
$inlay
->
getPublicID
()
}
\"
defer
></script>"
);
$this
->
assign
(
'scriptTag'
,
"<script
type=module
src=
\"
{
$inlay
->
getBundleUrl
()
}
?nocache=
$cacheBuster
\"
data-inlay-id=
\"
{
$inlay
->
getPublicID
()
}
\"
></script>"
);
parent
::
run
();
}
...
...
This diff is collapsed.
Click to expand it.
Civi/Api4/Action/Inlay/CreateBundle.php
+
6
−
4
View file @
680cebcb
<?php
namespace
Civi\Api4\Action\Inlay
;
/**
* Provides way to update the .js bundles for each inlay.
*/
use
CRM_Inlay_ExtensionUtil
as
E
;
use
Civi\Api4\Generic\Result
;
use
Civi\Inlay\Config
as
InlayConfig
;
use
Civi\Api4\Generic\Traits\DAOActionTrait
;
use
Civi
;
/**
* InlayType.get action
*
...
...
@@ -72,11 +76,10 @@ class CreateBundle extends \Civi\Api4\Generic\AbstractQueryAction {
$libraryCode
CiviCRMInlay.app.bundleInfo($now, $publicID);
$externalScript
(function(){
var i = window.CiviCRMInlay;
((i) => {
i.inlays[$publicID] = $initData;
i.app.bootWhenReady();
})();
})(
window.CiviCRMInlay
);
JAVASCRIPT;
// Get public storage.
...
...
@@ -107,5 +110,4 @@ class CreateBundle extends \Civi\Api4\Generic\AbstractQueryAction {
return
(
array
)
civicrm_api4
(
$this
->
getEntityName
(),
'get'
,
$params
);
}
}
This diff is collapsed.
Click to expand it.
ang/inlay/Inlays.js
+
1
−
1
View file @
680cebcb
...
...
@@ -152,7 +152,7 @@
}
$scope
.
getScript
=
function
(
i
)
{
var
mainScript
=
encodeToHTML
(
`<script src="
${
i
.
scriptUrl
}
" data-inlay-id="
${
i
.
public_id
}
" ></script>`
);
var
mainScript
=
encodeToHTML
(
`<script
type=module
src="
${
i
.
scriptUrl
}
" data-inlay-id="
${
i
.
public_id
}
" ></script>`
);
var
wpShortcode
=
encodeToHTML
(
`[inlay id="
${
i
.
public_id
}
"]`
);
console
.
log
({
mainScript
,
wpShortcode
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment