Skip to content

Instantly share code, notes, and snippets.

#mainmenu {
/* Declarations for proper Browsers */
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0, .15);
/* Common declarations */
background: #fff;
border: 1px solid #d1d1d1;
var foo = (function() {
// Any reference to "this" anonymous function in here?
})();
@Luke-23ae
Luke-23ae / Tabkey.js
Created May 24, 2011 14:37
Prototype Class allowing to insert tab-characters in form-elements
/**
* Usage: new Tabkey('id_of_form_element');
*/
var Tabkey = Class.create({
initialize: function(element) {
this.observeInput(element);
},
observeInput: function(element) {
Object.extend = Object.extend.wrap(function() {
var args = $A(arguments),
origExtend = args.shift(),
removeProperty;
/*
if(Object.isArray(args[2])) {
for (removeProperty in args[2])
delete args[2][removeProperty];
}
var Section = Class.create({
attach: function(element) {
Object.extend(element, this.extension);
}
extension: {
// Methods and properties here
}
}
Layout = {
settingsToSave: {},
saveSettings: function(data) {
Layout.settingsToSave[data[0]] = data[1].value;
},
submitSettings: function() {
new Ajax.Request('view_ax.php?submit__layout__update_settings', {
method: 'post',
%a{:name => "post_#{post.id}"}
-div_for post do
-unless post.user_id == 6 && current_user.id == 16
.name= user_name(post.user)
.date
=post.created_at.strftime('%Y/%m/%d %H:%M:%S')
/ =time_ago_in_words(post.created_at)
/ ago
.body
=format_body(post)
var properties = $w('borderBottomColor borderBottomStyle borderBottomWidth borderTopColor borderTopStyle borderTopWidth borderRightColor borderRightStyle borderRightWidth borderLeftColor borderLeftStyle borderLeftWidth fontSize fontFamily fontWeight letterSpacing lineHeight margin marginTop marginRight marginBottom marginLeft paddingTop paddingRight paddingBottom paddingLeft textAlign textIndent width wordSpacing');
for (var i = 0, length = properties.length; i < length; i++) {
toStyles[properties[i]] = from.getStyle(properties[i]);
}
this.setContentStyle(toStyles);
style_json = {};
style_json[css_property] = color.readAttribute("color");
$$(for_element).each(function(el) {
el.setStyle(style_json);
});
document.observe("dom:loaded", function() {
var customsPage = Class.create({
initialize: function(page, draggable_obj) {
if(draggable_obj)
this.draggableObject = new Draggable(draggable_obj);
Object.extend(page, this);