From f33beb0b3d60c38b164e29d9ec198d5e200b1f4f Mon Sep 17 00:00:00 2001 From: tomflannaghan Date: Tue, 19 Sep 2006 01:21:13 +0000 Subject: [PATCH] Preset added. This is a basic javascript based preset. --- .../preset/Image Gallery/addtemplate.html | 8 ++++ mod/data/preset/Image Gallery/csstemplate.css | 41 +++++++++++++++++++ mod/data/preset/Image Gallery/jstemplate.js | 41 +++++++++++++++++++ .../preset/Image Gallery/listtemplate.html | 8 ++++ .../Image Gallery/listtemplatefooter.html | 1 + .../Image Gallery/listtemplateheader.html | 2 + mod/data/preset/Image Gallery/preset.xml | 40 ++++++++++++++++++ .../preset/Image Gallery/rsstemplate.html | 1 + .../rsstitletemplate.html} | 0 .../preset/Image Gallery/singletemplate.html | 8 ++++ .../preset/imagegallery/listtemplate.html | 0 .../imagegallery/listtemplatefooter.html | 0 .../imagegallery/listtemplateheader.html | 0 mod/data/preset/imagegallery/preset.xml | 28 ------------- mod/data/preset/imagegallery/rsstemplate.html | 0 .../preset/imagegallery/singletemplate.html | 0 16 files changed, 150 insertions(+), 28 deletions(-) create mode 100644 mod/data/preset/Image Gallery/addtemplate.html create mode 100644 mod/data/preset/Image Gallery/csstemplate.css create mode 100644 mod/data/preset/Image Gallery/jstemplate.js create mode 100644 mod/data/preset/Image Gallery/listtemplate.html create mode 100644 mod/data/preset/Image Gallery/listtemplatefooter.html create mode 100644 mod/data/preset/Image Gallery/listtemplateheader.html create mode 100644 mod/data/preset/Image Gallery/preset.xml create mode 100644 mod/data/preset/Image Gallery/rsstemplate.html rename mod/data/preset/{imagegallery/addtemplate.html => Image Gallery/rsstitletemplate.html} (100%) create mode 100644 mod/data/preset/Image Gallery/singletemplate.html delete mode 100644 mod/data/preset/imagegallery/listtemplate.html delete mode 100644 mod/data/preset/imagegallery/listtemplatefooter.html delete mode 100644 mod/data/preset/imagegallery/listtemplateheader.html delete mode 100644 mod/data/preset/imagegallery/preset.xml delete mode 100644 mod/data/preset/imagegallery/rsstemplate.html delete mode 100644 mod/data/preset/imagegallery/singletemplate.html diff --git a/mod/data/preset/Image Gallery/addtemplate.html b/mod/data/preset/Image Gallery/addtemplate.html new file mode 100644 index 0000000000..e8d8d15e30 --- /dev/null +++ b/mod/data/preset/Image Gallery/addtemplate.html @@ -0,0 +1,8 @@ +
+ + + +
Title: [[title]]
Caption: [[caption]]
+
+[[image]] +
\ 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 index 0000000000..5274dda597 --- /dev/null +++ b/mod/data/preset/Image Gallery/csstemplate.css @@ -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; +} \ 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 index 0000000000..cc0db7797e --- /dev/null +++ b/mod/data/preset/Image Gallery/jstemplate.js @@ -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; \ 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 index 0000000000..5b245ce68d --- /dev/null +++ b/mod/data/preset/Image Gallery/listtemplate.html @@ -0,0 +1,8 @@ +
+
+ + + +
[[image]]
##edit## ##delete## ##approve##
+
+
diff --git a/mod/data/preset/Image Gallery/listtemplatefooter.html b/mod/data/preset/Image Gallery/listtemplatefooter.html new file mode 100644 index 0000000000..3945442ace --- /dev/null +++ b/mod/data/preset/Image Gallery/listtemplatefooter.html @@ -0,0 +1 @@ + \ 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 index 0000000000..c6f6f2e3e4 --- /dev/null +++ b/mod/data/preset/Image Gallery/listtemplateheader.html @@ -0,0 +1,2 @@ +
+
\ 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 index 0000000000..201650992b --- /dev/null +++ b/mod/data/preset/Image Gallery/preset.xml @@ -0,0 +1,40 @@ + + + + +0 +0 +3 +0 +0 +0 +0 +0 +0 +0 + +0 +0 +0 + + + +picture +image +100% +100% +2097152 +120 + + + +text +title + + + +text +caption + + + \ 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 index 0000000000..d8539553da --- /dev/null +++ b/mod/data/preset/Image Gallery/rsstemplate.html @@ -0,0 +1 @@ +
image:[[image]]
title:[[title]]
caption:[[caption]]
\ No newline at end of file diff --git a/mod/data/preset/imagegallery/addtemplate.html b/mod/data/preset/Image Gallery/rsstitletemplate.html similarity index 100% rename from mod/data/preset/imagegallery/addtemplate.html rename to mod/data/preset/Image Gallery/rsstitletemplate.html diff --git a/mod/data/preset/Image Gallery/singletemplate.html b/mod/data/preset/Image Gallery/singletemplate.html new file mode 100644 index 0000000000..07b687c0bf --- /dev/null +++ b/mod/data/preset/Image Gallery/singletemplate.html @@ -0,0 +1,8 @@ +
+ + + + + +

[[title]]

[[image]]
[[caption]]
##Edit## ##More## ##Delete## ##Approve##
+
\ 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 index e69de29bb2..0000000000 diff --git a/mod/data/preset/imagegallery/listtemplatefooter.html b/mod/data/preset/imagegallery/listtemplatefooter.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mod/data/preset/imagegallery/listtemplateheader.html b/mod/data/preset/imagegallery/listtemplateheader.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mod/data/preset/imagegallery/preset.xml b/mod/data/preset/imagegallery/preset.xml deleted file mode 100644 index 20ecd23e3e..0000000000 --- a/mod/data/preset/imagegallery/preset.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - 1 - 1 - - - - text - Name - The name of this image - - - - textarea - Description - Information about your image - - - - picture - Image - Your uploaded image - - - 100 - 100 - diff --git a/mod/data/preset/imagegallery/rsstemplate.html b/mod/data/preset/imagegallery/rsstemplate.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mod/data/preset/imagegallery/singletemplate.html b/mod/data/preset/imagegallery/singletemplate.html deleted file mode 100644 index e69de29bb2..0000000000 -- 2.39.5