View test.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
frapi = createObject( "java", "com.intergral.fusionreactor.api.FRAPI" ) | |
.getInstance() | |
; | |
csp = application.contentSecurityPolicy.getCspConfig(); | |
// Set the strict Content-Security-Policy. | |
cfheader( attributeCollection = csp.header ); |
View snippet-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function() { | |
// Get the form element | |
const form = document.querySelector("form"); | |
// Listen for the Turbo Drive form submission event | |
form.addEventListener("turbo:submit-end", function() { | |
// Scroll the form back into view | |
form.scrollIntoView(); | |
}); | |
}); |
View about.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfmodule template="./tags/page.cfm" section="about"> | |
<cfoutput> | |
<h2> | |
About This Site | |
</h2> | |
<p> | |
Copy copy copy.... | |
</p> |
View test.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<!--- Define the initial BODY content. ---> | |
<cfsavecontent variable="body"> | |
<p> | |
This is the body! | |
</p> | |
</cfsavecontent> | |
View injector.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import application modules. | |
import { ApiClient } from "./api-client.js"; | |
// ----------------------------------------------------------------------------------- // | |
// ----------------------------------------------------------------------------------- // | |
export var apiClient = new ApiClient(); |
View ViewHelper.cfc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component | |
output = false | |
hint = "I provide utility methods for rendering HTML in a view template." | |
{ | |
/** | |
* I output the given attribute with proper attribute encoding. If the value is a | |
* complex data structure, it is serialized as JSON. | |
*/ | |
public string function attr( |
View index.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
items = [ | |
{ id: 1, name: "Item One" }, | |
{ id: 2, name: "Item Two" }, | |
{ id: 3, name: "Item Three" } | |
]; | |
</cfscript> | |
<cfmodule template="./tags/page.cfm"> |
View a.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
writeOutput( "A-1 <br />" ); | |
return; | |
writeOutput( "A-2 <br />" ); | |
</cfscript> |
View _create.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
When rendered as a top-level request, we can render the form AS-IS. However, if we're | |
rendering inside a Turbo Frame (ie, we're trancluding the form into another page), we | |
have to render the form inside a like-named Turbo Frame so that Hotwire can merge the | |
results back into the live page. | |
-- | |
NOTE: In a more robust architecture, this could be implemented much more seamlessly as | |
a layout selection, such as a "standard" layout vs a "fly-out" layout. However, to | |
keep things as simple as possible, I'm rendering both types of layouts right here in | |
the same template so that we can see the mechanics at play. |
View index.cfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
if ( request.isPost ) { | |
// Sleeping to give us time to observe the busy-state of the submit button. | |
sleep( 2000 ); | |
location( url = "index.htm?signed=true", addToken = false ); | |
} |
NewerOlder