Skip to content

Commit

Permalink
Final on-demand node loading fixes...
Browse files Browse the repository at this point in the history
Includes code cleanup and refactoring.
  • Loading branch information
diegocr committed Jun 17, 2017
1 parent 08458d7 commit a11a2e5
Show file tree
Hide file tree
Showing 82 changed files with 11,467 additions and 11,631 deletions.
4 changes: 2 additions & 2 deletions css/icons.css
Expand Up @@ -991,8 +991,8 @@
background-image: url(../images/mega/account-sprite_v3.png);
}
.small-icon.clock {
background-image: url(../images/mega/icons-sprite_v2.png);
background-image: url(../images/mega/icons-sprite_v3.png);
background-position: -79px -743px;
width: 20px;
height:22px;
}
}
3 changes: 2 additions & 1 deletion css/toast.css
Expand Up @@ -156,6 +156,7 @@
}
.mobile.toast-notification.active {
opacity: 100;
visibility: visible;
}
.mobile.toast-notification.top {
bottom: initial;
Expand All @@ -164,4 +165,4 @@
.mobile.toast-notification .toast-icon {
display: none;
}
/* end of Mobile*/
/* end of Mobile*/
6 changes: 3 additions & 3 deletions decrypter.js
Expand Up @@ -35,9 +35,9 @@ onmessage = function(e)
}
else
{
var data = new Uint8Array( e.data.buffer || e.data ),
heapView = new DataView( heap.buffer ),
macs = [];
var data = new Uint8Array( e.data.buffer || e.data );
var heapView = new DataView( heap.buffer );
var macs = [];

for ( var i = 0; i < data.length; i += 0x100000 )
{
Expand Down
6 changes: 3 additions & 3 deletions encrypter.js
Expand Up @@ -35,9 +35,9 @@ onmessage = function(e)
}
else
{
var data = new Uint8Array( e.data.buffer || e.data ),
heapView = new DataView( heap.buffer );
macs = [];
var data = new Uint8Array(e.data.buffer || e.data);
var heapView = new DataView(heap.buffer);
var macs = [];

for ( var i = 0; i < data.length; i += 0x100000 )
{
Expand Down
2 changes: 1 addition & 1 deletion html/js/backup.js
Expand Up @@ -17,7 +17,7 @@ function init_backup() {
}
});

if (is_extension || mega.utils.execCommandUsable()) {
if (is_extension || M.execCommandUsable()) {
$('.backup-input-button').rebind('mouseover', function() {
$('#backup_keyinput').select();
});
Expand Down
6 changes: 3 additions & 3 deletions html/js/chrome.js
Expand Up @@ -82,7 +82,7 @@ var chromepage = {
getServerBuildVersion: function() {

// Fetch the latest current_ver.txt
mega.utils.xhr(mega.updateURL + '?time=' + unixtime())
M.xhr(mega.updateURL + '?time=' + unixtime())
.done(function(ev, data) {
var serverBuildVersion = null;

Expand Down Expand Up @@ -111,8 +111,8 @@ var chromepage = {

// If current build information is available (not in development) and currently using the Chrome extension
if (buildVersion.chrome && is_extension && window.chrome) {
var local = mega.utils.vtol(buildVersion.chrome);
var remote = mega.utils.vtol(serverBuildVersion.chrome);
var local = M.vtol(buildVersion.chrome);
var remote = M.vtol(serverBuildVersion.chrome);

// If the currently loaded version is older than the server build
if (local < remote) {
Expand Down
6 changes: 3 additions & 3 deletions html/js/download.js
Expand Up @@ -183,7 +183,7 @@ function dl_g(res) {
return false;
}

var filename = fm_safename(fdl_file.n) || 'unknown.bin';
var filename = M.getSafeName(fdl_file.n) || 'unknown.bin';
var filenameLength = filename.length;

fdl_queue_var = {
Expand All @@ -197,7 +197,7 @@ function dl_g(res) {
onDownloadProgress: dlprogress,
onDownloadComplete: dlcomplete,
onDownloadStart: dlstart,
onDownloadError: M.dlerror,
onDownloadError: M.dlerror.bind(M),
onBeforeDownloadComplete: function() { }
};

Expand Down Expand Up @@ -617,7 +617,7 @@ function dlcomplete(id)
}
else if (a < 2) $('.widget-icon.downloading').addClass('hidden');
else $('.widget-circle').attr('class','widget-circle percents-0');
Soon(mega.utils.resetUploadDownload);
Soon(M.resetUploadDownload);
$('.download.content-block').removeClass('downloading').addClass('download-complete');
fdl_queue_var = false;

Expand Down
2 changes: 1 addition & 1 deletion html/js/firefox.js
Expand Up @@ -40,7 +40,7 @@ var firefoxpage = {
mega.updateURL + '?time=' + unixtime();

// Fetch the latest current_ver.txt
mega.utils.xhr(updateURL)
M.xhr(updateURL)
.done(function(ev, data) {
var serverBuildVersion = null;

Expand Down
2 changes: 1 addition & 1 deletion html/js/megasync.js
Expand Up @@ -235,7 +235,7 @@ var megasync = (function() {
return MegaPromise.reject(ex);
}

var promise = mega.utils.xhr({
var promise = M.xhr({
url: megasyncUrl,
data: args,
type: 'json'
Expand Down
8 changes: 5 additions & 3 deletions html/js/register.js
Expand Up @@ -191,8 +191,10 @@ function registeraccount() {

M.getCopyNodes([M.RootID], null, names)
.done(function(nodes) {
$.ephNodes = nodes;
$.ephNodes[0].t = 1; // change RootID's t2 to t1
if (Array.isArray(nodes) && nodes.length) {
$.ephNodes = nodes;
$.ephNodes[0].t = 1; // change RootID's t2 to t1
}

signup();
});
Expand Down Expand Up @@ -366,7 +368,7 @@ function init_register() {
if (typeof zxcvbn === 'undefined') {
$('.login-register-input.password').addClass('loading');

mega.utils.require('zxcvbn_js')
M.require('zxcvbn_js')
.done(function() {
$('.login-register-input.password').removeClass('loading');
registerpwcheck();
Expand Down
2 changes: 1 addition & 1 deletion html/js/reset.js
Expand Up @@ -83,7 +83,7 @@ function init_reset() {
if (typeof zxcvbn === 'undefined') {
$('.login-register-input.password').addClass('loading');

mega.utils.require('zxcvbn_js')
M.require('zxcvbn_js')
.done(function() {
$('.login-register-input.password').removeClass('loading');
reset_pwcheck();
Expand Down
Binary file modified images/mega/icons-sprite_v3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/mega/icons-sprite_v3@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a11a2e5

Please sign in to comment.