]> git.mjollnir.org Git - moodle.git/commitdiff
Preset added. This is a basic javascript based preset.
authortomflannaghan <tomflannaghan>
Tue, 19 Sep 2006 01:21:13 +0000 (01:21 +0000)
committertomflannaghan <tomflannaghan>
Tue, 19 Sep 2006 01:21:13 +0000 (01:21 +0000)
16 files changed:
mod/data/preset/Image Gallery/addtemplate.html [new file with mode: 0644]
mod/data/preset/Image Gallery/csstemplate.css [new file with mode: 0644]
mod/data/preset/Image Gallery/jstemplate.js [new file with mode: 0644]
mod/data/preset/Image Gallery/listtemplate.html [new file with mode: 0644]
mod/data/preset/Image Gallery/listtemplatefooter.html [new file with mode: 0644]
mod/data/preset/Image Gallery/listtemplateheader.html [new file with mode: 0644]
mod/data/preset/Image Gallery/preset.xml [new file with mode: 0644]
mod/data/preset/Image Gallery/rsstemplate.html [new file with mode: 0644]
mod/data/preset/Image Gallery/rsstitletemplate.html [moved from mod/data/preset/imagegallery/addtemplate.html with 100% similarity]
mod/data/preset/Image Gallery/singletemplate.html [new file with mode: 0644]
mod/data/preset/imagegallery/listtemplate.html [deleted file]
mod/data/preset/imagegallery/listtemplatefooter.html [deleted file]
mod/data/preset/imagegallery/listtemplateheader.html [deleted file]
mod/data/preset/imagegallery/preset.xml [deleted file]
mod/data/preset/imagegallery/rsstemplate.html [deleted file]
mod/data/preset/imagegallery/singletemplate.html [deleted file]

