// The path that points to files in the SVN repostory // var topPath = "http://127.0.0.1/////stage/site/"; // Where the files are inside the repository //var localPath = "stage/site/"; var LOCAL = false; var IS_DEBUG = false; var svnPath = "uploads/publish/jasperserverwebsite/"; var pubPath = "website/jasperserverwebsite/"; var page_params = "?header=project&target=jasperserver"; String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)} String.prototype.trim = function(){return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))} String.prototype.startsWith = function(str) {return (this.match("^"+str)==str)} function adaptHeight() { adaptHeight(null, document.body.scrollHeight); } function adaptHeight(the_w, the_h) { var debug_str = "Script version 10\n"; try { debug_str +="updating frame size..."; debug_str +="Mic: " + navigator.appName.indexOf("Microsoft") +"\n"; the_height = 0; the_width = 0; if (window.top.document.getElementsByTagName("iframe")[0] != null) { window.top.document.getElementsByTagName("iframe")[0].style.display="block"; //window.top.document.getElementsByTagName("iframe")[0].scrolling='auto'; // This force a correct refit of the iframe if the previous page was bigger window.top.document.getElementsByTagName("iframe")[0].height=10; window.top.document.getElementsByTagName("iframe")[0].height=10; if (navigator.appName.indexOf("Microsoft")==-1) { the_height = getDocHeight(); the_width = document.body.scrollWidth; } else { the_height = (typeof(the_h) !== 'undefined') ? the_h : getDocHeight(); the_width = (typeof(the_w) !== 'undefined') ? the_w : document.body.scrollWidth;; } debug_str +="[" + the_width + "," + the_height + "] "; if (window.top != null) { if (the_height > 0)window.top.document.getElementsByTagName("iframe")[0].height=the_height; if (the_width > 0) window.top.document.getElementsByTagName("iframe")[0].width=the_width; } } debug_str +="OK\n"; } catch (err) { debug_str +="ERROR: " + err.description + "\n"; } debug_str +="\n"; // replace all links.. try { debug_str +="Updating links....\n"; var loc = document.location; if (!LOCAL) { docAnchors = document.getElementsByTagName("a"); debug_str +="Links found: " + docAnchors.length + "\n"; for (i=0; i= 0) { oldLinkValue = docAnchors[i].href; docAnchors[i].href = docAnchors[i].href.replace(svnPath, pubPath)+ page_params; newLinkValue = docAnchors[i].href; debug_str +="Transformed from: " + oldLinkValue + "\nto: " + newLinkValue + "\n"; } else { //debug_str +="Not transformed: " + docAnchors[i].pathname + " " + docAnchors[i].pathname.endsWith("html") + " " + docAnchors[i].href.indexOf(svnPath) + "\n"; } if (docAnchors[i].target == "") docAnchors[i].target="_top"; } debug_str +="OK\n"; } } catch(err) { debug_str +="ERROR: " + err.description + "\n"; } // For pages having the fancybox... try { debug_str +="Starting fancybox..."; $("a.gallery").fancybox(); debug_str +="OK\n"; } catch(err) { debug_str +="ERROR: " + err.description + "\n"; } try { debug_str +="SyntaxHighlighter..."; if (typeof(SyntaxHighlighter) != 'undefined') { SyntaxHighlighter.config.clipboardSwf = 'scripts/syntaxhighlighter/scripts/clipboard.swf'; SyntaxHighlighter.all(); } debug_str +="OK\n"; } catch(err) { debug_str +="ERROR: " + err.description + "\n"; } // // Piwik // try { // //var pkBaseURL = (("https:" == document.location.protocol) ? "https://sourceforge.net/apps/piwik/jasperserver/" : "http://sourceforge.net/apps/piwik/jasperserver/"); // //document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); // document.append(unescape("%3Cscript src='piwik.js' type='text/javascript'%3E%3C/script%3E")); // piwik_action_name = ''; // piwik_idsite = 2; // piwik_url = pkBaseURL + "piwik.php"; // piwik_log(piwik_action_name, piwik_idsite, piwik_url); // document.append(""); // // End Piwik // } catch (err) // { // debug_str +="ERROR: " + err.description + "\n"; // } if (IS_DEBUG) alert(debug_str); } function getDocHeight() { var myDoc = window.document; // alert(myDoc); //alert(D + "\n" + D.body.scrollHeight + "," + D.documentElement.scrollHeight + "," + // D.body.offsetHeight + "," + D.documentElement.offsetHeight + "," + // D.body.clientHeight + "," + D.documentElement.clientHeight); return Math.max( Math.max(myDoc.body.scrollHeight, myDoc.documentElement.scrollHeight), Math.max(myDoc.body.offsetHeight, myDoc.documentElement.offsetHeight), Math.max(myDoc.body.clientHeight, myDoc.documentElement.clientHeight) ); } String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)} String.prototype.trim = function(){return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""))} String.prototype.startsWith = function(str) {return (this.match("^"+str)==str)} function isLogged() { // Look for a div having "Join now to" in the innerHtml... var divElements = window.top.document.getElementsByTagName("div"); for (i=0; i= 0) { return false; } } return true; } // include_dom function is from the Stoyan Stefanov blog at phpied.com function include_dom(script_filename) { var html_doc = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribute('language', 'javascript'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', script_filename); html_doc.appendChild(js); return false; } function downloadJasperServer(anc) { anc.target="_top"; if (!isLogged()) { Set_Cookie( 'jasperserver_redirect_to', anc.href, '', '/', '', '' ); if (Get_Cookie( 'jasperserver_redirect_to' )) { anc.href="http://jasperforge.org/plugins/esp_frs/optional_redirect.php?group_id=112"; // anc.href = "http://sourceforge.net/projects/jasperserver/files/JasperServer"; } } } function performRedirect() { console.log("performRedirect called"); if ( Get_Cookie( 'jasperserver_redirect_to' ) ) { console.log("redirect to %s", Get_Cookie( 'jasperserver_redirect_to' )); window.top.document.location=Get_Cookie( 'jasperserver_redirect_to' ); Delete_Cookie('jasperserver_redirect_to', '/', ''); } else { window.top.document.location='http://jasperforge.org/website/jasperserverwebsite/JSJA%20Website/js_download.html?header=project&target=jasperserver'; } } var TRange=null function findString (str) { var win = window.parent; if (parseInt(navigator.appVersion)<4) return; var strFound; if (win.find) { // CODE FOR BROWSERS THAT SUPPORT window.find strFound=win.find(str); /* if (strFound && win.getSelection && !win.getSelection().anchorNode) { strFound=win.find(str) } if (!strFound) { strFound=win.find(str,0,1) while (win.find(str,0,1)) continue } */ } else if (navigator.appName.indexOf("Microsoft")!=-1) { // EXPLORER-SPECIFIC CODE if (TRange!=null) { TRange.collapse(false) strFound=TRange.findText(str) if (strFound) TRange.select() } if (TRange==null || strFound==0) { TRange=win.document.body.createTextRange() strFound=TRange.findText(str) //if (strFound) return 0; } } else if (navigator.appName=="Opera") { //alert ("Opera browsers not supported, sorry...") return -1; } //if (!strFound) alert ("String '"+str+"' not found!") return -1; return 0; } var req; function printNews(url) { req = false; // branch for native XMLHttpRequest object if(window.XMLHttpRequest && !(window.ActiveXObject)) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } // branch for IE/Windows ActiveX version } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } if(req) { try { req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(null); } catch(err) { req = false; document.getElementById("projectnews").innerHTML = ""+ err.description + "

