JavaScript is OFF/ON

JavaScript is OFF/ON

JavaScript is OFF/ON | Flickr

JavaScript is OFF/ON.
posted by samuelcotterall.

Because I (usually) practice unobtrusive JavaScript and have a terrible memory. The description, as entered by the person who uploaded it.

28618044@N07 The ID of the content owner – you can use this to link to their buddy icon. like so samuelcotterall

jalbertbowdenii Your Flickr screen name.

26127430@N04 Your ID – you can use this to link to your buddy icon.

jalbertbowdenii Your Flickr screen name.

http://www.flickr.com/people/jalbertbowdenii/ URL for your profile.

JavaScript is OFF/ON The title you entered for a blog entry. This title is automatically used to title your entry – you should only use this for image alt-text, etc.

Demo Text

Via Flickr….Demo Text Opt-in test:
Because I (usually) practice unobtrusive JavaScript and have a terrible memory. The description you entered for a blog entry.

Demo Text

Via Flickr….Demo Text Opt-in test:
Because I (usually) practice unobtrusive JavaScript and have a terrible memory. The description you entered for a blog entry, with line breaks converted to <br /&@62; tags.

MobiGates with unique mobile phone

MobiGates with unique mobile phone | Flickr

MobiGates with unique mobile phone

posted by MobiGates

My new mobile phone builds upon one of the most celebrated designs of the past decade by blending slender form with super-dooper phone design principles in an elegant retro shape. Measuring a mere 50mm thin x 400mm long and weighing only 1kg, my new mobile phone slips easily into a rucksack. The description, as entered by the person who uploaded it.

88192075@N00 The ID of the content owner – you can use this to link to their buddy icon. like so MobiGates

jalbertbowdenii Your Flickr screen name.

Danzig – ThrallDemonSweatPixelator

Danzig - ThrallDemonSweatPixelator | Flickr

Danzig – ThrallDemonSweatPixelator

posted by jalbertbowdenii

Danzig skull after being put through the The Pixelator, a <canvas> demo that pixelates images, powered by desandro.com/resources/close-pixelate/. The description, as entered by the person who uploaded it.

26127430@N04 The ID of the content owner – you can use this to link to their buddy icon. like so jalbertbowdenii

jalbertbowdenii Your Flickr screen name.

Safari iOS Specs Unobtrusive JavaScript Reminder

Recently I was digging around in the Safari Developer Library when I came across one more reason (as if there weren’t enough) to write Unobtrusive JavaScript. In this case, Safari on iOS (all devices) disables preload="" and autoplay="", in case the user may be in a position where they are on a horrid network and are being charged per data unit. So no data is actually loaded until initated by the user; this also implies that the play() and the load() methods are inactive until user initiated playback, unless the play() or load() method is triggered via user action. So in laymens terms, user-initiated Play buttons work, however the onload="play()" event does not. Safari Developer Library provided the solution below:

The example below does nothing in iOS:


<body onload="document.myMovie.play()">

The example below will play the media in iOS:


<input type="button" value="Play" onclick="document.myMovie.play()">

This works as-is, however the event handler is still mixed in with the markup thus violating the Seven Rules of Unobtrusive JavaScript, specifically number five:

5. Understand Events (Event handling to initiate change)

Event handling is the next step to truly Unobtrusive JavaScript…understand that Event Handling is true separation.

Seven Rules of Unobtrusive JavaScript

So I rewrote the Safari solution using Web Standards and separated behavior (JavaScript) from structure (html) using Unobtrusive JavaScript. I don’t have any video files available for the demo so I swapped audio in its place, as well as added some updated (read: “proper”) markup, but the principle(s) are not lost. The demo is a media control that will play a media file after user-initiated contact with the play button. You can view the demo here or view the code and markup below:


