Merge pull request #2479 from ether/export-privacy

Export privacy
pull/2488/head
John McLear 2015-01-21 01:20:51 +00:00
commit ee48b8b93a
7 changed files with 20 additions and 7 deletions

View File

@ -48,6 +48,7 @@ exports.getPadRaw = function(padId, callback){
// Get the author info
db.get("globalAuthor:"+authorId, function(e, authorEntry){
authorEntry.padIDs = padId;
if(!e) data["globalAuthor:"+authorId] = authorEntry;
});

View File

@ -24,12 +24,25 @@ exports.setPadRaw = function(padId, records, callback){
async.eachSeries(Object.keys(records), function(key, cb){
var value = records[key]
// we know its an author
// Author data
if(value.padIDs){
// rewrite author pad ids
value.padIDs[padId] = 1;
var newKey = key;
// Does this author already exist?
db.get(key, function(err, author){
if(author){
// Yes, add the padID to the author..
author.padIDs.push(padId);
value = author;
}else{
// No, create a new array with the author info in
value.padIDs = [padId];
}
});
// Not author data, probably pad data
}else{
// we can split it to look to see if its pad data
var oldPadId = key.split(":");

View File

@ -43,9 +43,8 @@ describe("bold button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
console.log(inner$(window)[0].bowser);
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -297,7 +297,7 @@ function prepareDocument(n, target){ // generates a random document with random
}
function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -15,7 +15,7 @@ describe("indentation button", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -44,7 +44,7 @@ describe("italic some text", function(){
//select this text element
$firstTextElement.sendkeys('{selectall}');
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";

View File

@ -47,7 +47,7 @@ describe("undo button then redo button", function(){
var modifiedValue = $firstTextElement.text(); // get the modified value
expect(modifiedValue).not.to.be(originalValue); // expect the value to change
if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser
if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE
var evtType = "keypress";
}else{
var evtType = "keydown";