virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 32)
Status: Beta
Brought to you by:
alllee
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(21) |
Aug
(31) |
Sep
(6) |
Oct
(15) |
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(4) |
Feb
(6) |
Mar
(12) |
Apr
(52) |
May
(14) |
Jun
(19) |
Jul
(81) |
Aug
(115) |
Sep
(36) |
Oct
(88) |
Nov
(46) |
Dec
(58) |
2010 |
Jan
(52) |
Feb
(55) |
Mar
(48) |
Apr
(15) |
May
(5) |
Jun
(38) |
Jul
(27) |
Aug
(24) |
Sep
(28) |
Oct
(1) |
Nov
(2) |
Dec
(29) |
2011 |
Jan
(87) |
Feb
(39) |
Mar
(63) |
Apr
(42) |
May
(26) |
Jun
(53) |
Jul
(23) |
Aug
(43) |
Sep
(37) |
Oct
(25) |
Nov
(4) |
Dec
(7) |
2012 |
Jan
(73) |
Feb
(79) |
Mar
(62) |
Apr
(28) |
May
(12) |
Jun
(2) |
Jul
(9) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(3) |
Dec
(3) |
2013 |
Jan
(8) |
Feb
(16) |
Mar
(38) |
Apr
(74) |
May
(62) |
Jun
(15) |
Jul
(49) |
Aug
(19) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bitbucket <iss...@bi...> - 2011-06-07 16:09:29
|
--- you can reply above this line --- New issue 16: clean up websocket connection logic https://bitbucket.org/virtualcommons/vcweb/issue/16/clean-up-websocket-connection-logic virtualcommons on Tue, 7 Jun 2011 18:09:23 +0200: Description: add/remove are getting invoked repeatedly and might not need to be. Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-06-07 16:06:32
|
--- you can reply above this line --- New issue 15: IOErrors from tornadio https://bitbucket.org/virtualcommons/vcweb/issue/15/ioerrors-from-tornadio virtualcommons on Tue, 7 Jun 2011 18:06:26 +0200: Description: Also, a lot of IOErrors being reported ala: {{{ #!python WARNING 2011-06-07 09:04:54,919 [tornadio.vcweb|remove_participant:99] caught key error <__main__.ParticipantHandler object at 0x25357d0> while trying to remove participant connection <__main__.ParticipantHandler object at 0x25357d0> ERROR:root:Uncaught exception, closing connection. Traceback (most recent call last): File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 193, in _on_end_delimiter self._receive_message() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 178, in _receive_message self.stream.read_bytes(1, self._on_frame_type) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 151, in read_bytes self._check_closed() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 378, in _check_closed raise IOError("Stream is closed") IOError: Stream is closed ERROR:root:Uncaught exception, closing connection. Traceback (most recent call last): File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 183, in _on_frame_type self.stream.read_until("\xff", self._on_end_delimiter) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 133, in read_until if self._read_from_buffer(): File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 325, in _read_from_buffer self._consume(loc + delimiter_len)) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 193, in _on_end_delimiter self._receive_message() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 178, in _receive_message self.stream.read_bytes(1, self._on_frame_type) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 151, in read_bytes self._check_closed() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 378, in _check_closed raise IOError("Stream is closed") IOError: Stream is closed }}} Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-06-07 16:04:30
|
--- you can reply above this line --- New issue 14: connection <-> pgr map with invalid entries https://bitbucket.org/virtualcommons/vcweb/issue/14/connection-pgr-map-with-invalid-entries virtualcommons on Tue, 7 Jun 2011 18:04:24 +0200: Description: {{{ #!python DEBUG 2011-06-07 09:01:39,871 [tornadio.vcweb|send_to_experimenter:147] sending to connection <__main__.ExperimenterHandler object at 0x2544a50> DEBUG 2011-06-07 09:01:40,263 [tornadio.vcweb|on_message:238] received message {u'participant_group_relationship_id': 2, u'message': u'pat a mat', u'message_type': u'chat'} from handler <__main__.ParticipantHandler object at 0x2748c10> DEBUG 2011-06-07 09:01:40,264 [tornadio.vcweb|get_participant_group_relationship:74] Looking for ParticipantGroupRelationship with tuple (11, 2) DEBUG 2011-06-07 09:01:40,284 [tornadio.vcweb|send_to_experimenter:144] sending {"participant": "Student 1 (s1...@as...)", "message_type": "chat", "date_created": "09:01:40", "pk": 184, "message": "2: pat a mat", "round_data_pk": 19} to e xperimenter (3, 2) DEBUG 2011-06-07 09:01:40,285 [tornadio.vcweb|send_to_experimenter:147] sending to connection <__main__.ExperimenterHandler object at 0x2544a50> DEBUG 2011-06-07 09:01:40,558 [tornadio.vcweb|on_message:238] received message {u'participant_group_relationship_id': 4, u'message': u'ok pat', u'message_type': u'chat'} from handler <__main__.ParticipantHandler object at 0x267e710> WARNING 2011-06-07 09:01:40,559 [tornadio.vcweb|get_participant_group_relationship:76] Couldn't find a participant group relationship using connection <__main__.ParticipantHandler object at 0x267e710> in connection map {<__main__.Partici pantHandler object at 0x2662ad0>: (12, 2), <__main__.ParticipantHandler object at 0x267af90>: (18, 2), <__main__.ParticipantHandler object at 0x2748c10>: (11, 2), <__main__.ParticipantHandler object at 0x27334d0>: (20, 2), <__main__.Part icipantHandler object at 0x2613c10>: (13, 2), <__main__.ParticipantHandler object at 0x2686cd0>: (19, 2), <__main__.ParticipantHandler object at 0x27472d0>: (14, 2)} ERROR:root:Uncaught exception in /participant/19/websocket Traceback (most recent call last): File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 165, in wrapper return callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornadio/conn.py", line 89, in raw_message self.on_message(msg[1]) File "vcwebio.py", line 269, in on_message current_round_data = participant_group_relationship.group.experiment.current_round_data AttributeError: 'NoneType' object has no attribute 'group' DEBUG 2011-06-07 09:01:40,561 [tornadio.vcweb|on_close:285] removing participant connection <__main__.ParticipantHandler object at 0x267e710> WARNING 2011-06-07 09:01:40,562 [tornadio.vcweb|remove_participant:99] caught key error <__main__.ParticipantHandler object at 0x267e710> while trying to remove participant connection <__main__.ParticipantHandler object at 0x267e710> ERROR:root:Uncaught exception, closing connection. Traceback (most recent call last): File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 193, in _on_end_delimiter self._receive_message() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/websocket.py", line 178, in _receive_message self.stream.read_bytes(1, self._on_frame_type) File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 151, in read_bytes self._check_closed() File "/opt/virtualenvs/vcweb/lib/python2.6/site-packages/tornado/iostream.py", line 378, in _check_closed raise IOError("Stream is closed") IOError: Stream is closed }}} Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-06-07 15:52:23
|
--- you can reply above this line --- New issue 13: duplicate entities https://bitbucket.org/virtualcommons/vcweb/issue/13/duplicate-entities virtualcommons on Tue, 7 Jun 2011 17:52:16 +0200: Description: duplicate GroupRoundDataValues are getting created and causing havoc in generate_participant_history (the wait page). # Ensure & verify that creation logic is only happening once, at the end of the round? # Handle this better in generate_participant_history so that we don't spit out a Internal Server Error page Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <com...@bi...> - 2011-06-07 08:09:51
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/9d37294f7ebb/ changeset: 9d37294f7ebb branches: user: all...@sod19.asu.edu date: 2011-06-07 10:09:20 summary: minor UI tweaks for chat page affected #: 1 file (134 bytes) --- a/vcweb/forestry/templates/forestry/chat.html Tue Jun 07 00:21:36 2011 -0700 +++ b/vcweb/forestry/templates/forestry/chat.html Tue Jun 07 01:09:20 2011 -0700 @@ -44,15 +44,15 @@ </script> {% endblock %} {% block title %} -Forestry Communication Round +Communication Round: {{experiment}} {% endblock %} {% block page %} -<h3>Communication Round</h3> - <div class='alert infoIcon ui-corner-all'> +<h3 style='margin-top: -30px;'>Communication Round Instructions</h3> + <div class='alert alertIcon ui-corner-all' style='font-size: 0.8em; line-height: 1.0em;'> You are <b>participant {{ participant_group_relationship.participant_number }}.</b> - You can now chat about any aspect of the experiment with the other members of your group with two restrictions: - <ol> + You can chat about any aspect of the experiment with the other members of your group with two restrictions: + <ol style='margin-left: 15px;margin-bottom: 0;'><li>You cannot promise side payments after the experiment is completed <li>You cannot threaten any member of your group with any consequences after the experiment is completed </ol> Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-07 07:22:12
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/ca62a1198db5/ changeset: ca62a1198db5 branches: user: all...@sod19.asu.edu date: 2011-06-07 09:21:36 summary: getting rid of submit disable; validation failure disables the button and then there's no way to submit affected #: 3 files (1.2 KB) --- a/vcweb/forestry/templates/forestry/chat.html Tue Jun 07 00:17:08 2011 -0700 +++ b/vcweb/forestry/templates/forestry/chat.html Tue Jun 07 00:21:36 2011 -0700 @@ -44,11 +44,11 @@ </script> {% endblock %} {% block title %} -Forestry Chat Round +Forestry Communication Round {% endblock %} {% block page %} -<h3>Chat</h3> +<h3>Communication Round</h3><div class='alert infoIcon ui-corner-all'> You are <b>participant {{ participant_group_relationship.participant_number }}.</b> You can now chat about any aspect of the experiment with the other members of your group with two restrictions: --- a/vcweb/forestry/templates/forestry/participate.html Tue Jun 07 00:17:08 2011 -0700 +++ b/vcweb/forestry/templates/forestry/participate.html Tue Jun 07 00:21:36 2011 -0700 @@ -33,7 +33,6 @@ } }); $('#forestry-form').submit(function() { - $('#submit').button("disable"); var harvestDecisionValue = $('#harvest-decision-id').val(); // FIXME: this isn't getting sent through properly before the submit occurs. // Should work out communicating directly from Django to the tornadio process. --- a/vcweb/static/js/dajaxice.core.js Tue Jun 07 00:17:08 2011 -0700 +++ b/vcweb/static/js/dajaxice.core.js Tue Jun 07 00:21:36 2011 -0700 @@ -1,1 +1,100 @@ -var Dajaxice={vcweb:{core:{experiment_controller:function(b,a){Dajaxice.call("vcweb.core.experiment_controller",b,a)}}},get_cookie:function(a){var e=null;if(document.cookie&&document.cookie!=""){var d=document.cookie.split(";");for(var c=0;c<d.length;c++){var b=d[c].toString().replace(/^\s+/,"").replace(/\s+$/,"");if(b.substring(0,a.length+1)==(a+"=")){e=decodeURIComponent(b.substring(a.length+1));break}}}return e},call:function(dajaxice_function,dajaxice_callback,argv){var send_data=[];is_callback_a_function=(typeof(dajaxice_callback)=="function");if(!is_callback_a_function){send_data.push("callback="+dajaxice_callback)}send_data.push("argv="+encodeURIComponent(JSON.stringify(argv)));send_data=send_data.join("&");var oXMLHttpRequest=new XMLHttpRequest;oXMLHttpRequest.open("POST","/dajaxice/"+dajaxice_function+"/");oXMLHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest");oXMLHttpRequest.setRequestHeader("X-CSRFToken",Dajaxice.get_cookie("csrftoken"));oXMLHttpRequest.onreadystatechange=function(){if(this.readyState==XMLHttpRequest.DONE){if(is_callback_a_function){try{dajaxice_callback(JSON.parse(this.responseText))}catch(exception){dajaxice_callback(this.responseText)}}else{eval(this.responseText)}}};oXMLHttpRequest.send(send_data)}};Dajaxice.EXCEPTION="DAJAXICE_EXCEPTION";window.Dajaxice=Dajaxice;(function(){function a(){this._object=f?new f:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function d(b){a.onreadystatechange&&a.onreadystatechange.apply(b);b.dispatchEvent({type:"readystatechange",bubbles:false,cancelable:false,timeStamp:new Date+0})}function m(b){var i=b.responseXML,h=b.responseText;if(g&&h&&i&&!i.documentElement&&b.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){i=new window.ActiveXObject("Microsoft.XMLDOM");i.async=false;i.validateOnParse=false;i.loadXML(h)}if(i){if(g&&i.parseError!=0||!i.documentElement||i.documentElement&&i.documentElement.tagName=="parsererror"){return null}}return i}function n(b){try{b.responseText=b._object.responseText}catch(k){}try{b.responseXML=m(b._object)}catch(j){}try{b.status=b._object.status}catch(h){}try{b.statusText=b._object.statusText}catch(i){}}function c(b){b._object.onreadystatechange=new window.Function}var f=window.XMLHttpRequest,e=!!window.controllers,g=window.document.all&&!window.opera;if(e&&f.wrapped){a.wrapped=f.wrapped}a.UNSENT=0;a.OPENED=1;a.HEADERS_RECEIVED=2;a.LOADING=3;a.DONE=4;a.prototype.readyState=a.UNSENT;a.prototype.responseText="";a.prototype.responseXML=null;a.prototype.status=0;a.prototype.statusText="";a.prototype.onreadystatechange=null;a.onreadystatechange=null;a.onopen=null;a.onsend=null;a.onabort=null;a.prototype.open=function(h,p,l,i,k){delete this._headers;if(arguments.length<3){l=true}this._async=l;var j=this,b=this.readyState,o;if(g&&l){o=function(){if(b!=a.DONE){c(j);j.abort()}};window.attachEvent("onunload",o)}a.onopen&&a.onopen.apply(this,arguments);if(arguments.length>4){this._object.open(h,p,l,i,k)}else{arguments.length>3?this._object.open(h,p,l,i):this._object.open(h,p,l)}if(!e&&!g){this.readyState=a.OPENED;d(this)}this._object.onreadystatechange=function(){if(!(e&&!l)){j.readyState=j._object.readyState;n(j);if(j._aborted){j.readyState=a.UNSENT}else{if(j.readyState==a.DONE){c(j);g&&l&&window.detachEvent("onunload",o)}b!=j.readyState&&d(j);b=j.readyState}}}};a.prototype.send=function(b){a.onsend&&a.onsend.apply(this,arguments);if(b&&b.nodeType){b=window.XMLSerializer?(new window.XMLSerializer).serializeToString(b):b.xml;this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")}this._object.send(b);if(e&&!this._async){this.readyState=a.OPENED;for(n(this);this.readyState<a.DONE;){this.readyState++;d(this);if(this._aborted){return}}}};a.prototype.abort=function(){a.onabort&&a.onabort.apply(this,arguments);if(this.readyState>a.UNSENT){this._aborted=true}this._object.abort();c(this)};a.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};a.prototype.getResponseHeader=function(b){return this._object.getResponseHeader(b)};a.prototype.setRequestHeader=function(b,h){if(!this._headers){this._headers={}}this._headers[b]=h;return this._object.setRequestHeader(b,h)};a.prototype.addEventListener=function(b,k,j){for(var h=0,i;i=this._listeners[h];h++){if(i[0]==b&&i[1]==k&&i[2]==j){return}}this._listeners.push([b,k,j])};a.prototype.removeEventListener=function(b,k,j){for(var h=0,i;i=this._listeners[h];h++){if(i[0]==b&&i[1]==k&&i[2]==j){break}}i&&this._listeners.splice(h,1)};a.prototype.dispatchEvent=function(b){b={type:b.type,target:this,currentTarget:this,eventPhase:2,bubbles:b.bubbles,cancelable:b.cancelable,timeStamp:b.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};if(b.type=="readystatechange"&&this.onreadystatechange){(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[b])}for(var i=0,h;h=this._listeners[i];i++){if(h[0]==b.type&&!h[2]){(h[1].handleEvent||h[1]).apply(this,[b])}}};a.prototype.toString=function(){return"[object XMLHttpRequest]"};a.toString=function(){return"[XMLHttpRequest]"};if(!window.Function.prototype.apply){window.Function.prototype.apply=function(b,h){h||(h=[]);b.__func=this;b.__func(h[0],h[1],h[2],h[3],h[4]);delete b.__func}}window.XMLHttpRequest=a})();if(!this.JSON){this.JSON={}}(function(){function k(a){return a<10?"0"+a:a}function n(a){o.lastIndex=0;return o.test(a)?'"'+a.replace(o,function(c){var d=q[c];return typeof d==="string"?d:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function l(a,c){var d,f,i=g,e,b=c[a];if(b&&typeof b==="object"&&typeof b.toJSON==="function"){b=b.toJSON(a)}if(typeof j==="function"){b=j.call(c,a,b)}switch(typeof b){case"string":return n(b);case"number":return isFinite(b)?String(b):"null";case"boolean":case"null":return String(b);case"object":if(!b){return"null"}g+=m;e=[];if(Object.prototype.toString.apply(b)==="[object Array]"){f=b.length;for(a=0;a<f;a+=1){e[a]=l(a,b)||"null"}c=e.length===0?"[]":g?"[\n"+g+e.join(",\n"+g)+"\n"+i+"]":"["+e.join(",")+"]";g=i;return c}if(j&&typeof j==="object"){f=j.length;for(a=0;a<f;a+=1){d=j[a];if(typeof d==="string"){if(c=l(d,b)){e.push(n(d)+(g?": ":":")+c)}}}}else{for(d in b){if(Object.hasOwnProperty.call(b,d)){if(c=l(d,b)){e.push(n(d)+(g?": ":":")+c)}}}}c=e.length===0?"{}":g?"{\n"+g+e.join(",\n"+g)+"\n"+i+"}":"{"+e.join(",")+"}";g=i;return c}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var p=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,m,q={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;if(typeof JSON.stringify!=="function"){JSON.stringify=function(a,c,d){var f;m=g="";if(typeof d==="number"){for(f=0;f<d;f+=1){m+=" "}}else{if(typeof d==="string"){m=d}}if((j=c)&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number")){throw new Error("JSON.stringify")}return l("",{"":a})}}if(typeof JSON.parse!=="function"){JSON.parse=function(a,c){function d(f,i){var e,b,h=f[i];if(h&&typeof h==="object"){for(e in h){if(Object.hasOwnProperty.call(h,e)){b=d(h,e);if(b!==undefined){h[e]=b}else{delete h[e]}}}}return c.call(f,i,h)}p.lastIndex=0;if(p.test(a)){a=a.replace(p,function(f){return"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){a=eval("("+a+")");return typeof c==="function"?d({"":a},""):a}throw new SyntaxError("JSON.parse")}}})(); \ No newline at end of file +var Dajaxice = { + + vcweb: { + + + + + + core: { + + experiment_controller: function(callback_function, argv){ + Dajaxice.call('vcweb.core.experiment_controller', callback_function, argv); + } + + + + } + + + + } + , + + get_cookie: function(name) + { + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = cookies[i].toString().replace(/^\s+/, "").replace(/\s+$/, ""); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + }, + + call: function(dajaxice_function, dajaxice_callback, argv) + { + var send_data = []; + is_callback_a_function = (typeof(dajaxice_callback) == 'function'); + + if (!is_callback_a_function){ + /* Backward compatibility for old callback as string usage. */ + send_data.push('callback='+dajaxice_callback); + } + + send_data.push('argv='+encodeURIComponent(JSON.stringify(argv))); + send_data = send_data.join('&'); + var oXMLHttpRequest = new XMLHttpRequest; + oXMLHttpRequest.open('POST', '/dajaxice/'+dajaxice_function+'/'); + oXMLHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + oXMLHttpRequest.setRequestHeader("X-CSRFToken",Dajaxice.get_cookie('csrftoken')); + oXMLHttpRequest.onreadystatechange = function() { + if (this.readyState == XMLHttpRequest.DONE) { + if (is_callback_a_function){ + try{ + dajaxice_callback(JSON.parse(this.responseText)); + } + catch(exception){ + dajaxice_callback(this.responseText); + } + } + else{ + /* Backward compatibility for old callback as string usage. */ + eval(this.responseText); + } + } + } + oXMLHttpRequest.send(send_data); + } +}; +Dajaxice.EXCEPTION = "DAJAXICE_EXCEPTION"; +window['Dajaxice'] = Dajaxice; + + + +(function(){function b(){this._object=i?new i:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function k(a){b.onreadystatechange&&b.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:false,cancelable:false,timeStamp:new Date+0})}function p(a){var c=a.responseXML,d=a.responseText;if(h&&d&&c&&!c.documentElement&&a.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){c=new window.ActiveXObject("Microsoft.XMLDOM");c.async=false;c.validateOnParse=false; +c.loadXML(d)}if(c)if(h&&c.parseError!=0||!c.documentElement||c.documentElement&&c.documentElement.tagName=="parsererror")return null;return c}function o(a){try{a.responseText=a._object.responseText}catch(c){}try{a.responseXML=p(a._object)}catch(d){}try{a.status=a._object.status}catch(g){}try{a.statusText=a._object.statusText}catch(e){}}function l(a){a._object.onreadystatechange=new window.Function}var i=window.XMLHttpRequest,j=!!window.controllers,h=window.document.all&&!window.opera;if(j&&i.wrapped)b.wrapped= +i.wrapped;b.UNSENT=0;b.OPENED=1;b.HEADERS_RECEIVED=2;b.LOADING=3;b.DONE=4;b.prototype.readyState=b.UNSENT;b.prototype.responseText="";b.prototype.responseXML=null;b.prototype.status=0;b.prototype.statusText="";b.prototype.onreadystatechange=null;b.onreadystatechange=null;b.onopen=null;b.onsend=null;b.onabort=null;b.prototype.open=function(a,c,d,g,e){delete this._headers;if(arguments.length<3)d=true;this._async=d;var f=this,m=this.readyState,n;if(h&&d){n=function(){if(m!=b.DONE){l(f);f.abort()}};window.attachEvent("onunload", +n)}b.onopen&&b.onopen.apply(this,arguments);if(arguments.length>4)this._object.open(a,c,d,g,e);else arguments.length>3?this._object.open(a,c,d,g):this._object.open(a,c,d);if(!j&&!h){this.readyState=b.OPENED;k(this)}this._object.onreadystatechange=function(){if(!(j&&!d)){f.readyState=f._object.readyState;o(f);if(f._aborted)f.readyState=b.UNSENT;else{if(f.readyState==b.DONE){l(f);h&&d&&window.detachEvent("onunload",n)}m!=f.readyState&&k(f);m=f.readyState}}}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this, +arguments);if(a&&a.nodeType){a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml;this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")}this._object.send(a);if(j&&!this._async){this.readyState=b.OPENED;for(o(this);this.readyState<b.DONE;){this.readyState++;k(this);if(this._aborted)return}}};b.prototype.abort=function(){b.onabort&&b.onabort.apply(this,arguments);if(this.readyState>b.UNSENT)this._aborted=true;this._object.abort();l(this)}; +b.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};b.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};b.prototype.setRequestHeader=function(a,c){if(!this._headers)this._headers={};this._headers[a]=c;return this._object.setRequestHeader(a,c)};b.prototype.addEventListener=function(a,c,d){for(var g=0,e;e=this._listeners[g];g++)if(e[0]==a&&e[1]==c&&e[2]==d)return;this._listeners.push([a,c,d])};b.prototype.removeEventListener=function(a, +c,d){for(var g=0,e;e=this._listeners[g];g++)if(e[0]==a&&e[1]==c&&e[2]==d)break;e&&this._listeners.splice(g,1)};b.prototype.dispatchEvent=function(a){a={type:a.type,target:this,currentTarget:this,eventPhase:2,bubbles:a.bubbles,cancelable:a.cancelable,timeStamp:a.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};if(a.type=="readystatechange"&&this.onreadystatechange)(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[a]);for(var c=0,d;d= +this._listeners[c];c++)if(d[0]==a.type&&!d[2])(d[1].handleEvent||d[1]).apply(this,[a])};b.prototype.toString=function(){return"[object XMLHttpRequest]"};b.toString=function(){return"[XMLHttpRequest]"};if(!window.Function.prototype.apply)window.Function.prototype.apply=function(a,c){c||(c=[]);a.__func=this;a.__func(c[0],c[1],c[2],c[3],c[4]);delete a.__func};window.XMLHttpRequest=b})(); + + + + +if(!this.JSON)this.JSON={}; +(function(){function k(a){return a<10?"0"+a:a}function n(a){o.lastIndex=0;return o.test(a)?'"'+a.replace(o,function(c){var d=q[c];return typeof d==="string"?d:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function l(a,c){var d,f,i=g,e,b=c[a];if(b&&typeof b==="object"&&typeof b.toJSON==="function")b=b.toJSON(a);if(typeof j==="function")b=j.call(c,a,b);switch(typeof b){case "string":return n(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);case "object":if(!b)return"null"; +g+=m;e=[];if(Object.prototype.toString.apply(b)==="[object Array]"){f=b.length;for(a=0;a<f;a+=1)e[a]=l(a,b)||"null";c=e.length===0?"[]":g?"[\n"+g+e.join(",\n"+g)+"\n"+i+"]":"["+e.join(",")+"]";g=i;return c}if(j&&typeof j==="object"){f=j.length;for(a=0;a<f;a+=1){d=j[a];if(typeof d==="string")if(c=l(d,b))e.push(n(d)+(g?": ":":")+c)}}else for(d in b)if(Object.hasOwnProperty.call(b,d))if(c=l(d,b))e.push(n(d)+(g?": ":":")+c);c=e.length===0?"{}":g?"{\n"+g+e.join(",\n"+g)+"\n"+i+"}":"{"+e.join(",")+"}"; +g=i;return c}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var p=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, +o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,m,q={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;if(typeof JSON.stringify!=="function")JSON.stringify=function(a,c,d){var f;m=g="";if(typeof d==="number")for(f=0;f<d;f+=1)m+=" ";else if(typeof d==="string")m=d;if((j=c)&&typeof c!=="function"&&(typeof c!=="object"||typeof c.length!=="number"))throw new Error("JSON.stringify");return l("", +{"":a})};if(typeof JSON.parse!=="function")JSON.parse=function(a,c){function d(f,i){var e,b,h=f[i];if(h&&typeof h==="object")for(e in h)if(Object.hasOwnProperty.call(h,e)){b=d(h,e);if(b!==undefined)h[e]=b;else delete h[e]}return c.call(f,i,h)}p.lastIndex=0;if(p.test(a))a=a.replace(p,function(f){return"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, +"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){a=eval("("+a+")");return typeof c==="function"?d({"":a},""):a}throw new SyntaxError("JSON.parse");}})(); + Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-07 07:17:44
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/fcbe7b63c59f/ changeset: fcbe7b63c59f branches: user: all...@sod19.asu.edu date: 2011-06-07 09:17:08 summary: updating alert message affected #: 1 file (360 bytes) --- a/vcweb/forestry/templates/forestry/chat.html Mon Jun 06 23:52:29 2011 -0700 +++ b/vcweb/forestry/templates/forestry/chat.html Tue Jun 07 00:17:08 2011 -0700 @@ -49,11 +49,15 @@ {% block page %} <h3>Chat</h3> - <div class='info ui-corner-all'> - <span class='icon-left ui-icon ui-icon-info'></span> - <b> - Hello, {{participant.full_name}}. - You are participant {{ participant_group_relationship.participant_number }} in {{participant_group_relationship.group}}. + <div class='alert infoIcon ui-corner-all'> + You are <b>participant {{ participant_group_relationship.participant_number }}.</b> + You can now chat about any aspect of the experiment with the other members of your group with two restrictions: + <ol> + <li>You cannot promise side payments after the experiment is completed + <li>You cannot threaten any member of your group with any consequences after the experiment is completed + </ol> + We are monitoring the chat traffic and if we detect any violation + of these rules you will be removed from the experiment. </b></div><div id='chat-div' class='chat notice ui-corner-all'> Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-07 06:52:28
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/309d346919b1/ changeset: 309d346919b1 branches: user: alllee date: 2011-06-07 08:52:29 summary: updated wait page affected #: 1 file (148 bytes) --- a/vcweb/forestry/templates/forestry/wait.html Mon Jun 06 21:51:43 2011 -0700 +++ b/vcweb/forestry/templates/forestry/wait.html Mon Jun 06 23:52:29 2011 -0700 @@ -33,14 +33,11 @@ {% block page %} <h3>Waiting for the next round to start</h3><p> -The facilitator will start the next round when every participant is ready. -<br/> +Please wait, {{request.user.participant}}. The facilitator will start the next round when every participant is ready. +</p><div class='ui-state-highlight ui-corner-all'><small><span class='float-left vcweb-ui-icon ui-icon ui-icon-circle-arrow-w'></span><a href='participate'>return to participation page</a></small></div> -<br/> -</p> - <h3>Participant History</h3><div id='group-history'> {% if participant_history %} @@ -86,11 +83,4 @@ {% endif %} </div> -<h3>Instructions</h3> -<div class='info ui-corner-all'> - Please wait until the next round begins. - {% comment%} - add ajax spinner and polling - {% endcomment %} -</div> {% endblock %} Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-07 04:51:41
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/2b9e27121b41/ changeset: 2b9e27121b41 branches: user: alllee date: 2011-06-07 06:51:43 summary: changing local back to run so deploy works properly affected #: 1 file (2 bytes) --- a/vcweb/fabfile.py Mon Jun 06 21:42:38 2011 -0700 +++ b/vcweb/fabfile.py Mon Jun 06 21:51:43 2011 -0700 @@ -74,7 +74,7 @@ def _virtualenv(*commands, **kwargs): """ source the virtualenv before executing this command """ env.command = ' && '.join(commands) - return local('. %(virtualenv_path)s/bin/activate && %(command)s' % env, **kwargs) + return run('. %(virtualenv_path)s/bin/activate && %(command)s' % env, **kwargs) def pip(): ''' looks for requirements.pip in the django project directory ''' Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-07 04:42:40
|
2 new changesets in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/77338d6a7376/ changeset: 77338d6a7376 branches: user: alllee date: 2011-06-07 02:23:47 summary: adding more logging in preparation for tomorrow's pretest affected #: 4 files (1.1 KB) --- a/vcweb/core/templates/includes/participant.events.html Mon Jun 06 15:00:08 2011 -0700 +++ b/vcweb/core/templates/includes/participant.events.html Mon Jun 06 17:23:47 2011 -0700 @@ -19,10 +19,10 @@ "message": payload }; } -function createChatEvent(message) { - return createMessageEvent(message); +function createChatEvent(payload) { + return createMessageEvent(payload); } -function createSubmitEvent(message) { - return createMessageEvent(message, "submit"); +function createSubmitEvent(payload) { + return createMessageEvent(payload, "submit"); } </script> --- a/vcweb/forestry/templates/forestry/participate.html Mon Jun 06 15:00:08 2011 -0700 +++ b/vcweb/forestry/templates/forestry/participate.html Mon Jun 06 17:23:47 2011 -0700 @@ -1,6 +1,7 @@ {% extends "participant/base.html" %} {% block head %} {{ block.super }} +{% comment %}{% include "includes/jquery.confirm.html" %} {%endcomment%} <script type="text/javascript"> $(function() { $("#forestry-form").validate({ @@ -32,11 +33,26 @@ } }); $('#forestry-form').submit(function() { - $(this).attr('disabled', true); - harvestDecisionValue = $('#harvest-decision-id').val(); + $('#submit').prop("disabled", true); + var harvestDecisionValue = $('#harvest-decision-id').val(); + // FIXME: this isn't getting sent through properly before the submit occurs. s.send(createSubmitEvent(harvestDecisionValue)); return true; }); + /* + $('#submit').click(function() { + $(this).fastConfirm({ + questionText: "Submit your harvest decision of " + harvestDecisionValue + "?", + onProceed: function(trigger) { + $('#forestry-form').submit(); + $(trigger).fastConfirm('close'); + }, + onCancel: function(trigger) { + $(trigger).fastConfirm('close'); + } + }); + }); + */ }); </script> {% endblock %} @@ -80,7 +96,7 @@ <input id='harvest-decision-id' style='width: 2em; text-align: right;' type="text" name='harvest_decision' class='required digits' maxlength='1'/></div><div> - <button type='submit'>Harvest</button> + <button id='submit' type='submit'>Harvest</button></div></form> {% else %} --- a/vcweb/forestry/views.py Mon Jun 06 15:00:08 2011 -0700 +++ b/vcweb/forestry/views.py Mon Jun 06 17:23:47 2011 -0700 @@ -114,10 +114,11 @@ class ParticipateView(SingleObjectTemplateResponseMixin, ParticipantSingleExperimentMixin, View): template_name_field = 'current_round_template' -# FIXME: refactor this ugliness +# FIXME: refactor the conditional logic here. @participant_required def participate(request, experiment_id=None): participant = request.user.participant + logger.debug("handling participate request for %s and experiment %s", participant, experiment_id) try: experiment = Experiment.objects.get(pk=experiment_id) current_round = experiment.current_round @@ -190,13 +191,14 @@ }, context_instance=RequestContext(request)) + +# FIXME: figure out the appropriate place for this trees = { 'deciduous': { 'name': 'deciduous-tree', 'height': 32 }, 'pine': {'name': 'pine-tree', 'height': 79 }, } - - def play(request, experiment, participant): + logger.debug("handling play request for participant %s and experiment %s", participant, experiment) form = HarvestDecisionForm(request.POST or None) participant_group_relationship = participant.get_participant_group_relationship(experiment) participant_experiment_relationship = participant.get_participant_experiment_relationship(experiment) --- a/vcweb/vcwebio.py Mon Jun 06 15:00:08 2011 -0700 +++ b/vcweb/vcwebio.py Mon Jun 06 17:23:47 2011 -0700 @@ -41,13 +41,15 @@ refresh_json = simplejson.dumps({ 'message_type': 'refresh' }) def add_experimenter(self, connection, incoming_experimenter_pk, incoming_experiment_pk): + logger.debug("experimenter_to_connection: %s", self.experimenter_to_connection) + logger.debug("connection_to_experimenter: %s", self.connection_to_experimenter) experimenter_pk = int(incoming_experimenter_pk) experiment_id = int(incoming_experiment_pk) experimenter_tuple = (experimenter_pk, experiment_id) logger.debug("registering experimenter %s with connection %s", experimenter_pk, connection) if connection in self.connection_to_experimenter: - logger.debug("experimenter already registered, removing previous mapping") - self.remove_experimenter(connection) + logger.debug("this experimenter has an existing connection (%s <-> %s) ", + self.connection_to_experimenter[connection], experimenter_tuple) self.connection_to_experimenter[connection] = experimenter_tuple self.experimenter_to_connection[experimenter_tuple] = connection @@ -67,20 +69,12 @@ logger.debug("Didn't find connection %s in connection map %s.", connection, self.connection_to_participant) return None - def get_experiment(self, connection): - if connection in self.connection_to_participant: - experiment_pk = self.connection_to_participant[connection][1] - return Experiment.objects.get(pk=experiment_pk) - else: - return None - def get_participant_experiment_tuple(self, connection): - if connection in self.connection_to_participant: - return self.connection_to_participant[connection] - else: - return None + return self.connection_to_participant[connection] def add_participant(self, auth_token, connection, participant_experiment_relationship): + logger.debug("connection to participant: %s", self.connection_to_participant) + logger.debug("participant to connection: %s", self.participant_to_connection) participant_tuple = (participant_experiment_relationship.participant.pk, participant_experiment_relationship.experiment.pk) if participant_tuple in self.participant_to_connection: logger.debug("participant already has a connection, removing previous mappings.") @@ -197,6 +191,7 @@ logger.debug("sending all connected participants %s to %s", notified_participants, url) def on_close(self): + logger.debug("removing experimenter connection %s", self) connection_manager.remove_experimenter(self) class ParticipantHandler(SocketConnection): @@ -241,6 +236,7 @@ elif event.message_type == 'submit': (participant_pk, experiment_pk) = connection_manager.get_participant_experiment_tuple(self) experiment = Experiment.objects.get(pk=experiment_pk) + logger.debug("processing participant submission for participant %s and experiment %s", participant_pk, experiment) # sanity check, make sure this is a data round. if experiment.is_data_round_in_progress: experimenter_tuple = (experiment.experimenter.pk, experiment.pk) @@ -252,7 +248,7 @@ event.participant_number = participant_group_relationship.participant_number event.participant_group = participant_group_relationship.group_number json = simplejson.dumps(event.__dict__) - logger.debug("json is: %s", json) + logger.debug("submit event json: %s", json) connection_manager.send_to_experimenter(experimenter_tuple, json) if experiment.all_participants_have_submitted: connection_manager.send_to_experimenter( http://bitbucket.org/virtualcommons/vcweb/changeset/1d2e56f95c58/ changeset: 1d2e56f95c58 branches: user: alllee date: 2011-06-07 06:42:38 summary: fixes issue 12 and issue 10 affected #: 3 files (494 bytes) --- a/vcweb/core/models.py Mon Jun 06 17:23:47 2011 -0700 +++ b/vcweb/core/models.py Mon Jun 06 21:42:38 2011 -0700 @@ -834,6 +834,7 @@ boolean_value = models.NullBooleanField(null=True, blank=True) date_created = models.DateTimeField(auto_now_add=True) last_modified = models.DateTimeField(auto_now=True) + is_active = models.BooleanField(default=True) @property def value(self): --- a/vcweb/forestry/templates/forestry/participate.html Mon Jun 06 17:23:47 2011 -0700 +++ b/vcweb/forestry/templates/forestry/participate.html Mon Jun 06 21:42:38 2011 -0700 @@ -33,9 +33,10 @@ } }); $('#forestry-form').submit(function() { - $('#submit').prop("disabled", true); + $('#submit').button("disable"); var harvestDecisionValue = $('#harvest-decision-id').val(); - // FIXME: this isn't getting sent through properly before the submit occurs. + // FIXME: this isn't getting sent through properly before the submit occurs. + // Should work out communicating directly from Django to the tornadio process. s.send(createSubmitEvent(harvestDecisionValue)); return true; }); --- a/vcweb/vcwebio.py Mon Jun 06 17:23:47 2011 -0700 +++ b/vcweb/vcwebio.py Mon Jun 06 21:42:38 2011 -0700 @@ -12,6 +12,7 @@ from vcweb.core.models import ParticipantExperimentRelationship, ParticipantGroupRelationship, ChatMessage, Experimenter, Experiment from vcweb import settings +# FIXME: currently tornadio.vcweb to avoid confusion with vcweb loggers logger = logging.getLogger('tornadio.vcweb') def info_json(message): @@ -32,12 +33,18 @@ ''' Manages socket.io connections to tornadio. ''' - # bidi maps for (participant.pk, experiment.pk) -> connection + # bidi maps for (participant.pk, experiment.pk) -> SocketConnection connection_to_participant = {} participant_to_connection = {} - # bidi maps for (experimenter.pk, experiment.pk) -> connection + # bidi maps for (experimenter.pk, experiment.pk) -> SocketConnection connection_to_experimenter = {} experimenter_to_connection = {} + ''' + We use participant_pk + experiment_pk tuples as keys in these bidimaps because + groups may not have formed yet. + FIXME: consider refactoring core so that an "all" group always exists in an + experiment. + ''' refresh_json = simplejson.dumps({ 'message_type': 'refresh' }) def add_experimenter(self, connection, incoming_experimenter_pk, incoming_experiment_pk): @@ -56,7 +63,7 @@ def remove_experimenter(self, connection): if connection in self.connection_to_experimenter: experimenter_tuple = self.connection_to_experimenter[connection] - logger.debug("removing experimenter %s", experimenter_tuple[0]) + logger.debug("removing experimenter %s", experimenter_tuple) del self.connection_to_experimenter[connection] if experimenter_tuple in self.experimenter_to_connection: del self.experimenter_to_connection[experimenter_tuple] @@ -66,7 +73,7 @@ (participant_pk, experiment_pk) = self.connection_to_participant[connection] logger.debug("Looking for ParticipantGroupRelationship with tuple (%s, %s)", participant_pk, experiment_pk) return ParticipantGroupRelationship.objects.get(participant__pk=participant_pk, group__experiment__pk = experiment_pk) - logger.debug("Didn't find connection %s in connection map %s.", connection, self.connection_to_participant) + logger.warning("Couldn't find a participant group relationship using connection %s in connection map %s", connection, self.connection_to_participant) return None def get_participant_experiment_tuple(self, connection): Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-06 22:00:16
|
2 new changesets in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/526efcd8ca87/ changeset: 526efcd8ca87 branches: user: alllee date: 2011-06-06 22:20:59 summary: updating socket.io to latest version from github, trying to fix wait page issue with socket.io affected #: 3 files (6.8 KB) --- a/vcweb/core/templates/contact.html Fri Jun 03 17:14:35 2011 -0700 +++ b/vcweb/core/templates/contact.html Mon Jun 06 13:20:59 2011 -0700 @@ -9,9 +9,7 @@ Please feel free to send us feedback, suggestions, or comments via our <a class='external' href='http://commons.asu.edu/contact'>contact form</a>. <br/><br/> - We also maintain an issue tracker at <a class='external' href='https://bitbucket.org/virtualcommons/vcweb/issues'>BitBucket</a> - and <a class='external' href='http://sourceforge.net/apps/trac/virtualcommons/'>SourceForge</a> - (one of these will eventually be retired). + We also maintain an issue tracker at <a class='external' href='https://bitbucket.org/virtualcommons/vcweb/issues'>BitBucket</a>. </div></div> {% endblock page %} --- a/vcweb/forestry/templates/forestry/wait.html Fri Jun 03 17:14:35 2011 -0700 +++ b/vcweb/forestry/templates/forestry/wait.html Mon Jun 06 13:20:59 2011 -0700 @@ -1,8 +1,8 @@ {% extends "participant/base.html" %} {% block head %} {{ block.super }} +{% include "includes/socket.io.html" %} {% include "includes/participant.events.html" %} -{% include "includes/socket.io.html" %} {% include "includes/tablesorter.html" %} <script type="text/javascript"> $(function() { --- a/vcweb/static/js/socket.io.min.js Fri Jun 03 17:14:35 2011 -0700 +++ b/vcweb/static/js/socket.io.min.js Mon Jun 06 13:20:59 2011 -0700 @@ -1,2 +1,2 @@ -/* Socket.IO.min 0.6.2 @author Guillermo Rauch <gui...@le...>, @license The MIT license., @copyright Copyright (c) 2010 LearnBoost <de...@le...> */ -var io=this.io={version:"0.6.2",setPath:function(a){window.console&&console.error&&console.error("io.setPath will be removed. Please set the variable WEB_SOCKET_SWF_LOCATION pointing to WebSocketMain.swf"),this.path=/\/$/.test(a)?a:a+"/",WEB_SOCKET_SWF_LOCATION=a+"lib/vendor/web-socket-js/WebSocketMain.swf"}};"jQuery"in this&&(jQuery.io=this.io),typeof window!="undefined"&&typeof WEB_SOCKET_SWF_LOCATION=="undefined"&&(WEB_SOCKET_SWF_LOCATION="/socket.io/lib/vendor/web-socket-js/WebSocketMain.swf"),function(){var a=this.io,b=!1;a.util={load:function(a){if(/loaded|complete/.test(document.readyState)||b)return a();"attachEvent"in window?window.attachEvent("onload",a):window.addEventListener("load",a,!1)},defer:function(b){if(!a.util.webkit)return b();a.util.load(function(){setTimeout(b,100)})},inherit:function(a,b){for(var c in b.prototype)a.prototype[c]=b.prototype[c]},indexOf:function(a,b,c){for(var d=a.length,e=c<0?Math.max(0,d+c):c||0;e<d;e++)if(a[e]===b)return e;return-1},isArray:function(a){return Object.prototype.toString.call(a)==="[object Array]"},merge:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}},a.util.webkit=/webkit/i.test(navigator.userAgent),a.util.load(function(){b=!0})}(),function(){var a=this.io,b="~m~",c=function(a){if(Object.prototype.toString.call(a)=="[object Object]"){if(!("JSON"in window)){var b="Socket.IO Error: Trying to encode as JSON, but JSON.stringify is missing.";if("console"in window&&console.error)console.error(b);else throw new Error(b);return'{ "$error": "'+b+'" }'}return"~j~"+JSON.stringify(a)}return String(a)},d=a.Transport=function(b,c){this.base=b,this.options={timeout:15e3},a.util.merge(this.options,c)};d.prototype.send=function(){throw new Error("Missing send() implementation")},d.prototype.connect=function(){throw new Error("Missing connect() implementation")},d.prototype.disconnect=function(){throw new Error("Missing disconnect() implementation")},d.prototype.encode=function(d){var e="",f;d=a.util.isArray(d)?d:[d];for(var g=0,h=d.length;g<h;g++)f=d[g]===null||d[g]===undefined?"":c(d[g]),e+=b+f.length+b+f;return e},d.prototype.decode=function(a){var c=[],d,e;do{if(a.substr(0,3)!==b)return c;a=a.substr(3),d="",e="";for(var f=0,g=a.length;f<g;f++){e=Number(a.substr(f,1));if(a.substr(f,1)==e)d+=e;else{a=a.substr(d.length+b.length),d=Number(d);break}}c.push(a.substr(0,d)),a=a.substr(d)}while(a!=="");return c},d.prototype.onData=function(a){this.setTimeout();var b=this.decode(a);if(b&&b.length)for(var c=0,d=b.length;c<d;c++)this.onMessage(b[c])},d.prototype.setTimeout=function(){var a=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){a.onTimeout()},this.options.timeout)},d.prototype.onTimeout=function(){this.onDisconnect()},d.prototype.onMessage=function(a){this.sessionid?a.substr(0,3)=="~h~"?this.onHeartbeat(a.substr(3)):a.substr(0,3)=="~j~"?this.base.onMessage(JSON.parse(a.substr(3))):this.base.onMessage(a):(this.sessionid=a,this.onConnect())},d.prototype.onHeartbeat=function(a){this.send("~h~"+a)},d.prototype.onConnect=function(){this.connected=!0,this.connecting=!1,this.base.onConnect(),this.setTimeout()},d.prototype.onDisconnect=function(){this.connecting=!1,this.connected=!1,this.sessionid=null,this.base.onDisconnect()},d.prototype.prepareUrl=function(){return(this.base.options.secure?"https":"http")+"://"+this.base.host+":"+this.base.options.port+"/"+this.base.options.resource+"/"+this.type+(this.sessionid?"/"+this.sessionid:"/")}}(),function(){var a=this.io,b=new Function,c=function(){if(!("XMLHttpRequest"in window))return!1;var a=new XMLHttpRequest;return a.withCredentials!=undefined}(),d=function(a){if("XDomainRequest"in window&&a)return new XDomainRequest;if("XMLHttpRequest"in window&&(!a||c))return new XMLHttpRequest;if(!a){try{var b=new ActiveXObject("MSXML2.XMLHTTP");return b}catch(d){}try{var e=new ActiveXObject("Microsoft.XMLHTTP");return e}catch(d){}}return!1},e=a.Transport.XHR=function(){a.Transport.apply(this,arguments),this.sendBuffer=[]};a.util.inherit(e,a.Transport),e.prototype.connect=function(){this.get();return this},e.prototype.checkSend=function(){if(!this.posting&&this.sendBuffer.length){var a=this.encode(this.sendBuffer);this.sendBuffer=[],this.sendIORequest(a)}},e.prototype.send=function(b){a.util.isArray(b)?this.sendBuffer.push.apply(this.sendBuffer,b):this.sendBuffer.push(b),this.checkSend();return this},e.prototype.sendIORequest=function(a){var c=this;this.posting=!0,this.sendXHR=this.request("send","POST"),this.sendXHR.onreadystatechange=function(){var a;if(c.sendXHR.readyState==4){c.sendXHR.onreadystatechange=b;try{a=c.sendXHR.status}catch(d){}c.posting=!1,a==200?c.checkSend():c.onDisconnect()}},this.sendXHR.send("data="+encodeURIComponent(a))},e.prototype.disconnect=function(){this.onDisconnect();return this},e.prototype.onDisconnect=function(){if(this.xhr){this.xhr.onreadystatechange=b;try{this.xhr.abort()}catch(c){}this.xhr=null}if(this.sendXHR){this.sendXHR.onreadystatechange=b;try{this.sendXHR.abort()}catch(c){}this.sendXHR=null}this.sendBuffer=[],a.Transport.prototype.onDisconnect.call(this)},e.prototype.request=function(a,b,c){var e=d(this.base.isXDomain());c&&(e.multipart=!0),e.open(b||"GET",this.prepareUrl()+(a?"/"+a:"")),b=="POST"&&"setRequestHeader"in e&&e.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");return e},e.check=function(a){try{if(d(a))return!0}catch(b){}return!1},e.xdomainCheck=function(){return e.check(!0)},e.request=d}(),function(){var a=this.io,b=a.Transport.websocket=function(){a.Transport.apply(this,arguments)};a.util.inherit(b,a.Transport),b.prototype.type="websocket",b.prototype.connect=function(){var a=this;this.socket=new WebSocket(this.prepareUrl()),this.socket.onmessage=function(b){a.onData(b.data)},this.socket.onclose=function(b){a.onDisconnect()},this.socket.onerror=function(b){a.onError(b)};return this},b.prototype.send=function(a){this.socket&&this.socket.send(this.encode(a));return this},b.prototype.disconnect=function(){this.socket&&this.socket.close();return this},b.prototype.onError=function(a){this.base.emit("error",[a])},b.prototype.prepareUrl=function(){return(this.base.options.secure?"wss":"ws")+"://"+this.base.host+":"+this.base.options.port+"/"+this.base.options.resource+"/"+this.type+(this.sessionid?"/"+this.sessionid:"")},b.check=function(){return"WebSocket"in window&&WebSocket.prototype&&WebSocket.prototype.send&&!!WebSocket.prototype.send.toString().match(/native/i)&&typeof WebSocket!="undefined"},b.xdomainCheck=function(){return!0}}(),function(){var a=this.io,b=a.Transport.flashsocket=function(){a.Transport.websocket.apply(this,arguments)};a.util.inherit(b,a.Transport.websocket),b.prototype.type="flashsocket",b.prototype.connect=function(){var b=this,c=arguments;WebSocket.__addTask(function(){a.Transport.websocket.prototype.connect.apply(b,c)});return this},b.prototype.send=function(){var b=this,c=arguments;WebSocket.__addTask(function(){a.Transport.websocket.prototype.send.apply(b,c)});return this},b.check=function(){if(typeof WebSocket=="undefined"||!("__addTask"in WebSocket)||!swfobject)return!1;return swfobject.hasFlashPlayerVersion("10.0.0")},b.xdomainCheck=function(){return!0}}(),function(){var a=this.io,b=a.Transport.htmlfile=function(){a.Transport.XHR.apply(this,arguments)};a.util.inherit(b,a.Transport.XHR),b.prototype.type="htmlfile",b.prototype.get=function(){var a=this;this.open(),window.attachEvent("onunload",function(){a.destroy()})},b.prototype.open=function(){this.doc=new ActiveXObject("htmlfile"),this.doc.open(),this.doc.write("<html></html>"),this.doc.parentWindow.s=this,this.doc.close();var a=this.doc.createElement("div");this.doc.body.appendChild(a),this.iframe=this.doc.createElement("iframe"),a.appendChild(this.iframe),this.iframe.src=this.prepareUrl()+"/"+ +(new Date)},b.prototype._=function(a,b){this.onData(a);var c=b.getElementsByTagName("script")[0];c.parentNode.removeChild(c)},b.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(a){}this.doc=null,CollectGarbage()}},b.prototype.disconnect=function(){this.destroy();return a.Transport.XHR.prototype.disconnect.call(this)},b.check=function(){if("ActiveXObject"in window)try{var b=new ActiveXObject("htmlfile");return b&&a.Transport.XHR.check()}catch(c){}return!1},b.xdomainCheck=function(){return!1}}(),function(){var a=this.io,b=a.Transport["xhr-multipart"]=function(){a.Transport.XHR.apply(this,arguments)};a.util.inherit(b,a.Transport.XHR),b.prototype.type="xhr-multipart",b.prototype.get=function(){var a=this;this.xhr=this.request("","GET",!0),this.xhr.onreadystatechange=function(){a.xhr.readyState==4&&a.onData(a.xhr.responseText)},this.xhr.send(null)},b.check=function(){return"XMLHttpRequest"in window&&"prototype"in XMLHttpRequest&&"multipart"in XMLHttpRequest.prototype},b.xdomainCheck=function(){return!0}}(),function(){var a=this.io,b=new Function,c=a.Transport["xhr-polling"]=function(){a.Transport.XHR.apply(this,arguments)};a.util.inherit(c,a.Transport.XHR),c.prototype.type="xhr-polling",c.prototype.connect=function(){var b=this;a.util.defer(function(){a.Transport.XHR.prototype.connect.call(b)});return!1},c.prototype.get=function(){var a=this;this.xhr=this.request(+(new Date),"GET"),this.xhr.onreadystatechange=function(){var c;if(a.xhr.readyState==4){a.xhr.onreadystatechange=b;try{c=a.xhr.status}catch(d){}c==200?(a.onData(a.xhr.responseText),a.get()):a.onDisconnect()}},this.xhr.send(null)},c.check=function(){return a.Transport.XHR.check()},c.xdomainCheck=function(){return a.Transport.XHR.xdomainCheck()}}(),function(){var a=this.io,b=a.Transport["jsonp-polling"]=function(){a.Transport.XHR.apply(this,arguments),this.insertAt=document.getElementsByTagName("script")[0],this.index=a.JSONP.length,a.JSONP.push(this)};a.util.inherit(b,a.Transport["xhr-polling"]),a.JSONP=[],b.prototype.type="jsonp-polling",b.prototype.sendIORequest=function(a){function h(){b.iframe&&b.form.removeChild(b.iframe);try{f=document.createElement('<iframe name="'+b.iframeId+'">')}catch(a){f=document.createElement("iframe"),f.name=b.iframeId}f.id=b.iframeId,b.form.appendChild(f),b.iframe=f}function g(){h(),b.posting=!1,b.checkSend()}var b=this;if(!("form"in this)){var c=document.createElement("FORM"),d=document.createElement("TEXTAREA"),e=this.iframeId="socket_io_iframe_"+this.index,f;c.style.position="absolute",c.style.top="-1000px",c.style.left="-1000px",c.target=e,c.method="POST",c.action=this.prepareUrl()+"/"+ +(new Date)+"/"+this.index,d.name="data",c.appendChild(d),this.insertAt.parentNode.insertBefore(c,this.insertAt),document.body.appendChild(c),this.form=c,this.area=d}h(),this.posting=!0,this.area.value=a;try{this.form.submit()}catch(i){}this.iframe.attachEvent?f.onreadystatechange=function(){b.iframe.readyState=="complete"&&g()}:this.iframe.onload=g},b.prototype.get=function(){var a=this,b=document.createElement("SCRIPT");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),b.async=!0,b.src=this.prepareUrl()+"/"+ +(new Date)+"/"+this.index,b.onerror=function(){a.onDisconnect()},this.insertAt.parentNode.insertBefore(b,this.insertAt),this.script=b},b.prototype._=function(){this.onData.apply(this,arguments),this.get();return this},b.check=function(){return!0},b.xdomainCheck=function(){return!0}}(),function(){var a=this.io,b=a.Socket=function(b,c){this.host=b||document.domain,this.options={secure:!1,document:document,port:document.location.port||80,resource:"socket.io",transports:["websocket","flashsocket","htmlfile","xhr-multipart","xhr-polling","jsonp-polling"],transportOptions:{"xhr-polling":{timeout:25e3},"jsonp-polling":{timeout:25e3}},connectTimeout:5e3,tryTransportsOnConnectTimeout:!0,reconnect:!0,reconnectionDelay:500,maxReconnectionAttempts:10,rememberTransport:!0},a.util.merge(this.options,c),this.connected=!1,this.connecting=!1,this.reconnecting=!1,this.events={},this.transport=this.getTransport(),!this.transport&&"console"in window&&console.error("No transport available")};b.prototype.getTransport=function(b){var c=b||this.options.transports,d;this.options.rememberTransport&&!b&&(d=this.options.document.cookie.match("(?:^|;)\\s*socketio=([^;]*)"),d&&(this.rememberedTransport=!0,c=[decodeURIComponent(d[1])]));for(var e=0,f;f=c[e];e++)if(a.Transport[f]&&a.Transport[f].check()&&(!this.isXDomain()||a.Transport[f].xdomainCheck()))return new a.Transport[f](this,this.options.transportOptions[f]||{});return null},b.prototype.connect=function(a){if(this.transport&&!this.connected){this.connecting&&this.disconnect(!0),this.connecting=!0,this.emit("connecting",[this.transport.type]),this.transport.connect();if(this.options.connectTimeout){var b=this;this.connectTimeoutTimer=setTimeout(function(){if(!b.connected){b.disconnect(!0);if(b.options.tryTransportsOnConnectTimeout&&!b.rememberedTransport){b.remainingTransports||(b.remainingTransports=b.options.transports.slice(0));var a=b.remainingTransports;while(a.length>0&&a.splice(0,1)[0]!=b.transport.type);a.length&&(b.transport=b.getTransport(a),b.connect())}(!b.remainingTransports||b.remainingTransports.length==0)&&b.emit("connect_failed")}b.remainingTransports&&b.remainingTransports.length==0&&delete b.remainingTransports},this.options.connectTimeout)}}a&&typeof a=="function"&&this.once("connect",a);return this},b.prototype.send=function(a){if(!this.transport||!this.transport.connected)return this.queue(a);this.transport.send(a);return this},b.prototype.disconnect=function(a){this.connectTimeoutTimer&&clearTimeout(this.connectTimeoutTimer),a||(this.options.reconnect=!1),this.transport.disconnect();return this},b.prototype.on=function(a,b){a in this.events||(this.events[a]=[]),this.events[a].push(b);return this},b.prototype.once=function(a,b){var c=this,d=function(){c.removeEvent(a,d),b.apply(c,arguments)};d.ref=b,c.on(a,d);return this},b.prototype.emit=function(a,b){if(a in this.events){var c=this.events[a].concat();for(var d=0,e=c.length;d<e;d++)c[d].apply(this,b===undefined?[]:b)}return this},b.prototype.removeEvent=function(a,b){if(a in this.events)for(var c=0,d=this.events[a].length;c<d;c++)(this.events[a][c]==b||this.events[a][c].ref&&this.events[a][c].ref==b)&&this.events[a].splice(c,1);return this},b.prototype.queue=function(a){"queueStack"in this||(this.queueStack=[]),this.queueStack.push(a);return this},b.prototype.doQueue=function(){if(!("queueStack"in this)||!this.queueStack.length)return this;this.transport.send(this.queueStack),this.queueStack=[];return this},b.prototype.isXDomain=function(){var a=window.location.port||80;return this.host!==document.domain||this.options.port!=a},b.prototype.onConnect=function(){this.connected=!0,this.connecting=!1,this.doQueue(),this.options.rememberTransport&&(this.options.document.cookie="socketio="+encodeURIComponent(this.transport.type)),this.emit("connect")},b.prototype.onMessage=function(a){this.emit("message",[a])},b.prototype.onDisconnect=function(){var a=this.connected;this.connected=!1,this.connecting=!1,this.queueStack=[],a&&(this.emit("disconnect"),this.options.reconnect&&!this.reconnecting&&this.onReconnect())},b.prototype.onReconnect=function(){function e(){if(!!a.reconnecting)if(!a.connected){if(a.connecting&&a.reconnecting)return a.reconnectionTimer=setTimeout(e,1e3);a.reconnectionAttempts++>=a.options.maxReconnectionAttempts?a.redoTransports?(a.emit("reconnect_failed"),d()):(a.on("connect_failed",e),a.options.tryTransportsOnConnectTimeout=!0,a.transport=a.getTransport(a.options.transports),a.redoTransports=!0,a.connect()):(a.reconnectionDelay*=2,a.connect(),a.emit("reconnecting",[a.reconnectionDelay,a.reconnectionAttempts]),a.reconnectionTimer=setTimeout(e,a.reconnectionDelay))}else d()}function d(){a.connected&&a.emit("reconnect",[a.transport.type,a.reconnectionAttempts]),a.removeEvent("connect_failed",e).removeEvent("connect",e),a.reconnecting=!1,delete a.reconnectionAttempts,delete a.reconnectionDelay,delete a.reconnectionTimer,delete a.redoTransports,a.options.tryTransportsOnConnectTimeout=b,a.options.rememberTransport=c;return}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options.reconnectionDelay;var a=this,b=this.options.tryTransportsOnConnectTimeout,c=this.options.rememberTransport;this.options.tryTransportsOnConnectTimeout=!1,this.reconnectionTimer=setTimeout(e,this.reconnectionDelay),this.on("connect",e)},b.prototype.fire=b.prototype.emit,b.prototype.addListener=b.prototype.addEvent=b.prototype.addEventListener=b.prototype.on,b.prototype.removeListener=b.prototype.removeEventListener=b.prototype.removeEvent}();var swfobject=function(){function V(b){var c=/[\\\"<>\.;]/,d=c.exec(b)!=null;return d&&typeof encodeURIComponent!=a?encodeURIComponent(b):b}function U(a,b){if(!!x){var c=b?"visible":"hidden";t&&P(a)?P(a).style.visibility=c:T("#"+a,"visibility:"+c)}}function T(c,d,e,f){if(!y.ie||!y.mac){var g=i.getElementsByTagName("head")[0];if(!g)return;var h=e&&typeof e=="string"?e:"screen";f&&(v=null,w=null);if(!v||w!=h){var j=Q("style");j.setAttribute("type","text/css"),j.setAttribute("media",h),v=g.appendChild(j),y.ie&&y.win&&typeof i.styleSheets!=a&&i.styleSheets.length>0&&(v=i.styleSheets[i.styleSheets.length-1]),w=h}y.ie&&y.win?v&&typeof v.addRule==b&&v.addRule(c,d):v&&typeof i.createTextNode!=a&&v.appendChild(i.createTextNode(c+" {"+d+"}"))}}function S(a){var b=y.pv,c=a.split(".");c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0;return b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function R(a,b,c){a.attachEvent(b,c),o[o.length]=[a,b,c]}function Q(a){return i.createElement(a)}function P(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function O(a){var b=P(a);if(b){for(var c in b)typeof b[c]=="function"&&(b[c]=null);b.parentNode.removeChild(b)}}function N(a){var b=P(a);b&&b.nodeName=="OBJECT"&&(y.ie&&y.win?(b.style.display="none",function(){b.readyState==4?O(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function M(a,b,c){var d=Q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function L(c,d,f){var g,h=P(f);if(y.wk&&y.wk<312)return g;if(h){typeof c.id==a&&(c.id=f);if(y.ie&&y.win){var i="";for(var j in c)c[j]!=Object.prototype[j]&&(j.toLowerCase()=="data"?d.movie=c[j]:j.toLowerCase()=="styleclass"?i+=' class="'+c[j]+'"':j.toLowerCase()!="classid"&&(i+=" "+j+'="'+c[j]+'"'));var k="";for(var l in d)d[l]!=Object.prototype[l]&&(k+='<param name="'+l+'" value="'+d[l]+'" />');h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+i+">"+k+"</object>",n[n.length]=c.id,g=P(c.id)}else{var m=Q(b);m.setAttribute("type",e);for(var o in c)c[o]!=Object.prototype[o]&&(o.toLowerCase()=="styleclass"?m.setAttribute("class",c[o]):o.toLowerCase()!="classid"&&m.setAttribute(o,c[o]));for(var p in d)d[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"&&M(m,p,d[p]);h.parentNode.replaceChild(m,h),g=m}}return g}function K(a){var c=Q("div");if(y.win&&y.ie)c.innerHTML=a.innerHTML;else{var d=a.getElementsByTagName(b)[0];if(d){var e=d.childNodes;if(e){var f=e.length;for(var g=0;g<f;g++)(e[g].nodeType!=1||e[g].nodeName!="PARAM")&&e[g].nodeType!=8&&c.appendChild(e[g].cloneNode(!0))}}}return c}function J(a){if(y.ie&&y.win&&a.readyState!=4){var b=Q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(K(a),b),a.style.display="none",function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(K(a),a)}function I(b,c,d,e){u=!0,r=e||null,s={success:!1,id:d};var g=P(d);if(g){g.nodeName=="OBJECT"?(p=K(g),q=null):(p=g,q=d),b.id=f;if(typeof b.width==a||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==a||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";i.title=i.title.slice(0,47)+" - Flash Player Installation";var j=y.ie&&y.win?"ActiveX":"PlugIn",k="MMredirectURL="+h.location.toString().replace(/&/g,"%26")+"&MMplayerType="+j+"&MMdoctitle="+i.title;typeof c.flashvars!=a?c.flashvars+="&"+k:c.flashvars=k;if(y.ie&&y.win&&g.readyState!=4){var l=Q("div");d+="SWFObjectNew",l.setAttribute("id",d),g.parentNode.insertBefore(l,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}()}L(b,c,d)}}function H(){return!u&&S("6.0.65")&&(y.win||y.mac)&&!(y.wk&&y.wk<312)}function G(c){var d=null,e=P(c);if(e&&e.nodeName=="OBJECT")if(typeof e.SetVariable!=a)d=e;else{var f=e.getElementsByTagName(b)[0];f&&(d=f)}return d}function F(){var b=m.length;if(b>0)for(var c=0;c<b;c++){var d=m[c].id,e=m[c].callbackFn,f={success:!1,id:d};if(y.pv[0]>0){var g=P(d);if(g)if(S(m[c].swfVersion)&&!(y.wk&&y.wk<312))U(d,!0),e&&(f.success=!0,f.ref=G(d),e(f));else if(m[c].expressInstall&&H()){var h={};h.data=m[c].expressInstall,h.width=g.getAttribute("width")||"0",h.height=g.getAttribute("height")||"0",g.getAttribute("class")&&(h.styleclass=g.getAttribute("class")),g.getAttribute("align")&&(h.align=g.getAttribute("align"));var i={},j=g.getElementsByTagName("param"),k=j.length;for(var l=0;l<k;l++)j[l].getAttribute("name").toLowerCase()!="movie"&&(i[j[l].getAttribute("name")]=j[l].getAttribute("value"));I(h,i,d,e)}else J(g),e&&e(f)}else{U(d,!0);if(e){var n=G(d);n&&typeof n.SetVariable!=a&&(f.success=!0,f.ref=n),e(f)}}}}function E(){var c=i.getElementsByTagName("body")[0],d=Q(b);d.setAttribute("type",e);var f=c.appendChild(d);if(f){var g=0;(function(){if(typeof f.GetVariable!=a){var b=f.GetVariable("$version");b&&(b=b.split(" ")[1].split(","),y.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)])}else if(g<10){g++,setTimeout(arguments.callee,10);return}c.removeChild(d),f=null,F()})()}else F()}function D(){k?E():F()}function C(b){if(typeof h.addEventListener!=a)h.addEventListener("load",b,!1);else if(typeof i.addEventListener!=a)i.addEventListener("load",b,!1);else if(typeof h.attachEvent!=a)R(h,"onload",b);else if(typeof h.onload=="function"){var c=h.onload;h.onload=function(){c(),b()}}else h.onload=b}function B(a){t?a():l[l.length]=a}function A(){if(!t){try{var a=i.getElementsByTagName("body")[0].appendChild(Q("span"));a.parentNode.removeChild(a)}catch(b){return}t=!0;var c=l.length;for(var d=0;d<c;d++)l[d]()}}var a="undefined",b="object",c="Shockwave Flash",d="ShockwaveFlash.ShockwaveFlash",e="application/x-shockwave-flash",f="SWFObjectExprInst",g="onreadystatechange",h=window,i=document,j=navigator,k=!1,l=[D],m=[],n=[],o=[],p,q,r,s,t=!1,u=!1,v,w,x=!0,y=function(){var f=typeof i.getElementById!=a&&typeof i.getElementsByTagName!=a&&typeof i.createElement!=a,g=j.userAgent.toLowerCase(),l=j.platform.toLowerCase(),m=l?/win/.test(l):/win/.test(g),n=l?/mac/.test(l):/mac/.test(g),o=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,p=!1,q=[0,0,0],r=null;if(typeof j.plugins!=a&&typeof j.plugins[c]==b)r=j.plugins[c].description,r&&(typeof j.mimeTypes==a||!j.mimeTypes[e]||!!j.mimeTypes[e].enabledPlugin)&&(k=!0,p=!1,r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),q[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10),q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10),q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof h.ActiveXObject!=a)try{var s=new ActiveXObject(d);s&&(r=s.GetVariable("$version"),r&&(p=!0,r=r.split(" ")[1].split(","),q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]))}catch(t){}return{w3:f,pv:q,wk:o,ie:p,win:m,mac:n}}(),z=function(){!y.w3||((typeof i.readyState!=a&&i.readyState=="complete"||typeof i.readyState==a&&(i.getElementsByTagName("body")[0]||i.body))&&A(),t||(typeof i.addEventListener!=a&&i.addEventListener("DOMContentLoaded",A,!1),y.ie&&y.win&&(i.attachEvent(g,function(){i.readyState=="complete"&&(i.detachEvent(g,arguments.callee),A())}),h==top&&function(){if(!t){try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}A()}}()),y.wk&&function(){if(!t){if(!/loaded|complete/.test(i.readyState)){setTimeout(arguments.callee,0);return}A()}}(),C(A)))}(),W=function(){y.ie&&y.win&&window.attachEvent("onunload",function(){var a=o.length;for(var b=0;b<a;b++)o[b][0].detachEvent(o[b][1],o[b][2]);var c=n.length;for(var d=0;d<c;d++)N(n[d]);for(var e in y)y[e]=null;y=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}();return{registerObject:function(a,b,c,d){if(y.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,m[m.length]=e,U(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){if(y.w3)return G(a)},embedSWF:function(c,d,e,f,g,h,i,j,k,l){var m={success:!1,id:d};y.w3&&!(y.wk&&y.wk<312)&&c&&d&&e&&f&&g?(U(d,!1),B(function(){e+="",f+="";var n={};if(k&&typeof k===b)for(var o in k)n[o]=k[o];n.data=c,n.width=e,n.height=f;var p={};if(j&&typeof j===b)for(var q in j)p[q]=j[q];if(i&&typeof i===b)for(var r in i)typeof p.flashvars!=a?p.flashvars+="&"+r+"="+i[r]:p.flashvars=r+"="+i[r];if(S(g)){var s=L(n,p,d);n.id==d&&U(d,!0),m.success=!0,m.ref=s}else{if(h&&H()){n.data=h,I(n,p,d,l);return}U(d,!0)}l&&l(m)})):l&&l(m)},switchOffAutoHideShow:function(){x=!1},ua:y,getFlashPlayerVersion:function(){return{major:y.pv[0],minor:y.pv[1],release:y.pv[2]}},hasFlashPlayerVersion:S,createSWF:function(a,b,c){return y.w3?L(a,b,c):undefined},showExpressInstall:function(a,b,c,d){y.w3&&H()&&I(a,b,c,d)},removeSWF:function(a){y.w3&&N(a)},createCSS:function(a,b,c,d){y.w3&&T(a,b,c,d)},addDomLoadEvent:B,addLoadEvent:C,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return V(b);var c=b.split("&");for(var d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return V(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(u){var a=P(f);a&&p&&(a.parentNode.replaceChild(p,a),q&&(U(q,!0),y.ie&&y.win&&(p.style.display="block")),r&&r(s)),u=!1}}}}();(function(){if(!window.WebSocket){var a=window.console;if(!a||!a.log||!a.error)a={log:function(){},error:function(){}};if(!swfobject.hasFlashPlayerVersion("10.0.0")){a.error("Flash Player >= 10.0.0 is required.");return}location.protocol=="file:"&&a.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),WebSocket=function(a,b,c,d,e){var f=this;f.__id=WebSocket.__nextId++,WebSocket.__instances[f.__id]=f,f.readyState=WebSocket.CONNECTING,f.bufferedAmount=0,f.__events={},b?typeof b=="string"&&(b=[b]):b=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(f.__id,a,b,c||null,d||0,e||null)})},0)},WebSocket.prototype.send=function(a){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var b=WebSocket.__flash.send(this.__id,encodeURIComponent(a));if(b<0)return!0;this.bufferedAmount+=b;return!1},WebSocket.prototype.close=function(){this.readyState!=WebSocket.CLOSED&&this.readyState!=WebSocket.CLOSING&&(this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id))},WebSocket.prototype.addEventListener=function(a,b,c){a in this.__events||(this.__events[a]=[]),this.__events[a].push(b)},WebSocket.prototype.removeEventListener=function(a,b,c){if(a in this.__events){var d=this.__events[a];for(var e=d.length-1;e>=0;--e)if(d[e]===b){d.splice(e,1);break}}},WebSocket.prototype.dispatchEvent=function(a){var b=this.__events[a.type]||[];for(var c=0;c<b.length;++c)b[c](a);var d=this["on"+a.type];d&&d(a)},WebSocket.prototype.__handleEvent=function(a){"readyState"in a&&(this.readyState=a.readyState),"protocol"in a&&(this.protocol=a.protocol);var b;if(a.type=="open"||a.type=="error")b=this.__createSimpleEvent(a.type);else if(a.type=="close")b=this.__createSimpleEvent("close");else{if(a.type!="message")throw"unknown event type: "+a.type;var c=decodeURIComponent(a.message);b=this.__createMessageEvent("message",c)}this.dispatchEvent(b)},WebSocket.prototype.__createSimpleEvent=function(a){if(document.createEvent&&window.Event){var b=document.createEvent("Event");b.initEvent(a,!1,!1);return b}return{type:a,bubbles:!1,cancelable:!1}},WebSocket.prototype.__createMessageEvent=function(a,b){if(document.createEvent&&window.MessageEvent&&!window.opera){var c=document.createEvent("MessageEvent");c.initMessageEvent("message",!1,!1,b,null,null,window,null);return c}return{type:a,data:b,bubbles:!1,cancelable:!1}},WebSocket.CONNECTING=0,WebSocket.OPEN=1,WebSocket.CLOSING=2,WebSocket.CLOSED=3,WebSocket.__flash=null,WebSocket.__instances={},WebSocket.__tasks=[],WebSocket.__nextId=0,WebSocket.loadFlashPolicyFile=function(a){WebSocket.__addTask(function(){WebSocket.__flash.loadManualPolicyFile(a)})},WebSocket.__initialize=function(){if(!WebSocket.__flash){WebSocket.__swfLocation&&(window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation);if(!window.WEB_SOCKET_SWF_LOCATION){a.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");return}var b=document.createElement("div");b.id="webSocketContainer",b.style.position="absolute",WebSocket.__isFlashLite()?(b.style.left="0px",b.style.top="0px"):(b.style.left="-100px",b.style.top="-100px");var c=document.createElement("div");c.id="webSocketFlash",b.appendChild(c),document.body.appendChild(b),swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","10.0.0",null,null,{hasPriority:!0,swliveconnect:!0,allowScriptAccess:"always"},null,function(b){b.success||a.error("[WebSocket] swfobject.embedSWF failed")})}},WebSocket.__onFlashInitialized=function(){setTimeout(function(){WebSocket.__flash=document.getElementById("webSocketFlash"),WebSocket.__flash.setCallerUrl(location.href),WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var a=0;a<WebSocket.__tasks.length;++a)WebSocket.__tasks[a]();WebSocket.__tasks=[]},0)},WebSocket.__onFlashEvent=function(){setTimeout(function(){try{var b=WebSocket.__flash.receiveEvents();for(var c=0;c<b.length;++c)WebSocket.__instances[b[c].webSocketId].__handleEvent(b[c])}catch(d){a.error(d)}},0);return!0},WebSocket.__log=function(b){a.log(decodeURIComponent(b))},WebSocket.__error=function(b){a.error(decodeURIComponent(b))},WebSocket.__addTask=function(a){WebSocket.__flash?a():WebSocket.__tasks.push(a)},WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return!1;var a=window.navigator.mimeTypes["application/x-shockwave-flash"];if(!a||!a.enabledPlugin||!a.enabledPlugin.filename)return!1;return a.enabledPlugin.filename.match(/flashlite/i)?!0:!1},window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",function(){WebSocket.__initialize()},!1):window.attachEvent("onload",function(){WebSocket.__initialize()}))}})() \ No newline at end of file +/* Socket.IO.min 0.7.0 @author Guillermo Rauch <gui...@le...>, @license The MIT license., @copyright Copyright (c) 2010 LearnBoost <de...@le...> */ +(function(a){var b=a;b.version="0.7.0",b.protocol=1,b.transports=["websocket","htmlfile","xhr-polling","jsonp-polling"],b.j=[],b.sockets={},"object"==typeof module&&"function"==typeof require&&(b.util=require("./util").util,b.EventEmitter=process.EventEmitter,b.Transport=require("./transport").Transport,b.transports.forEach(function(a){}),b.Socket=require("./socket").Socket),b.connect=function(a,c){var d=b.util.parseUri(a),e=b.util.uniqueUri(d);if(c||!b.sockets[e])var f=new b.Socket({host:d.host,secure:d.protocol=="https://",port:d.port||80});c||(this.sockets[e]=f);return f.of(d.path.length>1?d.path:"")}})("object"==typeof module?module.exports:window.io={}),function(a){function h(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}function g(){try{return new window.XMLHttpRequest}catch(a){}}var b=a.util={},c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,d=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];b.parseUri=function(a){var b=c.exec(a||""),e={},f=14;while(f--)e[d[f]]=b[f]||"";return e},b.uniqueUri=function(a){var b=a.protocol,c=a.host,d=a.port;"undefined"!=typeof document?(c=c||document.domain,d=d||document.location.port):(c="localhost",d=80);return(b||"http")+"://"+c+":"+(d||b&&b==="https"?443:80)};var e=!1;b.load=function(a){if(document.readyState==="complete"||e)return a();b.on(window,"load",a,!1)},b.on=function(a,b,c,d){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener(b,c,d)};var f="undefined"!=typeof window&&function(){if(!("XMLHttpRequest"in window))return!1;var a=new XMLHttpRequest;return a.withCredentials!=undefined}();b.request=function(a){return g()||window.ActiveXObject&&h()},"undefined"!=typeof window&&b.load(function(){e=!0}),b.defer=function(a){if(!b.ua.webkit)return a();b.load(function(){setTimeout(a,100)})},b.merge=function(a,b,c,d){var e=d||[],f=typeof c=="undefined"?2:c,g;for(g in b)b.hasOwnProperty(g)&&this.indexOf(e,g)<0&&(typeof a[g]!="object"||!f?(a[g]=b[g],e.push(b[g])):this.merge(a[g],b[g],f-1,e));return a},b.mixin=function(a,c){b.merge(a.prototype,c.prototype)},b.inherit=function(a,c){a.prototype=new c,b.merge(a,c)},b.isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},b.intersect=function(a,c){var d=[],e=a.length>c.length?a:c,f=a.length>c.length?c:a;for(var g=0,h=f.length;g<h;g++)~b.indexOf(e,f[g])&&d.push(f[g]);return d},b.indexOf=function(a,b,c){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b,c);for(var d=a.length,c=c<0?c+d<0?0:c+d:c||0;c<d&&a[c]!==b;c++);return d<=c?-1:c},b.ua={},b.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent)}("undefined"!=typeof window?io:module.exports),function(a,b){function c(){}a.EventEmitter=c,c.prototype.on=function(a,c){this.$events||(this.$events={}),this.$events[a]?b.util.isArray(this.$events[a])?this.$events[a].push(c):this.$events[a]=[this.$events[a],c]:this.$events[a]=c;return this},c.prototype.addListener=c.prototype.on,c.prototype.once=function(a,b){function d(){c.removeListener(a,d),b.apply(this,arguments)}var c=this;d.listener=b,this.on(a,d);return this},c.prototype.removeListener=function(a,c){if(this.$events&&this.$events[a]){var d=this.$events[a];if(b.util.isArray(d)){var e=-1;for(var f=0,g=d.length;f<g;f++)if(d[f]===c||d[f].listener&&d[f].listener===c){e=f;break}if(e<0)return this;d.splice(e,1),d.length||delete this.$events[a]}else(d===c||d.listener&&d.listener===c)&&delete this.$events[a]}return this},c.prototype.removeAllListeners=function(a){if(a===undefined){this.$events={};return this}this.$events&&this.$events[a]&&(this.$events[a]=null);return this},c.prototype.listeners=function(a){this.$events||(this.$events={}),this.$events[a]||(this.$events[a]=[]),b.util.isArray(this.$events[a])||(this.$events[a]=[this.$events[a]]);return this.$events[a]},c.prototype.emit=function(a){if(!this.$events)return!1;var c=this.$events[a];if(!c)return!1;var d=Array.prototype.slice.call(arguments,1);if("function"==typeof c)c.apply(this,d);else{if(!b.util.isArray(c))return!1;var e=c.slice();for(var f=0,g=e.length;f<g;f++)e[f].apply(this,d)}return!0}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(exports,nativeJSON){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i instanceof Date&&(i=date(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g;return e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)typeof rep[c]=="string"&&(d=rep[c],e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g;return e}}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function date(a,b){return isFinite(a.valueOf())?a.getUTCFullYear()+"-"+f(a.getUTCMonth()+1)+"-"+f(a.getUTCDate())+"T"+f(a.getUTCHours())+":"+f(a.getUTCMinutes())+":"+f(a.getUTCSeconds())+"Z":null}function f(a){return a<10?"0"+a:a}"use strict";if(nativeJSON&&nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(b&&typeof b!="function"&&(typeof b!="object"||typeof b.length!="number"))throw new Error("JSON.stringify");return str("",{"":a})},JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver=="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}("undefined"!=typeof io?io:module.exports,JSON),function(a,b){var c=a.parser={},d=c.packets=["disconnect","connect","heartbeat","message","json","event","ack","error"],e=c.reasons=["transport not supported","client not handshaken","unauthorized"],f=c.advice=["reconnect"],g=b.JSON,h=b.util.indexOf;c.encodePacket=function(a){var b=d.indexOf(a.type),c=a.id||"",h=a.endpoint||"",i=a.ack,j=null;switch(a.type){case"error":var k=a.reason?e.indexOf(a.reason):"",l=a.advice?f.indexOf(a.advice):"";if(k!==""||l!=="")j=k+(l!==""?"+"+l:"");break;case"message":a.data!==""&&(j=a.data);break;case"event":var m=a.args&&a.args.length?g.stringify(a.args):"";j=a.name+(m!==""?"�"+m:"");break;case"json":j=g.stringify(a.data);break;case"connect":a.qs&&(j=a.qs);break;case"ack":j=a.ackId+(a.args&&a.args.length?"+"+g.stringify(a.args):"");break;case"heartbeat":case"disconect":}var n=[b,c+(i=="data"?"+":""),h];j!==null&&j!==undefined&&n.push(j);return n.join(":")},c.encodePayload=function(a){var b="";if(a.length==1)return a[0];for(var c=0,d=a.length;c<d;c++){var e=a[c];b+="�"+e.length+"�"+a[c]}return b};var i=/^([^:]+):([0-9]+)?(\+)?:([^:]+)?:?(.*)?$/;c.decodePacket=function(a){var b=a.match(i);if(!b)return{};var c=b[2]||"",a=b[5]||"",h={type:d[b[1]],endpoint:b[4]||""};c&&(h.id=c,b[3]?h.ack="data":h.ack=!0);switch(h.type){case"error":var b=a.split("+");h.reason=e[b[0]]||"",h.advice=f[b[1]]||"";break;case"message":h.data=a||"";break;case"event":var b=a.match(/([^\ufffd]+)(\ufffd)?(.*)/);h.name=b[1]||"",h.args=[];if(b[3])try{h.args=g.parse(b[3])}catch(j){}break;case"json":try{h.data=g.parse(a)}catch(j){}break;case"connect":h.qs=a||"";break;case"ack":var b=a.match(/^([0-9]+)(\+)?(.*)/);if(b){h.ackId=b[1],h.args=[];if(b[3])try{h.args=b[3]?g.parse(b[3]):[]}catch(j){}}break;case"disconnect":case"heartbeat":}return h},c.decodePayload=function(b){if(b[0]=="�"){var d=[];for(var e=1,f="";e<b.length;e++)b[e]=="�"?(d.push(c.decodePacket(b.substr(e+1).substr(0,f))),e+=Number(f)+1,f=""):f+=b[e];return d}return[a.decodePacket(b)]}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function c(a,b){this.socket=a,this.sessid=b}a.Transport=c,b.util.mixin(c,b.EventEmitter),c.prototype.onData=function(a){this.clearCloseTimeout();if(a!==""){var c=b.parser.decodePayload(a);if(c&&c.length)for(var d=0,e=c.length;d<e;d++)this.onPacket(c[d])}return this},c.prototype.onPacket=function(a){if(a.type=="heartbeat")return this.onHeartbeat();if(a.type=="disconnect"&&a.endpoint=="")return this.onDisconnect();this.socket.onPacket(a);return this},c.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var a=this;this.closeTimeout=setTimeout(function(){a.onDisconnect()},this.socket.closeTimeout)}},c.prototype.onDisconnect=function(){this.close&&this.close(),this.clearTimeouts(),this.socket.onDisconnect();return this},c.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},c.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&&clearTimeout(this.reopenTimeout)},c.prototype.onHeartbeat=function(a){this.packet({type:"heartbeat"})},c.prototype.onOpen=function(){this.clearCloseTimeout(),this.socket.onOpen()},c.prototype.onClose=function(){this.reopenTimeout=setTimeout(function(){this.open()},this.socket.options["reopen delay"]),this.setCloseTimeout(),this.socket.onClose()},c.prototype.prepareUrl=function(){return this.socket.options.resource+"/"+b.protocol+"/"+this.name+"/"+this.sessid}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function d(){}function c(a){!a||(b.Transport.apply(this,arguments),this.sendBuffer=[],this.onOpen())}a.XHR=c,b.util.inherit(c,b.Transport),c.prototype.open=function(){this.get(),this.setCloseTimeout();return this},c.prototype.checkSend=function(){if(!this.posting&&this.sendBuffer.length){var a=b.parser.encodePayload(this.sendBuffer);this.sendBuffer=[],this.post(a)}},c.prototype.send=function(a){b.util.isArray(a)?this.sendBuffer.push.apply(this.sendBuffer,a):this.sendBuffer.push(a),this.checkSend();return this},c.prototype.post=function(a){function c(){b.sendXHR.readyState==4&&(b.sendXHR.onreadystatechange=b.sendXHR.onload=d,b.posting=!1,b.sendXHR.status==200?b.checkSend():b.onClose())}var b=this;this.posting=!0,this.sendXHR=this.request("POST"),window.XDomainRequest&&this.xhr instanceof XDomainRequest?this.sendXHR.onload=c:this.sendXHR.onreadystatechange=c,this.sendXHR.send(a)},c.prototype.onClose=function(){if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=d;try{this.xhr.abort()}catch(a){}this.xhr=null}if(this.sendXHR){this.sendXHR.onreadystatechange=this.sendXHR.onload=d;try{this.sendXHR.abort()}catch(a){}this.sendXHR=null}this.sendBuffer=[],b.Transport.prototype.onClose.call(this)},c.prototype.request=function(a){var c=b.util.request(this.socket.isXDomain());c.open(a||"GET",this.prepareUrl()+"?t"+ +(new Date)),a=="POST"&&(c.setRequestHeader?c.setRequestHeader("Content-type","text/plain"):c.contentType="text/plain");return c},c.prototype.scheme=function(){return this.socket.options.secure?"https://":"http://"},c.check=function(a){try{if(b.util.request(a))return!0}catch(c){}return!1},c.xdomainCheck=function(){return c.check(!0)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function d(){}function c(){b.Transport.XHR.apply(this,arguments),this.name="xhr-polling"}a["xhr-polling"]=c,b.util.inherit(c,b.Transport.XHR),c.prototype.open=function(){var a=this;b.util.defer(function(){b.Transport.XHR.prototype.open.call(a)});return!1},c.prototype.get=function(){function b(){a.xhr.readyState==4&&(a.xhr.onreadystatechange=a.xhr.onload=d,a.xhr.status==200?(a.onData(a.xhr.responseText),a.get()):a.onClose())}var a=this;this.xhr=this.request(),window.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=b,this.xhr.onerror=function(b){a.onError(b)}):this.xhr.onreadystatechange=b,this.xhr.send(null)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function c(a){if(!!a){b.Transport["xhr-polling"].apply(this,arguments),this.name="jsonp-polling",this.insertAt=document.getElementsByTagName("script")[0],this.index=b.j.length;var c=this;b.j.push(function(a){c._(a)})}}a["jsonp-polling"]=c,b.util.inherit(c,b.Transport["xhr-polling"]),c.prototype.post=function(a){function h(){b.iframe&&b.form.removeChild(b.iframe);try{f=document.createElement('<iframe name="'+b.iframeId+'">')}catch(a){f=document.createElement("iframe"),f.name=b.iframeId}f.id=b.iframeId,b.form.appendChild(f),b.iframe=f}function g(){h(),b.posting=!1,b.checkSend()}var b=this;if(!this.form){var c=document.createElement("FORM"),d=document.createElement("TEXTAREA"),e=this.iframeId="socketio_iframe_"+this.index,f;c.className="socketio",c.style.position="absolute",c.style.top="-1000px",c.style.left="-1000px",c.target=e,c.method="POST",c.action=this.prepareUrl()+"?t="+ +(new Date)+"&i="+this.index,d.name="data",c.appendChild(d),this.insertAt.parentNode.insertBefore(c,this.insertAt),document.body.appendChild(c),this.form=c,this.area=d}h(),this.posting=!0,this.area.value=a;try{this.form.submit()}catch(i){}this.iframe.attachEvent?f.onreadystatechange=function(){b.iframe.readyState=="complete"&&g()}:this.iframe.onload=g},c.prototype.get=function(){var a=this,b=document.createElement("SCRIPT");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),b.async=!0,b.src=this.prepareUrl()+"/?t="+ +(new Date)+"&i="+this.index,b.onerror=function(){a.onClose()},this.insertAt.parentNode.insertBefore(b,this.insertAt),this.script=b},c.prototype._=function(a){this.onData(a),this.get();return this},c.check=function(){return!0},c.xdomainCheck=function(){return!0}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function c(a){b.Transport.apply(this,arguments),this.name="websocket"}a.websocket=c,b.util.inherit(c,b.Transport),c.prototype.open=function(){this.websocket=new WebSocket(this.prepareUrl());var a=this;this.websocket.onopen=function(){a.onOpen()},this.websocket.onmessage=function(b){a.onData(b.data)},this.websocket.onclose=function(){a.onClose()},this.websocket.onerror=function(b){a.onError(b)};return this},c.prototype.send=function(a){this.websocket.send(b.parser.encodePacket(a));return this},c.prototype.close=function(){this.websocket.close();return this},c.prototype.onError=function(a){this.socket.onError(a)},c.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"},c.prototype.prepareUrl=function(){return this.scheme()+"://"+this.socket.options.host+":"+this.socket.options.port+"/"+this.socket.options.resource+"/"+b.protocol+"/"+this.name+"/"+this.sessid},c.check=function(){return!!window.WebSocket},c.xdomainCheck=function(){return!0}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function c(a){b.Transport.XHR.apply(this,arguments),this.name="htmlfile"}a.htmlfile=c,b.util.inherit(c,b.Transport.XHR),c.prototype.get=function(){var a=this;this.open(),window.attachEvent("onunload",function(){a.destroy()})},c.prototype.open=function(){this.doc=new ActiveXObject("htmlfile"),this.doc.open(),this.doc.write("<html></html>"),this.doc.parentWindow.s=this,this.doc.close();var a=this.doc.createElement("div");a.className="socketio",this.doc.body.appendChild(a),this.iframe=this.doc.createElement("iframe"),a.appendChild(this.iframe),this.iframe.src=this.prepareUrl()+"/?t="+ +(new Date),this.onOpen()},c.prototype._=function(a,b){this.onData(a);var c=b.getElementsByTagName("script")[0];c.parentNode.removeChild(c)},c.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(a){}this.doc=null,CollectGarbage()}},c.prototype.close=function(){this.destroy();return b.Transport.XHR.prototype.close.call(this)},c.check=function(){if("ActiveXObject"in window)try{var a=new ActiveXObject("htmlfile");return a&&b.Transport.XHR.check()}catch(c){}return!1},c.xdomainCheck=function(){return!1}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function d(a,b){this.namespace=a,this.name=b}function c(a){this.name=a||"",this.flags={},this.json=new d(this,"json"),this.ackPackets=0,this.acks={}}a.SocketNamespace=c,b.util.mixin(c,b.EventEmitter),c.prototype.$emit=b.EventEmitter.prototype.emit,c.prototype.packet=function(){packet.endpoint=this.name,this.socket.send(b.parser.encodePacket(packet)),this.flags={};return this},c.prototype.send=function(a,b){var c={type:this.flags.json?"json":"message",data:a};"function"==typeof b&&(c.id=++this.ackPackets,c.ack=b.length?"data":!0,this.acks[c.id]=b);return this.packet(c)},c.prototype.emit=function(a){var b=Array.prototype.slice.call(arguments,1),c=b[b.length-1],d={type:"event",name:a};"function"==typeof c&&(d.id=++this.ackPackets,d.ack=c.length?"data":!0,this.acks[d.id]=c,b=b.slice(0,b.length-1)),d.args=b;return this.packet(d)},c.prototype.onPacket=function(a){switch(a.type){case"connect":case"disconnect":this.$emit(a.type);break;case"message":case"json":this.$emit("message",a.data);break;case"event":this.$emit.apply(this,[a.name].concat(a.args))}},d.prototype.send=function(){this.namespace.flags[this.name]=!0,this.namespace.send.apply(this,arguments)},d.prototype.emit=function(){this.namespace.flags[this.name]=!0,this.namespace.emit.apply(this,arguments)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(a,b){function d(){}function c(a){this.options={port:80,secure:!1,document:document,resource:"socket.io",transports:b.transports,"connect timeout":1e4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reopen delay":3e3,"max reconnection attempts":10,"sync disconnect on unload":!0,"auto connect":!0},b.util.merge(this.options,a),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1;if(this.options["sync disconnect on unload"]){var c=this;b.util.on(window,"beforeunload",function(){c.disconnect(!0)},!1)}this.options["auto connect"]&&this.connect()}a.Socket=c,b.util.mixin(c,b.EventEmitter),c.prototype.of=function(a){this.namespaces||(this.namespaces={}),this.namespaces[a]||(this.namespaces[a]=new b.SocketNamespace(this,a));return this.namespaces[a]},c.prototype.handshake=function(a){function e(b){b instanceof Error?c.onError(b.message):a.apply(null,b.split(":"))}var c=this,f=this.options.resource+"/"+b.protocol+"/?t="+ +(new Date);if(this.isXDomain()){var g=document.getElementsByTagName("script")[0],h=document.createElement("SCRIPT");h.src=f+"&jsonp="+b.j.length,g.parentNode.insertBefore(h,g),b.j.push(function(a){e(a),h.parentNode.removeChild(h)})}else{var i=b.util.request();i.open("GET",f),i.onreadystatechange=function(){i.readyState==4&&(i.onreadystatechange=d,i.status==200?e(i.responseText):c.onError(i.responseText))},i.send(null)}},c.prototype.getTransport=function(a){var c=a||this.transports,d;for(var e=0,f;f=c[e];e++)if(b.Transport[f]&&b.Transport[f].check()&&(!this.isXDomain()||b.Transport[f].xdomainCheck()))return new b.Transport[f](this,this.sessionid);return null},c.prototype.connect=function(a){if(this.connecting)return this;var c=this;this.handshake(function(d,e,f,g){c.sessionid=d,c.closeTimeout=e,c.heartbeatTimeout=f,c.transports=b.util.intersect(g.split(","),c.options.transports),c.transport=c.getTransport();!c.transport||(c.connecting=!0,c.emit("connecting",c.transport.name),c.transport.open(),c.options.connectTimeout&&(c.connectTimeoutTimer=setTimeout(function(){if(!c.connected){if(c.options["try multiple transports"]){c.remainingTransports||(c.remainingTransports=c.transports.slice(0));var a=c.remainingTransports;while(a.length>0&&a.splice(0,1)[0]!=c.transport.name);a.length&&(c.transport=c.getTransport(a),c.connect())}(!c.remainingTransports||c.remainingTransports.length==0)&&c.emit("connect_failed")}c.remainingTransports&&c.remainingTransports.length==0&&delete c.remainingTransports},c.options["connect timeout"])),a&&typeof a=="function"&&c.once("connect",a),c.onConnect())});return this},c.prototype.send=function(a){this.transport.send(a);return this},c.prototype.disconnect=function(a){if(this.connected){this.open&&this.of("").packet({type:"disconnect"});var c=b.util.request();c.open("GET",this.resource+"/"+b.protocol+"/"+this.sessionid),a&&(c.sync=!0),this.onDisconnect()}return this},c.prototype.isXDomain=function(){var a=window.location.port||80;return this.options.host!==document.domain||this.options.port!=a},c.prototype.onConnect=function(){this.connected=!0,this.connecting=!1,this.emit("connect")},c.prototype.onOpen=function(){!!this.connected,this.open=!0},c.prototype.onClose=function(){this.open=!1},c.prototype.onPacket=function(a){this.of(a.endpoint).onPacket(a)},c.prototype.onError=function(a){this.emit("error",a);for(var b in this.namespaces)this.of(b).emit("error",a)},c.prototype.onDisconnect=function(){var a=this.connected;this.connected=!1,this.connecting=!1,this.open=!1;if(a){this.emit("disconnect"),this.transport.clearTimeouts();for(var b in this.namespaces)this.of(b).emit("error",err);this.options.reconnect&&!this.reconnecting&&this.reconnect()}},c.prototype.reconnect=function(){function e(){if(!!a.reconnecting){if(a.connected)return d();if(a.connecting&&a.reconnecting)return a.reconnectionTimer=setTimeout(e,1e3);a.reconnectionAttempts++>=b?a.redoTransports?(a.emit("reconnect_failed"),d()):(a.on("connect_failed",e),a.options["try multiple transports"]=!0,a.transport=a.getTransport(),a.redoTransports=!0,a.connect()):(a.reconnectionDelay*=2,a.connect(),a.emit("reconnecting",a.reconnectionDelay,a.reconnectionAttempts),a.reconnectionTimer=setTimeout(e,a.reconnectionDelay))}}function d(){a.connected&&a.emit("reconnect",a.transport.name,a.reconnectionAttempts),a.removeListener("connect_failed",e),a.removeListener("connect",e),a.reconnecting=!1,delete a.reconnectionAttempts,delete a.reconnectionDelay,delete a.reconnectionTimer,delete a.redoTransports,a.options["try multiple transports"]=c}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options["reconnection delay"];var a=this,b=this.options["max reconnection attempts"],c=this.options["try multiple transports"];this.options["try multiple transports"]=!1,this.reconnectionTimer=setTimeout(e,this.reconnectionDelay),this.on("connect",e)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports) \ No newline at end of file http://bitbucket.org/virtualcommons/vcweb/changeset/cd3592212eb8/ changeset: cd3592212eb8 branches: user: alllee date: 2011-06-07 00:00:08 summary: switching back to 0.6.2 socket.io.min.js affected #: 6 files (7.2 KB) --- a/vcweb/core/templates/includes/socket.io.html Mon Jun 06 13:20:59 2011 -0700 +++ b/vcweb/core/templates/includes/socket.io.html Mon Jun 06 15:00:08 2011 -0700 @@ -4,6 +4,7 @@ </script><script type="text/javascript"> +var vcwebSocket = {}; var cachedSocket; var defaultPort = 8881; function connect(resource) { @@ -17,17 +18,21 @@ console.log("using default port: " + defaultPort); port = defaultPort; } - cachedSocket = new io.Socket(host, {"port": port, "resource": resource}); + console.log("Establishing connection to " + host + ":" + port + "/" + resource); + cachedSocket = new io.Socket(host, {port: port, resource: resource}); cachedSocket.connect(); + console.log("connect invoked to " + host + ":" + port + "/" + resource); cachedSocket.on('connect', function() { - console.log("Connecting to " + host + ":" + port + "/" + resource); + console.debug("onconnect to " + host + ":" + port + "/" + resource); cachedSocket.send(createConnectionEvent()); }); + /* cachedSocket.on('disconnect', function(data) { console.log("received disconnect, reconnecting."); cachedSocket.connect(); cachedSocket.send(createReconnectionEvent()); }); + */ return cachedSocket; } function getCachedSocket() { --- a/vcweb/core/templates/participant/base.html Mon Jun 06 13:20:59 2011 -0700 +++ b/vcweb/core/templates/participant/base.html Mon Jun 06 15:00:08 2011 -0700 @@ -8,8 +8,8 @@ {% include "includes/socket.io.html" %} <script type='text/javascript'> var qtipOptions = {position: { corner: {target: 'topMiddle', tooltip: 'bottomMiddle'}}, style: { name: 'green', tip: 'bottomMiddle'} }; - connect('participant/{{participant_experiment_relationship.pk}}'); $(function() { + connect('participant/{{participant_experiment_relationship.pk}}'); $('[title]').qtip(qtipOptions); }); </script> --- a/vcweb/fabfile.py Mon Jun 06 13:20:59 2011 -0700 +++ b/vcweb/fabfile.py Mon Jun 06 15:00:08 2011 -0700 @@ -19,7 +19,7 @@ # default to current working directory env.project_path = os.path.dirname(__file__) env.hosts = ['localhost'] -env.hg_url = 'http://virtualcommons.hg.sourceforge.net:8000/hgroot/virtualcommons/virtualcommons' +env.hg_url = 'https://bitbucket.org/virtualcommons/vcweb' env.apache = 'httpd' env.applist = ['core', 'forestry'] env.apps = ' '.join(env.applist) @@ -98,7 +98,7 @@ port = vcweb_settings.SOCKET_IO_PORT _virtualenv("{python} vcwebio.py {port}".format(python=env.python, **locals()), capture=False) -def server(ip="127.0.0.1", port=8000): +def server(ip="149.169.203.115", port=8000): local("{python} manage.py runserver {ip}:{port}".format(python=env.python, **locals()), capture=False) def celeryd(): --- a/vcweb/forestry/templates/forestry/chat.html Mon Jun 06 13:20:59 2011 -0700 +++ b/vcweb/forestry/templates/forestry/chat.html Mon Jun 06 15:00:08 2011 -0700 @@ -4,7 +4,6 @@ <script type="text/javascript"> $(function() { var chatDiv = document.getElementById('chat-div'); - // var s = connect(window.location.hostname, 8888, 'participant/{{participant_experiment_relationship.pk}}'); var s = getCachedSocket(); s.on('message', function(json_string) { var json = jQuery.parseJSON(json_string); --- a/vcweb/forestry/templates/forestry/wait.html Mon Jun 06 13:20:59 2011 -0700 +++ b/vcweb/forestry/templates/forestry/wait.html Mon Jun 06 15:00:08 2011 -0700 @@ -1,15 +1,12 @@ {% extends "participant/base.html" %} {% block head %} {{ block.super }} -{% include "includes/socket.io.html" %} -{% include "includes/participant.events.html" %} {% include "includes/tablesorter.html" %} <script t... [truncated message content] |
From: Bitbucket <com...@bi...> - 2011-06-04 00:14:36
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/2105b439418f/ changeset: 2105b439418f branches: user: alllee date: 2011-06-04 02:14:35 summary: stubs for sanitation game views and initial_data for marcel affected #: 3 files (1.9 KB) --- a/vcweb/core/fixtures/initial_data.json Fri Jun 03 00:07:26 2011 -0700 +++ b/vcweb/core/fixtures/initial_data.json Fri Jun 03 17:14:35 2011 -0700 @@ -12,7 +12,7 @@ "pk": 1, "model": "auth.user", "fields": { - "username": "alee", + "username": "all...@as...", "first_name": "Allen", "last_name": "Lee", "is_active": true, --- a/vcweb/sanitation/fixtures/initial_data.json Fri Jun 03 00:07:26 2011 -0700 +++ b/vcweb/sanitation/fixtures/initial_data.json Fri Jun 03 17:14:35 2011 -0700 @@ -1,5 +1,35 @@ [ { + "pk": 14, + "model": "auth.user", + "fields": { + "username": "mar...@gm...", + "first_name": "Marcel", + "last_name": "Hurtado", + "is_active": true, + "is_superuser": true, + "is_staff": true, + "last_login": "2011-06-03 13:07:25", + "groups": [ + 1 + ], + "user_permissions": [], + "password": "sha1$617b8$76ccc42b1d93df9cd0b06409a2904406bf643677", + "email": "mar...@gm...", + "date_joined": "2011-06-03 13:07:25" + } + }, + { + "pk": 4, + "model": "core.experimenter", + "fields": { + "approved": true, + "user": 14, + "failed_password_attempts": 0, + "institution": 1 + } + }, + { "fields": { "creator": 1, "experiment_metadata": [ --- a/vcweb/sanitation/views.py Fri Jun 03 00:07:26 2011 -0700 +++ b/vcweb/sanitation/views.py Fri Jun 03 17:14:35 2011 -0700 @@ -1,8 +1,10 @@ -# Create your views here. from vcweb.core.models import Experiment from django.shortcuts import render_to_response, redirect from django.template.context import RequestContext +import logging +logger = logging.getLogger(__name__) + def configure(request, experiment_id=None): experiment = Experiment.objects.get(pk=experiment_id) return render_to_response('sanitation/configure.html', { @@ -10,3 +12,32 @@ }, context_instance=RequestContext(request)) +def consent(request, experiment): + pass + +def survey(request, experiment): + pass + +def quiz(request, experiment): + pass + +def instructions(request, experiment): + pass + +def play(request, experiment): + pass + +def participate(request, experiment_id=None): +# lookup participant's current location and then invoke the method named by the location + participant = request.user.participant +# FIXME: this isn't implemented + experiment = Experiment.objects.get(pk=experiment_id) + current_location = participant.current_location # "consent", "survey", "quiz", "play", "instructions" + if current_location in ["consent", "survey", "quiz", "play", "instructions"]: + logger.debug("current location %s is valid", current_location) +# invoke current_location as a method and pass in the request and the experiment + location_method = getattr(__name__, current_location) + return location_method(request, experiment) + logger.debug("Invalid location %s, redirecting to dashboard", current_location) + return redirect('core:dashboard') + Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-03 07:07:30
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/8c45d6446d7b/ changeset: 8c45d6446d7b branches: user: alllee date: 2011-06-03 09:07:26 summary: minor updates to models, fixing docstrings and initial_data affected #: 3 files (346 bytes) --- a/vcweb/core/models.py Wed Jun 01 12:49:17 2011 -0700 +++ b/vcweb/core/models.py Fri Jun 03 00:07:26 2011 -0700 @@ -127,7 +127,7 @@ The configuration for a given Experiment instance. One ExperimentConfiguration can be applied to many Experiment instances but can only be associated to a single ExperimentMetadata record. """ - experiment_metadata = models.ForeignKey(ExperimentMetadata, related_name='configurations') + experiment_metadata = models.ForeignKey(ExperimentMetadata, related_name='experiment_configurations') creator = models.ForeignKey(Experimenter, related_name='experiment_configurations') name = models.CharField(max_length=255) max_number_of_participants = models.PositiveIntegerField(default=0) @@ -738,18 +738,18 @@ NONE_VALUES_DICT = dict(map(lambda x,y: (x[0], y), PARAMETER_TYPES, [0, '', 0.0, False, None])) #dict(zip([parameter_type[0] for parameter_type in PARAMETER_TYPES], [0, '', 0.0, False, None])) + CONVERTERS = { + 'int': int, + 'string':str, + 'float': float, + 'boolean': lambda x: bool(x) and str(x).lower() != 'false' + } ''' all converters are one-arg functions that convert string input into the appropriate data type. NOTE: they expect already validated string data and will throw ValueErrors on invalid input. ''' - CONVERTERS = { - 'int': int, - 'string':str, - 'float': float, - 'boolean': lambda x: bool(x) and str(x).lower() != 'false' - } GROUP_SCOPE = 'group' GROUP_ROUND_SCOPE = 'group_round' @@ -848,10 +848,10 @@ class Meta: abstract = True -""" -Used for specific round configuration data. -""" class RoundParameterValue(ParameterizedValue): + """ + Represents a specific piece of round configuration data. + """ round_configuration = models.ForeignKey(RoundConfiguration, related_name='round_parameter_values') def __unicode__(self): @@ -872,13 +872,20 @@ class Group(models.Model): number = models.PositiveIntegerField() - """ how many members can this group hold at a maximum? Should be specified as a ConfigurationParameter somewhere """ + ''' internal numbering unique to the given experiment ''' max_size = models.PositiveIntegerField(default=5) + """ + how many members can this group hold at a maximum? Could be specified as a + RoundParameterValue / ExperimentConfiguration value + """ experiment = models.ForeignKey(Experiment, related_name='groups') + """ + The experiment that contains this Group. + """ - """ should return a unique chat / event channel to communicate on """ @property def channel(self): + """ should return a unique chat / event channel to communicate on """ return u"%s.%d" % (self.experiment.event_channel_name, self.number) @property @@ -939,11 +946,11 @@ ''' - ''' - Not as efficient as a simple SQL update because we need to do some type - conversion / processing to put the value into the appropriate field. - ''' def set_data_value(self, parameter_name=None, parameter=None, value=None): + ''' + Not as efficient as a simple SQL update because we need to do some type + conversion / processing to put the value into the appropriate field. + ''' data_value = self.get_data_value(parameter_name=parameter_name, parameter=parameter) data_value.value = value self.log("setting parameter %s = %s" % (parameter, value)) @@ -1004,13 +1011,13 @@ logger.warning("Trying to retrieve data value by name with no args") return None - ''' - Transfers the given parameter to the next round. If parameter isn't set, - transfer all parameters to the next round. - FIXME: If this ends up being surprising or isn't desired behavior for - common use cases, revisit and remove. - ''' def transfer_to_next_round(self, parameter=None, value=None, transfer_existing_value=True): + ''' + Transfers the given parameter to the next round. If parameter isn't set, + transfer all parameters to the next round. + FIXME: If this ends up being surprising or isn't desired behavior for + common use cases, revisit and remove. + ''' if self.experiment.is_last_round: logger.warning("Trying to transfer parameter %s to next round but this is the last round", parameter) return @@ -1063,11 +1070,12 @@ ordering = ['experiment', 'number'] -""" -round-specific data for a given experiment. Contains related sets to group_data -(GroupRoundDataValue), participant_data (ParticipantRoundDataValue), and chat_messages (ChatMessage) -""" class RoundData(models.Model): + """ + round-specific data for a given experiment. Contains related sets to group_data + (GroupRoundDataValue), participant_data (ParticipantRoundDataValue), and + chat_messages (ChatMessage) + """ experiment = models.ForeignKey(Experiment, related_name='round_data') round_configuration = models.ForeignKey(RoundConfiguration) elapsed_time = models.PositiveIntegerField(default=0) --- a/vcweb/forestry/fixtures/initial_data.json Wed Jun 01 12:49:17 2011 -0700 +++ b/vcweb/forestry/fixtures/initial_data.json Fri Jun 03 00:07:26 2011 -0700 @@ -7,7 +7,6 @@ ], "is_public": true, "max_group_size": 5, - "max_number_of_participants": 20, "name": "Forestry Default Configuration" }, "model": "core.experimentconfiguration", --- a/vcweb/sanitation/fixtures/initial_data.json Wed Jun 01 12:49:17 2011 -0700 +++ b/vcweb/sanitation/fixtures/initial_data.json Fri Jun 03 00:07:26 2011 -0700 @@ -7,7 +7,6 @@ ], "is_public": true, "max_group_size": 10, - "max_number_of_participants": -1, "name": "Sanitation Default Configuration" }, "model": "core.experimentconfiguration", Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-06-01 19:49:21
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/63c173735052/ changeset: 63c173735052 branches: user: alllee date: 2011-06-01 21:49:17 summary: updating actions available in wait page to just return to the participation page and changing ParameterizedValue.string_value to a TextField; consider adding an additional field json_value that stores arbitrary JSON-encoded strings (or just use the string_value for that as well) affected #: 5 files (97 bytes) --- a/.hgignore Wed May 25 14:53:46 2011 -0700 +++ b/.hgignore Wed Jun 01 12:49:17 2011 -0700 @@ -10,3 +10,5 @@ .idea build logs +tmp +.orig --- a/vcweb/core/models.py Wed May 25 14:53:46 2011 -0700 +++ b/vcweb/core/models.py Wed Jun 01 12:49:17 2011 -0700 @@ -828,7 +828,7 @@ class ParameterizedValue(models.Model): parameter = models.ForeignKey(Parameter) - string_value = models.CharField(max_length=512, null=True, blank=True) + string_value = models.TextField(null=True, blank=True) int_value = models.IntegerField(null=True, blank=True) float_value = models.FloatField(null=True, blank=True) boolean_value = models.NullBooleanField(null=True, blank=True) --- a/vcweb/forestry/templates/forestry/wait.html Wed May 25 14:53:46 2011 -0700 +++ b/vcweb/forestry/templates/forestry/wait.html Wed Jun 01 12:49:17 2011 -0700 @@ -38,10 +38,9 @@ <p> The facilitator will start the next round when every participant is ready. <br/> -<span class='ui-state-highlight ui-corner-all'> - <small><a class='contactIcon' href="#">send a private message to the facilitator</a> - | <a href='participate'>return to participation page</a></small> -</span> +<div class='ui-state-highlight ui-corner-all'> + <small><span class='float-left vcweb-ui-icon ui-icon ui-icon-circle-arrow-w'></span><a href='participate'>return to participation page</a></small> +</div><br/></p> --- a/vcweb/sanitation/fixtures/initial_data.json Wed May 25 14:53:46 2011 -0700 +++ b/vcweb/sanitation/fixtures/initial_data.json Wed Jun 01 12:49:17 2011 -0700 @@ -11,11 +11,11 @@ "name": "Sanitation Default Configuration" }, "model": "core.experimentconfiguration", - "pk": 11 + "pk": 3 }, { "fields": { - "authentication_code": "TEST_FORESTRY", + "authentication_code": "TEST_SANITATION", "current_round_elapsed_time": 0, "current_round_sequence_number": 1, "duration": "1h", @@ -31,6 +31,6 @@ "total_elapsed_time": 0 }, "model": "core.experiment", - "pk": 11 + "pk": 3 } ] --- a/vcweb/static/css/style.css Wed May 25 14:53:46 2011 -0700 +++ b/vcweb/static/css/style.css Wed Jun 01 12:49:17 2011 -0700 @@ -76,6 +76,10 @@ .float-right { float:right; } +.vcweb-ui-icon { + display:inline; + margin: 7px; +} .vcweb-icon { display:inline; background-repeat: no-repeat; Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <iss...@bi...> - 2011-05-31 21:36:54
|
--- you can reply above this line --- New issue 12: additional metadata on ParameterizedValue https://bitbucket.org/virtualcommons/vcweb/issue/12/additional-metadata-on-parameterizedvalue A Lee / alllee on Tue, 31 May 2011 23:36:48 +0200: Description: The sanitation game (and others) may need to flag a GroupRoundDataValue as "deleted". The underlying data flow: # On the hour, X amount of pollution is added to the resource, each piece of pollution is a distinct GRDV where the actual "value" of the GRDV is an int representing the character location of that piece pollution in the string text (how would we represent this in terms of image pollution?) # Participants "delete" a piece of pollution by setting its status to deleted, this way we don't lose the original pollution piece. Alternatively we could replay the set of all pollution added and reconcile it with the set of all participant decisions. Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-05-31 15:54:33
|
--- you can reply above this line --- New issue 11: socket.io broken in slovak clients on wait page https://bitbucket.org/virtualcommons/vcweb/issue/11/socketio-broken-in-slovak-clients-on-wait virtualcommons on Tue, 31 May 2011 17:54:23 +0200: Description: firebug reports io.JSONP[0] not defined Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-05-31 15:41:17
|
--- you can reply above this line --- New issue 10: disable submit when round ends https://bitbucket.org/virtualcommons/vcweb/issue/10/disable-submit-when-round-ends virtualcommons on Tue, 31 May 2011 17:41:08 +0200: Description: submission of data shouldn't be allowed when a round has ended. Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <iss...@bi...> - 2011-05-26 21:43:03
|
--- you can reply above this line --- New issue 9: set up scheduling via celery https://bitbucket.org/virtualcommons/vcweb/issue/9/set-up-scheduling-via-celery A Lee / alllee on Thu, 26 May 2011 23:42:57 +0200: Description: The sanitation game needs to have functional scheduling support. Implement using celery + celeryd. Experiments start at a specific date/time. -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <com...@bi...> - 2011-05-25 21:53:53
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/ec158c1f9650/ changeset: r371:ec158c1f9650 user: alllee date: 2011-05-25 23:53:46 summary: placeholders and initial set up for the sanitation experiment affected #: 11 files (3.3 KB) --- a/vcweb/core/models.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/core/models.py Wed May 25 14:53:46 2011 -0700 @@ -274,6 +274,10 @@ return "/%s/experimenter" % self.get_absolute_url() @property + def configure_url(self): + return "/%s/configure" % self.get_absolute_url() + + @property def stop_url(self): return "%s/stop" % self.controller_url @@ -1325,4 +1329,3 @@ def is_participant(user): return hasattr(user, 'participant') and isinstance(user.participant, Participant) - --- a/vcweb/core/templates/experimenter/dashboard.html Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/core/templates/experimenter/dashboard.html Wed May 25 14:53:46 2011 -0700 @@ -58,9 +58,12 @@ {% else %} <li><a title='clear all participants' href='{{e.controller_url}}/clear-participants' class='confirm-experiment-action'><img src='{{STATIC_URL}}images/famfamfam/group_delete.png' alt=''/> clear all participants</a></li> {% endif %} - <!-- <li><a href='{{e.management_url}}'><img src='{{STATIC_URL}}images/famfamfam/application_go.png' alt='Custom management interface'/> manage (unfinished)</a></li> --> {% if e.is_active %} <li><a title='stop this experiment' href='{{e.stop_url}}' class='confirm-experiment-action'><img src='{{STATIC_URL}}images/famfamfam/stop.png' alt=''/> stop</a></li> + {% else %} + <li> + <a title='Configure this experiment (currently implemented for sanitation game)' href='{{e.configure_url}}'><img src='{{STATIC_URL}}images/famfamfam/wrench.png' alt='configure' /> configure</a> + </li> {% endif %} </ul></div> --- a/vcweb/core/views.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/core/views.py Wed May 25 14:53:46 2011 -0700 @@ -53,8 +53,9 @@ elif is_experimenter(user): commons_user = user.experimenter else: - logger.error("Invalid user: %s" % user) + logger.error("Invalid user: %s", user) return + logger.debug("%s authentication_token=%s", commons_user, authentication_token) commons_user.authentication_token = authentication_token commons_user.save() @@ -65,7 +66,6 @@ request = self.request user = form.user_cache auth.login(request, user) - logger.debug("session is %s" % request.session) set_authentication_token(user, request.session.session_key) return super(LoginView, self).form_valid(form) def get_success_url(self): @@ -97,13 +97,14 @@ if experimenter_requested: experimenter = Experimenter.objects.create(user=user, institution=institution) - logger.debug("creating new experimenter: %s, adding default forestry experiment" % experimenter) + logger.debug("creating new experimenter: %s, adding default forestry experiment", experimenter) + # FIXME: add a default experiment for all ExperimentMetadata types # FIXME: hard coded slovakia experiment, get rid of this! experiment = Experiment.objects.get(pk=1) experiment.clone(experimenter=experimenter) else: participant = Participant.objects.create(user=user, institution=institution) - logger.debug("Creating new participant: %s" % participant) + logger.debug("Creating new participant: %s", participant) request = self.request auth.login(request, auth.authenticate(username=email, password=password)) set_authentication_token(user, request.session.session_key) @@ -139,7 +140,7 @@ experiment = Experiment.objects.get(experiment_metadata__namespace=namespace) if not experiment: - logger.warning("Tried to request instructions for id %s or namespace %s" % (pk, namespace)) + logger.warning("Tried to request instructions for id %s or namespace %s", pk, namespace) return redirect('home') return render_to_response(experiment.get_template_path('instructions.html'), locals(), context_instance=RequestContext(request)) @@ -196,7 +197,7 @@ def form_valid(self, form): emails = form.cleaned_data.get('participant_emails') experiment = self.object - logger.debug("registering participants %s for experiment: %s" % (emails, experiment)) + logger.debug("registering participants %s for experiment: %s", emails, experiment) experiment.authentication_code = form.cleaned_data.get('experiment_passcode') experiment.register_participants(emails=emails, institution=form.institution, password=experiment.authentication_code) @@ -240,8 +241,7 @@ # redirect to experiment specific management page? return redirect(experiment.management_url) except Experiment.DoesNotExist: - logger.warning("Tried to manage non-existent experiment with id %s" % - pk) + logger.warning("Tried to manage non-existent experiment with id %s", pk) # FIXME: add data converter objects to write to csv, excel, etc. --- a/vcweb/forestry/urls.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/forestry/urls.py Wed May 25 14:53:46 2011 -0700 @@ -4,8 +4,8 @@ url(r'^$', 'index', name='index'), url(r'^participate/?$', 'participant_index', name='participant_index'), url(r'^experiment/?$', 'experimenter_index', name='experimenter_index'), - url(r'^configure/(?P<experiment_id>\d+)$', 'configure', name='configure'), - url(r'^(?P<experiment_id>\d+)/experimenter$', 'manage_experiment', name='manage_experiment'), + url(r'^(?P<experiment_id>\d+)/configure$', 'configure', name='configure'), + url(r'^(?P<experiment_id>\d+)/experimenter$', 'monitor_experiment', name='monitor_experiment'), url(r'^(?P<experiment_id>\d+)/wait$', 'wait', name='wait'), url(r'^(?P<experiment_id>\d+)/participate$', 'participate', name='participate'), ) --- a/vcweb/forestry/views.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/forestry/views.py Wed May 25 14:53:46 2011 -0700 @@ -47,11 +47,11 @@ return render_to_response('forestry/participant-index.html', locals(), context_instance=RequestContext(request)) @experimenter_required -def configure(request): - return Http404() +def configure(request, experiment_id=None): + raise Http404() @experimenter_required -def manage_experiment(request, experiment_id=None): +def monitor_experiment(request, experiment_id=None): try: experiment = Experiment.objects.get(pk=experiment_id) return render_to_response('forestry/manage-experiment.html', --- a/vcweb/sanitation/views.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/sanitation/views.py Wed May 25 14:53:46 2011 -0700 @@ -1,1 +1,12 @@ # Create your views here. +from vcweb.core.models import Experiment +from django.shortcuts import render_to_response, redirect +from django.template.context import RequestContext + +def configure(request, experiment_id=None): + experiment = Experiment.objects.get(pk=experiment_id) + return render_to_response('sanitation/configure.html', { + 'experiment': experiment, + }, + context_instance=RequestContext(request)) + --- a/vcweb/settings.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/settings.py Wed May 25 14:53:46 2011 -0700 @@ -98,6 +98,7 @@ 'django.contrib.staticfiles', 'vcweb.core', 'vcweb.forestry', + 'vcweb.sanitation', 'dajaxice', 'djcelery', 'djkombu', --- a/vcweb/urls.py Fri May 20 23:26:48 2011 -0700 +++ b/vcweb/urls.py Wed May 25 14:53:46 2011 -0700 @@ -26,6 +26,7 @@ # ExperimentMetadata instance and using their namespace (e.g., replace all # instances of forestry with ExperimentMetadata.namespace) url(r'^forestry/', include('vcweb.forestry.urls', namespace='forestry', app_name='forestry')), + url(r'^sanitation/', include('vcweb.sanitation.urls', namespace='sanitation', app_name='sanitation')), url(r'^admin/', include(admin.site.urls)), # core catches everything else url(r'', include('vcweb.core.urls', namespace='core', app_name='core')), Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-05-21 06:26:56
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/c2cbc3a21d03/ changeset: r370:c2cbc3a21d03 user: alllee date: 2011-05-21 08:26:48 summary: getting rid of explicit python2.6 from fab affected #: 1 file (24 bytes) --- a/vcweb/fabfile.py Wed May 18 17:31:57 2011 -0700 +++ b/vcweb/fabfile.py Fri May 20 23:26:48 2011 -0700 @@ -9,7 +9,7 @@ sys.path.append(os.path.abspath('..')) # default env configuration -env.python = 'python2.6' +env.python = 'python' env.project_name = 'vcweb' env.deploy_user = 'apache' env.deploy_group = 'commons' @@ -108,7 +108,6 @@ local("%(python)s manage.py celerybeat" % env) def push(): - local('hg push') local('hg push ssh://hg...@bi.../virtualcommons/vcweb') def dev(): Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2011-05-19 00:32:10
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/de72639d52a7/ changeset: r369:de72639d52a7 user: alllee date: 2011-05-19 02:31:57 summary: version bumps on jquery + jquery ui affected #: 4 files (48 bytes) --- a/vcweb/README Tue May 17 17:06:35 2011 -0700 +++ b/vcweb/README Wed May 18 17:31:57 2011 -0700 @@ -6,7 +6,7 @@ RabbitMQ (maybe) System prerequisites: -1. python 2.6+ with easy_install +1. python 2.6+ with easy_install and python-dev headers (for paramiko/fabric) 2. sqlite3 for dev database 3. mercurial --- a/vcweb/core/templates/base.html Tue May 17 17:06:35 2011 -0700 +++ b/vcweb/core/templates/base.html Wed May 18 17:31:57 2011 -0700 @@ -10,7 +10,7 @@ <link href="{{STATIC_URL}}css/guarantee/style.css" rel="stylesheet" type="text/css" media="screen" /><link href="{{STATIC_URL}}css/style.css" rel="stylesheet" type="text/css" media="screen" /><!-- vcweb common js --> - <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js'></script> + <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script><script type='text/javascript' src='{{STATIC_URL}}js/common.js'></script><script type='text/javascript' src='{{STATIC_URL}}js/jquery.qtip-1.0.0-rc3.min.js'></script> {% include "includes/jquery.ui.html" %} --- a/vcweb/core/templates/includes/jquery.ui.html Tue May 17 17:06:35 2011 -0700 +++ b/vcweb/core/templates/includes/jquery.ui.html Wed May 18 17:31:57 2011 -0700 @@ -1,4 +1,4 @@ -{% with jquery_ui_version="1.8.12" %} +{% with jquery_ui_version="1.8.13" %} <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/{{jquery_ui_version}}/themes/pepper-grinder/jquery-ui.css" rel="stylesheet" type="text/css" media="screen" /><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/{{jquery_ui_version}}/jquery-ui.min.js"></script> {% endwith %} --- a/vcweb/settings.py Tue May 17 17:06:35 2011 -0700 +++ b/vcweb/settings.py Wed May 18 17:31:57 2011 -0700 @@ -140,7 +140,6 @@ import djcelery djcelery.setup_loader() - # set up jquery-ui css classes for django messages from django.contrib import messages MESSAGE_TAGS = { Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: <vir...@li...> - 2011-05-17 23:09:56
|
Subject: hg.virtualcommons 367 details: http://virtualcommons.hg.sourceforge.net:8000/hgroot/virtualcommons/virtualcommons/hgrepo/v/vi/virtualcommons/virtualcommons/rev/b75f90304368 changeset: 367:b75f90304368 user: Allen Lee <all...@as...> date: Tue May 17 16:09:49 2011 -0700 description: pushing vcweb settings into functions to allow setup() to work properly diffstat: vcweb/fabfile.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diffs (39 lines): diff -r e7b4abf46a96 -r b75f90304368 vcweb/fabfile.py --- a/vcweb/fabfile.py Tue May 17 01:05:45 2011 -0700 +++ b/vcweb/fabfile.py Tue May 17 16:09:49 2011 -0700 @@ -26,7 +26,6 @@ # django integration for access to settings, etc. django.project(env.project_name) -from vcweb import settings as vcweb_settings """ this currently only works for sqlite3 development database. do it by hand with @@ -56,6 +55,7 @@ sudo_chain(["rabbitmqctl %s" % cmd for cmd in ['stop_app', 'reset', 'start_app']]) def setup_rabbitmq(): + from vcweb import settings as vcweb_settings clear_rabbitmq_db() with fab_settings(warn_only=True): sudo("rabbitmqctl delete_user %s" % vcweb_settings.BROKER_USER, pty=True) @@ -87,7 +87,10 @@ with cd(env.project_path): _virtualenv('%(python)s manage.py test %(apps)s' % env) -def tornadio(ip="149.169.203.115", port=vcweb_settings.SOCKET_IO_PORT): +def tornadio(ip="149.169.203.115", port=None): + from vcweb import settings as vcweb_settings + if port is None: + port = vcweb_settings.SOCKET_IO_PORT local("{python} vcwebio.py {port}".format(python=env.python, **locals()), capture=False) def server(ip="149.169.203.115", port=8000): @@ -139,6 +142,7 @@ sudo(' && '.join(commands), **kwargs) def deploy(): + from vcweb import settings as vcweb_settings """ deploys to an already setup environment """ env.project_path = env.deploy_path + env.project_name push() |
From: Bitbucket <iss...@bi...> - 2011-05-17 23:05:42
|
--- you can reply above this line --- New issue 8: improve new developer setup steps https://bitbucket.org/virtualcommons/vcweb/issue/8/improve-new-developer-setup-steps A Lee / alllee on Wed, 18 May 2011 01:05:30 +0200: Description: Review & improve steps for new development environment setup Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: <vir...@li...> - 2011-05-17 08:05:57
|
Subject: hg.virtualcommons 366 details: http://virtualcommons.hg.sourceforge.net:8000/hgroot/virtualcommons/virtualcommons/hgrepo/v/vi/virtualcommons/virtualcommons/rev/e7b4abf46a96 changeset: 366:e7b4abf46a96 user: Allen Lee <all...@as...> date: Tue May 17 01:05:45 2011 -0700 description: updating socket.io client to github head for bugfixes diffstat: vcweb/static/js/socket.io.min.js | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diffs (9 lines): diff -r d909eb9c2efc -r e7b4abf46a96 vcweb/static/js/socket.io.min.js --- a/vcweb/static/js/socket.io.min.js Fri May 13 17:37:09 2011 -0700 +++ b/vcweb/static/js/socket.io.min.js Tue May 17 01:05:45 2011 -0700 @@ -1,1 +1,2 @@ -this.io={version:"0.6.2",setPath:function(a){if(window.console&&console.error){console.error("io.setPath will be removed. Please set the variable WEB_SOCKET_SWF_LOCATION pointing to WebSocketMain.swf")}this.path=/\/$/.test(a)?a:a+"/";WEB_SOCKET_SWF_LOCATION=a+"lib/vendor/web-socket-js/WebSocketMain.swf"}};if("jQuery" in this){jQuery.io=this.io}if(typeof window!="undefined"){if(typeof WEB_SOCKET_SWF_LOCATION==="undefined"){WEB_SOCKET_SWF_LOCATION="/socket.io/lib/vendor/web-socket-js/WebSocketMain.swf"}}(function(){var a=false;io.util={ios:false,load:function(b){if(/loaded|complete/.test(document.readyState)||a){return b()}if("attachEvent" in window){window.attachEvent("onload",b)}else{window.addEventListener("load",b,false)}},inherit:function(d,b){for(var c in b.prototype){d.prototype[c]=b.prototype[c]}},indexOf:function(b,e,f){for(var c=b.length,d=(f<0)?Math.max(0,c+f):f||0;d<c;d++){if(b[d]===e){return d}}return -1},isArray:function(b){return Object.prototype.toString.call(b)==="[object Array]"},merge:function(d,b){for(var c in b){if(b.hasOwnProperty(c)){d[c]=b[c]}}}};io.util.ios=/iphone|ipad/i.test(navigator.userAgent);io.util.android=/android/i.test(navigator.userAgent);io.util.opera=/opera/i.test(navigator.userAgent);io.util.load(function(){a=true})})();(function(){var a="~m~",b=function(c){if(Object.prototype.toString.call(c)=="[object Object]"){if(!("JSON" in window)){if("console" in window&&console.error){console.error("Trying to encode as JSON, but JSON.stringify is missing.")}return'{ "$error": "Invalid message" }'}return"~j~"+JSON.stringify(c)}else{return String(c)}};Transport=io.Transport=function(d,c){this.base=d;this.options={timeout:15000};io.util.merge(this.options,c)};Transport.prototype.send=function(){throw new Error("Missing send() implementation")};Transport.prototype.connect=function(){throw new Error("Missing connect() implementation")};Transport.prototype.disconnect=function(){throw new Error("Missing disconnect() implementation")};Transport.prototype._encode=function(g){var d="",f,g=io.uti |
From: <vir...@li...> - 2011-05-14 00:37:14
|
Subject: hg.virtualcommons 365 details: http://virtualcommons.hg.sourceforge.net:8000/hgroot/virtualcommons/virtualcommons/hgrepo/v/vi/virtualcommons/virtualcommons/rev/d909eb9c2efc changeset: 365:d909eb9c2efc user: Allen Lee <all...@as...> date: Fri May 13 17:37:09 2011 -0700 description: should remember to test before committing diffstat: vcweb/core/models.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r e968bd915583 -r d909eb9c2efc vcweb/core/models.py --- a/vcweb/core/models.py Fri May 13 17:23:53 2011 -0700 +++ b/vcweb/core/models.py Fri May 13 17:37:09 2011 -0700 @@ -412,7 +412,7 @@ self.register_participants(users=users, institution=institution) def initialize_parameters(self, group_parameters=None, participant_parameters=None): - if not self.is_playable_round: + if not self.current_round.is_playable_round: logger.warn("ignoring request to initialize parameters for round %s", self.current_round) return if group_parameters is None: |