Galleon ColdFusion 9 fix, and pagination UI update

I got my forums back up and in the process of doing so - found two interesting issues.

First - Image.cfc (which is from the open source ImageCFC project) made use of a CFC method called Throw. This allowed code in the CFC to do:

<cfset throw("Paris Hilton recommend some awesome new shoes. Shaweet!")>

Unfortunately this conflicts with ColdFusion 9's built in support for throwing via script. My "fix" was to simply rename all the throw calls to xc989082903480983894840894328093289042389. Now the code does:

<cfset xc989082903480983894840894328093289042389("code readability ftw!")>

Ok... I lie. I just renamed it mythrow, and updated the method definition as well.

Now for the UI issue. The ColdFusion/General forum has a ginormous number of threads. This created the following "interesting" UI:

That's awesome, isn't it? All it needs is a unicorn or two to spruce it up.

So I thought that wouldn't fly. What I ended up doing is simply adding some logic to say - if there are so many pages, switch to a drop down:

<p>Page: <cfif attributes.pages gt 10> <select onChange="document.location.href=this.options[this.selectedIndex].value"> <cfloop index="x" from=1 to="#attributes.pages#"> <option value="#cgi.script_name#?#qs#&page=#x#" <cfif is x>selected</cfif>>Page #x#</option> </cfloop> </select> <cfelse> <cfloop index="x" from=1 to="#attributes.pages#"> <cfif is not x><a href="#cgi.script_name#?#qs#&page=#x#">#x#</a><cfelse>#x#</cfif> </cfloop> </cfif> </p>

Which results in:

Somewhat better I think. Full City Media, who did the original skin for Galleon 2, is sending me over a small CSS tweak for it that I'll include in the new version shipping tomorrow morning.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA