1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-25 02:50:08 +03:00

Feature #1302: Update Self-Service to be IE compatible

* Javascript adaptation for IE >= 7
 * Updated crypto-js library. Added base64 enconding library for IE as browser does not support btoa()
 * Update langauge compilation plugin to produce IE >= 7 compatible translation files.
 * Added login warning for IE
(cherry picked from commit 1e9cdff570b9eb9118a94ae47ab196663d9820b0)
This commit is contained in:
Hector Sanjuan 2012-07-18 13:03:27 +02:00 committed by Ruben S. Montero
parent 057da9492b
commit d84ce02d44
17 changed files with 142 additions and 76 deletions

View File

@ -265,6 +265,7 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \
$SUNSTONE_LOCATION/public/locale/sk_SK \
$SUNSTONE_LOCATION/public/locale/zh_TW \
$SUNSTONE_LOCATION/public/vendor \
$SUNSTONE_LOCATION/public/vendor/crypto-js \
$SUNSTONE_LOCATION/public/vendor/jQueryLayout \
$SUNSTONE_LOCATION/public/vendor/dataTables \
$SUNSTONE_LOCATION/public/vendor/jQueryUI \
@ -286,6 +287,7 @@ OZONES_DIRS="$OZONES_LOCATION/lib \
$OZONES_LOCATION/templates \
$OZONES_LOCATION/public \
$OZONES_LOCATION/public/vendor \
$OZONES_LOCATION/public/vendor/crypto-js \
$OZONES_LOCATION/public/vendor/jQuery \
$OZONES_LOCATION/public/vendor/jQueryLayout \
$OZONES_LOCATION/public/vendor/dataTables \
@ -486,6 +488,7 @@ INSTALL_SUNSTONE_FILES=(
SUNSTONE_PUBLIC_JS_FILES:$SUNSTONE_LOCATION/public/js
SUNSTONE_PUBLIC_JS_PLUGINS_FILES:$SUNSTONE_LOCATION/public/js/plugins
SUNSTONE_PUBLIC_CSS_FILES:$SUNSTONE_LOCATION/public/css
SUNSTONE_PUBLIC_VENDOR_CRYPTOJS:$SUNSTONE_LOCATION/public/vendor/crypto-js
SUNSTONE_PUBLIC_VENDOR_DATATABLES:$SUNSTONE_LOCATION/public/vendor/dataTables
SUNSTONE_PUBLIC_VENDOR_JGROWL:$SUNSTONE_LOCATION/public/vendor/jGrowl
SUNSTONE_PUBLIC_VENDOR_JQUERY:$SUNSTONE_LOCATION/public/vendor/jQuery
@ -526,6 +529,7 @@ INSTALL_OZONES_FILES=(
OZONES_LIB_ZONE_FILES:$OZONES_LOCATION/lib/OZones
OZONES_PUBLIC_VENDOR_JQUERY:$OZONES_LOCATION/public/vendor/jQuery
OZONES_PUBLIC_VENDOR_DATATABLES:$OZONES_LOCATION/public/vendor/dataTables
OZONES_PUBLIC_VENDOR_CRYPTOJS:$OZONES_LOCATION/public/vendor/crypto-js
OZONES_PUBLIC_VENDOR_JGROWL:$OZONES_LOCATION/public/vendor/jGrowl
OZONES_PUBLIC_VENDOR_JQUERYUI:$OZONES_LOCATION/public/vendor/jQueryUI
OZONES_PUBLIC_VENDOR_JQUERYUIIMAGES:$OZONES_LOCATION/public/vendor/jQueryUI/images
@ -1336,7 +1340,9 @@ src/sunstone/public/vendor/flot/NOTICE"
SUNSTONE_PUBLIC_VENDOR_CRYPTOJS="\
src/sunstone/public/vendor/crypto-js/NOTICE \
src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js \
src/sunstone/public/vendor/crypto-js/sha1-min.js \
src/sunstone/public/vendor/crypto-js/core-min.js \
src/sunstone/public/vendor/crypto-js/enc-base64-min.js \
src/sunstone/public/vendor/crypto-js/NEW-BSD-LICENSE.txt"
SUNSTONE_PUBLIC_VENDOR_FILEUPLOADER="\
@ -1459,6 +1465,8 @@ OZONES_LIB_API_ZONA_FILES="src/ozones/Client/lib/zona/ZoneElement.rb \
OZONES_PUBLIC_VENDOR_JQUERY=$SUNSTONE_PUBLIC_VENDOR_JQUERY
OZONES_PUBLIC_VENDOR_CRYPTOJS=$SUNSTONE_PUBLIC_VENDOR_CRYPTOJS
OZONES_PUBLIC_VENDOR_DATATABLES=$SUNSTONE_PUBLIC_VENDOR_DATATABLES
OZONES_PUBLIC_VENDOR_JGROWL=$SUNSTONE_PUBLIC_VENDOR_JGROWL

View File

@ -37,10 +37,11 @@ puts "datatable_lang=\"#{datatable_lang}_datatable.txt\""
puts "locale={"
msgid = nil
tr_lines = []
po_file.each do |line|
if msgid
msgstr = line.sub("msgstr ", "").chomp
puts " #{msgid}:#{msgstr},"
tr_lines << " #{msgid}:#{msgstr}"
msgid = nil
next
end
@ -55,4 +56,10 @@ po_file.each do |line|
end
tr_lines[0..-2].each do |line|
puts line+','
end
# last line must not have an ending , for IE7 JS compatibility
puts tr_lines[-1]
puts "}"

View File

@ -525,18 +525,6 @@ ul.action_list{
/*background: #EDEDED;*/
border: 1px solid #525252;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, #E9E9E9),
color-stop(0.63, #F5F5F5)
);
background-image: -moz-linear-gradient(
center bottom,
#E9E9E9 25%,
#F5F5F5 63%
);
position:absolute;
z-index:1;
list-style-type:none;
@ -551,6 +539,16 @@ ul.action_list{
border-radius:4px;
border-bottom-right-radius:5px;
border-bottom-left-radius:5px;
background: #e9e9e9; /* Old browsers */
background: -moz-linear-gradient(top, #e9e9e9 25%, #f5f5f5 63%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(25%,#e9e9e9), color-stop(63%,#f5f5f5)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e9e9e9 25%,#f5f5f5 63%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e9e9e9 25%,#f5f5f5 63%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e9e9e9 25%,#f5f5f5 63%); /* IE10+ */
background: linear-gradient(to bottom, #e9e9e9 25%,#f5f5f5 63%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e9e9e9', endColorstr='#f5f5f5',GradientType=0 ); /* IE6-9 */
}
ul.action_list li a{

View File

@ -107,6 +107,7 @@ body {
padding-left: 0;
border:0;
border-right: 1px solid #353735;
background: #636663; /* Old browsers */
background: -moz-linear-gradient(left, #636663 95%, #353735 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(95%,#636663), color-stop(100%,#353735)); /* Chrome,Safari4+ */

View File

@ -139,6 +139,7 @@ div#login input#login_btn:hover {
position: relative;
top: 80px;
font-size:1.0em;
padding: 2px 15px;
}
#login_spinner {

View File

@ -43,7 +43,7 @@ function auth_error(req, error){
function authenticate(){
var username = $("#username").val();
var password = $("#password").val();
password = Crypto.SHA1(password);
password = CryptoJS.SHA1(password);
var remember = $("#check_remember").is(":checked");
$("#error_box").fadeOut("slow");
@ -63,6 +63,31 @@ function authenticate(){
OCCI.Auth.login(obj);
}
function getInternetExplorerVersion(){
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
function checkVersion(){
var ver = getInternetExplorerVersion();
if ( ver > -1 )
msg = ver <= 7.0 ? "You are using an old version of IE. \
Please upgrade or use Firefox or Chrome for full compatibility." :
"OpenNebula Self-Service is best seen with Chrome or Firefox";
$("#error_box").text(msg);
$("#error_box").fadeIn('slow');
}
$(document).ready(function(){
$('div#logo_selfservice').css("background","url("+logo_big+") no-repeat center");
@ -80,4 +105,6 @@ $(document).ready(function(){
$("input#username.box").focus();
$("#login_spinner").hide();
checkVersion();
});

View File

@ -42,7 +42,7 @@ $.ajaxSetup({
converters: {
"xml ONEjson": function(xml){
return $.xml2json(xml);
},
}
}
});
@ -255,7 +255,7 @@ var OCCI = {
callback_error(request, OCCI.Error(response)) : null;
}
});
},
}
/*
"monitor": function(params,resource,all){
var callback = params.success;
@ -306,9 +306,16 @@ var OCCI = {
type: "POST",
data: {remember: remember, lang: lang},
beforeSend : function(req) {
req.setRequestHeader( "Authorization",
"Basic " + btoa(username + ":" + password)
)
var token = username + ':' + password;
var authString = 'Basic ';
if (typeof(btoa) === 'function')
authString += btoa(token)
else {
token = CryptoJS.enc.Utf8.parse(token);
authString += CryptoJS.enc.Base64.stringify(token)
}
req.setRequestHeader( "Authorization", authString);
},
success: function(response){
return callback ? callback(request, response) : null;
@ -389,7 +396,7 @@ var OCCI = {
"unpublish": function(params){
params.data.body = { "PUBLIC": "NO" };
OCCI.Action.update(params,OCCI.Network.resource,"unpublish");
},
}
},
"VM": {
@ -474,7 +481,7 @@ var OCCI = {
"stopvnc" : function(params){
OCCI.VM.vnc(params,"stopvnc");
},
}
/*
"monitor" : function(params){
OCCI.Action.monitor(params,OCCI.VM.resource,false);
@ -534,7 +541,7 @@ var OCCI = {
"nonpersistent": function(params){
params.data.body = { "PERSISTENT":"NO" };
OCCI.Action.update(params,OCCI.Image.resource,"nonpersistent");
},
}
},
"Template" : {
@ -587,7 +594,7 @@ var OCCI = {
"resource" : "INSTANCE_TYPE",
"list" : function(params){
OCCI.Action.list(params,OCCI.Instance_type.resource);
},
}
},
"User" : {
@ -597,8 +604,7 @@ var OCCI = {
},
"show" : function(params){
OCCI.Action.show(params,OCCI.User.resource);
},
},
}
}
}

View File

@ -130,7 +130,7 @@ var vm_actions = {
"VM.create_dialog" : {
type: "custom",
call: popUpCreateVMDialog,
call: popUpCreateVMDialog
},
"VM.list" : {
@ -159,14 +159,14 @@ var vm_actions = {
call : function (){
waitingNodes(dataTable_vMachines);
Sunstone.runAction("VM.list");
},
}
},
"VM.autorefresh" : {
type: "custom",
call : function() {
OCCI.VM.list({timeout: true, success: updateVMachinesView,error: onError});
},
}
},
"VM.suspend" : {
@ -262,6 +262,7 @@ var vm_actions = {
callback: saveasDisksCallback,
error: onError
},
"VM.getInstanceTypes" : {
type: "list",
call: OCCI.Instance_type.list,
@ -292,7 +293,7 @@ var vm_actions = {
call: OCCI.VM.stopvnc,
error: onError,
notify: true
},
}
/*
"VM.monitor" : {
@ -319,9 +320,9 @@ var vm_actions = {
var vm_buttons = {
"VM.refresh" : {
type: "image",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
type: "action",
text: '<i class="icon-refresh icon-large">',
alwaysActive: true
},
"VM.create_dialog" : {
@ -395,14 +396,14 @@ var vm_info_panel = {
"vm_networks_tab" : {
title: tr("Networks"),
content: ""
},
}
}
var vm_create_panel = {
"vm_create_panel" : {
title: tr("Create Virtual Machine"),
content: create_vm_tmpl
},
}
};
var vms_tab = {
@ -723,7 +724,7 @@ function popUpCreateVMDialog(){
$('#network_box',dialog).html(net_select);
$('#network_box option',dialog).each(function(){
$(this).text('☐ '+$(this).text()+' (id:'+$(this).val()+')');
$(this).text('☐ '+$(this).text());
});
@ -736,7 +737,7 @@ function popUpCreateVMDialog(){
$('#disk_box',dialog).html(image_select);
$('#disk_box option',dialog).each(function(){
$(this).text('☐ '+$(this).text()+' (id:'+$(this).val()+')');
$(this).text('☐ '+$(this).text());
});
@ -771,7 +772,7 @@ function popUpCreateVMDialog(){
var vm = {
"NAME" : vm_name,
"INSTANCE_TYPE" : instance_type,
"INSTANCE_TYPE" : instance_type
};
var href = location.protocol + "//" + location.host;
@ -844,7 +845,7 @@ function setupSaveasDialog(){
width:600,
modal:true,
height:350,
resizable:true,
resizable:true
});
$('#saveas_vm_form',dialog).submit(function(){
@ -862,7 +863,7 @@ function setupSaveasDialog(){
else {
var obj = {
disk_id : disk_id,
image_name : image_name,
image_name : image_name
};
args.push(id);
Sunstone.runAction("VM.saveas",id,obj);
@ -1126,7 +1127,7 @@ $(document).ready(function(){
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "110px", "aTargets": [3] },
{ "sWidth": "110px", "aTargets": [3] }
],
"oLanguage": (datatable_lang != "") ?
{

View File

@ -56,7 +56,7 @@ var config_actions = {
call : OCCI.Config.list,
callback : updateConfig,
error : onError
},
}
};
var config_tab = {

View File

@ -148,15 +148,15 @@ var vnet_actions = {
elements: vnElements,
error: onError,
notify: true
},
}
};
var vnet_buttons = {
"Network.refresh" : {
type: "image",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
type: "action",
text: '<i class="icon-refresh icon-large">',
alwaysActive: true
},
"Network.create_dialog" : {
@ -184,7 +184,7 @@ var vnet_info_panel = {
"vnet_info_tab" : {
title: tr("Network information"),
content: ""
},
}
}
@ -192,7 +192,7 @@ var vnet_create_panel = {
"vnet_create_panel" : {
title: tr("Create network"),
content: create_vn_tmpl
},
}
}
var vnets_tab = {
@ -409,7 +409,7 @@ $(document).ready(function(){
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "35px", "aTargets": [1] }
],
"oLanguage": (datatable_lang != "") ?
{

View File

@ -149,7 +149,7 @@ var image_actions = {
call: function () {
waitingNodes(dataTable_images);
Sunstone.runAction("Image.list");
},
}
},
"Image.autorefresh" : {
@ -204,15 +204,15 @@ var image_actions = {
elements: imageElements,
error: onError,
notify: true
},
}
}
var image_buttons = {
"Image.refresh" : {
type: "image",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
type: "action",
text: '<i class="icon-refresh icon-large">',
alwaysActive: true
},
"Image.create_dialog" : {
type: "create_dialog",
@ -249,15 +249,14 @@ var image_info_panel = {
"image_info_tab" : {
title: tr("Image information"),
content: ""
},
}
};
var image_create_panel = {
"image_create_panel" : {
title: tr("Add storage"),
content: create_image_tmpl
},
}
};
var images_tab = {
@ -448,7 +447,7 @@ function popUpCreateImageDialog(){
width: "258px",
// left: "133px",
height: "15px",
display: "inline-block",
display: "inline-block"
});
$('#upload-progress div',dialog).css("border","1px solid #AAAAAA");
@ -482,7 +481,7 @@ function popUpCreateImageDialog(){
return false;
},
onCancel: function(id, fileName){
},
}
});
var file_input = false;
@ -593,7 +592,7 @@ $(document).ready(function(){
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "35px", "aTargets": [1] }
],
"oLanguage": (datatable_lang != "") ?
{

View File

@ -6,7 +6,9 @@
<link rel="stylesheet" type="text/css" href="vendor/jQueryUI/jquery-ui-1.8.16.custom.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="vendor/crypto-js/2.3.0-crypto-sha1.js"></script>
<script type="text/javascript" src="vendor/crypto-js/core-min.js"></script>
<script type="text/javascript" src="vendor/crypto-js/sha1-min.js"></script>
<script type="text/javascript" src="vendor/crypto-js/enc-base64-min.js"></script>
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/locale.js"></script>

View File

@ -684,7 +684,7 @@ function plot_graph(data,context,id_prefix,info){
xaxis : {
tickFormatter: function(val,axis){
return pretty_time_axis(val);
},
}
},
yaxis : { labelWidth: 40,
tickFormatter: function(val, axis) {
@ -749,7 +749,7 @@ function setupTemplateUpdateDialog(){
width:700,
modal:true,
height:430,
resizable:false,
resizable:false
});
$('button',dialog).button();

View File

@ -1,12 +0,0 @@
/*
* Crypto-JS v2.3.0
* http://code.google.com/p/crypto-js/
* Copyright (c) 2011, Jeff Mott. All rights reserved.
* http://code.google.com/p/crypto-js/wiki/License
*/
if(typeof Crypto=="undefined"||!Crypto.util)(function(){var k=window.Crypto={},l=k.util={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return l.rotl(a,8)&16711935|l.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=l.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],b=0,d=0;b<a.length;b++,d+=8)c[d>>>5]|=a[b]<<24-
d%32;return c},wordsToBytes:function(a){for(var c=[],b=0;b<a.length*32;b+=8)c.push(a[b>>>5]>>>24-b%32&255);return c},bytesToHex:function(a){for(var c=[],b=0;b<a.length;b++){c.push((a[b]>>>4).toString(16));c.push((a[b]&15).toString(16))}return c.join("")},hexToBytes:function(a){for(var c=[],b=0;b<a.length;b+=2)c.push(parseInt(a.substr(b,2),16));return c},bytesToBase64:function(a){if(typeof btoa=="function")return btoa(m.bytesToString(a));for(var c=[],b=0;b<a.length;b+=3)for(var d=a[b]<<16|a[b+1]<<
8|a[b+2],e=0;e<4;e++)b*8+e*6<=a.length*8?c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>>6*(3-e)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){if(typeof atob=="function")return m.stringToBytes(atob(a));a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],b=0,d=0;b<a.length;d=++b%4)d!=0&&c.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(b-1))&Math.pow(2,-2*d+8)-1)<<d*2|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a.charAt(b))>>>
6-d*2);return c}};k=k.charenc={};k.UTF8={stringToBytes:function(a){return m.stringToBytes(unescape(encodeURIComponent(a)))},bytesToString:function(a){return decodeURIComponent(escape(m.bytesToString(a)))}};var m=k.Binary={stringToBytes:function(a){for(var c=[],b=0;b<a.length;b++)c.push(a.charCodeAt(b)&255);return c},bytesToString:function(a){for(var c=[],b=0;b<a.length;b++)c.push(String.fromCharCode(a[b]));return c.join("")}}})();
(function(){var k=Crypto,l=k.util,m=k.charenc,a=m.UTF8,c=m.Binary,b=k.SHA1=function(d,e){var g=l.wordsToBytes(b._sha1(d));return e&&e.asBytes?g:e&&e.asString?c.bytesToString(g):l.bytesToHex(g)};b._sha1=function(d){if(d.constructor==String)d=a.stringToBytes(d);var e=l.bytesToWords(d),g=d.length*8;d=[];var n=1732584193,h=-271733879,i=-1732584194,j=271733878,o=-1009589776;e[g>>5]|=128<<24-g%32;e[(g+64>>>9<<4)+15]=g;for(g=0;g<e.length;g+=16){for(var q=n,r=h,s=i,t=j,u=o,f=0;f<80;f++){if(f<16)d[f]=e[g+
f];else{var p=d[f-3]^d[f-8]^d[f-14]^d[f-16];d[f]=p<<1|p>>>31}p=(n<<5|n>>>27)+o+(d[f]>>>0)+(f<20?(h&i|~h&j)+1518500249:f<40?(h^i^j)+1859775393:f<60?(h&i|h&j|i&j)-1894007588:(h^i^j)-899497514);o=j;j=i;i=h<<30|h>>>2;h=n;n=p}n+=q;h+=r;i+=s;j+=t;o+=u}return[n,h,i,j,o]};b._blocksize=16;b._digestsize=20})();

