Raymond Camden's Blog Rss

Context Menu Example with jQuery Mobile

3

Posted in Mobile, Development, jQuery, JavaScript, HTML5 | Posted on 05-23-2012 | 878 views

Yesterday a reader asked me about building context menu support for images within a jQuery Mobile operation. Turns out it's pretty easy. Obviously there is no such thing as a right click menu on a touch device. That being said - the convention that most mobile applications use is a "taphold" listener. You touch the item with your finger and wait. In a second or two, the context menu pops up. The taphold event is trivial to use in jQuery Mobile (with a caveat I'll get to in a second), but what isn't as trivial is decided what UI to use. jQuery Mobile will - soon - have a popup UI item. For now though I decided on the excellent SimpleDialog2 plugin by JTSage. Let's look at an example.

ColdFusion Developer Week (and graphics)

Posted in ColdFusion | Posted on 05-23-2012 | 627 views

As announced on the Adobe ColdFusion blog, ColdFusion Developer Week is back. This is an entire week of online ColdFusion presentations from experts in our community. The best part? It's entirely free! Sign up via the link above.

Also - I've attached a zip to this blog entry with official logo graphics for ColdFusion and ColdFusion Builder.

EDIT: Joe Brislin kindly gave me both a Windows and Mac icon file you can use for your CFBuilder or other needs. The zip includes his zip bundled in. Thanks Joe!

Notes on the ColdFusion 10 EULA

Posted in ColdFusion | Posted on 05-22-2012 | 776 views

I've had many folks ping me about the ColdFusion 10 EULA. This morning, product manager Rakshith posted a blog entry on it:

ColdFusion 10 EULA

Creating watermarked images in PhoneGap

4

Posted in Mobile, jQuery, JavaScript, HTML5 | Posted on 05-22-2012 | 685 views

A reader asked me if it was possible to watermark images (like those taken with a camera) in PhoneGap. This is rather trivial using Canvas (hey, it does have a use!) so I whipped up the following example to demonstrate it in action.

Nifty little trick with fileRead and ColdFusion 10

4

Posted in ColdFusion | Posted on 05-21-2012 | 1,061 views

ColdFusion 10 adds a nifty little feature to the VFS (Virtual File System) - support for FTP, HTTP, and ZIP. This means you can treat remote resources and zip files as if they were simple file systems. The docs don't go into great detail on this (and instead ask you to read the Apache Commons docs instead), but I discovered a simple, but really nice, good example of this.

Because fileRead supports http, if you want to quickly grab the contents of a URL, you can use it as I've done above. All it does is save you one line of code (compared to the normal cfhttp call followed by a set to grab the file contents), but it's handy!

cfObjective 2012

4

Posted in JavaScript, HTML5, ColdFusion | Posted on 05-20-2012 | 1,342 views

Another year and another cfObjective is behind me. Every year this conference gets better and this year was no exception. The location is great (even with it under heavy remodeling), the food was great (although did they really need to feed me half a chicken on the last day!), and of course, the content continues to be very well done and very interesting. My thanks to the entire team at cfObjective for their hard work and dedication in helping create this year's conference.

