mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Preset added. This is a basic javascript based preset.
This commit is contained in:
parent
21b6db6eff
commit
f33beb0b3d
16 changed files with 150 additions and 28 deletions
8
mod/data/preset/Image Gallery/addtemplate.html
Normal file
8
mod/data/preset/Image Gallery/addtemplate.html
Normal 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>
|
41
mod/data/preset/Image Gallery/csstemplate.css
Normal file
41
mod/data/preset/Image Gallery/csstemplate.css
Normal 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;
|
||||
}
|
41
mod/data/preset/Image Gallery/jstemplate.js
Normal file
41
mod/data/preset/Image Gallery/jstemplate.js
Normal 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;
|
8
mod/data/preset/Image Gallery/listtemplate.html
Normal file
8
mod/data/preset/Image Gallery/listtemplate.html
Normal 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>
|
1
mod/data/preset/Image Gallery/listtemplatefooter.html
Normal file
1
mod/data/preset/Image Gallery/listtemplatefooter.html
Normal file
|
@ -0,0 +1 @@
|
|||
</div></div>
|
2
mod/data/preset/Image Gallery/listtemplateheader.html
Normal file
2
mod/data/preset/Image Gallery/listtemplateheader.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<div align="center">
|
||||
<div align="center" id="pictures">
|
40
mod/data/preset/Image Gallery/preset.xml
Normal file
40
mod/data/preset/Image Gallery/preset.xml
Normal 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>
|
1
mod/data/preset/Image Gallery/rsstemplate.html
Normal file
1
mod/data/preset/Image Gallery/rsstemplate.html
Normal 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>
|
8
mod/data/preset/Image Gallery/singletemplate.html
Normal file
8
mod/data/preset/Image Gallery/singletemplate.html
Normal 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>
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue