From 0509b5ff1c9d66c88c5ef576e4c89e4701135dce Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 3 Feb 2015 02:25:52 -0800 Subject: [PATCH] sync fixes --- .../Owa/WopiServer.cs | 2 +- .../Content/Site.css | 11 ++++++++ .../Controllers/FileSystemController.cs | 2 +- .../Scripts/appScripts/wsp.js | 25 ++++++++++++++++++- .../Views/Shared/_Layout.cshtml | 5 ++-- .../WebsitePanel.WebDavPortal/Web.config | 13 +++++++++- 6 files changed, 52 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Owa/WopiServer.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Owa/WopiServer.cs index 357615f3..7da7cb5d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Owa/WopiServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Owa/WopiServer.cs @@ -28,7 +28,7 @@ namespace WebsitePanel.WebDav.Core.Owa var cFileInfo = new CheckFileInfo { BaseFileName = resource.DisplayName, - OwnerId = @"4257508bfe174aa28b461536d8b6b648",// WspContext.User.Login, + OwnerId = WspContext.User.Login, Size = resource.ContentLength, Version = DateTime.Now.ToString("s"), SupportsCoauth = false, diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index a7f32b61..c45a408b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -146,4 +146,15 @@ div#breadcrumb_wrapper a:last-child { } .form-control { border-radius: 4px; +} + +.header-logo { + float: none; + display: inline-block; + margin-right: 10px; +} + +.header-portal-title { + float: none; + display: inline-block; } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs index 28b6e19f..55e887b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs @@ -97,7 +97,7 @@ namespace WebsitePanel.WebDavPortal.Controllers string wopiSrc = Server.UrlDecode(url); - string owaOpenerUri = permissions.HasFlag(WebDavPermissions.Write) ? owaOpener.OwaEditor : owaOpener.OwaView; + string owaOpenerUri = permissions.HasFlag(WebDavPermissions.Write) ? owaOpener.OwaView : owaOpener.OwaView; var uri = string.Format("{0}/{1}WOPISrc={2}&access_token={3}", WebDavAppConfigManager.Instance.OfficeOnline.Url, owaOpenerUri, Server.UrlEncode(wopiSrc), Server.UrlEncode(accessToken.AccessToken.ToString("N"))); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js index e8ecfdf9..157b821b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js @@ -19,6 +19,25 @@ $(document).on('click', '.element-container', function (e) { } else { + if (isMobileDevice()) { + var now = new Date().getTime(); + var lastTouch = $(this).data('lastTouch') || now + 1; + var delta = now - lastTouch; + + if (delta < 500 && delta > 0) { + wsp.fileBrowser.openItem(this); + + $(this).data('lastTouch', 0); + + } else { + wsp.fileBrowser.clearAllSelectedItems(); + + wsp.fileBrowser.selectItem(this); + } + + $(this).data('lastTouch', now); + } + wsp.fileBrowser.clearAllSelectedItems(); wsp.fileBrowser.selectItem(this); @@ -51,4 +70,8 @@ $(document).click(function (event) { wsp.fileBrowser.clearAllSelectedItems(); wsp.fileBrowser.refreshDeletionBlock(); } -}) \ No newline at end of file +}) + +function isMobileDevice() { + return (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml index e93d4c78..277a17c3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml @@ -11,7 +11,7 @@ - + @ViewBag.Title @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") @@ -25,7 +25,8 @@ - @Html.RouteLink(WebDavAppConfigManager.Instance.ApplicationName, FileSystemRouteNames.ShowContentPath, new { pathPart = string.Empty }, new { @class = "navbar-brand" }) + + @Html.RouteLink(WebDavAppConfigManager.Instance.ApplicationName, FileSystemRouteNames.ShowContentPath, new { pathPart = string.Empty }, new { @class = "navbar-brand header-portal-title" })