From: rkv Date: Tue, 23 Oct 2012 09:00:49 +0000 (+0000) Subject: Moved to js subfolder. X-Git-Tag: Root_Delivery1_2012_12_06~127 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cf96370eb347b5835d726c0752ce42c7a61287a5;p=tools%2Fsiman.git Moved to js subfolder. --- diff --git a/Workspace/Siman/WebContent/jvs/action.js b/Workspace/Siman/WebContent/jvs/action.js deleted file mode 100644 index 9c55f43..0000000 --- a/Workspace/Siman/WebContent/jvs/action.js +++ /dev/null @@ -1,30 +0,0 @@ - function executeConfirmedAction (action, message) { -// ------------------------------------------------- - if (confirm(message)) executeAction(action); - else ContextHide(); - } - - function executeAction (action) { -// ------------------------------- - ContextHide(); - var open = action.indexOf("("); - if (open > 0 && action.charAt(action.length-1) == ")") { // Function call - -// Client side execution via the "perform" Applet - var method = action.substring(0, open); // Better trim the result - var args = action.substring(open+1, action.length-1).split(","); // Better trim each argument - if (method == "launch") { -// args[0] = executable name, args[1] = file name - if (args.length == 1) { -// alert("Executing " + args[0]); - document.perform.launch(args[0], null); - } else if (args.length >= 2) { -// alert("Executing " + args[0] + " with " + args[1]); - document.perform.launch(args[0], args[1]); - } - } - } else { -// Server side execution via a Struts action - window.location = action.replace("&", "&"); // Due to string conversion in menupopup JSP - } - } \ No newline at end of file diff --git a/Workspace/Siman/WebContent/jvs/popup.js b/Workspace/Siman/WebContent/jvs/popup.js deleted file mode 100644 index b36fda3..0000000 --- a/Workspace/Siman/WebContent/jvs/popup.js +++ /dev/null @@ -1,108 +0,0 @@ -// -// Displays and hide pop-up menus. -// Pop-ups are displayed when left-clicking on an edition icon of a link. -// The HTML corresponding tags are supposed being the following: -// -// -// -// Any other HTML construct will be ignored. -// -// Pop-ups can be used on a web page including java applets. -// If a pop-up hides an applet, this latter must be hidden when displaying the pop-up - as a limitation, -// the applet is supposed entirely hidden by the pop-up. -// By convention: -// - such pop-up must be named "toolpop" (
...), -// - the applet must be named "perform" (). - - var _iconName = "icon.ed"; - var _appletName = "perform"; - var _hiddingPopup = "toolpop"; - - var _replaceContext = false; // replace the system context menu - var _mouseOverContext = false; // is the mouse over the context menu - var _divContext = null; - var _appletContext = null; // Applet hidden by the popup - - InitContext(); - - function InitContext() { -// ---------------------- - document.onmousedown = ContextMouseDown; - document.onclick = ContextShow; - } - -// Call from the onMouseDown event, passing the event if standards compliant - function ContextMouseDown(event) { -// -------------------------------- - if (_mouseOverContext) return; - - var leftbutton = 0; - - // IE is evil and doesn't pass the event object - if (event == null) { - event = window.event; - leftbutton = 1; - } - // We assume we have a standards compliant browser, but check if we have IE - var target = event.target != null ? event.target : event.srcElement; - - // Only show the context menu if the right mouse button is pressed - // and a hyperlink on an edit icon has been clicked - if (_divContext != null) ContextHide(); // In case of another context menu previously shown - if (target.tagName.toLowerCase() == 'img') { - if (target.src.indexOf(_iconName) < 0) return; - target = target.parentNode; - } - if (event.button == leftbutton && target.tagName.toLowerCase() == 'a') { - _replaceContext = true; - if (target.getAttribute("href") == _hiddingPopup) _appletContext = document.getElementById(_appletName); - } - } - - function ContextHide() { -// ----------------------- - _divContext.style.display = 'none'; - if (_appletContext != null) { - _appletContext.style.display = 'inline'; - _appletContext = null; - } - } - -// Call from the onContextMenu event, passing the event -// If this function returns false, the browser's context menu will not show up - function ContextShow(event) { -// --------------------------- - if (_mouseOverContext) return true; - - // IE is evil and doesn't pass the event object - if (event == null) event = window.event; - - // we assume we have a standards compliant browser, but check if we have IE - var target = event.target != null ? event.target : event.srcElement; - target = target.parentNode; // Gets the hyperlink - if (_replaceContext) { - _divContext = $(target.attributes[0].nodeValue); // Popup involved (made of document index prefixed by "popup") - - // document.body.scrollTop does not work in IE - var scrollTop = document.scrollTop ? document.scrollTop : document.documentElement.scrollTop; - var scrollLeft = document.scrollLeft ? document.scrollLeft : document.documentElement.scrollLeft; - - // hide the menu first to avoid an "up-then-over" visual effect - _divContext.style.display = 'none'; - _divContext.style.left = event.clientX + scrollLeft + 'px'; - _divContext.style.top = event.clientY + scrollTop + 'px'; - _divContext.style.display = 'block'; - - _replaceContext = false; - if (_appletContext != null) _appletContext.style.display = 'none'; - - return false; - } - return true; - } - -// For making easier on the eyes and fingers - function $(id) { -// -------------- - return document.getElementById(id); - } \ No newline at end of file diff --git a/Workspace/Siman/WebContent/jvs/search.js b/Workspace/Siman/WebContent/jvs/search.js deleted file mode 100644 index 91956e1..0000000 --- a/Workspace/Siman/WebContent/jvs/search.js +++ /dev/null @@ -1,47 +0,0 @@ - function initialize (result) { -// ---------------------------- - var state = search.state.value; - - if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") { - search.visibility[0].checked = true; - search.visibility[1].disabled = true; - search.visibility[2].disabled = true; - } - if (result == "obsolete") changeFilter(); // Hides the result section and enables the Search button - } - - function setState () { -// -------------------- - var state = search.state.value; - - if (state == "inWORK" || state == "inDRAFT" || state == "inCHECK") { - search.visibility[0].checked = true; - search.visibility[1].disabled = true; - search.visibility[2].disabled = true; - } else if (search.visibility[1].value != "onlypublic") { - search.visibility[1].disabled = false; - search.visibility[2].disabled = false; - } - changeFilter(); - } - - function changeFilter () { -// ------------------------ - var result = document.getElementById("resulist"); - - search.elements[0].value = "0"; // Marks the result obsolete - result.style.display = "none"; // Hides the result section - search.refresh.disabled = false; // Enables the Search button - } - - function removeContext (index) { -// ------------------------------ - search.elements[0].value = index; - search.submit(); - } - - function cancel () { -// ------------------ - search.elements[0].value = "-1"; - search.submit(); - } \ No newline at end of file