Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
removed clientSideOnly option - wasn't practical or used by probably …
Browse files Browse the repository at this point in the history
…anyone.
  • Loading branch information
scottjehl committed May 24, 2011
1 parent b306f5e commit fa840f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Non-javascript enabled/supporting browsers/devices will currently receive the im

### Optional Configuration and Optimizations:

2 options are available for external configuration: widthBreakPoint and ClientSideOnly. You can set these within a global "rwd_images" object that must be defined before rwd-images.js is loaded.
1 option is available for external configuration: widthBreakPoint. You can set it within a global "rwd_images" object that must be defined before rwd-images.js is loaded.

<script>
//configure options here:
Expand All @@ -59,19 +59,6 @@ If you'd like to use a different width breakpoint than the 480px default:
};
</script>

#### Preventing all unnecessary image requests
If you are able to guarantee that your BODY element contains
no relative references to scripts, stylesheets (link elements), objects,
or anything else that makes an http request the moment they load (in other words, relative links (anchor elements) aren't a problem),
then you can set the clientSideOnly argument to true, which will prevent all unnecessary requests from going out to the server. This is ideal, but difficult to support as a default.

<script>
//configure options here:
var rwd_images = {
//set clientSideOnly flag to true - preventing all unnecessary requests!
ClientSideOnly: true
};
</script>

#### Server-side Optimizations
A cookie is set by the script so that on subsequent page loads you can set your images an appropriate source from the start and
Expand Down
10 changes: 1 addition & 9 deletions rwd-images/rwd-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
//defaults / mixins
var rwdi = (function(){
var defaults = {
clientSideOnly: false,
widthBreakPoint: 480,
htmlClass: "rwd-imgs-lrg"
};
Expand All @@ -21,7 +20,6 @@
}
return defaults;
})(),
clientSideOnly = rwdi.clientSideOnly,
widthBreakPoint = rwdi.widthBreakPoint,
wideload = win.screen.availWidth > widthBreakPoint,
filePath = location.href,
Expand Down Expand Up @@ -85,13 +83,7 @@
base = null;
}
else{
if(clientSideOnly){
//more info up top, use with caution!
base.href = "javascript://";
}
else{
base.href = dirPath + "rwd-router/";
}
base.href = dirPath + "rwd-router/";
}
return base;
})(),
Expand Down

0 comments on commit fa840f4

Please sign in to comment.