From: <sk...@us...> - 2008-08-21 08:20:06
|
Revision: 1116 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1116&view=rev Author: sknappe Date: 2008-08-21 08:19:58 +0000 (Thu, 21 Aug 2008) Log Message: ----------- REST now also works with URLs like: http://localhost/dbpedia-navigator/searchInstances/CitiesInSaxony?positives=[http://dbpedia.org/resource/Leipzig] You can generate an URL via a button at the bottom Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/ajax_get_class.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php trunk/src/dbpedia-navigator/ajax_search.php trunk/src/dbpedia-navigator/index.php trunk/src/dbpedia-navigator/js/ajax.js Added Paths: ----------- trunk/src/dbpedia-navigator/ajax_generate_URL.php trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php trunk/src/dbpedia-navigator/css/ trunk/src/dbpedia-navigator/css/default.css Removed Paths: ------------- trunk/src/dbpedia-navigator/default.css Added: trunk/src/dbpedia-navigator/ajax_generate_URL.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_generate_URL.php (rev 0) +++ trunk/src/dbpedia-navigator/ajax_generate_URL.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -0,0 +1,29 @@ +<?php + session_start(); + $positives=$_SESSION['positive']; + $negatives=$_SESSION['negative']; + + $pos=""; + $i=1; + if (isset($_SESSION['positive'])) foreach ($positives as $key=>$value){ + if ($i<count($positives)) $pos.=$key.']['; + else $pos.=$key; + $i++; + } + if (strlen($pos)>0) $pos='positives=['.$pos.']'; + $neg=""; + $i=1; + if (isset($_SESSION['negative'])) foreach ($negatives as $key=>$value){ + if ($i<count($negatives)) $neg.=$key.']['; + else $neg.=$key; + $i++; + } + if (strlen($neg)>0) $neg='negatives=['.$neg.']'; + + if (strlen($pos)>0||strlen($neg)>0) $interests='?'.$pos.$neg; + else $interests=""; + + $url='http://'.$_SERVER['HTTP_HOST'].'/dbpedia-navigator/'.$_SESSION['lastAction'].$interests; + + print $url.'<br/><br/>'; +?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -9,6 +9,11 @@ if (isset($_SESSION['articles'])) $articles=$_SESSION['articles']; $id=$_SESSION['id']; $ksID=$_SESSION['ksID']; + + //write last action into session + if (strpos($subject,"http://dbpedia.org/resource/")===0) $actionuri=substr (strrchr ($subject, "/"), 1); + else $actionuri=urlencode($subject); + $_SESSION['lastAction']='showArticle/'.$actionuri; session_write_close(); setRunning($id,"true"); Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -6,6 +6,9 @@ session_start(); if (isset($_SESSION['classes'])) $classes=$_SESSION['classes']; + //write last action into session + $actionuri=substr (strrchr ($class, "/"), 1); + $_SESSION['lastAction']='showClass/'.$actionuri; session_write_close(); Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -3,7 +3,13 @@ $category=$_POST['category']; $number=$_POST['number']; - + + session_start(); + //write last action into session + $actionuri=substr (strrchr ($category, "/"), 1); + $_SESSION['lastAction']='searchInstances/'.$actionuri; + session_write_close(); + //initialise content $content=""; $bestsearches=""; Modified: trunk/src/dbpedia-navigator/ajax_search.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_search.php 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/ajax_search.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -1,9 +1,14 @@ <?php include('helper_functions.php'); - $label=$_POST['label']; + $label=urldecode($_POST['label']); $number=$_POST['number']; - + + session_start(); + //write last action into session + $_SESSION['lastAction']='search/'.urlencode($label); + session_write_close(); + //initialise content $content=""; Added: trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php (rev 0) +++ trunk/src/dbpedia-navigator/ajax_set_positives_and_negatives.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -0,0 +1,42 @@ +<?php + include('helper_functions.php'); + + $positives=$_POST['positives']; + $negatives=$_POST['negatives']; + + if (strlen($positives)>0) $positives=explode('][',substr($positives,1,strlen($positives)-2)); + else $positives=array(); + if (strlen($negatives)>0) $negatives=explode('][',substr($negatives,1,strlen($negatives)-2)); + else $negatives=array(); + + mysql_connect('localhost','navigator','dbpedia'); + mysql_select_db("navigator_db"); + + $ptemp=array(); + foreach ($positives as $pos){ + $query="SELECT label FROM rank WHERE name='$pos' LIMIT 1"; + $res=mysql_query($query); + $result=mysql_fetch_array($res); + $ptemp[$pos]=$result['label']; + } + + $ntemp=array(); + foreach ($negatives as $neg){ + $query="SELECT label FROM rank WHERE name='$neg' LIMIT 1"; + $res=mysql_query($query); + $result=mysql_fetch_array($res); + $ntemp[$neg]=$result['label']; + } + + session_start(); + + $_SESSION['positive']=$ptemp; + $_SESSION['negative']=$ntemp; + + //add Positives and Negatives to Interests + $interests=show_Interests($_SESSION); + + print $interests[0]; + print '$$'; + print $interests[1]; +?> \ No newline at end of file Copied: trunk/src/dbpedia-navigator/css/default.css (from rev 1115, trunk/src/dbpedia-navigator/default.css) =================================================================== --- trunk/src/dbpedia-navigator/css/default.css (rev 0) +++ trunk/src/dbpedia-navigator/css/default.css 2008-08-21 08:19:58 UTC (rev 1116) @@ -0,0 +1,384 @@ +/** + * Main DBpedia Navigator Style Sheet. + * + * @author: Norman Heino + * @author: Jens Lehmann + */ + +/* remove browser specific margins */ +* { + margin: 0; + padding: 0; +} + +html { + font: 85%/1.2 "Lucida Grande", Helvetica, Arial, sans-serif; +} + +p { + margin: 8px 0; +} + +h1 { + margin: 0.2em; +} + +h2 { + margin: 0.1em; +} + +/* + * Main site structure + */ + +#Loading { + color: #666; + font-size: 85%; +} + +#wrapper { + /*position: relative;*/ + max-width: 100%; + padding: 1%; +/* padding: 15px; */ +/* margin: 15px;*/ +} + +#content { + /*margin: 0 19em;*/ + overflow: hidden; + /*width: 10%;*/ + width: 60%; + float: left; + margin-left: 3px; + margin-right: 3px; +/* border-left: 1px solid #bbb; + border-right: 1px solid #bbb; + padding: 0 5px;*/ +} + +/* + * Side bars are positioned absolutely due to several reasons: + * (1)Internet Explorer has problems displaying float elements, + * (2) the content's position in html is irrelevant, + * (3) positioning the content div is more straightforward. + */ +#leftSidebar { + /* position: absolute; */ + width: 18%; + min-width: 150px; + float: left; +} + +#rightSidebar { + /* position: absolute; */ + /*float: right;*/ + width: 18%; + min-width: 150px; + float: left; + /*top: 15px; + right: 15px;*/ +} + +/* + * sidebar content (boxes) + */ + +.box { + color: #666; + margin-bottom: 20px; + border: 1px solid #bbb; + font-size: 85%; +} + +/*.box td { + font-size: 100%; +}*/ + +.box .boxtitle { + color: #666; + background-color: #eee; + padding: 3px 0.4em; + font-weight: bold; + white-space: nowrap; +} + +.box .boxtitle .boxtitle_string { + width: 80%; + overflow: hidden; +/* display: none;*/ +} + +.box .boxcontent { + padding: 0.6em; + border-top: 1px solid #bbb; +} + +/* restrict content of certain boxes */ +.box#predicates .boxcontent, +.box#classes .boxcontent { + overflow: hidden; +} + +.box p { + margin: 0 2px 4px 0; +} + +.box ul, .box ol { + margin: 0px; +/* padding-left: 15px;*/ + list-style-position: inside; +} + +.box ul.no_bullet, .box ul.no_bullet { + list-style-type: none; +} + +.box ul li.horizontal, .box ol li.horizontal, +.box ul.horizontal, .box ol.horizontal { + display: inline; +} + +.box a.title_switch { + position: absolute; + right: 0.5em; + margin: auto 0; + color: #666; + border: 1px solid #bbb; + width: 1em; + height: 1em; + background-color: #fff; + text-align: center; +} + +.box a.title_switch:hover { + color: #02a; + text-decoration: none; + background-color: #eee; +} + +.box hr { + margin: 0.5em 0; + border: none; + border-top: 1px dotted #bbb; + height: 0; +} + +.box#classes .boxcontent a { + display: block; +} + +.box input { + width: auto; +} + +.box td input { + width: 100%; +} + +.box img.rating { + position: relative; + top: 1px; +} + +.hidden { + display: none; +} + + +/* + * Links + */ + +a, a:link, a:visited { + color: #02a; + text-decoration: none; + /* cursor: pointer; */ +} + +a:hover { + text-decoration: underline; +} + + +/* + * Tabs + */ + +/* all the tabs */ +.tabs { + float: left; + width: 100%; + background: #fff url("../images/tabs_back.png") repeat-x bottom; +} + +.tabs ul { + list-style: none; +} + +.tabs li { + float: left; + margin-right: 1px; +} + +.tabs a { + display: block; + margin-top: 1px; + padding: 0.35em 1.35em; + background-image: url("../images/tab_back.png"); + background-repeat: repeat-x; + background-color: #cbcbcb; + border: 1px solid #bbb; +} + +.tabs a:hover { + background: #fff; + text-decoration: none; +} + +.tabs a.current { + background: #fff; + border-bottom: 1px solid #fff; +} + +/* horizontal line underneath the tabs */ +#tab-line { + height: 1em; + clear: both; +} + +#instances { + float: right; +} + +.selected { + background-color: #bde; /*#b4d5fe;*/ +} + +.button { + border: solid black 1px; + padding: 0px 1px; + background-color: #eee; +} + +img { + border: none; +} + +/* + * Layer + */ +#layer { + width: 100%; + height: 100%; + position: absolute; + background-image: url("../images/black_50.png"); + background-repeat: repeat; + z-index: 98; +} + +#layerContent { + margin-top: 100px; + margin: auto; + width: 500px; + height: 300px; + background-color: #ffb; + border: 2px solid #bbb; + z-index: 99; +} + +/* + * Buttons + */ +input.button { + border: 1px solid #bbb; + color: #666; + background-color: #eee; + padding: 3px 0.4em; + font-weight: bold; + white-space: nowrap; + font-size: 85%; +} + +input.button:hover { + border-left:1px solid #ffffff; + border-top:1px solid #ffffff; + border-right:1px solid #848484; + border-bottom:1px solid #848484; +} + +.titletable{ + width:100%; + color: #666; + background-color: #eee; + padding: 0.1em 0.4em; + font-weight: bold; + font-size: 100%; + white-space: nowrap; +} + +.titletable input.button{ + width:auto; +} + +.titletable td.left{ + text-align:left; +} + +.titletable td.right{ + text-align:right; +} + +.box .boxtitlewithbutton { + color: #666; + background-color: #eee; + padding: 0em 0.4em; + font-weight: bold; + white-space: nowrap; +} + +#search { + text-align:center; +} + +#label { + margin-bottom: 0.1em; +} + +#article { + min-height: 500px; +} + +#credits { + border: none; +} + +#positivesboxtitle { + /*color: black;*/ + background-color: lightgreen; +} + +#negativesboxtitle { + /*color: black;*/ + background-color: #ee6666; +} + +#ArticleTitle { + font-size: 150%; + color:black; +} + +#footer { + clear: both; + text-align: center; +} + +#todo { + padding: 15px; + margin: 10px; +} + +#redirectedFrom { + color: #666; + font-size: 85%; +} \ No newline at end of file Deleted: trunk/src/dbpedia-navigator/default.css =================================================================== --- trunk/src/dbpedia-navigator/default.css 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/default.css 2008-08-21 08:19:58 UTC (rev 1116) @@ -1,384 +0,0 @@ -/** - * Main DBpedia Navigator Style Sheet. - * - * @author: Norman Heino - * @author: Jens Lehmann - */ - -/* remove browser specific margins */ -* { - margin: 0; - padding: 0; -} - -html { - font: 85%/1.2 "Lucida Grande", Helvetica, Arial, sans-serif; -} - -p { - margin: 8px 0; -} - -h1 { - margin: 0.2em; -} - -h2 { - margin: 0.1em; -} - -/* - * Main site structure - */ - -#Loading { - color: #666; - font-size: 85%; -} - -#wrapper { - /*position: relative;*/ - max-width: 100%; - padding: 1%; -/* padding: 15px; */ -/* margin: 15px;*/ -} - -#content { - /*margin: 0 19em;*/ - overflow: hidden; - /*width: 10%;*/ - width: 60%; - float: left; - margin-left: 3px; - margin-right: 3px; -/* border-left: 1px solid #bbb; - border-right: 1px solid #bbb; - padding: 0 5px;*/ -} - -/* - * Side bars are positioned absolutely due to several reasons: - * (1)Internet Explorer has problems displaying float elements, - * (2) the content's position in html is irrelevant, - * (3) positioning the content div is more straightforward. - */ -#leftSidebar { - /* position: absolute; */ - width: 18%; - min-width: 150px; - float: left; -} - -#rightSidebar { - /* position: absolute; */ - /*float: right;*/ - width: 18%; - min-width: 150px; - float: left; - /*top: 15px; - right: 15px;*/ -} - -/* - * sidebar content (boxes) - */ - -.box { - color: #666; - margin-bottom: 20px; - border: 1px solid #bbb; - font-size: 85%; -} - -/*.box td { - font-size: 100%; -}*/ - -.box .boxtitle { - color: #666; - background-color: #eee; - padding: 3px 0.4em; - font-weight: bold; - white-space: nowrap; -} - -.box .boxtitle .boxtitle_string { - width: 80%; - overflow: hidden; -/* display: none;*/ -} - -.box .boxcontent { - padding: 0.6em; - border-top: 1px solid #bbb; -} - -/* restrict content of certain boxes */ -.box#predicates .boxcontent, -.box#classes .boxcontent { - overflow: hidden; -} - -.box p { - margin: 0 2px 4px 0; -} - -.box ul, .box ol { - margin: 0px; -/* padding-left: 15px;*/ - list-style-position: inside; -} - -.box ul.no_bullet, .box ul.no_bullet { - list-style-type: none; -} - -.box ul li.horizontal, .box ol li.horizontal, -.box ul.horizontal, .box ol.horizontal { - display: inline; -} - -.box a.title_switch { - position: absolute; - right: 0.5em; - margin: auto 0; - color: #666; - border: 1px solid #bbb; - width: 1em; - height: 1em; - background-color: #fff; - text-align: center; -} - -.box a.title_switch:hover { - color: #02a; - text-decoration: none; - background-color: #eee; -} - -.box hr { - margin: 0.5em 0; - border: none; - border-top: 1px dotted #bbb; - height: 0; -} - -.box#classes .boxcontent a { - display: block; -} - -.box input { - width: auto; -} - -.box td input { - width: 100%; -} - -.box img.rating { - position: relative; - top: 1px; -} - -.hidden { - display: none; -} - - -/* - * Links - */ - -a, a:link, a:visited { - color: #02a; - text-decoration: none; - /* cursor: pointer; */ -} - -a:hover { - text-decoration: underline; -} - - -/* - * Tabs - */ - -/* all the tabs */ -.tabs { - float: left; - width: 100%; - background: #fff url("../images/tabs_back.png") repeat-x bottom; -} - -.tabs ul { - list-style: none; -} - -.tabs li { - float: left; - margin-right: 1px; -} - -.tabs a { - display: block; - margin-top: 1px; - padding: 0.35em 1.35em; - background-image: url("../images/tab_back.png"); - background-repeat: repeat-x; - background-color: #cbcbcb; - border: 1px solid #bbb; -} - -.tabs a:hover { - background: #fff; - text-decoration: none; -} - -.tabs a.current { - background: #fff; - border-bottom: 1px solid #fff; -} - -/* horizontal line underneath the tabs */ -#tab-line { - height: 1em; - clear: both; -} - -#instances { - float: right; -} - -.selected { - background-color: #bde; /*#b4d5fe;*/ -} - -.button { - border: solid black 1px; - padding: 0px 1px; - background-color: #eee; -} - -img { - border: none; -} - -/* - * Layer - */ -#layer { - width: 100%; - height: 100%; - position: absolute; - background-image: url("../images/black_50.png"); - background-repeat: repeat; - z-index: 98; -} - -#layerContent { - margin-top: 100px; - margin: auto; - width: 500px; - height: 300px; - background-color: #ffb; - border: 2px solid #bbb; - z-index: 99; -} - -/* - * Buttons - */ -input.button { - border: 1px solid #bbb; - color: #666; - background-color: #eee; - padding: 3px 0.4em; - font-weight: bold; - white-space: nowrap; - font-size: 85%; -} - -input.button:hover { - border-left:1px solid #ffffff; - border-top:1px solid #ffffff; - border-right:1px solid #848484; - border-bottom:1px solid #848484; -} - -.titletable{ - width:100%; - color: #666; - background-color: #eee; - padding: 0.1em 0.4em; - font-weight: bold; - font-size: 100%; - white-space: nowrap; -} - -.titletable input.button{ - width:auto; -} - -.titletable td.left{ - text-align:left; -} - -.titletable td.right{ - text-align:right; -} - -.box .boxtitlewithbutton { - color: #666; - background-color: #eee; - padding: 0em 0.4em; - font-weight: bold; - white-space: nowrap; -} - -#search { - text-align:center; -} - -#label { - margin-bottom: 0.1em; -} - -#article { - min-height: 500px; -} - -#credits { - border: none; -} - -#positivesboxtitle { - /*color: black;*/ - background-color: lightgreen; -} - -#negativesboxtitle { - /*color: black;*/ - background-color: #ee6666; -} - -#ArticleTitle { - font-size: 150%; - color:black; -} - -#footer { - clear: both; - text-align: center; -} - -#todo { - padding: 15px; - margin: 10px; -} - -#redirectedFrom { - color: #666; - font-size: 85%; -} \ No newline at end of file Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/index.php 2008-08-21 08:19:58 UTC (rev 1116) @@ -16,6 +16,7 @@ //what happens onLoad $onLoad="onLoad=\"document.getElementById('label').focus();"; +if (isset($_GET['positives'])||isset($_GET['negatives'])) $onLoad.="setPositivesAndNegatives('positives=".$_GET['positives']."&negatives=".$_GET['negatives']."');"; if (isset($_GET['showArticle'])) $onLoad.="get_article('label=".$_GET['showArticle']."&cache=-1');"; else if (isset($_GET['search'])) $onLoad.="search_it('label=".$_GET['search']."&number=10');"; else if (isset($_GET['showClass'])) $onLoad.="get_class('class=http://dbpedia.org/class/yago/".$_GET['showClass']."&cache=-1');"; @@ -23,6 +24,7 @@ else if (isset($_SESSION['currentArticle'])){ $onLoad.="get_article('label=&cache=".$_SESSION['currentArticle']."');"; } + $onLoad.="\""; @@ -194,7 +196,9 @@ </div><!-- wrapper --> <div id="footer"> - <p>Licensed under the GNU General Public License (GPL) 3 as part of the DL-Learner open source + <div id="generatedURL"></div> + <input type="button" class="button" value="generate URL" onclick="generateURL();"/> + <p>Licensed under the GNU General Public License (GPL) 3 as part of the DL-Learner open source project.<br />Copyright © Jens Lehmann 2007-2008 </p> <div id="validation"> <?php Modified: trunk/src/dbpedia-navigator/js/ajax.js =================================================================== --- trunk/src/dbpedia-navigator/js/ajax.js 2008-08-20 20:05:10 UTC (rev 1115) +++ trunk/src/dbpedia-navigator/js/ajax.js 2008-08-21 08:19:58 UTC (rev 1116) @@ -220,57 +220,57 @@ XhrObj.send(param); } - function removeNegInterest(param) - { - if (document.all){ - //IE - var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); - } - else{ - //Mozilla - var XhrObj = new XMLHttpRequest(); - } +function removeNegInterest(param) +{ + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } - XhrObj.open("POST",'ajax_remove_neg_interest.php'); + XhrObj.open("POST",'ajax_remove_neg_interest.php'); - XhrObj.onreadystatechange = function() - { - if (XhrObj.readyState == 4 && XhrObj.status == 200){ - var response = XhrObj.responseText.split('$$'); - document.getElementById('Positives').innerHTML=response[0]; - document.getElementById('Negatives').innerHTML=response[1]; - } - } + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + var response = XhrObj.responseText.split('$$'); + document.getElementById('Positives').innerHTML=response[0]; + document.getElementById('Negatives').innerHTML=response[1]; + } + } - XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); - XhrObj.send(param); + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(param); +} + +function learnConcept() +{ + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } + + XhrObj.open("POST",'ajax_learn_concepts.php'); + + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + var response = XhrObj.responseText.split('$$'); + document.getElementById('conceptlink').innerHTML=response[0]; + document.getElementById('ConceptInformation').innerHTML=response[1]; } - - function learnConcept() - { - if (document.all){ - //IE - var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); - } - else{ - //Mozilla - var XhrObj = new XMLHttpRequest(); - } + } - XhrObj.open("POST",'ajax_learn_concepts.php'); - - XhrObj.onreadystatechange = function() - { - if (XhrObj.readyState == 4 && XhrObj.status == 200){ - var response = XhrObj.responseText.split('$$'); - document.getElementById('conceptlink').innerHTML=response[0]; - document.getElementById('ConceptInformation').innerHTML=response[1]; - } - } - - XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); - XhrObj.send(); - } + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(); +} function stopServerCall() { @@ -349,4 +349,54 @@ XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); XhrObj.send(param); +} + +function setPositivesAndNegatives(param) +{ + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } + + XhrObj.open("POST",'ajax_set_positives_and_negatives.php'); + + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + var response = XhrObj.responseText.split('$$'); + document.getElementById('Positives').innerHTML=response[0]; + document.getElementById('Negatives').innerHTML=response[1]; + } + } + + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(param); +} + +function generateURL() +{ + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } + + XhrObj.open("POST",'ajax_generate_URL.php'); + + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + document.getElementById('generatedURL').innerHTML=XhrObj.responseText; + } + } + + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(); } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |