March 8th, 2010 by jeremychone | No Comments »
- Smart GWT (demo): Free/LGPL: Seems to be mature and well maintained
- GWT drag and drop: Free/Apache 2.0: Seems to be mature and well maintained
- GWT EXT: Paid/Dual License: Complete and huge libs. Seems to be wrappers on top of ext
Posted in GWT | No Comments »
March 7th, 2010 by jeremychone | No Comments »
Posted in JavaScript | No Comments »
March 4th, 2010 by jeremychone | No Comments »
To use the JsonpRequestBuilder, you need to inherit the following in your x.gwt.xml
<inherits name="com.google.gwt.jsonp.Jsonp" />
Posted in GWT, Uncategorized | No Comments »
February 27th, 2010 by jeremychone | No Comments »
Sometime, the jQuery(”#xx”).click() does not work. So, here is a way to do it directly:
var e = document.createEvent('MouseEvents');
e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
var r = $("#myElement").get(0).dispatchEvent(e);
Obviously, you can use the document.getElementById(”myElement”) if you do not want any jQuery dependency.
Posted in Uncategorized | No Comments »
February 22nd, 2010 by jeremychone | No Comments »
Assuming the iframe is from the same domain that the top window, use frameElement.ownerDocument to get to the parent document.
var topWindowHref = window.frameElement.ownerDocument.location.href
Posted in JavaScript | No Comments »
February 22nd, 2010 by jeremychone | No Comments »
From John Resig Javascript array remove
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
Examples:
// Remove the second item from the array
array.remove(1);
// Remove the second-to-last item from the array
array.remove(-2);
// Remove the second and third items from the array
array.remove(1,2);
// Remove the last and second-to-last items from the array
array.remove(-2,-1);
Posted in JavaScript | No Comments »
February 13th, 2010 by jeremychone | No Comments »
Getting started official tutorial
http://code.google.com/chrome/extensions/getstarted.html
manifest.json
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
},
"permissions": [
"http://api.flickr.com/"
]
}
See also: Browser Actions
Debug & Inspect extension
- chrome-extension://extensionId/popup.html to see the page
- got to chrome://extensions/ and click on popup.html
Posted in Chrome | No Comments »
February 12th, 2010 by jeremychone | No Comments »
- Install Android SDK and Android Driver
- Set android USB mode to debug (Settings > Applications > Development > USB Debugging)
- Connect Android to PC with USB cable
- launch \android-sdk-windows\tools\ddms.bat
- Click on Device > Screen Capture (or Ctrl S)
Tutorial video (not sure why the driver need to be installed manually. I installed it normally and it worked)
Posted in Uncategorized | No Comments »
February 6th, 2010 by jeremychone | No Comments »
Yes, File.renameTo is used to move file.
// File (or directory) to be moved
File file = new File("filename");
// Destination directory
File dir = new File("directoryname");
// Move file to new directory
boolean success = file.renameTo(new File(dir, file.getName()));
if (!success) {
// File was not successfully moved
}
source
Posted in Java | No Comments »
February 5th, 2010 by jeremychone | No Comments »
HTML
Javascript code
<script type="text/javascript">
$(document).ready(function(){
var paper = Raphael("rtest", 320, 200);
var circle = paper.circle(50, 40, 30);
circle.attr({
"stroke": "#336699",
"fill": "#fbfbfb"
});
$(circle.node).click(function(){
var circle = this.raphael;
//Toggle the circle fill color
if (circle.attr("fill") == "#333333") {
circle.attr("fill", "#fbfbfb");
} else {
circle.attr("fill", "#333333");
}
});
});
</script>
See RaphaelJs Event doc
Posted in RaphaelJs, jQuery | No Comments »