Version Description
- Update for virtue 2.0
Download this release
Release Info
Developer | britner |
Plugin | Kadence Themes Toolkit |
Version | 1.4 |
Comparing to | |
See all releases |
Code changes from version 1.3 to 1.4
- readme.txt +3 -0
- shortcodes.php +16 -16
- shortcodes/columns/columns_popup.php +13 -13
- trunk/images/portfolio-icon.png +0 -0
- trunk/post-types.php +60 -0
- trunk/readme.txt +35 -0
- trunk/shortcode_ajax.php +56 -0
- trunk/shortcodes.php +258 -0
- trunk/shortcodes/accordion/accordion_popup.php +71 -0
- trunk/shortcodes/accordion/accordion_shortgen.js +36 -0
- trunk/shortcodes/accordion/img/accordion.png +0 -0
- trunk/shortcodes/btns/btns_popup.php +151 -0
- trunk/shortcodes/btns/btns_shortgen.js +36 -0
- trunk/shortcodes/btns/img/btn.png +0 -0
- trunk/shortcodes/columns/columns_popup.php +194 -0
- trunk/shortcodes/columns/columns_shortgen.js +123 -0
- trunk/shortcodes/columns/img/columns.png +0 -0
- trunk/shortcodes/divider/divider_popup.php +85 -0
- trunk/shortcodes/divider/divider_shortgen.js +36 -0
- trunk/shortcodes/divider/img/divider.png +0 -0
- trunk/shortcodes/icons/icon_popup.php +216 -0
- trunk/shortcodes/icons/icon_shortgen.js +36 -0
- trunk/shortcodes/icons/img/cool.png +0 -0
- trunk/shortcodes/pullquote/img/quote.png +0 -0
- trunk/shortcodes/pullquote/quote_popup.php +82 -0
- trunk/shortcodes/pullquote/quote_shortgen.js +36 -0
- trunk/shortcodes/video/img/video.png +0 -0
- trunk/shortcodes/video/video_popup.php +73 -0
- trunk/shortcodes/video/video_shortgen.js +98 -0
- trunk/virtue_toolkit.php +28 -0
readme.txt
CHANGED
@@ -22,6 +22,9 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
|
|
22 |
|
23 |
== Changelog ==
|
24 |
|
|
|
|
|
|
|
25 |
= 1.3 =
|
26 |
* Fix Blank Popup
|
27 |
|
22 |
|
23 |
== Changelog ==
|
24 |
|
25 |
+
= 1.4 =
|
26 |
+
* Update for virtue 2.0
|
27 |
+
|
28 |
= 1.3 =
|
29 |
* Fix Blank Popup
|
30 |
|
shortcodes.php
CHANGED
@@ -7,10 +7,10 @@ function kad_accordion_shortcode_function($atts, $content ) {
|
|
7 |
if( is_array( $GLOBALS['panes'] ) ){
|
8 |
|
9 |
foreach( $GLOBALS['panes'] as $tab ){
|
10 |
-
$tabs[] = '<div class="
|
11 |
|
12 |
}
|
13 |
-
$return = "\n".'<div class="
|
14 |
}
|
15 |
return $return;
|
16 |
}
|
@@ -20,7 +20,7 @@ function kad_accordion_pane_function($atts, $content ) {
|
|
20 |
'title' => 'Pane %d',
|
21 |
'start' => ''
|
22 |
), $atts));
|
23 |
-
if ($start != '') {$open = '
|
24 |
if ($start != '') {$in = 'in';} else {$in = '';}
|
25 |
|
26 |
$x = $GLOBALS['pane_count'];
|
@@ -61,43 +61,43 @@ $GLOBALS['tab_count']++;
|
|
61 |
|
62 |
//Shortcode for columns
|
63 |
function kad_column_shortcode_function( $atts, $content ) {
|
64 |
-
return '<div class="row
|
65 |
}
|
66 |
function kad_hcolumn_shortcode_function( $atts, $content ) {
|
67 |
-
return '<div class="row
|
68 |
}
|
69 |
function kad_column11_function( $atts, $content ) {
|
70 |
-
return '<div class="
|
71 |
}
|
72 |
function kad_column10_function( $atts, $content ) {
|
73 |
-
return '<div class="
|
74 |
}
|
75 |
function kad_column9_function( $atts, $content ) {
|
76 |
-
return '<div class="
|
77 |
}
|
78 |
function kad_column8_function( $atts, $content ) {
|
79 |
-
return '<div class="
|
80 |
}
|
81 |
function kad_column7_function( $atts, $content ) {
|
82 |
-
return '<div class="
|
83 |
}
|
84 |
function kad_column6_function( $atts, $content ) {
|
85 |
-
return '<div class="
|
86 |
}
|
87 |
function kad_column5_function( $atts, $content ) {
|
88 |
-
return '<div class="
|
89 |
}
|
90 |
function kad_column4_function( $atts, $content ) {
|
91 |
-
return '<div class="
|
92 |
}
|
93 |
function kad_column3_function( $atts, $content ) {
|
94 |
-
return '<div class="
|
95 |
}
|
96 |
function kad_column2_function( $atts, $content ) {
|
97 |
-
return '<div class="
|
98 |
}
|
99 |
function kad_column1_function( $atts, $content ) {
|
100 |
-
return '<div class="
|
101 |
}
|
102 |
//Shortcode for Icons
|
103 |
function kad_icon_shortcode_function( $atts) {
|
7 |
if( is_array( $GLOBALS['panes'] ) ){
|
8 |
|
9 |
foreach( $GLOBALS['panes'] as $tab ){
|
10 |
+
$tabs[] = '<div class="panel panel-default"><div class="panel-heading"><a class="accordion-toggle '.$tab['open'].'" data-toggle="collapse" data-parent="#accordionname'.$random.'" href="#collapse'.$random.$tab['link'].'"><h5><i class="icon-minus primary-color"></i><i class="icon-plus"></i>'.$tab['title'].'</h5></a></div><div id="collapse'.$random.$tab['link'].'" class="panel-collapse collapse '.$tab['in'].'"><div class="panel-body postclass">'.$tab['content'].'</div></div></div>';
|
11 |
|
12 |
}
|
13 |
+
$return = "\n".'<div class="panel-group" id="accordionname'.$random.'">'.implode( "\n", $tabs ).'</div>'."\n";
|
14 |
}
|
15 |
return $return;
|
16 |
}
|
20 |
'title' => 'Pane %d',
|
21 |
'start' => ''
|
22 |
), $atts));
|
23 |
+
if ($start != '') {$open = '';} else {$open = 'collapsed';}
|
24 |
if ($start != '') {$in = 'in';} else {$in = '';}
|
25 |
|
26 |
$x = $GLOBALS['pane_count'];
|
61 |
|
62 |
//Shortcode for columns
|
63 |
function kad_column_shortcode_function( $atts, $content ) {
|
64 |
+
return '<div class="row">'.do_shortcode($content).'</div>';
|
65 |
}
|
66 |
function kad_hcolumn_shortcode_function( $atts, $content ) {
|
67 |
+
return '<div class="row">'.do_shortcode($content).'</div>';
|
68 |
}
|
69 |
function kad_column11_function( $atts, $content ) {
|
70 |
+
return '<div class="col-md-11">'.do_shortcode($content).'</div>';
|
71 |
}
|
72 |
function kad_column10_function( $atts, $content ) {
|
73 |
+
return '<div class="col-md-10">'.do_shortcode($content).'</div>';
|
74 |
}
|
75 |
function kad_column9_function( $atts, $content ) {
|
76 |
+
return '<div class="col-md-9">'.do_shortcode($content).'</div>';
|
77 |
}
|
78 |
function kad_column8_function( $atts, $content ) {
|
79 |
+
return '<div class="col-md-8">'.do_shortcode($content).'</div>';
|
80 |
}
|
81 |
function kad_column7_function( $atts, $content ) {
|
82 |
+
return '<div class="col-md-7">'.do_shortcode($content).'</div>';
|
83 |
}
|
84 |
function kad_column6_function( $atts, $content ) {
|
85 |
+
return '<div class="col-md-6">'.do_shortcode($content).'</div>';
|
86 |
}
|
87 |
function kad_column5_function( $atts, $content ) {
|
88 |
+
return '<div class="col-md-5">'.do_shortcode($content).'</div>';
|
89 |
}
|
90 |
function kad_column4_function( $atts, $content ) {
|
91 |
+
return '<div class="col-md-4">'.do_shortcode($content).'</div>';
|
92 |
}
|
93 |
function kad_column3_function( $atts, $content ) {
|
94 |
+
return '<div class="col-md-3">'.do_shortcode($content).'</div>';
|
95 |
}
|
96 |
function kad_column2_function( $atts, $content ) {
|
97 |
+
return '<div class="col-md-2">'.do_shortcode($content).'</div>';
|
98 |
}
|
99 |
function kad_column1_function( $atts, $content ) {
|
100 |
+
return '<div class="col-md-1">'.do_shortcode($content).'</div>';
|
101 |
}
|
102 |
//Shortcode for Icons
|
103 |
function kad_icon_shortcode_function( $atts) {
|
shortcodes/columns/columns_popup.php
CHANGED
@@ -37,47 +37,47 @@ var ButtonDialog = {
|
|
37 |
case '1':
|
38 |
output = '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnstart mceItem" title="hcolumns" />';
|
39 |
if(document.getElementById('2column').checked) {
|
40 |
-
output += '<div class="
|
41 |
output += '<p>add content here</p>';
|
42 |
output += '</div> ';
|
43 |
-
output += '<div class="
|
44 |
output += '<p>add content here</p>';
|
45 |
output += '</div> ';
|
46 |
}else if(document.getElementById('2columnright').checked) {
|
47 |
-
output += '<div class="
|
48 |
output += '<p>add content here</p>';
|
49 |
output += '</div> ';
|
50 |
-
output += '<div class="
|
51 |
output += '<p>add content here</p>';
|
52 |
output += '</div> ';
|
53 |
}else if(document.getElementById('2columnleft').checked) {
|
54 |
-
output += '<div class="
|
55 |
output += '<p>add content here</p>';
|
56 |
output += '</div> ';
|
57 |
-
output += '<div class="
|
58 |
output += '<p>add content here</p>';
|
59 |
output += '</div> ';
|
60 |
}else if(document.getElementById('3column').checked) {
|
61 |
-
output += '<div class="
|
62 |
output += '<p>add content here</p>';
|
63 |
output += '</div> ';
|
64 |
-
output += '<div class="
|
65 |
output += '<p>add content here</p>';
|
66 |
output += '</div> ';
|
67 |
-
output += '<div class="
|
68 |
output += '<p>add content here</p>';
|
69 |
output += '</div> ';
|
70 |
}else if(document.getElementById('4column').checked) {
|
71 |
-
output += '<div class="
|
72 |
output += '<p>add content here</p>';
|
73 |
output += '</div> ';
|
74 |
-
output += '<div class="
|
75 |
output += '<p>add content here</p>';
|
76 |
output += '</div> ';
|
77 |
-
output += '<div class="
|
78 |
output += '<p>add content here</p>';
|
79 |
output += '</div> ';
|
80 |
-
output += '<div class="
|
81 |
output += '<p>add content here</p>';
|
82 |
output += '</div> ';
|
83 |
}
|
37 |
case '1':
|
38 |
output = '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnstart mceItem" title="hcolumns" />';
|
39 |
if(document.getElementById('2column').checked) {
|
40 |
+
output += '<div class="col-md-6"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-6 mceItem" title="columnhelper col-md-6" />';
|
41 |
output += '<p>add content here</p>';
|
42 |
output += '</div> ';
|
43 |
+
output += '<div class="col-md-6"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-6 mceItem" title="columnhelper col-md-6" />';
|
44 |
output += '<p>add content here</p>';
|
45 |
output += '</div> ';
|
46 |
}else if(document.getElementById('2columnright').checked) {
|
47 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
48 |
output += '<p>add content here</p>';
|
49 |
output += '</div> ';
|
50 |
+
output += '<div class="col-md-8"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-8 mceItem" title="columnhelper col-md-8" />';
|
51 |
output += '<p>add content here</p>';
|
52 |
output += '</div> ';
|
53 |
}else if(document.getElementById('2columnleft').checked) {
|
54 |
+
output += '<div class="col-md-8"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-8 mceItem" title="columnhelper col-md-8" />';
|
55 |
output += '<p>add content here</p>';
|
56 |
output += '</div> ';
|
57 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
58 |
output += '<p>add content here</p>';
|
59 |
output += '</div> ';
|
60 |
}else if(document.getElementById('3column').checked) {
|
61 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
62 |
output += '<p>add content here</p>';
|
63 |
output += '</div> ';
|
64 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
65 |
output += '<p>add content here</p>';
|
66 |
output += '</div> ';
|
67 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
68 |
output += '<p>add content here</p>';
|
69 |
output += '</div> ';
|
70 |
}else if(document.getElementById('4column').checked) {
|
71 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
72 |
output += '<p>add content here</p>';
|
73 |
output += '</div> ';
|
74 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
75 |
output += '<p>add content here</p>';
|
76 |
output += '</div> ';
|
77 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
78 |
output += '<p>add content here</p>';
|
79 |
output += '</div> ';
|
80 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
81 |
output += '<p>add content here</p>';
|
82 |
output += '</div> ';
|
83 |
}
|
trunk/images/portfolio-icon.png
ADDED
Binary file
|
trunk/post-types.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Custom post types
|
3 |
+
function portfolio_post_init() {
|
4 |
+
$portfoliolabels = array(
|
5 |
+
'name' => __('Portfolio', 'virtue'),
|
6 |
+
'singular_name' => __('Portfolio Item', 'virtue'),
|
7 |
+
'add_new' => __('Add New', 'virtue'),
|
8 |
+
'add_new_item' => __('Add New Portfolio Item', 'virtue'),
|
9 |
+
'edit_item' => __('Edit Portfolio Item', 'virtue'),
|
10 |
+
'new_item' => __('New Portfolio Item', 'virtue'),
|
11 |
+
'all_items' => __('All Portfolio', 'virtue'),
|
12 |
+
'view_item' => __('View Portfolio Item', 'virtue'),
|
13 |
+
'search_items' => __('Search Portfolio', 'virtue'),
|
14 |
+
'not_found' => __('No Portfolio Item found', 'virtue'),
|
15 |
+
'not_found_in_trash' => __('No Portfolio Items found in Trash', 'virtue'),
|
16 |
+
'parent_item_colon' => '',
|
17 |
+
'menu_name' => __('Portfolio', 'virtue')
|
18 |
+
);
|
19 |
+
|
20 |
+
$portargs = array(
|
21 |
+
'labels' => $portfoliolabels,
|
22 |
+
'public' => true,
|
23 |
+
'publicly_queryable' => true,
|
24 |
+
'show_ui' => true,
|
25 |
+
'show_in_menu' => true,
|
26 |
+
'query_var' => true,
|
27 |
+
'rewrite' => array( 'slug' => 'portfolio' ), /* you can specify its url slug */
|
28 |
+
'has_archive' => false,
|
29 |
+
'capability_type' => 'post',
|
30 |
+
'hierarchical' => false,
|
31 |
+
'menu_position' => 8,
|
32 |
+
'menu_icon' => VIRTUE_TOOLKIT_URL .'/images/portfolio-icon.png',
|
33 |
+
'supports' => array( 'title', 'editor', 'author', 'page-attributes', 'thumbnail', 'comments' )
|
34 |
+
);
|
35 |
+
// Initialize Taxonomy Labels
|
36 |
+
$worklabels = array(
|
37 |
+
'name' => __( 'Portfolio Type', 'virtue' ),
|
38 |
+
'singular_name' => __( 'Type', 'virtue' ),
|
39 |
+
'search_items' => __( 'Search Type', 'virtue' ),
|
40 |
+
'all_items' => __( 'All Type', 'virtue' ),
|
41 |
+
'parent_item' => __( 'Parent Type', 'virtue' ),
|
42 |
+
'parent_item_colon' => __( 'Parent Type:', 'virtue' ),
|
43 |
+
'edit_item' => __( 'Edit Type', 'virtue' ),
|
44 |
+
'update_item' => __( 'Update Type', 'virtue' ),
|
45 |
+
'add_new_item' => __( 'Add New Type', 'virtue' ),
|
46 |
+
'new_item_name' => __( 'New Type Name', 'virtue' ),
|
47 |
+
);
|
48 |
+
// Register Custom Taxonomy
|
49 |
+
register_taxonomy('portfolio-type',array('portfolio'), array(
|
50 |
+
'hierarchical' => true, // define whether to use a system like tags or categories
|
51 |
+
'labels' => $worklabels,
|
52 |
+
'show_ui' => true,
|
53 |
+
'query_var' => true,
|
54 |
+
'rewrite' => true,
|
55 |
+
));
|
56 |
+
|
57 |
+
register_post_type( 'portfolio', $portargs );
|
58 |
+
}
|
59 |
+
add_action( 'init', 'portfolio_post_init', 1 );
|
60 |
+
|
trunk/readme.txt
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Virtue ToolKit ===
|
2 |
+
Contributors: britner
|
3 |
+
Tags:
|
4 |
+
Requires at least: 3.2
|
5 |
+
Tested up to: 3.8
|
6 |
+
Stable tag: 1.4
|
7 |
+
License: GPLv2 or later
|
8 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
|
10 |
+
Custom Portfolio and Shortcode functionality for Virtue Theme
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
Custom Portfolio and Shortcode functionality for Virtue Theme
|
15 |
+
|
16 |
+
Not intended to work with any other theme.
|
17 |
+
|
18 |
+
== Installation ==
|
19 |
+
|
20 |
+
Install the plugin into the `/wp-content/plugins/` folder, and activate it.
|
21 |
+
|
22 |
+
|
23 |
+
== Changelog ==
|
24 |
+
|
25 |
+
= 1.4 =
|
26 |
+
* Update for virtue 2.0
|
27 |
+
|
28 |
+
= 1.3 =
|
29 |
+
* Fix Blank Popup
|
30 |
+
|
31 |
+
= 1.2 =
|
32 |
+
* Updated code to use ajax.
|
33 |
+
|
34 |
+
= 1.0 =
|
35 |
+
* Initial Version.
|
trunk/shortcode_ajax.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function virtue_columns_ajax_tinymce() {
|
3 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts')) // check for rights
|
4 |
+
die(__("You are not allowed to be here"));
|
5 |
+
|
6 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/columns/columns_popup.php');
|
7 |
+
}
|
8 |
+
add_action('wp_ajax_kadcolumns_tinymce', 'virtue_columns_ajax_tinymce');
|
9 |
+
|
10 |
+
function virtue_icons_ajax_tinymce() {
|
11 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
12 |
+
die(__("You are not allowed to be here"));
|
13 |
+
|
14 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/icons/icon_popup.php');
|
15 |
+
}
|
16 |
+
add_action('wp_ajax_kadicons_tinymce', 'virtue_icons_ajax_tinymce');
|
17 |
+
|
18 |
+
function virtue_quote_ajax_tinymce() {
|
19 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
20 |
+
die(__("You are not allowed to be here"));
|
21 |
+
|
22 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/pullquote/quote_popup.php');
|
23 |
+
}
|
24 |
+
add_action('wp_ajax_kadquote_tinymce', 'virtue_quote_ajax_tinymce');
|
25 |
+
|
26 |
+
function virtue_video_ajax_tinymce() {
|
27 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
28 |
+
die(__("You are not allowed to be here"));
|
29 |
+
|
30 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/video/video_popup.php');
|
31 |
+
}
|
32 |
+
add_action('wp_ajax_kadvideo_tinymce', 'virtue_video_ajax_tinymce');
|
33 |
+
|
34 |
+
function virtue_btns_ajax_tinymce() {
|
35 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
36 |
+
die(__("You are not allowed to be here"));
|
37 |
+
|
38 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/btns/btns_popup.php');
|
39 |
+
}
|
40 |
+
add_action('wp_ajax_kadbtns_tinymce', 'virtue_btns_ajax_tinymce');
|
41 |
+
|
42 |
+
function virtue_divider_ajax_tinymce() {
|
43 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
44 |
+
die(__("You are not allowed to be here"));
|
45 |
+
|
46 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/divider/divider_popup.php');
|
47 |
+
}
|
48 |
+
add_action('wp_ajax_kaddivider_tinymce', 'virtue_divider_ajax_tinymce');
|
49 |
+
|
50 |
+
function virtue_accordion_ajax_tinymce() {
|
51 |
+
if (!current_user_can('edit_pages') && !current_user_can('edit_posts'))
|
52 |
+
die(__("You are not allowed to be here"));
|
53 |
+
|
54 |
+
include_once( dirname(dirname(__FILE__)) . '/virtue-toolkit/shortcodes/accordion/accordion_popup.php');
|
55 |
+
}
|
56 |
+
add_action('wp_ajax_kadaccordion_tinymce', 'virtue_accordion_ajax_tinymce');
|
trunk/shortcodes.php
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//Shortcode for accordion
|
3 |
+
function kad_accordion_shortcode_function($atts, $content ) {
|
4 |
+
$GLOBALS['pane_count'] = 0;
|
5 |
+
do_shortcode( $content );
|
6 |
+
$random = rand(1, 99);
|
7 |
+
if( is_array( $GLOBALS['panes'] ) ){
|
8 |
+
|
9 |
+
foreach( $GLOBALS['panes'] as $tab ){
|
10 |
+
$tabs[] = '<div class="panel panel-default"><div class="panel-heading"><a class="accordion-toggle '.$tab['open'].'" data-toggle="collapse" data-parent="#accordionname'.$random.'" href="#collapse'.$random.$tab['link'].'"><h5><i class="icon-minus primary-color"></i><i class="icon-plus"></i>'.$tab['title'].'</h5></a></div><div id="collapse'.$random.$tab['link'].'" class="panel-collapse collapse '.$tab['in'].'"><div class="panel-body postclass">'.$tab['content'].'</div></div></div>';
|
11 |
+
|
12 |
+
}
|
13 |
+
$return = "\n".'<div class="panel-group" id="accordionname'.$random.'">'.implode( "\n", $tabs ).'</div>'."\n";
|
14 |
+
}
|
15 |
+
return $return;
|
16 |
+
}
|
17 |
+
|
18 |
+
function kad_accordion_pane_function($atts, $content ) {
|
19 |
+
extract(shortcode_atts(array(
|
20 |
+
'title' => 'Pane %d',
|
21 |
+
'start' => ''
|
22 |
+
), $atts));
|
23 |
+
if ($start != '') {$open = '';} else {$open = 'collapsed';}
|
24 |
+
if ($start != '') {$in = 'in';} else {$in = '';}
|
25 |
+
|
26 |
+
$x = $GLOBALS['pane_count'];
|
27 |
+
$GLOBALS['panes'][$x] = array( 'title' => $title, 'open' => $open, 'in' => $in, 'link' => $GLOBALS['pane_count'], 'content' => do_shortcode( $content ) );
|
28 |
+
|
29 |
+
$GLOBALS['pane_count']++;
|
30 |
+
}
|
31 |
+
function kad_tab_shortcode_function($atts, $content ) {
|
32 |
+
$GLOBALS['tab_count'] = 0;
|
33 |
+
do_shortcode( $content );
|
34 |
+
$random = rand(1, 99);
|
35 |
+
if( is_array( $GLOBALS['tabs'] ) ){
|
36 |
+
|
37 |
+
foreach( $GLOBALS['tabs'] as $nav ){
|
38 |
+
$tabnav[] = '<li class="'.$nav['active'].'"><a href="#sctab'.$random.$nav['link'].'">'.$nav['title'].'</a></li>';
|
39 |
+
}
|
40 |
+
|
41 |
+
foreach( $GLOBALS['tabs'] as $tab ){
|
42 |
+
$tabs[] = '<div class="tab-pane clearfix '.$tab['active'].'" id="sctab'.$random.$tab['link'].'">'.$tab['content'].'</div>';
|
43 |
+
}
|
44 |
+
|
45 |
+
$return = "\n".'<ul class="nav nav-tabs sc_tabs">'.implode( "\n", $tabnav ).'</ul> <div class="tab-content postclass">'.implode( "\n", $tabs ).'</div>'."\n";
|
46 |
+
}
|
47 |
+
return $return;
|
48 |
+
}
|
49 |
+
function kad_tab_pane_function($atts, $content ) {
|
50 |
+
extract(shortcode_atts(array(
|
51 |
+
'title' => 'Tab %d',
|
52 |
+
'start' => ''
|
53 |
+
), $atts));
|
54 |
+
if ($start != '') {$active = 'active';} else {$active = '';}
|
55 |
+
|
56 |
+
$x = $GLOBALS['tab_count'];
|
57 |
+
$GLOBALS['tabs'][$x] = array( 'title' => $title, 'active' => $active, 'link' => $GLOBALS['tab_count'], 'content' => do_shortcode( $content ) );
|
58 |
+
|
59 |
+
$GLOBALS['tab_count']++;
|
60 |
+
}
|
61 |
+
|
62 |
+
//Shortcode for columns
|
63 |
+
function kad_column_shortcode_function( $atts, $content ) {
|
64 |
+
return '<div class="row">'.do_shortcode($content).'</div>';
|
65 |
+
}
|
66 |
+
function kad_hcolumn_shortcode_function( $atts, $content ) {
|
67 |
+
return '<div class="row">'.do_shortcode($content).'</div>';
|
68 |
+
}
|
69 |
+
function kad_column11_function( $atts, $content ) {
|
70 |
+
return '<div class="col-md-11">'.do_shortcode($content).'</div>';
|
71 |
+
}
|
72 |
+
function kad_column10_function( $atts, $content ) {
|
73 |
+
return '<div class="col-md-10">'.do_shortcode($content).'</div>';
|
74 |
+
}
|
75 |
+
function kad_column9_function( $atts, $content ) {
|
76 |
+
return '<div class="col-md-9">'.do_shortcode($content).'</div>';
|
77 |
+
}
|
78 |
+
function kad_column8_function( $atts, $content ) {
|
79 |
+
return '<div class="col-md-8">'.do_shortcode($content).'</div>';
|
80 |
+
}
|
81 |
+
function kad_column7_function( $atts, $content ) {
|
82 |
+
return '<div class="col-md-7">'.do_shortcode($content).'</div>';
|
83 |
+
}
|
84 |
+
function kad_column6_function( $atts, $content ) {
|
85 |
+
return '<div class="col-md-6">'.do_shortcode($content).'</div>';
|
86 |
+
}
|
87 |
+
function kad_column5_function( $atts, $content ) {
|
88 |
+
return '<div class="col-md-5">'.do_shortcode($content).'</div>';
|
89 |
+
}
|
90 |
+
function kad_column4_function( $atts, $content ) {
|
91 |
+
return '<div class="col-md-4">'.do_shortcode($content).'</div>';
|
92 |
+
}
|
93 |
+
function kad_column3_function( $atts, $content ) {
|
94 |
+
return '<div class="col-md-3">'.do_shortcode($content).'</div>';
|
95 |
+
}
|
96 |
+
function kad_column2_function( $atts, $content ) {
|
97 |
+
return '<div class="col-md-2">'.do_shortcode($content).'</div>';
|
98 |
+
}
|
99 |
+
function kad_column1_function( $atts, $content ) {
|
100 |
+
return '<div class="col-md-1">'.do_shortcode($content).'</div>';
|
101 |
+
}
|
102 |
+
//Shortcode for Icons
|
103 |
+
function kad_icon_shortcode_function( $atts) {
|
104 |
+
extract(shortcode_atts(array(
|
105 |
+
'icon' => '',
|
106 |
+
'size' => '',
|
107 |
+
'color' => '',
|
108 |
+
'float'=> ''
|
109 |
+
), $atts));
|
110 |
+
if ($float != '') $output = '<i class="'.$icon.'" style="font-size:'.$size.'; color:'.$color.'; float:'.$float.'; padding:10px;"></i>';
|
111 |
+
else $output = '<i class="'.$icon.'" style="font-size:'.$size.'; color:'.$color.';"></i>';
|
112 |
+
return $output;
|
113 |
+
}
|
114 |
+
// Video Shortcode
|
115 |
+
function kad_video_shortcode_function( $atts, $content) {
|
116 |
+
extract(shortcode_atts(array(
|
117 |
+
'width' => '',
|
118 |
+
), $atts));
|
119 |
+
if($width != '') { $output = '<div style="max-width:'.$width.'px;"><div class="videofit">'.$content.'</div></div>';}
|
120 |
+
else { $output = '<div class="videofit">'.$content.'</div>'; }
|
121 |
+
return $output;
|
122 |
+
}
|
123 |
+
//Button
|
124 |
+
function kad_button_shortcode_function( $atts) {
|
125 |
+
extract(shortcode_atts(array(
|
126 |
+
'bcolor' => '',
|
127 |
+
'link' => '',
|
128 |
+
'text' => '',
|
129 |
+
'tcolor' => '',
|
130 |
+
), $atts));
|
131 |
+
return '<a href="'.$link.'" class="kad-btn kad-btn-primary" style="background-color:'.$bcolor.'; color:'.$tcolor.'">'.$text.'</a>';
|
132 |
+
}
|
133 |
+
function kad_blockquote_shortcode_function( $atts, $content) {
|
134 |
+
extract(shortcode_atts(array(
|
135 |
+
'align' => 'center',
|
136 |
+
), $atts));
|
137 |
+
switch ($align)
|
138 |
+
{
|
139 |
+
case "center":
|
140 |
+
$output = '<div class="blockquote-full postclass clearfix">' . do_shortcode($content) . '</div>';
|
141 |
+
break;
|
142 |
+
|
143 |
+
case "left":
|
144 |
+
$output = '<div class="blockquote-left postclass clearfix">' . do_shortcode($content) . '</div>';
|
145 |
+
break;
|
146 |
+
|
147 |
+
case "right":
|
148 |
+
$output = '<div class="blockquote-right postclass clearfix">' . do_shortcode($content) . '</div>';
|
149 |
+
break;
|
150 |
+
}
|
151 |
+
return $output;
|
152 |
+
}
|
153 |
+
function kad_pullquote_shortcode_function( $atts, $content) {
|
154 |
+
extract( shortcode_atts( array(
|
155 |
+
'align' => 'center'
|
156 |
+
), $atts ));
|
157 |
+
|
158 |
+
switch ($align)
|
159 |
+
{
|
160 |
+
case "center":
|
161 |
+
$output = '<div class="pullquote-center">' . do_shortcode($content) . '</div>';
|
162 |
+
break;
|
163 |
+
|
164 |
+
case "right":
|
165 |
+
$output = '<div class="pullquote-right">' . do_shortcode($content) . '</div>';
|
166 |
+
break;
|
167 |
+
|
168 |
+
case "left":
|
169 |
+
$output = '<div class="pullquote-left">' . do_shortcode($content) . '</div>';
|
170 |
+
break;
|
171 |
+
}
|
172 |
+
|
173 |
+
return $output;
|
174 |
+
}
|
175 |
+
function kad_hrule_function( ) {
|
176 |
+
return '<div class="hrule clearfix"></div>';
|
177 |
+
}
|
178 |
+
function kad_hrpadding10_function( ) {
|
179 |
+
return '<div class="space_20 clearfix"></div>';
|
180 |
+
}
|
181 |
+
function kad_hrpadding20_function( ) {
|
182 |
+
return '<div class="space_40 clearfix"></div>';
|
183 |
+
}
|
184 |
+
function kad_hrpadding40_function( ) {
|
185 |
+
return '<div class="space_80 clearfix"></div>';
|
186 |
+
}
|
187 |
+
function kad_clearfix_function( ) {
|
188 |
+
return '<div class="clearfix"></div>';
|
189 |
+
}
|
190 |
+
function kad_columnhelper_function( ) {
|
191 |
+
return '';
|
192 |
+
}
|
193 |
+
function virtuetoolkit_register_shortcodes(){
|
194 |
+
add_shortcode('accordion', 'kad_accordion_shortcode_function');
|
195 |
+
add_shortcode('pane', 'kad_accordion_pane_function');
|
196 |
+
add_shortcode('tabs', 'kad_tab_shortcode_function');
|
197 |
+
add_shortcode('tab', 'kad_tab_pane_function');
|
198 |
+
add_shortcode('columns', 'kad_column_shortcode_function');
|
199 |
+
add_shortcode('hcolumns', 'kad_hcolumn_shortcode_function');
|
200 |
+
add_shortcode('span11', 'kad_column11_function');
|
201 |
+
add_shortcode('span10', 'kad_column10_function');
|
202 |
+
add_shortcode('span9', 'kad_column9_function');
|
203 |
+
add_shortcode('span8', 'kad_column8_function');
|
204 |
+
add_shortcode('span7', 'kad_column7_function');
|
205 |
+
add_shortcode('span6', 'kad_column6_function');
|
206 |
+
add_shortcode('span5', 'kad_column5_function');
|
207 |
+
add_shortcode('span4', 'kad_column4_function');
|
208 |
+
add_shortcode('span3', 'kad_column3_function');
|
209 |
+
add_shortcode('span2', 'kad_column2_function');
|
210 |
+
add_shortcode('span1', 'kad_column1_function');
|
211 |
+
add_shortcode('columnhelper', 'kad_columnhelper_function');
|
212 |
+
add_shortcode('icon', 'kad_icon_shortcode_function');
|
213 |
+
add_shortcode('video', 'kad_video_shortcode_function');
|
214 |
+
add_shortcode('pullquote', 'kad_pullquote_shortcode_function');
|
215 |
+
add_shortcode('blockquote', 'kad_blockquote_shortcode_function');
|
216 |
+
add_shortcode('btn', 'kad_button_shortcode_function');
|
217 |
+
add_shortcode('hr', 'kad_hrule_function');
|
218 |
+
add_shortcode('space_20', 'kad_hrpadding10_function');
|
219 |
+
add_shortcode('space_40', 'kad_hrpadding20_function');
|
220 |
+
add_shortcode('space_80', 'kad_hrpadding40_function');
|
221 |
+
add_shortcode('clear', 'kad_clearfix_function');
|
222 |
+
}
|
223 |
+
add_action( 'init', 'virtuetoolkit_register_shortcodes');
|
224 |
+
|
225 |
+
|
226 |
+
function virtue_register_button( $buttons ) {
|
227 |
+
array_push( $buttons, "|", "kadcolumns" );
|
228 |
+
array_push( $buttons, "|", "kaddivider" );
|
229 |
+
array_push( $buttons, "|", "kadaccordion" );
|
230 |
+
array_push( $buttons, "|", "kadquote" );
|
231 |
+
array_push( $buttons, "|", "kadbtn" );
|
232 |
+
array_push( $buttons, "|", "kadicon" );
|
233 |
+
array_push( $buttons, "|", "kadvideo" );
|
234 |
+
return $buttons;
|
235 |
+
}
|
236 |
+
function virtue_add_plugin( $plugin_array ) {
|
237 |
+
$plugin_array['kadcolumns'] = VIRTUE_TOOLKIT_URL . '/shortcodes/columns/columns_shortgen.js';
|
238 |
+
$plugin_array['kadicon'] = VIRTUE_TOOLKIT_URL . '/shortcodes/icons/icon_shortgen.js';
|
239 |
+
$plugin_array['kadaccordion'] = VIRTUE_TOOLKIT_URL . '/shortcodes/accordion/accordion_shortgen.js';
|
240 |
+
$plugin_array['kadvideo'] = VIRTUE_TOOLKIT_URL . '/shortcodes/video/video_shortgen.js';
|
241 |
+
$plugin_array['kadquote'] = VIRTUE_TOOLKIT_URL . '/shortcodes/pullquote/quote_shortgen.js';
|
242 |
+
$plugin_array['kadbtn'] = VIRTUE_TOOLKIT_URL . '/shortcodes/btns/btns_shortgen.js';
|
243 |
+
$plugin_array['kaddivider'] = VIRTUE_TOOLKIT_URL . '/shortcodes/divider/divider_shortgen.js';
|
244 |
+
return $plugin_array;
|
245 |
+
}
|
246 |
+
function virtue_tinymce_shortcode_button() {
|
247 |
+
|
248 |
+
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) {
|
249 |
+
return;
|
250 |
+
}
|
251 |
+
|
252 |
+
if ( get_user_option('rich_editing') == 'true' ) {
|
253 |
+
add_filter( 'mce_external_plugins', 'virtue_add_plugin' );
|
254 |
+
add_filter( 'mce_buttons_3', 'virtue_register_button' );
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
258 |
+
add_action('init', 'virtue_tinymce_shortcode_button');
|
trunk/shortcodes/accordion/accordion_popup.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Accordion or Tabs", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var type = jQuery('#icon-dialog select#tabs').val();
|
31 |
+
|
32 |
+
var output = '';
|
33 |
+
|
34 |
+
// setup the output of our shortcode
|
35 |
+
if( type == 'accordion')
|
36 |
+
output += '[accordion]<br />[pane title="title1" start=open]<br />Put content here<br />[/pane]<br />[pane title="title2"]<br />Put content here<br />[/pane]<br />[pane title="title3"]<br />Copy and paste to create more<br />[/pane]<br />[/accordion]<br />';
|
37 |
+
else {
|
38 |
+
output += '[tabs]<br />[tab title="title1" start=open]<br />Put content here<br />[/tab]<br />[tab title="title2"]<br />Put content here<br />[/tab]<br />[tab title="title3"]<br />Copy and paste to create more<br />[/tab]<br />[/tabs]<br />';
|
39 |
+
}
|
40 |
+
|
41 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
42 |
+
|
43 |
+
// Return
|
44 |
+
tinyMCEPopup.close();
|
45 |
+
}
|
46 |
+
};
|
47 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
48 |
+
|
49 |
+
</script>
|
50 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog select {display:block; height:28px; width:200px; font-size:12px;} #icon-dialog a#insert {margin-top:10px;}
|
51 |
+
|
52 |
+
</style>
|
53 |
+
|
54 |
+
</head>
|
55 |
+
<body>
|
56 |
+
<div id="icon-dialog">
|
57 |
+
<form action="/" method="get" accept-charset="utf-8">
|
58 |
+
<div>
|
59 |
+
<label for="tabs"><?php _e("Accordion or Tabs", "virtue"); ?></label>
|
60 |
+
<select name="tabs" id="tabs">
|
61 |
+
<option value="accordion"><?php _e("Accordion", "virtue"); ?></option>
|
62 |
+
<option value="tabs"><?php _e("Tabs", "virtue"); ?></option>
|
63 |
+
</select>
|
64 |
+
</div>
|
65 |
+
<div>
|
66 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", "virtue"); ?></a>
|
67 |
+
</div>
|
68 |
+
</form>
|
69 |
+
</div>
|
70 |
+
</body>
|
71 |
+
</html>
|
trunk/shortcodes/accordion/accordion_shortgen.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadaccordion', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
ed.addCommand('mcekadaccordion', function() {
|
6 |
+
ed.windowManager.open({
|
7 |
+
file: ajaxurl + '?action=kadaccordion_tinymce',
|
8 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
9 |
+
height : 110 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
10 |
+
inline : 1
|
11 |
+
}, {
|
12 |
+
plugin_url : url
|
13 |
+
});
|
14 |
+
});
|
15 |
+
|
16 |
+
// Register buttons
|
17 |
+
ed.addButton('kadaccordion', {title : 'Insert Accordion or Tab', cmd : 'mcekadaccordion', image: url + '/img/accordion.png' });
|
18 |
+
},
|
19 |
+
|
20 |
+
getInfo : function() {
|
21 |
+
return {
|
22 |
+
longname : 'Insert Accordion or Tab',
|
23 |
+
author : 'Benjamin Ritner',
|
24 |
+
authorurl : 'http://kadencethemes.com',
|
25 |
+
infourl : 'http://kadencethemes.com',
|
26 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
27 |
+
};
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register plugin
|
32 |
+
// first parameter is the button ID and must match ID elsewhere
|
33 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
34 |
+
tinymce.PluginManager.add('kadaccordion', tinymce.plugins.kadaccordion);
|
35 |
+
|
36 |
+
})();
|
trunk/shortcodes/accordion/img/accordion.png
ADDED
Binary file
|
trunk/shortcodes/btns/btns_popup.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Button", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var text = jQuery('#icon-dialog input#text').val();
|
31 |
+
var tcolor = jQuery('#icon-dialog select#text-color').val();
|
32 |
+
var texthex = jQuery('#icon-dialog input#text-color-hex').val();
|
33 |
+
var bcolor = jQuery('#icon-dialog select#btn-color').val();
|
34 |
+
var btnhex = jQuery('#icon-dialog input#btn-color-hex').val();
|
35 |
+
var btnlink = jQuery('#icon-dialog input#btn-link').val();
|
36 |
+
|
37 |
+
var output = '';
|
38 |
+
|
39 |
+
// setup the output of our shortcode
|
40 |
+
output = '[btn ';
|
41 |
+
output += 'text="' + text + '" ';
|
42 |
+
if(texthex)
|
43 |
+
output += ' tcolor=' + texthex + ' ';
|
44 |
+
else {
|
45 |
+
output += 'tcolor=' + tcolor + ' ';
|
46 |
+
}
|
47 |
+
if(btnhex) {
|
48 |
+
output += ' bcolor=' + btnhex + ' ';
|
49 |
+
} else {
|
50 |
+
if(bcolor) {
|
51 |
+
output += 'bcolor=' + bcolor + ' ';
|
52 |
+
} else {
|
53 |
+
output += '';
|
54 |
+
}
|
55 |
+
}
|
56 |
+
output += 'link="' + btnlink +'"';
|
57 |
+
output += ']';
|
58 |
+
|
59 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
60 |
+
|
61 |
+
// Return
|
62 |
+
tinyMCEPopup.close();
|
63 |
+
}
|
64 |
+
};
|
65 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
66 |
+
|
67 |
+
</script>
|
68 |
+
|
69 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog label.hex {font-size:12px; line-height:24px; display:inline-block; padding:6px 4px 6px 12px;} #icon-dialog select {display:block; height:28px; width:300px; font-size:12px;} #icon-dialog input {display:block; width:300px; height:24px;} #icon-dialog input.btn-hex {display:inline-block; width:120px; height:24px;} #icon-dialog a#insert {margin-top:15px;} .linebreak {margin-bottom:6px; border-bottom: solid 1px #d7d7d7; padding-bottom:6px}
|
70 |
+
|
71 |
+
</style>
|
72 |
+
|
73 |
+
</head>
|
74 |
+
<body>
|
75 |
+
<div id="icon-dialog">
|
76 |
+
<form action="/" method="get" accept-charset="utf-8">
|
77 |
+
<div class="linebreak">
|
78 |
+
<div>
|
79 |
+
<label for="btn-text"><?php _e("Button Text", "virtue"); ?></label>
|
80 |
+
<input type="text" name="btn_text" value="" id="text" />
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
<div class="linebreak">
|
84 |
+
<div>
|
85 |
+
<label for="btn-color"><?php _e("Text Color", "virtue"); ?></label>
|
86 |
+
<select name="btn-color" id="text-color">
|
87 |
+
<option value="#FFF"><?php _e("White", "virtue"); ?></option>
|
88 |
+
<option value="#F2F2F2"><?php _e("Off-White", "virtue"); ?></option>
|
89 |
+
<option value="#000"><?php _e("Black", "virtue"); ?></option>
|
90 |
+
<option value="#CDCDCD"><?php _e("Light-Gray", "virtue"); ?></option>
|
91 |
+
<option value="#999"><?php _e("Gray", "virtue"); ?></option>
|
92 |
+
<option value="#444"><?php _e("Dark-Gray", "virtue"); ?></option>
|
93 |
+
<option value="#CCC"><?php _e("Silver", "virtue"); ?></option>
|
94 |
+
<option value="#FF0000"><?php _e("Red", "virtue"); ?></option>
|
95 |
+
<option value="#0000FF"><?php _e("Blue", "virtue"); ?></option>
|
96 |
+
<option value="#008000"><?php _e("Green", "virtue"); ?></option>
|
97 |
+
<option value="#FFFF00"><?php _e("Yellow", "virtue"); ?></option>
|
98 |
+
<option value="#FFA500"><?php _e("Orange", "virtue"); ?></option>
|
99 |
+
<option value="#FF00FF"><?php _e("Pink", "virtue"); ?></option>
|
100 |
+
<option value="#800080"><?php _e("Purple", "virtue"); ?></option>
|
101 |
+
<option value="#8B4513"><?php _e("Brown", "virtue"); ?></option>
|
102 |
+
<option value="#800000"><?php _e("Maroon", "virtue"); ?></option>
|
103 |
+
</select>
|
104 |
+
</div>
|
105 |
+
<div>
|
106 |
+
<label class="hex" for="text-color-hex"><?php _e("Or Type Hex Color", "virtue"); ?></label>
|
107 |
+
<input type="text"class="btn-hex" name="text-color-hex" value="" id="text-color-hex" />
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
<div class="linebreak">
|
111 |
+
<div>
|
112 |
+
<label for="btn-color"><?php _e("Button Color", "virtue"); ?></label>
|
113 |
+
<select name="btn-color" id="btn-color">
|
114 |
+
<option value=""><?php _e("Primary Color", "virtue"); ?></option>
|
115 |
+
<option value="#000"><?php _e("Black", "virtue"); ?></option>
|
116 |
+
<option value="#CDCDCD"><?php _e("Light-Gray", "virtue"); ?></option>
|
117 |
+
<option value="#999"><?php _e("Gray", "virtue"); ?></option>
|
118 |
+
<option value="#444"><?php _e("Dark-Gray", "virtue"); ?></option>
|
119 |
+
<option value="#CCC"><?php _e("Silver", "virtue"); ?></option>
|
120 |
+
<option value="#FFF"><?php _e("White", "virtue"); ?></option>
|
121 |
+
<option value="#F2F2F2"><?php _e("Off-White", "virtue"); ?></option>
|
122 |
+
<option value="#FF0000"><?php _e("Red", "virtue"); ?></option>
|
123 |
+
<option value="#0000FF"><?php _e("Blue", "virtue"); ?></option>
|
124 |
+
<option value="#008000"><?php _e("Green", "virtue"); ?></option>
|
125 |
+
<option value="#FFFF00"><?php _e("Yellow", "virtue"); ?></option>
|
126 |
+
<option value="#FFA500"><?php _e("Orange", "virtue"); ?></option>
|
127 |
+
<option value="#FF00FF"><?php _e("Pink", "virtue"); ?></option>
|
128 |
+
<option value="#800080"><?php _e("Purple", "virtue"); ?></option>
|
129 |
+
<option value="#8B4513"><?php _e("Brown", "virtue"); ?></option>
|
130 |
+
<option value="#800000"><?php _e("Maroon", "virtue"); ?></option>
|
131 |
+
|
132 |
+
</select>
|
133 |
+
</div>
|
134 |
+
<div>
|
135 |
+
<label class="hex" for="btn-color-hex"><?php _e("Or Type Hex Color", "virtue"); ?></label>
|
136 |
+
<input type="text" class="btn-hex" name="btn-color-hex" value="" id="btn-color-hex" />
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
<div class="linebreak">
|
140 |
+
<div>
|
141 |
+
<label for="btn-link"><?php _e("Button Link", "virtue"); ?></label>
|
142 |
+
<input type="text" name="btn-link" value="" id="btn-link" />
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
<div>
|
146 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", "virtue"); ?></a>
|
147 |
+
</div>
|
148 |
+
</form>
|
149 |
+
</div>
|
150 |
+
</body>
|
151 |
+
</html>
|
trunk/shortcodes/btns/btns_shortgen.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadbtn', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
ed.addCommand('mcekadbtn', function() {
|
6 |
+
ed.windowManager.open({
|
7 |
+
file: ajaxurl + '?action=kadbtns_tinymce',
|
8 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
9 |
+
height : 400 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
10 |
+
inline : 1
|
11 |
+
}, {
|
12 |
+
plugin_url : url
|
13 |
+
});
|
14 |
+
});
|
15 |
+
|
16 |
+
// Register buttons
|
17 |
+
ed.addButton('kadbtn', {title : 'Insert Button', cmd : 'mcekadbtn', image: url + '/img/btn.png' });
|
18 |
+
},
|
19 |
+
|
20 |
+
getInfo : function() {
|
21 |
+
return {
|
22 |
+
longname : 'Insert Button',
|
23 |
+
author : 'Benjamin Ritner',
|
24 |
+
authorurl : 'http://kadencethemes.com',
|
25 |
+
infourl : 'http://kadencethemes.com',
|
26 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
27 |
+
};
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register plugin
|
32 |
+
// first parameter is the button ID and must match ID elsewhere
|
33 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
34 |
+
tinymce.PluginManager.add('kadbtn', tinymce.plugins.kadbtn);
|
35 |
+
|
36 |
+
})();
|
trunk/shortcodes/btns/img/btn.png
ADDED
Binary file
|
trunk/shortcodes/columns/columns_popup.php
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Columns", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var coutput = jQuery('#icon-dialog select#columnoutput').val();
|
31 |
+
|
32 |
+
var output = '';
|
33 |
+
|
34 |
+
// setup the output of our shortcode
|
35 |
+
switch (coutput)
|
36 |
+
{
|
37 |
+
case '1':
|
38 |
+
output = '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnstart mceItem" title="hcolumns" />';
|
39 |
+
if(document.getElementById('2column').checked) {
|
40 |
+
output += '<div class="col-md-6"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-6 mceItem" title="columnhelper col-md-6" />';
|
41 |
+
output += '<p>add content here</p>';
|
42 |
+
output += '</div> ';
|
43 |
+
output += '<div class="col-md-6"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-6 mceItem" title="columnhelper col-md-6" />';
|
44 |
+
output += '<p>add content here</p>';
|
45 |
+
output += '</div> ';
|
46 |
+
}else if(document.getElementById('2columnright').checked) {
|
47 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
48 |
+
output += '<p>add content here</p>';
|
49 |
+
output += '</div> ';
|
50 |
+
output += '<div class="col-md-8"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-8 mceItem" title="columnhelper col-md-8" />';
|
51 |
+
output += '<p>add content here</p>';
|
52 |
+
output += '</div> ';
|
53 |
+
}else if(document.getElementById('2columnleft').checked) {
|
54 |
+
output += '<div class="col-md-8"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-8 mceItem" title="columnhelper col-md-8" />';
|
55 |
+
output += '<p>add content here</p>';
|
56 |
+
output += '</div> ';
|
57 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
58 |
+
output += '<p>add content here</p>';
|
59 |
+
output += '</div> ';
|
60 |
+
}else if(document.getElementById('3column').checked) {
|
61 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
62 |
+
output += '<p>add content here</p>';
|
63 |
+
output += '</div> ';
|
64 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
65 |
+
output += '<p>add content here</p>';
|
66 |
+
output += '</div> ';
|
67 |
+
output += '<div class="col-md-4"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-4 mceItem" title="columnhelper col-md-4" />';
|
68 |
+
output += '<p>add content here</p>';
|
69 |
+
output += '</div> ';
|
70 |
+
}else if(document.getElementById('4column').checked) {
|
71 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
72 |
+
output += '<p>add content here</p>';
|
73 |
+
output += '</div> ';
|
74 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
75 |
+
output += '<p>add content here</p>';
|
76 |
+
output += '</div> ';
|
77 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
78 |
+
output += '<p>add content here</p>';
|
79 |
+
output += '</div> ';
|
80 |
+
output += '<div class="col-md-3"><img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper col-md-3 mceItem" title="columnhelper col-md-3" />';
|
81 |
+
output += '<p>add content here</p>';
|
82 |
+
output += '</div> ';
|
83 |
+
}
|
84 |
+
output += '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnend mceItem" title="/hcolumns" />';
|
85 |
+
|
86 |
+
break;
|
87 |
+
default:
|
88 |
+
output = '[columns] ';
|
89 |
+
if(document.getElementById('2column').checked) {
|
90 |
+
output += '[span6] ';
|
91 |
+
output += '<p>add content here</p>';
|
92 |
+
output += '[/span6]';
|
93 |
+
output += '[span6] ';
|
94 |
+
output += '<p>add content here</p>';
|
95 |
+
output += '[/span6]';
|
96 |
+
}else if(document.getElementById('2columnright').checked) {
|
97 |
+
output += '[span4] ';
|
98 |
+
output += '<p>add content here</p>';
|
99 |
+
output += '[/span4]';
|
100 |
+
output += '[span8] ';
|
101 |
+
output += '<p>add content here</p>';
|
102 |
+
output += '[/span8]';
|
103 |
+
}else if(document.getElementById('2columnleft').checked) {
|
104 |
+
output += '[span8] ';
|
105 |
+
output += '<p>add content here</p>';
|
106 |
+
output += '[/span8]';
|
107 |
+
output += '[span4] ';
|
108 |
+
output += '<p>add content here</p>';
|
109 |
+
output += '[/span4]';
|
110 |
+
}else if(document.getElementById('3column').checked) {
|
111 |
+
output += '[span4] ';
|
112 |
+
output += '<p>add content here</p>';
|
113 |
+
output += '[/span4]';
|
114 |
+
output += '[span4] ';
|
115 |
+
output += '<p>add content here</p>';
|
116 |
+
output += '[/span4]';
|
117 |
+
output += '[span4] ';
|
118 |
+
output += '<p>add content here</p>';
|
119 |
+
output += '[/span4]';
|
120 |
+
}else if(document.getElementById('4column').checked) {
|
121 |
+
output += '[span3] ';
|
122 |
+
output += '<p>add content here</p>';
|
123 |
+
output += '[/span3]';
|
124 |
+
output += '[span3] ';
|
125 |
+
output += '<p>add content here</p>';
|
126 |
+
output += '[/span3]';
|
127 |
+
output += '[span3] ';
|
128 |
+
output += '<p>add content here</p>';
|
129 |
+
output += '[/span3]';
|
130 |
+
output += '[span3] ';
|
131 |
+
output += '<p>add content here</p>';
|
132 |
+
output += '[/span3]';
|
133 |
+
}
|
134 |
+
|
135 |
+
output += '[/columns]';
|
136 |
+
}
|
137 |
+
|
138 |
+
tinyMCEPopup.execCommand('mceReplaceContent', false, output);
|
139 |
+
|
140 |
+
// Return
|
141 |
+
tinyMCEPopup.close();
|
142 |
+
}
|
143 |
+
};
|
144 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
145 |
+
|
146 |
+
</script>
|
147 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:12px; line-height:24px; width:150px; display:inline-block; text-align:right;} #icon-dialog label.imglabel {width: auto; text-align: left; padding-left: 10px;} #icon-dialog a#insert {margin-top:2px;} #icon-dialog p {font-size:12px;} #icon-dialog .option-row {padding-bottom:6px; border-bottom: solid 1px #d7d7d7; margin-bottom:8px;} #icon-dialog select {width:159px; height:24px;} </style>
|
148 |
+
|
149 |
+
</head>
|
150 |
+
<body>
|
151 |
+
<div id="icon-dialog">
|
152 |
+
<form action="/" method="get" id="columnform" accept-charset="utf-8">
|
153 |
+
<div>
|
154 |
+
<p>Choose a Column Layout:</p>
|
155 |
+
</div>
|
156 |
+
<div class="option-row">
|
157 |
+
<label for="column-option">Choose Column Output:</label>
|
158 |
+
<select name="column-one" id="columnoutput">
|
159 |
+
<option value="2">Shortcodes</option>
|
160 |
+
<option value="1">Visual Aid</option>
|
161 |
+
</select>
|
162 |
+
</div>
|
163 |
+
<div class="option-row">
|
164 |
+
<label for="2column">Two Column</label>
|
165 |
+
<input type="radio" name="column" value="2column" id="2column">
|
166 |
+
<label class="imglabel" for="2column"><img src="<?php echo get_template_directory_uri()?>/assets/img/twocolumn.jpg" /></label>
|
167 |
+
</div>
|
168 |
+
<div class="option-row">
|
169 |
+
<label for="2columnright">Two Column Offset Right</label>
|
170 |
+
<input type="radio" name="column" value="2columnright"id="2columnright">
|
171 |
+
<label class="imglabel" for="2columnright"><img src="<?php echo get_template_directory_uri()?>/assets/img/twocolumnright.jpg" /></label>
|
172 |
+
</div>
|
173 |
+
<div class="option-row">
|
174 |
+
<label for="2columnleft">Two Column Offset Left</label>
|
175 |
+
<input type="radio" name="column" value="2columnleft"id="2columnleft">
|
176 |
+
<label class="imglabel" for="2columnleft"><img src="<?php echo get_template_directory_uri()?>/assets/img/twocolumnleft.jpg" /></label>
|
177 |
+
</div>
|
178 |
+
<div class="option-row">
|
179 |
+
<label for="3column">Three Column</label>
|
180 |
+
<input type="radio" name="column" value="3column"id="3column">
|
181 |
+
<label class="imglabel" for="3column"><img src="<?php echo get_template_directory_uri()?>/assets/img/threecolumn.jpg" /></label>
|
182 |
+
</div>
|
183 |
+
<div class="option-row">
|
184 |
+
<label for="4column">Four Column</label>
|
185 |
+
<input type="radio" name="column" value="4column"id="4column">
|
186 |
+
<label class="imglabel" for="4column"><img src="<?php echo get_template_directory_uri()?>/assets/img/fourcolumn.jpg" /></label>
|
187 |
+
</div>
|
188 |
+
<div>
|
189 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center">Insert</a>
|
190 |
+
</div>
|
191 |
+
</form>
|
192 |
+
</div>
|
193 |
+
</body>
|
194 |
+
</html>
|
trunk/shortcodes/columns/columns_shortgen.js
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadcolumns', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
var t = this;
|
6 |
+
ed.addCommand('mcekadcolumns', function() {
|
7 |
+
ed.windowManager.open({
|
8 |
+
file: ajaxurl + '?action=kadcolumns_tinymce',
|
9 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
10 |
+
height : 420 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
11 |
+
inline : 1
|
12 |
+
}, {
|
13 |
+
plugin_url : url
|
14 |
+
});
|
15 |
+
});
|
16 |
+
|
17 |
+
// Register buttons
|
18 |
+
ed.addButton('kadcolumns', {title : 'Insert Columns', cmd : 'mcekadcolumns', image: url + '/img/columns.png' });
|
19 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
20 |
+
o.content = t._do_column(o.content);
|
21 |
+
});
|
22 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
23 |
+
o.content = t._do_columnstart(o.content);
|
24 |
+
});
|
25 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
26 |
+
o.content = t._do_columnend(o.content);
|
27 |
+
});
|
28 |
+
|
29 |
+
ed.onPostProcess.add(function(ed, o) {
|
30 |
+
if (o.get)
|
31 |
+
o.content = t._get_column(o.content);
|
32 |
+
});
|
33 |
+
ed.onPostProcess.add(function(ed, o) {
|
34 |
+
if (o.get)
|
35 |
+
o.content = t._get_columnstart(o.content);
|
36 |
+
});
|
37 |
+
ed.onPostProcess.add(function(ed, o) {
|
38 |
+
if (o.get)
|
39 |
+
o.content = t._get_columnend(o.content);
|
40 |
+
});
|
41 |
+
},
|
42 |
+
_do_column : function(co) {
|
43 |
+
return co.replace(/\[columnhelper([^\]]*)\]/g, function(a,b){
|
44 |
+
return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnhelper '+tinymce.DOM.encode(b)+' mceItem" title="columnhelper'+tinymce.DOM.encode(b)+'" />';
|
45 |
+
});
|
46 |
+
},
|
47 |
+
_do_columnstart : function(co) {
|
48 |
+
return co.replace(/\[hcolumns([^\]]*)\]/g, function(a,b){
|
49 |
+
return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnstart mceItem" title="hcolumns" />';
|
50 |
+
});
|
51 |
+
},
|
52 |
+
_do_columnend : function(co) {
|
53 |
+
return co.replace(/\[\/hcolumns([^\]]*)\]/g, function(a,b){
|
54 |
+
return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="columnend mceItem" title="/hcolumns" />';
|
55 |
+
});
|
56 |
+
},
|
57 |
+
|
58 |
+
_get_column : function(co) {
|
59 |
+
|
60 |
+
function getAttr(s, n) {
|
61 |
+
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
|
62 |
+
return n ? tinymce.DOM.decode(n[1]) : '';
|
63 |
+
};
|
64 |
+
|
65 |
+
return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
|
66 |
+
var cls = getAttr(im, 'class');
|
67 |
+
|
68 |
+
if ( cls.indexOf('columnhelper') != -1 )
|
69 |
+
return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
|
70 |
+
|
71 |
+
return a;
|
72 |
+
});
|
73 |
+
},
|
74 |
+
_get_columnstart : function(co) {
|
75 |
+
|
76 |
+
function getAttr(s, n) {
|
77 |
+
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
|
78 |
+
return n ? tinymce.DOM.decode(n[1]) : '';
|
79 |
+
};
|
80 |
+
|
81 |
+
return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
|
82 |
+
var cls = getAttr(im, 'class');
|
83 |
+
|
84 |
+
if ( cls.indexOf('columnstart') != -1 )
|
85 |
+
return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
|
86 |
+
|
87 |
+
return a;
|
88 |
+
});
|
89 |
+
},
|
90 |
+
_get_columnend : function(co) {
|
91 |
+
|
92 |
+
function getAttr(s, n) {
|
93 |
+
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
|
94 |
+
return n ? tinymce.DOM.decode(n[1]) : '';
|
95 |
+
};
|
96 |
+
|
97 |
+
return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
|
98 |
+
var cls = getAttr(im, 'class');
|
99 |
+
|
100 |
+
if ( cls.indexOf('columnend') != -1 )
|
101 |
+
return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
|
102 |
+
|
103 |
+
return a;
|
104 |
+
});
|
105 |
+
},
|
106 |
+
|
107 |
+
getInfo : function() {
|
108 |
+
return {
|
109 |
+
longname : 'Insert Columns',
|
110 |
+
author : 'Benjamin Ritner',
|
111 |
+
authorurl : 'http://kadencethemes.com',
|
112 |
+
infourl : 'http://kadencethemes.com',
|
113 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
114 |
+
};
|
115 |
+
}
|
116 |
+
});
|
117 |
+
|
118 |
+
// Register plugin
|
119 |
+
// first parameter is the button ID and must match ID elsewhere
|
120 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
121 |
+
tinymce.PluginManager.add('kadcolumns', tinymce.plugins.kadcolumns);
|
122 |
+
|
123 |
+
})();
|
trunk/shortcodes/columns/img/columns.png
ADDED
Binary file
|
trunk/shortcodes/divider/divider_popup.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Divider", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var divider = jQuery('#icon-dialog select#divider').val();
|
31 |
+
|
32 |
+
var output = '';
|
33 |
+
|
34 |
+
// setup the output of our shortcode
|
35 |
+
switch(divider) {
|
36 |
+
case 'hr':
|
37 |
+
output += '[hr]';
|
38 |
+
break;
|
39 |
+
case 'space_20':
|
40 |
+
output += '[space_20]';
|
41 |
+
break;
|
42 |
+
case 'space_40':
|
43 |
+
output += '[space_40]';
|
44 |
+
break;
|
45 |
+
case 'space_80':
|
46 |
+
output += '[space_80]';
|
47 |
+
break;
|
48 |
+
default:
|
49 |
+
output += '[clear]';
|
50 |
+
}
|
51 |
+
|
52 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
53 |
+
|
54 |
+
// Return
|
55 |
+
tinyMCEPopup.close();
|
56 |
+
}
|
57 |
+
};
|
58 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
59 |
+
|
60 |
+
</script>
|
61 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog select {display:block; height:28px; width:200px; font-size:12px;} #icon-dialog a#insert {margin-top:10px;}
|
62 |
+
|
63 |
+
</style>
|
64 |
+
|
65 |
+
</head>
|
66 |
+
<body>
|
67 |
+
<div id="icon-dialog">
|
68 |
+
<form action="/" method="get" accept-charset="utf-8">
|
69 |
+
<div>
|
70 |
+
<label for="dividers"><?php _e("Choose a Divider", "virtue"); ?></label>
|
71 |
+
<select name="divider" id="divider">
|
72 |
+
<option value="hr"><?php _e("Line", "virtue"); ?></option>
|
73 |
+
<option value="space_20"><?php _e("Padding Small", "virtue"); ?></option>
|
74 |
+
<option value="space_40"><?php _e("Padding Medium", "virtue"); ?></option>
|
75 |
+
<option value="space_80"><?php _e("Padding Large", "virtue"); ?></option>
|
76 |
+
<option value="clear"><?php _e("Clear", "virtue"); ?></option>
|
77 |
+
</select>
|
78 |
+
</div>
|
79 |
+
<div>
|
80 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", "virtue"); ?></a>
|
81 |
+
</div>
|
82 |
+
</form>
|
83 |
+
</div>
|
84 |
+
</body>
|
85 |
+
</html>
|
trunk/shortcodes/divider/divider_shortgen.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kaddivider', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
ed.addCommand('mcekaddivider', function() {
|
6 |
+
ed.windowManager.open({
|
7 |
+
file: ajaxurl + '?action=kaddivider_tinymce',
|
8 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
9 |
+
height : 110 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
10 |
+
inline : 1
|
11 |
+
}, {
|
12 |
+
plugin_url : url
|
13 |
+
});
|
14 |
+
});
|
15 |
+
|
16 |
+
// Register buttons
|
17 |
+
ed.addButton('kaddivider', {title : 'Insert Divider', cmd : 'mcekaddivider', image: url + '/img/divider.png' });
|
18 |
+
},
|
19 |
+
|
20 |
+
getInfo : function() {
|
21 |
+
return {
|
22 |
+
longname : 'Insert Divider',
|
23 |
+
author : 'Benjamin Ritner',
|
24 |
+
authorurl : 'http://kadencethemes.com',
|
25 |
+
infourl : 'http://kadencethemes.com',
|
26 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
27 |
+
};
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register plugin
|
32 |
+
// first parameter is the button ID and must match ID elsewhere
|
33 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
34 |
+
tinymce.PluginManager.add('kaddivider', tinymce.plugins.kaddivider);
|
35 |
+
|
36 |
+
})();
|
trunk/shortcodes/divider/img/divider.png
ADDED
Binary file
|
trunk/shortcodes/icons/icon_popup.php
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Icon", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/lib/icons/js/icon-select.js"></script>
|
17 |
+
<link href="<?php echo get_template_directory_uri() ?>/lib/icons/css/icon-select.css" rel="stylesheet"/>
|
18 |
+
<link href="<?php echo get_template_directory_uri() ?>/assets/css/icons.css" rel="stylesheet"/>
|
19 |
+
<script type="text/javascript">
|
20 |
+
|
21 |
+
var ButtonDialog = {
|
22 |
+
local_ed : 'ed',
|
23 |
+
init : function(ed) {
|
24 |
+
ButtonDialog.local_ed = ed;
|
25 |
+
tinyMCEPopup.resizeToInnerSize();
|
26 |
+
},
|
27 |
+
insert : function insertButton(ed) {
|
28 |
+
|
29 |
+
// Try and remove existing style / blockquote
|
30 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
31 |
+
|
32 |
+
// set up variables to contain our input values
|
33 |
+
var icon = jQuery('#icon-dialog select#icon-icon').val();
|
34 |
+
var size = jQuery('#icon-dialog select#icon-size').val();
|
35 |
+
var color = jQuery('#icon-dialog select#icon-color').val();
|
36 |
+
var colorhex = jQuery('#icon-dialog input#icon-color-hex').val();
|
37 |
+
var float = jQuery('#icon-dialog select#icon-align').val();
|
38 |
+
|
39 |
+
var output = '';
|
40 |
+
|
41 |
+
// setup the output of our shortcode
|
42 |
+
output = '[icon ';
|
43 |
+
output += 'icon=' + icon + ' ';
|
44 |
+
output += 'size=' + size + ' ';
|
45 |
+
if(colorhex)
|
46 |
+
output += ' color=' + colorhex + ' ';
|
47 |
+
else {
|
48 |
+
output += 'color=' + color + ' ';
|
49 |
+
}
|
50 |
+
if(float == 'none')
|
51 |
+
output += '';
|
52 |
+
else {
|
53 |
+
output += 'float=' + float;
|
54 |
+
}
|
55 |
+
|
56 |
+
// check to see if the TEXT field is blank
|
57 |
+
output += ']';
|
58 |
+
|
59 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
60 |
+
|
61 |
+
// Return
|
62 |
+
tinyMCEPopup.close();
|
63 |
+
}
|
64 |
+
};
|
65 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
66 |
+
|
67 |
+
</script>
|
68 |
+
<?php $icons = array( 'icon-glass', 'icon-music', 'icon-search', 'icon-envelope-alt', 'icon-heart', 'icon-star', 'icon-star-empty', 'icon-user', 'icon-film', 'icon-th-large', 'icon-th', 'icon-th-list', 'icon-ok', 'icon-remove', 'icon-zoom-in', 'icon-zoom-out', 'icon-power-off', 'icon-off', 'icon-signal', 'icon-gear', 'icon-cog', 'icon-trash', 'icon-home', 'icon-file-alt', 'icon-time', 'icon-road', 'icon-download-alt', 'icon-download', 'icon-upload', 'icon-inbox', 'icon-play-circle', 'icon-rotate-right', 'icon-repeat', 'icon-refresh', 'icon-list-alt', 'icon-lock', 'icon-flag', 'icon-headphones', 'icon-volume-off', 'icon-volume-down', 'icon-volume-up', 'icon-qrcode', 'icon-barcode', 'icon-tag', 'icon-tags', 'icon-book', 'icon-bookmark', 'icon-print', 'icon-camera', 'icon-font', 'icon-bold', 'icon-italic', 'icon-text-height', 'icon-text-width', 'icon-align-left', 'icon-align-center', 'icon-align-right', 'icon-align-justify', 'icon-list', 'icon-indent-left', 'icon-indent-right', 'icon-facetime-video', 'icon-picture', 'icon-pencil', 'icon-map-marker', 'icon-adjust', 'icon-tint', 'icon-edit', 'icon-share', 'icon-check', 'icon-move', 'icon-step-backward', 'icon-fast-backward', 'icon-backward', 'icon-play', 'icon-pause', 'icon-stop', 'icon-forward', 'icon-fast-forward', 'icon-step-forward', 'icon-eject', 'icon-chevron-left', 'icon-chevron-right', 'icon-plus-sign', 'icon-minus-sign', 'icon-remove-sign', 'icon-ok-sign', 'icon-question-sign', 'icon-info-sign', 'icon-screenshot', 'icon-remove-circle', 'icon-ok-circle', 'icon-ban-circle', 'icon-arrow-left', 'icon-arrow-right', 'icon-arrow-up', 'icon-arrow-down', 'icon-mail-forward', 'icon-share-alt', 'icon-resize-full', 'icon-resize-small', 'icon-plus', 'icon-minus', 'icon-asterisk', 'icon-exclamation-sign', 'icon-gift', 'icon-leaf', 'icon-fire', 'icon-eye-open', 'icon-eye-close', 'icon-warning-sign', 'icon-plane', 'icon-calendar', 'icon-random', 'icon-comment', 'icon-magnet', 'icon-chevron-up', 'icon-chevron-down', 'icon-retweet', 'icon-shopping-cart', 'icon-folder-close', 'icon-folder-open', 'icon-resize-vertical', 'icon-resize-horizontal', 'icon-bar-chart', 'icon-twitter-sign', 'icon-facebook-sign', 'icon-camera-retro', 'icon-key', 'icon-gears', 'icon-cogs', 'icon-comments', 'icon-thumbs-up-alt', 'icon-thumbs-down-alt', 'icon-star-half', 'icon-heart-empty', 'icon-signout', 'icon-linkedin-sign', 'icon-pushpin', 'icon-external-link', 'icon-signin', 'icon-trophy', 'icon-github-sign', 'icon-upload-alt', 'icon-lemon', 'icon-phone', 'icon-unchecked', 'icon-check-empty', 'icon-bookmark-empty', 'icon-phone-sign', 'icon-twitter', 'icon-facebook', 'icon-github', 'icon-unlock', 'icon-credit-card', 'icon-rss', 'icon-hdd', 'icon-bullhorn', 'icon-bell', 'icon-certificate', 'icon-hand-right', 'icon-hand-left', 'icon-hand-up', 'icon-hand-down', 'icon-circle-arrow-left', 'icon-circle-arrow-right', 'icon-circle-arrow-up', 'icon-circle-arrow-down', 'icon-globe', 'icon-wrench', 'icon-tasks', 'icon-filter', 'icon-briefcase', 'icon-fullscreen', 'icon-group', 'icon-link', 'icon-cloud', 'icon-beaker', 'icon-cut', 'icon-copy', 'icon-paperclip', 'icon-paper-clip', 'icon-save', 'icon-sign-blank', 'icon-reorder', 'icon-list-ul', 'icon-list-ol', 'icon-strikethrough', 'icon-underline', 'icon-table', 'icon-magic', 'icon-truck', 'icon-pinterest', 'icon-pinterest-sign', 'icon-google-plus-sign', 'icon-google-plus', 'icon-money', 'icon-caret-down', 'icon-caret-up', 'icon-caret-left', 'icon-caret-right', 'icon-columns', 'icon-sort', 'icon-sort-down', 'icon-sort-up', 'icon-envelope', 'icon-linkedin', 'icon-rotate-left', 'icon-undo', 'icon-legal', 'icon-dashboard', 'icon-comment-alt', 'icon-comments-alt', 'icon-bolt', 'icon-sitemap', 'icon-umbrella', 'icon-paste', 'icon-lightbulb', 'icon-exchange', 'icon-cloud-download', 'icon-cloud-upload', 'icon-user-md', 'icon-stethoscope', 'icon-suitcase', 'icon-bell-alt', 'icon-coffee', 'icon-food', 'icon-file-text-alt', 'icon-building', 'icon-hospital', 'icon-ambulance', 'icon-medkit', 'icon-fighter-jet', 'icon-beer', 'icon-h-sign', 'icon-plus-sign-alt', 'icon-double-angle-left', 'icon-double-angle-right', 'icon-double-angle-up', 'icon-double-angle-down', 'icon-angle-left', 'icon-angle-right', 'icon-angle-up', 'icon-angle-down', 'icon-desktop', 'icon-laptop', 'icon-tablet', 'icon-mobile-phone', 'icon-circle-blank', 'icon-quote-left', 'icon-quote-right', 'icon-spinner', 'icon-circle', 'icon-mail-reply', 'icon-reply', 'icon-github-alt', 'icon-folder-close-alt', 'icon-folder-open-alt', 'icon-expand-alt', 'icon-collapse-alt', 'icon-smile', 'icon-frown', 'icon-meh', 'icon-gamepad', 'icon-keyboard', 'icon-flag-alt', 'icon-flag-checkered', 'icon-terminal', 'icon-code', 'icon-reply-all', 'icon-mail-reply-all', 'icon-star-half-full', 'icon-star-half-empty', 'icon-location-arrow', 'icon-crop', 'icon-code-fork', 'icon-unlink', 'icon-question', 'icon-info', 'icon-exclamation', 'icon-superscript', 'icon-subscript', 'icon-eraser', 'icon-puzzle-piece', 'icon-microphone', 'icon-microphone-off', 'icon-shield', 'icon-calendar-empty', 'icon-fire-extinguisher', 'icon-rocket', 'icon-maxcdn', 'icon-chevron-sign-left', 'icon-chevron-sign-right', 'icon-chevron-sign-up', 'icon-chevron-sign-down', 'icon-html5', 'icon-css3', 'icon-anchor', 'icon-unlock-alt', 'icon-bullseye', 'icon-ellipsis-horizontal', 'icon-ellipsis-vertical', 'icon-rss-sign', 'icon-play-sign', 'icon-ticket', 'icon-minus-sign-alt', 'icon-check-minus', 'icon-level-up', 'icon-level-down', 'icon-check-sign', 'icon-edit-sign', 'icon-external-link-sign', 'icon-share-sign', 'icon-compass', 'icon-collapse', 'icon-collapse-top', 'icon-expand', 'icon-euro', 'icon-eur', 'icon-gbp', 'icon-dollar', 'icon-usd', 'icon-rupee', 'icon-inr', 'icon-yen', 'icon-jpy', 'icon-renminbi', 'icon-cny', 'icon-won', 'icon-krw', 'icon-bitcoin', 'icon-btc', 'icon-file', 'icon-file-text', 'icon-sort-by-alphabet', 'icon-sort-by-alphabet-alt', 'icon-sort-by-attributes', 'icon-sort-by-attributes-alt', 'icon-sort-by-order', 'icon-sort-by-order-alt', 'icon-thumbs-up', 'icon-thumbs-down', 'icon-youtube-sign', 'icon-youtube', 'icon-xing', 'icon-xing-sign', 'icon-youtube-play', 'icon-dropbox', 'icon-stackexchange', 'icon-instagram', 'icon-flickr', 'icon-adn', 'icon-bitbucket', 'icon-bitbucket-sign', 'icon-tumblr', 'icon-tumblr-sign', 'icon-long-arrow-down', 'icon-long-arrow-up', 'icon-long-arrow-left', 'icon-long-arrow-right', 'icon-apple', 'icon-windows', 'icon-android', 'icon-linux', 'icon-dribbble', 'icon-skype', 'icon-foursquare', 'icon-trello', 'icon-female', 'icon-male', 'icon-gittip', 'icon-sun', 'icon-moon', 'icon-archive', 'icon-bug', 'icon-vk', 'icon-weibo', 'icon-renren');
|
69 |
+
|
70 |
+
?>
|
71 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog label.hex {font-size:12px; line-height:24px; display:inline-block; padding:6px 4px 6px 12px;} .linebreak {margin-bottom:6px; border-bottom: solid 1px #d7d7d7; padding-bottom:6px} #icon-dialog input#icon-color-hex {display:inline-block; height:24px;} #icon-dialog a#insert {margin-top:15px;}
|
72 |
+
|
73 |
+
</style>
|
74 |
+
|
75 |
+
</head>
|
76 |
+
<body>
|
77 |
+
<div id="icon-dialog">
|
78 |
+
<form action="/" method="get" accept-charset="utf-8">
|
79 |
+
<div class="linebreak">
|
80 |
+
<div>
|
81 |
+
<label for="button-url">Choose Icon</label>
|
82 |
+
<select name="icon-icon" class="kad_icomoon" id="icon-icon">
|
83 |
+
<?php foreach ($icons as $icon) {
|
84 |
+
echo '<option value="'.$icon. '">'.$icon. '</option>';
|
85 |
+
}?>
|
86 |
+
</select>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
<div class="linebreak">
|
90 |
+
<div>
|
91 |
+
<label for="icon-size">Icon Size</label>
|
92 |
+
<select name="icon-icon" class="kad_icomoon" id="icon-size">
|
93 |
+
<option value="5px">5px</option>
|
94 |
+
<option value="6px">6px</option>
|
95 |
+
<option value="7px">7px</option>
|
96 |
+
<option value="8px">8px</option>
|
97 |
+
<option value="9px">9px</option>
|
98 |
+
<option value="10px">10px</option>
|
99 |
+
<option value="11px">11px</option>
|
100 |
+
<option value="12px">12px</option>
|
101 |
+
<option value="13px">13px</option>
|
102 |
+
<option value="14px" selected="selected">14px</option>
|
103 |
+
<option value="15px">15px</option>
|
104 |
+
<option value="16px">16px</option>
|
105 |
+
<option value="17px">17px</option>
|
106 |
+
<option value="18px">18px</option>
|
107 |
+
<option value="19px">19px</option>
|
108 |
+
<option value="20px">20px</option>
|
109 |
+
<option value="21px">21px</option>
|
110 |
+
<option value="22px">22px</option>
|
111 |
+
<option value="23px">23px</option>
|
112 |
+
<option value="24px">24px</option>
|
113 |
+
<option value="25px">25px</option>
|
114 |
+
<option value="26px">26px</option>
|
115 |
+
<option value="27px">27px</option>
|
116 |
+
<option value="28px">28px</option>
|
117 |
+
<option value="29px">29px</option>
|
118 |
+
<option value="30px">30px</option>
|
119 |
+
<option value="31px">31px</option>
|
120 |
+
<option value="32px">32px</option>
|
121 |
+
<option value="33px">33px</option>
|
122 |
+
<option value="34px">34px</option>
|
123 |
+
<option value="35px">35px</option>
|
124 |
+
<option value="36px">36px</option>
|
125 |
+
<option value="37px">37px</option>
|
126 |
+
<option value="38px">38px</option>
|
127 |
+
<option value="39px">39px</option>
|
128 |
+
<option value="40px">40px</option>
|
129 |
+
<option value="41px">41px</option>
|
130 |
+
<option value="42px">42px</option>
|
131 |
+
<option value="43px">43px</option>
|
132 |
+
<option value="44px">44px</option>
|
133 |
+
<option value="45px">45px</option>
|
134 |
+
<option value="46px">46px</option>
|
135 |
+
<option value="47px">47px</option>
|
136 |
+
<option value="48px">48px</option>
|
137 |
+
<option value="49px">49px</option>
|
138 |
+
<option value="50px">50px</option>
|
139 |
+
<option value="51px">51px</option>
|
140 |
+
<option value="52px">52px</option>
|
141 |
+
<option value="53px">53px</option>
|
142 |
+
<option value="54px">54px</option>
|
143 |
+
<option value="55px">55px</option>
|
144 |
+
<option value="56px">56px</option>
|
145 |
+
<option value="57px">57px</option>
|
146 |
+
<option value="58px">58px</option>
|
147 |
+
<option value="59px">59px</option>
|
148 |
+
<option value="60px">60px</option>
|
149 |
+
<option value="61px">61px</option>
|
150 |
+
<option value="62px">62px</option>
|
151 |
+
<option value="63px">63px</option>
|
152 |
+
<option value="64px">64px</option>
|
153 |
+
<option value="65px">65px</option>
|
154 |
+
<option value="66px">66px</option>
|
155 |
+
<option value="67px">67px</option>
|
156 |
+
<option value="68px">68px</option>
|
157 |
+
<option value="69px">69px</option>
|
158 |
+
<option value="70px">70px</option>
|
159 |
+
<option value="71px">71px</option>
|
160 |
+
<option value="72px">72px</option>
|
161 |
+
<option value="73px">73px</option>
|
162 |
+
<option value="74px">74px</option>
|
163 |
+
<option value="75px">75px</option>
|
164 |
+
<option value="76px">76px</option>
|
165 |
+
<option value="77px">77px</option>
|
166 |
+
<option value="78px">78px</option>
|
167 |
+
<option value="79px">79px</option>
|
168 |
+
<option value="80px">80px</option>
|
169 |
+
</select>
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
<div class="linebreak">
|
173 |
+
<div>
|
174 |
+
<label for="icon-color">Icon Color</label>
|
175 |
+
<select name="icon-color" class="kad_icomoon" id="icon-color">
|
176 |
+
<option value="#000">Black</option>
|
177 |
+
<option value="#CDCDCD">Light-Gray</option>
|
178 |
+
<option value="#999">Gray</option>
|
179 |
+
<option value="#444">Dark-Gray</option>
|
180 |
+
<option value="#CCC">Silver</option>
|
181 |
+
<option value="#FFF">White</option>
|
182 |
+
<option value="#F2F2F2">Off-White</option>
|
183 |
+
<option value="#FF0000">Red</option>
|
184 |
+
<option value="#0000FF">Blue</option>
|
185 |
+
<option value="#008000">Green</option>
|
186 |
+
<option value="#FFFF00">Yellow</option>
|
187 |
+
<option value="#FFA500">Orange</option>
|
188 |
+
<option value="#FF00FF">Pink</option>
|
189 |
+
<option value="#800080">Purple</option>
|
190 |
+
<option value="#8B4513">Brown</option>
|
191 |
+
<option value="#800000">Maroon</option>
|
192 |
+
|
193 |
+
</select>
|
194 |
+
</div>
|
195 |
+
<div>
|
196 |
+
<label class="hex"for="icon-color-hex">Or Type Hex Color</label>
|
197 |
+
<input type="text" name="icon-color-hex" value="" id="icon-color-hex" />
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
<div class="linebreak">
|
201 |
+
<div>
|
202 |
+
<label for="icon-align">Icon Float</label>
|
203 |
+
<select name="icon-align" class="kad_icomoon" id="icon-align">
|
204 |
+
<option value="none">None</option>
|
205 |
+
<option value="left">Left</option>
|
206 |
+
<option value="right">Right</option>
|
207 |
+
</select>
|
208 |
+
</div>
|
209 |
+
</div>
|
210 |
+
<div>
|
211 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center">Insert</a>
|
212 |
+
</div>
|
213 |
+
</form>
|
214 |
+
</div>
|
215 |
+
</body>
|
216 |
+
</html>
|
trunk/shortcodes/icons/icon_shortgen.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadicon', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
ed.addCommand('mcekadicon', function() {
|
6 |
+
ed.windowManager.open({
|
7 |
+
file: ajaxurl + '?action=kadicons_tinymce',
|
8 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
9 |
+
height : 360 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
10 |
+
inline : 1
|
11 |
+
}, {
|
12 |
+
plugin_url : url
|
13 |
+
});
|
14 |
+
});
|
15 |
+
|
16 |
+
// Register buttons
|
17 |
+
ed.addButton('kadicon', {title : 'Insert Icon', cmd : 'mcekadicon', image: url + '/img/cool.png' });
|
18 |
+
},
|
19 |
+
|
20 |
+
getInfo : function() {
|
21 |
+
return {
|
22 |
+
longname : 'Insert Icon',
|
23 |
+
author : 'Benjamin Ritner',
|
24 |
+
authorurl : 'http://kadencethemes.com',
|
25 |
+
infourl : 'http://kadencethemes.com',
|
26 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
27 |
+
};
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register plugin
|
32 |
+
// first parameter is the button ID and must match ID elsewhere
|
33 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
34 |
+
tinymce.PluginManager.add('kadicon', tinymce.plugins.kadicon);
|
35 |
+
|
36 |
+
})();
|
trunk/shortcodes/icons/img/cool.png
ADDED
Binary file
|
trunk/shortcodes/pullquote/img/quote.png
ADDED
Binary file
|
trunk/shortcodes/pullquote/quote_popup.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Styled Quote", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var quote = jQuery('#icon-dialog select#quote').val();
|
31 |
+
var align = jQuery('#icon-dialog select#align').val();
|
32 |
+
|
33 |
+
var output = '';
|
34 |
+
if(quote == 'pull')
|
35 |
+
output += '[pullquote align=' + align + ']<p>Sample Text</p>[/pullquote]<br />';
|
36 |
+
else {
|
37 |
+
output += '[blockquote align=' + align + ']<p>Sample Text </p>[/blockquote]<br />';
|
38 |
+
}
|
39 |
+
|
40 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
41 |
+
|
42 |
+
// Return
|
43 |
+
tinyMCEPopup.close();
|
44 |
+
}
|
45 |
+
};
|
46 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
47 |
+
|
48 |
+
</script>
|
49 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:14px; display:inline-block; padding:4px;} #icon-dialog select {display:block; height:28px; width:200px; font-size:12px;} .linebreak {margin-bottom:6px; border-bottom: solid 1px #d7d7d7; padding-bottom:6px} #icon-dialog a#insert {margin-top:10px;}
|
50 |
+
|
51 |
+
</style>
|
52 |
+
|
53 |
+
</head>
|
54 |
+
<body>
|
55 |
+
<div id="icon-dialog">
|
56 |
+
<form action="/" method="get" accept-charset="utf-8">
|
57 |
+
<div class="linebreak">
|
58 |
+
<div>
|
59 |
+
<label for="text"><?php _e("Style", "virtue"); ?></label>
|
60 |
+
<select name="quote" id="quote">
|
61 |
+
<option value="pull"><?php _e("Pull-Quote", "virtue"); ?></option>
|
62 |
+
<option value="block"><?php _e("Block-Quote", "virtue"); ?></option>
|
63 |
+
</select>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
<div class="linebreak">
|
67 |
+
<div>
|
68 |
+
<label for="text"><?php _e("Align", "virtue"); ?></label>
|
69 |
+
<select name="quote" id="align">
|
70 |
+
<option value="center"><?php _e("Center", "virtue"); ?></option>
|
71 |
+
<option value="left"><?php _e("Left", "virtue"); ?></option>
|
72 |
+
<option value="right"><?php _e("Right", "virtue"); ?></option>
|
73 |
+
</select>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<div>
|
77 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", "virtue"); ?></a>
|
78 |
+
</div>
|
79 |
+
</form>
|
80 |
+
</div>
|
81 |
+
</body>
|
82 |
+
</html>
|
trunk/shortcodes/pullquote/quote_shortgen.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadquote', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
// Register commands
|
5 |
+
ed.addCommand('mcekadquote', function() {
|
6 |
+
ed.windowManager.open({
|
7 |
+
file: ajaxurl + '?action=kadquote_tinymce',
|
8 |
+
width : 350 + parseInt(ed.getLang('button.delta_width', 0)), // size of our window
|
9 |
+
height : 190 + parseInt(ed.getLang('button.delta_height', 0)), // size of our window
|
10 |
+
inline : 1
|
11 |
+
}, {
|
12 |
+
plugin_url : url
|
13 |
+
});
|
14 |
+
});
|
15 |
+
|
16 |
+
// Register buttons
|
17 |
+
ed.addButton('kadquote', {title : 'Insert Styled Quote', cmd : 'mcekadquote', image: url + '/img/quote.png' });
|
18 |
+
},
|
19 |
+
|
20 |
+
getInfo : function() {
|
21 |
+
return {
|
22 |
+
longname : 'Insert Styled Quote',
|
23 |
+
author : 'Benjamin Ritner',
|
24 |
+
authorurl : 'http://kadencethemes.com',
|
25 |
+
infourl : 'http://kadencethemes.com',
|
26 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
27 |
+
};
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
+
// Register plugin
|
32 |
+
// first parameter is the button ID and must match ID elsewhere
|
33 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
34 |
+
tinymce.PluginManager.add('kadquote', tinymce.plugins.kadquote);
|
35 |
+
|
36 |
+
})();
|
trunk/shortcodes/video/img/video.png
ADDED
Binary file
|
trunk/shortcodes/video/video_popup.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
wp_enqueue_script('jquery-ui-core');
|
3 |
+
wp_enqueue_script('jquery-ui-widget');
|
4 |
+
wp_enqueue_script('jquery-ui-position');
|
5 |
+
wp_enqueue_script('jquery');
|
6 |
+
global $wp_scripts;
|
7 |
+
?>
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<head>
|
10 |
+
<title><?php _e("Insert Video", "virtue"); ?></title>
|
11 |
+
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
12 |
+
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
13 |
+
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
14 |
+
<base target="_self" />
|
15 |
+
<?php wp_print_scripts(); ?>
|
16 |
+
<script type="text/javascript">
|
17 |
+
|
18 |
+
var ButtonDialog = {
|
19 |
+
local_ed : 'ed',
|
20 |
+
init : function(ed) {
|
21 |
+
ButtonDialog.local_ed = ed;
|
22 |
+
tinyMCEPopup.resizeToInnerSize();
|
23 |
+
},
|
24 |
+
insert : function insertButton(ed) {
|
25 |
+
|
26 |
+
// Try and remove existing style / blockquote
|
27 |
+
tinyMCEPopup.execCommand('mceRemoveNode', false, null);
|
28 |
+
|
29 |
+
// set up variables to contain our input values
|
30 |
+
var video = jQuery('#icon-dialog textarea#video').val();
|
31 |
+
var width = jQuery('#icon-dialog input#width').val();
|
32 |
+
|
33 |
+
var output = '';
|
34 |
+
if(width)
|
35 |
+
output += '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="kadvideo mceItem" title="video width='+width+'" />';
|
36 |
+
else {
|
37 |
+
output += '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="kadvideo mceItem" title="video" />';
|
38 |
+
}
|
39 |
+
output += video;
|
40 |
+
output += '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="kadvideoend mceItem" title="/video" />';
|
41 |
+
|
42 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, output);
|
43 |
+
|
44 |
+
// Return
|
45 |
+
tinyMCEPopup.close();
|
46 |
+
}
|
47 |
+
};
|
48 |
+
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog);
|
49 |
+
|
50 |
+
</script>
|
51 |
+
<style type="text/css" media="screen"> #icon-dialog label {font-size:12px; display:block; padding:4px;} #icon-dialog textarea#video{display:block; height:100px; width:270px; font-size:10px;} #icon-dialog input#width{display:inline-block; height:25px; width:100px; font-size:12px; margin-bottom:10px;} #icon-dialog a#insert {margin-top:10px;}
|
52 |
+
|
53 |
+
</style>
|
54 |
+
|
55 |
+
</head>
|
56 |
+
<body>
|
57 |
+
<div id="icon-dialog">
|
58 |
+
<form action="/" method="get" accept-charset="utf-8">
|
59 |
+
<div>
|
60 |
+
<label for="tabs"><?php _e("(Optional) Max Width", "virtue"); ?></label>
|
61 |
+
<input type="text" name="width" value="" id="width" /><span style="display:inline-block; padding-left:5px;">(*<?php _e("note just use number", "virtue"); ?>)</span>
|
62 |
+
</div>
|
63 |
+
<div>
|
64 |
+
<label for="tabs"><?php _e("Video Iframe Code", "virtue"); ?></label>
|
65 |
+
<textarea name="video" id="video" /></textarea>
|
66 |
+
</div>
|
67 |
+
<div>
|
68 |
+
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", "virtue"); ?></a>
|
69 |
+
</div>
|
70 |
+
</form>
|
71 |
+
</div>
|
72 |
+
</body>
|
73 |
+
</html>
|
trunk/shortcodes/video/video_shortgen.js
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.kadvideo', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
var t = this;
|
5 |
+
// Register commands
|
6 |
+
ed.addCommand('mcekadvideo', function() {
|
7 |
+
ed.windowManager.open({
|
8 |
+
file: ajaxurl + '?action=kadvideo_tinymce',
|
9 |
+
width : 350 + ed.getLang('button.delta_width', 0), // size of our window
|
10 |
+
height : 250 + ed.getLang('button.delta_height', 0), // size of our window
|
11 |
+
inline : 1
|
12 |
+
}, {
|
13 |
+
plugin_url : url
|
14 |
+
});
|
15 |
+
});
|
16 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
17 |
+
cm.setActive('kadvideo', n.nodeName == 'IMG');
|
18 |
+
});
|
19 |
+
|
20 |
+
// Register buttons
|
21 |
+
ed.addButton('kadvideo', {title : 'Insert video', cmd : 'mcekadvideo', image: url + '/img/video.png' });
|
22 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
23 |
+
o.content = t._do_video(o.content);
|
24 |
+
});
|
25 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
26 |
+
o.content = t._do_videoend(o.content);
|
27 |
+
});
|
28 |
+
|
29 |
+
ed.onPostProcess.add(function(ed, o) {
|
30 |
+
if (o.get)
|
31 |
+
o.content = t._get_video(o.content);
|
32 |
+
});
|
33 |
+
ed.onPostProcess.add(function(ed, o) {
|
34 |
+
if (o.get)
|
35 |
+
o.content = t._get_videoend(o.content);
|
36 |
+
});
|
37 |
+
},
|
38 |
+
|
39 |
+
_do_video : function(co) {
|
40 |
+
return co.replace(/\[video([^\]]*)\]/g, function(a,b){
|
41 |
+
return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="kadvideo mceItem" title="video'+tinymce.DOM.encode(b)+'" />';
|
42 |
+
});
|
43 |
+
},
|
44 |
+
_do_videoend : function(co) {
|
45 |
+
return co.replace(/\[\/video([^\]]*)\]/g, function(a,b){
|
46 |
+
return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="kadvideoend mceItem" title="/video" />';
|
47 |
+
});
|
48 |
+
},
|
49 |
+
|
50 |
+
_get_video : function(co) {
|
51 |
+
|
52 |
+
function getAttr(s, n) {
|
53 |
+
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
|
54 |
+
return n ? tinymce.DOM.decode(n[1]) : '';
|
55 |
+
};
|
56 |
+
|
57 |
+
return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
|
58 |
+
var cls = getAttr(im, 'class');
|
59 |
+
|
60 |
+
if ( cls.indexOf('kadvideo') != -1 )
|
61 |
+
return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
|
62 |
+
|
63 |
+
return a;
|
64 |
+
});
|
65 |
+
},
|
66 |
+
_get_videoend : function(co) {
|
67 |
+
|
68 |
+
function getAttr(s, n) {
|
69 |
+
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
|
70 |
+
return n ? tinymce.DOM.decode(n[1]) : '';
|
71 |
+
};
|
72 |
+
|
73 |
+
return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
|
74 |
+
var cls = getAttr(im, 'class');
|
75 |
+
|
76 |
+
if ( cls.indexOf('kadvideoend') != -1 )
|
77 |
+
return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
|
78 |
+
|
79 |
+
return a;
|
80 |
+
});
|
81 |
+
},
|
82 |
+
getInfo : function() {
|
83 |
+
return {
|
84 |
+
longname : 'Insert video',
|
85 |
+
author : 'Benjamin Ritner',
|
86 |
+
authorurl : 'http://kadencethemes.com',
|
87 |
+
infourl : 'http://kadencethemes.com',
|
88 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
89 |
+
};
|
90 |
+
}
|
91 |
+
});
|
92 |
+
|
93 |
+
// Register plugin
|
94 |
+
// first parameter is the button ID and must match ID elsewhere
|
95 |
+
// second parameter must match the first parameter of the tinymce.create() function above
|
96 |
+
tinymce.PluginManager.add('kadvideo', tinymce.plugins.kadvideo);
|
97 |
+
|
98 |
+
})();
|
trunk/virtue_toolkit.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Virtue ToolKit
|
5 |
+
Description: Custom Portfolio and Shortcode functionality for Virtue Theme
|
6 |
+
Version: 1.4
|
7 |
+
Author: Kadence Themes
|
8 |
+
Author URI: http://kadencethemes.com/
|
9 |
+
License: GPLv2 or later
|
10 |
+
*/
|
11 |
+
function virtue_toolkit_activation() {
|
12 |
+
}
|
13 |
+
register_activation_hook(__FILE__, 'virtue_toolkit_activation');
|
14 |
+
|
15 |
+
function virtue_toolkit_deactivation() {
|
16 |
+
}
|
17 |
+
register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation');
|
18 |
+
|
19 |
+
require_once('post-types.php');
|
20 |
+
require_once('shortcodes.php');
|
21 |
+
require_once('shortcode_ajax.php');
|
22 |
+
|
23 |
+
if(!defined('VIRTUE_TOOLKIT_PATH')){
|
24 |
+
define('VIRTUE_TOOLKIT_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
|
25 |
+
}
|
26 |
+
if(!defined('VIRTUE_TOOLKIT_URL')){
|
27 |
+
define('VIRTUE_TOOLKIT_URL', plugin_dir_url(__FILE__) );
|
28 |
+
}
|