Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Updating all the links so that I can use relative paths in the exampl…
Browse files Browse the repository at this point in the history
…es for use both on the CDN and localhost
  • Loading branch information
jansepar committed Feb 28, 2013
1 parent 47a4a91 commit 48edba8
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 41 deletions.
14 changes: 5 additions & 9 deletions Gruntfile.js
Expand Up @@ -181,18 +181,14 @@ module.exports = function(grunt) {
access: "public-read", access: "public-read",
headers: { "Cache-Control": "max-age=1200" }, headers: { "Cache-Control": "max-age=1200" },
upload: [ upload: [
{ // minified library { // build
src: "build/mobify-<%= pkg.version %>.min.js", src: "build/**/*",
dest: "mobifyjs/mobify-<%= pkg.version %>.min.js", dest: "mobifyjs/build/",
gzip: true rel: "build"
},
{ // unminified library
src: "build/mobify-<%= pkg.version %>.js",
dest: "mobifyjs/mobify-<%= pkg.version %>.js"
}, },
{ // examples { // examples
src: "examples/**/*", src: "examples/**/*",
dest: "examples", dest: "mobifyjs/examples/",
rel: "examples" rel: "examples"
} }
] ]
Expand Down
6 changes: 3 additions & 3 deletions examples/capturing-basictemplating/index.html
Expand Up @@ -62,14 +62,14 @@
return true; return true;
}, },
// path to mobify.js // path to mobify.js
'/build/mobify-2.0.0alpha1.js', '/mobifyjs/build/mobify-2.0.0alpha1.js',


// path to main executable // path to main executable
'/examples/capturing-basictemplating/main.js' '/mobifyjs/examples/capturing-basictemplating/main.js'
); );
</script> </script>
<!-- END MOBIFY TAG --> <!-- END MOBIFY TAG -->
<link rel="stylesheet" href="/examples/assets/css/stylesheet.css" type="text/css"> <link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">
<title>Mobify.js image gallary example</title> <title>Mobify.js image gallary example</title>
</head> </head>
<body class="foo"> <body class="foo">
Expand Down
10 changes: 5 additions & 5 deletions examples/capturing-grumpycat/index.html
Expand Up @@ -62,14 +62,14 @@
return true; return true;
}, },
// path to mobify.js // path to mobify.js
'//cdn.mobify.com/mobifyjs/mobify-2.0.0alpha1.min.js', '/mobifyjs/build/mobify-2.0.0alpha1.min.js',


// path to main executable // path to main executable
'/examples/capturing-grumpycat/main.js' '/mobifyjs/examples/capturing-grumpycat/main.js'
); );
</script> </script>
<!-- END MOBIFY TAG --> <!-- END MOBIFY TAG -->
<link rel="stylesheet" href="/examples/assets/css/stylesheet.css" type="text/css"> <link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">
<title>Mobify.js image gallary example</title> <title>Mobify.js image gallary example</title>
</head> </head>
<body class="foo"> <body class="foo">
Expand All @@ -80,10 +80,10 @@
Also note, they were plain old img elements (no data&ndash;src tricks). Also note, they were plain old img elements (no data&ndash;src tricks).
<a href="#" id="swap">Click here to download and view the original images from the source html.</a></p> <a href="#" id="swap">Click here to download and view the original images from the source html.</a></p>
<div class="img"> <div class="img">
<img src="/examples/assets/images/leaves-big.jpg" width="100%"> <img src="/mobifyjs/examples/assets/images/leaves-big.jpg" width="100%">
</div> </div>
<div class="img"> <div class="img">
<img src="/examples/assets/images/office-big.jpg" width="100%"> <img src="/mobifyjs/examples/assets/images/office-big.jpg" width="100%">
</div> </div>


</div> </div>
Expand Down
2 changes: 1 addition & 1 deletion examples/capturing-grumpycat/main.js
Expand Up @@ -6,7 +6,7 @@ if (capturing) {
var capture = Mobify.Capture.init(); var capture = Mobify.Capture.init();
var capturedDoc = capture.capturedDoc; var capturedDoc = capture.capturedDoc;


var grumpyUrl = "/examples/assets/images/grumpycat.jpg" var grumpyUrl = "/mobifyjs/examples/assets/images/grumpycat.jpg"


var imgs = capturedDoc.getElementsByTagName("img"); var imgs = capturedDoc.getElementsByTagName("img");
for(var i = 0; i < imgs.length; i++) { for(var i = 0; i < imgs.length; i++) {
Expand Down
18 changes: 9 additions & 9 deletions examples/capturing-mediaquery/index.html
Expand Up @@ -62,32 +62,32 @@
return true; return true;
}, },
// path to mobify.js // path to mobify.js
'//cdn.mobify.com/mobifyjs/mobify-2.0.0alpha1.min.js', '/mobifyjs/build/mobify-2.0.0alpha1.min.js',


// path to main executable // path to main executable
'/examples/capturing-mediaquery/main.js' '/mobifyjs/examples/capturing-mediaquery/main.js'
); );
</script> </script>
<!-- END MOBIFY TAG --> <!-- END MOBIFY TAG -->