// javascript
window.onload = function() {
// Get the play button and append the audio play method to on click 
  var audio = document.getElementById("audiosrc");
  var play = document.getElementById('play');
  play.addEventListener('click', function(){ 
  audio.play(); }, false); 
}
<!-- html -->
<button type="button" id="play">
  <audio id="audiosrc">
    <source src="http://dev.bowdenweb.com/a/m/a/clipping_link-finds-a-secret-13908.ogg" />
    <source src="http://dev.bowdenweb.com/a/m/a/clipping_link-finds-a-secret-13908.mp3" />
    <source src="http://dev.bowdenweb.com/a/m/a/clipping_link-finds-a-secret-13908.wav" />
  </audio>
</button>

Making Responsive, Accessible, High DPI, CSS Sprites

Applying clip on img‘s via media-queries

I love css Sprites so I was quite dismayed to read about problems with iPhone 4 Retina Display (High dpi) and problems with accessibility, both of which will stop a standardista dead in their tracks. Retina Display is a user-agent feature and as such should at least be used to progressively enhance the ux, not degrade it! User-Agent Features are seen as bothersome and/or afterthoughts in most circles, however they are vital for creating unique browsing experiences for each applicable unique user-agent setting. The accessibility issue is a no-brainer, it must be resolved; Accessibility should be a part of your work-flows and not an afterthought. One thing about the bad accessibility in particular stood out to me:

In conclusion, the only method that is truly accessible and supported by nearly all browsers is to use inline images instead of background CSS images to display non-decorative content. If sprite maps are required then consider using inline positioned sprite maps.

css Background Images and Accessibility

Responsive Design via css media-queries is a principle of progressive enhancement that is a staple of Front-End Engineering and for the most part solves all cross-browser and cross-platform issues. By applying rwd via media-queries, it occured to me that you could use the sprites still, but apply it to inline img‘s via clip property. Then to alter the clip property style settings via media-queries, swapping bigger images for bigger resolutions. It works like a charm, although I’m not sure how accessible they are. You can view the demo here

Or you can jsfiddle with it own your own here.

The style in the demo is shown below:

Style


.abspositioner{position:relative}
.box h2{margin:0}
.box{margin:10px auto; outline:1px solid #000; width:300px}
.spriteclipx{position:absolute; top:0; left:0}
/** width:256px; height:256px; .spriteclipx{clip:rect(0, 256px, 256px, 0)} **/
/** width:128px; height:128px; .spriteclipx{clip:rect(266px, 128px, 394px, 0); top:-266px} **/
/** width:64px; height:64px; .spriteclipx{clip:rect(404px, 192px, 468px, 0); top:-404px} **/
/** width:32px; height:32px; .spriteclipx{clip:rect(478px, 224px, 510px, 0); top:-478px} **/
/** width:24px; height:24px; .spriteclipx{clip:rect(520px, 248px, 544px, 0); top:-520px} **/
/** width:16px; height:16px; .spriteclipx{clip:rect(554px, 256px, 570px, 0); top:-554px} **/
@media only screen  {
  .spriteclipx{clip:rect(0, 256px, 256px, 0)}
}
/** target iPhone portrait display **/
@media screen and (max-width: 320px) {
  .spriteclipx{clip:rect(404px, 192px, 468px, 0); top:-404px}
}

/** target iPhone / iPod Touch with Retina Display **/
@media only screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) { 
  .spriteclipx{clip:rect(266px, 128px, 394px, 0); top:-266px}
}

/** target iPad portrait and landscape **/
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  .spriteclipx{clip:rect(0, 256px, 256px, 0)}
}

Pinned Sites and Jump Lists in IE9

Browser ux - User-Agent Optimization Series ie9 Part One

Pinned Sites in ie9 allow developers to add to the ux of the overall site by providing unique experiences to the user by utilizing ie specific tools like Jump Lists. Developers can use Pinned Sites to make their sites feel more like a native Windows application. Users can add tasks to behavior(s) specific to pinned sites. Pinned Sites are drag and drop, the user simply has to drag the browser tab down to the Windows 7 taskbar.

Jump Lists

Pinned Sites using Jump Lists allow developers to control how a site is accessed by declaring a common entry point via meta name="msapplication-starturl" content="".

