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

Commit

Permalink
Merge pull request #44 from mobify/content-updates
Browse files Browse the repository at this point in the history
Content updates
  • Loading branch information
John Boxall committed Aug 1, 2012
2 parents a80d793 + d0cdffc commit 8bff2cb
Show file tree
Hide file tree
Showing 22 changed files with 289 additions and 73 deletions.
1 change: 1 addition & 0 deletions www/_includes/nav-docs.md
Expand Up @@ -6,6 +6,7 @@
- [Understanding Templates]({{ site.baseurl }}/docs/understanding-templates/)
- [Handling JavaScript]({{ site.baseurl }}/docs/handling-javascript/)
- [Mobify.js in Production]({{ site.baseurl }}/docs/mobifyjs-in-production/)
- [Going Responsive]({{ site.baseurl }}/docs/responsive/)
- [Konf Reference]({{ site.baseurl }}/docs/konf-reference/)
- [`OUTPUTHTML`]({{ site.baseurl }}/docs/konf-reference/#outputhtml)
- [`context.data`]({{ site.baseurl }}/docs/konf-reference/#contextdatakey)
Expand Down
1 change: 0 additions & 1 deletion www/_includes/nav-examples.html
Expand Up @@ -2,7 +2,6 @@
<div class="nav-examples">
<div class="demostore">
<h3><a href="{{ site.baseurl }}/examples/#demostore">Demo Site</a></h3>
<p>Uncle Merlin's Discount Potions</p>
</div>
<!--
<div class="demoblog">
Expand Down
5 changes: 4 additions & 1 deletion www/_includes/nav.html
Expand Up @@ -2,7 +2,7 @@
<ul class="nav">
<li>
{% active_links %}
<a href="/mobifyjs/" class="rounded">About</a>
<a href="/mobifyjs/" class="rounded about">About</a>
{% endactive_links %}
</li><li>
{% active_links prefix %}
Expand All @@ -12,6 +12,9 @@
</li><li>
<a href="/mobifyjs/community/" class="rounded">Community</a>
</li>
<li>
<a href="//twitter.com/mobifyjs" class="rounded"><i class="icon-twitter"></i></a>
</li>
</ul><!-- .nav -->
{% endactive_links %}
</div>
4 changes: 2 additions & 2 deletions www/_layouts/base.html
Expand Up @@ -44,7 +44,7 @@
<div class="viewport">
<div class="navbar row-fluid">
<div class="navbar-inner">
<a class="brand" href="/mobifyjs/">mobify.js</a>
<a class="brand" href="/mobifyjs/">Mobify.js</a>

{% include nav.html %}

Expand All @@ -69,7 +69,7 @@
<div class="span6">
<ul class="nav pull-right">
<li>
<a href="//twitter.com/mobifyjs" title="mobify.js on Twitter"><i class="icon-twitter"></i>@mobifyjs</a>
<a href="//twitter.com/mobifyjs" title="Mobify on Twitter"><i class="icon-twitter"></i>@Mobifyjs</a>
</li><li>
<a href="//github.com/mobify" title="Mobify on Github"><i class="icon-github"></i>Github</a>
</li><li>
Expand Down
4 changes: 2 additions & 2 deletions www/docs/getting-started.md
Expand Up @@ -12,10 +12,10 @@ Start" guide and now crave more.
Open _myproject/src/mobify.konf_ in your text editor. The konf is a JavaScript
file required by every Mobify.js project. It contains the DOM operations
performed on the source DOM. The _mobify.konf_ generated by the scaffold selects
the text content of the first &lt;p&gt; element and renders a template to
the text content of the first `<p>` element and renders a template to
display it.

Let's change it to display to first &lt;a&gt; element on the page. Change the
Let's change it to display to first `<a>` element on the page. Change the
*content* key to the following:

'content': function(context) {
Expand Down
34 changes: 17 additions & 17 deletions www/docs/index.md
Expand Up @@ -23,30 +23,30 @@ Mobify.js is a JavaScript framework for adapting existing websites for tablet an

Insert the Mobify.js tag **immediately** after the opening _<head>_ tag on the website you want to adapt:

<script>
(function(window, document, mjs) {
<script>
(function(window, document, mjs) {

window.Mobify = {points: [+new Date], tagVersion: [1, 0]};
window.Mobify = {points: [+new Date], tagVersion: [1, 0]};

var isMobile = /ip(hone|od|ad)|android|blackberry.*applewebkit/i.test(navigator.userAgent)
, optedOut = /mobify-path=($|;)/.test(document.cookie);
var isMobile = /ip(hone|od|ad)|android|blackberry.*applewebkit/i.test(navigator.userAgent)
, optedOut = /mobify-path=($|;)/.test(document.cookie);

if (!isMobile || optedOut) {
return;
}
if (!isMobile || optedOut) {
return;
}

document.write('<plaintext style="display:none">');
document.write('<plaintext style="display:none">');

setTimeout(function() {
var mobifyjs = document.createElement('script')
, script = document.getElementsByTagName('script')[0];
setTimeout(function() {
var mobifyjs = document.createElement('script')
, script = document.getElementsByTagName('script')[0];

mobifyjs.src = mjs;
script.parentNode.insertBefore(mobifyjs, script);
});
mobifyjs.src = mjs;
script.parentNode.insertBefore(mobifyjs, script);
});

})(this, document, 'http://127.0.0.1:8080/mobify.js');
</script>
})(this, document, 'http://127.0.0.1:8080/mobify.js');
</script>

## Preview your mobile site

Expand Down
108 changes: 108 additions & 0 deletions www/docs/responsive.md
@@ -0,0 +1,108 @@
---
layout: doc
title: Going Responsive
---

# Going Responsive with Mobify.js

Mobify.js allows you to adapt a page's markup for mobile devices.
[Responsive Web Design](http://en.wikipedia.org/wiki/Responsive_Web_Design)
is similarly powerful technique for adapting a page for mobile.

We believe there's a time and a place for both. Responsive is great on
content-forward websites where you have full control over the original
markup. Mobify.js excels in situations where the original markup isn't
well-suited for mobile or can't be modified.

But this doesn't need to be an either/or decision, you can use responsive
+ Mobify.js side by side and take advantage of the strengths of each.

## Combining Mobify.js with Responsive

If you're Mobify.js, working with responsive is simple. In your mobile
style sheet, add media queries as you normally would at your desired
breakpoints:

@media (max-width: 320px) {
.selector {
rule: value;
}
}
@media (max-width: 480px) {
.selector {
rule: value;
}
}

If you'd like to use Mobify.js to enhance an existing repsonsive site,
you'll likely want to forego a full mobile site adaptation. Instead
you can use the konf to cherry-pick more granular adaptations, and
ignore Mobify.js templates completely.

The first thing you'd do is configure your konf to pass through your
site's original DOM instead of adapting it:

'OUTPUTHTML': function(context) {
return context.data('$html').prop('outerHTML')
}

Then you would add single-element selectors on an as-needed basis:

// remove an element on mobile devices
$('.large-image').remove();

// add content to an element
$('.sale-item').append("<b>on sale</b>");

// add a class for mobile
$('.urgent').addClass("urgent-mobile");

// move an element to another place in the mobile DOM
$("footer li a:nth-child(3)").insertAfter($("header nav a:nth-child(2)"));
$("#poll").appendTo($(".sidebar"));


So your final konf might look something like this:

{>"/base/lib/base_konf.konf"/}
{<data} {

'adaptation': function() {
$('.large-image').remove();
$('.urgent').addClass("urgent-mobile");
}

'OUTPUTHTML': function(context) {
return context.data('$html').prop('outerHTML')
}

} {/data}

## Responsive UI Modules

We're also building a library of UI modules that will work with
Mobify.js to help you create mobile sites faster. These modules will
be fully responsive, and will easily integrate into new and existing
sites alike.

Stay tuned as we release the first handful of these during August 2012.


## Cloud Enhancements

The Mobify Cloud offers additional services that can enhance any
responsive site:

* **Image Resizing** -- Our image resizing service automatically
scales and resizes images, then serves only the most appropriate
one for a user's device. It also enables the use of high-density
(Retina) inline `img` elements without the performance hit of
double-loading.

* **Combo** -- our JavaScript optimization service. Combo improves
your site's JavaScript delivery for mobile and desktop alike.
It combines HTTP requests for multiple scripts into a single request
and caches the scripts client-side in HTML5 localStorage where
available.

The Mobify Cloud base plan is free, [give it a try it now](https://cloud.mobify.com/).
6 changes: 2 additions & 4 deletions www/examples/index.md
Expand Up @@ -5,11 +5,9 @@ title: Mobify.js Examples

# Examples

We've create a few examples to help you get a feel for Mobify.js!
We&#8217;re creating examples to help you get a feel for Mobify.js. Watch this space for more in the near future.

The code is available on Github:

[github.com/mobify/mobifyjs-demos](https://github.com/mobify/mobifyjs-demos)
All code is available on Github: [github.com/mobify/mobifyjs-demos](https://github.com/mobify/mobifyjs-demos)

----

Expand Down
43 changes: 27 additions & 16 deletions www/index.html
Expand Up @@ -7,10 +7,10 @@
<div class="row-fluid intro">
<div class="span5 video-intro">
<p class="lead">
Remix your HTML, CSS and JavaScript for <strong>better mobile sites</strong>. Go mobile in a day.
Remix your HTML, CSS and JavaScript for <strong>better mobile sites</strong>.
</p>
<p class="lead-mini">
Mobify.js is an open source framework that helps you quickly adapt any website to support any device. Powering millions of mobile visits to your favourite websites every day.
Mobify.js is an open source client-side web framework that helps you adapt any website to support any device. Powering millions of daily mobile visits to your favourite websites.
</p>
</div>

Expand All @@ -25,14 +25,14 @@ <h3>Coding A Mobile Site with Mobify.js</h3>


<div class="install-client">
<h2>Install the Mobify Client</h2>
<div class="row-fluid">
<div class="span12">
<div class="well install-container rounded shaded">
<div class="row-fluid">
<div class="span6">
<div class="install-summary">
<p>Quick install instructions are on the right. After you have the client, check out the Mobified demo site. (Note that the Mobify Client requires Node.js, <a href="http://nodejs.org/">get it here</a>)</p>
<h2>Install the Mobify Client</h2>
<p>Quick install instructions are on the right. After you have the client, check out the examples. Note: the Mobify Client requires Node.js, <a href="http://nodejs.org/">get it here</a>.</p>

<div class="actions">
<a href="/mobifyjs/examples/"><i class="icon-beaker"></i>See Examples</a>
Expand Down Expand Up @@ -61,24 +61,35 @@ <h2>Install the Mobify Client</h2>
</div>
</div>


<div class="remix-site">
<h2>Remix Your Site for Mobile Devices</h2>
<div class="social-proof">
<div class="row-fluid">
<div class="span4">
<p>Adapting websites for different screens and devices is challenging and time consuming. Use Mobify.js to quickly adapt any website to support any device. Keep the same URL across desktop, mobile and iPad alike.</p>
</div>

<div class="span4">
<p>Mobify.js gives you complete control over how your HTML is interpreted after it has been delivered. Client Side Adaptation allows you to remix content, on the device, on the fly &mdash; avoiding the performance challenges of lookahead parsing.</p>
<div class="span6">
<p class="quote">&#8220;Mobify.js has been a great match for our business, we have been able to launch 7 mobile websites with a team of two front-end developers.&#8221;</p>
<p><cite>&#8211; Jake Rutter, Direct Wines</cite></p>
</div>

<div class="span2"></div>
<div class="span4 clients">
<h3>Mobify.js is used by:</h3>
<div class="well rounded shaded">
<span>Starbucks, Wired, Threadless, Siemens, GQ, Bosch</span>
</div>
</div>
</div>
</div>


<div class="how-it-works">
<h2>Why Mobify.js?</h2>
<div class="row-fluid">
<div class="span4 manipulate-dom">
<p>Take control of your existing DOM on mobile and tablets. Move elements around, replace heavy images and scripts with low-bandwidth optimized versions.</p>
</div>
<div class="span4 desktop-content">
<p>Mobile site content comes directly from your desktop site. As you make changes and add content your mobile site won&#8217;t fall out of sync.</p>
</div>
<div class="span4 responsive">
<p>Use Mobify.js on its own, or combine with other industry-leading techniques like Responsive Web Design for even more control. <a href="/mobifyjs/docs/responsive/" class="more">Learn More &rsaquo;</a></p>
</div>
</div><!-- .row-fluid -->
</div>

Expand All @@ -89,9 +100,9 @@ <h2>Take it to the Next Level</h2>
<span></span>
</div>
<div class="span5">
<p>Once you have a finely-tuned mobile site, let the experts behind Mobify.js help you take it further.</p>
<p>Let the team who created Mobify.js help you take your finely-tuned mobile site even further.</p>

<p>The Mobify Cloud offers a distributed CDN, mobile workflow management, QA testing, automatic image resizing, and smart JavaScript optimization.</p>
<p>The Mobify Cloud offers a distributed CDN, mobile workflow management, QA testing, automatic image resizing, smart JavaScript optimization, and more.</p>
</div>
<div class="span4 cta">
<a href="http://cloud.mobify.com/" class="btn btn-primary rounded">Try Mobify Cloud for Free</a>
Expand Down

0 comments on commit 8bff2cb

Please sign in to comment.