TemplatesNext ToolKit - Version 2.0.6

Version Description

Download this release

Release Info

Developer marsian
Plugin Icon 128x128 TemplatesNext ToolKit
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

css/images/homepage-banner-bg.png ADDED
Binary file
css/images/homepage-banner-bg2.png ADDED
Binary file
css/images/homepage-banner-bg3.png ADDED
Binary file
css/images/vig-24.png ADDED
Binary file
css/images/vig-32.png ADDED
Binary file
css/tx-admin-style.css CHANGED
@@ -126,7 +126,9 @@ ul.tx-fa-icons > li.active {
126
 
127
  .txx-sh-form,
128
  #tx-column-form,
 
129
  #tx-devider-form,
 
130
  #tx-testimonial-form,
131
  #tx-button-form,
132
  #tx-calltoact-form,
@@ -188,4 +190,25 @@ ul.tx-fa-icons > li.active {
188
  position: absolute;
189
  bottom: 0px;
190
  left: 0px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
126
 
127
  .txx-sh-form,
128
  #tx-column-form,
129
+ #tx-vslider-form,
130
  #tx-devider-form,
131
+ #tx-youtube-form,
132
  #tx-testimonial-form,
133
  #tx-button-form,
134
  #tx-calltoact-form,
190
  position: absolute;
191
  bottom: 0px;
192
  left: 0px;
193
+ }
194
+
195
+ .updated > a {
196
+ display: inline-block;
197
+ text-decoration: none;
198
+ font-size: 20px;
199
+ line-height: 24px;
200
+ width: 24px;
201
+ text-align: center;
202
+ color: #000;
203
+ background-color: #eee;
204
+ }
205
+ .updated > a:hover {
206
+ background-color: #000;
207
+ color: #FFF;
208
+ }
209
+
210
+
211
+ .updated > p {
212
+ display: inline-block;
213
+ line-height: 24px;
214
  }
css/tx-style.css CHANGED
@@ -1711,3 +1711,181 @@ span.tx-animate {
1711
  }
1712
  }
1713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1711
  }
1712
  }
1713
 
