View image-with-caption.js
$(".img-left, .img-right, .article-detail img", this).each(function()
{
var image = $(this);
var imageCaption = image.attr("alt");
if (imageCaption != '')
{
image.wrap('<div class="image-w-caption">');
image.parent('.image-w-caption')
.css('max-width', image.width())
.addClass(image.attr('class'))
View bootstrap-mixins.scss
@mixin respond($minWidth: 0, $maxWidth: 0) {
@if $minWidth and $maxWidth
{
@media screen and (min-width: $minWidth) and (max-width: $maxWidth) { @content; }
}
@else if $minWidth
{
@media screen and (min-width: $minWidth) { @content; }
}
@else if $maxWidth
View update-join.sql
UPDATE table A
JOIN table B ON {join fields}
JOIN table C ON {join fields}
JOIN {as many tables as you need}
SET A.column = {expression}
Example:
UPDATE person P
JOIN address A ON P.home_address_id = A.id
JOIN city C ON A.city_id = C.id
View keyup-delay.js
$('#mySearch').keyup(function() {
clearTimeout($.data(this, 'timer'));
var wait = setTimeout(search, 500);
$(this).data('timer', wait);
});
View component.php
<?
public function createComponentRatingForm()
{
$form = new Nette\Application\UI\Form;
$form->setTranslator($this->translator);
$messages = array(
View example
http://kod.djpw.cz/wwhc
View autosave.js
var AutoSave = (function(){
var timer = null;
function getEditor(){
var elems = document.getElementsByTagName("textarea")
if (elems.length <= 0)
return null;
View autosave.js
$(document).ready(function() {
///////////////////////
//
// Recovery Below
//
///////////////////////
// Retrieve the object from storage onReady
var autosave = localStorage.getItem('file');
View mathutils.jquery.js
(function($) {
$.mathUtils = {
sum: function(array) {
var total = 0;
$.each(array, function(index, value) {
total += $.mathUtils.parseCzechFloat(value);
});
return total;
},
View on-responsive-no-hover.js
if ('createTouch' in document)
{
try
{
var ignore = /:hover/;
for (var i=0; i<document.styleSheets.length; i++)
{
var sheet = document.styleSheets[i];
for (var j=sheet.cssRules.length-1; j>=0; j--)