/// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public OtherApplication(IOtherPage page)
        {
            new IHTMLButton { innerText = "open Default page" }.AttachToDocument().onclick +=
               delegate
               {
                   Native.window.open("/", "_self");

               };

            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"other",
                value => value.ToDocumentTitle()
            );
        }
Exemple #2
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public OtherApplication(IOtherPage page)
        {
            new IHTMLButton {
                innerText = "open Default page"
            }.AttachToDocument().onclick +=
                delegate
            {
                Native.window.open("/", "_self");
            };

            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"other",
                value => value.ToDocumentTitle()
                );
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public OtherApplication(IOtherPage page)
        {
            var AudioLinks = this.AudioLinks.ToArray();

            Native.Document.body.Clear();

            new IHTMLButton {
                innerText = "open Default page"
            }.AttachToDocument().With(
                btn =>
            {
                new HTML.Images.FromAssets.jsc().AttachTo(btn);

                btn.onclick +=
                    delegate
                {
                    new IHTMLIFrame
                    {
                        src = "/"
                    }.AttachToDocument();

                    //Native.Window.open("/", "_self");
                };
            }
                );

            AudioLinks.WithEach(
                a =>
            {
                IHTMLAudio audio = null;

                new IHTMLButton {
                    innerText = a.innerText
                }.AttachToDocument().With(
                    btn =>
                {
                    btn.style.display = IStyle.DisplayEnum.block;

                    btn.onclick +=
                        delegate
                    {
                        if (audio == null)
                        {
                            audio = new IHTMLAudio {
                                src = a.href
                            }.AttachToDocument();
                            audio.play();
                        }
                        else
                        {
                            if (audio.paused)
                            {
                                audio.play();
                            }
                            else
                            {
                                audio.pause();
                            }
                        }
                    };
                }
                    );
            }
                );


            // XMLHttpRequest cannot load http://192.168.1.100:16304/xml?WebMethod=06000001. Origin http://www.webgljobs.com is not allowed by Access-Control-Allow-Origin.
            // Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"other",
            //    value => value.ToDocumentTitle()
            //);
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public OtherApplication(IOtherPage page)
        {
            var AudioLinks = this.AudioLinks.ToArray();

            Native.Document.body.Clear();

            new IHTMLButton { innerText = "open Default page" }.AttachToDocument().With(
                btn =>
                {
                    new HTML.Images.FromAssets.jsc().AttachTo(btn);

                    btn.onclick +=
                       delegate
                       {
                           new IHTMLIFrame
                           {
                               src = "/"
                           }.AttachToDocument();

                           //Native.Window.open("/", "_self");

                       };
                }
            );

            AudioLinks.WithEach(
                a =>
                {
                    IHTMLAudio audio = null;

                    new IHTMLButton { innerText = a.innerText }.AttachToDocument().With(
                        btn =>
                        {
                            btn.style.display = IStyle.DisplayEnum.block;

                            btn.onclick +=
                                delegate
                                {
                                    if (audio == null)
                                    {
                                        audio = new IHTMLAudio { src = a.href }.AttachToDocument();
                                        audio.play();
                                    }
                                    else
                                    {
                                        if (audio.paused)
                                            audio.play();
                                        else
                                            audio.pause();
                                    }
                                };
                        }
                    );

                }
            );


            // XMLHttpRequest cannot load http://192.168.1.100:16304/xml?WebMethod=06000001. Origin http://www.webgljobs.com is not allowed by Access-Control-Allow-Origin.
            // Send data from JavaScript to the server tier
            //service.WebMethod2(
            //    @"other",
            //    value => value.ToDocumentTitle()
            //);
        }