1714
+ .tx-vslider{
1715
+ position: relative;
1716
+ display: block;
1717
+ overflow: hidden;
1718
+ }
1719
+
1720
+ .tx-imagebg {
1721
+ display: block;
1722
+ position: absolute;
1723
+ left: 0px;
1724
+ top: 0px;
1725
+ height: 100%;
1726
+ width: 100%;
1727
+ z-index: 2;
1728
+ }
1729
+
1730
+ .tx-video-background {
1731
+ position: absolute;
1732
+ top: 0;
1733
+ right: 0;
1734
+ bottom: 0;
1735
+ left: 0;
1736
+ z-index: 3;
1737
+ }
1738
+ .tx-video-foreground,
1739
+ .tx-video-background iframe,
1740
+ .tx-video-background .tx-video-player {
1741
+ position: absolute;
1742
+ top: 0;
1743
+ left: 0;
1744
+ width: 100%;
1745
+ height: 100%;
1746
+ pointer-events: none;
1747
+ }
1748
+
1749
+ .tx-vslider-content {
1750
+ position: absolute;
1751
+ display: block;
1752
+ z-index: 4;
1753
+ top: 0px;
1754
+ left: 0px;
1755
+ height: 100%;
1756
+ width: 100%;
1757
+ color: #FFF;
1758
+
1759
+ -webkit-transform-style: preserve-3d;
1760
+ -moz-transform-style: preserve-3d;
1761
+ transform-style: preserve-3d;
1762
+ }
1763
+
1764
+ .tx-vslider-content.vignette {
1765
+ background-image: url(images/vig-32.png);
1766
+ background-repeat: no-repeat;
1767
+ background-position: 0px 0px;
1768
+ background-size: cover;
1769
+ }
1770
+
1771
+ .tx-vslider-content.pixel {
1772
+ background-image: url(images/homepage-banner-bg3.png);
1773
+ background-repeat: repeat;
1774
+ }
1775
+
1776
+ .tx-vslider-content .content-wrap {
1777
+ position: relative;
1778
+ top: 50%;
1779
+ transform: perspective(1px) translateY(-50%);
1780
+ max-height: 100%;
1781
+ max-width: 1200px;
1782
+ margin-left: auto;
1783
+ margin-right: auto;
1784
+ overflow: hidden;
1785
+ }
1786
+
1787
+ .vslider-img {
1788
+ display: block;
1789
+ margin: auto;
1790
+ max-height: 20%;
1791
+ max-width: 400px;
1792
+ }
1793
+
1794
+ .tx-vslider-content .content-wrap h2 {
1795
+ font-size: 64px;
1796
+ line-height: 64px;
1797
+ margin-bottom: 16px;
1798
+
1799
+ max-width: 900px;
1800
+ padding-left: 32px;
1801
+ padding-right: 32px;
1802
+ display: block;
1803
+ margin-left: auto;
1804
+ margin-right: auto;
1805
+ }
1806
+
1807
+ .tx-vslider-content .content-wrap p {
1808
+ font-size: 15px;
1809
+
1810
+ max-width: 900px;
1811
+ padding-left: 32px;
1812
+ padding-right: 32px;
1813
+ display: block;
1814
+ margin-left: auto;
1815
+ margin-right: auto;
1816
+ }
1817
+
1818
+ .vslider_button {
1819
+ display: inline-block;
1820
+ height: 48px;
1821
+ line-height: 48px;
1822
+ padding: 0px 48px;
1823
+ color: #FFF;
1824
+ text-transform: uppercase;
1825
+ }
1826
+
1827
+ .tx-youtube-warp {
1828
+ position: relative;
1829
+ padding-bottom: 56.25%; /* 16:9 */
1830
+ height: 0;
1831
+ }
1832
+ .tx-youtube-warp iframe {
1833
+ position: absolute;
1834
+ top: 0;
1835
+ left: 0;
1836
+ width: 100%;
1837
+ height: 100%;
1838
+ }
1839
+
1840
+ @media (min-aspect-ratio: 16/9) {
1841
+ .tx-video-foreground { height: 300%; top: -100%; }
1842
+ }
1843
+ @media (max-aspect-ratio: 16/9) {
1844
+ .tx-video-foreground { width: 300%; left: -100%; }
1845
+ }
1846
+
1847
+ @media (max-width: 768px) {
1848
+ .vslider-img {
1849
+ max-height: 20%;
1850
+ max-width: 300px;
1851
+ }
1852
+
1853
+ .tx-vslider-content .content-wrap h2 {
1854
+ font-size: 48px;
1855
+ line-height: 48px;
1856
+ margin-bottom: 16px;
1857
+ }
1858
+
1859
+ .tx-vslider-content .content-wrap p {
1860
+ font-size: 14px;
1861
+ }
1862
+
1863
+ .vslider_button {
1864
+ height: 36px;
1865
+ line-height: 36px;
1866
+ padding: 0px 36px;
1867
+ }
1868
+ }
1869
+
1870
+ @media (max-width: 480px) {
1871
+ .vslider-img {
1872
+ max-height: 20%;
1873
+ max-width: 100px;
1874
+ }
1875
+
1876
+ .tx-vslider-content .content-wrap h2 {
1877
+ font-size: 24px;
1878
+ line-height: 24px;
1879
+ margin-bottom: 8px;
1880
+ }
1881
+
1882
+ .tx-vslider-content .content-wrap p {
1883
+ font-size: 13px;
1884
+ }
1885
+
1886
+ .vslider_button {
1887
+ height: 32px;
1888
+ line-height: 32px;
1889
+ padding: 0px 32px;
1890
+ }
1891
+ }
js/tx-script.js CHANGED
@@ -281,6 +281,25 @@ jQuery(document).ready(function ($) {
281
  }
282
  });
283
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
 
285
 
286
  });
281
  }
282
  });
283
  });
284
+
285
+
286
+ if ( $('.tx-vslider').length > 0 )
287
+ {
288
+ var header_height = $('.tx-vslider').data('vslider-height');
289
+ var header_reduct = $('.tx-vslider').data('vslider-reduct');
290
+
291
+ var winheight = $( window ).height();
292
+ var winwidth = $( window ).width();
293
+
294
+ if( winwidth > 1200 )
295
+ {
296
+ $('.tx-vslider').css( "height", ((winheight-header_reduct)/100)*header_height );
297
+ } else
298
+ {
299
+ $('.tx-vslider').css( "height", winheight/2);
300
+ }
301
+
302
+ }
303
 
304
 
305
  });
js/tx_main.js CHANGED
@@ -588,15 +588,8 @@ function tx_slider_cat(){
588
  return tx_slider_cat_list;
589
  }
590
 
591
- /*
592
- //Insert tx shortcode media button
593
- window.addEventListener("load", function(){
594
- document.getElementById("insert-tx-button").onclick = function(){
595
- var $form = jQuery("#txshortcodes-form");
596
- jQuery.colorbox({inline:true, href:"#tx-shortcode-form"});
597
- }
598
- });
599
- */
600
 
601
 
602
 
588
  return tx_slider_cat_list;
589
  }
590
 
591
+
592
+
 
 
 
 
 
 
 
593
 
594
 
595
 
readme.txt CHANGED
@@ -4,17 +4,20 @@ Contributors: marsian
4
  Tags: shortcode, shortcodes, columns, column, section, sections, portfolio, testimonial, border, borders, button, buttons, masonry, posts, post_type, font awesome, icons, fontawesome
5
  Requires at least: 3.6
6
  Tested up to: 4.7
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Custom Portfolio, Testimonial, Slider, Team and many other Shortcode functionalites...
 
12
 
