Category: JavaScript

Material related to JavaScript.

Create a Link to a Remedy Ticket

BMC SoftwareLike many large companies, mine uses BMC Remedy for IT Service Management. One of the seemingly simple tasks that’s often asked of us is to create a page or report that links ticket numbers to their listings in Remedy. This is more difficult that it ever should need to be, but doable with a little work. Note that the following was tested on BMC Remedy 7.6. as, unfortunately, I have no other environment to test in.

(more…)

DP_SharePoint Update

SharePoint LogoI’ve (finally) incorporated a substantial number of improvements and new features into my JavaScript library, DP_SharePoint, designed to make working with client-side SharePoint development easier. It provides:

  • Methods to acquire JavaScript handlers to SharePoint form controls and fields. This makes it much simpler to interrogate or add event handlers to SharePoint forms.
  • Simple methods to add or remove events from SharePoint form elements.
  • Simple methods to hide and show elements of SharePoint forms.
  • Methods to simplify the calling and use of SharePoint web services and ready the data returned from them for use.

It still beta – and likely will be for… ever – but I’m using it in heavily trafficked production development without problems. Except some in-depth posts about specific features over the next few months.

Comments, criticisms or suggestions are always welcome!

Bodybuilders Remind Me of DP_DateExtensions

As none of you remember, I released a huge update to my venerable (8 years-old now!) JavaScript date extensions DP_DateExtensions a couple of years ago. The rewrite was prompted by a bug, but sent my brain down a rabbit hole: just how do you calculate the difference between two dates?

You can read about the whole sordid mess, but it turns out that’s a surprisingly complex question. In the end, the new component ended up with no less than three distinct options for calculating the difference between two time periods.

Anyway, this leads me to a bizarre conversation that was detailed by Joe Veix on Death And Taxes: “Two body builders argue on the internet about how many days are in the week“. The whole exchange is hilarious and is well worth spending some time with.

Still, it did remind me uncomfortably of the week where I nearly went insane trying to figure out how to minus one date from another date. Rabbit holes can be dangerous.

Phonetic Alphabet Fun

I spent more than a little time learning about the history and multiple styles of phonetic alphabets when putting together DP_AlphaWords (which supports eight different standards plus a couple of just-for-fun additions). I’m not an expert, but I’m definitely an interested amateur.

So when a reader by the name of Lurie brought The Phonetic Alphabet according to Google – 2015 to my attention, I was intrigued. Eliran Ouzan of HostAdvice.com collated all of the single-letter search suggestions from each of the regional editions of Google and created an interesting infographic of the results.

So, for example, instead of saying “Whisky Tango Foxtrot” when things get odd, you might just say “Walmart Target Facebook”. I considered adding it to DP_AlphaWords, but as I’m lazy and this is bound to change regularly, I decided against it.

Still, its an interesting exercise, even if it does reveal some potentially uncomfortable things about the power of branding and global marketing.

DP_DateExtensions Update

I recently received a tweet from @denndk with a very reasonable question about my JavaScript date extensions, DP_DateExtensions:

@kiwidust Just used your DateExtension lib. I see that quarterhours and businessdays in the add method is not implemented. why in the docs?

To be fair I did implement the methods. I just implemented them terribly.

First off, the “quarterhours” (and “halfhours” as well) were mistakenly calculating quarter and half minutes, not hours. Simple fix for a really dumbass mistake. Unfortunately the second issue was even dumbassier.

You see I originally released the component – and kept releasing updates for it for over six years – with no actual code in the “businessdays” calculation for the add() method. It was just plain empty. Last February I got an email mentioning this and so I fixed it. Then, a scant two months later I published an older version of the component to GitHub that didn’t have it. A year later I get a tweet.

You should be able to recognize two things: 1) nobody uses this, and 2) I’m an idiot.

In any case the component has been corrected (again) and uploaded to GitHub.

Announcing DP_SharePoint

SharePoint LogoI’ve published the initial version of my JavaScript library, DP_SharePoint, designed to make working with client-side SharePoint development easier.  Still in development, the library provides:

  • Methods to acquire JavaScript handlers to SharePoint form controls and fields. This make it much simpler to interrogate or add event handlers to SharePoint forms.
  • Simple methods to add or remove events from SharePoint form elements.
  • Simple methods to hide and show elements of SharePoint forms.
  • Methods to simplify the calling and use of SharePoint web services and ready the data returned from them for use.

The library should be considered (very) beta but I am using it in a heavily trafficked production development.  I’ve got lots of plans for this, as I’m in a position to do a lot of SharePoint development over the next few months or years (all without access to SharePoint Designer or any back-end support).

Comments, criticisms or suggestions are always welcome!

I’ve GitHubbed! GitHubbled? GitHubliered?

I’ve finally gotten with the times and moved my JavaScript libraries and utilities to GitHub.  You can find me at https://github.com/kiwidust. My components are old (and, if I must admit it, old-fashioned) and I had never really considered them much beyond my own needs but since it seems a few other have found some of them useful I decided it was time become a little more formal.

The following components have been moved – feel free to fork ’em!

I’ll be maintaining the documentation here at DepressedPress.com, for now at least, and the examples will still be hosted at Comcast (as I’ve found no other viable options).  I’m open to any other suggestions to make working with my stuff easier.

Personal Archaeology: Using a GIF as a Data Pipe

Way back in the history-times, in August of the year 2000, I authored an article detailing a technique that allowed for bi-directional communication between a server and a web browser without a page refresh.  The technique was, if I do say so myself, pretty clever in a primitive, kludgy, clunky kind of way.  I have no idea if I was really the “first” to come up with this but I do know that the rise of standardized AJAX a few short years later completely and deservedly eclipsed it.

Using a GIF as a Data Pipe

What I’ve recently realized is that a lot of traffic still points to that article.  I, in fact, get nearly as many 404 errors for people looking for this article as I do legitimate hits to the site (“popular” I am not).  It’s listed in the Wikipedia article on Remote Scripting and in many blogs, forums and resource sites.  For the curious various versions of it are available on the Internet Archive.

Now it’s nothing more than a weird little historical artifact that I’ll keep here on the digital mantle for posterity.

DP_DateExtensions vs Excel: Fight!

I recently received a request for assistance with my JavaScript date extensions, DP_DateExtensions.  In part it says:

I need to simulate the MS Excel networkdays() function.  Excel would count 10th Jan 2013 midnight to 15th Jan 2013 midnight as 4 working days (6 days in total) but DP_DateExtension.js does not count the 10th so outputs 3 working days (5 total).

The Excel NetworkDays() function returns “business days” (removing Saturday and Sunday and optionally holidays from the calculation). In this case passing the function January 10th (a Thursday) to January 15 (a Tuesday) results in “4”.  This makes it clear that Excel is doing this calculation inclusively by date and obviously not from “midnight to midnight”.

(more…)