public static System.Web.WebPages.HelperResult LikeBox(
            string href,
            int width = 292,
            int height = 587,
            string colorScheme = "light",
            int connections = 10,
            bool showStream = true,
            bool showHeader = true) {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 581 "..\..\Facebook.cshtml"
                                        
    
    var src = new UrlBuilder("http://www.facebook.com/plugins/recommendations.php")
                    .AddParam("href", href)
                    .AddParam("width", width)
                    .AddParam("height", height)
                    .AddParam("header", showHeader)
                    .AddParam("colorscheme", colorScheme)
                    .AddParam("connections", connections)
                    .AddParam("stream", showStream)
                    .AddParam("header", showHeader)
                    .AddParam("locale", Language);
                                 

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 594 "..\..\Facebook.cshtml"
WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 594 "..\..\Facebook.cshtml"
                                                                   WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 594 "..\..\Facebook.cshtml"
                                                                                      WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>                \r\n");



#line 595 "..\..\Facebook.cshtml"

#line default
#line hidden

});

}
public static System.Web.WebPages.HelperResult LikeButton(
            string href = "",
            string buttonLayout = "standard",
            bool showFaces = true,
            int width = 450,
            int height = 80,
            string action = "like",
            string font = "",
            string colorScheme = "light",
            string refLabel = ""
            ) {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 445 "..\..\Facebook.cshtml"
                   
                
    if (href.IsEmpty()) {
        href = Request.Url.OriginalString;
    }

    var src = new UrlBuilder("http://www.facebook.com/plugins/like.php")
                    .AddParam("href", href)
                    .AddParam("layout", buttonLayout)
                    .AddParam("show_faces", showFaces)
                    .AddParam("width", width)
                    .AddParam("action", action)
                    .AddParam("colorscheme", colorScheme)
                    .AddParam("height", height)
                    .AddParam("font", font)
                    .AddParam("locale", Language)
                    .AddParam("ref", refLabel);
        

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 463 "..\..\Facebook.cshtml"
WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 463 "..\..\Facebook.cshtml"
                                                                   WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 463 "..\..\Facebook.cshtml"
                                                                                      WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 464 "..\..\Facebook.cshtml"

#line default
#line hidden

});

}
public static System.Web.WebPages.HelperResult Recommendations(
            string site = "",
            int width = 300,
            int height = 300,
            bool showHeader = true,
            string colorScheme = "light",
            string font = "",
            string borderColor = "",
            string filter = "",
            string refLabel = ""
    ) {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 531 "..\..\Facebook.cshtml"
       	
        if (site.IsEmpty()) {
            site = Request.Url.Host;
        }

    var src = new UrlBuilder("http://www.facebook.com/plugins/recommendations.php")
                    .AddParam("site", site)
                    .AddParam("width", width)
                    .AddParam("height", height)
                    .AddParam("header", showHeader)
                    .AddParam("colorscheme", colorScheme)
                    .AddParam("font", font)
                    .AddParam("border_color", borderColor)
                    .AddParam("filter", filter)
                    .AddParam("ref", refLabel)
                    .AddParam("locale", Language);
    

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 548 "..\..\Facebook.cshtml"
WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 548 "..\..\Facebook.cshtml"
                                                                   WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 548 "..\..\Facebook.cshtml"
                                                                                      WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 549 "..\..\Facebook.cshtml"

#line default
#line hidden

});

}
public static System.Web.WebPages.HelperResult LiveStream(
            int width = 400,
            int height = 500,
            string xid = "",
            string viaUrl = "",
            bool alwaysPostToFriends = false) {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 637 "..\..\Facebook.cshtml"
                                               
       
                
    var builder = new UrlBuilder("http://www.facebook.com/plugins/live_stream_box.php")
        .AddParam("app_id", AppId)
        .AddParam("width", width)
        .AddParam("height", height)
        .AddParam("always_post_to_friends", alwaysPostToFriends)
        .AddParam("locale", Language);

    if (!xid.IsEmpty()) {
        builder.AddParam("xid", xid);
        builder.AddParam("via_url", viaUrl);
    }
    

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 652 "..\..\Facebook.cshtml"
WriteTo(@__razor_helper_writer, builder);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 652 "..\..\Facebook.cshtml"
                                                                       WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 652 "..\..\Facebook.cshtml"
                                                                                          WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 653 "..\..\Facebook.cshtml"

#line default
#line hidden

});

}
public static System.Web.WebPages.HelperResult LoginButton(
        string registerUrl,
        string returnUrl = "~/",
        string callbackUrl = DefaultCallbackUrl,
        string buttonText = "",
        bool autoLogoutLink = false,
        string size = "medium",
        string length = "long",
        bool showFaces = false,
        string extendedPermissions = "") {
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 366 "..\..\Facebook.cshtml"
                                          

    var redirectUrl = new UrlBuilder(callbackUrl)
                            .AddParam("registerUrl", new UrlBuilder(registerUrl))
                            .AddParam("returnUrl", new UrlBuilder(returnUrl));
    var onLogin = String.Format(CultureInfo.InvariantCulture, "loginRedirect('{0}')", RawJS(redirectUrl));
    extendedPermissions = extendedPermissions.IsEmpty() ? "email" : String.Concat("email,", extendedPermissions);


#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "    <fb:login-button autologoutlink=\"");



#line 374 "..\..\Facebook.cshtml"
      WriteTo(@__razor_helper_writer, autoLogoutLink);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" size=\"");



