Beispiel #1
0
 public XDoc IssueLink(
     [DekiExtParam("YouTrack ID to link to (default: all issues)")] string id,
     [DekiExtParam("link contents; can be text, an image, or another document (default: link uri)", true)] object text,
     [DekiExtParam("link hover title (default: link title)", true)] string title,
     [DekiExtParam("link target (default: nil)", true)] string target
     )
 {
     return(DekiScriptLibrary.WebLink(_server.At("issue", id).ToString(), text, title, target));
 }
Beispiel #2
0
 public XDoc QueryLink(
     [DekiExtParam("query expression to link to")] string query,
     [DekiExtParam("link contents; can be text, an image, or another document (default: link uri)", true)] object text,
     [DekiExtParam("link hover title (default: link title)", true)] string title,
     [DekiExtParam("link target (default: nil)", true)] string target
     )
 {
     return(DekiScriptLibrary.WebLink(_server.At("issues").With("q", query).ToString(), text, title, target));
 }
Beispiel #3
0
        public override XDoc AsEmbeddableXml(bool safe)
        {
            MimeType mime = (Value.Segments.Length > 0) ? MimeType.FromFileExtension(Value.LastSegment ?? string.Empty) : MimeType.BINARY;

            if (StringUtil.EqualsInvariant(mime.MainType, "image"))
            {
                // embed <img> tag
                return(DekiScriptLibrary.WebImage(AsString(), null, null, null));
            }
            else
            {
                // embed <a> tag
                return(DekiScriptLibrary.WebLink(AsString(), null, null, null));
            }
        }
Beispiel #4
0
        private void AddUri(XmlNode context, DekiScriptUri uri)
        {
            if (context == null)
            {
                ConvertStateToHtml(null);
            }

            // NOTE (steveb): URIs have special embedding rules; either embed it as a <img> and <a> document base on the URI file extension on the last segment

            XUri     url  = uri.Value.AsPublicUri();
            MimeType mime = (url.Segments.Length > 0) ? MimeType.FromFileExtension(url.LastSegment ?? string.Empty) : MimeType.BINARY;
            XDoc     item = mime.MainType.EqualsInvariant("image") ?
                            DekiScriptLibrary.WebImage(url.ToString(), null, null, null) :
                            DekiScriptLibrary.WebLink(url.ToString(), null, null, null);

            AddXDoc(context, item);
        }