13
  == Description ==
14
 
15
- Custom Portfolio, Testimonial, Slider, Team and Shortcode functionality for TemplatesNext Wordpress Themes.
 
 
16
 
17
- Demo and documentation : http://www.templatesnext.org/icreate/?page_id=541
18
 
19
  https://www.youtube.com/watch?v=vqTHQCN2ci4
20
 
@@ -26,6 +29,10 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
26
 
27
 
28
  == Changelog ==
 
 
 
 
29
  = 2.0.3 =
30
  * Comitability issue with PHP7 fixed
31
 
4
  Tags: shortcode, shortcodes, columns, column, section, sections, portfolio, testimonial, border, borders, button, buttons, masonry, posts, post_type, font awesome, icons, fontawesome
5
  Requires at least: 3.6
6
  Tested up to: 4.7
7
+ Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ This plugin adds portfolio, team/members, itrans slider, testimonials post type along with shortcodes for
12
+ Portfolio, Testimonials, Image Sliders, Team, Fullscreen Video slider, Youtube video and many other Shortcode functionalites...
13
 
14
  == Description ==
15
 
16
+ Custom Portfolios, Testimonial, Sliders, Team and Shortcode functionalities like Rows and columns, Deviders,
17
+ Spacers, Buttons, Call To Act, Services, Headings, Fullscreen Video Sliders, YouTube video, WooCommerce Product Carousels,
18
+ Animations, Fancy Blocks, etc, for TemplatesNext Wordpress Themes.
19
 
20
+ Demo and documentation : [http://www.templatesnext.org/icreate/?page_id=541](http://www.templatesnext.org/icreate/?page_id=541)
21
 
22
  https://www.youtube.com/watch?v=vqTHQCN2ci4
23
 
29
 
30
 
31
  == Changelog ==
32
+ = 2.0.5 =
33
+ * Added Youtube Video shortcode
34
+ * Added Fullscreen Video/Image slider
35
+
36
  = 2.0.3 =
37
  * Comitability issue with PHP7 fixed
38
 
shortcodes.php CHANGED
@@ -13,8 +13,8 @@ function tx_shortcodes_button() {
13
  }
14
 
15
  }
16
- //add_action('init', 'tx_shortcodes_button');
17
- add_action('admin_head', 'tx_shortcodes_button');
18
 
