Thursday, September 4. 2008Google releases Chrome
So! Google has finally made its entry into the browser market, and its filled with lies!
Specifically: Google's new browser software is designed to work "invisibly" and will run any application that runs on Apple's Safari web browser, company officials said. and "If you are webmaster, and your site works in Apple Safari then it will work very well in Google Chrome," Pichai said. So then, fire up Chrome and point it at http://iphone.itransit.com.au/. So, it seems that not all sites that work in Safari will work under Chrome. Its a fair assumption that most sites don't make heavy use of window.openDatabase (HTML 5 spec) but its still inaccurate to say that all sites that work in Safari will work under Chrome. Wonder if thats just time/laziness on Google's part not to pull across a more recent version of WebKit or because they wrote their own JS engine (that should be outside the JS engine though..), or because its a competing feature against Google Gears? Hopefully not the latter. It would be nice to see where Google takes Chrome though as the beta progresses. Otherwise though, not bad Update: Looks like they're using the "Safari 3.1" branch of Webkit for the beta, which does support window.openDatabase just fine. Seems to be a compile time option and they're choosing to disable it. More info/source over at http://dev.chromium.org/. bok Wednesday, July 23. 2008iPhone + Safari + Gestures
Looking for iTransit? Check two posts down.
-- Been playing with touches in Safari, specifically trying to track certain gestures. If you haven't read it, a good primer on touches/gestures in Mobile Safari can be found here. Its a great starting point. So now that the its been established as to how to do Drag and Drop and rotating/scaling what about the other one finger gestures that apple employs? Specifically, I'm trying to replicate the swipe left and right functionality of the photo browser (show previous/next photos), and I've been able to do so. The trick here is to catch the initial touch event, and the ending touch event and work out where our finger has gone. A key thing to remember is that the touches are passed around and updated by reference, so your original copy of the touch will be updated with a new position. What I've ended up with is a small class that watches the touchstart and touchend events on the document level, and when it detects a swipe it fires a gesture:swipe event. How? The following is the code that I used, you'll need Prototype to make this work. Click on a comment to hide it. Click here to show all comments.
var GestureClass = Class.create
Is that documented enough to make sense? Drop me a line in the comments if not and I'll see what I can do to explain better You'll see this gesture used in the new version of iTransit, naturally - and there's more gestures to come! Cheers, -bok Thursday, July 17. 2008iTransitHi all, While I'm quietly working on a new version of iTransit (iui is a bit bloated...) you're invited to continue to check out the current version @ http://iphone.itransit.com.au/. Presently it is for Melbourne only, other cities are on my medium-range radar. Here's whats coming:
The current aim for iTransit is to be something that you can whip out on the go to find out info live - as such browsing timetables won't be a focus. Comments, suggestions and other feedback is very valued. Feel free to leave a comment below or via the app. Cheers,
bok Friday, July 4. 2008Melbourne Public Transport + Google Maps
While I'm detailing apps that I've played with but never published, there's the beginning of something larger with regards to Melbourne's Public Transport system.
For the moment, its just a google maps version of the network maps with some station/stop info, but you can check it out at http://transport.odynia.org/maps/. I had planned on going the full stretch and making it the ultimate resource of its type, but my time doesn't seem to be my own lately! bok Tuesday, August 22. 2006BUBBLES!The future.. is Bubbles!
Weeeee
Yes, so I am excited, watch this space!
-bok
Wednesday, August 2. 2006Playing with GridsThis seems to be the most popular subject available on this blog. Seems no one has tried playing with the Microsoft CRM grids as much as me, which is rather interesting
A while back I touched on how to "colourise" the grid rows, a reader comment got me thinking about how I could satisfy an internal request here. In our old system, they used a dummy entry to trigger a filter which changed the formatting to highlight it. IE they created a record of type "notice" and it would make it bold and bright purple! Couldn't miss it!
So they've asked whether it would be possible to implement something similar with CRM. As these screenshots show, it is!
Before
After
As you can see, a huge improvement, they should have no problems working out that there are no more repairs to be booked for those days
This uses the same colourising code as the previous post, with a few additions
Click on a comment to hide it. Click here to show all comments.
// if someone can work out why the computers here insist the week starts at Thursday what would beThis will take the contents of a lookup field in the grid, check its GUID against the correct one, and if it is remove all TD's from the field except for the one containing the lookup, and then expand and modify it.
Now please remember, this is a VERY BASIC example. If you modify the view at all or the view contains different fields it won't work. This goes for all grid modifying via javascript. Its also very definitely NOT SUPPORTED by Microsoft. So don't ask them.
From Steve:
Hi, I'm thinking whether we can modify the grid view such as add .gif images in the column?
I need to do that because there's a user requirement which the customer wants me to show different gif images (like traffic lights) based on the status.... Do you have any idea? Sure do Steve!
What you would do, is once you are in the loop checking each row, instead of replacing the background colour (or in addition to) you could add an image to a column, or replace the icon. To replace the icon you would be looking at something like:
grid.childNodes[i].childNodes[1].innerHTML = '<img src="http://server/your/img_here.gif" alt=""This has been tested and seems to work
As always, I hope this helps someone!
-bok
Update!
I get several requests a week for the content of statuses.aspx, and given that I don't actively work with Microsoft CRM anymore I figure it might just be easier if I post the source here. Feel free to comment if you need help, keep in mind though that I'll probably be a bit rusty by now
<%@ Page Language="c#" Debug="true"%>
Thursday, July 27. 2006Xnyo DevelopmentWell its official...
There's 116 pages of the Xnyo source printed out in pretty syntax-colours on my desk with a plethora of scribbles, crosses-out, adjustments and notes on there. I've found ALOT of areas that I'm just not satisfied with and want to redo. So I dare say this will end up being a full re-write.
I'll try to make it as backwards compatible as possible, but one thing is for sure, this will be a forward looking rewrite, meaning that unfortunately it won't be PHP4 compatible. I want to start making use of exceptions and better OO practices. Things like autoloading will be incorporated into the plugin system. Exceptions for the errors, __get() and __set() for config options. I'll investigate extra things like PDO and the new filter extension that'll be in 5.2 (which functions remarkably similar to my filter stuff..) and see how they go. I'll keep this blog up to date with development notes as I go.
Should be interesting
-bok
Wednesday, July 19. 2006Xnyo, Smarty, AJAXBeen playing recently with ideas on what I could make Xnyo's AJAX functionality look like. I've started to take a basic look at how other libraries are doing it, so this may evolve in the furture.
So far, I have this:
Click on a comment to hide it. Click here to show all comments.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
this is very very early stages yet, just me mainly pushing some ideas onto something more concrete than my brain.
The basic idea here, is that the {effect} function will create an event (or function?) called login_failure that will call the shake effect on the first element found inside it. The {post} function seen in the button element will then post to Pavid (the Xnyo XMLRPC backend) calling the $xnyo->login() method, passing the values of the username and password field. On an error it would trigger the login_failure event, causing the loginbox to shake.
Make sense? Please feel free to leave any comments.
-bok
Thursday, June 29. 2006PHP SecurityIt seems that once again people are trying to spread Fear Uncertainty and Doubt (FUD) about the security of PHP. The article http://www.owasp.org/index.php/PHP_Top_5 lists what they consider to be PHP security faults.
This is simply not true. None of the faults listed here are actually PHP-specific. The items they list could occur on any programming language if the programmer was sufficiently inexperienced. Further, any and all of the faults have been made harder to access by recent versions of PHP.
The article does make for a good read though, on some of the basic security practices you should undertake on any language, and would likely have been well received if not worded in such a manner that it could be perceived as an attack
Remember though, a programming language is only as secure as the person using it. Read up on your security practices and you'll be right. Pay attention to security announcements, most major open source projects have them in an easy to access place, and always keep your software uptodate with patches!
-bok
Showing / Hiding Fields For User Who Created ItemRonald Lemmen has recently pulled out several stops in what was possible with CRM in his attempts to be able to show and hide fields based on the user logged in, and what roles they have.
I won't repeat his excellent work, but I will put forth an idea I had as to another possible use, one which I've had to implement here to keep up with Management's demands..
In this one, using Ronald's code to get the user id of the logged in user, we can compare it to the created by field. This of course requires that we have the created by field on the form somewhere. Then you can use the following code (the getUserId() function is from Ronald's blog) to check whether this is the user who created this object, and show/hide a section (or field or tab or whatever) based on that information.
Click on a comment to hide it. Click here to show all comments.
function getUserId()
It's a really simple idea. Can have some interesting uses, particularly if you combine it with the Security Role functions. This means you could make it so that only the person who created the item can change certain values, unless they're a high level manager.
Think about it
-bok
Wednesday, June 21. 2006"Colourising" Microsoft CRM GridsRecently I came up with a nice idea: what if we could shade the rows in grids?
I thought through it, and realised it was possible. Of course its not possible to make it automatically colourise the grid, at least not without editing the aspx pages and that would go well beyond the realms of the supported customisations.
Before we go further, please remember that this is not a supported customisation either as it involves searching/editing the html output, which Microsoft is well within its right to change at any time.
The code that does this is split into two bits. You could go ahead and add the "colourise" code to the isv.config.xml file, but i really hate editing that all the time
Like so:
<Button Title="Colourise" ToolTip="Colourise active grid view"That loads up the following script.
scripts/colourify.js
Click on a comment to hide it. Click here to show all comments.
/**
As you can see, it has limited application but can be useful for a "quick glance". Some shortcomings include not holding the colourised status through reloads, changing the grid page, resorting the grid, etc, as well as the loss of the blue "selected row", as you can see below this only comes up with a white font instead of black. This is also a basic prototype version. I'll extend it at some point in the future to be able to colourised based on owner, dates, or whatever columns are there
I suppose I should show some screenshots of what this actually does..
Before
After
Enjoy!
-bok
PS. I've had several requests for the source to statuses.aspx. If you would like to see this leave a comment and I'll be happy to email it through, not going to post it here though as my C# is very basic - I've only been coding in it for 6 weeks
Update!
I get several requests a week for the content of statuses.aspx, and given that I don't actively work with Microsoft CRM anymore I figure it might just be easier if I post the source here. Feel free to comment if you need help, keep in mind though that I'll probably be a bit rusty by now
<%@ Page Language="c#" Debug="true"%>
|