Posts

Showing posts from June, 2011

loader timer using jQuery dialog

We have a gift and needed a loader display I created a loader js module using jQuery dialog and it's coded to display when ajax calls start and then hide when ajax calls stop. Could make model by setting the dialog modal param to true. var loadingTimer = (function() { var $timer = $('#loadingHopup'), init = function(){ _dialog(); _listeners(); }, show = function() { $timer.dialog("open"); }, hide = function() { $timer.dialog("close"); }, _dialog = function() { $timer.dialog({ create: function (event, ui) { $(".ui-widget-header").hide(); }, open: function() { // allow safari/chrome users to use scrollbar window.setTimeout(function() { $(document).unbind('mousedown.dialog-overlay').unbind('mouseup.dialog-overlay'); }, 100); }, close: function() { }, dialogClass: 'noTitleDialog', height: 200, width: 200, position: '

SVN Merge using Tortoise svn OR command line

Before you start you should find the revision number in the source folder you want to merge forward from. Steps: ensure all is committed and its updated in target folder go to target folder (you want to merge into) and right click and choose Merge on screen 1, I usually choose "Merge range of revisions"  and click Next. But if you want to merge from a Branch then select the Merge from Branch 2nd option and then on next screen choose the Branch URL to merge from.  on screen 2 "Merge Revision Range", choose url to merge from (i.e. source) on screen 2, enter revision range to merge e.g. 1230-Head.   This means merge revision 1230s to Head from the source to the target you selected in step 2 i.e. a range. You could also just merge a single revision number or more than one delimited by commas. You can click Show Log button to see a list of revision to choose from. click Next on screen 3 "Merge Options", you can click Test Merge to see what a merge wou

jQuery to get all input fields which are not hidden nor display: none

jQuery is sooo powerful, no wonder its used on almost half the worlds sites. Here's some code to find in #myForm all input types of text which are not hidden fields or display: none and iterate over them         $('#myForm input[type=text]:input:not(input:hidden)').each(function() {             console.log("In each and value is: " + $(this).val() + " id is: " + this.id);                                 }); There is a difference between input[type=hidden] and input:hidden. The latter includes type hidden as well as display none which is what I wanted.

jQuery and jsonp

I recently has recourse to build a jQuery jsonp integration. A workaround to the browsers same origin policy. I discovered this little black art that is not well documented at all.  There's a few useful links on the web but not alot to go on, even on jQuery site. Here's my code with some explanation below:      // I setup an object literal to set the data, then stringify it (name your fields as you need)      //      var callData = {                    Field1: "Denis",                    Field2: "0",                    Field3: "Test"             };      var JSONRequestData = JSON.stringify(callData);      $.ajax({                   dataType: 'jsonp',                 jsonpCallback: 'postProcessingCallBack',                 url: 'http://myserver.com/myjsonphandler?jsoncallback=?',                 data: JSONRequestData,                 async: false                    });    You must set dataType to jsonp.