Removing the uuidhelpers.js due to the fact that it breaks the usage of new feature UUID() without parameter and seems that it is not needed anymore.
This commit is contained in:
@@ -125,10 +125,6 @@ namespace Robomongo
|
||||
std::string esprima = loadFile(":/robomongo/scripts/esprima.js", true);
|
||||
_scope->exec(esprima, "(esprima)", false, true, true);
|
||||
|
||||
// UUID helpers
|
||||
std::string uuidhelpers = loadFile(":/robomongo/scripts/uuidhelpers.js", true);
|
||||
_scope->exec(uuidhelpers, "(uuidhelpers)", false, true, true);
|
||||
|
||||
// Enable verbose shell reporting
|
||||
_scope->exec("_verboseShell = true;", "(verboseShell)", false, false, false);
|
||||
|
||||
@@ -225,7 +221,7 @@ namespace Robomongo
|
||||
"(shell2)" , true , true , false, _timeoutSec * 1000);
|
||||
}
|
||||
else // failed to run script
|
||||
failed = true;
|
||||
failed = true;
|
||||
|
||||
qint64 elapsed = timer.elapsed(); // milliseconds
|
||||
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
// Javascript helper functions for parsing and displaying UUIDs in the MongoDB shell.
|
||||
// This is a temporary solution until SERVER-3153 is implemented.
|
||||
// To create BinData values corresponding to the various driver encodings use:
|
||||
// var s = "{00112233-4455-6677-8899-aabbccddeeff}";
|
||||
// var uuid = UUID(s); // new Standard encoding
|
||||
// var juuid = JUUID(s); // JavaLegacy encoding
|
||||
// var nuuid = NUUID(s); // CSharpLegacy encoding
|
||||
// var pyuuid = PYUUID(s); // PythonLegacy encoding
|
||||
|
||||
function HexToBase64(hex) {
|
||||
var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
var base64 = "";
|
||||
var group;
|
||||
for (var i = 0; i < 30; i += 6) {
|
||||
group = parseInt(hex.substr(i, 6), 16);
|
||||
base64 += base64Digits[(group >> 18) & 0x3f];
|
||||
base64 += base64Digits[(group >> 12) & 0x3f];
|
||||
base64 += base64Digits[(group >> 6) & 0x3f];
|
||||
base64 += base64Digits[group & 0x3f];
|
||||
}
|
||||
group = parseInt(hex.substr(30, 2), 16);
|
||||
base64 += base64Digits[(group >> 2) & 0x3f];
|
||||
base64 += base64Digits[(group << 4) & 0x3f];
|
||||
base64 += "==";
|
||||
return base64;
|
||||
}
|
||||
|
||||
function Base64ToHex(base64) {
|
||||
var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
var hexDigits = "0123456789abcdef";
|
||||
var hex = "";
|
||||
for (var i = 0; i < 24; ) {
|
||||
var e1 = base64Digits.indexOf(base64[i++]);
|
||||
var e2 = base64Digits.indexOf(base64[i++]);
|
||||
var e3 = base64Digits.indexOf(base64[i++]);
|
||||
var e4 = base64Digits.indexOf(base64[i++]);
|
||||
var c1 = (e1 << 2) | (e2 >> 4);
|
||||
var c2 = ((e2 & 15) << 4) | (e3 >> 2);
|
||||
var c3 = ((e3 & 3) << 6) | e4;
|
||||
hex += hexDigits[c1 >> 4];
|
||||
hex += hexDigits[c1 & 15];
|
||||
if (e3 != 64) {
|
||||
hex += hexDigits[c2 >> 4];
|
||||
hex += hexDigits[c2 & 15];
|
||||
}
|
||||
if (e4 != 64) {
|
||||
hex += hexDigits[c3 >> 4];
|
||||
hex += hexDigits[c3 & 15];
|
||||
}
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
||||
|
||||
function newUUID(uuid) {
|
||||
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
|
||||
var base64 = HexToBase64(hex);
|
||||
return new BinData(4, base64); // new subtype 4
|
||||
}
|
||||
|
||||
// Store old UUID implementation (subtype 3)
|
||||
oldUUID = UUID;
|
||||
|
||||
// Replace UUID (subtype 3) with newUUID (subtype 4)
|
||||
UUID = newUUID;
|
||||
|
||||
// If user wants backward compatibility, he should execute
|
||||
// the following lines in order to restore previous meaning
|
||||
// of UUID() function:
|
||||
//
|
||||
// UUID = oldUUID
|
||||
|
||||
|
||||
// Legacy UUID in unspecified encoding
|
||||
function LUUID(uuid) {
|
||||
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
|
||||
var base64 = HexToBase64(hex);
|
||||
return new BinData(3, base64);
|
||||
}
|
||||
|
||||
function JUUID(uuid) {
|
||||
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
|
||||
var msb = hex.substr(0, 16);
|
||||
var lsb = hex.substr(16, 16);
|
||||
msb = msb.substr(14, 2) + msb.substr(12, 2) + msb.substr(10, 2) + msb.substr(8, 2) + msb.substr(6, 2) + msb.substr(4, 2) + msb.substr(2, 2) + msb.substr(0, 2);
|
||||
lsb = lsb.substr(14, 2) + lsb.substr(12, 2) + lsb.substr(10, 2) + lsb.substr(8, 2) + lsb.substr(6, 2) + lsb.substr(4, 2) + lsb.substr(2, 2) + lsb.substr(0, 2);
|
||||
hex = msb + lsb;
|
||||
var base64 = HexToBase64(hex);
|
||||
return new BinData(3, base64);
|
||||
}
|
||||
|
||||
function NUUID(uuid) {
|
||||
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
|
||||
var a = hex.substr(6, 2) + hex.substr(4, 2) + hex.substr(2, 2) + hex.substr(0, 2);
|
||||
var b = hex.substr(10, 2) + hex.substr(8, 2);
|
||||
var c = hex.substr(14, 2) + hex.substr(12, 2);
|
||||
var d = hex.substr(16, 16);
|
||||
hex = a + b + c + d;
|
||||
var base64 = HexToBase64(hex);
|
||||
return new BinData(3, base64);
|
||||
}
|
||||
|
||||
function PYUUID(uuid) {
|
||||
var hex = uuid.replace(/[{}-]/g, ""); // remove extra characters
|
||||
var base64 = HexToBase64(hex);
|
||||
return new BinData(3, base64);
|
||||
}
|
||||
Reference in New Issue
Block a user