Plugin Directory

Changeset 1242511


Ignore:
Timestamp:
09/10/2015 02:21:31 PM (11 years ago)
Author:
luisfpg
Message:

Now it is possible to use multiple widgets in the same page

Location:
cyclos/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cyclos/trunk/cyclos-public.php

    r1242487 r1242511  
    7676    // Returns the html to show when shortcode is used.
    7777    return '
    78         <div id="cyclosForgotContainer" class="cyclosFormBox" style="display:none">
    79             <form id="cyclosForgotPasswordForm" action="#" method="post">
     78        <div class="cyclosFormBox cyclosForgotContainer" style="display:none">
     79            <form class="cyclosForgotPasswordForm" action="#" method="post">
    8080                <div class="cyclosFormTitle">' . $t->forgotTitle . '</div>
    8181                <div class="cyclosFormField">
    82                     <input placeholder="' . $t->forgotEmail . '" id="cyclosEmail" tabindex="3" type="email" required>
     82                    <input placeholder="' . $t->forgotEmail . '" name="cyclosEmail" type="email" required>
    8383                </div>
    8484                <div class="cyclosFormField">
    8585                    <div>
    86                         <input placeholder="' . $t->forgotCaptcha . '" id="cyclosCaptcha" tabindex="4" type="text" style="float: left; width: 60%" required>
    87                         <a id="cyclosNewCaptcha" href="#">' . $t->forgotNewCaptcha . '</a>
     86                        <input placeholder="' . $t->forgotCaptcha . '" class="cyclosCaptcha" type="text" style="float: left; width: 60%" required>
     87                        <a class="cyclosNewCaptcha" href="#">' . $t->forgotNewCaptcha . '</a>
    8888                    </div>
    8989                    <div>
    90                         <img alt="captcha" id="cyclosCaptchaImage" style="display:none">
     90                        <img alt="captcha" class="cyclosCaptchaImage" style="display:none">
    9191                    </div>
    9292                </div>
    9393                <div class="cyclosFormActions">
    94                     <input id="cyclosForgotSubmit" type="submit" tabindex="5" value="' . $t->forgotSubmit . '">
     94                    <input class="cyclosForgotSubmit" type="submit" value="' . $t->forgotSubmit . '">
    9595                    <div class="cyclosForgotPasswordBox">
    96                         <a id="cyclosForgotCancel" href="#">' . $t->forgotCancel . '</a>
     96                        <a class="cyclosForgotCancel" href="#">' . $t->forgotCancel . '</a>
    9797                    </div>
    9898                </div>
    9999            </form>
    100100        </div>
    101         <div id="cyclosLoginContainer" class="cyclosFormBox">
    102             <form id="cyclosLoginForm" action="#" method="post">
     101        <div class="cyclosFormBox cyclosLoginContainer">
     102            <form class="cyclosLoginForm" action="#" method="post">
    103103                <div class="cyclosFormTitle">' . $t->loginTitle . '</div>
    104104                <div class="cyclosFormField">
    105                     <input placeholder="' . $t->loginName . '" id="cyclosPrincipal" tabindex="3" type="text" required>
     105                    <input placeholder="' . $t->loginName . '" name="cyclosPrincipal" type="text" required>
    106106                </div>
    107107                <div class="cyclosFormField">
    108                     <input placeholder="' . $t->loginPassword . '" id="cyclosPassword" tabindex="4" type="password" required>
     108                    <input placeholder="' . $t->loginPassword . '" name="cyclosPassword" type="password" required>
    109109                </div>
    110110                <div class="cyclosFormActions">
    111                     <input type="submit" id="cyclosLoginSubmit" tabindex="5" value="' . $t->loginSubmit . '">
     111                    <input type="submit" class="cyclosLoginSubmit" value="' . $t->loginSubmit . '">
    112112                    <div class="cyclosForgotPasswordBox">
    113                         <a id="cyclosForgotLink" href="#">' . $t->forgotLink . '</a>
     113                        <a class="cyclosForgotLink" href="#">' . $t->forgotLink . '</a>
    114114                    </div>
    115115                </div>
     
    128128                function showLogin() {
    129129                    if (submitEnabled) {
    130                         $("#cyclosLoginForm").trigger("reset");
    131                         $("#cyclosLoginContainer").show();
    132                         $("#cyclosForgotContainer").hide();
    133                         $("#cyclosPrincipal").focus();
     130                        $(".cyclosLoginForm").trigger("reset");
     131                        $(".cyclosLoginContainer").show();
     132                        $(".cyclosForgotContainer").hide();
     133                        $(".cyclosPrincipal").focus();
    134134                    }
    135135                }
     
    137137                function showForgotPassword() {
    138138                    if (submitEnabled) {
    139                         $("#cyclosForgotPasswordForm").trigger("reset");
    140                         $("#cyclosLoginContainer").hide();
    141                         $("#cyclosForgotContainer").show();
    142                         $("#cyclosEmail").focus();
     139                        $(".cyclosForgotPasswordForm").trigger("reset");
     140                        $(".cyclosLoginContainer").hide();
     141                        $(".cyclosForgotContainer").show();
     142                        $(".cyclosEmail").focus();
    143143                        if (captchaId == null) {
    144144                            newCaptcha();
     
    148148               
    149149                function newCaptcha() {
    150                     var img = $("#cyclosCaptchaImage");
     150                    var img = $(".cyclosCaptchaImage");
    151151                    img.css("opacity", 0.2);
    152152                    $.post("' . admin_url('admin-ajax.php?action=cyclos_captcha') . '")
     
    163163                }
    164164               
    165                 $("#cyclosLoginForm").submit(function(event) {
     165                $(".cyclosLoginForm").submit(function(event) {
    166166                    if (submitEnabled) {
    167                         var principal = ($("#cyclosPrincipal").val() || "").trim();
    168                         var password = ($("#cyclosPassword").val() || "").trim();
     167                        var principal = this.cyclosPrincipal.value.trim();
     168                        var password = this.cyclosPassword.value.trim();
    169169                       
    170170                        if (principal != "" && password != "") {
     
    197197                });
    198198               
    199                 $("#cyclosForgotPasswordForm").submit(function(event) {
     199                $(".cyclosForgotPasswordForm").submit(function(event) {
    200200                    if (submitEnabled) {
    201                         var email = ($("#cyclosEmail").val() || "").trim();
    202                         var captchaText = ($("#cyclosCaptcha").val() || "").trim();
     201                        var email = this.cyclosEmail.trim();
     202                        var captchaText = this.cyclosCaptcha.trim();
    203203                       
    204204                        if (email != "" && captchaText != "") {
     
    233233                });
    234234               
    235                 $("#cyclosForgotLink").click(showForgotPassword).click(stopEvent);
    236                 $("#cyclosForgotCancel").click(showLogin).click(stopEvent);
    237                 $("#cyclosNewCaptcha").click(function() {
     235                $(".cyclosForgotLink").click(showForgotPassword).click(stopEvent);
     236                $(".cyclosForgotCancel").click(showLogin).click(stopEvent);
     237                $(".cyclosNewCaptcha").click(function() {
    238238                    newCaptcha();
    239                     var cyclosCaptcha = $("#cyclosCaptcha");
     239                    var cyclosCaptcha = $(".cyclosCaptcha");
    240240                    cyclosCaptcha.val("");
    241241                    cyclosCaptcha.focus();
  • cyclos/trunk/stylesheet.css

    r1111214 r1242511  
    1 #cyclosLoginContainer .cyclosFormTitle {
     1.cyclosLoginContainer .cyclosFormTitle {
    22    background: url("login.png") no-repeat 0px 0px;
    33}
    44
    5 #cyclosForgotContainer .cyclosFormTitle {
     5.cyclosForgotContainer .cyclosFormTitle {
    66    background: url("password_recover.png") no-repeat 0px 0px;
    77}
     
    6565}
    6666
    67 #cyclosNewCaptcha {
     67.cyclosNewCaptcha {
    6868    display: block;
    6969    float: right;   
Note: See TracChangeset for help on using the changeset viewer.