remove dead code from pad/main.js

pull/1/head
ansuz 9 years ago
parent 9f45ccb2d9
commit f75c246029

@ -181,13 +181,6 @@ define([
// apply patches, and try not to lose the cursor in the process! // apply patches, and try not to lose the cursor in the process!
var applyHjson = function (shjson) { var applyHjson = function (shjson) {
// var hjson = JSON.parse(shjson);
// var peerUserList = hjson[hjson.length-1];
// if(peerUserList.metadata) {
// var userData = peerUserList.metadata;
// addToUserList(userData);
// delete hjson[hjson.length-1];
// }
var userDocStateDom = hjsonToDom(JSON.parse(shjson)); var userDocStateDom = hjsonToDom(JSON.parse(shjson));
userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf
var patch = (DD).diff(inner, userDocStateDom); var patch = (DD).diff(inner, userDocStateDom);
@ -296,8 +289,6 @@ define([
return hj; return hj;
}; };
// $textarea.val(JSON.stringify(Convert.dom.to.hjson(inner)));
/* It's incredibly important that you assign 'rti.onLocal' /* It's incredibly important that you assign 'rti.onLocal'
It's used inside of realtimeInput to make sure that all changes It's used inside of realtimeInput to make sure that all changes
make it into chainpad. make it into chainpad.
@ -307,16 +298,14 @@ define([
the code less extensible. the code less extensible.
*/ */
var propogate = rti.onLocal = function () { var propogate = rti.onLocal = function () {
/* if the problem were a matter of external patches being // serialize your DOM into an object
applied while a local patch were in progress, then we would
expect to be able to check and find
'module.localChangeInProgress' with a non-zero value while
we were applying a remote change.
*/
var hjson = Hyperjson.fromDOM(inner, isNotMagicLine, brFilter); var hjson = Hyperjson.fromDOM(inner, isNotMagicLine, brFilter);
// append the userlist to the hyperjson structure
if(Object.keys(myData).length > 0) { if(Object.keys(myData).length > 0) {
hjson[hjson.length] = {metadata: userList}; hjson[hjson.length] = {metadata: userList};
} }
// stringify the json and send it into chainpad
var shjson = JSON.stringify(hjson); var shjson = JSON.stringify(hjson);
if (!rti.patchText(shjson)) { if (!rti.patchText(shjson)) {
return; return;

Loading…
Cancel
Save