Commit 2f692491 authored by Ying-Chun Liu's avatar Ying-Chun Liu

Import Upstream version 1.0.3+dfsg.1

parents
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
# git ignore file
.idea/
_site/
*.sln
*.suo
*.config
*.bundle
sauce_connect.*
node_modules/
\ No newline at end of file
{
// JSHint Configuration File for HeadJS
// See http://jshint.com/docs/ for more details
// See http://jslinterrors.com/ for error information
// If you have suggestions for these settings, please leave a comment on GitHub
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : 4, // {int} Number of spaces to use for indentation
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : false, // true: Prohibit use of empty blocks
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : true, // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
"trailing" : true, // true: Prohibit trailing whitespaces
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line
// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : false, // true: Tolerate defining variables inside control statements"
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
"laxcomma" : true, // true: Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"multistr" : false, // true: Tolerate multi-line strings
"proto" : false, // true: Tolerate using the `__proto__` property
"scripturl" : false, // true: Tolerate script-targeted URLs
"smarttabs" : true, // true: Tolerate mixed tabs/spaces when used for alignment
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // true: Tolerate using this in a non-constructor function
// Environments
"browser" : true, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : false, // jQuery
"mootools" : false, // MooTools
"node" : false, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface
// Legacy
"nomen" : false, // true: Prohibit dangling `_` in variables
"onevar" : false, // true: Allow only one `var` statement per function
"passfail" : false, // true: Stop on first error
"white" : false, // true: Check against strict whitespace and indentation rules
// Custom Globals
"globals" : {} // additional predefined global variables
}
# define language used
language: node_js
# configure node version
node_js:
- "0.11"
# http://about.travis-ci.org/docs/user/build-configuration/#Build-Lifecycle
# install dependencies
before_script:
- npm install -g grunt-cli
- npm install grunt grunt-contrib-qunit
# run
script: grunt test -v -d
# Run tests using Travis CI and Sauce Labs
# https://saucelabs.com/opensource/travis
#
# Secure environment variables
# http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables
#
# Extra links
# https://github.com/axemclion/grunt-saucelabs
env:
global:
- secure: "i8xVOci13yViGd+vqpiM0P2kL4qayAOOd80jmlOOKHu7tCMEF6EvkJBOwALVx+LDRFnyg/4iP0drQSMYztiF5ZTnEcbh+EknltKAA3ygI/d2RUDhB7Cn7Knu3baqE1By3BXHbVlhOZ0zTZUbwrGcnzxnBHec5mvISw9Y1dIaz94="
- secure: "M7lJ0WoAcSACTUJGHRuTcUzGrvo806mJ5UCJ3MjttL4DPz+kxeO2zLPCLff12zmv1x97lRjKtY7zJJei8ZkGgEQfLLlz5I3Hg7yJ2dSqTxGiKpr7vlipDZq6+ZPpHo3kElsGIy5ue/rVKNS/8l8I5zYRdNpWkwztLJvj6nHfxIo="
\ No newline at end of file
---
layout: main
---
<div class="intro">
Stop breaking things !
</div>
<div class="group">
<div class="float-l" style="font-size: 150px">404</div>
<img class="float-l" src="/site/assets/img/404.jpg" title="by ~Lain-Luscious-Fanart" alt="not found" style="max-width: 100%"/>
</div>
<br /><br />
<div class="intro">
<strong>Make it the only script in your HEAD.</strong>
&laquo; A concise solution to universal problems &raquo;
</div>
{% include sections/download.html %}
\ No newline at end of file
headjs.com
module.exports = function (grunt) {
//#region Saucelabs Browsers
// https://saucelabs.com/docs/platforms
var browsers = [
// sauce says ff25 is availiable, but times out systematically...
{
browserName: "firefox",
platform : "Windows 8",
version : "22"
},
{
browserName : "iphone",
platform : "OS X 10.8",
version : "6.1",
"device-orientation": "portrait"
},
{
browserName : "ipad",
platform : "OS X 10.8",
version : "6.1",
"device-orientation": "portrait"
},
{
browserName : "android",
platform : "Linux",
version : "4.0",
"device-orientation": "portrait"
},
{
browserName: "safari",
platform: "OS X 10.6",
version: "5"
},
{
browserName: "safari",
platform : "OS X 10.8",
version : "6"
},
{
browserName: "chrome",
platform : "Windows 7",
version : "31"
},
{
browserName: "internet explorer",
platform : "Windows XP",
version : "7"
},
{
browserName: "internet explorer",
platform : "Windows XP",
version : "8"
},
{
browserName: "internet explorer",
platform : "Windows 7",
version : "9"
},
{
browserName: "internet explorer",
platform : "Windows 8",
version : "10"
},
{
browserName: "internet explorer",
platform : "Windows 8.1",
version : "11"
}
];
//#endregion
// Project configuration
grunt.initConfig({
//#region Saucelabs
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
"saucelabs-qunit": {
all: {
options: {
urls : ["http://127.0.0.1:9999/test/unit/1.0.0/index.html"],
tunnelTimeout: 10,
build : process.env.TRAVIS_JOB_ID,
concurrency : 3,
browsers : browsers,
testname : "qunit tests",
tags : ["master"]
}
}
},
watch: {},
//#endregion
// load package information ..use later for building via grunt...
//pkg: grunt.file.readJSON("package.json"),
// task: local unit tests
qunit: {
files: ['test/unit/1.0.0/index.html']
}
});
// Loading dependencies
for (var key in grunt.file.readJSON("package.json").devDependencies) {
if (key !== "grunt" && key.indexOf("grunt") === 0) {
grunt.loadNpmTasks(key);
}
}
// register: local unit tests
grunt.registerTask("qtest", "qunit");
// register sauce tasks
grunt.registerTask("dev" , ["connect", "watch"]);
grunt.registerTask("test", ["connect", "saucelabs-qunit"]);
};
\ No newline at end of file
The MIT License
Copyright (c) 2013
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
[![Head JS](http://headjs.com/site/assets/img/logo-big.png)](http://headjs.com)
###Latest Version: v1.0.3 :: [Downloads](http://headjs.com/site/download.html) | [Docs](http://headjs.com/site/api/v1.00.html) | [News](http://headjs.com/site/blog.html) | [Intro](http://headjs.com)
#####Status
[![Build Status](https://travis-ci.org/headjs/headjs.png?branch=master)](https://travis-ci.org/headjs/headjs)
#####Tested with (..amongst others)
[![Selenium Status](https://saucelabs.com/browser-matrix/itechnology.svg)](https://saucelabs.com/u/itechnology)
###Responsive Design, Feature Detections, and Resource Loading
* Speed up your apps: Load JS & CSS asyncronously and in parallel, but execute them in order
* Load one asset if a condition is met, else fallback and load a different one
* Manage script dependencies, and execute callbacks once they are loaded
* Cross-browser compatible &laquo; pseudo media-queries &raquo; let you code against different resolutions & devices
* Fix quirks in specific browsers by quickly applying dedicated CSS/JS logic
* Detect various browsers & their versions
* Check if the client supports a certain Browser, HTML5, or CSS3 feature
* Automatically generates JS and CSS classes for browsers & features that where detected
* Automatically generates CSS classes, to know what page or section a user is viewing
* Know if the user is in landscape or portrait mode
* Or whether the client is using a mobile or desktop device
* Get old browsers to support HTML5 elements like nav, sidebar, header, footer, ...
* ...
* __Make it, The only script in your &lt;HEAD&gt;__
* ___A concise solution to universal problems___
###Resources
- __WebSite__
- [http://headjs.com](http://headjs.com)
- __Bugs__
- [https://github.com/headjs/headjs/issues](https://github.com/headjs/headjs/issues)
- __Community Support__
- [http://stackoverflow.com](http://stackoverflow.com/questions/tagged/head.js)
- _Remember to tag your questions with_: ___head.js___
- __Feature Requests/Suggestions__
- [http://headjs.uservoice.com](http://headjs.uservoice.com/forums/182905-headjs-feature-suggestions)
# GitHub Defaults
lsi: false
pygments: true
safe: true
# UTF-8 & parse errors fix
markdown: redcarpet
# Custom Variables
head:
major: 1.0.0
minor: 1.0.3
\ No newline at end of file
<h2 id="browser">Browser Information</h2>
<div class="intro">
HeadJS knows certain information about the browser and exposes that information via CSS & JS
</div>
<div class="code-example" data-title="head.browser">
<p>These variables are accessible via JavaScript (all the time) so you can apply certain logic depending on specific use-cases</p>
<ul>
<li>head.browser.name (string)</li>
<li>head.browser.version (float)</li>
<li>head.browser.ie (bool)</li>
<li>head.browser.ff (bool)</li>
<li>head.browser.chrome (bool)</li>
<li>head.browser.ios (bool)</li>
<li>head.browser.android (bool)</li>
<li>head.browser.webkit (bool)</li>
<li>head.browser.opera (bool)</li>
</ul>
{% highlight js %}
if (head.browser.ie && head.browser.version < 9) {
/* code specific to IE but only if IE < 9 */
}
{% endhighlight %}
<p>The same information is also exposed via CSS, so that you may apply CSS specific fixes</p>
{% highlight css %}
.ie8 {
/* code specific to IE8 */
}
.lt-ie9 {
/* code specific to IE but only if IE < 9 */
}
{% endhighlight %}
<p>No matter how HeadJS is configured, it will at least generate CSS classes for the current browser & it's version (.ie8, .ff25). Generating classes for (.lt, .lte, .gt, .gte, .eq) including full min/max ranges of browser versions is supported, but not advised since it can generate too much css. By default only current browser + version, and IE6-11 ranges are generated automagically.</p>
<p>You can select which variables are exposed via CSS in the <a href="#configuration">configuration</a> section.</p>
<div style="width:100%;">
<div onclick="blog.loadComments(this, 'api/1.0.0/browser', 'Leave a comment')" style="cursor: pointer;">
<h2>Show Comments</h2>
</div>
</div>
</div>
<h1 id="configuration">Configuration</h1>
<div class="intro">
Sometimes you will want to change how HeadJS behaves by enabling or disabling certain features.
</div>
<div class="code-example" data-title="Configuration">
<p>This is the default configuration that HeadJS ships with</p>
{% highlight js %}
conf = {
screens : [240, 320, 480, 640, 768, 800, 1024, 1280, 1440, 1680, 1920],
screensCss: { "gt": true, "gte": false, "lt": true, "lte": false, "eq": false },
browsers : [
{ ie: { min: 6, max: 11 } }
//,{ chrome : { min: 8, max: 31 } }
//,{ ff : { min: 3, max: 26 } }
//,{ ios : { min: 3, max: 7 } }
//,{ android: { min: 2, max: 4 } }
//,{ webkit : { min: 9, max: 12 } }
//,{ opera : { min: 9, max: 12 } }
],
browserCss: { "gt": true, "gte": false, "lt": true, "lte": false, "eq": true },
html5 : true,
page : "-page",
section : "-section",
head : "head"
};
{% endhighlight %}
<p>If you wanted to change what screen breakpoints HeadJS uses, then you would do something like this</p>
{% highlight html %}
<html>
<head>
<script>
var head_conf = {
screens: [1024, 1280, 1440, 1680, 1920]
};
</script>
<script src="head.min.js"></script>
</head>
<body>
<!-- my content-->
</body>
</html>
{% endhighlight %}
<p>The same goes for all the other configurable variables. Just make sure <strong>var head_conf</strong> is declared BEFORE you include HeadJS.</p>
<dl>
<dt>screens</dt>
<dd>Width breakpoints for which lt,lte,gt,gte,eq can be generated (.gt-800, .lt-1680)</dd>
<dt>screensCss</dt>
<dd>Enables/Disables the actual insertion of those breakpoints into the HTML</dd>
<dt>browsers</dt>
<dd>Browser/Version breakpoints for which lt,lte,gt,gte,eq can be generated (.ie8, .lt-ie9)</dd>
<dt>browserCss</dt>
<dd>Enables/Disables the actual insertion of those breakpoints into the HTML</dd>
<dt>html5</dt>
<dd>When enabled, IE8 and less will have the &laquo; HTML5 Shim &raquo; injected, which adds compatibility for the following HTML5 elements: abbr, article, aside, audio, canvas, details, figcaption, figure, footer, header, hgroup, main, mark, meter, nav, output, progress, section, summary, time, video</dd>
<dt>page</dt>
<dd>Suffix used by the &laquo; CSS Router &raquo; when detecting pages (#v1-page)</dd>
<dt>section</dt>
<dd>Suffix used by the &laquo; CSS Router &raquo; when detecting page sections (.api-section)</dd>
<dt>head</dt>
<dd>Name of the variable that should be used for HeadJS. If set to something else like: test, you would call test.load() instead of head.load()</dd>
</dl>
<div style="width:100%;">
<div onclick="blog.loadComments(this, 'api/1.0.0/configuration', 'Leave a comment')" style="cursor: pointer;">
<h2>Show Comments</h2>
</div>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
<h1 id="html5">HTML5 Shim</h1>
<h2>Target HTML5 and CSS3 elements safely</h2>
<div class="intro">
Want to start using HTML5 semantics but are put off by it because you still have a large audience of users using non compatible browsers ?
</div>
<div class="code-example" data-title="HTML5 & CSS3">
<p>DIV's are good, but HeadJS let's you be semantic and futuristic</p>
{% highlight html %}
/* Use CSS3 semantics */
<style>
article { text-shadow:0 0 1px #ccc; }
</style>
<!-- works in IE too -->
<article>
<header></header>
<section></section>
<footer></footer>
</article>
{% endhighlight %}
<p>HeadJS will detect if IE < 9 is present, and inject the necessary HTML5 Shim for you.</p>
<p>You will still need to use a HTML5 enabling stylesheet for it to work like <a href="http://necolas.github.io/normalize.css/" target="_blank">Normalize.css</a>, or just <a href="/site/assets/css/html5.min.css" target="_blank">download our file</a> and reference it in your HEAD.</p>
{% highlight html %}
<html>
<head>
<link rel="stylesheet" href="html5.min.css" />
<script src="head.min.js"></script>
/* Use CSS3 semantics */
<style>
article { text-shadow:0 0 1px #ccc; }
</style>
</head>
<body>
<!-- works in IE too -->
<article>
<header></header>
<section></section>
<footer></footer>
</article>
</body>
</html>
{% endhighlight %}
<p>You can also enable/disable the injection via the <a href="#configuration">configuration</a> section.</p>
---
<p><em>But before you start believing all the hype around HTML5, be sure to give this a read ..you'll be surprised !</em></p>
<figure>
<a href="http://www.truthabouthtml5.com/#fivereasons" target="_blank"><img src="/site/assets/img/truth-about-html5.jpg" alt="The Truth About HTML5" width="51" height="81"></a>
<figcaption><em>The Truth About HTML5</em></figcaption>
</figure>
<div style="width:100%;">
<div onclick="blog.loadComments(this, 'api/1.0.0/html5', 'Leave a comment')" style="cursor: pointer;">
<h2>Show Comments</h2>
</div>
</div>
</div>
\ No newline at end of file
<h1 id="load">Resource Loading</h1>
<div class="intro">
Speed up your site. Manage your library's dependencies. Load javascript and stylesheets in parallel but execute them in the correct order.
</div>
<div class="code-example" data-title="head.load()">
<p>Resource loading has many different options to cater to various needs</p>
{% highlight js %}
// queue scripts and fire a callback when loading is finished
head.load("file1.js", "file2.js", function() {
// do something
});
// same as above, but pass files in as an Array
head.load(["file1.js", "file2.js"], function() {
// do something
});
// you can also give scripts a name (label)
head.load({ label1: "file1.js" }, { label2: "file2.js" }, function() {
// do something
});
// same as above, but pass files in as an Array
head.load([{ label1: "file1.js" }, { label2: "file2.js" }], function() {
// do something
});