Scott Nixon avatar Scott Nixon committed 628fac7

Added css file for inline Action box. Completed feature to keep closed action boxes closed.

Comments (0)

Files changed (2)

inbounding/dispatch/static/css/ck_main.css

+/*
+  Nice white background with a small white border.
+*/
+#in_container {
+    background: #fff;
+    border: 0;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -moz-border-radius: 2px;
+    bottom: 0;
+    height: auto;
+    margin: 0;
+    padding: 7px;
+    position: fixed;
+    right: 30px;
+    width: 291px;
+    z-index: 9999;
+}
+
+.inner-light {
+    margin: -2px 0px 0px -2px;
+    border: 1px solid #BBB;
+    background-color: #F4F4F4;
+}
+.action_box {
+    background: #fff;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+    -moz-border-radius: 2px;
+    padding: 18px;
+}
+.inbox200 {
+    width: 200px;
+}
+div.shadowed {
+    border-bottom: 1px solid #BBB;
+    border-right: 1px solid #BBB;
+}
+.hide-open {
+    width: 40px;
+    position: relative;
+    color: purple;
+    padding: 0 5px;
+    text-align: center;
+    float: right;
+}
+.top-layer {
+    overflow: hidden;
+}
+#ck_container {
+    position: fixed;
+    right: 30px;
+    bottom: 0;
+}
+#ck_container1 {
+   position: fixed;
+   right: 35px;
+   top: 25px;
+}
+
+.black-back {
+    color: white !important;
+    background-color: #333;
+    border-top: 1px solid #383838;
+    border-bottom: 1px solid #444;
+    -moz-box-shadow: 0 2px 0 0 #262626, 0 -1px 0 0 #171717;
+    -webkit-box-shadow: 0 2px 0 0 #262626, 0 -1px 0 0 #171717;
+    -o-box-shadow: 0 2px 0 0 #262626, 0 -1px 0 0 #171717;
+    box-shadow: 0 2px 0 0 #262626, 0 -1px 0 0 #171717;
+    display: block;
+    margin-bottom: 1px;
+}
+
+.ck_closed { 
+    display: none;
+}

inbounding/dispatch/static/in.js

 	    /* We pass the id of the action to that we can check a 
 	     * cookie to see if it has been closed or completed.
 	     */
-	    INBOUND.action_id = results.id;
-	    var status = callback(results.id); //Callback function of INBOUND.usereval
+
+	    /* Create a global that can be used by INBOUND.close */
+	    INBOUND.action_id = results.id; 
+
+	    /* Callback function of INBOUND.usereval 
+	     * Pass the ID of the result to check for a status value
+	     * that will let you know if the action has been completed
+	     * or closed by this user.
+	     */
+	    var status = callback(results.id); 
+
 	    if (results && typeof results === 'object') {
+		
+		/* Template to show to every user that has not close or completed. */
+		var tmplt1a = "<div id='ck_container'><div class='top-layer'><div class='hide-open inner-light'><a id='ck_close' onclick='INBOUND.close();'>close</a></div></div><div class='inner-light'><div class='action_box'>"
+		
+		/* Template to show to users that have closed the Container. */
+		var tmplt1b = "<div id='ck_container' class='ck_closed'><div class='top-layer'><div class='hide-open inner-light'><a id='ck_close' onclick='INBOUND.close();'>close</a></div></div><div class='inner-light'><div class='action_box'>"
 
-		//var body = document.getElementsByTagName("body");
-		var tmplt1 = "<div id='ck_container'><div class='top-layer'><div class='hide-open inner-light'><a id='ck_close' onclick='INBOUND.close();'>close</a></div></div><div class='inner-light'><div class='action_box'>"
 		var tmplt2 = results.code + "</div></div></div>"
 		var orginal = '<div id="in_container">' + s + results.code + '</div>'
 
 		// based on the value in the cookie.
 		var s = status;
 		var csscls = '';
-		if (s === 100) { 
-		    csscls = 'completed';
+
+		if (s === '100') { 
+		    csscls = 'ck_completed';
 		}
-		else if (s === 101) {
-		    csscls = 'closed';
+		else if (s === '101') {
+		    // Added class='ck_closed'
+		    $('body').append(tmplt1b + tmplt2);
+		} 
+		else {
+		    /* This is the default event that will show the template in 
+		     * an unchanged state.
+		    */
+		    $('body').append(tmplt1a + tmplt2);
 		}
 
-		$('body').append(tmplt1 + tmplt2);
+
 	    }
 	}
     });
     $('#ck_container').hide();
     // Value = 100 for Completed
     // Value = 101 for Closed
-    INBOUND.setCookie('ck_status', INBOUND.action_id + ',' + 100, (60*60*24*365), '/', '');
+    INBOUND.setCookie('ck_status', INBOUND.action_id + ',' + 101, (60*60*24*365), '/', '');
 };
 
 INBOUND.usereval = function(rid) {
     /* Evaluate if the user has closed or completed the Action. 
-     * The client_status cookie is only for marking a Action
+     * The ck_status cookie is only for marking a Action
      * as either completed or closed.
      */
 
     var get_status = INBOUND.getCookie('ck_status');
-    var values_list = get_status.split(',');
-    if (values_list[0] === rid.toString()) {
-	var status = values_list[1];
-	console.log("USEREVAL: " + status);
+
+    /* Check to see if a value exits and return the status number. */
+    if (get_status === null && typeof get_status === 'object')
+	status = 0;
+    else {
+	var values_list = get_status.split(',');
+	if (values_list[0] === rid.toString()) {
+	    var status = values_list[1];
+	    console.log("USEREVAL: " + status);
+	}
     }
     return status;
 };
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.