Jump List items sit on the taskbar and are doorways to the pinned site even when ie is not running. You can add common destinations and tasks or site-specific/user-specific tasks on the Jump List.

Pinned Sites can only contain one static and one dynamic list at a time.

A task is a site-specific action in a pinned site that can be simple site functionality. Static Tasks are set when the site is pinned, but notificiations and user-specific tasks are set dynamically.

Pinned Site functionality can be accessed via the Pinned Site api. You have two choices, static site properties, which are easily defined in meta elements, and user-specific/dynamic customization which are implemented using the api.

You can use the following meta elements to control your Pinned Site shortcut. Note: these meta elements are only used when the user pins the site, after this occurs they have no value on the pinned site and are thus called, “install-time” values.

Static Tasks are defined using meta Elements

meta Definition

meta name="application-name"

Defines the name of the Pinned Site application instance. It appears in a tooltip when hovering over the pinned site on the Windows 7 taskbar. This is also appended to the window title of the pinned site application instance. If missing, the document title will be used.

meta name="msapplication-tooltip"

Provides additional tooltip data that appears when hovering over pinned site shortcut or on the desktop.

meta name="msapplication-starturl"

Contains the root url of the application. The start url can be fully qualified or relative to the current document. Only http and https are allowed; if missing, the address of the current page is used. Runtime metadata declared in the start page redefines the navigation button color and static Jump List tasks each time the site is launched. Use this to control how users access your site. When combined with Jump List metadata in the start page, you can easiliy control how users select styles they want to use. If your start url redirects to a new path, it must include the path and a trailing slash (/).

meta name="msapplication-window"

Sets initial size of Pinned Site window when launched bby the user. Should the user alter these dimensions, they will be retained when launched again. Minimm window width is 800 pixels and minimum window height is 600 pixels.

Run-time meta

The following meta elements are read each time the user launches the pinned site, and therefore can and should be used to modify the user experience over time.

meta Definition

meta name="msapplication-navbutton-color"

Defines custom color of back/forward buttons of the browser window of the pinned site. All named colors and/or hex colors are valid for use. If missing, default color is taken from the sites favicon color palette.

meta name="msapplication-task"

Define static tasks for use with Jump Lists.

meta name="msapplication-task-separator"

Used to place a visible barrier between tasks in the Jump List menu. Separators must be unique, done so by adding content="unique-value" for more than one value.

meta name="msapplication-task"

When you declare a default task(s) they appear in the jump list under the Tasks category. A task in this case is a site-specific action and they can be static or dynamic. The following are the allowed parameters of the content="" attribute of meta name="msapplication-task".

attribute Definition

meta name="msapplication" content="name="

Defines a string that is the task name that appears in the Jump List.

meta name="msapplication" content="action-uri="

Defines a fully qualified or relative uri, where the browser goes on click.

meta name="msapplication" content="icon-uri="

Defines a fully qualified or relative uri, the icon that shows in the Jump List for the Task.

meta name="msapplication" content="window-type="

Defines how browser handles opening site in Jump List. Can be:

  • tab (default) - a new tab in the current window.
  • self (default) - the current tab.
  • window (default) - a new Pinned Site window.

I created a demo here. Below are screenshots of what pinned sites static properties can do for you.

IE9 Pinned Site Navbutton Color Screenshot

ie9 Pinned Site Navbutton Color meta name="msapplication-navbutton-color"

IE9 Pinned Site Window Size Screenshot

ie9 Pinned Site Window Size meta name="msapplication-window" /

IE9 Pinned Site Taskbar before Pinning Site

ie9 Pinned Site Taskbar before Pinning Site

IE9 Pinned Site Icon attached to the Taskbar

ie9 Pinned Site Icon attached to the Taskbar

ie9 Pinned Sites Jump List meta name="msapplication-task"

I used the X-Icon Editor to create my favicon; its an html5 canvas tool that allows you to upload and create favicons in-browser.

References

Kill Facebook Sidebar IM Bookmarklet

Hate the new facebook im chat box? Use this bookmarklet to shut it down in your browser. Simply drag it up to your browser’s bookmark bar; then the next time you log into facebook and that horrible box pops up, click on the bookmarklet to kill the im.