19
  function tx_add_plugin( $plugin_array ) {
20
  $plugin_array['txshortcodes'] = plugin_dir_url( __FILE__ ) . 'tx-shortcodes.js';
@@ -189,7 +189,7 @@ function tx_row_function($atts, $content = null) {
189
 
190
  $return_string ='';
191
 
192
- $return_string .= '<div class="tx-row">';
193
  $return_string .= do_shortcode($content);
194
  $return_string .= '</div>';
195
 
@@ -899,6 +899,135 @@ function tx_fancyblock_function($atts, $content = null) {
899
  endif;
900
 
901
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
902
  function tx_register_shortcodes(){
903
  add_shortcode('tx_recentposts', 'tx_recentposts_function');
904
  add_shortcode('tx_row', 'tx_row_function');
@@ -917,7 +1046,9 @@ function tx_register_shortcodes(){
917
 
918
  add_shortcode('tx_team', 'tx_team_function');
919
  add_shortcode('tx_animate', 'tx_animate_function');
920
- add_shortcode('tx_fancyblock', 'tx_fancyblock_function');
 
 
921
  }
922
 
923
  add_action( 'init', 'tx_register_shortcodes');
13
  }
14
 
15
  }
16
+ add_action('init', 'tx_shortcodes_button');
17
+ //add_action('admin_head', 'tx_shortcodes_button');
18
 
19
  function tx_add_plugin( $plugin_array ) {
20
  $plugin_array['txshortcodes'] = plugin_dir_url( __FILE__ ) . 'tx-shortcodes.js';
189
 
190
  $return_string ='';
191
 
192
+ $return_string .= '<div class="tx-row '.$atts['class'].'">';
193
  $return_string .= do_shortcode($content);
194
  $return_string .= '</div>';
195
 
899
  endif;
900
 
901
 
902
+ // Video/hero Slider
903
+ if ( !function_exists('tx_vslider_function') ) :
904
+
905
+ function tx_vslider_function($atts, $content = null) {
906
+
907
+ //[tx_vslider height="72" vurl="http://youtube.com/videourl" bgcolor="#dd3333" overlay="0.5" bgurl="http://localhost/i-max/wp-content/uploads/2016/07/Surface-Magenta-Touch-Cover.png" attachment="fixed" bgsize="cover" imgurl="http://localhost/i-max/wp-content/uploads/2015/01/i-create-logo.png" title="Slide Title" linktext="Link Text" linkurl="http://www.google.com/"]Slide Content Here[/tx_vslider]
908
+
909
+ $atts = shortcode_atts(array(
910
+ 'height' => '72',
911
+ 'reduct' => 0,
912
+ 'vurl' => '',
913
+ 'bgcolor' => '#dd3333',
914
+ 'overlay' => '',
915
+ 'bgurl' => '',
916
+ 'attachment' => 'fixed',
917
+ 'bgsize' => 'cover',
918
+ 'imgurl' => '',
919
+ 'title' => 'Slide Title',
920
+ 'linktext' => 'Link Text',
921
+ 'linkurl' => 'http://www.templatesnext.org/',
922
+
923
+ ), $atts);
924
+
925
+ $slider_text = do_shortcode($content);
926
+ $video_id = "";
927
+ $img_css = "";
928
+ $bg_image = esc_url($atts['bgurl']);
929
+ $attachment = esc_attr($atts['attachment']);
930
+ $bgsize = esc_attr($atts['bgsize']);
931
+ $logoimage = esc_url($atts['imgurl']);
932
+ $overlay = esc_attr($atts['overlay']);
933
+ $reduct = esc_attr($atts['reduct']);
934
+
935
+
936
+ if ( strpos( $atts['vurl'], 'youtu' ) !== false )
937
+ {
938
+ $video_id = ( preg_match( '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $atts['vurl'], $match ) ) ? $match[1] : false;
939
+ }
940
+
941
+ $img_css .= ' background-image: url('.$bg_image.');';
942
+ $img_css .= ' background-position: center center;';
943
+ $img_css .= ' background-repeat: no-repeat;';
944
+ $img_css .= ' background-attachment: ' . $attachment . ';';
945
+ $img_css .= ' background-size: '.$bgsize.';';
946
+
947
+ $return_string ='';
948
+ $return_string .= '<div class="tx-vslider" data-vslider-height="'.$atts['height'].'" data-vslider-reduct="'.$reduct.'" >';
949
+ $return_string .= '<div class="tx-imagebg" style="'.$img_css.'"></div>';
950
+ $return_string .= '<div class="tx-video-background">';
951
+
952
+ $return_string .= '<div class="tx-vslider-content '.$overlay.'">';
953
+ $return_string .= '<div class="content-wrap" style="text-align: center;">';
954
+
955
+ if( !empty($logoimage) ){
956
+ $return_string .= '<img class="vslider-img" src="'.$logoimage.'" alt="" />';
957
+ }
958
+
959
+ $return_string .= '<h2 class="vslider-title">'.esc_attr($atts['title']).'</h2>';
960
+
961
+ if( !empty($slider_text) ){
962
+ $return_string .= '<p class="vslider-content">'.esc_attr($slider_text).'</p>';
963
+ }
964
+
965
+ if( !empty($atts['linkurl']) && !empty($atts['linktext']) ){
966
+ $return_string .= '<button class="vslider_button button" href="'.esc_attr($atts['linkurl']).'">'.esc_attr($atts['linktext']).'</button>';
967
+ }
968
+
969
+ $return_string .= '<div class="clear"></div>';
970
+ $return_string .= '</div>';
971
+ $return_string .= '</div>';
972
+ if( !empty($video_id) && !wp_is_mobile() ){
973
+ $return_string .= '<div class="tx-video-foreground">';
974
+ $return_string .= '<iframe src="https://www.youtube.com/embed/'.$video_id.'?controls=0&amp;showinfo=0&amp;rel=0&amp;autoplay=1&amp;loop=1&amp;playlist='.$video_id.'" frameborder="0" allowfullscreen></iframe>';
975
+ $return_string .= '</div>';
976
+ }
977
+ $return_string .= '</div>';
978
+ $return_string .= '</div> <!-- tx-tx-vslider" -->';
979
+
980
+
981
+ return $return_string;
982
+ }
983
+
984
+ endif;
985
+
986
+
987
+ // YouTube Video [tx_youtube youtube_url="https://www.youtube.com/watch?v=KJ9NNiDlic8" width="600" controls="1" autoplay="1"]
988
+ if ( !function_exists('tx_youtube_function') ) :
989
+
990
+ function tx_youtube_function($atts) {
991
+
992
+ $atts = shortcode_atts(array(
993
+ 'youtube_url' => '',
994
+ 'width' => '',
995
+ 'controls' => 1,
996
+ 'autoplay' => 0,
997
+ ), $atts);
998
+
999
+ $youtube_url = esc_url($atts['youtube_url']);
1000
+ $controls = esc_attr($atts['controls']);
1001
+ $autoplay = esc_attr($atts['autoplay']);
1002
+ $width = esc_attr($atts['width']);
1003
+
1004
+ if( $width != "" )
1005
+ {
1006
+ $width = $width."px";
1007
+ } else
1008
+ {
1009
+ $width = "100%";
1010
+ }
1011
+
1012
+ if ( strpos( $youtube_url, 'youtu' ) !== false )
1013
+ {
1014
+ $video_id = ( preg_match( '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $youtube_url, $match ) ) ? $match[1] : false;
1015
+ }
1016
+
1017
+ $return_string ='';
1018
+
1019
+ $return_string .= '<div class="tx-youtube-outerwarp" style="width: '.$width.'">';
1020
+ $return_string .= '<div class="tx-youtube-warp" style="">';
1021
+ $return_string .= '<iframe src="https://www.youtube.com/embed/'.$video_id.'?controls='.$controls.'&amp;showinfo=0&amp;rel=0&amp;autoplay='.$autoplay.'" frameborder="0" allowfullscreen></iframe>';
1022
+ $return_string .= '</div></div>';
1023
+
1024
+ return $return_string;
1025
+ }
1026
+
1027
+ endif;
1028
+
1029
+
1030
+
1031
  function tx_register_shortcodes(){
1032
  add_shortcode('tx_recentposts', 'tx_recentposts_function');
1033
  add_shortcode('tx_row', 'tx_row_function');
1046
 
1047
  add_shortcode('tx_team', 'tx_team_function');
1048
  add_shortcode('tx_animate', 'tx_animate_function');
1049
+ add_shortcode('tx_fancyblock', 'tx_fancyblock_function');
1050
+ add_shortcode('tx_vslider', 'tx_vslider_function');
1051
+ add_shortcode('tx_youtube', 'tx_youtube_function');
1052
  }
1053
 
1054
  add_action( 'init', 'tx_register_shortcodes');
tx-shortcodes.js CHANGED
@@ -14,6 +14,20 @@
14
  });
15
  });
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  // executes this when the DOM is ready
19
  jQuery(function(){
@@ -48,7 +62,10 @@
48
  <td class="shortcode-list"><span id="animation">Animate</span></td><td class="shortcode-list"><span id="fancyblock">Fancy Block</span></td>\
49
  </tr>\
50
  <tr>\
51
- <td class="shortcode-list"><span id="txteam">Team</span></td><td class="shortcode-list"><span id=""></span></td>\
 
 
 
52
  </tr>\
53
  </table>\
54
  <div class="nx-sh-cancel">\
@@ -175,7 +192,21 @@
175
  setTimeout(function() {
176
  jQuery.colorbox({inline:true, href:"#tx-team-form"});
177
  }, 500);
178
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  form_tx.find('.modal-close').click(function(){
181
  jQuery.colorbox.close();
@@ -1386,6 +1417,8 @@
1386
  // inserts the shortcode into the active editor
1387
  tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
1388
 
 
 
1389
  // closes Thickbox
1390
  jQuery.colorbox.close();
1391
  });
@@ -1396,7 +1429,283 @@
1396
 
1397
  });
1398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
  /*
1401
  * image form
1402
  */
@@ -1507,3 +1816,4 @@ function tx_resize_thickbox() {
1507
  jQuery(document).find('#TB_window').width( TB_WIDTH ).height( TB_HEIGHT ).css( 'margin-left', - TB_WIDTH / 2 );
1508
  }
1509
 
 
14
  });
15
  });
