Upgrade to Rails 3.2 and move some of the assets to the asset pipeline directories
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 6.5 KiB |
@ -1,2 +0,0 @@
|
||||
// Place your application-specific JavaScript functions and classes here
|
||||
// This file is automatically included by javascript_include_tag :defaults
|
@ -1,175 +0,0 @@
|
||||
(function() {
|
||||
// Technique from Juriy Zaytsev
|
||||
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
||||
function isEventSupported(eventName) {
|
||||
var el = document.createElement('div');
|
||||
eventName = 'on' + eventName;
|
||||
var isSupported = (eventName in el);
|
||||
if (!isSupported) {
|
||||
el.setAttribute(eventName, 'return;');
|
||||
isSupported = typeof el[eventName] == 'function';
|
||||
}
|
||||
el = null;
|
||||
return isSupported;
|
||||
}
|
||||
|
||||
function isForm(element) {
|
||||
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
||||
}
|
||||
|
||||
function isInput(element) {
|
||||
if (Object.isElement(element)) {
|
||||
var name = element.nodeName.toUpperCase()
|
||||
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
||||
}
|
||||
else return false
|
||||
}
|
||||
|
||||
var submitBubbles = isEventSupported('submit'),
|
||||
changeBubbles = isEventSupported('change')
|
||||
|
||||
if (!submitBubbles || !changeBubbles) {
|
||||
// augment the Event.Handler class to observe custom events when needed
|
||||
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
||||
function(init, element, eventName, selector, callback) {
|
||||
init(element, eventName, selector, callback)
|
||||
// is the handler being attached to an element that doesn't support this event?
|
||||
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
||||
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
||||
// "submit" => "emulated:submit"
|
||||
this.eventName = 'emulated:' + this.eventName
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (!submitBubbles) {
|
||||
// discover forms on the page by observing focus events which always bubble
|
||||
document.on('focusin', 'form', function(focusEvent, form) {
|
||||
// special handler for the real "submit" event (one-time operation)
|
||||
if (!form.retrieve('emulated:submit')) {
|
||||
form.on('submit', function(submitEvent) {
|
||||
var emulated = form.fire('emulated:submit', submitEvent, true)
|
||||
// if custom event received preventDefault, cancel the real one too
|
||||
if (emulated.returnValue === false) submitEvent.preventDefault()
|
||||
})
|
||||
form.store('emulated:submit', true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!changeBubbles) {
|
||||
// discover form inputs on the page
|
||||
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
||||
// special handler for real "change" events
|
||||
if (!input.retrieve('emulated:change')) {
|
||||
input.on('change', function(changeEvent) {
|
||||
input.fire('emulated:change', changeEvent, true)
|
||||
})
|
||||
input.store('emulated:change', true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleRemote(element) {
|
||||
var method, url, params;
|
||||
|
||||
var event = element.fire("ajax:before");
|
||||
if (event.stopped) return false;
|
||||
|
||||
if (element.tagName.toLowerCase() === 'form') {
|
||||
method = element.readAttribute('method') || 'post';
|
||||
url = element.readAttribute('action');
|
||||
params = element.serialize();
|
||||
} else {
|
||||
method = element.readAttribute('data-method') || 'get';
|
||||
url = element.readAttribute('href');
|
||||
params = {};
|
||||
}
|
||||
|
||||
new Ajax.Request(url, {
|
||||
method: method,
|
||||
parameters: params,
|
||||
evalScripts: true,
|
||||
|
||||
onComplete: function(request) { element.fire("ajax:complete", request); },
|
||||
onSuccess: function(request) { element.fire("ajax:success", request); },
|
||||
onFailure: function(request) { element.fire("ajax:failure", request); }
|
||||
});
|
||||
|
||||
element.fire("ajax:after");
|
||||
}
|
||||
|
||||
function handleMethod(element) {
|
||||
var method = element.readAttribute('data-method'),
|
||||
url = element.readAttribute('href'),
|
||||
csrf_param = $$('meta[name=csrf-param]')[0],
|
||||
csrf_token = $$('meta[name=csrf-token]')[0];
|
||||
|
||||
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
||||
element.parentNode.insert(form);
|
||||
|
||||
if (method !== 'post') {
|
||||
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
||||
form.insert(field);
|
||||
}
|
||||
|
||||
if (csrf_param) {
|
||||
var param = csrf_param.readAttribute('content'),
|
||||
token = csrf_token.readAttribute('content'),
|
||||
field = new Element('input', { type: 'hidden', name: param, value: token });
|
||||
form.insert(field);
|
||||
}
|
||||
|
||||
form.submit();
|
||||
}
|
||||
|
||||
|
||||
document.on("click", "*[data-confirm]", function(event, element) {
|
||||
var message = element.readAttribute('data-confirm');
|
||||
if (!confirm(message)) event.stop();
|
||||
});
|
||||
|
||||
document.on("click", "a[data-remote]", function(event, element) {
|
||||
if (event.stopped) return;
|
||||
handleRemote(element);
|
||||
event.stop();
|
||||
});
|
||||
|
||||
document.on("click", "a[data-method]", function(event, element) {
|
||||
if (event.stopped) return;
|
||||
handleMethod(element);
|
||||
event.stop();
|
||||
});
|
||||
|
||||
document.on("submit", function(event) {
|
||||
var element = event.findElement(),
|
||||
message = element.readAttribute('data-confirm');
|
||||
if (message && !confirm(message)) {
|
||||
event.stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
var inputs = element.select("input[type=submit][data-disable-with]");
|
||||
inputs.each(function(input) {
|
||||
input.disabled = true;
|
||||
input.writeAttribute('data-original-value', input.value);
|
||||
input.value = input.readAttribute('data-disable-with');
|
||||
});
|
||||
|
||||
var element = event.findElement("form[data-remote]");
|
||||
if (element) {
|
||||
handleRemote(element);
|
||||
event.stop();
|
||||
}
|
||||
});
|
||||
|
||||
document.on("ajax:after", "form", function(event, element) {
|
||||
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
||||
inputs.each(function(input) {
|
||||
input.value = input.readAttribute('data-original-value');
|
||||
input.removeAttribute('data-original-value');
|
||||
input.disabled = false;
|
||||
});
|
||||
});
|
||||
})();
|
@ -1,85 +0,0 @@
|
||||
html, body { height: 100%; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif; color: #333333; }
|
||||
img { border: 0; }
|
||||
h2 { margin-top: 5px; }
|
||||
h3 { margin-top: 0; }
|
||||
a { color: #2565a5; text-decoration: none; }
|
||||
a:hover, a:hover div,
|
||||
a:hover .info { color: #0066ff; text-decoration: underline; }
|
||||
ul { margin: 0; padding: 0 0 0 20px; }
|
||||
ul li { margin-left: 15px; }
|
||||
table { border-collapse: collapse; }
|
||||
#logo { margin: 6px 0 0 20px; font-size: 45px; font-weight: bold; font-family: Tahoma, Geneva, Kalimati, sans-serif; }
|
||||
#logo a { color: #d62020; }
|
||||
#logo a span, .paygray { color: #666666; }
|
||||
#logo a:hover { text-decoration: none; }
|
||||
#logo.small { font-size: 30px; color: #666666; }
|
||||
#options { float: right; text-align: right; }
|
||||
#options span { padding-right: 10px; }
|
||||
#login { padding: 6px; border: 1px solid #bbbbbb; border-collapse: separate; border-spacing: 3px; background-color: #eeeeee; background: -webkit-gradient(linear, left top, right top, from(#dddddd), to(#f5f5f5)); background: -moz-linear-gradient(left, #dddddd, #f5f5f5); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dddddd', endColorstr='#f5f5f5', GradientType=1)); }
|
||||
#menu { height: 40px; margin: 0 auto; border: 1px solid #dddddd; background-color: #d6d6d6; background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#bbbbbb)); background: -moz-linear-gradient(top, #eeeeee, #bbbbbb); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#bbbbbb')); }
|
||||
#menu div { float: left; }
|
||||
#menu div a { color: #777777; padding: 10px 30px; display: block; font-weight: bold; }
|
||||
#menu div:hover { background-color: #cccccc; }
|
||||
#menu div:hover a { color: #000000; text-decoration: none; }
|
||||
#menu .selected,
|
||||
#menu .selected:hover { background-color: #e5e5e5; }
|
||||
#menu .selected a { color: #000000; }
|
||||
.userlogin { display:none; }
|
||||
.login_info { font-weight: bold; text-align: right; font-size: 12px; }
|
||||
.round { -moz-border-radius: 7px; -webkit-border-radius: 7px; }
|
||||
.text_center { text-align: center; }
|
||||
.big { font-size: 18px; }
|
||||
.large { font-size: 20px; }
|
||||
.xlarge { font-size: 30px; }
|
||||
.small { font-size: 12px; }
|
||||
.action { margin-right: 30px; position: relative; top: 25px; font-weight: bold; }
|
||||
.nicetable { font-size: 14px; border: 1px solid #bbbbbb; }
|
||||
.nicetable .header { font-weight: bold; background-color: #e5e5e5; }
|
||||
.nicetable .header td { padding-top: 3px; }
|
||||
.nicetable td { padding: 2px 10px; border-bottom: 1px solid #bbbbbb; }
|
||||
.nicetable .stripe { background-color: #f9f9f9; }
|
||||
.table_no_header { font-size: 14px; border: 1px solid #bbbbbb; }
|
||||
.table_no_header td { padding: 2px 10px; border-bottom: 1px solid #bbbbbb; }
|
||||
.table_no_header .left { font-weight: bold; }
|
||||
.pagination { font-size: 14px; }
|
||||
.centerme { display: table; margin: 0 auto; }
|
||||
.fixedwidth { width: 990px; display: table; margin: 0 auto; }
|
||||
|
||||
/* error messages */
|
||||
.errorExplanation { background-color: #ffffe0; display: table; margin-bottom: 20px; padding: 10px; border: 1px solid #aaaaaa; }
|
||||
.field_with_errors { display: inline; }
|
||||
|
||||
/* main layout */
|
||||
#wrapper { min-height: 100%; position: relative; }
|
||||
#header { height: 75px; }
|
||||
#menuwrap { padding: 0 20px; }
|
||||
#content { padding: 23px 20px 58px 23px; }
|
||||
|
||||
/* shortcuts */
|
||||
.FL { float: left; }
|
||||
.FR { float: right; }
|
||||
.FN { float: none; }
|
||||
.DT { display: table; }
|
||||
.CL { clear: left; }
|
||||
.UL { text-decoration: underline; }
|
||||
.TAR { text-align: right; }
|
||||
.TAC { text-align: center; }
|
||||
.VAT { vertical-align: top; }
|
||||
.PB10 { padding-bottom: 10px; }
|
||||
.PR20 { padding-right: 20px; }
|
||||
.PL20 { padding-left: 20px; }
|
||||
.PL30 { padding-left: 30px; }
|
||||
.MR20 { margin-right: 20px; }
|
||||
.MR60 { margin-right: 60px; }
|
||||
.ML20 { margin-left: 20px; }
|
||||
.W100 { width: 100%; }
|
||||
.left20 { position: relative; left: -20px; }
|
||||
.up2 { position: relative; top: -2px; }
|
||||
.up20 { position: relative; top: -20px; }
|
||||
|
||||
/* form styling */
|
||||
input[type='text'],
|
||||
input[type='password'] { border: 1px inset #999999; width: 165px; }
|
||||
input[type='text']:focus,
|
||||
input[type='password']:focus { background-color: #ffffdd; }
|
||||
input[type='submit'] { font-size: 14px; padding: 3px 6px; color: #333333; }
|
Reference in New Issue
Block a user