Preset added. This is a basic javascript based preset.

This commit is contained in:
tomflannaghan 2006-09-19 01:21:13 +00:00
parent 21b6db6eff
commit f33beb0b3d
16 changed files with 150 additions and 28 deletions

View file

@ -0,0 +1,8 @@
<div align="center">
<table>
<tr><td>Title: </td><td>[[title]]</td></tr>
<tr><td>Caption: </td><td>[[caption]]</td></tr>
</table>
<hr>
[[image]]
</div>

View file

@ -0,0 +1,41 @@
/****** List View CSS ******/
#pictures {
width: 750px;
}
.picture {
padding: 5px;
border-style: solid;
border-width: thin;
border-color: #779;
background-color: white;
display:table-cell;display:inline-table;display:inline-block;
}
.pictureframe {
padding: 5px;
display:table-cell;display:inline-table;display:inline-block;
}
.picturediv {
display: inline;
width: 150px;
height: 200px;
}
.inline {
display: inline;
}
/***** Single View CSS *****/
.caption {
font-style: italic;
}
#singleimage {
width: 700px;
}

View file

@ -0,0 +1,41 @@
var maxHeight = 550;
var maxListHeight = 120;
function init() {
if (document.getElementById("singleimage")) single();
/*else if (document.getElementById("pictures")) list();*/
}
function list() {
imageDivs = document.getElementsByName("listimage");
for (i=0; i < imageDivs.length; i++) {
currentHeight = imageDivs[i].offsetHeight;
currentWidth = imageDivs[i].offsetWidth;
if (currentHeight > maxListHeight) {
ratio = maxListHeight / currentHeight;
imageDivs[i].style.width = (currentWidth*ratio) + 'px';
imageDivs[i].style.height = (currentHeight*ratio) + 'px';
imageDivs[i].firstChild.style.height = '100%';
imageDivs[i].firstChild.style.width = '100%';
}
}
}
function single() {
var imageDiv = document.getElementById("singleimage");
if (imageDiv) {
currentHeight = imageDiv.offsetHeight;
currentWidth = imageDiv.offsetWidth;
if (currentHeight > maxHeight) {
ratio = maxHeight / currentHeight;
imageDiv.style.width = (currentWidth*ratio) + 'px';
imageDiv.style.height = (currentHeight*ratio) + 'px';
}
}
}
window.onload = init;

View file

@ -0,0 +1,8 @@
<div class="picturediv">
<table class="pictureframe"><tr><td>
<table class="picture">
<tr><td><div name="listimage">[[image]]</div></td></tr>
<tr><td align="right">##edit## ##delete## ##approve##</td></tr>
</table>
</td></tr></table>
</div>

View file

@ -0,0 +1 @@
</div></div>

View file

@ -0,0 +1,2 @@
<div align="center">
<div align="center" id="pictures">

View file

@ -0,0 +1,40 @@
<preset>
<settings>
<intro></intro>
<comments>0</comments>
<ratings>0</ratings>
<participants>3</participants>
<requiredentries>0</requiredentries>
<requiredentriestoview>0</requiredentriestoview>
<maxentries>0</maxentries>
<rssarticles>0</rssarticles>
<approval>0</approval>
<scale>0</scale>
<assessed>0</assessed>
<assessedpublic></assessedpublic>
<defaultsort>0</defaultsort>
<defaultsortdir>0</defaultsortdir>
<editany>0</editany>
</settings>
<field>
<type>picture</type>
<name>image</name>
<param1>100%</param1>
<param2>100%</param2>
<param3>2097152</param3>
<param4>120</param4>
</field>
<field>
<type>text</type>
<name>title</name>
</field>
<field>
<type>text</type>
<name>caption</name>
</field>
</preset>

View file

@ -0,0 +1 @@
<div align="center"><table><tr><td valign="top" align="right">image:</td><td>[[image]]</td></tr><tr><td valign="top" align="right">title:</td><td>[[title]]</td></tr><tr><td valign="top" align="right">caption:</td><td>[[caption]]</td></tr></table></div>

View file

@ -0,0 +1,8 @@
<div align="center">
<table id="single">
<tr><td align="center"><h3>[[title]]</h3></td></tr>
<tr><td align="center"><div id="singleimage">[[image]]</div></td></tr>
<tr><td align="center"><span class="caption">[[caption]]</span></td></tr>
<tr><td align="center">##Edit## ##More## ##Delete## ##Approve##</td></tr>
</table>
</div>

View file

@ -1,28 +0,0 @@
<?xml version="1.0"?>
<settings>
<comments>1</comments>
<ratings>1</ratings>
</settings>
<field>
<type>text</type>
<name>Name</name>
<description>The name of this image</description>
</field>
<field>
<type>textarea</type>
<name>Description</name>
<description>Information about your image</description>
</field>
<field>
<type>picture</type>
<name>Image</name>
<description>Your uploaded image</description>
<param1></param1>
<param2></param2>
<param4>100</param4>
<param5>100</param5>
</field>