Plugin Directory

Changeset 3455315


Ignore:
Timestamp:
02/06/2026 11:42:01 AM (7 weeks ago)
Author:
quantumcloud
Message:

New feature: Import demo data

Location:
simple-link-directory
Files:
403 added
11 edited

Legend:

Unmodified
Added
Removed
  • simple-link-directory/trunk/assets/css/admin-style.css

    r3393439 r3455315  
    590590
    591591
    592 #qcld-quick-flyout {
     592.qcld-sldquick-flyout {
    593593    align-items: center;
    594594    bottom: 40px;
     
    603603}
    604604
    605 #qcld-quick-flyout:not(.is-open) {
     605.qcld-sldquick-flyout:not(.is-open) {
    606606    pointer-events: none
    607607}
    608608
    609609@media (max-width:959px) {
    610     #qcld-quick-flyout {
     610    .qcld-sldquick-flyout {
    611611        display: none
    612612    }
    613613}
    614614
    615 #qcld-quick-flyout .qcld-quick-flyout-mascot {
     615.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot {
    616616    align-items: center;
    617617    display: flex;
     
    620620}
    621621
    622 #qcld-quick-flyout .qcld-quick-flyout-mascot:after {
     622.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot:after {
    623623    background-color: #fff;
    624624    border-radius: 50%;
     
    635635}
    636636
    637 #qcld-quick-flyout .qcld-quick-flyout-mascot:hover:after {
     637.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot:hover:after {
    638638    box-shadow: 0 0 0 1px #212121, 0 3px 30px rgba(0, 0, 0, .25)
    639639}
    640640
    641 #qcld-quick-flyout .qcld-quick-flyout-mascot:focus {
     641.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot:focus {
    642642    box-shadow: none
    643643}
    644644
    645 #qcld-quick-flyout .qcld-quick-mascot__eyes {
     645.qcld-sldquick-flyout .qcld-quick-mascot__eyes {
    646646    transition: transform .2s ease-in-out
    647647}
    648648
    649 #qcld-quick-flyout.is-open .glsr-mascot__eyes {
     649.qcld-sldquick-flyout.is-open .glsr-mascot__eyes {
    650650    transform: translateY(-2.5%)
    651651}
    652652
    653 #qcld-quick-flyout .qcld-quick-flyout-label {
     653.qcld-sldquick-flyout .qcld-sldquick-flyout-label {
    654654    align-items: center;
    655655    display: flex;
     
    662662}
    663663
    664 #qcld-quick-flyout .qcld-quick-flyout-label>div {
     664.qcld-sldquick-flyout .qcld-sldquick-flyout-label>div {
    665665    background-color: rgba(44 51 56/.9);
    666666    border-radius: 3px;
     
    672672}
    673673
    674 #qcld-quick-flyout .qcld-quick-flyout-item:hover .qcld-quick-flyout-label>div,
    675 #qcld-quick-flyout .qcld-quick-flyout-mascot .qcld-quick-flyout-label>div {
     674.qcld-sldquick-flyout .qcld-sldquick-flyout-item:hover .qcld-sldquick-flyout-label>div,
     675.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot .qcld-sldquick-flyout-label>div {
    676676    background-color: #E91E63
    677677}
    678678
    679 #qcld-quick-flyout .qcld-quick-flyout-mascot .qcld-quick-flyout-label {
     679.qcld-sldquick-flyout .qcld-sldquick-flyout-mascot .qcld-sldquick-flyout-label {
    680680    opacity: 1;
    681681    transform: scale(1);
     
    683683}
    684684
    685 #qcld-quick-flyout.is-open .qcld-quick-flyout-mascot .qcld-quick-flyout-label {
     685.qcld-sldquick-flyout.is-open .qcld-sldquick-flyout-mascot .qcld-sldquick-flyout-label {
    686686    opacity: 0;
    687687    transform: scale(0)
    688688}
    689689
    690 #qcld-quick-flyout .qcld-quick-flyout-items {
     690.qcld-sldquick-flyout .qcld-sldquick-flyout-items {
    691691    display: flex;
    692692    flex-direction: column;
     
    694694}
    695695
    696 #qcld-quick-flyout .qcld-quick-flyout-item {
     696.qcld-sldquick-flyout .qcld-sldquick-flyout-item {
    697697    align-items: center;
    698698    background-color:#5B4E96;
     
    712712}
    713713
    714 #qcld-quick-flyout .qcld-quick-flyout-item:hover {
     714.qcld-sldquick-flyout .qcld-sldquick-flyout-item:hover {
    715715    background-color: #111111;
    716716    box-shadow: 0 3px 30px rgba(0, 0, 0, .25)
    717717}
    718718
    719 #qcld-quick-flyout .qcld-quick-flyout-item.qcld-quick-flyout-premium {
     719.qcld-sldquick-flyout .qcld-sldquick-flyout-item.qcld-sldquick-flyout-premium {
    720720    background-color: #009688
    721721}
    722722
    723 #qcld-quick-flyout .qcld-quick-flyout-item.qcld-quick-flyout-premium:hover {
     723.qcld-sldquick-flyout .qcld-sldquick-flyout-item.qcld-sldquick-flyout-premium:hover {
    724724    background-color: #E91E63
    725725}
    726726
    727 #qcld-quick-flyout .qcld-quick-flyout-item.qcld-quick-flyout-premium i {
     727.qcld-sldquick-flyout .qcld-sldquick-flyout-item.qcld-sldquick-flyout-premium i {
    728728    align-items: center;
    729729    color: #fff;
     
    734734
    735735
    736 #qcld-quick-flyout.is-open .qcld-quick-flyout-item {
     736.qcld-sldquick-flyout.is-open .qcld-sldquick-flyout-item {
    737737    opacity: 1;
    738738    transform: scale(1);
     
    740740}
    741741
    742 #qcld-quick-flyout .qcld-quick-flyout-item i {
     742.qcld-sldquick-flyout .qcld-sldquick-flyout-item i {
    743743    color: #fff;
    744744    font-size: 26px;
     
    747747}
    748748
    749 a.qcld-quick-flyout-button.qcld-quick-flyout-mascot img {
     749a.qcld-sldquick-flyout-button.qcld-sldquick-flyout-mascot img {
    750750    width: 60px !important;
    751751}
     752
     753body.qcld-sld-flyout #wpcontent .is-open {
     754    background: #000000b0;
     755    z-index: 99999;
     756    width: 100%;
     757    right: 0;
     758    height: 100vh;
     759    display: flex;
     760    align-items: flex-end;
     761    justify-content: flex-end;
     762    row-gap: 10px;
     763    transition: opacity .2s ease-in-out;
     764    bottom: 0;
     765    padding: 40px;
     766}
  • simple-link-directory/trunk/assets/css/directory-style.css

    r3265548 r3455315  
    344344}
    345345
     346
     347       
     348/* Toggle Switch Styling */
     349.sld-sld-theme-switch-wrapper {
     350    display: flex;
     351    align-items: center;
     352    justify-content: end;
     353    gap: 10px;
     354    margin-bottom: 5px;
     355}
     356
     357.sld-theme-switch {
     358    display: inline-block;
     359    height: 34px;
     360    position: relative;
     361    width: 60px;
     362    background: gray;
     363    border-radius: 20px;
     364    border: 1px solid #ddd;
     365}
     366
     367.sld-theme-switch input { display: none; }
     368
     369.sld-theme-slider {
     370    background-color: var(--switch-bg);
     371    bottom: 0;
     372    cursor: pointer;
     373    left: 0;
     374    position: absolute;
     375    right: 0;
     376    top: 0;
     377    transition: .4s;
     378    display: flex;
     379    align-items: center;
     380    justify-content: space-between;
     381    padding: 0 5px;
     382}
     383
     384.sld-theme-slider:before {
     385    background-color: #fff;
     386    bottom: 4px;
     387    content: "";
     388    height: 25px;
     389    left: 4px;
     390    position: absolute;
     391    transition: .4s;
     392    width: 25px;
     393    z-index: 2;
     394}
     395
     396input:checked + .sld-theme-slider:before {
     397    transform: translateX(25px);
     398}
     399
     400.sld-theme-slider.sld-theme-round {
     401    border-radius: 34px;
     402}
     403
     404.sld-theme-slider.sld-theme-round:before {
     405    border-radius: 50%;
     406}
     407
     408.sld-theme-icon { font-size: 14px; z-index: 1; }
     409
     410
    346411@media only screen and (max-width : 768px) {
    347412.qcopd-list-wrapper {
  • simple-link-directory/trunk/assets/js/directory-script.js

    r3393439 r3455315  
    242242   
    243243   jQuery(document).ready(function($){
    244 jQuery('#qcld-quick-flyout').on('click', function() {
    245   jQuery(this).toggleClass('is-open');
     244        jQuery('.qcld-sldquick-flyout').on('click', function() {
     245        jQuery(this).toggleClass('is-open');
     246        });
     247    });
     248        jQuery(document).ready(function($){
     249        $('.qcld-sldquick-flyout').on('click', function(){
     250            $('body').toggleClass('qcld-sld-flyout');
     251        });
     252        });   
     253   
    246254});
    247     });
    248    
    249    
    250 });
    251 
    252 
     255
     256
  • simple-link-directory/trunk/assets/js/qcopd-admin-common.js

    r3393439 r3455315  
    258258        $(this).parent().parent().remove();
    259259    });
     260
     261
     262
     263    $(document).on( 'click', '#sld-start-import-btn',function(e){
     264        e.preventDefault();
     265       
     266        var uploadBtn   = $(this);
     267        var messageArea = $('#sld-import-message');
     268
     269        // Data to send via AJAX
     270        var data = {
     271            'action': 'qcld_sld_import_csv_from_folder',
     272            'security': sld_ajax_object.ajax_nonce,
     273        };
     274
     275        $.ajax({
     276            url: ajaxurl,
     277            data: data,
     278            dataType: 'json',
     279            type: 'POST',
     280            beforeSend: function (){
     281
     282                uploadBtn.prop('disabled', true).text('Importing...');
     283                messageArea.html('<p>Importing data, please wait...</p>');
     284               
     285            },
     286            success: function (response){
     287                if (response.success) {
     288                    messageArea.html('<p style="color: green;">' + response.data.message + '</p>');
     289                    // Redirect to the newly created page
     290                    //window.location.replace(response.data.redirect_url);
     291                    window.open(response.data.redirect_url)
     292                } else {
     293                    messageArea.html('<p style="color: red;">Error: ' + response.data + '</p>');
     294                    uploadBtn.prop('disabled', false).text('Click to Import Data');
     295                }
     296               
     297            },
     298            error: function (xhr, status, errorThrown){
     299                uploadBtn.prop('disabled', false).text('Click to Import Data');
     300                messageArea.html('<p style="color: red;"><strong>Something went wrong:</strong> ' + errorThrown + '</p>');
     301                window.location.reload();
     302            }
     303        });
     304
     305
     306    });
     307
     308
     309
     310
     311
     312
     313
    260314});
    261315
     
    371425    });
    372426   
    373 jQuery(document).ready(function($){
    374 jQuery('#qcld-quick-flyout').on('click', function() {
    375   jQuery(this).toggleClass('is-open');
    376 });
    377     });
     427        jQuery(document).ready(function($){
     428        jQuery('.qcld-sldquick-flyout').on('click', function() {
     429        jQuery(this).toggleClass('is-open');
     430        });
     431    });
     432
     433        jQuery(document).ready(function($){
     434        $('.qcld-sldquick-flyout').on('click', function(){
     435            $('body').toggleClass('qcld-sld-flyout');
     436        });
     437        });
    378438
    379439})
  • simple-link-directory/trunk/assets/js/qcopd-admin-scripts.js

    r3393439 r3455315  
    4545
    4646
    47 jQuery(document).ready(function($){
    48 jQuery('#qcld-quick-flyout').on('click', function() {
    49   jQuery(this).toggleClass('is-open');
    50 });
     47    jQuery(document).ready(function($){
     48        jQuery('.qcld-sldquick-flyout').on('click', function() {
     49        jQuery(this).toggleClass('is-open');
     50        });
    5151    });
    5252
     53        jQuery(document).ready(function($){
     54        $('.qcld-sldquick-flyout').on('click', function(){
     55            $('body').toggleClass('qcld-sld-flyout');
     56        });
     57        });
    5358
    5459});
  • simple-link-directory/trunk/embed/css/embed-form.css

    r3240583 r3455315  
    159159    box-sizing: border-box;
    160160}
    161 .qcopd_embed_container{text-align: right;border-bottom: 1px solid #ddd;padding-bottom: 10px;margin-bottom: 10px; min-height: 55px;}
     161.qcopd_embed_container{text-align: right;border-bottom: 1px solid #ddd;padding-top: 10px;padding-bottom: 10px;margin-bottom: 10px; min-height: 55px;}
    162162.igcode_textarea{width:100%; height:120px;}
    163163.qcopd_iframe_sm{width: 70px;}
  • simple-link-directory/trunk/qc-op-directory-assets.php

    r3202260 r3455315  
    7575        wp_register_script( 'sld-admin-common-script', QCOPD_ASSETS_URL . '/js/qcopd-admin-common.js', array('jquery'));
    7676        wp_enqueue_script( 'sld-admin-common-script' );
     77
     78        $params                     = array(
     79          'ajaxurl'                 => admin_url('admin-ajax.php'),
     80          'ajax_nonce'              => wp_create_nonce('quantum_ajax_validation_18')
     81        );
     82        wp_localize_script( 'sld-admin-common-script', 'sld_ajax_object', $params );
    7783       
    7884        $scrolljs = "jQuery(document).ready(function($){
  • simple-link-directory/trunk/qc-op-directory-main.php

    r3402543 r3455315  
    44 * Plugin URI: https://wordpress.org/plugins/simple-link-directory
    55 * Description: Link Directory WordPress plugin to curate topic based link collections. Curate gorgeous Link Directory, Local Business Directory, Partners or Vendors Directory
    6  * Version: 8.8.4
     6 * Version: 8.8.6
    77 * Author: Link Directory
    88 * Author URI: https://www.quantumcloud.com/products/simple-link-directory/
    99 * Requires at least: 4.6
    10  * Tested up to: 6.8
     10 * Tested up to: 6.9
    1111 * Text Domain: qc-opd
    1212 * Domain Path: /lang/
     
    4545}
    4646
     47// Define a constant for the CSV file path within the plugin directory
     48if ( ! defined( 'SLD_CSV_FILE_PATH' ) ) {
     49    define( 'SLD_CSV_FILE_PATH', plugin_dir_path( __FILE__ ) . 'assets/file/sample-csv-file-demo.csv' );
     50}
    4751//Include files and scripts
    4852
     
    5559require_once( 'qc-op-directory-import.php' );
    5660require_once( 'qc-opd-ajax-stuffs.php' );
     61
     62/*01-27-2026*/
     63require_once( 'qc-sld-import-demo-data.php' );
     64
     65
    5766
    5867/*05-31-2017*/
     
    212221            <div class="sld_info_carousel">
    213222
    214                 <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: Did you know that you can'); ?> <strong style="color: yellow"><?php echo esc_html('Auto Generate'); ?></strong> <?php echo esc_html('Title, Subtitle & Thumbnail with the Pro Version in Just 2 Clicks?'); ?> <strong style="color: yellow"><?php echo esc_html('Triple Your Link Entry Speed!'); ?></strong></div>
    215                
    216                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Lists are the base pillars of SLD, not individual links. Group your links into different Lists for the best performance.'); ?></div>
    217                
    218                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: SLD looks the best when you create multiple Lists and use the Show All Lists mode.'); ?></div>
    219 
    220                 <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: Did you know that SLD Pro version lets you monetize your directory and earn'); ?> <strong style="color: yellow"><?php echo esc_html('passive income?'); ?></strong> <?php echo esc_html('Upgrade now!'); ?></div>
    221                
    222                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Try to keep the maximum number of links below 30 per list. Create multiple Lists as needed.'); ?></div>
    223 
    224                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Use the handy shortcode generator to make life easy. It is a small, blue [SLD] button found at the toolbar of any page\'s visual editor.'); ?></div>
    225                
    226                 <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: You can display your'); ?> <strong style="color: yellow"><?php echo esc_html('Lists by category'); ?> </strong><?php echo esc_html('with the SLD pro version.'); ?> <strong style="color: yellow"><?php echo esc_html('16+ Templates, Multi page mode'); ?></strong><?php echo esc_html(', Widgets are also available.'); ?></div>
    227                
    228                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: You can create a page with a contact form and link the Add Link button to that page so people can submit links to your directory by email.'); ?></div>
    229 
    230                 <div class="sld_info_item"><?php echo esc_html('**SLD Tip: If you are having problem with adding more items or saving a list then you may need to increase max_input_vars value in server. Check the help section for more details.'); ?></div>
    231                
    232                 <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: SLD pro version has'); ?> <strong style="color: yellow"><?php echo esc_html('front end dashboard'); ?></strong> <?php echo esc_html('for user registration and link management. As well as tags and instant search.'); ?> <strong style="color: yellow"><?php echo esc_html('Upgrade to the Pro version now!'); ?></strong></div>
     223                <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: Did you know that you can', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('Auto Generate', 'qc-opd'); ?></strong> <?php echo esc_html('Title, Subtitle & Thumbnail with the Pro Version in Just 2 Clicks?', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('Triple Your Link Entry Speed!', 'qc-opd'); ?></strong></div>
     224               
     225                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Lists are the base pillars of SLD, not individual links. Group your links into different Lists for the best performance.', 'qc-opd'); ?></div>
     226               
     227                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: SLD looks the best when you create multiple Lists and use the Show All Lists mode.', 'qc-opd'); ?></div>
     228
     229                <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: Did you know that SLD Pro version lets you monetize your directory and earn', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('passive income?', 'qc-opd'); ?></strong> <?php echo esc_html('Upgrade now!', 'qc-opd'); ?></div>
     230               
     231                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Try to keep the maximum number of links below 30 per list. Create multiple Lists as needed.', 'qc-opd'); ?></div>
     232
     233                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: Use the handy shortcode generator to make life easy. It is a small, blue [SLD] button found at the toolbar of any page\'s visual editor.', 'qc-opd'); ?></div>
     234               
     235                <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: You can display your', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('Lists by category', 'qc-opd'); ?> </strong><?php echo esc_html('with the SLD pro version.', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('16+ Templates, Multi page mode', 'qc-opd'); ?></strong><?php echo esc_html(', Widgets are also available.', 'qc-opd'); ?></div>
     236               
     237                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: You can create a page with a contact form and link the Add Link button to that page so people can submit links to your directory by email.', 'qc-opd'); ?></div>
     238
     239                <div class="sld_info_item"><?php echo esc_html('**SLD Tip: If you are having problem with adding more items or saving a list then you may need to increase max_input_vars value in server. Check the help section for more details.', 'qc-opd'); ?></div>
     240               
     241                <div class="sld_info_item"><?php echo esc_html('**SLD Pro Tip: SLD pro version has', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('front end dashboard', 'qc-opd'); ?></strong> <?php echo esc_html('for user registration and link management. As well as tags and instant search.', 'qc-opd'); ?> <strong style="color: yellow"><?php echo esc_html('Upgrade to the Pro version now!', 'qc-opd'); ?></strong></div>
    233242
    234243            </div>
     
    285294    ?>
    286295    <p>
    287         <label for="sh_meta_box_bg_effect"><p><?php echo esc_html('Click the button below to generate shortcode'); ?></p></label>
    288         <input type="button" id="sld_shortcode_generator_meta" class="button button-primary button-large" value="<?php echo esc_attr('Generate Shortcode'); ?>" />
     296        <label for="sh_meta_box_bg_effect"><p><?php echo esc_html('Click the button below to generate shortcode', 'qc-opd'); ?></p></label>
     297        <input type="button" id="sld_shortcode_generator_meta" class="button button-primary button-large" value="<?php echo esc_attr('Generate Shortcode', 'qc-opd'); ?>" />
    289298    </p>
    290299   
     
    405414                <?php
    406415                printf(
    407                     __('%s Simple Link Directory %s works the best when you create multiple Lists and show them all in a page. Use the following shortcode to display All lists on any page:  %s  %s  %s  Use the %s shortcode generator %s to select style and other options. ', 'dna88-wp-notice'),
     416                    __('%s Simple Link Directory %s works the best when you create multiple Lists and show them all in a page. Use the following shortcode to display All lists on any page:  %s  %s  %s  Use the %s shortcode generator %s to select style and other options. ', 'qc-opd'),
    408417                    '<strong>',
    409418                    '</strong>',
     
    420429
    421430
    422 
    423 
     431        <?php
     432            $page_slug     = 'sld-demo-data';
     433
     434            $existing_page = get_page_by_path( $page_slug );
     435            if ( ! $existing_page ) {
     436        ?>
     437
     438        <div id="message" class="notice notice-info is-dismissible">
     439            <p>
     440                <?php
     441                printf(
     442                    __('%s Import SLD Demo Data:%s Imports a CSV file from the plugin folder into a custom post type called "sld", creates a new page, displays the data using a shortcode, and redirects the demo page %s Click to Import Data %s %s', 'qc-opd'),
     443                    '<strong>',
     444                    '</strong>',
     445                    '<button type="button" id="sld-start-import-btn" class="button button-primary">',
     446                    '</button>',
     447                    '<div id="sld-import-message"></div>',
     448               
     449                );
     450                ?>
     451            </p>
     452        </div>
     453    <?php }else{ ?>
     454
     455        <div id="message" class="notice notice-info is-dismissible">
     456            <p>
     457                <?php
     458                printf(
     459                    __('%s SLD Demo Data Imported:%s Imports a CSV file from the plugin folder into a custom post type called "sld", creates a new page, displays the data using a shortcode, and redirects the demo page %s Click to View Demo Page %s ', 'qc-opd'),
     460                    '<strong>',
     461                    '</strong>',
     462                    '<a href="'.esc_url(home_url('sld-demo-data')).'" target="_blank">',
     463                    '</a>',
     464               
     465                );
     466                ?>
     467            </p>
     468        </div>
     469    <?php } ?>
    424470
    425471       
    426 <div id="qcld-quick-flyout" >
    427     <div class="qcld-quick-flyout-items">
    428     <a href="https://www.quantumcloud.com/resources/kb-sections/simple-link-directory/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item qcld-quick-flyout-premium" rel="noopener noreferrer" target="_blank" style="transition-delay: 0ms;">
    429                 <div class="qcld-quick-flyout-label">
    430                     <div>Getting Started</div>
     472        <div class="qcld-sldquick-flyout" >
     473            <div class="qcld-sldquick-flyout-items">
     474                <a href="<?php echo esc_url('https://www.quantumcloud.com/resources/kb-sections/simple-link-directory/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item qcld-sldquick-flyout-premium" rel="noopener noreferrer" target="_blank" style="transition-delay: 0ms;">
     475                    <div class="qcld-sldquick-flyout-label">
     476                        <div><?php echo esc_html('Getting Started', 'qc-opd'); ?></div>
     477                    </div>
     478                    <i class="dashicons dashicons-admin-home"></i>
     479                </a>
     480                <a href="<?php echo esc_url('https://www.quantumcloud.com/resources/kb-sections/frequently-asked-questions/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item" rel="noopener noreferrer" target="_blank" style="transition-delay: 60ms;">
     481                    <div class="qcld-sldquick-flyout-label">
     482                        <div><?php echo esc_html('FAQ', 'qc-opd'); ?></div>
     483                    </div>
     484                    <i class="dashicons dashicons-flag"></i>
     485                </a>
     486                <a href="<?php echo esc_url('https://www.quantumcloud.com/resources/kb-sections/simple-link-directory/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item" style="transition-delay: 90ms;">
     487                    <div class="qcld-sldquick-flyout-label">
     488                        <div><?php echo esc_html('Read the Documentation', 'qc-opd'); ?></div>
     489                    </div>
     490                    <i class="dashicons dashicons-sos"></i>
     491                </a>
     492                <a href="<?php echo esc_url('https://www.quantumcloud.com/resources/free-support/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item" rel="noopener noreferrer" target="_blank" style="transition-delay: 120ms;">
     493                    <div class="qcld-sldquick-flyout-label">
     494                        <div><?php echo esc_html('Ask for Help', 'qc-opd'); ?></div>
     495                    </div>
     496                    <i class="dashicons dashicons-email"></i>
     497                </a>           
     498                <a href="<?php echo esc_url('https://dev.quantumcloud.com/sld/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item" style="transition-delay: 30ms;">
     499                    <div class="qcld-sldquick-flyout-label">
     500                        <div><?php echo esc_html('Check out the SLD Demo', 'qc-opd'); ?></div>
     501                    </div>
     502                    <i class="dashicons dashicons-welcome-view-site"></i>
     503                </a>
     504                <a href="<?php echo esc_url('https://www.quantumcloud.com/products/simple-link-directory/'); ?>" target="_blank" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-item qcld-sldquick-flyout-premium" rel="noopener noreferrer" target="_blank" style="transition-delay: 0ms;">
     505                    <div class="qcld-sldquick-flyout-label">
     506                        <div><?php echo esc_html('Upgrade to Premium', 'qc-opd'); ?></div>
     507                    </div>
     508                    <i class="dashicons dashicons-star-filled"></i>
     509                </a>
     510            </div>
     511            <a href="javascript:void(0);" class="qcld-sldquick-flyout-button qcld-sldquick-flyout-mascot">
     512                <div class="qcld-sldquick-flyout-label">
     513                    <div><?php echo esc_html('Start Here', 'qc-opd'); ?></div>
    431514                </div>
    432                 <i class="dashicons dashicons-admin-home"></i>
     515                <img style="width:100%" src="<?php echo esc_url( QCOPD_IMG_URL . '/logo.png' ); ?>" alt="Dialogflow CX">
    433516            </a>
    434             <a href="https://www.quantumcloud.com/resources/kb-sections/frequently-asked-questions/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item" rel="noopener noreferrer" target="_blank" style="transition-delay: 60ms;">
    435                 <div class="qcld-quick-flyout-label">
    436                     <div>FAQ</div>
    437                 </div>
    438                 <i class="dashicons dashicons-flag"></i>
    439             </a>
    440             <a href="https://www.quantumcloud.com/resources/kb-sections/simple-link-directory/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item" style="transition-delay: 90ms;">
    441                 <div class="qcld-quick-flyout-label">
    442                     <div>Read the Documentation</div>
    443                 </div>
    444                 <i class="dashicons dashicons-sos"></i>
    445             </a>
    446             <a href="https://www.quantumcloud.com/resources/free-support/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item" rel="noopener noreferrer" target="_blank" style="transition-delay: 120ms;">
    447                 <div class="qcld-quick-flyout-label">
    448                     <div>Ask for Help</div>
    449                 </div>
    450                 <i class="dashicons dashicons-email"></i>
    451             </a>           
    452             <a href="https://dev.quantumcloud.com/sld/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item" style="transition-delay: 30ms;">
    453                 <div class="qcld-quick-flyout-label">
    454                     <div>Check out the SLD Demo</div>
    455                 </div>
    456                 <i class="dashicons dashicons-welcome-view-site"></i>
    457             </a>
    458             <a href="https://www.quantumcloud.com/products/simple-link-directory/" target="_blank" class="qcld-quick-flyout-button qcld-quick-flyout-item qcld-quick-flyout-premium" rel="noopener noreferrer" target="_blank" style="transition-delay: 0ms;">
    459                 <div class="qcld-quick-flyout-label">
    460                     <div>Upgrade to Premium</div>
    461                 </div>
    462                 <i class="dashicons dashicons-star-filled"></i>
    463             </a>
    464             </div>
    465     <a href="javascript:void(0);" class="qcld-quick-flyout-button qcld-quick-flyout-mascot">
    466         <div class="qcld-quick-flyout-label">
    467             <div>Start Here</div>
    468517        </div>
    469         <img style="width:100%" src="<?php echo esc_url( QCOPD_IMG_URL . '/logo.png' ); ?>" alt="Dialogflow CX">
    470     </a>
    471 </div>
    472518    <?php
    473519       
  • simple-link-directory/trunk/qc-op-directory-shortcodes.php

    r3402543 r3455315  
    110110            'subtitle_line_height'  => '',
    111111            'enable_image'          => '',
     112            'dark_mode'             => get_option('sld_enable_dark_mode')
    112113        ), $atts
    113114    ));
     
    140141        'subtitle_line_height'  => $subtitle_line_height,
    141142        'enable_image'          => $enable_image,
     143        'dark_mode'             => $dark_mode,
    142144    );
    143145   
     
    149151        wp_add_inline_style( 'qcopd-custom-css', $css );
    150152    }
     153
     154    $lan_enable_dark_mode   = get_option('sld_lan_enable_dark_mode') ? get_option('sld_lan_enable_dark_mode') : 'Enable Dark Mode';
     155    $lan_dark_mode_on       = get_option('sld_lan_dark_mode_on') ? get_option('sld_lan_dark_mode_on') : 'Dark Mode On';
     156    $lan_light_mode_on      = get_option('sld_lan_light_mode_on') ? get_option('sld_lan_light_mode_on') : 'Light Mode On';
     157
     158    $custom_js = 'jQuery(document).ready(function($) {
     159
     160            function sld_dark_light_mode($toggle, e) {
     161               
     162                if (e && e.stopImmediatePropagation) {
     163                    e.stopImmediatePropagation();
     164                }
     165                const $targetWrapper = $toggle.closest(".sld-sld-theme-switch-wrapper").parent().parent();
     166                const $targetWrappers = $targetWrapper.find(".qcopd-list-wrapper ul li, .filter-area, .sld-tag-filter-area, .sld-top-area");
     167                const $allItems = $targetWrappers.find("div, a, p, h1, h2, h3, h4, h5, h6, span");
     168                const $targetElements = $targetWrappers.add($allItems);
     169
     170                $targetElements.each(function() {
     171                    const $el = $(this);
     172                   
     173                    // Store previous style only if not already stored
     174                    if (!$el.data("previous-style")) {
     175                        $el.data("previous-style", $el.attr("style") || "");
     176                    }
     177
     178                    $el.css({
     179                        "background-color": "#121212",
     180                        "color": "#ffffff",
     181                        "border-color": "#333"
     182                    });
     183
     184                    // Ensure text headers and links are white
     185                    if ($el.is("a,h3 span, h1, h2, h3, h4, h5, h6")) {
     186                        $el.css("color", "#ffffff");
     187                    }
     188                });
     189            }
     190
     191            function sld_remove_dark_mode($toggle, e) {
     192                if (e && e.stopImmediatePropagation) {
     193                    e.stopImmediatePropagation();
     194                }
     195                const $targetWrapper    = $toggle.closest(".sld-sld-theme-switch-wrapper").parent().parent();
     196                const $targetWrappers   = $targetWrapper.find(".qcopd-list-wrapper ul li, .qcopd-list-wrapper ul li *, .sld-top-area, .sld-top-area *, .filter-area, .filter-area *, .sld-tag-filter-area, .sld-tag-filter-area *");
     197                $targetWrappers.each(function() {
     198                    const $el = $(this);
     199                    const oldStyle = $el.data("previous-style");
     200                   
     201                    if (oldStyle !== undefined) {
     202                        if (oldStyle === "") {
     203                            $el.removeAttr("style");
     204                        } else {
     205                            $el.attr("style", oldStyle);
     206                        }
     207                    }
     208                });
     209            }
     210
     211            $(".qcopd-list-wrapper").each(function(index) {
     212                const $list = $(this);
     213                const uniqueId = "sld-theme-checkbox-" + index;
     214                if (!$list.prev(".sld-sld-theme-switch-wrapper").length) {
     215                    $list.before(`
     216                        <div class="sld-sld-theme-switch-wrapper">
     217                            <label class="sld-theme-switch" for="${uniqueId}">
     218                                <input type="checkbox" id="${uniqueId}" class="sld-theme-checkbox-input" />
     219                                <div class="sld-theme-slider sld-theme-round">
     220                                    <span class="sld-theme-icon sun">☀️</span>
     221                                    <span class="sld-theme-icon moon">🌙</span>
     222                                </div>
     223                            </label>
     224                            <em id="sld-theme-status-${index}">'.$lan_enable_dark_mode.'</em>
     225                        </div>
     226                    `);
     227                }
     228            });
     229
     230            const $toggle = $("#sld-theme-checkbox-0");
     231            const $qcld_sld_tab = $(".qcld_sld_tab").length;
     232            const $body = $(".sld-main-style-simple");
     233            const $statusText = $("#sld-theme-status-0");
     234            const storageKey = "user-theme-pref";
     235            const currentTheme = localStorage.getItem(storageKey);
     236
     237
     238            if (!$qcld_sld_tab) {
     239
     240                if (currentTheme) {
     241                    $body.addClass(currentTheme);
     242                    if (currentTheme === "dark-mode") {
     243                        $toggle.prop("checked", true);
     244                        sld_dark_light_mode($toggle);
     245                        $statusText.text("'.$lan_dark_mode_on.'");
     246                    }
     247                } else {
     248                    if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
     249                        $body.addClass("dark-mode");
     250                        $toggle.prop("checked", true);
     251                        sld_remove_dark_mode($toggle);
     252                        $statusText.text("'.$lan_light_mode_on.'");
     253                    }
     254                }
     255            }
     256
     257            $(document).on("change", ".sld-theme-checkbox-input", function(e) {
     258                e.preventDefault();
     259                e.stopImmediatePropagation();
     260                const $thisToggle   = $(this);
     261                const isDarkMode    = $thisToggle.is(":checked");
     262                const $targetWraps = $toggle.closest(".sld-sld-theme-switch-wrapper");
     263
     264                if (isDarkMode) {
     265                    // APPLY DARK MODE
     266                    $body.addClass("dark-mode");
     267                    localStorage.setItem(storageKey, "dark-mode");
     268                    sld_dark_light_mode($thisToggle);
     269                    $targetWraps.find("em").text("'.$lan_dark_mode_on.'");
     270                } else {
     271                    // RESTORE ORIGINAL STYLE
     272                    $body.removeClass("dark-mode");
     273                    localStorage.setItem(storageKey, "light-mode");
     274                    sld_remove_dark_mode($thisToggle);
     275                    $targetWraps.find("em").text("'.$lan_light_mode_on.'");
     276                }
     277            });
     278
     279
     280           
     281        });';
     282
     283    if( isset($dark_mode) && ($dark_mode == 'on' || $dark_mode == 'show' || $dark_mode == 'yes' ) ){
     284
     285        wp_add_inline_script( 'qcopd-custom-script', $custom_js, 'after' );
     286    }
    151287
    152288    if( $mode == 'one' )
  • simple-link-directory/trunk/qc-opd-setting-options.php

    r3393439 r3455315  
    4848    register_setting( 'qc-sld-plugin-settings-group', 'sld_enable_rtl', $args );
    4949    register_setting( 'qc-sld-plugin-settings-group', 'sld_enable_search', $args );
     50    register_setting( 'qc-sld-plugin-settings-group', 'sld_enable_dark_mode', $args );
    5051    //Language Settings
    5152    register_setting( 'qc-sld-plugin-settings-group', 'sld_lan_add_link', $args );
     
    5354    register_setting( 'qc-sld-plugin-settings-group', 'sld_lan_live_search', $args );
    5455    register_setting( 'qc-sld-plugin-settings-group', 'sld_no_results_found', $args );
     56    register_setting( 'qc-sbd-plugin-settings-group', 'sld_lan_enable_dark_mode', $args );
     57    register_setting( 'qc-sbd-plugin-settings-group', 'sld_lan_dark_mode_on', $args );
     58    register_setting( 'qc-sbd-plugin-settings-group', 'sld_lan_light_mode_on', $args );
    5559    //custom css section
    5660    register_setting( 'qc-sld-plugin-settings-group', 'sld_custom_style', $args );
     
    194198            <i><?php echo esc_html('If you make this option ON, then list items will be arranged in Right-to-Left direction.'); ?></i></td>
    195199        </tr>
     200        <tr valign="top">
     201          <th scope="row"><?php echo esc_html('Enable Dark Mode'); ?></th>
     202          <td><input type="checkbox" name="sld_enable_dark_mode" value="on" <?php echo (esc_attr( get_option('sld_enable_dark_mode') )=='on'?'checked="checked"':''); ?> />
     203            <i><?php echo esc_html('Enable this option to show Dark Mode for all themes'); ?></i></td>
     204        </tr>
    196205      </table>
    197206    </div>
     
    217226          <td><input type="text" name="sld_no_results_found" size="100" value="<?php echo esc_attr( get_option('sld_no_results_found') ); ?>"  />
    218227            <i><?php echo esc_html('Change the language for No Results Found for Your Search'); ?></i></td>
     228        </tr>
     229        <tr valign="top">
     230          <th scope="row"> <?php echo esc_html('Enable Dark Mode'); ?></th>
     231          <td><input type="text" name="sld_lan_enable_dark_mode" size="100" value="<?php echo esc_attr( get_option('sld_lan_enable_dark_mode') ); ?>"  />
     232            <i> <?php echo esc_html('Change the language for - Enable Dark Mode'); ?></i></td>
     233        </tr>
     234        <tr valign="top">
     235          <th scope="row"> <?php echo esc_html('Dark Mode On'); ?></th>
     236          <td><input type="text" name="sld_lan_dark_mode_on" size="100" value="<?php echo esc_attr( get_option('sld_lan_dark_mode_on') ); ?>"  />
     237            <i> <?php echo esc_html('Change the language for - Dark Mode On'); ?></i></td>
     238        </tr>
     239        <tr valign="top">
     240          <th scope="row"> <?php echo esc_html('Light Mode On'); ?></th>
     241          <td><input type="text" name="sld_lan_light_mode_on" size="100" value="<?php echo esc_attr( get_option('sld_lan_light_mode_on') ); ?>"  />
     242            <i> <?php echo esc_html('Change the language for - Light Mode On'); ?></i></td>
    219243        </tr>
    220244      </table>
     
    299323                        <?php echo esc_html(' Add the shortcode parameter search="true" to show Live Search'); ?> <br>
    300324                        <?php echo esc_html('Example: search="true"'); ?> </p>
     325                      <p> <strong><?php echo esc_html('11. dark_mode'); ?></strong> <br>
     326                      <?php echo esc_html('You can use this value to use the dark_mode of SLD templates. Available values for this option "on", "off".'); ?> </p>
    301327
    302328                    </div>
  • simple-link-directory/trunk/readme.txt

    r3421793 r3455315  
    55Requires at least: 4.6
    66Tested up to: 6.9
    7 Stable tag: 8.8.4
     7Stable tag: 8.8.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    366366== Changelog ==
    367367
     368= 8.8.6 =
     369# Added feature: Import demo data
     370
    368371= 8.8.4 =
    369372# Improved security
Note: See TracChangeset for help on using the changeset viewer.