Inital commit

This commit is contained in:
Tilman
2011-10-26 10:11:42 +02:00
commit c0da376199
888 changed files with 44367 additions and 0 deletions
Binary file not shown.
@@ -0,0 +1,129 @@
/**
* IMG ASSIST WINDOW
*/
body.img_assist {
margin: 0px;
padding: 5px;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: .8em;
background-color: #efefef;
}
/* Thin line between the header frame and the main frame */
body#img_assist_thumbs, body#img_assist_upload, body#img_assist_properties {
border-top: 1px solid #000;
}
/* Darker background color in the header frame */
body#img_assist_header {
background-color:#ccc;
}
/* Thin border around images */
.img_assist img {
border: 1px solid #000;
}
.img_assist .form-button {
font-weight: bold;
}
.img_assist img {
display: inline; /* pushbutton theme changes the display to block */
}
.img_assist .messages {
border: 1px solid #000;
background-color: #ccc;
padding: 2px;
margin: 3px 0px 6px 0px;
}
/* Upload Window */
.img_assist .node-form {
width: 95%;
}
/* Properties Window */
.img_assist #preview {
padding: 5px 10px 5px 5px;
}
.img_assist .form-item { /* the first form field on the properties frame should be at the top of the page */
margin-top: 0px;
margin-bottom: 1em;
}
.img_assist #caption {
display: block;
}
.img_assist #browse div.form-item {
display: inline;
}
.img_assist #link-group div.form-item{
display: inline;
}
.img_assist #size div.form-item{
display: inline;
}
.img_assist #size-other div.form-item{
display: inline;
}
.img_assist #alignment {
text-align: left;
}
.img_assist #edit-title, .img_assist #edit-desc {
width: 99%;
}
.img_assist #edit-link {
width: 155px;
}
.img_assist #edit-url {
width: 150px;
}
.img_assist #edit-align {
width: 100px;
}
#finalhtmlcode {
display: none;
visibility: hidden;
}
/* Header Frame */
#header-uploading, #header-properties, #header-browse {
float: left;
width: 80%;
}
#header-startover, #header-cancel {
float: right;
width: 15%;
text-align: right;
}
/**
* POPUP IMAGES WINDOW
*/
body#img_assist_display {
margin: 0;
padding: 0;
}
img {
margin: 0;
padding: 0;
}
/**
* FINAL PAGE (node)
* You may want to copy these styles to your theme's CSS file and then set img_assist.css
* not to load on every page. This can be set on the img_assist settings page.
*/
span.left {
float: left;
margin: 5px 5px 5px 0px;
}
span.right {
float: right;
margin: 5px 0px 5px 5px;
}
span.caption {
display: block; /* put the caption under the image (not next to it) */
}
.inline img{
border: 1px solid #000; /* put a thin border around inline images */
}
br.clear-both {
clear: both; /* clear floats so the next node will display normally */
}
@@ -0,0 +1,149 @@
var currentMode;
function onChangeBrowseBy() {
var formObj = frames['img_assist_header'].document.forms[0];
browse = formObj['edit[browse]'].value;
frames['img_assist_main'].window.location.href = BASE_URL + 'index.php?q=img_assist/thumbs/' + browse;
}
function onClickUpload() {
frames['img_assist_main'].window.location.href = BASE_URL + 'index.php?q=img_assist/upload';
}
function onClickStartOver() {
frames['img_assist_main'].window.location.href = BASE_URL + 'index.php?q=img_assist/thumbs/myimages';
}
function updateCaption() {
var caption = frames['img_assist_main'].document.getElementById("caption");
var title = frames['img_assist_main'].document.img_assist['edit[title]'].value;
var desc = frames['img_assist_main'].document.img_assist['edit[desc]'].value;
if (desc != '') {
title = title + ': ';
}
caption.innerHTML = '<strong>' + title + '</strong>' + desc;
}
function onChangeHeight() {
var formObj = frames['img_assist_main'].document.forms[0];
var aspect = formObj['edit[aspect]'].value;
var height = formObj['edit[height]'].value;
formObj['edit[width]'].value = Math.round(height * aspect);
}
function onChangeWidth() {
var formObj = frames['img_assist_main'].document.forms[0];
var aspect = formObj['edit[aspect]'].value;
var width = formObj['edit[width]'].value;
formObj['edit[height]'].value = Math.round(width / aspect);
}
function onChangeLink() {
var formObj = frames['img_assist_main'].document.forms[0];
if (formObj['edit[link_options_visible]'].value == 1) {
if (formObj['edit[link]'].value == 'url') {
showElement('edit-url', 'inline');
} else {
hideElement('edit-url');
}
}
}
function onChangeSizeLabel() {
var formObj = frames['img_assist_main'].document.forms[0];
if (formObj['edit[size_label]'].value == 'other') {
showElement('size-other', 'inline');
} else {
hideElement('size-other');
//showElement('size-other', 'inline'); // uncomment for testing
// get the new width and height
var size = formObj['edit[size_label]'].value.split('x');
// this array is probably a bounding box size, not an actual image
// size, so now we use the known aspect ratio to find the actual size
var aspect = formObj['edit[aspect]'].value;
var width = size[0];
var height = size[1];
if (Math.round(width / aspect) <= height) { // width is controlling factor
height = Math.round(width / aspect);
} else { // height is controlling factor
width = Math.round(height * aspect);
}
// fill the hidden width and height textboxes with these values
formObj['edit[width]'].value = width;
formObj['edit[height]'].value = height;
}
}
function setHeader(mode) {
if (currentMode != mode) {
frames['img_assist_header'].window.location.href = BASE_URL + 'index.php?q=img_assist/header/' + mode;
}
currentMode = mode;
}
function showElement(id, format) {
var docObj = frames['img_assist_main'].document;
format = (format) ? format : 'block';
if (docObj.layers) {
docObj.layers[id].display = format;
} else if (docObj.all) {
docObj.all[id].style.display = format;
} else if (docObj.getElementById) {
docObj.getElementById(id).style.display = format;
}
}
function hideElement(id) {
var docObj = frames['img_assist_main'].document;
if (docObj.layers) {
docObj.layers[id].display = 'none';
} else if (docObj.all) {
docObj.all[id].style.display = 'none';
} else if (docObj.getElementById) {
docObj.getElementById(id).style.display = 'none';
}
}
function launch_popup(nid, mw, mh) {
var ox = mw;
var oy = mh;
if((ox>=screen.width) || (oy>=screen.height)){
var ox = screen.width-150;
var oy = screen.height-150;
var winx = (screen.width / 2)-(ox / 2);
var winy = (screen.height / 2)-(oy / 2);
var use_scrollbars = 1;
}
else{
var winx = (screen.width / 2)-(ox / 2);
var winy = (screen.height / 2)-(oy / 2);
var use_scrollbars = 0;
}
var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
}
function insertImage() {
if (window.opener) {
// Get variables from the fields on the properties frame
var formObj = frames['img_assist_main'].document.forms[0];
// Get mode (see img_assist.module for detailed comments)
if (formObj['edit[insertmode]'].value == 'html') { // return so the page can submit normally and generate the HTML code
return true;
} else if (formObj['edit[insertmode]'].value == 'html2') { // HTML step 2 (processed code, ready to be inserted)
var content = getHTML(formObj);
} else {
var content = getFilterTag(formObj);
}
insertToEditor(content);
return false;
} else {
alert('The image cannot be inserted because the parent window cannot be found.');
return false;
}
}
function getHTML(formObj) {
var html = frames['img_assist_main'].document.getElementById("finalhtmlcode").innerHTML;
return html;
}