Plugin Directory

Changeset 2852518


Ignore:
Timestamp:
01/22/2023 11:08:34 AM (3 years ago)
Author:
alvinmuthui
Message:

commit VERSION 1.0.1

Location:
toric
Files:
185 added
10 edited

Legend:

Unmodified
Added
Removed
  • toric/trunk/README.txt

    r2850549 r2852518  
    55Requires at least: 3.0.1
    66Tested up to: 6.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88Requires PHP: 5.6.20
    99License: GPLv2 or later
     
    3939== Changelog ==
    4040
    41 = 1.0 =
     41= 1.0.0 =
    4242* The beginning of Tori Codes.
     43
     44= 1.0.1 =
     45Added live preview while editing the code value.
    4346
    4447== Upgrade Notice ==
    4548
    46 = 1.0 =
    47 The beginning of Tori Codes.
     49= 1.0.1 =
     50Added live preview while editing the code value.
  • toric/trunk/admin/class-toric-admin.php

    r2850549 r2852518  
    7070        $this->version     = $this->toric->get_version();
    7171        $this->set_toric_meta_boxes()->get_toric_meta_boxes();
    72     }
     72
     73    }
     74
     75
    7376
    7477    /**
     
    7982    public function enqueue_styles() {
    8083
    81         /**
    82          * This function is provided for demonstration purposes only.
    83          *
    84          * An instance of this class should be passed to the run() function
    85          * defined in Toric_Loader as all of the hooks are defined
    86          * in that particular class.
    87          *
    88          * The Toric_Loader will then create the relationship
    89          * between the defined hooks and the functions defined in this
    90          * class.
    91          */
    92 
    9384        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/toric-admin.css', array(), $this->version, 'all' );
    9485
     
    10192     */
    10293    public function enqueue_scripts() {
    103 
    104         /**
    105          * This function is provided for demonstration purposes only.
    106          *
    107          * An instance of this class should be passed to the run() function
    108          * defined in Toric_Loader as all of the hooks are defined
    109          * in that particular class.
    110          *
    111          * The Toric_Loader will then create the relationship
    112          * between the defined hooks and the functions defined in this
    113          * class.
    114          */
    115 
    116         // todo: minify scripts.
    117 
    11894        wp_enqueue_script( $this->plugin_name . '-admin', plugin_dir_url( __FILE__ ) . 'js/toric-admin.js', array( 'jquery' ), $this->version, false );
    11995        wp_enqueue_script( $this->plugin_name . '-copy-to-clipboard', plugin_dir_url( __FILE__ ) . 'js/toric-copy-to-clipboard.js', array( 'jquery' ), $this->version, false );
    120 
    12196    }
    12297
     
    130105    public function init() {
    131106        $this->admin_menu();
     107
     108        $toric_ajax = new Toric_Ajax(
     109            $this->toric,
     110            'toric_admin',
     111            array( $this, 'ajax_callback' ),
     112            plugin_dir_url( __FILE__ ) . 'js/toric-ajax.js',
     113            'private',
     114            array(
     115                'code_retrieval_error_message' => esc_html( __( 'Failed to retrieve the code. Update the code or Refresh the page', 'toric' ) ),
     116            ), // $ajax_variables,
     117            'toric-admin-ajax', // $nonce,
     118            'toric',
     119            'toric-admin-ajax', // $ajax_handle,
     120            array( $this->plugin_name . '-admin' ),
     121            '1.0.1', // $script_version,
     122            false// $script_in_footer.
     123        );
     124    }
     125
     126    function ajax_callback() {
     127        // nonce verification on
     128        if ( isset( $_REQUEST['value'] ) ) {
     129            $value = $_REQUEST['value'];
     130        }
     131        if ( $value ) {
     132            echo wp_kses( $this->toric->get_toric_codes()->get_qr_code( $value ), $this->toric->get_allowed_svg_html() );
     133        } else {
     134            echo esc_html( __( 'Please enter details', 'toric' ) );
     135        }
     136
    132137    }
    133138
  • toric/trunk/admin/css/toric-admin.css

    r2850549 r2852518  
    1 @charset "UTF-8";
    2 .nav-tabs {
    3   float: left;
    4   width: 100%;
    5   margin: 0;
    6   list-style-type: none;
    7   border-bottom: 1px solid transparent;
    8 }
    9 .nav-tabs > li {
    10   float: left;
    11   margin-bottom: -1px;
    12 }
    13 .nav-tabs > li > a {
    14   margin-right: 2px;
    15   line-height: 1.5;
    16   padding: 10px;
    17   border: 1px solid transparent;
    18   border-radius: 4px 4px 0 0;
    19   float: left;
    20   text-decoration: none;
    21 }
    22 .nav-tabs > li > a:hover {
    23   border-color: #eee #eee #ddd;
    24 }
    25 .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
    26   color: #555;
    27   cursor: default;
    28   background-color: #fff;
    29   border-color: transparent;
    30 }
    31 
    32 .tab-content > .tab-pane {
    33   float: left;
    34   width: 100%;
    35   display: none;
    36 }
    37 .tab-content > .tab-pane.active {
    38   display: block;
    39   padding: 10px;
    40   background-color: #fff;
    41   -webkit-box-shadow: 0 5px 4px -2px rgba(0, 0, 0, 0.15);
    42           box-shadow: 0 5px 4px -2px rgba(0, 0, 0, 0.15);
    43 }
    44 
    45 div.ui-toggle {
    46   margin: 0;
    47   padding: 0;
    48 }
    49 div.ui-toggle input[type=checkbox] {
    50   display: none;
    51 }
    52 div.ui-toggle input[type=checkbox]:checked + label {
    53   border-color: #009eea;
    54   background: #009eea;
    55   -webkit-box-shadow: inset 0 0 0 10px #009eea;
    56           box-shadow: inset 0 0 0 10px #009eea;
    57 }
    58 div.ui-toggle input[type=checkbox]:checked + label > div {
    59   margin-left: 20px;
    60 }
    61 div.ui-toggle label {
    62   -webkit-transition: all 300ms ease;
    63   transition: all 300ms ease;
    64   display: inline-block;
    65   position: relative;
    66   -webkit-touch-callout: none;
    67   -webkit-user-select: none;
    68   -moz-user-select: none;
    69   -ms-user-select: none;
    70   user-select: none;
    71   background: #8c8c8c;
    72   -webkit-box-shadow: inset 0 0 0 0 #009eea;
    73           box-shadow: inset 0 0 0 0 #009eea;
    74   border: 2px solid #8c8c8c;
    75   border-radius: 22px;
    76   width: 40px;
    77   height: 20px;
    78 }
    79 div.ui-toggle label div {
    80   -webkit-transition: all 200ms ease;
    81   transition: all 200ms ease;
    82   background: #FFFFFF;
    83   width: 20px;
    84   height: 20px;
    85   border-radius: 10px;
    86 }
    87 div.ui-toggle label:hover, div.ui-toggle label > div:hover {
    88   cursor: pointer;
    89 }
    90 
    91 /*320px — 480px: Mobile devices.
    92 481px — 768px: iPads, Tablets.
    93 769px — 1024px: Small screens, laptops.
    94 1025px — 1200px: Desktops, large screens.
    95 1201px and more — Extra large screens, TV.*/
    96 /*Global*/
    97 #codes_settings > .inside {
    98   padding: 0 !important;
    99   margin-top: 0;
    100 }
    101 
    102 .toric-metabox-inner-container {
    103   display: -webkit-box;
    104   display: -ms-flexbox;
    105   display: flex;
    106   -webkit-box-align: stretch;
    107       -ms-flex-align: stretch;
    108           align-items: stretch;
    109   -webkit-box-shadow: 0 5px 4px -2px rgba(0, 0, 0, 0.15);
    110           box-shadow: 0 5px 4px -2px rgba(0, 0, 0, 0.15);
    111 }
    112 .toric-metabox-inner-container .toric-metabox-nav-tabs {
    113   /*float: left;*/
    114   width: 162px;
    115   margin: 0;
    116   /*list-style-type:none;*/
    117   border-bottom: 1px solid transparent;
    118   background-color: #f0f0f1;
    119 }
    120 .toric-metabox-inner-container .toric-metabox-nav-tabs.tc-collapsed {
    121   max-width: 42px;
    122 }
    123 .toric-metabox-inner-container .toric-metabox-nav-tabs.tc-collapsed > li > a > p .tc_tab_title {
    124   display: none;
    125 }
    126 .toric-metabox-inner-container .toric-metabox-nav-tabs > li {
    127   max-width: 162px;
    128   max-height: calc(0px + 8px * 2 + 20px); /**/
    129   display: -webkit-box;
    130   display: -ms-flexbox;
    131   display: flex;
    132   -webkit-box-align: center;
    133       -ms-flex-align: center;
    134           align-items: center;
    135   /*float: left;*/
    136   margin-bottom: -1px; /*removes gap between li*/
    137   /*overflow: hidden;hide overflow due to -1 margin*/
    138   /*border: $horizontal_tab_border_size solid transparent;
    139   border-color: $horizontal_tab_border_color;*/
    140   /*@element 'div' and  (max-width: $media_xsmall_max_size) {
    141     background-color: aqua !important;
    142   }*/
    143   /*&:hover {
    144     border-color: #95f19a #7ff088 #fc7171;
    145   }*/
    146 }
    147 .toric-metabox-inner-container .toric-metabox-nav-tabs > li > a {
    148   color: #022C25;
    149   /*margin-right: 2px;
    150   line-height: 1.5;
    151   padding: 12px;*/
    152   position: relative;
    153   /*border-radius: 4px 4px 0 0;*/
    154   /*float: left;*/
    155   text-decoration: none;
    156   max-height: calc(0px + 8px * 2 + 20px);
    157   max-width: 100%;
    158   width: 100%;
    159   overflow: hidden;
    160   /*&:hover {
    161     border-color: #95f19a #7ff088 #fc7171;
    162   }*/
    163 }
    164 .toric-metabox-inner-container .toric-metabox-nav-tabs > li > a:hover {
    165   color: #72aee6;
    166 }
    167 .toric-metabox-inner-container .toric-metabox-nav-tabs > li > a:hover::before {
    168   left: 0;
    169   border: solid 4px transparent;
    170   border-left-color: transparent;
    171   content: "";
    172   height: 100%;
    173   width: 0;
    174   position: absolute;
    175   pointer-events: none;
    176   border-right-color: #72aee6;
    177   top: calc(4px * -1);
    178   margin-left: calc(4px * -1);
    179 }
    180 .toric-metabox-inner-container .toric-metabox-nav-tabs > li > a > p {
    181   font-size: 14px;
    182   line-height: 1.3;
    183   padding: 8px;
    184   overflow-wrap: break-word;
    185   word-wrap: break-word;
    186   -ms-word-break: break-all;
    187   word-break: break-word;
    188   -webkit-hyphens: auto;
    189   -ms-hyphens: auto;
    190       hyphens: auto;
    191   margin: 0px;
    192 }
    193 .toric-metabox-inner-container .toric-metabox-nav-tabs > li > a > p .tc_tab_title {
    194   padding-left: 8px;
    195 }
    196 .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a {
    197   color: #fff;
    198   border-color: #c3c4c7 #2271b1 #c3c4c7 #c3c4c7;
    199   background-color: #2271b1;
    200 }
    201 .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a, .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a:hover, .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a:focus {
    202   cursor: default;
    203   /*background-color: #99f575;
    204   border-color: transparent;
    205   border-color: #fc009b transparent #fc7171 #945605;*/
    206   position: relative;
    207 }
    208 .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a:hover::before {
    209   left: 0;
    210   border-right-color: #fff;
    211 }
    212 .toric-metabox-inner-container .toric-metabox-nav-tabs > li.active > a:after {
    213   right: 0;
    214   border: solid 9px transparent;
    215   border-right-color: transparent;
    216   content: " ";
    217   height: 0;
    218   width: 0;
    219   position: absolute;
    220   pointer-events: none;
    221   border-right-color: #fff;
    222   top: 50%;
    223   margin-top: -9px;
    224 }
    225 .toric-metabox-inner-container .toric-metabox-tab-content {
    226   -webkit-box-flex: 1;
    227       -ms-flex-positive: 1;
    228           flex-grow: 1; /*fill the parent div*/
    229   min-height: 334px;
    230   font-size: 13px;
    231   line-height: 1.5;
    232 }
    233 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane {
    234   float: left;
    235   width: 100%;
    236   display: none;
    237   /*background-color: #945605;*/
    238   -webkit-box-flex: 1;
    239       -ms-flex-positive: 1;
    240           flex-grow: 1;
    241   /*border: $horizontal_tab_border_size solid transparent;
    242         border-color:$metabox_tab_pane_tr_border_color;*/
    243 }
    244 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane.active {
    245   display: block;
    246   /*padding: 10px;
    247   background-color: #fff;*/
    248 }
    249 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane > table {
    250   width: 100%;
    251   /*border: solid;*/
    252   border-collapse: collapse;
    253 }
    254 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane > table tr {
    255   border: 1px solid transparent;
    256   border-color: transparent transparent #c3c4c7 transparent;
    257   /*border: solid;*/
    258 }
    259 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane > table tr td {
    260   vertical-align: top;
    261   /*border: solid;*/
    262   padding: 12px;
    263 }
    264 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane > table tr td:nth-child(1) {
    265   /*width: 30%;*/
    266 }
    267 .toric-metabox-inner-container .toric-metabox-tab-content > .toric-metabox-tab-pane > table tr td:nth-child(2) {
    268   /*width: 70%;*/
    269 }
    270 
    271 .tc-hidden {
    272   display: none;
    273 }
    274 
    275 .toric-metabox-nav.toric-metabox-nav-tabs.tc-collapsed > li {
    276   position: relative;
    277 }
    278 
    279 .toric-tooltip {
    280   position: relative;
    281   display: inline-block;
    282 }
    283 
    284 .toric-tooltip .toric-tooltiptext {
    285   visibility: hidden;
    286   min-width: 320px;
    287   background-color: black;
    288   color: #fff;
    289   text-align: center;
    290   border-radius: 6px;
    291   padding: 5px 0;
    292   position: absolute;
    293   z-index: 1;
    294   top: -5px;
    295   left: 110%;
    296   /*Transition*/
    297   opacity: 0;
    298   -webkit-transition: opacity 1s;
    299   transition: opacity 1s;
    300 }
    301 
    302 .toric-tooltip .toric-tooltiptext::after {
    303   content: "";
    304   position: absolute;
    305   top: 50%;
    306   right: 100%;
    307   margin-top: -5px;
    308   border-width: 5px;
    309   border-style: solid;
    310   border-color: transparent black transparent transparent;
    311 }
    312 
    313 .toric-tooltip:hover .toric-tooltiptext {
    314   visibility: visible;
    315   opacity: 1; /*transition*/
    316 }
    317 
    318 .toric.tooltip {
    319   position: relative;
    320   display: inline-block;
    321 }
    322 .toric.tooltip:hover .toric.tooltiptext {
    323   visibility: visible;
    324   opacity: 1;
    325 }
    326 .toric.tooltip .toric.tooltiptext {
    327   visibility: hidden;
    328   width: 140px;
    329   background-color: #555;
    330   color: #fff;
    331   text-align: center;
    332   border-radius: 6px;
    333   padding: 5px;
    334   position: absolute;
    335   z-index: 1;
    336   bottom: 150%;
    337   left: 50%;
    338   margin-left: -75px;
    339   opacity: 0;
    340   -webkit-transition: opacity 0.3s;
    341   transition: opacity 0.3s;
    342 }
    343 .toric.tooltip .toric.tooltiptext::after {
    344   content: "";
    345   position: absolute;
    346   top: 100%;
    347   left: 50%;
    348   margin-left: -5px;
    349   border-width: 5px;
    350   border-style: solid;
    351   border-color: #555 transparent transparent transparent;
    352 }
    353 
    354 /*All of the CSS for admin are here*/
    355 /*.nav-tabs{
    356     float: left;
    357     width: 100%;
    358     margin: 0;
    359     list-style-type: none;
    360     border-bottom: 1px solid #ddd;
    361 }
    362 
    363 .nav-tabs > li{
    364     float: left;
    365     margin-bottom: -1px;
    366 }
    367 
    368 .nav-tabs > li> a{
    369     float: left;
    370     text-decoration: none;
    371     margin-right: 2px;
    372     line-height: 1.5 ;
    373     padding: 10px;
    374     border: 1px solid transparent;
    375     border-radius:4px 4px 0 0;
    376 }
    377 
    378 .nav-tabs > li> a:hover{
    379     border-color: #eee #eee #ddd;
    380 }
    381 
    382 .nav-tabs > li.active> a,
    383 .nav-tabs > li.active> a:hover,
    384 .nav-tabs > li.active> a:focus{
    385     color: #555;
    386     cursor:  default;
    387     background-color: #f5f5f5;
    388     border: 1px solid #ddd;
    389     border-bottom-color: transparent;
    390 
    391 
    392 }
    393 
    394 
    395 
    396 .tab-content .tab-pane{
    397     float: left;
    398     width: 100%;
    399     display: none;
    400 }
    401 
    402 .tab-content > .tab-pane.active{
    403     display: block;
    404     padding: 10px;
    405     background-color: #f5f5f5;
    406     box-shadow: 0 5px 4px -2px rgba(0,0,0,0.15);
    407 }*/
    408 .toric.field.section {
    409   margin: inherit;
    410 }
    411 .toric.field.section.display-none {
    412   display: none;
    413 }/*# sourceMappingURL=toric-admin.css.map */
     1.toric-metabox-nav.toric-metabox-nav-tabs.tc-collapsed>li{position:relative}.toric-tooltip{position:relative;display:inline-block}.toric-tooltip .toric-tooltiptext{visibility:hidden;min-width:320px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;top:-5px;left:110%;opacity:0;-webkit-transition:opacity 1s;transition:opacity 1s}.toric-tooltip .toric-tooltiptext::after{content:"";position:absolute;top:50%;right:100%;margin-top:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) #000 rgba(0,0,0,0) rgba(0,0,0,0)}.toric-tooltip:hover .toric-tooltiptext{visibility:visible;opacity:1}.toric.tooltip{position:relative;display:inline-block}.toric.tooltip:hover .toric.tooltiptext{visibility:visible;opacity:1}.toric.tooltip .toric.tooltiptext{visibility:hidden;width:140px;background-color:#555;color:#fff;text-align:center;border-radius:6px;padding:5px;position:absolute;z-index:1;bottom:150%;left:50%;margin-left:-75px;opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.toric.tooltip .toric.tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.toric .spinner-container{color:#8ed1fc;text-align:center;width:100px}.toric #spinner-preloader{display:inline-block;width:50px;height:50px;border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#2ebffd;color:#8ed1fc;animation:spin 1s ease-in-out infinite;-webkit-animation:spin 1s ease-in-out infinite}@keyframes spin{to{-webkit-transform:rotate(360deg)}}@-webkit-keyframes spin{to{-webkit-transform:rotate(360deg)}}.toric.field.section{margin:inherit}.toric.field.section.display-none{display:none}/*# sourceMappingURL=toric-admin.css.map */
  • toric/trunk/admin/css/toric-admin.css.map

    r2850549 r2852518  
    1 {"version":3,"sources":["toric-admin.css","modules/tabs.scss","modules/checkboxes.scss","modules/metaboxes.scss","modules/tooltip.scss","modules/shortcode.scss","toric-admin.scss"],"names":[],"mappings":"AAAA,gBAAgB;ACAhB;EACC,WAAA;EACA,WAAA;EACA,SAAA;EACA,qBAAA;EACA,oCAAA;ADED;ACAC;EACC,WAAA;EACA,mBAAA;ADEF;ACAE;EACC,iBAAA;EACA,gBAAA;EACA,aAAA;EACA,6BAAA;EACA,0BAAA;EACA,WAAA;EACA,qBAAA;ADEH;ACAG;EACC,4BAAA;ADEJ;ACGG;EAGC,WAAA;EACA,eAAA;EACA,sBAAA;EACA,yBAAA;ADHJ;;ACSA;EACC,WAAA;EACA,WAAA;EACA,aAAA;ADND;ACQC;EACC,cAAA;EACA,aAAA;EACA,sBAAA;EACA,sDAAA;UAAA,8CAAA;ADNF;;AE+BA;EAjDC,SAAA;EACA,UAAA;AFsBD;AEpBC;EACC,aAAA;AFsBF;AEpBE;EACC,qBA5BE;EA6BF,mBA7BE;EA+BO,4CAAA;UAAA,oCAAA;AFqBZ;AEnBG;EACC,iBAqCgB;AFhBpB;AEhBC;EACC,kCAAA;EAAA,0BAAA;EACA,qBAAA;EACA,kBAAA;EA9BD,2BAgCqB;EA/Br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;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;EACA,uDAAA;AJ2PJ;;AIzPE;EACE,mBAAA;EACA,UAAA,EAAA,aAAA;AJ4PJ;;AKvSE;EACI,kBAAA;EACA,qBAAA;AL0SN;AKxSM;EACE,mBAAA;EACA,UAAA;AL0SR;AKvSM;EACI,kBAAA;EACA,YAAA;EACA,sBAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,YAAA;EACA,kBAAA;EACA,UAAA;EACA,YAAA;EACA,SAAA;EACA,kBAAA;EACA,UAAA;EACA,gCAAA;EAAA,wBAAA;ALySV;AKxSU;EACE,WAAA;EACA,kBAAA;EACA,SAAA;EACA,SAAA;EACA,iBAAA;EACA,iBAAA;EACA,mBAAA;EACA,sDAAA;AL0SZ;;AM3UA,oCAAA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AA6DA;EACI,eAAA;ANqUJ;AMpUC;EACG,aAAA;ANsUJ","file":"toric-admin.css"}
     1{"version":3,"sources":["modules/tooltip.scss","modules/shortcode.scss","modules/spinner-preloader.scss","toric-admin.scss"],"names":[],"mappings":"AAII,0DACI,iBAAA,CAIR,eACI,iBAAA,CACA,oBAAA,CAIF,kCACE,iBAAA,CACA,eAAA,CACA,qBAAA,CACA,UAAA,CACA,iBAAA,CACA,iBAAA,CACA,aAAA,CACA,iBAAA,CACA,SAAA,CACA,QAAA,CACA,SAAA,CAEA,SAAA,CACA,6BAAA,CAAA,qBAAA,CAGF,yCACE,UAAA,CACA,iBAAA,CACA,OAAA,CACA,UAAA,CACA,eAAA,CACA,gBAAA,CACA,kBAAA,CACA,2DAAA,CAEF,wCACE,kBAAA,CACA,SAAA,CC3CF,eACI,iBAAA,CACA,oBAAA,CAEA,wCACE,kBAAA,CACA,SAAA,CAGF,kCACI,iBAAA,CACA,WAAA,CACA,qBAAA,CACA,UAAA,CACA,iBAAA,CACA,iBAAA,CACA,WAAA,CACA,iBAAA,CACA,SAAA,CACA,WAAA,CACA,QAAA,CACA,iBAAA,CACA,SAAA,CACA,8BAAA,CAAA,sBAAA,CACA,yCACE,UAAA,CACA,iBAAA,CACA,QAAA,CACA,QAAA,CACA,gBAAA,CACA,gBAAA,CACA,kBAAA,CACA,2DAAA,CChCV,0BACE,aAAA,CACA,iBAAA,CACA,WAAA,CAEF,0BACE,oBAAA,CACA,UAAA,CACA,WAAA,CACA,qCAAA,CACA,iBAAA,CACA,wBAAA,CACA,aAAA,CACA,sCAAA,CACA,8CAAA,CAGF,gBACE,GAAA,gCAAA,CAAA,CAEF,wBACE,GAAA,gCAAA,CAAA,CCZJ,qBACI,cAAA,CACH,kCACG,YAAA","file":"toric-admin.css"}
  • toric/trunk/admin/css/toric-admin.scss

    r2850549 r2852518  
    1 /*All of the CSS for admin are here*/
    2 
    3 /*.nav-tabs{
    4     float: left;
    5     width: 100%;
    6     margin: 0;
    7     list-style-type: none;
    8     border-bottom: 1px solid #ddd;
    9 }
    10 
    11 .nav-tabs > li{
    12     float: left;
    13     margin-bottom: -1px;
    14 }
    15 
    16 .nav-tabs > li> a{
    17     float: left;
    18     text-decoration: none;
    19     margin-right: 2px;
    20     line-height: 1.5 ;
    21     padding: 10px;
    22     border: 1px solid transparent;
    23     border-radius:4px 4px 0 0;
    24 }
    25 
    26 .nav-tabs > li> a:hover{
    27     border-color: #eee #eee #ddd;
    28 }
    29 
    30 .nav-tabs > li.active> a,
    31 .nav-tabs > li.active> a:hover,
    32 .nav-tabs > li.active> a:focus{
    33     color: #555;
    34     cursor:  default;
    35     background-color: #f5f5f5;
    36     border: 1px solid #ddd;
    37     border-bottom-color: transparent;
    38    
    39 
    40 }
    411
    422
    43 
    44 .tab-content .tab-pane{
    45     float: left;
    46     width: 100%;
    47     display: none;
    48 }
    49 
    50 .tab-content > .tab-pane.active{
    51     display: block;
    52     padding: 10px;
    53     background-color: #f5f5f5;
    54     box-shadow: 0 5px 4px -2px rgba(0,0,0,0.15);
    55 }*/
    56 
    57 @use 'modules/tabs';
    58 @use 'modules/checkboxes';
    59 @use 'modules/metaboxes';
     3//@use 'modules/tabs';
     4//@use 'modules/checkboxes';
     5//@use 'modules/metaboxes';
    606@use 'modules/tooltip.scss';
    617@use 'modules/shortcode.scss';
     8@use 'modules/spinner-preloader.scss';
    629
    6310
  • toric/trunk/admin/fields/class-toric-text-field.php

    r2850549 r2852518  
    123123            <?php echo esc_attr( $this->description ); ?>
    124124        </label>
    125         <input class="<?php echo esc_attr( $class ); ?>" type="text" id="<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>"   placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo esc_attr( $this->get_database_value( $post->ID ) ); ?>">
     125        <input class="<?php echo esc_attr( $class ); ?>" type="text" id="<?php echo esc_attr( $field_id ); ?>" name="<?php echo esc_attr( $field_id ); ?>"   placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo esc_attr( $this->get_database_value( $post->ID ) ); ?>" oninput="toricContentOnInput(this.value)">
    126126        </div>
    127127        <?php
  • toric/trunk/admin/js/toric-admin.js

    r2850549 r2852518  
    3535
    3636window.addEventListener("load" ,function(){
    37     settingsTabs();
    38     settingsMetaboxTabs();
    39     registerNavTabEvents();
    40     responsiveNavTab(null);//make the nav tab responsive on load
    41    
     37    //toricLivePreview();
    4238});
    4339
    44 function settingsTabs(){
    45     var tabs=document.querySelectorAll("ul.nav-tabs > li");
    46     for(var i=0;i<tabs.length;i++){
    47         tabs[i].addEventListener("click",switchTab);
    48     }
    49 }
    50 /**
    51 * Switches the setting tabs
    52 * @summary
    53 * @param {event} event -  click event
    54 */
    55 function switchTab (event) {
    56    
    57     event.preventDefault();//makes sure #id is not added on url
    58     //console.log(event);
    59     document.querySelector("ul.nav-tabs li.active").classList.remove("active");//removes class active from tab heading
    60     document.querySelector(".tab-pane.active").classList.remove("active");//removes class active from tab pane
    61 
    62     var clicked_tab=event.currentTarget;
    63     //
    64     clicked_tab.classList.add("active");//add class active to tab heading
    65 
    66     var anchor =event.target;
    67     console.log(anchor);
    68     var active_pane_id=anchor.getAttribute("href");
    69     console.log(active_pane_id);
    70     document.querySelector(active_pane_id).classList.add("active");//adds class active to tab pane
    71    
     40function showSpinnerPreloader(){
     41    var toric_preview_div=document.getElementById("toric-preview-meta-box-preview");
     42    toric_preview_div.innerHTML='<div class="toric spinner-container"><div id="spinner-preloader"></div></div>';
    7243}
    7344
    74 //Metabox script
    75 function settingsMetaboxTabs(){
    76     var tabs=document.querySelectorAll("ul.toric-metabox-nav-tabs > li");
    77     for(var i=0;i<tabs.length;i++){
    78         tabs[i].addEventListener("click",switchMetaboxTab);
    79 
    80         //responsive
    81         tabs[i].addEventListener('resize', responsiveNavTab);
    82        
    83     }
     45function toricContentOnInput(value){
     46    showSpinnerPreloader();
     47    toric_ajax(value);// call the function.
    8448}
    8549
    8650
    87 function switchMetaboxTab (event) {
    88    
    89     event.preventDefault();//makes sure #id is not added on url
    90     //console.log(event);
    91     //try{
    92         //alert('hey');
    93         document.querySelector("ul.toric-metabox-nav-tabs li.active").classList.remove("active");//removes class active from tab heading
    94         document.querySelector(".toric-metabox-tab-pane.active").classList.remove("active");//removes class active from tab pane
    95 
    96         var clicked_tab=event.currentTarget;/*gets clicked li element*/
    97        
    98         clicked_tab.classList.add("active");//add class active to tab heading
    99        
    100 
    101 
    102 
    103         var anchor =clicked_tab.children[0];/*gets a tag*/
    104         console.log(anchor);
    105         var active_pane_id=anchor.getAttribute("href");
    106         //console.log(active_pane_id);
    107         document.querySelector(active_pane_id).classList.add("active");//adds class active to tab pane
    108     //}catch(err){
    109         //alert(err);
    110     //}
    111 }
    112 
    113 
    114 function registerNavTabEvents(){
    115     window.addEventListener('resize', responsiveNavTab);
    116 }
    117 
    118 function responsiveNavTab(event){
    119     /*var desired_width=150;//desired width of the horizontal tab
    120     var tabs_section=document.querySelectorAll("ul.toric-metabox-nav-tabs");
    121     for(var i=0;i<tabs_section.length;i++){//for each url
    122         var newWidth = tabs_section[i].offsetWidth;
    123         if(newWidth<desired_width){
    124             tabs_section[i].classList.add('tc-collapsed');
    125            
    126         }else{
    127             tabs_section[i].classList.remove('tc-collapsed');
    128         }
    129        
    130     }*/
    131 
    132    
    133     var desired_width=400;//desired width of the horizontal tab
    134     var tab_contents=document.querySelectorAll(".toric-metabox-tab-content");
    135     for(var i=0;i<tab_contents.length;i++){//for each url
    136         var newWidth = tab_contents[i].offsetWidth;
    137         var ul=tab_contents[i].previousSibling.previousSibling;
    138         if(newWidth<desired_width){//less space for div
    139            
    140             ul.classList.add('tc-collapsed');
    141             //.classList.add('tc-collapsed');
    142            
    143         }else{
    144             if(desired_width+120<newWidth){
    145                 ul.classList.remove('tc-collapsed');
    146             }
    147            
    148         }
    149        
     51/*function toricLivePreview(){
     52    var toric_content_input=document.getElementById("toric-content-meta-box-content");
     53    if(null !== toric_content_input){
     54        toric_content_input.onchange=toricContentOnchange;
    15055    }
    151    
    152 }
    153 
    154 
    155 
    156  
     56}*/
  • toric/trunk/admin/views/class-toric-preview.php

    r2850549 r2852518  
    133133     */
    134134    public function render( WP_Post $post, Toric_Meta_Box $meta_box ) {
    135         echo '<div class="toric ' . esc_attr( $this->id ) . '">';
     135        echo '<div class="toric ' . esc_attr( $this->id ) . '" id="' . esc_attr( $this->id ) . '" >';
    136136        $value = $this->get_database_value_by_meta_key( $post->ID, 'toric-content-meta-box-content' );
    137137        if ( $value ) {
  • toric/trunk/includes/class-toric.php

    r2850549 r2852518  
    112112
    113113    /**
     114     * The WordPress major and minor version stored as int or float.
     115     *
     116     * @since    1.0.1
     117     * @access   protected
     118     * @var      string    $wp_version_value    Format: major.minor.
     119     */
     120    protected $wp_version_value;
     121
     122    /**
    114123     * Define the core functionality of the plugin.
    115124     *
     
    124133            $this->version = TORIC_VERSION;
    125134        } else {
    126             $this->version = '1.0.0';
     135            $this->version = '1.0.1';
    127136        }
    128137        $this->plugin_name = 'toric';
     
    130139        $this->set_settings();
    131140        $this->plugin_base_dir = plugin_dir_path( __DIR__ );
     141        $this->set_wp_version_value();
    132142
    133143        $this->load_dependencies();
     
    250260        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/codes/class-toric-codes.php';
    251261
     262        /**
     263         * The class responsible for creating the AJAX
     264         */
     265        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/ajax/class-toric-ajax.php';
     266
    252267        if ( ! class_exists( '\Com\Tecnick\Barcode\Barcode' ) ) {
    253268            spl_autoload_register( array( $this, 'third_party_lib_auto_loader' ) );
     
    442457    }
    443458
     459    function get_allowed_svg_html(){
     460        return array(
     461            'svg'  => array(
     462                'xmlns'   => true,
     463                'width'   => true,
     464                'height'  => true,
     465                'viewbox' => true,
     466                'version' => true,
     467            ),
     468            'desc' => true,
     469            'rect' => array(
     470                'x'              => true,
     471                'y'              => true,
     472                'width'          => true,
     473                'height'         => true,
     474                'fill'           => true,
     475                'stroke'         => true,
     476                'stroke-width'   => true,
     477                'stroke-linecap' => true,
     478            ),
     479            'g'    => array(
     480                'id'             => true,
     481                'fill'           => true,
     482                'stroke'         => true,
     483                'stroke-width'   => true,
     484                'stroke-linecap' => true,
     485            ),
     486        );
     487    }
     488
     489    function get_allowed_ajax_html(){
     490        return $this->get_allowed_svg_html();
     491    }
     492
     493    /**
     494     * Set $wp_version_value value for use when checking WordPress versions.
     495     *
     496     * @since    1.0.1
     497     * @access   private
     498     */
     499    private function set_wp_version_value() {
     500        $wp_version_array       = explode( '.', get_bloginfo( 'version' ) );
     501        $wp_version_array_count = count( $wp_version_array );
     502        for ( $i = 0;$i < $wp_version_array_count;$i++ ) {
     503            if ( 0 === $i ) {
     504                $this->wp_version_value = (int) $wp_version_array[ $i ];
     505            } elseif ( 1 === $i ) {
     506                $this->wp_version_value += ( (int) $wp_version_array[ $i ] ) * 0.1;
     507                break;
     508            }
     509        }
     510    }
     511
     512    /**
     513     * Retrieve the WordPress major and minor version value.
     514     *
     515     * @since     1.0.1
     516     * @return    float|int   The WordPress major and minor version value.
     517     */
     518    public function get_wp_version_value() {
     519        return $this->wp_version_value;
     520    }
     521
    444522}
  • toric/trunk/toric.php

    r2850549 r2852518  
    3535 * Rename this for your plugin and update it as you release new versions.
    3636 */
    37 define( 'TORIC_VERSION', '1.0.0' );
     37define( 'TORIC_VERSION', '1.0.1' );
    3838
    3939/**
Note: See TracChangeset for help on using the changeset viewer.