View File

@ -0,0 +1,12 @@
/*
CryptoJS v3.0.2
code.google.com/p/crypto-js
(c) 2009-2012 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(h,o){var f={},j=f.lib={},k=j.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;b&&c.mixIn(b);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),i=j.WordArray=k.extend({init:function(a,b){a=
this.words=a||[];this.sigBytes=b!=o?b:4*a.length},toString:function(a){return(a||p).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var e=0;e<a;e++)b[d+e>>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535<c.length)for(e=0;e<a;e+=4)b[d+e>>>2]=c[e>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=
k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c<a;c+=4)b.push(4294967296*h.random()|0);return i.create(b,a)}}),l=f.enc={},p=l.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,c=[],d=0;d<a;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return i.create(c,b/2)}},n=l.Latin1={stringify:function(a){for(var b=
a.words,a=a.sigBytes,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return i.create(c,b)}},q=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},m=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create();
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=q.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,f=d/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*e,d=h.min(4*a,d);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(c,g);g=c.splice(0,a);b.sigBytes-=d}return i.create(g,d)},clone:function(){var a=k.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});j.Hasher=m.extend({init:function(){this.reset()},
reset:function(){m.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=m.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return r.HMAC.create(a,c).finalize(b)}}});var r=f.algo={};return f}(Math);

View File

@ -0,0 +1,8 @@
/*
CryptoJS v3.0.2
code.google.com/p/crypto-js
(c) 2009-2012 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function(){var h=CryptoJS,i=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();for(var b=[],a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var b=b.replace(/\s/g,""),e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));
for(var c=[],a=0,d=0;d<e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return i.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();

View File

@ -0,0 +1,8 @@
/*
CryptoJS v3.0.2
code.google.com/p/crypto-js
(c) 2009-2012 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function(){var d=CryptoJS,c=d.lib,l=c.WordArray,c=c.Hasher,j=[],k=d.algo.SHA1=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,m){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],i=a[3],d=a[4],b=0;80>b;b++){if(16>b)j[b]=c[m+b]|0;else{var g=j[b-3]^j[b-8]^j[b-14]^j[b-16];j[b]=g<<1|g>>>31}g=(e<<5|e>>>27)+d+j[b];g=20>b?g+((f&h|~f&i)+1518500249):40>b?g+((f^h^i)+1859775393):60>b?g+((f&h|f&i|h&i)-1894007588):g+((f^h^i)-
899497514);d=i;i=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+i|0;a[4]=a[4]+d|0},_doFinalize:function(){var d=this._data,c=d.words,a=8*this._nDataBytes,e=8*d.sigBytes;c[e>>>5]|=128<<24-e%32;c[(e+64>>>9<<4)+15]=a;d.sigBytes=4*c.length;this._process()}});d.SHA1=c._createHelper(k);d.HmacSHA1=c._createHmacHelper(k)})();