This file contains hidden or 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
var dispatcher = function (path, func) { | |
if (func) return dispatcher.path_func.push([path, func]); | |
$.each(dispatcher.path_func, function () { | |
if (path.match(this[0])) return this[1](); | |
}); | |
}; | |
dispatcher.path_func = []; | |
setTimeout(function () { dispatcher(location.pathname); }, 0); | |
dispatcher('.', function () { |
This file contains hidden or 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
$.fn.tap = function (func) { | |
$.ifFunction(func) ? func.call(this, this) : console.debug(this) | |
return this; | |
}; | |
$(‘div’).find(‘a’).tap(function () { | |
console.debug(this[0]); | |
}); |
This file contains hidden or 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
(function ($) { | |
// ここで普通に書く | |
})(jQuery.noConflict(true)); |
This file contains hidden or 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
(function () { | |
String.prototype.template = function (param) { | |
function esc (c) { return '&#'+c.charCodeAt(0)+';'; }; | |
var reg = new RegExp('[&"<>\']', 'g'); | |
return this.replace(/\[%(.+?)%\]/g, function (arg1, key) { | |
return ((param[key] || '')+'').replace(reg, esc); | |
}); | |
}; | |
})(); |
This file contains hidden or 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
$(function () { | |
var gmap = $('#gmap'); | |
if (!gmap.length) return; | |
$.getJSON(gmap.find(':hidden').val(), function (data) { | |
if (!GBrowserIsCompatible()) return; | |
var map = new GMap2(gmap.get(0)); | |
map.addControl(new GMapTypeControl()); | |
map.addControl(new GLargeMapControl()); | |
var bounds = new GLatLngBounds(); | |
var markers = []; |
This file contains hidden or 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
yum -y install gcc-c++ libpng-devel libjpeg-devel freetype* libxslt-devel | |
wget http://swfmill.org/releases/swfmill-0.3.0.tar.gz | |
tar xzf swfmill-0.3.0.tar.gz | |
cd swfmill-0.3.0 | |
wget http://lab.klab.org/files/flash/encoding.patch | |
patch -fp1 < encoding.patch | |
./configure | |
make && make install |
This file contains hidden or 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
function YYYYMMDD (d) { return [d.getFullYear(), '0' + (d.getMonth() + 1), '0' + d.getDate()].join('-').replace(/-\d(\d\d)/g, '-$1'); }; |
This file contains hidden or 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
$('#hoge1').delay(700).fadeIn(500, function () { | |
$('#hoge2').delay(700).fadeIn(500, function () { | |
$('#hoge3').delay(700).fadeIn(500); | |
}); | |
}); |
This file contains hidden or 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
$().ajaxSend(function () { | |
if ($('#click_wrapper').length) return; | |
$('<div id="click_wrapper">').appendTo('body').css('opacity', 0); | |
}).bind('ajaxComplete', function () { | |
setTimeout(function () { | |
$('#click_wrapper').remove(); | |
}, 500); | |
}); | |
$('body').live('pageAnimationStart', function () { | |
if ($('#click_wrapper').length) return; |
This file contains hidden or 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
/** | |
* getScrollTop, getScrollLeftの設定 | |
* @returns scroll position | |
*/ | |
$.each([['Top', 'Y'], ['Left', 'X']], function () { | |
var name = this; | |
$[('getScroll' + name[0])] = function () { | |
var b = document.body['scroll' + name[0]] || 0; | |
var e = document.documentElement['scroll' + name[0]] || 0; | |
var s = window['scroll' + name[1]] || 0; |
OlderNewer