From d84ce02d44d8fcf606d4501ec22a94a07691b5de Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 18 Jul 2012 13:03:27 +0200 Subject: [PATCH] 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) --- install.sh | 10 +++++- share/scons/po2json.rb | 9 +++++- .../occi/lib/ui/public/css/application.css | 22 ++++++------- src/cloud/occi/lib/ui/public/css/layout.css | 1 + src/cloud/occi/lib/ui/public/css/login.css | 1 + src/cloud/occi/lib/ui/public/js/login.js | 29 ++++++++++++++++- src/cloud/occi/lib/ui/public/js/occi.js | 30 +++++++++++------- .../occi/lib/ui/public/js/plugins/compute.js | 31 ++++++++++--------- .../lib/ui/public/js/plugins/configuration.js | 2 +- .../occi/lib/ui/public/js/plugins/network.js | 14 ++++----- .../occi/lib/ui/public/js/plugins/storage.js | 21 ++++++------- src/cloud/occi/lib/ui/templates/login.html | 4 ++- src/sunstone/public/js/sunstone-util.js | 4 +-- .../vendor/crypto-js/2.3.0-crypto-sha1.js | 12 ------- .../public/vendor/crypto-js/core-min.js | 12 +++++++ .../public/vendor/crypto-js/enc-base64-min.js | 8 +++++ .../public/vendor/crypto-js/sha1-min.js | 8 +++++ 17 files changed, 142 insertions(+), 76 deletions(-) delete mode 100644 src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js create mode 100644 src/sunstone/public/vendor/crypto-js/core-min.js create mode 100644 src/sunstone/public/vendor/crypto-js/enc-base64-min.js create mode 100644 src/sunstone/public/vendor/crypto-js/sha1-min.js diff --git a/install.sh b/install.sh index 347a6e5597..fd161239ad 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/share/scons/po2json.rb b/share/scons/po2json.rb index b46d9ef832..9153736f34 100755 --- a/share/scons/po2json.rb +++ b/share/scons/po2json.rb @@ -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 "}" diff --git a/src/cloud/occi/lib/ui/public/css/application.css b/src/cloud/occi/lib/ui/public/css/application.css index a1b6b3cf61..faad452b97 100644 --- a/src/cloud/occi/lib/ui/public/css/application.css +++ b/src/cloud/occi/lib/ui/public/css/application.css @@ -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{ diff --git a/src/cloud/occi/lib/ui/public/css/layout.css b/src/cloud/occi/lib/ui/public/css/layout.css index 2bfe875597..6f113e7c6b 100644 --- a/src/cloud/occi/lib/ui/public/css/layout.css +++ b/src/cloud/occi/lib/ui/public/css/layout.css @@ -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+ */ diff --git a/src/cloud/occi/lib/ui/public/css/login.css b/src/cloud/occi/lib/ui/public/css/login.css index b58bacd20f..3c76e3b65f 100644 --- a/src/cloud/occi/lib/ui/public/css/login.css +++ b/src/cloud/occi/lib/ui/public/css/login.css @@ -139,6 +139,7 @@ div#login input#login_btn:hover { position: relative; top: 80px; font-size:1.0em; + padding: 2px 15px; } #login_spinner { diff --git a/src/cloud/occi/lib/ui/public/js/login.js b/src/cloud/occi/lib/ui/public/js/login.js index 363fb781fd..f32ab43881 100644 --- a/src/cloud/occi/lib/ui/public/js/login.js +++ b/src/cloud/occi/lib/ui/public/js/login.js @@ -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(); }); diff --git a/src/cloud/occi/lib/ui/public/js/occi.js b/src/cloud/occi/lib/ui/public/js/occi.js index 29bd389ed6..3a9198e428 100644 --- a/src/cloud/occi/lib/ui/public/js/occi.js +++ b/src/cloud/occi/lib/ui/public/js/occi.js @@ -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); - }, - - }, + } + } } diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index 605bbec9e3..fe74c3bfcd 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -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: '', + 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 != "") ? { diff --git a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js index 9562202bf3..6b1444091d 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js @@ -56,7 +56,7 @@ var config_actions = { call : OCCI.Config.list, callback : updateConfig, error : onError - }, + } }; var config_tab = { diff --git a/src/cloud/occi/lib/ui/public/js/plugins/network.js b/src/cloud/occi/lib/ui/public/js/plugins/network.js index 93942ff016..609151d206 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/network.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/network.js @@ -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: '', + 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 != "") ? { diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index 2fb749a85f..37e09ce498 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -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: '', + 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 != "") ? { diff --git a/src/cloud/occi/lib/ui/templates/login.html b/src/cloud/occi/lib/ui/templates/login.html index 7fb6b3e456..8922a5ff58 100644 --- a/src/cloud/occi/lib/ui/templates/login.html +++ b/src/cloud/occi/lib/ui/templates/login.html @@ -6,7 +6,9 @@ - + + + diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 2005cd7c68..949c5967f0 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -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(); diff --git a/src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js b/src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js deleted file mode 100644 index 579cf6c456..0000000000 --- a/src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js +++ /dev/null @@ -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<>>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;c0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],b=0,d=0;b>>5]|=a[b]<<24- -d%32;return c},wordsToBytes:function(a){for(var c=[],b=0;b>>5]>>>24-b%32&255);return c},bytesToHex:function(a){for(var c=[],b=0;b>>4).toString(16));c.push((a[b]&15).toString(16))}return c.join("")},hexToBytes:function(a){for(var c=[],b=0;b>>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>> -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>5]|=128<<24-g%32;e[(g+64>>>9<<4)+15]=g;for(g=0;g>>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})(); diff --git a/src/sunstone/public/vendor/crypto-js/core-min.js b/src/sunstone/public/vendor/crypto-js/core-min.js new file mode 100644 index 0000000000..65e57cc4f9 --- /dev/null +++ b/src/sunstone/public/vendor/crypto-js/core-min.js @@ -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>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535>>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>>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>>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>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;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>>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>>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>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return i.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); diff --git a/src/sunstone/public/vendor/crypto-js/sha1-min.js b/src/sunstone/public/vendor/crypto-js/sha1-min.js new file mode 100644 index 0000000000..21ac56230e --- /dev/null +++ b/src/sunstone/public/vendor/crypto-js/sha1-min.js @@ -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)})();