diff --git a/umbraco.sln b/umbraco.sln index 5c20b71c0f..b37c0e023d 100644 --- a/umbraco.sln +++ b/umbraco.sln @@ -41,7 +41,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{05329D config templates\config\metablogConfig.config = config templates\config\metablogConfig.config config templates\config\restExtensions.config = config templates\config\restExtensions.config config templates\config\scripting.config = config templates\config\scripting.config - config templates\config\tinyMceConfig.config = config templates\config\tinyMceConfig.config config templates\config\umbracoSettings.config = config templates\config\umbracoSettings.config config templates\config\UrlRewriting.config = config templates\config\UrlRewriting.config config templates\config\xsltExtensions.config = config templates\config\xsltExtensions.config diff --git a/umbraco/presentation/umbraco/umbraco.aspx b/umbraco/presentation/umbraco/umbraco.aspx index 81963322ee..7a42b56d7d 100644 --- a/umbraco/presentation/umbraco/umbraco.aspx +++ b/umbraco/presentation/umbraco/umbraco.aspx @@ -113,18 +113,18 @@ var rightAction = '<%=umbraco.presentation.UmbracoContext.Current.Request.QueryString["rightAction"]%>'; var rightActionId = '{<%=umbraco.presentation.UmbracoContext.Current.Request.QueryString["id"]%>}'; - jQuery(document).ready(function() { + jQuery(document).ready(function () { UmbClientMgr.setUmbracoPath("<%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>"); - + //call wresize first for IE/FF resize issues - jQuery(window).wresize(function() { resizePage(); }); + jQuery(window).wresize(function () { resizePage(); }); resizePage(); jQuery("#umbracoMainPageBody").css("background", "#fff"); //wire up the history mgr - UmbClientMgr.historyManager().addEventHandler("navigating", function(e, app) { + UmbClientMgr.historyManager().addEventHandler("navigating", function (e, app) { //show modal wait dialog. TODO: Finish this //jQuery("
 
").appendTo("body") // .ModalWindowShow("", false, 300, 100, 300, 0) @@ -143,8 +143,42 @@ "content", true); } + + jQuery("#right").show(); }); + + + // Handles single vs double click on application item icon buttons... + + function appItemSingleClick(itemName) { + UmbClientMgr.historyManager().addHistory(itemName); + return false; + } + function appItemDoubleClick(itemName) { + //When double clicking, we'll clear the tree cache so that it loads the dashboard + UmbClientMgr.mainTree().clearTreeCache(); + UmbClientMgr.historyManager().addHistory(itemName); + return false; + } + function appClick(appItem) { + var that = this; + setTimeout(function () { + var dblclick = parseInt($(that).data('double'), 10); + if (dblclick > 0) { + $(that).data('double', dblclick - 1); + } else { + appItemSingleClick.call(that, appItem); + } + }, 300); + return false; + } + function appDblClick(appItem) { + $(this).data('double', 2); + appItemDoubleClick.call(this, appItem); + return false; + } + diff --git a/umbraco/presentation/umbraco/umbraco.aspx.cs b/umbraco/presentation/umbraco/umbraco.aspx.cs index 46a7a3753e..7ddf5b3dba 100644 --- a/umbraco/presentation/umbraco/umbraco.aspx.cs +++ b/umbraco/presentation/umbraco/umbraco.aspx.cs @@ -15,6 +15,7 @@ using umbraco.BusinessLogic.Actions; using ClientDependency.Core; using umbraco.IO; using System.Linq; +using System.Text; namespace umbraco.cms.presentation { @@ -25,28 +26,42 @@ namespace umbraco.cms.presentation { protected umbWindow UmbWindow1; protected System.Web.UI.WebControls.PlaceHolder bubbleText; - - protected void Page_Load(object sender, System.EventArgs e) - { + protected void Page_Load(object sender, System.EventArgs e) + { var apps = this.getUser().Applications.ToList(); bool userHasAccesstodefaultApp = apps.Where(x => x.alias == "content").Count() > 0; - + // Load user module icons .. - if (apps.Count() > 1) { + if (apps.Count() > 1) + { + + var JSEvents = new StringBuilder(); + PlaceHolderAppIcons.Text = ui.Text("main", "sections", base.getUser()); plcIcons.Text = ""; - foreach (BusinessLogic.Application a in apps) { - string iconElement = String.Format("
  • ", a.icon.Substring(1, a.icon.Length - 1)); + foreach (BusinessLogic.Application a in apps) + { + + string aiconSubstring = a.icon.Substring(1, a.icon.Length - 1); + + JSEvents.Append(@"jQuery('." + aiconSubstring + "').click(function() { appClick.call(this, '" + a.alias + "'); } );"); + JSEvents.Append(@"jQuery('." + aiconSubstring + "').dblclick(function() { appDblClick.call(this, '" + a.alias + "'); } );"); + + string iconElement = String.Format("
  • ", aiconSubstring); if (a.icon.StartsWith(".")) - iconElement += + iconElement += "\"\"
  • "; else iconElement += "\"""; plcIcons.Text += iconElement; } - } else + + Page.ClientScript.RegisterStartupScript(this.GetType(), "AppIcons", "jQuery(document).ready(function() { " + JSEvents.ToString() + " } );", true); + + } + else PlaceHolderAppIcons.Visible = false; @@ -58,26 +73,27 @@ namespace umbraco.cms.presentation } - // Load globalized labels - treeWindow.Text = ui.Text("main", "tree", base.getUser()); + // Load globalized labels + treeWindow.Text = ui.Text("main", "tree", base.getUser()); RenderActionJS(); - - // Load default right action -// string rightAction = String.Format(@" -// var initApp = '{0}'; -// var rightAction = '{1}'; -// var rightActionId = '{2}';", umbraco.presentation.UmbracoContext.Current.Request["app"], helper.Request("rightAction"), helper.Request("id")); -// ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "rightAction", rightAction, true); - // Version check goes here! + // Load default right action + // string rightAction = String.Format(@" + // var initApp = '{0}'; + // var rightAction = '{1}'; + // var rightActionId = '{2}';", umbraco.presentation.UmbracoContext.Current.Request["app"], helper.Request("rightAction"), helper.Request("id")); + // ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "rightAction", rightAction, true); + + // Version check goes here! string updateCheckCookie = ""; if (Request.Cookies["updateCheck"] != null) { updateCheckCookie = Request.Cookies["updateCheck"].Value.ToString(); } - if (GlobalSettings.VersionCheckPeriod > 0 && String.IsNullOrEmpty(updateCheckCookie) && base.getUser().UserType.Alias == "admin") { + if (GlobalSettings.VersionCheckPeriod > 0 && String.IsNullOrEmpty(updateCheckCookie) && base.getUser().UserType.Alias == "admin") + { // Add scriptmanager version check ScriptManager sm = ScriptManager.GetCurrent(Page); @@ -86,11 +102,11 @@ namespace umbraco.cms.presentation Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "upgradeChecker", "jQuery(document).ready(function() {umbraco.presentation.webservices.CheckForUpgrade.CallUpgradeService(umbracoCheckUpgrade);});", true); - Response.Cookies["updateCheck"].Value = "1"; + Response.Cookies["updateCheck"].Value = "1"; Response.Cookies["updateCheck"].Expires = DateTime.Now.AddDays(GlobalSettings.VersionCheckPeriod); - } - DataBind(); - } + } + DataBind(); + } /// /// Renders out all JavaScript references that have bee declared in IActions