burp_cms 1.3.8 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +1 -1
- data/app/assets/packages/burp/editing/js/content-decorator.js +8 -4
- data/app/assets/packages/burp/editing/js/jquery.html2markdown.js +106 -0
- data/app/assets/packages/burp/editing/js/main.js +34 -28
- data/app/assets/packages/burp/editing.js +1 -2
- data/app/controllers/burp/pages_controller.rb +0 -1
- data/app/models/burp/page_model.rb +3 -3
- data/config/cucumber.yml +6 -6
- data/lib/burp/version.rb +1 -1
- metadata +34 -706
- data/app/assets/packages/burp/editing/js/md5.js +0 -207
- data/app/assets/packages/burp/editing/js/stay.js +0 -143
@@ -1,207 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
*
|
3
|
-
* MD5 (Message-Digest Algorithm)
|
4
|
-
* http://www.webtoolkit.info/
|
5
|
-
*
|
6
|
-
**/
|
7
|
-
|
8
|
-
var MD5 = function (string) {
|
9
|
-
|
10
|
-
function RotateLeft(lValue, iShiftBits) {
|
11
|
-
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
|
12
|
-
}
|
13
|
-
|
14
|
-
function AddUnsigned(lX,lY) {
|
15
|
-
var lX4,lY4,lX8,lY8,lResult;
|
16
|
-
lX8 = (lX & 0x80000000);
|
17
|
-
lY8 = (lY & 0x80000000);
|
18
|
-
lX4 = (lX & 0x40000000);
|
19
|
-
lY4 = (lY & 0x40000000);
|
20
|
-
lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
|
21
|
-
if (lX4 & lY4) {
|
22
|
-
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
|
23
|
-
}
|
24
|
-
if (lX4 | lY4) {
|
25
|
-
if (lResult & 0x40000000) {
|
26
|
-
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
|
27
|
-
} else {
|
28
|
-
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
|
29
|
-
}
|
30
|
-
} else {
|
31
|
-
return (lResult ^ lX8 ^ lY8);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
function F(x,y,z) { return (x & y) | ((~x) & z); }
|
36
|
-
function G(x,y,z) { return (x & z) | (y & (~z)); }
|
37
|
-
function H(x,y,z) { return (x ^ y ^ z); }
|
38
|
-
function I(x,y,z) { return (y ^ (x | (~z))); }
|
39
|
-
|
40
|
-
function FF(a,b,c,d,x,s,ac) {
|
41
|
-
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
|
42
|
-
return AddUnsigned(RotateLeft(a, s), b);
|
43
|
-
};
|
44
|
-
|
45
|
-
function GG(a,b,c,d,x,s,ac) {
|
46
|
-
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
|
47
|
-
return AddUnsigned(RotateLeft(a, s), b);
|
48
|
-
};
|
49
|
-
|
50
|
-
function HH(a,b,c,d,x,s,ac) {
|
51
|
-
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
|
52
|
-
return AddUnsigned(RotateLeft(a, s), b);
|
53
|
-
};
|
54
|
-
|
55
|
-
function II(a,b,c,d,x,s,ac) {
|
56
|
-
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
|
57
|
-
return AddUnsigned(RotateLeft(a, s), b);
|
58
|
-
};
|
59
|
-
|
60
|
-
function ConvertToWordArray(string) {
|
61
|
-
var lWordCount;
|
62
|
-
var lMessageLength = string.length;
|
63
|
-
var lNumberOfWords_temp1=lMessageLength + 8;
|
64
|
-
var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
|
65
|
-
var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
|
66
|
-
var lWordArray=Array(lNumberOfWords-1);
|
67
|
-
var lBytePosition = 0;
|
68
|
-
var lByteCount = 0;
|
69
|
-
while ( lByteCount < lMessageLength ) {
|
70
|
-
lWordCount = (lByteCount-(lByteCount % 4))/4;
|
71
|
-
lBytePosition = (lByteCount % 4)*8;
|
72
|
-
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
|
73
|
-
lByteCount++;
|
74
|
-
}
|
75
|
-
lWordCount = (lByteCount-(lByteCount % 4))/4;
|
76
|
-
lBytePosition = (lByteCount % 4)*8;
|
77
|
-
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
|
78
|
-
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
|
79
|
-
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
|
80
|
-
return lWordArray;
|
81
|
-
};
|
82
|
-
|
83
|
-
function WordToHex(lValue) {
|
84
|
-
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
|
85
|
-
for (lCount = 0;lCount<=3;lCount++) {
|
86
|
-
lByte = (lValue>>>(lCount*8)) & 255;
|
87
|
-
WordToHexValue_temp = "0" + lByte.toString(16);
|
88
|
-
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
|
89
|
-
}
|
90
|
-
return WordToHexValue;
|
91
|
-
};
|
92
|
-
|
93
|
-
function Utf8Encode(string) {
|
94
|
-
string = string.replace(/\r\n/g,"\n");
|
95
|
-
var utftext = "";
|
96
|
-
|
97
|
-
for (var n = 0; n < string.length; n++) {
|
98
|
-
|
99
|
-
var c = string.charCodeAt(n);
|
100
|
-
|
101
|
-
if (c < 128) {
|
102
|
-
utftext += String.fromCharCode(c);
|
103
|
-
}
|
104
|
-
else if((c > 127) && (c < 2048)) {
|
105
|
-
utftext += String.fromCharCode((c >> 6) | 192);
|
106
|
-
utftext += String.fromCharCode((c & 63) | 128);
|
107
|
-
}
|
108
|
-
else {
|
109
|
-
utftext += String.fromCharCode((c >> 12) | 224);
|
110
|
-
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
111
|
-
utftext += String.fromCharCode((c & 63) | 128);
|
112
|
-
}
|
113
|
-
|
114
|
-
}
|
115
|
-
|
116
|
-
return utftext;
|
117
|
-
};
|
118
|
-
|
119
|
-
var x=Array();
|
120
|
-
var k,AA,BB,CC,DD,a,b,c,d;
|
121
|
-
var S11=7, S12=12, S13=17, S14=22;
|
122
|
-
var S21=5, S22=9 , S23=14, S24=20;
|
123
|
-
var S31=4, S32=11, S33=16, S34=23;
|
124
|
-
var S41=6, S42=10, S43=15, S44=21;
|
125
|
-
|
126
|
-
string = Utf8Encode(string);
|
127
|
-
|
128
|
-
x = ConvertToWordArray(string);
|
129
|
-
|
130
|
-
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
|
131
|
-
|
132
|
-
for (k=0;k<x.length;k+=16) {
|
133
|
-
AA=a; BB=b; CC=c; DD=d;
|
134
|
-
a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
|
135
|
-
d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
|
136
|
-
c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
|
137
|
-
b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
|
138
|
-
a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
|
139
|
-
d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
|
140
|
-
c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
|
141
|
-
b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
|
142
|
-
a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
|
143
|
-
d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
|
144
|
-
c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
|
145
|
-
b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
|
146
|
-
a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
|
147
|
-
d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
|
148
|
-
c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
|
149
|
-
b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
|
150
|
-
a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
|
151
|
-
d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
|
152
|
-
c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
|
153
|
-
b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
|
154
|
-
a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
|
155
|
-
d=GG(d,a,b,c,x[k+10],S22,0x2441453);
|
156
|
-
c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
|
157
|
-
b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
|
158
|
-
a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
|
159
|
-
d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
|
160
|
-
c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
|
161
|
-
b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
|
162
|
-
a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
|
163
|
-
d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
|
164
|
-
c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
|
165
|
-
b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
|
166
|
-
a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
|
167
|
-
d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
|
168
|
-
c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
|
169
|
-
b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
|
170
|
-
a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
|
171
|
-
d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
|
172
|
-
c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
|
173
|
-
b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
|
174
|
-
a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
|
175
|
-
d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
|
176
|
-
c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
|
177
|
-
b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
|
178
|
-
a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
|
179
|
-
d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
|
180
|
-
c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
|
181
|
-
b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
|
182
|
-
a=II(a,b,c,d,x[k+0], S41,0xF4292244);
|
183
|
-
d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
|
184
|
-
c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
|
185
|
-
b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
|
186
|
-
a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
|
187
|
-
d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
|
188
|
-
c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
|
189
|
-
b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
|
190
|
-
a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
|
191
|
-
d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
|
192
|
-
c=II(c,d,a,b,x[k+6], S43,0xA3014314);
|
193
|
-
b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
|
194
|
-
a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
|
195
|
-
d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
|
196
|
-
c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
|
197
|
-
b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
|
198
|
-
a=AddUnsigned(a,AA);
|
199
|
-
b=AddUnsigned(b,BB);
|
200
|
-
c=AddUnsigned(c,CC);
|
201
|
-
d=AddUnsigned(d,DD);
|
202
|
-
}
|
203
|
-
|
204
|
-
var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
|
205
|
-
|
206
|
-
return temp.toLowerCase();
|
207
|
-
}
|
@@ -1,143 +0,0 @@
|
|
1
|
-
/*global
|
2
|
-
MD5
|
3
|
-
*/
|
4
|
-
$(function() {
|
5
|
-
|
6
|
-
$.fn.md5Hash = function() {
|
7
|
-
|
8
|
-
$(this).each(function() {
|
9
|
-
var html = $(this).html();
|
10
|
-
if(!$(this).data('md5-hash') || $(this).data('md5-hash-html') !== html) {
|
11
|
-
$(this).data('md5-hash-html',html);
|
12
|
-
$(this).data('md5-hash',MD5(html));
|
13
|
-
}
|
14
|
-
});
|
15
|
-
|
16
|
-
return $(this).data('md5-hash');
|
17
|
-
};
|
18
|
-
|
19
|
-
$.fn.park = function(selector) {
|
20
|
-
|
21
|
-
$(this).each(function() {
|
22
|
-
|
23
|
-
var tempLocation = $(this).data('park-temp-element') || $('<div></div>');
|
24
|
-
$(this).data('park-temp-element',tempLocation);
|
25
|
-
|
26
|
-
$(this).find(selector).each(function() {
|
27
|
-
|
28
|
-
var above = ['top'];
|
29
|
-
var below = [];
|
30
|
-
|
31
|
-
$($(this).prevAll("p,ul,ol,h1,h2,h3,h4,h5").get().reverse()).each(function() {
|
32
|
-
above.push($(this).md5Hash());
|
33
|
-
});
|
34
|
-
|
35
|
-
$(this).nextAll("p,ul,ol,h1,h2,h3,h4,h5").each(function() {
|
36
|
-
below.push($(this).md5Hash());
|
37
|
-
});
|
38
|
-
|
39
|
-
if(above.length == 0) {
|
40
|
-
above.push('top');
|
41
|
-
}
|
42
|
-
|
43
|
-
if(below.length == 0) {
|
44
|
-
below.push('bottom');
|
45
|
-
}
|
46
|
-
|
47
|
-
$(this).data('hashes-above',above.reverse().slice(0,3).reverse());
|
48
|
-
$(this).data('hashes-below',below.slice(0,3));
|
49
|
-
|
50
|
-
tempLocation.append(this);
|
51
|
-
});
|
52
|
-
});
|
53
|
-
};
|
54
|
-
|
55
|
-
var multiplyer = 0.62;
|
56
|
-
|
57
|
-
function matchBelow(hashes,location,below) {
|
58
|
-
hashes = hashes.slice(location);
|
59
|
-
|
60
|
-
var currentValue = 1;
|
61
|
-
var totalMatchValue = 0;
|
62
|
-
|
63
|
-
$.each(below,function(index,value) {
|
64
|
-
if(value === hashes[index]) {
|
65
|
-
totalMatchValue += currentValue;
|
66
|
-
}
|
67
|
-
|
68
|
-
currentValue = currentValue * multiplyer;
|
69
|
-
});
|
70
|
-
|
71
|
-
return totalMatchValue;
|
72
|
-
}
|
73
|
-
|
74
|
-
function matchAbove(hashes,location,above) {
|
75
|
-
hashes = hashes.slice(0,location).reverse();
|
76
|
-
above = above.slice(0).reverse();
|
77
|
-
|
78
|
-
return matchBelow(hashes,0,above);
|
79
|
-
}
|
80
|
-
|
81
|
-
$.fn.unpark = function() {
|
82
|
-
console.debug('unpark');
|
83
|
-
|
84
|
-
$(this).each(function() {
|
85
|
-
|
86
|
-
var hashes = [];
|
87
|
-
var elements = [];
|
88
|
-
var container = this;
|
89
|
-
|
90
|
-
$(this).find("p,ul,ol,h1,h2,h3,h4,h5").each(function() {
|
91
|
-
var hash = $(this).md5Hash();
|
92
|
-
elements.push({hash:hash,element:this});
|
93
|
-
hashes.push(hash);
|
94
|
-
});
|
95
|
-
|
96
|
-
hashes.unshift('top');
|
97
|
-
elements.unshift('top');
|
98
|
-
hashes.push('bottom');
|
99
|
-
elements.push('bottom');
|
100
|
-
|
101
|
-
$($(this).data('park-temp-element') || []).first().children().each(function() {
|
102
|
-
|
103
|
-
console.debug(" ");
|
104
|
-
console.debug(this);
|
105
|
-
console.debug(hashes);
|
106
|
-
console.debug($(this).data('hashes-above'),$(this).data('hashes-below'))
|
107
|
-
|
108
|
-
var best = {match:0};
|
109
|
-
var element = this;
|
110
|
-
|
111
|
-
$.each(elements,function(index,value) {
|
112
|
-
var a = matchAbove(hashes,index,$(element).data('hashes-above') || []);
|
113
|
-
var b = matchBelow(hashes,index,$(element).data('hashes-below') || []);
|
114
|
-
var match = a + b;
|
115
|
-
|
116
|
-
|
117
|
-
if(match > best.match && match >= 1) {
|
118
|
-
if(value === 'top' || value === "bottom") {
|
119
|
-
best = {match:match,element:value};
|
120
|
-
} else {
|
121
|
-
best = {match:match,element:value.element};
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
console.debug({above:a,below:b,result:match},best);
|
126
|
-
});
|
127
|
-
|
128
|
-
if(best.element === 'top') {
|
129
|
-
$(container).prepend(element);
|
130
|
-
} else if(best.element === "bottom") {
|
131
|
-
$(container).append(element);
|
132
|
-
} else if(best.element) {
|
133
|
-
$(element).insertBefore(best.element);
|
134
|
-
}
|
135
|
-
});
|
136
|
-
|
137
|
-
// Remove any left over element
|
138
|
-
$($(this).data('park-temp-element') || []).first().children().remove();
|
139
|
-
});
|
140
|
-
};
|
141
|
-
|
142
|
-
|
143
|
-
});
|