FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

SuperTrooper

v0.1.0.0 Interceptors
<cfcomponent hint="I replace all instances of 'now' with 'meow' " output="false">

<cffunction name="preRender" access="public" returntype="void" hint="Executes before event data is rendered" output="false" >
<cfargument name="event">
<cfargument name="interceptData">
<cfscript>
// Just modifying Brad Woods, JavaScript-Defer / JavascriptDefer.cfc, with something fun (I think)
var local = {};
// Regex to match script tags.
local.regex = "<[\s\/]*script\b[^>]*>[^>]*<\/script>";

local.result = reFindNoCase(local.regex,interceptData.renderedContent,1,true);

// Replace all instances of 'now' and 'Now' with the appropriate 'Moew/moew'
interceptData.renderedContent = Replace(interceptData.renderedContent, "Now", "Meow", "all");
interceptData.renderedContent = Replace(interceptData.renderedContent, "now", "meow", "all");

</cfscript>
</cffunction>
</cfcomponent>

$ box install SuperTrooper

No collaborators yet.
 
  • {{ getFullDate("2014-09-27T22:26:02Z") }}
  • {{ getFullDate("2016-06-09T01:19:29Z") }}
  • 3,356
  • 2,572