Comparing version 0.0.1 to 0.0.2
33
hooks.js
@@ -75,3 +75,3 @@ var ERR = require("async-stacktrace"); | ||
function (cb) { | ||
readOnlyManager.getIds(oldPadId, function(err, value) { | ||
exports.getIds(oldPadId, function(err, value) { | ||
if(ERR(err, cb)) return; | ||
@@ -194,1 +194,32 @@ oldPadId = value.padId; | ||
} | ||
/** | ||
* returns a the padId and readonlyPadId in an object for any id | ||
* @param {String} padIdOrReadonlyPadId read only id or real pad id | ||
*/ | ||
exports.getIds = function(padIdOrReadonlyPadId, callback) { | ||
var handleRealPadId = function () { | ||
readOnlyManager.getReadOnlyId(padIdOrReadonlyPadId, function (err, value) { | ||
callback(null, { | ||
readOnlyPadId: value, | ||
padId: padIdOrReadonlyPadId, | ||
readonly: false | ||
}); | ||
}); | ||
} | ||
if (padIdOrReadonlyPadId.indexOf("r.") != 0) | ||
return handleRealPadId(); | ||
readOnlyManager.getPadId(padIdOrReadonlyPadId, function (err, value) { | ||
if(ERR(err, callback)) return; | ||
if (value == null) | ||
return handleRealPadId(); | ||
callback(null, { | ||
readOnlyPadId: padIdOrReadonlyPadId, | ||
padId: value, | ||
readonly: true | ||
}); | ||
}); | ||
} |
{ | ||
"name": "ep_copypad", | ||
"description": "Enables the user to copy a pad with all its content but (without any history) to a new pad", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "RedHog (Egil Moeller) <egil.moller@freecode.no>", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8334
219