#line 374 "..\..\Facebook.cshtml"
                             WriteTo(@__razor_helper_writer, size);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" length=\"");



#line 374 "..\..\Facebook.cshtml"
                                            WriteTo(@__razor_helper_writer, length);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" onlogin=\"");



#line 374 "..\..\Facebook.cshtml"
                                                              WriteTo(@__razor_helper_writer, onLogin);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" show-faces=\"");



#line 374 "..\..\Facebook.cshtml"
                                                                                    WriteTo(@__razor_helper_writer, showFaces);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\" perms=\"");



#line 374 "..\..\Facebook.cshtml"
                                                                                                       WriteTo(@__razor_helper_writer, extendedPermissions);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "\">");



#line 374 "..\..\Facebook.cshtml"
                                                                                                                             WriteTo(@__razor_helper_writer, buttonText);

#line default
#line hidden

WriteLiteralTo(@__razor_helper_writer, "</fb:login-button>        \r\n");



#line 375 "..\..\Facebook.cshtml"

#line default
#line hidden

});

}
Пример #6
0
        public static System.Web.WebPages.HelperResult Recommendations(
            string site        = "",
            int width          = 300,
            int height         = 300,
            bool showHeader    = true,
            string colorScheme = "light",
            string font        = "",
            string borderColor = "",
            string filter      = "",
            string refLabel    = ""
            )
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 531 "Facebook.cshtml"

                if (site.IsEmpty())
                {
                    site = Request.Url.Host;
                }

                var src = new UrlBuilder("http://www.facebook.com/plugins/recommendations.php")
                          .AddParam("site", site)
                          .AddParam("width", width)
                          .AddParam("height", height)
                          .AddParam("header", showHeader)
                          .AddParam("colorscheme", colorScheme)
                          .AddParam("font", font)
                          .AddParam("border_color", borderColor)
                          .AddParam("filter", filter)
                          .AddParam("ref", refLabel)
                          .AddParam("locale", Language);


#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 548 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 548 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 548 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 549 "Facebook.cshtml"

#line default
#line hidden
            }));
        }
Пример #7
0
        public static System.Web.WebPages.HelperResult LikeBox(
            string href,
            int width          = 292,
            int height         = 587,
            string colorScheme = "light",
            int connections    = 10,
            bool showStream    = true,
            bool showHeader    = true)
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 581 "Facebook.cshtml"


                var src = new UrlBuilder("http://www.facebook.com/plugins/likebox.php")
                          .AddParam("href", href)
                          .AddParam("width", width)
                          .AddParam("height", height)
                          .AddParam("header", showHeader)
                          .AddParam("colorscheme", colorScheme)
                          .AddParam("connections", connections)
                          .AddParam("stream", showStream)
                          .AddParam("header", showHeader)
                          .AddParam("locale", Language);


#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 594 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 594 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 594 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>                \r\n");



#line 595 "Facebook.cshtml"

#line default
#line hidden
            }));
        }
Пример #8
0
        public static System.Web.WebPages.HelperResult LikeButton(
            string href         = "",
            string buttonLayout = "standard",
            bool showFaces      = true,
            int width           = 450,
            int height          = 80,
            string action       = "like",
            string font         = "",
            string colorScheme  = "light",
            string refLabel     = ""
            )
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 445 "Facebook.cshtml"


                if (href.IsEmpty())
                {
                    href = Request.Url.OriginalString;
                }

                var src = new UrlBuilder("http://www.facebook.com/plugins/like.php")
                          .AddParam("href", href)
                          .AddParam("layout", buttonLayout)
                          .AddParam("show_faces", showFaces)
                          .AddParam("width", width)
                          .AddParam("action", action)
                          .AddParam("colorscheme", colorScheme)
                          .AddParam("height", height)
                          .AddParam("font", font)
                          .AddParam("locale", Language)
                          .AddParam("ref", refLabel);


