Wupload Countdown Hack - Copy Paste Script + Call Cmapplication - Pages.Download - Countdown.Hack and Download Files Without Waiting
Wupload Countdown Hack - Copy Paste Script + Call Cmapplication - Pages.Download - Countdown.Hack and Download Files Without Waiting
Wupload Countdown Hack - Copy Paste Script + Call Cmapplication - Pages.Download - Countdown.Hack and Download Files Without Waiting
wupload.hack
myHostname = window.location.hostname;
var myTLD = "." + myHostname.substring(myHostname.indexOf("wupload") +
"wupload.".length).split(".")[0];
function afterLoad() {
return
}
ieFixForFileSelectionOnChangeEventTimer = null;
function ieFixForFileSelectionOnChangeEvent(a) {
$("#siteName").toggle();
if ($("#inputFileSelection").val() == "") {
ieFixForFileSelectionOnChangeEventTimer =
setTimeout("ieFixForFileSelectionOnChangeEvent()", 200)
} else {
$("body")[0].focus()
}
}
function urlencode(a) {
return escape(a.toString().replace(/%/g, "%25").replace(/\+/g,
"%2B")).replace(/%25/g, "%")
}
$(document).ajaxStart(function() {
$("body").addClass("ajaxLoading")
});
$(document).ajaxStop(function() {
$("body").removeClass("ajaxLoading")
});
$(document).ajaxError(function(d, c, a, b) {
CMApplication.Widgets.Dialog.close();
CMApplication.Widgets.Dialog.displayMessage(c.responseText,
CMApplication.Widgets.Dialog.Types.exception)
});
jQuery.setCookie = function(b, c, a) {
var d = new Date();
d.setDate(d.getDate() + a);
cookieDomain = ".wupload" + myTLD;
document.cookie = b + "=" + escape(c) + ((a == null) ? "" : ";expires=" +
d.toUTCString() + "; path=/;domain=" + cookieDomain + ";")
};
jQuery.getCookie = function(a) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(a + "=");
if (c_start != -1) {
c_start = c_start + a.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) {
c_end = document.cookie.length
}
return unescape(document.cookie.substring(c_start, c_end))
}
}
return ""
};
jQuery.unparam = function(d) {
var f = {},
c = d.split("&"),
e, b, a;
for (b = 0, a = c.length; b < a; b++) {
e = c[b].split("=", 2);
f[decodeURIComponent(e[0])] = (e.length == 2 ?
decodeURIComponent(e[1].replace(/\+/g, " ")) : true)
}
return f
};
CMApplication = {
User: {
RolesNames: ["anonymous", "free", "premium"],
RolesValues: {
ANONYMOUS: 0,
FREE: 1,
PREMIUM: 2
}, sessId: "",
email: "",
isAffiliate: false,
role: "anonymous"
}, Bootstrap: {
run: function() {
for (var a in this) {
if (a.indexOf("_init") === -1) {
continue
}
this[a]()
}
CMApplication.Widgets.Ajax._init()
}
}, Dictionnary: {
SEARCH_ALL_FOLDERS: "Search all folders:",
SEARCH_THIS_FOLDERS: "Search this folders:",
PLEASE_WAIT: "Please Wait...",
SHARE: "Share",
SHARE_FILES: "Share Files",
EDIT: "Edit",
TRASH: "Trash",
DOWNLOAD_READY: "Download Ready",
START_DOWNLOAD_NOW: "Start download now!",
LEAVING_WILL_CANCEL_UPLOADS: "If you continue, your upload(s) will be
cancelled.",
YOUR_UPLOADS: "Your uploads",
COMPLETED: "Completed",
CLOSE: "Close",
VIEW_LINKS: "View Links",
UNEXPECTED_PROCESS_ERROR: "Unexpected error during process",
LOGIN_UNEXPECTED_PROCESS_ERROR: "Unexpected error during login",
SYSTEM_ERROR: "System Error",
ERROR: "Error",
NOTICE: "Notice",
FILESYSTEM_MOVE_INSTRUCTION: "Select the file/folder you want to move on the
right side of the file browser.",
FILESYSTEM_COPY_INSTRUCTION: "Select the file/folder you want to copy on the
right side of the file browser.",
FILESYSTEM_TRASH_INSTRUCTION: "Select the file/folder you want to delete on the
right side of the file browser.",
FILESYSTEM_GENERATELINKS_INSTRUCTION: "Select the file(s) you want to generate
link on the right side of the file browser.",
FILESYSTEM_PREMIUM_INSTRUCTION: "Select the file(s) you want to set only for
premium on the right side of the file browser.",
FOLDER_ID_REQUIRED: "Folder ID should be specified",
FILESYSTEM_MOVE_SOURCE_IDENTICAL_TO_DESTINATION: "Impossible to move: The
source folder is identical then the destination",
FILESYSTEM_MOVE_DESTINATION_SUBFOLDER_OF_SOURCE: "Impossible to move: The
destination folder is a subfolder of the source.",
FILESYSTEM_MOVE_UNABLE_TO_MOVE: "Unable to move selected file/folder",
FILESYSTEM_COPY_UNABLE_TO_COPY: "Unable to copy selected file/folder",
FILESYSTEM_TRASH_UNABLE_TO_TRASH: "Unable to trash selected file/folder",
FILESYSTEM_PREMIUM_UNABLE_TO_PREMIUM: "Unable to set only for premium selected
file(s)",
COPY_FOLDER_NOT_YET_IMPLEMENTED: "Copy of folder not yet implemented",
PAGE_SHOULD_BE_OPENED_IN_NEW_WINDOW: "For technical reasons, this page should
be opened in a new window/tab when uploading a file.",
USER_HAS_TO_WAIT: "User has to wait",
VIEW_ALL_LINKS: "View all links",
SELECT_A_DESTINATION: "Select a destination",
MOVE: "Move",
CANCEL: "Cancel",
CANCEL_UPLOAD: "Cancel Upload",
ARE_YOU_SURE_YOU_WANT_TO_DELETE_THESE_FILES: "Are you sure you want to delete
these files / folder ?",
ARE_YOU_SURE_YOU_WANT_TO_SET_THESE_FILES_ONLY_PREMIUM: "Are you sure you want
to set these files only for premium?",
ARE_YOU_SURE_YOU_WANT_TO_UNSET_THESE_FILES_ONLY_PREMIUM: "Are you sure you want
to unset these files only for premium?",
DESCRIPTION: "Description:",
IS_PUBLIC: "Is Public:",
LINK: "Link",
LINKS: "Links:",
DATE_CREATED: "Created On:",
DATE_UPDATED: "Updated On:",
MUST_BE_PUBLIC: "Must be public",
COPY: "Copy",
REMOTE_UPLOAD: "Remote Upload",
WEB_UPLOAD: "Web Upload",
UNKNOWN: "Unknown",
SIZE: "Size",
SOURCE: "Source",
PASSWORD: "Password",
PREMIUM_ONLY: "Premium Only",
TOTAL_SIZE: "Total Size:",
FOLLOWING_ERROR_DURING_UPLOAD: "The following errors happen during the
upload:",
RENAME: "Rename",
UPLOADING: "Uploading",
FILES: "Files",
RESTORE: "Restore",
SELECT: "Select",
MINIMIZE: "Minimize",
FILES_UPLOADED_TO: "Files uploaded to:",
CHOOSE_FILES_TO_UPLOAD: "Choose files to upload",
UPLOAD_NOW: "Upload Now",
YOU_SUCCESSFULLY_UPLOADED: "You successfully uploaded",
YOU_UPLOADED: "You uploaded",
ERROR_DURING_THE_UPLOAD: "Error during the upload",
SHARE_ALL_LINKS: "Share ALL Links",
CHOOSE_FILES_AND_THEN_PRESS_UPLOAD_NOW: "Choose files to upload, then click
"Start Upload"",
TOTAL_FILES: "Total Files:",
FILE_NAME: "File name",
PROGRESS: "Progress",
DOWNLOAD_LINK: "Download Link",
FAIL: "Fail",
VIEW_LINK: "View Link",
START_UPLOAD: "Start Upload",
SELECTABLE: "Selectable"
}, URLs: {
languageFilesystemExportFolderLinks: "/file-manager/export-all-
links/:folderId",
languageFilesystemCopy: "/file-manager/copy/:id",
languageFilesystemMove: "/file-manager/move/:id",
languageFilesystemEditMultiple: "/file-manager/edit-files/:id",
languageFilesystemShare: "/file-manager/share/email/:ids",
languageFilesystemEdit: "/file-manager/edit/:id",
languageFilesystemCreate: "/file-manager/create/:parentId",
languageFilesystemTrash: "/file-manager/delete/:id",
languageFilesystemGenerateLink: "/file-manager/share/urls/:id",
languageFilesystemBrowse: "/file-
manager/list/:folderId/:page/:orderBy/:orderDirection/:globalSearch/:queryString",
languageFilesystemRemoved: "/file-manager/removed",
languageDownload: "/file/:id",
uploadProgress: ":hostserver/nginxuploadprogress?
unique=:unique&ID=:progress_key&X-Progress-ID=:progress_key",
uploadCallback: "/upload/done/:uploadProgressId",
domain: "http://" + window.location.host
}, foward: function(a) {
location.href = a
}, Viewport: {
width: null,
height: null,
adjust: function() {
if (typeof window.innerWidth != "undefined") {
this.width = window.innerWidth,
this.height = window.innerHeight
} else {
if (typeof document.documentElement != "undefined" && typeof
document.documentElement.clientWidth != "undefined" &&
document.documentElement.clientWidth != 0) {
this.width = document.documentElement.clientWidth,
this.height = document.documentElement.clientHeight
} else {
this.width = document.getElementsByTagName("body")[0].clientWidth,
this.height = document.getElementsByTagName("body")[0].clientHeight
}
}
var a = false;
if (navigator.userAgent.indexOf("MSIE 6") != -1) {
a = true
}
}
}, Layout: {
_init: function() {
if (CMApplication.User.email != "") {
$("body").addClass("loggedIn")
} else {
$("body").removeClass("loggedIn")
}
$("#lMainUsage a[href=" + window.location +
"]").parent("li").addClass("active");
$("#lMainUsage li.active").parent("li").addClass("active");
$("#lMainUsage li.active").parent("ul").parent("li").addClass("active");
$("ul.main li li.account").live("mouseenter", function(a) {
$(this).addClass("hover");
$("ul.lMore", this).show()
});
$("ul.main li li.account").live("mouseleave", function(a) {
$(this).removeClass("hover");
$("ul.lMore", this).hide()
})
}
}, Widgets: {}, Pages: {}
};
sortFolders = function(d, c) {
var g = $('#sortForm input[name="folder_field"]').val();
if (g == "name") {
var f = encodeURI($(d).text()).replace("%0A%20%20%20%20%20%20%20%20",
"").replace("%0A%20%20%20%20", "");
var e = encodeURI($(c).text()).replace("%0A%20%20%20%20%20%20%20%20",
"").replace("%0A%20%20%20%20", "")
} else {
if (g == "date") {
var f = $(d).attr("data-date");
var e = $(c).attr("data-date")
}
}
if ($('#sortForm input[name="folder_direction"]').val() == "desc") {
return (f > e) ? -1 : (f < e) ? 1 : 0
} else {
return (f < e) ? -1 : (f > e) ? 1 : 0
}
};
$(document).ready(function() {
var counter = 0;
$("#internationalization a.active").click(function() {
return false
});
$("#internationalization").click(function() {
$("#internationalization li").toggleClass("open").delay(800);
$("div#internationalization ul").toggleClass("opened").delay(800);
counter++
});
$("html").click(function() {
if (counter % 2) {
$("#internationalization li").toggleClass("open").delay(800);
$("div#internationalization ul").toggleClass("opened").delay(800);
counter++
}
});
if (jQuery.getCookie("isJavascriptEnable") != 1) {
jQuery.setCookie("isJavascriptEnable", 1, 30)
}
$("#DialogWidget #signupCompleted form").live("successCallback", function(event,
data) {
$(this).removeAttr("rel")
});
$("#free_download, #free_download2, #cancelDownload").live("click",
function(event) {
$("#freeDownload").hide();
event.preventDefault();
$.post(this.href, $("#downloadMode form").serialize(), function(data) {
$("#premiumDownload").remove();
$("#downloadMode").replaceWith(data);
$("#downloadMode").slideDown("slow")
})
});
$("#downloadMode form").live("submit", function(event) {
event.preventDefault();
$.post(this.action, $("#downloadMode form").serialize(), function(data) {
$("#downloadMode").replaceWith(data);
$("#downloadMode").slideDown("slow")
})
});
$('#downloadMode form input[type="submit"], #downloadMode form
button').live("click", function(event) {
event.preventDefault();
$.post($("#downloadMode form").attr("action"), $("#downloadMode
form").serialize(), function(data) {
$("#downloadMode").replaceWith(data);
$("#downloadMode").slideDown("slow")
})
});
isSearchResult = false;
CMApplication.Widgets.Ajax = {
Events: {
click: function(e) {
if (e.isDefaultPrevented()) {
return
}
var internalLinkRegEx = /^(\#|\/|https?\:\/\/([^.]+\.)?wupload(\.[a-z]
{2,3})+\/?)/i;
destination = $(this).attr("href");
isInternal = internalLinkRegEx.test(destination);
var anchorRegEx = /(\#.*)$/i;
isAnchor = anchorRegEx.test(destination);
if (!isInternal) {
return
}
e.preventDefault();
localPath =
CMApplication.Widgets.Ajax.getHash(destination).replace(anchorRegEx, "");
if (localPath != "" && !(localPath == window.location.pathname &&
isAnchor)) {
var intelligenceRegEx = /\/intelligence(\/.*)?$/i;
isIntelligence = intelligenceRegEx.test(localPath);
if (!isIntelligence) {
$.history.load(localPath)
} else {
alert(CMApplication.Dictionnary.PAGE_SHOULD_BE_OPENED_IN_NEW_WINDOW);
window.open(localPath)
}
}
anchor = anchorRegEx.exec(destination);
if (anchor !== null && $(anchor[0]).length == 1) {
setTimeout("$('html,body').animate({scrollTop: " + $
(anchor[0]).offset().top + "}, 800);", 1)
}
}, submit: function(e) {
if (e.isDefaultPrevented()) {
return
}
var internalLinkRegEx = /^(\#|\/|https?\:\/\/([^.]+\.)?wupload(\.[a-z]
{2,3})+\/?)/i;
destination = $(this).attr("action");
isInternal = internalLinkRegEx.test(destination);
if (!isInternal) {
return
}
e.preventDefault();
localPath = CMApplication.Widgets.Ajax.getHash(destination);
jQuery.ajax({
url: localPath,
type: $(this).attr("method") || "get",
data: $(this).serialize(),
dataType: "html",
complete: function(XMLHttpRequest, textStatus) {
$("#mainContent").html(XMLHttpRequest.responseText)
}
})
}
}, start: function() {
alert("Starting Ajax Browsing");
$("form").live("submit", CMApplication.Widgets.Ajax.Events.submit);
$("a").live("click", CMApplication.Widgets.Ajax.Events.click);
$.history.init(function(hash) {
if (hash == "") {
url = CMApplication.Widgets.Ajax.getHash(location.href)
} else {
jQuery.ajax({
url: hash,
async: false,
global: false,
type: "get",
dataType: "html",
data: {
isGlobalAjax: "1"
}, complete: function(XMLHttpRequest, textStatus) {
$("#mainContent").html(XMLHttpRequest.responseText)
}
});
$("html,body").animate({
scrollTop: 0
}, 1)
}
}, {
unescape: ",/"
})
}, stop: function() {
alert("Stopping Ajax Browsing");
$("form").die("submit", CMApplication.Widgets.Ajax.Events.submit);
$("a").die("click", CMApplication.Widgets.Ajax.Events.click);
$.history.init(function() {}, {
unescape: ",/"
})
}, _init: function() {}, getHash: function(url) {
hostnameRegEx = /^(https?\:\/\/[^\/]+)/i;
return url.replace(hostnameRegEx, "")
}
};
CMApplication.Widgets.Purchase = {
Events: {
submit: function(e) {
e.preventDefault();
CMApplication.Widgets.Dialog.displayUrl($(this).attr("action"));
editForm = $("form", CMApplication.Widgets.Dialog.dialogContainer);
editForm.bind("successCallback", function(event, data) {
if (data.data.paymentSystem == 3) {
$(event.target).attr("rel", "keep");
$("#DialogWidgetContent").load(data.redirect)
} else {
location.href = data.redirect
}
});
editForm.bind("failCallback", function(event, data) {
$(event.target).attr("rel", "keep")
})
}
}, _init: function() {
$(".form_payment_system_3, .form_payment_system_8.premiumEmail,
.form_payment_system_9.premiumEmail").live("submit",
CMApplication.Widgets.Purchase.Events.submit)
}
};
CMApplication.Widgets.Tools = {
Events: {
click: function(e) {
e.preventDefault();
$(this).addClass("active");
$('#lUser li.lMore:not("#statsLinks") ul').show();
$(document).bind("click", closeUserMenuMore);
function closeUserMenuMore(e) {
clickedElement = $(e.target);
if (!clickedElement.is('#lUser li.lMore:not("#statsLinks") ul') &&
clickedElement.parents('#lUser li.lMore:not("#statsLinks") ul').length < 1) {
$('#lUser li.lMore:not("#statsLinks") a').removeClass("active");
$('#lUser li.lMore:not("#statsLinks") ul').hide();
$(document).unbind("click", closeUserMenuMore)
}
}
}
}, _init: function() {
$('#lUser li.lMore:not("#statsLinks") > a:not(.active)').live("click",
CMApplication.Widgets.Tools.Events.click)
}
};
CMApplication.Widgets.Stats = {
Events: {
click: function(e) {
e.preventDefault();
$(this).addClass("active");
$("#lUser li.lMore#statsLinks ul").show();
$(document).bind("click", closeUserMenuMore);
function closeUserMenuMore(e) {
clickedElement = $(e.target);
if (!clickedElement.is("#lUser li.lMore#statsLinks ul") &&
clickedElement.parents("#lUser li.lMore#statsLinks ul").length < 1) {
$("#lUser li.lMore#statsLinks a").removeClass("active");
$("#lUser li.lMore#statsLinks ul").hide();
$(document).unbind("click", closeUserMenuMore)
}
}
}
}, _init: function() {
$("#lUser li.lMore#statsLinks > a:not(.active)").live("click",
CMApplication.Widgets.Stats.Events.click)
}
};
CMApplication.Pages.Download = {
PasswordProtection: {
formElement: $("body#Download_Index #passwordProtection form"),
Events: {
submit: function(event) {
event.preventDefault();
jQuery.ajax({
url: $(this).attr("action"),
type: $(this).attr("method"),
dataType: "json",
data: $(this).serialize(),
success: function(data) {
if (data.status == "success") {
jQuery.ajax({
url: data.redirect,
type: "GET",
dataType: "html",
success: function(data) {
$("#premiumMessages").html(data)
}
})
} else {
container = $("#password").parent();
errorContainer = $("ul.errors", container);
if (errorContainer.length === 0) {
errorContainer = $('<ul class="errors" />').appendTo(container)
}
for (fieldName in data.messages) {
errors = "";
field = data.messages[fieldName];
for (error in field) {
errors += "<li>" + field[error] + "</li>"
}
errorContainer.html(errors)
}
}
}
})
}
}
}, CountDown: {
delay: 60,
decrease: function() {
if (this.delay > 0) {
this.delay--;
$("#countdown").text(this.getFormatedDelay());
window.onPageTimeout =
setTimeout("CMApplication.Pages.Download.CountDown.decrease();", 1050)
} else {
$.post("?start=1", $("#tm, #tm_hash").serialize(), function(data) {
$("#downloadMode").replaceWith(data)
})
}
},
hack: function() {
$.post("?start=1", $("#tm, #tm_hash").serialize(), function(data) {
$("#downloadMode").replaceWith(data)
})
}
, getFormatedDelay: function() {
returnValue = this.delay / 60;
returnValue = returnValue.toString().split(".");
minutes = returnValue[0];
seconds = this.delay - (minutes * 60);
if (seconds.toString().length == 1) {
seconds = "0" + seconds
}
if (minutes < 1) {
rv = seconds + "s"
} else {
rv = minutes + " min."
}
return rv
}
}, _init: function() {
CMApplication.Pages.Download.PasswordProtection.formElement.live("submit",
CMApplication.Pages.Download.PasswordProtection.Events.submit);
if (typeof(countDownDelay) !== "undefined") {
CMApplication.Pages.Download.CountDown.delay = countDownDelay;
CMApplication.Pages.Download.CountDown.decrease();
try {
pageTracker._trackEvent("download_delay", "wait_" + countDownDelay,
CMApplication.Dictionnary.USER_HAS_TO_WAIT + countDownDelay)
} catch(e) {}
}
}
};
CMApplication.Widgets.Dialog = {
dialogContainer: null,
Types: {
exception: 1,
error: 2,
notice: 3
}, Events: {
close: function(event) {
event.preventDefault();
CMApplication.Widgets.Dialog.close()
}, submit: function(event) {
event.preventDefault();
var formSubmitted = $(this);
jQuery.ajax({
url: formSubmitted.attr("action"),
data: formSubmitted.serializeArray(),
type: formSubmitted.attr("method"),
dataType: "json",
success: function(data, textStatus, XMLHttpResponse) {
if (data.status == "success") {
form = formSubmitted.trigger("successCallback", data)
} else {
form = formSubmitted.trigger("failCallback", data);
if ($(form).attr("rel") == "keep") {
for (var i in data.messages) {
for (var j in data.messages[i]) {
message = data.messages[i][j];
if ($("#" +
i).parent("div.elements").children(".errors").length == 0) {
$("#" + i).parent("div.elements").append("<ul
class='errors'><li>" + message + "</li></ul>")
} else {
$("#" +
i).parent("div.elements").children(".errors").html("<li>" + message + "</li>")
}
}
}
}
}
if ($(form).attr("rel") != "keep") {
CMApplication.Widgets.Dialog.close()
}
}
})
}
}, displayMessage: function(message, type, className, positionTarget) {
switch (type) {
case CMApplication.Widgets.Dialog.Types.exception:
title = CMApplication.Dictionnary.SYSTEM_ERROR;
lclassName = "systemError";
break;
case CMApplication.Widgets.Dialog.Types.error:
title = CMApplication.Dictionnary.ERROR;
lclassName = "error";
break;
case CMApplication.Widgets.Dialog.Types.notice:
title = CMApplication.Dictionnary.NOTICE;
lclassName = "notice";
break
}
html = '<div id="DialogWidgetMessage" class="' + lclassName + '"><h2><span>'
+ title + "</span></h2>" + message + "</div>";
CMApplication.Widgets.Dialog.open(html, 400, className, positionTarget)
}, displayUrl: function(url, width, className, positionTarget) {
var width;
ajaxUrl = url;
jQuery.ajax({
url: ajaxUrl,
type: "get",
dataType: "html",
async: false,
success: function(data, textStatus, XMLHttpResponse) {
CMApplication.Widgets.Dialog.displayContent(data, width, className,