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
$('#loading').ajaxStart(function () { | |
$(this).show(); | |
}); | |
$('#loading').ajaxStop(function () { | |
$(this).hide(); | |
}); | |
$('#send').click(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
function drag(o){ | |
var params = { | |
startLeft: 0, | |
startTop: 0, | |
_x: | |
_y: | |
isDrag: false | |
}; | |
params.startLeft = o.currentLeft; |
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 slideshow = { | |
context: false, | |
tabs: false, | |
timeout: 1000, | |
slideSpeed: 1000, | |
tabSpeed: 300, | |
fx: 'scrollLeft' | |
init: function () { | |
this.context = $('#slideshow'); |
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
$('#timer').focus(function(){ | |
// turn on timer | |
startTimer(); | |
}).blur(function(){ | |
// turn off timer | |
endTimer(); | |
}); | |
var lastValue = "", |
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
// ECMAScript 5 | |
function isEmpty(obj){ | |
return Object.getOwnPropertyNames(obj).length === 0; | |
} | |
function isEmpty(obj){ | |
return Object.keys(obj).length === 0; | |
} | |
// compitable |
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 uniqueId = function () { | |
var idCounter = 0; | |
return function(prefix){ | |
var id = ++idCounter + ''; | |
return prefix ? prefix + id : id; | |
} | |
}(); | |
var cid = uniqueId(); // 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
(function(){ | |
var global = this; | |
})(); |
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
// | |
// 适用于node.js,不依赖于其它js,仅是一个库 | |
(function(){ | |
var global = this; | |
var libName = function () { | |
} | |
if(typeof module !== 'undefined') { |
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
import sublime, sublime_plugin | |
import webbrowser | |
class OpenBrowserCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
# self.view.insert(edit, 0, "Hello, World!") | |
url = self.view.file_name(); | |
webbrowser.open_new(url); |
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 isInProgress(){ | |
return $submit.prop('disabled') === true; | |
} | |
function markInProgress(){ | |
$submit.prop('disabled', true); | |
} | |
function markProgressDone(){ | |
$submit.prop('disabled', false); | |
} |
OlderNewer