This file contains 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
/** > placeholderize ['placeholdered' <- класс когда текст в инпуте из плейсхолдера] */ | |
(function($) { | |
var activeClass = 'placeholdered'; | |
$('[data-placeholder]').each(function(i) { | |
var placeholder = $(this).data('placeholder'); | |
if (this.value.length == 0) { | |
this.value = placeholder; | |
$(this).addClass(activeClass) | |
} | |
$(this) |
This file contains 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
/** > inputClearize (Умная очистка инпутов) [применяется для всех инпутов, у которых есть аттрибут rel, равный 'cleared'][Также должен рядом по DOM быть расположен элемент с классом 'clearInput' для опустошения value инпута] @link https://gist.github.com/3950536 */ | |
(function($){ | |
var $e = $('input[rel~="cleared"]') | |
$e.on('keyup', function(){ | |
var proxy = this, | |
value = this.value, | |
isPlace = $(this).data('placeholder') || false, | |
onClicker = $( $(this).siblings('.clearInput') ), | |
visibilityValue = ((value.length > 0 && !isPlace) || (value.length !== isPlace.length)) ? 'visible' : 'hidden'; | |
onClicker.css({visibility: visibilityValue}) |
This file contains 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($){ | |
$.fn.upPanel = function(options) { | |
var | |
settings = $.extend({ | |
fade : false, // int, etc; | |
speed : 300, // up scroll speed | |
waterline : 600, // 'auto', 'formula' |
This file contains 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
$.shortcut = function(combination, callback) { | |
$(document).on("keydown", function(e){ | |
var combo = combination.split('+'), | |
eventKey = combo[combo.length-1], | |
primary = combo[0] == 'ctrl' ? e.ctrlKey: combo[0] == 'shift' ? e.shiftKey : e.altKey; | |
if(e.keyCode == eventKey.toUpperCase().charCodeAt(0) && primary) { | |
e.preventDefault(); | |
callback.apply(this); | |
} | |
}); |
This file contains 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.fadeToggle = function(speed, callback, important) { | |
return this.each(function() { | |
$(this)[ important ? ( important == 'show' ? 'fadeIn' : 'fadeOut') : ( $(this).is(':visible') ? 'fadeOut' : 'fadeIn' ) ](speed, callback); | |
}); | |
} |
This file contains 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 ($) { | |
$.fn.liveDraggable = function (opts) { | |
this.live("mouseover", function() { | |
if (!$(this).data("init")) { | |
$(this).data("init", true).draggable(opts); | |
} | |
}); | |
return $(); | |
}; | |
}(jQuery)); |
This file contains 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($) { | |
$.fn.fullscreen = function(options) { | |
var settings = $.extend({ | |
to: false, | |
exit: 'Normal size', | |
onScreenChange: $.noop, | |
onFail: $.noop | |
},options); | |
This file contains 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($) { | |
$.fn.preload = function(forPreload, options) { | |
var settings = $.extend({ | |
debug : false, | |
percentage : { | |
textCnt : '', | |
lineCnt : '' | |
}, |
This file contains 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
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* @author paulirish / http://paulirish.com/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
This file contains 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
/* piecon */ | |
(function(){var i={},j=null,k=null,f=null,g=null,h={},l={color:"#ff0084",background:"#bbb",shadow:"#fff",fallback:!1},c,o=navigator.userAgent.toLowerCase();c=function(e){return-1!==o.indexOf(e)};var p=c("msie");c("chrome");c("chrome")||c("safari");var q=c("safari")&&!c("chrome");c("mozilla")&&!c("chrome")&&c("safari");var m=function(e){for(var a=document.getElementsByTagName("link"),c=document.getElementsByTagName("head")[0],f=0,h=a.length;f<h;f++)("icon"===a[f].getAttribute("rel")||"shortcut icon"=== | |
a[f].getAttribute("rel"))&&c.removeChild(a[f]);a=document.createElement("link");a.type="image/x-icon";a.rel="icon";a.href=e;document.getElementsByTagName("head")[0].appendChild(a)},n=function(){g||(g=document.createElement("canvas"),g.width=16,g.height=16);return g};i.setOptions=function(e){h={};for(var a in l)h[a]=e.hasOwnProperty(a)?e[a]:l[a];return this};i.setProgress=function(e){f||(f=document.title);if(!k||!j){var a;a:{a=document.getElementsByTagName("link");for(var c=0,i=a.length;c<i;c++)if("i |
OlderNewer