2011-02-14 17:19:44 -08:00
|
|
|
|
(function ($) {
|
|
|
|
|
$(function () {
|
|
|
|
|
$("<div id='debug-control'><ul><li id='debug-shapes'>Shapes</li><li id='debug-zones'>Zones</li></ul><div id='debug-control-toggle'>»</div></div>")
|
2011-02-08 17:52:53 -08:00
|
|
|
|
.appendTo("body");
|
2011-02-14 17:19:44 -08:00
|
|
|
|
$("#debug-shapes").click(function () {
|
2011-02-08 17:52:53 -08:00
|
|
|
|
var _this = $(this);
|
|
|
|
|
$("html").toggleClass(_this.attr("id"));
|
|
|
|
|
$(this).toggleClass("debug-active");
|
|
|
|
|
});
|
2011-02-14 17:19:44 -08:00
|
|
|
|
$("#debug-zones").click(function () {
|
2011-02-11 15:33:33 -08:00
|
|
|
|
var _this = $(this);
|
|
|
|
|
$("html").toggleClass(_this.attr("id"));
|
|
|
|
|
$(this).toggleClass("debug-active");
|
2011-02-14 17:19:44 -08:00
|
|
|
|
|
|
|
|
|
if ($(this).hasClass("debug-active")) {
|
|
|
|
|
|
|
|
|
|
// renders the zone name in each zone
|
|
|
|
|
$(".zone").each(function () {
|
|
|
|
|
var classes = $(this).attr("class").split(' ');
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < classes.length; i++) {
|
|
|
|
|
if (classes[i].indexOf("zone-") === 0) {
|
|
|
|
|
$(this).append('<div class="zone-name">' + classes[i].substr(classes[i].indexOf("-")+1) + '</div>');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$(".zone-name").remove();
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-11 15:33:33 -08:00
|
|
|
|
});
|
|
|
|
|
$("#debug-control-toggle").click(function () {
|
2011-02-08 17:52:53 -08:00
|
|
|
|
var _this = $(this), open = "debug-open";
|
2011-02-14 17:19:44 -08:00
|
|
|
|
if (_this.is("." + open)) {
|
|
|
|
|
_this.prev().hide("fast", function () { _this.removeClass(open).html("»"); });
|
2011-02-08 17:52:53 -08:00
|
|
|
|
} else {
|
2011-02-14 17:19:44 -08:00
|
|
|
|
_this.prev().show("fast", function () { _this.addClass(open).html("«"); });
|
2011-02-08 17:52:53 -08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})(jQuery);
|