authpartner
Clone or download
Modified Files
<!DOCTYPE html>
<!DOCTYPE html>
<?php include 'config.php'; ?>
<?php include 'config.php'; ?>
<?php $code = "code_download"; ?>
<html lang="en">
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="description" content="">
<meta name="author" content="">
<meta name="author" content="">
<title>DigiLocker Service Center</title>
<title>DigiLocker Service Center</title>
<!-- Bootstrap Core CSS -->
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<link href="css/font-style.css" rel="stylesheet" type="text/css">
<link href="css/font-style.css" rel="stylesheet" type="text/css">
<!-- Custom Fonts -->
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<style>
<style>
ul li span .btn {
ul li span .btn {
background-color:blueviolet;
background-color:blueviolet;
padding:0px;
padding:0px;
border-radius: 4px;
border-radius: 4px;
text-transform: none;
text-transform: none;
margin-left:20px;
margin-left:20px;
}
}
@media (min-width: 768px){
@media (min-width: 768px){
.navbar-nav>li>a {
.navbar-nav>li>a {
font-size:11px;
font-size:11px;
padding-top: 8px;
padding-top: 8px;
padding-bottom: 0px;
padding-bottom: 0px;
color: #fff;
color: #fff;
padding-bottom: 8px;
padding-bottom: 8px;
}
}
.navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
.navbar-nav>li>a:hover{ color: #000; background-color:#f0ede4;}
.row{margin-top: -10px;margin-bottom: 15px;}
.row{margin-top: -10px;margin-bottom: 15px;}
}
}
.dropdown{
.dropdown{
margin:6px 16px;
margin:6px 16px;
color:#fff !important;
color:#fff !important;
cursor: pointer; cursor: hand;
cursor: pointer; cursor: hand;
}
}
.dropdown-submenu {
.dropdown-submenu {
position: relative;
position: relative;
color:#0033FF;
color:#0033FF;
}
}
.dropdown-menu>li{
.dropdown-menu>li{
margin-left: -15px;
margin-left: -15px;
cursor: pointer; cursor: hand;
cursor: pointer; cursor: hand;
}
}
</style>
</style>
</head>
</head>
<body>
<body>
<!-- Navigation -->
<!-- Navigation -->
<div class="row">
<div class="row">
<div class="col-md-6">
<div class="col-md-6">
<a class="navbar-brand pull-left" href="index.html"><img src="images/logo.png"></a>
<a class="navbar-brand pull-left" href="index.html"><img src="images/logo.png"></a>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6">
<a class="navbar-brand pull-right">
<a class="navbar-brand pull-right">
<img src="images/digitalindialogo.png"></a>
<img src="images/digitalindialogo.png"></a>
</div>
</div>
</div>
</div>
<nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 40px; position: relative;" >
<nav role="navigation" style="background-color: blueviolet; margin-bottom: 15px;height: 40px; position: relative;" >
<div class="container" style="padding-left:0px !important;">
<div class="container" style="padding-left:0px !important;">
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Brand and toggle get grouped for better mobile display -->
<!-- Collect the nav links, forms, and other content for toggling -->
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" >
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" >
<ul class="nav navbar-nav navbar-left ">
<ul class="nav navbar-nav navbar-left ">
<li><a href= "<?php echo $config['dlsc_path']; ?>"><i class="fa fa-home fa-2x" aria-hidden="true"></i></a></li>
<li><a href= "<?php echo $config['dlsc_path']; ?>"><i class="fa fa-home fa-2x" aria-hidden="true"></i></a></li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AADHAAR
<div class="dropdown-toggle" data-toggle="dropdown">AADHAAR
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a >Aadhaar Demographic Update</a></li><hr>
<li><a >Aadhaar Demographic Update</a></li><hr>
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
<li><a>Aadhaar eKYC PVC Print</a></li>
<li><a>Aadhaar eKYC PVC Print</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">AGRICULTURE
<div class="dropdown-toggle" data-toggle="dropdown">AGRICULTURE
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Agricultural Machine Store</a></li><hr>
<li><a tabindex="-1" >Agricultural Machine Store</a></li><hr>
<li><a tabindex="-1" >Online Store</a></li><hr>
<li><a tabindex="-1" >Online Store</a></li><hr>
<li><a tabindex="-1" >Farmer Registration</a></li><hr>
<li><a tabindex="-1" >Farmer Registration</a></li><hr>
<li><a tabindex="-1" >Marketplace</a></li>
<li><a tabindex="-1" >Marketplace</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">BANKING AND PENSION
<div class="dropdown-toggle" data-toggle="dropdown">BANKING AND PENSION
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >RAP Registration</a></li><hr>
<li><a tabindex="-1" >RAP Registration</a></li><hr>
<li><a tabindex="-1" >Basic Banking Course</a></li><hr>
<li><a tabindex="-1" >Basic Banking Course</a></li><hr>
<li><a tabindex="-1" >Life Certificate (LIC)</a></li><hr>
<li><a tabindex="-1" >Life Certificate (LIC)</a></li><hr>
<li><a tabindex="-1" >Pin Pad Device Payment Service</a></li>
<li><a tabindex="-1" >Pin Pad Device Payment Service</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">DIGILOCKER</div>
<div class="dropdown-toggle" data-toggle="dropdown">DIGILOCKER</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li>
<li>
<span><form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span><form action = "<?php echo $config[$code] ?>" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
<input type="text" class="form-control" name = "response_type" value="code">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
<label class="control-label" for="inputSuccess">Client ID</label>
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
<label class="control-label" for="inputSuccess">State</label>
<input type="text" class="form-control" name = "state" value="123456">
<input type="text" class="form-control" name = "state" value="123456">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<input type="text" class="form-control" name = "dl_flow" value="signup">
<input type="text" class="form-control" name = "dl_flow" value="signup">
</div>
</div>
<button type="submit" class="btn">Open Digilocker Account</button>
<button type="submit" class="btn">Open Digilocker Account</button>
</form>
</form>
</span>
</span>
</li><hr>
</li><hr>
<li>
<li>
<span><form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span><form action = "<?php echo $config[$code] ?>" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
<input type="text" class="form-control" name = "response_type" value="code">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
<label class="control-label" for="inputSuccess">Client ID</label>
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
<input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
<label class="control-label" for="inputSuccess">State</label>
<input type="text" class="form-control" name = "state" value="123456">
<input type="text" class="form-control" name = "state" value="123456">
</div>
</div>
<button type="submit" class="btn">Download</button>
<button type="submit" class="btn">Download</button>
</form>
</form>
</span>
</span>
</li><hr>
</li><hr>
<li>
<li>
<span> <form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<span> <form action = "<?php echo $config[$code] ?>" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
<input type="text" class="form-control" name = "response_type" value="code">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
<label class="control-label" for="inputSuccess">Client ID</label>
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_upload'] ?>">
<input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_upload'] ?>">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<label class="control-label" for="inputSuccess">Redirect Uri</label>
<input type="text" class="form-control" name = "redirect_uri" value="<?php echo $config['uploaddoc_redirect_uri'] ?>">
<input type="text" class="form-control" name = "redirect_uri" value="<?php echo $config['uploaddoc_redirect_uri'] ?>">
</div>
</div>
<div class="form-group has-success" style="display:none">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
<label class="control-label" for="inputSuccess">State</label>
<input type="text" class="form-control" name = "state" value="123456">
<input type="text" class="form-control" name = "state" value="123456">
</div>
</div>
<button type="submit" class="btn" >Upload</button>
<button type="submit" class="btn" >Upload</button>
</form>
</form>
</span>
</span>
</li>
</li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">ELECTION
<div class="dropdown-toggle" data-toggle="dropdown">ELECTION
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Punjab Election Services</a></li><hr>
<li><a tabindex="-1" >Punjab Election Services</a></li><hr>
<li><a tabindex="-1" >Uttarakhand Election Services</a></li><hr>
<li><a tabindex="-1" >Uttarakhand Election Services</a></li><hr>
<li><a tabindex="-1" >Meghalaya Election Services</a></li><hr>
<li><a tabindex="-1" >Meghalaya Election Services</a></li><hr>
<li><a tabindex="-1" >Rajasthan Election Services</a></li>
<li><a tabindex="-1" >Rajasthan Election Services</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">GOVERNMENT
<div class="dropdown-toggle" data-toggle="dropdown">GOVERNMENT
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Birth and Death Application</a></li><hr>
<li><a tabindex="-1" >Birth and Death Application</a></li><hr>
<li><a tabindex="-1" >Forest Services</a></li><hr>
<li><a tabindex="-1" >Forest Services</a></li><hr>
<li><a tabindex="-1" >Online FIR</a></li><hr>
<li><a tabindex="-1" >Online FIR</a></li><hr>
<li><a tabindex="-1" >Ration Card Services</a></li>
<li><a tabindex="-1" >Ration Card Services</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">INSURANCE
<div class="dropdown-toggle" data-toggle="dropdown">INSURANCE
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Pradhan Mantri Fasal Bima Yojna</a></li><hr>
<li><a tabindex="-1" >Pradhan Mantri Fasal Bima Yojna</a></li><hr>
<li><a tabindex="-1" >Farmer Package Policy</a></li><hr>
<li><a tabindex="-1" >Farmer Package Policy</a></li><hr>
<li><a tabindex="-1" >Life Insurance</a></li><hr>
<li><a tabindex="-1" >Life Insurance</a></li><hr>
<li><a tabindex="-1" >Personal Accidental</a></li>
<li><a tabindex="-1" >Personal Accidental</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
<li>
<li>
<div class="dropdown">
<div class="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">TRAVEL
<div class="dropdown-toggle" data-toggle="dropdown">TRAVEL
</div>
</div>
<ul class="dropdown-menu" style="margin-left: -5px;">
<ul class="dropdown-menu" style="margin-left: -5px;">
<li><a tabindex="-1" >Darshan Booking</a></li><hr>
<li><a tabindex="-1" >Darshan Booking</a></li><hr>
<li><a tabindex="-1" >Bus Ticket Booking</a></li><hr>
<li><a tabindex="-1" >Bus Ticket Booking</a></li><hr>
<li><a tabindex="-1" >Flight Tickets</a></li><hr>
<li><a tabindex="-1" >Flight Tickets</a></li><hr>
<li><a tabindex="-1" >Bus Tickets</a></li>
<li><a tabindex="-1" >Bus Tickets</a></li>
</ul>
</ul>
</div>
</div>
</li>
</li>
</ul>
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
<!-- /.navbar-collapse -->
</div>
</div>
<!-- /.container -->
<!-- /.container -->
</nav>
</nav>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.min.js"></script>
<script>
<script>
$(document).ready(function () {
$(document).ready(function () {
$('.dropdown-submenu a.test').on("click", function (e) {
$('.dropdown-submenu a.test').on("click", function (e) {
$(this).next('ul').toggle();
$(this).next('ul').toggle();
e.stopPropagation();
e.stopPropagation();
e.preventDefault();
e.preventDefault();
});
});
});
});
</script>
</script>
/* globals JQClass */
/* globals JQClass */
/*! Simple JavaScript Inheritance
/*! Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* By John Resig http://ejohn.org/
* MIT Licensed.
* MIT Licensed.
*/
*/
// Inspired by base2 and Prototype
// Inspired by base2 and Prototype
(function(){
(function(){
'use strict';
'use strict';
var initializing = false;
var initializing = false;
// The base JQClass implementation (does nothing)
// The base JQClass implementation (does nothing)
window.JQClass = function(){};
window.JQClass = function(){};
// Collection of derived classes
// Collection of derived classes
JQClass.classes = {};
JQClass.classes = {};
// Create a new JQClass that inherits from this class
// Create a new JQClass that inherits from this class
JQClass.extend = function extender(prop) {
JQClass.extend = function extender(prop) {
var base = this.prototype;
var base = this.prototype;
// Instantiate a base class (but only create the instance, don't run the init constructor)
// Instantiate a base class (but only create the instance, don't run the init constructor)
initializing = true;
initializing = true;
var prototype = new this();
var prototype = new this();
initializing = false;
initializing = false;
// Copy the properties over onto the new prototype
// Copy the properties over onto the new prototype
for (var name in prop) { // jshint loopfunc:true
for (var name in prop) { // jshint loopfunc:true
// Check if we're overwriting an existing function
// Check if we're overwriting an existing function
if (typeof prop[name] === 'function' && typeof base[name] === 'function') {
if (typeof prop[name] === 'function' && typeof base[name] === 'function') {
prototype[name] = (function (name, fn) {
prototype[name] = (function (name, fn) {
return function () {
return function () {
var __super = this._super;
var __super = this._super;
// Add a new ._super() method that is the same method but on the super-class
// Add a new ._super() method that is the same method but on the super-class
this._super = function (args) {
this._super = function (args) {
return base[name].apply(this, args || []);
return base[name].apply(this, args || []);
};
};
var ret = fn.apply(this, arguments);
var ret = fn.apply(this, arguments);
// The method only needs to be bound temporarily, so we remove it when we're done executing
// The method only needs to be bound temporarily, so we remove it when we're done executing
this._super = __super;
this._super = __super;
return ret;
return ret;
};
};
})(name, prop[name]);
})(name, prop[name]);
// Check if we're overwriting existing default options.
// Check if we're overwriting existing default options.
} else if (typeof prop[name] === 'object' && typeof base[name] === 'object' && name === 'defaultOptions') {
} else if (typeof prop[name] === 'object' && typeof base[name] === 'object' && name === 'defaultOptions') {
var obj1 = base[name];
var obj1 = base[name];
var obj2 = prop[name];
var obj2 = prop[name];
var obj3 = {};
var obj3 = {};
var key;
var key;
for (key in obj1) { // jshint forin:false
for (key in obj1) { // jshint forin:false
obj3[key] = obj1[key];
obj3[key] = obj1[key];
}
}
for (key in obj2) { // jshint forin:false
for (key in obj2) { // jshint forin:false
obj3[key] = obj2[key];
obj3[key] = obj2[key];
}
}
prototype[name] = obj3;
prototype[name] = obj3;
} else {
} else {
prototype[name] = prop[name];
prototype[name] = prop[name];
}
}
}
}
// The dummy class constructor
// The dummy class constructor
function JQClass() {
function JQClass() {
// All construction is actually done in the init method
// All construction is actually done in the init method
if (!initializing && this._init) {
if (!initializing && this._init) {
this._init.apply(this, arguments);
this._init.apply(this, arguments);
}
}
}
}
// Populate our constructed prototype object
// Populate our constructed prototype object
JQClass.prototype = prototype;
JQClass.prototype = prototype;
// Enforce the constructor to be what we expect
// Enforce the constructor to be what we expect
JQClass.prototype.constructor = JQClass;
JQClass.prototype.constructor = JQClass;
// And make this class extendable
// And make this class extendable
JQClass.extend = extender;
JQClass.extend = extender;
return JQClass;
return JQClass;
};
};
})();
})();
/*! Abstract base class for collection plugins v1.0.3.
/*! Abstract base class for collection plugins v1.0.3.
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
Licensed under the MIT license (http://keith-wood.name/licence.html). */
Licensed under the MIT license (http://keith-wood.name/licence.html). */
(function($) { // Ensure $, encapsulate
(function($) { // Ensure $, encapsulate
'use strict';
'use strict';
/** <p>Abstract base class for collection plugins v1.0.3.</p>
/** <p>Abstract base class for collection plugins v1.0.3.</p>
<p>Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.</p>
<p>Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.</p>
<p>Licensed under the MIT license (http://keith-wood.name/licence.html).</p>
<p>Licensed under the MIT license (http://keith-wood.name/licence.html).</p>
<p>Use {@link $.JQPlugin.createPlugin} to create new plugins using this framework.</p>
<p>Use {@link $.JQPlugin.createPlugin} to create new plugins using this framework.</p>
<p>This base class provides common functionality such as:</p>
<p>This base class provides common functionality such as:</p>
<ul>
<ul>
<li>Creates jQuery bridge - allowing you to invoke your plugin on a collection of elements.</li>
<li>Creates jQuery bridge - allowing you to invoke your plugin on a collection of elements.</li>
<li>Handles initialisation including reading settings from metadata -
<li>Handles initialisation including reading settings from metadata -
an instance object is attached to the affected element(s) containing all the necessary data.</li>
an instance object is attached to the affected element(s) containing all the necessary data.</li>
<li>Handles option retrieval and update - options can be set through default values,
<li>Handles option retrieval and update - options can be set through default values,
through inline metadata, or through instantiation settings.<br>
through inline metadata, or through instantiation settings.<br>
Metadata is specified as an attribute on the element:
Metadata is specified as an attribute on the element:
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.</li>
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.</li>
<li>Handles method calling - inner functions starting with '_'are inaccessible,
<li>Handles method calling - inner functions starting with '_'are inaccessible,
whereas others can be called via <code>$(selector).pluginName('functionName')</code>.</li>
whereas others can be called via <code>$(selector).pluginName('functionName')</code>.</li>
<li>Handles plugin destruction - removing all trace of the plugin.</li>
<li>Handles plugin destruction - removing all trace of the plugin.</li>
</ul>
</ul>
@module JQPlugin
@module JQPlugin
@abstract */
@abstract */
JQClass.classes.JQPlugin = JQClass.extend({
JQClass.classes.JQPlugin = JQClass.extend({
/** Name to identify this plugin.
/** Name to identify this plugin.
@example name: 'tabs' */
@example name: 'tabs' */
name: 'plugin',
name: 'plugin',
/** Default options for instances of this plugin (default: {}).
/** Default options for instances of this plugin (default: {}).
@example defaultOptions: {
@example defaultOptions: {
selectedClass: 'selected',
selectedClass: 'selected',
triggers: 'click'
triggers: 'click'
} */
} */
defaultOptions: {},
defaultOptions: {},
/** Options dependent on the locale.
/** Options dependent on the locale.
Indexed by language and (optional) country code, with '' denoting the default language (English/US).
Indexed by language and (optional) country code, with '' denoting the default language (English/US).
Normally additional languages would be provided as separate files to all them to be included as needed.
Normally additional languages would be provided as separate files to all them to be included as needed.
@example regionalOptions: {
@example regionalOptions: {
'': {
'': {
greeting: 'Hi'
greeting: 'Hi'
}
}
} */
} */
regionalOptions: {},
regionalOptions: {},
/** Whether or not a deep merge should be performed when accumulating options.
/** Whether or not a deep merge should be performed when accumulating options.
The default is <code>true</code> but can be overridden in a sub-class. */
The default is <code>true</code> but can be overridden in a sub-class. */
deepMerge: true,
deepMerge: true,
/** Retrieve a marker class for affected elements.
/** Retrieve a marker class for affected elements.
In the format: <code>is-<pluginName></code>.
In the format: <code>is-<pluginName></code>.
@protected
@protected
@return {string} The marker class. */
@return {string} The marker class. */
_getMarker: function() {
_getMarker: function() {
return 'is-' + this.name;
return 'is-' + this.name;
},
},
/** Initialise the plugin.
/** Initialise the plugin.
Create the jQuery bridge - plugin name <code>xyz</code>
Create the jQuery bridge - plugin name <code>xyz</code>
produces singleton <code>$.xyz</code> and collection function <code>$.fn.xyz</code>.
produces singleton <code>$.xyz</code> and collection function <code>$.fn.xyz</code>.
@protected */
@protected */
_init: function() {
_init: function() {
// Apply default localisations
// Apply default localisations
$.extend(this.defaultOptions, (this.regionalOptions && this.regionalOptions['']) || {});
$.extend(this.defaultOptions, (this.regionalOptions && this.regionalOptions['']) || {});
// Camel-case the name
// Camel-case the name
var jqName = camelCase(this.name);
var jqName = camelCase(this.name);
// Expose jQuery singleton manager
// Expose jQuery singleton manager
$[jqName] = this;
$[jqName] = this;
// Expose jQuery collection plugin
// Expose jQuery collection plugin
$.fn[jqName] = function(options) {
$.fn[jqName] = function(options) {
var otherArgs = Array.prototype.slice.call(arguments, 1);
var otherArgs = Array.prototype.slice.call(arguments, 1);
var inst = this;
var inst = this;
var returnValue = this;
var returnValue = this;
this.each(function () {
this.each(function () {
if (typeof options === 'string') {
if (typeof options === 'string') {
if (options[0] === '_' || !$[jqName][options]) {
if (options[0] === '_' || !$[jqName][options]) {
throw 'Unknown method: ' + options;
throw 'Unknown method: ' + options;
}
}
var methodValue = $[jqName][options].apply($[jqName], [this].concat(otherArgs));
var methodValue = $[jqName][options].apply($[jqName], [this].concat(otherArgs));
if (methodValue !== inst && methodValue !== undefined) {
if (methodValue !== inst && methodValue !== undefined) {
returnValue = methodValue;
returnValue = methodValue;
return false;
return false;
}
}
} else {
} else {
$[jqName]._attach(this, options);
$[jqName]._attach(this, options);
}
}
});
});
return returnValue;
return returnValue;
};
};
},
},
/** Set default options for all subsequent instances.
/** Set default options for all subsequent instances.
@param {object} options The new default options.
@param {object} options The new default options.
@example $.pluginName.setDefaults({name: value, ...}) */
@example $.pluginName.setDefaults({name: value, ...}) */
setDefaults: function(options) {
setDefaults: function(options) {
$.extend(this.defaultOptions, options || {});
$.extend(this.defaultOptions, options || {});
},
},
/** Initialise an element. Called internally only.
/** Initialise an element. Called internally only.
Adds an instance object as data named for the plugin.
Adds an instance object as data named for the plugin.
Override {@linkcode module:JQPlugin~_postAttach|_postAttach} for plugin-specific processing.
Override {@linkcode module:JQPlugin~_postAttach|_postAttach} for plugin-specific processing.
@private
@private
@param {Element} elem The element to enhance.
@param {Element} elem The element to enhance.
@param {object} options Overriding settings. */
@param {object} options Overriding settings. */
_attach: function(elem, options) {
_attach: function(elem, options) {
elem = $(elem);
elem = $(elem);
if (elem.hasClass(this._getMarker())) {
if (elem.hasClass(this._getMarker())) {
return;
return;
}
}
elem.addClass(this._getMarker());
elem.addClass(this._getMarker());
options = $.extend(this.deepMerge, {}, this.defaultOptions, this._getMetadata(elem), options || {});
options = $.extend(this.deepMerge, {}, this.defaultOptions, this._getMetadata(elem), options || {});
var inst = $.extend({name: this.name, elem: elem, options: options}, this._instSettings(elem, options));
var inst = $.extend({name: this.name, elem: elem, options: options}, this._instSettings(elem, options));
elem.data(this.name, inst); // Save instance against element
elem.data(this.name, inst); // Save instance against element
this._postAttach(elem, inst);
this._postAttach(elem, inst);
this.option(elem, options);
this.option(elem, options);
},
},
/** Retrieve additional instance settings.
/** Retrieve additional instance settings.
Override this in a sub-class to provide extra settings.
Override this in a sub-class to provide extra settings.
These are added directly to the instance object.
These are added directly to the instance object.
Default attributes of an instance object are shown as properties below:
Default attributes of an instance object are shown as properties below:
@protected
@protected
@param {jQuery} elem The current jQuery element.
@param {jQuery} elem The current jQuery element.
@param {object} options The instance options.
@param {object} options The instance options.
@return {object} Any extra instance values.
@return {object} Any extra instance values.
@property {Element} elem The element to which this instance applies.
@property {Element} elem The element to which this instance applies.
@property {string} name The name of this plugin.
@property {string} name The name of this plugin.
@property {object} options The accumulated options for this instance.
@property {object} options The accumulated options for this instance.
@example _instSettings: function(elem, options) {
@example _instSettings: function(elem, options) {
return {nav: elem.find(options.navSelector)};
return {nav: elem.find(options.navSelector)};
} */
} */
_instSettings: function(elem, options) { // jshint unused:false
_instSettings: function(elem, options) { // jshint unused:false
return {};
return {};
},
},
/** Plugin specific post initialisation.
/** Plugin specific post initialisation.
Override this in a sub-class to perform extra activities.
Override this in a sub-class to perform extra activities.
This is where you would implement your plugin's main functionality.
This is where you would implement your plugin's main functionality.
@protected
@protected
@param {jQuery} elem The current jQuery element.
@param {jQuery} elem The current jQuery element.
@param {object} inst The instance settings.
@param {object} inst The instance settings.
@example _postAttach: function(elem, inst) {
@example _postAttach: function(elem, inst) {
elem.on('click.' + this.name, function() {
elem.on('click.' + this.name, function() {
...
...
});
});
} */
} */
_postAttach: function(elem, inst) { // jshint unused:false
_postAttach: function(elem, inst) { // jshint unused:false
},
},
/** Retrieve metadata configuration from the element.
/** Retrieve metadata configuration from the element.
Metadata is specified as an attribute:
Metadata is specified as an attribute:
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.
@private
@private
@param {jQuery} elem The source element.
@param {jQuery} elem The source element.
@return {object} The inline configuration or {}. */
@return {object} The inline configuration or {}. */
_getMetadata: function(elem) {
_getMetadata: function(elem) {
try {
try {
var data = elem.data(this.name.toLowerCase()) || '';
var data = elem.data(this.name.toLowerCase()) || '';
data = data.replace(/(\\?)'/g, function(e, t) {
data = data.replace(/(\\?)'/g, function(e, t) {
return t ? '\'' : '"';
return t ? '\'' : '"';
}).replace(/([a-zA-Z0-9]+):/g, function(match, group, i) {
}).replace(/([a-zA-Z0-9]+):/g, function(match, group, i) {
var count = data.substring(0, i).match(/"/g); // Handle embedded ':'
var count = data.substring(0, i).match(/"/g); // Handle embedded ':'
return (!count || count.length % 2 === 0 ? '"' + group + '":' : group + ':');
return (!count || count.length % 2 === 0 ? '"' + group + '":' : group + ':');
}).replace(/\\:/g, ':');
}).replace(/\\:/g, ':');
data = $.parseJSON('{' + data + '}');
data = $.parseJSON('{' + data + '}');
for (var key in data) {
for (var key in data) {
if (data.hasOwnProperty(key)) {
if (data.hasOwnProperty(key)) {
var value = data[key];
var value = data[key];
if (typeof value === 'string' && value.match(/^new Date\(([-0-9,\s]*)\)$/)) { // Convert dates
if (typeof value === 'string' && value.match(/^new Date\(([-0-9,\s]*)\)$/)) { // Convert dates
data[key] = eval(value); // jshint ignore:line
data[key] = eval(value); // jshint ignore:line
}
}
}
}
}
}
return data;
return data;
}
}
catch (e) {
catch (e) {
return {};
return {};
}
}
},
},
/** Retrieve the instance data for element.
/** Retrieve the instance data for element.
@protected
@protected
@param {Element} elem The source element.
@param {Element} elem The source element.
@return {object} The instance data or <code>{}</code> if none. */
@return {object} The instance data or <code>{}</code> if none. */
_getInst: function(elem) {
_getInst: function(elem) {
return $(elem).data(this.name) || {};
return $(elem).data(this.name) || {};
},
},
/** Retrieve or reconfigure the settings for a plugin.
/** Retrieve or reconfigure the settings for a plugin.
If new settings are provided they are applied to the instance options.
If new settings are provided they are applied to the instance options.
If an option name only is provided the value of that option is returned.
If an option name only is provided the value of that option is returned.
If no name or value is provided, all options are returned.
If no name or value is provided, all options are returned.
Override {@linkcode module:JQPlugin~_optionsChanged|_optionsChanged}
Override {@linkcode module:JQPlugin~_optionsChanged|_optionsChanged}
for plugin-specific processing when option values change.
for plugin-specific processing when option values change.
@param {Element} elem The source element.
@param {Element} elem The source element.
@param {object|string} [name] The collection of new option values or the name of a single option.
@param {object|string} [name] The collection of new option values or the name of a single option.
@param {any} [value] The value for a single named option.
@param {any} [value] The value for a single named option.
@return {any|object} If retrieving a single value or all options.
@return {any|object} If retrieving a single value or all options.
@example $(selector).plugin('option', 'name', value) // Set one option
@example $(selector).plugin('option', 'name', value) // Set one option
$(selector).plugin('option', {name: value, ...}) // Set multiple options
$(selector).plugin('option', {name: value, ...}) // Set multiple options
var value = $(selector).plugin('option', 'name') // Get one option
var value = $(selector).plugin('option', 'name') // Get one option
var options = $(selector).plugin('option') // Get all options */
var options = $(selector).plugin('option') // Get all options */
option: function(elem, name, value) {
option: function(elem, name, value) {
elem = $(elem);
elem = $(elem);
var inst = elem.data(this.name);
var inst = elem.data(this.name);
var options = name || {};
var options = name || {};
if (!name || (typeof name === 'string' && typeof value === 'undefined')) {
if (!name || (typeof name === 'string' && typeof value === 'undefined')) {
options = (inst || {}).options;
options = (inst || {}).options;
return (options && name ? options[name] : options);
return (options && name ? options[name] : options);
}
}
if (!elem.hasClass(this._getMarker())) {
if (!elem.hasClass(this._getMarker())) {
return;
return;
}
}
if (typeof name === 'string') {
if (typeof name === 'string') {
options = {};
options = {};
options[name] = value;
options[name] = value;
}
}
this._optionsChanged(elem, inst, options);
this._optionsChanged(elem, inst, options);
$.extend(inst.options, options);
$.extend(inst.options, options);
},
},
/** Plugin specific options processing.
/** Plugin specific options processing.
Old value available in <code>inst.options[name]</code>, new value in <code>options[name]</code>.
Old value available in <code>inst.options[name]</code>, new value in <code>options[name]</code>.
Override this in a sub-class to perform extra activities.
Override this in a sub-class to perform extra activities.
@protected
@protected
@param {jQuery} elem The current jQuery element.
@param {jQuery} elem The current jQuery element.
@param {object} inst The instance settings.
@param {object} inst The instance settings.
@param {object} options The new options.
@param {object} options The new options.
@example _optionsChanged: function(elem, inst, options) {
@example _optionsChanged: function(elem, inst, options) {
if (options.name != inst.options.name) {
if (options.name != inst.options.name) {
elem.removeClass(inst.options.name).addClass(options.name);
elem.removeClass(inst.options.name).addClass(options.name);
}
}
} */
} */
_optionsChanged: function(elem, inst, options) { // jshint unused:false
_optionsChanged: function(elem, inst, options) { // jshint unused:false
},
},
/** Remove all trace of the plugin.
/** Remove all trace of the plugin.
Override {@linkcode module:JQPlugin~_preDestroy|_preDestroy} for plugin-specific processing.
Override {@linkcode module:JQPlugin~_preDestroy|_preDestroy} for plugin-specific processing.
@param {Element} elem The source element.
@param {Element} elem The source element.
@example $(selector).plugin('destroy') */
@example $(selector).plugin('destroy') */
destroy: function(elem) {
destroy: function(elem) {
elem = $(elem);
elem = $(elem);
if (!elem.hasClass(this._getMarker())) {
if (!elem.hasClass(this._getMarker())) {
return;
return;
}
}
this._preDestroy(elem, this._getInst(elem));
this._preDestroy(elem, this._getInst(elem));
elem.removeData(this.name).removeClass(this._getMarker());
elem.removeData(this.name).removeClass(this._getMarker());
},
},
/** Plugin specific pre destruction.
/** Plugin specific pre destruction.
It is invoked as part of the {@linkcode module:JQPlugin~destroy|destroy} processing.
It is invoked as part of the {@linkcode module:JQPlugin~destroy|destroy} processing.
Override this in a sub-class to perform extra activities and undo everything that was
Override this in a sub-class to perform extra activities and undo everything that was
done in the {@linkcode module:JQPlugin~_postAttach|_postAttach} or
done in the {@linkcode module:JQPlugin~_postAttach|_postAttach} or
{@linkcode module:JQPlugin~_optionsChanged|_optionsChanged} functions.
{@linkcode module:JQPlugin~_optionsChanged|_optionsChanged} functions.
@protected
@protected
@param {jQuery} elem The current jQuery element.
@param {jQuery} elem The current jQuery element.
@param {object} inst The instance settings.
@param {object} inst The instance settings.
@example _preDestroy: function(elem, inst) {
@example _preDestroy: function(elem, inst) {
elem.off('.' + this.name);
elem.off('.' + this.name);
} */
} */
_preDestroy: function(elem, inst) { // jshint unused:false
_preDestroy: function(elem, inst) { // jshint unused:false
}
}
});
});
/** Convert names from hyphenated to camel-case.
/** Convert names from hyphenated to camel-case.
@private
@private
@param {string} value The original hyphenated name.
@param {string} value The original hyphenated name.
@return {string} The camel-case version. */
@return {string} The camel-case version. */
function camelCase(name) {
function camelCase(name) {
return name.replace(/-([a-z])/g, function(match, group) {
return name.replace(/-([a-z])/g, function(match, group) {
return group.toUpperCase();
return group.toUpperCase();
});
});
}
}
/** Expose the plugin base.
/** Expose the plugin base.
@namespace $.JQPlugin */
@namespace $.JQPlugin */
$.JQPlugin = {
$.JQPlugin = {
/** Create a new collection plugin.
/** Create a new collection plugin.
@memberof $.JQPlugin
@memberof $.JQPlugin
@param {string} [superClass='JQPlugin'] The name of the parent class to inherit from.
@param {string} [superClass='JQPlugin'] The name of the parent class to inherit from.
@param {object} overrides The property/function overrides for the new class.
@param {object} overrides The property/function overrides for the new class.
See {@link module:JQPlugin|JQPlugin} for the base functionality.
See {@link module:JQPlugin|JQPlugin} for the base functionality.
@example $.JQPlugin.createPlugin({ // Define the plugin
@example $.JQPlugin.createPlugin({ // Define the plugin
name: 'tabs',
name: 'tabs',
defaultOptions: {selectedClass: 'selected'},
defaultOptions: {selectedClass: 'selected'},
_initSettings: function(elem, options) { return {...}; },
_initSettings: function(elem, options) { return {...}; },
_postAttach: function(elem, inst) { ... }
_postAttach: function(elem, inst) { ... }
});
});
$('selector').tabs(); // And instantiate it */
$('selector').tabs(); // And instantiate it */
createPlugin: function(superClass, overrides) {
createPlugin: function(superClass, overrides) {
if (typeof superClass === 'object') {
if (typeof superClass === 'object') {
overrides = superClass;
overrides = superClass;
superClass = 'JQPlugin';
superClass = 'JQPlugin';
}
}
superClass = camelCase(superClass);
superClass = camelCase(superClass);
var className = camelCase(overrides.name);
var className = camelCase(overrides.name);
JQClass.classes[className] = JQClass.classes[superClass].extend(overrides);
JQClass.classes[className] = JQClass.classes[superClass].extend(overrides);
new JQClass.classes[className](); // jshint ignore:line
new JQClass.classes[className](); // jshint ignore:line
}
}
};
};
})(jQuery);
})(jQuery);
/*!
* Modernizr v2.8.2
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
* Available under the BSD and MIT licenses: www.modernizr.com/license/
*/
/*
* Modernizr tests which native CSS3 and HTML5 features are available in
* the current UA and makes the results available to you in two ways:
* as properties on a global Modernizr object, and as classes on the
* <html> element. This information allows you to progressively enhance
* your pages with a granular level of control over the experience.
*
* Modernizr has an optional (not included) conditional resource loader
* called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
* To get a build that includes Modernizr.load(), as well as choosing
* which tests to include, go to www.modernizr.com/download/
*
* Authors Faruk Ates, Paul Irish, Alex Sexton
* Contributors Ryan Seddon, Ben Alman
*/
window.Modernizr = (function( window, document, undefined ) {
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.2',
var version = '2.8.2',
Modernizr = {},
Modernizr = {},
/*>>cssclasses*/
/*>>cssclasses*/
// option for enabling the HTML classes to be added
// option for enabling the HTML classes to be added
enableClasses = true,
enableClasses = true,
/*>>cssclasses*/
/*>>cssclasses*/
docElement = document.documentElement,
docElement = document.documentElement,
/**
/**
* Create our "modernizr" element that we do most feature tests on.
* Create our "modernizr" element that we do most feature tests on.
*/
*/
mod = 'modernizr',
mod = 'modernizr',
modElem = document.createElement(mod),
modElem = document.createElement(mod),
mStyle = modElem.style,
mStyle = modElem.style,
/**
/**
* Create the input element for various Web Forms feature tests.
* Create the input element for various Web Forms feature tests.
*/
*/
inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,
inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,
/*>>smile*/
/*>>smile*/
smile = ':)',
smile = ':)',
/*>>smile*/
/*>>smile*/
toString = {}.toString,
toString = {}.toString,
// TODO :: make the prefixes more granular
// TODO :: make the prefixes more granular
/*>>prefixes*/
/*>>prefixes*/
// List of property values to set for css tests. See ticket #21
// List of property values to set for css tests. See ticket #21
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
/*>>prefixes*/
/*>>prefixes*/
/*>>domprefixes*/
/*>>domprefixes*/
// Following spec is to expose vendor-specific style properties as:
// Following spec is to expose vendor-specific style properties as:
// elem.style.WebkitBorderRadius
// elem.style.WebkitBorderRadius
// and the following would be incorrect:
// and the following would be incorrect:
// elem.style.webkitBorderRadius
// elem.style.webkitBorderRadius
// Webkit ghosts their properties in lowercase but Opera & Moz do not.
// Webkit ghosts their properties in lowercase but Opera & Moz do not.
// Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
// Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
// erik.eae.net/archives/2008/03/10/21.48.10/
// erik.eae.net/archives/2008/03/10/21.48.10/
// More here: github.com/Modernizr/Modernizr/issues/issue/21
// More here: github.com/Modernizr/Modernizr/issues/issue/21
omPrefixes = 'Webkit Moz O ms',
omPrefixes = 'Webkit Moz O ms',
cssomPrefixes = omPrefixes.split(' '),
cssomPrefixes = omPrefixes.split(' '),
domPrefixes = omPrefixes.toLowerCase().split(' '),
domPrefixes = omPrefixes.toLowerCase().split(' '),
/*>>domprefixes*/
/*>>domprefixes*/
/*>>ns*/
/*>>ns*/
ns = {'svg': 'http://www.w3.org/2000/svg'},
ns = {'svg': 'http://www.w3.org/2000/svg'},
/*>>ns*/
/*>>ns*/
tests = {},
tests = {},
inputs = {},
inputs = {},
attrs = {},
attrs = {},
classes = [],
classes = [],
slice = classes.slice,
slice = classes.slice,
featureName, // used in testing loop
featureName, // used in testing loop
/*>>teststyles*/
/*>>teststyles*/
// Inject element with style element and some CSS rules
// Inject element with style element and some CSS rules
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
var style, ret, node, docOverflow,
div = document.createElement('div'),
div = document.createElement('div'),
// After page load injecting a fake body doesn't work so check if body exists
// After page load injecting a fake body doesn't work so check if body exists
body = document.body,
body = document.body,
// IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
// IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
fakeBody = body || document.createElement('body');
fakeBody = body || document.createElement('body');
if ( parseInt(nodes, 10) ) {
if ( parseInt(nodes, 10) ) {
// In order not to give false positives we create a node for each test
// In order not to give false positives we create a node for each test
// This also allows the method to scale for unspecified uses
// This also allows the method to scale for unspecified uses
while ( nodes-- ) {
while ( nodes-- ) {
node = document.createElement('div');
node = document.createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
div.appendChild(node);
}
}
}
}
// <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
// <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
// when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
// when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
// with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
// with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
// msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
// msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
// Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277
// Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
div.id = mod;
div.id = mod;
// IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
// IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
// Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
// Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
(body ? div : fakeBody).innerHTML += style;
(body ? div : fakeBody).innerHTML += style;
fakeBody.appendChild(div);
fakeBody.appendChild(div);
if ( !body ) {
if ( !body ) {
//avoid crashing IE8, if background image is used
//avoid crashing IE8, if background image is used
fakeBody.style.background = '';
fakeBody.style.background = '';
//Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
//Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
fakeBody.style.overflow = 'hidden';
fakeBody.style.overflow = 'hidden';
docOverflow = docElement.style.overflow;
docOverflow = docElement.style.overflow;
docElement.style.overflow = 'hidden';
docElement.style.overflow = 'hidden';
docElement.appendChild(fakeBody);
docElement.appendChild(fakeBody);
}
}
ret = callback(div, rule);
ret = callback(div, rule);
// If this is done after page load we don't want to remove the body so check if body exists
// If this is done after page load we don't want to remove the body so check if body exists
if ( !body ) {
if ( !body ) {
fakeBody.parentNode.removeChild(fakeBody);
fakeBody.parentNode.removeChild(fakeBody);
docElement.style.overflow = docOverflow;
docElement.style.overflow = docOverflow;
} else {
} else {
div.parentNode.removeChild(div);
div.parentNode.removeChild(div);
}
}
return !!ret;
return !!ret;
},
},
/*>>teststyles*/
/*>>teststyles*/
/*>>mq*/
/*>>mq*/
// adapted from matchMedia polyfill
// adapted from matchMedia polyfill
// by Scott Jehl and Paul Irish
// by Scott Jehl and Paul Irish
// gist.github.com/786768
// gist.github.com/786768
testMediaQuery = function( mq ) {
testMediaQuery = function( mq ) {
var matchMedia = window.matchMedia || window.msMatchMedia;
var matchMedia = window.matchMedia || window.msMatchMedia;
if ( matchMedia ) {
if ( matchMedia ) {
return matchMedia(mq) && matchMedia(mq).matches || false;
return matchMedia(mq) && matchMedia(mq).matches || false;
}
}
var bool;
var bool;
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
bool = (window.getComputedStyle ?
bool = (window.getComputedStyle ?
getComputedStyle(node, null) :
getComputedStyle(node, null) :
node.currentStyle)['position'] == 'absolute';
node.currentStyle)['position'] === 'absolute';
});
});
return bool;
return bool;
},
},
/*>>mq*/
/*>>mq*/
/*>>hasevent*/
/*>>hasevent*/
//
//
// isEventSupported determines if a given element supports the given event
// isEventSupported determines if a given element supports the given event
// kangax.github.com/iseventsupported/
// kangax.github.com/iseventsupported/
//
//
// The following results are known incorrects:
// The following results are known incorrects:
// Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
// Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
// Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
// Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
// ...
// ...
isEventSupported = (function() {
isEventSupported = (function() {
var TAGNAMES = {
var TAGNAMES = {
'select': 'input', 'change': 'input',
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
'submit': 'form', 'reset': 'form',
'error': 'img', 'load': 'img', 'abort': 'img'
'error': 'img', 'load': 'img', 'abort': 'img'
};
};
function isEventSupported( eventName, element ) {
function isEventSupported( eventName, element ) {
element = element || document.createElement(TAGNAMES[eventName] || 'div');
element = element || document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
eventName = 'on' + eventName;
// When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
// When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
var isSupported = eventName in element;
var isSupported = eventName in element;
if ( !isSupported ) {
if ( !isSupported ) {
// If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
// If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
if ( !element.setAttribute ) {
if ( !element.setAttribute ) {
element = document.createElement('div');
element = document.createElement('div');
}
}
if ( element.setAttribute && element.removeAttribute ) {
if ( element.setAttribute && element.removeAttribute ) {
element.setAttribute(eventName, '');
element.setAttribute(eventName, '');
isSupported = is(element[eventName], 'function');
isSupported = is(element[eventName], 'function');
// If property was created, "remove it" (by setting value to `undefined`)
// If property was created, "remove it" (by setting value to `undefined`)
if ( !is(element[eventName], 'undefined') ) {
if ( !is(element[eventName], 'undefined') ) {
element[eventName] = undefined;
element[eventName] = undefined;
}
}
element.removeAttribute(eventName);
element.removeAttribute(eventName);
}
}
}
}
element = null;
element = null;
return isSupported;
return isSupported;
}
}
return isEventSupported;
return isEventSupported;
})(),
})(),
/*>>hasevent*/
/*>>hasevent*/
// TODO :: Add flag for hasownprop ? didn't last time
// TODO :: Add flag for hasownprop ? didn't last time
// hasOwnProperty shim by kangax needed for Safari 2.0 support
// hasOwnProperty shim by kangax needed for Safari 2.0 support
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
hasOwnProp = function (object, property) {
hasOwnProp = function (object, property) {
return _hasOwnProperty.call(object, property);
return _hasOwnProperty.call(object, property);
};
};
}
}
else {
else {
hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
};
};
}
}
// Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
// Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
// es5.github.com/#x15.3.4.5
// es5.github.com/#x15.3.4.5
if (!Function.prototype.bind) {
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(that) {
Function.prototype.bind = function bind(that) {
var target = this;
var target = this;
if (typeof target != "function") {
if (typeof target != "function") {
throw new TypeError();
throw new TypeError();
}
}
var args = slice.call(arguments, 1),
var args = slice.call(arguments, 1),
bound = function () {
bound = function () {
if (this instanceof bound) {
if (this instanceof bound) {
var F = function(){};
var F = function(){};
F.prototype = target.prototype;
F.prototype = target.prototype;
var self = new F();
var self = new F();
var result = target.apply(
var result = target.apply(
self,
self,
args.concat(slice.call(arguments))
args.concat(slice.call(arguments))
);
);
if (Object(result) === result) {
if (Object(result) === result) {
return result;
return result;
}
}
return self;
return self;
} else {
} else {
return target.apply(
return target.apply(
that,
that,
args.concat(slice.call(arguments))
args.concat(slice.call(arguments))
);
);
}
}
};
};
return bound;
return bound;
};
};
}
}
/**
/**
* setCss applies given styles to the Modernizr DOM node.
* setCss applies given styles to the Modernizr DOM node.
*/
*/
function setCss( str ) {
function setCss( str ) {
mStyle.cssText = str;
mStyle.cssText = str;
}
}
/**
/**
* setCssAll extrapolates all vendor-specific css strings.
* setCssAll extrapolates all vendor-specific css strings.
*/
*/
function setCssAll( str1, str2 ) {
function setCssAll( str1, str2 ) {
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
}
}
/**
/**
* is returns a boolean for if typeof obj is exactly type.
* is returns a boolean for if typeof obj is exactly type.
*/
*/
function is( obj, type ) {
function is( obj, type ) {
return typeof obj === type;
return typeof obj === type;
}
}
/**
/**
* contains returns a boolean for if substr is found within str.
* contains returns a boolean for if substr is found within str.
*/
*/
function contains( str, substr ) {
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
if(('' + str).indexOf(substr) == -1) {
return false;
} else{
return true;
}
//return !!~('' + str).indexOf(substr);
}
}
/*>>testprop*/
/*>>testprop*/
// testProps is a generic CSS / DOM property test.
// testProps is a generic CSS / DOM property test.
// In testing support for a given CSS property, it's legit to test:
// In testing support for a given CSS property, it's legit to test:
// `elem.style[styleName] !== undefined`
// `elem.style[styleName] !== undefined`
// If the property is supported it will return an empty string,
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.
// if unsupported it will return undefined.
// We'll take advantage of this quick test and skip setting a style
// We'll take advantage of this quick test and skip setting a style
// on our modernizr element, but instead just testing undefined vs
// on our modernizr element, but instead just testing undefined vs
// empty string.
// empty string.
// Because the testing of the CSS property names (with "-", as
// Because the testing of the CSS property names (with "-", as
// opposed to the camelCase DOM properties) is non-portable and
// opposed to the camelCase DOM properties) is non-portable and
// non-standard but works in WebKit and IE (but not Gecko or Opera),
// non-standard but works in WebKit and IE (but not Gecko or Opera),
// we explicitly reject properties with dashes so that authors
// we explicitly reject properties with dashes so that authors
// developing in WebKit or IE first don't end up with
// developing in WebKit or IE first don't end up with
// browser-specific content by accident.
// browser-specific content by accident.
function testProps( props, prefixed ) {
function testProps( props, prefixed ) {
for ( var i in props ) {
for ( var i in props ) {
var prop = props[i];
var prop = props[i];
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
return prefixed == 'pfx' ? prop : true;
return prefixed === 'pfx' ? prop : true;
}
}
}
}
return false;
return false;
}
}
/*>>testprop*/
/*>>testprop*/
// TODO :: add testDOMProps
// TODO :: add testDOMProps
/**
/**
* testDOMProps is a generic DOM property test; if a browser supports
* testDOMProps is a generic DOM property test; if a browser supports
* a certain property, it won't return undefined for it.
* a certain property, it won't return undefined for it.
*/
*/
function testDOMProps( props, obj, elem ) {
function testDOMProps( props, obj, elem ) {
for ( var i in props ) {
for ( var i in props ) {
var item = obj[props[i]];
var item = obj[props[i]];
if ( item !== undefined) {
if ( item !== undefined) {
// return the property name as a string
// return the property name as a string
if (elem === false) return props[i];
if (elem === false) return props[i];
// let's bind a function
// let's bind a function
if (is(item, 'function')){
if (is(item, 'function')){
// default to autobind unless override
// default to autobind unless override
return item.bind(elem || obj);
return item.bind(elem || obj);
}
}
// return the unbound function or obj or value
// return the unbound function or obj or value
return item;
return item;
}
}
}
}
return false;
return false;
}
}
/*>>testallprops*/
/*>>testallprops*/
/**
/**
* testPropsAll tests a list of DOM properties we want to check against.
* testPropsAll tests a list of DOM properties we want to check against.
* We specify literally ALL possible (known and/or likely) properties on
* We specify literally ALL possible (known and/or likely) properties on
* the element including the non-vendor prefixed one, for forward-
* the element including the non-vendor prefixed one, for forward-
* compatibility.
* compatibility.
*/
*/
function testPropsAll( prop, prefixed, elem ) {
function testPropsAll( prop, prefixed, elem ) {
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
// did they call .prefixed('boxSizing') or are we just testing a prop?
// did they call .prefixed('boxSizing') or are we just testing a prop?
if(is(prefixed, "string") || is(prefixed, "undefined")) {
if(is(prefixed, "string") || is(prefixed, "undefined")) {
return testProps(props, prefixed);
return testProps(props, prefixed);
// otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
// otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
} else {
} else {
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
return testDOMProps(props, prefixed, elem);
}
}
}
}
/*>>testallprops*/
/*>>testallprops*/
/**
/**
* Tests
* Tests
* -----
* -----
*/
*/
// The *new* flexbox
// The *new* flexbox
// dev.w3.org/csswg/css3-flexbox
// dev.w3.org/csswg/css3-flexbox
tests['flexbox'] = function() {
tests['flexbox'] = function() {
return testPropsAll('flexWrap');
return testPropsAll('flexWrap');
};
};
// The *old* flexbox
// The *old* flexbox
// www.w3.org/TR/2009/WD-css3-flexbox-20090723/
// www.w3.org/TR/2009/WD-css3-flexbox-20090723/
tests['flexboxlegacy'] = function() {
tests['flexboxlegacy'] = function() {
return testPropsAll('boxDirection');
return testPropsAll('boxDirection');
};
};
// On the S60 and BB Storm, getContext exists, but always returns undefined
// On the S60 and BB Storm, getContext exists, but always returns undefined
// so we actually have to call getContext() to verify
// so we actually have to call getContext() to verify
// github.com/Modernizr/Modernizr/issues/issue/97/
// github.com/Modernizr/Modernizr/issues/issue/97/
tests['canvas'] = function() {
tests['canvas'] = function() {
var elem = document.createElement('canvas');
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
return !!(elem.getContext && elem.getContext('2d'));
};
};
tests['canvastext'] = function() {
tests['canvastext'] = function() {
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
};
};
// webk.it/70117 is tracking a legit WebGL feature detect proposal
// webk.it/70117 is tracking a legit WebGL feature detect proposal
// We do a soft detect which may false positive in order to avoid
// We do a soft detect which may false positive in order to avoid
// an expensive context creation: bugzil.la/732441
// an expensive context creation: bugzil.la/732441
tests['webgl'] = function() {
tests['webgl'] = function() {
return !!window.WebGLRenderingContext;
return !!window.WebGLRenderingContext;
};
};
/*
/*
* The Modernizr.touch test only indicates if the browser supports
* The Modernizr.touch test only indicates if the browser supports
* touch events, which does not necessarily reflect a touchscreen
* touch events, which does not necessarily reflect a touchscreen
* device, as evidenced by tablets running Windows 7 or, alas,
* device, as evidenced by tablets running Windows 7 or, alas,
* the Palm Pre / WebOS (touch) phones.
* the Palm Pre / WebOS (touch) phones.
*
*
* Additionally, Chrome (desktop) used to lie about its support on this,
* Additionally, Chrome (desktop) used to lie about its support on this,
* but that has since been rectified: crbug.com/36415
* but that has since been rectified: crbug.com/36415
*
*
* We also test for Firefox 4 Multitouch Support.
* We also test for Firefox 4 Multitouch Support.
*
*
* For more info, see: modernizr.github.com/Modernizr/touch.html
* For more info, see: modernizr.github.com/Modernizr/touch.html
*/
*/
tests['touch'] = function() {
tests['touch'] = function() {
var bool;
var bool;
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
bool = true;
bool = true;
} else {
} else {
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
bool = node.offsetTop === 9;
bool = node.offsetTop === 9;
});
});
}
}
return bool;
return bool;
};
};
// geolocation is often considered a trivial feature detect...
// geolocation is often considered a trivial feature detect...
// Turns out, it's quite tricky to get right:
// Turns out, it's quite tricky to get right:
//
//
// Using !!navigator.geolocation does two things we don't want. It:
// Using !!navigator.geolocation does two things we don't want. It:
// 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
// 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
// 2. Disables page caching in WebKit: webk.it/43956
// 2. Disables page caching in WebKit: webk.it/43956
//
//
// Meanwhile, in Firefox < 8, an about:config setting could expose
// Meanwhile, in Firefox < 8, an about:config setting could expose
// a false positive that would throw an exception: bugzil.la/688158
// a false positive that would throw an exception: bugzil.la/688158
tests['geolocation'] = function() {
tests['geolocation'] = function() {
return 'geolocation' in navigator;
return 'geolocation' in navigator;
};
};
tests['postmessage'] = function() {
tests['postmessage'] = function() {
return !!window.postMessage;
return !!window.postMessage;
};
};
// Chrome incognito mode used to throw an exception when using openDatabase
// Chrome incognito mode used to throw an exception when using openDatabase
// It doesn't anymore.
// It doesn't anymore.
tests['websqldatabase'] = function() {
tests['websqldatabase'] = function() {
return !!window.openDatabase;
return !!window.openDatabase;
};
};
// Vendors had inconsistent prefixing with the experimental Indexed DB:
// Vendors had inconsistent prefixing with the experimental Indexed DB:
// - Webkit's implementation is accessible through webkitIndexedDB
// - Webkit's implementation is accessible through webkitIndexedDB
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
// For speed, we don't test the legacy (and beta-only) indexedDB
// For speed, we don't test the legacy (and beta-only) indexedDB
tests['indexedDB'] = function() {
tests['indexedDB'] = function() {
return !!testPropsAll("indexedDB", window);
return !!testPropsAll("indexedDB", window);
};
};
// documentMode logic from YUI to filter out IE8 Compat Mode
// documentMode logic from YUI to filter out IE8 Compat Mode
// which false positives.
// which false positives.
tests['hashchange'] = function() {
tests['hashchange'] = function() {
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
};
};
// Per 1.6:
// Per 1.6:
// This used to be Modernizr.historymanagement but the longer
// This used to be Modernizr.historymanagement but the longer
// name has been deprecated in favor of a shorter and property-matching one.
// name has been deprecated in favor of a shorter and property-matching one.
// The old API is still available in 1.6, but as of 2.0 will throw a warning,
// The old API is still available in 1.6, but as of 2.0 will throw a warning,
// and in the first release thereafter disappear entirely.
// and in the first release thereafter disappear entirely.
tests['history'] = function() {
tests['history'] = function() {
return !!(window.history && history.pushState);
return !!(window.history && history.pushState);
};
};
tests['draganddrop'] = function() {
tests['draganddrop'] = function() {
var div = document.createElement('div');
var div = document.createElement('div');
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
};
};
// FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
// FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
// will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
// will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
// FF10 still uses prefixes, so check for it until then.
// FF10 still uses prefixes, so check for it until then.
// for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
// for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
tests['websockets'] = function() {
tests['websockets'] = function() {
return 'WebSocket' in window || 'MozWebSocket' in window;
return 'WebSocket' in window || 'MozWebSocket' in window;
};
};
// css-tricks.com/rgba-browser-support/
// css-tricks.com/rgba-browser-support/
tests['rgba'] = function() {
tests['rgba'] = function() {
// Set an rgba() color and check the returned value
// Set an rgba() color and check the returned value
setCss('background-color:rgba(150,255,150,.5)');
setCss('background-color:rgba(150,255,150,.5)');
return contains(mStyle.backgroundColor, 'rgba');
return contains(mStyle.backgroundColor, 'rgba');
};
};
tests['hsla'] = function() {
tests['hsla'] = function() {
// Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
// Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
// except IE9 who retains it as hsla
// except IE9 who retains it as hsla
setCss('background-color:hsla(120,40%,100%,.5)');
setCss('background-color:hsla(120,40%,100%,.5)');
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
};
};
tests['multiplebgs'] = function() {
tests['multiplebgs'] = function() {
// Setting multiple images AND a color on the background shorthand property
// Setting multiple images AND a color on the background shorthand property
// and then querying the style.background property value for the number of
// and then querying the style.background property value for the number of
// occurrences of "url(" is a reliable method for detecting ACTUAL support for this!
// occurrences of "url(" is a reliable method for detecting ACTUAL support for this!
setCss('background:url(https://),url(https://),red url(https://)');
setCss('background:url(https://),url(https://),red url(https://)');
// If the UA supports multiple backgrounds, there should be three occurrences
// If the UA supports multiple backgrounds, there should be three occurrences
// of the string "url(" in the return value for elemStyle.background
// of the string "url(" in the return value for elemStyle.background
return (/(url\s*\(.*?){3}/).test(mStyle.background);
return (/(url\s*\(.*?){3}/).test(mStyle.background);
};
};
// this will false positive in Opera Mini
// this will false positive in Opera Mini
// github.com/Modernizr/Modernizr/issues/396
// github.com/Modernizr/Modernizr/issues/396
tests['backgroundsize'] = function() {
tests['backgroundsize'] = function() {
return testPropsAll('backgroundSize');
return testPropsAll('backgroundSize');
};
};
tests['borderimage'] = function() {
tests['borderimage'] = function() {
return testPropsAll('borderImage');
return testPropsAll('borderImage');
};
};
// Super comprehensive table about all the unique implementations of
// Super comprehensive table about all the unique implementations of
// border-radius: muddledramblings.com/table-of-css3-border-radius-compliance
// border-radius: muddledramblings.com/table-of-css3-border-radius-compliance
tests['borderradius'] = function() {
tests['borderradius'] = function() {
return testPropsAll('borderRadius');
return testPropsAll('borderRadius');
};
};
// WebOS unfortunately false positives on this test.
// WebOS unfortunately false positives on this test.
tests['boxshadow'] = function() {
tests['boxshadow'] = function() {
return testPropsAll('boxShadow');
return testPropsAll('boxShadow');
};
};
// FF3.0 will false positive on this test
// FF3.0 will false positive on this test
tests['textshadow'] = function() {
tests['textshadow'] = function() {
return document.createElement('div').style.textShadow === '';
return document.createElement('div').style.textShadow === '';
};
};
tests['opacity'] = function() {
tests['opacity'] = function() {
// Browsers that actually have CSS Opacity implemented have done so
// Browsers that actually have CSS Opacity implemented have done so
// according to spec, which means their return values are within the
// according to spec, which means their return values are within the
// range of [0.0,1.0] - including the leading zero.
// range of [0.0,1.0] - including the leading zero.
setCssAll('opacity:.55');
setCssAll('opacity:.55');
// The non-literal . in this regex is intentional:
// The non-literal . in this regex is intentional:
// German Chrome returns this value as 0,55
// German Chrome returns this value as 0,55
// github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
// github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
return (/^0.55$/).test(mStyle.opacity);
return (/^0.55$/).test(mStyle.opacity);
};
};
// Note, Android < 4 will pass this test, but can only animate
// Note, Android < 4 will pass this test, but can only animate
// a single property at a time
// a single property at a time
// goo.gl/v3V4Gp
// goo.gl/v3V4Gp
tests['cssanimations'] = function() {
tests['cssanimations'] = function() {
return testPropsAll('animationName');
return testPropsAll('animationName');
};
};
tests['csscolumns'] = function() {
tests['csscolumns'] = function() {
return testPropsAll('columnCount');
return testPropsAll('columnCount');
};
};
tests['cssgradients'] = function() {
tests['cssgradients'] = function() {
/**
/**
* For CSS Gradients syntax, please see:
* For CSS Gradients syntax, please see:
* webkit.org/blog/175/introducing-css-gradients/
* webkit.org/blog/175/introducing-css-gradients/
* developer.mozilla.org/en/CSS/-moz-linear-gradient
* developer.mozilla.org/en/CSS/-moz-linear-gradient
* developer.mozilla.org/en/CSS/-moz-radial-gradient
* developer.mozilla.org/en/CSS/-moz-radial-gradient
* dev.w3.org/csswg/css3-images/#gradients-
* dev.w3.org/csswg/css3-images/#gradients-
*/
*/
var str1 = 'background-image:',
var str1 = 'background-image:',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';
str3 = 'linear-gradient(left top,#9f9, white);';
setCss(
setCss(
// legacy webkit syntax (FIXME: remove when syntax not in use anymore)
// legacy webkit syntax (FIXME: remove when syntax not in use anymore)
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
// standard syntax // trailing 'background-image:'
// standard syntax // trailing 'background-image:'
prefixes.join(str3 + str1)).slice(0, -str1.length)
prefixes.join(str3 + str1)).slice(0, -str1.length)
);
);
return contains(mStyle.backgroundImage, 'gradient');
return contains(mStyle.backgroundImage, 'gradient');
};
};
tests['cssreflections'] = function() {
tests['cssreflections'] = function() {
return testPropsAll('boxReflect');
return testPropsAll('boxReflect');
};
};
tests['csstransforms'] = function() {
tests['csstransforms'] = function() {
return !!testPropsAll('transform');
return !!testPropsAll('transform');
};
};
tests['csstransforms3d'] = function() {
tests['csstransforms3d'] = function() {
var ret = !!testPropsAll('perspective');
var ret = !!testPropsAll('perspective');
// Webkit's 3D transforms are passed off to the browser's own graphics renderer.
// Webkit's 3D transforms are passed off to the browser's own graphics renderer.
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
// some conditions. As a result, Webkit typically recognizes the syntax but
// some conditions. As a result, Webkit typically recognizes the syntax but
// will sometimes throw a false positive, thus we must do a more thorough check:
// will sometimes throw a false positive, thus we must do a more thorough check:
if ( ret && 'webkitPerspective' in docElement.style ) {
if ( ret && 'webkitPerspective' in docElement.style ) {
// Webkit allows this media query to succeed only if the feature is enabled.
// Webkit allows this media query to succeed only if the feature is enabled.
// `@media (transform-3d),(-webkit-transform-3d){ ... }`
// `@media (transform-3d),(-webkit-transform-3d){ ... }`
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
});
});
}
}
return ret;
return ret;
};
};
tests['csstransitions'] = function() {
tests['csstransitions'] = function() {
return testPropsAll('transition');
return testPropsAll('transition');
};
};
/*>>fontface*/
/*>>fontface*/
// @font-face detection routine by Diego Perini
// @font-face detection routine by Diego Perini
// javascript.nwbox.com/CSSSupport/
// javascript.nwbox.com/CSSSupport/
// false positives:
// false positives:
// WebOS github.com/Modernizr/Modernizr/issues/342
// WebOS github.com/Modernizr/Modernizr/issues/342
// WP7 github.com/Modernizr/Modernizr/issues/538
// WP7 github.com/Modernizr/Modernizr/issues/538
tests['fontface'] = function() {
tests['fontface'] = function() {
var bool;
var bool;
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
var style = document.getElementById('smodernizr'),
var style = document.getElementById('smodernizr'),
sheet = style.sheet || style.styleSheet,
sheet = style.sheet || style.styleSheet,
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
});
});
return bool;
return bool;
};
};
/*>>fontface*/
/*>>fontface*/
// CSS generated content detection
// CSS generated content detection
tests['generatedcontent'] = function() {
tests['generatedcontent'] = function() {
var bool;
var bool;
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
bool = node.offsetHeight >= 3;
bool = node.offsetHeight >= 3;
});
});
return bool;
return bool;
};
};
// These tests evaluate support of the video/audio elements, as well as
// These tests evaluate support of the video/audio elements, as well as
// testing what types of content they support.
// testing what types of content they support.
//
//
// We're using the Boolean constructor here, so that we can extend the value
// We're using the Boolean constructor here, so that we can extend the value
// e.g. Modernizr.video // true
// e.g. Modernizr.video // true
// Modernizr.video.ogg // 'probably'
// Modernizr.video.ogg // 'probably'
//
//
// Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
// Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
// thx to NielsLeenheer and zcorpan
// thx to NielsLeenheer and zcorpan
// Note: in some older browsers, "no" was a return value instead of empty string.
// Note: in some older browsers, "no" was a return value instead of empty string.
// It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
// It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
// It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5
// It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5
tests['video'] = function() {
tests['video'] = function() {
var elem = document.createElement('video'),
var elem = document.createElement('video'),
bool = false;
bool = false;
// IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
// IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
try {
try {
if ( bool = !!elem.canPlayType ) {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
// Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
// Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
}
}
} catch(e) { }
} catch(e) { }
return bool;
return bool;
};
};
tests['audio'] = function() {
tests['audio'] = function() {
var elem = document.createElement('audio'),
var elem = document.createElement('audio'),
bool = false;
bool = false;
try {
try {
if ( bool = !!elem.canPlayType ) {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
// Mimetypes accepted:
// Mimetypes accepted:
// developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
// developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
// bit.ly/iphoneoscodecs
// bit.ly/iphoneoscodecs
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
}
}
} catch(e) { }
} catch(e) { }
return bool;
return bool;
};
};
// In FF4, if disabled, window.localStorage should === null.
// In FF4, if disabled, window.localStorage should === null.
// Normally, we could not test that directly and need to do a
// Normally, we could not test that directly and need to do a
// `('localStorage' in window) && ` test first because otherwise Firefox will
// `('localStorage' in window) && ` test first because otherwise Firefox will
// throw bugzil.la/365772 if cookies are disabled
// throw bugzil.la/365772 if cookies are disabled
// Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
// Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
// will throw the exception:
// will throw the exception:
// QUOTA_EXCEEDED_ERRROR DOM Exception 22.
// QUOTA_EXCEEDED_ERRROR DOM Exception 22.
// Peculiarly, getItem and removeItem calls do not throw.
// Peculiarly, getItem and removeItem calls do not throw.
// Because we are forced to try/catch this, we'll go aggressive.
// Because we are forced to try/catch this, we'll go aggressive.
// Just FWIW: IE8 Compat mode supports these features completely:
// Just FWIW: IE8 Compat mode supports these features completely:
// www.quirksmode.org/dom/html5.html
// www.quirksmode.org/dom/html5.html
// But IE8 doesn't support either with local files
// But IE8 doesn't support either with local files
tests['localstorage'] = function() {
tests['localstorage'] = function() {
try {
try {
localStorage.setItem(mod, mod);
localStorage.setItem(mod, mod);
localStorage.removeItem(mod);
localStorage.removeItem(mod);
return true;
return true;
} catch(e) {
} catch(e) {
return false;
return false;
}
}
};
};
tests['sessionstorage'] = function() {
tests['sessionstorage'] = function() {
try {
try {
sessionStorage.setItem(mod, mod);
sessionStorage.setItem(mod, mod);
sessionStorage.removeItem(mod);
sessionStorage.removeItem(mod);
return true;
return true;
} catch(e) {
} catch(e) {
return false;
return false;
}
}
};
};
tests['webworkers'] = function() {
tests['webworkers'] = function() {
return !!window.Worker;
return !!window.Worker;
};
};
tests['applicationcache'] = function() {
tests['applicationcache'] = function() {
return !!window.applicationCache;
return !!window.applicationCache;
};
};
// Thanks to Erik Dahlstrom
tests['svg'] = function() {
tests['svg'] = function() {
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
};
};
// specifically for SVG inline in HTML, not within XHTML
// specifically for SVG inline in HTML, not within XHTML
// test page: paulirish.com/demo/inline-svg
// test page: paulirish.com/demo/inline-svg
tests['inlinesvg'] = function() {
tests['inlinesvg'] = function() {
var div = document.createElement('div');
var div = document.createElement('div');
div.innerHTML = '<svg/>';
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
};
};
// SVG SMIL animation
// SVG SMIL animation
tests['smil'] = function() {
tests['smil'] = function() {
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
};
};
// This test is only for clip paths in SVG proper, not clip paths on HTML content
// This test is only for clip paths in SVG proper, not clip paths on HTML content
// demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg
// demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg
// However read the comments to dig into applying SVG clippaths to HTML content here:
// However read the comments to dig into applying SVG clippaths to HTML content here:
// github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
// github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
tests['svgclippaths'] = function() {
tests['svgclippaths'] = function() {
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
};
};
/*>>webforms*/
/*>>webforms*/
// input features and input types go directly onto the ret object, bypassing the tests loop.
// input features and input types go directly onto the ret object, bypassing the tests loop.
// Hold this guy to execute in a moment.
// Hold this guy to execute in a moment.
function webforms() {
function webforms() {
/*>>input*/
/*>>input*/
// Run through HTML5's new input attributes to see if the UA understands any.
// Run through HTML5's new input attributes to see if the UA understands any.
// We're using f which is the <input> element created early on
// We're using f which is the <input> element created early on
// Mike Taylr has created a comprehensive resource for testing these attributes
// Mike Taylr has created a comprehensive resource for testing these attributes
// when applied to all input types:
// when applied to all input types:
// miketaylr.com/code/input-type-attr.html
// miketaylr.com/code/input-type-attr.html
// spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
// spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
// Only input placeholder is tested while textarea's placeholder is not.
// Only input placeholder is tested while textarea's placeholder is not.
// Currently Safari 4 and Opera 11 have support only for the input placeholder
// Currently Safari 4 and Opera 11 have support only for the input placeholder
// Both tests are available in feature-detects/forms-placeholder.js
// Both tests are available in feature-detects/forms-placeholder.js
Modernizr['input'] = (function( props ) {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
attrs[ props[i] ] = !!(props[i] in inputElem);
}
}
if (attrs.list){
if (attrs.list){
// safari false positive's on datalist: webk.it/74252
// safari false positive's on datalist: webk.it/74252
// see also github.com/Modernizr/Modernizr/issues/146
// see also github.com/Modernizr/Modernizr/issues/146
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
}
}
return attrs;
return attrs;
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
/*>>input*/
/*>>input*/
/*>>inputtypes*/
/*>>inputtypes*/
// Run through HTML5's new input types to see if the UA understands any.
// Run through HTML5's new input types to see if the UA understands any.
// This is put behind the tests runloop because it doesn't return a
// This is put behind the tests runloop because it doesn't return a
// true/false like all the other tests; instead, it returns an object
// true/false like all the other tests; instead, it returns an object
// containing each input type with its corresponding true/false value
// containing each input type with its corresponding true/false value
// Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
// Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
Modernizr['inputtypes'] = (function(props) {
Modernizr['inputtypes'] = (function(props) {
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
inputElem.setAttribute('type', inputElemType = props[i]);
inputElem.setAttribute('type', inputElemType = props[i]);
bool = inputElem.type !== 'text';
bool = inputElem.type !== 'text';
// We first check to see if the type we give it sticks..
// We first check to see if the type we give it sticks..
// If the type does, we feed it a textual value, which shouldn't be valid.
// If the type does, we feed it a textual value, which shouldn't be valid.
// If the value doesn't stick, we know there's input sanitization which infers a custom UI
// If the value doesn't stick, we know there's input sanitization which infers a custom UI
if ( bool ) {
if ( bool ) {
inputElem.value = smile;
inputElem.value = smile;
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
docElement.appendChild(inputElem);
docElement.appendChild(inputElem);
defaultView = document.defaultView;
defaultView = document.defaultView;
// Safari 2-4 allows the smiley as a value, despite making a slider
// Safari 2-4 allows the smiley as a value, despite making a slider
bool = defaultView.getComputedStyle &&
bool = defaultView.getComputedStyle &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
// Mobile android web browser has false positive, so must
// Mobile android web browser has false positive, so must
// check the height to see if the widget is actually there.
// check the height to see if the widget is actually there.
(inputElem.offsetHeight !== 0);
(inputElem.offsetHeight !== 0);
docElement.removeChild(inputElem);
docElement.removeChild(inputElem);
} else if ( /^(search|tel)$/.test(inputElemType) ){
} else if ( /^(search|tel)$/.test(inputElemType) ){
// Spec doesn't define any special parsing or detectable UI
// Spec doesn't define any special parsing or detectable UI
// behaviors so we pass these through as true
// behaviors so we pass these through as true
// Interestingly, opera fails the earlier test, so it doesn't
// Interestingly, opera fails the earlier test, so it doesn't
// even make it here.
// even make it here.
} else if ( /^(url|email)$/.test(inputElemType) ) {
} else if ( /^(url|email)$/.test(inputElemType) ) {
// Real url and email support comes with prebaked validation.
// Real url and email support comes with prebaked validation.
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
} else {
} else {
// If the upgraded input compontent rejects the :) text, we got a winner
// If the upgraded input compontent rejects the :) text, we got a winner
bool = inputElem.value != smile;
bool = inputElem.value != smile;
}
}
}
}
inputs[ props[i] ] = !!bool;
inputs[ props[i] ] = !!bool;
}
}
return inputs;
return inputs;
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
/*>>inputtypes*/
/*>>inputtypes*/
}
}
/*>>webforms*/
// End of test definitions
// -----------------------
// Run through all tests and detect their support in the current UA.
// todo: hypothetically we could be doing an array of tests and use a basic loop here.
for ( var feature in tests ) {
for ( var feature in tests ) {
if ( hasOwnProp(tests, feature) ) {
if ( hasOwnProp(tests, feature) ) {
// run the test, throw the return value into the Modernizr,
// run the test, throw the return value into the Modernizr,
// then based on that boolean, define an appropriate className
// then based on that boolean, define an appropriate className
// and push it into an array of classes we'll join later.
// and push it into an array of classes we'll join later.
featureName = feature.toLowerCase();
featureName = feature.toLowerCase();
Modernizr[featureName] = tests[feature]();
Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
}
}
/*>>webforms*/
// input tests need to run.
Modernizr.input || webforms();
Modernizr.input || webforms();
/*>>webforms*/
/*>>webforms*/
/**
/**
* addTest allows the user to define their own feature tests
* addTest allows the user to define their own feature tests
* the result will be added onto the Modernizr object,
* the result will be added onto the Modernizr object,
* as well as an appropriate className set on the html element
* as well as an appropriate className set on the html element
*
*
* @param feature - String naming the feature
* @param feature - String naming the feature
* @param test - Function returning true if feature is supported, false if not
* @param test - Function returning true if feature is supported, false if not
*/
*/
Modernizr.addTest = function ( feature, test ) {
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == 'object' ) {
if ( typeof feature == 'object' ) {
for ( var key in feature ) {
for ( var key in feature ) {
if ( hasOwnProp( feature, key ) ) {
if ( hasOwnProp( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
Modernizr.addTest( key, feature[ key ] );
}
}
}
}
} else {
} else {
feature = feature.toLowerCase();
feature = feature.toLowerCase();
if ( Modernizr[feature] !== undefined ) {
if ( Modernizr[feature] !== undefined ) {
// we're going to quit if you're trying to overwrite an existing test
// we're going to quit if you're trying to overwrite an existing test
// if we were to allow it, we'd do this:
// if we were to allow it, we'd do this:
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// docElement.className = docElement.className.replace( re, '' );
// docElement.className = docElement.className.replace( re, '' );
// but, no rly, stuff 'em.
// but, no rly, stuff 'em.
return Modernizr;
return Modernizr;
}
}
test = typeof test == 'function' ? test() : test;
test = typeof test == 'function' ? test() : test;
if (typeof enableClasses !== "undefined" && enableClasses) {
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className += ' ' + (test ? '' : 'no-') + feature;
docElement.className += ' ' + (test ? '' : 'no-') + feature;
}
}
Modernizr[feature] = test;
Modernizr[feature] = test;
}
}
return Modernizr; // allow chaining.
return Modernizr; // allow chaining.
};
};
// Reset modElem.cssText to nothing to reduce memory footprint.
// Reset modElem.cssText to nothing to reduce memory footprint.
setCss('');
setCss('');
modElem = inputElem = null;
modElem = inputElem = null;
/*>>shiv*/
/*>>shiv*/
/**
/**
* @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
* @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
*/
;(function(window, document) {
;(function(window, document) {
/*jshint evil:true */
/*jshint evil:true */
/** version */
/** version */
var version = '3.7.0';
var version = '3.7.0';
/** Preset options */
/** Preset options */
var options = window.html5 || {};
var options = window.html5 || {};
/** Used to skip problem elements */
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
var expando = '_html5shiv';
/** The id for the the documents expando */
/** The id for the the documents expando */
var expanID = 0;
var expanID = 0;
/** Cached data for each document */
/** Cached data for each document */
var expandoData = {};
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
var supportsUnknownElements;
(function() {
(function() {
try {
try {
var a = document.createElement('a');
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
// assign a false positive if unable to shiv
(document.createElement)('a');
(document.createElement)('a');
var frag = document.createDocumentFragment();
var frag = document.createDocumentFragment();
return (
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
typeof frag.createElement == 'undefined'
);
);
}());
}());
} catch(e) {
} catch(e) {
// assign a false positive if detection fails => unable to shiv
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsHtml5Styles = true;
supportsUnknownElements = true;
supportsUnknownElements = true;
}
}
}());
}());
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/**
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @private
* @param {Document} ownerDocument The document.
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
* @returns {StyleSheet} The style element.
*/
*/
function addStyleSheet(ownerDocument, cssText) {
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
return parent.insertBefore(p.lastChild, parent.firstChild);
}
}
/**
/**
* Returns the value of `html5.elements` as an array.
* Returns the value of `html5.elements` as an array.
* @private
* @private
* @returns {Array} An array of shived element node names.
* @returns {Array} An array of shived element node names.
*/
*/
function getElements() {
function getElements() {
var elements = html5.elements;
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
}
/**
/**
* Returns the data associated to the given document
* Returns the data associated to the given document
* @private
* @private
* @param {Document} ownerDocument The document.
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
* @returns {Object} An object of data.
*/
*/
function getExpandoData(ownerDocument) {
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
var data = expandoData[ownerDocument[expando]];
if (!data) {
if (!data) {
data = {};
data = {};
expanID++;
expanID++;
ownerDocument[expando] = expanID;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
expandoData[expanID] = data;
}
}
return data;
return data;
}
}
/**
/**
* returns a shived element for the given nodeName and document
* returns a shived element for the given nodeName and document
* @memberOf html5
* @memberOf html5
* @param {String} nodeName name of the element
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
* @returns {Object} The shived element.
*/
*/
function createElement(nodeName, ownerDocument, data){
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
ownerDocument = document;
}
}
if(supportsUnknownElements){
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
return ownerDocument.createElement(nodeName);
}
}
if (!data) {
if (!data) {
data = getExpandoData(ownerDocument);
data = getExpandoData(ownerDocument);
}
}
var node;
var node;
if (data.cache[nodeName]) {
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
} else {
node = data.createElem(nodeName);
node = data.createElem(nodeName);
}
}
// Avoid adding some elements to fragments in IE < 9 because
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
}
/**
/**
* returns a shived DocumentFragment for the given document
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
* @returns {Object} The shived DocumentFragment.
*/
*/
function createDocumentFragment(ownerDocument, data){
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
ownerDocument = document;
}
}
if(supportsUnknownElements){
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
return ownerDocument.createDocumentFragment();
}
}
data = data || getExpandoData(ownerDocument);
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
var clone = data.frag.cloneNode(),
i = 0,
i = 0,
elems = getElements(),
elems = getElements(),
l = elems.length;
l = elems.length;
for(;i<l;i++){
for(;i<l;i++){
clone.createElement(elems[i]);
clone.createElement(elems[i]);
}
}
return clone;
return clone;
}
}
/**
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
* @param {Object} data of the document.
*/
*/
function shivMethods(ownerDocument, data) {
function shivMethods(ownerDocument, data) {
if (!data.cache) {
if (!data.cache) {
data.cache = {};
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
data.frag = data.createFrag();
}
}
ownerDocument.createElement = function(nodeName) {
ownerDocument.createElement = function(nodeName) {
//abort shiv
//abort shiv
if (!html5.shivMethods) {
if (!html5.shivMethods) {
return data.createElem(nodeName);
return data.createElem(nodeName);
}
}
return createElement(nodeName, ownerDocument, data);
return createElement(nodeName, ownerDocument, data);
};
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
// unroll the `createElement` calls
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
data.createElem(nodeName);
data.createElem(nodeName);
data.frag.createElement(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
return 'c("' + nodeName + '")';
}) +
}) +
');return n}'
');return n}'
)(html5, data.frag);
)(html5, data.frag);
}
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/**
/**
* Shivs the given document.
* Shivs the given document.
* @memberOf html5
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
* @returns {Document} The shived document.
*/
*/
function shivDocument(ownerDocument) {
function shivDocument(ownerDocument) {
if (!ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
ownerDocument = document;
}
}
var data = getExpandoData(ownerDocument);
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
// hides non-rendered elements
'template{display:none}'
'template{display:none}'
);
);
}
}
if (!supportsUnknownElements) {
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
shivMethods(ownerDocument, data);
}
}
return ownerDocument;
return ownerDocument;
}
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/**
/**
* The `html5` object is exposed so that more elements can be shived and
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* existing shiving can be detected on iframes.
* @type Object
* @type Object
* @example
* @example
*
*
* // options can be changed before the script is included
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
*/
var html5 = {
var html5 = {
/**
/**
* An array or space separated string of node names of the elements to shiv.
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @memberOf html5
* @type Array|String
* @type Array|String
*/
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
/**
/**
* current version of html5shiv
* current version of html5shiv
*/
*/
'version': version,
'version': version,
/**
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @memberOf html5
* @type Boolean
* @type Boolean
*/
*/
'shivCSS': (options.shivCSS !== false),
'shivCSS': (options.shivCSS !== false),
/**
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @memberOf html5
* @type boolean
* @type boolean
*/
*/
'supportsUnknownElements': supportsUnknownElements,
'supportsUnknownElements': supportsUnknownElements,
/**
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* methods should be overwritten.
* @memberOf html5
* @memberOf html5
* @type Boolean
* @type Boolean
*/
*/
'shivMethods': (options.shivMethods !== false),
'shivMethods': (options.shivMethods !== false),
/**
/**
* A string to describe the type of `html5` object ("default" or "default print").
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @memberOf html5
* @type String
* @type String
*/
*/
'type': 'default',
'type': 'default',
// shivs the document according to the specified `html5` object options
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
'shivDocument': shivDocument,
//creates a shived element
//creates a shived element
createElement: createElement,
createElement: createElement,
//creates a shived documentFragment
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment
createDocumentFragment: createDocumentFragment
};
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// expose html5
// expose html5
window.html5 = html5;
window.html5 = html5;
// shiv the document
// shiv the document
shivDocument(document);
shivDocument(document);
}(this, document));
}(this, document));
/*>>shiv*/
/*>>shiv*/
// Assign private properties to the return object with prefix
// Assign private properties to the return object with prefix
Modernizr._version = version;
Modernizr._version = version;
// expose these for the plugin API. Look in the source for how to join() them against your input
// expose these for the plugin API. Look in the source for how to join() them against your input
/*>>prefixes*/
/*>>prefixes*/
Modernizr._prefixes = prefixes;
Modernizr._prefixes = prefixes;
/*>>prefixes*/
/*>>prefixes*/
/*>>domprefixes*/
/*>>domprefixes*/
Modernizr._domPrefixes = domPrefixes;
Modernizr._domPrefixes = domPrefixes;
Modernizr._cssomPrefixes = cssomPrefixes;
Modernizr._cssomPrefixes = cssomPrefixes;
/*>>domprefixes*/
/*>>domprefixes*/
/*>>mq*/
/*>>mq*/
// Modernizr.mq tests a given media query, live against the current state of the window
// Modernizr.mq tests a given media query, live against the current state of the window
// A few important notes:
// A few important notes:
// * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
// * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
// * A max-width or orientation query will be evaluated against the current state, which may change later.
// * A max-width or orientation query will be evaluated against the current state, which may change later.
// * You must specify values. Eg. If you are testing support for the min-width media query use:
// * You must specify values. Eg. If you are testing support for the min-width media query use:
// Modernizr.mq('(min-width:0)')
// Modernizr.mq('(min-width:0)')
// usage:
// usage:
// Modernizr.mq('only screen and (max-width:768)')
// Modernizr.mq('only screen and (max-width:768)')
Modernizr.mq = testMediaQuery;
Modernizr.mq = testMediaQuery;
/*>>mq*/
/*>>mq*/
/*>>hasevent*/
/*>>hasevent*/
// Modernizr.hasEvent() detects support for a given event, with an optional element to test on
// Modernizr.hasEvent() detects support for a given event, with an optional element to test on
// Modernizr.hasEvent('gesturestart', elem)
// Modernizr.hasEvent('gesturestart', elem)
Modernizr.hasEvent = isEventSupported;
Modernizr.hasEvent = isEventSupported;
/*>>hasevent*/
/*>>hasevent*/
/*>>testprop*/
/*>>testprop*/
// Modernizr.testProp() investigates whether a given style property is recognized
// Modernizr.testProp() investigates whether a given style property is recognized
// Note that the property names must be provided in the camelCase variant.
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testProp('pointerEvents')
// Modernizr.testProp('pointerEvents')
Modernizr.testProp = function(prop){
Modernizr.testProp = function(prop){
return testProps([prop]);
return testProps([prop]);
};
};
/*>>testprop*/
/*>>testprop*/
/*>>testallprops*/
/*>>testallprops*/
// Modernizr.testAllProps() investigates whether a given style property,
// Modernizr.testAllProps() investigates whether a given style property,
// or any of its vendor-prefixed variants, is recognized
// or any of its vendor-prefixed variants, is recognized
// Note that the property names must be provided in the camelCase variant.
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testAllProps('boxSizing')
// Modernizr.testAllProps('boxSizing')
Modernizr.testAllProps = testPropsAll;
Modernizr.testAllProps = testPropsAll;
/*>>testallprops*/
/*>>testallprops*/
/*>>teststyles*/
/*>>teststyles*/
// Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
// Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
// Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
// Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
Modernizr.testStyles = injectElementWithStyles;
Modernizr.testStyles = injectElementWithStyles;
/*>>teststyles*/
/*>>teststyles*/
/*>>prefixed*/
/*>>prefixed*/
// Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
// Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'
// Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
// Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
// Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
// Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
//
//
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
// If you're trying to ascertain which transition end event to bind to, you might do something like...
// If you're trying to ascertain which transition end event to bind to, you might do something like...
//
//
// var transEndEventNames = {
// var transEndEventNames = {
// 'WebkitTransition' : 'webkitTransitionEnd',
// 'WebkitTransition' : 'webkitTransitionEnd',
// 'MozTransition' : 'transitionend',
// 'MozTransition' : 'transitionend',
// 'OTransition' : 'oTransitionEnd',
// 'OTransition' : 'oTransitionEnd',
// 'msTransition' : 'MSTransitionEnd',
// 'msTransition' : 'MSTransitionEnd',
// 'transition' : 'transitionend'
// 'transition' : 'transitionend'
// },
// },
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
Modernizr.prefixed = function(prop, obj, elem){
Modernizr.prefixed = function(prop, obj, elem){
if(!obj) {
if(!obj) {
return testPropsAll(prop, 'pfx');
return testPropsAll(prop, 'pfx');
} else {
} else {
// Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
// Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
return testPropsAll(prop, obj, elem);
return testPropsAll(prop, obj, elem);
}
}
};
};
/*>>prefixed*/
/*>>prefixed*/
/*>>cssclasses*/
/*>>cssclasses*/
// Remove "no-js" class from <html> element, if it exists:
// Remove "no-js" class from <html> element, if it exists:
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
// Add the new classes to the <html> element.
// Add the new classes to the <html> element.
(enableClasses ? ' js ' + classes.join(' ') : '');
(enableClasses ? ' js ' + classes.join(' ') : '');
/*>>cssclasses*/
/*>>cssclasses*/
return Modernizr;
return Modernizr;
})(this, this.document);
})(this, this.document);
<?php
<?php
$file = "xml/hashKey.xml";
$file = "xml/hashKey.xml";
$doc = new DOMDocument('1.0');
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$doc->formatOutput = true;
$root = $doc->createElement('maincontent');
$root = $doc->createElement('maincontent');
$root = $doc->appendChild($root);
$root = $doc->appendChild($root);
$title = $doc->createElement('code');
$title = $doc->createElement('code');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$enclosure = $doc->createAttribute('num');
$enclosure = $doc->createAttribute('num');
$enclosure->value = "";
$enclosure->value = "";
$title->appendChild($enclosure);
$title->appendChild($enclosure);
$title = $doc->createElement('access_token');
$title = $doc->createElement('access_token');
$title = $root->appendChild($title);
$title = $root->appendChild($title);
$text = $doc->createTextNode("");
$text = $doc->createTextNode("");
$text = $title->appendChild($text);
$text = $title->appendChild($text);
$doc->save($file);
$doc->save($file);
$doc->save("xml/hashhKey.xml");
$doc->save("xml/hashhKey.xml");
if (file_exists($file)) {
if (file_exists($file)) {
$xml = (array) simplexml_load_file($file) or die("Error: Cannot create object");
$xml = (array) simplexml_load_file($file) || die("Error: Cannot create object");
} else {
} else {
echo $file. " file doesnot exists";
echo $file. " file doesnot exists";
}
}
header("Location: index.php");
header("Location: index.php");
?>
?>