changeset 53:a405991e39d8

modified ClaiMode/computeUnaimously method
author one
date Thu, 04 Oct 2012 18:01:16 +0900
parents f3db6edc61ad
children 2f6b0b1bd03b
files app/models/ClaimModel.java logs/application.log public/viewer/denied.png public/viewer/form.css public/viewer/index.html public/viewer/viewer.html target/scala-2.9.1/cache/compile/compile target/scala-2.9.1/cache/compile/copy-resources
diffstat 8 files changed, 106 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/ClaimModel.java	Thu Oct 04 17:04:38 2012 +0900
+++ b/app/models/ClaimModel.java	Thu Oct 04 18:01:16 2012 +0900
@@ -292,6 +292,8 @@
 			} else if (requestsNumber == deniedNumber
 					&& queAndSugStatus.equals(FAILED)) {
 				setProperty(STATUS, FAILED);
+			} else {
+				setProperty(STATUS, UNKNOWN);
 			}
 		} else if (inverseRefutationStatus != null & queAndSugStatus == null) {
 			if (requestsNumber == agreedNumber && inverseRefutationStatus.equals(PASS)) {
@@ -299,13 +301,15 @@
 			} else if (requestsNumber == deniedNumber
 					&& inverseRefutationStatus.equals(FAILED)) {
 				setProperty(STATUS, FAILED);
+			} else {
+				setProperty(STATUS, UNKNOWN);
 			}
 		}else if (inverseRefutationStatus != null & queAndSugStatus != null) {
 			String childStatus = UNKNOWN;
 			if (inverseRefutationStatus.equals(queAndSugStatus)) {
 				childStatus = inverseRefutationStatus;
 			}
-			if ( requestsNumber == agreedNumber && childStatus.equals(PASS) ){
+			if ( requestsNumber == agreedNumber &&childStatus.equals(PASS) ){
 				setProperty(STATUS, PASS);
 			} else if ( requestsNumber == deniedNumber && childStatus.equals(DENIED)) {
 				setProperty(STATUS, FAILED);
--- a/logs/application.log	Thu Oct 04 17:04:38 2012 +0900
+++ b/logs/application.log	Thu Oct 04 18:01:16 2012 +0900
@@ -1,6 +1,42 @@
-2012-10-04 16:02:44,886 - [INFO] - from play in main 
+2012-10-04 17:01:54,758 - [INFO] - from play in main 
 Listening for HTTP on port 80...
 
-2012-10-04 16:02:48,604 - [INFO] - from play in play-akka.actor.default-dispatcher-3 
+2012-10-04 17:01:57,339 - [INFO] - from play in play-akka.actor.default-dispatcher-1 
+Application started (Dev)
+
+2012-10-04 17:02:38,814 - [INFO] - from application in play-akka.actor.default-dispatcher-3 
+Application shutdown...
+
+2012-10-04 17:02:38,836 - [INFO] - from play in play-akka.actor.default-dispatcher-3 
+Application started (Dev)
+
+2012-10-04 17:03:04,500 - [INFO] - from application in play-akka.actor.default-dispatcher-1 
+Application shutdown...
+
+2012-10-04 17:03:04,521 - [INFO] - from play in play-akka.actor.default-dispatcher-1 
 Application started (Dev)
 
+2012-10-04 17:03:16,151 - [INFO] - from application in play-akka.actor.default-dispatcher-3 
+Application shutdown...
+
+2012-10-04 17:03:16,168 - [INFO] - from play in play-akka.actor.default-dispatcher-3 
+Application started (Dev)
+
+2012-10-04 17:03:26,159 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
+Application shutdown...
+
+2012-10-04 17:03:26,183 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
+Application started (Dev)
+
+2012-10-04 17:56:05,425 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
+Application shutdown...
+
+2012-10-04 17:56:05,449 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
+Application started (Dev)
+
+2012-10-04 17:56:30,570 - [INFO] - from application in play-akka.actor.default-dispatcher-1 
+Application shutdown...
+
+2012-10-04 17:56:30,585 - [INFO] - from play in play-akka.actor.default-dispatcher-1 
+Application started (Dev)
+
Binary file public/viewer/denied.png has changed
--- a/public/viewer/form.css	Thu Oct 04 17:04:38 2012 +0900
+++ b/public/viewer/form.css	Thu Oct 04 18:01:16 2012 +0900
@@ -66,8 +66,14 @@
 div.claim_main,div.mention_main{
 	position:absolute;left:0;top:90;width:600;height:270;
 }
-div.claiminfo div.claim_main{background:-webkit-gradient(linear,left top,left bottom,from(#66a),to(white),color-stop(0.02,white));}
-div.mentioninfo div.mention_main{background:-webkit-gradient(linear,left top,left bottom,from(#599),to(white),color-stop(0.02,white));}
+div.claiminfo div.claim_main{
+	background:-moz-linear-gradient(top,#66a,white 2%,white);
+	background:-webkit-gradient(linear,left top,left bottom,from(#66a),to(white),color-stop(0.02,white));
+}
+div.mentioninfo div.mention_main{
+	background:-moz-linear-gradient(top,#559,white 2%,white);
+	background:-webkit-gradient(linear,left top,left bottom,from(#599),to(white),color-stop(0.02,white));
+}
 div.claim_main textarea,div.mention_main textarea{
 	font-size:20px;
 	position:absolute;
@@ -119,6 +125,7 @@
 
 span.button{
 	background:#eee;
+	background:-moz-linear-gradient(top,#fff,#ddf);
 	background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#ddf));
 	border:1px solid gray;
 	border-radius:4px;
@@ -127,10 +134,12 @@
 }
 span.button:hover{
 	background:#bbb;
+	background:-moz-linear-gradient(top,#ccc,#aac);
 	background:-webkit-gradient(linear,left top,left bottom,from(#ccc),to(#aac));
 }
 span.button:active{
 	background:#bbb;
+	background:-moz-linear-gradient(top,#bbb,#88b);
 	background:-webkit-gradient(linear,left top,left bottom,from(#bbb),to(#88b));
 }
 div.claim_footer span.button{
@@ -157,13 +166,15 @@
 	border:1px solid gray;
 	text-align:center;
 	background:#eef;
-	background:-webkit-gradient(linear,left top,left bottom,from(eef),to(#bbe));
+	background:-moz-linear-gradient(top,#eef,#bbe);
+	background:-webkit-gradient(linear,left top,left bottom,from(#eef),to(#bbe));
 	color:#888;
 }
 .option1 .option1,.option2 .option2,.option3 .option3{
 	color:black;
 	background:#ccb;
-	background:-webkit-gradient(linear,left top,left bottom,from(ccb),to(#88c));
+	background:-moz-linear-gradient(top,#ccb,#88c);
+	background:-webkit-gradient(linear,left top,left bottom,from(#ccb),to(#88c));
 
 }
 .agree1{position:absolute;right:130;top:4;width:60px;}
--- a/public/viewer/index.html	Thu Oct 04 17:04:38 2012 +0900
+++ b/public/viewer/index.html	Thu Oct 04 18:01:16 2012 +0900
@@ -106,6 +106,8 @@
 function showForm(){
 	$("#claimbody")[0].className="claim_contents";
 	
+      var keys=['title','contents','w','d','b','q','r'];
+      for(var i=0;i<keys.length;i++)$("#claimform_"+keys[i]).val("");
 	$("#claim_author").text(userName);
 	$("#claimvote_option")[0].className="option1";
 	claimUserMap=new HashSet();
@@ -164,22 +166,6 @@
 }
 a.claim:hover{box-shadow:0 0 30px white;}
 
-span.button{
-	background:#eee;
-	background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#eee));
-	border:1px solid silver;
-	border-radius:4px;
-	text-align:center;
-	cursor:default;	
-}
-span.button:hover{
-	background:#ddd;
-	background:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#ddd));
-}
-span.button:active{
-	background:#bbb;
-	background:-webkit-gradient(linear,left top,left bottom,from(#ccc),to(#bbb));
-}
 </style>
 <div id="loginPopup" style='position:fixed;left:0;top:0;width:100%;height:100%;z-index:10;'>
 <div style='position:absolute;left:0;top:0;width:100%;height:100%;background:black;opacity:0.5'></div>
@@ -215,7 +201,8 @@
 	z-index:5;
 	height:50px;
 	width:100%;
-	background:#334;
+	background:#223;
+	background:-moz-linear-gradient(top,#002,#223);
 	background:-webkit-gradient(linear,left top,left bottom,from(#002),to(#223));
 	color:silver;
 	font-size:40px;
@@ -225,7 +212,8 @@
 	text-align:center;
 	width:160;height:50;
 	cursor:pointer;
-	background:#bbd;
+	background:#334;
+	background:-moz-linear-gradient(top,#224,#334);
 	background:-webkit-gradient(linear,left top,left bottom,from(#224),to(#334));
 	color:silver;
 }
--- a/public/viewer/viewer.html	Thu Oct 04 17:04:38 2012 +0900
+++ b/public/viewer/viewer.html	Thu Oct 04 18:01:16 2012 +0900
@@ -1,4 +1,5 @@
 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
+<title>R-Consensus</title>
 <link rel='stylesheet' href="form.css">
 <script src='form.js'></script>
 <script type="text/javascript" src="js/lib/jquery-1.8.1-min.js"></script>
@@ -25,12 +26,14 @@
 	}
 }
 
-var userName=localStorage.userName;
+var userName;
+
 var treeInfo;
 var userList=[];
 var root_id;
 function loadConsensus(id){
 	function onload(json){
+		document.title="R-Consensus : "+json.toulmin.title;
 		$("#header_title").text("R-Consensus : "+json.toulmin.title)
 		if(treeInfo){
 			updateToNew(json);
@@ -53,7 +56,7 @@
 function loadUserList(){
 	$.ajax({
 		url:BASE_URL+"/users/all",
-		success:function(o){userList=o.sort()},
+		success:function(o){userList=o.sort();showUserList([]);},
 		type:"GET",cache:false,
 		error:function(o){console.log("ERROR",o)}
 	});
@@ -61,6 +64,22 @@
 
 
 $(function(){
+	userName=localStorage.userName;
+	if(userName)start();
+	else $("#loginPopup").css("display","block");
+})
+function login(uname){
+	userName=localStorage.userName=uname;
+	start();
+}
+function start(){
+	$.ajax({
+		url:BASE_URL+"/users/create/"+userName,
+		success:function(o){console.log(o)},
+		type:"PUT",cache:false,
+		error:function(o){console.log(o)}
+	});
+	
 	popupInit();
 	jsPlumb.importDefaults({
 		Connector : [ "Straight", { curviness:50 } ],
@@ -68,7 +87,6 @@
 		EndpointStyle : {},
 		Anchors: ["BottomCenter","TopCenter"]
 	});
-	
 	var consensus_id=(location.search.match("[0-9]+")||[])[0];
 	if(consensus_id){
 		root_id=consensus_id;
@@ -78,7 +96,7 @@
 	}else{
 		document.body.innerHTML="<div style='color:white;font-size:64px'>No ClaimID Specified.<br><a href='index.html' style='color:#88f'>back</a></div>";
 	}
-})
+}
 
 function updateToNew(json){
 	var t2=createJSONTreeInfo(json)
@@ -291,6 +309,7 @@
 	height:50px;
 	width:100%;
 	background:#223;
+	background:-moz-linear-gradient(top,#002,#223);
 	background:-webkit-gradient(linear,left top,left bottom,from(#002),to(#223));
 	color:silver;
 	font-size:40px;
@@ -530,4 +549,22 @@
 	<div class='cover' id='mention_cover'></div>
 </div>
 </div>
-</div>
\ No newline at end of file
+</div>
+
+
+
+
+<div id="loginPopup" style='position:fixed;left:0;top:0;width:100%;height:100%;z-index:10;display:none;'>
+<div style='position:absolute;left:0;top:0;width:100%;height:100%;background:black;opacity:0.5'></div>
+<div style='position:absolute;left:50%;top:50%;'>
+<div style='position:absolute;left:-160px;top:-80px;width:320px;height:120px;background:white'>
+<form onsubmit="try{a=$('#loginUserName');if(a.val()){login(a.val());$('#loginPopup').remove();}}catch(e){console.log(e)}return false">
+<div style='position:absolute;left:20px;top:15px;font-size:24px;width:280;text-align:center;'>
+	R-Consensus Login
+</div>
+<input type=text placeholder='username' style='position:absolute;left:20px;top:70px;width:180px;font-size:16px;height:24px;' id='loginUserName'>
+<span style='position:absolute;left:220px;top:70px;width:80px;font-size:16px;height:24px;line-height:24px;' class='button' value='login' onclick="try{a=$('#loginUserName');if(a.val()){login(a.val());$('#loginPopup').remove();}}catch(e){console.log(e)}return false">login</span>
+</form>
+</div>
+</div>
+</div>
Binary file target/scala-2.9.1/cache/compile/compile has changed
Binary file target/scala-2.9.1/cache/compile/copy-resources has changed