зеркало из https://github.com/mozilla/pjs.git
Not needed the base64 encoding for now.
This commit is contained in:
Родитель
5079ab1939
Коммит
8a407af516
|
@ -53,71 +53,6 @@ function syncUIZoom() {
|
|||
document.styleSheets[1].cssRules[1].style.fontSize=currentUILevel+"px";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Bookmark Utility Services - for the General Session
|
||||
*/
|
||||
|
||||
const charRange="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
function encode(str) {
|
||||
|
||||
i=0;
|
||||
e64="";
|
||||
var cp1,cp2,cp3,newA,newB,newC,newD;
|
||||
do {
|
||||
cp1 = str.charCodeAt(i++);
|
||||
cp2 = str.charCodeAt(i++);
|
||||
cp3 = str.charCodeAt(i++);
|
||||
|
||||
newA= ( cp1 >> 2 );
|
||||
newB= ( ( (cp1&3) << 4 ) | ( cp2 >> 4 ) );
|
||||
newC= ( ( (cp2 & 15) << 2 ) | ( cp3 >> 6 ) );
|
||||
newD= cp3 & 63;
|
||||
|
||||
e64= e64+ a.charAt(newA)+a.charAt(newB)+a.charAt(newC)+a.charAt(newD);
|
||||
if (isNaN(cp2)) {
|
||||
newC = enc4 = 64;
|
||||
} else if (isNaN(cp3)) {
|
||||
newD = 64;
|
||||
}
|
||||
} while (i < str.length);
|
||||
|
||||
|
||||
|
||||
return e64;
|
||||
}
|
||||
|
||||
function decode(str) {
|
||||
|
||||
var i=0;
|
||||
var d64="";
|
||||
var newA, newB,newC,newD,cp1,cp2,cp3;
|
||||
str= str.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
do {
|
||||
newA=charRange.indexOf(str.charAt(i++));
|
||||
newB=charRange.indexOf(str.charAt(i++));
|
||||
newC=charRange.indexOf(str.charAt(i++));
|
||||
newD=charRange.indexOf(str.charAt(i++));
|
||||
|
||||
cp1 = (newA << 2) | (newB >> 4);
|
||||
cp2 = ( ((newB & 15) << 4) | (newC >> 2) );
|
||||
cp3 = ( ((newC & 3 )<< 6) | newD );
|
||||
|
||||
d64= d64 + String.fromCharCode(cp1);
|
||||
|
||||
if (newC != 64) {
|
||||
d64= d64+ String.fromCharCode(cp2);
|
||||
}
|
||||
if (newD != 64) {
|
||||
d64= d64+ String.fromCharCode(cp3);
|
||||
}
|
||||
|
||||
} while (i < str.length);
|
||||
|
||||
return d64;
|
||||
}
|
||||
|
||||
function loadBookmarks(storeStr) {
|
||||
|
||||
var aDOMParser = new DOMParser();
|
||||
|
|
Загрузка…
Ссылка в новой задаче