<link rel="stylesheet" href="/examples/assets/css/stylesheet.css" type="text/css"> <link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">
<title>Mobify.js Media Query</title> <title>Mobify.js Media Query</title>
</head> </head>
<body class="foo"> <body class="foo">
<div class="small"> <div class="small">
<h1 media="(max-width : 480px)">Small images downloaded</h1> <h1 media="(max-width : 480px)">Small images downloaded</h1>
<img src="/examples/assets/images/leaves-small.jpg" width="100%" media="(max-width : 480px)"> <img src="/mobifyjs/examples/assets/images/leaves-small.jpg" width="100%" media="(max-width : 480px)">
<img src="/examples/assets/images/office-small.jpg" width="100%" media="(max-width : 480px)"> <img src="/mobifyjs/examples/assets/images/office-small.jpg" width="100%" media="(max-width : 480px)">
</div> </div>
<div class="big"> <div class="big">
<h1 media="(min-width : 480px)">Big images downloaded</h1> <h1 media="(min-width : 480px)">Big images downloaded</h1>
<img src="/examples/assets/images/leaves-big.jpg" width="100%" media="(min-width : 480px)"> <img src="/mobifyjs/examples/assets/images/leaves-big.jpg" width="100%" media="(min-width : 480px)">
<img src="/examples/assets/images/office-big.jpg" width="100%" media="(min-width : 480px)"> <img src="/mobifyjs/examples/assets/images/office-big.jpg" width="100%" media="(min-width : 480px)">
</div> </div>


<h1 media="(min-width : 480px)"> <h1 media="(min-width : 480px)">
<script src="/examples/assets/js/small.js" media="(max-width: 480px)"></script> <script src="/mobifyjs/examples/assets/js/small.js" media="(max-width: 480px)"></script>
<script src="/examples/assets/js/large.js" media="(min-width: 480px)"></script> <script src="/mobifyjs/examples/assets/js/large.js" media="(min-width: 480px)"></script>
<script> <script>
// Grab the total time since starting capturing and send it // Grab the total time since starting capturing and send it
// to the parent for testing in performance.html // to the parent for testing in performance.html
Expand Down
16 changes: 8 additions & 8 deletions examples/capturing-picturepolyfill/index.html
Expand Up @@ -62,14 +62,14 @@
return true; return true;
}, },
// path to mobify.js // path to mobify.js
'//cdn.mobify.com/mobifyjs/mobify-2.0.0alpha1.min.js', '/mobifyjs/build/mobify-2.0.0alpha1.min.js',


// path to main executable // path to main executable
'/examples/capturing-picturepolyfill/main.js' '/mobifyjs/examples/capturing-picturepolyfill/main.js'
); );
</script> </script>
<!-- END MOBIFY TAG --> <!-- END MOBIFY TAG -->
<link rel="stylesheet" href="/examples/assets/css/stylesheet.css" type="text/css"> <link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">


<title>Mobify.js Picturefill example</title> <title>Mobify.js Picturefill example</title>
</head> </head>
Expand All @@ -78,11 +78,11 @@
<p>This example has been forked and replicated using capturing to avoid the need for a &lt;noscript&gt; tag (view source to see for yourself).</p> <p>This example has been forked and replicated using capturing to avoid the need for a &lt;noscript&gt; tag (view source to see for yourself).</p>
<p>Open up the network tab of your web inspector to see that the img element does not have it's asset downloaded.<p> <p>Open up the network tab of your web inspector to see that the img element does not have it's asset downloaded.<p>
<picture> <picture>
<source src="/examples/assets/images/small.jpg"> <source src="/mobifyjs/examples/assets/images/small.jpg">
<source src="/examples/assets/images/medium.jpg" media="(min-width: 450px)"> <source src="/mobifyjs/examples/assets/images/medium.jpg" media="(min-width: 450px)">
<source src="/examples/assets/images/large.jpg" media="(min-width: 800px)"> <source src="/mobifyjs/examples/assets/images/large.jpg" media="(min-width: 800px)">
<source src="/examples/assets/images/extralarge.jpg" media="(min-width: 1000px)"> <source src="/mobifyjs/examples/assets/images/extralarge.jpg" media="(min-width: 1000px)">
<img src="/examples/assets/images/small.jpg"> <img src="/mobifyjs/examples/assets/images/small.jpg">
</picture> </picture>
<script> <script>
// Grab the total time since starting capturing and send it // Grab the total time since starting capturing and send it
Expand Down
1 change: 1 addition & 0 deletions mobifyjs
2 changes: 1 addition & 1 deletion www/v2/docs/index.md
Expand Up @@ -21,7 +21,7 @@ more.