#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 463 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, src);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 463 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 463 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 464 "Facebook.cshtml"

#line default
#line hidden
            }));
        }
Пример #9
0
        public static System.Web.WebPages.HelperResult LoginButton(
            string registerUrl,
            string returnUrl           = "~/",
            string callbackUrl         = DefaultCallbackUrl,
            string buttonText          = "",
            bool autoLogoutLink        = false,
            string size                = "medium",
            string length              = "long",
            bool showFaces             = false,
            string extendedPermissions = "")
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 366 "Facebook.cshtml"


                var redirectUrl = new UrlBuilder(callbackUrl)
                                  .AddParam("registerUrl", new UrlBuilder(registerUrl))
                                  .AddParam("returnUrl", new UrlBuilder(returnUrl));
                var onLogin = String.Format(CultureInfo.InvariantCulture, "loginRedirect('{0}')", RawJS(redirectUrl));
                extendedPermissions = extendedPermissions.IsEmpty() ? "email" : String.Concat("email,", extendedPermissions);


#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "    <fb:login-button autologoutlink=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, autoLogoutLink);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" size=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, size);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" length=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, length);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" onlogin=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, onLogin);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" show-faces=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, showFaces);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" perms=\"");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, extendedPermissions);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\">");



#line 374 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, buttonText);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "</fb:login-button>        \r\n");



#line 375 "Facebook.cshtml"

#line default
#line hidden
            }));
        }
Пример #10
0
        public static System.Web.WebPages.HelperResult LiveStream(
            int width                = 400,
            int height               = 500,
            string xid               = "",
            string viaUrl            = "",
            bool alwaysPostToFriends = false)
        {
            return(new System.Web.WebPages.HelperResult(__razor_helper_writer => {
#line 637 "Facebook.cshtml"



                var builder = new UrlBuilder("http://www.facebook.com/plugins/live_stream_box.php")
                              .AddParam("app_id", AppId)
                              .AddParam("width", width)
                              .AddParam("height", height)
                              .AddParam("always_post_to_friends", alwaysPostToFriends)
                              .AddParam("locale", Language);

                if (!xid.IsEmpty())
                {
                    builder.AddParam("xid", xid);
                    builder.AddParam("via_url", viaUrl);
                }


#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "    <iframe src=\"");



#line 652 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, builder);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:");



#line 652 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, width);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px; height:");



#line 652 "Facebook.cshtml"
                WriteTo(@__razor_helper_writer, height);

#line default
#line hidden

                WriteLiteralTo(@__razor_helper_writer, "px;\" allowTransparency=\"true\"></iframe>\r\n");



#line 653 "Facebook.cshtml"

#line default
#line hidden
            }));
        }
    private static string GetUrlHelper(HttpContextBase context, string path, string publicKey, string errorCode) {

        publicKey = publicKey ?? PublicKey;
        if (String.IsNullOrEmpty(publicKey)) {
            throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "publicKey");
        }

        var builder = new UrlBuilder(context.Request.IsSecureConnection ? _reCaptchaSecureUrl : _reCaptchaUrl);
        builder.AddPath(path);
        builder.AddParam("k", publicKey);
        if (!String.IsNullOrEmpty(errorCode)) {
            builder.AddParam("error", errorCode);
        }
        return builder;
    }
    internal static string GetValidatePostData(HttpContextBase context, string privateKey, VirtualPathUtilityBase virtualPathUtility) {
        string remoteIP = context.Request.ServerVariables["REMOTE_ADDR"];
        if (String.IsNullOrEmpty(remoteIP)) {
            throw new InvalidOperationException(HelpersToolkitResources.ReCaptcha_RemoteIPNotFound);
        }

        // Noscript rendering requires the user to copy and paste the challenge string to a textarea.
        // When the challenge is invalid the recaptcha service doesn't return an error that affects
        // UI rendering, so Validate should just return false without issuing the web request.
        string challenge = context.Request.Form["recaptcha_challenge_field"];
        if (String.IsNullOrEmpty(challenge)) {
            return String.Empty;
        }
        string response = (context.Request.Form["recaptcha_response_field"] ?? String.Empty).Trim();

        var builder = new UrlBuilder(context, virtualPathUtility, path: null, parameters: null)
                .AddParam("privatekey", privateKey)
                .AddParam("remoteip", context.Request.ServerVariables["REMOTE_ADDR"])
                .AddParam("challenge", challenge)
                .AddParam("response", response);
        
        // Trim the leading ? and return the QueryString
        return builder.QueryString.Substring(1);
    }