/gc.xml
XML | 1538 lines | 1425 code | 110 blank | 3 comment | 0 complexity | d4c0f7c4304a17e8447d81fc78899817 MD5 | raw file
- <?xml version="1.0" encoding="UTF-8"?>
- <Module>
- <ModulePrefs title="GoComics from Universal Uclick"
- title_url="http://www.gocomics.com"
- author="Universal Uclick"
- author_email="universaluclick@gmail.com"
- description="Get a Laugh each and everyday with the GoComics gadget for iGoogle - giving you access to the
- best and most extensive online comics collection ever compiled! It's the only place to get your
- favorites like 'Calvin and Hobbes', 'Garfield', 'Foxtrot', 'Doonesbury' and the newer hits like
- 'Lio', 'Pooch Cafe', 'The Argyle Sweater' and 'Cul de Sac'. Build your own personal daily comics
- page and choose from over 200+ Comic Strips. Share comics with your Friends, Favorite those you
- want to see again, and see Comments from other comic fans. Add GoComics to your iGoogle page now
- and start laughing!"
- screenshot="http://images.gocomics.com/images/google/comics_screenshot.jpg"
- thumbnail="http://images.gocomics.com/images/google/gocomics_logo.jpg">
- <Require feature="opensocial-0.8"/>
- <Require feature="setprefs"/>
- <Require feature="views"/>
- <Require feature="dynamic-height"/>
- <Require feature="minimessage"/>
- </ModulePrefs>
-
-
- <!-- H O M E -->
- <Content type="html" view="home,profile"><![CDATA[
- <style type='text/css'>
- /* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
- */
- html, body, div, span, applet, object, iframe,
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
- a, abbr, acronym, address, big, cite, code,
- del, dfn, em, img, ins, kbd, q, s, samp,
- small, strike, strong, sub, sup, tt, var,
- b, u, i, center,
- dl, dt, dd, ol, ul, li,
- fieldset, form, label, legend,
- table, caption, tbody, tfoot, thead, tr, th, td,
- article, aside, canvas, details, embed,
- figure, figcaption, footer, header, hgroup,
- menu, nav, output, ruby, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
- /* HTML5 display-role reset for older browsers */
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
- body {
- line-height: 1;
- }
- ol, ul {
- list-style: none;
- }
- blockquote, q {
- quotes: none;
- }
- blockquote:before, blockquote:after,
- q:before, q:after {
- content: '';
- content: none;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
- body {
- color: #474747;
- font-family: Helvetica, Arial, Verdana, sans-serif;
- font-size: 12px; }
- a {
- text-decoration: none;
- color: #4a91c1; }
- a:visited {
- color: #4a91c1; }
- .button, .big-button, .little-button {
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- color: #FFF;
- font-weight: bold;
- text-align: center; }
- .button:visited, .big-button:visited, .little-button:visited {
- color: #FFF; }
- .big-button {
- background: #38a3cd;
- background: -webkit-gradient(linear, left top, left bottom, from(#8acae1), to(#38a3cd));
- background: -moz-linear-gradient(top, #8acae1, #38a3cd);
- width: 75px;
- display: block;
- padding: 6px 10px; }
- .big-button:hover {
- background: #8acae1;
- background: -webkit-gradient(linear, left top, left bottom, from(#38a3cd), to(#8acae1));
- background: -moz-linear-gradient(top, #38a3cd, #8acae1); }
- .little-button {
- background: #777777;
- background: -webkit-gradient(linear, left top, left bottom, from(#888888), to(#777777));
- background: -moz-linear-gradient(top, #888888, #777777);
- display: inline-block;
- width: 150px;
- padding: 4px 8px; }
- .little-button:hover {
- background: #888888;
- background: -webkit-gradient(linear, left top, left bottom, from(#777777), to(#888888));
- background: -moz-linear-gradient(top, #777777, #888888); }
- .clear {
- clear: both; }
- #home-container {
- display: block;
- width: 400px; }
- #home-container ul {
- list-style-type: none;
- text-align: center;
- width: inherit; }
- #home-container ul li {
- display: inline-block; }
- #home-container ul.feature-navigation {
- display: table;
- padding: 5px 0px;
- border-bottom: 1px solid #AAA; }
- #home-container ul.feature-navigation li {
- text-align: right;
- display: table-cell;
- padding-right: 10px;
- padding-left: 0px; }
- #home-container ul.feature-navigation li:first-child {
- padding-right: 0px;
- padding-left: 10px;
- text-align: left; }
- #home-container ul.feature-options {
- padding: 5px 0; }
- #feature {
- display: block;
- width: 400px; }
- #feature h1 {
- font-size: 16px;
- font-weight: bold;
- padding-bottom: 5px; }
- #feature h1 span {
- font-size: 12px; }
- #feature h1 span.date {
- float: right;
- text-align: right; }
- #feature div.feature-image {
- margin: 5px auto;
- width: 360px;
- border: 2px solid #FFF;
- padding: 10px;
- background: #f2f2f2;
- background: -webkit-gradient(linear, left top, left bottom, from(white), to(#f2f2f2));
- background: -moz-linear-gradient(top, white, #f2f2f2);
- -moz-box-shadow: 0 0 5px 1px #cccccc;
- -webkit-box-shadow: 0 0 5px 1px #cccccc;
- box-shadow: 0 0 5px 1px #cccccc;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px; }
- #feature div.feature-image img {
- width: inherit;
- cursor: pointer; }
- </style>
- <div id="home">
- <div id="home-container">
- <div id="feature"></div>
- <ul class="feature-navigation">
- <li><a href="#" class="prev little-button">←</a></li>
- <li><a href="#" class="next little-button">→</a></li>
- </ul>
- <ul class="feature-options">
- <li><a href="#" class="pick-comics big-button">Pick Comics</a></li>
- <li><a href="#" class="full-size big-button">Full Size</a></li>
- </ul>
- </div>
- </div>
- <script id="feature-template" type="text/mustache-tmpl">
- <h1>
- {{title}}
- <span class="byline">by {{author}}</span>
- <span class="date">{{display_date}}</span>
- </h1>
- <div class="feature-image">
- <img src="{{image_link}}" alt="{{title}}" />
- </div>
- </script>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
- <script type="text/javascript">/*
- mustache.js Logic-less templates in JavaScript
- See http://mustache.github.com/ for more info.
- */
- var Mustache = function() {
- var Renderer = function() {};
- Renderer.prototype = {
- otag: "{{",
- ctag: "}}",
- pragmas: {},
- buffer: [],
- pragmas_implemented: {
- "IMPLICIT-ITERATOR": true
- },
- context: {},
- render: function(template, context, partials, in_recursion) {
- // reset buffer & set context
- if(!in_recursion) {
- this.context = context;
- this.buffer = []; // TODO: make this non-lazy
- }
- // fail fast
- if(!this.includes("", template)) {
- if(in_recursion) {
- return template;
- } else {
- this.send(template);
- return;
- }
- }
- template = this.render_pragmas(template);
- var html = this.render_section(template, context, partials);
- if(in_recursion) {
- return this.render_tags(html, context, partials, in_recursion);
- }
- this.render_tags(html, context, partials, in_recursion);
- },
- /*
- Sends parsed lines
- */
- send: function(line) {
- if(line != "") {
- this.buffer.push(line);
- }
- },
- /*
- Looks for %PRAGMAS
- */
- render_pragmas: function(template) {
- // no pragmas
- if(!this.includes("%", template)) {
- return template;
- }
- var that = this;
- var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
- this.ctag);
- return template.replace(regex, function(match, pragma, options) {
- if(!that.pragmas_implemented[pragma]) {
- throw({message:
- "This implementation of mustache doesn't understand the '" +
- pragma + "' pragma"});
- }
- that.pragmas[pragma] = {};
- if(options) {
- var opts = options.split("=");
- that.pragmas[pragma][opts[0]] = opts[1];
- }
- return "";
- // ignore unknown pragmas silently
- });
- },
- /*
- Tries to find a partial in the curent scope and render it
- */
- render_partial: function(name, context, partials) {
- name = this.trim(name);
- if(!partials || partials[name] === undefined) {
- throw({message: "unknown_partial '" + name + "'"});
- }
- if(typeof(context[name]) != "object") {
- return this.render(partials[name], context, partials, true);
- }
- return this.render(partials[name], context[name], partials, true);
- },
- /*
- Renders inverted (^) and normal (#) sections
- */
- render_section: function(template, context, partials) {
- if(!this.includes("#", template) && !this.includes("^", template)) {
- return template;
- }
- var that = this;
- // CSW - Added "+?" so it finds the tighest bound, not the widest
- var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
- "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
- "\\s*", "mg");
- // for each {{#foo}}{{/foo}} section do...
- return template.replace(regex, function(match, type, name, content) {
- var value = that.find(name, context);
- if(type == "^") { // inverted section
- if(!value || that.is_array(value) && value.length === 0) {
- // false or empty list, render it
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- } else if(type == "#") { // normal section
- if(that.is_array(value)) { // Enumerable, Let's loop!
- return that.map(value, function(row) {
- return that.render(content, that.create_context(row),
- partials, true);
- }).join("");
- } else if(that.is_object(value)) { // Object, Use it as subcontext!
- return that.render(content, that.create_context(value),
- partials, true);
- } else if(typeof value === "function") {
- // higher order section
- return value.call(context, content, function(text) {
- return that.render(text, context, partials, true);
- });
- } else if(value) { // boolean section
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- }
- });
- },
- /*
- Replace {{foo}} and friends with values from our view
- */
- render_tags: function(template, context, partials, in_recursion) {
- // tit for tat
- var that = this;
- var new_regex = function() {
- return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
- that.ctag + "+", "g");
- };
- var regex = new_regex();
- var tag_replace_callback = function(match, operator, name) {
- switch(operator) {
- case "!": // ignore comments
- return "";
- case "=": // set new delimiters, rebuild the replace regexp
- that.set_delimiters(name);
- regex = new_regex();
- return "";
- case ">": // render partial
- return that.render_partial(name, context, partials);
- case "{": // the triple mustache is unescaped
- return that.find(name, context);
- default: // escape the value
- return that.escape(that.find(name, context));
- }
- };
- var lines = template.split("\n");
- for(var i = 0; i < lines.length; i++) {
- lines[i] = lines[i].replace(regex, tag_replace_callback, this);
- if(!in_recursion) {
- this.send(lines[i]);
- }
- }
- if(in_recursion) {
- return lines.join("\n");
- }
- },
- set_delimiters: function(delimiters) {
- var dels = delimiters.split(" ");
- this.otag = this.escape_regex(dels[0]);
- this.ctag = this.escape_regex(dels[1]);
- },
- escape_regex: function(text) {
- // thank you Simon Willison
- if(!arguments.callee.sRE) {
- var specials = [
- '/', '.', '*', '+', '?', '|',
- '(', ')', '[', ']', '{', '}', '\\'
- ];
- arguments.callee.sRE = new RegExp(
- '(\\' + specials.join('|\\') + ')', 'g'
- );
- }
- return text.replace(arguments.callee.sRE, '\\$1');
- },
- /*
- find `name` in current `context`. That is find me a value
- from the view object
- */
- find: function(name, context) {
- name = this.trim(name);
- // Checks whether a value is thruthy or false or 0
- function is_kinda_truthy(bool) {
- return bool === false || bool === 0 || bool;
- }
- var value;
- if(is_kinda_truthy(context[name])) {
- value = context[name];
- } else if(is_kinda_truthy(this.context[name])) {
- value = this.context[name];
- }
- if(typeof value === "function") {
- return value.apply(context);
- }
- if(value !== undefined) {
- return value;
- }
- // silently ignore unkown variables
- return "";
- },
- // Utility methods
- /* includes tag */
- includes: function(needle, haystack) {
- return haystack.indexOf(this.otag + needle) != -1;
- },
- /*
- Does away with nasty characters
- */
- escape: function(s) {
- s = String(s === null ? "" : s);
- return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
- switch(s) {
- case "&": return "&";
- case "\\": return "\\\\";
- case '"': return '"';
- case "'": return ''';
- case "<": return "<";
- case ">": return ">";
- default: return s;
- }
- });
- },
- // by @langalex, support for arrays of strings
- create_context: function(_context) {
- if(this.is_object(_context)) {
- return _context;
- } else {
- var iterator = ".";
- if(this.pragmas["IMPLICIT-ITERATOR"]) {
- iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
- }
- var ctx = {};
- ctx[iterator] = _context;
- return ctx;
- }
- },
- is_object: function(a) {
- return a && typeof a == "object";
- },
- is_array: function(a) {
- return Object.prototype.toString.call(a) === '[object Array]';
- },
- /*
- Gets rid of leading and trailing whitespace
- */
- trim: function(s) {
- return s.replace(/^\s*|\s*$/g, "");
- },
- /*
- Why, why, why? Because IE. Cry, cry cry.
- */
- map: function(array, fn) {
- if (typeof array.map == "function") {
- return array.map(fn);
- } else {
- var r = [];
- var l = array.length;
- for(var i = 0; i < l; i++) {
- r.push(fn(array[i]));
- }
- return r;
- }
- }
- };
- return({
- name: "mustache.js",
- version: "0.3.1-dev",
- /*
- Turns a template and view into HTML
- */
- to_html: function(template, view, partials, send_fun) {
- var renderer = new Renderer();
- if(send_fun) {
- renderer.send = send_fun;
- }
- renderer.render(template, view, partials);
- if(!send_fun) {
- return renderer.buffer.join("\n");
- }
- }
- });
- }();
- </script>
- <script type="text/javascript">// Underscore.js 1.1.6
- // (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
- // Underscore is freely distributable under the MIT license.
- // Portions of Underscore are inspired or borrowed from Prototype,
- // Oliver Steele's Functional, and John Resig's Micro-Templating.
- // For all details and documentation:
- // http://documentcloud.github.com/underscore
- (function(){var p=this,C=p._,m={},i=Array.prototype,n=Object.prototype,f=i.slice,D=i.unshift,E=n.toString,l=n.hasOwnProperty,s=i.forEach,t=i.map,u=i.reduce,v=i.reduceRight,w=i.filter,x=i.every,y=i.some,o=i.indexOf,z=i.lastIndexOf;n=Array.isArray;var F=Object.keys,q=Function.prototype.bind,b=function(a){return new j(a)};typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):p._=b;b.VERSION="1.1.6";var h=b.each=b.forEach=function(a,c,d){if(a!=null)if(s&&a.forEach===s)a.forEach(c,d);else if(b.isNumber(a.length))for(var e=
- 0,k=a.length;e<k;e++){if(c.call(d,a[e],e,a)===m)break}else for(e in a)if(l.call(a,e)&&c.call(d,a[e],e,a)===m)break};b.map=function(a,c,b){var e=[];if(a==null)return e;if(t&&a.map===t)return a.map(c,b);h(a,function(a,g,G){e[e.length]=c.call(b,a,g,G)});return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var k=d!==void 0;a==null&&(a=[]);if(u&&a.reduce===u)return e&&(c=b.bind(c,e)),k?a.reduce(c,d):a.reduce(c);h(a,function(a,b,f){!k&&b===0?(d=a,k=!0):d=c.call(e,d,a,b,f)});if(!k)throw new TypeError("Reduce of empty array with no initial value");
- return d};b.reduceRight=b.foldr=function(a,c,d,e){a==null&&(a=[]);if(v&&a.reduceRight===v)return e&&(c=b.bind(c,e)),d!==void 0?a.reduceRight(c,d):a.reduceRight(c);a=(b.isArray(a)?a.slice():b.toArray(a)).reverse();return b.reduce(a,c,d,e)};b.find=b.detect=function(a,c,b){var e;A(a,function(a,g,f){if(c.call(b,a,g,f))return e=a,!0});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(w&&a.filter===w)return a.filter(c,b);h(a,function(a,g,f){c.call(b,a,g,f)&&(e[e.length]=a)});return e};
- b.reject=function(a,c,b){var e=[];if(a==null)return e;h(a,function(a,g,f){c.call(b,a,g,f)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=!0;if(a==null)return e;if(x&&a.every===x)return a.every(c,b);h(a,function(a,g,f){if(!(e=e&&c.call(b,a,g,f)))return m});return e};var A=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=!1;if(a==null)return e;if(y&&a.some===y)return a.some(c,d);h(a,function(a,b,f){if(e=c.call(d,a,b,f))return m});return e};b.include=b.contains=function(a,c){var b=
- !1;if(a==null)return b;if(o&&a.indexOf===o)return a.indexOf(c)!=-1;A(a,function(a){if(b=a===c)return!0});return b};b.invoke=function(a,c){var d=f.call(arguments,2);return b.map(a,function(a){return(c.call?c||a:a[c]).apply(a,d)})};b.pluck=function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};h(a,function(a,b,f){b=c?c.call(d,a,b,f):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,
- c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};h(a,function(a,b,f){b=c?c.call(d,a,b,f):a;b<e.computed&&(e={value:a,computed:b})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,f){return{value:a,criteria:c.call(d,a,b,f)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=
- function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return f.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?f.call(a,0,b):a[0]};b.rest=b.tail=function(a,b,d){return f.call(a,b==null||d?1:b)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a){return b.reduce(a,function(a,d){if(b.isArray(d))return a.concat(b.flatten(d));
- a[a.length]=d;return a},[])};b.without=function(a){var c=f.call(arguments,1);return b.filter(a,function(a){return!b.include(c,a)})};b.uniq=b.unique=function(a,c){return b.reduce(a,function(a,e,f){if(0==f||(c===!0?b.last(a)!=e:!b.include(a,e)))a[a.length]=e;return a},[])};b.intersect=function(a){var c=f.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.zip=function(){for(var a=f.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),
- e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(o&&a.indexOf===o)return a.indexOf(c);d=0;for(e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(z&&a.lastIndexOf===z)return a.lastIndexOf(b);for(var d=a.length;d--;)if(a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);d=arguments[2]||1;for(var e=Math.max(Math.ceil((b-a)/
- d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};b.bind=function(a,b){if(a.bind===q&&q)return q.apply(a,f.call(arguments,1));var d=f.call(arguments,2);return function(){return a.apply(b,d.concat(f.call(arguments)))}};b.bindAll=function(a){var c=f.call(arguments,1);c.length==0&&(c=b.functions(a));h(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,c){var d={};c||(c=b.identity);return function(){var b=c.apply(this,arguments);return l.call(d,b)?d[b]:d[b]=a.apply(this,arguments)}};b.delay=
- function(a,b){var d=f.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(f.call(arguments,1)))};var B=function(a,b,d){var e;return function(){var f=this,g=arguments,h=function(){e=null;a.apply(f,g)};d&&clearTimeout(e);if(d||!e)e=setTimeout(h,b)}};b.throttle=function(a,b){return B(a,b,!1)};b.debounce=function(a,b){return B(a,b,!0)};b.once=function(a){var b=!1,d;return function(){if(b)return d;b=!0;return d=a.apply(this,arguments)}};
- b.wrap=function(a,b){return function(){var d=[a].concat(f.call(arguments));return b.apply(this,d)}};b.compose=function(){var a=f.call(arguments);return function(){for(var b=f.call(arguments),d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}};b.keys=F||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)l.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,
- b.identity)};b.functions=b.methods=function(a){return b.filter(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a){h(f.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){h(f.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,c){if(a===c)return!0;var d=typeof a;if(d!=
- typeof c)return!1;if(a==c)return!0;if(!a&&c||a&&!c)return!1;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return!1;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return!1;if(a.length&&a.length!==c.length)return!1;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return!1;
- for(var f in a)if(!(f in c)||!b.isEqual(a[f],c[f]))return!1;return!0};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(l.call(a,c))return!1;return!0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=n||function(a){return E.call(a)==="[object Array]"};b.isArguments=function(a){return!(!a||!l.call(a,"callee"))};b.isFunction=function(a){return!(!a||!a.constructor||!a.call||!a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};
- b.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===!0||a===!1};b.isDate=function(a){return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)};b.isRegExp=function(a){return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===!1))};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.noConflict=function(){p._=C;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=
- 0;e<a;e++)b.call(d,e)};b.mixin=function(a){h(b.functions(a),function(c){H(c,b[c]=a[c])})};var I=0;b.uniqueId=function(a){var b=I++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings;d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||
- null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";d=new Function("obj",d);return c?d(c):d};var j=function(a){this._wrapped=a};b.prototype=j.prototype;var r=function(a,c){return c?b(a).chain():a},H=function(a,c){j.prototype[a]=function(){var a=f.call(arguments);D.call(a,this._wrapped);return r(c.apply(b,a),this._chain)}};b.mixin(b);h(["pop","push","reverse","shift","sort",
- "splice","unshift"],function(a){var b=i[a];j.prototype[a]=function(){b.apply(this._wrapped,arguments);return r(this._wrapped,this._chain)}});h(["concat","join","slice"],function(a){var b=i[a];j.prototype[a]=function(){return r(b.apply(this._wrapped,arguments),this._chain)}});j.prototype.chain=function(){this._chain=!0;return this};j.prototype.value=function(){return this._wrapped}})();
- </script>
- <script type="text/javascript">// Backbone.js 0.3.3
- // (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
- // Backbone may be freely distributed under the MIT license.
- // For all details and documentation:
- // http://documentcloud.github.com/backbone
- (function(){var e;e=typeof exports!=="undefined"?exports:this.Backbone={};e.VERSION="0.3.3";var f=this._;if(!f&&typeof require!=="undefined")f=require("underscore")._;var h=this.jQuery||this.Zepto;e.emulateHTTP=false;e.emulateJSON=false;e.Events={bind:function(a,b){this._callbacks||(this._callbacks={});(this._callbacks[a]||(this._callbacks[a]=[])).push(b);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d=0,g=c.length;d<g;d++)if(b===c[d]){c.splice(d,
- 1);break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,g;if(!(c=this._callbacks))return this;if(b=c[a]){d=0;for(g=b.length;d<g;d++)b[d].apply(this,Array.prototype.slice.call(arguments,1))}if(b=c.all){d=0;for(g=b.length;d<g;d++)b[d].apply(this,arguments)}return this}};e.Model=function(a,b){a||(a={});if(this.defaults)a=f.extend({},this.defaults,a);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.set(a,{silent:true});this._previousAttributes=
- f.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;this.initialize(a,b)};f.extend(e.Model.prototype,e.Events,{_previousAttributes:null,_changed:false,initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=(b==null?"":b).replace(/&(?!\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,
- """)},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes,d=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return false;if("id"in a)this.id=a.id;for(var g in a){var i=a[g];if(!f.isEqual(c[g],i)){c[g]=i;delete d[g];if(!b.silent){this._changed=true;this.trigger("change:"+g,this,i,b)}}}!b.silent&&this._changed&&this.change(b);return this},unset:function(a,b){b||(b={});var c={};c[a]=void 0;if(!b.silent&&this.validate&&
- !this._performValidation(c,b))return false;delete this.attributes[a];delete this._escapedAttributes[a];if(!b.silent){this._changed=true;this.trigger("change:"+a,this,void 0,b);this.change(b)}return this},clear:function(a){a||(a={});var b=this.attributes,c={};for(attr in b)c[attr]=void 0;if(!a.silent&&this.validate&&!this._performValidation(c,a))return false;this.attributes={};this._escapedAttributes={};if(!a.silent){this._changed=true;for(attr in b)this.trigger("change:"+attr,this,void 0,a);this.change(a)}return this},
- fetch:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("read",this,function(d){if(!b.set(b.parse(d),a))return false;a.success&&a.success(b,d)},c);return this},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return false;var c=this,d=j(b.error,c,b),g=this.isNew()?"create":"update";(this.sync||e.sync)(g,this,function(i){if(!c.set(c.parse(i),b))return false;b.success&&b.success(c,i)},d);return this},destroy:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("delete",
- this,function(d){b.collection&&b.collection.remove(b);a.success&&a.success(b,d)},c);return this},url:function(){var a=k(this.collection);if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+this.id},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return!this.id},change:function(a){this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes);this._changed=false},hasChanged:function(a){if(a)return this._previousAttributes[a]!=
- this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=false,d;for(d in a)if(!f.isEqual(b[d],a[d])){c=c||{};c[d]=a[d]}return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c){b.error?b.error(this,c):this.trigger("error",this,c,b);return false}return true}});
- e.Collection=function(a,b){b||(b={});if(b.comparator){this.comparator=b.comparator;delete b.comparator}this._boundOnModelEvent=f.bind(this._onModelEvent,this);this._reset();a&&this.refresh(a,{silent:true});this.initialize(a,b)};f.extend(e.Collection.prototype,e.Events,{model:e.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,
- b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){if(a==null)return null;return this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("refresh",this,a);return this},pluck:function(a){return f.map(this.models,
- function(b){return b.get(a)})},refresh:function(a,b){a||(a=[]);b||(b={});this._reset();this.add(a,{silent:true});b.silent||this.trigger("refresh",this,b);return this},fetch:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("read",this,function(d){b.refresh(b.parse(d));a.success&&a.success(b,d)},c);return this},create:function(a,b){var c=this;b||(b={});if(a instanceof e.Model)a.collection=c;else a=new this.model(a,{collection:c});return a.save(null,{success:function(d,g){c.add(d);
- b.success&&b.success(d,g)},error:b.error})},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_add:function(a,b){b||(b={});a instanceof e.Model||(a=new this.model(a,{collection:this}));var c=this.getByCid(a);if(c)throw Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;a.collection=this;this.models.splice(this.comparator?this.sortedIndex(a,this.comparator):
- this.length,0,a);a.bind("all",this._boundOnModelEvent);this.length++;b.silent||a.trigger("add",a,this,b);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];delete a.collection;this.models.splice(this.indexOf(a),1);this.length--;b.silent||a.trigger("remove",a,this,b);a.unbind("all",this._boundOnModelEvent);return a},_onModelEvent:function(a,b){if(a==="change:id"){delete this._byId[b.previous("id")];this._byId[b.id]=
- b}this.trigger.apply(this,arguments)}});f.each(["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"],function(a){e.Collection.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});e.Controller=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes();
- this.initialize(a)};var o=/:([\w\d]+)/g,p=/\*([\w\d]+)/g;f.extend(e.Controller.prototype,e.Events,{initialize:function(){},route:function(a,b,c){e.history||(e.history=new e.History);f.isRegExp(a)||(a=this._routeToRegExp(a));e.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d))},this))},saveLocation:function(a){e.history.saveLocation(a)},_bindRoutes:function(){if(this.routes)for(var a in this.routes){var b=this.routes[a];
- this.route(a,b,this[b])}},_routeToRegExp:function(a){a=a.replace(o,"([^/]*)").replace(p,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});e.History=function(){this.handlers=[];this.fragment=this.getFragment();f.bindAll(this,"checkUrl")};var l=/^#*/;f.extend(e.History.prototype,{interval:50,getFragment:function(a){return(a||window.location).hash.replace(l,"")},start:function(){var a=document.documentMode;if(a=h.browser.msie&&(!a||a<=7))this.iframe=h('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;
- "onhashchange"in window&&!a?h(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);return this.loadUrl()},route:function(a,b){this.handlers.push({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();if(a==this.fragment&&this.iframe)a=this.getFragment(this.iframe.location);if(a==this.fragment||a==decodeURIComponent(this.fragment))return false;if(this.iframe)window.location.hash=this.iframe.location.hash=a;this.loadUrl()},loadUrl:function(){var a=this.fragment=
- this.getFragment();return f.any(this.handlers,function(b){if(b.route.test(a)){b.callback(a);return true}})},saveLocation:function(a){a=(a||"").replace(l,"");if(this.fragment!=a){window.location.hash=this.fragment=a;if(this.iframe&&a!=this.getFragment(this.iframe.location)){this.iframe.document.open().close();this.iframe.location.hash=a}}}});e.View=function(a){this._configure(a||{});this._ensureElement();this.delegateEvents();this.initialize(a)};var q=/^(\w+)\s*(.*)$/;f.extend(e.View.prototype,e.Events,
- {tagName:"div",$:function(a){return h(a,this.el)},initialize:function(){},render:function(){return this},remove:function(){h(this.el).remove();return this},make:function(a,b,c){a=document.createElement(a);b&&h(a).attr(b);c&&h(a).html(c);return a},delegateEvents:function(a){if(a||(a=this.events)){h(this.el).unbind();for(var b in a){var c=a[b],d=b.match(q),g=d[1];d=d[2];c=f.bind(this[c],this);d===""?h(this.el).bind(g,c):h(this.el).delegate(d,g,c)}}},_configure:function(a){if(this.options)a=f.extend({},
- this.options,a);if(a.model)this.model=a.model;if(a.collection)this.collection=a.collection;if(a.el)this.el=a.el;if(a.id)this.id=a.id;if(a.className)this.className=a.className;if(a.tagName)this.tagName=a.tagName;this.options=a},_ensureElement:function(){if(!this.el){var a={};if(this.id)a.id=this.id;if(this.className)a["class"]=this.className;this.el=this.make(this.tagName,a)}}});var m=function(a,b){var c=r(this,a,b);c.extend=m;return c};e.Model.extend=e.Collection.extend=e.Controller.extend=e.View.extend=
- m;var s={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};e.sync=function(a,b,c,d){var g=s[a];a=a==="create"||a==="update"?JSON.stringify(b.toJSON()):null;b={url:k(b),type:g,contentType:"application/json",data:a,dataType:"json",processData:false,success:c,error:d};if(e.emulateJSON){b.contentType="application/x-www-form-urlencoded";b.processData=true;b.data=a?{model:a}:{}}if(e.emulateHTTP)if(g==="PUT"||g==="DELETE"){if(e.emulateJSON)b.data._method=g;b.type="POST";b.beforeSend=function(i){i.setRequestHeader("X-HTTP-Method-Override",
- g)}}h.ajax(b)};var n=function(){},r=function(a,b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)};n.prototype=a.prototype;d.prototype=new n;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},k=function(a){if(!(a&&a.url))throw Error("A 'url' property or function must be specified");return f.isFunction(a.url)?a.url():a.url},j=function(a,b,c){return function(d){a?a(b,d):b.trigger("error",b,d,c)}}})();
- </script>
- <script type="text/javascript">var GLOBALS, adjustHeight, makeDataRequest, prefs, slugify;
- prefs = new gadgets.Prefs();
- GLOBALS = {
- rootUrl: "http://gocomics.com"
- };
- GLOBALS.feedUrl = "" + GLOBALS.rootUrl + "/feeds";
- GLOBALS.featureUrl = "" + GLOBALS.feedUrl + "/recent_item/";
- GLOBALS.featureListUrl = "" + GLOBALS.feedUrl + "/features?min=true&category=comic";
- GLOBALS.navigation = {
- myComics: {
- title: 'My Comics',
- slug: 'MyComics',
- featureGroups: [
- {
- title: 'My Comics',
- slug: 'mycomics',
- ids: [],
- data: []
- }
- ]
- },
- favorites: {
- title: 'Favorites',
- slug: 'Favorites',
- featureGroups: [
- {
- title: 'My Favorites',
- slug: 'myfavorites',
- ids: [],
- data: []
- }, {
- title: "Friends' Favorites",
- slug: 'friendsfavorites',
- ids: [],
- data: []
- }
- ]
- },
- allComics: {
- title: 'All Comics',
- slug: 'AllComics',
- featureGroups: [
- {
- title: 'Popular',
- slug: 'popular',
- ids: [],
- data: []
- }, {
- title: "A-Z",
- slug: 'atoz',
- ids: [],
- data: []
- }
- ]
- }
- };
- adjustHeight = function() {
- return gadgets.window.adjustHeight();
- };
- makeDataRequest = function(url, callback) {
- return gadgets.io.makeRequest(url, function(obj) {
- if (!obj || obj.rc !== 200) {
- console.log('Failed to get data.');
- }
- return callback(obj.data);
- });
- };
- slugify = function(str) {
- var from, i, to, _ref;
- str = str.replace(/^\s+|\s+$/g, '').toLowerCase();
- from = "ŕáäâčéëęěíďîňóöôůúüűńçˇ/_,:;";
- to = "aaaaeeeeiiiioooouuuunc------";
- for (i = 0, _ref = from.length; 0 <= _ref ? i <= _ref : i >= _ref; 0 <= _ref ? i++ : i--) {
- str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
- }
- return str.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-');
- };</script>
- <script type="text/javascript">var Feature, FeatureList, HomeView, init;
- Feature = Backbone.Model.extend({
- BASE_URL: GLOBALS.featureUrl,
- url: function() {
- return this.BASE_URL + this.attributes.id;
- }
- });
- FeatureList = Backbone.Collection.extend({
- BASE_URL: GLOBALS.featureListUrl,
- model: Feature,
- url: function() {
- return this.BASE_URL;
- }
- });
- HomeView = Backbone.View.extend({
- el: $('#home-container'),
- template: $('#feature-template').html(),
- _features: null,
- _currentFeature: null,
- _previousFeature: null,
- _nextFeature: null,
- _index: 0,
- _supportedViews: null,
- events: {
- 'click .pick-comics': 'pickComics',
- 'click .full-size': 'fullSize',
- 'click .feature-image img': 'fullSize',
- 'click .prev': 'previous',
- 'click .next': 'next'
- },
- initialize: function() {
- this.collection = new FeatureList(_.detect(GLOBALS.navigation.myComics.featureGroups, function(g) {
- return g.slug === 'mycomics';
- }).data);
- this.setFeature(this._index);
- this._supportedViews = gadgets.views.getSupportedViews();
- return this;
- },
- render: function() {
- $('#feature').html(Mustache.to_html(this.template, this._currentFeature.toJSON()));
- $('.prev').html("← " + this._previousFeature.attributes.title);
- $('.next').html("" + this._nextFeature.attributes.title + " →");
- adjustHeight();
- return this;
- },
- up: function(i) {
- if (i + 1 > this.collection.length - 1) {
- return 0;
- } else {
- return i + 1;
- }
- },
- down: function(i) {
- if (i - 1 < 0) {
- return this.collection.length - 1;
- } else {
- return i - 1;
- }
- },
- cycle: function(increment) {
- this._index = increment ? this.up(this._index) : this.down(this._index);
- return this.setFeature(this._index);
- },
- setFeature: function(i) {
- this._currentFeature = this.collection.at(i);
- this._previousFeature = this.collection.at(this.down(i));
- this._nextFeature = this.collection.at(this.up(i));
- return this.render();
- },
- rockTheCanvasView: function(isEditMode) {
- var params;
- params = {
- 'featureId': this._currentFeature.attributes.feature_id,
- 'isEditMode': isEditMode
- };
- return gadgets.views.requestNavigateTo(this._supportedViews.canvas, params);
- },
- pickComics: function(e) {
- e.preventDefault();
- return this.rockTheCanvasView(true);
- },
- fullSize: function(e) {
- e.preventDefault();
- return this.rockTheCanvasView(false);
- },
- previous: function(e) {
- e.preventDefault();
- return this.cycle(false);
- },
- next: function(e) {
- e.preventDefault();
- return this.cycle(true);
- }
- });
- init = function() {
- var featureGroup, initialize;
- featureGroup = _.detect(GLOBALS.navigation.myComics.featureGroups, function(g) {
- return g.slug === 'mycomics';
- });
- if (prefs.getArray(featureGroup.slug).length <= 0) {
- featureGroup.ids = [609, 9, 32];
- } else {
- featureGroup.ids = prefs.getArray(featureGroup.slug);
- }
- initialize = _.after(featureGroup.ids.length, function() {
- return window.View = new HomeView;
- });
- _(featureGroup.ids).each(function(id) {
- return makeDataRequest("" + GLOBALS.featureUrl + id, function(obj) {
- featureGroup.data.push(JSON.parse(obj));
- return initialize();
- });
- });
- return this;
- };
- gadgets.util.registerOnLoadHandler(init);</script>
-
- ]]>
- </Content>
-
-
-
- <!-- C A N V A S -->
- <Content type="html" view="canvas"><![CDATA[
-
- <style type='text/css'>
- /* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
- */
- html, body, div, span, applet, object, iframe,
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
- a, abbr, acronym, address, big, cite, code,
- del, dfn, em, img, ins, kbd, q, s, samp,
- small, strike, strong, sub, sup, tt, var,
- b, u, i, center,
- dl, dt, dd, ol, ul, li,
- fieldset, form, label, legend,
- table, caption, tbody, tfoot, thead, tr, th, td,
- article, aside, canvas, details, embed,
- figure, figcaption, footer, header, hgroup,
- menu, nav, output, ruby, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
- /* HTML5 display-role reset for older browsers */
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
- body {
- line-height: 1;
- }
- ol, ul {
- list-style: none;
- }
- blockquote, q {
- quotes: none;
- }
- blockquote:before, blockquote:after,
- q:before, q:after {
- content: '';
- content: none;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
- body {
- color: #474747;
- font-family: Helvetica, Arial, Verdana, sans-serif;
- font-size: 12px; }
- a {
- text-decoration: none;
- color: #4a91c1; }
- a:visited {
- color: #4a91c1; }
- .button, .big-button, .little-button {
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- color: #FFF;
- font-weight: bold;
- text-align: center; }
- .button:visited, .big-button:visited, .little-button:visited {
- color: #FFF; }
- .big-button {
- background: #38a3cd;
- background: -webkit-gradient(linear, left top, left bottom, from(#8acae1), to(#38a3cd));
- background: -moz-linear-gradient(top, #8acae1, #38a3cd);
- width: 75px;
- display: block;
- padding: 6px 10px; }
- .big-button:hover {
- background: #8acae1;
- background: -webkit-gradient(linear, left top, left bottom, from(#38a3cd), to(#8acae1));
- background: -moz-linear-gradient(top, #38a3cd, #8acae1); }
- .little-button {
- background: #777777;
- background: -webkit-gradient(linear, left top, left bottom, from(#888888), to(#777777));
- background: -moz-linear-gradient(top, #888888, #777777);
- display: inline-block;
- width: 150px;
- padding: 4px 8px; }
- .little-button:hover {
- background: #888888;
- background: -webkit-gradient(linear, left top, left bottom, from(#777777), to(#888888));
- background: -moz-linear-gradient(top, #777777, #888888); }
- .clear {
- clear: both; }
- #canvas {
- width: 950px;
- background: #FFF;
- margin-left: 5px;
- margin-top: 5px; }
- #canvas-container {
- background: #FFF; }
- #tab-navigation {
- color: #FFF;
- width: inherit; }
- #tab-navigation ul {
- background: #5e9100;
- background: -webkit-gradient(linear, left top, left bottom, from(#78ae07), to(#5e9100));
- background: -moz-linear-gradient(top, #78ae07, #5e9100);
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- display: table;
- width: 300px; }
- #tab-navigation ul li {
- display: table-cell;
- border-right: 1px solid #629000;
- border-left: 1px solid #8CB94A; }
- #tab-navigation ul li a {
- font-weight: bold;
- color: inherit;
- text-align: center;
- display: block;
- padding: 12px 12px 20px 12px; }
- #tab-navigation ul li a:hover, #tab-navigation ul li a.selected {
- background: #85b334;
- background: -webkit-gradient(linear, left top, left bottom, from(#78ae07), to(#85b334));
- background: -moz-linear-gradient(top, #78ae07, #85b334); }
- #tab-navigation ul li a.selected {
- cursor: inherit; }
- #tab-navigation ul li #myComics:hover, #tab-navigation ul li #myComics.selected {
- border-top-left-radius: 5px;
- border-bottom-left-radius: 5px;
- -webkit-border-top-left-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- -moz-border-radius-topleft: 5px;
- -moz-border-radius-bottomleft: 5px; }
- #tab-navigation ul li #allComics:hover, #tab-navigation ul li #allComics.selected {
- border-top-right-radius: 5px;
- border-bottom-right-radius: 5px;
- -webkit-border-top-right-radius: 5px;
- -webkit-border-bottom-right-radius: 5px;
- -moz-border-radius-topright: 5px;
- -moz-border-radius-bottomright: 5px; }
- #tab-navigation ul li:first-child {
- border-left: none; }
- #tab-navigation ul li.last-li {
- border-right: none; }
- #content {
- -moz-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.3);
- -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.3);
- box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.3);
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-top: 4px solid #71A9CC;
- position: relative;
- background: #FFF;
- top: -10px;
- padding-left: 10px;
- padding-top: 10px;
- padding-bottom: 10px; }
- #feature {
- background: white;
- background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(white));
- background: -moz-linear-gradient(top, #f2f2f2, white);
- -moz-box-shadow: 0 0 5px 2px #bbbbbb;
- -webkit-box-shadow: 0 0 5px 2px #bbbbbb;
- box-shadow: 0 0 5px 2px #bbbbbb;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border: 2px solid #FFF;
- width: 615px;
- display: inline-block;
- padding: 15px; }
- #feature div.feature-header {
- display: table;
- width: inherit;
- margin-bottom: 10px; }
- #feature div.feature-header h1 {
- display: table-cell;
- vertical-align: middle;
- font-size: 24px; }
- #feature div.feature-header h1 .byline {
- color: #8e8e8e;
- font-size: 18px; }
- #feature div.feature-header ul.feature-navigation {
- display: table-cell;
- vertical-align: middle;
- text-align: right; }
- #feature div.feature-header ul.feature-navigation li {
- display: inline-block;
- padding: 0 2px; }
- #feature div.feature-image {
- width: inherit;
- text-align: center; }
- #feature ul.share-wrapper {
- background: #e4e4e4;
- background: -webkit-gradient(linear, left top, left bottom, from(white), to(#e4e4e4));
- background: -moz-linear-gradient(top, white, #e4e4e4);
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -moz-box-shadow: 0 0 5px 1px #cccccc;
- -webkit-box-shadow: 0 0 5px 1px #cccccc;
- box-shadow: 0 0 5px 1px #cccccc;
- font-size: 11px;
- border: 1px solid #CCC;
- text-align: center;
- text-transform: uppercase;
- margin-top: 10px; }
- #feature ul.share-wrapper li {
- display: inline-block;
- border-left: 1px solid #DDD; }
- #feature ul.share-wrapper li a {
- width: 203.667px;
- padding: 11px 0;
- display: block;
- color: inherit; }
- #feature ul.share-wrapper li a:hover {
- background: white;
- background: -webkit-gradient(linear, left top, left bottom, from(#e4e4e4), to(white));
- background: -moz-linear-gradient(top, #e4e4e4, white); }
- #feature ul.share-wrapper li a#share:hover {
- border-top-right-radius: 5px;
- border-bottom-right-radius: 5px;
- -webkit-border-top-right-radius: 5px;
- -webkit-border-bottom-right-radius: 5px;
- -moz-border-radius-topright: 5px;
- -moz-border-radius-bottomright: 5px; }
- #feature ul.share-wrapper li a#favorite:hover {
- border-top-left-radius: 5px;
- border-bottom-left-radius: 5px;
- -webkit-border-top-left-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- -moz-border-radius-topleft: 5px;
- -moz-border-radius-bottomleft: 5px; }
- #feature ul.share-wrapper li:first-child {
- border-left: none; }
- #feature form#feature-comment {
- display: none;
- width: inherit;
- text-align: right; }
- #feature form#feature-comment h3 {
- text-align: left;
- font-size: 14px;
- color: #8e8e8e;
- padding: 10px 0; }
- #feature form#feature-comment h3 #counter {
- text-align: right;
- float: right;
- color: #d5d5d5; }
- #feature form#feature-comment textarea {
- width: inherit;
- text-align: left; }
- #feature-list {
- vertical-align: top;
- width: 288px;
- display: inline-block; }
- #feature-list ul, #feature-list > div {
- padding-left: 15px;
- padding-right: 15px; }
- #feature-list ul.feature-list-tabs {
- border-bottom: 1px solid #B2B2B2; }
- #feature-list ul.feature-list-tabs li {
- display: inline-block; }
- #feature-list ul.feature-list-tabs li a {
- background: white;
- background: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(white));
- background: -moz-linear-gradient(top, #e8e8e8, white);
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
- -webkit-border-top-left-radius: 5px;
- -webkit-border-top-right-radius: 5px;
- -moz-border-radius-topleft: 5px;
- -moz-border-radius-topbottom: 5px;
- display: block;
- padding: 6px 12px;
- border-top: 1px solid #B2B2B2;
- border-left: 1px solid #B2B2B2;
- border-right: 1px solid #B2B2B2;
- border-bottom: 1px solid #FFF;
- position: relative;
- top: 1px; }
- #feature-list div.feature-list-header {
- padding-top: 6px;
- padding-bottom: 8px;
- margin-top: 4px;
- font-size: 16px;
- font-weight: bold;
- overflow: hidden;
- border-bottom: 1px solid #DDD; }
- #feature-list div.feature-list-header h3 {
- width: 50%;
- float: left;
- padding: 2px 0; }
- #feature-list div.feature-list-header div.edit {
- font-weight: normal;
- float: right;
- color: #8e8e8e;
- font-size: 12px; }
- #feature-list div.feature-list-header div.edit a {
- width: auto; }
- #feature-list ul.feature-list-navigation {
- background: #e4e4e4;
- background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#e4e4e4));
- background: -moz-linear-gradient(top, #f4f4f4, #e4e4e4);
- border-bottom: 1px solid #CCC;
- margin-bottom: 5px;
- display: table;
- width: inherit;
- height: 24px;
- text-align: right; }
- #feature-list ul.feature-list-navigation li {
- vertical-align: middle;
- font-weight: bold;
- display: table-cell;
- width: 50%; }
- #feature-list ul.feature-list-navigation li:first-child {
- text-align: left; }
- #feature-list ul.features {
- padding: 0px; }
- #feature-list ul.features li a {
- display: block;
- padding: 5px 15px; }
- #feature-list ul.features li a:hover {
- background: #e7f2ff; }
- #feature-list ul.features li.alt a {
- background: #f4f4f4; }
- #feature-list ul.features li.alt a:hover {
- background: #e7f2ff; }
- </style>
-
- <div id="canvas">
- <!-- Banner ad goes here. -->
- <div id="canvas-container">
- <div id="tab-navigation">
- <ul>
- <li>
- <a href="#" id="MyComics" class="top-tab">My Comics</a>
- </li>
- <li>
- <a href="#" id="Favorites" class="top-tab">Favorites</a>
- </li>
- <li class="last-li">
- <a href="#" id="AllComics" class="top-tab">All Comics</a>
- </li>
- </ul>
- </div>
- <div id="content">
- <div id="feature"></div>
- <div id="feature-list"></div>
- <div class="clear"></div>
- <div id="feature-comments"></div>
- </div>
- </div>
- </div>
- <script id="feature-template" type="text/mustache-tmpl">
- <div class="feature-header">
- <h1>{{title}} <span class="byline">by {{author}}</span></h1>
- <ul class="feature-navigation">
- <li>{{display_date}}</li>
- <li><a href="#" id="prev">←</a></li>
- <li><a href="#" id="next">→</a></li>
- </ul>
- </div>
- <div class="feature-image">
- <img src="{{image_link}}" alt="{{title}}" />
- </div>
- <ul class="share-wrapper"><li><a href="{{id}}" id="favorite">Favorite</a></li><li><a href="{{feature_id}}" id="subscribe">Subscribe</a></li><li><a href="{{id}}" id="share">Share</a></li></ul>
- <form id="feature-comment">
- <h3>Share with comment: <span id="counter">140</span></h3>
- <textarea cols="40" rows="2" id="comment-field"></textarea>
- <input id="comment-button" type="button" value="Share" />
- </form>
- </script>
- <script id="feature-list-template" type="text/mustache-tmpl">
- <ul class="feature-list-tabs">
- {{#feature_groups}}
- <li class="little-tab"><a href="#" id="{{slug}}">{{title}}</a></li>
- {{/feature_groups}}
- </ul>
- <div class="feature-list-header">
- <h3>{{title}}</h3>
- <div class="edit"><a href="#" class="little-button">Edit</a></div>
- </div>
- <ul class="feature-list-navigation">
- <li><a href="#" id="prev">← Previous</a></li>
- <li><a href="#" id="next">Next →</a></li>
- </ul>
- <ul class="features">
- {{#features}}
- <li><a href="{{id}}">{{title}}</a></li>
- {{/features}}
- </ul>
- </script>
-
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
- <script type="text/javascript">/*
- mustache.js Logic-less templates in JavaScript
- See http://mustache.github.com/ for more info.
- */
- var Mustache = function() {
- var Renderer = function() {};
- Renderer.prototype = {
- otag: "{{",
- ctag: "}}",
- pragmas: {},
- buffer: [],
- pragmas_implemented: {
- "IMPLICIT-ITERATOR": true
- },
- context: {},
- render: function(template, context, partials, in_recursion) {
- // reset buffer & set context
- if(!in_recursion) {
- this.context = context;
- this.buffer = []; // TODO: make this non-lazy
- }
- // fail fast
- if(!this.includes("", template)) {
- if(in_recursion) {
- return template;
- } else {
- this.send(template);
- return;
- }
- }
- template = this.render_pragmas(template);
- var html = this.render_section(template, context, partials);
- if(in_recursion) {
- return this.render_tags(html, context, partials, in_recursion);
- }
- this.render_tags(html, context, partials, in_recursion);
- },
- /*
- Sends parsed lines
- */
- send: function(line) {
- if(line != "") {
- this.buffer.push(line);
- }
- },
- /*
- Looks for %PRAGMAS
- */
- render_pragmas: function(template) {
- // no pragmas
- if(!this.includes("%", template)) {
- return template;
- }
- var that = this;
- var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
- this.ctag);
- return template.replace(regex, function(match, pragma, options) {
- if(!that.pragmas_implemented[pragma]) {
- throw({message:
- "This implementation of mustache doesn't understand the '" +
- pragma + "' pragma"});
- }
- that.pragmas[pragma] = {};
- if(options) {
- var opts = options.split("=");
- that.pragmas[pragma][opts[0]] = opts[1];
- }
- return "";
- // ignore unknown pragmas silently
- });
- },
- /*
- Tries to find a partial in the curent scope and render it
- */
- render_partial: function(name, context, partials) {
- name = this.trim(name);
- if(!partials || partials[name] === undefined) {
- throw({message: "unknown_partial '" + name + "'"});
- }
- if(typeof(context[name]) != "object") {
- return this.render(partials[name], context, partials, true);
- }
- return this.render(partials[name], context[name], partials, true);
- },
- /*
- Renders inverted (^) and normal (#) sections
- */
- render_section: function(template, context, partials) {
- if(!this.includes("#", template) && !this.includes("^", template)) {
- return template;
- }
- var that = this;
- // CSW - Added "+?" so it finds the tighest bound, not the widest
- var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
- "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
- "\\s*", "mg");
- // for each {{#foo}}{{/foo}} section do...
- return template.replace(regex, function(match, type, name, content) {
- var value = that.find(name, context);
- if(type == "^") { // inverted section
- if(!value || that.is_array(value) && value.length === 0) {
- // false or empty list, render it
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- } else if(type == "#") { // normal section
- if(that.is_array(value)) { // Enumerable, Let's loop!
- return that.map(value, function(row) {
- return that.render(content, that.create_context(row),
- partials, true);
- }).join("");
- } else if(that.is_object(value)) { // Object, Use it as subcontext!
- return that.render(content, that.create_context(value),
- partials, true);
- } else if(typeof value === "function") {
- // higher order section
- return value.call(context, content, function(text) {
- return that.render(text, context, partials, true);
- });
- } else if(value) { // boolean section
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- }
- });
- },
- /*
- Replace {{foo}} and friends with values from our view
- */
- render_tags: function(template, context, partials, in_recursion) {
- // tit for tat
- var that = this;
- var new_regex = function() {
- return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
- that.ctag + "+", "g");
- };
- var regex = new_regex();
- var tag_replace_callback = function(match, operator, name) {
- switch(operator) {
- case "!": // ignore comments
- return "";
- case "=": // set new delimiters, rebuild the replace regexp
- that.set_delimiters(name);
- regex = new_regex();
- return "";
- case ">": // render partial
- return that.render_partial(name, context, partials);
- case "{": // the triple mustache is unescaped
- return that.find(name, context);
- default: // escape the value
- return that.escape(that.find(name, context));
- }
- };
- var lines = template.split("\n");
- for(var i = 0; i < lines.length; i++) {
- lines[i] = lines[i].replace(regex, tag_replace_callback, this);
- if(!in_recursion) {
- this.send(lines[i]);
- }
- }
- if(in_recursion) {
- return lines.join("\n");
- }
- },
- set_delimiters: function(delimiters) {
- var dels = delimiters.split(" ");
- this.otag = this.escape_regex(dels[0]);
- this.ctag = this.escape_regex(dels[1]);
- },
- escape_regex: function(text) {
- // thank you Simon Willison
- if(!arguments.callee.sRE) {
- var specials = [
- '/', '.', '*', '+', '?', '|',
- '(', ')', '[', ']', '{', '}', '\\'
- ];
- arguments.callee.sRE = new RegExp(
- '(\\' + specials.join('|\\') + ')', 'g'
- );
- }
- return text.replace(arguments.callee.sRE, '\\$1');
- },
- /*
- find `name` in current `context`. That is find me a value
- from the view object
- */
- find: function(name, context) {
- name = this.trim(name);
- // Checks whether a value is thruthy or false or 0
- function is_kinda_truthy(bool) {
- return bool === false || bool === 0 || bool;
- }
- var value;
- if(is_kinda_truthy(context[name])) {
- value = context[name];
- } else if(is_kinda_truthy(this.context[name])) {
- value = this.context[name];
- }
- if(typeof value === "function") {
- return value.apply(context);
- }
- if(value !== undefined) {
- return value;
- }
- // silently ignore unkown variables
- return "";
- },
- // Utility methods
- /* includes tag */
- includes: function(needle, haystack) {
- return haystack.indexOf(this.otag + needle) != -1;
- },
- /*
- Does away with nasty characters
- */
- escape: function(s) {
- s = String(s === null ? "" : s);
- return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
- switch(s) {
- case "&": return "&";
- case "\\": return "\\\\";
- case '"': return '"';
- case "'": return ''';
- case "<": return "<";
- case ">": return ">";
- default: return s;
- }
- });
- },
- // by @langalex, support for arrays of strings
- create_context: function(_context) {
- if(this.is_object(_context)) {
- return _context;
- } else {
- var iterator = ".";
- if(this.pragmas["IMPLICIT-ITERATOR"]) {
- iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
- }
- var ctx = {};
- ctx[iterator] = _context;
- return ctx;
- }
- },
- is_object: function(a) {
- return a && typeof a == "object";
- },
- is_array: function(a) {
- return Object.prototype.toString.call(a) === '[object Array]';
- },
- /*
- Gets rid of leading and trailing whitespace
- */
- trim: function(s) {
- return s.replace(/^\s*|\s*$/g, "");
- },
- /*
- Why, why, why? Because IE. Cry, cry cry.
- */
- map: function(array, fn) {
- if (typeof array.map == "function") {
- return array.map(fn);
- } else {
- var r = [];
- var l = array.length;
- for(var i = 0; i < l; i++) {
- r.push(fn(array[i]));
- }
- return r;
- }
- }
- };
- return({
- name: "mustache.js",
- version: "0.3.1-dev",
- /*
- Turns a template and view into HTML
- */
- to_html: function(template, view, partials, send_fun) {
- var renderer = new Renderer();
- if(send_fun) {
- renderer.send = send_fun;
- }
- renderer.render(template, view, partials);
- if(!send_fun) {
- return renderer.buffer.join("\n");
- }
- }
- });
- }();
- </script>
- <script type="text/javascript">// Underscore.js 1.1.6
- // (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
- // Underscore is freely distributable under the MIT license.
- // Portions of Underscore are inspired or borrowed from Prototype,
- // Oliver Steele's Functional, and John Resig's Micro-Templating.
- // For all details and documentation:
- // http://documentcloud.github.com/underscore
- (function(){var p=this,C=p._,m={},i=Array.prototype,n=Object.prototype,f=i.slice,D=i.unshift,E=n.toString,l=n.hasOwnProperty,s=i.forEach,t=i.map,u=i.reduce,v=i.reduceRight,w=i.filter,x=i.every,y=i.some,o=i.indexOf,z=i.lastIndexOf;n=Array.isArray;var F=Object.keys,q=Function.prototype.bind,b=function(a){return new j(a)};typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):p._=b;b.VERSION="1.1.6";var h=b.each=b.forEach=function(a,c,d){if(a!=null)if(s&&a.forEach===s)a.forEach(c,d);else if(b.isNumber(a.length))for(var e=
- 0,k=a.length;e<k;e++){if(c.call(d,a[e],e,a)===m)break}else for(e in a)if(l.call(a,e)&&c.call(d,a[e],e,a)===m)break};b.map=function(a,c,b){var e=[];if(a==null)return e;if(t&&a.map===t)return a.map(c,b);h(a,function(a,g,G){e[e.length]=c.call(b,a,g,G)});return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var k=d!==void 0;a==null&&(a=[]);if(u&&a.reduce===u)return e&&(c=b.bi