diff --git a/mod/data/preset/Image Gallery/addtemplate.html b/mod/data/preset/Image Gallery/addtemplate.html
new file mode 100644 (file)
index 0000000..e8d8d15
--- /dev/null
@@ -0,0 +1,8 @@
+<div align="center">\r
+<table>\r
+<tr><td>Title: </td><td>[[title]]</td></tr>\r
+<tr><td>Caption: </td><td>[[caption]]</td></tr>\r
+</table>\r
+<hr>\r
+[[image]]\r
+</div>
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/csstemplate.css b/mod/data/preset/Image Gallery/csstemplate.css
new file mode 100644 (file)
index 0000000..5274dda
--- /dev/null
@@ -0,0 +1,41 @@
+/******  List View CSS ******/\r
+\r
+#pictures {\r
+  width: 750px;\r
+}\r
+\r
+.picture {\r
+  padding: 5px;\r
+  border-style: solid;\r
+  border-width: thin;\r
+  border-color: #779;\r
+  background-color: white;\r
+\r
+  display:table-cell;display:inline-table;display:inline-block;\r
+}\r
+\r
+.pictureframe {\r
+  padding: 5px;\r
+\r
+  display:table-cell;display:inline-table;display:inline-block;\r
+}\r
+\r
+.picturediv {\r
+  display: inline;\r
+  width: 150px;\r
+  height: 200px;\r
+}\r
+\r
+.inline {\r
+  display: inline;\r
+}\r
+\r
+/*****  Single View CSS *****/\r
+\r
+.caption {\r
+  font-style: italic;\r
+}\r
+\r
+#singleimage {\r
+  width: 700px;\r
+}
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/jstemplate.js b/mod/data/preset/Image Gallery/jstemplate.js
new file mode 100644 (file)
index 0000000..cc0db77
--- /dev/null
@@ -0,0 +1,41 @@
+var maxHeight = 550;\r
+var maxListHeight = 120;\r
+\r
+function init() {\r
+       if (document.getElementById("singleimage")) single();\r
+       /*else if (document.getElementById("pictures")) list();*/\r
+}\r
+\r
+function list() {\r
+       imageDivs = document.getElementsByName("listimage");\r
+       for (i=0; i < imageDivs.length; i++) {\r
+               currentHeight = imageDivs[i].offsetHeight;\r
+               currentWidth = imageDivs[i].offsetWidth;\r
+               \r
+               if (currentHeight > maxListHeight) {\r
+                       ratio = maxListHeight / currentHeight;\r
+                       imageDivs[i].style.width = (currentWidth*ratio) + 'px';\r
+                       imageDivs[i].style.height = (currentHeight*ratio) + 'px';\r
+                       imageDivs[i].firstChild.style.height = '100%';\r
+                       imageDivs[i].firstChild.style.width = '100%';\r
+               }\r
+       }\r
+}\r
+\r
+function single() {\r
+       var imageDiv = document.getElementById("singleimage");\r
+\r
+       if (imageDiv) {\r
+               currentHeight = imageDiv.offsetHeight;\r
+               currentWidth  = imageDiv.offsetWidth;\r
+               \r
+               if (currentHeight > maxHeight) {\r
+                       ratio = maxHeight / currentHeight;\r
+                       imageDiv.style.width = (currentWidth*ratio) + 'px';\r
+                       imageDiv.style.height = (currentHeight*ratio) + 'px';\r
+               \r
+               }\r
+       }\r
+}\r
+\r
+window.onload = init;
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/listtemplate.html b/mod/data/preset/Image Gallery/listtemplate.html
new file mode 100644 (file)
index 0000000..5b245ce
--- /dev/null
@@ -0,0 +1,8 @@
+<div class="picturediv">\r
+<table class="pictureframe"><tr><td>\r
+<table class="picture">\r
+<tr><td><div name="listimage">[[image]]</div></td></tr>\r
+<tr><td align="right">##edit## ##delete## ##approve##</td></tr>\r
+</table>\r
+</td></tr></table>\r
+</div>\r
diff --git a/mod/data/preset/Image Gallery/listtemplatefooter.html b/mod/data/preset/Image Gallery/listtemplatefooter.html
new file mode 100644 (file)
index 0000000..3945442
--- /dev/null
@@ -0,0 +1 @@
+</div></div>
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/listtemplateheader.html b/mod/data/preset/Image Gallery/listtemplateheader.html
new file mode 100644 (file)
index 0000000..c6f6f2e
--- /dev/null
@@ -0,0 +1,2 @@
+<div align="center">\r
+<div align="center" id="pictures">
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/preset.xml b/mod/data/preset/Image Gallery/preset.xml
new file mode 100644 (file)
index 0000000..2016509
--- /dev/null
@@ -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>
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/rsstemplate.html b/mod/data/preset/Image Gallery/rsstemplate.html
new file mode 100644 (file)
index 0000000..d853955
--- /dev/null
@@ -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>
\ No newline at end of file
diff --git a/mod/data/preset/Image Gallery/singletemplate.html b/mod/data/preset/Image Gallery/singletemplate.html
new file mode 100644 (file)
index 0000000..07b687c
--- /dev/null
@@ -0,0 +1,8 @@
+<div align="center">\r
+<table id="single">\r
+<tr><td align="center"><h3>[[title]]</h3></td></tr>\r
+<tr><td align="center"><div id="singleimage">[[image]]</div></td></tr>\r
+<tr><td align="center"><span class="caption">[[caption]]</span></td></tr>\r
+<tr><td align="center">##Edit##  ##More##  ##Delete##  ##Approve##</td></tr>\r
+</table>\r
+</div>
\ No newline at end of file
diff --git a/mod/data/preset/imagegallery/listtemplate.html b/mod/data/preset/imagegallery/listtemplate.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mod/data/preset/imagegallery/listtemplatefooter.html b/mod/data/preset/imagegallery/listtemplatefooter.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mod/data/preset/imagegallery/listtemplateheader.html b/mod/data/preset/imagegallery/listtemplateheader.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mod/data/preset/imagegallery/preset.xml b/mod/data/preset/imagegallery/preset.xml
deleted file mode 100644 (file)
index 20ecd23..0000000
+++ /dev/null
@@ -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>
diff --git a/mod/data/preset/imagegallery/rsstemplate.html b/mod/data/preset/imagegallery/rsstemplate.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mod/data/preset/imagegallery/singletemplate.html b/mod/data/preset/imagegallery/singletemplate.html
deleted file mode 100644 (file)
index e69de29..0000000