fb.im.block


<a class="bookmarklet" href="
  javascript:(function(){
    var style=document.createElement('style');style.innerHTML='.fbChatSidebarBody{display:none !important}';
    document.body.appendChild(style)
  })();
  " title="Drag Me to Your Browser!">
  fb.im.block
</a>

Note: facebook is evil and we shouldn’t be using it anyways. User Beware!

00:38 9/8/2011: Camden Town, London

00:38 9/8/2011: Camden Town, London | Flickr

00:38 9/8/2011: Camden Town, London

posted by pixel.eight

Hi
My agency is London News Pictures:
0208 354 4272
press@londonnewspictures.co.uk
www.londonnewspictures.co.uk

As looters and rioters smashed up shops, looted and fought with police in Camden Town, Philippa Morgan-Walker, 25 and her husband, Jonny Walker, 31, made tea for the police who were protecting their street. Some of the officers had been on duty for more than 30 hours. The description, as entered by the person who uploaded it.

8663728@N06 The ID of the content owner – you can use this to link to their buddy icon. like so pixel.eight

jalbertbowdenii Your Flickr screen name.

Sunset Over the Indian Ocean (NASA, International Space Station Science, 05/25/10)

Sunset Over the Indian Ocean (NASA, International Space Station Science, 05/25/10) | Flickr

Sunset Over the Indian Ocean (NASA, International Space Station Science, 05/25/10)

posted by NASA’s Marshall Space Flight Center

A sunset on the Indian Ocean is featured in this image photographed by an Expedition 23 crew member on the International Space Station (ISS). The image presents an edge-on, or limb view, of Earth’s atmosphere as seen from orbit. The Earth’s curvature is visible along the horizon line, or limb, that extends across the image from center left to lower right. Above the darkened surface of Earth, a brilliant sequence of colors roughly denotes several layers of the atmosphere. Deep oranges and yellows are visible in the troposphere that extends from Earth’s surface to 6-20 kilometers high. This layer contains over 80 percent of the mass of the atmosphere and almost all of the water vapor, clouds, and precipitation — several dark cloud layers are visible within this layer. Variations in the colors are due mainly to varying concentrations of either clouds or aerosols (airborne particles or droplets). The pink to white region above the clouds appears to be the stratosphere; this atmospheric layer generally has little or no clouds and extends up to approximately 50 kilometers above Earth’s surface. Above the stratosphere blue layers mark the upper atmosphere (including the mesosphere, thermosphere, ionosphere, and exosphere) as it gradually fades into the blackness of outer space. The ISS was located over the southern Indian Ocean when this image was taken, with the observer looking towards the west. Crew members aboard the space station see 16 sunrises and sunsets per day due to their high orbital velocity (greater than 28,000 kilometers per hour). The multiple chances for photography are fortunate, as at that speed each sunrise/sunset event only lasts a few seconds.

Image/caption credit: NASA

View original image/caption:
spaceflight.nasa.gov/gallery/images/station/crew-23/html/…

More about space station science:
www.nasa.gov/mission_pages/station/science/index.html

There’s a Flickr group about Space Station Science. Please feel welcome to join! www.flickr.com/groups/stationscience/ The description, as entered by the person who uploaded it.

28634332@N05 The ID of the content owner – you can use this to link to their buddy icon. like so NASA’s Marshall Space Flight Center

jalbertbowdenii Your Flickr screen name.

How Not to Design Like a Developer

SXSW Interactive 2011 - Austin, TX | Flickr

SXSW Interactive 2011 – Austin, TX

posted by kk+

It’s that time again! Every March the geeks gather in Austin, Texas for the annual SXSW Festival. Split into three sections, Interactive, Film and Music, this festival has something for everyone. Whether it’s an up and coming band, an innovative piece of technology or an inspiring film, SXSW has it all. :) The description, as entered by the person who uploaded it.

49503002894@N01 The ID of the content owner – you can use this to link to their buddy icon. like so kk+

jalbertbowdenii.