public string Render(Uri url, IFileViewerOptions options) { var pollIdString = url.Segments[url.Segments.Length - 1]; Guid pollId; if (!Guid.TryParse(pollIdString, out pollId)) { throw new FileViewerNotSupportedException(); } var poll = InternalApi.PollingService.GetPoll(pollId); if (poll != null) { return(string.Format("<div style=\"width:{1}\"><div class=\"ui-poll\" data-pollid=\"{0}\" data-showname=\"true\" data-readonly=\"{2}\"></div></div>", poll.Id.ToString(), options.Width.HasValue && options.Width.Value > 0 ? options.Width.Value.ToString() + "px" : "inherit", options.ViewType == FileViewerViewType.Preview ? "true" : "false" )); } else { return(string.Empty); } }
public string Render(Uri url, IFileViewerOptions options) { if (options.ViewType == FileViewerViewType.Preview) { return(string.Format(@"<div>GitHub Gist Embed for <a href=""{0}""</a>Gist</a></div>", url)); } return(string.Format(@"<script src=""{0}.js""></script>", url)); }
public string Render(Uri url, IFileViewerOptions options) { if (options.ViewType != FileViewerViewType.Preview) return CreateRenderedViewerMarkup(url, options.Width.HasValue ? options.Width.Value : 0, options.Height.HasValue ? options.Height.Value : 0); HttpContext current = HttpContext.Current; if (current != null) { return PublicApi.UI.GetResizedImageHtml(current.Response.ApplyAppPathModifier(this.GetPreviewImageUrl(url)), options.Height.HasValue ? options.Height.Value : 0, options.Width.HasValue ? options.Width.Value : 0); } return string.Empty; }
public string Render(Uri url, IFileViewerOptions options) { if (options.ViewType != FileViewerViewType.Preview) { return(CreateRenderedViewerMarkup(url, options.Width.HasValue ? options.Width.Value : 0, options.Height.HasValue ? options.Height.Value : 0)); } HttpContext current = HttpContext.Current; if (current != null) { return(PublicApi.UI.GetResizedImageHtml(current.Response.ApplyAppPathModifier(this.GetPreviewImageUrl(url)), options.Height.HasValue ? options.Height.Value : 0, options.Width.HasValue ? options.Width.Value : 0)); } return(string.Empty); }
public string Render(Uri url, IFileViewerOptions options) { var pollIdString = url.Segments[url.Segments.Length - 1]; Guid pollId; if (!Guid.TryParse(pollIdString, out pollId)) throw new FileViewerNotSupportedException(); var poll = InternalApi.PollingService.GetPoll(pollId); if (poll != null) return string.Format("<div style=\"width:{1}\"><div class=\"ui-poll\" data-pollid=\"{0}\" data-showname=\"true\" data-readonly=\"{2}\"></div></div>", poll.Id.ToString(), options.Width.HasValue && options.Width.Value > 0 ? options.Width.Value.ToString() + "px" : "inherit", options.ViewType == FileViewerViewType.Preview ? "true" : "false" ); else return string.Empty; }
public FileViewerMediaType GetMediaType(ICentralizedFile file, IFileViewerOptions options) { return(FileViewerMediaType.Empty); }
public string Render(ICentralizedFile file, IFileViewerOptions options) { return(string.Empty); }
public FileViewerMediaType GetMediaType(ICentralizedFile file, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { return(FileViewerMediaType.Video); }
public FileViewerMediaType GetMediaType(ICentralizedFile file, IFileViewerOptions options) { return FileViewerMediaType.Empty; }
public string Render(Evolution.Extensibility.Storage.Version1.ICentralizedFile file, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public FileViewerMediaType GetMediaType(Evolution.Extensibility.Storage.Version1.ICentralizedFile file, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { return FileViewerMediaType.Video; }
public string Render(ICentralizedFile file, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public string Render(ICentralizedFile file, IFileViewerOptions options) { return string.Empty; }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public string Render(Uri url, IFileViewerOptions options) { throw new FileViewerNotSupportedException(); }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { return options.ViewType == FileViewerViewType.Preview ? FileViewerMediaType.Image : FileViewerMediaType.Video; }
public string Render(ICentralizedFile file, IFileViewerOptions options) { var appData = Telligent.Evolution.Mobile.ServiceLocator.Get <Telligent.Evolution.Mobile.App.Services.IAppDataService>().Get(file); if (appData == null || appData.Image == null) { throw new FileViewerNotSupportedException(); } if (options.ViewType == FileViewerViewType.Preview) { return(Telligent.Evolution.Extensibility.Api.Version1.PublicApi.UI.GetResizedImageHtml(CentralizedFileStorage.GetGenericDownloadUrl(appData.Image), options.Width.HasValue ? options.Width.Value : 0, options.Height.HasValue ? options.Height.Value : 0, new UiGetResizedImageHtmlOptions { ResizeMethod = "ZoomAndCrop", OutputIsPersisted = options.OutputIsPersisted })); } else { StringBuilder html = new StringBuilder(); string installUrl = null; var installer = PluginManager.Get <AppInstaller>().FirstOrDefault(); if (installer != null) { installUrl = installer.FormatInstallationUrl(appData); } if (!string.IsNullOrEmpty(installUrl)) { html.Append("<a href=\""); html.Append(PublicApi.Html.Encode(installUrl)); html.Append("\" style=\"display:inline-block; background-color: #f3f3f3; color: #555; text-align: center; text-decoration: none; padding: 2px; border-radius: 10px;\" class=\"app-viewer with-install\">"); } else { html.Append("<span class=\"app-view without-install\">"); } html.Append(Telligent.Evolution.Extensibility.Api.Version1.PublicApi.UI.GetResizedImageHtml(CentralizedFileStorage.GetGenericDownloadUrl(appData.Image), options.Width.HasValue ? options.Width.Value : 0, options.Height.HasValue ? options.Height.Value : 0, new UiGetResizedImageHtmlOptions { ResizeMethod = "ScaleDown", OutputIsPersisted = options.OutputIsPersisted, HtmlAttributes = new Dictionary <string, string> { { "style", "border-radius: 10px; display: inline-block;" } } })); if (!string.IsNullOrEmpty(installUrl)) { html.Append("<div style=\"padding: 8px;\">"); if (appData.IsDirectlyInstallable) { html.Append(_translation.GetLanguageResourceValue("ota_install")); } else { html.Append(_translation.GetLanguageResourceValue("itunes_install")); } html.Append("</div></a>"); } else { html.Append("</span>"); } return(html.ToString()); } }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { return(options.ViewType == FileViewerViewType.Preview ? FileViewerMediaType.Image : FileViewerMediaType.Video); }
public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options) { return(FileViewerMediaType.Document); }