"; } } } function processReqChange() { // only if req shows "loaded" if (req.readyState == 4) { // only if "OK" if (req.status == 200) { // ...processing statements go here... var msg = ""; var items = req.responseXML.getElementsByTagName("item"); // show only 2 for (i=0; i< items.length && i < 2; i++) { item_title = items[i].getElementsByTagName("title")[0].firstChild.nodeValue; item_link = items[i].getElementsByTagName("link")[0].firstChild.nodeValue; item_date = new Date(items[i].getElementsByTagName("pubDate")[0].firstChild.nodeValue); if (item_title.length > 3 && item_title.substr(item_title.length-3,item_title.length)=="(0)") { item_title = item_title.trim(); item_title = item_title.substr(0, item_title.length - 3); } var curr_date = monthNames[item_date.getMonth()] + " " + item_date.getDate() + ", " + item_date.getFullYear(); var cellName = "js_news_cell"; if (i==2) cellName = "js_news_cell2"; msg += ""; } msg += "
" + item_title + "
" + curr_date + "
"; document.getElementById("projectnews").innerHTML = msg; } else { //alert("There was a problem retrieving the XML data:\n" + req.statusText); document.getElementById("projectnews").innerHTML = "Unable to parse the RSS.

"; } } } var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; function Set_Cookie( name, value, expires, path, domain, secure ) { // set time, it's in milliseconds var today = new Date(); today.setTime( today.getTime() ); /* if the expires variable is set, make the correct expires time, the current script below will set it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24 */ if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } // this fixes an issue with the old method, ambiguous values // with this test document.cookie.indexOf( name + "=" ); function Get_Cookie( check_name ) { // first we'll split this cookie up into name/value pairs // note: document.cookie only returns name=value, not the other components var a_all_cookies = document.cookie.split( ';' ); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; // set boolean t/f default f for ( i = 0; i < a_all_cookies.length; i++ ) { // now we'll split apart each name=value pair a_temp_cookie = a_all_cookies[i].split( '=' ); // and trim left/right whitespace while we're at it cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); // if the extracted name matches passed check_name if ( cookie_name == check_name ) { b_cookie_found = true; // we need to handle case where cookie has no value but exists (no = sign, that is): if ( a_temp_cookie.length > 1 ) { cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ); } // note that in cases where cookie is initialized but no value, null is returned return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if ( !b_cookie_found ) { return null; } } // this deletes the cookie when called function Delete_Cookie( name, path, domain ) { if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; }