Skip to content

Instantly share code, notes, and snippets.

View andidev's full-sized avatar

Anders Steiner andidev

  • PideDirecto
  • Sweden, Stockholm
View GitHub Profile
@andidev
andidev / jquery.collapse.js
Created September 17, 2011 08:02
jquery plugin to add collapser do tags
jQuery.fn.collapse = function(options) {
// This plugin requires jquery.cookie.js plugin
// Load plugin for handling cookies
// $.getScript('jquery/plugins/jquery.cookie.js');
// Default values
var defaults = {
collapsed: true,
ignore: [],
rememberState: true
@andidev
andidev / jquery.cookie.js
Created September 17, 2011 15:15
jquery plugin to handle cookies
@andidev
andidev / jquery.outerhtml.js
Created September 21, 2011 19:10
jquery plugin to print outer html-tags
/* jquery extentions (help methods) */
jQuery.fn.extend({ /* jquery object to html-string */
outerHtml: function(replacement) {
// We just want to replace the entire node and contents with
// some new html value
if (replacement) {
return this.each(function() {
$(this).replaceWith(replacement);
});
}
@andidev
andidev / jquery.isempty.js
Created September 23, 2011 14:30
jquery plugin to check if jquery selection is empty
jQuery.fn.extend({
/* jquery object to html-string */
isEmpty: function() {
// Return true if jquery object is empty
return (object.length > 0 ? true : false);
}
});
@andidev
andidev / jquery.disable-select-option-IE6-IE7-support.js
Created September 23, 2011 15:43
jquery browser fix for supporting disabled options in selects for IE6 and IE7
// TODO: Remove fix for selects-tags with multiple="multiple" attribute as ölong as it is not supported
// TODO: Support selects-tags with multiple="multiple" attribute
// TODO: Support disabling up and down key browsing on disabled options
// TODO: Check if selecting an an disabled option with up and down key + enter key submits form with disabled value
$(document).ready(function() {
if ($.browser.msie && parseFloat($.browser.version) < 8) {
// Add disabled color to disabled options
$("select").find("option[disabled]").css("color", "graytext");
@andidev
andidev / page-layout.css
Created September 24, 2011 12:54
css for page layout
/* html style
----------------------------------*/
html {
background-color: white;
/* font style (this will be inherited) */
font-size: small;
font-family: arial,sans-serif;
}
@andidev
andidev / group-layout.css
Created September 24, 2011 13:35
css for group layout
/* group style
----------------------------------*/
div.group {
display: block;
float: left;
}
div.group > h3.group-header {
margin: 8px;
margin-bottom: -8px;
border: 1px;
@andidev
andidev / input-layout.css
Created September 24, 2011 13:47
css for input layout
/* general object styles
----------------------------------*/
/* object style */
div.input {
/* margin, border, padding
is ignored since display table */
display: table-row;
}
@andidev
andidev / input-style.css
Created September 24, 2011 13:57
css for input style
/* object labels
----------------------------------*/
div.input .values label {
margin: 0px;
border: 2px solid transparent; /* for consistency use same border as input (but transparent) */
padding: 2px 2px;
width: 150px;
display: block;
float: left;
@andidev
andidev / UtilityClassTemplate.java
Last active December 19, 2015 21:09
Template for Java utility class gists
package org.andidev.utils;
/*
* UtilityClassTemplate
*
* Copyright AndiDev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at