16
 
17
+ /*
18
+ jQuery(function(){
19
+
20
+ console.log("Yo console");
21
+ //Insert tx shortcode media button
22
+ window.addEventListener("load", function(){
23
+ document.getElementById("insert-tx-button").onclick = function(){
24
+
25
+ var $form = jQuery("#txshortcodes-form");
26
+ jQuery.colorbox({inline:true, href:"#tx-shortcode-form"});
27
+ }
28
+ });
29
+ });
30
+ */
31
 
32
  // executes this when the DOM is ready
33
  jQuery(function(){
62
  <td class="shortcode-list"><span id="animation">Animate</span></td><td class="shortcode-list"><span id="fancyblock">Fancy Block</span></td>\
63
  </tr>\
64
  <tr>\
65
+ <td class="shortcode-list"><span id="txteam">Team</span></td><td class="shortcode-list"><span id="videoslider">Video Slider</span></td>\
66
+ </tr>\
67
+ <tr>\
68
+ <td class="shortcode-list"><span id="txyoutube">YouTube Video</span></td><td class="shortcode-list"><span id="noid">&nbsp;</span></td>\
69
  </tr>\
70
  </table>\
71
  <div class="nx-sh-cancel">\
192
  setTimeout(function() {
193
  jQuery.colorbox({inline:true, href:"#tx-team-form"});
194
  }, 500);
195
+ });
196
+
197
+ //Insert video slider
198
+ form_tx.find('#videoslider').click(function(){
199
+ setTimeout(function() {
200
+ jQuery.colorbox({inline:true, href:"#tx-vslider-form"});
201
+ }, 500);
202
+ });
203
+
204
+ //Insert YouTube video
205
+ form_tx.find('#txyoutube').click(function(){
206
+ setTimeout(function() {
207
+ jQuery.colorbox({inline:true, href:"#tx-youtube-form"});
208
+ }, 500);
209
+ });
210
 