<pre id="mobify-tag"><code class="html">&lt;script class="mobify" id="mobify-tag">(function(a,b,c,d,e){function f(a,c,d){var e=b.createElement("script"),f=b.getElementById("mobify-tag");return e.src=a,e.id=c,e.setAttribute("class",d),f.parentNode.insertBefore(e,f),e}!this.Mobify&&c()&&(b.write('&lt;plaintext style="display:none">'),setTimeout(function(){a.capturing=!0;var b=f(d,"mobify-js","mobify");b.onload=function(){e&&f(e,"mobify-js-main","mobify")}}))})(window,document,function(){var b,a=/webkit|msie\s10|(firefox)[\/\s](\d+)|(opera)[\s\S]*version[\/\s](\d+)|3ds/i.exec(navigator.userAgent);return a&&(b=a[1]&&"firefox"===a[1].toLowerCase()&&4>+a[2]?!1:a[3]&&"opera"===a[3].toLowerCase()&&11>+a[4]?!1:!0),b?!0:!1}, <pre id="mobify-tag"><code class="html">&lt;script class="mobify" id="mobify-tag">(function(a,b,c,d,e){function f(a,c,d){var e=b.createElement("script"),f=b.getElementById("mobify-tag");return e.src=a,e.id=c,e.setAttribute("class",d),f.parentNode.insertBefore(e,f),e}!this.Mobify&&c()&&(b.write('&lt;plaintext style="display:none">'),setTimeout(function(){a.capturing=!0;var b=f(d,"mobify-js","mobify");b.onload=function(){e&&f(e,"mobify-js-main","mobify")}}))})(window,document,function(){var b,a=/webkit|msie\s10|(firefox)[\/\s](\d+)|(opera)[\s\S]*version[\/\s](\d+)|3ds/i.exec(navigator.userAgent);return a&&(b=a[1]&&"firefox"===a[1].toLowerCase()&&4>+a[2]?!1:a[3]&&"opera"===a[3].toLowerCase()&&11>+a[4]?!1:!0),b?!0:!1},
// path to Mobify.js library // path to Mobify.js library
"//cdn.mobify.com/mobifyjs/mobify-2.0.0alpha1.min.js", "//cdn.mobify.com/mobifyjs/build/mobify-2.0.0alpha1.min.js",
// Path to main executable // Path to main executable
"/PATH/TO/main.js"); "/PATH/TO/main.js");
&lt;/script></code></pre> &lt;/script></code></pre>
Expand Down
10 changes: 5 additions & 5 deletions www/v2/examples/index.md
Expand Up @@ -17,7 +17,7 @@ You can view the example in the link below. Be sure to
open up web inspector to see that the original images open up web inspector to see that the original images
on the site did not download. on the site did not download.


* [Grumpy Cat Example](http://cdn.mobify.com/examples/capturing-grumpycat/index.html){: target='_blank' } * [Grumpy Cat Example](http://cdn.mobify.com/mobifyjs/examples/capturing-grumpycat/index.html){: target='_blank' }


Source code on Github: Source code on Github:


Expand All @@ -34,7 +34,7 @@ You can view the example in the link below. Be sure to
open up web inspector to see that only the images and scripts open up web inspector to see that only the images and scripts
evaluated by the media query are loaded. evaluated by the media query are loaded.


* [Media Query Example](http://cdn.mobify.com/examples/capturing-mediaquery/index.html){: target='_blank' } * [Media Query Example](http://cdn.mobify.com/mobifyjs/examples/capturing-mediaquery/index.html){: target='_blank' }


Source code on Github: Source code on Github:


Expand All @@ -53,12 +53,12 @@ possible.


Check out this basic example: Check out this basic example:


* [Templating Example](http://cdn.mobify.com/examples/capturing-templating/index.html){: target='_blank' } * [Templating Example](http://cdn.mobify.com/mobifyjs/examples/capturing-basictemplating/index.html){: target='_blank' }


Source code on Github: Source code on Github:


* [index.html](https://github.com/mobify/mobifyjs/blob/v2.0-documentation/examples/capturing-templating/index.html){: target='_blank' } * [index.html](https://github.com/mobify/mobifyjs/blob/v2.0-documentation/examples/capturing-basictemplating/index.html){: target='_blank' }
* [base.html](https://github.com/mobify/mobifyjs/blob/v2.0-documentation/examples/capturing-templating/main.js){: target='_blank' } * [base.html](https://github.com/mobify/mobifyjs/blob/v2.0-documentation/examples/capturing-basictemplating/main.js){: target='_blank' }


---- ----


Expand Down

0 comments on commit 48edba8

Please sign in to comment.