existdissolve.com

the singularity of being and nothingness

Follow me on TwitterRSS Feeds

  • Home
  • About
  • CFAviary
  • ContentBox Modules
    • jsFiddle
  • Gloss

Checking if Spry eventListener Exists

May 3rd

Posted by existdissolve in Spry Framework

No comments

So if you use Spry, you know that adding an eventListener to anything is super-simple.  It's easy to add, and managing the processing that occurs on events is pretty intuitive. 

For example:

Spry.Utils.addEventListener("myButton","click",doMyFunction,false);

This one line of code adds an eventListener to the element "myButton" for the onclick event, which will fire "doMyFunction()".  And it's just as easy to remove the same eventListener:Spry.Utils.removeEventListener("myButton","click",doMyFunction,false);

Easy enough.  However, I recently found myself wanting to not only add and remove eventListeners, but also to check if they exist for certain elements.  Luckily, before digging into the DOM to much, I checked SpryDOMUtils.js–sure enough, there's a function already built for this.

In fact, as you may or may not be aware, you can run Spry.Utils.addEventListener() on an element as many times as you like–only one eventListener will be registered.  This is because addEventListener() runs a check to see if the eventListener is already registered, and proceeds from there (look at line 166 in SpryDOMUtils.js v. 0.6 to see this in action).

So checking to see if an eventListener is registered for an element is exactly the same as adding and removing the eventListener.  Here's what it looks like:

