Skip to content

Instantly share code, notes, and snippets.

View neokoenig's full-sized avatar

Tom King neokoenig

View GitHub Profile
@neokoenig
neokoenig / Ajax.cfc
Created July 31, 2014 07:58
cfwheels simple ajax example
<cfcomponent extends="controller">
<cffunction name="init">
<cfscript>
provides("html,json");
filters(through="_isValidAjaxRequest", except="index");
</cfscript>
</cffunction>
<!--- This is called remotely;
isAjax() just confirms this is an ajax request;
@neokoenig
neokoenig / .gitignore
Created January 3, 2015 12:31
cfwheels railo gitignore
# Ignore Misc Folder
miscellaneous
# unpacked plugin folders
plugins/**/*
# files directory where uploads go
files
# DBMigrate plugin: generated SQL
db/sql
@neokoenig
neokoenig / urlrewrite.xml
Last active August 29, 2015 14:12
cfwheels tuckey urlrewrite
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule>
<note>
Allow TomCat to have SES links.
</note>
<!--
<cfif structkeyexists(evaluate(arguments.objectname), "featuredimage")>
<img src="#_getImagePath(src=evaluate(arguments.objectname).featuredimage)#">
</cfif>
@neokoenig
neokoenig / Default.cfc
Created February 10, 2015 10:00
Simple cfwheels route example
/**
* Example controller: add these routes: The order is important in how they get matched. Top down!
*
* // Example Static Route - it's above the user bit so will get precedence
* addRoute(name="about", pattern="/about", controller="pages", action="about");
*
* // Here's our user routes: from this point on, anything like "/foo/" will get interpreted as username = foo etc.
* // These two routes basically mimic wheels defaults, just with the username prefix
* addRoute(name="user", pattern="/[username]/[controller]/[action]/[key]");
* addRoute(name="user", pattern="/[username]/[controller]/[action]/");
<script>
var gm=$("#mycanvas").gridmanager({
// Add the custom button
customControls: {
global_col: [{ callback: 'insert_image', loc: 'top', iconClass: 'fa fa-file-image-o' }]
}
}).data('gridmanager');
// Function which gets called
function insert_image(container, btnElem) {
public function updatesortorder(){
if(isAjax()){
params.neworder=replace(params.neworder, "[", "all");
params.neworder=replace(params.neworder, "]", "all");
if(structKeyExists(params, "menuid") AND structKeyExists(params, "neworder")){
for (i=1;i<=listlen(params.neworder);i++) {
item=model("menuitem").updateOne(where="id=#listGetAt(params.neworder, i)#", sortorder=i);
}
renderText("#params.neworder# Sortorder updated");
}
@neokoenig
neokoenig / gist:1614b229cdbbba5799d4
Created June 3, 2015 10:14
Gridmanager Specific Non Editable Columns
<div id="mycanvas" class="clearfix">
<div class="row"><div class="column col-md-6 col-sm-6 col-xs-6"><!--gm-editable-region--><p>New Content</p><!--/gm-editable-region--></div><div class="column col-md-6 col-sm-6 col-xs-6 noteditable"><!--gm-editable-region--><p>Not Editable</p><!--/gm-editable-region--></div></div>
<div class="row"><div class="column col-md-6 col-sm-6 col-xs-6 noteditable"><!--gm-editable-region--><p>Not Editable</p><!--/gm-editable-region--></div><div class="column col-md-6 col-sm-6 col-xs-6 "><!--gm-editable-region--><p>New Content</p><!--/gm-editable-region--></div></div>
</div>
<!--================== JS ================-->
<script>
$(document).ready(function(){
Lucee 5.0.0.49 Error (expression)
Message The key [WHEELS] does not exist, only the following keys are available: [applicationname].
Stacktrace The Error Occurred in
C:\Users\Tom\Downloads\lucee-5.0.0.49-express1\webapps\ROOT\wheels\index.cfm: line 1
1: <cfoutput>#application.wheels.dispatch.$request()#</cfoutput>
called from C:\Users\Tom\Downloads\lucee-5.0.0.49-express1\webapps\ROOT\index.cfm: line 2
Java Stacktrace lucee.runtime.exp.ExpressionException: The key [WHEELS] does not exist, only the following keys are available: [applicationname].
at lucee.runtime.type.util.StructSupport.invalidKey(StructSupport.java:64)
at lucee.runtime.type.StructImpl.get(StructImpl.java:121)
Hits /Application.cfc;
- /wheels/functions.cfm
- /config/app.cfm
- /wheels/controller/appfunctions.cfm
- /wheels/controller/caching.cfm
- /wheels/controller/filters.cfm
- /wheels/controller/flash.cfm
- /wheels/controller/initialization.cfm
- /wheels/controller/miscellaneous.cfm
- /wheels/controller/redirection.cfm