WORK IN PROGRESS, GET THE STABLE SOURCE FROM THE THE DOWNLOADS TABS

Mega Commit: New controls: tree control, pickers of all sorts, image viewer, media uploader. Removed a zillion iframes. New modal window standard framework. Fixes some bugs. ClientDependency & Examine DLL updates. Lots of JS enhancements, libs and more methods added to ClientTools.

[TFS Changeset #63838]
This commit is contained in:
Shandem
2010-02-08 02:22:42 +00:00
parent 3372da8225
commit 8ac0e2fa54
220 changed files with 4460 additions and 5436 deletions

View File

@@ -0,0 +1,8 @@
(function($) {
$.fn.VerticalAlign = function(opts) {
return this.each(function() {
var top = (($(this).parent().height() - $(this).height()) / 2);
$(this).css('margin-top', top);
});
};
})(jQuery);

View File

@@ -231,7 +231,7 @@
// UMBRACO SPECIFIC, open window on space
if (currentValue == ' ') {
$input.blur();
openModal("dialogs/search.aspx", 'Search', 470, 620);
UmbClientMgr.openModalWindow("dialogs/search.aspx", 'Search', true, 620, 470);
} else {
if (!skipPrevCheck && currentValue == previousValue)
return;

View File

@@ -0,0 +1,3 @@
//used for live editing to invoke no conflict after jquery has loaded with lazy loading
//alert("jquery.noConflict: " + jQuery.noConflict);
jQuery.noConflict();

View File

@@ -55,7 +55,7 @@ Umbraco.Application.Actions = function() {
launchAbout: function() {
/// <summary>Launches the about Umbraco window</summary>
UmbClientMgr.mainWindow().openModal("dialogs/about.aspx", UmbClientMgr.uiKeys()['general_about'], 390, 450);
UmbClientMgr.openModalWindow("dialogs/about.aspx", UmbClientMgr.uiKeys()['general_about'], true, 450, 390);
return false;
},
@@ -67,7 +67,7 @@ Umbraco.Application.Actions = function() {
this._currApp = 'content';
}
UmbClientMgr.mainWindow().openModal("dialogs/create.aspx?nodeType=" + this._currApp + "&app=" + this._currApp + "&rnd=" + this._utils.generateRandom(), UmbClientMgr.uiKeys()['actions_create'] + " " + this._currApp, 470, 620);
UmbClientMgr.openModalWindow("dialogs/create.aspx?nodeType=" + this._currApp + "&app=" + this._currApp + "&rnd=" + this._utils.generateRandom(), UmbClientMgr.uiKeys()['actions_create'] + " " + this._currApp, true, 620, 470);
return false;
} else
@@ -155,7 +155,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '0' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/sort.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sort'], 450, 600);
UmbClientMgr.openModalWindow("dialogs/sort.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sort'], true, 600, 450);
}
},
@@ -164,7 +164,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/cruds.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_rights'], 300, 800);
UmbClientMgr.openModalWindow("dialogs/cruds.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_rights'], true, 800, 300);
}
},
@@ -172,14 +172,14 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/protectPage.aspx?mode=cut&nodeId=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_protect'], 480, 535);
UmbClientMgr.openModalWindow("dialogs/protectPage.aspx?mode=cut&nodeId=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_protect'], true, 535, 480);
}
},
actionRollback: function() {
/// <summary></summary>
UmbClientMgr.mainWindow().openModal('dialogs/rollback.aspx?nodeId=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_rollback'], 550, 600);
UmbClientMgr.openModalWindow('dialogs/rollback.aspx?nodeId=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_rollback'], true, 600, 550);
},
actionRefresh: function() {
@@ -193,7 +193,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/notifications.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_notify'], 480, 300);
UmbClientMgr.openModalWindow("dialogs/notifications.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_notify'], true, 300, 480);
}
},
@@ -205,7 +205,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '' != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/publish.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId, uiKeys['actions_publish'], 280, 540);
UmbClientMgr.openModalWindow("dialogs/publish.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId, uiKeys['actions_publish'], true, 540, 280);
}
},
@@ -214,7 +214,7 @@ Umbraco.Application.Actions = function() {
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
if (confirm(uiKeys['defaultdialogs_confirmSure'] + '\n\n')) {
UmbClientMgr.mainWindow().openModal('dialogs/SendPublish.aspx?id=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sendtopublish'], 200, 300);
UmbClientMgr.openModalWindow('dialogs/SendPublish.aspx?id=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sendtopublish'], true, 300, 200);
}
}
},
@@ -229,14 +229,14 @@ Umbraco.Application.Actions = function() {
actionRePublish: function() {
/// <summary></summary>
UmbClientMgr.mainWindow().openModal('dialogs/republish.aspx?rnd=' + this._utils.generateRandom(), 'Republishing entire site', 210, 450);
UmbClientMgr.openModalWindow('dialogs/republish.aspx?rnd=' + this._utils.generateRandom(), 'Republishing entire site', true, 450, 210);
},
actionAssignDomain: function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/assignDomain.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId, uiKeys['actions_assignDomain'], 420, 500);
UmbClientMgr.openModalWindow("dialogs/assignDomain.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId, uiKeys['actions_assignDomain'], true, 500, 420);
}
},
@@ -251,16 +251,16 @@ Umbraco.Application.Actions = function() {
var actionNode = UmbClientMgr.mainTree().getActionNode();
if (actionNode.nodeType != '') {
if (actionNode.nodeType == "content") {
UmbClientMgr.mainWindow().openModal("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], 425, 600);
UmbClientMgr.openModalWindow("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], true, 600, 425);
}
else if (actionNode.nodeType == "initmember") {
UmbClientMgr.mainWindow().openModal("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], 380, 420);
UmbClientMgr.openModalWindow("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], true, 420, 380);
}
else if (actionNode.nodeType == "initpython" || actionNode.nodeType == "initdlrscripting") {
UmbClientMgr.mainWindow().openModal("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], 380, 420);
}
else {
UmbClientMgr.mainWindow().openModal("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], 270, 420);
UmbClientMgr.openModalWindow("create.aspx?nodeId=" + actionNode.nodeId + "&nodeType=" + actionNode.nodeType + "&nodeName=" + actionNode.nodeName + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_create'], true, 420, 270);
}
}
},
@@ -277,7 +277,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/sendToTranslation.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sendToTranslate'], 470, 500);
UmbClientMgr.openModalWindow("dialogs/sendToTranslation.aspx?id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_sendToTranslate'], true, 500, 470);
}
},
@@ -285,7 +285,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/emptyTrashcan.aspx", uiKeys['actions_emptyTrashcan'], 220, 500);
UmbClientMgr.openModalWindow("dialogs/emptyTrashcan.aspx", uiKeys['actions_emptyTrashcan'], true, 500, 220);
}
},
@@ -293,7 +293,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/importDocumentType.aspx?rnd=" + this._utils.generateRandom(), uiKeys['actions_importDocumentType'], 460, 400);
UmbClientMgr.openModalWindow("dialogs/importDocumentType.aspx?rnd=" + this._utils.generateRandom(), uiKeys['actions_importDocumentType'], true, 460, 400);
}
},
@@ -308,7 +308,7 @@ Umbraco.Application.Actions = function() {
actionAudit: function() {
/// <summary></summary>
UmbClientMgr.mainWindow().openModal('dialogs/viewAuditTrail.aspx?nodeId=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_auditTrail'], 500, 550);
UmbClientMgr.openModalWindow('dialogs/viewAuditTrail.aspx?nodeId=' + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_auditTrail'], true, 550, 500);
},
actionPackage: function() {
@@ -351,7 +351,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/moveOrCopy.aspx?app=" + this._currApp + "&mode=cut&id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_move'], 460, 500);
UmbClientMgr.openModalWindow("dialogs/moveOrCopy.aspx?app=" + this._currApp + "&mode=cut&id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_move'], true, 500, 460);
}
},
@@ -359,7 +359,7 @@ Umbraco.Application.Actions = function() {
/// <summary></summary>
if (UmbClientMgr.mainTree().getActionNode().nodeId != '-1' && UmbClientMgr.mainTree().getActionNode().nodeType != '') {
UmbClientMgr.mainWindow().openModal("dialogs/moveOrCopy.aspx?app=" + this._currApp + "&mode=copy&id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_copy'], 470, 500);
UmbClientMgr.openModalWindow("dialogs/moveOrCopy.aspx?app=" + this._currApp + "&mode=copy&id=" + UmbClientMgr.mainTree().getActionNode().nodeId + '&rnd=' + this._utils.generateRandom(), uiKeys['actions_copy'], true, 500, 470);
}
},
_debug: function(strMsg) {
@@ -369,7 +369,7 @@ Umbraco.Application.Actions = function() {
},
actionExportCode: function() {
/// <summary></summary>
UmbClientMgr.mainWindow().openModal("dialogs/exportCode.aspx", UmbClientMgr.uiKeys()['exportDocumentTypeAsCode'], 350, 400);
UmbClientMgr.openModalWindow("dialogs/exportCode.aspx", UmbClientMgr.uiKeys()['exportDocumentTypeAsCode'], true, 400, 350);
return false;
}
}

View File

@@ -14,10 +14,11 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
return {
_isDirty: false,
_isDebug: true,
_isDebug: false,
_mainTree: null,
_appActions: null,
_rootPath: "/umbraco", //this is the default
_modal: null,
setUmbracoPath: function(strPath) {
/// <summary>
@@ -49,7 +50,6 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
this._mainTree = $("<div id='falseTree' />").appendTo("body").hide().UmbracoTree({
uiKeys: this.uiKeys(),
jsonFullMenu: {},
jsonInitNode: {},
appActions: this.appActions()
}).UmbracoTreeAPI();
}
@@ -111,6 +111,34 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
this.mainWindow().right.location.href = strLocation;
}
},
openModalWindow: function(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback) {
if (this._modal == null) {
this._modal = new Umbraco.Controls.ModalWindow();
}
this._modal.open(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback);
},
closeModalWindow: function(rVal) {
/// <summary>
/// will close the latest open modal window, otherwise
/// if the modal object is null and the mainWindow is not null, this generally means this is
/// being called inside a modal window, so we'll check to see if we can get the parent modal
/// object and close it instead.
/// if an rVal is passed in, then this will be sent to the onCloseCallback method if it was specified.
/// </summary>
if (this._modal != null) {
this._modal.close(rVal);
}
else {
//this will recursively try to close a modal window until window.parent or
//window.parent.UmbClientMgr doesn't exist.
if (window.parent == null || window.parent == window) {
return; //don't recurse, exit
}
else if (typeof window.parent.UmbClientMgr != "undefined") {
window.parent.UmbClientMgr.closeModalWindow(rVal);
}
}
},
_debug: function(strMsg) {
if (this._isDebug) {
Sys.Debug.trace("UmbClientMgr: " + strMsg);
@@ -127,4 +155,4 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
})(jQuery);
//define alias for use throughout application
var UmbClientMgr = new Umbraco.Application.ClientManager();
var UmbClientMgr = new Umbraco.Application.ClientManager();

View File

@@ -0,0 +1,73 @@
Umbraco.Sys.registerNamespace("Umbraco.Utils");
Umbraco.Utils.UrlEncoder = {
// public method for url encoding
encode: function(string) {
return escape(this._utf8_encode(string));
},
// public method for url decoding
decode: function(string) {
return this._utf8_decode(unescape(string));
},
// private method for UTF-8 encoding
_utf8_encode: function(string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if ((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
},
// private method for UTF-8 decoding
_utf8_decode: function(utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while (i < utftext.length) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if ((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i + 1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i + 1);
c3 = utftext.charCodeAt(i + 2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
}
}