211
  form_tx.find('.modal-close').click(function(){
212
  jQuery.colorbox.close();
1417
  // inserts the shortcode into the active editor
1418
  tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
1419
 
1420
+ //send_to_editor(shortcode);
1421
+
1422
  // closes Thickbox
1423
  jQuery.colorbox.close();
1424
  });
1429
 
1430
  });
1431
 
1432
+
1433
+ /*
1434
+ * vslider form
1435
+ */
1436
+ jQuery(function(){
1437
+ var form_vslider = jQuery('<div id="vslider-form" class="tx-sh-form"><div id="tx-vslider-form"><table id="vslider-table" class="form-table">\
1438
+ <tr>\
1439
+ <td class="tx-heading" colspan="2"><h2>Video/Hero Slider</h2></td>\
1440
+ </tr>\
1441
+ <tr>\
1442
+ <th><label for="vslider-height">Slider Height in %</label></th>\
1443
+ <td><input type="number" name="height" id="vslider-height" min="10" max="100" value="60" /><br />\
1444
+ <small>Video slider height in percent(%), <b>% of window height</b></small>\
1445
+ </tr>\
1446
+ <tr>\
1447
+ <th><label for="vslider-reduct">Height Reduction in px</label></th>\
1448
+ <td><input type="number" name="reduct" id="vslider-reduct" min="1" max="300" value="0" /><br />\
1449
+ <small>Slider height reduction in pixel(px), <b>used for header or a bottom bar</b>\
1450
+ <br />example: i-max, i-excel, i-craft has ( Header+topbar ) : 126px</small>\
1451
+ </tr>\
1452
+ <tr>\
1453
+ <th><label for="vslider-vurl">YouTube Video URL</label></th>\
1454
+ <td><input type="url" name="vurl" id="vslider-vurl" value="" /><br />\
1455
+ <small>YouTube Video URL</b></small>\
1456
+ </tr>\
1457
+ <tr>\
1458
+ <th><label for="vslider-overlay">Overlay Layer</label></th>\
1459
+ <td><select name="overlay" id="vslider-overlay">\
1460
+ <option value="none">None</option>\
1461
+ <option value="vignette">Vignette</option>\
1462
+ <option value="pixel">Pixel Pattern</option>\
1463
+ </select><br />\
1464
+ <small>Overlay Layer Tranparancy, <b>.9 least transparent and .1 heighest</b></small>\
1465
+ </tr>\
1466
+ <tr>\
1467
+ <th><label for="vslider-bgurl">Background Image URL</label></th>\
1468
+ <td><input type="text" name="bgurl" id="vslider-bgurl" /><br />\
1469
+ <input type="button" class="tx-button" name="tx-img-upload" id="tx-upload-button" value="Upload Image">\
1470
+ </tr>\
1471
+ <tr>\
1472
+ <th><label for="vslider-bgattachment">Background Attachment</label></th>\
1473
+ <td><select name="bgattachment" id="vslider-bgattachment">\
1474
+ <option value="fixed">Fixed</option>\
1475
+ <option value="scroll">Scroll</option>\
1476
+ </select><br />\
1477
+ <small>Select background movement</small></td>\
1478
+ </tr>\
1479
+ <tr>\
1480
+ <th><label for="vslider-bgsize">Background Size</label></th>\
1481
+ <td><select name="bgsize" id="vslider-bgsize">\
1482
+ <option value="cover">Cover</option>\
1483
+ <option value="auto">Auto</option>\
1484
+ </select><br />\
1485
+ <small>Select background size</small></td>\
1486
+ </tr>\
1487
+ <tr>\
1488
+ <th><label for="vslider-imgurl">Logo/Image URL</label></th>\
1489
+ <td><input type="text" name="imgurl" id="vslider-imgurl" /><br />\
1490
+ <input type="button" class="tx-button" name="tx-img-upload2" id="tx-upload-button2" value="Upload Image">\
1491
+ </tr>\
1492
+ <tr>\
1493
+ <th><label for="vslider-title">Title</label></th>\
1494
+ <td><input type="text" name="title" id="vslider-title" /><br />\
1495
+ <small>Enter Title</small></td>\
1496
+ </tr>\
1497
+ <tr>\
1498
+ <th><label for="vslider-content">Content</label></th>\
1499
+ <td><textarea name="content" id="vslider-content">Content ...</textarea><br />\
1500
+ <small>Enter your contents here.</small>\
1501
+ </tr>\
1502
+ <tr>\
1503
+ <th><label for="vslider-linktext">Link Text (Button)</label></th>\
1504
+ <td><input type="text" name="linktext" id="vslider-linktext" /><br />\
1505
+ <small>Enter Link Text</small></td>\
1506
+ </tr>\
1507
+ <tr>\
1508
+ <th><label for="vslider-linkurl">Link URL</label></th>\
1509
+ <td><input type="url" name="linkurl" id="vslider-linkurl" /><br />\
1510
+ <small>Enter Link URL</small></td>\
1511
+ </tr>\
1512
+ </table>\
1513
+ <p class="submit">\
1514
+ <input type="button" id="vslider-submit" class="button-primary" value="Insert Slider" name="submit" />\
1515
+ <input type="button" id="modal-close" class="modal-close button-primary" value="Cancel" name="Cancel" />\
1516
+ </p>\
1517
+ <div class="tnext-bottom-lebel">'+tx_footer_include()+'</div>\
1518
+ </div></div>');
1519
+
1520
+ var table = form_vslider.find('#vslider-table');
1521
+
1522
+ tx_color_picker(form_vslider.find('.color'));
1523
+
1524
+ form_vslider.appendTo('body').hide();
1525
+
1526
+ // handles the click event of the submit button
1527
+ form_vslider.find('#vslider-submit').click(function(){
1528
+
1529
+ var height = table.find('#vslider-height').val();
1530
+ var reduct = table.find('#vslider-reduct').val();
1531
+ var vurl = table.find('#vslider-vurl').val();
1532
+ //var bgcolor = table.find('#vslider-bgcolor').val();
1533
+ var overlay = table.find('#vslider-overlay').val();
1534
+ var bgurl = table.find('#vslider-bgurl').val();
1535
+ var attachment = table.find('#vslider-bgattachment').val();
1536
+ var bgsize = table.find('#vslider-bgsize').val();
1537
+ var imgurl = table.find('#vslider-imgurl').val();
1538
+ var title = table.find('#vslider-title').val();
1539
+ var content = table.find('#vslider-content').val();
1540
+ var linktext = table.find('#vslider-linktext').val();
1541
+ var linkurl = table.find('#vslider-linkurl').val();
1542
+
1543
+
1544
+ var shortcode = '[tx_vslider height="'+height+'" reduct="'+reduct+'" vurl="'+vurl+'" overlay="'+overlay+'" bgurl="'+bgurl+'" attachment="'+attachment+'" bgsize="'+bgsize+'" imgurl="'+imgurl+'" title="'+title+'" linktext="'+linktext+'" linkurl="'+linkurl+'"]'+content+'[/tx_vslider]<br/>';
1545
+
1546
+ // inserts the shortcode into the active editor
1547
+ tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
1548
+
1549
+ //Insert tx shortcode via media button
1550
+ //wp.media.editor.insert(shortcode);
1551
+
1552
+ // closes Thickbox
1553
+ jQuery.colorbox.close();
1554
+ });
1555
+
1556
+ form_vslider.find('#modal-close').click(function(){
1557
+ jQuery.colorbox.close();
1558
+ });
1559
+
1560
+
1561
+ var file_frame;
1562
+ form_vslider.find('#tx-upload-button').click(function(event){
1563
+
1564
+ event.preventDefault();
1565
+
1566
+ // If the media frame already exists, reopen it.
1567
+ if ( file_frame ) {
1568
+ file_frame.open();
1569
+ return;
1570
+ }
1571
+
1572
+ // Create the media frame.
1573
+ file_frame = wp.media.frames.file_frame = wp.media({
1574
+ title: jQuery( this ).data( 'uploader_title' ),
1575
+ button: {
1576
+ text: jQuery( this ).data( 'uploader_button_text' ),
1577
+ },
1578
+ multiple: false // Set to true to allow multiple files to be selected
1579
+ });
1580
+
1581
+ // When an image is selected, run a callback.
1582
+ file_frame.on( 'select', function() {
1583
+ // We set multiple to false so only get one image from the uploader
1584
+ attachment = file_frame.state().get('selection').first().toJSON();
1585
+
1586
+ // Do something with attachment.id and/or attachment.url here
1587
+ table.find('#vslider-bgurl').val(attachment.url);
1588
+
1589
+ });
1590
+ // Finally, open the modal
1591
+ file_frame.open();
1592
+
1593
+ });
1594
+
1595
+ //Logo image URL
1596
+ var file_frame2;
1597
+ form_vslider.find('#tx-upload-button2').click(function(event){
1598
+
1599
+ event.preventDefault();
1600
+
1601
+ // If the media frame already exists, reopen it.
1602
+ if ( file_frame2 ) {
1603
+ file_frame2.open();
1604
+ return;
1605
+ }
1606
+
1607
+ // Create the media frame.
1608
+ file_frame2 = wp.media.frames.file_frame2 = wp.media({
1609
+ title: jQuery( this ).data( 'uploader_title' ),
1610
+ button: {
1611
+ text: jQuery( this ).data( 'uploader_button_text' ),
1612
+ },
1613
+ multiple: false // Set to true to allow multiple files to be selected
1614
+ });
1615
+
1616
+ // When an image is selected, run a callback.
1617
+ file_frame2.on( 'select', function() {
1618
+ // We set multiple to false so only get one image from the uploader
1619
+ attachment = file_frame2.state().get('selection').first().toJSON();
1620
+
1621
+ // Do something with attachment.id and/or attachment.url here
1622
+ table.find('#vslider-imgurl').val(attachment.url);
1623
+
1624
+ });
1625
+ // Finally, open the modal
1626
+ file_frame2.open();
1627
+ });
1628
+
1629
+ });
1630
+
1631
 
1632
+ /*
1633
+ * youtube form
1634
+ */
1635
+ jQuery(function(){
1636
+ var form_youtube = jQuery('<div id="youtube-form" class="tx-sh-form"><div id="tx-youtube-form"><table id="youtube-table" class="form-table">\
1637
+ <tr>\
1638
+ <td class="tx-heading" colspan="2"><h2>Insert YouTube Video</h2></td>\
1639
+ </tr>\
1640
+ <tr>\
1641
+ <th><label for="youtube-url">YouTube Video URL</label></th>\
1642
+ <td><input type="url" name="url" id="youtube-url" value="" /><br />\
1643
+ <small>Enter the YouTube Video URL</small>\
1644
+ </tr>\
1645
+ <tr>\
1646
+ <th><label for="youtube-width">Width</label></th>\
1647
+ <td><input type="number" name="width" id="youtube-width" value=""><br />\
1648
+ <small>Leave it empty for responsive video</small>\
1649
+ </tr>\
1650
+ <tr>\
1651
+ <th><label for="youtube-controls">Show Controls</label></th>\
1652
+ <td><input type="checkbox" name="controls" id="youtube-controls" value="1" checked><br />\
1653
+ <small>Turn On/OFF video controls</small>\
1654
+ </tr>\
1655
+ <tr>\
1656
+ <th><label for="youtube-autoplay">Autoplay</label></th>\
1657
+ <td><input type="checkbox" name="autoplay" id="youtube-autoplay" value="0" /><br />\
1658
+ <small>Turn On/OFF autoplay</small>\
1659
+ </tr>\
1660
+ </table>\
1661
+ <p class="submit">\
1662
+ <input type="button" id="button-submit" class="button-primary" value="Insert YouTube Video" name="submit" />\
1663
+ <input type="button" id="modal-close" class="modal-close button-primary" value="Cancel" name="Cancel" />\
1664
+ </p>\
1665
+ <div class="tnext-bottom-lebel">'+tx_footer_include()+'</div>\
1666
+ </div></div>');
1667
+
1668
+ var table = form_youtube.find('#youtube-table');
1669
+
1670
+ //tx_color_picker(form_calltoact.find('.color'));
1671
+
1672
+ form_youtube.appendTo('body').hide();
1673
+
1674
+ // handles the click event of the submit button
1675
+ form_youtube.find('#button-submit').click(function(){
1676
+
1677
+ var youtube_url = table.find('#youtube-url').val();
1678
+ var youtube_width = table.find('#youtube-width').val();
1679
+ var youtube_controls = table.find('#youtube-controls').val();
1680
+ var youtube_autoplay = table.find('#youtube-autoplay').val();
1681
+
1682
+ if(table.find('#youtube-controls').attr('checked')) {
1683
+ youtube_controls = 1;
1684
+ } else {
1685
+ youtube_controls = 0
1686
+ }
1687
+
1688
+ if(table.find('#youtube-autoplay').attr('checked')) {
1689
+ youtube_autoplay = 1;
1690
+ } else {
1691
+ youtube_autoplay = 0;
1692
+ }
1693
+
1694
+ var shortcode = '[tx_youtube youtube_url="'+youtube_url+'" width="'+youtube_width+'" controls="'+youtube_controls+'" autoplay="'+youtube_autoplay+'"]';
1695
+
1696
+ // inserts the shortcode into the active editor
1697
+ tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
1698
+
1699
+ // closes Thickbox
1700
+ jQuery.colorbox.close();
1701
+ });
1702
+ form_youtube.find('#modal-close').click(function(){
1703
+ jQuery.colorbox.close();
1704
+ });
1705
+
1706
+ });
1707
+
1708
+
1709
  /*
1710
  * image form
1711
  */
1816
  jQuery(document).find('#TB_window').width( TB_WIDTH ).height( TB_HEIGHT ).css( 'margin-left', - TB_WIDTH / 2 );
1817
  }
1818
 
1819
+
tx-toolkit.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: TemplatesNext ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for TemplatesNext Wordpress Themes
6
- Version: 2.0.5
7
  Author: TemplatesNext
8
  Author URI: http://templatesnext.org/
9
  License: GPLv2 or later
3
  /*
4
  Plugin Name: TemplatesNext ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for TemplatesNext Wordpress Themes
6
+ Version: 2.0.6
7
  Author: TemplatesNext
8
  Author URI: http://templatesnext.org/
9
  License: GPLv2 or later