Plugin Directory

Changeset 2175363


Ignore:
Timestamp:
10/17/2019 11:40:25 PM (6 years ago)
Author:
kakaroto84
Message:

Version 1.0.1
Add copy button

Location:
pixel-clusters/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pixel-clusters/trunk/content/pixel-html.php

    r2144690 r2175363  
    1 <div class="wrap">
     1<style>
     2.wrap .postbox .inside h1
     3{
     4    font-size:28px;
     5}
    26
    3     <h1>Pixel Clusters</h1>
     7.wrap .postbox .inside h3#code-generate
     8{
     9    display: inline-block;
     10    font-size: 18px;
     11}
    412
    5     <h2>Copy Code:</h2>
    6     <h3 id="code-generate">[cluster]</h3>
     13.wrap .postbox .inside .mybutton
     14{
     15    background: #09F;
     16    border: 1px solid black;
     17    border-radius: 10px;
     18    color: white;
     19    cursor: pointer;
     20    font-size: 18px;
     21    font-weight: 700;
     22    padding: 4px 15px;
     23}
     24
     25.wrap .postbox .inside .mybutton:hover
     26{
     27    background: black;
     28}
     29
     30.wrap .postbox .inside #success
     31{
     32    color: #0C3;
     33    font-style: 16px;
     34    font-style: italic;
     35}
     36
     37</style>
     38<div class="wrap">     
    739   
    8     <table width="100%" border="0" cellpadding="1" cellspacing="1">
    9     <tr>
    10         <td width="15%">
    11             <label for="mode">Select mode:</label>
    12         </td>
    13         <td>
    14             <select id="mode" name="mode" onChange="pixel_cluster_code()">
    15                 <option disabled selected hidden>Select mode:</option>
    16                 <option value="1">Image, title and excerpt</option>
    17                 <option value="2">Image, title without excerpt</option>
    18                 <option value="3">List of titles</option>
    19             </select>
    20         </td>
    21     </tr>
    22     <tr>
    23         <td width="15%">
    24             <label for="number">Number of post to show:</label>
    25         </td>
    26         <td>
    27             <input type="number" min="1" id="number" name="number" value="1" onChange="pixel_cluster_code()" />
    28         </td>
    29     </tr>
    30     <tr>
    31         <td width="15%">
    32             <label for="type">Select type:</label>
    33         </td>
    34         <td>
    35             <select id="type" name="type" onChange="pixel_cluster_change_type()">
    36                 <option disabled selected hidden>Select type:</option>
    37                 <option value="1">Categories</option>
    38                 <option value="2">Tags</option>
    39             </select>
    40         </td>
    41     </tr>
    42     <tr class="type-select" id="type1" style="display: none;">
    43         <td width="15%">
    44             <label for="cat">Select a category:</label>
    45         </td>
    46         <td>
    47             <?php
    48                 wp_dropdown_categories( array(
    49                     'hide_empty'        => true,
    50                     'name'              => 'cat',
    51                     'id'                => 'cat',
    52                     'hierarchical'      => true,
    53                     'show_option_none'  => 'Select category',
    54                     'orderby'           => 'name',
    55                 ) );
    56             ?>
    57         </td>
    58     </tr>
    59     <tr class="type-select" id="type2" style="display: none;">
    60         <td width="15%">
    61             <label for="tag">Select a tag:</label>
    62         </td>
    63         <td>
    64             <?php
    65                 wp_dropdown_categories( array(
    66                     'hide_empty'        => true,
    67                     'name'              => 'tag',
    68                     'id'                => 'tag',
    69                     'hierarchical'      => true,
    70                     'show_option_none'  => 'Select tag',
    71                     'taxonomy'          => 'post_tag',
    72                     'orderby'           => 'name',
    73                 ) );
    74             ?>
    75         </td>
    76     </tr>
    77     </table>   
    78    
    79     <p>&nbsp;</p>
    80    
    81     <p><strong>Example: [cluster type="1" tag_id="51"  modo="1" numero="2"]</strong></p>
    82    
    83     <h2>Type:</h2>
    84     <ul>
    85         <li>1 - Category</li>
    86         <li>2 - Tag</li>
    87     </ul>
    88    
    89     <h2>tag_id:</h2>
    90     <p>Reference ID</p>
    91    
    92    
    93     <h2>modo:</h2>
    94     <ul>
    95         <li>1 - Image, title and excerpt</li>
    96         <li>2 - Image, title without excerpt</li>
    97         <li>3 - List of titles</li>
    98     </ul>
    99    
    100    
    101     <h2>numero:</h2>
    102     <p>Number of posts to show</p>
     40    <div class="postbox">               
     41        <div class="inside">
     42
     43            <h1>Pixel Clusters</h1>
     44            <hr />
     45            <h2>Copy Code:</h2>
     46            <h3 id="code-generate">[cluster]</h3> <button class="mybutton" onclick="pixel_copyToClipboard('#code-generate')">Copy</button> <span id="success"></span>
     47           
     48            <table width="100%" border="0" cellpadding="1" cellspacing="1">
     49            <tr>
     50                <td width="15%">
     51                    <label for="mode">Select mode:</label>
     52                </td>
     53                <td>
     54                    <select id="mode" name="mode" onChange="pixel_cluster_code()">
     55                        <option disabled selected hidden>Select mode:</option>
     56                        <option value="1">Image, title and excerpt</option>
     57                        <option value="2">Image, title without excerpt</option>
     58                        <option value="3">List of titles</option>
     59                    </select>
     60                </td>
     61            </tr>
     62            <tr>
     63                <td width="15%">
     64                    <label for="number">Number of post to show:</label>
     65                </td>
     66                <td>
     67                    <input type="number" min="1" id="number" name="number" value="1" onChange="pixel_cluster_code()" />
     68                </td>
     69            </tr>
     70            <tr>
     71                <td width="15%">
     72                    <label for="type">Select type:</label>
     73                </td>
     74                <td>
     75                    <select id="type" name="type" onChange="pixel_cluster_change_type()">
     76                        <option disabled selected hidden>Select type:</option>
     77                        <option value="1">Categories</option>
     78                        <option value="2">Tags</option>
     79                    </select>
     80                </td>
     81            </tr>
     82            <tr class="type-select" id="type1" style="display: none;">
     83                <td width="15%">
     84                    <label for="cat">Select a category:</label>
     85                </td>
     86                <td>
     87                    <?php
     88                        wp_dropdown_categories( array(
     89                            'hide_empty'        => true,
     90                            'name'              => 'cat',
     91                            'id'                => 'cat',
     92                            'hierarchical'      => true,
     93                            'show_option_none'  => 'Select category',
     94                            'orderby'           => 'name',
     95                        ) );
     96                    ?>
     97                </td>
     98            </tr>
     99            <tr class="type-select" id="type2" style="display: none;">
     100                <td width="15%">
     101                    <label for="tag">Select a tag:</label>
     102                </td>
     103                <td>
     104                    <?php
     105                        wp_dropdown_categories( array(
     106                            'hide_empty'        => true,
     107                            'name'              => 'tag',
     108                            'id'                => 'tag',
     109                            'hierarchical'      => true,
     110                            'show_option_none'  => 'Select tag',
     111                            'taxonomy'          => 'post_tag',
     112                            'orderby'           => 'name',
     113                        ) );
     114                    ?>
     115                </td>
     116            </tr>
     117            </table>   
     118           
     119            <p>&nbsp;</p>
     120           
     121            <p><strong>Example: [cluster type="1" tag_id="51"  modo="1" numero="2"]</strong></p>
     122           
     123            <h2>Type:</h2>
     124            <ul>
     125                <li>1 - Category</li>
     126                <li>2 - Tag</li>
     127            </ul>
     128           
     129            <h2>tag_id:</h2>
     130            <p>Reference ID</p>
     131           
     132           
     133            <h2>modo:</h2>
     134            <ul>
     135                <li>1 - Image, title and excerpt</li>
     136                <li>2 - Image, title without excerpt</li>
     137                <li>3 - List of titles</li>
     138            </ul>
     139           
     140           
     141            <h2>numero:</h2>
     142            <p>Number of posts to show</p>
     143           
     144        </div>
     145    </div>
    103146
    104147</div>
  • pixel-clusters/trunk/js/cluster.js

    r2144690 r2175363  
    5252    return data;
    5353}
     54
     55function pixel_copyToClipboard(elemento)
     56{
     57    var temp = jQuery("<input>")
     58    jQuery("body").append(temp);
     59    temp.val(jQuery(elemento).text()).select();
     60    document.execCommand("copy");
     61    temp.remove();
     62   
     63    jQuery('#success').html('').show();
     64    jQuery('#success').html('Shortcode was copied!').fadeOut(2000);
     65}
  • pixel-clusters/trunk/pixel-clusters.php

    r2146006 r2175363  
    99 * Plugin URI:        https://mireunion.com/
    1010 * Description:       A small plugin for create clusters of posts.
    11  * Version:           1.0
     11 * Version:           1.0.1
    1212 * Author:            Mex Avila
    1313 * Author URI:        https://datakun.com/
  • pixel-clusters/trunk/readme.txt

    r2144643 r2175363  
    4848= 1.0 =
    4949* Initial release
     50= 1.0.1 =
     51* Add copy button
Note: See TracChangeset for help on using the changeset viewer.