Search Results

Search found 4442 results on 178 pages for 'html5 filesystem'.

Page 3/178 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • HTML5 and Visual Studio 2010

    - by Harish Ranganathan
    All of us work with Visual Studio (or the free Visual Web Developer Express Edition) for developing web applications targeting ASP.NET / ASP.NET MVC or Silverlight etc.,  Over the years, Visual Studio has grown to a great extent.  From being a simple limited functionality tool in VS.NET 2002 to the multi-faceted, MEF driven Visual Studio 2010, it has come a long way.  And as much as Visual Studio supports rapid web development by generating HTML mark up, it also added intellisense for some of the HTML specifications that one has otherwise monotonously type every time.  Ex.- In Visual Studio 2010, one can just type the angular bracket “<” and then the first keyword “h” or “x” for html or xhtml respectively and then press tab twice and it would render the entire markup required for XHTML or HTML 1.0/1.1 strict/transitional and the fully qualified W3C URL. The same holds good for specifying HTML type declaration.  Now, the difference between HTML and XHTML has been discussed in detail already, though, if you are interested to know, you can read it from http://www.w3schools.com/xhtml/xhtml_html.asp But, the industry trend or the buzz around is HTML5.  With browsers like IE9 Beta, Google Chrome, Firefox 4 etc., supporting HTML5 standards big time, everyone wants to start developing HTML5 based websites. VS developers (like me) often get the question around when would VS start supporting HTML5.  VS 2010 was released last year and HTML5 is still specifications under development.  Clearly, with the timelines we started developing Visual Studio (way back in 2008), HTML5 specs were almost non-existent.  Even today, the HTML5 body recommends not to fully depend on the entire mark up set as they are still under development specs and might change in the future. However, with Visual Studio 2010 SP1 beta, there is quite a bit of support for HTML5 based web development.  In fact, one of my colleagues pointed out that SP1 beta’s major enhancement is its ability to support HTML5 tags and even add server mode to them. Lets look at the existing validation schema available in Visual Studio (Tools – Options – Validation) This is before installing Visual Studio 2010 SP1 Beta.  Clearly, the validation options are restricted to HTML 4.01 and XHTML 1.1 transitional and below. Also, lets consider using some of the new HTML5 input type elements.  (I found out this, just today from my friend, also an, ASP.NET team member) <input type=”email”> is one of the new input type elements according to the HTML5 specification.  Now, this works well if you type it as is  in Visual Studio and the page renders without any issue (since the default behaviour is, if there is an “undefined” type specified to input tag, it would fall back on the default mode, which is text. The moment you add <input type=”email” runat=”server” >, you get an error Naturally you don’t get intellisense support as well for these new tags.  Once you install Visual Studio 2010 Service Pack 1 Beta from here (it takes a while so you need to be patient for the installation to complete), you will start getting additional Validation templates for HTML5, as below:- Once you set this, you can start using HTML5 elements in your web page without getting errors/warnings.  Look at the screen shot below, for the new “video” tag which is showing up in intellisense (video is a part of the new HTML5 specifications)     note that, you still need to hook up the <!DOCTYPE html /> on the top manually as it doesn’t change automatically  (from the default XHTML 1.0 strict) when you create a new page. Also, the new input type tags in HTML5 are also supported One, can also use the <asp:TextBox type=”email” which would in turn generate the <input type=”email”> markup when the page is rendered.  In fact, as of SP1 beta, this is the only way to put the new input type tags with the runat=”server” attribute (otherwise you will get the parser error mentioned above.  This issue would be fixed by the final release of SP1 beta) Going further, there may be more support for having server tags for some of the common HTML5 elements, but this is work in progress currently. So, other than not having runat=”server” support for the new HTML5  input tags, you can pretty much build and target HTML5 websites with Visual Studio 2010 SP1 Beta, today.  For those who are running Visual Studio 2008, you also have the “HTML5 intellisense for Visual Studio 2010 and 2008” available for download, from http://visualstudiogallery.msdn.microsoft.com/d771cbc8-d60a-40b0-a1d8-f19fc393127d/ Note that, if you are running Visual Studio 2010, the recommended approach is to install the SP1 beta which would be the way forward for HTML5 support in Visual Studio. Of course, you need to test these on a browser supporting HTML5 such as IE9 Beta or Chrome or FireFox 4.  You can download IE9 Beta from here You can also follow the Visual Web Developer Team Blog for more updates on the stuff they are building. Cheers !!!

    Read the article

  • Make your CHM Help Files show HTML5 and CSS3 content

    - by Rick Strahl
    The HTML Help 1.0 specification aka CHM files, is pretty old. In fact, it's practically ancient as it was introduced in 1997 when Internet Explorer 4 was introduced. Html Help 1.0 is basically a completely HTML based Help system that uses a Help Viewer that internally uses Internet Explorer to render the HTML Help content. Because of its use of the Internet Explorer shell for rendering there were many security issues in the past, which resulted in locking down of the Web Browser control in Windows and also the Help Engine which caused some unfortunate side effects. Even so, CHM continues to be a popular help format because it is very easy to produce content for it, using plain HTML and because it works with many Windows application platforms out of the box. While there have been various attempts to replace CHM help files CHM files still seem to be a popular choice for many applications to display their help systems. The biggest alternative these days is no system based help at all, but links to online documentation. For Windows apps though it's still very common to see CHM help files and there are still a ton of CHM help out there and lots of tools (including our own West Wind Html Help Builder) that produce output for CHM files as well as Web output. Image is Everything and you ain't got it! One problem with the CHM engine is that it's stuck with an ancient Internet Explorer version for rendering. For example if you have help content that uses HTML5 or CSS3 content you might have an HTML Help topic like the following shown here in a full Web Browser instance of Internet Explorer: The page clearly uses some CSS3 features like rounded corners and box shadows that are rendered using plain CSS 3 features. Note that I used Internet Explorer on purpose here to demonstrate that IE9 on Windows 7 can properly render this content using some of the new features of CSS, but the same is true for all other recent versions of the major browsers (FireFox 3.1+, Safari 4.5+, WebKit 9+ etc.). Unfortunately if you take this nice and simple CSS3 content and run it through the HTML Help compiler to produce a CHM file the resulting output on the same machine looks a bit less flashy: All the CSS3 styling is gone and although the page display and functionality still works, but all the extra styling features are gone. This even though I am running this on a Windows 7 machine that has IE9 that should be able to render these CSS features. Bummer. Web Browser Control - perpetually stuck in IE 7 Mode The problem is the Web Browser/Shell Components in Windows. This component is and has been part of Windows for as long as Internet Explorer has been around, but the Web Browser control hasn't kept up with the latest versions of IE. In a nutshell the control is stuck in IE7 rendering mode for engine compatibility reasons by default. However, there is at least one way to fix this explicitly using Registry keys on a per application basis. The key point from that blog article is that you can override the IE rendering engine for a particular executable by setting one (or more) registry flags that tell the Windows Shell which version of the Internet Explorer rendering engine to load. An application that wishes to use a more recent version of Internet Explorer can then register itself during installation for the specific IE version desired and from then on the application will use that version of the Web Browser component. If the application is older than the specified version it falls back to the default version (IE 7 rendering). Forcing CHM files to display with IE9 (or later) Rendering Knowing that we can force the IE usage for a given process it's also possible to affect the CHM rendering by setting same keys on the executable that's hosting the CHM file. What that executable file is depends on the type of application as there are a number of ways that can launch the help engine. hh.exeThe standalone Windows CHM Help Viewer that launches when you launch a CHM from Windows Explorer. You can manually add hh.exe to the registry keys. YourApplication.exeIf you're using .NET or any tool that internally uses the hhControl ActiveX control to launch help content your application is your host. You should add your application's exe to the registry during application startup. foxhhelp9.exeIf you're building a FoxPro application that uses the built-in help features, foxhhelp9.exe is used to actually host the help controls. Make sure to add this executable to the registry. What to set You can configure the Internet Explorer version used for an application in the registry by specifying the executable file name and a value that specifies the IE version desired. There are two different sets of keys for 32 bit and 64 bit applications. 32 bit only or 64 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION Value Key: hh.exe 32 bit on 64 bit machine: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION Value Key: hh.exe Note that it's best to always set both values ideally when you install your application so it works regardless of which platform you run on. The value specified is a DWORD value and the interesting values are decimal 9000 for IE9 rendering mode depending on !DOCTYPE settings or 9999 for IE 9 standards mode always. You can use the same logic for 8000 and 8888 for IE8 and the final value of 7000 for IE7 (one has to wonder what they're going todo for version 10 to perpetuate that pattern). I think 9000 is the value you'd most likely want to use. 9000 means that IE9 will be used for rendering but unless the right doctypes are used (XHTML and HTML5 specifically) IE will still fall back into quirks mode as needed. This should allow existing pages to continue to use the fallback engine while new pages that have the proper HTML doctype set can take advantage of the newest features. Here's an example of how I set the registry keys in my Tarma Installmate registry configuration: Note that I set all three values both under the Software and Wow6432Node keys so that this works regardless of where these EXEs are launched from. Even though all apps are 32 bit apps, the 64 bit (the default one shown selected) key is often used. So, now once I've set the registry key for hh.exe I can now launch my CHM help file from Explorer and see the following CSS3 IE9 rendered display: Summary It sucks that we have to go through all these hoops to get what should be natural behavior for an application to support the latest features available on a system. But it shouldn't be a surprise - the Windows Help team (if there even is such a thing) has not been known for forward looking technologies. It's a pretty big hassle that we have to resort to setting registry keys in order to get the Web Browser control and the internal CHM engine to render itself properly but at least it's possible to make it work after all. Using this technique it's possible to ship an application with a help file and allow your CHM help to display with richer CSS markup and correct rendering using the stricter and more consistent XHTML or HTML5 doctypes. If you provide both Web help and in-application help (and why not if you're building from a single source) you now can side step the issue of your customers asking: Why does my help file look so much shittier than the online help… No more!© Rick Strahl, West Wind Technologies, 2005-2012Posted in HTML5  Help  Html Help Builder  Internet Explorer  Windows   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • "Unknown Filesystem" error without CDROM

    - by Utku Tarhan
    I've got a problem with Ubuntu 12.04 LTS. At first I ran mount command on terminal. Then I restarted my computer. After that, when my computer opened there is writing this: error: unknown filesystem grub rescue I searched commands and I found ls command. I tried it and I got this: (hd0) (hd0,msdos5) (hd0,msdos1) My computer's DVD driver is broken and I tried to boot Ubuntu on USB but it doesn't worked. My computer's specs: PC Name: HP Presario F780ET Processor: AMD Turion 64 X2 Mobile Technology TL-60 Ram: 2GB Ubuntu Version: 12.04 LTS

    Read the article

  • HTML5 Video Stop onClose

    - by Rob
    I'm using jQuery tools for an overlay. Inside the overlay I have an HTML5 video. However, when I close the overlay, the video keeps playing. Any idea how I might get the video to stop when I close the overlay? Here's the code I have: $("img[rel]").overlay({ onClose: function() { //stop the video somehow }, mask: { color: '#000', opacity: 0.7 }}); I tried using $('video').pause(); But this paused the overlay as well.

    Read the article

  • How to format FAT32 filesystem infected with windows virus and that is write protected

    - by explorex
    Hi, I have a pendrive with FAT32 filesystem. it is infected with virus dont know which but has autorun.inf and create exe file within folder. I tried to format it with various filesystems and even try to delete it with GParted but couldn't because it says it is write protected i can't even delete files. How to format it? user@explorerx:~$ sudo fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xbd04bd04 Device Boot Start End Blocks Id System /dev/sda1 * 1 498 3998720 82 Linux swap / Solaris Partition 1 does not end on cylinder boundary. /dev/sda2 499 19457 152287585+ f W95 Ext'd (LBA) /dev/sda5 5100 10198 40957686 7 HPFS/NTFS /dev/sda6 10199 14787 36861111 7 HPFS/NTFS /dev/sda7 14788 19457 37511743+ 7 HPFS/NTFS /dev/sda8 499 5099 36956160 83 Linux Partition table entries are not in disk order Disk /dev/sdc: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc13bc13b Device Boot Start End Blocks Id System /dev/sdc1 1 9729 78143488 7 HPFS/NTFS /dev/sdc2 9729 19457 78143488 7 HPFS/NTFS Disk /dev/sdb: 4194 MB, 4194304000 bytes 112 heads, 47 sectors/track, 1556 cylinders Units = cylinders of 5264 * 512 = 2695168 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 2 1557 4091904 b W95 FAT32

    Read the article

  • A* Start path finding in HTML5 Canvas

    - by gyhgowvi
    I'm trying implement A* Start path finding in my games(which are written with JavaScript, HTML5 Canvas). Library for A* Start found this - http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html and now I'm using this library for path finding. And with this library, I'm trying write a simple test, but stuck with one problem. I'm now done when in HTML5 canvas screen click with mouse show path until my mouse.x and mouse.y. Here is a screenshot - http://oi46.tinypic.com/14qxrl.jpg (Pink square: Player, Orange squares: path until my mouse.x/mouse.y) Code how I'm drawing the orange squares until my mouse.x/mouse.y is: 'http://pastebin.com/bfq74ybc (Sorry I do not understand how upload code in my post) My problem is I do not understand how to move my player until path goal. I've tried: 'http://pastebin.com/nVW3mhUM But with this code my player is not beung drawn.(When I run the code, player.x and player.y are equals to 0 and when I click with the mouse I get the path player blink and disappear) Maybe anyone know how to solve this problem? And I'm very very very sorry for my bad English language. :)

    Read the article

  • Ubuntu 12.04 64 bit "unable to find medium with live filesystem" AFTER normal install

    - by user88710
    So, I got a new computer (64 bit quad core yada yada). pulled my Ubuntu SSD drive from old machine, installed it into new machine. (my intention here is to have Ubuntu installed on the 120G SSD, Win7 on the main drive) downloaded 64 bit Ubuntu, burned it to a disk. rebooted with Live CD, installed Ubuntu to the SSD drive, had no problems rebooted again, got the grub menu, selected Ubuntu after a minute i got this - "unable to find medium with live filesystem" booting into windows, explorer doesnt even see the SSD. Device manager sees it though. I assume this is because its formatted with ext4. so, The liveCD saw the SSD just fine, installed fine, but when i try to boot ubuntu, i get the error above, heeellllpppp! UPDATE: small update. Windows did a software update that apparently wiped out my grub, so I guess grub was installed on the main drive. I reinstalled Ubuntu (again) on the SSD drive but, still no joy with booting from it. same error message as above.

    Read the article

  • Ubuntu 13.04 to 13.10: Filesystem check or mount failed

    - by SamHuckaby
    I attempted to upgrade from Ubuntu 13.04 to 13.10 today, and mid upgrade the system started flaking out, and eventually locked up entirely. I was forced to restart the computer, and am now unable to get the computer to boot up at all. When I boot currently, it takes me to the GRUB menu, and I can choose to boot normally, or boot in an older version. I have tried several things, which I list below, but no matter what, when I try to finish booting into Ubuntu, I receive the following error: Filesystem check or mount failed. A maintenance shell will now be started. CONTROL-D will terminate this shell and continue booting after re-trying filesystems. Any further errors will be ignored root@ubuntu-computername:~# I have fun fsck -f and everything appears correct, no errors are reported. and it passes all 5 checks. If I run fdisk -l then I get the following information: Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes Disk identifier: 0x00010824 Device Boot Start End Blocks Id System /dev/sda1 * 2048 608456703 304227328 83 Linux /dev/sda2 608458750 625141759 8341505 5 Extended Partition 2 does not start on physical sector boundary. /dev/sda5 608458752 625141759 8341504 82 Linux swap / Solaris Disk /dev/sdb: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x0fb4b7e8 Device Boot Start End Blocks Id System /dev/sdb1 8192 625139711 312565760 7 HPFS/NTFS/exFAT I am considering just installing a new OS on the other disk, that currently has nothing on it, and then just attempting to scrape my data off the old disk (thankfully I didn't encrypt the files). Really my question is this: Can I salvage this Ubuntu install, or should I give up and just reinstall?

    Read the article

  • X won't start, root filesystem mounted read only

    - by TK Kocheran
    I just experienced a very strange and puzzling problem on my machine that I can't seem to get sorted out. I was running Windows on a second partition, and everything was working great. I then went to restart into Linux, and noticed that X wouldn't start. Everything was displayed in super-low resolution, so I tried reinstalling my NVIDIA driver. I started seeing all of these I/O error problems, so I figured that my SSD was bad. After a bit more playing around, I ran fsck on the drive when mounted from a startup disk as well as badsectors and everything looked great. The SMART drive tests all passed and again, everything was looking good, so I rebooted again and still, no joy. I started then getting some weird USB errors, so I followed someone's advice and unplugged my computer's power supply, then started back up again and my graphics looked a lot better in the BIOS and in the boot logo, but X still wouldn't start. I then found out that my main boot drive was being mounted read-only for some reason. What's going wrong? I've done some pretty extensive tests on the SSD from a startup disk such as writing massive files, reading big files, running filesystem checks on the entire disk, and everything is looking great, until I try to boot. Whenever I try installing the drivers with apt-get, I get a ton of ata error messages looking like this: How can I diagnose what's going wrong and fix it so I can get back to work?

    Read the article

  • Ubuntu boots in read-only filesystem after upgrade!

    - by akatzbreaker
    I got a serious problem here: I recently upgraded to the Latest Version of Ubuntu. Now, I boot to my Ubuntu Partition, and I get a Low-Graphics error! I boot to a Recovery-Mode to see what the Problem is. Then, I try to Fix any Damaged Packages, to run fsck but nothing solved the Problem. Then, from the Recovery Menu, I open a Root Shell. I try to create a File and I understand that the Filesystem is Read-Only. Then, I run: mount -o remount,rw / and it Worked for that Terminal Session! When I go back to recovery, I select to resume Boot Normally but I get the Same Error! a I also tried to Boot to my Root Shell again, remount as Read-Write and Start Gnome from there. It Worked! (But the user is ROOT, and is quite Dangerous!) However, I can't do all this proccess at every boot! Any Solution? (Note that when I try to create a new File in my Ubuntu Partition from another OS, I don't get any Errors!)

    Read the article

  • Independent HTML5 Physics Game: Any Feedback? [closed]

    - by mndoftea
    I've been independently developing a physics-based HTML5 game. I haven't used any libraries or engines; all the code, including the physics, is my own. It is free for a while on the Chrome Web Store and I was hoping that I could get some feedback on it. You can get it for Chrome here: https://chrome.google.com/webstore/detail/dbnmkpcomailjochphnmfklofkmgenci. I know this is not a normal question, but I'm happy for answers to be abstracted/generalized for broader use. Im asking here because I don't know anyone else personally who does this stuff. Any thoughts, comments or ideas you might have would be greatly appreciated! The physics system is written in JavaScript and works by setting up the differential equations of motion (plus a few conditions) and evaluating them numerically using the Euler method. The graphics are done through the HTML5 canvas and the music is done through the audio element. (Said music is in the public domain by the way). You can see the code by going to VIewView Source in Chrome.

    Read the article

  • Making HTML5 videos stored on AWS S3 **difficult** to download (because I cant make it impossible)

    - by Jimmery
    I am building a website that hosts video's stored on AWS's S3 service. The videos are played thru a HTML5 player we have built. Ive just been asked to make sure "nobody can steal our video's". Now I know that if you really don't want something stolen, don't put it up on the internet. However I just need to secure these videos as good as possible, the videos need to at the very least resist someone going thru the source code and trying to download them manually. One option available to me is to completely rebuild the video player in flash. This is not ideal, for several reasons, notably because I would also then have to build an App for mobile devices to be able to view this site. So I am looking for other options. I have heard about using a token to make the file available only during certain times. I have heard of using a separate file to serve the videos that sits between the HTML5 page and the video file. I am also having a look at IAM, the Secure AWS Access Control, in the hopes AWS can solve this problem for me. Can anyone here recommend any of these options? Or perhaps suggest other options available to me? Any help would be greatly appreciated.

    Read the article

  • Drawing on a webpage – HTML5 - IE9

    - by nmarun
    So I upgraded to IE9 and continued exploring HTML5. Now there’s this ‘thing’ called Canvas in HTML5 with which you can do some cool stuff. Alright what IS this Canvas thing anyways? The Web Hypertext Application Technology Working Group says this: “The canvas element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, or other visual images on the fly.” The Canvas element has two only attributes – width and height and when not specified they take up the default values of 300 and 150 respectively. Below is what my HTML file looks like: 1: <!DOCTYPE html> 2: <html lang="en-US"> 3: <head> 4: <script type="text/javascript" src="CustomScript.js"></script> 5: <script src="jquery-1.4.4.js" type="text/javascript"></script 6:  7: <title>Draw on a webpage</title> 8: </head> 9: <body> 10: <canvas id="canvas" width="500" height="500"></canvas> 11: <br /> 12: <input type="submit" id="submit" value="Clear" /> 13: <h4 id="currentPosition"> 14: 0, 0 15: </h4> 16: <div id="mousedownCoords"></div> 17: </body> 18: </html> In case you’re wondering, this is not a MVC or any kind of web application. This is plain ol’ HTML even though I’m writing all this in VS 2010. You see this is a very simple, ‘gimmicks-free’ html page. I have declared a Canvas element on line 10 and a button on line 11 to clear the drawing board. I’m using jQuery / JavaScript show the current position of the mouse on the screen. This will get updated in the ‘currentPosition’ <h4> tag and I’m using the ‘mousedownCoords’ to write all the places where the mouse was clicked. This is what my page renders as: The rectangle with a background is our canvas. The coloring is due to some javascript (which we’ll see in a moment). Now let’s get to our CustomScript.js file. 1: jQuery(document).ready(function () { 2: var isFirstClick = true; 3: var canvas = document.getElementById("canvas"); 4: // getContext: Returns an object that exposes an API for drawing on the canvas 5: var canvasContext = canvas.getContext("2d"); 6: fillBackground(); 7:  8: $("#submit").click(function () { 9: clearCanvas(); 10: fillBackground(); 11: }); 12:  13: $(document).mousemove(function (e) { 14: $('#currentPosition').html(e.pageX + ', ' + e.pageY); 15: }); 16: $(document).mouseup(function (e) { 17: // on the first click 18: // set the moveTo 19: if (isFirstClick == true) { 20: canvasContext.beginPath(); 21: canvasContext.moveTo(e.pageX - 7, e.pageY - 7); 22: isFirstClick = false; 23: } 24: else { 25: // on subsequent clicks, draw a line 26: canvasContext.lineTo(e.pageX - 7, e.pageY - 7); 27: canvasContext.stroke(); 28: } 29:  30: $('#mousedownCoords').text($('#mousedownCoords').text() + '(' + e.pageX + ',' + e.pageY + ')'); 31: }); 32:  33: function fillBackground() { 34: canvasContext.fillStyle = '#a1b1c3'; 35: canvasContext.fillRect(0, 0, 500, 500); 36: canvasContext.fill(); 37: } 38:  39: function clearCanvas() { 40: // wipe-out the canvas 41: canvas.width = canvas.width; 42: // set the isFirstClick to true 43: // so the next shape can begin 44: isFirstClick = true; 45: // clear the text 46: $('#mousedownCoords').text(''); 47: } 48: })   The script only looks long and complicated, but is not. I’ll go over the main steps. Get a ‘hold’ of your canvas object and retrieve the ‘2d’ context out of it. On mousemove event, write the current x and y coordinates to the ‘currentPosition’ element. On mouseup event, check if this is the first time the user has clicked on the canvas. The coloring of the canvas is done in the fillBackground() function. We first need to start a new path. This is done by calling the beginPath() function on our context. The moveTo() function sets the starting point of our path. The lineTo() function sets the end point of the line to be drawn. The stroke() function is the one that actually draws the line on our canvas. So if you want to play with the demo, here’s how you do it. First click on the canvas (nothing visible happens on the canvas). The second click draws a line from the first click to the current coordinates and so on and so forth. Click on the ‘Clear’ button, to reset the canvas and to give your creativity a clean slate. Here’s a sample output: Happy drawing! Verdict: HTML5 and IE9 – I think we’re on to something big and great here!

    Read the article

  • SimpleModal bug when positioning HTML5 video

    - by digm
    I am trying to use simple modal to display a modal window containing a video. I'm using the HTML5 "video" tag to do this. Using JQuery and SimpleModal, I can get it working in Chrome and Firefox, but for some reason Safari fails to maintain the centered positioning of the modal dialog for the video. In other words, when you scroll up and down in the windows, the modal window stays in its place, but the video scrolls up and down with the rest of the content outside the window. I've put together a 29 line piece of HTML code that you can cut and paste to test. https://pastee.org/z5sw Anyone know what I can do to fix this? I've been trying for a few hours now and no combination of JQuery, SimpleModal, or CSS changes can seem to fix this. I'd appreciate any suggestions. Thanks in advance!

    Read the article

  • HTML5 video element non-seekable when using Django development server

    - by Ory Band
    Hey everyone. I've got a Django app serving a webpage with an HTML5 element. There's a wierd "feature", turning the video element to be non-seekable: video.seekable returns a timeRanges object with length=0, whereas it should be length=1. This means I can't edit the video. JavaScript can't do anything either. The thing is, when I upload the problematic webpage, statically - no Django, just plain HTML/JS/CSS - to my website for testing, it works fine - length=1. However, if I try to serve the same static page on my Django dev server still gives the same problem. I am using Django's static serving for dev/debug purposes - Do you have any idea what is causing this, or how can I fix it? Thanks.

    Read the article

  • HTML5 video on Chrome

    - by Rob
    I'm using the following HTML5 to display video, but only the controls show up in Chrome. Works fine in Safari and Firefox: <video width="720" height="480" controls="controls" preload="preload"> <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" > <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.mp4" type="video/mp4"> Your browser doesn't support video. </video> Any ideas?

    Read the article

  • Linux filesystem with inodes close on the disk

    - by pts
    I'd like to make the ls -laR /media/myfs on Linux as fast as possible. I'll have 1 million files on the filesystem, 2TB of total file size, and some directories containing as much as 10000 files. Which filesystem should I use and how should I configure it? As far as I understand, the reason why ls -laR is slow because it has to stat(2) each inode (i.e. 1 million stat(2)s), and since inodes are distributed randomly on the disk, each stat(2) needs one disk seek. Here are some solutions I had in mind, none of which I am satisfied with: Create the filesystem on an SSD, because the seek operations on SSDs are fast. This wouldn't work, because a 2TB SSD doesn't exist, or it's prohibitively expensive. Create a filesystem which spans on two block devices: an SSD and a disk; the disk contains file data, and the SSD contains all the metadata (including directory entries, inodes and POSIX extended attributes). Is there a filesystem which supports this? Would it survive a system crash (power outage)? Use find /media/myfs on ext2, ext3 or ext4, instead of ls -laR /media/myfs, because the former can the advantage of the d_type field (see in the getdents(2) man page), so it doesn't have to stat. Unfortunately, this doesn't meet my requirements, because I need all file sizes as well, which find /media/myfs doesn't print. Use a filesystem, such as VFAT, which stores inodes in the directory entries. I'd love this one, but VFAT is not reliable and flexible enough for me, and I don't know of any other filesystem which does that. Do you? Of course, storing inodes in the directory entries wouldn't work for files with a link count more than 1, but that's not a problem since I have only a few dozen such files in my use case. Adjust some settings in /proc or sysctl so that inodes are locked to system memory forever. This would not speed up the first ls -laR /media/myfs, but it would make all subsequent invocations amazingly fast. How can I do this? I don't like this idea, because it doesn't speed up the first invocation, which currently takes 30 minutes. Also I'd like to lock the POSIX extended attributes in memory as well. What do I have to do for that? Use a filesystem which has an online defragmentation tool, which can be instructed to relocate inodes to the the beginning of the block device. Once the relocation is done, I can run dd if=/dev/sdb of=/dev/null bs=1M count=256 to get the beginning of the block device fetched to the kernel in-memory cache without seeking, and then the stat(2) operations would be fast, because they read from the cache. Is there a way to lock those inodes and/or blocks into memory once they have been read? Which filesystem has such a defragmentation tool?

    Read the article

  • Wubi and Vista 64 bits can't work

    - by Daok
    First of all, I have posted this issue at Ubuntu Forum without success yet. Hello, I have downloaded "kubuntu-9.10-desktop-amd64.iso" and I have mounted it on my Windows Vista 64 bits Ultimate. I have downloaded wubi 9.10. The problem is when installing, it crash after few time. Here is the log file: 11-26 21:07 INFO root: === wubi 9.10ubuntu1 rev160 === 11-26 21:07 DEBUG root: Logfile is c:\users\patrick\appdata\local\temp\wubi-9.10ubuntu1-rev160.log 11-26 21:07 DEBUG root: sys.argv = ['main.pyo', '--exefile="Z:\\wubi.exe"'] 11-26 21:07 DEBUG CommonBackend: data_dir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\data 11-26 21:07 DEBUG WindowsBackend: 7z=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\bin\7z.exe 11-26 21:07 DEBUG CommonBackend: Fetching basic info... 11-26 21:07 DEBUG CommonBackend: original_exe=Z:\wubi.exe 11-26 21:07 DEBUG CommonBackend: platform=win32 11-26 21:07 DEBUG CommonBackend: osname=nt 11-26 21:07 DEBUG CommonBackend: language=fr_CA 11-26 21:07 DEBUG CommonBackend: encoding=cp1252 11-26 21:07 DEBUG WindowsBackend: arch=amd64 11-26 21:07 DEBUG CommonBackend: Parsing isolist=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\data\isolist.ini 11-26 21:07 DEBUG CommonBackend: Adding distro Xubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Xubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Kubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Mythbuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Ubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Ubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Mythbuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Kubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro KubuntuNetbook-i386 11-26 21:07 DEBUG CommonBackend: Adding distro UbuntuNetbookRemix-i386 11-26 21:07 DEBUG WindowsBackend: Fetching host info... 11-26 21:07 DEBUG WindowsBackend: registry_key=Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi 11-26 21:07 DEBUG WindowsBackend: windows version=vista 11-26 21:07 DEBUG WindowsBackend: windows_version2=Windows (TM) Vista Ultimate 11-26 21:07 DEBUG WindowsBackend: windows_sp=None 11-26 21:07 DEBUG WindowsBackend: windows_build=6002 11-26 21:07 DEBUG WindowsBackend: gmt=-5 11-26 21:07 DEBUG WindowsBackend: country=CA 11-26 21:07 DEBUG WindowsBackend: timezone=America/Montreal 11-26 21:07 DEBUG WindowsBackend: windows_username=Patrick 11-26 21:07 DEBUG WindowsBackend: user_full_name=Patrick 11-26 21:07 DEBUG WindowsBackend: user_directory=C:\Users\Patrick 11-26 21:07 DEBUG WindowsBackend: windows_language_code=1036 11-26 21:07 DEBUG WindowsBackend: windows_language=French 11-26 21:07 DEBUG WindowsBackend: processor_name=Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz 11-26 21:07 DEBUG WindowsBackend: bootloader=vista 11-26 21:07 DEBUG WindowsBackend: system_drive=Drive(C: hd 239816.335938 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(C: hd 239816.335938 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(D: cd 0.0 mb free ) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(E: hd 483619.367188 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(G: hd 84606.9375 mb free fat32) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(Z: cd 0.0 mb free cdfs) 11-26 21:07 DEBUG WindowsBackend: uninstaller_path=C:\ubuntu\uninstall-wubi.exe 11-26 21:07 DEBUG WindowsBackend: previous_target_dir=C:\ubuntu 11-26 21:07 DEBUG WindowsBackend: previous_distro_name=Kubuntu 11-26 21:07 DEBUG WindowsBackend: keyboard_id=269029385 11-26 21:07 DEBUG WindowsBackend: keyboard_layout=ca 11-26 21:07 DEBUG WindowsBackend: keyboard_variant= 11-26 21:07 DEBUG CommonBackend: python locale=('fr_CA', 'cp1252') 11-26 21:07 DEBUG CommonBackend: locale=fr_CA.UTF-8 11-26 21:07 DEBUG WindowsBackend: total_memory_mb=4095.99999905 11-26 21:07 DEBUG CommonBackend: Searching ISOs on USB devices 11-26 21:07 DEBUG CommonBackend: Searching for local CDs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: parsing info from str=Kubuntu 9.10 "Karmic Koala" - Release amd64 (20091027) 11-26 21:07 DEBUG Distro: parsed info={'name': 'Kubuntu', 'subversion': 'Release', 'version': '9.10', 'build': '20091027', 'codename': 'Karmic Koala', 'arch': 'amd64'} 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu Netbook Remix 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Kubuntu CD 11-26 21:07 INFO Distro: Found a valid CD for Kubuntu: Z:\ 11-26 21:07 INFO root: Running the CD menu... 11-26 21:07 DEBUG WindowsFrontend: __init__... 11-26 21:07 DEBUG WindowsFrontend: on_init... 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 INFO root: CD menu finished 11-26 21:07 INFO root: Already installed, running the uninstaller... 11-26 21:07 INFO root: Running the uninstaller... 11-26 21:07 INFO CommonBackend: This is the uninstaller running 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 INFO root: Received settings 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 DEBUG TaskList: # Running tasklist... 11-26 21:07 DEBUG TaskList: ## Running Sauvegarder l'ISO... 11-26 21:07 DEBUG TaskList: ## Finished Sauvegarder l'ISO 11-26 21:07 DEBUG TaskList: ## Running Supprimer l'entrée pour le programme d'amorçage... 11-26 21:07 DEBUG WindowsBackend: Could not find bcd id 11-26 21:07 DEBUG WindowsBackend: undo_bootini C: 11-26 21:07 DEBUG WindowsBackend: undo_configsys Drive(C: hd 239816.335938 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: undo_bootini E: 11-26 21:07 DEBUG WindowsBackend: undo_configsys Drive(E: hd 483619.367188 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: undo_bootini G: 11-26 21:07 DEBUG WindowsBackend: undo_configsys Drive(G: hd 84606.9375 mb free fat32) 11-26 21:07 DEBUG TaskList: ## Finished Supprimer l'entrée pour le programme d'amorçage 11-26 21:07 DEBUG TaskList: ## Running Supprimer le répertoire cible... 11-26 21:07 DEBUG CommonBackend: Deleting C:\ubuntu 11-26 21:07 DEBUG TaskList: ## Finished Supprimer le répertoire cible 11-26 21:07 DEBUG TaskList: ## Running Supprimer la clé du registre... 11-26 21:07 DEBUG TaskList: ## Finished Supprimer la clé du registre 11-26 21:07 DEBUG TaskList: # Finished tasklist 11-26 21:07 INFO root: Almost finished uninstalling 11-26 21:07 INFO root: Finished uninstallation 11-26 21:07 DEBUG CommonBackend: Fetching basic info... 11-26 21:07 DEBUG CommonBackend: original_exe=Z:\wubi.exe 11-26 21:07 DEBUG CommonBackend: platform=win32 11-26 21:07 DEBUG CommonBackend: osname=nt 11-26 21:07 DEBUG WindowsBackend: arch=amd64 11-26 21:07 DEBUG CommonBackend: Parsing isolist=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\data\isolist.ini 11-26 21:07 DEBUG CommonBackend: Adding distro Xubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Xubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Kubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Mythbuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Ubuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Ubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro Mythbuntu-amd64 11-26 21:07 DEBUG CommonBackend: Adding distro Kubuntu-i386 11-26 21:07 DEBUG CommonBackend: Adding distro KubuntuNetbook-i386 11-26 21:07 DEBUG CommonBackend: Adding distro UbuntuNetbookRemix-i386 11-26 21:07 DEBUG WindowsBackend: Fetching host info... 11-26 21:07 DEBUG WindowsBackend: registry_key=Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi 11-26 21:07 DEBUG WindowsBackend: windows version=vista 11-26 21:07 DEBUG WindowsBackend: windows_version2=Windows (TM) Vista Ultimate 11-26 21:07 DEBUG WindowsBackend: windows_sp=None 11-26 21:07 DEBUG WindowsBackend: windows_build=6002 11-26 21:07 DEBUG WindowsBackend: gmt=-5 11-26 21:07 DEBUG WindowsBackend: country=CA 11-26 21:07 DEBUG WindowsBackend: timezone=America/Montreal 11-26 21:07 DEBUG WindowsBackend: windows_username=Patrick 11-26 21:07 DEBUG WindowsBackend: user_full_name=Patrick 11-26 21:07 DEBUG WindowsBackend: user_directory=C:\Users\Patrick 11-26 21:07 DEBUG WindowsBackend: windows_language_code=1036 11-26 21:07 DEBUG WindowsBackend: windows_language=French 11-26 21:07 DEBUG WindowsBackend: processor_name=Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz 11-26 21:07 DEBUG WindowsBackend: bootloader=vista 11-26 21:07 DEBUG WindowsBackend: system_drive=Drive(C: hd 240512.851563 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(C: hd 240512.851563 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(D: cd 0.0 mb free ) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(E: hd 483523.867188 mb free ntfs) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(G: hd 84445.65625 mb free fat32) 11-26 21:07 DEBUG WindowsBackend: drive=Drive(Z: cd 0.0 mb free cdfs) 11-26 21:07 DEBUG WindowsBackend: uninstaller_path=None 11-26 21:07 DEBUG WindowsBackend: previous_target_dir=None 11-26 21:07 DEBUG WindowsBackend: previous_distro_name=None 11-26 21:07 DEBUG WindowsBackend: keyboard_id=269029385 11-26 21:07 DEBUG WindowsBackend: keyboard_layout=ca 11-26 21:07 DEBUG WindowsBackend: keyboard_variant= 11-26 21:07 DEBUG WindowsBackend: total_memory_mb=4095.99999905 11-26 21:07 DEBUG CommonBackend: Searching ISOs on USB devices 11-26 21:07 DEBUG CommonBackend: Searching for local CDs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether D:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain D:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether E:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain E:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Kubuntu Netbook CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Xubuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether G:\ is a valid Mythbuntu CD 11-26 21:07 DEBUG Distro: does not contain G:\casper\filesystem.squashfs 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu CD 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Ubuntu Netbook Remix CD 11-26 21:07 DEBUG Distro: wrong name: Kubuntu != Ubuntu Netbook Remix 11-26 21:07 DEBUG Distro: checking whether Z:\ is a valid Kubuntu CD 11-26 21:07 INFO Distro: Found a valid CD for Kubuntu: Z:\ 11-26 21:07 INFO root: Running the installer... 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['fr_CA', 'fr'] 11-26 21:07 DEBUG WinuiInstallationPage: target_drive=C:, installation_size=17000MB, distro_name=Kubuntu, language=en_US, locale=en_US.UTF-8, username=patrick 11-26 21:07 INFO root: Received settings 11-26 21:07 INFO WinuiPage: appname=wubi, localedir=C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\translations, languages=['en_US', 'en'] 11-26 21:07 DEBUG TaskList: # Running tasklist... 11-26 21:07 DEBUG TaskList: ## Running select_target_dir... 11-26 21:07 INFO WindowsBackend: Installing into C:\ubuntu 11-26 21:07 DEBUG TaskList: ## Finished select_target_dir 11-26 21:07 DEBUG TaskList: ## Running create_dir_structure... 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\disks 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\install 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\install\boot 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\disks\boot 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\disks\boot\grub 11-26 21:07 DEBUG CommonBackend: Creating dir C:\ubuntu\install\boot\grub 11-26 21:07 DEBUG TaskList: ## Finished create_dir_structure 11-26 21:07 DEBUG TaskList: ## Running uncompress_target_dir... 11-26 21:07 DEBUG TaskList: ## Finished uncompress_target_dir 11-26 21:07 DEBUG TaskList: ## Running create_uninstaller... 11-26 21:07 DEBUG WindowsBackend: Copying uninstaller Z:\wubi.exe -> C:\ubuntu\uninstall-wubi.exe 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi UninstallString C:\ubuntu\uninstall-wubi.exe 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi InstallationDir C:\ubuntu 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi DisplayName Kubuntu 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi DisplayIcon C:\ubuntu\Kubuntu.ico 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi DisplayVersion 9.10ubuntu1-rev160 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi Publisher Kubuntu 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi URLInfoAbout http://www.kubuntu.org 11-26 21:07 DEBUG registry: Setting registry key -2147483646 Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi HelpLink http://www.ubuntu.com/support 11-26 21:07 DEBUG TaskList: ## Finished create_uninstaller 11-26 21:07 DEBUG TaskList: ## Running copy_installation_files... 11-26 21:07 DEBUG WindowsBackend: Copying C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\data\custom-installation -> C:\ubuntu\install\custom-installation 11-26 21:07 DEBUG WindowsBackend: Copying C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\winboot -> C:\ubuntu\winboot 11-26 21:07 DEBUG WindowsBackend: Copying C:\Users\Patrick\AppData\Local\Temp\pyl5A09.tmp\data\images\Kubuntu.ico -> C:\ubuntu\Kubuntu.ico 11-26 21:07 DEBUG TaskList: ## Finished copy_installation_files 11-26 21:07 DEBUG TaskList: ## Running get_iso... 11-26 21:07 DEBUG TaskList: New task copy_file 11-26 21:07 DEBUG TaskList: ### Running copy_file... 11-26 21:09 DEBUG TaskList: ### Finished copy_file 11-26 21:09 ERROR TaskList: [Errno 22] Invalid argument Traceback (most recent call last): File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__ File "\lib\wubi\backends\common\utils.py", line 209, in copy_file IOError: [Errno 22] Invalid argument 11-26 21:09 DEBUG TaskList: # Cancelling tasklist 11-26 21:09 DEBUG TaskList: New task check_iso 11-26 21:09 ERROR root: [Errno 22]

    Read the article

  • HTML5 Form Validation

    - by Stephen.Walther
    The latest versions of Google Chrome (16+), Mozilla Firefox (8+), and Internet Explorer (10+) all support HTML5 client-side validation. It is time to take HTML5 validation seriously. The purpose of the blog post is to describe how you can take advantage of HTML5 client-side validation regardless of the type of application that you are building. You learn how to use the HTML5 validation attributes, how to perform custom validation using the JavaScript validation constraint API, and how to simulate HTML5 validation on older browsers by taking advantage of a jQuery plugin. Finally, we discuss the security issues related to using client-side validation. Using Client-Side Validation Attributes The HTML5 specification discusses several attributes which you can use with INPUT elements to perform client-side validation including the required, pattern, min, max, step, and maxlength attributes. For example, you use the required attribute to require a user to enter a value for an INPUT element. The following form demonstrates how you can make the firstName and lastName form fields required: <!DOCTYPE html> <html > <head> <title>Required Demo</title> </head> <body> <form> <label> First Name: <input required title="First Name is Required!" /> </label> <label> Last Name: <input required title="Last Name is Required!" /> </label> <button>Register</button> </form> </body> </html> If you attempt to submit this form without entering a value for firstName or lastName then you get the validation error message: Notice that the value of the title attribute is used to display the validation error message “First Name is Required!”. The title attribute does not work this way with the current version of Firefox. If you want to display a custom validation error message with Firefox then you need to include an x-moz-errormessage attribute like this: <input required title="First Name is Required!" x-moz-errormessage="First Name is Required!" /> The pattern attribute enables you to validate the value of an INPUT element against a regular expression. For example, the following form includes a social security number field which includes a pattern attribute: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Pattern</title> </head> <body> <form> <label> Social Security Number: <input required pattern="^d{3}-d{2}-d{4}$" title="###-##-####" /> </label> <button>Register</button> </form> </body> </html> The regular expression in the form above requires the social security number to match the pattern ###-##-####: Notice that the input field includes both a pattern and a required validation attribute. If you don’t enter a value then the regular expression is never triggered. You need to include the required attribute to force a user to enter a value and cause the value to be validated against the regular expression. Custom Validation You can take advantage of the HTML5 constraint validation API to perform custom validation. You can perform any custom validation that you need. The only requirement is that you write a JavaScript function. For example, when booking a hotel room, you might want to validate that the Arrival Date is in the future instead of the past: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Constraint Validation API</title> </head> <body> <form> <label> Arrival Date: <input id="arrivalDate" type="date" required /> </label> <button>Submit Reservation</button> </form> <script type="text/javascript"> var arrivalDate = document.getElementById("arrivalDate"); arrivalDate.addEventListener("input", function() { var value = new Date(arrivalDate.value); if (value < new Date()) { arrivalDate.setCustomValidity("Arrival date must be after now!"); } else { arrivalDate.setCustomValidity(""); } }); </script> </body> </html> The form above contains an input field named arrivalDate. Entering a value into the arrivalDate field triggers the input event. The JavaScript code adds an event listener for the input event and checks whether the date entered is greater than the current date. If validation fails then the validation error message “Arrival date must be after now!” is assigned to the arrivalDate input field by calling the setCustomValidity() method of the validation constraint API. Otherwise, the validation error message is cleared by calling setCustomValidity() with an empty string. HTML5 Validation and Older Browsers But what about older browsers? For example, what about Apple Safari and versions of Microsoft Internet Explorer older than Internet Explorer 10? What the world really needs is a jQuery plugin which provides backwards compatibility for the HTML5 validation attributes. If a browser supports the HTML5 validation attributes then the plugin would do nothing. Otherwise, the plugin would add support for the attributes. Unfortunately, as far as I know, this plugin does not exist. I have not been able to find any plugin which supports both the required and pattern attributes for older browsers, but does not get in the way of these attributes in the case of newer browsers. There are several jQuery plugins which provide partial support for the HTML5 validation attributes including: · jQuery Validation — http://docs.jquery.com/Plugins/Validation · html5Form — http://www.matiasmancini.com.ar/jquery-plugin-ajax-form-validation-html5.html · h5Validate — http://ericleads.com/h5validate/ The jQuery Validation plugin – the most popular JavaScript validation library – supports the HTML5 required attribute, but it does not support the HTML5 pattern attribute. Likewise, the html5Form plugin does not support the pattern attribute. The h5Validate plugin provides the best support for the HTML5 validation attributes. The following page illustrates how this plugin supports both the required and pattern attributes: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>h5Validate</title> <style type="text/css"> .validationError { border: solid 2px red; } .validationValid { border: solid 2px green; } </style> </head> <body> <form id="customerForm"> <label> First Name: <input id="firstName" required /> </label> <label> Social Security Number: <input id="ssn" required pattern="^d{3}-d{2}-d{4}$" title="Expected pattern is ###-##-####" /> </label> <input type="submit" /> </form> <script type="text/javascript" src="Scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="Scripts/jquery.h5validate.js"></script> <script type="text/javascript"> // Enable h5Validate plugin $("#customerForm").h5Validate({ errorClass: "validationError", validClass: "validationValid" }); // Prevent form submission when errors $("#customerForm").submit(function (evt) { if ($("#customerForm").h5Validate("allValid") === false) { evt.preventDefault(); } }); </script> </body> </html> When an input field fails validation, the validationError CSS class is applied to the field and the field appears with a red border. When an input field passes validation, the validationValid CSS class is applied to the field and the field appears with a green border. From the perspective of HTML5 validation, the h5Validate plugin is the best of the plugins. It adds support for the required and pattern attributes to browsers which do not natively support these attributes such as IE9. However, this plugin does not include everything in my wish list for a perfect HTML5 validation plugin. Here’s my wish list for the perfect back compat HTML5 validation plugin: 1. The plugin would disable itself when used with a browser which natively supports HTML5 validation attributes. The plugin should not be too greedy – it should not handle validation when a browser could do the work itself. 2. The plugin should simulate the same user interface for displaying validation error messages as the user interface displayed by browsers which natively support HTML5 validation. Chrome, Firefox, and Internet Explorer all display validation errors in a popup. The perfect plugin would also display a popup. 3. Finally, the plugin would add support for the setCustomValidity() method and the other methods of the HTML5 validation constraint API. That way, you could implement custom validation in a standards compatible way and you would know that it worked across all browsers both old and new. Security It would be irresponsible of me to end this blog post without mentioning the issue of security. It is important to remember that any client-side validation — including HTML5 validation — can be bypassed. You should use client-side validation with the intention to create a better user experience. Client validation is great for providing a user with immediate feedback when the user is in the process of completing a form. However, client-side validation cannot prevent an evil hacker from submitting unexpected form data to your web server. You should always enforce your validation rules on the server. The only way to ensure that a required field has a value is to verify that the required field has a value on the server. The HTML5 required attribute does not guarantee anything. Summary The goal of this blog post was to describe the support for validation contained in the HTML5 standard. You learned how to use both the required and the pattern attributes in an HTML5 form. We also discussed how you can implement custom validation by taking advantage of the setCustomValidity() method. Finally, I discussed the available jQuery plugins for adding support for the HTM5 validation attributes to older browsers. Unfortunately, I am unaware of any jQuery plugin which provides a perfect solution to the problem of backwards compatibility.

    Read the article

  • HTML5 Form Validation

    - by Stephen.Walther
    The latest versions of Google Chrome (16+), Mozilla Firefox (8+), and Internet Explorer (10+) all support HTML5 client-side validation. It is time to take HTML5 validation seriously. The purpose of the blog post is to describe how you can take advantage of HTML5 client-side validation regardless of the type of application that you are building. You learn how to use the HTML5 validation attributes, how to perform custom validation using the JavaScript validation constraint API, and how to simulate HTML5 validation on older browsers by taking advantage of a jQuery plugin. Finally, we discuss the security issues related to using client-side validation. Using Client-Side Validation Attributes The HTML5 specification discusses several attributes which you can use with INPUT elements to perform client-side validation including the required, pattern, min, max, step, and maxlength attributes. For example, you use the required attribute to require a user to enter a value for an INPUT element. The following form demonstrates how you can make the firstName and lastName form fields required: <!DOCTYPE html> <html > <head> <title>Required Demo</title> </head> <body> <form> <label> First Name: <input required title="First Name is Required!" /> </label> <label> Last Name: <input required title="Last Name is Required!" /> </label> <button>Register</button> </form> </body> </html> If you attempt to submit this form without entering a value for firstName or lastName then you get the validation error message: Notice that the value of the title attribute is used to display the validation error message “First Name is Required!”. The title attribute does not work this way with the current version of Firefox. If you want to display a custom validation error message with Firefox then you need to include an x-moz-errormessage attribute like this: <input required title="First Name is Required!" x-moz-errormessage="First Name is Required!" /> The pattern attribute enables you to validate the value of an INPUT element against a regular expression. For example, the following form includes a social security number field which includes a pattern attribute: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Pattern</title> </head> <body> <form> <label> Social Security Number: <input required pattern="^\d{3}-\d{2}-\d{4}$" title="###-##-####" /> </label> <button>Register</button> </form> </body> </html> The regular expression in the form above requires the social security number to match the pattern ###-##-####: Notice that the input field includes both a pattern and a required validation attribute. If you don’t enter a value then the regular expression is never triggered. You need to include the required attribute to force a user to enter a value and cause the value to be validated against the regular expression. Custom Validation You can take advantage of the HTML5 constraint validation API to perform custom validation. You can perform any custom validation that you need. The only requirement is that you write a JavaScript function. For example, when booking a hotel room, you might want to validate that the Arrival Date is in the future instead of the past: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Constraint Validation API</title> </head> <body> <form> <label> Arrival Date: <input id="arrivalDate" type="date" required /> </label> <button>Submit Reservation</button> </form> <script type="text/javascript"> var arrivalDate = document.getElementById("arrivalDate"); arrivalDate.addEventListener("input", function() { var value = new Date(arrivalDate.value); if (value < new Date()) { arrivalDate.setCustomValidity("Arrival date must be after now!"); } else { arrivalDate.setCustomValidity(""); } }); </script> </body> </html> The form above contains an input field named arrivalDate. Entering a value into the arrivalDate field triggers the input event. The JavaScript code adds an event listener for the input event and checks whether the date entered is greater than the current date. If validation fails then the validation error message “Arrival date must be after now!” is assigned to the arrivalDate input field by calling the setCustomValidity() method of the validation constraint API. Otherwise, the validation error message is cleared by calling setCustomValidity() with an empty string. HTML5 Validation and Older Browsers But what about older browsers? For example, what about Apple Safari and versions of Microsoft Internet Explorer older than Internet Explorer 10? What the world really needs is a jQuery plugin which provides backwards compatibility for the HTML5 validation attributes. If a browser supports the HTML5 validation attributes then the plugin would do nothing. Otherwise, the plugin would add support for the attributes. Unfortunately, as far as I know, this plugin does not exist. I have not been able to find any plugin which supports both the required and pattern attributes for older browsers, but does not get in the way of these attributes in the case of newer browsers. There are several jQuery plugins which provide partial support for the HTML5 validation attributes including: · jQuery Validation — http://docs.jquery.com/Plugins/Validation · html5Form — http://www.matiasmancini.com.ar/jquery-plugin-ajax-form-validation-html5.html · h5Validate — http://ericleads.com/h5validate/ The jQuery Validation plugin – the most popular JavaScript validation library – supports the HTML5 required attribute, but it does not support the HTML5 pattern attribute. Likewise, the html5Form plugin does not support the pattern attribute. The h5Validate plugin provides the best support for the HTML5 validation attributes. The following page illustrates how this plugin supports both the required and pattern attributes: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>h5Validate</title> <style type="text/css"> .validationError { border: solid 2px red; } .validationValid { border: solid 2px green; } </style> </head> <body> <form id="customerForm"> <label> First Name: <input id="firstName" required /> </label> <label> Social Security Number: <input id="ssn" required pattern="^\d{3}-\d{2}-\d{4}$" title="Expected pattern is ###-##-####" /> </label> <input type="submit" /> </form> <script type="text/javascript" src="Scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="Scripts/jquery.h5validate.js"></script> <script type="text/javascript"> // Enable h5Validate plugin $("#customerForm").h5Validate({ errorClass: "validationError", validClass: "validationValid" }); // Prevent form submission when errors $("#customerForm").submit(function (evt) { if ($("#customerForm").h5Validate("allValid") === false) { evt.preventDefault(); } }); </script> </body> </html> When an input field fails validation, the validationError CSS class is applied to the field and the field appears with a red border. When an input field passes validation, the validationValid CSS class is applied to the field and the field appears with a green border. From the perspective of HTML5 validation, the h5Validate plugin is the best of the plugins. It adds support for the required and pattern attributes to browsers which do not natively support these attributes such as IE9. However, this plugin does not include everything in my wish list for a perfect HTML5 validation plugin. Here’s my wish list for the perfect back compat HTML5 validation plugin: 1. The plugin would disable itself when used with a browser which natively supports HTML5 validation attributes. The plugin should not be too greedy – it should not handle validation when a browser could do the work itself. 2. The plugin should simulate the same user interface for displaying validation error messages as the user interface displayed by browsers which natively support HTML5 validation. Chrome, Firefox, and Internet Explorer all display validation errors in a popup. The perfect plugin would also display a popup. 3. Finally, the plugin would add support for the setCustomValidity() method and the other methods of the HTML5 validation constraint API. That way, you could implement custom validation in a standards compatible way and you would know that it worked across all browsers both old and new. Security It would be irresponsible of me to end this blog post without mentioning the issue of security. It is important to remember that any client-side validation — including HTML5 validation — can be bypassed. You should use client-side validation with the intention to create a better user experience. Client validation is great for providing a user with immediate feedback when the user is in the process of completing a form. However, client-side validation cannot prevent an evil hacker from submitting unexpected form data to your web server. You should always enforce your validation rules on the server. The only way to ensure that a required field has a value is to verify that the required field has a value on the server. The HTML5 required attribute does not guarantee anything. Summary The goal of this blog post was to describe the support for validation contained in the HTML5 standard. You learned how to use both the required and the pattern attributes in an HTML5 form. We also discussed how you can implement custom validation by taking advantage of the setCustomValidity() method. Finally, I discussed the available jQuery plugins for adding support for the HTM5 validation attributes to older browsers. Unfortunately, I am unaware of any jQuery plugin which provides a perfect solution to the problem of backwards compatibility.

    Read the article

  • HTML5 Input type=date Formatting Issues

    - by Rick Strahl
    One of the nice features in HTML5 is the abililty to specify a specific input type for HTML text input boxes. There a host of very useful input types available including email, number, date, datetime, month, number, range, search, tel, time, url and week. For a more complete list you can check out the MDN reference. Date input types also support automatic validation which can be useful in some scenarios but maybe can get in the way at other times. One of the more common input types, and one that can most benefit of a custom UI for selection is of course date input. Almost every application could use a decent date representation and HTML5's date input type seems to push into the right direction. It'd be nice if you could just say:<form action="DateTest.html"> <label for="FromDate">Enter a Date:</label> <input type="date" id="FromDate" name="FromDate" value="11/08/2012" class="date" /> <hr /> <input type="submit" id="btnSubmit" name="btnSubmit" value="Save Date" class="smallbutton" /> </form> but if you'd expect to just work, you're likely to be pretty disappointed. Problem #1: Browser Support For starters there's browser support. Out of the major browsers only the latest versions of WebKit and Opera based browsers seem to support date input. Neither FireFox, nor any version of Internet Explorer (including the new touch enabled IE10 in Windows RT) support input type=date. Browser support is an issue, but it would be OK if it wasn't for problem #2. Problem #2: Date Formatting If you look at my date input from before:<input type="date" id="FromDate" name="FromDate" value="11/08/2012" class="date" /> You can see that my date is formatted in local date format (ie. en-us). Now when I run this sadly the form that comes up in Chrome (and also iOS mobile browsers) comes up like this: Chrome isn't recognizing my local date string. Instead it's expecting my date format to be provided in ISO 8601 format which is: 2012-11-08 So if I change the date input field to:<input type="date" id="FromDate" name="FromDate" value="2012-10-08" class="date" /> I correctly get the date field filled in: Also when I pick a date with the DatePicker the date value is also returned is also set to the ISO date format. Yet notice how the date is still formatted to the local date time format (ie. en-US format). So if I pick a new date: and then save, the value field is set back to: 2012-11-15 using the ISO format. The same is true for Opera and iOS browsers and I suspect any other WebKit style browser and their date pickers. So to summarize input type=date: Expects ISO 8601 format dates to display intial values Sets selected date values to ISO 8601 Now what? This would sort of make sense, if all browsers supported input type=date. It'd be easy because you could just format dates appropriately when you set the date value into the control by applying the appropriate culture formatting (ie. .ToString("yyyy-MM-dd") ). .NET is actually smart enough to pick up the date on the other end for modelbinding when ISO 8601 is used. For other environments this might be a bit more tricky. input type=date is clearly the way to go forward. Date controls implemented in HTML are going the way of the dodo, given the intricacies of mobile platforms and scaling for both desktop and mobile. I've been using jQuery UI Datepicker for ages but once going to mobile, that's no longer an option as the control doesn't scale down well for mobile apps (at least not without major re-styling). It also makes a lot of sense for the browser to provide this functionality - creating a consistent date input experience across apps only makes sense, which is why I find it baffling that neither FireFox nor IE 10 deign it necessary to support date input natively. The problem is that a large number of even the latest and greatest browsers don't support this. So now you're stuck with not knowing what date format you have to serve since neither the local format, nor the ISO format works in all cases. For my current app I just broke down and used the ISO format and so I'll live with the non-local date format. <input type="date" id="ToDate" name="ToDate" value="2012-11-08" class="date"/> Here's what this looks like on Chrome: Here's what it looks like on my iPhone: Both Chrome and the phone do this the way it should be. For the phone especially this demonstrates why we'd want this - the built-in date picker there certainly beats manually trying to edit the date using finger gymnastics, and it's one of the easiest ways to pick a date I can think of (ie. easier to use than your typical date picker). Finally here's what the date looks like in FireFox: Certainly this is not the ideal date format, but it's clear enough I suppose. If users enter a date in local US format and that works as well (but won't work for other locales). It'll have to do. Over time one can only hope that other browsers will finally decide to implement this functionality natively to provide a unique experience. Until then, incomplete solutions it is. Related Posts Html 5 Input Types - How useful is this really going to be?© Rick Strahl, West Wind Technologies, 2005-2012Posted in HTML5  HTML   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Adding interactive graphical elements to text-based browser game with HTML5

    - by st9
    I'm re-writing an old virtual world/browser based game. It is text and HTML form based with some static graphics. The client is HTML and JS. I want to introduce some interactive graphical elements to certain parts of the game, for example a 'customise character' page, with hooks to server side and local data storage. I want to use HTML5/JS, what is the best approach to designing the web-site? For example could I use Boilerplate and then embed these interactive elements in the page? Thanks

    Read the article

  • HTML5 Canvas Game Timer

    - by zghyh
    How to create good timer for HTML5 Canvas games? I am using RequestAnimationFrame( http://paulirish.com/2011/requestanimationframe-for-smart-animating/ ) But object's move too fast. Something like my code is: http://pastebin.com/bSHCTMmq But if I press UP_ARROW player don't move one pixel, but move 5, 8, or 10 or more or less pixels. How to do if I press UP_ARROW player move 1 pixel? Thanks for help.

    Read the article

  • Making a startscreen for an HTML5 game?

    - by hustlerinc
    How would I make a start screen for a game using HTML5 canvas? I'm not looking for something advanced, just the new game button and highscore link etc. The question might be stupid, but I've never done anything similar, and the tutorials out there don't cover the subject. Is it enough to just make a fillText with an onclick function? Is there a way to find out the size of the text? Help appreciated.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >