Permalink
Browse files

IE fixes + demo using Google's advanced compiler mode.

  • Loading branch information...
1 parent ce3541b commit 624f992d37760165dc3ad9e67d8b769acb56e28d @mythz committed Nov 28, 2011
@@ -2,39 +2,37 @@
<html lang="en-us">
<head>
<title>jQuip - jQuery in parts</title>
- <script type="text/javascript" src="dist/jquip.min.js"></script>
- <script type="text/javascript" src="dist/jquip.events.min.js"></script>
- <script type="text/javascript" src="dist/jquip.docready.min.js"></script>
- <script type="text/javascript" src="dist/jquip.css.min.js"></script>
- <script type="text/javascript" src="dist/jquip.ajax.min.js"></script>
- <script type="text/javascript" src="dist/jquip.custom.min.js"></script>
+ <script type="text/javascript" src="dist/jquip.all.closure-advanced.js"></script>
<script type="text/javascript">
$(function() {
$(document.body)
.css({'font-family':'Arial'})
.append("<p>This message added on document ready</p>");
- $(".attrs button").click(function ()
- {
+
+ $(".attrs button").click(function () {
var $dl = $(this).next();
- $.each($(this).parent().data(), function (name, val)
- {
+ $.each($(this).parent().data(), function (name, val) {
$dl.append("<dt>" + name + "</dt>").append("<dd>" + val + "</dd>");
});
});
+
var compiledTpl = $._template($("#tpl").html()), $win = $(window);
- $win.resize(function(){
+ var updateTpl = function(){
var html = compiledTpl({width: $win.width(), height: $win.height()});
$("#winsize").html(html);
- });
- $win.resize();
+ };
+
+ $win.resize(updateTpl);
- function rgb()
- {
+ function rgb() {
return Math.floor(Math.random() * 255);
}
+
$("body > button").click(function(){
$(document.body).css({background:"rgb(" + rgb() + "," + rgb() + "," + rgb() + ")"});
});
+
+ updateTpl();
});
</script>
</head>
View
@@ -13,28 +13,31 @@
$(document.body)
.css({'font-family':'Arial'})
.append("<p>This message added on document ready</p>");
- $(".attrs button").click(function ()
- {
- var $dl = $(this).next();
- $.each($(this).parent().data(), function (name, val)
- {
+
+ $(".attrs button").click(function () {
+ var $dl = $(this).next();
+ $.each($(this).parent().data(), function (name, val) {
$dl.append("<dt>" + name + "</dt>").append("<dd>" + val + "</dd>");
});
});
+
var compiledTpl = $._template($("#tpl").html()), $win = $(window);
- $win.resize(function(){
+ var updateTpl = function(){
var html = compiledTpl({width: $win.width(), height: $win.height()});
$("#winsize").html(html);
- });
- $win.resize();
+ };
+
+ $win.resize(updateTpl);
- function rgb()
- {
+ function rgb() {
return Math.floor(Math.random() * 255);
}
+
$("body > button").click(function(){
$(document.body).css({background:"rgb(" + rgb() + "," + rgb() + "," + rgb() + ")"});
});
+
+ updateTpl();
});
</script>
</head>

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -464,7 +464,7 @@ window['$'] = window['jquip'] = (function(){
var useQuery = queryEngines();
$['setQuery'](useQuery || function(sel, ctx){
- return doc.querySelectorAll ? (ctx || doc).querySelectorAll(sel) : [];
+ return doc.querySelectorAll ? makeArray((ctx || doc).querySelectorAll(sel)) : [];
});
function loadScript(url, cb, async){
@@ -1449,7 +1449,8 @@ $['plug']("events", function($){
this.dispatchEvent(e, e.initEvent(evt, true, true));
} else if (this.fireEvent)
try {
- this.fireEvent("on" + evt);
+ if (evt !== "ready")
+ this.fireEvent("on" + evt);
} catch(e){}
});
};
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -8,28 +8,31 @@
$(document.body)
.css({'font-family':'Arial'})
.append("<p>This message added on document ready</p>");
- $(".attrs button").click(function ()
- {
- var $dl = $(this).next();
- $.each($(this).parent().data(), function (name, val)
- {
+
+ $(".attrs button").click(function () {
+ var $dl = $(this).next();
+ $.each($(this).parent().data(), function (name, val) {
$dl.append("<dt>" + name + "</dt>").append("<dd>" + val + "</dd>");
});
});
+
var compiledTpl = $._template($("#tpl").html()), $win = $(window);
- $win.resize(function(){
+ var updateTpl = function(){
var html = compiledTpl({width: $win.width(), height: $win.height()});
$("#winsize").html(html);
- });
- $win.resize();
+ };
+
+ $win.resize(updateTpl);
- function rgb()
- {
+ function rgb() {
return Math.floor(Math.random() * 255);
}
+
$("body > button").click(function(){
$(document.body).css({background:"rgb(" + rgb() + "," + rgb() + "," + rgb() + ")"});
});
+
+ updateTpl();
});
</script>
</head>
View
@@ -131,7 +131,8 @@ $['plug']("events", function($){
this.dispatchEvent(e, e.initEvent(evt, true, true));
} else if (this.fireEvent)
try {
- this.fireEvent("on" + evt);
+ if (evt !== "ready")
+ this.fireEvent("on" + evt);
} catch(e){}
});
};
View
@@ -464,7 +464,7 @@ window['$'] = window['jquip'] = (function(){
var useQuery = queryEngines();
$['setQuery'](useQuery || function(sel, ctx){
- return doc.querySelectorAll ? (ctx || doc).querySelectorAll(sel) : [];
+ return doc.querySelectorAll ? makeArray((ctx || doc).querySelectorAll(sel)) : [];
});
function loadScript(url, cb, async){

0 comments on commit 624f992

Please sign in to comment.