Plugin Directory

Changeset 2237525


Ignore:
Timestamp:
02/03/2020 09:14:12 AM (6 years ago)
Author:
zoho
Message:

support of multiple domains on classic editor

Location:
zoho-forms/tags/2.0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • zoho-forms/tags/2.0/readme.txt

    r2209845 r2237525  
    2929
    3030Once you define the height and width of your form and click **Embed**, the form's preview will be shown in the editor.
     31
     32You can also create a short code as shown below to embed your form in your WordPress page:
     33[zohoForms src=<Form Permalink> width=100% height=600px]
     34
     35Note: You can copy the Form Permalink from the [Share tab](https://www.zoho.com/forms/help/share/public-sharing.html) in your form builder.
    3136
    3237These setup instructions are for WordPress versions 5.0 and above.
  • zoho-forms/tags/2.0/tinymce/zforms_dailog.css

    r2047986 r2237525  
    88.popupOuterWrapper{ font-size: 13px;padding: 25px;padding-top:25px;padding-bottom: 15px;}
    99.popupOuterWrapper .popupInnerWrapper{ padding-bottom:10px;}
    10 .popupOuterWrapper .popupInnerWrapper label{ display: block;margin-bottom: 5px;}
     10.popupOuterWrapper .popupInnerWrapper label{ display: block;margin-bottom: 8px;}
    1111.popupOuterWrapper .popupInnerWrapper label em{ color:#ff0000;font-weight:600;}
    1212.popupOuterWrapper .popupContainer input{ padding:5px 10px;}
     
    1919.flLeft{float:left;}
    2020.flRight{float:right;}
    21 .popupFotter{ text-align:center; margin-top:28px;}
     21.popupFotter{ text-align:center; margin-top:30px;}
    2222.signWrapper{ text-align:center; font-size:13px; margin:18% 13%;}
    2323.signWrapper input{    padding: 4px 8px; font-size: 13px;cursor: pointer;}
    2424.popupContainer select{padding: 5px;font-size: 12px;background: #fff;width: 100%;}
    25 .errorCont textarea, .errorCont select{ border:1px solid #ff0000;
    26 .errorCont p{font-size:12px; color:#ff0000; margin:0; padding-top:3px;}
     25.errorCont textarea, .errorCont select, .errorCont .zf-wb-dropWrapper{ border:1px solid #ff0000}   
     26.errorCont p{font-size:12px; color:#ff0000; margin:0; padding-top:3px; position: absolute;}
    2727.brandingFotterWrapper{ position:fixed; bottom:0; width:100%;}
    2828.brandingFotterWrapper .brandingFotterCont{ margin:10px; }
     
    3030.forceColors{ background:#fff !important;}
    3131.popupOuterWrapper .popupContainer textarea:focus, .popupOuterWrapper .popupContainer input:focus, .popupOuterWrapper .popupContainer select:focus{ border:1px solid #000;}
     32.zf-wb-dropWrapper{ border:1px solid #d6d6d6; position: relative; height:32px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px; overflow: hidden;}
     33        .zf-wb-dropWrapper::before{ content: "";right: 12px;top: 11px; position: absolute;width: 0; height: 0; border-left: 6px solid transparent;border-right: 6px solid transparent;border-top: 7px solid #222;}
     34
     35        .zf-wb-dropWrapper select{
     36            position: absolute;
     37            top: 0;
     38            border: 0 none !important;
     39            width: 100%;
     40            max-width: 100%;
     41            outline: none !important;
     42            -moz-outline: none !important;
     43            margin: 0;
     44             appearance: none;
     45            -moz-appearance: radio-container;
     46            -webkit-appearance: none;
     47            background: transparent;
     48            text-overflow: '';
     49             webkit-user-select: none;
     50            -moz-user-select: none;
     51            -ms-user-select: none;
     52            -o-user-select: none;
     53            user-select: none;
     54            text-indent: 2px;
     55            white-space: nowrap;
     56            text-overflow: ellipsis;
     57            height: auto;
     58            font-size: 14px !important;
     59            padding-bottom: 5px;
     60            line-height: inherit;;
     61            }
     62        .zf-wb-dropWrapper select:hover{color:#444 !important;}
     63        .zf-wb-dropWrapper select:focus, .zf-wb-dropWrapper select option{-moz-outline: none !important; outline: none !important; border:none; -moz-box-shadow: none !important;-webkit-box-shadow: none !important;box-shadow: none !important;outline-offset: -2px !important; color: #444;}
     64        select:-moz-focusring {color: transparent !important;text-shadow: 0 0 0 #000 !important;}
     65        .popupOuterWrapper .popupContainer input[type="submit"]:focus{border: 1px solid transparent; outline: none;}
     66        .zf-wb-loading{ text-align: center;}
     67        .zf-wb-loading p{ display: inline;padding: 0 10px 0 0px !important;}
     68        /*loading animation */
     69.zf-wb-spinner { text-align: center;display: inline;position: relative;top: 2px;}
     70.zf-wb-spinner > div {
     71width: 11px;
     72height: 11px;
     73background-color: #333;
     74
     75border-radius: 100%;
     76display: inline-block;
     77-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
     78animation: sk-bouncedelay 1.4s infinite ease-in-out both;
     79}
     80
     81.zf-wb-spinner .bounce1 {
     82-webkit-animation-delay: -0.32s;
     83animation-delay: -0.32s;
     84}
     85
     86.zf-wb-spinner .bounce2 {
     87-webkit-animation-delay: -0.16s;
     88animation-delay: -0.16s;
     89}
     90
     91@-webkit-keyframes sk-bouncedelay {
     920%, 80%, 100% { -webkit-transform: scale(0) }
     9340% { -webkit-transform: scale(1.0) }
     94}
     95
     96@keyframes sk-bouncedelay {
     970%, 80%, 100% {
     98-webkit-transform: scale(0);
     99transform: scale(0);
     100} 40% {
     101-webkit-transform: scale(1.0);
     102transform: scale(1.0);
     103}
     104}
  • zoho-forms/tags/2.0/tinymce/zforms_dailog.js

    r2047986 r2237525  
    9696        document.getElementById("formSelectionError").style.display="block";       
    9797        document.getElementById("formSelectionError").innerHTML="Please select a form.";
    98         document.getElementById("selctContainer").classList.add("errorCont");
     98        document.getElementById("selctContainer").className= "errorCont";
    9999    }
    100100    else
     
    110110            formHeight.value="600px";
    111111        }
    112         var urlBuild = zForms[formName][1];
     112        var urlBuild = formName;
     113
    113114        insertContent(urlBuild,formWidth.value,formHeight.value);
    114115       
     
    126127    document.getElementById("publicLink").className= "selected";
    127128    document.getElementById("permaLinkDiv").style.display="block";
    128     document.getElementById("createFormDiv").style.display="none";
    129129    document.getElementById("chooseFormDiv").style.display= "none";
    130     document.getElementById("signinDiv").style.display="none";
    131     document.getElementById("refreshDiv").style.display="none";
    132130    document.getElementById("selectForm").classList.remove("selected");
    133131   
     
    138136    if(window.tinyMCE)
    139137    {
    140         window.open("https://www.zoho.com/forms/login.html");
    141         document.getElementById("refreshDiv").style.display="block";
    142         document.getElementById("signinDiv").style.display="none";
     138        var domainValue = $("#zForm_domain").val();
     139        var formsUrl = getZohoURL(domainValue);
     140        if(formsUrl !=""){
     141            window.open(formsUrl+"/forms/login.html");
     142            document.getElementById("refreshDiv").style.display="block";
     143            document.getElementById("signinDiv").style.display="none";
     144        }
    143145    }               
    144146}
     
    162164    }
    163165}
     166function showChooseFormDiv()
     167{
     168    document.getElementById("selectForm").classList.add("selected");
     169    document.getElementById("chooseFormDiv").style.display="block";
     170    document.getElementById("permaLinkDiv").style.display= "none";
     171    document.getElementById("publicLink").className= "none";
     172}
     173
     174function proceedToSelectFormOnTinyMce(){
     175    var domainValue = $("#zForm_domain").val();
     176    if(domainValue == "-select-"){
     177        $("#domainSelectionErr").show();
     178        $("#domainSelectionDiv").addClass("errorCont");
     179        return;
     180    }
     181    var formsUrl = getZohoFormsURL(domainValue);
     182    if(formsUrl !=""){
     183        getZohoFormsLisOnTinyMce(formsUrl);
     184        $("#domainSelectionDiv").hide();
     185        $("#refreshDiv").hide();
     186        $("#loadingDiv").show();
     187        setTimeout(function() {
     188            $("#loadingDiv").hide();
     189            if(a==""){
     190                $("#signinDiv").show();
     191            }else if(a.forms.length == 0){
     192                $("#createFormDiv").show();
     193            }else{
     194                getForms();
     195                $("#formSelectionDiv").show();
     196            }
     197           
     198        }, 2000);
     199    }
     200}
     201function getZohoFormsLisOnTinyMce(formsUrl){
     202            var apiURL = formsUrl+"/api/getforms?type=plugin";
     203            $("#loadingDiv").show();
     204            getFormsAndIncludeScriptOnTinyMce(apiURL,addToFormListDropDown);
     205        }
     206
     207        function addToFormListDropDown(){
     208            if(a!=""){
     209                var len = a.forms.length;
     210                if(len > 0){
     211               
     212                    var formList =document.getElementById("formname");
     213                    for(i = 0; i < len;i++){
     214                        var option = document.createElement("option");
     215                        option.text = a.forms[i].display_name;
     216                        option.value = a.forms[i].public_url;
     217                        formList.options.add(option);
     218                    }
     219                    $("#zFormSelectDiv").show();
     220                }
     221            }
     222        }
     223        function getFormsAndIncludeScriptOnTinyMce(url,callback)
     224        {
     225            var script = document.createElement("script")
     226            script.type = "text/javascript";
     227            if (script.readyState)
     228            { 
     229            //IE
     230
     231            script.onreadystatechange = function(){         
     232                    if (script.readyState == "loaded" || script.readyState == "complete")
     233                    {
     234                        script.onreadystatechange = null;
     235                        callback();
     236                    }
     237                };
     238            }
     239            else
     240            {
     241            //Others
     242               script.onload = function(){
     243                    callback();
     244                };
     245                script.onerror = function(){
     246                    callback();
     247                };
     248            }   
     249            script.src = url;
     250            document.getElementsByTagName("head")[0].appendChild(script);   
     251        }
     252//constructing url based on domain extention
     253function getZohoFormsURL(domain){
     254    if(domain != undefined && domain.length != 0 && domain != "-select-" && (domain == ".com" || domain == ".eu" || domain == ".com.cn" || domain == ".au" || domain == ".in")){
     255        return "https://forms.zoho"+domain;
     256    }else{
     257        return "";
     258    }
     259}
     260function getZohoURL(domain){
     261    if(domain != undefined && domain.length != 0 && domain != "-select-"){
     262        return "https://zoho"+domain;
     263    }else{
     264        return "";
     265    }
     266}
     267function hideDomainSelctError(){
     268    $("#domainSelectionDiv").removeClass("errorCont");
     269    $("#domainSelectionErr").hide();
     270}
    164271
    165272function hideError()
    166273{
    167     if(document.getElementById("selctContainer").classList.contains("errorCont"))
    168     {
     274    if(document.getElementById("selctContainer").classList.contains("errorCont")){
     275        document.getElementById("formSelectionError").style.display="none";
    169276        document.getElementById("selctContainer").classList.remove("errorCont");
    170         document.getElementById("formSelectionError").style.display="none";
    171277    }
    172278    if(document.getElementById("permaContainer").classList.contains("errorCont"))
     
    176282    }
    177283}
     284
     285
    178286
    179287function selectForm()
     
    225333function createForm()
    226334{
    227     window.open("https://forms.zoho.com/");
    228     document.getElementById("refreshDiv").style.display="block";   
    229     document.getElementById("createFormDiv").style.display="none";
    230     document.getElementById("signinDiv").style.display="none";
    231 }
     335    var domainValue = $("#zForm_domain").val();
     336    var formsUrl = getZohoFormsURL(domainValue);
     337    if(formsUrl !=""){
     338        window.open(formsUrl); 
     339        document.getElementById("refreshDiv").style.display="block";   
     340        document.getElementById("createFormDiv").style.display="none";
     341        document.getElementById("signinDiv").style.display="none";
     342    }
     343}
  • zoho-forms/tags/2.0/tinymce/zforms_dialog.php

    r2047986 r2237525  
    2323            <div class="legandTabCont">
    2424                <a href="javascript:void(0);" class="selected" id="publicLink" onclick="embedPerma()" > <em>Use Public Link</em></a>
    25                 <a class="lastTab" href="javascript:void(0);" id="selectForm" onclick="chooseForm()"><em>Select Your Form</em></a>
     25                <a class="lastTab" href="javascript:void(0);" id="selectForm" onclick="showChooseFormDiv()"><em>Select Your Form</em></a>
    2626                <div class="clearBoth"></div>
    2727            </div>
     
    3636                </div>
    3737
    38                 <div class="twoColumns">
     38                <div class="twoColumns" style="margin-top:20px">
    3939                        <div class="popupInnerWrapper flLeft">
    4040                        <label>Width </label>
     
    5858            </div>
    5959   
    60 
    6160            <div class="popupOuterWrapper" id="chooseFormDiv" style="display:none">
     61                <div id="domainSelectionDiv" class="popupInnerWrapper" style="margin-top: 12%;">
     62                    <label>Select the domain your Zoho account belongs to<em>*</em></label>
     63                    <div class="popupContainer zf-wb-dropWrapper" >
     64                        <select id="zForm_domain" onchange="hideDomainSelctError()"; style="width: 100%">
     65                            <option value="-select-">-Select-</option>
     66                            <option value=".com">zoho.com</option>
     67                            <option value=".eu">zoho.eu</option>
     68                            <option value=".com.cn">zoho.com.cn</option>
     69                            <option value=".in">zoho.in</option>
     70                            <option value=".au">zoho.au</option>
     71                        </select>
     72                    </div>
     73                    <p id="domainSelectionErr" style="display:none">Please choose a domain.</p>
     74                    <div class="popupContainer popupFotter">
     75                        <input class="blue" type="submit" value="Connect"  onclick="proceedToSelectFormOnTinyMce();">
     76                    </div>
     77                </div>
     78               
     79           
     80            <div class="popupInnerWrapper" id="formSelectionDiv" style="display:none">
    6281                 
    63                 <div class="popupInnerWrapper">
     82                <div id="selctContainer">
    6483                    <label>Choose a form<em>*</em></label>
    65                     <div class="popupContainer" id="selctContainer">
     84                    <div class="popupContainer zf-wb-dropWrapper">
    6685                        <select id="formname" onchange="hideError()"; style="width: 100%">
    6786                            <option>-Select-</option>
    6887                        </select>
    69                         <p id="formSelectionError" />
     88                       
    7089                    </div>
     90                    <p id="formSelectionError" />
    7191                </div>
    72                 <div class="twoColumns">
     92                <div class="twoColumns" style="margin-top:20px">
    7393                    <div class="popupInnerWrapper flLeft">
    7494                        <label>Width </label>
     
    92112                </div> 
    93113            </div>
    94            
    95             <div class="popupOuterWrapper" id="signinDiv" style="display:none">
    96                 <div class="popupInnerWrapper">
     114            <div class="popupInnerWrapper" id="signinDiv" style="display:none">
     115                <div >
    97116                    <div class="signWrapper">
    98117                        <p> Sign in to your Zoho Forms account to select a form. </p>
     
    101120                </div> 
    102121            </div>
    103             <div class="popupOuterWrapper" id="createFormDiv" style="display:none">
    104                 <div class="popupInnerWrapper">
     122            <div class="popupInnerWrapper" id="createFormDiv" style="display:none">
     123                <div >
    105124                    <div class="signWrapper">
    106125                        <p> You have not created any forms yet. Click on Create to build a new form. </p>
     
    109128                </div> 
    110129            </div>
    111 
    112             <div class="popupOuterWrapper" id="refreshDiv" style="display:none">
    113                 <div class="popupInnerWrapper">
     130            <div class="popupInnerWrapper" id="refreshDiv" style="display:none">
     131                <div >
    114132                    <div class="signWrapper">
    115133                    <p> Please Refresh to view your forms. </p>
    116                     <input class="blue" type="button" value="Refresh" id="button_refresh"  onclick="refresh()">
     134                    <input class="blue" type="button" value="Refresh" id="button_refresh"  onclick="proceedToSelectFormOnTinyMce()">   
    117135                    </div>
    118136                </div> 
    119137       
    120138            </div>
    121 
     139            <div id="loadingDiv" class="zf-wb-loading signWrapper" style="display: none;">
     140                <p>loading</p>
     141                <div class="zf-wb-spinner">
     142                    <div class="bounce1"></div>
     143                    <div class="bounce2"></div>
     144                    <div class="bounce3"></div>
     145                </div>
     146            </div>
     147        </div>
    122148            <div class="brandingFotterWrapper">
    123149                <div class="flRight brandingFotterCont">
  • zoho-forms/tags/2.0/zohoforms-block.js

    r2209845 r2237525  
    283283                                                },
    284284                                                "zoho.in"
     285                                            ),
     286                                            wpCreateElem("option",
     287                                                {
     288                                                    value: ".au"
     289                                                },
     290                                                "zoho.au"
    285291                                            )
    286292                                        )
Note: See TracChangeset for help on using the changeset viewer.