Plugin Directory

Changeset 3093833


Ignore:
Timestamp:
05/28/2024 11:21:19 AM (19 months ago)
Author:
viitorcloudvc
Message:

Fix button issue on visual screen and mulitple shortcode tested with latest wp version

Location:
viitor-shortcodes/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • viitor-shortcodes/trunk/includes/admin/class-ww-vcsc-admin.php

    r3028594 r3093833  
    1212 *
    1313 * @package WP Shortcodes
    14  * @since 1.0.0
     14 * @since 3.0.0
    1515 */
    1616class Ww_Wpsc_Admin {
     
    3030     *
    3131     * @package WP Shortcodes
    32      * @since 1.0.0
     32     * @since 3.0.0
    3333     */
    3434    public function ww_vcsc_shortcode_editor_register_button( $buttons ) {
     
    4646     *
    4747     * @package WP Shortcodes
    48      * @since 1.0.0
     48     * @since 3.0.0
    4949     */
    5050    public function ww_vcsc_shortcode_editor_button_script( $plugin_array ) {
     
    6363     *
    6464     * @package WP Shortcodes
    65      * @since 1.0.0
     65     * @since 3.0.0
    6666     */
    6767    public function ww_vcsc_shortcode_button() {
     
    8383     *
    8484     * @package WP Shortcodes
    85      * @since 1.0.0
     85     * @since 3.0.0
    8686     */
    8787    public function ww_vcsc_shortcode_popup_markup() {
     
    9494     *
    9595     * @package WP Shortcodes
    96      * @since 1.0.0
     96     * @since 3.0.0
    9797     */
    9898    public function add_hooks() {
  • viitor-shortcodes/trunk/includes/admin/forms/ww-vcsc-popup.php

    r3028594 r3093833  
    1313 *
    1414 * @package WP Shortcodes
    15  * @since 1.0.0
     15 * @since 3.0.0
    1616 */
    1717
  • viitor-shortcodes/trunk/includes/class-ww-vcsc-scripts.php

    r3028594 r3093833  
    1313 *
    1414 * @package WP Shortcodes
    15  * @since 1.0.0
     15 * @since 3.0.0
    1616 */
    1717class Ww_Wpsc_Scripts {
     
    2626     *
    2727     * @package WP Shortcodes
    28      * @since 1.0.0
     28     * @since 3.0.0
    2929     */
    3030    public function ww_vcsc_public_styles() {
     
    4040     *
    4141     * @package WP Shortcodes
    42      * @since 1.0.0
     42     * @since 3.0.0
    4343     */
    4444    public function ww_vcsc_admin_styles( $hook_suffix ) {
     
    6262     *
    6363     * @package WP Shortcodes
    64      * @since 1.0.0
     64     * @since 3.0.0
    6565     */
    6666    public function add_hooks() {
  • viitor-shortcodes/trunk/includes/class-ww-vcsc-shortcodes.php

    r3028594 r3093833  
    1313 *
    1414 * @package WP Shortcodes
    15  * @since 1.0.0
     15 * @since 3.0.0
    1616 */
    1717class Ww_Wpsc_Shortcodes {
     
    2727     *
    2828     * @package WP Shortcodes
    29      * @since 1.0.0
     29     * @since 3.0.0
    3030     */
    3131    public function ww_vcsc_boxes( $atts, $content ) {
     
    5757     *
    5858     * @package WP Shortcodes
    59      * @since 1.0.0
     59     * @since 3.0.0
    6060     */
    6161    public function ww_vcsc_button( $atts, $content ) {
     
    7272     *
    7373     * @package WP Shortcodes
    74      * @since 1.0.0
     74     * @since 3.0.0
    7575     */
    7676    public function add_hooks() {
  • viitor-shortcodes/trunk/includes/css/ww-vcsc-public.css

    r1779448 r3093833  
    11/* ############## boxes type css start ################*/
    2 .ww-vcsc-boxstandard{
    3     border: 1px solid #FFFFFF;
    4     color: #6D6E6E;
     2.ww-vcsc-boxstandard {
     3    border: 1px solid #FFFFFF;
     4    color: #6D6E6E;
    55    background: none repeat scroll 0 0 #F1F1F1;
    66    margin: 0 0 10px;
    7     padding: 15px 45px 15px 45px;   
     7    padding: 15px 45px 15px 45px;
    88
    99}
     10
    1011.ww-vcsc-boxinfo {
    11     background:url(../images/box-info.png) no-repeat scroll 7px 6px #BEDEFF;
     12    background: url(../images/box-info.png) no-repeat scroll 7px 6px #BEDEFF;
    1213    border: 1px solid #E7F3FF;
    13     color: #517193;
     14    color: #517193;
    1415    padding: 15px 55px 15px 55px;
    15     border-radius: 4px;
     16    border-radius: 4px;
    1617}
    17 .ww-vcsc-boxwarning{
    18     background:url(../images/box-warning.png) no-repeat scroll 7px 6px #F7F4B4;
    19     border: 1px solid #FFFFEA;
    20     color: #8C8A64;
     18
     19.ww-vcsc-boxwarning {
     20    background: url(../images/box-warning.png) no-repeat scroll 7px 6px #F7F4B4;
     21    border: 1px solid #FFFFEA;
     22    color: #8C8A64;
    2123    padding: 15px 45px 15px 45px;
    22     border-radius: 4px; 
     24    border-radius: 4px;
    2325}
    24 .ww-vcsc-boxdownload{
    25     background:url(../images/box-download.png) no-repeat scroll 7px 6px #C0F0B3;
    26     border: 1px solid #E9FFE3;
    27     color: #5C8A50;
     26
     27.ww-vcsc-boxdownload {
     28    background: url(../images/box-download.png) no-repeat scroll 7px 6px #C0F0B3;
     29    border: 1px solid #E9FFE3;
     30    color: #5C8A50;
    2831    padding: 15px 54px 15px 54px;
    29     border-radius: 4px; 
     32    border-radius: 4px;
    3033}
     34
    3135.ww-vcsc-boxerror {
    32     background:url(../images/box-error.png) no-repeat scroll 7px 6px #FFCEBE;
    33     border: 1px solid #FFEEE8;
    34     color: #957368;
     36    background: url(../images/box-error.png) no-repeat scroll 7px 6px #FFCEBE;
     37    border: 1px solid #FFEEE8;
     38    color: #957368;
    3539    padding: 15px 45px 15px 45px;
    36     border-radius: 4px; 
     40    border-radius: 4px;
    3741}
    38 .ww-vcsc-boxstandard,.ww-vcsc-boxinfo,.ww-vcsc-boxwarning,.ww-vcsc-boxdownload,.ww-vcsc-boxerror{
    39     font-family: 'Droid Sans,Arial',Verdana,sans-serif;
    40     font-size: 14px;
    41     line-height: 21px;
    42     float: left;
     42
     43.ww-vcsc-boxstandard,
     44.ww-vcsc-boxinfo,
     45.ww-vcsc-boxwarning,
     46.ww-vcsc-boxdownload,
     47.ww-vcsc-boxerror {
     48    font-family: 'Droid Sans,Arial', Verdana, sans-serif;
     49    font-size: 14px;
     50    line-height: 21px;
     51    float: left;
    4352    min-height: 57px;
    4453    line-height: 18px;
    4554    margin: 0 0 10px;
    46     margin:20px;
    47     width:auto;
    48     clear:both;
     55    margin: 20px;
     56    width: auto;
     57    clear: both;
    4958    min-width: 145px;
    5059    width: 190px;
    51     text-align:center;
     60    text-align: center;
    5261    color: #000;
    53     border-radius: 6px;
     62    border-radius: 6px;
    5463}
     64
    5565/*.ww-vcsc-boxstandard{
    5666    width:100% !important;
     
    6070
    6171/**************** Button CSS Start *************************/
    62 a.ww-vcsc-button.orange{
    63     background: -moz-linear-gradient(center top , #FAA51A, #F47A20) repeat scroll 0 0 transparent;
    64     background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #FAA51A), color-stop(1,#F47A20));
     72a.ww-vcsc-button.orange {
     73    background: -moz-linear-gradient(center top, #FAA51A, #F47A20) repeat scroll 0 0 transparent;
     74    background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #FAA51A), color-stop(1, #F47A20));
    6575    background-color: #d76b23;
    66     border: 1px solid #DA7C0C;
    67     color: #FEF4E9;
     76    border: 1px solid #DA7C0C;
     77    color: #FEF4E9;
    6878}
    69 a.ww-vcsc-button.orange:hover{
     79
     80a.ww-vcsc-button.orange:hover {
    7081    background: #d25e00;
    71     background: -moz-linear-gradient(center top , #F88E11, #F06015) repeat scroll 0 0 transparent;
    72     background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #F88E11), color-stop(1,#F06015));
     82    background: -moz-linear-gradient(center top, #F88E11, #F06015) repeat scroll 0 0 transparent;
     83    background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #F88E11), color-stop(1, #F06015));
    7384}
    74 a.ww-vcsc-button.orange:active{
    75     background: -moz-linear-gradient(center top , #F47A20, #FAA51A) repeat scroll 0 0 transparent;
    76     background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #F47A20), color-stop(1,#FAA51A));
    77     color: #FCD3A5;
     85
     86a.ww-vcsc-button.orange:active {
     87    background: -moz-linear-gradient(center top, #F47A20, #FAA51A) repeat scroll 0 0 transparent;
     88    background: -webkit-gradient(linear, left top, left bottom, color-stop(.2, #F47A20), color-stop(1, #FAA51A));
     89    color: #FCD3A5;
    7890}
    79 a.ww-vcsc-button span{
     91
     92a.ww-vcsc-button span {
    8093    line-height: 1.2em;
    81     min-height: 16px;
     94    min-height: 16px;
    8295}
    83 a.ww-vcsc-button.large{
     96
     97a.ww-vcsc-button.large {
    8498    font-size: 1.4em;
    85     padding: 7px 46px;
     99    padding: 7px 46px;
    86100}
    87 .ww-vcsc-button-container{
    88     margin-bottom:10px;
     101
     102.ww-vcsc-button-container {
     103    margin-bottom: 10px;
    89104}
     105
     106.ww-vcsc-boxinfo a.button {
     107    text-decoration: none;
     108    font-size: 18px;
     109}
     110
    90111/**************** Button CSS End *************************/
  • viitor-shortcodes/trunk/includes/js/ww-vcsc-buttons.js

    r1754949 r3093833  
    1 // JavaScript Document
    2 jQuery(document).ready(function($) {
     1jQuery(document).ready(function ($) {
    32
    4 // Start Single Shortcode Start
    5 (function() {
    6     tinymce.create('tinymce.plugins.wwvcscsingleshortcode', {
    7         init : function(ed, url) {
    8            
    9             ed.addButton('wwvcscsingleshortcode', {
    10                 title : 'My Single Shortcode', 
    11                 image : url+'/images/ww-vcsc-single.png',
    12                 onclick : function() {
    13                    
    14                 //send_to_editor(str);
    15                 tinymce.get('content').execCommand('mceInsertContent',false, '[ww_vcsc_button][/ww_vcsc_button]');
    16                  
    17                 }
    18             });
    19         },
    20         createControl : function(n, cm) {
    21             return null;
    22         },
    23     });
    24  
    25     tinymce.PluginManager.add('wwvcscsingleshortcode', tinymce.plugins.wwvcscsingleshortcode);
    26 })();
    27 // Start Single Shortcode End
     3    // Start Single Shortcode Start
     4    (function () {
     5        tinymce.create('tinymce.plugins.wwvcscsingleshortcode', {
     6            init: function (ed, url) {
     7                ed.addButton('wwvcscsingleshortcode', {
     8                    title: 'My Single Shortcode',
     9                    image: url + '/images/ww-vcsc-single.png',
     10                    onclick: function () {
     11                        // Send single shortcode
     12                        tinymce.get('content').execCommand('mceInsertContent', false, '[ww_vcsc_button][/ww_vcsc_button]');
     13                    }
     14                });
     15            },
     16            createControl: function (n, cm) {
     17                return null;
     18            },
     19        });
    2820
    29 // Start Shortcodes Click
    30 (function() {
    31     tinymce.create('tinymce.plugins.wwvcscshortcodes', {
    32         init : function(ed, url) {
    33            
    34             ed.addButton('wwvcscshortcodes', {
    35                 title : 'My Shortcodes List',
    36                 image : url+'/images/ww-vcsc.png',
    37                 onclick : function() {
    38                    
    39                     jQuery('.ww-vcsc-popup-overlay').fadeIn();
    40                     jQuery('.ww-vcsc-popup-content').fadeIn();
    41                    
    42                     jQuery('#ww_vcsc_shortcode').val('');
    43                     jQuery('#ww_vcsc_box_type_select').val('');
    44                     jQuery('#ww_vcsc_box_content').val('');
    45                     jQuery('.ww-vcsc-shortcodes-options').hide();
    46                     jQuery('.ww_vcsc_box_content').val('');
    47                    
    48                 }
    49             });
    50         },
    51         createControl : function(n, cm) {
    52             return null;
    53         },
    54     });
    55  
    56     tinymce.PluginManager.add('wwvcscshortcodes', tinymce.plugins.wwvcscshortcodes);
    57 })();
    58    
    59     jQuery( document ).on('click', '.ww-vcsc-popup-close-button, .ww-vcsc-popup-overlay', function () {
    60         jQuery('.ww-vcsc-popup-overlay').fadeOut();
    61         jQuery('.ww-vcsc-popup-content').fadeOut();
    62        
     21        tinymce.PluginManager.add('wwvcscsingleshortcode', tinymce.plugins.wwvcscsingleshortcode);
     22    })();
     23    // End Single Shortcode
     24
     25    // Start Shortcodes Click
     26    (function () {
     27        tinymce.create('tinymce.plugins.wwvcscshortcodes', {
     28            init: function (ed, url) {
     29                ed.addButton('wwvcscshortcodes', {
     30                    title: 'My Shortcodes List',
     31                    image: url + '/images/ww-vcsc.png',
     32                    onclick: function () {
     33                        $('.ww-vcsc-popup-overlay, .ww-vcsc-popup-content').fadeIn();
     34                        $('#ww_vcsc_shortcode, #ww_vcsc_box_type_select, #ww_vcsc_box_content').val('');
     35                        $('.ww-vcsc-shortcodes-options').hide();
     36                    }
     37                });
     38            },
     39            createControl: function (n, cm) {
     40                return null;
     41            },
     42        });
     43
     44        tinymce.PluginManager.add('wwvcscshortcodes', tinymce.plugins.wwvcscshortcodes);
     45    })();
     46
     47    // Close Popup
     48    $(document).on('click', '.ww-vcsc-popup-close-button, .ww-vcsc-popup-overlay', function () {
     49        $('.ww-vcsc-popup-overlay, .ww-vcsc-popup-content').fadeOut();
    6350    });
    64     jQuery( document ).on('click', '#ww_vcsc_insert_shortcode', function () {
    65        
    66         var shortcode = jQuery('#ww_vcsc_shortcode').val();
     51
     52    // Insert Shortcode
     53    $(document).off('click', '#ww_vcsc_insert_shortcode').on('click', '#ww_vcsc_insert_shortcode', function () {
     54        var shortcode = $('#ww_vcsc_shortcode').val();
    6755        var shortcodestr = '';
    68         if(shortcode == '') {
    69             jQuery('.ww-vcsc-popup-error').fadeIn();
     56
     57        if (shortcode === '') {
     58            $('.ww-vcsc-popup-error').fadeIn();
    7059            return false;
    7160        } else {
    72             jQuery('.ww-vcsc-popup-error').hide();
    73                
    74                 switch(shortcode) {
    75                     case 'button'   :
    76                                         shortcodestr += '[ww_vcsc_button][/ww_vcsc_button]';
    77                                         break;
    78                     case 'box'      :
    79                                        
    80                                         var content = jQuery('#ww_vcsc_box_content').val();
    81                                         var boxtype = jQuery('#ww_vcsc_box_type_select').val();
    82                                         shortcodestr += '[ww_vcsc_boxes boxtype="'+boxtype+'" showcontent="'+content+'"][/ww_vcsc_boxes]';         
    83                                         break;
    84                                
    85                     default:break;
    86                 }
    87                
    88                  //send_to_editor(str);
    89                 tinymce.get('content').execCommand('mceInsertContent',false, shortcodestr);
    90                 jQuery('.ww-vcsc-popup-overlay').fadeOut();
    91                 jQuery('.ww-vcsc-popup-content').fadeOut();
    92            
    93            
     61            $('.ww-vcsc-popup-error').hide();
     62
     63            switch (shortcode) {
     64                case 'button':
     65                    shortcodestr = '[ww_vcsc_button][/ww_vcsc_button]';
     66                    break;
     67                case 'box':
     68                    var content = $('#ww_vcsc_box_content').val();
     69                    var boxtype = $('#ww_vcsc_box_type_select').val();
     70                    shortcodestr = '[ww_vcsc_boxes boxtype="' + boxtype + '" showcontent="' + content + '"][/ww_vcsc_boxes]';
     71                    break;
     72                default:
     73                    break;
     74            }
     75
     76            // Insert shortcode
     77            tinymce.get('content').execCommand('mceInsertContent', false, shortcodestr);
     78            $('.ww-vcsc-popup-overlay, .ww-vcsc-popup-content').fadeOut();
    9479        }
    9580    });
    96     jQuery('#ww_vcsc_shortcode').change(function() {
    97        
    98         var shortcode = jQuery(this).val();
    99         jQuery('.ww-vcsc-shortcodes-options').hide();
    100         switch(shortcode) {
    101             case 'box'  :
    102                                 jQuery('#ww_vcsc_box_type').show();
    103                                 break;
    104                                
    105             default:break;
     81
     82    // Show Options Based on Shortcode Selection
     83    $('#ww_vcsc_shortcode').change(function () {
     84        var shortcode = $(this).val();
     85        $('.ww-vcsc-shortcodes-options').hide();
     86
     87        if (shortcode === 'box') {
     88            $('#ww_vcsc_box_type').show();
    10689        }
    10790    });
    108    
     91
    10992});
  • viitor-shortcodes/trunk/readme.txt

    r3028594 r3093833  
    44Tags:Viitor, Shortcodes, Shortcode, Button,  box, page, Download Button, Error Button, Standard Button, Info Button
    55Requires at least: 3.8
    6 Tested up to: 6.4.2
    7 Requires PHP: 5.2.4
     6Tested up to: 6.5.3
     7Requires PHP: 5.2.4 or higher
    88Stable tag: trunk
    99License: GPLv3
  • viitor-shortcodes/trunk/ww-wp-shortcodes.php

    r3028594 r3093833  
    44 * Plugin URI: https://viitorcloud.com/blog/
    55 * Description: Button shortcodes and shortcodes attributes.
    6  * Version: 2.0.0
     6 * Version: 3.0.0
    77 * Author: Viitorcloud
    88 * Author URI: https://viitorcloud.com/
    99 *
    1010 * @package WP Shortcodes
    11  * @since 1.0.0
     11 * @since 3.0.0
    1212 */
    1313
     
    4141 *
    4242 * @package WP Shortcodes
    43  * @since 1.0.0
     43 * @since 3.0.0
    4444 */
    4545load_plugin_textdomain( 'wwvcsc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     
    5151 *
    5252 * @package WP Shortcodes
    53  * @since 1.0.0
     53 * @since 3.0.0
    5454 */
    5555
     
    6262 *
    6363 * @package WP Shortcodes
    64  * @since 1.0.0
     64 * @since 3.0.0
    6565 */
    6666
     
    7474 *
    7575 * @package WP Shortcodes
    76  * @since 1.0.0
     76 * @since 3.0.0
    7777 */
    7878function ww_vcsc_install() {
     
    8888 *
    8989 * @package WP Shortcodes
    90  * @since 1.0.0
     90 * @since 3.0.0
    9191 */
    9292function ww_vcsc_uninstall() {
     
    9999 *
    100100 * @package WP Shortcodes
    101  * @since 1.0.0
     101 * @since 3.0.0
    102102 */
    103103
     
    125125$ww_vcsc_shortcodes = new Ww_Wpsc_Shortcodes();
    126126$ww_vcsc_shortcodes->add_hooks();
     127
     128/**
     129 * Enqueue script for admin
     130 */
     131function enqueue_custom_tinymce_plugin() {
     132    wp_enqueue_script( 'custom-tinymce-plugin', plugin_dir_url( __FILE__ ) . 'includes/js/ww-vcsc-buttons.js', array( 'jquery' ), '1.0', true );
     133}
     134add_action( 'admin_enqueue_scripts', 'enqueue_custom_tinymce_plugin' );
Note: See TracChangeset for help on using the changeset viewer.