This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Boiler plate code is usually consisted of simple patterns. Once you master them, there is no need for readability. It should be as compact as possible, to preserve space for the real implementation code. For example: | |
// adding interface "storage" to namespace "AppHtml5" | |
if (window.AppHtml5) | |
window.AppHtml5.storage = { "save" : {}, "load" : {}}; | |
else { | |
window.AppHtml5 = {}; | |
window.AppHtml5.storage = {}; | |
window.AppHtml5.storage = { "save" : {}, "load" : {}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Tests </title> | |
<style type="text/css"> | |
div.results b { | |
color: green; | |
} | |
div.results b[class='err'] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Component for utilizing local storage. It provides backup plan, if no WebStorage is available on client | |
* | |
*We support html5 storage, and cookie store if webStorage is not available. | |
* | |
*Cookies | |
* Are for older browsers only. A "session" cookie (one without expiration data) is available in all windows | |
* that have access to that domain until the browser is shut down. This is bad. | |
* 4096 chars limit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple logging framwork | |
* Supports Chrome or Firefox | |
* Usage: | |
* | |
* AppHtml5.log.info('Dropdown value changed to something new!'); | |
* | |
*/ | |
//create logging functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is the extension function for table plugin (My params are array of key value pairs). Make this script available to your //web page which is utilizing the table plugin | |
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, myParams ) { | |
if ( oSettings.oFeatures.bServerSide ) { | |
oSettings.aoServerParams = []; | |
oSettings.aoServerParams.push({"sName": "user", | |
"fn": function (aoData) { | |
for (var i=0;i<myParams.length;i++){ | |
aoData.push( {"name" : myParams[i][0], "value" : myParams[i][1]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Creating simple page navigator with remote pages</title> | |
<style type="text/css"> | |
div.viewport { | |
position: relative; | |
border-collapse: collapse; | |
width: 800px; | |
height: 200px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>HTML5Template</title> | |
<style type="text/css"> | |
html, body { height: 100%; width: 100%; } /* occupy whole viewport. */ | |
body,div,p { | |
/* css reset techique; We are resetting the UserAgent (browser) style */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>templator</title> | |
<style type="text/css"> | |
#content { | |
padding: 5px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>templator2</title> | |
<style type="text/css"> | |
html, body { | |
font-size: 14px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tabs demo</title> | |
<style type="text/css"> | |
.tabs ul { | |
list-style-type: none; | |
margin: 0 2em; | |
padding: 0; | |
cursor: pointer; |
OlderNewer