Theme Basics is a series of tutorial notes on building a Blogger theme.
Discover tips and learn how to start building your own Blogger theme:
- Minimum code requirements.
- Basic templates.
- Tags & Data definitions.
- Resources and examples.
#AND | |
<b:if cond='data:blog.pageType == "index"'> | |
<b:if cond='data:blog.searchQuery'> | |
<!--search_page AND index_page--> | |
</b:if> | |
</b:if> | |
#OR |
.post-body img { | |
width: $(content.width); | |
height: auto; | |
margin-left: -1em; | |
padding: 0; | |
border: none; | |
max-width: 100%; | |
} | |
.post-body .tr-caption-container { |
This is a list of guidelines to make your Javascript faster, often associated with jsPerf benchmarks.
If you have an existing codebase, don't get carried away with premature optimizations. Profile to find the slow bits and pick the low hanging fruit.
Some of the latter lessons in Code School's Chrome DevTools course will teach you how to profile your code.
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
/* | |
Set readonly property value for an object | |
*/ | |
// Utils | |
var | |
op=function(o,p,v){ | |
o=o||{}; | |
var f=Object.defineProperty; | |
if(!io(v)){opv(v)} | |
if(f){ |
/* | |
you'll need to include supporting script like: w,d,dm,i{},ti,to,wc | |
they are shortcuts for: window,document,DomJs,VariableTest,Timer,and console. | |
*/ | |
var | |
gs=function(a){ | |
if(!io(a)||!is(a.src)){we(': Invalid source: '+a.src);return} | |
// Somewhere deep in your JavaScript library... | |
Array.prototype.foo = 1; | |
// While you have no idea that your code will misbehave. | |
var a = []; // Create a new empty array. | |
a[5] = 5; // Perfectly legal JavaScript that resizes the array. | |
// normal loop saves you |
config={ | |
callbacks:{ | |
signInSuccess: function(currentUser, credential, redirectUrl) { | |
// Do something. | |
// Return type determines whether we continue the redirect automatically | |
// or whether we leave that to developer to handle. | |
return true; | |
}, | |
signInFailure: function(error) { |