Feb
26

pycharm for django and sass

For django:

professional version.

  1. create a new django project: just create a new one
  2. import a django project:
    1. import the project
    2. activate django support

For Sass:

https://www.jetbrains.com/help/pycharm/2016.3/transpiling-sass-less-and-scss-to-css.html

  1. make sure, the sass support is activate: File -> Setting -> Plugin
  2. install node.js: File -> Setting -> Plugin -> install jetbrain plugin
  3. install ruby: during the installation, don’t forget check the option “set path to default”
  4. open teminal to install sass: “gem install sass”
  5. create a file watcher: File -> setting ->tools -> file watcher -> add -> sass
  6. transpiling the code
Jan
04

HTML5 Audio and Video Tags

for Audio

<audio controls>
    <source src="http://www.codehamster.com/dongdong/fragrance_of_flowers.mp3" type="audio/mp3">
</audio>

for Video

<video controls> 
    <source src="http://www.codehamster.com/dongdong/Neujahr2014.mp4" type="video/mp4">
</video>

You can directly see and the try the cods with JS Bin

Audio and Video Tags for HTML5

Dec
31

IE 10 still doesn’t support “onchange” event in HTML5!

HTML5 has a lot of nice feature, but the cross browser support is still not so ideally.

Just like:

If you want to disable the fields in a “fieldset” and dynamically enable them when some condition is met, the best way is to use a radio button or a checkbox.

You can add a “disabled” attribute on the nested fieldset elements, and use “onchange” event on the radio button or checkbox to controll the “disabled” attribute.

But it still doesn’t work in IE 10!!!

The following code works under chrome and firefox perfectly but not IE:

<form>
    <fieldset>
        <legend>Store Credit Card</legend>
        <p><label>Name displayed on your card:<input name="fullName"
            required></label></p>
        <fieldset name="accountNum" disabled>
            <legend>
                <label>
                    <input type="radio" name="accountType"
                           onchange="form.accountNum.disabled = !checked;
                           form.accountLetters.disabled=checked">My account is a
                           12-digit number
                </label>
            </legend>
            <p><label>Store card number: <input name="cardNum"
                required></label></p>
        </fieldset>
        <fieldset name="accountLetters" disabled>
            <legend>
                <label>
                    <input type="radio" name="accountType"
                           onchange="form.accountLetters.disabled = !checked;
                           form.accountNum.disabled=checked">My account includes
                           letters and numbers
                </label>
            </legend>
            <p><label>Store card code: <input name="cardLetters"></label></p>
        </fieldset>
    </fieldset>
</form>