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> | |
/* makeTelLink ColdFusion UDF - generates an HTML TEL link with optional phone formatting | |
2018-01-29 | |
Force TEL = MakeTelLink("831-393-1798", "", 1) | |
2023-07-21 Add "mask" option (pass boolean or string "(xxx) xxx-xxxx" mask) | |
2024-11-15 Add support for extension | |
Phone formatting requires phoneFormat UDF: https://gist.github.com/JamoCA/4342da7f2388a3a0b38fb6b55b8c9c35 | |
Author: James Moberg http://sunstarmedia.com @sunstarmedia | |
GIST: https://gist.github.com/JamoCA/4342da7f2388a3a0b38fb6b55b8c9c35 | |
Blog: https://dev.to/gamesover/phoneformat-maketellink-coldfusion-udfs-40fh |
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> | |
/** | |
* getLastWorkWeekInMonth: Returns the date for the start of the last full work week (M-F) in a given month. | |
* | |
* @param Month A number representing the month (default = current month) | |
* @param Year A number representing the year (default = current year) | |
* @param includeWeekend A boolean flag to indicate whether to require the weekend as part of the decision | |
* @return Returns a date representing the start of the week. | |
* @author James Moberg http://sunstarmedia.com, @sunstarmedia | |
* @version 1, November 7, 2024 |
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> | |
/** | |
* generateZint UDF | |
* @displayname generateZint | |
* @Dependency Requires Zint executable from https://zint.org.uk/ | |
* @Dependency_Documentation https://zint.org.uk/manual/chapter/4 | |
* @author James Moberg http://sunstarmedia.com, @sunstarmedia | |
* @version 1 | |
* @lastUpdate 10/30/2024 16:00 Pacific | |
* @gist https://gist.github.com/JamoCA/fbbd2599102216448ada8e9f85d40b9c |
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> | |
/** | |
* structToTable UDF | |
* @displayname structToTable | |
* @author James Moberg http://sunstarmedia.com, @sunstarmedia | |
* @version 1 | |
* @lastUpdate 10/28/2024 15:58 | |
* @gist https://gist.github.com/JamoCA/bc5c58e829e191947f2e34289fd98a5a | |
* @blog https://dev.to/gamesover/structtotable-generate-htmltext-output-for-displayemail-1mk4 | |
* @twitter https://x.com/gamesover/status/1851046259387469955 |
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
<!--- 2024-10-16 | |
Example of defining a default set of ColdFusion scoped variables, setting default values & identifying actual values for debugging or unit tests. | |
Tweet: https://x.com/gamesover/status/1846590541833855413 | |
---> | |
<cfscript> | |
// Define default scoped variables; | |
variable_config = [ | |
["id": "attributes.promotionID", "value": ""] | |
,["id": "attributes.options", "value": ""] |
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
<!--- enableWKHTMLTOPDFForms 2024-10-07 | |
ColdFusion/CFML UDF to modify WKHTMLTOPDF binary file so that editable fields can be accessed when using Adobe Acrobat. | |
GIST: https://gist.github.com/JamoCA/607e2b1b28f2a55006ba9bdf26d4df9b | |
BLOG: https://dev.to/gamesover/hack-wkhtmltopdf-pdf-to-enable-adobe-acrobat-field-editing-2f6 | |
TWEET: https://x.com/gamesover/status/1843460127757873524 | |
LinkedIn: https://www.linkedin.com/posts/jamesmoberg_hack-wkhtmltopdf-pdf-to-enable-adobe-acrobat-activity-7249486444040175616-jWXh | |
---> | |
<cfscript> | |
public boolean function enableWKHTMLTOPDFForms(required string pdfIn, string pdfOut="", boolean onlyWKFiles=true) hint="Modify a WKHTMLTOPDF binary file so editable fields can be accessed when using Adobe Acrobat." { | |
local.pdfData = fileread(arguments.pdfIn, "utf-8"); |
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
<!DOCTYPE html> | |
<html lang="en"><head> | |
<meta charset="utf-8"> | |
<title>ColdFusion HeatColor UDF Demo</title> | |
<link rel="STYLESHEET" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.32.0/css/theme.blue.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.32.0/js/jquery.tablesorter.min.js"></script> | |
<script> | |
$(function(){ | |
$('#myTable').tablesorter(); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!-- saved from url=(0098)https://web.archive.org/web/20160708172357/http://www.jnathanson.com/blog/client/jquery/heatcolor/ --> | |
<html data-lt-installed="true"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" type="text/javascript"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.32.0/js/jquery.tablesorter.min.js" type="text/javascript"></script> | |
<script src="https://raw.github.com/joshuanathanson/jquery-heatcolor/refs/heads/master/jquery.heatcolor.0.0.1.js" type="text/javascript"></script> | |
<style> | |
body {font-family:"Trebuchet", "Lucida Sans", Courier; font-size:12px;} |
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
<!--- createShadowHtml UDF - Using ColdFusion to generate HTML to create & populate a shadow DOM. | |
NOTE: This approach requires using absolute HREF/SRC references for links and static resources. | |
GIST: https://gist.github.com/JamoCA/0774f707e8b18b61bc95b5f2c39b1f9f | |
BLOG: https://dev.to/gamesover/embed-a-full-html-document-inline-using-shadow-dom-5d5d | |
TWEET: https://x.com/gamesover/status/1836493265186754801 | |
---> | |
<cfscript> | |
string function createShadowHtml(required string html, string id="", boolean enableLinks=true, string placeholder="Previewable content will be displayed here...") hint="I generate a shadow DOM on-the-fly to preview HTML/CSS (No JS)" { | |
local.newLine = createobject("java", "java.lang.System").getProperty("line.separator"); | |
local.id = (isvalid("variablename", arguments.id)) ? arguments.id : "shadow" & randrange(10000,99999,"SHA1PRNG"); |
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
<!--- streamFind UDF (2015-06-09) Searches the output buffer to determine if a string exists. Works w/Adobe ColdFusion, Railo & Lucee CFML. | |
GIST: https://gist.github.com/JamoCA/3f5f041f2ca5bc0a5358597a5d78c91f | |
BLOG: https://groups.google.com/g/railo/c/Q4KV0yT7oGk/m/hgLXXMOWtBgJ | |
TWEET: https://x.com/gamesover/status/1834384722614780095 | |
INSPIRATION: Michael Offner/Railo back in 2012. https://groups.google.com/g/railo/c/Q4KV0yT7oGk/m/hgLXXMOWtBgJ | |
---> | |
<cfscript> | |
boolean function streamFind(required string str, boolean caseSensitive=false) output=true hint="I search the output buffer to determine if a string exists" { | |
if (arguments.caseSensitive){ | |
return (listfindnocase("railo,lucee", server.ColdFusion.ProductName)) ? getPageContext().getOut().getString().indexOf(arguments.str) neq -1 : getPageContext().getCFOutput().getBuffer().toString().indexOf(arguments.str) neq -1; |
NewerOlder