示例#1
0
        public static IHTMLDOMNode create_display_div(HTMLDocument document,Store store,config config)
        {
            IHTMLElement div = document.createElement("div");

            /* This will be removed */
            YesLink yes = new YesLink(document, config.accept_url, store.id, document.url);

            ((IHTMLDOMNode) div).appendChild((IHTMLDOMNode) yes.Element);

            /* End removed */

            return (IHTMLDOMNode) div;
        }
示例#2
0
文件: NoticeDiv.cs 项目: grefly/Buy4
        public NoticeDiv(HTMLDocument Document,Buy4Configuration Config, Store Store)
        {
            _div = Document.createElement("div");
            _div.innerHTML = Config.GetContent(Store, Document.url);
            _div.style.cssText = Config.GetStyle();

            _div.setAttribute("id", "buy4_notice", 0);
            ((IHTMLStyle2) _div.style).overflowX = "hidden";
            ((IHTMLStyle2) _div.style).overflowY = "hidden";
            ((IHTMLStyle2) _div.style).position = "relative";
            _div.style.display = "none";
            _div.style.filter = "alpha(opacity=95)";
            _div.style.zIndex = 1000;
        }
示例#3
0
        public JavascriptNode(HTMLDocument Document,config Config,Store Store)
        {
            StringBuilder builder = new StringBuilder();
            IHTMLElement notice_div = (IHTMLElement) new NoticeDiv(Document, Config, Store).NoticeDivDomNode;

            _script = (IHTMLScriptElement) Document.createElement("script");
            _script.type = "text/javascript";

            _script.text += (new GetCookieScript(Document).ToString());
            _script.text += (new SetCookieCacheScript(Document).ToString());

            // This script inserts the Buy4 notice into the DOM
            /*
            builder.Append("var notice = document.createElement(\"span\");");
            builder.Append("notice.id = \"container_div\";");

            builder.Append("notice.style.position =\"absolute\";");
            builder.Append("notice.style.top = \"10px\";");
            builder.Append("notice.style.align = \"center\";");
            builder.Append("notice.style.left = \"10px\";");
            builder.Append("notice.style.width = \"97%\";");
            builder.Append("notice.style.height = \"auto\";");
            builder.Append("notice.style.zIndex = \"1000\";");
            builder.Append(String.Format("notice.innerHTML= '{0}';", notice_div.outerHTML.Replace(Environment.NewLine, "")));
            */

            /*
            builder.Append("alert(get_cookie(\"buy4_cache\"));");
            */
            /*
            builder.Append("if( get_cookie(\"buy4_cache\") != \"true\" )");
            builder.Append("{ document.body.appendChild(notice); }");
            */

            _script.text = builder.ToString();
        }
示例#4
0
 public string GetContent(Store Store,string ReturnURL)
 {
     return ContentParser.For(_content).WithStore(Store).WithReturnUrl(ReturnURL).Parse();
 }
示例#5
0
文件: Buy4AddOn.cs 项目: grefly/Buy4
        private void insert_notice_div_into_htmldocument(HTMLDocument document, Buy4Configuration config, Store store)
        {
            if (HTMLDocument.body == null) return;

            NoticeDiv notice_div = new NoticeDiv(HTMLDocument, config, store);

            ((IHTMLDOMNode)HTMLDocument.body).insertBefore(notice_div.NoticeDivDomNode,
                                      ((IHTMLDOMNode)HTMLDocument.body).firstChild);
        }
示例#6
0
文件: Buy4AddOn.cs 项目: grefly/Buy4
 private void insert_javascripts_into_htmldocument(HTMLDocument document,Buy4Configuration Config,Store Store)
 {
     document.appendChild(new Buy4CustomJavaScript(document).Script);
     document.appendChild(new AcceptLinkClickScript(document).Script);
     document.appendChild(new DeclineLinkClickScript(document).Script);
     document.appendChild(new EndSlideScript(document).Script);
     document.appendChild(new GetCookieScript(document).Script);
     document.appendChild(new SetCookieCacheScript(document).Script);
     document.appendChild(new SlideDownScript(document).Script);
     document.appendChild(new SlideTickScript(document).Script);
     document.appendChild(new SlideUpScript(document).Script);
     document.appendChild(new StartSlideScript(document).Script);
 }
示例#7
0
文件: NoticeText.cs 项目: grefly/Buy4
 public NoticeText(HTMLDocument Document, config Config, Store Store)
 {
     _notice_text = " " + Config.display_html
         .Replace("###name###", Store.name)
         .Replace("###typical_donation###", Store.typical_donation);
 }
示例#8
0
 public static IHTMLDOMNode Create(HTMLDocument document,Store store,Buy4Configuration config)
 {
     return new NoticeDiv(document,config,store).NoticeDivDomNode;
 }