Author: pvollenweider
Date: Tue Nov 6 15:41:03 2007
New Revision: 11
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D11&repname=3D=
simple_templates
Log:
Minor fixes on simple templates
Added:
trunk/src/jsp/template_api.jsp
Removed:
trunk/src/jsp/templatel_api.jsp
Modified:
trunk/src/java/jahiatemplates/Simple_templates.properties
trunk/src/jsp/actions.css
trunk/src/jsp/actions.js
trunk/src/jsp/declarations_api.inc
Modified: trunk/src/java/jahiatemplates/Simple_templates.properties
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/java/jahiat=
emplates/Simple_templates.properties&rev=3D11&repname=3Dsimple_templates
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/java/jahiatemplates/Simple_templates.properties (original)
+++ trunk/src/java/jahiatemplates/Simple_templates.properties Tue Nov 6 15=
:41:03 2007
@@ -1,6 +1,8 @@
add =3D Add
delete =3D Delete
update =3D Update
+ContentContainerListOperations =3D Operations
+ContentContainerOperations =3D Operations
contentContainerListOperations =3D List operations
contentContainerOperations =3D Container operations
contentFieldOperations =3D Field operations
Modified: trunk/src/jsp/actions.css
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/jsp/actions=
.css&rev=3D11&repname=3Dsimple_templates
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/actions.css (original)
+++ trunk/src/jsp/actions.css Tue Nov 6 15:41:03 2007
@@ -1,48 +1,73 @@
-div.menu,
-div.menu a.menuItem {
- font-family: "MS Sans Serif", Arial, sans-serif;
- font-size: 8pt;
- font-style: normal;
- font-weight: normal;
- color: #000000;
- white-space: nowrap;
-}
-
-div.menu {
- background-color: #d0d0d0;
- border: 2px solid;
- border-color: #f0f0f0 #909090 #909090 #f0f0f0;
- left: 0px;
- padding: 0px 1px 1px 0px;
- position: absolute;
- top: 0px;
- visibility: hidden;
- z-index: 101;
-}
-
-div.menu a.menuItem {
- color: #000000;
- cursor: default;
- display: block;
- padding: 3px 1em;
- text-decoration: none;
- white-space: nowrap;
-}
-
-div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
- background-color: #000080;
- color: #ffffff;
-}
-
-div.menu a.menuItem span.menuItemText {}
-
-div.menu a.menuItem span.menuItemArrow {
- margin-right: -.75em;
-}
-
-div.menu div.menuItemSep {
- border-top: 1px solid #909090;
- border-bottom: 1px solid #f0f0f0;
- margin: 4px 2px;
-}
-
+#menu div.menu {
+ background-color: #d0d0d0 !important;
+}
+div.menu a {
+ font-weight: normal !important;
+}
+.nostyle,
+.nostyle a {
+ background:transparent !important;
+ font-weight: normal !important;
+}
+div.menu,
+div.menu a.menuItem {
+ font-family: "MS Sans Serif", Arial, sans-serif;
+ font-size: 8pt;
+ font-style: normal;
+ font-weight: normal !important;
+ color: #000000;
+ white-space: nowrap;
+}
+#navigation span a {
+ padding:0 !important;
+}
+div.menu {
+ background-color: #d0d0d0;
+ border: 2px solid;
+ border-color: #f0f0f0 #909090 #909090 #f0f0f0;
+ left: 0px;
+ padding: 0px 1px 1px 0px !important;
+ position: absolute;
+ top: 0px;
+ visibility: hidden;
+ z-index: 101;
+}
+
+div.menu a.menuItem {
+ text-align:left !important;
+ color: #000000 !important;
+ cursor: default;
+ display: block !important;
+ clear:both;
+ padding: 3px 1em !important;
+ text-decoration: none;
+ white-space: nowrap;
+ background-image:none !important;
+ width:120px;
+ font-weight:normal !important;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+ background-color: #000080 !important;
+ color: #ffffff !important;
+ text-decoration:none !important;
+}
+
+div.menu a.menuItem span.menuItemText {}
+
+div.menu a.menuItem span.menuItemArrow {
+ margin-right: -.75em !important;
+}
+
+div.menu div.menuItemSep {
+ border-top: 1px solid #909090;
+ border-bottom: 1px solid #f0f0f0;
+ margin: 4px 2px;
+}
+
+fieldset {
+ padding:0;
+ margin: 0;
+ clear: both;
+}
Modified: trunk/src/jsp/actions.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/jsp/actions=
.js&rev=3D11&repname=3Dsimple_templates
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/actions.js (original)
+++ trunk/src/jsp/actions.js Tue Nov 6 15:41:03 2007
@@ -13,36 +13,37 @@
=
function Browser() {
=
- var ua, s, i;
+ var ua, s, i;
=
- this.isIE =3D false; // Internet Explorer
- this.isNS =3D false; // Netscape
- this.version =3D null;
-
- ua =3D navigator.userAgent;
-
- s =3D "MSIE";
- if ((i =3D ua.indexOf(s)) >=3D 0) {
- this.isIE =3D true;
- this.version =3D parseFloat(ua.substr(i + s.length));
- return;
- }
-
- s =3D "Netscape6/";
- if ((i =3D ua.indexOf(s)) >=3D 0) {
- this.isNS =3D true;
- this.version =3D parseFloat(ua.substr(i + s.length));
- return;
- }
-
- // Treat any other "Gecko" browser as NS 6.1.
-
- s =3D "Gecko";
- if ((i =3D ua.indexOf(s)) >=3D 0) {
- this.isNS =3D true;
- this.version =3D 6.1;
- return;
- }
+ this.isIE =3D false;
+ // Internet Explorer
+ this.isNS =3D false;
+ // Netscape
+ this.version =3D null;
+
+ ua =3D navigator.userAgent;
+
+ s =3D "MSIE";
+ if ((i =3D ua.indexOf(s)) >=3D 0) {
+ this.isIE =3D true;
+ this.version =3D parseFloat(ua.substr(i + s.length));
+ return;
+ }
+
+ s =3D "Netscape6/";
+ if ((i =3D ua.indexOf(s)) >=3D 0) {
+ this.isNS =3D true;
+ this.version =3D parseFloat(ua.substr(i + s.length));
+ return;
+ }
+
+ // Treat any other "Gecko" browser as NS 6.1.
+
+ s =3D "Gecko";
+ if ((i =3D ua.indexOf(s)) >=3D 0) {
+ this.isNS =3D true;
+ this.version =3D 6.1;
+ }
}
=
var browser =3D new Browser();
@@ -60,127 +61,127 @@
// deactivated.
=
if (browser.isIE)
- document.onmousedown =3D pageMousedown;
+ document.onmousedown =3D pageMousedown;
else
- document.addEventListener("mousedown", pageMousedown, true);
+ document.addEventListener("mousedown", pageMousedown, true);
=
function pageMousedown(event) {
=
- var el;
+ var el;
=
- // If there is no active button, exit.
+ // If there is no active button, exit.
=
- if (activeButton =3D=3D null)
- return;
+ if (activeButton =3D=3D null)
+ return;
=
- // Find the element that was clicked on.
+ // Find the element that was clicked on.
=
- if (browser.isIE)
- el =3D window.event.srcElement;
- else
- el =3D (event.target.tagName ? event.target : event.target.parentNode);
+ if (browser.isIE)
+ el =3D window.event.srcElement;
+ else
+ el =3D (event.target.tagName ? event.target : event.target.parentN=
ode);
=
- // If the active button was clicked on, exit.
+ // If the active button was clicked on, exit.
=
- if (el =3D=3D activeButton)
- return;
+ if (el =3D=3D activeButton)
+ return;
=
- // If the element is not part of a menu, reset and clear the active
- // button.
+ // If the element is not part of a menu, reset and clear the active
+ // button.
=
- if (getContainerWith(el, "DIV", "menu") =3D=3D null) {
- resetButton(activeButton);
- activeButton =3D null;
- }
+ if (getContainerWith(el, "DIV", "menu") =3D=3D null) {
+ resetButton(activeButton);
+ activeButton =3D null;
+ }
}
=
// Opens up the menu of the given id
-function buttonClick (menuId) {
- var button =3D getObjectById ("button_" + menuId);
+function buttonClick(menuId) {
+ var button =3D getObjectById("button_" + menuId);
+
+ // Blur focus from the link to remove that annoying outline.
+ button.blur();
+
+ // Associate the named menu to this button if not already done.
+ // Additionally, initialize menu display.
+ if (button.menu =3D=3D null) {
+ button.menu =3D getObjectById(menuId);
+ if (button.menu.isInitialized =3D=3D null) {
+ menuInit(button.menu);
+ }
+ }
+
+ // Reset the currently active button, if any.
=
- // Blur focus from the link to remove that annoying outline.
- button.blur();
+ if (activeButton !=3D null) {
+ resetButton(activeButton);
+ }
+
+ // Activate this button, unless it was the currently active one.
=
- // Associate the named menu to this button if not already done.
- // Additionally, initialize menu display.
- if (button.menu =3D=3D null) {
- button.menu =3D getObjectById (menuId);
- if (button.menu.isInitialized =3D=3D null) {
- menuInit(button.menu);
- }
- }
-
- // Reset the currently active button, if any.
-
- if (activeButton !=3D null) {
- resetButton(activeButton);
- }
-
- // Activate this button, unless it was the currently active one.
-
- if (button !=3D activeButton) {
- depressButton(button);
- activeButton =3D button;
- } else {
- activeButton =3D null;
- }
+ if (button !=3D activeButton) {
+ depressButton(button);
+ activeButton =3D button;
+ } else {
+ activeButton =3D null;
+ }
}
=
// Switches menu if the user's mouse goes on another menu
function buttonMouseover(event, menuId) {
- var button;
+ var button;
+
+ // Find the target button element.
+ if (browser.isIE) {
+ button =3D window.event.srcElement;
+ } else {
+ button =3D event.currentTarget;
+ }
=
- // Find the target button element.
- if (browser.isIE) {
- button =3D window.event.srcElement;
- } else {
- button =3D event.currentTarget;
- }
-
- // If any other button menu is active, make this one active instead.
- if (activeButton !=3D null && activeButton !=3D button) {
- buttonClick (menuId);
- }
+ // If any other button menu is active, make this one active instead.
+ if (activeButton !=3D null && activeButton !=3D button) {
+ buttonClick(menuId);
+ }
}
=
function depressButton(button) {
- var x, y;
+ var x, y;
=
- // Update the button's style class to make it look like it's
- // depressed.
+ // Update the button's style class to make it look like it's
+ // depressed.
=
- button.className +=3D " menuButtonActive";
+ button.className +=3D " menuButtonActive";
=
- // Position the associated drop down menu under the button and
- // show it.
+ // Position the associated drop down menu under the button and
+ // show it.
=
- x =3D getPageOffsetLeft(button);
- y =3D getPageOffsetTop(button) + button.offsetHeight - 5;
+ x =3D getPageOffsetLeft(button);
+ y =3D getPageOffsetTop(button) + button.offsetHeight;
=
- // For IE, adjust position.
+ // For IE, adjust position.
=
- if (browser.isIE) {
- x +=3D button.offsetParent.clientLeft;
- y +=3D button.offsetParent.clientTop;
- }
+ if (browser.isIE) {
+ x +=3D button.offsetParent.clientLeft;
+ y +=3D button.offsetParent.clientTop;
+ }
=
- button.menu.style.left =3D x + "px";
- button.menu.style.top =3D y + "px";
- button.menu.style.visibility =3D "visible";
+ button.menu.style.left =3D x + "px";
+ button.menu.style.top =3D y + "px";
+ button.menu.style.visibility =3D "visible";
}
=
function resetButton(button) {
=
- // Restore the button's style class.
+ // Restore the button's style class.
=
- removeClassName(button, "menuButtonActive");
+ removeClassName(button, "menuButtonActive");
=
- // Hide the button's menu, first closing any sub menus.
+ // Hide the button's menu, first closing any sub menus.
=
- if (button.menu !=3D null) {
- closeSubMenu(button.menu);
- button.menu.style.visibility =3D "hidden";
- }
+ if (button.menu !=3D null) {
+ closeSubMenu(button.menu);
+ button.menu.style.visibility =3D "hidden";
+ }
}
=
//------------------------------------------------------------------------=
----
@@ -189,106 +190,106 @@
=
function menuMouseover(event) {
=
- var menu;
+ var menu;
=
- // Find the target menu element.
+ // Find the target menu element.
=
- if (browser.isIE)
- menu =3D getContainerWith(window.event.srcElement, "DIV", "menu");
- else
- menu =3D event.currentTarget;
+ if (browser.isIE)
+ menu =3D getContainerWith(window.event.srcElement, "DIV", "menu");
+ else
+ menu =3D event.currentTarget;
=
- // Close any active sub menu.
+ // Close any active sub menu.
=
- if (menu.activeItem !=3D null)
- closeSubMenu(menu);
+ if (menu.activeItem !=3D null)
+ closeSubMenu(menu);
}
=
function menuItemMouseover(event, menuId) {
=
- var item, menu, x, y;
+ var item, menu, x, y;
=
- // Find the target item element and its parent menu element.
+ // Find the target item element and its parent menu element.
=
- if (browser.isIE)
- item =3D getContainerWith(window.event.srcElement, "A", "menuItem");
- else
- item =3D event.currentTarget;
- menu =3D getContainerWith(item, "DIV", "menu");
+ if (browser.isIE)
+ item =3D getContainerWith(window.event.srcElement, "A", "menuItem"=
);
+ else
+ item =3D event.currentTarget;
+ menu =3D getContainerWith(item, "DIV", "menu");
=
- // Close any active sub menu and mark this one as active.
+ // Close any active sub menu and mark this one as active.
=
- if (menu.activeItem !=3D null)
- closeSubMenu(menu);
- menu.activeItem =3D item;
+ if (menu.activeItem !=3D null)
+ closeSubMenu(menu);
+ menu.activeItem =3D item;
=
- // Highlight the item element.
+ // Highlight the item element.
=
- item.className +=3D " menuItemHighlight";
+ item.className +=3D " menuItemHighlight";
=
- // Initialize the sub menu, if not already done.
+ // Initialize the sub menu, if not already done.
=
- if (item.subMenu =3D=3D null) {
- item.subMenu =3D document.getElementById(menuId);
- if (item.subMenu.isInitialized =3D=3D null)
- menuInit(item.subMenu);
- }
-
- // Get position for submenu based on the menu item.
-
- x =3D getPageOffsetLeft(item) + item.offsetWidth;
- y =3D getPageOffsetTop(item);
-
- // Adjust position to fit in view.
-
- var maxX, maxY;
+ if (item.subMenu =3D=3D null) {
+ item.subMenu =3D document.getElementById(menuId);
+ if (item.subMenu.isInitialized =3D=3D null)
+ menuInit(item.subMenu);
+ }
=
- if (browser.isNS) {
- maxX =3D window.scrollX + window.innerWidth;
- maxY =3D window.scrollY + window.innerHeight;
- }
- if (browser.isIE) {
- maxX =3D (document.documentElement.scrollLeft !=3D 0 ? document.docu=
mentElement.scrollLeft : document.body.scrollLeft)
- + (document.documentElement.clientWidth !=3D 0 ? document.docume=
ntElement.clientWidth : document.body.clientWidth);
- maxY =3D (document.documentElement.scrollTop !=3D 0 ? document.docu=
mentElement.scrollTop : document.body.scrollTop)
- + (document.documentElement.clientHeight !=3D 0 ? document.docume=
ntElement.clientHeight : document.body.clientHeight);
- }
- maxX -=3D item.subMenu.offsetWidth;
- maxY -=3D item.subMenu.offsetHeight;
+ // Get position for submenu based on the menu item.
=
- if (x > maxX)
- x =3D Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
- + (menu.offsetWidth - item.offsetWidth));
- y =3D Math.max(0, Math.min(y, maxY));
+ x =3D getPageOffsetLeft(item) + item.offsetWidth;
+ y =3D getPageOffsetTop(item);
=
- // Position and show it.
+ // Adjust position to fit in view.
=
- item.subMenu.style.left =3D x + "px";
- item.subMenu.style.top =3D y + "px";
- item.subMenu.style.visibility =3D "visible";
+ var maxX, maxY;
=
- // Stop the event from bubbling.
+ if (browser.isNS) {
+ maxX =3D window.scrollX + window.innerWidth;
+ maxY =3D window.scrollY + window.innerHeight;
+ }
+ if (browser.isIE) {
+ maxX =3D (document.documentElement.scrollLeft !=3D 0 ? document.do=
cumentElement.scrollLeft : document.body.scrollLeft)
+ + (document.documentElement.clientWidth !=3D 0 ? document.=
documentElement.clientWidth : document.body.clientWidth);
+ maxY =3D (document.documentElement.scrollTop !=3D 0 ? document.doc=
umentElement.scrollTop : document.body.scrollTop)
+ + (document.documentElement.clientHeight !=3D 0 ? document=
.documentElement.clientHeight : document.body.clientHeight);
+ }
+ maxX -=3D item.subMenu.offsetWidth;
+ maxY -=3D item.subMenu.offsetHeight;
=
- if (browser.isIE)
- window.event.cancelBubble =3D true;
- else
- event.stopPropagation();
+ if (x > maxX)
+ x =3D Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+ + (menu.offsetWidth - item.offsetWidth));
+ y =3D Math.max(0, Math.min(y, maxY));
+
+ // Position and show it.
+
+ item.subMenu.style.left =3D x + "px";
+ item.subMenu.style.top =3D y + "px";
+ item.subMenu.style.visibility =3D "visible";
+
+ // Stop the event from bubbling.
+
+ if (browser.isIE)
+ window.event.cancelBubble =3D true;
+ else
+ event.stopPropagation();
}
=
function closeSubMenu(menu) {
=
- if (menu =3D=3D null || menu.activeItem =3D=3D null)
- return;
+ if (menu =3D=3D null || menu.activeItem =3D=3D null)
+ return;
=
- // Recursively close any sub menus.
+ // Recursively close any sub menus.
=
- if (menu.activeItem.subMenu !=3D null) {
- closeSubMenu(menu.activeItem.subMenu);
- menu.activeItem.subMenu.style.visibility =3D "hidden";
- menu.activeItem.subMenu =3D null;
- }
- removeClassName(menu.activeItem, "menuItemHighlight");
- menu.activeItem =3D null;
+ if (menu.activeItem.subMenu !=3D null) {
+ closeSubMenu(menu.activeItem.subMenu);
+ menu.activeItem.subMenu.style.visibility =3D "hidden";
+ menu.activeItem.subMenu =3D null;
+ }
+ removeClassName(menu.activeItem, "menuItemHighlight");
+ menu.activeItem =3D null;
}
=
//------------------------------------------------------------------------=
----
@@ -297,64 +298,64 @@
=
function menuInit(menu) {
=
- var itemList, spanList;
- var textEl, arrowEl;
- var itemWidth;
- var w, dw;
- var i, j;
-
- // For IE, replace arrow characters.
-
- if (browser.isIE) {
- menu.style.lineHeight =3D "2.5ex";
- spanList =3D menu.getElementsByTagName("SPAN");
- for (i =3D 0; i < spanList.length; i++)
- if (hasClassName(spanList[i], "menuItemArrow")) {
- spanList[i].style.fontFamily =3D "Webdings";
- spanList[i].firstChild.nodeValue =3D "4";
- }
- }
-
- // Find the width of a menu item.
-
- itemList =3D menu.getElementsByTagName("A");
- if (itemList.length > 0)
- itemWidth =3D itemList[0].offsetWidth;
- else
- return;
-
- // For items with arrows, add padding to item text to make the
- // arrows flush right.
-
- for (i =3D 0; i < itemList.length; i++) {
- spanList =3D itemList[i].getElementsByTagName("SPAN");
- textEl =3D null;
- arrowEl =3D null;
- for (j =3D 0; j < spanList.length; j++) {
- if (hasClassName(spanList[j], "menuItemText"))
- textEl =3D spanList[j];
- if (hasClassName(spanList[j], "menuItemArrow"))
- arrowEl =3D spanList[j];
- }
- if (textEl !=3D null && arrowEl !=3D null)
- textEl.style.paddingRight =3D (itemWidth
- - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
- }
-
- // Fix IE hover problem by setting an explicit width on first item of
- // the menu.
-
- if (browser.isIE) {
- w =3D itemList[0].offsetWidth;
- itemList[0].style.width =3D w + "px";
- dw =3D itemList[0].offsetWidth - w;
- w -=3D dw;
- itemList[0].style.width =3D w + "px";
- }
+ var itemList, spanList;
+ var textEl, arrowEl;
+ var itemWidth;
+ var w, dw;
+ var i, j;
+
+ // For IE, replace arrow characters.
+
+ if (browser.isIE) {
+ menu.style.lineHeight =3D "2.5ex";
+ spanList =3D menu.getElementsByTagName("SPAN");
+ for (i =3D 0; i < spanList.length; i++)
+ if (hasClassName(spanList[i], "menuItemArrow")) {
+ spanList[i].style.fontFamily =3D "Webdings";
+ spanList[i].firstChild.nodeValue =3D "4";
+ }
+ }
+
+ // Find the width of a menu item.
+
+ itemList =3D menu.getElementsByTagName("A");
+ if (itemList.length > 0)
+ itemWidth =3D itemList[0].offsetWidth;
+ else
+ return;
+
+ // For items with arrows, add padding to item text to make the
+ // arrows flush right.
+
+ for (i =3D 0; i < itemList.length; i++) {
+ spanList =3D itemList[i].getElementsByTagName("SPAN");
+ textEl =3D null;
+ arrowEl =3D null;
+ for (j =3D 0; j < spanList.length; j++) {
+ if (hasClassName(spanList[j], "menuItemText"))
+ textEl =3D spanList[j];
+ if (hasClassName(spanList[j], "menuItemArrow"))
+ arrowEl =3D spanList[j];
+ }
+ if (textEl !=3D null && arrowEl !=3D null)
+ textEl.style.paddingRight =3D (itemWidth
+ - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+ }
+
+ // Fix IE hover problem by setting an explicit width on first item of
+ // the menu.
+
+ if (browser.isIE) {
+ w =3D itemList[0].offsetWidth;
+ itemList[0].style.width =3D w + "px";
+ dw =3D itemList[0].offsetWidth - w;
+ w -=3D dw;
+ itemList[0].style.width =3D w + "px";
+ }
=
- // Mark menu as initialized.
+ // Mark menu as initialized.
=
- menu.isInitialized =3D true;
+ menu.isInitialized =3D true;
}
=
//------------------------------------------------------------------------=
----
@@ -363,247 +364,247 @@
=
function getContainerWith(node, tagName, className) {
=
- // Starting with the given node, find the nearest containing element
- // with the specified tag name and style class.
+ // Starting with the given node, find the nearest containing element
+ // with the specified tag name and style class.
=
- while (node !=3D null) {
- if (node.tagName !=3D null && node.tagName =3D=3D tagName &&
- hasClassName(node, className))
- return node;
- node =3D node.parentNode;
- }
+ while (node !=3D null) {
+ if (node.tagName !=3D null && node.tagName =3D=3D tagName &&
+ hasClassName(node, className))
+ return node;
+ node =3D node.parentNode;
+ }
=
- return node;
+ return node;
}
=
function hasClassName(el, name) {
=
- var i, list;
+ var i, list;
=
- // Return true if the given element currently has the given class
- // name.
+ // Return true if the given element currently has the given class
+ // name.
=
- list =3D el.className.split(" ");
- for (i =3D 0; i < list.length; i++)
- if (list[i] =3D=3D name)
- return true;
+ list =3D el.className.split(" ");
+ for (i =3D 0; i < list.length; i++)
+ if (list[i] =3D=3D name)
+ return true;
=
- return false;
+ return false;
}
=
function removeClassName(el, name) {
=
- var i, curList, newList;
+ var i, curList, newList;
=
- if (el.className =3D=3D null)
- return;
+ if (el.className =3D=3D null)
+ return;
=
- // Remove the given class name from the element's className property.
+ // Remove the given class name from the element's className property.
=
- newList =3D new Array();
- curList =3D el.className.split(" ");
- for (i =3D 0; i < curList.length; i++)
- if (curList[i] !=3D name) {
- // Workaround to replace the push method.
- var _curList =3D new Array(curList[i]);
- newList.concat(_curList);
- // Comment this line because not supported by IE5.0
- //newList.push(curList[i]);
- }
- el.className =3D newList.join(" ");
+ newList =3D new Array();
+ curList =3D el.className.split(" ");
+ for (i =3D 0; i < curList.length; i++)
+ if (curList[i] !=3D name) {
+ // Workaround to replace the push method.
+ var _curList =3D new Array(curList[i]);
+ newList.concat(_curList);
+ // Comment this line because not supported by IE5.0
+ //newList.push(curList[i]);
+ }
+ el.className =3D newList.join(" ");
}
=
function getPageOffsetLeft(el) {
=
- var x;
+ var x;
=
- // Return the x coordinate of an element relative to the page.
+ // Return the x coordinate of an element relative to the page.
=
- x =3D el.offsetLeft;
- if (el.offsetParent !=3D null)
- x +=3D getPageOffsetLeft(el.offsetParent);
+ x =3D el.offsetLeft;
+ if (el.offsetParent !=3D null)
+ x +=3D getPageOffsetLeft(el.offsetParent);
=
- return x;
+ return x;
}
=
function getPageOffsetTop(el) {
=
- var y;
+ var y;
=
- // Return the x coordinate of an element relative to the page.
+ // Return the x coordinate of an element relative to the page.
=
- y =3D el.offsetTop;
- if (el.offsetParent !=3D null)
- y +=3D getPageOffsetTop(el.offsetParent);
+ y =3D el.offsetTop;
+ if (el.offsetParent !=3D null)
+ y +=3D getPageOffsetTop(el.offsetParent);
=
- return y;
+ return y;
}
=
// Check the browser for DOM manipulation
-function checkBrowser(){
- this.ver=3Dnavigator.appVersion;
- this.dom=3Ddocument.getElementById?1:0;
- this.ie6=3D(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
- this.ie55=3D((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) &&
this.dom)?1=
:0;
- this.ie5=3D((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) &&
th=
is.dom)?1:0;
- this.ie4=3D(document.all && !this.dom)?1:0;
- this.ns5=3D(this.dom && parseInt(this.ver) >=3D 5) ?1:0;
- this.ns4=3D(document.layers && !this.dom)?1:0;
- this.ie4plus=3D(this.ie6 || this.ie5 || this.ie4);
- this.ie5plus=3D(this.ie6 || this.ie5)
- this.bw=3D(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
- return this;
+function checkBrowser() {
+ this.ver =3D navigator.appVersion;
+ this.dom =3D document.getElementById?1:0;
+ this.ie6 =3D (this.ver.indexOf("MSIE 6") > -1 && this.dom)?1:0;
+ this.ie55 =3D ((this.ver.indexOf("MSIE 5.5") > -1 || this.ie6) && this=
.dom)?1:0;
+ this.ie5 =3D ((this.ver.indexOf("MSIE 5") > -1 || this.ie5 || this.ie6=
) && this.dom)?1:0;
+ this.ie4 =3D (document.all && !this.dom)?1:0;
+ this.ns5 =3D (this.dom && parseInt(this.ver) >=3D 5) ?1:0;
+ this.ns4 =3D (document.layers && !this.dom)?1:0;
+ this.ie4plus =3D (this.ie6 || this.ie5 || this.ie4);
+ this.ie5plus =3D (this.ie6 || this.ie5)
+ this.bw =3D (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
+ return this;
}
=
bw =3D new checkBrowser();
=
// Get an Object contained in a DOM document by its ID attribute
-function getObjectById (ID) {
- var obj;
- if (bw.dom)
- return document.getElementById (ID);
- else if (bw.ie4)
- return document.all (ID);
- else
- alert ("Error: Your browser version is not supported. Please
upgrade..."=
);
+function getObjectById(ID) {
+ var obj;
+ if (bw.dom)
+ return document.getElementById(ID);
+ else if (bw.ie4)
+ return document.all(ID);
+ else
+ alert("Error: Your browser version is not supported. Please upgrad=
e...");
return null;
}
=
// Returns an array of values. The delimiter is the ',' character
-function getNodeValues (content, nodeName) {
- var tag =3D "<" + nodeName + ">";
- var start =3D content.indexOf (tag);
- var end =3D content.indexOf ("</" + nodeName + ">");
-
- if (start < end) {
- var values =3D content.substring (start + tag.length, end);
- return values.split (";;");
- } else {
- return new Array (0);
- }
+function getNodeValues(content, nodeName) {
+ var tag =3D "<" + nodeName + ">";
+ var start =3D content.indexOf(tag);
+ var end =3D content.indexOf("</" + nodeName + ">");
+
+ if (start < end) {
+ var values =3D content.substring(start + tag.length, end);
+ return values.split(";;");
+ } else {
+ return new Array (0);
+ }
}
=
// Returns the value of an XML tag
-function getNodeValue (content, nodeName) {
- var tag =3D "<" + nodeName + ">";
- var start =3D content.indexOf (tag);
- var end =3D content.indexOf ("</" + nodeName + ">");
-
- if (start < end) {
- return content.substring (start + tag.length, end);
- } else {
- return null;
- }
+function getNodeValue(content, nodeName) {
+ var tag =3D "<" + nodeName + ">";
+ var start =3D content.indexOf(tag);
+ var end =3D content.indexOf("</" + nodeName + ">");
+
+ if (start < end) {
+ return content.substring(start + tag.length, end);
+ } else {
+ return null;
+ }
}
=
// AJAX based function to get all Actions to fill up the Action menu
-function getActionMenu(context, objectType, objectKey, definitionID, paren=
tID, pageID, domID, lang) {
+function getActionMenu(context, objectType, objectKey, definitionID, paren=
tID, pageID, domID) {
document.body.style.cursor =3D "wait";
try {
// correct values are "POST" or "GET" (HTTP methods).
var method =3D "POST" ;
var data =3D "key=3D" + objectKey + "&type=3D" + objectType +
"&def=3D" + definitionID + "&parent=3D" + parentID + "&=
domid=3D" + domID +
- "¶ms=3D/op/edit/lang/" + lang + "/pid/" + pageID;
+ "¶ms=3D/op/edit/pid/" + pageID;
=
var url =3D context + "/ajaxaction/GetMenuItems";
=
- if (method =3D=3D "GET") {
- url +=3D "?" + data;
- data =3D null;
- }
-
- // Create new XMLHttpRequest request
- if (window.XMLHttpRequest) {
- req =3D new XMLHttpRequest ();
-
- } else if (window.ActiveXObject) {
- req =3D new ActiveXObject ("Microsoft.XMLHTTP");
-
- } else {
- alert ("Error: Your Browser does not support
XMLHTTPRequests, please up=
grade...");
- return;
- }
-
- req.open (method, url, true);
-
- req.onreadystatechange =3D function () {
- buildActionMenu();
- }
-
- if (method =3D=3D "POST") {
- req.setRequestHeader ("Content-type",
"application/x-www-form-urlencode=
d");
- }
- req.send (data);
-
- } catch (e) {
- alert ("Exception sending the Request: " + e);
- }
+ if (method =3D=3D "GET") {
+ url +=3D "?" + data;
+ data =3D null;
+ }
+
+ // Create new XMLHttpRequest request
+ if (window.XMLHttpRequest) {
+ req =3D new XMLHttpRequest ();
+
+ } else if (window.ActiveXObject) {
+ req =3D new ActiveXObject ("Microsoft.XMLHTTP");
+
+ } else {
+ alert("Error: Your Browser does not support XMLHTTPRequests, p=
lease upgrade...");
+ return;
+ }
+
+ req.open(method, url, true);
+
+ req.onreadystatechange =3D function () {
+ buildActionMenu();
+ }
+
+ if (method =3D=3D "POST") {
+ req.setRequestHeader("Content-type", "application/x-www-form-u=
rlencoded");
+ }
+ req.send(data);
+
+ } catch (e) {
+ alert("Exception sending the Request: " + e);
+ }
}
=
// Build the Action Menu
-function buildActionMenu () {
- var readyState =3D req.readyState;
- if (req.readyState =3D=3D 4) {
- // alert ("resp: " + req.responseText);
- if (req.status =3D=3D 200) {
- try {
- var response =3D req.responseText;
+function buildActionMenu() {
+ var readyState =3D req.readyState;
+ if (req.readyState =3D=3D 4) {
+ // alert ("resp: " + req.responseText);
+ if (req.status =3D=3D 200) {
+ try {
+ var response =3D req.responseText;
var uniqueID =3D getNodeValue(response, "domid");
=
- var methods =3D getNodeValues (response,
"method");
- var launchers =3D getNodeValues (response,
"launcher");
- var images =3D getNodeValues (response,
"image");
+ var methods =3D getNodeValues(response, "method");
+ var launchers =3D getNodeValues(response, "launcher");
+ var images =3D getNodeValues(response, "image");
=
- var fieldset =3D getNodeValue (response,
"fieldset");
- updateFieldSet (uniqueID, fieldset);
+ var fieldset =3D getNodeValue(response, "fieldset");
+ updateFieldSet(uniqueID, fieldset);
=
- addActions (uniqueID, methods, launchers,
images);
+ addActions(uniqueID, methods, launchers, images);
=
// changeURL(uniqueID);
=
- buttonClick (uniqueID);
+ buttonClick(uniqueID);
=
- } catch (e) {
- alert ("Exception building Action Menu: " + e);
- }
-
- } else {
- alert ("There was a problem processing the request.
Status: " +
- req.status + ", msg: " +
req.statusText);
- }
- document.body.style.cursor =3D "default";
- }
+ } catch (e) {
+ alert("Exception building Action Menu: " + e);
+ }
+
+ } else {
+ alert("There was a problem processing the request. Status: " +
+ req.status + ", msg: " + req.statusText);
+ }
+ document.body.style.cursor =3D "default";
+ }
}
=
// Changes the default grey border. Use in case the object is locked for e=
xample
-function updateFieldSet (id, param) {
- // alert ("Updating fieldSet for " + id + ", param =3D " + param);
+function updateFieldSet(id, param) {
+ // alert ("Updating fieldSet for " + id + ", param =3D " + param);
if (param =3D=3D null) {
return;
}
=
- var setID =3D "fieldset_" + id;
- var setElem =3D getObjectById (setID);
+ var setID =3D "fieldset_" + id;
+ var setElem =3D getObjectById(setID);
=
- var content;
- if (param =3D=3D "complete") {
- content =3D "completeLocked";
+ var content;
+ if (param =3D=3D "complete") {
+ content =3D "completeLocked";
=
- } else if (param =3D=3D "partial") {
- content =3D "partialLocked";
+ } else if (param =3D=3D "partial") {
+ content =3D "partialLocked";
=
- } else {
- content =3D "unlocked";
- }
+ } else {
+ return;
+ }
=
- setElem.className =3D content;
+ setElem.className =3D content;
}
=
// Changes the href value of the given element
-function changeURL (id) {
- var button =3D getObjectById ("button_" + id);
- button.href =3D "javascript:buttonClick('" + id + "');";
+function changeURL(id) {
+ var button =3D getObjectById("button_" + id);
+ button.href =3D "javascript:buttonClick('" + id + "');";
}
=
// Adds the Actions to the action menu
@@ -632,59 +633,59 @@
}
=
// Returns a String for the Action Launcher URI
-function printLauncher (launcher) {
- return " <a class=3D\"menuItem\" href=3D\"javascript:" + launcher +
"\"=
>\n";
+function printLauncher(launcher) {
+ return " <a class=3D\"menuItem\" href=3D\"javascript:" + launcher + =
"\">\n";
}
=
// Returns a String for the Action Image
-function printImage (imageName) {
- return " <img src=3D\"" + imageName + "\" alt=3D\"\"
border=3D\"0\" =
/> ";
+function printImage(imageName) {
+ return " <img src=3D\"" + imageName + "\" alt=3D\"\" border=3D\"0=
\" /> ";
}
=
// Returns a String for the Action method name
-function printMethod (methodName) {
- return methodName + "\n </a>\n";
+function printMethod(methodName) {
+ return methodName + "\n </a>\n";
}
=
-function clipboard (context, objectKey, op, pageID) {
+function clipboard(context, objectKey, op, pageID) {
document.body.style.cursor =3D "wait";
try {
// correct values are "POST" or "GET" (HTTP methods).
var method =3D "POST" ;
var data =3D "key=3D" + objectKey + "&cop=3D" + op;
- var url =3D jahiaMainServletPath + "/op/edit/engineName/clipboard/=
pid/" + pageID ;
+ var url =3D context + "/Jahia/op/edit/engineName/clipboard/pid/" +=
pageID ;
=
- if (method =3D=3D "GET") {
- url +=3D "?" + data;
- data =3D null;
- }
+ if (method =3D=3D "GET") {
+ url +=3D "?" + data;
+ data =3D null;
+ }
=
- // Create new XMLHttpRequest request
- if (window.XMLHttpRequest) {
- req =3D new XMLHttpRequest ();
+ // Create new XMLHttpRequest request
+ if (window.XMLHttpRequest) {
+ req =3D new XMLHttpRequest ();
=
- } else if (window.ActiveXObject) {
- req =3D new ActiveXObject ("Microsoft.XMLHTTP");
+ } else if (window.ActiveXObject) {
+ req =3D new ActiveXObject ("Microsoft.XMLHTTP");
=
- } else {
- alert ("Error: Your Browser does not support
XMLHTTPRequests, please up=
grade...");
- return;
- }
+ } else {
+ alert("Error: Your Browser does not support XMLHTTPRequests, p=
lease upgrade...");
+ return;
+ }
=
- req.open (method, url, true);
+ req.open(method, url, true);
=
- if (op =3D=3D "paste") {
- req.onreadystatechange =3D function () {
+ if (op =3D=3D "paste") {
+ req.onreadystatechange =3D function () {
if (req.readyState =3D=3D 4) {
document.body.style.cursor =3D "default";
window.location.reload();
}
- }
- } else {
- req.onreadystatechange =3D function () {
+ }
+ } else {
+ req.onreadystatechange =3D function () {
if (req.readyState =3D=3D 4) {
//copy
- myurl =3D "http://" + document.location.host + context=
+ "/jsp/jahia/engines/images/clipboard_next.png";
+ myurl =3D "http://" + document.location.host + "/jahia=
/jsp/jahia/engines/images/clipboard_next.png";
myclip =3D document.getElementById('clipboard');
myclip.src =3D myurl;
myclip.alt =3D "clipboard:" + objectKey;
@@ -692,15 +693,15 @@
document.body.style.cursor =3D "default";
}
}
- }
+ }
=
- if (method =3D=3D "POST") {
- req.setRequestHeader ("Content-type",
"application/x-www-form-urlencode=
d");
- }
- req.send (data);
- } catch (e) {
- alert ("Exception sending the Request: " + e);
- }
+ if (method =3D=3D "POST") {
+ req.setRequestHeader("Content-type", "application/x-www-form-u=
rlencoded");
+ }
+ req.send(data);
+ } catch (e) {
+ alert("Exception sending the Request: " + e);
+ }
}
=
function getWorkflowState(context, key, pid) {
@@ -767,18 +768,3 @@
}
}
}
-
-function readCookie(name) {
- var nameEQ =3D name + "=3D";
- var ca =3D document.cookie.split(';');
- for(var i=3D0;i < ca.length;i++)
- {
- var c =3D ca[i];
- while (c.charAt(0)=3D=3D' ') c =3D c.substring(1,c.length);
- if (c.indexOf(nameEQ) =3D=3D 0) return c.substring(nameEQ.leng=
th,c.length);
- }
- //alert('A cookie was not set. '+name+'. Please ensure that your b=
rowser accepts cookies.');
- return "Username";
- }
-
-
Modified: trunk/src/jsp/declarations_api.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/jsp/declara=
tions_api.inc&rev=3D11&repname=3Dsimple_templates
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/declarations_api.inc (original)
+++ trunk/src/jsp/declarations_api.inc Tue Nov 6 15:41:03 2007
@@ -1,5 +1,6 @@
<%@ page import=3D"java.lang.*"%>
<%@ page import=3D"java.util.*" %>
+<%@ page import=3D"org.jahia.bin.*" %>
<%@ page import=3D"org.jahia.content.*" %>
<%@ page import=3D"org.jahia.data.*" %>
<%@ page import=3D"org.jahia.data.beans.*" %>
@@ -26,7 +27,8 @@
String contextURL =3D jData.gui().drawHttpJspContext(request);
%>
<script type=3D"text/javascript" src=3D"<%=3DjParams.settings().getJsHttpP=
ath()%>"></script>
-<link rel=3D"stylesheet" href=3D"<%=3DcontextURL%>/web.css" type=3D"text/c=
ss"/>
+<link rel=3D"stylesheet" href=3D"<%=3DJahia.getContextPath()%>/jsp/jahia/c=
ss/core_css.jsp" type=3D"text/css"></link>
+<link rel=3D"stylesheet" href=3D"<%=3DcontextURL%>/css/web.css" type=3D"te=
xt/css"/>
<%
if (jData.gui().isEditMode()) {
%>
Added: trunk/src/jsp/template_api.jsp
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/src/jsp/=
template_api.jsp&rev=3D11&repname=3Dsimple_templates
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/jsp/template_api.jsp (added)
+++ trunk/src/jsp/template_api.jsp Tue Nov 6 15:41:03 2007
@@ -0,0 +1,39 @@
+<%@ page language=3D"java" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 =
Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns=3D"http://www.w3.org/1999/xhtml">
+<head>
+ <%@ include file=3D"declarations_api.inc"%>
+ <title><%=3DcurrentPage.getTitle()%></title>
+ <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-=
8" />
+</head>
+<body>
+<%
+if (jData.gui().isLogged()) {
+ %>
+ <jsp:include page=3D"/jsp/jahia/topbar/topmenu.jsp" flush=3D"true"/>
+ <jsp:include page=3D"/jsp/jahia/topbar/operationbuttons.jsp" flush=3D"=
true"/>
+ <%
+}
+%>
+<div id=3D"pagebody">
+<p>
+ <a href=3D"<%=3DjParams.composeSiteUrl()%>"><img src=3D"<%=3DcontextUR=
L%>/img/logo.gif"
+ alt=3D"Home" width=3D"150" height=3D"40" border=3D"0" /></a>
+</p>
+<table width=3D"800" border=3D"0">
+<tr>
+ <td width=3D"150" class=3D"leftmenu">
+ <%@ include file=3D"leftmenu_api.inc"%>
+ </td>
+ <td width=3D"650" class=3D"maincell">
+ <%@ include file=3D"pagepath_api.inc"%>
+ <%@ include file=3D"pagetitle_api.inc"%>
+ <%@ include file=3D"maincontent_api.inc"%>
+ <%@ include file=3D"bottom_api.inc"%>
+ <%@ include file=3D"login_api.inc"%>
+ </td>
+</tr>
+</table>
+</div>
+</body>
+</html>
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list