Spry.Utils.eventListenerIsBoundToElement("myButton,"click",doMyFunction,false);

This will return true or false, and you can do whatever you'd More >

eventListeners, Spry

Setting Dynamic Mappings in ColdFusion 8

May 2nd

Posted by existdissolve in ColdFusion

No comments

Over the last year, I've learned alot about ColdFusion, AJAX, and DBA stuff. I have to say, however, that the coolest thing I've learned is that in ColdFusion 8 you can set per application mappings in the Application.cfc itself. Why is this so cool? Well, I tend to create a lot of folders in my applications in order to keep related assets in one place together. Of course, creating mappings to these folders makes life a lot easier in that you don't have to worry about making sure you are referencing these folders correctly in different contexts–with mappings ColdFusion can take of that for you.

However, the problem I often run into is that I have to create some funky mapping names in CF Administrator in order to keep them all unique. In my local host environment, for example, the number of mappings is huge and it becomes a hassel to remember to re-set these mappings up when I push final code to a production environment (not to mention that some hosting providers make doing this a lot harder than you could imagine…).

But with CF8, this is no longer a problem. Now you can create dynamic mappings in APplication.cfc, More >

ColdFusion 8

Manipulating Spry Datasets in the DOM

May 1st

Posted by existdissolve in Spry Framework

No comments

I recently created a little peice of functionality using Spry data to setup two lists that can swap data on the fly,

without the need for any postbacks to the server.  I've done this thing several times before, but in the past, I've done it very inefficiently.  Let me give you an example.

Let's say I'm building a list of songs to put on my mp3 player.  I start with a list of all the songs from my media library, as well as a blank list that's waiting to be filled up with songs for the play list. In the past, what I've done is create two Spry data connections to a database, one to manage the play list, and one to manage the full list of songs.

Of course, this is easy enough to do, but I wanted to make it a bit better.  For example, when selecting a song, I wanted to be able to show that the song was selected (and also make it un-selectable again).  

My past approach would have been to start with an onclick event to handle the data saving.  Once this process was complete, I would have fired a complete reload of both my More >

DOM, Spry

Getting Back into Posting

Apr 29th

Posted by existdissolve in General

No comments

Wow.  It's been nearly 2 months since I last posted here.  Not good.

The other night, I was feeling guilty about that, so I added a few items to my portfolio.  

I've been out of commission the last several months for a couple reasons.  First, my day job has been pretty hectic recently.  We've been launching some large projects, and I've started to become involved a lot more with planning aspects of what we're doing.  So while there's a lot less code work happening from me, I've been make up for that with writing, reviewing and an endless stream of meetings.

Second, I've been in the middle of a pretty decent little content management system.  I'll be blogging about it a bit more when I'm ready to unveil it, but it's coming right along and I'm pretty pleased so far with what I've accomplished.  As CMS's go, it's nothing revolutionary, but I have learned a ton in the process, so at least I have that going for me.

So in the meantime, I'm going to try to get back to blogging regularly.  I've missed it quite a bit, and I have a ton of things to blog about, from opening up Spry's guts, More >

Updates, Where I\'ve Been

A Generosity That Transcends Morality

Apr 26th

Posted by existdissolve in Theology

4 comments

(Thanks to Kevin for the inspiration!)

In Luke 10, Jesus tells the famous story of the Good Samaritan.  In this narrative, the behavior of the Samaritan toward the injured man is juxtaposed with that of the a priest and a Levite to reveal the nature of the message of love which Jesus was teaching, a love which treats one's "neighbor" as oneself.

Obviously, the various facets of this story have been mulled over for countless centuries.  However, while listening to a exposition of this passage this weekend, I was struck by something of an interesting idea: that the nature of love and generosity transcends morality. 

Let me explain.

Generally, the attitudes of the Levite and priest are characterized quite pejoratively–after all, it is they who walked so callously by the injured man, with seemingly little regard for his life or injuries.  While there is certainly a measure of truth to this characterization, I think some other considerations are warranted.

One of these considerations is that these men did not bypass the injured man out of gross neglect or comfortable apathy.  In fact, it is quite possible that their hearts were moved to compassion.  If this is so, why did they not then act?

Part of More >

Good Samaritan

Microsoft Word is the Devil

Mar 1st

Posted by existdissolve in Microsoft

3 comments

I've made clear in the past my great distaste for Microsoft Word and the "formatting" which it injects into WYSIWYG fields.  I could write scores of pages about my dislike, but I'll let the following example speak for me.  Keep in mind that the following is for 19 words.

 

<p><link href="file:///C:%5CDOCUME%7E1%5CDONVAN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"><link href="file:///C:%5CDOCUME%7E1%5CDONVAN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"><link href="file:///C:%5CDOCUME%7E1%5CDONVAN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"><!--[if gte mso 9]><xml><w:WordDocument><w:View>Normal</w:View><w:Zoom>0</w:Zoom><w:TrackMoves /><w:TrackFormatting /><w:PunctuationKerning /><w:ValidateAgainstSchemas /><w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid><w:IgnoreMixedContent>false</w:IgnoreMixedContent><w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText><w:DoNotPromoteQF /><w:LidThemeOther>EN-US</w:LidThemeOther><w:LidThemeAsian>X-NONE</w:LidThemeAsian><w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript><w:Compatibility><w:BreakWrappedTables /><w:SnapToGridInCell /><w:WrapTextWithPunct /><w:UseAsianBreakRules /><w:DontGrowAutofit /><w:SplitPgBreakAndParaMark /><w:DontVertAlignCellWithSp /><w:DontBreakConstrainedForcedTables /><w:DontVertAlignInTxbx /><w:Word11KerningPairs /><w:CachedColBalance /></w:Compatibility><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><m:mathPr><m:mathFont m:val="Cambria Math" /><m:brkBin m:val="before" /><m:brkBinSub m:val="--" /><m:smallFrac m:val="off" /><m:dispDef /><m:lMargin m:val="0" /><m:rMargin m:val="0" /><m:defJc m:val="centerGroup" /><m:wrapIndent m:val="1440" /><m:intLim m:val="subSup" /><m:naryLim m:val="undOvr" /></m:mathPr></w:WordDocument></xml><![endif]--><!--[if gte mso 9]><xml><w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"DefSemiHidden="true" DefQFormat="false" DefPriority="99"LatentStyleCount="267"><w:LsdException Locked="false" Priority="0" SemiHidden="false"UnhideWhenUsed="false" QFormat="true" Name="Normal" /><w:LsdException Locked="false" Priority="9" SemiHidden="false"UnhideWhenUsed="false" QFormat="true" Name="heading 1" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /><w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /><w:LsdException Locked="false" Priority="39" Name="toc 1" /><w:LsdException Locked="false" Priority="39" Name="toc 2" /><w:LsdException Locked="false" Priority="39" Name="toc 3" /><w:LsdException Locked="false" Priority="39" Name="toc 4" /><w:LsdException Locked="false" Priority="39" Name="toc 5" /><w:LsdException Locked="false" Priority="39" Name="toc 6" /><w:LsdException Locked="false" Priority="39" Name="toc 7" /><w:LsdException Locked="false" More >

Microsoft Word is the Devil

ColdFusion input=datefield Gotcha

Feb 5th

Posted by existdissolve in ColdFusion

No comments

Another quick post 🙂

If you're using ColdFusion 8's datefield input AND are using a table for laying out the form, make sure that the cfform element is OUTSIDE of the table element.

This, of course, should be done anyway…however, tonight I was modifying some old, embarassing code and upgraded to the datefield.  The page kept throwing an unhelpful JS error.  After about 20 minutes of getting angry, I reversed the order of the table and form elements, and voila, it worked again.

Urgh.

Share this:
  • Click to share on Google+ (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Share on Facebook (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
  • More
  • Click to share on StumbleUpon (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
ColdFusion, Gotcha!

removeChild() and IE7

Jan 27th

Posted by existdissolve in Microsoft

1 comment

Just a quick post 🙂

I've been working on a pretty simple bit of code where one "row" of information is removed and added to a different table of information.  Pretty simple stuff.

However, I ran into a issue with IE7 (go figure, right?).  When using the "removeChild()" function, IE was not always removing the element specified.  I debugged my code to no end, and couldn't find any issues.

Now I'm not sure if this is an actual bug, or an error in implementation on my part, but I ran across a post that seems to indicate that the best way to handle removeChild() in IE is to recursively remove all of the element's children, ending with the element itself (most other browsers don't seem to care, and just remove what you ask for!).  

So really, I'm saying anything new, but just getting Google a bit more information to work with to other poor slobs looking for this answer.

Here's where I found the solution:

And here's the recursive function:

function removeChildSafe(el) {    //before deleting el, recursively delete all of its children.    while(el.childNodes.length > 0) {        removeChildSafe(el.childNodes[el.childNodes.length-1]);    }    el.parentNode.removeChild(el);}

 

Share this:
  • Click to share on Google+ (Opens in new window)
  • Click to share on Twitter (Opens in More >
IE Hates the World, Javascript

Dynamically Loading JavaScript…with Spry!

Dec 23rd

Posted by existdissolve in Spry Framework

1 comment

I've written a couple of articles in the last few months about my adventures in JavaScript.  While I certainly don't claim to be even proficient, I am getting better day by day.  As I pick up tricks and tips, I try to pass them on to help others out (hopefully!).  

Recently, we ran into an issue at work.  We're constantly adding JavaScript functionality to our company intranet.  While adding references to JavaScript files in the master pages that drive the templates is easy to do, there is a process that all master page changes have to go through, and this can limit the desirability of future changes.  What we needed was a way to dynamically load JavaScript files when needed, so that only the core init.js file that is loaded with every page request needs to be referenced on the master pages.

I've never done this kind of thing before, so I did a little snooping around.  There are apparently alot of solutions out there, some of them better and more robust than others.  After studying what they do, I decided to try my hand at building a simple JS loader in Spry, given that the core files I need are More >

Javascript, Loading JavaScript, Spry

What You See Is What You Get…Unless You Can't See

Dec 23rd

Posted by existdissolve in Web Design

No comments

If you use one or more of the billion and seven content managment systems out there, you're probably more than familiar with a what-you-see-is-what-you-get (WYSIWYG) text editor.  These *fun* little textareas allow users to mimic, with decent accuracy, the styles and organization that they would normally apply in word-processing documents.  

The original intention of WYSIWYGs, of course, was to put control of text styling and organzation for web-based content into the hands of the people managing the content, so that every bit of text-editing doesn't have to go through the web developer.  The result, however, is a disaster.

Why a disaster?  Well, before discussing the reasons why, try this little experiment.  The next time you're around a web designer/developer, say nothing to them.  Simply shift your eyes, turn your head, and randomly blurt out "WYSIWYG!!!".  They will either 1.) punch you in the mouth out of built up frustration or 2.) cower in a corner as they are reminded of how they are abused by WYSIWYGs on a daily basis.

So what's the big deal?  

Well, to begin, most content managers have no business even thinking the word "design," much less actively participate in it.  Giving them the reigns to "make the More >

HTML, WYSIWYG
« First...1020«2526272829»3040...Last »
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • Adobe (1)
    • Audio (10)
    • Books (8)
    • Chrome (1)
    • ColdFusion (64)
      • ColdBox (13)
        • ContentBox (7)
    • Cool Stuff (42)
    • Ext JS 5 (7)
    • Flex (5)
    • General (28)
    • Into the Box (1)
    • JavaScript (95)
      • AJAX (2)
      • CKEditor (3)
      • ExtJS (59)
        • ExtJS 4.2. App Walkthrough (16)
      • jQuery (1)
      • Sencha Fiddle (3)
      • Sencha Touch (9)
      • Spry Framework (18)
    • Microsoft (8)
    • Mobile (4)
      • Sencha Touch (4)
    • Music (26)
    • Parse.com (1)
    • Philosophy (16)
    • PHP (2)
    • Ruby (6)
    • SharePoint (8)
    • Sitecore (5)
    • Social Media (5)
    • Theology (81)
    • Travel (1)
    • Uncategorized (9)
    • Video Games (4)
    • Web Design (45)
      • CSS3 (3)
      • HTML5 (9)
    • Web Development (12)
    • WordPress (1)
    Adobe AIR AJAX Anthropology API Athanasius Atonement Theology Auto-Tune Blog Action Day CD Review CFScript CFSharePoint Christology CKEditor ColdFusion ColdFusion 9 ContentBox CSS Eschatology ExtJS ExtJS 4 Facebook Forgiveness General HTML HTML5 Javascript Koans Linguistics Music Origins ORM Probability Ruby Sencha Sencha Touch SharePoint Sitecore Spry Spry Framework theming Theology Web 2.0 Web Design WordPress
    • September 2017 (1)
    • May 2015 (1)
    • January 2015 (1)
    • November 2014 (2)
    • September 2014 (2)
    • August 2014 (3)
    • May 2014 (1)
    • March 2014 (1)
    • February 2014 (2)
    • January 2014 (2)
    • December 2013 (2)
    • October 2013 (1)
    • August 2013 (2)
    • July 2013 (5)
    • June 2013 (7)
    • May 2013 (11)
    • March 2013 (1)
    • January 2013 (6)
    • December 2012 (2)
    • November 2012 (4)
    • September 2012 (2)
    • August 2012 (2)
    • June 2012 (2)
    • May 2012 (2)
    • April 2012 (3)
    • March 2012 (1)
    • February 2012 (6)
    • January 2012 (10)
    • November 2011 (2)
    • October 2011 (1)
    • September 2011 (5)
    • August 2011 (11)
    • July 2011 (3)
    • June 2011 (1)
    • May 2011 (4)
    • April 2011 (4)
    • March 2011 (4)
    • February 2011 (4)
    • January 2011 (3)
    • December 2010 (7)
    • November 2010 (10)
    • October 2010 (9)
    • September 2010 (8)
    • August 2010 (19)
    • July 2010 (16)
    • June 2010 (17)
    • May 2010 (7)
    • April 2010 (3)
    • March 2010 (4)
    • February 2010 (3)
    • January 2010 (7)
    • December 2009 (2)
    • November 2009 (4)
    • October 2009 (8)
    • September 2009 (3)
    • August 2009 (3)
    • July 2009 (1)
    • May 2009 (5)
    • April 2009 (2)
    • March 2009 (1)
    • February 2009 (1)
    • January 2009 (1)
    • December 2008 (3)
    • November 2008 (3)
    • October 2008 (4)
    • September 2008 (2)
    • August 2008 (5)
    • July 2008 (6)
    • June 2008 (6)
    • May 2008 (13)
    • April 2008 (4)
    • March 2008 (11)
    • February 2008 (3)
    • January 2008 (5)
    • December 2007 (5)
    • November 2007 (2)
    • October 2007 (10)
    • September 2007 (10)
    • August 2007 (9)
    • July 2007 (8)
    • June 2007 (28)
    • May 2007 (2)
    • April 2007 (2)
    • March 2007 (2)
    • January 2007 (2)
    • December 2006 (2)
    • August 2006 (2)
    • July 2006 (3)
    • June 2006 (4)
    • May 2006 (3)
    • April 2006 (4)
    • March 2006 (3)
    • February 2006 (4)
    • Dragonvale Tips and Tricks (60)
    • A Study Bible to End All Study Bibles (42)
    • ExtJS 4.2 Walkthrough — Part 4: Steppin’ in Some CRUD (33)
    • A Little Taste of Spry 1.6 Goodness (22)
    • The Closing of the Evangelical Mind (21)
    • Where No Man Has Gone Before (19)
    • ExtJS 4.2 Walkthrough – Part 3: Under Control(ler) (19)
    • Thoughts on Christian Ecumenism (17)
    • ExtJS 4.2 Walkthrough — Part 11: Executive Dashboard (17)
    • Sencha Touch Theming: Building Our Custom Stylesheet with SASS (15)
    • Uga: Proverbs 17:15 He that justifieth the wicked, and he that condemneth the just, even they both are...
    • existdissolve: You should be able to find it here: https://forgebox.io/view/jsFiddle
    • Terry Riegel: Hello, Do you have a demo?
    • existdissolve: I enjoy cake. Please send it to me.
    • existdissolve: Your request for permission to my RSS feed has been denied.
    • Lipstick Queen: Just want to say your article is as astounding. The clarity to your post is just cool and that i...
    • sahib: Hey So where can i find that checkLogin Method? i mean in what file. i am trying to implement a...
    • Niall O'Brien: Have the routing issues you mention improved with the latest version of ExtJS?
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.