Inital commit
@@ -0,0 +1,691 @@
|
||||
/* $Id: drupal.css,v 1.147.2.8 2006/12/14 20:20:21 killes Exp $ */
|
||||
|
||||
/*
|
||||
** HTML elements
|
||||
*/
|
||||
fieldset {
|
||||
margin-bottom: 1em;
|
||||
padding: .5em;
|
||||
}
|
||||
form {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
hr {
|
||||
height: 1px;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th {
|
||||
text-align: left;
|
||||
padding-right: 1em;
|
||||
border-bottom: 3px solid #ccc;
|
||||
}
|
||||
th.active img {
|
||||
display: inline;
|
||||
}
|
||||
tr.even, tr.odd {
|
||||
background-color: #eee;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
tr.even, tr.odd {
|
||||
padding: 0.1em 0.6em;
|
||||
}
|
||||
td.active {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
/*
|
||||
** Menu styles
|
||||
*/
|
||||
ul.menu {
|
||||
list-style: none;
|
||||
border: none;
|
||||
text-align:left;
|
||||
}
|
||||
ul.menu li {
|
||||
margin: 0 0 0 0.5em;
|
||||
}
|
||||
li.expanded {
|
||||
list-style-type: circle;
|
||||
list-style-image: url(menu-expanded.png);
|
||||
padding: 0.2em 0.5em 0 0;
|
||||
margin: 0;
|
||||
}
|
||||
li.collapsed {
|
||||
list-style-type: disc;
|
||||
list-style-image: url(menu-collapsed.png);
|
||||
padding: 0.2em 0.5em 0 0;
|
||||
margin: 0;
|
||||
}
|
||||
li.leaf {
|
||||
list-style-type: square;
|
||||
list-style-image: url(menu-leaf.png);
|
||||
padding: 0.2em 0.5em 0 0;
|
||||
margin: 0;
|
||||
}
|
||||
li a.active {
|
||||
color: #000;
|
||||
}
|
||||
td.menu-disabled {
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Other common styles
|
||||
*/
|
||||
.breadcrumb {
|
||||
padding-bottom: .5em
|
||||
}
|
||||
.block-region {
|
||||
background-color: #ffff66;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
padding: 3px;
|
||||
}
|
||||
.block ul {
|
||||
margin: 0;
|
||||
padding: 0 0 0.25em 1em;
|
||||
}
|
||||
br.clear {
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
.container-inline div {
|
||||
display: inline;
|
||||
}
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
.item-list .icon {
|
||||
color: #555;
|
||||
float: right;
|
||||
padding-left: 0.25em;
|
||||
clear: right;
|
||||
}
|
||||
.item-list .icon a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
.item-list .icon a:hover {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
.item-list .title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.item-list ul {
|
||||
margin: 0 0 0.75em 0;
|
||||
padding: 0;
|
||||
}
|
||||
.item-list ul li {
|
||||
margin: 0 0 0.25em 1.5em;
|
||||
padding: 0;
|
||||
list-style: disc;
|
||||
}
|
||||
.form-item {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
tr.odd .form-item, tr.even .form-item {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.form-item input.error, .form-item textarea.error, .form-item select.error {
|
||||
border: 2px solid red;
|
||||
}
|
||||
.form-item .description {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.form-item label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
.form-item label.option {
|
||||
display: inline;
|
||||
font-weight: normal;
|
||||
}
|
||||
.marker, .form-required {
|
||||
color: #f00;
|
||||
}
|
||||
.more-link {
|
||||
text-align: right;
|
||||
}
|
||||
.node-form .form-text {
|
||||
display: block;
|
||||
width: 95%;
|
||||
}
|
||||
.node-form .standard {
|
||||
clear: both;
|
||||
}
|
||||
.node-form textarea {
|
||||
display: block;
|
||||
width: 95%;
|
||||
}
|
||||
.node-form .attachments fieldset {
|
||||
float: none;
|
||||
display: block;
|
||||
}
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ok {
|
||||
color: #080;
|
||||
}
|
||||
#pager {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
#pager a, #pager strong.pager-current {
|
||||
padding: 0.5em;
|
||||
}
|
||||
.path {
|
||||
padding-bottom: 0.7em;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
/*
|
||||
** Module specific styles
|
||||
*/
|
||||
#aggregator .feed-source .feed-title {
|
||||
margin-top: 0;
|
||||
}
|
||||
#aggregator .feed-source .feed-image img {
|
||||
margin-bottom: 0.75em;
|
||||
}
|
||||
#aggregator .feed-source .feed-icon {
|
||||
float: right;
|
||||
display: block;
|
||||
}
|
||||
#aggregator .feed-item {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
#aggregator .feed-item-title {
|
||||
margin-bottom: 0;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
#aggregator .feed-item-meta, #aggregator .feed-item-body {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
#aggregator .feed-item-categories {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
#aggregator td {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
#aggregator td.categorize-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
#aggregator .categorize-item .news-item .body {
|
||||
margin-top: 0;
|
||||
}
|
||||
#aggregator .categorize-item h3 {
|
||||
margin-bottom: 1em;
|
||||
margin-top: 0;
|
||||
}
|
||||
.book-navigation .menu {
|
||||
border-top: 1px solid #888;
|
||||
padding: 1em 0 0 3em;
|
||||
}
|
||||
.book-navigation .page-links {
|
||||
border-top: 1px solid #888;
|
||||
border-bottom: 1px solid #888;
|
||||
text-align: center;
|
||||
padding: 0.5em;
|
||||
width:98%;
|
||||
}
|
||||
.book-navigation .page-previous {
|
||||
text-align: right;
|
||||
width: 42%;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.book-navigation .page-up {
|
||||
margin: 0 5%;
|
||||
width: 4%;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.book-navigation .page-next {
|
||||
text-align: left;
|
||||
width: 42%;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.node-unpublished, .comment-unpublished {
|
||||
background-color: #fff4f4;
|
||||
}
|
||||
.preview .node, .preview .comment {
|
||||
background-color: #ffffea;
|
||||
}
|
||||
.archive {
|
||||
margin: 1em 0 1em 0;
|
||||
}
|
||||
.calendar .row-week td a {
|
||||
display: block;
|
||||
}
|
||||
.calendar .row-week td a:hover {
|
||||
background-color: #888; color: #fff;
|
||||
}
|
||||
.calendar a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.calendar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.calendar table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
.calendar td, .calendar th {
|
||||
text-align: center;
|
||||
border: 1px solid #000;
|
||||
padding: 1px;
|
||||
margin: 0;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.calendar td.day-blank {
|
||||
border: 0;
|
||||
}
|
||||
.tips {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
#forum .description {
|
||||
font-size: 0.9em;
|
||||
margin: 0.5em;
|
||||
}
|
||||
#forum td.created, #forum td.posts, #forum td.topics, #forum td.last-reply, #forum td.replies, #forum td.pager {
|
||||
white-space: nowrap;
|
||||
}
|
||||
#forum td.posts, #forum td.topics, #forum td.replies, #forum td.pager {
|
||||
text-align: center;
|
||||
}
|
||||
.forum-topic-navigation {
|
||||
padding: 1em 0 0 3em;
|
||||
border-top: 1px solid #888;
|
||||
border-bottom: 1px solid #888;
|
||||
text-align: center;
|
||||
padding: 0.5em;
|
||||
width: 98%;
|
||||
}
|
||||
.forum-topic-navigation .topic-previous {
|
||||
text-align: right;
|
||||
float: left;
|
||||
width: 46%;
|
||||
}
|
||||
.forum-topic-navigation .topic-next {
|
||||
text-align: left;
|
||||
float: right;
|
||||
width: 46%;
|
||||
}
|
||||
.locale-untranslated {
|
||||
font-style: normal;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
#node-admin-filter ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
#node-admin-buttons {
|
||||
float: left;
|
||||
margin-left: 0.5em;
|
||||
clear: right;
|
||||
}
|
||||
td.revision-current {
|
||||
background: #ffc;
|
||||
}
|
||||
dl.multiselect dd.b, dl.multiselect dd.b .form-item, dl.multiselect dd.b select {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
width: 14em;
|
||||
}
|
||||
dl.multiselect dd.a, dl.multiselect dd.a .form-item {
|
||||
width: 8em;
|
||||
}
|
||||
dl.multiselect dt, dl.multiselect dd {
|
||||
float: left;
|
||||
line-height: 1.75em;
|
||||
padding: 0;
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
dl.multiselect .form-item {
|
||||
height: 1.75em;
|
||||
margin: 0;
|
||||
}
|
||||
#permissions td.module, #blocks td.region {
|
||||
font-weight: bold;
|
||||
}
|
||||
#permissions td.permission, #blocks td.block, #taxonomy td.term, #taxonomy td.message {
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
#access-rules .access-type, #access-rules .rule-type {
|
||||
margin-right: 1em;
|
||||
float: left;
|
||||
}
|
||||
#access-rules .access-type .form-item, #access-rules .rule-type .form-item {
|
||||
margin-top: 0;
|
||||
}
|
||||
#access-rules .mask {
|
||||
clear: both;
|
||||
}
|
||||
.poll .bar {
|
||||
height: 1em;
|
||||
margin: 1px 0;
|
||||
background-color: #ddd;
|
||||
}
|
||||
.poll .bar .foreground {
|
||||
background-color: #000;
|
||||
height: 1em;
|
||||
clear: left;
|
||||
float: left;
|
||||
}
|
||||
.poll .links {
|
||||
text-align: center;
|
||||
}
|
||||
.poll .percent {
|
||||
text-align: right;
|
||||
}
|
||||
.poll .total {
|
||||
text-align: center;
|
||||
}
|
||||
.poll .vote-form {
|
||||
text-align: center;
|
||||
}
|
||||
.poll .vote-form .choices {
|
||||
text-align: left;
|
||||
margin: 0 auto;
|
||||
display: table;
|
||||
}
|
||||
.profile {
|
||||
clear: both;
|
||||
margin: 1em 0 1em 0;
|
||||
}
|
||||
.profile .picture {
|
||||
float: right;
|
||||
margin: 0 1em 1em 0;
|
||||
}
|
||||
.profile dt {
|
||||
margin: 1em 0 0.2em 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
.profile dd {
|
||||
margin:0;
|
||||
}
|
||||
.node-form .poll-form fieldset {
|
||||
display: block;
|
||||
}
|
||||
img.screenshot {
|
||||
border: 1px solid #808080;
|
||||
display: block;
|
||||
margin: 2px;
|
||||
}
|
||||
.search-form {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.search-form p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.2em;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.search-form input {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.search-results p {
|
||||
margin-top: 0;
|
||||
}
|
||||
.search-results dt {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.search-results dd {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.search-results .search-info {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.search-advanced .criterion {
|
||||
float: left;
|
||||
margin-right: 2em;
|
||||
}
|
||||
.search-advanced .action {
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
#tracker td.replies {
|
||||
text-align: center;
|
||||
}
|
||||
#tracker table {
|
||||
width: 100%;
|
||||
}
|
||||
.theme-settings-left {
|
||||
float: left;
|
||||
width: 49%;
|
||||
}
|
||||
.theme-settings-right {
|
||||
float: right;
|
||||
width: 49%;
|
||||
}
|
||||
.theme-settings-bottom {
|
||||
clear: both;
|
||||
}
|
||||
#user-login-form {
|
||||
text-align: center;
|
||||
}
|
||||
.more-help-link {
|
||||
font-size: 0.85em;
|
||||
text-align: right;
|
||||
}
|
||||
table.watchdog-event th {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
tr.watchdog-user {
|
||||
background: #ffd;
|
||||
}
|
||||
tr.watchdog-user .active {
|
||||
background: #eed;
|
||||
}
|
||||
tr.watchdog-content {
|
||||
background: #ddf;
|
||||
}
|
||||
tr.watchdog-content .active {
|
||||
background: #cce;
|
||||
}
|
||||
tr.watchdog-page-not-found, tr.watchdog-access-denied {
|
||||
background: #dfd;
|
||||
}
|
||||
tr.watchdog-page-not-found .active, tr.watchdog-access-denied .active {
|
||||
background: #cec;
|
||||
}
|
||||
tr.watchdog-error {
|
||||
background: #ffc9c9;
|
||||
}
|
||||
tr.watchdog-error .active {
|
||||
background: #eeb9b9;
|
||||
}
|
||||
|
||||
/* Tab navigation */
|
||||
ul.primary {
|
||||
border-collapse: collapse;
|
||||
padding: 0 0 0 1em;
|
||||
white-space: nowrap;
|
||||
list-style: none;
|
||||
margin: 5px;
|
||||
height: auto;
|
||||
line-height: normal;
|
||||
border-bottom: 1px solid #bbb;
|
||||
}
|
||||
ul.primary li {
|
||||
display: inline;
|
||||
}
|
||||
ul.primary li a {
|
||||
background-color: #ddd;
|
||||
border-color: #bbb;
|
||||
border-width: 1px;
|
||||
border-style: solid solid none solid;
|
||||
height: auto;
|
||||
margin-right: 0.5em;
|
||||
padding: 0 1em;
|
||||
text-decoration: none;
|
||||
}
|
||||
ul.primary li.active a {
|
||||
background-color: #fff;
|
||||
border: 1px solid #bbb;
|
||||
border-bottom: #fff 1px solid;
|
||||
}
|
||||
ul.primary li a:hover {
|
||||
background-color: #eee;
|
||||
border-color: #ccc;
|
||||
border-bottom-color: #eee;
|
||||
}
|
||||
ul.secondary {
|
||||
border-bottom: 1px solid #bbb;
|
||||
padding: 0.5em 1em 0.5em 1em;
|
||||
margin: 5px;
|
||||
}
|
||||
ul.secondary li {
|
||||
display: inline;
|
||||
padding: 0 1em;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
ul.secondary a {
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
ul.secondary a.active {
|
||||
border-bottom: 4px solid #999;
|
||||
}
|
||||
|
||||
/*
|
||||
** Help module
|
||||
*/
|
||||
.help-items {
|
||||
float: left;
|
||||
width: 22%;
|
||||
padding-right: 3%;
|
||||
}
|
||||
.help-items-last {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Autocomplete styles
|
||||
*/
|
||||
/* Suggestion list */
|
||||
#autocomplete {
|
||||
position: absolute;
|
||||
border: 1px solid;
|
||||
overflow: hidden;
|
||||
z-index: 100;
|
||||
}
|
||||
#autocomplete ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
#autocomplete li {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
white-space: pre;
|
||||
cursor: default;
|
||||
}
|
||||
#autocomplete li.selected {
|
||||
background: #0072b9;
|
||||
color: #fff;
|
||||
}
|
||||
/* Animated throbber */
|
||||
html.js input.form-autocomplete {
|
||||
background-image: url(throbber.gif);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 100% 2px;
|
||||
}
|
||||
html.js input.throbbing {
|
||||
background-position: 100% -18px;
|
||||
}
|
||||
|
||||
/*
|
||||
** Progressbar styles
|
||||
*/
|
||||
.progress {
|
||||
font-weight: bold;
|
||||
}
|
||||
.progress .bar {
|
||||
background: #fff url(progress.gif);
|
||||
border: 1px solid #00375a;
|
||||
height: 1.5em;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
.progress .filled {
|
||||
background: #0072b9;
|
||||
height: 1em;
|
||||
border-bottom: 0.5em solid #004a73;
|
||||
width: 0%;
|
||||
}
|
||||
.progress .percentage {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
** Collapsing fieldsets
|
||||
*/
|
||||
html.js fieldset.collapsed {
|
||||
border-bottom-width: 0;
|
||||
border-left-width: 0;
|
||||
border-right-width: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
html.js fieldset.collapsed * {
|
||||
display: none;
|
||||
}
|
||||
html.js fieldset.collapsed table *,
|
||||
html.js fieldset.collapsed legend,
|
||||
html.js fieldset.collapsed legend * {
|
||||
display: inline;
|
||||
}
|
||||
html.js fieldset.collapsible legend a {
|
||||
padding-left: 15px;
|
||||
background: url(menu-expanded.png) 5px 50% no-repeat;
|
||||
}
|
||||
html.js fieldset.collapsed legend a {
|
||||
background-image: url(menu-collapsed.png);
|
||||
}
|
||||
/* Note: IE-only fix due to '* html' (breaks Konqueror otherwise). */
|
||||
* html.js fieldset.collapsible legend a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
** Resizable text areas
|
||||
*/
|
||||
.resizable-textarea {
|
||||
width: 95%;
|
||||
}
|
||||
.resizable-textarea .grippie {
|
||||
height: 14px;
|
||||
background: #eee url(grippie.png) no-repeat 100% 100%;
|
||||
border: 1px solid #ddd;
|
||||
border-top-width: 0;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
||||
/*
|
||||
** Formatting for welcome page
|
||||
*/
|
||||
#first-time strong {
|
||||
display: block;
|
||||
padding: 1.5em 0 .5em;
|
||||
}
|
||||
@@ -0,0 +1,364 @@
|
||||
// $Id: drupal.js,v 1.22.2.4 2006/12/01 14:57:29 killes Exp $
|
||||
|
||||
/**
|
||||
* Only enable Javascript functionality if all required features are supported.
|
||||
*/
|
||||
function isJsEnabled() {
|
||||
if (typeof document.jsEnabled == 'undefined') {
|
||||
// Note: ! casts to boolean implicitly.
|
||||
document.jsEnabled = !(
|
||||
!document.getElementsByTagName ||
|
||||
!document.createElement ||
|
||||
!document.createTextNode ||
|
||||
!document.documentElement ||
|
||||
!document.getElementById);
|
||||
}
|
||||
return document.jsEnabled;
|
||||
}
|
||||
|
||||
// Global Killswitch on the <html> element
|
||||
if (isJsEnabled()) {
|
||||
document.documentElement.className = 'js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Make IE's XMLHTTP object accessible through XMLHttpRequest()
|
||||
*/
|
||||
if (typeof XMLHttpRequest == 'undefined') {
|
||||
XMLHttpRequest = function () {
|
||||
var msxmls = ['MSXML3', 'MSXML2', 'Microsoft']
|
||||
for (var i=0; i < msxmls.length; i++) {
|
||||
try {
|
||||
return new ActiveXObject(msxmls[i]+'.XMLHTTP')
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
throw new Error("No XML component installed!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an HTTP GET request and sends the response to the callback function.
|
||||
*
|
||||
* Note that dynamic arguments in the URI should be escaped with encodeURIComponent().
|
||||
*/
|
||||
function HTTPGet(uri, callbackFunction, callbackParameter) {
|
||||
var xmlHttp = new XMLHttpRequest();
|
||||
var bAsync = true;
|
||||
if (!callbackFunction) {
|
||||
bAsync = false;
|
||||
}
|
||||
|
||||
xmlHttp.open('GET', uri, bAsync);
|
||||
xmlHttp.send(null);
|
||||
|
||||
if (bAsync) {
|
||||
xmlHttp.onreadystatechange = function() {
|
||||
if (xmlHttp.readyState == 4) {
|
||||
callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
}
|
||||
else {
|
||||
return xmlHttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an HTTP POST request and sends the response to the callback function
|
||||
*
|
||||
* Note: passing null or undefined for 'object' makes the request fail in Opera 8.
|
||||
* Pass an empty string instead.
|
||||
*/
|
||||
function HTTPPost(uri, callbackFunction, callbackParameter, object) {
|
||||
var xmlHttp = new XMLHttpRequest();
|
||||
var bAsync = true;
|
||||
if (!callbackFunction) {
|
||||
bAsync = false;
|
||||
}
|
||||
xmlHttp.open('POST', uri, bAsync);
|
||||
|
||||
var toSend = '';
|
||||
if (typeof object == 'object') {
|
||||
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
for (var i in object) {
|
||||
toSend += (toSend ? '&' : '') + i + '=' + encodeURIComponent(object[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
toSend = object;
|
||||
}
|
||||
xmlHttp.send(toSend);
|
||||
|
||||
if (bAsync) {
|
||||
xmlHttp.onreadystatechange = function() {
|
||||
if (xmlHttp.readyState == 4) {
|
||||
callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
}
|
||||
else {
|
||||
return xmlHttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirects a button's form submission to a hidden iframe and displays the result
|
||||
* in a given wrapper. The iframe should contain a call to
|
||||
* window.parent.iframeHandler() after submission.
|
||||
*/
|
||||
function redirectFormButton(uri, button, handler) {
|
||||
// (Re)create an iframe to target.
|
||||
createIframe();
|
||||
|
||||
// Trap the button
|
||||
button.onmouseover = button.onfocus = function() {
|
||||
button.onclick = function() {
|
||||
// Prepare variables for use in anonymous function.
|
||||
var button = this;
|
||||
var action = button.form.action;
|
||||
var target = button.form.target;
|
||||
|
||||
// Redirect form submission
|
||||
this.form.action = uri;
|
||||
this.form.target = 'redirect-target';
|
||||
|
||||
handler.onsubmit();
|
||||
|
||||
// Set iframe handler for later
|
||||
window.iframeHandler = function () {
|
||||
var iframe = $('redirect-target');
|
||||
// Restore form submission
|
||||
button.form.action = action;
|
||||
button.form.target = target;
|
||||
|
||||
// Get response from iframe body
|
||||
try {
|
||||
response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;
|
||||
// Firefox 1.0.x hack: Remove (corrupted) control characters
|
||||
response = response.replace(/[\f\n\r\t]/g, ' ');
|
||||
if (window.opera) {
|
||||
// Opera-hack: it returns innerHTML sanitized.
|
||||
response = response.replace(/"/g, '"');
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
response = null;
|
||||
}
|
||||
|
||||
$('redirect-target').onload = null;
|
||||
$('redirect-target').src = 'about:blank';
|
||||
|
||||
response = parseJson(response);
|
||||
// Check response code
|
||||
if (response.status == 0) {
|
||||
handler.onerror(response.data);
|
||||
return;
|
||||
}
|
||||
handler.oncomplete(response.data);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
button.onmouseout = button.onblur = function() {
|
||||
button.onclick = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a function to the window onload event
|
||||
*/
|
||||
function addLoadEvent(func) {
|
||||
var oldOnload = window.onload;
|
||||
if (typeof window.onload != 'function') {
|
||||
window.onload = func;
|
||||
}
|
||||
else {
|
||||
window.onload = function() {
|
||||
oldOnload();
|
||||
func();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a function to a given form's submit event
|
||||
*/
|
||||
function addSubmitEvent(form, func) {
|
||||
var oldSubmit = form.onsubmit;
|
||||
if (typeof oldSubmit != 'function') {
|
||||
form.onsubmit = func;
|
||||
}
|
||||
else {
|
||||
form.onsubmit = function() {
|
||||
return oldSubmit() && func();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the absolute position of an element on the screen
|
||||
*/
|
||||
function absolutePosition(el) {
|
||||
var sLeft = 0, sTop = 0;
|
||||
var isDiv = /^div$/i.test(el.tagName);
|
||||
if (isDiv && el.scrollLeft) {
|
||||
sLeft = el.scrollLeft;
|
||||
}
|
||||
if (isDiv && el.scrollTop) {
|
||||
sTop = el.scrollTop;
|
||||
}
|
||||
var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop };
|
||||
if (el.offsetParent) {
|
||||
var tmp = absolutePosition(el.offsetParent);
|
||||
r.x += tmp.x;
|
||||
r.y += tmp.y;
|
||||
}
|
||||
return r;
|
||||
};
|
||||
|
||||
function dimensions(el) {
|
||||
return { width: el.offsetWidth, height: el.offsetHeight };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if an element has a specified class name
|
||||
*/
|
||||
function hasClass(node, className) {
|
||||
if (node.className == className) {
|
||||
return true;
|
||||
}
|
||||
var reg = new RegExp('(^| )'+ className +'($| )')
|
||||
if (reg.test(node.className)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a class name to an element
|
||||
*/
|
||||
function addClass(node, className) {
|
||||
if (hasClass(node, className)) {
|
||||
return false;
|
||||
}
|
||||
node.className += ' '+ className;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a class name from an element
|
||||
*/
|
||||
function removeClass(node, className) {
|
||||
if (!hasClass(node, className)) {
|
||||
return false;
|
||||
}
|
||||
// Replaces words surrounded with whitespace or at a string border with a space. Prevents multiple class names from being glued together.
|
||||
node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles a class name on or off for an element
|
||||
*/
|
||||
function toggleClass(node, className) {
|
||||
if (!removeClass(node, className) && !addClass(node, className)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emulate PHP's ereg_replace function in javascript
|
||||
*/
|
||||
function eregReplace(search, replace, subject) {
|
||||
return subject.replace(new RegExp(search,'g'), replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an element from the page
|
||||
*/
|
||||
function removeNode(node) {
|
||||
if (typeof node == 'string') {
|
||||
node = $(node);
|
||||
}
|
||||
if (node && node.parentNode) {
|
||||
return node.parentNode.removeChild(node);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents an event from propagating.
|
||||
*/
|
||||
function stopEvent(event) {
|
||||
if (event.preventDefault) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
else {
|
||||
event.returnValue = false;
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a JSON response.
|
||||
*
|
||||
* The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
|
||||
*/
|
||||
function parseJson(data) {
|
||||
if (data.substring(0,1) != '{') {
|
||||
return { status: 0, data: data.length ? data : 'Unspecified error' };
|
||||
}
|
||||
return eval('(' + data + ');');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an invisible iframe for form submissions.
|
||||
*/
|
||||
function createIframe() {
|
||||
// Delete any previous iframe
|
||||
deleteIframe();
|
||||
// Note: some browsers require the literal name/id attributes on the tag,
|
||||
// some want them set through JS. We do both.
|
||||
window.iframeHandler = function () {};
|
||||
var div = document.createElement('div');
|
||||
div.id = 'redirect-holder';
|
||||
div.innerHTML = '<iframe name="redirect-target" id="redirect-target" class="redirect" onload="window.iframeHandler();"></iframe>';
|
||||
var iframe = div.firstChild;
|
||||
with (iframe) {
|
||||
name = 'redirect-target';
|
||||
setAttribute('name', 'redirect-target');
|
||||
id = 'redirect-target';
|
||||
}
|
||||
with (iframe.style) {
|
||||
position = 'absolute';
|
||||
height = '1px';
|
||||
width = '1px';
|
||||
visibility = 'hidden';
|
||||
}
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the invisible iframe for form submissions.
|
||||
*/
|
||||
function deleteIframe() {
|
||||
var holder = $('redirect-holder');
|
||||
if (holder != null) {
|
||||
removeNode(holder);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around document.getElementById().
|
||||
*/
|
||||
function $(id) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 162 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 106 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 1.3 KiB |