While I attended many sessions, here is a short list of what I thought was interesting and my take aways from each:

  • Simeon Bateman presented on "Enterprise JavaScript Applications" and Node.js. His first presentation was a good overview of the tools that can help you build JavaScript applications. He demonstrated multiple things, including Backbone. I've seen that before but I think I'm going to play around with it a bit more. As for Node - I don't think I've been shy about my disappointment around Node. Not so much in the technology but how it is 'marketed' and presented to other developers. Sim did show the classic HTTP server example (the one I complain about), but then moved into much more interesting areas with his discussion of Connect and Express. I found these pretty interesting, but then Sim went on to discuss where he thought Node.js could be most useful - as a complement to other server-side languages (like ColdFusion) by providing highly performant network type services (like websockets) via Socket.io. He focused on the practical use cases for Node and that to me is what really made it seem better.
  • I only caught one presentation by Elliott Sprehn, but it was a good one. He talked about "Production Ready JavaScript" and some of the issues you face when you get past the 1000-line mark in your JavaScript files. I found his discussion of testing and logging of user actions in JavaScript fascinating. I plan on trying to implement, and blog, some of the things he discussed.
  • Charlie Arehart gave a great talk on ColdFusion under Tomcat. I really had no idea how much Tomcat could do.
  • Mark Mandel talked about Closures in ColdFusion 10 and blew my mind. I'm not discussing it here because it was too much. I've got another blog entry just on that for later this week.
  • I had seen Dave Ferguson talk on security before - but it is always a good idea to be reminded of just how much work is involved in creating a secure site. I especially liked his fact versus myth approach.
  • I saw Scott Stroz present on "How to Pimp Out Your Model" and PhoneGap. I've seen the first presentation before, but I really enjoy how he brings the concepts of MVC to a simpler, easier to understand level. I'm still approached by people having trouble wrapping their heads around the concept and if you can see Scott present on it - do so. Obviously I'm already familiar with PhoneGap, but Scott's presentation was very polished and has encouraged me to bring mine up to a higher level.

There were even more great presentations, but as I have to go catch the Super Shuttle I'm going to wrap it up here. I've said it before but I'll say it again. cfObjective is an incredible conference and well worth your money and time. I cannot encourage my readers enough. Whether you want to learn more about ColdFusion or JavaScript, it is a great opportunity to both learn and network.

E-Seminar on Slatwall next week

12

Posted in ColdFusion | Posted on 05-18-2012 | 1,229 views

While at cfObjective, Sumit Verma from Slatwall let me know that they are doing an Adobe E-Seminar next week on the product. Slatwall is a free, open source e-commerce product that plugs into Mura CMS, another good, free, open source ColdFusion product.

You can register for this e-seminar here: http://www.adobe.com/cfusion/event/index.cfm?event=detail&id=2014594&loc=en_us

By the way - I feel like we (Adobe) could do a much better job of letting you know about these e-seminars. Agreed?

Slides, code, from my HTML5 Presentation

4

Posted in Development | Posted on 05-17-2012 | 1,488 views

First off - a big thank you to everyone who attended my presentation at cfObjective today. I hope it was a useful introduction to some of the cool new stuff in HTML5. That sounds really lame, but it's honestly how I feel. The web (well the front end) is incredibly fun again. I'm hoping to do many more presentations in the future, but with a more focused topic. I'm doing a presentation soon on HTML5 Storage options and I'm planning one just on Forms. (Since, you know, forms are kind of important. Unlike other things. Looking at you Canvas.)

You can download the presentation and code from Github: https://github.com/cfjedimaster/HTML-Code-Demos

It should "just run" in your browser, but some of the demos are a bit bleeding edge.

Important note on availability of ColdFusion 9

Posted in ColdFusion | Posted on 05-17-2012 | 1,357 views

Just passing along this important information about the availability of ColdFusion 9: Availability of ColdFusion 9

Some thoughts on organizing a large jQuery Mobile project

7

Posted in Mobile, Development, jQuery, JavaScript, HTML5 | Posted on 05-16-2012 | 1,793 views

Ben Forta pinged me with an interesting question (and when the Forta pings you, you respond) that I thought I'd share here. It's one of those "best practices" questions that really has no best answer, so as always, I'm very eager to hear what my readers have to say. Don't feel afraid to tell me I'm completely off my rocker - that makes for fun conversation. Ok, so the question:

I have a JQ+jQM=PG app. It started off as 2 small pages and 50 lines of code, and is now 10 pages and over 1000 lines of code (excluding lots of .js libraries, some my own and some downloaded, that are all included).

My question simply is how would you go about organizing the code? Each "page" in its own HTML file? Would you put page supporting event handlers with those pages? What about handlers that use JQ to manipulate other pages? Separate all JavaScript in included files? And actually, how the heck do you even use JQ to manipulate controls in another page?

I know there is no right or wrong answer, but I am about to start refactoring this entire mess, so ... any thoughts you'd like to share?